netmodule boards: Adapt devicetree path to match kernel 5.10

With kernel upgrade to 5.10 the paths of all nodees have changed because
of the way the ti drivers are handled.

These paths must therefore be adaped in u-boot in order to stay
compatible.

This means that u-boot versions before this commit are not 100%
compatible with kernel 5.10, but they should usually be able to boot.

Also after this change, older kernel will not work 100% but should still
boot.

BugzID: 77112
This commit is contained in:
Alexandre Bard 2021-12-15 19:14:45 +01:00
parent 2fa18965e6
commit 4832ca022a
4 changed files with 23 additions and 28 deletions

View File

@ -1304,13 +1304,13 @@ static void ft_dio(void *blob)
ft_enable_node(blob, "/netbox_dio_2in_1out");
/* OEM Linux gpios -> remove IOs not present */
ft_set_gpio_name(blob, "/ocp/gpio@44e07000", 27, ""); /* gpio0_27: IO_OUT1n */
ft_set_gpio_name(blob, "/ocp/gpio@4804c000", 14, ""); /* gpio1_14: IO_IN2 */
ft_set_gpio_name(blob, "/ocp/gpio@4804c000", 15, ""); /* gpio1_15: IO_IN3 */
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@7000/gpio@0", 27, ""); /* gpio0_27: IO_OUT1n */
ft_set_gpio_name(blob, "/ocp/interconnect@48000000/segment@0/target-module@4c000/gpio@0", 14, ""); /* gpio1_14: IO_IN2 */
ft_set_gpio_name(blob, "/ocp/interconnect@48000000/segment@0/target-module@4c000/gpio@0", 15, ""); /* gpio1_15: IO_IN3 */
/* pmic_gpios: 5: IO_IN2_WAKE3n, 6: IO_IN2_WAKE3n */
ft_set_gpio_name(blob, "/ocp/i2c@44e0b000/da9063@58/gpio", 5, "");
ft_set_gpio_name(blob, "/ocp/i2c@44e0b000/da9063@58/gpio", 6, "");
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/da9063@58/gpio", 5, "");
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/da9063@58/gpio", 6, "");
break;
default:
@ -1321,13 +1321,12 @@ static void ft_dio(void *blob)
static void ft_tty(void *blob)
{
if (hw_has_tty) {
/* TODO: Should use alias uart5 */
ft_enable_node(blob, "/ocp/serial@481aa000");
ft_enable_node(blob, "serial5");
}
else {
/* OEM Linux gpios -> remove IOs not present */
ft_set_gpio_name(blob, "/ocp/gpio@44e07000", 22, ""); /* gpio0_22: SEL_RS232_RS485n */
ft_set_gpio_name(blob, "/ocp/gpio@44e07000", 23, ""); /* gpio0_23: RS485_TERM_ENn */
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@7000/gpio@0", 22, ""); /* gpio0_22: SEL_RS232_RS485n */
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@7000/gpio@0", 23, ""); /* gpio0_23: RS485_TERM_ENn */
}
}

View File

