summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamin Guo <samin.guo@starfivetech.com>2022-11-01 11:26:21 +0300
committerSamin Guo <samin.guo@starfivetech.com>2022-11-01 13:54:21 +0300
commitca91f535d48d02088ed4b5ad78eb343c0325b8c9 (patch)
tree132f1f71b8be86754db8622d4f17f32ed26b51ce
parent0dbe3fb0be546f2be7adaee6baf6d550fbba4e26 (diff)
downloadu-boot-ca91f535d48d02088ed4b5ad78eb343c0325b8c9.tar.xz
board:starfive:evb: Support using env to detect board version
JH7110B need tx_inverted by YT8521 phy, you need to read the chip version to determine whether to use it. Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
-rw-r--r--configs/starfive_evb_defconfig2
-rw-r--r--include/configs/starfive-evb.h20
2 files changed, 22 insertions, 0 deletions
diff --git a/configs/starfive_evb_defconfig b/configs/starfive_evb_defconfig
index 613548407e..fe08ef22d0 100644
--- a/configs/starfive_evb_defconfig
+++ b/configs/starfive_evb_defconfig
@@ -27,6 +27,8 @@ CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyS0,115200 debug rootwait earlycon=sbi "
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="fatload mmc 0:3 $kernel_addr_r jh7110_uEnv.txt; env import -t $kernel_addr_r $filesize;run boot2"
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="run chipa_set_uboot"
CONFIG_LOG_MAX_LEVEL=4
CONFIG_SPL_LOG=y
CONFIG_DISPLAY_CPUINFO=y
diff --git a/include/configs/starfive-evb.h b/include/configs/starfive-evb.h
index dfb3c3bf57..2fb7ec1bbc 100644
--- a/include/configs/starfive-evb.h
+++ b/include/configs/starfive-evb.h
@@ -98,6 +98,24 @@
#define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985"
#define TYPE_GUID_SYSTEM "0FC63DAF-8483-4772-8E79-3D69D8477DE4"
+#define CHIPA_GMAC_SET \
+ "chipa_gmac_set=" \
+ "fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_10 <0x1>;" \
+ "fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_100 <0x1>;" \
+ "fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_1000 <0x1>;\0"
+
+#define CHIPA_SET \
+ "chipa_set=" \
+ "if test ${chip_vision} = B; then " \
+ "run chipa_gmac_set;" \
+ "fi; \0" \
+ "chipa_set_uboot=" \
+ "fdt addr ${fdtcontroladdr};" \
+ "run chipa_set;\0" \
+ "chipa_set_linux=" \
+ "fdt addr ${fdt_addr_r};" \
+ "run chipa_set;\0"
+
#define PARTS_DEFAULT \
"name=loader1,start=17K,size=1M,type=${type_guid_gpt_loader1};" \
"name=loader2,size=4MB,type=${type_guid_gpt_loader2};" \
@@ -113,6 +131,8 @@
"script_size_f=0x1000\0" \
"pxefile_addr_r=0x88200000\0" \
"ramdisk_addr_r=0x88300000\0" \
+ CHIPA_GMAC_SET \
+ CHIPA_SET \
"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \