Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v3 PATCH 19/25] ARM: sa11x0: assabet: add dependency on MMU
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

Building for NOMMU configuration leads to following error:

arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/assabet.c: In function 'map_sa1100_gpio_regs':
arch/arm/mach-sa1100/assabet.c:496:38: error: 'PMD_MASK' undeclared (first use in this function)
  unsigned long phys = __PREG(GPLR) & PMD_MASK;
                                      ^
arch/arm/mach-sa1100/assabet.c:496:38: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./include/linux/list.h:7:0,
                 from ./include/linux/module.h:9,
                 from arch/arm/mach-sa1100/assabet.c:14:
./arch/arm/include/asm/pgtable-2level-hwdef.h:22:29: error: 'pmdval_t' undeclared (first use in this function)
 #define PMD_TYPE_SECT  (_AT(pmdval_t, 2) << 0)
                             ^
./include/uapi/linux/const.h:21:20: note: in definition of macro '_AT'
 #define _AT(T,X) ((T)(X))
                    ^
arch/arm/mach-sa1100/assabet.c:498:13: note: in expansion of macro 'PMD_TYPE_SECT'
  int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
             ^
arch/arm/mach-sa1100/assabet.c:503:2: error: implicit declaration of function 'flush_pmd_entry' [-Werror=implicit-function-declaration]
  flush_pmd_entry(pmd);
  ^
arch/arm/mach-sa1100/assabet.c:497:16: warning: unused variable 'virt' [-Wunused-variable]
  unsigned long virt = (unsigned long)io_p2v(phys);
                ^
arch/arm/mach-sa1100/assabet.c: At top level:
arch/arm/mach-sa1100/assabet.c:620:24: warning: 'assabet_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc assabet_io_desc[] __initdata = {
                        ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-sa1100/assabet.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [arch/arm/mach-sa1100] Error 2
make: *** Waiting for unfinished jobs....

The code there performs the manual selection of page flags which makes
it dependant on MMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mach-sa1100/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 36e3c79..af8cd56 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -4,6 +4,7 @@ menu "SA11x0 Implementations"
 
 config SA1100_ASSABET
 	bool "Assabet"
+	depends on MMU
 	select ARM_SA1110_CPUFREQ
 	help
 	  Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 18/25] ARM: sa1100: move CPU specific copy code under its own config
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

By now there is no way to limit sa1100 specific copy code to MMU only
builds and that leads to the following error when built for NOMMU

arch/arm/mm/copypage-v4mc.c:26:35: error: 'L_PTE_PRESENT' undeclared (first use in this function)
 #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
                                   ^
./arch/arm/include/asm/page-nommu.h:41:26: note: in definition of macro '__pgprot'
 #define __pgprot(x)     (x)
                          ^
arch/arm/mm/copypage-v4mc.c:77:47: note: in expansion of macro 'minicache_pgprot'
  set_top_pte(COPYPAGE_MINICACHE, mk_pte(from, minicache_pgprot));
                                               ^
arch/arm/mm/copypage-v4mc.c:26:51: error: 'L_PTE_YOUNG' undeclared (first use in this function)
 #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
                                                   ^
./arch/arm/include/asm/page-nommu.h:41:26: note: in definition of macro '__pgprot'
 #define __pgprot(x)     (x)
                          ^
arch/arm/mm/copypage-v4mc.c:77:47: note: in expansion of macro 'minicache_pgprot'
  set_top_pte(COPYPAGE_MINICACHE, mk_pte(from, minicache_pgprot));
                                               ^
arch/arm/mm/copypage-v4mc.c:27:7: error: 'L_PTE_MT_MINICACHE' undeclared (first use in this function)
       L_PTE_MT_MINICACHE)
       ^
./arch/arm/include/asm/page-nommu.h:41:26: note: in definition of macro '__pgprot'
 #define __pgprot(x)     (x)
                          ^
arch/arm/mm/copypage-v4mc.c:77:47: note: in expansion of macro 'minicache_pgprot'
  set_top_pte(COPYPAGE_MINICACHE, mk_pte(from, minicache_pgprot));
                                               ^
arch/arm/mm/copypage-v4mc.c: At top level:
arch/arm/mm/copypage-v4mc.c:112:8: error: variable 'v4_mc_user_fns' has initializer but incomplete type
 struct cpu_user_fns v4_mc_user_fns __initdata = {
        ^
arch/arm/mm/copypage-v4mc.c:113:2: error: unknown field 'cpu_clear_user_highpage' specified in initializer
  .cpu_clear_user_highpage = v4_mc_clear_user_highpage,
  ^
arch/arm/mm/copypage-v4mc.c:113:2: warning: excess elements in struct initializer
arch/arm/mm/copypage-v4mc.c:113:2: warning: (near initialization for 'v4_mc_user_fns')
arch/arm/mm/copypage-v4mc.c:114:2: error: unknown field 'cpu_copy_user_highpage' specified in initializer
  .cpu_copy_user_highpage = v4_mc_copy_user_highpage,
  ^
arch/arm/mm/copypage-v4mc.c:114:2: warning: excess elements in struct initializer
arch/arm/mm/copypage-v4mc.c:114:2: warning: (near initialization for 'v4_mc_user_fns')
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mm/copypage-v4mc.o] Error 1
make: *** [arch/arm/mm] Error 2

Move that code under CPU_COPY_V4MC config option which we can guard
against NOMMU configuration.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/page.h |    2 +-
 arch/arm/mm/Kconfig         |    4 ++++
 arch/arm/mm/Makefile        |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index 4355f0e..6ec7bb6 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -75,7 +75,7 @@
 # endif
 #endif
 
-#ifdef CONFIG_CPU_SA1100
+#ifdef CONFIG_CPU_COPY_V4MC
 # ifdef _USER
 #  define MULTI_USER 1
 # else
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c1799dd..6dffbe4 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -290,6 +290,7 @@ config CPU_SA1100
 	select CPU_ABRT_EV4
 	select CPU_CACHE_V4WB
 	select CPU_CACHE_VIVT
+	select CPU_COPY_V4MC if MMU
 	select CPU_CP15_MMU
 	select CPU_PABRT_LEGACY
 	select CPU_TLB_V4WB if MMU
@@ -524,6 +525,9 @@ config CPU_CACHE_V7M
 
 if MMU
 # The copy-page model
+config CPU_COPY_V4MC
+	bool
+
 config CPU_COPY_V4WT
 	bool
 
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index e869824..2ac7988 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -53,7 +53,7 @@ obj-$(CONFIG_CPU_COPY_V4WT)	+= copypage-v4wt.o
 obj-$(CONFIG_CPU_COPY_V4WB)	+= copypage-v4wb.o
 obj-$(CONFIG_CPU_COPY_FEROCEON)	+= copypage-feroceon.o
 obj-$(CONFIG_CPU_COPY_V6)	+= copypage-v6.o context.o
