Skip to content

Commit

Permalink
arch/arm/samv7: enforce compilation error for incompatible configurat…
Browse files Browse the repository at this point in the history
…ion options

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
  • Loading branch information
pkarashchenko committed May 22, 2024
1 parent 1ee279c commit d0950ef
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 17 deletions.
7 changes: 6 additions & 1 deletion arch/arm/src/samv7/sam_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
* Pre-processor Definitions
****************************************************************************/

#if defined(CONFIG_SAMV7_JTAG_FULL_ENABLE) && defined(CONFIG_SAMV7_USART1)
# error CONFIG_SAMV7_JTAG_FULL_ENABLE is incompatible with CONFIG_SAMV7_USART1.
# error The SYSIO Pin4 must be bound to PB4 to use USART1
#endif

#if !defined(CONFIG_SAMV7_ERASE_ENABLE) || \
!defined(CONFIG_SAMV7_JTAG_FULL_ENABLE)
# if defined(CONFIG_SAMV7_ERASE_DISABLE)
Expand All @@ -51,7 +56,7 @@
# endif
# if defined(CONFIG_SAMV7_JTAG_DISABLE)
# define SYSIO_BITS (MATRIX_CCFG_SYSIO_SYSIO4 | MATRIX_CCFG_SYSIO_SYSIO5 | \
MATRIX_CCFG_SYSIO_SYSIO6 | MATRIX_CCFG_SYSIO_SYSIO7)
MATRIX_CCFG_SYSIO_SYSIO6 | MATRIX_CCFG_SYSIO_SYSIO7)
# endif
# if defined(CONFIG_SAMV7_JTAG_FULL_SW_ENABLE)
# define SYSIO_BITS MATRIX_CCFG_SYSIO_SYSIO4
Expand Down
16 changes: 0 additions & 16 deletions arch/arm/src/samv7/sam_lowputc.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ void sam_lowsetup(void)
uint64_t divb3;
uint32_t intpart;
uint32_t fracpart;
#endif
#if (defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG)) || \
defined(CONFIG_SAMV7_USART1)
uint32_t regval;
#endif

Expand Down Expand Up @@ -322,19 +319,6 @@ void sam_lowsetup(void)
sam_configgpio(GPIO_USART1_RTS);
# endif

/* To use the USART1 as an USART, the SYSIO Pin4 must be bound to PB4
* instead of TDI
*/

# if defined(CONFIG_SAMV7_JTAG_FULL_ENABLE)
# warning CONFIG_SAMV7_JTAG_FULL_ENABLE is incompatible with CONFIG_SAMV7_USART1.
# warning The SYSIO Pin4 must be bound to PB4 to use USART1
# endif

regval = getreg32(SAM_MATRIX_CCFG_SYSIO);
regval |= MATRIX_CCFG_SYSIO_SYSIO4;
putreg32(regval, SAM_MATRIX_CCFG_SYSIO);

#endif

#ifdef CONFIG_SAMV7_USART2
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/adc/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TC0=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/can/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_MCAN0=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TWIHS0=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TWIHS0=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/netnsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TWIHS0=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/pwm/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_PWM0=y
CONFIG_SAMV7_PWM0_CH0=y
CONFIG_SAMV7_PWM0_CH1=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/pysim/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_PWM0=y
CONFIG_SAMV7_PWM0_CH0=y
CONFIG_SAMV7_PWM0_CH1=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/same70-xplained/configs/twm4nx/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOC_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TWIHS0=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/knsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TWIHS0=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SYSTEMRESET=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SYSTEMRESET=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SYSTEMRESET=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SYSTEMRESET=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/module/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ CONFIG_SAMV7_GPIOA_IRQ=y
CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
CONFIG_SCHED_HPWORK=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SPI0=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/mxtxplnd/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SMC=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/netnsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SDRAMC=y
CONFIG_SAMV7_SDRAMSIZE=2097152
CONFIG_SAMV7_TWIHS0=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/nxwm/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_SMC=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/vnc/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down
1 change: 1 addition & 0 deletions boards/arm/samv7/samv71-xult/configs/vnxwm/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
CONFIG_SAMV7_GPIOD_IRQ=y
CONFIG_SAMV7_GPIO_IRQ=y
CONFIG_SAMV7_HSMCI0=y
CONFIG_SAMV7_JTAG_FULL_SW_ENABLE=y
CONFIG_SAMV7_TWIHS0=y
CONFIG_SAMV7_USART1=y
CONFIG_SAMV7_XDMAC=y
Expand Down

0 comments on commit d0950ef

Please sign in to comment.