Commit 2296cecf authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Ralf Baechle

MIPS: Octeon: device_tree_init: fill mac addresses when using appended dtb

Fill MAC addresses from bootinfo when using appended DTB.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: default avatarDavid Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12590/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 377de399
...@@ -1118,11 +1118,13 @@ void __init device_tree_init(void) ...@@ -1118,11 +1118,13 @@ void __init device_tree_init(void)
{ {
const void *fdt; const void *fdt;
bool do_prune; bool do_prune;
bool fill_mac;
#ifdef CONFIG_MIPS_ELF_APPENDED_DTB #ifdef CONFIG_MIPS_ELF_APPENDED_DTB
if (!fdt_check_header(&__appended_dtb)) { if (!fdt_check_header(&__appended_dtb)) {
fdt = &__appended_dtb; fdt = &__appended_dtb;
do_prune = false; do_prune = false;
fill_mac = true;
pr_info("Using appended Device Tree.\n"); pr_info("Using appended Device Tree.\n");
} else } else
#endif #endif
...@@ -1131,22 +1133,26 @@ void __init device_tree_init(void) ...@@ -1131,22 +1133,26 @@ void __init device_tree_init(void)
if (fdt_check_header(fdt)) if (fdt_check_header(fdt))
panic("Corrupt Device Tree passed to kernel."); panic("Corrupt Device Tree passed to kernel.");
do_prune = false; do_prune = false;
fill_mac = false;
pr_info("Using passed Device Tree.\n"); pr_info("Using passed Device Tree.\n");
} else if (OCTEON_IS_MODEL(OCTEON_CN68XX)) { } else if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
fdt = &__dtb_octeon_68xx_begin; fdt = &__dtb_octeon_68xx_begin;
do_prune = true; do_prune = true;
fill_mac = true;
} else { } else {
fdt = &__dtb_octeon_3xxx_begin; fdt = &__dtb_octeon_3xxx_begin;
do_prune = true; do_prune = true;
fill_mac = true;
} }
initial_boot_params = (void *)fdt; initial_boot_params = (void *)fdt;
if (do_prune) { if (do_prune) {
octeon_prune_device_tree(); octeon_prune_device_tree();
octeon_fill_mac_addresses();
pr_info("Using internal Device Tree.\n"); pr_info("Using internal Device Tree.\n");
} }
if (fill_mac)
octeon_fill_mac_addresses();
unflatten_and_copy_device_tree(); unflatten_and_copy_device_tree();
init_octeon_system_type(); init_octeon_system_type();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment