Skip to content

Commit fe82de9

Browse files
haokexintsbogend
authored andcommitted
Revert "MIPS: Octeon: Remove special handling of CONFIG_MIPS_ELF_APPENDED_DTB=y"
This reverts commit d9df9fb. For the OCTEON boards, it need to patch the built-in DTB before using it. Previously it judges if it is a built-in DTB by checking fw_passed_dtb. But after commit 37e5c69 ("MIPS: head.S: Init fw_passed_dtb to builtin DTB", the fw_passed_dtb is initialized even when using built-in DTB. This causes the OCTEON boards boot broken due to an unpatched built-in DTB is used. Revert the commit d9df9fb to restore the codes before the fw_passed_dtb is used and then fix this issue. Fixed: 37e5c69 ("MIPS: head.S: Init fw_passed_dtb to builtin DTB") Cc: stable@vger.kernel.org Suggested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent d9e84fb commit fe82de9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arch/mips/cavium-octeon/setup.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,12 +1149,15 @@ void __init device_tree_init(void)
11491149
bool do_prune;
11501150
bool fill_mac;
11511151

1152-
if (fw_passed_dtb) {
1153-
fdt = (void *)fw_passed_dtb;
1152+
#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
1153+
if (!fdt_check_header(&__appended_dtb)) {
1154+
fdt = &__appended_dtb;
11541155
do_prune = false;
11551156
fill_mac = true;
11561157
pr_info("Using appended Device Tree.\n");
1157-
} else if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
1158+
} else
1159+
#endif
1160+
if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
11581161
fdt = phys_to_virt(octeon_bootinfo->fdt_addr);
11591162
if (fdt_check_header(fdt))
11601163
panic("Corrupt Device Tree passed to kernel.");

0 commit comments

Comments
 (0)