Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/serial/Kconfig.mspm0
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ config UART_MSPM0
depends on DT_HAS_TI_MSPM0_UART_ENABLED
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
select USE_MSPM0_DL_UART
select USE_MSPM0_DL_UNICOMM_UART if (HAS_MSP_UNICOMM)
select USE_MSPM0_DL_UART if !(HAS_MSP_UNICOMM)
select PINCTRL
help
This option enables the TI MSPM0 UART driver.
21 changes: 19 additions & 2 deletions drivers/serial/uart_mspm0.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@
#include <zephyr/irq.h>

/* Driverlib includes */
#ifdef CONFIG_HAS_MSP_UNICOMM
#include <ti/driverlib/dl_unicommuart.h>
#else
#include <ti/driverlib/dl_uart_main.h>
#endif

struct uart_mspm0_config {
#ifdef CONFIG_HAS_MSP_UNICOMM
UNICOMM_Inst_Regs *regs;
#else
UART_Regs *regs;
#endif
uint32_t current_speed;
const struct mspm0_sys_clock *clock_subsys;
const struct pinctrl_dev_config *pinctrl;
Expand Down Expand Up @@ -313,8 +321,17 @@ static DEVICE_API(uart, uart_mspm0_driver_api) = {
\
MSP_UART_IRQ_DEFINE(index); \
\
static const struct uart_mspm0_config uart_mspm0_cfg_##index = { \
.regs = (UART_Regs *)DT_INST_REG_ADDR(index), \
IF_ENABLED(CONFIG_HAS_MSP_UNICOMM, \
(static UNICOMM_Inst_Regs uart_mspm0_uc_regs_##index = { \
.inst = (UNICOMM_Regs *)DT_INST_REG_ADDR(index), \
.uart = (UNICOMMUART_Regs *)UC_UART_BASE(DT_INST_REG_ADDR(index)), \
.fixedMode = DT_CHILD_NUM(DT_PARENT(DT_DRV_INST(index))) == 1, \
};) \
) \
\
static const struct uart_mspm0_config uart_mspm0_cfg_##index = { \
.regs = COND_CODE_1(CONFIG_HAS_MSP_UNICOMM, \
(&uart_mspm0_uc_regs_##index), ((UART_Regs *)DT_INST_REG_ADDR(index))), \
.current_speed = DT_INST_PROP(index, current_speed), \
.pinctrl = PINCTRL_DT_INST_DEV_CONFIG_GET(index), \
.clock_subsys = &mspm0_uart_sys_clock##index, \
Expand Down
3 changes: 3 additions & 0 deletions modules/Kconfig.mspm0
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ config USE_MSPM0_DL_GPIO
config USE_MSPM0_DL_UART
bool

config USE_MSPM0_DL_UNICOMM_UART
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never used but defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in the kconfig of the serial driver to pull in the correct APIs from the hal.

bool

config USE_MSPM0_DL_TIMER
bool