* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
@ 2013-06-07 10:48 Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 1/3] ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM Jonathan Austin
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 10:48 UTC (permalink / raw)
To: linux-arm-kernel
The original aim of this series was to restore the ability to build a NOMMU
kernel for Versatile Express, something that was lost when we converted
ARCH_VEXPRESS for ARCH_MULTIPLATFORM.
In order to do this, it is necessary to abstract the use of generic headers
from selection of ARCH_MULTIPLATFORM so that the two can be used separately.
This is necessary becuase building a multiplatform kernel for processors
without and MMU doesn't make sense (it is necessary to hardcode certain mem-map
related data) and the versatile express can host NOMMU processors.
This series performs this separation, and then goes on to add a 'dummy'
ARCH_VEXPRESS_NOMMU platform that can be selected as standalone platform.
Patch 2 was sent to the list as an RFC some time ago where it was ACKd, but
alone is not sufficient to solve the problem, hence this follow-up series.
Changes since V1:
- Rebase on to 3.10-rc1: fixup conflict from CONFIG_UNCOMPRESS_INCLUDE-foo
Changes since V2
- Rename ARM_GENERIC_HEADERS to NEED_NO_MACH_HEADERS as suggested/requested by
Rob Herring
Jonathan Austin (3):
ARM: allow platforms to use generic headers without
ARCH_MULTIPLATFORM
ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM
ARM: vexpress-nommu: add a Makefile.boot to restore single-platform
build
arch/arm/Kconfig | 21 +++++++++++++++++++++
arch/arm/Kconfig.debug | 4 ++--
arch/arm/Makefile | 2 +-
arch/arm/include/asm/timex.h | 2 +-
arch/arm/mach-mvebu/Makefile | 2 +-
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-vexpress/Makefile | 2 +-
arch/arm/mach-vexpress/Makefile.boot | 4 ++++
arch/arm/plat-omap/Makefile | 2 +-
arch/arm/plat-orion/Makefile | 2 +-
arch/arm/plat-versatile/Makefile | 2 +-
11 files changed, 35 insertions(+), 10 deletions(-)
create mode 100644 arch/arm/mach-vexpress/Makefile.boot
--
1.7.9.5
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/3] ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM
2013-06-07 10:48 [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Jonathan Austin
@ 2013-06-07 10:48 ` Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 2/3] ARM: nommu: re-enable use of vexpress " Jonathan Austin
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 10:48 UTC (permalink / raw)
To: linux-arm-kernel
Currently the use of generic mach headers is only is controlled by the same
config option as selection of a multiplatform kernel (i.e.
ARCH_MULTIPLATFORM). However, there are cases where it is valid to use the
generic headers but still build a single platform kernel.
One such example is when using the vexpress platform with a core that does
not have an MMU; a multiplatform kernel does not make sense, but use of the
generic headers is required by the vexpress platform since 617276307cd4c
("ARM: vexpress: convert to multi-platform").
This patch untangles these two options by introducing a new
NEED_NO_MACH_HEADERS config option that ARCH_MULTIPLATFORM selects. Other
platforms can now select NEED_NO_MACH_HEADERS independently.
Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
CC: Rob Herring <rob.herring@calxeda.com>
CC: Pawel Moll <pawel.moll@arm.com>
CC: Jason Cooper <jason@lakedaemon.net>
CC: Andrew Lunn <andrew@lunn.ch>
CC: Gregory Clement <gregory.clement@free-electrons.com>
CC: Tony Lindgren <tony@atomide.com>
CC: Stephen Boyd <sboyd@codeaurora.org>
CC: Will Deacon <will.deacon@arm.com>
---
arch/arm/Kconfig | 4 ++++
arch/arm/Kconfig.debug | 4 ++--
arch/arm/Makefile | 2 +-
arch/arm/include/asm/timex.h | 2 +-
arch/arm/mach-mvebu/Makefile | 2 +-
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-vexpress/Makefile | 2 +-
arch/arm/plat-omap/Makefile | 2 +-
arch/arm/plat-orion/Makefile | 2 +-
arch/arm/plat-versatile/Makefile | 2 +-
10 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5543d36..f018924 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -207,6 +207,9 @@ config NEED_RET_TO_USER
config ARCH_MTD_XIP
bool
+config NEED_NO_MACH_HEADERS
+ bool
+
config VECTORS_BASE
hex
default 0xffff0000 if MMU || CPU_HIGH_VECTOR
@@ -296,6 +299,7 @@ config ARCH_MULTIPLATFORM
select MULTI_IRQ_HANDLER
select SPARSE_IRQ
select USE_OF
+ select NEED_NO_MACH_HEADERS
config ARCH_INTEGRATOR
bool "ARM Ltd. Integrator family"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 1d41908..451df97 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -652,13 +652,13 @@ config DEBUG_LL_INCLUDE
config DEBUG_UNCOMPRESS
bool
- default y if ARCH_MULTIPLATFORM && DEBUG_LL && \
+ default y if NEED_NO_MACH_HEADERS && DEBUG_LL && \
!DEBUG_OMAP2PLUS_UART && \
!DEBUG_TEGRA_UART
config UNCOMPRESS_INCLUDE
string
- default "debug/uncompress.h" if ARCH_MULTIPLATFORM
+ default "debug/uncompress.h" if NEED_NO_MACH_HEADERS
default "mach/uncompress.h"
config EARLY_PRINTK
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 3380c4f..72a3765 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -230,7 +230,7 @@ endif
machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y))
-ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
+ifneq ($(CONFIG_NEED_NO_MACH_HEADERS),y)
ifeq ($(KBUILD_SRC),)
KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
else
diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
index 83f2aa8..921c79c 100644
--- a/arch/arm/include/asm/timex.h
+++ b/arch/arm/include/asm/timex.h
@@ -12,7 +12,7 @@
#ifndef _ASMARM_TIMEX_H
#define _ASMARM_TIMEX_H
-#ifdef CONFIG_ARCH_MULTIPLATFORM
+#ifdef CONFIG_NEED_NO_MACH_HEADERS
#define CLOCK_TICK_RATE 1000000
#else
#include <mach/timex.h>
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 2d04f0e..460a53d 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -1,4 +1,4 @@
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
+ccflags-$(CONFIG_NEED_NO_MACH_HEADERS) := -I$(srctree)/$(src)/include \
-I$(srctree)/arch/arm/plat-orion/include
AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 55a9d67..437a238 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
+ccflags-$(CONFIG_NEED_NO_MACH_HEADERS) := -I$(srctree)/$(src)/include \
-I$(srctree)/arch/arm/plat-omap/include
# Common support
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile
index 42703e8..59a9ce2 100644
--- a/arch/arm/mach-vexpress/Makefile
+++ b/arch/arm/mach-vexpress/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for the linux kernel.
#
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
+ccflags-$(CONFIG_NEED_NO_MACH_HEADERS) := -I$(srctree)/$(src)/include \
-I$(srctree)/arch/arm/plat-versatile/include
obj-y := v2m.o
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 3119941..2eb913d 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include
+ccflags-$(CONFIG_NEED_NO_MACH_HEADERS) := -I$(srctree)/arch/arm/plat-omap/include
# Common support
obj-y := sram.o dma.o counter_32k.o
diff --git a/arch/arm/plat-orion/Makefile b/arch/arm/plat-orion/Makefile
index 9433605..9c8f122 100644
--- a/arch/arm/plat-orion/Makefile
+++ b/arch/arm/plat-orion/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for the linux kernel.
#
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
+ccflags-$(CONFIG_NEED_NO_MACH_HEADERS) := -I$(srctree)/$(src)/include
orion-gpio-$(CONFIG_GPIOLIB) += gpio.o
obj-$(CONFIG_PLAT_ORION_LEGACY) += irq.o pcie.o time.o common.o mpp.o
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index f88d448..4369df8 100644
--- a/arch/arm/plat-versatile/Makefile
+++ b/arch/arm/plat-versatile/Makefile
@@ -1,4 +1,4 @@
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
+ccflags-$(CONFIG_NEED_NO_MACH_HEADERS) := -I$(srctree)/$(src)/include
obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o
obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/3] ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM
2013-06-07 10:48 [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 1/3] ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM Jonathan Austin
@ 2013-06-07 10:48 ` Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 3/3] ARM: vexpress-nommu: add a Makefile.boot to restore single-platform build Jonathan Austin
2013-06-07 12:36 ` [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Arnd Bergmann
3 siblings, 0 replies; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 10:48 UTC (permalink / raw)
To: linux-arm-kernel
Since 617276307cd4c ("ARM: vexpress: convert to multi-platform") it has been
impossible to select ARCH_VEXPRESS without ARCH_MULTIPLATFORM.
ARCH_MULTIPLATFORM doesn't make sense for NOMMU targets, not least because
of the need to hard-code the memory map. However, it should still be
possible to run NOMMU kernels on top of the Versatile Express by selecting
it as the only platform.
This patch creates a shim ARCH_VEXPRESS_NOMMU config option in the 'choice'
for "ARM system type" to make this possible again.
Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
CC: Pawel Moll <pawel.moll@arm.com>
---
arch/arm/Kconfig | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f018924..7801b91 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -351,6 +351,23 @@ config ARCH_VERSATILE
help
This enables support for ARM Ltd Versatile board.
+config ARCH_VEXPRESS_NOMMU
+ bool "ARM Ltd. Versatile Express family for NOMMU"
+ depends on !MMU
+ select ARCH_VEXPRESS
+ select SPARSE_IRQ
+ select NEED_NO_MACH_HEADERS
+ help
+ This option enables support for systems using Cortex processor based
+ ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
+ in configurations WITHOUT an MMU. You must boot using a Flattened
+ Device Tree - the traditional ATAGs boot method is not usable with
+ this configuration.
+
+ If your system has an MMU and you want to make use of it, you
+ should instead choose to build a multiplatform kernel and
+ select ARCH_VEXPRESS
+
config ARCH_AT91
bool "Atmel AT91"
select ARCH_REQUIRE_GPIOLIB
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 3/3] ARM: vexpress-nommu: add a Makefile.boot to restore single-platform build
2013-06-07 10:48 [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 1/3] ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 2/3] ARM: nommu: re-enable use of vexpress " Jonathan Austin
@ 2013-06-07 10:48 ` Jonathan Austin
2013-06-07 12:36 ` [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Arnd Bergmann
3 siblings, 0 replies; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 10:48 UTC (permalink / raw)
To: linux-arm-kernel
When a single-platform kernel is built, a machine-specific Makefile.boot is
expected. In the move to a multiplatform kernels this was removed for
vexpress. Assuming AUTO_ZRELADDR is selected and a DT is used, the values
recorded in it are no-longer required. However, the missing file breaks building
of a single platform kernel for vexpress, such as when using vexpress and a
platform without an MMU.
This patch re-instates Makefile.boot for vexpress in single platform
configuration, fixing single-platform build. This change does not affect the
multi-platform kernel.
Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
CC: Pawel Moll <pawel.moll@arm.com>
---
arch/arm/mach-vexpress/Makefile.boot | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 arch/arm/mach-vexpress/Makefile.boot
diff --git a/arch/arm/mach-vexpress/Makefile.boot b/arch/arm/mach-vexpress/Makefile.boot
new file mode 100644
index 0000000..8caa868
--- /dev/null
+++ b/arch/arm/mach-vexpress/Makefile.boot
@@ -0,0 +1,4 @@
+# This is a dummy Makefile.boot for building ARCH_VEXPRESS as a standalone
+# platform as opposed with ARCH_MULTIPLATFORM. It is preferable to use
+# CONFIG_AUTO_ZRELADDR=y and DT but uncomment the line below if you need it.
+# zreladdr-y += 0x00008000
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 10:48 [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Jonathan Austin
` (2 preceding siblings ...)
2013-06-07 10:48 ` [PATCH v3 3/3] ARM: vexpress-nommu: add a Makefile.boot to restore single-platform build Jonathan Austin
@ 2013-06-07 12:36 ` Arnd Bergmann
2013-06-07 13:13 ` Jonathan Austin
3 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2013-06-07 12:36 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 07 June 2013 11:48:28 Jonathan Austin wrote:
> The original aim of this series was to restore the ability to build a NOMMU
> kernel for Versatile Express, something that was lost when we converted
> ARCH_VEXPRESS for ARCH_MULTIPLATFORM.
>
> In order to do this, it is necessary to abstract the use of generic headers
> from selection of ARCH_MULTIPLATFORM so that the two can be used separately.
> This is necessary becuase building a multiplatform kernel for processors
> without and MMU doesn't make sense (it is necessary to hardcode certain mem-map
> related data) and the versatile express can host NOMMU processors.
>
> This series performs this separation, and then goes on to add a 'dummy'
> ARCH_VEXPRESS_NOMMU platform that can be selected as standalone platform.
>
> Patch 2 was sent to the list as an RFC some time ago where it was ACKd, but
> alone is not sufficient to solve the problem, hence this follow-up series.
I'd like to revisit whether we can't just make !CONFIG_MMU work in combination
with CONFIG_ARCH_MULTIPLATFORM. I've spent some time recently on randconfig
builds and used the patch below to actually fix all build-time bugs I see
with that. The changes need to be split up into separate patches and reviewed
one by one, but I think the only one you really need is to not select
ARM_PATCH_PHYS_VIRT when building a NOMMU kernel.
Arnd
commit b62a2b6e472bfb3c7b224b300f25365112be1ea9
Author: Arnd Bergmann <arnd@arndb.de>
Date: Mon Jun 3 11:06:23 2013 +0200
ARM: make "randconfig" work with NOMMU
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bbe5b2a..25763ce 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -19,7 +19,7 @@ config ARM
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select HARDIRQS_SW_RESEND
- select HAVE_AOUT
+ select HAVE_AOUT if MMU
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
select HAVE_ARCH_KGDB
select HAVE_ARCH_SECCOMP_FILTER
@@ -285,13 +285,11 @@ config MMU
#
choice
prompt "ARM system type"
- default ARCH_VERSATILE if !MMU
- default ARCH_MULTIPLATFORM if MMU
+ default ARCH_MULTIPLATFORM
config ARCH_MULTIPLATFORM
bool "Allow multiple platforms to be selected"
- depends on MMU
- select ARM_PATCH_PHYS_VIRT
+ select ARM_PATCH_PHYS_VIRT if MMU
select AUTO_ZRELADDR
select COMMON_CLK
select MULTI_IRQ_HANDLER
@@ -1812,6 +1810,7 @@ config XEN
depends on ARM && AEABI && OF
depends on CPU_V7 && !CPU_V6
depends on !GENERIC_ATOMIC64
+ depends on MMU
select ARM_PSCI
select PARAVIRT
help
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index bff7138..ba960e5 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -248,7 +248,7 @@ vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
}
}
-#ifndef CONFIG_CPU_CACHE_VIPT
+#if !defined(CONFIG_CPU_CACHE_VIPT) || !defined(CONFIG_MMU)
#define flush_cache_mm(mm) \
vivt_flush_cache_mm(mm)
#define flush_cache_range(vma,start,end) \
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 56752a6..b6821ab 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -166,7 +166,11 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
/* PCI fixed i/o mapping */
#define PCI_IO_VIRT_BASE 0xfee00000
+#ifdef CONFIG_MMU
extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
+#else
+static inline int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr) { return 0; }
+#endif
/*
* Now, pick up the machine-defined IO definitions
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 2fe141f..d380191 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -55,8 +55,9 @@ extern const struct mem_type *get_mem_type(unsigned int type);
extern int ioremap_page(unsigned long virt, unsigned long phys,
const struct mem_type *mtype);
#else
-#define iotable_init(map,num) do { } while (0)
+#define iotable_init(map,num) do { (void)(map); } while (0)
#define vm_reserve_area_early(a,s,c) do { } while (0)
+static inline void debug_ll_io_init(void) {}
#endif
#endif
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index a0a0efe..748c269 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -35,7 +35,7 @@
#else /* !CONFIG_MMU */
.macro addruart_current, rx, tmp1, tmp2
- addruart \rx, \tmp1
+ addruart \rx, \tmp1, \tmp2
.endm
#endif /* CONFIG_MMU */
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 5b391a6..b5f304e 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -175,6 +175,8 @@ __lookup_processor_type_data:
.long __proc_info_end
.size __lookup_processor_type_data, . - __lookup_processor_type_data
+ __HEAD
+
__error_p:
#ifdef CONFIG_DEBUG_LL
adr r0, str_p1
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index c59c97e..ebfcb44 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -22,7 +22,9 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
*save_ptr = virt_to_phys(ptr);
/* This must correspond to the LDM in cpu_resume() assembly */
+#ifdef CONFIG_MMU
*ptr++ = virt_to_phys(idmap_pgd);
+#endif
*ptr++ = sp;
*ptr++ = virt_to_phys(cpu_do_resume);
@@ -53,11 +55,11 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
*/
int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
{
- struct mm_struct *mm = current->active_mm;
int ret;
-
+#ifdef CONFIG_MMU
if (!idmap_pgd)
return -EINVAL;
+#endif
/*
* Provide a temporary page table with an identity mapping for
@@ -66,11 +68,14 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
* back to the correct page tables.
*/
ret = __cpu_suspend(arg, fn);
+#ifdef CONFIG_MMU
if (ret == 0) {
+ struct mm_struct *mm = current->active_mm;
cpu_switch_mm(mm->pgd, mm);
local_flush_bp_all();
local_flush_tlb_all();
}
+#endif
return ret;
}
diff --git a/arch/arm/mach-at91/Kconfig.non_dt b/arch/arm/mach-at91/Kconfig.non_dt
index 6cd554a..ab8d2ce 100644
--- a/arch/arm/mach-at91/Kconfig.non_dt
+++ b/arch/arm/mach-at91/Kconfig.non_dt
@@ -36,6 +36,7 @@ config ARCH_AT91SAM9G45
config ARCH_AT91X40
bool "AT91x40"
depends on !MMU
+ select CPU_ARM9TDMI
select ARCH_USES_GETTIMEOFFSET
select MULTI_IRQ_HANDLER
select SPARSE_IRQ
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index a7d1910..fbfb1eb 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,7 +1,7 @@
config ARCH_MXC
bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
select ARCH_REQUIRE_GPIOLIB
- select ARM_PATCH_PHYS_VIRT
+ select ARM_PATCH_PHYS_VIRT if MMU
select AUTO_ZRELADDR if !ZBOOT_ROM
select CLKDEV_LOOKUP
select CLKSRC_MMIO
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index 82e79c6..3b98409e6 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -110,7 +110,9 @@ static int mx5_suspend_enter(suspend_state_t state)
}
if (state == PM_SUSPEND_MEM) {
+#ifdef CONFIG_MMU
local_flush_tlb_all();
+#endif
flush_cache_all();
/*clear the EMPGC0/1 bits */
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 18cc48b..d29727b 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -100,7 +100,7 @@ config ARCH_OMAP2PLUS_TYPICAL
bool "Typical OMAP configuration"
default y
select AEABI
- select HIGHMEM
+ select HIGHMEM if MMU
select I2C
select I2C_OMAP
select MENELAUS if ARCH_OMAP2
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
index b970440..98624fe 100644
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -60,8 +60,8 @@ int __init omap_secure_ram_reserve_memblock(void)
{
u32 size = OMAP_SECURE_RAM_STORAGE;
- size = ALIGN(size, SECTION_SIZE);
- omap_secure_memblock_base = arm_memblock_steal(size, SECTION_SIZE);
+ size = ALIGN(size, SZ_1M);
+ omap_secure_memblock_base = arm_memblock_steal(size, SZ_1M);
return 0;
}
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
index 13bae78..dc98377 100644
--- a/arch/arm/mach-picoxcell/Kconfig
+++ b/arch/arm/mach-picoxcell/Kconfig
@@ -1,7 +1,7 @@
config ARCH_PICOXCELL
bool "Picochip PicoXcell" if ARCH_MULTI_V6
select ARCH_REQUIRE_GPIOLIB
- select ARM_PATCH_PHYS_VIRT
+ select ARM_PATCH_PHYS_VIRT if MMU
select ARM_VIC
select CPU_V6K
select DW_APB_TIMER
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 9e8101e..3397d05 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -6,7 +6,7 @@ comment "Processor Type"
# ARM7TDMI
config CPU_ARM7TDMI
- bool "Support ARM7TDMI processor"
+ bool
depends on !MMU
select CPU_32v4T
select CPU_ABRT_LV4T
@@ -56,7 +56,7 @@ config CPU_ARM740T
# ARM9TDMI
config CPU_ARM9TDMI
- bool "Support ARM9TDMI processor"
+ bool
depends on !MMU
select CPU_32v4T
select CPU_ABRT_NOMMU
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index a5bc92d..ad4d277 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -81,7 +81,11 @@ void __init omap_map_sram(unsigned long start, unsigned long size,
start = ROUND_DOWN(start, PAGE_SIZE);
omap_sram_size = size;
omap_sram_skip = skip;
+#ifdef CONFIG_MMU
omap_sram_base = __arm_ioremap_exec(start, size, cached);
+#else
+ omap_sram_base = (void __iomem *)start;
+#endif
if (!omap_sram_base) {
pr_err("SRAM: Could not map\n");
return;
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index c332fb9..adaf609 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -130,7 +130,7 @@ config IRQ_REMAP
# OMAP IOMMU support
config OMAP_IOMMU
bool "OMAP IOMMU Support"
- depends on ARCH_OMAP2PLUS
+ depends on ARCH_OMAP2PLUS && MMU
select IOMMU_API
config OMAP_IOVMM
diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index c0c95be..85fc94b 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -10,6 +10,7 @@ if ANDROID
config ANDROID_BINDER_IPC
bool "Android Binder IPC Driver"
+ depends on MMU
default n
---help---
Binder is used in Android for both communication between processes,
diff --git a/drivers/staging/zsmalloc/Kconfig b/drivers/staging/zsmalloc/Kconfig
index 7fab032..0ae13cd 100644
--- a/drivers/staging/zsmalloc/Kconfig
+++ b/drivers/staging/zsmalloc/Kconfig
@@ -1,5 +1,6 @@
config ZSMALLOC
bool "Memory allocator for compressed pages"
+ depends on MMU
default n
help
zsmalloc is a slab-based memory allocator designed to store
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index cf23b15..9cc4d43 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -193,13 +193,17 @@ extern int _cond_resched(void);
(__x < 0) ? -__x : __x; \
})
-#ifdef CONFIG_PROVE_LOCKING
-void might_fault(void);
-#else
+#ifndef CONFIG_MMU
+static inline void might_fault(void)
+{
+}
+#elif !defined(CONFIG_PROVE_LOCKING)
static inline void might_fault(void)
{
might_sleep();
}
+#else
+void might_fault(void);
#endif
extern struct atomic_notifier_head panic_notifier_list;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b87681a..5511a1c 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -919,7 +919,11 @@ extern bool skip_free_areas_node(unsigned int flags, int nid);
int shmem_zero_setup(struct vm_area_struct *);
+#ifdef CONFIG_MMU
extern int can_do_mlock(void);
+#else
+static inline int can_do_mlock(void) { return 0; }
+#endif
extern int user_shm_lock(size_t, struct user_struct *);
extern void user_shm_unlock(size_t, struct user_struct *);
diff --git a/mm/nommu.c b/mm/nommu.c
index ecd1f15..a7709f1 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -54,6 +54,7 @@
#endif
void *high_memory;
+EXPORT_SYMBOL(high_memory);
struct page *mem_map;
unsigned long max_mapnr;
unsigned long highest_memmap_pfn;
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 12:36 ` [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Arnd Bergmann
@ 2013-06-07 13:13 ` Jonathan Austin
2013-06-07 14:00 ` Arnd Bergmann
0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 13:13 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On 07/06/13 13:36, Arnd Bergmann wrote:
> On Friday 07 June 2013 11:48:28 Jonathan Austin wrote:
>> The original aim of this series was to restore the ability to build a NOMMU
>> kernel for Versatile Express, something that was lost when we converted
>> ARCH_VEXPRESS for ARCH_MULTIPLATFORM.
>>
>> In order to do this, it is necessary to abstract the use of generic headers
>> from selection of ARCH_MULTIPLATFORM so that the two can be used separately.
>> This is necessary becuase building a multiplatform kernel for processors
>> without and MMU doesn't make sense (it is necessary to hardcode certain mem-map
>> related data) and the versatile express can host NOMMU processors.
>>
>> This series performs this separation, and then goes on to add a 'dummy'
>> ARCH_VEXPRESS_NOMMU platform that can be selected as standalone platform.
>>
>> Patch 2 was sent to the list as an RFC some time ago where it was ACKd, but
>> alone is not sufficient to solve the problem, hence this follow-up series.
>
> I'd like to revisit whether we can't just make !CONFIG_MMU work in combination
> with CONFIG_ARCH_MULTIPLATFORM.
Do you mean you want to build real !MMU multiplatform kernels that
validly work on multiple platforms, or are you just interested in
keeping the config options set?
I don't think the former makes sense - we still rely on setting
CONFIG_DRAM_BASE (and hence PHYS_OFFSET) and we *can't* use the high
exception vector on many platforms (high exception vectors is deprecated
for R class, too) but we need to use it on others.
In the case that you just want to keep the config option set, I don't
really see what you gain?
The problem I see with enabling !MMU/ARCH_MULTIPLATFORM is that you end
up needing to change platforms that (as far as I know) people never use
in NOMMU configurations for NOMMU behaviour: cf imx, omap2 needing to be
changed in a specific way for the NOMMU case in the diff below. (I say
'specific way' because, of course, this series does make a small change
to them, but I see it more as separating out two previously conflated
options than as NOMMU specific changes...)
> I've spent some time recently on randconfig
> builds and used the patch below to actually fix all build-time bugs I see
> with that. The changes need to be split up into separate patches and reviewed
> one by one, but I think the only one you really need is to not select
> ARM_PATCH_PHYS_VIRT when building a NOMMU kernel.
I agree that this seems to get you to something that builds, though I'm
not sure it'd build something that runs... Don't we end up just making
life harder (I think the diff below is more complicated than the one for
this series...) for ourselves without a win?
Doesn't the explicit dependency of CONFIG_MMU for ARCH_MULTIPLATFORM
mean that randconfig builds still work, even without the changes below?
Apologies if I'm missing a use-case here!
Jonny
>
> Arnd
>
> commit b62a2b6e472bfb3c7b224b300f25365112be1ea9
> Author: Arnd Bergmann <arnd@arndb.de>
> Date: Mon Jun 3 11:06:23 2013 +0200
>
> ARM: make "randconfig" work with NOMMU
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index bbe5b2a..25763ce 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -19,7 +19,7 @@ config ARM
> select GENERIC_STRNCPY_FROM_USER
> select GENERIC_STRNLEN_USER
> select HARDIRQS_SW_RESEND
> - select HAVE_AOUT
> + select HAVE_AOUT if MMU
> select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
> select HAVE_ARCH_KGDB
> select HAVE_ARCH_SECCOMP_FILTER
> @@ -285,13 +285,11 @@ config MMU
> #
> choice
> prompt "ARM system type"
> - default ARCH_VERSATILE if !MMU
> - default ARCH_MULTIPLATFORM if MMU
> + default ARCH_MULTIPLATFORM
>
> config ARCH_MULTIPLATFORM
> bool "Allow multiple platforms to be selected"
> - depends on MMU
> - select ARM_PATCH_PHYS_VIRT
> + select ARM_PATCH_PHYS_VIRT if MMU
> select AUTO_ZRELADDR
> select COMMON_CLK
> select MULTI_IRQ_HANDLER
> @@ -1812,6 +1810,7 @@ config XEN
> depends on ARM && AEABI && OF
> depends on CPU_V7 && !CPU_V6
> depends on !GENERIC_ATOMIC64
> + depends on MMU
> select ARM_PSCI
> select PARAVIRT
> help
> diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
> index bff7138..ba960e5 100644
> --- a/arch/arm/include/asm/cacheflush.h
> +++ b/arch/arm/include/asm/cacheflush.h
> @@ -248,7 +248,7 @@ vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
> }
> }
>
> -#ifndef CONFIG_CPU_CACHE_VIPT
> +#if !defined(CONFIG_CPU_CACHE_VIPT) || !defined(CONFIG_MMU)
> #define flush_cache_mm(mm) \
> vivt_flush_cache_mm(mm)
> #define flush_cache_range(vma,start,end) \
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index 56752a6..b6821ab 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -166,7 +166,11 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
> /* PCI fixed i/o mapping */
> #define PCI_IO_VIRT_BASE 0xfee00000
>
> +#ifdef CONFIG_MMU
> extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
> +#else
> +static inline int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr) { return 0; }
> +#endif
>
> /*
> * Now, pick up the machine-defined IO definitions
> diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
> index 2fe141f..d380191 100644
> --- a/arch/arm/include/asm/mach/map.h
> +++ b/arch/arm/include/asm/mach/map.h
> @@ -55,8 +55,9 @@ extern const struct mem_type *get_mem_type(unsigned int type);
> extern int ioremap_page(unsigned long virt, unsigned long phys,
> const struct mem_type *mtype);
> #else
> -#define iotable_init(map,num) do { } while (0)
> +#define iotable_init(map,num) do { (void)(map); } while (0)
> #define vm_reserve_area_early(a,s,c) do { } while (0)
> +static inline void debug_ll_io_init(void) {}
> #endif
>
> #endif
> diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
> index a0a0efe..748c269 100644
> --- a/arch/arm/kernel/debug.S
> +++ b/arch/arm/kernel/debug.S
> @@ -35,7 +35,7 @@
>
> #else /* !CONFIG_MMU */
> .macro addruart_current, rx, tmp1, tmp2
> - addruart \rx, \tmp1
> + addruart \rx, \tmp1, \tmp2
> .endm
>
> #endif /* CONFIG_MMU */
> diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
> index 5b391a6..b5f304e 100644
> --- a/arch/arm/kernel/head-common.S
> +++ b/arch/arm/kernel/head-common.S
> @@ -175,6 +175,8 @@ __lookup_processor_type_data:
> .long __proc_info_end
> .size __lookup_processor_type_data, . - __lookup_processor_type_data
>
> + __HEAD
> +
> __error_p:
> #ifdef CONFIG_DEBUG_LL
> adr r0, str_p1
> diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
> index c59c97e..ebfcb44 100644
> --- a/arch/arm/kernel/suspend.c
> +++ b/arch/arm/kernel/suspend.c
> @@ -22,7 +22,9 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
> *save_ptr = virt_to_phys(ptr);
>
> /* This must correspond to the LDM in cpu_resume() assembly */
> +#ifdef CONFIG_MMU
> *ptr++ = virt_to_phys(idmap_pgd);
> +#endif
> *ptr++ = sp;
> *ptr++ = virt_to_phys(cpu_do_resume);
>
> @@ -53,11 +55,11 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
> */
> int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
> {
> - struct mm_struct *mm = current->active_mm;
> int ret;
> -
> +#ifdef CONFIG_MMU
> if (!idmap_pgd)
> return -EINVAL;
> +#endif
>
> /*
> * Provide a temporary page table with an identity mapping for
> @@ -66,11 +68,14 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
> * back to the correct page tables.
> */
> ret = __cpu_suspend(arg, fn);
> +#ifdef CONFIG_MMU
> if (ret == 0) {
> + struct mm_struct *mm = current->active_mm;
> cpu_switch_mm(mm->pgd, mm);
> local_flush_bp_all();
> local_flush_tlb_all();
> }
> +#endif
>
> return ret;
> }
> diff --git a/arch/arm/mach-at91/Kconfig.non_dt b/arch/arm/mach-at91/Kconfig.non_dt
> index 6cd554a..ab8d2ce 100644
> --- a/arch/arm/mach-at91/Kconfig.non_dt
> +++ b/arch/arm/mach-at91/Kconfig.non_dt
> @@ -36,6 +36,7 @@ config ARCH_AT91SAM9G45
> config ARCH_AT91X40
> bool "AT91x40"
> depends on !MMU
> + select CPU_ARM9TDMI
> select ARCH_USES_GETTIMEOFFSET
> select MULTI_IRQ_HANDLER
> select SPARSE_IRQ
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index a7d1910..fbfb1eb 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -1,7 +1,7 @@
> config ARCH_MXC
> bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
> select ARCH_REQUIRE_GPIOLIB
> - select ARM_PATCH_PHYS_VIRT
> + select ARM_PATCH_PHYS_VIRT if MMU
> select AUTO_ZRELADDR if !ZBOOT_ROM
> select CLKDEV_LOOKUP
> select CLKSRC_MMIO
> diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
> index 82e79c6..3b98409e6 100644
> --- a/arch/arm/mach-imx/pm-imx5.c
> +++ b/arch/arm/mach-imx/pm-imx5.c
> @@ -110,7 +110,9 @@ static int mx5_suspend_enter(suspend_state_t state)
> }
>
> if (state == PM_SUSPEND_MEM) {
> +#ifdef CONFIG_MMU
> local_flush_tlb_all();
> +#endif
> flush_cache_all();
>
> /*clear the EMPGC0/1 bits */
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 18cc48b..d29727b 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -100,7 +100,7 @@ config ARCH_OMAP2PLUS_TYPICAL
> bool "Typical OMAP configuration"
> default y
> select AEABI
> - select HIGHMEM
> + select HIGHMEM if MMU
> select I2C
> select I2C_OMAP
> select MENELAUS if ARCH_OMAP2
> diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
> index b970440..98624fe 100644
> --- a/arch/arm/mach-omap2/omap-secure.c
> +++ b/arch/arm/mach-omap2/omap-secure.c
> @@ -60,8 +60,8 @@ int __init omap_secure_ram_reserve_memblock(void)
> {
> u32 size = OMAP_SECURE_RAM_STORAGE;
>
> - size = ALIGN(size, SECTION_SIZE);
> - omap_secure_memblock_base = arm_memblock_steal(size, SECTION_SIZE);
> + size = ALIGN(size, SZ_1M);
> + omap_secure_memblock_base = arm_memblock_steal(size, SZ_1M);
>
> return 0;
> }
> diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
> index 13bae78..dc98377 100644
> --- a/arch/arm/mach-picoxcell/Kconfig
> +++ b/arch/arm/mach-picoxcell/Kconfig
> @@ -1,7 +1,7 @@
> config ARCH_PICOXCELL
> bool "Picochip PicoXcell" if ARCH_MULTI_V6
> select ARCH_REQUIRE_GPIOLIB
> - select ARM_PATCH_PHYS_VIRT
> + select ARM_PATCH_PHYS_VIRT if MMU
> select ARM_VIC
> select CPU_V6K
> select DW_APB_TIMER
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index 9e8101e..3397d05 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -6,7 +6,7 @@ comment "Processor Type"
>
> # ARM7TDMI
> config CPU_ARM7TDMI
> - bool "Support ARM7TDMI processor"
> + bool
> depends on !MMU
> select CPU_32v4T
> select CPU_ABRT_LV4T
> @@ -56,7 +56,7 @@ config CPU_ARM740T
>
> # ARM9TDMI
> config CPU_ARM9TDMI
> - bool "Support ARM9TDMI processor"
> + bool
> depends on !MMU
> select CPU_32v4T
> select CPU_ABRT_NOMMU
> diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
> index a5bc92d..ad4d277 100644
> --- a/arch/arm/plat-omap/sram.c
> +++ b/arch/arm/plat-omap/sram.c
> @@ -81,7 +81,11 @@ void __init omap_map_sram(unsigned long start, unsigned long size,
> start = ROUND_DOWN(start, PAGE_SIZE);
> omap_sram_size = size;
> omap_sram_skip = skip;
> +#ifdef CONFIG_MMU
> omap_sram_base = __arm_ioremap_exec(start, size, cached);
> +#else
> + omap_sram_base = (void __iomem *)start;
> +#endif
> if (!omap_sram_base) {
> pr_err("SRAM: Could not map\n");
> return;
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index c332fb9..adaf609 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -130,7 +130,7 @@ config IRQ_REMAP
> # OMAP IOMMU support
> config OMAP_IOMMU
> bool "OMAP IOMMU Support"
> - depends on ARCH_OMAP2PLUS
> + depends on ARCH_OMAP2PLUS && MMU
> select IOMMU_API
>
> config OMAP_IOVMM
> diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
> index c0c95be..85fc94b 100644
> --- a/drivers/staging/android/Kconfig
> +++ b/drivers/staging/android/Kconfig
> @@ -10,6 +10,7 @@ if ANDROID
>
> config ANDROID_BINDER_IPC
> bool "Android Binder IPC Driver"
> + depends on MMU
> default n
> ---help---
> Binder is used in Android for both communication between processes,
> diff --git a/drivers/staging/zsmalloc/Kconfig b/drivers/staging/zsmalloc/Kconfig
> index 7fab032..0ae13cd 100644
> --- a/drivers/staging/zsmalloc/Kconfig
> +++ b/drivers/staging/zsmalloc/Kconfig
> @@ -1,5 +1,6 @@
> config ZSMALLOC
> bool "Memory allocator for compressed pages"
> + depends on MMU
> default n
> help
> zsmalloc is a slab-based memory allocator designed to store
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index cf23b15..9cc4d43 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -193,13 +193,17 @@ extern int _cond_resched(void);
> (__x < 0) ? -__x : __x; \
> })
>
> -#ifdef CONFIG_PROVE_LOCKING
> -void might_fault(void);
> -#else
> +#ifndef CONFIG_MMU
> +static inline void might_fault(void)
> +{
> +}
> +#elif !defined(CONFIG_PROVE_LOCKING)
> static inline void might_fault(void)
> {
> might_sleep();
> }
> +#else
> +void might_fault(void);
> #endif
>
> extern struct atomic_notifier_head panic_notifier_list;
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index b87681a..5511a1c 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -919,7 +919,11 @@ extern bool skip_free_areas_node(unsigned int flags, int nid);
>
> int shmem_zero_setup(struct vm_area_struct *);
>
> +#ifdef CONFIG_MMU
> extern int can_do_mlock(void);
> +#else
> +static inline int can_do_mlock(void) { return 0; }
> +#endif
> extern int user_shm_lock(size_t, struct user_struct *);
> extern void user_shm_unlock(size_t, struct user_struct *);
>
> diff --git a/mm/nommu.c b/mm/nommu.c
> index ecd1f15..a7709f1 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -54,6 +54,7 @@
> #endif
>
> void *high_memory;
> +EXPORT_SYMBOL(high_memory);
> struct page *mem_map;
> unsigned long max_mapnr;
> unsigned long highest_memmap_pfn;
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 13:13 ` Jonathan Austin
@ 2013-06-07 14:00 ` Arnd Bergmann
2013-06-07 14:04 ` Arnd Bergmann
0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2013-06-07 14:00 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 07 June 2013 14:13:24 Jonathan Austin wrote:
>
> Do you mean you want to build real !MMU multiplatform kernels that
> validly work on multiple platforms, or are you just interested in
> keeping the config options set?
>
> I don't think the former makes sense - we still rely on setting
> CONFIG_DRAM_BASE (and hence PHYS_OFFSET) and we *can't* use the high
> exception vector on many platforms (high exception vectors is deprecated
> for R class, too) but we need to use it on others.
>
> In the case that you just want to keep the config option set, I don't
> really see what you gain?
The main interest on my side is to keep the MMU and NOMMU configuration
as similar as possible, and minimize the complexity in Kconfig.
Ideally CONFIG_MMU should just be a single switch to turn on or off,
with a few options becoming visible only for one of the settings.
> The problem I see with enabling !MMU/ARCH_MULTIPLATFORM is that you end
> up needing to change platforms that (as far as I know) people never use
> in NOMMU configurations for NOMMU behaviour: cf imx, omap2 needing to be
> changed in a specific way for the NOMMU case in the diff below. (I say
> 'specific way' because, of course, this series does make a small change
> to them, but I see it more as separating out two previously conflated
> options than as NOMMU specific changes...)
Well, I would consider the imx and omap2 changes to be actual bugs.
We previously allowed them to be built with !MMU, and we could still
decide that we don't want them to run that way but just disable those.
I would however prefer to allow !MMU builds by default for everything
that is not know to be broken, rather than allowing it only for
code that is known to work.
> > I've spent some time recently on randconfig
> > builds and used the patch below to actually fix all build-time bugs I see
> > with that. The changes need to be split up into separate patches and reviewed
> > one by one, but I think the only one you really need is to not select
> > ARM_PATCH_PHYS_VIRT when building a NOMMU kernel.
>
> I agree that this seems to get you to something that builds, though I'm
> not sure it'd build something that runs... Don't we end up just making
> life harder (I think the diff below is more complicated than the one for
> this series...) for ourselves without a win?
>
> Doesn't the explicit dependency of CONFIG_MMU for ARCH_MULTIPLATFORM
> mean that randconfig builds still work, even without the changes below?
>
> Apologies if I'm missing a use-case here!
I am somewhat annoyed by the fact that I had to disable ARCH_MULTIPLATFORM
for !MMU kernels in order to get 'make randconfig' to work and I would rather
allow it and fix the bugs.
Arnd
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 14:00 ` Arnd Bergmann
@ 2013-06-07 14:04 ` Arnd Bergmann
2013-06-07 16:51 ` Jonathan Austin
0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2013-06-07 14:04 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 07 June 2013 16:00:47 Arnd Bergmann wrote:
> > Doesn't the explicit dependency of CONFIG_MMU for ARCH_MULTIPLATFORM
> > mean that randconfig builds still work, even without the changes below?
> >
> > Apologies if I'm missing a use-case here!
>
> I am somewhat annoyed by the fact that I had to disable ARCH_MULTIPLATFORM
> for !MMU kernels in order to get 'make randconfig' to work and I would rather
> allow it and fix the bugs.
To expand on this a bit more: I want to eventually make ARCH_MULTIPLATFORM
mandatory for all modern platforms, in particular anything ARMv6 and ARMv7
based. Forcing all !MMU-kernels to be !ARCH_MULTIPLATFORM means we won't
get there unless we disallow !MMU on modern platforms.
Arnd
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 14:04 ` Arnd Bergmann
@ 2013-06-07 16:51 ` Jonathan Austin
2013-06-07 17:33 ` Arnd Bergmann
0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 16:51 UTC (permalink / raw)
To: linux-arm-kernel
On 07/06/13 15:04, Arnd Bergmann wrote:
> On Friday 07 June 2013 16:00:47 Arnd Bergmann wrote:
>>> Doesn't the explicit dependency of CONFIG_MMU for ARCH_MULTIPLATFORM
>>> mean that randconfig builds still work, even without the changes below?
>>>
>>> Apologies if I'm missing a use-case here!
>>
>> I am somewhat annoyed by the fact that I had to disable ARCH_MULTIPLATFORM
>> for !MMU kernels in order to get 'make randconfig' to work and I would rather
>> allow it and fix the bugs.
>
> To expand on this a bit more: I want to eventually make ARCH_MULTIPLATFORM
> mandatory for all modern platforms, in particular anything ARMv6 and ARMv7
> based. Forcing all !MMU-kernels to be !ARCH_MULTIPLATFORM means we won't
> get there unless we disallow !MMU on modern platforms.
>
Thanks for the expansion. I like that as an aim :). We should remember
it'll still only make sense for platforms where PHYS_OFFSET/DRAM_BASE is
the same - not sure how many that will be.
I've had a play with keeping !MMU and ARCH_MULTIPLATFORM selectable
together, and of the fixes in your diff, only the following is required
to get R7 booting on top of Vexpress:
-----8<-------
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a7f066e..ead2b25 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -289,8 +289,7 @@ choice
config ARCH_MULTIPLATFORM
bool "Allow multiple platforms to be selected"
- depends on MMU
- select ARM_PATCH_PHYS_VIRT
+ select ARM_PATCH_PHYS_VIRT if MMU
select AUTO_ZRELADDR
select COMMON_CLK
select MULTI_IRQ_HANDLER
----->8--------
It's nice too, because we don't need to add back Makefile.boot for vexpress.
The R7 support, nommu-fixes and MPU patches I sent before and which I
hope to have merged for 3.11 (pull request for rmk coming shortly) can
all work fine using this instead of the NEED_NO_MACH_HEADERS series (IE
this series)....
It would be cool, then, to have the small patch above in for 3.11 too if
we're not too late and if nobody is against going down this route?
Arnd: would you like to send it as a patch to the list for
consideration, or shall I take this on?
Jonny
> Arnd
>
>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 16:51 ` Jonathan Austin
@ 2013-06-07 17:33 ` Arnd Bergmann
2013-06-07 17:50 ` Jonathan Austin
0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2013-06-07 17:33 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 07 June 2013 17:51:07 Jonathan Austin wrote:
>
> Thanks for the expansion. I like that as an aim :). We should remember
> it'll still only make sense for platforms where PHYS_OFFSET/DRAM_BASE is
> the same - not sure how many that will be.
Yes, this is much less about the practical value of actually running
a kernel that is built for multiple NOMMU machines than it is about
doing things in a consistent way throughout the kernel.
> I've had a play with keeping !MMU and ARCH_MULTIPLATFORM selectable
> together, and of the fixes in your diff, only the following is required
> to get R7 booting on top of Vexpress:
>
> -----8<-------
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index a7f066e..ead2b25 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -289,8 +289,7 @@ choice
>
> config ARCH_MULTIPLATFORM
> bool "Allow multiple platforms to be selected"
> - depends on MMU
> - select ARM_PATCH_PHYS_VIRT
> + select ARM_PATCH_PHYS_VIRT if MMU
> select AUTO_ZRELADDR
> select COMMON_CLK
> select MULTI_IRQ_HANDLER
> ----->8--------
>
> It's nice too, because we don't need to add back Makefile.boot for vexpress.
Ok, excellent. We can probably mark that for -stable backports so we
also get it in 3.8.x and 3.9.x.
> The R7 support, nommu-fixes and MPU patches I sent before and which I
> hope to have merged for 3.11 (pull request for rmk coming shortly) can
> all work fine using this instead of the NEED_NO_MACH_HEADERS series (IE
> this series)....
Ok.
> It would be cool, then, to have the small patch above in for 3.11 too if
> we're not too late and if nobody is against going down this route?
>
> Arnd: would you like to send it as a patch to the list for
> consideration, or shall I take this on?
Please send a patch with a correct description.
Arnd
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM
2013-06-07 17:33 ` Arnd Bergmann
@ 2013-06-07 17:50 ` Jonathan Austin
0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Austin @ 2013-06-07 17:50 UTC (permalink / raw)
To: linux-arm-kernel
On 07/06/13 18:33, Arnd Bergmann wrote:
> On Friday 07 June 2013 17:51:07 Jonathan Austin wrote:
>
> Please send a patch with a correct description.
No worries. What's the authorship etiquette on a little patch like this?
Thanks,
Jonny
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-06-07 17:50 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-07 10:48 [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 1/3] ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 2/3] ARM: nommu: re-enable use of vexpress " Jonathan Austin
2013-06-07 10:48 ` [PATCH v3 3/3] ARM: vexpress-nommu: add a Makefile.boot to restore single-platform build Jonathan Austin
2013-06-07 12:36 ` [PATCH v3 0/3] Separate generic header usage from ARCH_MULTIPLATFORM Arnd Bergmann
2013-06-07 13:13 ` Jonathan Austin
2013-06-07 14:00 ` Arnd Bergmann
2013-06-07 14:04 ` Arnd Bergmann
2013-06-07 16:51 ` Jonathan Austin
2013-06-07 17:33 ` Arnd Bergmann
2013-06-07 17:50 ` Jonathan Austin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).