Skip to content

Commit 651d19f

Browse files
aakoskinralfbaechle
authored andcommitted
MIPS: Octeon: Support APPENDED_DTB
Use appended DTB when available. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11115/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 87db537 commit 651d19f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

arch/mips/cavium-octeon/setup.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,18 +1081,27 @@ void __init prom_free_prom_memory(void)
10811081

10821082
int octeon_prune_device_tree(void);
10831083

1084+
extern const char __appended_dtb;
10841085
extern const char __dtb_octeon_3xxx_begin;
10851086
extern const char __dtb_octeon_68xx_begin;
10861087
void __init device_tree_init(void)
10871088
{
10881089
const void *fdt;
10891090
bool do_prune;
10901091

1092+
#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
1093+
if (!fdt_check_header(&__appended_dtb)) {
1094+
fdt = &__appended_dtb;
1095+
do_prune = false;
1096+
pr_info("Using appended Device Tree.\n");
1097+
} else
1098+
#endif
10911099
if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
10921100
fdt = phys_to_virt(octeon_bootinfo->fdt_addr);
10931101
if (fdt_check_header(fdt))
10941102
panic("Corrupt Device Tree passed to kernel.");
10951103
do_prune = false;
1104+
pr_info("Using passed Device Tree.\n");
10961105
} else if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
10971106
fdt = &__dtb_octeon_68xx_begin;
10981107
do_prune = true;
@@ -1106,8 +1115,6 @@ void __init device_tree_init(void)
11061115
if (do_prune) {
11071116
octeon_prune_device_tree();
11081117
pr_info("Using internal Device Tree.\n");
1109-
} else {
1110-
pr_info("Using passed Device Tree.\n");
11111118
}
11121119
unflatten_and_copy_device_tree();
11131120
}

0 commit comments

Comments
 (0)