Skip to content

Commit a5dffc8

Browse files
Modify rockpis devtree overlay bus priority
Signed-off-by: Stephen <stephen@vamrs.com>
1 parent bc4e3e6 commit a5dffc8

File tree

1 file changed

+54
-31
lines changed

1 file changed

+54
-31
lines changed

cmd/pxe.c

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -988,71 +988,94 @@ static void handle_hw_conf(cmd_tbl_t *cmdtp, struct fdt_header *working_fdt, str
988988
set_hw_property(working_fdt, "/i2c@ff060000", "status", "disabled", 9);
989989
}
990990

991-
//priority: i2c0 > uart1 > spi2 > uart2
992-
if(hw_conf->i2c0 == VALUE_ON)
991+
//priority: uart1 > spi2 > uart2,i2c0
992+
if(hw_conf->uart1 == VALUE_ON)
993993
{
994-
set_hw_property(working_fdt, "/i2c@ff040000", "status", "okay", 5);
995-
set_hw_property(working_fdt, "/serial@ff120000", "status", "disabled", 9);
994+
set_hw_property(working_fdt, "/serial@ff0b0000", "status", "okay", 5);
996995
set_hw_property(working_fdt, "/spi@ff140000", "status", "disabled", 9);
997996
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
997+
set_hw_property(working_fdt, "/i2c@ff040000", "status", "disabled", 9);
998998
}
999-
else if(hw_conf->i2c0 == VALUE_OFF && hw_conf->uart1 == VALUE_ON)
999+
else if(hw_conf->uart1 == VALUE_OFF && hw_conf->spi2 == VALUE_ON)
10001000
{
1001-
set_hw_property(working_fdt, "/i2c@ff040000", "status", "okay", 5);
1002-
set_hw_property(working_fdt, "/serial@ff120000", "status", "disabled", 9);
1003-
set_hw_property(working_fdt, "/spi@ff140000", "status", "disabled", 9);
1004-
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
1005-
}
1006-
else if(hw_conf->i2c0 == VALUE_OFF && hw_conf->uart1 == VALUE_OFF
1007-
&& hw_conf->spi2 == VALUE_ON)
1008-
{
1009-
set_hw_property(working_fdt, "/i2c@ff040000", "status", "okay", 5);
1010-
set_hw_property(working_fdt, "/serial@ff120000", "status", "disabled", 9);
1011-
set_hw_property(working_fdt, "/spi@ff140000", "status", "disabled", 9);
1001+
set_hw_property(working_fdt, "/serial@ff0b0000", "status", "disabled", 9);
1002+
set_hw_property(working_fdt, "/spi@ff140000", "status", "okay", 5);
10121003
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
1004+
set_hw_property(working_fdt, "/i2c@ff040000", "status", "disabled", 9);
10131005
}
1014-
else if(hw_conf->i2c0 == VALUE_OFF && hw_conf->uart1 == VALUE_OFF
1015-
&& hw_conf->spi2 == VALUE_OFF && hw_conf->uart2 == VALUE_ON)
1006+
else if(hw_conf->uart1 == VALUE_OFF && hw_conf->spi2 == VALUE_OFF)
10161007
{
1017-
set_hw_property(working_fdt, "/i2c@ff040000", "status", "okay", 5);
1018-
set_hw_property(working_fdt, "/serial@ff120000", "status", "disabled", 9);
1008+
set_hw_property(working_fdt, "/serial@ff0b0000", "status", "disabled", 9);
10191009
set_hw_property(working_fdt, "/spi@ff140000", "status", "disabled", 9);
1020-
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
1010+
1011+
if(hw_conf->uart2 == VALUE_ON)
1012+
{
1013+
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "okay", 5);
1014+
}
1015+
else if(hw_conf->uart2 == VALUE_OFF)
1016+
{
1017+
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
1018+
}
1019+
else
1020+
{
1021+
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
1022+
}
1023+
1024+
if(hw_conf->i2c0 == VALUE_ON)
1025+
{
1026+
set_hw_property(working_fdt, "/i2c@ff040000", "status", "okay", 5);
1027+
}
1028+
else if(hw_conf->i2c0 == VALUE_OFF)
1029+
{
1030+
set_hw_property(working_fdt, "/i2c@ff040000", "status", "disabled", 9);
1031+
}
1032+
else
1033+
{
1034+
set_hw_property(working_fdt, "/i2c@ff040000", "status", "disabled", 9);
1035+
}
10211036
}
10221037
else
10231038
{
1024-
set_hw_property(working_fdt, "/i2c@ff040000", "status", "disabled", 9);
1025-
set_hw_property(working_fdt, "/serial@ff120000", "status", "disabled", 9);
1039+
set_hw_property(working_fdt, "/serial@ff0b0000", "status", "disabled", 9);
10261040
set_hw_property(working_fdt, "/spi@ff140000", "status", "disabled", 9);
10271041
set_hw_property(working_fdt, "/serial@ff0c0000", "status", "disabled", 9);
1042+
set_hw_property(working_fdt, "/i2c@ff040000", "status", "disabled", 9);
10281043
}
10291044

