summaryrefslogtreecommitdiff
path: root/include/configs/starfive-visionfive2.h
diff options
context:
space:
mode:
authorSamin Guo <samin.guo@linux.starfivetech.com>2022-10-15 16:35:53 +0300
committerJianlong Huang <jianlong.huang@starfivetech.com>2022-11-03 11:31:42 +0300
commitd0df544ccec590d8c18ebb9e63a36066af878dd5 (patch)
tree16b77a16d0250fb11fc6554dac36468968a58b0c /include/configs/starfive-visionfive2.h
parent2a54b81bcaf7486aa8f75c04b67fcd809ca3dfa2 (diff)
downloadu-boot-d0df544ccec590d8c18ebb9e63a36066af878dd5.tar.xz
board:starfive:visionfive2: Support using env to detect board version
JH7110A do not need tx_inverted by YT8531 phy, you need to read the chip version to determine whether to use it. Signed-off-by: Samin Guo <samin.guo@linux.starfivetech.com>
Diffstat (limited to 'include/configs/starfive-visionfive2.h')
-rw-r--r--include/configs/starfive-visionfive2.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/configs/starfive-visionfive2.h b/include/configs/starfive-visionfive2.h
index 3146c52321..63bc99d9b3 100644
--- a/include/configs/starfive-visionfive2.h
+++ b/include/configs/starfive-visionfive2.h
@@ -101,6 +101,36 @@
"name=loader2,size=4MB,type=${type_guid_gpt_loader2};" \
"name=system,size=-,bootable,type=${type_guid_gpt_system};"
+#define CHIPA_GMAC_SET \
+ "chipa_gmac_set=" \
+ "fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_10 <0x0>;" \
+ "fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_100 <0x0>;" \
+ "fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_1000 <0x0>;" \
+ "fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_10 <0x0>;" \
+ "fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_100 <0x0>;" \
+ "fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_1000 <0x0>;" \
+ "fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_delay_sel <0x9> \0"
+
+#define CHIPA_SET \
+ "chipa_set=" \
+ "if test ${chip_vision} = A; then " \
+ "run chipa_gmac_set;" \
+ "fi; \0" \
+ "chipa_set_uboot=" \
+ "fdt addr ${uboot_fdt_addr};" \
+ "run chipa_set;\0" \
+ "chipa_set_linux=" \
+ "fdt addr ${fdt_addr_r};" \
+ "run chipa_set;\0"
+
+#define CHIPA_SET_FORCE \
+ "chipa_set_uboot_force=" \
+ "fdt addr ${uboot_fdt_addr};" \
+ "run chipa_gmac_set; \0" \
+ "chipa_set_linux_force=" \
+ "fdt addr ${fdt_addr_r};" \
+ "run chipa_gmac_set; \0" \
+
#define VISIONFIVE2_BOOTENV \
"bootenv=uEnv.txt\0" \
"testenv=vf2_uEnv.txt\0" \
@@ -147,6 +177,9 @@
"pxefile_addr_r=0x88200000\0" \
"ramdisk_addr_r=0x88300000\0" \
VISIONFIVE2_BOOTENV \
+ CHIPA_GMAC_SET \
+ CHIPA_SET \
+ CHIPA_SET_FORCE \
"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \