devicetree: Generate BLUETOOTH_UART,UART_PIPE etc config from dt

patch uses chosen property zephyr,bt-uart, zephyr,uart-pipe
and zephyr,bt-mon-uart to determine the uart instance to be
used for bluetooth,uart_pipe and bluetooth_monitor and generate
appropriate configs.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
This commit is contained in:
Savinay Dharmappa 2017-07-12 19:52:00 +05:30 committed by Kumar Gala
commit c1e5cbfd41
5 changed files with 22 additions and 2 deletions

View file

@ -198,11 +198,13 @@ endif # RTC
if BLUETOOTH_H4 if BLUETOOTH_H4
if !HAS_DTS
config BLUETOOTH_UART_ON_DEV_NAME config BLUETOOTH_UART_ON_DEV_NAME
default UART_QMSI_0_NAME default UART_QMSI_0_NAME
config UART_QMSI_0 config UART_QMSI_0
def_bool y def_bool y
endif
if !HAS_DTS if !HAS_DTS
config UART_QMSI_0_BAUDRATE config UART_QMSI_0_BAUDRATE

View file

@ -18,22 +18,24 @@ config PHYS_LOAD_ADDR
default 0x40010000 default 0x40010000
endif endif
if BLUETOOTH_H4 if BLUETOOTH_H4 && !HAS_DTS
config BLUETOOTH_UART_ON_DEV_NAME config BLUETOOTH_UART_ON_DEV_NAME
default UART_QMSI_0_NAME default UART_QMSI_0_NAME
endif endif
if UART_PIPE if UART_PIPE && !HAS_DTS
config UART_PIPE_ON_DEV_NAME config UART_PIPE_ON_DEV_NAME
default UART_QMSI_1_NAME default UART_QMSI_1_NAME
endif endif
if !HAS_DTS
config BLUETOOTH_MONITOR_ON_DEV_NAME config BLUETOOTH_MONITOR_ON_DEV_NAME
default UART_QMSI_1_NAME if BLUETOOTH_DEBUG_MONITOR default UART_QMSI_1_NAME if BLUETOOTH_DEBUG_MONITOR
endif
if FLASH && SPI if FLASH && SPI

View file

@ -58,6 +58,7 @@ endchoice
endif # !BLUETOOTH_CONTROLLER endif # !BLUETOOTH_CONTROLLER
if !HAS_DTS
config BLUETOOTH_UART_ON_DEV_NAME config BLUETOOTH_UART_ON_DEV_NAME
string "Device Name of UART Device for Bluetooth" string "Device Name of UART Device for Bluetooth"
default "UART_0" default "UART_0"
@ -65,6 +66,7 @@ config BLUETOOTH_UART_ON_DEV_NAME
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
config BLUETOOTH_SPI_DEV_NAME config BLUETOOTH_SPI_DEV_NAME
string "Device Name of SPI Device for Bluetooth" string "Device Name of SPI Device for Bluetooth"

View file

@ -179,6 +179,7 @@ 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 "UART_0" default "UART_0"
@ -186,6 +187,7 @@ config UART_PIPE_ON_DEV_NAME
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 XTENSA_SIM_CONSOLE config XTENSA_SIM_CONSOLE
bool bool

View file

@ -776,6 +776,18 @@ def main():
extract_string_prop(chosen['zephyr,console'], None, "label", extract_string_prop(chosen['zephyr,console'], None, "label",
"CONFIG_UART_CONSOLE_ON_DEV_NAME", defs) "CONFIG_UART_CONSOLE_ON_DEV_NAME", defs)
if 'zephyr,bt-uart' in chosen:
extract_string_prop(chosen['zephyr,bt-uart'], None, "label",
"CONFIG_BLUETOOTH_UART_ON_DEV_NAME", defs)
if 'zephyr,uart-pipe' in chosen:
extract_string_prop(chosen['zephyr,uart-pipe'], None, "label",
"CONFIG_UART_PIPE_ON_DEV_NAME", defs)
if 'zephyr,bt-mon-uart' in chosen:
extract_string_prop(chosen['zephyr,bt-mon-uart'], None, "label",
"CONFIG_BLUETOOTH_MONITOR_ON_DEV_NAME", defs)
# only compute the load offset if a code partition exists and it is not the # only compute the load offset if a code partition exists and it is not the
# same as the flash base address # same as the flash base address
load_defs = {} load_defs = {}