From 170574d331ec09b2fc72636f86be628ea2f69381 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 24 Jun 2016 07:45:59 -0600 Subject: [PATCH] Add configuration logic to include a Kconfig file in each custom configuration. Includes adding a dummy custom board configuration directory. A consequence of this that each custom board directory will now need to contain a Kconfig file. NOTE also that the new board directory does not take effect in the configuration menues until the NEXT time you run 'make menuconfig' --- Makefile.unix | 12 ++--- Makefile.win | 10 ++-- configs/Kconfig | 112 +++++++++++++++++------------------------- configs/dummy/Kconfig | 4 ++ 4 files changed, 61 insertions(+), 77 deletions(-) create mode 100644 configs/dummy/Kconfig diff --git a/Makefile.unix b/Makefile.unix index 022c796216..a6913ad672 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -480,22 +480,22 @@ pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT) # location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See # README.txt file in the NuttX tools GIT repository for additional information. -config: apps_preconfig +config: context apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf Kconfig -oldconfig: apps_preconfig +oldconfig: context apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --oldconfig Kconfig -olddefconfig: apps_preconfig +olddefconfig: context apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --olddefconfig Kconfig -menuconfig: apps_preconfig +menuconfig: context apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-mconf Kconfig -qconfig: apps_preconfig +qconfig: context apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-qconf Kconfig -gconfig: apps_preconfig +gconfig: context apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-gconf Kconfig # export diff --git a/Makefile.win b/Makefile.win index 5a71a42122..5556efb79f 100644 --- a/Makefile.win +++ b/Makefile.win @@ -480,16 +480,16 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT) # location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See # misc\tools\README.txt for additional information. -config: apps_preconfig +config: context apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf Kconfig -oldconfig: apps_preconfig - $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --oldconfig Kconfig +oldconfig: context apps_preconfig + $(Q) context set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --oldconfig Kconfig -olddefconfig: apps_preconfig +olddefconfig: context apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --olddefconfig Kconfig -menuconfig: configenv apps_preconfig +menuconfig: context configenv apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-mconf Kconfig # export diff --git a/configs/Kconfig b/configs/Kconfig index 75014db5fd..b6e90d411b 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -444,6 +444,12 @@ config ARCH_BOARD_MIRTOO This is the port to the DTX1-4000L "Mirtoo" module. This module uses MicroChip PIC32MX250F128D. See http://www.dimitech.com/ for further information. +config ARCH_BOARD_MOXA + bool "Moxa board" + depends on ARCH_CHIP_MOXART + ---help--- + Moxa + config ARCH_BOARD_NUTINY_NUC120 bool "Nuvoton NuTiny NUC120" depends on ARCH_CHIP_NUC120LE3AN @@ -1257,26 +1263,13 @@ config ARCH_BOARD_CUSTOM Don't see the board you want? You must first select the exact MCU part number, then the boards supporting that part will be available for selection. -config ARCH_BOARD_MOXA - bool "Moxa board" - depends on ARCH_CHIP_MOXART - ---help--- - Moxa - endchoice -if ARCH_BOARD_CUSTOM menu "Custom Board Configuration" -config ARCH_BOARD_CUSTOM_NAME - string "Custom board name" - default "" - ---help--- - This is a name for the board. It is not used except to return the - information via the NSH uname command. - config ARCH_BOARD_CUSTOM_DIR string "Custom board directory" + default "configs/dummy" ---help--- If the custom board configuration is selected, then it is necessary to also tell the build system where it can find the board directory @@ -1289,33 +1282,17 @@ config ARCH_BOARD_CUSTOM_DIR config ARCH_BOARD_CUSTOM_DIR_RELPATH bool "Relative custom board directory" + default y ---help--- Specifies that the board directory is relative to the NuttX directory. -config BOARD_CRASHDUMP - bool "Enable Board level logging of crash dumps" - default n +if ARCH_BOARD_CUSTOM + +config ARCH_BOARD_CUSTOM_NAME + string "Custom board name" ---help--- - If selected up_asseert will call out to board_crashdump, in the case - of an assertion failure, prior to calling exit. Or in the - case of a hardfault prior to looping indefinitely. board_crashdump - then has a chance to save the state of the machine. - - The purpose of board_crashdump is to save as much information as it can - about the cause of the fault and then most likely reset the system. - - N.B. There is limited system resources that can be used, who knows - what memory is trashed? So all we can expect to do is save the - "machine state" in a place where on the next reset can write it - to more sophisticated storage in a sane operating environment. - -config BOARD_RESET_ON_CRASH - bool "Eanble Board Reset after the crashdump is saved" - default n - depends on BOARD_CRASHDUMP - ---help--- - If selected the board_crashdump should reset the machine after - saveing the state of the machine + This is a name for the board. It is not used except to return the + information via the NSH uname command. config BOARD_CUSTOM_LEDS bool "Custom board LEDs" @@ -1341,8 +1318,8 @@ config BOARD_CUSTOM_INTERRUPT depends on NETDEVICES select ARCH_PHY_INTERRUPT if NETDEVICES -endmenu # Custom Board Configuration endif #ARCH_BOARD_CUSTOM +endmenu # Custom Board Configuration config ARCH_BOARD string @@ -1503,34 +1480,9 @@ config ARCH_IRQBUTTONS ---help--- "Support interrupts on button presses and releases." -config NSH_MMCSDMINOR - int "MMC/SD minor number" - default 0 - depends on NSH_LIBRARY && MMCSD - ---help--- - If board-specific NSH start-up logic needs to mount an MMC/SD device, then the - setting should be provided to identify the MMC/SD minor device number (i.e., the N ini - /dev/mmcsdN). Default 0 - -config NSH_MMCSDSLOTNO - int "MMC/SD slot number" - default 0 - depends on NSH_LIBRARY && MMCSD - ---help--- - If board-specific NSH start-up supports more than one MMC/SD slot, then this setting - should be provided to indicate which slot should be used. Default: 0. - -config NSH_MMCSDSPIPORTNO - int "MMC/SD SPI device number" - default 0 - depends on NSH_LIBRARY && MMCSD && MMCSD_SPI - ---help--- - If board-specif NSH start-up logic will mount an SPI-based MMC/SD volume, then this - setting may be needed to tell the board logic which SPI bus to use. Default: 0 - (meaning is board-specific). - comment "Board-Specific Options" + if ARCH_BOARD_AMBER source "configs/amber/Kconfig" endif @@ -1657,6 +1609,9 @@ endif if ARCH_BOARD_MOTEINO_MEGA source "configs/moteino-mega/Kconfig" endif +if ARCH_BOARD_MOXA +source "configs/moxa/Kconfig" +endif if ARCH_BOARD_MX1ADS source "configs/mx1ads/Kconfig" endif @@ -1891,10 +1846,35 @@ endif if ARCH_BOARD_SIM source "configs/sim/Kconfig" endif -if ARCH_BOARD_MOXA -source "configs/moxa/Kconfig" +if ARCH_BOARD_CUSTOM +source "$ARCH_BOARD_CUSTOM_DIR/Kconfig" endif +config BOARD_CRASHDUMP + bool "Enable Board level logging of crash dumps" + default n + ---help--- + If selected up_assert will call out to board_crashdump, in the case + of an assertion failure, prior to calling exit. Or in the + case of a hardfault prior to looping indefinitely. board_crashdump + then has a chance to save the state of the machine. + + The purpose of board_crashdump is to save as much information as it can + about the cause of the fault and then most likely reset the system. + + N.B. There is limited system resources that can be used, who knows + what memory is trashed? So all we can expect to do is save the + "machine state" in a place where on the next reset can write it + to more sophisticated storage in a sane operating environment. + +config BOARD_RESET_ON_CRASH + bool "Enable Board Reset after the crashdump is saved" + default n + depends on BOARD_CRASHDUMP + ---help--- + If selected the board_crashdump should reset the machine after + saveing the state of the machine + config LIB_BOARDCTL bool "Enable boardctl() interface" default n diff --git a/configs/dummy/Kconfig b/configs/dummy/Kconfig new file mode 100644 index 0000000000..f72f3c094c --- /dev/null +++ b/configs/dummy/Kconfig @@ -0,0 +1,4 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +#