Skip to content
Permalink
Browse files

drivers: uart_msp432p4xx: Get clock frequency from DTS

The uart_msp432p4xx driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
  • Loading branch information...
pizi-nordic authored and carlescufi committed Apr 11, 2019
1 parent 170e93b commit 69bbcec74ffacafbf25b186a31a84ef5bbece8ad
Showing with 2 additions and 1 deletion.
  1. +1 −1 drivers/serial/uart_msp432p4xx.c
  2. +1 −0 soc/arm/ti_simplelink/msp432p4xx/dts_fixup.h
@@ -39,7 +39,7 @@ static void uart_msp432p4xx_isr(void *arg);

static const struct uart_device_config uart_msp432p4xx_dev_cfg_0 = {
.base = (void *)DT_UART_MSP432P4XX_BASE_ADDRESS,
.sys_clk_freq = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
.sys_clk_freq = DT_UART_MSP432P4XX_CLOCK_FREQUENCY,
};

static struct uart_msp432p4xx_dev_data_t uart_msp432p4xx_dev_data_0 = {
@@ -12,6 +12,7 @@

#define DT_UART_MSP432P4XX_NAME DT_TI_MSP432P4XX_UART_40001000_LABEL
#define DT_UART_MSP432P4XX_BASE_ADDRESS DT_TI_MSP432P4XX_UART_40001000_BASE_ADDRESS
#define DT_UART_MSP432P4XX_CLOCK_FREQUENCY DT_TI_MSP432P4XX_UART_40001000_CLOCKS_CLOCK_FREQUENCY
#define DT_UART_MSP432P4XX_BAUD_RATE DT_TI_MSP432P4XX_UART_40001000_CURRENT_SPEED

/* End of SoC Level DTS fixup file */

0 comments on commit 69bbcec

Please sign in to comment.
You can’t perform that action at this time.