1030-
//priority: pwm3 > i2c3 > pwm2
1045+
//priority: pwm3 > i2c3
10311046
if(hw_conf->pwm3 == VALUE_ON)
10321047
{
1033-
set_hw_property(working_fdt, "/spi@ff180030", "status", "okay", 5);
1048+
set_hw_property(working_fdt, "/pwm@ff180030", "status", "okay", 5);
10341049
set_hw_property(working_fdt, "/i2c@ff070000", "status", "disabled", 9);
1035-
set_hw_property(working_fdt, "/pwm@ff180020", "status", "disabled", 9);
10361050
}
10371051
else if(hw_conf->pwm3 == VALUE_OFF && hw_conf->i2c3 == VALUE_ON)
10381052
{
1039-
set_hw_property(working_fdt, "/spi@ff180030", "status", "disabled", 9);
1053+
set_hw_property(working_fdt, "/pwm@ff180030", "status", "disabled", 9);
1054+
set_hw_property(working_fdt, "/i2c@ff070000", "status", "okay", 5);
1055+
}
1056+
else
1057+
{
1058+
set_hw_property(working_fdt, "/pwm@ff180030", "status", "disabled", 9);
1059+
set_hw_property(working_fdt, "/i2c@ff070000", "status", "disabled", 9);
1060+
}
1061+
1062+
//priority: i2c3 > pwm2
1063+
if(hw_conf->i2c3 == VALUE_ON)
1064+
{
10401065
set_hw_property(working_fdt, "/i2c@ff070000", "status", "okay", 5);
10411066
set_hw_property(working_fdt, "/pwm@ff180020", "status", "disabled", 9);
10421067
}
1043-
else if(hw_conf->pwm3 == VALUE_OFF && hw_conf->i2c3 == VALUE_OFF
1044-
&& hw_conf->pwm2 == VALUE_ON)
1068+
else if(hw_conf->i2c3 == VALUE_OFF && hw_conf->pwm2 == VALUE_ON)
10451069
{
1046-
set_hw_property(working_fdt, "/spi@ff180030", "status", "disabled", 9);
10471070
set_hw_property(working_fdt, "/i2c@ff070000", "status", "disabled", 9);
10481071
set_hw_property(working_fdt, "/pwm@ff180020", "status", "okay", 5);
10491072
}
10501073
else
10511074
{
1052-
set_hw_property(working_fdt, "/spi@ff180030", "status", "disabled", 9);
10531075
set_hw_property(working_fdt, "/i2c@ff070000", "status", "disabled", 9);
10541076
set_hw_property(working_fdt, "/pwm@ff180020", "status", "disabled", 9);
10551077
}
1078+
10561079
#endif
10571080
}
10581081
#endif

0 commit comments

Comments
 (0)