diff options
author | Daniel Leung <daniel.leung@intel.com> | 2015-12-01 08:42:19 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2016-02-05 20:24:56 -0500 |
commit | 5faca5067acf2493404e10daeea01c9c57478228 (patch) | |
tree | 3f60c6aa5409134a4cde363f89bc6a60f3a7183f | |
parent | 3d361603e55968f6efd573f2f1682e8d721be381 (diff) |
uart_pipe: let UART driver do the initialization
Remove the call to uart_init(), and let the UART drivers take care of
the port initialization.
Change-Id: Id3e46135ab993cb6596b1fb5339ab1664c65ab40
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
-rw-r--r-- | arch/arm/platforms/ti_lm3s6965/board.h | 2 | ||||
-rw-r--r-- | arch/x86/platforms/ia32/board.h | 2 | ||||
-rw-r--r-- | drivers/console/uart_pipe.c | 13 |
3 files changed, 2 insertions, 15 deletions
diff --git a/arch/arm/platforms/ti_lm3s6965/board.h b/arch/arm/platforms/ti_lm3s6965/board.h index 903357a05..bfe5ee150 100644 --- a/arch/arm/platforms/ti_lm3s6965/board.h +++ b/arch/arm/platforms/ti_lm3s6965/board.h @@ -119,10 +119,8 @@ extern struct device * const uart_devs[]; /* Pipe UART definitions */ #define CONFIG_UART_PIPE_INDEX 2 -#define CONFIG_UART_PIPE_BAUDRATE 115200 #define CONFIG_UART_PIPE_IRQ IRQ_UART2 #define CONFIG_UART_PIPE_INT_PRI 3 -#define CONFIG_UART_PIPE_FREQ SYSCLK_DEFAULT_IOSC_HZ #endif /* !_ASMLANGUAGE */ diff --git a/arch/x86/platforms/ia32/board.h b/arch/x86/platforms/ia32/board.h index 2a9131a03..cf97cae3f 100644 --- a/arch/x86/platforms/ia32/board.h +++ b/arch/x86/platforms/ia32/board.h @@ -59,10 +59,8 @@ /* Pipe UART definitions */ #define CONFIG_UART_PIPE_INDEX 1 -#define CONFIG_UART_PIPE_BAUDRATE CONFIG_UART_NS16550_PORT_1_BAUD_RATE #define CONFIG_UART_PIPE_IRQ CONFIG_UART_NS16550_PORT_1_IRQ #define CONFIG_UART_PIPE_INT_PRI CONFIG_UART_NS16550_PORT_1_IRQ_PRI -#define CONFIG_UART_PIPE_FREQ CONFIG_UART_NS16550_PORT_1_CLK_FREQ #ifndef _ASMLANGUAGE extern struct device * const uart_devs[]; diff --git a/drivers/console/uart_pipe.c b/drivers/console/uart_pipe.c index 0d07daefb..3a3ff16ec 100644 --- a/drivers/console/uart_pipe.c +++ b/drivers/console/uart_pipe.c @@ -74,10 +74,8 @@ IRQ_CONNECT_STATIC(uart_pipe, CONFIG_UART_PIPE_IRQ, CONFIG_UART_PIPE_INT_PRI, uart_pipe_isr, 0, UART_IRQ_FLAGS); -static void uart_pipe_setup(struct device *uart, struct uart_init_info *info) +static void uart_pipe_setup(struct device *uart) { - uart_init(uart, info); - uart_irq_rx_disable(uart); uart_irq_tx_disable(uart); IRQ_CONFIG(uart_pipe, uart_irq_get(uart), 0); @@ -95,17 +93,10 @@ static void uart_pipe_setup(struct device *uart, struct uart_init_info *info) void uart_pipe_register(uint8_t *buf, size_t len, uart_pipe_recv_cb cb) { - struct uart_init_info info = { - .options = 0, - .sys_clk_freq = CONFIG_UART_PIPE_FREQ, - .baud_rate = CONFIG_UART_PIPE_BAUDRATE, - .irq_pri = CONFIG_UART_PIPE_INT_PRI, - }; - recv_buf = buf; recv_buf_len = len; app_cb = cb; - uart_pipe_setup(UART, &info); + uart_pipe_setup(UART); } #endif |