From 74d00a8c3849c1340efd713eb94b786e304c201f Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 25 Dec 2016 20:11:34 +0100 Subject: kernel: split patches folder up into backport, pending and hack folders * properly format/comment all patches * merge debloat patches * merge Kconfig patches * merge swconfig patches * merge hotplug patches * drop 200-fix_localversion.patch - upstream * drop 222-arm_zimage_none.patch - unused * drop 252-mv_cesa_depends.patch - no longer required * drop 410-mtd-move-forward-declaration-of-struct-mtd_info.patch - unused * drop 661-fq_codel_keep_dropped_stats.patch - outdated * drop 702-phy_add_aneg_done_function.patch - upstream * drop 840-rtc7301.patch - unused * drop 841-rtc_pt7c4338.patch - upstream * drop 921-use_preinit_as_init.patch - unused * drop spio-gpio-old and gpio-mmc - unused Signed-off-by: John Crispin --- ...re-the-appended-dtb-address-in-a-variable.patch | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch (limited to 'target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch') diff --git a/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch b/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch new file mode 100644 index 0000000000..764c1cb830 --- /dev/null +++ b/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch @@ -0,0 +1,132 @@ +From 15f37e1588920e010f20b53f04af94e91b8ee714 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 20 Jun 2016 11:27:37 +0200 +Subject: [PATCH] MIPS: store the appended dtb address in a variable + +Instead of rewriting the arguments to match the UHI spec, store the +address of a appended or UHI supplied dtb in fw_supplied_dtb. + +That way the original bootloader arugments are kept intact while still +making the use of an appended dtb invisible for mach code. + +Mach code can still find out if it is an appended dtb by comparing +fw_arg1 with fw_supplied_dtb. + +Signed-off-by: Jonas Gorski +Cc: Kevin Cernekee +Cc: Florian Fainelli +Cc: John Crispin +Cc: Paul Burton +Cc: James Hogan +Cc: Alban Bedel +Cc: Daniel Gimpelevich +Cc: Antony Pavlov +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/13699/ +Signed-off-by: Ralf Baechle +--- + arch/mips/ath79/setup.c | 4 ++-- + arch/mips/bmips/setup.c | 4 ++-- + arch/mips/include/asm/bootinfo.h | 4 ++++ + arch/mips/kernel/head.S | 21 ++++++++++++++------- + arch/mips/kernel/setup.c | 4 ++++ + arch/mips/lantiq/prom.c | 4 ++-- + arch/mips/pic32/pic32mzda/init.c | 4 ++-- + 7 files changed, 30 insertions(+), 15 deletions(-) + +--- a/arch/mips/ath79/setup.c ++++ b/arch/mips/ath79/setup.c +@@ -207,6 +207,8 @@ void __init plat_mem_setup(void) + fdt_start = fw_getenvl("fdt_start"); + if (fdt_start) + __dt_setup_arch((void *)KSEG0ADDR(fdt_start)); ++ else if (fw_passed_dtb) ++ __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb)); + #ifdef CONFIG_BUILTIN_DTB + else + __dt_setup_arch(__dtb_start); +--- a/arch/mips/bmips/setup.c ++++ b/arch/mips/bmips/setup.c +@@ -149,8 +149,8 @@ void __init plat_mem_setup(void) + /* intended to somewhat resemble ARM; see Documentation/arm/Booting */ + if (fw_arg0 == 0 && fw_arg1 == 0xffffffff) + dtb = phys_to_virt(fw_arg2); +- else if (fw_arg0 == -2) /* UHI interface */ +- dtb = (void *)fw_arg1; ++ else if (fw_passed_dtb) /* UHI interface */ ++ dtb = (void *)fw_passed_dtb; + else if (__dtb_start != __dtb_end) + dtb = (void *)__dtb_start; + else +--- a/arch/mips/include/asm/bootinfo.h ++++ b/arch/mips/include/asm/bootinfo.h +@@ -127,6 +127,10 @@ extern char arcs_cmdline[COMMAND_LINE_SI + */ + extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; + ++#ifdef CONFIG_USE_OF ++extern unsigned long fw_passed_dtb; ++#endif ++ + /* + * Platform memory detection hook called by setup_arch + */ +--- a/arch/mips/kernel/head.S ++++ b/arch/mips/kernel/head.S +@@ -94,21 +94,24 @@ NESTED(kernel_entry, 16, sp) # kernel + jr t0 + 0: + ++#ifdef CONFIG_USE_OF + #ifdef CONFIG_MIPS_RAW_APPENDED_DTB +- PTR_LA t0, __appended_dtb ++ PTR_LA t2, __appended_dtb + + #ifdef CONFIG_CPU_BIG_ENDIAN + li t1, 0xd00dfeed + #else + li t1, 0xedfe0dd0 + #endif +- lw t2, (t0) +- bne t1, t2, not_found +- nop +- +- move a1, t0 +- PTR_LI a0, -2 +-not_found: ++ lw t0, (t2) ++ beq t0, t1, dtb_found ++#endif ++ li t1, -2 ++ beq a0, t1, dtb_found ++ move t2, a1 ++ ++ li t2, 0 ++dtb_found: + #endif + PTR_LA t0, __bss_start # clear .bss + LONG_S zero, (t0) +@@ -123,6 +126,10 @@ not_found: + LONG_S a2, fw_arg2 + LONG_S a3, fw_arg3 + ++#ifdef CONFIG_USE_OF ++ LONG_S t2, fw_passed_dtb ++#endif ++ + MTC0 zero, CP0_CONTEXT # clear context register + PTR_LA $28, init_thread_union + /* Set the SP after an empty pt_regs. */ +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -814,6 +814,10 @@ void __init setup_arch(char **cmdline_p) + unsigned long kernelsp[NR_CPUS]; + unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; + ++#ifdef CONFIG_USE_OF ++unsigned long fw_passed_dtb; ++#endif ++ + #ifdef CONFIG_DEBUG_FS + struct dentry *mips_debugfs_dir; + static int __init debugfs_mips(void) -- cgit v1.2.3