Skip to content

Commit

Permalink
Revert "MIPS: Octeon: Remove special handling of CONFIG_MIPS_ELF_APPE…
Browse files Browse the repository at this point in the history
…NDED_DTB=y"

commit fe82de9 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
haokexin authored and gregkh committed Mar 4, 2021
1 parent 3f3614b commit 50af0b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arch/mips/cavium-octeon/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,12 +1158,15 @@ void __init device_tree_init(void)
bool do_prune;
bool fill_mac;

if (fw_passed_dtb) {
fdt = (void *)fw_passed_dtb;
#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
if (!fdt_check_header(&__appended_dtb)) {
fdt = &__appended_dtb;
do_prune = false;
fill_mac = true;
pr_info("Using appended Device Tree.\n");
} else if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
} else
#endif
if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
fdt = phys_to_virt(octeon_bootinfo->fdt_addr);
if (fdt_check_header(fdt))
panic("Corrupt Device Tree passed to kernel.");
Expand Down

0 comments on commit 50af0b3

Please sign in to comment.