-obj-$(CONFIG_CPU_SA1100)	+= copypage-v4mc.o
+obj-$(CONFIG_CPU_COPY_V4MC)	+= copypage-v4mc.o
 obj-$(CONFIG_CPU_XSCALE)	+= copypage-xscale.o
 obj-$(CONFIG_CPU_XSC3)		+= copypage-xsc3.o
 obj-$(CONFIG_CPU_COPY_FA)	+= copypage-fa.o
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 17/25] ARM: omap: do not select HIGHMEM explicitly
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

Explicit selection of HIGHMEM breaks NOMMU builds. It seems that
HIGHMEM is user selectable option, so probably it would be better to
let user to make a decision on this options or, at least, move it to
defconfig.

Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 0465338..daddddc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -121,7 +121,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	bool "Typical OMAP configuration"
 	default y
 	select AEABI
-	select HIGHMEM
 	select I2C
 	select I2C_OMAP
 	select MENELAUS if ARCH_OMAP2
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 16/25] ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

Building in NOMMU configurations lead to the following splat:

warning: (ARCH_INTEGRATOR && ARCH_MULTIPLATFORM && ARCH_EP93XX) selects ARM_PATCH_PHYS_VIRT which has unmet direct dependencies (!XIP_KERNEL && MMU)

Make sure ARM_PATCH_PHYS_VIRT is selected for MMU builds only.

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 90c91de..b3fa6e9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -380,7 +380,7 @@ config ARCH_EP93XX
 	bool "EP93xx-based"
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARM_AMBA
-	select ARM_PATCH_PHYS_VIRT
+	select ARM_PATCH_PHYS_VIRT if MMU
 	select ARM_VIC
 	select AUTO_ZRELADDR
 	select CLKDEV_LOOKUP
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 15/25] ARM: kexec: disallow kexec for NOMMU builds
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While building for NOMMU the following error shows up:

kernel/built-in.o: In function `kimage_free_entry':
memremap.c:(.text+0x4dafc): undefined reference to `arch_phys_to_idmap_offset'
memremap.c:(.text+0x4db04): undefined reference to `arch_phys_to_idmap_offset'
kernel/built-in.o: In function `kimage_alloc_page':
memremap.c:(.text+0x4dbc0): undefined reference to `arch_phys_to_idmap_offset'
memremap.c:(.text+0x4dbc8): undefined reference to `arch_phys_to_idmap_offset'
memremap.c:(.text+0x4dc1c): undefined reference to `arch_phys_to_idmap_offset'

That comes from Kexec, add dependency on MMU there.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b5d529f..90c91de 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2019,7 +2019,7 @@ config XIP_PHYS_ADDR
 config KEXEC
 	bool "Kexec system call (EXPERIMENTAL)"
 	depends on (!SMP || PM_SLEEP_SMP)
-	depends on !CPU_V7M
+	depends on MMU
 	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 14/25] ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While building for NOMMU link time error shows up:

arch/arm/kernel/built-in.o: In function `setup_arch':
arch/arm/kernel/smccc-call.o:(.init.text+0xa50): undefined reference to `erratum_a15_798181_init'

It happens because erratum_a15_798181_init() lives under smp_tlb.c
which is build only for MMU configurations. So do call this function
only if build with CONFIG_MMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/setup.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 34e3f3c..2254396 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -717,9 +717,9 @@ static void __init setup_processor(void)
 #endif
 #ifdef CONFIG_MMU
 	init_default_cache_policy(list->__cpu_mm_mmu_flags);
-#endif
-	erratum_a15_798181_init();
 
+	erratum_a15_798181_init();
+#endif
 	elf_hwcap_fixup();
 
 	cacheid_init();
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 13/25] ARM: sleep: allow it to be build for R-class
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

cpu_resume_arm was guarded with CONFIG_MMU in 2678bb9fa13 (ARM: fix
EFM32 build breakage caused by cpu_resume_arm) in response to broken
build for EFM32 platform which has M-class cpu. It turned out that
this dependency on MMU is quite strict and prevent R-class from being
built.

The root cause of build breakage for M-class is that there is no ARM
instructions supported there. So instead of limiting cpu_resume_arm to
MMU only build, lets handle M-class case properly - keep in Thumb mode
and fall through to cpu_resume.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/sleep.S |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 0f6c100..41b512d 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -119,7 +119,10 @@ ENDPROC(cpu_resume_after_mmu)
 	.text
 	.align
 
-#ifdef CONFIG_MMU
+#ifdef CONFIG_CPU_THUMBONLY
+	.thumb
+ENTRY(cpu_resume_arm)
+#else
 	.arm
 ENTRY(cpu_resume_arm)
  THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
@@ -159,10 +162,7 @@ THUMB(	ldmia	r0!, {r1, r2, r3}	)
 THUMB(	mov	sp, r2			)
 THUMB(	bx	r3			)
 ENDPROC(cpu_resume)
-
-#ifdef CONFIG_MMU
 ENDPROC(cpu_resume_arm)
-#endif
 
 	.align 2
 _sleep_save_sp:
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 12/25] ARM: tlbflush: drop dependency on CONFIG_SMP
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While building NOMMU and UP following errors show up:

arch/arm/mach-mvebu/pmsu.c: In function 'armada_370_xp_pmsu_idle_enter':
arch/arm/mach-mvebu/pmsu.c:291:2: error: implicit declaration of function 'local_flush_tlb_all' [-Werror=implicit-function-declaration]
  local_flush_tlb_all();
  ^
  CC      arch/arm/mach-omap2/control.o
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-mvebu/pmsu.o] Error 1

...

arch/arm/mach-imx/pm-imx5.c: In function 'mx5_suspend_enter':
arch/arm/mach-imx/pm-imx5.c:227:3: error: implicit declaration of function 'local_flush_tlb_all' [-Werror=implicit-function-declaration]
   local_flush_tlb_all();
   ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-imx/pm-imx5.o] Error 1

...

arch/arm/mach-imx/pm-imx6.c: In function 'imx6q_suspend_finish':
arch/arm/mach-imx/pm-imx6.c:354:3: error: implicit declaration of function 'local_flush_tlb_all' [-Werror=implicit-function-declaration]
   local_flush_tlb_all();
   ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-imx/pm-imx6.o] Error 1

Make local_* stuff available for UP (even though it doesn't make
sense) so build can progress.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/tlbflush.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index def9e57..d9a6e2e 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -641,7 +641,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
 
 #endif
 
-#elif defined(CONFIG_SMP)	/* !CONFIG_MMU */
+#else /* !CONFIG_MMU */
 
 #ifndef __ASSEMBLY__
 
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 11/25] ARM: move arm_heavy_mb to MMU/noMMU neutral place
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

So it can be referenced from both camps.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mm/flush.c |   15 ---------------
 arch/arm/mm/iomap.c |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 3cced84..0c73969 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -21,21 +21,6 @@
 
 #include "mm.h"
 
-#ifdef CONFIG_ARM_HEAVY_MB
-void (*soc_mb)(void);
-
-void arm_heavy_mb(void)
-{
-#ifdef CONFIG_OUTER_CACHE_SYNC
-	if (outer_cache.sync)
-		outer_cache.sync();
-#endif
-	if (soc_mb)
-		soc_mb();
-}
-EXPORT_SYMBOL(arm_heavy_mb);
-#endif
-
 #ifdef CONFIG_CPU_CACHE_VIPT
 
 static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c
index 4614208..1b601db 100644
--- a/arch/arm/mm/iomap.c
+++ b/arch/arm/mm/iomap.c
@@ -9,6 +9,8 @@
 #include <linux/ioport.h>
 #include <linux/io.h>
 
+#include <asm/outercache.h>
+
 unsigned long vga_base;
 EXPORT_SYMBOL(vga_base);
 
@@ -40,3 +42,18 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 }
 EXPORT_SYMBOL(pci_iounmap);
 #endif
+
+#ifdef CONFIG_ARM_HEAVY_MB
+void (*soc_mb)(void);
+
+void arm_heavy_mb(void)
+{
+#ifdef CONFIG_OUTER_CACHE_SYNC
+	if (outer_cache.sync)
+		outer_cache.sync();
+#endif
+	if (soc_mb)
+		soc_mb();
+}
+EXPORT_SYMBOL(arm_heavy_mb);
+#endif
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 10/25] ARM: NOMMU: implement secondary_startup_arm
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

Mediatek's and Qualcomm's platform code has reference to
secondary_startup_arm and that breaks NOMMU build.

Since head-nommu.S is common, we need to take extra care of M-class
platforms since there are no ARM instructions avaliable there. Even
though secondary_startup_arm is build it in SMP configuration only
(which is not supported by M-class) it'd be better to be on the safe
side and handle Thumb-only case there - keep in Thumb mode and fall
through to secondary_startup.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index ae80c71..f5bb554 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -88,7 +88,17 @@ ENTRY(stext)
 ENDPROC(stext)
 
 #ifdef CONFIG_SMP
-	.text
+#ifdef CONFIG_CPU_THUMBONLY
+	.thumb
+ENTRY(secondary_startup_arm)
+#else
+	.arm
+ENTRY(secondary_startup_arm)
+	THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
+	THUMB(	bx	r9		)	@ If this is a Thumb-2 kernel,
+	THUMB(	.thumb			)	@ switch to Thumb now.
+	THUMB(1:			)
+#endif
 ENTRY(secondary_startup)
 	/*
 	 * Common entry point for secondary CPUs.
@@ -126,6 +136,7 @@ ENTRY(secondary_startup)
 	mov	fp, #0
 	b	secondary_start_kernel
 ENDPROC(secondary_startup)
+ENDPROC(secondary_startup_arm)
 
 	.type	__secondary_data, %object
 __secondary_data:
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 09/25] ARM: NOMMU: fix load of CONFIG_VECTORS_BASE
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While running randconfig with NOMMU enabled following error shows up:

arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:265: Error: invalid constant (ffffffffffff0000) after fixup
make[1]: *** [arch/arm/kernel/head-nommu.o] Error 1

That happens because CONFIG_VECTORS_BASE it is out of range of the mov
instruction. So use ldr pseudo instruction instead and let assembler
to figure out how to deal with that.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 7317554..ae80c71 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -251,7 +251,7 @@ ENTRY(__setup_mpu)
 	set_region_nr r0, #MPU_VECTORS_REGION
 	isb
 	/* Shared, inaccessible to PL0, rw PL1 */
-	mov	r0, #CONFIG_VECTORS_BASE	@ Cover from VECTORS_BASE
+	ldr	r0, =CONFIG_VECTORS_BASE	@ Cover from VECTORS_BASE
 	ldr	r5,=(MPU_AP_PL1RW_PL0NA | MPU_RGN_NORMAL)
 	/* Writing N to bits 5:1 (RSR_SZ) --> region size 2^N+1 */
 	mov	r6, #(((2 * PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN)
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 08/25] ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While building for pre-ARMv7 CPUs with ARM_MPU enabled following error
shows up:

  AS      arch/arm/kernel/head-nommu.o
arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:223: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:231: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:235: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:244: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:248: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:258: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:265: Error: selected processor does not support ARM mode `isb'
make[1]: *** [arch/arm/kernel/head-nommu.o] Error 1

