kernel: update kernel 4.4 to version 4.4.30
[openwrt/openwrt.git] / target / linux / lantiq / patches-4.4 / 122-MIPS-store-the-appended-dtb-address-in-a-variable.patch
1 From 15f37e1588920e010f20b53f04af94e91b8ee714 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Mon, 20 Jun 2016 11:27:37 +0200
4 Subject: [PATCH] MIPS: store the appended dtb address in a variable
5
6 Instead of rewriting the arguments to match the UHI spec, store the
7 address of a appended or UHI supplied dtb in fw_supplied_dtb.
8
9 That way the original bootloader arugments are kept intact while still
10 making the use of an appended dtb invisible for mach code.
11
12 Mach code can still find out if it is an appended dtb by comparing
13 fw_arg1 with fw_supplied_dtb.
14
15 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
16 Cc: Kevin Cernekee <cernekee@gmail.com>
17 Cc: Florian Fainelli <f.fainelli@gmail.com>
18 Cc: John Crispin <john@phrozen.org>
19 Cc: Paul Burton <paul.burton@imgtec.com>
20 Cc: James Hogan <james.hogan@imgtec.com>
21 Cc: Alban Bedel <albeu@free.fr>
22 Cc: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
23 Cc: Antony Pavlov <antonynpavlov@gmail.com>
24 Cc: linux-mips@linux-mips.org
25 Patchwork: https://patchwork.linux-mips.org/patch/13699/
26 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
27 ---
28 arch/mips/ath79/setup.c | 4 ++--
29 arch/mips/bmips/setup.c | 4 ++--
30 arch/mips/include/asm/bootinfo.h | 4 ++++
31 arch/mips/kernel/head.S | 21 ++++++++++++++-------
32 arch/mips/kernel/setup.c | 4 ++++
33 arch/mips/lantiq/prom.c | 4 ++--
34 arch/mips/pic32/pic32mzda/init.c | 4 ++--
35 7 files changed, 30 insertions(+), 15 deletions(-)
36
37 --- a/arch/mips/lantiq/prom.c
38 +++ b/arch/mips/lantiq/prom.c
39 @@ -78,8 +78,8 @@ void __init plat_mem_setup(void)
40
41 set_io_port_base((unsigned long) KSEG1);
42
43 - if (fw_arg0 == -2) /* UHI interface */
44 - dtb = (void *)fw_arg1;
45 + if (fw_passed_dtb) /* UHI interface */
46 + dtb = (void *)fw_passed_dtb;
47 else if (__dtb_start != __dtb_end)
48 dtb = (void *)__dtb_start;
49 else