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 !HAS_DTS
config BLUETOOTH_UART_ON_DEV_NAME
default UART_QMSI_0_NAME
config UART_QMSI_0
def_bool y
endif
if !HAS_DTS
config UART_QMSI_0_BAUDRATE

View file

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

View file

@ -58,6 +58,7 @@ endchoice
endif # !BLUETOOTH_CONTROLLER
if !HAS_DTS
config BLUETOOTH_UART_ON_DEV_NAME
string "Device Name of UART Device for Bluetooth"
default "UART_0"
@ -65,6 +66,7 @@ config BLUETOOTH_UART_ON_DEV_NAME
help
This option specifies the name of UART device to be used
for Bluetooth.
endif
config BLUETOOTH_SPI_DEV_NAME
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
protocol data are handled by application provided callback.
if !HAS_DTS
config UART_PIPE_ON_DEV_NAME
string "Device Name of UART Device for pipe UART"
default "UART_0"
@ -186,6 +187,7 @@ config UART_PIPE_ON_DEV_NAME
help
This option specifies the name of UART device to be used
for pipe UART.
endif
config XTENSA_SIM_CONSOLE
bool

View file

@ -776,6 +776,18 @@ def main():
extract_string_prop(chosen['zephyr,console'], None, "label",
"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
# same as the flash base address
load_defs = {}