fdt_support: Add fdt_delete_disabled_nodes() and use in Turris MOX
Move Turris MOX specific remove_disabled_nodes() to fdt_support with name fdt_delete_disabled_nodes(), so that others can potentially use it. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
08370038df
commit
574506c327
@ -749,24 +749,6 @@ static int setup_switch(void *blob, int id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int remove_disabled_nodes(void *blob)
|
|
||||||
{
|
|
||||||
while (1) {
|
|
||||||
int res, offset;
|
|
||||||
|
|
||||||
offset = fdt_node_offset_by_prop_value(blob, -1, "status",
|
|
||||||
"disabled", 9);
|
|
||||||
if (offset < 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
res = fdt_del_node(blob, offset);
|
|
||||||
if (res < 0)
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ft_board_setup(void *blob, struct bd_info *bd)
|
int ft_board_setup(void *blob, struct bd_info *bd)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
@ -872,7 +854,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
|||||||
fdt_fixup_ethernet(blob);
|
fdt_fixup_ethernet(blob);
|
||||||
|
|
||||||
/* Finally remove disabled nodes, as per Rob Herring's request. */
|
/* Finally remove disabled nodes, as per Rob Herring's request. */
|
||||||
remove_disabled_nodes(blob);
|
fdt_delete_disabled_nodes(blob);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -695,6 +695,29 @@ int fdt_shrink_to_minimum(void *blob, uint extrasize)
|
|||||||
return actualsize;
|
return actualsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fdt_delete_disabled_nodes: Delete all nodes with status == "disabled"
|
||||||
|
*
|
||||||
|
* @blob: ptr to device tree
|
||||||
|
*/
|
||||||
|
int fdt_delete_disabled_nodes(void *blob)
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
int ret, offset;
|
||||||
|
|
||||||
|
offset = fdt_node_offset_by_prop_value(blob, -1, "status",
|
||||||
|
"disabled", 9);
|
||||||
|
if (offset < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
ret = fdt_del_node(blob, offset);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
#define CONFIG_SYS_PCI_NR_INBOUND_WIN 4
|
#define CONFIG_SYS_PCI_NR_INBOUND_WIN 4
|
||||||
|
|
||||||
|
@ -228,6 +228,8 @@ void set_working_fdt_addr(ulong addr);
|
|||||||
int fdt_shrink_to_minimum(void *blob, uint extrasize);
|
int fdt_shrink_to_minimum(void *blob, uint extrasize);
|
||||||
int fdt_increase_size(void *fdt, int add_len);
|
int fdt_increase_size(void *fdt, int add_len);
|
||||||
|
|
||||||
|
int fdt_delete_disabled_nodes(void *blob);
|
||||||
|
|
||||||
int fdt_fixup_nor_flash_size(void *blob);
|
int fdt_fixup_nor_flash_size(void *blob);
|
||||||
|
|
||||||
struct node_info;
|
struct node_info;
|
||||||
|
Loading…
Reference in New Issue
Block a user