@ -2123,7 +2123,7 @@ static void ft_user_interface(void *blob)
if (ui_hw_version == 1) {
int node_offset;
node_offset = fdt_path_offset(blob, "/ocp/i2c@4802a000/pca9539@74/");
node_offset = fdt_path_offset(blob, "/ocp/interconnect@48000000/segment@0/target-module@2a000/i2c@0/pca9539@74/");
if (node_offset != -1) {
fdt_setprop_string(blob, node_offset, "status", "okay");
}
@ -2148,7 +2148,7 @@ static void ft_user_interface(void *blob)
else if (ui_hw_version == 2) {
int node_offset;
node_offset = fdt_path_offset(blob, "/ocp/i2c@4802a000/pca9538@70/");
node_offset = fdt_path_offset(blob, "/ocp/interconnect@48000000/segment@0/target-module@2a000/i2c@0/pca9538@70/");
if (node_offset != -1) {
fdt_setprop_string(blob, node_offset, "status", "okay");
}
@ -2206,13 +2206,13 @@ static void ft_eth(void *blob)
if (hw_ver == 1) {
int node_offset;
node_offset = fdt_path_offset(blob, "/ocp/ethernet@4a100000/mdio@4a101000/ethernet-phy@2/");
node_offset = fdt_path_offset(blob, "/ocp/interconnect@4a000000/segment@0/target-module@100000/ethernet@0/mdio@1000/ethernet-phy@2/");
if (node_offset != -1) {
fdt_setprop_u32(blob, node_offset, "<reg>", 7);
fdt_setprop_u32(blob, node_offset, "reg", 7);
}
node_offset = fdt_path_offset(blob, "/ocp/ethernet@4a100000/mdio@4a101000/ethernet-phy@3/");
node_offset = fdt_path_offset(blob, "/ocp/interconnect@4a000000/segment@0/target-module@100000/ethernet@0/mdio@1000/ethernet-phy@2/ethernet-phy@3/");
if (node_offset != -1) {
fdt_setprop_u32(blob, node_offset, "<reg>", 6);
fdt_setprop_u32(blob, node_offset, "reg", 6);

View File

@ -1330,10 +1330,10 @@ end: ;
static void ft_comio_gpios(void *blob)
{
/* gpio0_7: COM/IO relay output */
ft_set_gpio_name(blob, "/ocp/gpio@44e07000", 7, "COMIO_OUT0");
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@7000/gpio@0", 7, "COMIO_OUT0");
/* gpio1_8: COM/IO digital input */
ft_set_gpio_name(blob, "/ocp/gpio@4804c000", 8, "COMIO_IN0");
ft_set_gpio_name(blob, "/ocp/interconnect@48000000/segment@0/target-module@4c000/gpio@0", 8, "COMIO_IN0");
}
static void ft_shields(void* blob)
@ -1345,15 +1345,13 @@ static void ft_shields(void* blob)
case SHIELD_COM_IO:
ft_comio_gpios(blob);
ft_enable_node(blob, "/netbox_dio_comio");
/* TODO: Should use alias serial0 */
ft_enable_node(blob, "/ocp/serial@44e09000");
ft_enable_node(blob, "serial0");
break;
case SHIELD_DUALCAN:
case SHIELD_DUALCAN_PASSIVE:
/* TODO: Should use alias d_can0, d_can1 */
ft_enable_node(blob, "/ocp/can@481cc000");
ft_enable_node(blob, "/ocp/can@481d0000");
ft_enable_node(blob, "d-can0");
ft_enable_node(blob, "d-can1");
break;
default:

View File

@ -1242,10 +1242,10 @@ end: ;
static void ft_comio_gpios(void *blob)
{
/* gpio0_7: COM/IO relay output */
ft_set_gpio_name(blob, "/ocp/gpio@44e07000", 7, "COMIO_OUT0");
ft_set_gpio_name(blob, "/ocp/interconnect@44c00000/segment@200000/target-module@7000/gpio@0", 7, "COMIO_OUT0");
/* gpio1_8: COM/IO digital input */
ft_set_gpio_name(blob, "/ocp/gpio@4804c000", 8, "COMIO_IN0");
ft_set_gpio_name(blob, "/ocp/interconnect@48000000/segment@0/target-module@4c000/gpio@0", 8, "COMIO_IN0");
}
static void ft_shields(void* blob)
@ -1257,15 +1257,13 @@ static void ft_shields(void* blob)
case SHIELD_COM_IO:
ft_comio_gpios(blob);
ft_enable_node(blob, "/netbox_dio_comio");
/* TODO: Should use alias serial0 */
ft_enable_node(blob, "/ocp/serial@44e09000");
ft_enable_node(blob, "serial0");
break;
case SHIELD_DUALCAN:
case SHIELD_DUALCAN_PASSIVE:
/* TODO: Should use alias d_can0, d_can1 */
ft_enable_node(blob, "/ocp/can@481cc000");
ft_enable_node(blob, "/ocp/can@481d0000");
ft_enable_node(blob, "d-can0");
ft_enable_node(blob, "d-can1");
break;
default:
@ -1273,7 +1271,7 @@ static void ft_shields(void* blob)
* Enable uart1 (ttyS0) always as kernel needs it as fallback console,
* if (ttyS1) is not available as console.
*/
ft_enable_node(blob, "/ocp/serial@44e09000");
ft_enable_node(blob, "serial0");
break;
};