diff --git a/drivers/Kconfig b/drivers/Kconfig index 45ea433bc96..8a9d162ed6c 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -3,91 +3,6 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config DEV_SIMPLE_ADDRENV - bool "Simple AddrEnv" - default n - -config DEV_NULL - bool "Enable /dev/null" - default y - -config DEV_ZERO - bool "Enable /dev/zero" - default n - -config DRVR_MKRD - bool "RAM disk wrapper (mkrd)" - default n - ---help--- - Build the mkrd() function which serves as a wrapper to simplify - creation of RAM disks. If the boardctrl() interface is enabled, - the selecting this option will also enable the BOARDIOC_MKRD - command that will support creation of RAM disks from applications. - -# ARCH needs to support memory access while CPU is running to be able to use -# the LWL CONSOLE - -config ARCH_HAVE_RDWR_MEM_CPU_RUN - bool - default n - -config LWL_CONSOLE -bool "Lightweight Link Console Support" - default n - depends on DEV_CONSOLE && ARCH_HAVE_RDWR_MEM_CPU_RUN - ---help--- - Use the lightweight link console which provides console over a - debug channel by means of shared memory. A terminal application - for openocd as the debugger is available in tools/ocdconsole.py. - -menu "Buffering" - -config DRVR_WRITEBUFFER - bool "Enable write buffer support" - default n - ---help--- - Enable generic write buffering support that can be used by a variety - of drivers. - -if DRVR_WRITEBUFFER - -config DRVR_WRDELAY - int "Write flush delay" - default 350 - ---help--- - If there is no write activity for this configured amount of time, - then the contents will be automatically flushed to the media. This - reduces the likelihood that data will be stuck in the write buffer - at the time of power down. - -endif # DRVR_WRITEBUFFER - -config DRVR_READAHEAD - bool "Enable read-ahead buffer support" - default n - ---help--- - Enable generic read-ahead buffering support that can be used by a - variety of drivers. - -if DRVR_WRITEBUFFER || DRVR_READAHEAD - -config DRVR_READBYTES - bool "Support byte read method" - default y if MTD_BYTE_WRITE - default n if !MTD_BYTE_WRITE - -config DRVR_REMOVABLE - bool "Support removable media" - default n - -config DRVR_INVALIDATE - bool "Support cache invalidation" - default n - -endif # DRVR_WRITEBUFFER || DRVR_READAHEAD - -endmenu # Buffering - config SPECIFIC_DRIVERS bool "Board Specific drivers" default n @@ -108,6 +23,7 @@ source "drivers/input/Kconfig" source "drivers/ioexpander/Kconfig" source "drivers/lcd/Kconfig" source "drivers/leds/Kconfig" +source "drivers/misc/Kconfig" source "drivers/mmcsd/Kconfig" source "drivers/modem/Kconfig" source "drivers/mtd/Kconfig" diff --git a/drivers/Makefile b/drivers/Makefile index 7433c13ecb7..d6b53242bef 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -39,6 +39,7 @@ include ioexpander/Make.defs include lcd/Make.defs include leds/Make.defs include loop/Make.defs +include misc/Make.defs include mmcsd/Make.defs include modem/Make.defs include mtd/Make.defs @@ -70,30 +71,6 @@ ifeq ($(CONFIG_SPECIFIC_DRIVERS),y) -include platform/Make.defs endif -ifeq ($(CONFIG_DEV_SIMPLE_ADDRENV),y) - CSRCS += addrenv.c -endif - -CSRCS += dev_null.c dev_zero.c - -ifeq ($(CONFIG_LWL_CONSOLE),y) - CSRCS += lwl_console.c -endif - -ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) - CSRCS += ramdisk.c -ifeq ($(CONFIG_DRVR_MKRD),y) - CSRCS += mkrd.c -endif -ifeq ($(CONFIG_DRVR_WRITEBUFFER),y) - CSRCS += rwbuffer.c -else -ifeq ($(CONFIG_DRVR_READAHEAD),y) - CSRCS += rwbuffer.c -endif -endif -endif - AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig new file mode 100644 index 00000000000..780f805f408 --- /dev/null +++ b/drivers/misc/Kconfig @@ -0,0 +1,89 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config DEV_SIMPLE_ADDRENV + bool "Simple AddrEnv" + default n + +config DEV_NULL + bool "Enable /dev/null" + default y + +config DEV_ZERO + bool "Enable /dev/zero" + default n + +config DRVR_MKRD + bool "RAM disk wrapper (mkrd)" + default n + ---help--- + Build the mkrd() function which serves as a wrapper to simplify + creation of RAM disks. If the boardctrl() interface is enabled, + the selecting this option will also enable the BOARDIOC_MKRD + command that will support creation of RAM disks from applications. + +# ARCH needs to support memory access while CPU is running to be able to use +# the LWL CONSOLE + +config ARCH_HAVE_RDWR_MEM_CPU_RUN + bool + default n + +config LWL_CONSOLE +bool "Lightweight Link Console Support" + default n + depends on DEV_CONSOLE && ARCH_HAVE_RDWR_MEM_CPU_RUN + ---help--- + Use the lightweight link console which provides console over a + debug channel by means of shared memory. A terminal application + for openocd as the debugger is available in tools/ocdconsole.py. + +menu "Buffering" + +config DRVR_WRITEBUFFER + bool "Enable write buffer support" + default n + ---help--- + Enable generic write buffering support that can be used by a variety + of drivers. + +if DRVR_WRITEBUFFER + +config DRVR_WRDELAY + int "Write flush delay" + default 350 + ---help--- + If there is no write activity for this configured amount of time, + then the contents will be automatically flushed to the media. This + reduces the likelihood that data will be stuck in the write buffer + at the time of power down. + +endif # DRVR_WRITEBUFFER + +config DRVR_READAHEAD + bool "Enable read-ahead buffer support" + default n + ---help--- + Enable generic read-ahead buffering support that can be used by a + variety of drivers. + +if DRVR_WRITEBUFFER || DRVR_READAHEAD + +config DRVR_READBYTES + bool "Support byte read method" + default y if MTD_BYTE_WRITE + default n if !MTD_BYTE_WRITE + +config DRVR_REMOVABLE + bool "Support removable media" + default n + +config DRVR_INVALIDATE + bool "Support cache invalidation" + default n + +endif # DRVR_WRITEBUFFER || DRVR_READAHEAD + +endmenu # Buffering diff --git a/drivers/misc/Make.defs b/drivers/misc/Make.defs new file mode 100644 index 00000000000..ae0e3b65376 --- /dev/null +++ b/drivers/misc/Make.defs @@ -0,0 +1,53 @@ +############################################################################ +# drivers/misc/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifeq ($(CONFIG_DEV_SIMPLE_ADDRENV),y) + CSRCS += addrenv.c +endif + +ifeq ($(CONFIG_DEV_NULL),y) + CSRCS += dev_null.c +endif + +ifeq ($(CONFIG_DEV_ZERO),y) + CSRCS += dev_zero.c +endif + +ifeq ($(CONFIG_LWL_CONSOLE),y) + CSRCS += lwl_console.c +endif + +ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) + CSRCS += ramdisk.c +ifeq ($(CONFIG_DRVR_MKRD),y) + CSRCS += mkrd.c +endif +endif + +ifeq ($(CONFIG_DRVR_WRITEBUFFER),y) + CSRCS += rwbuffer.c +else ifeq ($(CONFIG_DRVR_READAHEAD),y) + CSRCS += rwbuffer.c +endif + +# Include build support + +DEPPATH += --dep-path misc +VPATH += :misc diff --git a/drivers/addrenv.c b/drivers/misc/addrenv.c similarity index 99% rename from drivers/addrenv.c rename to drivers/misc/addrenv.c index 82063c416e1..b22ede370ff 100644 --- a/drivers/addrenv.c +++ b/drivers/misc/addrenv.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/addrenv.c + * drivers/misc/addrenv.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/drivers/dev_null.c b/drivers/misc/dev_null.c similarity index 99% rename from drivers/dev_null.c rename to drivers/misc/dev_null.c index cab9fd1d7ea..5bb27a746c3 100644 --- a/drivers/dev_null.c +++ b/drivers/misc/dev_null.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/dev_null.c + * drivers/misc/dev_null.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/drivers/dev_zero.c b/drivers/misc/dev_zero.c similarity index 99% rename from drivers/dev_zero.c rename to drivers/misc/dev_zero.c index e49e810b98c..4ceab41c816 100644 --- a/drivers/dev_zero.c +++ b/drivers/misc/dev_zero.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/dev_zero.c + * drivers/misc/dev_zero.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/drivers/lwl_console.c b/drivers/misc/lwl_console.c similarity index 99% rename from drivers/lwl_console.c rename to drivers/misc/lwl_console.c index 29ad0860a71..5b0234d8029 100644 --- a/drivers/lwl_console.c +++ b/drivers/misc/lwl_console.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/lwl_console.c + * drivers/misc/lwl_console.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/drivers/mkrd.c b/drivers/misc/mkrd.c similarity index 99% rename from drivers/mkrd.c rename to drivers/misc/mkrd.c index 25f374f882f..7c6a967faef 100644 --- a/drivers/mkrd.c +++ b/drivers/misc/mkrd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/mkrd.c + * drivers/misc/mkrd.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/drivers/ramdisk.c b/drivers/misc/ramdisk.c similarity index 99% rename from drivers/ramdisk.c rename to drivers/misc/ramdisk.c index fb1e2f3c73e..0c85a13329d 100644 --- a/drivers/ramdisk.c +++ b/drivers/misc/ramdisk.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/ramdisk.c + * drivers/misc/ramdisk.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/drivers/rwbuffer.c b/drivers/misc/rwbuffer.c similarity index 99% rename from drivers/rwbuffer.c rename to drivers/misc/rwbuffer.c index 60e6306380e..fe7698e3b9c 100644 --- a/drivers/rwbuffer.c +++ b/drivers/misc/rwbuffer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/rwbuffer.c + * drivers/misc/rwbuffer.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with