dts: Convert CONFIG_ to DT_ symbols for chosen props

Replace generating CONFIG_ symbols with DT_ symbols for chosen
properties like 'zephyr,console' or 'zephyr,bt-mon-uart'.  We now use a
kconfigfunctions (dt_str_val) to extract the info from dts into Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-02-08 08:32:46 -06:00 committed by Kumar Gala
commit ff70b3444f
6 changed files with 18 additions and 24 deletions

View file

@ -300,17 +300,17 @@ The full set of Zephyr-specific ``chosen`` nodes follows:
* - ``zephyr,ccm`` * - ``zephyr,ccm``
- ``DT_CCM`` - ``DT_CCM``
* - ``zephyr,console`` * - ``zephyr,console``
- :option:`CONFIG_UART_CONSOLE_ON_DEV_NAME` - `DT_UART_CONSOLE_ON_DEV_NAME`
* - ``zephyr,shell-uart`` * - ``zephyr,shell-uart``
- :option:`CONFIG_UART_SHELL_ON_DEV_NAME` - `DT_UART_SHELL_ON_DEV_NAME`
* - ``zephyr,bt-uart`` * - ``zephyr,bt-uart``
- :option:`CONFIG_BT_UART_ON_DEV_NAME` - `DT_BT_UART_ON_DEV_NAME`
* - ``zephyr,uart-pipe`` * - ``zephyr,uart-pipe``
- :option:`CONFIG_UART_PIPE_ON_DEV_NAME` - `DT_UART_PIPE_ON_DEV_NAME`
* - ``zephyr,bt-mon-uart`` * - ``zephyr,bt-mon-uart``
- :option:`CONFIG_BT_MONITOR_ON_DEV_NAME` - `DT_BT_MONITOR_ON_DEV_NAME`
* - ``zephyr,uart-mcumgr`` * - ``zephyr,uart-mcumgr``
- :option:`CONFIG_UART_MCUMGR_ON_DEV_NAME` - `DT_UART_MCUMGR_ON_DEV_NAME`
As chosen properties tend to be related to software configuration, it can be As chosen properties tend to be related to software configuration, it can be
useful for the build system to know if a chosen property was defined. We useful for the build system to know if a chosen property was defined. We

View file

@ -62,15 +62,14 @@ config BT_NO_DRIVER
endchoice endchoice
if !HAS_DTS
config BT_UART_ON_DEV_NAME config BT_UART_ON_DEV_NAME
string "Device Name of UART Device for Bluetooth" string "Device Name of UART Device for Bluetooth"
default "$(dt_str_val,DT_BT_UART_ON_DEV_NAME)" if HAS_DTS
default "UART_0" default "UART_0"
depends on BT_UART depends on BT_UART
help help
This option specifies the name of UART device to be used This option specifies the name of UART device to be used
for Bluetooth. for Bluetooth.
endif
if BT_SPI if BT_SPI

View file

@ -41,15 +41,14 @@ config UART_CONSOLE
Enable this option to use one UART for console. Make sure Enable this option to use one UART for console. Make sure
CONFIG_UART_CONSOLE_ON_DEV_NAME is also set correctly. CONFIG_UART_CONSOLE_ON_DEV_NAME is also set correctly.
if !HAS_DTS
config UART_CONSOLE_ON_DEV_NAME config UART_CONSOLE_ON_DEV_NAME
string "Device Name of UART Device for UART Console" string "Device Name of UART Device for UART Console"
default "$(dt_str_val,DT_UART_CONSOLE_ON_DEV_NAME)" if HAS_DTS
default "UART_0" default "UART_0"
depends on UART_CONSOLE depends on UART_CONSOLE
help help
This option specifies the name of UART device to be used for This option specifies the name of UART device to be used for
UART console. UART console.
endif
config UART_CONSOLE_INIT_PRIORITY config UART_CONSOLE_INIT_PRIORITY
int "Init priority" int "Init priority"
@ -191,15 +190,14 @@ config UART_PIPE
data (as contrary to console UART driver) and all aspects of received data (as contrary to console UART driver) and all aspects of received
protocol data are handled by application provided callback. protocol data are handled by application provided callback.
if !HAS_DTS
config UART_PIPE_ON_DEV_NAME config UART_PIPE_ON_DEV_NAME
string "Device Name of UART Device for pipe UART" string "Device Name of UART Device for pipe UART"
default "$(dt_str_val,DT_UART_PIPE_ON_DEV_NAME)" if HAS_DTS
default "UART_0" default "UART_0"
depends on UART_PIPE depends on UART_PIPE
help help
This option specifies the name of UART device to be used This option specifies the name of UART device to be used
for pipe UART. for pipe UART.
endif
config UART_MCUMGR config UART_MCUMGR
bool "Enable mcumgr UART driver" bool "Enable mcumgr UART driver"
@ -212,15 +210,14 @@ config UART_MCUMGR
data are handled by an application provided callback. data are handled by an application provided callback.
if UART_MCUMGR if UART_MCUMGR
if !HAS_DTS
config UART_MCUMGR_ON_DEV_NAME config UART_MCUMGR_ON_DEV_NAME
string "Device Name of UART Device for mcumgr UART" string "Device Name of UART Device for mcumgr UART"
default "$(dt_str_val,DT_UART_MCUMGR_ON_DEV_NAME)" if HAS_DTS
default "UART_0" default "UART_0"
depends on UART_MCUMGR depends on UART_MCUMGR
help help
This option specifies the name of UART device to be used This option specifies the name of UART device to be used
for mcumgr UART. for mcumgr UART.
endif # !HAS_DTS
config UART_MCUMGR_RX_BUF_SIZE config UART_MCUMGR_RX_BUF_SIZE
int "Size of receive buffer for mcumgr fragments received over UART, in bytes" int "Size of receive buffer for mcumgr fragments received over UART, in bytes"