MPU setup code is available for ARMv7 only, but head-nommu.S is
generic, so build head-nommu.S with -march=armv7-a (and armv7-m for
M-calss to avoid "Conflicting architecture profiles M/A" link time)
flag; in case pre-ARMv7 it detects there there is no MPU is avaliable,
so it will never reach those instructions.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/Makefile |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index ad325a8..6da8b04 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -84,6 +84,11 @@ endif
 obj-$(CONFIG_PARAVIRT)	+= paravirt.o
 
 head-y			:= head$(MMUEXT).o
+ifeq ($(CONFIG_CPU_V7M),y)
+AFLAGS_head-nommu.o     :=-Wa,-march=armv7-m
+else
+AFLAGS_head-nommu.o     :=-Wa,-march=armv7-a
+endif
 obj-$(CONFIG_DEBUG_LL)	+= debug.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 07/25] ARM: NOMMU: relax restriction on MPU existence
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

MPU is must have if we run SMP configurations (since it sets Sharable
attribute), but for UP we can progress further if MPU is not presented.

This patch changes setup_mpu to return error code which we ignore for
boot cpu and only take into account for secondaries.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 6b4eb27..7317554 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -13,6 +13,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 #include <asm/assembler.h>
 #include <asm/ptrace.h>
@@ -112,6 +113,8 @@ ENTRY(secondary_startup)
 	/* Use MPU region info supplied by __cpu_up */
 	ldr	r6, [r7]			@ get secondary_data.mpu_szr
 	bl      __setup_mpu			@ Initialize the MPU
+	teq	r0, #0
+	bne     __error_p
 #endif
 
 	badr	lr, 1f				@ return (PIC) address
@@ -201,7 +204,8 @@ ENDPROC(__after_proc_init)
  * Region 3: Normal, shared, inaccessible from PL0 to protect the vectors page
  *
  * r6: Value to be written to DRSR (and IRSR if required) for MPU_RAM_REGION
-*/
+ * r0: non zero value indicates error
+ */
 
 ENTRY(__setup_mpu)
 
@@ -209,13 +213,13 @@ ENTRY(__setup_mpu)
 	mrc	p15, 0, r0, c0, c1, 4		@ Read ID_MMFR0
 	and	r0, r0, #(MMFR0_PMSA)		@ PMSA field
 	teq	r0, #(MMFR0_PMSAv7)		@ PMSA v7
-	bne	__error_p			@ Fail: ARM_MPU on NOT v7 PMSA
+	bne	__nompu
 
 	/* Determine whether the D/I-side memory map is unified. We set the
 	 * flags here and continue to use them for the rest of this function */
 	mrc	p15, 0, r0, c0, c0, 4		@ MPUIR
 	ands	r5, r0, #MPUIR_DREGION_SZMASK	@ 0 size d region => No MPU
-	beq	__error_p			@ Fail: ARM_MPU and no MPU
+	beq	__nompu
 	tst	r0, #MPUIR_nU			@ MPUIR_nU = 0 for unified
 
 	/* Setup second region first to free up r6 */
@@ -263,6 +267,11 @@ ENTRY(__setup_mpu)
 	orr	r0, r0, #CR_M			@ Set SCTRL.M (MPU on)
 	mcr	p15, 0, r0, c1, c0, 0		@ Enable MPU
 	isb
