summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWei Fu <wefu@redhat.com>2021-12-28 11:44:18 +0300
committersom.qin <som.qin@starfivetech.com>2021-12-30 08:38:04 +0300
commitc204ddb84b3c956ce5ad13cfb4486d9bd598194c (patch)
treea6a22fc49b15b23ac022e6975e22c7e45fa6d17b /include
parent26e56a202d6af54a19c2bc97ef1ab5b8804b3f54 (diff)
downloadu-boot-c204ddb84b3c956ce5ad13cfb4486d9bd598194c.tar.xz
starfive: add ID_EEPROM supoort for visionfive V1
This patch add ID_EEPROM (mac command) support for visionfive V1. Signed-off-by: Wei Fu <wefu@redhat.com>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/configs/starfive-jh7100.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/configs/starfive-jh7100.h b/include/configs/starfive-jh7100.h
index 71c311eaaf..e97f0f5fdd 100755
--- a/include/configs/starfive-jh7100.h
+++ b/include/configs/starfive-jh7100.h
@@ -100,4 +100,41 @@
#define CONFIG_CQSPI_REF_CLK (250000000)
#endif
+#ifdef CONFIG_ID_EEPROM /* EEPROM for SN and MAC */
+#define CONFIG_SYS_EEPROM_BUS_NUM 0
+
+#define FORMAT_VERSION 0x1
+#define PCB_VERSION 0x1
+#define BOM_VERSION 'A'
+/*
+ * BYTES_PER_EEPROM_PAGE: the 24FC04H datasheet says that data can
+ * only be written in page mode, which means 16 bytes at a time:
+ * 16-Byte Page Write Buffer
+ */
+#define BYTES_PER_EEPROM_PAGE 16
+
+/*
+ * EEPROM_WRITE_DELAY_MS: the 24FC04H datasheet says it takes up to
+ * 5ms to complete a given write:
+ * Write Cycle Time (byte or page) ro Page Write Time 5 ms, Maximum
+ */
+#define EEPROM_WRITE_DELAY_MS 5000
+/*
+ * StarFive OUI. Registration Date is 20xx-xx-xx
+ */
+#define STARFIVE_OUI_PREFIX "6C:CF:39:"
+#define STARFIVE_DEFAULT_MAC {0x6C, 0xCF, 0x39, 0x08, 0x08, 0x08}
+
+/* Magic number at the first four bytes of EEPROM HATs */
+#define STARFIVE_EEPROM_HATS_SIG "SFVF" /* StarFive VisionFive */
+
+#define CONFIG_STARFIVE_EEPROM_HATS_SIZE_MAX 128 /* Header + Atom1&4(v1) */
+#define CONFIG_STARFIVE_EEPROM_WP_OFFSET 256 /* Read only field */
+#define CONFIG_STARFIVE_EEPROM_ATOM1_PSTR "VF7100A1-2201-D008E000-00000001\0"
+#define CONFIG_STARFIVE_EEPROM_ATOM1_PSTR_SIZE 32
+#define CONFIG_STARFIVE_EEPROM_ATOM1_SN_OFFSET 23
+#define CONFIG_STARFIVE_EEPROM_ATOM1_VSTR "StarFive Technology Co., Ltd.\0\0\0"
+#define CONFIG_STARFIVE_EEPROM_ATOM1_VSTR_SIZE 32
+#endif
+
#endif /* __CONFIG_H */