ipq40xx: copy 5.15 patches and config to 6.1
[openwrt/staging/jow.git] / target / linux / ipq40xx / patches-6.1 / 301-arm-compressed-add-appended-DTB-section.patch
1 From 0843a61d6913bdac8889eb048ed89f7903059787 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Fri, 30 Oct 2020 13:36:31 +0100
4 Subject: [PATCH] arm: compressed: add appended DTB section
5
6 This adds a appended_dtb section to the ARM decompressor
7 linker script.
8
9 This allows using the existing ARM zImage appended DTB support for
10 appending a DTB to the raw ELF kernel.
11
12 Its size is set to 1MB max to match the zImage appended DTB size limit.
13
14 To use it to pass the DTB to the kernel, objcopy is used:
15
16 objcopy --set-section-flags=.appended_dtb=alloc,contents \
17 --update-section=.appended_dtb=<target>.dtb vmlinux
18
19 This is based off the following patch:
20 https://github.com/openwrt/openwrt/commit/c063e27e02a9dcac0e7f5877fb154e58fa3e1a69
21
22 Signed-off-by: Robert Marko <robimarko@gmail.com>
23 ---
24 arch/arm/boot/compressed/vmlinux.lds.S | 9 ++++++++-
25 1 file changed, 8 insertions(+), 1 deletion(-)
26
27 --- a/arch/arm/boot/compressed/vmlinux.lds.S
28 +++ b/arch/arm/boot/compressed/vmlinux.lds.S
29 @@ -103,6 +103,13 @@ SECTIONS
30
31 _edata = .;
32
33 + .appended_dtb : {
34 + /* leave space for appended DTB */
35 + . += 0x100000;
36 + }
37 +
38 + _edata_dtb = .;
39 +
40 /*
41 * The image_end section appears after any additional loadable sections
42 * that the linker may decide to insert in the binary image. Having
43 @@ -140,4 +147,4 @@ SECTIONS
44
45 ARM_ASSERTS
46 }
47 -ASSERT(_edata_real == _edata, "error: zImage file size is incorrect");
48 +ASSERT(_edata_real == _edata_dtb, "error: zImage file size is incorrect");