+
+	mov	r0, #0
+	ret	lr
+__nompu:
+	mov	r0, #-ENODEV
 	ret	lr
 ENDPROC(__setup_mpu)
 #endif
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 06/25] ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

Define __arm_ioremap_exec and pci_ioremap* functions fallowing pattern
for other ioremap functions.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mm/nommu.c |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 2740967..681cec8 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -19,6 +19,7 @@
 #include <asm/cputype.h>
 #include <asm/mpu.h>
 #include <asm/procinfo.h>
+#include <asm/mach/map.h>
 
 #include "mm.h"
 
@@ -401,3 +402,37 @@ void iounmap(volatile void __iomem *addr)
 {
 }
 EXPORT_SYMBOL(iounmap);
+
+void __iomem *
+__arm_ioremap_exec(phys_addr_t phys_addr, size_t size, bool cached)
+{
+	unsigned int mtype;
+
+	if (cached)
+		mtype = MT_MEMORY_RWX;
+	else
+		mtype = MT_MEMORY_RWX_NONCACHED;
+
+	return __arm_ioremap_caller(phys_addr, size, mtype,
+			__builtin_return_address(0));
+}
+
+#ifdef CONFIG_PCI
+static int pci_ioremap_mem_type = MT_DEVICE;
+
+void pci_ioremap_set_mem_type(int mem_type)
+{
+	pci_ioremap_mem_type = mem_type;
+}
+
+int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
+{
+	BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
+
+	return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
+				  PCI_IO_VIRT_BASE + offset + SZ_64K,
+				  phys_addr,
+				  MT_DEVICE);
+}
+EXPORT_SYMBOL_GPL(pci_ioremap_io);
+#endif
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 05/25] ARM: NOMMU: define dummy user structure for feroceon
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While building for NOMMU the following link time error shows up:

arch/arm/mm/built-in.o:(.proc.info.init+0x2c): undefined reference to `feroceon_user_fns'
arch/arm/mm/built-in.o:(.proc.info.init+0x60): undefined reference to `feroceon_user_fns'
arch/arm/mm/built-in.o:(.proc.info.init+0x94): undefined reference to `feroceon_user_fns'
arch/arm/mm/built-in.o:(.proc.info.init+0xc8): undefined reference to `feroceon_user_fns'

Define dummy feroceon_user_fns for !MMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/pgtable-nommu.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index 9115801..bc1f6aa 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -113,6 +113,7 @@
 #define v4wt_user_fns	(0)
 #define v6_user_fns	(0)
 #define xscale_mc_user_fns (0)
+#define feroceon_user_fns (0)
 
 #endif /*__ASSEMBLY__*/
 
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 04/25] ARM: NOMMU: define SECTION_xxx macros
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

SECTION_SIZE is referenced from several places which breaks NOMMU
build:

  CC      arch/arm/kernel/setup.o
arch/arm/kernel/setup.c: In function 'reserve_crashkernel':
arch/arm/kernel/setup.c:1001:25: error: 'SECTION_SIZE' undeclared (first use in this function)
             crash_size, SECTION_SIZE);
                         ^
arch/arm/kernel/setup.c:1001:25: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [arch/arm/kernel/setup.o] Error 1
make: *** [arch/arm/kernel] Error 2

...

In file included from ./include/linux/cache.h:4:0,
                 from ./include/linux/printk.h:8,
                 from ./include/linux/kernel.h:13,
                 from arch/arm/mach-omap2/omap-secure.c:15:
arch/arm/mach-omap2/omap-secure.c: In function 'omap_secure_ram_reserve_memblock':
arch/arm/mach-omap2/omap-secure.c:65:21: error: 'SECTION_SIZE' undeclared (first use in this function)
  size = ALIGN(size, SECTION_SIZE);
                     ^
./include/uapi/linux/kernel.h:10:47: note: in definition of macro '__ALIGN_KERNEL_MASK'
 #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
                                               ^
./include/linux/kernel.h:48:22: note: in expansion of macro '__ALIGN_KERNEL'
 #define ALIGN(x, a)  __ALIGN_KERNEL((x), (a))
                      ^
arch/arm/mach-omap2/omap-secure.c:65:9: note: in expansion of macro 'ALIGN'
  size = ALIGN(size, SECTION_SIZE);
         ^
arch/arm/mach-omap2/omap-secure.c:65:21: note: each undeclared identifier is reported only once for each function it appears in
  size = ALIGN(size, SECTION_SIZE);
                     ^
./include/uapi/linux/kernel.h:10:47: note: in definition of macro '__ALIGN_KERNEL_MASK'
 #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
                                               ^
./include/linux/kernel.h:48:22: note: in expansion of macro '__ALIGN_KERNEL'
 #define ALIGN(x, a)  __ALIGN_KERNEL((x), (a))
                      ^
arch/arm/mach-omap2/omap-secure.c:65:9: note: in expansion of macro 'ALIGN'
  size = ALIGN(size, SECTION_SIZE);
         ^
make[1]: *** [arch/arm/mach-omap2/omap-secure.o] Error 1

...

In file included from arch/arm/mach-tegra/io.c:31:0:
arch/arm/mach-tegra/iomap.h:116:22: error: 'SECTION_SIZE' undeclared here (not in a function)
 #define IO_PPSB_SIZE SECTION_SIZE
                      ^
arch/arm/mach-tegra/io.c:37:13: note: in expansion of macro 'IO_PPSB_SIZE'
   .length = IO_PPSB_SIZE,
             ^
arch/arm/mach-tegra/io.c:33:24: warning: 'tegra_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc tegra_io_desc[] __initdata = {
                        ^
make[1]: *** [arch/arm/mach-tegra/io.o] Error 1
make: *** [arch/arm/mach-tegra] Error 2

Pickup defines from pgtable-2level.h to make NOMMU build happy.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/pgtable-nommu.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index add094d..9115801 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -35,6 +35,11 @@
 
 #define PGDIR_SIZE		(1UL << PGDIR_SHIFT)
 #define PGDIR_MASK		(~(PGDIR_SIZE-1))
+
+#define SECTION_SHIFT           20
+#define SECTION_SIZE            (1UL << SECTION_SHIFT)
+#define SECTION_MASK            (~(SECTION_SIZE-1))
+
 /* FIXME */
 
 #define PAGE_NONE	__pgprot(0)
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 03/25] ARM: debug: allow debug_ll_addr for NOMMU
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

While building for NOMMU the following warning shows up:

arch/arm/plat-samsung/pm-debug.c: In function 's3c_pm_uart_base':
arch/arm/plat-samsung/pm-debug.c:61:2: error: implicit declaration of function 'debug_ll_addr' [-Werror=implicit-function-declaration]
  debug_ll_addr(&paddr, &vaddr);
  ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/plat-samsung/pm-debug.o] Error 1

