From 97233ca74a920db0b53232b95ccf2a9bc3b074dd Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Thu, 26 Aug 2021 11:21:52 +0200 Subject: MIPS: kernel: fix alignment of the devicetree buffer Starting with kernel v5.12 we have more strict alignment checking for the devicetree buffers. Fix it by telling the compiler to align fdt_buf properly. Signed-off-by: Oleksij Rempel --- ...ta-fix-alignment-of-the-devicetree-buffer.patch | 34 ++++++++++++++++++++++ configs/platform-mips/patches/linux-5.14/series | 4 +++ ...ta-fix-alignment-of-the-devicetree-buffer.patch | 34 ++++++++++++++++++++++ configs/platform-mipsel/patches/linux-5.14/series | 4 +++ 4 files changed, 76 insertions(+) create mode 100644 configs/platform-mips/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch create mode 100644 configs/platform-mips/patches/linux-5.14/series create mode 100644 configs/platform-mipsel/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch create mode 100644 configs/platform-mipsel/patches/linux-5.14/series (limited to 'configs') diff --git a/configs/platform-mips/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch b/configs/platform-mips/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch new file mode 100644 index 0000000..ebf1030 --- /dev/null +++ b/configs/platform-mips/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch @@ -0,0 +1,34 @@ +From: Oleksij Rempel +Date: Thu, 2 Sep 2021 08:35:37 +0200 +Subject: [PATCH] MIPS: Malta: fix alignment of the devicetree buffer + +Starting with following patch MIPS Malta is not able to boot: +| commit 79edff12060fe7772af08607eff50c0e2486c5ba +| Author: Rob Herring +| scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9 + +The reason is the alignment test added to the fdt_ro_probe_(). To fix +this issue, we need to make sure that fdt_buf is aligned. + +Since the dtc patch was designed to uncover potential issue, I handle +initial MIPS Malta patch as initial bug. + +Fixes: e81a8c7dabac ("MIPS: Malta: Setup RAM regions via DT") +Signed-off-by: Oleksij Rempel +--- + arch/mips/mti-malta/malta-dtshim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/mips/mti-malta/malta-dtshim.c b/arch/mips/mti-malta/malta-dtshim.c +index 0ddf03df6268..f451268f6c38 100644 +--- a/arch/mips/mti-malta/malta-dtshim.c ++++ b/arch/mips/mti-malta/malta-dtshim.c +@@ -22,7 +22,7 @@ + #define ROCIT_CONFIG_GEN1_MEMMAP_SHIFT 8 + #define ROCIT_CONFIG_GEN1_MEMMAP_MASK (0xf << 8) + +-static unsigned char fdt_buf[16 << 10] __initdata; ++static unsigned char fdt_buf[16 << 10] __initdata __aligned(8); + + /* determined physical memory size, not overridden by command line args */ + extern unsigned long physical_memsize; diff --git a/configs/platform-mips/patches/linux-5.14/series b/configs/platform-mips/patches/linux-5.14/series new file mode 100644 index 0000000..b220453 --- /dev/null +++ b/configs/platform-mips/patches/linux-5.14/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch +# 25ed4bdad4900ab6e57594b71c39b60c - git-ptx-patches magic diff --git a/configs/platform-mipsel/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch b/configs/platform-mipsel/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch new file mode 100644 index 0000000..ebf1030 --- /dev/null +++ b/configs/platform-mipsel/patches/linux-5.14/0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch @@ -0,0 +1,34 @@ +From: Oleksij Rempel +Date: Thu, 2 Sep 2021 08:35:37 +0200 +Subject: [PATCH] MIPS: Malta: fix alignment of the devicetree buffer + +Starting with following patch MIPS Malta is not able to boot: +| commit 79edff12060fe7772af08607eff50c0e2486c5ba +| Author: Rob Herring +| scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9 + +The reason is the alignment test added to the fdt_ro_probe_(). To fix +this issue, we need to make sure that fdt_buf is aligned. + +Since the dtc patch was designed to uncover potential issue, I handle +initial MIPS Malta patch as initial bug. + +Fixes: e81a8c7dabac ("MIPS: Malta: Setup RAM regions via DT") +Signed-off-by: Oleksij Rempel +--- + arch/mips/mti-malta/malta-dtshim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/mips/mti-malta/malta-dtshim.c b/arch/mips/mti-malta/malta-dtshim.c +index 0ddf03df6268..f451268f6c38 100644 +--- a/arch/mips/mti-malta/malta-dtshim.c ++++ b/arch/mips/mti-malta/malta-dtshim.c +@@ -22,7 +22,7 @@ + #define ROCIT_CONFIG_GEN1_MEMMAP_SHIFT 8 + #define ROCIT_CONFIG_GEN1_MEMMAP_MASK (0xf << 8) + +-static unsigned char fdt_buf[16 << 10] __initdata; ++static unsigned char fdt_buf[16 << 10] __initdata __aligned(8); + + /* determined physical memory size, not overridden by command line args */ + extern unsigned long physical_memsize; diff --git a/configs/platform-mipsel/patches/linux-5.14/series b/configs/platform-mipsel/patches/linux-5.14/series new file mode 100644 index 0000000..b220453 --- /dev/null +++ b/configs/platform-mipsel/patches/linux-5.14/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-MIPS-Malta-fix-alignment-of-the-devicetree-buffer.patch +# 25ed4bdad4900ab6e57594b71c39b60c - git-ptx-patches magic -- cgit v1.2.3