Browse Source

add support for Qemu ARM noMMU

Greg Ungerer made me aware of this possibility.
Rather hackish implementation, we need to deduplicate later.
Update Linux Kernel to 4.4.19 while there.
Only non-Devicetree system supported right now.
Waldemar Brodkorb 8 years ago
parent
commit
db6e6a11e6

+ 2 - 2
mk/kernel-ver.mk

@@ -32,10 +32,10 @@ KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_HASH:=		f5ed0278c95ac75c855e52082c585af6936c606878b37a10ab5a65f08104a0d3
 KERNEL_HASH:=		f5ed0278c95ac75c855e52082c585af6936c606878b37a10ab5a65f08104a0d3
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_4),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_4),y)
-KERNEL_FILE_VER:=	4.4.17
+KERNEL_FILE_VER:=	4.4.19
 KERNEL_RELEASE:=	1
 KERNEL_RELEASE:=	1
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
 KERNEL_VERSION:=	$(KERNEL_FILE_VER)-$(KERNEL_RELEASE)
-KERNEL_HASH:=		159451471c0df6bde8043b85dfacafa58e65c4a0cabb1157e83916326cd04f81
+KERNEL_HASH:=		55ad0c6f0b62346f5e4b100f0e01970e8f3a5454f7c8af1e7bba490a3a6ac694
 endif
 endif
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_1),y)
 ifeq ($(ADK_TARGET_KERNEL_VERSION_4_1),y)
 KERNEL_FILE_VER:=	4.1.30
 KERNEL_FILE_VER:=	4.1.30

+ 2 - 2
target/arm/Makefile

@@ -32,7 +32,7 @@ endif
 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE),y)
 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE),y)
 QEMU_ARGS+=-M realview-eb-mpcore -net user -net nic
 QEMU_ARGS+=-M realview-eb-mpcore -net user -net nic
 endif
 endif
-ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB),y)
+ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU),y)
 ifeq ($(ADK_TARGET_WITH_DEVICETREE),y)
 ifeq ($(ADK_TARGET_WITH_DEVICETREE),y)
 QEMU_ARGS+=-M versatilepb -net user -net nic,model=smc91c111 -dtb $(FW_DIR)/versatile-pb.dtb
 QEMU_ARGS+=-M versatilepb -net user -net nic,model=smc91c111 -dtb $(FW_DIR)/versatile-pb.dtb
 else
 else
@@ -153,7 +153,7 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9),y)
 	env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
 	env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
 		dtbs $(MAKE_TRACE)
 		dtbs $(MAKE_TRACE)
 endif
 endif
-ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB),y)
+ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU),y)
 	env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
 	env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
 		dtbs $(MAKE_TRACE)
 		dtbs $(MAKE_TRACE)
 endif
 endif

+ 16 - 0
target/arm/kernel/qemu-arm-versatilepb-nommu

@@ -0,0 +1,16 @@
+CONFIG_ARM=y
+CONFIG_ARCH_VERSATILE=y
+CONFIG_KUSER_HELPERS=y
+CONFIG_ATAGS=y
+CONFIG_USE_OF=y
+CONFIG_SET_MEM_PARAM=y
+CONFIG_DRAM_BASE=0x00000000
+CONFIG_DRAM_SIZE=0x08000000
+CONFIG_ARCH_VERSATILE_PB=y
+CONFIG_MACH_VERSATILE_AB=y
+# CONFIG_MACH_VERSATILE_DT is not set
+CONFIG_PLAT_VERSATILE_CLOCK=y
+CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y
+CONFIG_PLAT_VERSATILE=y
+CONFIG_VECTORS_BASE=0x00000000
+CONFIG_PHYS_OFFSET=0x00000000

+ 10 - 0
target/arm/systems/qemu-arm-versatilepb-nommu

@@ -0,0 +1,10 @@
+config ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
+	bool "Qemu Emulator (Versatile/PB) no MMU"
+	depends on ADK_TARGET_LITTLE_ENDIAN
+	select ADK_TARGET_CPU_ARM_ARM926EJ_S_NOMMU
+	select ADK_TARGET_QEMU
+	select ADK_TARGET_KERNEL_ZIMAGE
+	select ADK_TARGET_KERNEL_WITH_COMPRESSION
+	help
+	  Qemu Emulator for ARM architecture (Versatile/PB) without MMU.
+

+ 0 - 1
target/config/Config.in.archopts

