Separate generic header usage from ARCH_MULTIPLATFORM
Subsystems (6)
cover Separate generic header usage from ARCH_MULTIPLATFORM
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.
Since the original single patch was sent I have also selected SPARSE_IRQ for ARCH_VEXPRESS_NOMMU in that patch.
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/Makefile | 2 +- arch/arm/boot/compressed/misc.c | 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, 34 insertions(+), 9 deletions(-) create mode 100644 arch/arm/mach-vexpress/Makefile.boot
Signature · 1 line
1.7.9.5
PATCH 1/3 ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM
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 ARM_GENERIC_HEADERS config option that ARCH_MULTIPLATFORM selects. Other platforms can now select ARCH_GENERIC_HEADERS independently.
---
I'd be happy to submit the per-platform conversions as separate patches if doing them in a single go is not appropriate.
arch/arm/Kconfig | 4 ++++ arch/arm/Makefile | 2 +- arch/arm/boot/compressed/misc.c | 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, 13 insertions(+), 9 deletions(-)
arch/arm/Kconfig +4 -0
@@ -208,6 +208,9 @@ config NEED_RET_TO_USER config ARCH_MTD_XIP bool +config ARM_GENERIC_HEADERS + bool + config VECTORS_BASE hex default 0xffff0000 if MMU || CPU_HIGH_VECTOR
@@ -297,6 +300,7 @@ config ARCH_MULTIPLATFORM select MULTI_IRQ_HANDLER select SPARSE_IRQ select USE_OF + select ARM_GENERIC_HEADERS config ARCH_INTEGRATOR bool "ARM Ltd. Integrator family"
arch/arm/Makefile +1 -1
@@ -233,7 +233,7 @@ endif machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y)) -ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y) +ifneq ($(CONFIG_ARM_GENERIC_HEADERS),y) ifeq ($(KBUILD_SRC),) KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs)) else
arch/arm/boot/compressed/misc.c +1 -1
@@ -25,7 +25,7 @@ unsigned int __machine_arch_type;static void putstr (const char *ptr);extern void error (char *x); -#ifdef CONFIG_ARCH_MULTIPLATFORM +#ifdef CONFIG_ARM_GENERIC_HEADERS static inline void putc (int c) {}static inline void flush (void ) {}static inline void arch_decomp_setup (void ) {}
arch/arm/include/asm/timex.h +1 -1
@@ -12,7 +12,7 @@#ifndef _ASMARM_TIMEX_H#define _ASMARM_TIMEX_H -#ifdef CONFIG_ARCH_MULTIPLATFORM +#ifdef CONFIG_ARM_GENERIC_HEADERS #define CLOCK_TICK_RATE 1000000#else #include <mach/timex.h>
arch/arm/mach-mvebu/Makefile +1 -1
@@ -1,4 +1,4 @@ -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ +ccflags-$(CONFIG_ARM_GENERIC_HEADERS) := -I$(srctree)/$(src)/include \ -I$(srctree)/arch/arm/plat-orion/include AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
arch/arm/mach-omap2/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ +ccflags-$(CONFIG_ARM_GENERIC_HEADERS) := -I$(srctree)/$(src)/include \ -I$(srctree)/arch/arm/plat-omap/include # Common support
arch/arm/mach-vexpress/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the linux kernel. # -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ +ccflags-$(CONFIG_ARM_GENERIC_HEADERS) := -I$(srctree)/$(src)/include \ -I$(srctree)/arch/arm/plat-versatile/include obj-y := v2m.o reset.o
arch/arm/plat-omap/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include +ccflags-$(CONFIG_ARM_GENERIC_HEADERS) := -I$(srctree)/arch/arm/plat-omap/include # Common support obj-y := sram.o dma.o counter_32k.o
arch/arm/plat-orion/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the linux kernel. # -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include +ccflags-$(CONFIG_ARM_GENERIC_HEADERS) := -I$(srctree)/$(src)/include obj-y += addr-map.o
arch/arm/plat-versatile/Makefile +1 -1
@@ -1,4 +1,4 @@ -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include +ccflags-$(CONFIG_ARM_GENERIC_HEADERS) := -I$(srctree)/$(src)/include obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
Signature · 1 line
1.7.9.5
PATCH 1/3 ARM: allow platforms to use generic headers without ARCH_MULTIPLATFORM
arch/arm/boot/compressed/misc.c unsigned int __machine_arch_type; · line 28
Quoted 10 lines · Jonathan Austin
arch/arm/boot/compressed/misc.c +1
-1@@ -25,7 +25,7 @@ unsigned int __machine_arch_type;static void putstr (const char *ptr);extern void error (char *x); -#ifdef CONFIG_ARCH_MULTIPLATFORM +#ifdef CONFIG_ARM_GENERIC_HEADERS
Note that this will conflict with patches I've just merged. I wouldn't suggest you rely on those patches yet until they've had some wider testing, so I'd recommend you hold off with these for a while.
PATCH 2/3 ARM: nommu: re-enable use of vexpress without ARCH_MULTIPLATFORM
In reply to Jonathan AustinSince 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.
--- arch/arm/Kconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm/Kconfig +17 -0
@@ -352,6 +352,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 ARM_GENERIC_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
Signature · 1 line
1.7.9.5
PATCH 3/3 ARM: vexpress-nommu: add a Makefile.boot to restore single-platform build
In reply to Jonathan AustinWhen 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.
---
I'm less sure about this patch than I am about the other two. If anyone has cleaner suggestions than adding back Makefile.boot then I'd happily consider them.
This seemed preferable to making point-change just for this case to the generic include mechanism in arch/arm/Makefile:235, where the Makefile.boot file are included.
arch/arm/mach-vexpress/Makefile.boot | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 arch/arm/mach-vexpress/Makefile.boot
arch/arm/mach-vexpress/Makefile.boot new file +4 -0
@@ -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
Signature · 1 line
1.7.9.5