View file

@ -26,12 +26,12 @@ regs_config = {
} }
name_config = { name_config = {
'zephyr,console' : 'CONFIG_UART_CONSOLE_ON_DEV_NAME', 'zephyr,console' : 'DT_UART_CONSOLE_ON_DEV_NAME',
'zephyr,shell-uart' : 'CONFIG_UART_SHELL_ON_DEV_NAME', 'zephyr,shell-uart' : 'DT_UART_SHELL_ON_DEV_NAME',
'zephyr,bt-uart' : 'CONFIG_BT_UART_ON_DEV_NAME', 'zephyr,bt-uart' : 'DT_BT_UART_ON_DEV_NAME',
'zephyr,uart-pipe' : 'CONFIG_UART_PIPE_ON_DEV_NAME', 'zephyr,uart-pipe' : 'DT_UART_PIPE_ON_DEV_NAME',
'zephyr,bt-mon-uart' : 'CONFIG_BT_MONITOR_ON_DEV_NAME', 'zephyr,bt-mon-uart' : 'DT_BT_MONITOR_ON_DEV_NAME',
'zephyr,uart-mcumgr' : 'CONFIG_UART_MCUMGR_ON_DEV_NAME' 'zephyr,uart-mcumgr' : 'DT_UART_MCUMGR_ON_DEV_NAME'
} }

View file

@ -90,15 +90,14 @@ endchoice
if BT_DEBUG if BT_DEBUG
if !HAS_DTS
config BT_MONITOR_ON_DEV_NAME config BT_MONITOR_ON_DEV_NAME
string "Device Name of Bluetooth monitor logging UART" string "Device Name of Bluetooth monitor logging UART"
depends on BT_DEBUG_MONITOR depends on BT_DEBUG_MONITOR
default "$(dt_str_val,DT_BT_MONITOR_ON_DEV_NAME)" if HAS_DTS
default "UART_0" default "UART_0"
help help
This option specifies the name of UART device to be used This option specifies the name of UART device to be used
for the Bluetooth monitor logging. for the Bluetooth monitor logging.
endif
config BT_DEBUG_HCI_DRIVER config BT_DEBUG_HCI_DRIVER
bool "Bluetooth HCI driver debug" bool "Bluetooth HCI driver debug"

View file

@ -24,14 +24,13 @@ config SHELL_BACKEND_SERIAL
if SHELL_BACKEND_SERIAL if SHELL_BACKEND_SERIAL
if !HAS_DTS
config UART_SHELL_ON_DEV_NAME config UART_SHELL_ON_DEV_NAME
string "Device Name of UART Device for SHELL_BACKEND_SERIAL" string "Device Name of UART Device for SHELL_BACKEND_SERIAL"
default "$(dt_str_val,DT_UART_SHELL_ON_DEV_NAME)" if HAS_DTS
default "UART_0" default "UART_0"
help help
This option specifies the name of UART device to be used for the This option specifies the name of UART device to be used for the
SHELL UART backend. SHELL UART backend.
endif
# Internal config to enable UART interrupts if supported. # Internal config to enable UART interrupts if supported.
config SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN config SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN