~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerass El Hafidi <vitali64pmemail@protonmail.com>2023-05-08 19:03:10 +0200
committerFerass El Hafidi <vitali64pmemail@protonmail.com>2023-05-08 19:03:10 +0200
commitf9ed707f171c8069e99e24e24c3da73d8b6f5716 (patch)
tree4da9838d387c8bc260e83f3f51f5dfa83e0b48ae /plat/gxb/efuse.c
downloadamlogic-bl2-master.tar.gz
Push old Amlogic BL2 sourcesHEADmaster
Diffstat (limited to 'plat/gxb/efuse.c')
-rw-r--r--plat/gxb/efuse.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/plat/gxb/efuse.c b/plat/gxb/efuse.c
new file mode 100644
index 0000000..703c1d5
--- /dev/null
+++ b/plat/gxb/efuse.c
@@ -0,0 +1,48 @@
+
+/*
+ * arch/arm/cpu/armv8/common/firmware/plat/gxb/efuse.c
+ *
+ * Copyright (C) 2015 Amlogic, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include <io.h>
+#include <asm/arch/cpu_config.h>
+#include <stdio.h>
+#include <string.h>
+#include <efuse.h>
+
+#define EFUSE_READ_PRINT 0
+
+void efuse_read(uint64_t offset, uint64_t length, const char * buffer){
+ memcpy((void *)buffer, (void *)(P_SHARED_EFUSE_MIRROR+offset), length);
+#if EFUSE_READ_PRINT
+ efuse_print(offset, length, buffer);
+#endif
+}
+
+void efuse_print(uint64_t offset, uint64_t length, const char * buffer){
+ uint32_t loop = 0;
+ serial_puts("Efuse Read:");
+ for (loop=0; loop<length; loop++) {
+ if (0 == (loop % 16))
+ serial_puts("\n");
+ serial_put_hex(buffer[loop], 8);
+ serial_puts(" ");
+ //printf("%2x ", buffer[loop]);
+ }
+ serial_puts("\n");
+} \ No newline at end of file