aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Nowakowski <marcin.nowakowski@fungible.com>2019-05-13 08:32:43 -0400
committerPaul Burton <paul.burton@mips.com>2019-05-13 15:02:47 -0400
commit67eebf7213046e65d8fb1f37f5fd10d5fb71e098 (patch)
tree158ae7ec45da3912e7ccf0927792278e6d88f756
parente6308b6d35ea706c23a589a8c709fa444ff13e17 (diff)
generic: fix appended dtb support
Appended DTB support is mostly intended to be used on legacy systems, but it is a valid feature that can be enabled for generic platform, which currently doesn't support it - if selected, the appended DTB will be ignored by the platform startup code. During kernel startup, the appended DTB's location is stored in fw_passed_dtb if the init code finds what appears to be a valid DTB. Otherwise (if a0 == -2), a1 is stored in fw_passed_dtb, so either way it will always point to either a user-passed DTB or built-in DTB. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@fungible.com> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org
-rw-r--r--arch/mips/generic/init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index a106f8113842..a84475f1924f 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -43,14 +43,14 @@ void __init *plat_get_fdt(void)
43 /* Already set up */ 43 /* Already set up */
44 return (void *)fdt; 44 return (void *)fdt;
45 45
46 if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_arg1)) { 46 if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_passed_dtb)) {
47 /* 47 /*
48 * We booted using the UHI boot protocol, so we have been 48 * We booted using the UHI boot protocol, so we have been
49 * provided with the appropriate device tree for the board. 49 * provided with the appropriate device tree for the board.
50 * Make use of it & search for any machine struct based upon 50 * Make use of it & search for any machine struct based upon
51 * the root compatible string. 51 * the root compatible string.
52 */ 52 */
53 fdt = (void *)fw_arg1; 53 fdt = (void *)fw_passed_dtb;
54 54
55 for_each_mips_machine(check_mach) { 55 for_each_mips_machine(check_mach) {
56 match = mips_machine_is_compatible(check_mach, fdt); 56 match = mips_machine_is_compatible(check_mach, fdt);