diff --git a/boards/arm/arduino_due/arduino_due_defconfig b/boards/arm/arduino_due/arduino_due_defconfig index 179648c839..9651d88447 100644 --- a/boards/arm/arduino_due/arduino_due_defconfig +++ b/boards/arm/arduino_due/arduino_due_defconfig @@ -9,6 +9,5 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_SAM=y -CONFIG_UART_SAM_PORT_0=y CONFIG_SOC_ATMEL_SAM3X_EXT_MAINCK=y CONFIG_WDT_DISABLE_AT_BOOT=y diff --git a/boards/arm/sam4e_xpro/sam4e_xpro_defconfig b/boards/arm/sam4e_xpro/sam4e_xpro_defconfig index b4bac94088..d0f00f72a9 100644 --- a/boards/arm/sam4e_xpro/sam4e_xpro_defconfig +++ b/boards/arm/sam4e_xpro/sam4e_xpro_defconfig @@ -7,7 +7,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_SAM=y -CONFIG_UART_SAM_PORT_0=y CONFIG_BOARD_SAM4E_XPRO=y CONFIG_SOC_ATMEL_SAM4E_EXT_MAINCK=y CONFIG_GPIO_SAM=y diff --git a/boards/arm/sam4s_xplained/sam4s_xplained_defconfig b/boards/arm/sam4s_xplained/sam4s_xplained_defconfig index ec53783189..b352b51799 100644 --- a/boards/arm/sam4s_xplained/sam4s_xplained_defconfig +++ b/boards/arm/sam4s_xplained/sam4s_xplained_defconfig @@ -7,7 +7,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_SAM=y -CONFIG_UART_SAM_PORT_0=y CONFIG_BOARD_SAM4S_XPLAINED=y CONFIG_SOC_ATMEL_SAM4S_EXT_MAINCK=y CONFIG_GPIO=y diff --git a/drivers/serial/Kconfig.uart_sam b/drivers/serial/Kconfig.uart_sam index a955412178..925707c2b8 100644 --- a/drivers/serial/Kconfig.uart_sam +++ b/drivers/serial/Kconfig.uart_sam @@ -4,98 +4,10 @@ # Copyright (c) 2018 Justin Watson # SPDX-License-Identifier: Apache-2.0 -menuconfig UART_SAM +config UART_SAM bool "Atmel SAM MCU family UART driver" depends on SOC_FAMILY_SAM select SERIAL_HAS_DRIVER select SERIAL_SUPPORT_INTERRUPT help This option enables the UARTx driver for Atmel SAM MCUs. - -# ---------- Port 0 ---------- - -config UART_SAM_PORT_0 - bool "Enable UART0" - depends on UART_SAM - help - Enable UART0 at boot. - -# ---------- Port 1 ---------- - -config UART_SAM_PORT_1 - bool "Enable UART1" - depends on UART_SAM - help - Enable UART1 at boot. - -choice UART_SAM_PORT_1_PIN_TX - prompt "TX pin" - depends on UART_SAM_PORT_1 - depends on SOC_SERIES_SAME70 || \ - SOC_SERIES_SAMV71 - - config UART_SAM_PORT_1_PIN_TX_PA4 - bool "PA4" - - config UART_SAM_PORT_1_PIN_TX_PA6 - bool "PA6" - - config UART_SAM_PORT_1_PIN_TX_PD26 - bool "PD26" -endchoice - -# ---------- Port 2 ---------- - -config UART_SAM_PORT_2 - bool "Enable UART2" - depends on UART_SAM - depends on SOC_SERIES_SAME70 || \ - SOC_SERIES_SAMV71 - help - Enable UART2 at boot - -# ---------- Port 3 ---------- - -config UART_SAM_PORT_3 - bool "Enable UART3" - depends on UART_SAM - depends on SOC_SERIES_SAME70 || \ - SOC_SERIES_SAMV71 - help - Enable UART3 at boot - -choice UART_SAM_PORT_3_PIN_TX - prompt "TX pin" - depends on UART_SAM_PORT_3 - depends on SOC_SERIES_SAME70 || \ - SOC_SERIES_SAMV71 - - config UART_SAM_PORT_3_PIN_TX_PD30 - bool "PD30" - - config UART_SAM_PORT_3_PIN_TX_PD31 - bool "PD31" -endchoice - -# ---------- Port 4 ---------- - -config UART_SAM_PORT_4 - bool "Enable UART4" - depends on UART_SAM - depends on SOC_SERIES_SAME70 || \ - SOC_SERIES_SAMV71 - help - Enable UART4 at boot - -choice UART_SAM_PORT_4_PIN_TX - prompt "TX pin" - depends on UART_SAM_PORT_4 - depends on SOC_SERIES_SAME70 || \ - SOC_SERIES_SAMV71 - - config UART_SAM_PORT_4_PIN_TX_PD3 - bool "PD3" - - config UART_SAM_PORT_4_PIN_TX_PD19 - bool "PD19" -endchoice diff --git a/drivers/serial/uart_sam.c b/drivers/serial/uart_sam.c index 080db7ddf6..9bcaa02a56 100644 --- a/drivers/serial/uart_sam.c +++ b/drivers/serial/uart_sam.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT atmel_sam_uart + /** @file * @brief UART driver for Atmel SAM MCU family. * @@ -19,50 +21,6 @@ #include #include -/* - * Verify Kconfig configuration - */ - -#if CONFIG_UART_SAM_PORT_0 == 1 - -#if DT_UART_SAM_PORT_0_BAUD_RATE == 0 -#error "DT_UART_SAM_PORT_0_BAUD_RATE has to be bigger than 0" -#endif - -#endif - -#if CONFIG_UART_SAM_PORT_1 == 1 - -#if DT_UART_SAM_PORT_1_BAUD_RATE == 0 -#error "DT_UART_SAM_PORT_1_BAUD_RATE has to be bigger than 0" -#endif - -#endif - -#if CONFIG_UART_SAM_PORT_2 == 1 - -#if DT_UART_SAM_PORT_2_BAUD_RATE == 0 -#error "DT_UART_SAM_PORT_2_BAUD_RATE has to be bigger than 0" -#endif - -#endif - -#if CONFIG_UART_SAM_PORT_3 == 1 - -#if DT_UART_SAM_PORT_3_BAUD_RATE == 0 -#error "DT_UART_SAM_PORT_3_BAUD_RATE has to be bigger than 0" -#endif - -#endif - -#if CONFIG_UART_SAM_PORT_4 == 1 - -#if DT_UART_SAM_PORT_4_BAUD_RATE == 0 -#error "DT_UART_SAM_PORT_4_BAUD_RATE has to be bigger than 0" -#endif - -#endif - /* Device constant configuration parameters */ struct uart_sam_dev_cfg { Uart *regs; @@ -364,206 +322,53 @@ static const struct uart_driver_api uart_sam_driver_api = { #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ }; -/* UART0 */ - -#ifdef CONFIG_UART_SAM_PORT_0 +#define UART_SAM_DECLARE_CFG(n, IRQ_FUNC_INIT) \ + static const struct uart_sam_dev_cfg uart##n##_sam_config = { \ + .regs = (Uart *)DT_INST_REG_ADDR(n), \ + .periph_id = DT_INST_PROP(n, peripheral_id), \ + \ + .pin_rx = ATMEL_SAM_DT_PIN(n, 0), \ + .pin_tx = ATMEL_SAM_DT_PIN(n, 1), \ + \ + IRQ_FUNC_INIT \ + } #ifdef CONFIG_UART_INTERRUPT_DRIVEN -/* Forward declare function */ -static void uart0_sam_irq_config_func(struct device *port); -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -static const struct uart_sam_dev_cfg uart0_sam_config = { - .regs = UART0, - .periph_id = ID_UART0, - .pin_rx = PIN_UART0_RXD, - .pin_tx = PIN_UART0_TXD, - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN - .irq_config_func = uart0_sam_irq_config_func, -#endif -}; - -static struct uart_sam_dev_data uart0_sam_data = { - .baud_rate = DT_UART_SAM_PORT_0_BAUD_RATE, -}; - -DEVICE_AND_API_INIT(uart0_sam, DT_UART_SAM_PORT_0_NAME, &uart_sam_init, - &uart0_sam_data, &uart0_sam_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_sam_driver_api); - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -static void uart0_sam_irq_config_func(struct device *port) -{ - IRQ_CONNECT(DT_UART_SAM_PORT_0_IRQ, - DT_UART_SAM_PORT_0_IRQ_PRIO, - uart_sam_isr, - DEVICE_GET(uart0_sam), 0); - irq_enable(DT_UART_SAM_PORT_0_IRQ); -} -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -#endif /* CONFIG_UART_SAM_PORT_0 */ - -/* UART1 */ - -#ifdef CONFIG_UART_SAM_PORT_1 - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -/* Forward declare function */ -static void uart1_sam_irq_config_func(struct device *port); -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -static const struct uart_sam_dev_cfg uart1_sam_config = { - .regs = UART1, - .periph_id = ID_UART1, - .pin_rx = PIN_UART1_RXD, - .pin_tx = PIN_UART1_TXD, - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN - .irq_config_func = uart1_sam_irq_config_func, -#endif -}; - -static struct uart_sam_dev_data uart1_sam_data = { - .baud_rate = DT_UART_SAM_PORT_1_BAUD_RATE, -}; - -DEVICE_AND_API_INIT(uart1_sam, DT_UART_SAM_PORT_1_NAME, &uart_sam_init, - &uart1_sam_data, &uart1_sam_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_sam_driver_api); - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -static void uart1_sam_irq_config_func(struct device *port) -{ - IRQ_CONNECT(DT_UART_SAM_PORT_1_IRQ, - DT_UART_SAM_PORT_1_IRQ_PRIO, - uart_sam_isr, - DEVICE_GET(uart1_sam), 0); - irq_enable(DT_UART_SAM_PORT_1_IRQ); -} -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -#endif /* CONFIG_UART_SAM_PORT_1 */ - -/* UART2 */ - -#ifdef CONFIG_UART_SAM_PORT_2 - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -/* Forward declare function */ -static void uart2_sam_irq_config_func(struct device *port); -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -static const struct uart_sam_dev_cfg uart2_sam_config = { - .regs = UART2, - .periph_id = ID_UART2, - .pin_rx = PIN_UART2_RXD, - .pin_tx = PIN_UART2_TXD, - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN - .irq_config_func = uart2_sam_irq_config_func, -#endif -}; - -static struct uart_sam_dev_data uart2_sam_data = { - .baud_rate = DT_UART_SAM_PORT_2_BAUD_RATE, -}; - -DEVICE_AND_API_INIT(uart2_sam, DT_UART_SAM_PORT_2_NAME, &uart_sam_init, - &uart2_sam_data, &uart2_sam_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_sam_driver_api); - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -static void uart2_sam_irq_config_func(struct device *port) -{ - IRQ_CONNECT(DT_UART_SAM_PORT_2_IRQ, - DT_UART_SAM_PORT_2_IRQ_PRIO, - uart_sam_isr, - DEVICE_GET(uart2_sam), 0); - irq_enable(DT_UART_SAM_PORT_2_IRQ); -} -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - +#define UART_SAM_CONFIG_FUNC(n) \ + static void uart##n##_sam_irq_config_func(struct device *port) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(n), \ + DT_INST_IRQ(n, priority), \ + uart_sam_isr, \ + DEVICE_GET(uart##n##_sam), 0); \ + irq_enable(DT_INST_IRQN(n)); \ + } +#define UART_SAM_IRQ_CFG_FUNC_INIT(n) \ + .irq_config_func = uart##n##_sam_irq_config_func +#define UART_SAM_INIT_CFG(n) \ + UART_SAM_DECLARE_CFG(n, UART_SAM_IRQ_CFG_FUNC_INIT(n)) +#else +#define UART_SAM_CONFIG_FUNC(n) +#define UART_SAM_IRQ_CFG_FUNC_INIT +#define UART_SAM_INIT_CFG(n) \ + UART_SAM_DECLARE_CFG(n, UART_SAM_IRQ_CFG_FUNC_INIT) #endif -/* UART3 */ +#define UART_SAM_INIT(n) \ + static struct uart_sam_dev_data uart##n##_sam_data = { \ + .baud_rate = DT_INST_PROP(n, current_speed), \ + }; \ + \ + static const struct uart_sam_dev_cfg uart##n##_sam_config; \ + \ + DEVICE_AND_API_INIT(uart##n##_sam, DT_INST_LABEL(n), \ + &uart_sam_init, &uart##n##_sam_data, \ + &uart##n##_sam_config, PRE_KERNEL_1, \ + CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + &uart_sam_driver_api); \ + \ + UART_SAM_CONFIG_FUNC(n) \ + \ + UART_SAM_INIT_CFG(n) -#ifdef CONFIG_UART_SAM_PORT_3 - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -/* Forward declare function */ -static void uart3_sam_irq_config_func(struct device *port); -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -static const struct uart_sam_dev_cfg uart3_sam_config = { - .regs = UART3, - .periph_id = ID_UART3, - .pin_rx = PIN_UART3_RXD, - .pin_tx = PIN_UART3_TXD, - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN - .irq_config_func = uart3_sam_irq_config_func, -#endif -}; - -static struct uart_sam_dev_data uart3_sam_data = { - .baud_rate = DT_UART_SAM_PORT_3_BAUD_RATE, -}; - -DEVICE_AND_API_INIT(uart3_sam, DT_UART_SAM_PORT_3_NAME, &uart_sam_init, - &uart3_sam_data, &uart3_sam_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_sam_driver_api); - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -static void uart3_sam_irq_config_func(struct device *port) -{ - IRQ_CONNECT(DT_UART_SAM_PORT_3_IRQ, - DT_UART_SAM_PORT_3_IRQ_PRIO, - uart_sam_isr, - DEVICE_GET(uart3_sam), 0); - irq_enable(DT_UART_SAM_PORT_3_IRQ); -} -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -#endif - -/* UART4 */ - -#ifdef CONFIG_UART_SAM_PORT_4 - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -/* Forward declare function */ -static void uart4_sam_irq_config_func(struct device *port); -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -static const struct uart_sam_dev_cfg uart4_sam_config = { - .regs = UART4, - .periph_id = ID_UART4, - .pin_rx = PIN_UART4_RXD, - .pin_tx = PIN_UART4_TXD, - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN - .irq_config_func = uart4_sam_irq_config_func, -#endif -}; - -static struct uart_sam_dev_data uart4_sam_data = { - .baud_rate = DT_UART_SAM_PORT_4_BAUD_RATE, -}; - -DEVICE_AND_API_INIT(uart4_sam, DT_UART_SAM_PORT_4_NAME, &uart_sam_init, - &uart4_sam_data, &uart4_sam_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_sam_driver_api); - -#ifdef CONFIG_UART_INTERRUPT_DRIVEN -static void uart4_sam_irq_config_func(struct device *port) -{ - IRQ_CONNECT(DT_UART_SAM_PORT_4_IRQ, - DT_UART_SAM_PORT_4_IRQ_PRIO, - uart_sam_isr, - DEVICE_GET(uart4_sam), 0); - irq_enable(DT_UART_SAM_PORT_4_IRQ); -} -#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ - -#endif +DT_INST_FOREACH(UART_SAM_INIT) diff --git a/soc/arm/atmel_sam/sam3x/dts_fixup.h b/soc/arm/atmel_sam/sam3x/dts_fixup.h index 0dd87efdac..0eea85e8c7 100644 --- a/soc/arm/atmel_sam/sam3x/dts_fixup.h +++ b/soc/arm/atmel_sam/sam3x/dts_fixup.h @@ -45,11 +45,6 @@ #define DT_I2C_1_IRQ_PRI DT_ATMEL_SAM_I2C_TWI_40090000_IRQ_0_PRIORITY #define DT_I2C_1_PERIPHERAL_ID DT_ATMEL_SAM_I2C_TWI_40090000_PERIPHERAL_ID -#define DT_UART_SAM_PORT_0_NAME DT_ATMEL_SAM_UART_400E0800_LABEL -#define DT_UART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_UART_400E0800_CURRENT_SPEED -#define DT_UART_SAM_PORT_0_IRQ DT_ATMEL_SAM_UART_400E0800_IRQ_0 -#define DT_UART_SAM_PORT_0_IRQ_PRIO DT_ATMEL_SAM_UART_400E0800_IRQ_0_PRIORITY - #define DT_USART_SAM_PORT_0_NAME DT_ATMEL_SAM_USART_40098000_LABEL #define DT_USART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_USART_40098000_CURRENT_SPEED #define DT_USART_SAM_PORT_1_NAME DT_ATMEL_SAM_USART_4009C000_LABEL diff --git a/soc/arm/atmel_sam/sam3x/soc_pinmap.h b/soc/arm/atmel_sam/sam3x/soc_pinmap.h index d7b35ab804..f92021a729 100644 --- a/soc/arm/atmel_sam/sam3x/soc_pinmap.h +++ b/soc/arm/atmel_sam/sam3x/soc_pinmap.h @@ -15,13 +15,6 @@ #include -/* Universal Asynchronous Receiver Transmitter (UART) */ - -#define PIN_UART0_RXD {PIO_PA8A_URXD, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} -#define PIN_UART0_TXD {PIO_PA9A_UTXD, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} - -#define PINS_UART0 {PIN_UART0_RXD, PIN_UART0_TXD} - /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */ #define PIN_USART0_RXD {PIO_PA10A_RXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} diff --git a/soc/arm/atmel_sam/sam4e/dts_fixup.h b/soc/arm/atmel_sam/sam4e/dts_fixup.h index 3f10335dee..a5ae9f20bb 100644 --- a/soc/arm/atmel_sam/sam4e/dts_fixup.h +++ b/soc/arm/atmel_sam/sam4e/dts_fixup.h @@ -54,15 +54,6 @@ #define DT_SPI_0_IRQ_PRI DT_ATMEL_SAM_SPI_40088000_IRQ_0_PRIORITY #define DT_SPI_0_PERIPHERAL_ID DT_ATMEL_SAM_SPI_40088000_PERIPHERAL_ID -#define DT_UART_SAM_PORT_0_NAME DT_ATMEL_SAM_UART_400E0600_LABEL -#define DT_UART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_UART_400E0600_CURRENT_SPEED -#define DT_UART_SAM_PORT_0_IRQ DT_ATMEL_SAM_UART_400E0600_IRQ_0 -#define DT_UART_SAM_PORT_0_IRQ_PRIO DT_ATMEL_SAM_UART_400E0600_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_1_NAME DT_ATMEL_SAM_UART_40060600_LABEL -#define DT_UART_SAM_PORT_1_BAUD_RATE DT_ATMEL_SAM_UART_40060600_CURRENT_SPEED -#define DT_UART_SAM_PORT_1_IRQ DT_ATMEL_SAM_UART_40060600_IRQ_0 -#define DT_UART_SAM_PORT_1_IRQ_PRIO DT_ATMEL_SAM_UART_40060600_IRQ_0_PRIORITY - #define DT_USART_SAM_PORT_0_NAME DT_ATMEL_SAM_USART_400A0000_LABEL #define DT_USART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_USART_400A0000_CURRENT_SPEED #define DT_USART_SAM_PORT_0_IRQ DT_ATMEL_SAM_USART_400A0000_IRQ_0 diff --git a/soc/arm/atmel_sam/sam4e/soc_pinmap.h b/soc/arm/atmel_sam/sam4e/soc_pinmap.h index a42dda6bb1..1d62e0fa25 100644 --- a/soc/arm/atmel_sam/sam4e/soc_pinmap.h +++ b/soc/arm/atmel_sam/sam4e/soc_pinmap.h @@ -17,18 +17,6 @@ #include -/* Universal Asynchronous Receiver Transmitter (UART) */ - -#define PIN_UART0_RXD {PIO_PA9A_URXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} -#define PIN_UART0_TXD {PIO_PA10A_UTXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} - -#define PINS_UART0 {PIN_UART0_RXD, PIN_UART0_TXD} - -#define PIN_UART1_RXD {PIO_PA5C_URXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#define PIN_UART1_TXD {PIO_PA6C_UTXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} - -#define PINS_UART1 {PIN_UART1_RXD, PIN_UART1_TXD} - /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */ #define PIN_USART0_RXD {PIO_PB0C_RXD0, PIOB, ID_PIOB, SOC_GPIO_FUNC_C} diff --git a/soc/arm/atmel_sam/sam4s/dts_fixup.h b/soc/arm/atmel_sam/sam4s/dts_fixup.h index 38945bdcb6..63d79fe726 100644 --- a/soc/arm/atmel_sam/sam4s/dts_fixup.h +++ b/soc/arm/atmel_sam/sam4s/dts_fixup.h @@ -45,15 +45,6 @@ #define DT_SPI_0_IRQ_PRI DT_ATMEL_SAM_SPI_40008000_IRQ_0_PRIORITY #define DT_SPI_0_PERIPHERAL_ID DT_ATMEL_SAM_SPI_40008000_PERIPHERAL_ID -#define DT_UART_SAM_PORT_0_NAME DT_ATMEL_SAM_UART_400E0600_LABEL -#define DT_UART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_UART_400E0600_CURRENT_SPEED -#define DT_UART_SAM_PORT_0_IRQ DT_ATMEL_SAM_UART_400E0600_IRQ_0 -#define DT_UART_SAM_PORT_0_IRQ_PRIO DT_ATMEL_SAM_UART_400E0600_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_1_NAME DT_ATMEL_SAM_UART_400E0800_LABEL -#define DT_UART_SAM_PORT_1_BAUD_RATE DT_ATMEL_SAM_UART_400E0800_CURRENT_SPEED -#define DT_UART_SAM_PORT_1_IRQ DT_ATMEL_SAM_UART_400E0800_IRQ_0 -#define DT_UART_SAM_PORT_1_IRQ_PRIO DT_ATMEL_SAM_UART_400E0800_IRQ_0_PRIORITY - #define DT_USART_SAM_PORT_0_NAME DT_ATMEL_SAM_USART_40024000_LABEL #define DT_USART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_USART_40024000_CURRENT_SPEED #define DT_USART_SAM_PORT_0_IRQ DT_ATMEL_SAM_USART_40024000_IRQ_0 diff --git a/soc/arm/atmel_sam/sam4s/soc_pinmap.h b/soc/arm/atmel_sam/sam4s/soc_pinmap.h index 5fab6408b7..827c13ba84 100644 --- a/soc/arm/atmel_sam/sam4s/soc_pinmap.h +++ b/soc/arm/atmel_sam/sam4s/soc_pinmap.h @@ -16,18 +16,6 @@ #include -/* Universal Asynchronous Receiver Transmitter (UART) */ - -#define PIN_UART0_RXD {PIO_PA9A_URXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} -#define PIN_UART0_TXD {PIO_PA10A_UTXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} - -#define PINS_UART0 {PIN_UART0_RXD, PIN_UART0_TXD} - -#define PIN_UART1_RXD {PIO_PB2A_URXD1, PIOB, ID_PIOB, SOC_GPIO_FUNC_A} -#define PIN_UART1_TXD {PIO_PB3A_UTXD1, PIOB, ID_PIOB, SOC_GPIO_FUNC_A} - -#define PINS_UART1 {PIN_UART1_RXD, PIN_UART1_TXD} - /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */ #define PIN_USART0_RXD {PIO_PA5A_RXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} diff --git a/soc/arm/atmel_sam/same70/dts_fixup.h b/soc/arm/atmel_sam/same70/dts_fixup.h index 602f88bc19..f53d688e81 100644 --- a/soc/arm/atmel_sam/same70/dts_fixup.h +++ b/soc/arm/atmel_sam/same70/dts_fixup.h @@ -66,26 +66,6 @@ #define DT_SPI_1_IRQ_PRI DT_ATMEL_SAM_SPI_40058000_IRQ_0_PRIORITY #define DT_SPI_1_PERIPHERAL_ID DT_ATMEL_SAM_SPI_40058000_PERIPHERAL_ID -#define DT_UART_SAM_PORT_0_NAME DT_ATMEL_SAM_UART_400E0800_LABEL -#define DT_UART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_UART_400E0800_CURRENT_SPEED -#define DT_UART_SAM_PORT_0_IRQ DT_ATMEL_SAM_UART_400E0800_IRQ_0 -#define DT_UART_SAM_PORT_0_IRQ_PRIO DT_ATMEL_SAM_UART_400E0800_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_1_NAME DT_ATMEL_SAM_UART_400E0A00_LABEL -#define DT_UART_SAM_PORT_1_BAUD_RATE DT_ATMEL_SAM_UART_400E0A00_CURRENT_SPEED -#define DT_UART_SAM_PORT_1_IRQ DT_ATMEL_SAM_UART_400E0A00_IRQ_0 -#define DT_UART_SAM_PORT_1_IRQ_PRIO DT_ATMEL_SAM_UART_400E0A00_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_2_NAME DT_ATMEL_SAM_UART_400E1A00_LABEL -#define DT_UART_SAM_PORT_2_BAUD_RATE DT_ATMEL_SAM_UART_400E1A00_CURRENT_SPEED -#define DT_UART_SAM_PORT_2_IRQ DT_ATMEL_SAM_UART_400E1A00_IRQ_0 -#define DT_UART_SAM_PORT_2_IRQ_PRIO DT_ATMEL_SAM_UART_400E1A00_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_3_NAME DT_ATMEL_SAM_UART_400E1C00_LABEL -#define DT_UART_SAM_PORT_3_BAUD_RATE DT_ATMEL_SAM_UART_400E1C00_CURRENT_SPEED -#define DT_UART_SAM_PORT_3_IRQ DT_ATMEL_SAM_UART_400E1C00_IRQ_0 -#define DT_UART_SAM_PORT_3_IRQ_PRIO DT_ATMEL_SAM_UART_400E1C00_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_4_NAME DT_ATMEL_SAM_UART_400E1E00_LABEL -#define DT_UART_SAM_PORT_4_BAUD_RATE DT_ATMEL_SAM_UART_400E1E00_CURRENT_SPEED -#define DT_UART_SAM_PORT_4_IRQ DT_ATMEL_SAM_UART_400E1E00_IRQ_0 -#define DT_UART_SAM_PORT_4_IRQ_PRIO DT_ATMEL_SAM_UART_400E1E00_IRQ_0_PRIORITY #define DT_USART_SAM_PORT_0_NAME DT_ATMEL_SAM_USART_40024000_LABEL #define DT_USART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_USART_40024000_CURRENT_SPEED #define DT_USART_SAM_PORT_0_IRQ DT_ATMEL_SAM_USART_40024000_IRQ_0 diff --git a/soc/arm/atmel_sam/same70/soc_pinmap.h b/soc/arm/atmel_sam/same70/soc_pinmap.h index cbcd635c22..46dd568cf8 100644 --- a/soc/arm/atmel_sam/same70/soc_pinmap.h +++ b/soc/arm/atmel_sam/same70/soc_pinmap.h @@ -30,47 +30,6 @@ #define PINS_GMAC0 {PIN_GMAC_SET1} -/* Universal Asynchronous Receiver Transmitter (UART) */ - -#define PIN_UART0_RXD {PIO_PA9A_UART0_URXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} -#define PIN_UART0_TXD {PIO_PA10A_UART0_UTXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} - -#define PINS_UART0 {PIN_UART0_RXD, PIN_UART0_TXD} - -#define PIN_UART1_RXD {PIO_PA5C_UART1_URXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#ifdef CONFIG_UART_SAM_PORT_1_PIN_TX_PA4 -#define PIN_UART1_TXD {PIO_PA4C_UART1_UTXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#elif CONFIG_UART_SAM_PORT_1_PIN_TX_PA6 -#define PIN_UART1_TXD {PIO_PA6C_UART1_UTXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#elif CONFIG_UART_SAM_PORT_1_PIN_TX_PD26 -#define PIN_UART1_TXD {PIO_PD26D_UART1_UTXD1, PIOD, ID_PIOD, SOC_GPIO_FUNC_D} -#endif - -#define PINS_UART1 {PIN_UART1_RXD, PIN_UART1_TXD} - -#define PIN_UART2_RXD {PIO_PD25C_UART2_URXD2, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#define PIN_UART2_TXD {PIO_PD26C_UART2_UTXD2, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} - -#define PINS_UART2 {PIN_UART2_RXD, PIN_UART2_TXD} - -#define PIN_UART3_RXD {PIO_PD28A_UART3_URXD3, PIOD, ID_PIOD, SOC_GPIO_FUNC_A} -#ifdef CONFIG_UART_SAM_PORT_3_PIN_TX_PD30 -#define PIN_UART3_TXD {PIO_PD30A_UART3_UTXD3, PIOD, ID_PIOD, SOC_GPIO_FUNC_A} -#elif CONFIG_UART_SAM_PORT_3_PIN_TX_PD31 -#define PIN_UART3_TXD {PIO_PD31B_UART3_UTXD3, PIOD, ID_PIOD, SOC_GPIO_FUNC_B} -#endif - -#define PINS_UART3 {PIN_UART3_RXD, PIN_UART3_TXD} - -#define PIN_UART4_RXD {PIO_PD18C_UART4_URXD4, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#ifdef CONFIG_UART_SAM_PORT_4_PIN_TX_PD3 -#define PIN_UART4_TXD {PIO_PD3C_UART4_UTXD4, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#elif CONFIG_UART_SAM_PORT_4_PIN_TX_PD19 -#define PIN_UART4_TXD {PIO_PD19C_UART4_UTXD4, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#endif - -#define PINS_UART4 {PIN_UART4_RXD, PIN_UART4_TXD} - /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */ #define PIN_USART0_RXD {PIO_PB0C_USART0_RXD0, PIOB, ID_PIOB, SOC_GPIO_FUNC_C} diff --git a/soc/arm/atmel_sam/samv71/dts_fixup.h b/soc/arm/atmel_sam/samv71/dts_fixup.h index f66327e82b..f56d5cbb6d 100644 --- a/soc/arm/atmel_sam/samv71/dts_fixup.h +++ b/soc/arm/atmel_sam/samv71/dts_fixup.h @@ -70,27 +70,6 @@ #define DT_SPI_1_IRQ_PRI DT_ATMEL_SAM_SPI_40058000_IRQ_0_PRIORITY #define DT_SPI_1_PERIPHERAL_ID DT_ATMEL_SAM_SPI_40058000_PERIPHERAL_ID -#define DT_UART_SAM_PORT_0_NAME DT_ATMEL_SAM_UART_400E0800_LABEL -#define DT_UART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_UART_400E0800_CURRENT_SPEED -#define DT_UART_SAM_PORT_0_IRQ DT_ATMEL_SAM_UART_400E0800_IRQ_0 -#define DT_UART_SAM_PORT_0_IRQ_PRIO DT_ATMEL_SAM_UART_400E0800_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_1_NAME DT_ATMEL_SAM_UART_400E0A00_LABEL -#define DT_UART_SAM_PORT_1_BAUD_RATE DT_ATMEL_SAM_UART_400E0A00_CURRENT_SPEED -#define DT_UART_SAM_PORT_1_IRQ DT_ATMEL_SAM_UART_400E0A00_IRQ_0 -#define DT_UART_SAM_PORT_1_IRQ_PRIO DT_ATMEL_SAM_UART_400E0A00_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_2_NAME DT_ATMEL_SAM_UART_400E1A00_LABEL -#define DT_UART_SAM_PORT_2_BAUD_RATE DT_ATMEL_SAM_UART_400E1A00_CURRENT_SPEED -#define DT_UART_SAM_PORT_2_IRQ DT_ATMEL_SAM_UART_400E1A00_IRQ_0 -#define DT_UART_SAM_PORT_2_IRQ_PRIO DT_ATMEL_SAM_UART_400E1A00_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_3_NAME DT_ATMEL_SAM_UART_400E1C00_LABEL -#define DT_UART_SAM_PORT_3_BAUD_RATE DT_ATMEL_SAM_UART_400E1C00_CURRENT_SPEED -#define DT_UART_SAM_PORT_3_IRQ DT_ATMEL_SAM_UART_400E1C00_IRQ_0 -#define DT_UART_SAM_PORT_3_IRQ_PRIO DT_ATMEL_SAM_UART_400E1C00_IRQ_0_PRIORITY -#define DT_UART_SAM_PORT_4_NAME DT_ATMEL_SAM_UART_400E1E00_LABEL -#define DT_UART_SAM_PORT_4_BAUD_RATE DT_ATMEL_SAM_UART_400E1E00_CURRENT_SPEED -#define DT_UART_SAM_PORT_4_IRQ DT_ATMEL_SAM_UART_400E1E00_IRQ_0 -#define DT_UART_SAM_PORT_4_IRQ_PRIO DT_ATMEL_SAM_UART_400E1E00_IRQ_0_PRIORITY - #define DT_USART_SAM_PORT_0_NAME DT_ATMEL_SAM_USART_40024000_LABEL #define DT_USART_SAM_PORT_0_BAUD_RATE DT_ATMEL_SAM_USART_40024000_CURRENT_SPEED #define DT_USART_SAM_PORT_0_IRQ DT_ATMEL_SAM_USART_40024000_IRQ_0 diff --git a/soc/arm/atmel_sam/samv71/soc_pinmap.h b/soc/arm/atmel_sam/samv71/soc_pinmap.h index 73917edf49..46a087fb93 100644 --- a/soc/arm/atmel_sam/samv71/soc_pinmap.h +++ b/soc/arm/atmel_sam/samv71/soc_pinmap.h @@ -31,47 +31,6 @@ #define PINS_GMAC0 {PIN_GMAC_SET1} -/* Universal Asynchronous Receiver Transmitter (UART) */ - -#define PIN_UART0_RXD {PIO_PA9A_UART0_URXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} -#define PIN_UART0_TXD {PIO_PA10A_UART0_UTXD0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A} - -#define PINS_UART0 {PIN_UART0_RXD, PIN_UART0_TXD} - -#define PIN_UART1_RXD {PIO_PA5C_UART1_URXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#ifdef CONFIG_UART_SAM_PORT_1_PIN_TX_PA4 -#define PIN_UART1_TXD {PIO_PA4C_UART1_UTXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#elif CONFIG_UART_SAM_PORT_1_PIN_TX_PA6 -#define PIN_UART1_TXD {PIO_PA6C_UART1_UTXD1, PIOA, ID_PIOA, SOC_GPIO_FUNC_C} -#elif CONFIG_UART_SAM_PORT_1_PIN_TX_PD26 -#define PIN_UART1_TXD {PIO_PD26D_UART1_UTXD1, PIOD, ID_PIOD, SOC_GPIO_FUNC_D} -#endif - -#define PINS_UART1 {PIN_UART1_RXD, PIN_UART1_TXD} - -#define PIN_UART2_RXD {PIO_PD25C_UART2_URXD2, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#define PIN_UART2_TXD {PIO_PD26C_UART2_UTXD2, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} - -#define PINS_UART2 {PIN_UART2_RXD, PIN_UART2_TXD} - -#define PIN_UART3_RXD {PIO_PD28A_UART3_URXD3, PIOD, ID_PIOD, SOC_GPIO_FUNC_A} -#ifdef CONFIG_UART_SAM_PORT_3_PIN_TX_PD30 -#define PIN_UART3_TXD {PIO_PD30A_UART3_UTXD3, PIOD, ID_PIOD, SOC_GPIO_FUNC_A} -#elif CONFIG_UART_SAM_PORT_3_PIN_TX_PD31 -#define PIN_UART3_TXD {PIO_PD31B_UART3_UTXD3, PIOD, ID_PIOD, SOC_GPIO_FUNC_B} -#endif - -#define PINS_UART3 {PIN_UART3_RXD, PIN_UART3_TXD} - -#define PIN_UART4_RXD {PIO_PD18C_UART4_URXD4, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#ifdef CONFIG_UART_SAM_PORT_4_PIN_TX_PD3 -#define PIN_UART4_TXD {PIO_PD3C_UART4_UTXD4, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#elif CONFIG_UART_SAM_PORT_4_PIN_TX_PD19 -#define PIN_UART4_TXD {PIO_PD19C_UART4_UTXD4, PIOD, ID_PIOD, SOC_GPIO_FUNC_C} -#endif - -#define PINS_UART4 {PIN_UART4_RXD, PIN_UART4_TXD} - /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */ #define PIN_USART0_RXD {PIO_PB0C_USART0_RXD0, PIOB, ID_PIOB, SOC_GPIO_FUNC_C}