hw21/26: support backward compatible DT

This commit is contained in:
Rene Straub 2022-11-11 18:52:59 +01:00
parent a9e615e7ae
commit e1069f6d23
1 changed files with 14 additions and 5 deletions

View File

@ -2094,12 +2094,23 @@ static void ft_enable_node(void* blob, const char* name)
int node_ofs = -1; int node_ofs = -1;
node_ofs = fdt_path_offset(blob, name); node_ofs = fdt_path_offset(blob, name);
printf("ft_enable_node %s -> %d\n", name, node_ofs); // printf("ft_enable_node %s -> %d\n", name, node_ofs);
if (node_ofs >= 0) { if (node_ofs >= 0) {
fdt_setprop_string(blob, node_ofs, "status", "okay"); fdt_setprop_string(blob, node_ofs, "status", "okay");
} }
} }
static void ft_disable_node(void* blob, const char* name)
{
int node_ofs = -1;
node_ofs = fdt_path_offset(blob, name);
// printf("ft_disable_node %s -> %d\n", name, node_ofs);
if (node_ofs >= 0) {
fdt_setprop_string(blob, node_ofs, "status", "disabled");
}
}
/* /*
* Modify the name of a gpio in a gpio-line-names string list. * Modify the name of a gpio in a gpio-line-names string list.
*/ */
@ -2345,13 +2356,11 @@ static void ft_led(void *blob)
* Link from SysState-LED Driver also needs to be adapted * Link from SysState-LED Driver also needs to be adapted
*/ */
if (is_v32_or_newer()) { if (is_v32_or_newer()) {
ft_disable_node(blob, "status_led");
ft_disable_node(blob, "/sysstate-led");
ft_enable_node(blob, "status_led_v32"); ft_enable_node(blob, "status_led_v32");
ft_enable_node(blob, "/sysstate-led-v32"); ft_enable_node(blob, "/sysstate-led-v32");
} }
else {
ft_enable_node(blob, "status_led");
ft_enable_node(blob, "/sysstate-led");
}
} }
int ft_board_setup(void *blob, bd_t *bd) int ft_board_setup(void *blob, bd_t *bd)