Skip to content
Permalink
Browse files

drivers/uart: Remove DTS fixups for SiFive UART

Change the DT macros used by the SiFive UART driver so that fixups
are no longer required.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
  • Loading branch information...
nategraff-sifive authored and nashif committed Mar 19, 2019
1 parent 10ddb62 commit a11ebbd48a5810c37564509b6bde667d42524334
Showing with 8 additions and 25 deletions.
  1. +8 −8 drivers/serial/uart_sifive.c
  2. +0 −17 soc/riscv32/riscv-privilege/sifive-freedom/dts_fixup.h
@@ -380,17 +380,17 @@ static void uart_sifive_irq_cfg_func_0(void);
#endif

static const struct uart_sifive_device_config uart_sifive_dev_cfg_0 = {
.port = DT_SIFIVE_UART_0_BASE_ADDR,
.sys_clk_freq = DT_SIFIVE_UART_0_CLK_FREQ,
.baud_rate = DT_SIFIVE_UART_0_CURRENT_SPEED,
.port = DT_SIFIVE_UART0_0_BASE_ADDRESS,
.sys_clk_freq = DT_SIFIVE_UART0_0_CLOCK_FREQUENCY,
.baud_rate = DT_SIFIVE_UART0_0_CURRENT_SPEED,
.rxcnt_irq = CONFIG_UART_SIFIVE_PORT_0_RXCNT_IRQ,
.txcnt_irq = CONFIG_UART_SIFIVE_PORT_0_TXCNT_IRQ,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
.cfg_func = uart_sifive_irq_cfg_func_0,
#endif
};

DEVICE_AND_API_INIT(uart_sifive_0, DT_SIFIVE_UART_0_LABEL,
DEVICE_AND_API_INIT(uart_sifive_0, DT_SIFIVE_UART0_0_LABEL,
uart_sifive_init,
&uart_sifive_data_0, &uart_sifive_dev_cfg_0,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
@@ -419,17 +419,17 @@ static void uart_sifive_irq_cfg_func_1(void);
#endif

static const struct uart_sifive_device_config uart_sifive_dev_cfg_1 = {
.port = DT_SIFIVE_UART_1_BASE_ADDR,
.sys_clk_freq = DT_SIFIVE_UART_1_CLK_FREQ,
.baud_rate = DT_SIFIVE_UART_1_CURRENT_SPEED,
.port = DT_SIFIVE_UART0_1_BASE_ADDRESS,
.sys_clk_freq = DT_SIFIVE_UART0_1_CLOCK_FREQUENCY,
.baud_rate = DT_SIFIVE_UART0_1_CURRENT_SPEED,
.rxcnt_irq = CONFIG_UART_SIFIVE_PORT_1_RXCNT_IRQ,
.txcnt_irq = CONFIG_UART_SIFIVE_PORT_1_TXCNT_IRQ,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
.cfg_func = uart_sifive_irq_cfg_func_1,
#endif
};

DEVICE_AND_API_INIT(uart_sifive_1, DT_SIFIVE_UART_1_LABEL,
DEVICE_AND_API_INIT(uart_sifive_1, DT_SIFIVE_UART0_1_LABEL,
uart_sifive_init,
&uart_sifive_data_1, &uart_sifive_dev_cfg_1,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
@@ -50,20 +50,3 @@
#define DT_PLIC_REG_BASE_ADDR \
DT_RISCV_PLIC0_C000000_REG_BASE_ADDRESS

/* UART 0 */
#define DT_SIFIVE_UART_0_BASE_ADDR DT_SIFIVE_UART0_10013000_BASE_ADDRESS
#define DT_SIFIVE_UART_0_CURRENT_SPEED DT_SIFIVE_UART0_10013000_CURRENT_SPEED
#define DT_SIFIVE_UART_0_IRQ_0 DT_SIFIVE_UART0_10013000_IRQ_0
#define DT_SIFIVE_UART_0_LABEL DT_SIFIVE_UART0_10013000_LABEL
#define DT_SIFIVE_UART_0_SIZE DT_SIFIVE_UART0_10013000_SIZE
#define DT_SIFIVE_UART_0_CLK_FREQ DT_SIFIVE_UART0_10013000_CLOCK_FREQUENCY

/* UART 1 */
#define DT_SIFIVE_UART_1_BASE_ADDR DT_SIFIVE_UART0_10023000_BASE_ADDRESS
#define DT_SIFIVE_UART_1_CURRENT_SPEED DT_SIFIVE_UART0_10023000_CURRENT_SPEED
#define DT_SIFIVE_UART_1_IRQ_0 DT_SIFIVE_UART0_10023000_IRQ_0
#define DT_SIFIVE_UART_1_LABEL DT_SIFIVE_UART0_10023000_LABEL
#define DT_SIFIVE_UART_1_SIZE DT_SIFIVE_UART0_10023000_SIZE
#define DT_SIFIVE_UART_1_LABEL DT_SIFIVE_UART0_10023000_LABEL
#define DT_SIFIVE_UART_1_CLK_FREQ DT_SIFIVE_UART0_10023000_CLOCK_FREQUENCY

0 comments on commit a11ebbd

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