소스 검색

Support the new JH7110 chip A gmac configuration in linux v6.6+

If gmac_conf_new = 1, apply the new gmac configuration in linux v6.6+.
If gmac_conf_new = 0, apply the old gmac configuration.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Hal Feng 2 달 전
부모
커밋
0bd685d280
3개의 변경된 파일50개의 추가작업 그리고 8개의 파일을 삭제
  1. 2 4
      include/configs/starfive-devkits.h
  2. 11 2
      include/configs/starfive-evb.h
  3. 37 2
      include/configs/starfive-visionfive2.h

+ 2 - 4
include/configs/starfive-devkits.h

@@ -169,13 +169,11 @@
 
 #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"
+	"echo JH7110 Devkits never supports chip A;\0"
 
 #define CHIPA_SET	\
 	"chipa_set="				\
-	"if test ${chip_vision} = B; then "	\
+	"if test ${chip_vision} = A; then "	\
 		"run chipa_gmac_set;"		\
 	"fi; \0"				\
 	"chipa_set_uboot="			\

+ 11 - 2
include/configs/starfive-evb.h

@@ -177,8 +177,17 @@
 
 #define CHIPA_SET	\
 	"chipa_set="				\
-	"if test ${chip_vision} = B; then "	\
-		"run chipa_gmac_set;"		\
+	"if test ${chip_vision} = B; then "					\
+		"fdt get name gmac1_subnode_name /soc/ethernet@16040000 0;"	\
+		"if test ${gmac1_subnode_name} = mdio; then "			\
+			"setenv gmac_conf_new 1;"				\
+		"else "								\
+			"setenv gmac_conf_new 0;"				\
+		"fi; "								\
+		"setenv gmac1_subnode_name;"					\
+		"if test ${gmac_conf_new} = 0; then "				\
+			"run chipa_gmac_set;"					\
+		"fi; "								\
 	"fi; \0"				\
 	"chipa_set_uboot="			\
 	"fdt addr ${fdtcontroladdr};"		\

+ 37 - 2
include/configs/starfive-visionfive2.h

@@ -180,6 +180,29 @@
 	"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_GMAC_SET_NEW	\
+	"chipa_gmac_set_new="	\
+	"fdt rm /soc/ethernet@16030000 starfive,tx-use-rgmii-clk;"				\
+	"fdt rm /soc/ethernet@16030000 assigned-clocks;"					\
+	"fdt rm /soc/ethernet@16030000 assigned-clock-parents;"					\
+	"fdt rm /soc/ethernet@16030000/mdio/ethernet-phy@0 motorcomm,tx-clk-adj-enabled;"	\
+	"fdt rm /soc/ethernet@16030000/mdio/ethernet-phy@0 motorcomm,tx-clk-100-inverted;"	\
+	"fdt rm /soc/ethernet@16030000/mdio/ethernet-phy@0 motorcomm,tx-clk-1000-inverted;"	\
+	"fdt rm /soc/ethernet@16030000/mdio/ethernet-phy@0 motorcomm,rx-clk-drv-microamp;"	\
+	"fdt rm /soc/ethernet@16030000/mdio/ethernet-phy@0 motorcomm,rx-data-drv-microamp;"	\
+	"fdt set /soc/ethernet@16030000/mdio/ethernet-phy@0 rx-internal-delay-ps <1900>;"	\
+	"fdt set /soc/ethernet@16030000/mdio/ethernet-phy@0 tx-internal-delay-ps <1350>;"	\
+	"fdt rm /soc/ethernet@16040000 starfive,tx-use-rgmii-clk;"				\
+	"fdt set /soc/ethernet@16040000 phy-mode \"rmii\";"					\
+	"fdt set /soc/ethernet@16040000 assigned-clocks <0x00000003 0x00000069 0x00000003 0x00000067>;"	\
+	"fdt set /soc/ethernet@16040000 assigned-clock-parents <0x00000003 0x00000065 0x00000003 0x00000065>;"	\
+	"fdt rm /soc/ethernet@16040000/mdio/ethernet-phy@1 motorcomm,tx-clk-adj-enabled;"	\
+	"fdt rm /soc/ethernet@16040000/mdio/ethernet-phy@1 motorcomm,tx-clk-100-inverted;"	\
+	"fdt rm /soc/ethernet@16040000/mdio/ethernet-phy@1 motorcomm,rx-clk-drv-microamp;"	\
+	"fdt rm /soc/ethernet@16040000/mdio/ethernet-phy@1 motorcomm,rx-data-drv-microamp;"	\
+	"fdt rm /soc/ethernet@16040000/mdio/ethernet-phy@1 rx-internal-delay-ps;"		\
+	"fdt rm /soc/ethernet@16040000/mdio/ethernet-phy@1 tx-internal-delay-ps; \0"
+
 #define VISIONFIVE2_MEM_SET	\
 	"visionfive2_mem_set="	\
 	"fdt memory ${memory_addr} ${memory_size};" \
@@ -187,8 +210,19 @@
 
 #define CHIPA_SET	\
 	"chipa_set="				\
-	"if test ${chip_vision} = A; then "	\
-		"run chipa_gmac_set;"		\
+	"if test ${chip_vision} = A; then "					\
+		"fdt get name gmac1_subnode_name /soc/ethernet@16040000 0;"	\
+		"if test ${gmac1_subnode_name} = mdio; then "			\
+			"setenv gmac_conf_new 1;"				\
+		"else "								\
+			"setenv gmac_conf_new 0;"				\
+		"fi; "								\
+		"setenv gmac1_subnode_name;"					\
+		"if test ${gmac_conf_new} = 0; then "				\
+			"run chipa_gmac_set;"					\
+		"else "								\
+			"run chipa_gmac_set_new;"				\
+		"fi; "								\
 	"fi; \0"				\
 	"chipa_set_uboot="			\
 	"fdt addr ${uboot_fdt_addr};"		\
@@ -326,6 +360,7 @@
 	JH7110_SDK_BOOTENV				\
 	JH7110_DISTRO_BOOTENV				\
 	CHIPA_GMAC_SET					\
+	CHIPA_GMAC_SET_NEW				\
 	CHIPA_SET					\
 	CPU_VOL_1020_SET				\
 	CPU_VOL_1040_SET				\