From 47f17c451a534cb8a7d7360ea6f97a6c9f6be798 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 20 Dec 2016 10:45:34 +1000 Subject: linux-yocto_4.8: Resolve CONFIG_DEBUG_RODATA for Zynq This patch resolves a previous commit (ea4ca65aaf) which only mitigated the issue caused due to CONFIG_DEBUG_RODATA for Zynq. This issue has been properly fixed in the next version of the kernel (v4.10) and this change backports the patch to the v4.8 kernel for linux-yocto(-tiny). Additionally this change removes the forced disabling of CONFIG_DEBUG_RODATA allowing for Zynq platforms to use the feature without issue. Signed-off-by: Nathan Rossi --- .../config/xilinx-common/bsp/xilinx/soc/zynq7.cfg | 3 -- recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend | 5 +++ recipes-kernel/linux/linux-yocto_4.8.bbappend | 5 +++ ...ynq-Reserve-correct-amount-of-non-DMA-RAM.patch | 39 ++++++++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 recipes-kernel/linux/linux/ARM-zynq-Reserve-correct-amount-of-non-DMA-RAM.patch diff --git a/recipes-kernel/linux/config/xilinx-common/bsp/xilinx/soc/zynq7.cfg b/recipes-kernel/linux/config/xilinx-common/bsp/xilinx/soc/zynq7.cfg index b6dc0dbd..93584875 100644 --- a/recipes-kernel/linux/config/xilinx-common/bsp/xilinx/soc/zynq7.cfg +++ b/recipes-kernel/linux/config/xilinx-common/bsp/xilinx/soc/zynq7.cfg @@ -40,6 +40,3 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_CPU_IDLE=y CONFIG_ARM_ZYNQ_CPUIDLE=y -# DEBUG_RODATA causes issues with the lower 512KB of memory which doesn't do DMA -# CONFIG_DEBUG_RODATA is not set - diff --git a/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend index 651e0d72..a345230b 100644 --- a/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend +++ b/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend @@ -2,3 +2,8 @@ require linux-xilinx-configs.inc require linux-xilinx-machines.inc +FILESEXTRAPATHS_prepend := "${THISDIR}/linux:" +SRC_URI_append = " \ + file://ARM-zynq-Reserve-correct-amount-of-non-DMA-RAM.patch \ + " + diff --git a/recipes-kernel/linux/linux-yocto_4.8.bbappend b/recipes-kernel/linux/linux-yocto_4.8.bbappend index 651e0d72..a345230b 100644 --- a/recipes-kernel/linux/linux-yocto_4.8.bbappend +++ b/recipes-kernel/linux/linux-yocto_4.8.bbappend @@ -2,3 +2,8 @@ require linux-xilinx-configs.inc require linux-xilinx-machines.inc +FILESEXTRAPATHS_prepend := "${THISDIR}/linux:" +SRC_URI_append = " \ + file://ARM-zynq-Reserve-correct-amount-of-non-DMA-RAM.patch \ + " + diff --git a/recipes-kernel/linux/linux/ARM-zynq-Reserve-correct-amount-of-non-DMA-RAM.patch b/recipes-kernel/linux/linux/ARM-zynq-Reserve-correct-amount-of-non-DMA-RAM.patch new file mode 100644 index 00000000..9aa014b7 --- /dev/null +++ b/recipes-kernel/linux/linux/ARM-zynq-Reserve-correct-amount-of-non-DMA-RAM.patch @@ -0,0 +1,39 @@ +From 06305673edf7adc6b035f81f727bdcb18ff6fe9b Mon Sep 17 00:00:00 2001 +From: Kyle Roeschley +Date: Mon, 31 Oct 2016 11:26:17 -0500 +Subject: [PATCH] ARM: zynq: Reserve correct amount of non-DMA RAM + +On Zynq, we haven't been reserving the correct amount of DMA-incapable +RAM to keep DMA away from it (per the Zynq TRM Section 4.1, it should be +the first 512k). In older kernels, this was masked by the +memblock_reserve call in arm_memblock_init(). Now, reserve the correct +amount excplicitly rather than relying on swapper_pg_dir, which is an +address and not a size anyway. + +Fixes: 46f5b96 ("ARM: zynq: Reserve not DMAable space in front of the +kernel") + +Signed-off-by: Kyle Roeschley +Tested-by: Nathan Rossi +Signed-off-by: Michal Simek +Upstream-Status: Backport [from v4.10, 7a3cc2a7b2] +--- + arch/arm/mach-zynq/common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c +index d12002cd63..ed11864831 100644 +--- a/arch/arm/mach-zynq/common.c ++++ b/arch/arm/mach-zynq/common.c +@@ -59,7 +59,7 @@ void __iomem *zynq_scu_base; + static void __init zynq_memory_init(void) + { + if (!__pa(PAGE_OFFSET)) +- memblock_reserve(__pa(PAGE_OFFSET), __pa(swapper_pg_dir)); ++ memblock_reserve(__pa(PAGE_OFFSET), 0x80000); + } + + static struct platform_device zynq_cpuidle_device = { +-- +2.11.0 + -- cgit v1.2.3-54-g00ecf