It seems that commit a73b59c51ab2 ("ARM: compile fix for DEBUG_LL=y &&
MMU=n") unnecessary disallows debug_ll_addr from being used for !MMU
configurations. Commit message there has a error description:

arch/arm/kernel/debug.S: Assembler messages:
arch/arm/kernel/debug.S:104: Error: too many positional arguments

In fact, the root reason for that problem is likely that machine
dependent addruart macro took less parameters than debug_ll_addr was
passing. For instance, commit 0e17226f7cd2 ("ARM: SAMSUNG: Fixup
commit 4e6d488af37980d224cbf298224db6173673f362") addresses the
similar issue with the same signs.

So, debug_ll_addr has no anti-dependency on NOMMU, but still needs to
be adjusted for NOMMU case. addruart populates first two arguments
with PA and VA of UART. In case of NOMMU the second parameter doesn't
make sense - modify debug_ll_addr that PA is used where VA is
expected.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/mach/map.h |    1 +
 arch/arm/kernel/debug.S         |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 6b86b9c..8832dbf 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -63,6 +63,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
 #define iotable_init(map,num)	do { } while (0)
 #define vm_reserve_area_early(a,s,c)	do { } while (0)
 #define debug_ll_io_init() do { } while (0)
+extern void debug_ll_addr(unsigned long *paddr, unsigned long *vaddr);
 
 #endif
 
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index ea9646c..681b046 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -100,14 +100,16 @@ ENTRY(printch)
 		b	1b
 ENDPROC(printch)
 
-#ifdef CONFIG_MMU
 ENTRY(debug_ll_addr)
 		addruart r2, r3, ip
 		str	r2, [r0]
+#ifdef CONFIG_MMU
 		str	r3, [r1]
+#else
+		str	r2, [r1]
+#endif
 		ret	lr
 ENDPROC(debug_ll_addr)
-#endif
 
 #else
 
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 02/25] ARM: NOMMU: define debug_ll_io_ini
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

We do not need to do anything in debug_ll_io_init in case of NOMMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/mach/map.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 9b7c328..6b86b9c 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -62,6 +62,8 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
 #else
 #define iotable_init(map,num)	do { } while (0)
 #define vm_reserve_area_early(a,s,c)	do { } while (0)
+#define debug_ll_io_init() do { } while (0)
+
 #endif
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 01/25] ARM: NOMMU: define stubs for fixup
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480691143-19845-1-git-send-email-vladimir.murzin@arm.com>

When build for NOMMU following errors show up:

arch/arm/kernel/patch.c: In function 'patch_map':
arch/arm/kernel/patch.c:39:2: error: implicit declaration of function 'set_fixmap' [-Werror=implicit-function-declaration]
  set_fixmap(fixmap, page_to_phys(page));
  ^
arch/arm/kernel/patch.c:41:2: error: implicit declaration of function '__fix_to_virt' [-Werror=implicit-function-declaration]
  return (void *) (__fix_to_virt(fixmap) + (uintaddr & ~PAGE_MASK));
  ^
arch/arm/kernel/patch.c: In function 'patch_unmap':
arch/arm/kernel/patch.c:47:2: error: implicit declaration of function 'clear_fixmap' [-Werror=implicit-function-declaration]
  clear_fixmap(fixmap);
  ^
cc1: some warnings being treated as errors

Fixup does not make much sense in NOMMU configurations, so provide
stub definitions.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/fixmap.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h
index 5c17d2d..0bfc2e3 100644
--- a/arch/arm/include/asm/fixmap.h
+++ b/arch/arm/include/asm/fixmap.h
@@ -59,6 +59,12 @@ enum fixed_addresses {
 
 #else
 
+#define set_fixmap(idx, phys)
+#define clear_fixmap(idx)
+
+#define __fix_to_virt(x)	(x)
+#define __virt_to_fix(x)	(x)
+
 static inline void early_fixmap_init(void) { }
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

With transition to MULTIPLATFORM we lost capability to build NOMMU
configurations. Maybe not a big deal, but there is still interest in
building NOMMU configuration apart from M-class cores. Basically, I'm
talking about R-class cores which shares a lot with A-class except
MMU; there was little interest to run A-class with MMU disabled (or
1:1 MMU mapping) as well.  By now it is not even possible to build
such configurations without extra patches on top. Another aspect is
that some portion of NOMMU code have been (build) untested for a
while. All these makes it even harder to involve more people in using
NOMMU and build community around that.

This series is trying to make it possible to build NOMMU
configurations. It is done in PATCH 25/25 which allows to select
ARCH_MULTIPLATFORM even for NOMMU. This is controlled with EXPERT
config option. All patches prior 25/25 is an attempt to fix build
failures for NOMMU case. I don't claim they are 100% correct, so I'm
open to suggestion how they can be done in a better way.

It was build tested with allmodconfig and defconfigs [1] with
!MMU. Additionally, I've been running randconfig, so two more patches
have been added compared to RFC v2.
I had to keep following diff on top:

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 40a7c4a..c737124 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -65,7 +65,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
                 */
                register uint64_t x asm ("r2");
 
-               asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base));
+//             asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base));
                buf64[i++] = x;
        }
        i *= 8;

Not sure all cases are fixed yet, so keep running randconfig.

Patches can be pulled from Git tree:

git://linux-arm.org/linux-vm.git (branch: nommu-rfc-v3)

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <linux@armlinux.org.uk>

Thanks!

Vladimir Murzin (25):
  ARM: NOMMU: define stubs for fixup
  ARM: NOMMU: define debug_ll_io_ini
  ARM: debug: allow debug_ll_addr for NOMMU
  ARM: NOMMU: define SECTION_xxx macros
  ARM: NOMMU: define dummy user structure for feroceon
  ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions
  ARM: NOMMU: relax restriction on MPU existence
  ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs
  ARM: NOMMU: fix load of CONFIG_VECTORS_BASE
  ARM: NOMMU: implement secondary_startup_arm
  ARM: move arm_heavy_mb to MMU/noMMU neutral place
  ARM: tlbflush: drop dependency on CONFIG_SMP
  ARM: sleep: allow it to be build for R-class
  ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU
  ARM: kexec: disallow kexec for NOMMU builds
  ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only
  ARM: omap: do not select HIGHMEM explicitly
  ARM: sa1100: move CPU specific copy code under its own config
  ARM: sa11x0: assabet: add dependency on MMU
  ARM: i.MX: remove map_io callback
  PCI: tegra: limit to MMU build only
  IB: add dependency on MMU
  cnic: add dependency on MMU
  scsi: bnx2i: bnx2fc: add dependency on MMU
  ARM: Allow ARCH_MULTIPLATFORM to be selected for NOMMU

 arch/arm/Kconfig                      |   25 +++++++++++++++++++----
 arch/arm/include/asm/fixmap.h         |    6 ++++++
 arch/arm/include/asm/mach/map.h       |    3 +++
 arch/arm/include/asm/page.h           |    2 +-
 arch/arm/include/asm/pgtable-nommu.h  |    6 ++++++
 arch/arm/include/asm/tlbflush.h       |    2 +-
 arch/arm/kernel/Makefile              |    5 +++++
 arch/arm/kernel/debug.S               |    6 ++++--
 arch/arm/kernel/head-nommu.S          |   30 +++++++++++++++++++++++-----
 arch/arm/kernel/setup.c               |    4 ++--
 arch/arm/kernel/sleep.S               |    8 ++++----
 arch/arm/mach-imx/mach-imx1.c         |    1 -
 arch/arm/mach-omap2/Kconfig           |    1 -
 arch/arm/mach-sa1100/Kconfig          |    1 +
 arch/arm/mm/Kconfig                   |    4 ++++
 arch/arm/mm/Makefile                  |    2 +-
 arch/arm/mm/flush.c                   |   15 --------------
 arch/arm/mm/iomap.c                   |   17 ++++++++++++++++
 arch/arm/mm/nommu.c                   |   35 +++++++++++++++++++++++++++++++++
 drivers/infiniband/Kconfig            |    1 +
 drivers/net/ethernet/broadcom/Kconfig |    1 +
 drivers/pci/host/Kconfig              |    2 +-
 drivers/scsi/bnx2fc/Kconfig           |    1 +
 drivers/scsi/bnx2i/Kconfig            |    1 +
 24 files changed, 141 insertions(+), 38 deletions(-)

