From 36e352dc2f258819db77057b3856cd585f64e80b Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Tue, 28 Jul 2015 10:05:39 -0400 Subject: [PATCH] arm: Improve Kconfig option organization The Cortex-M related Kconfig menus and options no longer show up at the top level when "make ARCH=arm menuconfig" is issued. They show up under the "General Platform Configuration" menu. Change-Id: I6bf012e628212340f5e089d0193a9a71d90c79b9 Signed-off-by: Peter Mitsis --- arch/arm/Kconfig | 47 ++++++++--------- .../configs/micro_basic_cortex_m3_defconfig | 15 ++---- .../arm/configs/micro_fsl_frdm_k64f_defconfig | 15 ++---- .../configs/nano_basic_cortex_m3_defconfig | 15 ++---- arch/arm/configs/nano_fsl_frdm_k64f_defconfig | 15 ++---- arch/arm/core/Kconfig | 50 +++++++++++++++++++ arch/arm/core/cortex_m/Kconfig | 35 +++---------- arch/arm/defconfig | 15 ++---- 8 files changed, 96 insertions(+), 111 deletions(-) create mode 100644 arch/arm/core/Kconfig diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index d2bd9cc45c0..a3ccf2fbe38 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -34,17 +34,37 @@ source "kernel/Kconfig" source "misc/Kconfig" -menu "ARM family options" +menu "General Platform Configuration" + +choice +prompt "Platform Selection" +default PLATFORM_FSL_FRDM_K64F + +config PLATFORM_FSL_FRDM_K64F + bool "FSL FRDM K64F" + select CPU_CORTEX_M + select CPU_CORTEX_M4 + select K20_UART + +config PLATFORM_TI_LM3S6965 + bool "TI LM3S6965" + select CPU_CORTEX_M + select CPU_CORTEX_M3 + select STELLARIS_UART + +endchoice config ARM bool + # Omit prompt to signify "hidden" option default y help This option signifies the use of an ARM system. config ISA_THUMB2 - bool "Thumb-2 Technology" - default y + bool + # Omit prompt to signify "hidden" option + default n help From: http://www.arm.com/products/processors/technologies/instruction-set-architectures.php @@ -69,30 +89,11 @@ config ISA_THUMB2 to prolong battery-life or to enrich the product feature set. Thumb-2 technology is featured in the processor, and in all ARMv7 architecture-based processors. -endmenu -menu "Platform General Configuration" - -choice -prompt "Minimum Platform Configuation Selection" -default PLATFORM_FSL_FRDM_K64F - -config PLATFORM_FSL_FRDM_K64F - bool "Minimum Configuration for FSL FRDM K64F" - select CPU_CORTEX_M4 - select K20_UART - -config PLATFORM_TI_LM3S6965 - bool "Minimum Configuration for a TI LM3S6965" - select CPU_CORTEX_M3 - select STELLARIS_UART - -endchoice +source "arch/arm/core/Kconfig" endmenu -source "arch/arm/core/cortex_m/Kconfig" - if PLATFORM_TI_LM3S6965 source "arch/arm/platforms/ti_lm3s6965/Kconfig" endif diff --git a/arch/arm/configs/micro_basic_cortex_m3_defconfig b/arch/arm/configs/micro_basic_cortex_m3_defconfig index e22b8c2a023..470cb1ee947 100644 --- a/arch/arm/configs/micro_basic_cortex_m3_defconfig +++ b/arch/arm/configs/micro_basic_cortex_m3_defconfig @@ -72,25 +72,16 @@ CONFIG_PRINTK=y # CONFIG_BOOTLOADER_UNKNOWN is not set # -# ARM family options -# -CONFIG_ARM=y -CONFIG_ISA_THUMB2=y - -# -# Platform General Configuration +# General Platform Configuration # # CONFIG_PLATFORM_FSL_FRDM_K64F is not set CONFIG_PLATFORM_TI_LM3S6965=y - -# -# ARM Cortex CPU options -# +CONFIG_ARM=y +CONFIG_ISA_THUMB2=y CONFIG_CPU_CORTEX=y CONFIG_CPU_CORTEX_M=y CONFIG_CPU_CORTEX_M3_M4=y CONFIG_CPU_CORTEX_M3=y -# CONFIG_CPU_CORTEX_M4 is not set # # ARM Cortex-M family options diff --git a/arch/arm/configs/micro_fsl_frdm_k64f_defconfig b/arch/arm/configs/micro_fsl_frdm_k64f_defconfig index 3bc17184204..5a629046b28 100644 --- a/arch/arm/configs/micro_fsl_frdm_k64f_defconfig +++ b/arch/arm/configs/micro_fsl_frdm_k64f_defconfig @@ -72,24 +72,15 @@ CONFIG_PRINTK=y # CONFIG_BOOTLOADER_UNKNOWN is not set # -# ARM family options -# -CONFIG_ARM=y -CONFIG_ISA_THUMB2=y - -# -# Platform General Configuration +# General Platform Configuration # CONFIG_PLATFORM_FSL_FRDM_K64F=y # CONFIG_PLATFORM_TI_LM3S6965 is not set - -# -# ARM Cortex CPU options -# +CONFIG_ARM=y +CONFIG_ISA_THUMB2=y CONFIG_CPU_CORTEX=y CONFIG_CPU_CORTEX_M=y CONFIG_CPU_CORTEX_M3_M4=y -# CONFIG_CPU_CORTEX_M3 is not set CONFIG_CPU_CORTEX_M4=y # diff --git a/arch/arm/configs/nano_basic_cortex_m3_defconfig b/arch/arm/configs/nano_basic_cortex_m3_defconfig index 9598cc33a9a..1c77d93d6c0 100644 --- a/arch/arm/configs/nano_basic_cortex_m3_defconfig +++ b/arch/arm/configs/nano_basic_cortex_m3_defconfig @@ -51,25 +51,16 @@ CONFIG_PRINTK=y # CONFIG_BOOTLOADER_UNKNOWN is not set # -# ARM family options -# -CONFIG_ARM=y -CONFIG_ISA_THUMB2=y - -# -# Platform General Configuration +# General Platform Configuration # # CONFIG_PLATFORM_FSL_FRDM_K64F is not set CONFIG_PLATFORM_TI_LM3S6965=y - -# -# ARM Cortex CPU options -# +CONFIG_ARM=y +CONFIG_ISA_THUMB2=y CONFIG_CPU_CORTEX=y CONFIG_CPU_CORTEX_M=y CONFIG_CPU_CORTEX_M3_M4=y CONFIG_CPU_CORTEX_M3=y -# CONFIG_CPU_CORTEX_M4 is not set # # ARM Cortex-M family options diff --git a/arch/arm/configs/nano_fsl_frdm_k64f_defconfig b/arch/arm/configs/nano_fsl_frdm_k64f_defconfig index bda07b04f19..20bedf2f4a3 100644 --- a/arch/arm/configs/nano_fsl_frdm_k64f_defconfig +++ b/arch/arm/configs/nano_fsl_frdm_k64f_defconfig @@ -51,24 +51,15 @@ CONFIG_PRINTK=y # CONFIG_BOOTLOADER_UNKNOWN is not set # -# ARM family options -# -CONFIG_ARM=y -CONFIG_ISA_THUMB2=y - -# -# Platform General Configuration +# General Platform Configuration # CONFIG_PLATFORM_FSL_FRDM_K64F=y # CONFIG_PLATFORM_TI_LM3S6965 is not set - -# -# ARM Cortex CPU options -# +CONFIG_ARM=y +CONFIG_ISA_THUMB2=y CONFIG_CPU_CORTEX=y CONFIG_CPU_CORTEX_M=y CONFIG_CPU_CORTEX_M3_M4=y -# CONFIG_CPU_CORTEX_M3 is not set CONFIG_CPU_CORTEX_M4=y # diff --git a/arch/arm/core/Kconfig b/arch/arm/core/Kconfig new file mode 100644 index 00000000000..675b46526d5 --- /dev/null +++ b/arch/arm/core/Kconfig @@ -0,0 +1,50 @@ +# Kconfig - ARM core configuration options + +# +# Copyright (c) 2015 Wind River Systems, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1) Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2) Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3) Neither the name of Wind River Systems nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +config CPU_CORTEX + bool + # Omit prompt to signify "hidden" option + default n + help + This option signifies the use of a CPU of the Cortex family. + +config CPU_CORTEX_M + bool + # Omit prompt to signify "hidden" option + default n + select CPU_CORTEX + help + This option signifies the use of a CPU of the Cortex-M family. + +if CPU_CORTEX_M +source "arch/arm/core/cortex_m/Kconfig" +endif diff --git a/arch/arm/core/cortex_m/Kconfig b/arch/arm/core/cortex_m/Kconfig index 6f8b7d7abfe..c0827582a65 100644 --- a/arch/arm/core/cortex_m/Kconfig +++ b/arch/arm/core/cortex_m/Kconfig @@ -30,48 +30,27 @@ # POSSIBILITY OF SUCH DAMAGE. # -menu "ARM Cortex CPU options" - -config CPU_CORTEX - bool "ARM CORTEX" - default n - select ARM - help - This option signifies the use of a CPU of the Cortex family. - -config CPU_CORTEX_M - bool "ARM Cortex-M" - default n - select CPU_CORTEX - select ISA_THUMB2 - help - This option signifies the use of a CPU of the Cortex-M family. - config CPU_CORTEX_M3_M4 - bool "ARM Cortex-M3 or ARM Cortex-M4" + bool + # Omit prompt to signify "hidden" option default n - select CPU_CORTEX_M + select ISA_THUMB2 help This option signifies the use of either a Cortex-M3 or Cortex-M4 CPU. -choice -prompt "ARM Cortex M3 or M4 Processor" -default CPU_CORTEX_M4 - config CPU_CORTEX_M3 - bool "ARM Cortex-M3" + bool + # Omit prompt to signify "hidden" option select CPU_CORTEX_M3_M4 help This option signifies the use of a Cortex-M3 CPU config CPU_CORTEX_M4 - bool "ARM Cortex-M4" + bool + # Omit prompt to signify "hidden" option select CPU_CORTEX_M3_M4 help This option signifies the use of a Cortex-M4 CPU -endchoice - -endmenu menu "ARM Cortex-M family options" depends on CPU_CORTEX_M diff --git a/arch/arm/defconfig b/arch/arm/defconfig index 3bc17184204..5a629046b28 100644 --- a/arch/arm/defconfig +++ b/arch/arm/defconfig @@ -72,24 +72,15 @@ CONFIG_PRINTK=y # CONFIG_BOOTLOADER_UNKNOWN is not set # -# ARM family options -# -CONFIG_ARM=y -CONFIG_ISA_THUMB2=y - -# -# Platform General Configuration +# General Platform Configuration # CONFIG_PLATFORM_FSL_FRDM_K64F=y # CONFIG_PLATFORM_TI_LM3S6965 is not set - -# -# ARM Cortex CPU options -# +CONFIG_ARM=y +CONFIG_ISA_THUMB2=y CONFIG_CPU_CORTEX=y CONFIG_CPU_CORTEX_M=y CONFIG_CPU_CORTEX_M3_M4=y -# CONFIG_CPU_CORTEX_M3 is not set CONFIG_CPU_CORTEX_M4=y #