@@ -7,7 +7,6 @@ depends on ADK_TARGET_ARCH_ARM
 
 
 config ADK_TARGET_ARCH_ARM_WITH_ARM
 config ADK_TARGET_ARCH_ARM_WITH_ARM
 	bool "arm"
 	bool "arm"
-	depends on ADK_TARGET_WITH_MMU
 
 
 config ADK_TARGET_ARCH_ARM_WITH_THUMB
 config ADK_TARGET_ARCH_ARM_WITH_THUMB
 	bool "thumb"
 	bool "thumb"

+ 7 - 0
target/config/Config.in.cpu

@@ -56,6 +56,13 @@ config ADK_TARGET_CPU_ARM_ARM926EJ_S
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_WITH_MMU
 	depends on ADK_TARGET_ARCH_ARM
 	depends on ADK_TARGET_ARCH_ARM
 
 
+config ADK_TARGET_CPU_ARM_ARM926EJ_S_NOMMU
+	bool "arm926ej-s"
+	select ADK_TARGET_WITH_LT
+	select ADK_TARGET_WITHOUT_MMU
+	select ADK_TARGET_UCLINUX
+	depends on ADK_TARGET_ARCH_ARM
+
 config ADK_TARGET_CPU_ARM_ARM11MPCORE
 config ADK_TARGET_CPU_ARM_ARM11MPCORE
 	bool "arm11mpcore"
 	bool "arm11mpcore"
 	select ADK_TARGET_WITH_NPTL
 	select ADK_TARGET_WITH_NPTL

+ 1 - 1
target/config/Config.in.kernelversion

@@ -31,7 +31,7 @@ config ADK_TARGET_KERNEL_VERSION_4_6
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NDS32
 
 
 config ADK_TARGET_KERNEL_VERSION_4_4
 config ADK_TARGET_KERNEL_VERSION_4_4
-	bool "4.4.17"
+	bool "4.4.19"
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_ARCH_NIOS2
 	depends on !ADK_TARGET_ARCH_NIOS2
 	depends on !ADK_TARGET_CPU_MIPS_MIPS32R6
 	depends on !ADK_TARGET_CPU_MIPS_MIPS32R6

+ 2 - 1
target/config/Config.in.runtime

@@ -260,6 +260,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
 	default "ttyARC0" if ADK_TARGET_SYSTEM_NSIM_ARCV1 \
 	default "ttyARC0" if ADK_TARGET_SYSTEM_NSIM_ARCV1 \
 				|| ADK_TARGET_SYSTEM_NSIM_ARCV2
 				|| ADK_TARGET_SYSTEM_NSIM_ARCV2
 	default "ttyAMA0" if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB \
 	default "ttyAMA0" if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB \
+				|| ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU \
 				|| ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE \
 				|| ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE \
 				|| ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9 \
 				|| ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9 \
 				|| ADK_TARGET_SYSTEM_ARM_FM \
 				|| ADK_TARGET_SYSTEM_ARM_FM \
@@ -284,7 +285,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_SPEED
 		|| ADK_TARGET_SIM
 		|| ADK_TARGET_SIM
 	default "9600" if ADK_TARGET_SYSTEM_FON_FON2100
 	default "9600" if ADK_TARGET_SYSTEM_FON_FON2100
 	default "9600" if ADK_TARGET_SYSTEM_NUMATO_MIMASV2
 	default "9600" if ADK_TARGET_SYSTEM_NUMATO_MIMASV2
-	default "38400" if ADK_TARGET_SYSTEM_PCENGINES_WRAP	
+	default "38400" if ADK_TARGET_SYSTEM_PCENGINES_WRAP
 	default "38400" if ADK_TARGET_SYSTEM_ANDES_AG101P
 	default "38400" if ADK_TARGET_SYSTEM_ANDES_AG101P
 	default "115200"
 	default "115200"
 
 

+ 1 - 0
target/linux/config/Config.in.bus

@@ -7,6 +7,7 @@ config ADK_KERNEL_PCI
 	depends on ADK_TARGET_WITH_PCI \
 	depends on ADK_TARGET_WITH_PCI \
 		|| ADK_TARGET_QEMU \
 		|| ADK_TARGET_QEMU \
 		|| ADK_TARGET_VBOX
 		|| ADK_TARGET_VBOX
+	default n if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
 	default y
 	default y
 
 
 config ADK_KERNEL_PCI_QUIRKS
 config ADK_KERNEL_PCI_QUIRKS

+ 2 - 0
target/linux/config/Config.in.ethernet

@@ -192,8 +192,10 @@ config ADK_KERNEL_SMC91X
 	select ADK_KERNEL_GPIOLIB
 	select ADK_KERNEL_GPIOLIB
 	depends on ADK_TARGET_SYSTEM_ARM_FM || \
 	depends on ADK_TARGET_SYSTEM_ARM_FM || \
 		   ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB || \
 		   ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB || \
+		   ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU || \
 		   ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 		   ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
+	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 	default y if ADK_TARGET_SYSTEM_ARM_FM
 	default y if ADK_TARGET_SYSTEM_ARM_FM
 	default n
 	default n

+ 1 - 2
target/linux/config/Config.in.kernel

@@ -88,8 +88,7 @@ config ADK_KERNEL_BINFMT_ELF_FDPIC
 
 
 config ADK_KERNEL_BINFMT_FLAT
 config ADK_KERNEL_BINFMT_FLAT
 	bool
 	bool
-	default y if ADK_TARGET_BINFMT_FLAT_ONE
-	default y if ADK_TARGET_BINFMT_FLAT_SEP_DATA
+	default y if ADK_TARGET_BINFMT_FLAT
 
 
 config ADK_KERNEL_BINFMT_SHARED_FLAT
 config ADK_KERNEL_BINFMT_SHARED_FLAT
 	bool
 	bool

+ 2 - 0
target/linux/config/Config.in.serial

@@ -199,10 +199,12 @@ config ADK_KERNEL_SERIAL_AMBA_PL011
 	depends on ADK_TARGET_BOARD_BCM28XX \
 	depends on ADK_TARGET_BOARD_BCM28XX \
 		|| ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE \
 		|| ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE \
 		|| ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB \
 		|| ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB \
+		|| ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU \
 		|| ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
 		|| ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
 	default y if ADK_TARGET_BOARD_BCM28XX
 	default y if ADK_TARGET_BOARD_BCM28XX
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
+	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
 	default y if ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
 	default n
 	default n
 	help
 	help

+ 0 - 0
target/linux/patches/4.4.17/coldfire-sighandler.patch → target/linux/patches/4.4.19/coldfire-sighandler.patch


+ 0 - 0
target/linux/patches/4.4.17/crisv32.patch → target/linux/patches/4.4.19/crisv32.patch


+ 0 - 0
target/linux/patches/4.4.17/initramfs-nosizelimit.patch → target/linux/patches/4.4.19/initramfs-nosizelimit.patch


+ 0 - 0
target/linux/patches/4.4.17/ld-or1k.patch → target/linux/patches/4.4.19/ld-or1k.patch


+ 0 - 0
target/linux/patches/4.4.17/macsonic.patch → target/linux/patches/4.4.19/macsonic.patch


+ 0 - 0
target/linux/patches/4.4.17/mips-xz.patch → target/linux/patches/4.4.19/mips-xz.patch


+ 0 - 0
target/linux/patches/4.4.17/patch-realtime → target/linux/patches/4.4.19/patch-realtime


+ 0 - 0
target/linux/patches/4.4.17/revert-sparc.patch → target/linux/patches/4.4.19/revert-sparc.patch


+ 0 - 0
target/linux/patches/4.4.17/startup.patch → target/linux/patches/4.4.19/startup.patch


+ 0 - 0
target/linux/patches/4.4.17/use-libgcc-for-sh.patch → target/linux/patches/4.4.19/use-libgcc-for-sh.patch


+ 16 - 0
target/linux/patches/4.4.19/versatile-nommu.patch

@@ -0,0 +1,16 @@
+diff -Nur linux-4.4.17.orig/arch/arm/mach-versatile/include/mach/hardware.h linux-4.4.17/arch/arm/mach-versatile/include/mach/hardware.h
+--- linux-4.4.17.orig/arch/arm/mach-versatile/include/mach/hardware.h	2016-08-10 11:49:43.000000000 +0200
++++ linux-4.4.17/arch/arm/mach-versatile/include/mach/hardware.h	2016-08-25 23:19:03.691716292 +0200
+@@ -30,8 +30,12 @@
+ #define VERSATILE_PCI_VIRT_BASE		(void __iomem *)0xe8000000ul
+ #define VERSATILE_PCI_CFG_VIRT_BASE	(void __iomem *)0xe9000000ul
+ 
++#ifdef CONFIG_MMU
+ /* macro to get at MMIO space when running virtually */
+ #define IO_ADDRESS(x)		(((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
++#else
++#define IO_ADDRESS(x)		(x)
++#endif
+ 
+ #define __io_address(n)		((void __iomem __force *)IO_ADDRESS(n))
+