[1] List of errors/warnings from defconfigs:

acs5k_defconfig
arch/arm/mach-ks8695/cpu.c:37:24: warning: 'ks8695_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ks8695_io_desc[] __initdata = {
                        ^
acs5k_tiny_defconfig
arch/arm/mach-ks8695/cpu.c:37:24: warning: 'ks8695_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ks8695_io_desc[] __initdata = {
                        ^
am200epdkit_defconfig
aspeed_g4_defconfig
aspeed_g5_defconfig
assabet_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
/work/tools/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: no machine record defined
make: *** [vmlinux] Error 1
at91_dt_defconfig
axm55xx_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
badge4_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/badge4.c:295:24: warning: 'badge4_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc badge4_io_desc[] __initdata = {
                        ^
bcm2835_defconfig
cerfcube_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/cerf.c:137:24: warning: 'cerf_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cerf_io_desc[] __initdata = {
                        ^
clps711x_defconfig
cm_x2xx_defconfig
cm_x300_defconfig
cns3420vb_defconfig
arch/arm/mach-cns3xxx/core.c:29:24: warning: 'cns3xxx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cns3xxx_io_desc[] __initdata = {
                        ^
arch/arm/mach-cns3xxx/cns3420vb.c:230:24: warning: 'cns3420_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cns3420_io_desc[] __initdata = {
                        ^
colibri_pxa270_defconfig
colibri_pxa300_defconfig
collie_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/collie.c:403:24: warning: 'collie_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc collie_io_desc[] __initdata = {
                        ^
corgi_defconfig
davinci_all_defconfig
dove_defconfig
arch/arm/mach-dove/common.c:50:24: warning: 'dove_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc dove_io_desc[] __initdata = {
                        ^
ebsa110_defconfig
arch/arm/mach-ebsa110/core.c:72:24: warning: 'ebsa110_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ebsa110_io_desc[] __initdata = {
                        ^
efm32_defconfig
em_x270_defconfig
ep93xx_defconfig
arch/arm/mach-ep93xx/core.c:56:24: warning: 'ep93xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ep93xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-ep93xx/ts72xx.c:32:24: warning: 'ts72xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ts72xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-ep93xx/vision_ep9307.c:51:24: warning: 'vision_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc vision_io_desc[] __initdata = {
                        ^
eseries_pxa_defconfig
exynos_defconfig
arch/arm/mach-exynos/exynos.c:31:24: warning: 'exynos4_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc exynos4_iodesc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
ezx_defconfig
footbridge_defconfig
arch/arm/mach-footbridge/common.c:140:24: warning: 'fb_common_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc fb_common_io_desc[] __initdata = {
                        ^
arch/arm/mach-footbridge/common.c:153:24: warning: 'ebsa285_host_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ebsa285_host_io_desc[] __initdata = {
                        ^
h3600_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/h3xxx.c:274:24: warning: 'h3600_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc h3600_io_desc[] __initdata = {
                        ^
h5000_defconfig
hackkit_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/hackkit.c:64:24: warning: 'hackkit_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc hackkit_io_desc[] __initdata = {
                        ^
hisi_defconfig
arch/arm/mach-hisi/hisilicon.c:31:24: warning: 'hi3620_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc hi3620_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
imote2_defconfig
imx_v4_v5_defconfig
arch/arm/mach-imx/mm-imx21.c:33:24: warning: 'imx21_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx21_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mm-imx27.c:33:24: warning: 'imx27_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx27_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-mx27ads.c:381:24: warning: 'mx27ads_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx27ads_io_desc[] __initdata = {
                        ^
imx_v6_v7_defconfig
arch/arm/mach-imx/mm-imx3.c:119:24: warning: 'mx31_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx31_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mm-imx3.c:216:24: warning: 'mx35_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx35_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
arch/arm/mach-imx/mach-mx31ads.c:542:24: warning: 'mx31ads_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx31ads_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-mx31lite.c:236:24: warning: 'mx31lite_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx31lite_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-kzm_arm11_01.c:262:24: warning: 'kzm_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc kzm_io_desc[] __initdata = {
                        ^
integrator_defconfig
iop13xx_defconfig
iop32x_defconfig
iop33x_defconfig
ixp4xx_defconfig
jornada720_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/jornada720.c:277:24: warning: 'jornada720_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc jornada720_io_desc[] __initdata = {
                        ^
keystone_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
ks8695_defconfig
arch/arm/mach-ks8695/cpu.c:37:24: warning: 'ks8695_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ks8695_io_desc[] __initdata = {
                        ^
lart_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/lart.c:115:24: warning: 'lart_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc lart_io_desc[] __initdata = {
                        ^
lpc18xx_defconfig
lpc32xx_defconfig
arch/arm/mach-lpc32xx/common.c:70:24: warning: 'lpc32xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc lpc32xx_io_desc[] __initdata = {
                        ^
lpd270_defconfig
lubbock_defconfig
magician_defconfig
mainstone_defconfig
mini2440_defconfig
arch/arm/mach-s3c24xx/common.c:155:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c244x.c:49:24: warning: 's3c244x_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c244x_iodesc[] __initdata = {
                        ^
mmp2_defconfig
arch/arm/mach-mmp/common.c:28:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
moxart_defconfig
mps2_defconfig
multi_v4t_defconfig
arch/arm/mach-clps711x/board-dt.c:33:24: warning: 'clps711x_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc clps711x_io_desc __initdata = {
                        ^
multi_v5_defconfig
arch/arm/mach-imx/mm-imx21.c:33:24: warning: 'imx21_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx21_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mm-imx27.c:33:24: warning: 'imx27_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx27_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-mx27ads.c:381:24: warning: 'mx27ads_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx27ads_io_desc[] __initdata = {
                        ^
multi_v7_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
arch/arm/mach-exynos/exynos.c:31:24: warning: 'exynos4_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc exynos4_iodesc[] __initdata = {
                        ^
