drivers: uart: miv: convert to DT_INST defines
Convert driver to fully use DT_INST_ defines. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
836b485377
commit
4372efe4ef
4 changed files with 6 additions and 21 deletions
|
@ -6,7 +6,6 @@ CONFIG_BOARD_M2GL025_MIV=y
|
||||||
CONFIG_CONSOLE=y
|
CONFIG_CONSOLE=y
|
||||||
CONFIG_SERIAL=y
|
CONFIG_SERIAL=y
|
||||||
CONFIG_UART_MIV=y
|
CONFIG_UART_MIV=y
|
||||||
CONFIG_UART_MIV_PORT_0=y
|
|
||||||
CONFIG_UART_CONSOLE=y
|
CONFIG_UART_CONSOLE=y
|
||||||
CONFIG_PLIC=y
|
CONFIG_PLIC=y
|
||||||
CONFIG_RISCV_MACHINE_TIMER=y
|
CONFIG_RISCV_MACHINE_TIMER=y
|
||||||
|
|
|
@ -9,10 +9,3 @@ config UART_MIV
|
||||||
select SERIAL_HAS_DRIVER
|
select SERIAL_HAS_DRIVER
|
||||||
help
|
help
|
||||||
This option enables the Mi-V serial driver.
|
This option enables the Mi-V serial driver.
|
||||||
|
|
||||||
config UART_MIV_PORT_0
|
|
||||||
bool "Enable Mi-V Port 0"
|
|
||||||
depends on UART_MIV
|
|
||||||
help
|
|
||||||
This tells the driver to configure the UART port at boot, depending on
|
|
||||||
the additional configuration options below.
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ static const struct uart_driver_api uart_miv_driver_api = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_UART_MIV_PORT_0
|
#ifdef DT_INST_0_MICROSEMI_COREUART
|
||||||
|
|
||||||
static struct uart_miv_data uart_miv_data_0;
|
static struct uart_miv_data uart_miv_data_0;
|
||||||
|
|
||||||
|
@ -388,16 +388,16 @@ static void uart_miv_irq_cfg_func_0(struct device *dev);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct uart_miv_device_config uart_miv_dev_cfg_0 = {
|
static const struct uart_miv_device_config uart_miv_dev_cfg_0 = {
|
||||||
.uart_addr = DT_MIV_UART_0_BASE_ADDR,
|
.uart_addr = DT_INST_0_MICROSEMI_COREUART_BASE_ADDRESS,
|
||||||
.sys_clk_freq = DT_MIV_UART_0_CLOCK_FREQUENCY,
|
.sys_clk_freq = DT_INST_0_MICROSEMI_COREUART_CLOCK_FREQUENCY,
|
||||||
.line_config = MIV_UART_0_LINECFG,
|
.line_config = MIV_UART_0_LINECFG,
|
||||||
.baud_rate = DT_MIV_UART_0_BAUD_RATE,
|
.baud_rate = DT_INST_0_MICROSEMI_COREUART_CURRENT_SPEED,
|
||||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
.cfg_func = uart_miv_irq_cfg_func_0,
|
.cfg_func = uart_miv_irq_cfg_func_0,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(uart_miv_0, DT_MIV_UART_0_NAME,
|
DEVICE_AND_API_INIT(uart_miv_0, DT_INST_0_MICROSEMI_COREUART_LABEL,
|
||||||
uart_miv_init, &uart_miv_data_0, &uart_miv_dev_cfg_0,
|
uart_miv_init, &uart_miv_data_0, &uart_miv_dev_cfg_0,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
(void *)&uart_miv_driver_api);
|
(void *)&uart_miv_driver_api);
|
||||||
|
@ -412,4 +412,4 @@ static void uart_miv_irq_cfg_func_0(struct device *dev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_UART_MIV_PORT_0 */
|
#endif /* DT_INST_0_MICROSEMI_COREUART */
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
/* SPDX-License-Identifier: Apache-2.0 */
|
|
||||||
|
|
||||||
/* UART 0 */
|
|
||||||
#define DT_MIV_UART_0_BASE_ADDR DT_MICROSEMI_COREUART_70001000_BASE_ADDRESS
|
|
||||||
#define DT_MIV_UART_0_CLOCK_FREQUENCY DT_MICROSEMI_COREUART_70001000_CLOCK_FREQUENCY
|
|
||||||
#define DT_MIV_UART_0_BAUD_RATE DT_MICROSEMI_COREUART_70001000_CURRENT_SPEED
|
|
||||||
#define DT_MIV_UART_0_NAME DT_MICROSEMI_COREUART_70001000_LABEL
|
|
Loading…
Add table
Add a link
Reference in a new issue