Browse Source

allow to select CPU flavour for toolchain building via env

Add a more generic way to define CPU flavours for Toolchain
building. Add Cortex-A8 definition. Move Thumb symbol around.
Waldemar Brodkorb 9 năm trước cách đây
mục cha
commit
6cebe0b479

+ 2 - 3
Config.in

@@ -24,10 +24,9 @@ source "target/config/Config.in.boards"
 source "target/config/Config.in.kernel"
 source "target/config/Config.in.arch"
 source "target/config/Config.in.system"
-source "target/config/Config.in.arm"
-source "target/config/Config.in.cris"
+source "target/config/Config.in.subsystem"
+source "target/config/Config.in.tc"
 source "target/config/Config.in.mips"
-source "target/config/Config.in.x86"
 source "target/config/Config.in.xtensa"
 source "target/config/Config.in.qemu"
 source "target/config/Config.in.qemuopts"

+ 7 - 0
mk/build.mk

@@ -449,6 +449,13 @@ endif
 			|sed -e "s#^config \(.*\)#\1=y#" \
 			>> $(ADK_TOPDIR)/.defconfig; \
 	fi
+	@if [ ! -z "$(ADK_TARGET_CPU)" ];then \
+		cpu=$$(echo "$(ADK_TARGET_CPU)" |sed -e "s/-/_/g"); \
+		grep -h "^config" target/config/Config.in.tc \
+			|grep -i "$$cpu$$" \
+			|sed -e "s#^config \(.*\)#\1=y#" \
+			>> $(ADK_TOPDIR)/.defconfig; \
+	fi
 	@if [ ! -z "$(ADK_TARGET_SYSTEM)" ];then \
 		system=$$(echo "$(ADK_TARGET_SYSTEM)" |sed -e "s/-/_/g"); \
 		grep -h "^config" target/*/Config.in.systems \

+ 5 - 0
target/config/Config.in

@@ -26,6 +26,11 @@ config ADK_TARGET_QEMU
 config ADK_TARGET_VBOX
 	bool
 
+config ADK_TARGET_ARCH_ARM_WITH_THUMB
+	bool
+	select ADK_KERNEL_THUMB2_KERNEL
+	depends on ADK_TARGET_ARCH_ARM
+
 # the inverse of ADK_TARGET_KERNEL_CUSTOMISING,
 # allows for selecting it off (i.e., to disable it)
 config ADK_TARGET_FIXED_KERNEL

+ 0 - 5
target/config/Config.in.arm

@@ -1,5 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-source target/config/Config.in.arm.choice
-source target/config/Config.in.arm.default

+ 0 - 7
target/config/Config.in.arm.default

@@ -1,7 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-config ADK_TARGET_ARCH_ARM_WITH_THUMB
-	bool
-	select ADK_KERNEL_THUMB2_KERNEL
-	depends on ADK_TARGET_ARCH_ARM

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

@@ -83,6 +83,11 @@ config ADK_CPU_CORTEX_A7
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_CPU_WITH_FPU_VFPV4
 
+config ADK_CPU_CORTEX_A8
+	bool
+	select ADK_TARGET_WITH_NPTL
+	select ADK_TARGET_WITH_MMU
+
 config ADK_CPU_CORTEX_A9
 	bool
 	select ADK_TARGET_WITH_NPTL
@@ -302,6 +307,7 @@ config ADK_TARGET_GCC_CPU
 	default "arm926ej-s" if ADK_CPU_ARM926EJ_S
 	default "armv8-a" if ADK_CPU_ARMV8
 	default "cortex-a7" if ADK_CPU_CORTEX_A7
+	default "cortex-a8" if ADK_CPU_CORTEX_A8
 	default "cortex-a9" if ADK_CPU_CORTEX_A9
 	default "cortex-a53" if ADK_CPU_CORTEX_A53
 	default "cortex-a57" if ADK_CPU_CORTEX_A57

+ 0 - 5
target/config/Config.in.cris

@@ -1,5 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-source target/config/Config.in.cris.choice
-source target/config/Config.in.cris.default

+ 0 - 16
target/config/Config.in.cris.choice

@@ -1,16 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-choice ADK_TARGET_CRIS_CPU_ARCH
-prompt "CPU architecture"
-depends on ADK_TARGET_TOOLCHAIN && ADK_TARGET_ARCH_CRIS
-
-config ADK_CPU_CRIS_V10
-	boolean "cris v10"
-        select ADK_crisv10
-
-config ADK_CPU_CRIS_V32
-	boolean "cris v32"
-        select ADK_crisv32
-
-endchoice

+ 0 - 13
target/config/Config.in.cris.default

@@ -1,13 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-config ADK_crisv10
-	boolean
-
-config ADK_crisv32
-	boolean
-
-config ADK_TARGET_CRIS_CPU
-	string
-	default "cris" if ADK_crisv10
-	default "crisv32" if ADK_crisv32

+ 2 - 41
target/config/Config.in.arm.choice → target/config/Config.in.subsystem

@@ -1,44 +1,3 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-choice ADK_TARGET_ARM_CPU_ARCH
-prompt "CPU architecture and family"
-depends on ADK_TARGET_TOOLCHAIN && ADK_TARGET_ARCH_ARM
-
-config ADK_CPU_ARMV7A_CORTEX_A9
-        bool "cortex-a9"
-        select ADK_CPU_CORTEX_A9
-
-config ADK_CPU_ARMV7A_CORTEX_A7
-        bool "cortex-a7"
-        select ADK_CPU_CORTEX_A7
-
-config ADK_CPU_ARMV7M_CORTEX_M4
-	bool "cortex-m4"
-	select ADK_CPU_CORTEX_M4
-	select ADK_TARGET_ARCH_ARM_WITH_THUMB
-	select ADK_TARGET_UCLINUX
-
-config ADK_CPU_ARMV7M_CORTEX_M3
-	bool "cortex-m3"
-	select ADK_CPU_CORTEX_M3
-	select ADK_TARGET_ARCH_ARM_WITH_THUMB
-	select ADK_TARGET_UCLINUX
-
-config ADK_CPU_ARMV6_ARM1176JZF_S
-        bool "arm1176jzf-s (armv6)"
-        select ADK_CPU_ARM1176JZF_S
-
-config ADK_CPU_ARMV5TE_ARM926EJ_S
-        bool "arm926ej-s (armv5te)"
-        select ADK_CPU_ARM926EJ_S
-
-config ADK_CPU_ARMV5TE_XSCALE
-        bool "xscale"
-        select ADK_CPU_XSCALE
-
-endchoice
-
 choice
 prompt "Solidrun IMX6 model"
 depends on ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
@@ -92,3 +51,5 @@ config ADK_TARGET_HUMMINGBOARD_I2EX
 	select ADK_TARGET_WITH_SATA
 
 endchoice
+
+

+ 90 - 0
target/config/Config.in.tc

@@ -0,0 +1,90 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+choice ADK_TARGET_CPU
+prompt "CPU type"
+depends on ADK_TARGET_TOOLCHAIN && \
+	( ADK_TARGET_ARCH_CRIS \
+	|| ADK_TARGET_ARCH_ARM \
+	|| ADK_TARGET_ARCH_X86 )
+
+config ADK_TARGET_CPU_ARM_CORTEX_A9
+        bool "cortex-a9"
+        select ADK_CPU_CORTEX_A9
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_CORTEX_A8
+        bool "cortex-a8"
+        select ADK_CPU_CORTEX_A8
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_CORTEX_A7
+        bool "cortex-a7"
+        select ADK_CPU_CORTEX_A7
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_CORTEX_M4
+	bool "cortex-m4"
+	select ADK_CPU_CORTEX_M4
+	select ADK_TARGET_ARCH_ARM_WITH_THUMB
+	select ADK_TARGET_UCLINUX
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_CORTEX_M3
+	bool "cortex-m3"
+	select ADK_CPU_CORTEX_M3
+	select ADK_TARGET_ARCH_ARM_WITH_THUMB
+	select ADK_TARGET_UCLINUX
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_ARM1176JZF_S
+        bool "arm1176jzf-s"
+        select ADK_CPU_ARM1176JZF_S
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_ARM926EJ_S
+        bool "arm926ej-s"
+        select ADK_CPU_ARM926EJ_S
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_XSCALE
+        bool "xscale"
+        select ADK_CPU_XSCALE
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_CRIS_V10
+	bool "cris v10"
+        select ADK_CPU_CRIS_V10
+	depends on ADK_TARGET_ARCH_CRIS
+
+config ADK_TARGET_CPU_CRIS_V32
+	bool "cris v32"
+        select ADK_CPU_CRIS_V32
+	depends on ADK_TARGET_ARCH_CRIS
+
+config ADK_TARGET_CPU_X86_I486
+	bool "i486"
+	select ADK_CPU_I486
+	depends on ADK_TARGET_ARCH_X86
+
+config ADK_TARGET_CPU_X86_I586
+	bool "i586"
+	select ADK_CPU_I586
+	depends on ADK_TARGET_ARCH_X86
+
+config ADK_TARGET_CPU_X86_I686
+	bool "i686"
+	select ADK_CPU_I686
+	depends on ADK_TARGET_ARCH_X86
+
+config ADK_TARGET_CPU_X86_GEODE
+	bool "geode"
+	select ADK_CPU_GEODE
+	depends on ADK_TARGET_ARCH_X86
+
+config ADK_TARGET_CPU_X86_ATOM
+	bool "atom"
+	select ADK_CPU_ATOM
+	depends on ADK_TARGET_ARCH_X86
+
+endchoice

+ 0 - 5
target/config/Config.in.x86

@@ -1,5 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-source target/config/Config.in.x86.choice
-source target/config/Config.in.x86.default

+ 0 - 25
target/config/Config.in.x86.choice

@@ -1,25 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-choice ADK_TARGET_X86_CPU_ARCH
-prompt "CPU architecture"
-depends on (ADK_TARGET_SYSTEM_QEMU_X86 || ADK_TARGET_SYSTEM_GENERIC_PC || ADK_TARGET_SYSTEM_VBOX_X86 || ADK_TARGET_TOOLCHAIN) && ADK_TARGET_ARCH_X86
-default ADK_CPU_I486
-
-config ADK_CPU_I486
-        bool "i486"
-        select ADK_i486
-
-config ADK_CPU_I586
-        bool "i586"
-        select ADK_i586
-
-config ADK_CPU_I686
-        bool "i686"
-        select ADK_i686
-
-config ADK_CPU_ATOM
-        bool "atom"
-        select ADK_atom
-
-endchoice

+ 0 - 22
target/config/Config.in.x86.default

@@ -1,22 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-config ADK_i486
-	bool
-
-config ADK_i586
-	bool
-
-config ADK_i686
-	bool
-
-config ADK_atom
-	bool
-
-config ADK_TARGET_X86_CPU
-	string
-	default "i486" if ADK_i486
-	default "i586" if ADK_i586
-	default "i686" if ADK_i686
-	default "atom" if ADK_atom
-