arch/arm/mach-hisi/hisilicon.c:31:24: warning: 'hi3620_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc hi3620_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:141:24: warning: 'omap34xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap34xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:188:24: warning: 'omapti81xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapti81xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:199:24: warning: 'omapam33xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapam33xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:216:24: warning: 'omap44xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap44xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:239:24: warning: 'omap54xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap54xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:268:24: warning: 'dra7xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc dra7xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-tegra/io.c:33:24: warning: 'tegra_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc tegra_io_desc[] __initdata = {
                        ^
arch/arm/mach-vt8500/vt8500.c:52:24: warning: 'vt8500_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc vt8500_io_desc[] __initdata = {
                        ^
arch/arm/mach-spear/spear13xx.c:60:24: warning: 'spear13xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear13xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-spear/spear1310.c:43:24: warning: 'spear1310_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear1310_io_desc[] __initdata = {
                        ^
mv78xx0_defconfig
mvebu_v5_defconfig
mvebu_v7_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
mxs_defconfig
neponset_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
/work/tools/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: no machine record defined
make: *** [vmlinux] Error 1
netwinder_defconfig
arch/arm/mach-footbridge/common.c:140:24: warning: 'fb_common_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc fb_common_io_desc[] __initdata = {
                        ^
arch/arm/mach-footbridge/common.c:153:24: warning: 'ebsa285_host_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ebsa285_host_io_desc[] __initdata = {
                        ^
In file included from sound/oss/os.h:20:0,
                 from sound/oss/sound_config.h:20,
                 from sound/oss/midibuf.c:21:
sound/oss/midibuf.c: In function 'MIDIbuf_read':
./arch/arm/include/asm/uaccess.h:530:38: warning: 'tmp_data' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __copy_to_user(to, from, n) (memcpy((void __force *)to, from, n), 0)
                                      ^
sound/oss/midibuf.c:316:16: note: 'tmp_data' was declared here
  unsigned char tmp_data;
                ^
netx_defconfig
arch/arm/mach-netx/generic.c:33:24: warning: 'netx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc netx_io_desc[] __initdata = {
                        ^
nhk8815_defconfig
arch/arm/mach-nomadik/cpu-8815.c:86:24: warning: 'cpu8815_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cpu8815_io_desc[] __initdata = {
                        ^
nuc910_defconfig
arch/arm/mach-w90x900/cpu.c:45:24: warning: 'nuc900_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc nuc900_iodesc[] __initdata = {
                        ^
nuc950_defconfig
arch/arm/mach-w90x900/cpu.c:45:24: warning: 'nuc900_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc nuc900_iodesc[] __initdata = {
                        ^
nuc960_defconfig
arch/arm/mach-w90x900/cpu.c:45:24: warning: 'nuc900_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc nuc900_iodesc[] __initdata = {
                        ^
omap1_defconfig
omap2plus_defconfig
arch/arm/mach-omap2/io.c:71:24: warning: 'omap24xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap24xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:87:24: warning: 'omap242x_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap242x_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:111:24: warning: 'omap243x_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap243x_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:141:24: warning: 'omap34xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap34xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:188:24: warning: 'omapti81xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapti81xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:199:24: warning: 'omapam33xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapam33xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:216:24: warning: 'omap44xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap44xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:239:24: warning: 'omap54xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap54xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:268:24: warning: 'dra7xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc dra7xx_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
orion5x_defconfig
palmz72_defconfig
pcm027_defconfig
pleb_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
prima2_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
pxa168_defconfig
arch/arm/mach-mmp/common.c:28:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
pxa255-idp_defconfig
pxa3xx_defconfig
pxa910_defconfig
arch/arm/mach-mmp/common.c:28:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
pxa_defconfig
qcom_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
raumfeld_defconfig
realview_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
rpc_defconfig
s3c2410_defconfig
arch/arm/mach-s3c24xx/common.c:155:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2410.c:54:24: warning: 's3c2410_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2410_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2412.c:64:24: warning: 's3c2412_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2412_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2416.c:69:24: warning: 's3c2416_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2416_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c244x.c:49:24: warning: 's3c244x_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c244x_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2443.c:50:24: warning: 's3c2443_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2443_iodesc[] __initdata = {
                        ^
s3c6400_defconfig
arch/arm/mach-s3c64xx/common.c:106:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
s5pv210_defconfig
sama5_defconfig
shannon_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
shmobile_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
simpad_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/simpad.c:121:24: warning: 'simpad_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc simpad_io_desc[] __initdata = {
                        ^
socfpga_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
spear13xx_defconfig
arch/arm/mach-spear/spear13xx.c:60:24: warning: 'spear13xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear13xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-spear/spear1310.c:43:24: warning: 'spear1310_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear1310_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
spear3xx_defconfig
spear6xx_defconfig
spitz_defconfig
stm32_defconfig
sunxi_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
tct_hammer_defconfig
arch/arm/mach-s3c24xx/common.c:155:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2410.c:54:24: warning: 's3c2410_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2410_iodesc[] __initdata = {
                        ^
tegra_defconfig
arch/arm/mach-tegra/io.c:33:24: warning: 'tegra_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc tegra_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
trizeps4_defconfig
u300_defconfig
u8500_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
versatile_defconfig
vexpress_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
vf610m4_defconfig
viper_defconfig
vt8500_v6_v7_defconfig
arch/arm/mach-vt8500/vt8500.c:52:24: warning: 'vt8500_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc vt8500_io_desc[] __initdata = {
                        ^
xcep_defconfig
zeus_defconfig
zx_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)


-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v3 -next 2/2] ARM: dts: sunxi: add support for Orange Pi Zero board
From: Icenowy Zheng @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161202150513.34691-1-icenowy@aosc.xyz>

Orange Pi Zero is a board that came with the new Allwinner H2+ SoC and a
SDIO Wi-Fi chip by Allwinner (XR819).

Add a device tree file for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
Changes since v2:
- Merged SDIO Wi-Fi patch into it.
- SDIO Wi-Fi: add a ethernet1 alias to it, as it has no internal NVRAM.
- SDIO Wi-Fi: changed pinctrl binding to generic pinconf
- removed all gpio pinctrl nodes
- changed h2plus to h2-plus
Changes since v1:
- Convert to generic pinconf bindings.
- SDIO Wi-Fi: add patch.

Some notes:
- The uart1 and uart2 is available on the unsoldered gpio header.
- The onboard USB connector has its Vbus directly connected to DCIN-5V (the
  power jack)

 arch/arm/boot/dts/Makefile                        |   1 +
 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 159 ++++++++++++++++++++++
 2 files changed, 160 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 6447abc..59f6e86 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -844,6 +844,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 	sun8i-a33-sinlinx-sina33.dtb \
 	sun8i-a83t-allwinner-h8homlet-v2.dtb \
 	sun8i-a83t-cubietruck-plus.dtb \
+	sun8i-h2-plus-orangepi-zero.dtb \
 	sun8i-h3-bananapi-m2-plus.dtb \
 	sun8i-h3-nanopi-neo.dtb \
 	sun8i-h3-orangepi-2.dtb \
diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
new file mode 100644
index 0000000..d18807f
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * Based on sun8i-h3-orangepi-one.dts, which is:
+ *   Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-h3.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+	model = "Xunlong Orange Pi Zero";
+	compatible = "xunlong,orangepi-zero", "allwinner,sun8i-h2-plus";
+
+	aliases {
+		serial0 = &uart0;
+		/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
+		ethernet1 = &xr819;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		pwr_led {
+			label = "orangepi:green:pwr";
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		status_led {
+			label = "orangepi:red:status";
+			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	reg_vcc_wifi: reg_vcc_wifi {
+		compatible = "regulator-fixed";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc-wifi";
+		enable-active-high;
+		gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_a>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+	cd-inverted;
+	status = "okay";
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>;
+	vmmc-supply = <&reg_vcc_wifi>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	/*
+	 * Explicitly define the sdio device, so that we can add an ethernet
+	 * alias for it (which e.g. makes u-boot set a mac-address).
+	 */
+	xr819: sdio_wifi at 1 {
+		reg = <1>;
+	};
+};
+
+&mmc1_pins_a {
+	bias-pull-up;
+};
+
+&ohci1 {
+	status = "okay";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins_a>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>;
+	status = "disabled";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
+	status = "disabled";
+};
+
+&usbphy {
+	/* USB VBUS is always on */
+	status = "okay";
+};
-- 
2.10.2

^ permalink raw reply related

* [PATCH v3 -next 1/2] ARM: sunxi: add support for H2+ SoC
From: Icenowy Zheng @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Allwinner H2+ is a quad-core Cortex-A7 SoC.

It is very like H3, that they share the same SoC ID (0x1680), and H3
memory maps as well as drivers works well on the SoC.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
Changes since v2:
- Changed compatible from allwinner,sun8i-h2plus to allwinner,sun8i-h2-plus.
 Documentation/arm/sunxi/README                  | 4 ++++
 Documentation/devicetree/bindings/arm/sunxi.txt | 1 +
 arch/arm/mach-sunxi/sunxi.c                     | 1 +
 3 files changed, 6 insertions(+)

diff --git a/Documentation/arm/sunxi/README b/Documentation/arm/sunxi/README
index cd02433..1fe4d99c 100644
--- a/Documentation/arm/sunxi/README
+++ b/Documentation/arm/sunxi/README
@@ -63,6 +63,10 @@ SunXi family
         + User Manual
           http://dl.linux-sunxi.org/A33/A33%20user%20manual%20release%201.1.pdf
 
+      - Allwinner H2+ (sun8i)
+        + No document available now, but is known to be working properly with
+          H3 drivers and memory map.
+
       - Allwinner H3 (sun8i)
         + Datasheet
           http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf
diff --git a/Documentation/devicetree/bindings/arm/sunxi.txt b/Documentation/devicetree/bindings/arm/sunxi.txt
index 4d6467c..59b143f 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.txt
+++ b/Documentation/devicetree/bindings/arm/sunxi.txt
@@ -13,6 +13,7 @@ using one of the following compatible strings:
   allwinner,sun8i-a33
   allwinner,sun8i-a83t
   allwinner,sun8i-h3
+  allwinner,sun8i-h2-plus
   allwinner,sun9i-a80
   allwinner,sun50i-a64
   nextthing,gr8
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 2e2bde2..320d2af 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -63,6 +63,7 @@ static const char * const sun8i_board_dt_compat[] = {
 	"allwinner,sun8i-a23",
 	"allwinner,sun8i-a33",
 	"allwinner,sun8i-a83t",
+	"allwinner,sun8i-h2-plus",
 	"allwinner,sun8i-h3",
 	NULL,
 };
-- 
2.10.2

^ permalink raw reply related

* [PATCH] imx_v6_v7_defconfig: enable SPIDEV module
From: Gary Bisson @ 2016-12-02 14:56 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
Hi,

Seems that this configuration is missing, especially since many
device trees are already using "spidev" nodes.

Regards,
Gary
---
 arch/arm/configs/imx_v6_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index cd81bd0..f208ad5 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -192,6 +192,7 @@ CONFIG_I2C_IMX=y
 CONFIG_SPI=y
 CONFIG_SPI_IMX=y
 CONFIG_SPI_FSL_DSPI=y
+CONFIG_SPI_SPIDEV=m
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_MC9S08DZ60=y
 CONFIG_GPIO_PCA953X=y
-- 
2.9.3

^ permalink raw reply related

* [PATCH V6 6/6] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'
From: Sricharan R @ 2016-12-02 14:55 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480690509-13490-1-git-send-email-sricharan@codeaurora.org>

Currently the driver sets all the device transactions privileges
to UNPRIVILEGED, but there are cases where the iommu masters wants
to isolate privileged supervisor and unprivileged user.
So don't override the privileged setting to unprivileged, instead
set it to default as incoming and let it be controlled by the pagetable
settings.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---

[V6] V5 was doing this with a 'revert'[1] patch, which no more
     applies on this code base. So changed the same like this.
     [1] https://patchwork.kernel.org/patch/9250493/

 drivers/iommu/arm-smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index eaa8f44..8bb0eea 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1213,7 +1213,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 			continue;
 
 		s2cr[idx].type = type;
-		s2cr[idx].privcfg = S2CR_PRIVCFG_UNPRIV;
+		s2cr[idx].privcfg = S2CR_PRIVCFG_DEFAULT;
 		s2cr[idx].cbndx = cbndx;
 		arm_smmu_write_s2cr(smmu, idx);
 	}
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related

* [RESEND PATCH V6 5/6] dmaengine: pl330: Make sure microcode is privileged
From: Sricharan R @ 2016-12-02 14:55 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1480690509-13490-1-git-send-email-sricharan@codeaurora.org>

From: Mitchel Humpherys <mitchelh@codeaurora.org>

The PL330 performs privileged instruction fetches.  This can result in
SMMU permission faults on SMMUs that implement the ARMv8 VMSA, which
specifies that mappings that are writeable at one execution level shall
not be executable at any higher-privileged level.  Fix this by using the
DMA_ATTR_PRIVILEGED attribute, which will ensure that the microcode
IOMMU mapping is only accessible to the privileged level.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
---

[V6] No change

 drivers/dma/pl330.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 030fe05..1a8bac2 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1854,14 +1854,16 @@ static int dmac_alloc_resources(struct pl330_dmac *pl330)
 {
 	int chans = pl330->pcfg.num_chan;
 	int ret;
+	unsigned long dma_attrs = DMA_ATTR_PRIVILEGED;
 
 	/*
 	 * Alloc MicroCode buffer for 'chans' Channel threads.
 	 * A channel's buffer offset is (Channel_Id * MCODE_BUFF_PERCHAN)
 	 */
-	pl330->mcode_cpu = dma_alloc_coherent(pl330->ddma.dev,
+	pl330->mcode_cpu = dma_alloc_attrs(pl330->ddma.dev,
 				chans * pl330->mcbufsz,
-				&pl330->mcode_bus, GFP_KERNEL);
+				&pl330->mcode_bus, GFP_KERNEL,
+				dma_attrs);
 	if (!pl330->mcode_cpu) {
 		dev_err(pl330->ddma.dev, "%s:%d Can't allocate memory!\n",
 			__func__, __LINE__);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox