diff --git a/arch/arm/soc/atmel_sam/Kconfig b/arch/arm/soc/atmel_sam/Kconfig index 759f70525c7023..1988dd2005ab0a 100644 --- a/arch/arm/soc/atmel_sam/Kconfig +++ b/arch/arm/soc/atmel_sam/Kconfig @@ -4,10 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -config SOC_ATMEL_SAM3 - bool - depends on ARM - default n - # Select SoC Part No. and configuration options source "arch/arm/soc/atmel_sam/*/Kconfig.soc" diff --git a/arch/arm/soc/atmel_sam/Kconfig.defconfig b/arch/arm/soc/atmel_sam/Kconfig.defconfig index 1f5550b230c4d2..bdddffc4387516 100644 --- a/arch/arm/soc/atmel_sam/Kconfig.defconfig +++ b/arch/arm/soc/atmel_sam/Kconfig.defconfig @@ -16,7 +16,7 @@ config SOC_FAMILY default atmel_sam config WATCHDOG - def_bool y if !SOC_ATMEL_SAM3X8E + def_bool y endif #SOC_FAMILY_SAM diff --git a/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series b/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series index 30159e2ebf0d62..8ed2fecfcf4178 100644 --- a/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series +++ b/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series @@ -6,7 +6,7 @@ # SPDX-License-Identifier: Apache-2.0 # -if SOC_SERIES_SAM3X || SOC_ATMEL_SAM3X8E +if SOC_SERIES_SAM3X config SOC_SERIES string @@ -14,7 +14,7 @@ config SOC_SERIES config SOC_PART_NUMBER string - default sam3x8e if SOC_PART_NUMBER_SAM3X8E || SOC_ATMEL_SAM3X8E + default sam3x8e if SOC_PART_NUMBER_SAM3X8E config NUM_IRQ_PRIO_BITS int @@ -42,66 +42,19 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC # to provide one continuous 96K block. # config SRAM_SIZE - default 96 if SOC_PART_NUMBER_SAM3X8E || SOC_ATMEL_SAM3X8E + default 96 if SOC_PART_NUMBER_SAM3X8E config SRAM_BASE_ADDRESS - default 0x20000000 if !SOC_PART_NUMBER_SAM3X8E && !SOC_ATMEL_SAM3X8E - default 0x20070000 if SOC_PART_NUMBER_SAM3X8E || SOC_ATMEL_SAM3X8E + default 0x20000000 if !SOC_PART_NUMBER_SAM3X8E + default 0x20070000 if SOC_PART_NUMBER_SAM3X8E # # Atmel SAM3X family has flash starting @ 0x00080000. # config FLASH_SIZE - default 512 if SOC_PART_NUMBER_SAM3X8E || SOC_ATMEL_SAM3X8E + default 512 if SOC_PART_NUMBER_SAM3X8E config FLASH_BASE_ADDRESS default 0x00080000 -if UART_ATMEL_SAM3 - -config UART_ATMEL_SAM3_BAUD_RATE - default 115200 - -config UART_ATMEL_SAM3_CLK_FREQ - default 84000000 - -endif # UART_ATMEL_SAM3 - -if GPIO - -config GPIO_ATMEL_SAM3 - def_bool y - -config GPIO_ATMEL_SAM3_PORTA - default y - -config GPIO_ATMEL_SAM3_PORTB - default y - -config GPIO_ATMEL_SAM3_PORTC - default y - -config GPIO_ATMEL_SAM3_PORTD - default y - -endif # GPIO - -if I2C - -config I2C_ATMEL_SAM3 - def_bool y - -config I2C_0 - default y -config I2C_0_IRQ_PRI - default 0 - -config I2C_1 - default y - -config I2C_1_IRQ_PRI - default 0 - -endif # I2C - endif # SOC_SERIES_SAM3X diff --git a/arch/arm/soc/atmel_sam/sam3x/Kconfig.series b/arch/arm/soc/atmel_sam/sam3x/Kconfig.series index 59bb0f4ea8672f..9d77cb7a8e8142 100644 --- a/arch/arm/soc/atmel_sam/sam3x/Kconfig.series +++ b/arch/arm/soc/atmel_sam/sam3x/Kconfig.series @@ -16,13 +16,3 @@ config SOC_SERIES_SAM3X help Enable support for Atmel SAM3X Cortex-M3 microcontrollers. Part No.: SAM3X8E - -config SOC_ATMEL_SAM3X8E - bool "Atmel SAM3X8E Processor" - select SOC_PART_NUMBER_SAM3X8E - select CPU_CORTEX_M - select CPU_CORTEX_M3 - select SOC_FAMILY_SAM - select SYS_POWER_LOW_POWER_STATE_SUPPORTED - select CPU_HAS_SYSTICK - select SOC_ATMEL_SAM3 diff --git a/arch/arm/soc/atmel_sam/sam3x/Kconfig.soc b/arch/arm/soc/atmel_sam/sam3x/Kconfig.soc index 06bf046725faa0..1277d9e53b9c53 100644 --- a/arch/arm/soc/atmel_sam/sam3x/Kconfig.soc +++ b/arch/arm/soc/atmel_sam/sam3x/Kconfig.soc @@ -15,7 +15,7 @@ choice bool "SAM3X8E" endchoice -if SOC_SERIES_SAM3X || SOC_ATMEL_SAM3X8E +if SOC_SERIES_SAM3X config SOC_ATMEL_SAM3X_EXT_SLCK bool "Atmel SAM3 to use external crystal oscillator for slow clock" @@ -75,7 +75,7 @@ config SOC_ATMEL_SAM3X_PLLA_DIVA config SOC_ATMEL_SAM3X_WAIT_MODE bool "Atmel SAM3 goes to Wait mode instead of Sleep mode" - depends on SOC_ATMEL_SAM3_EXT_MAINCK + depends on SOC_ATMEL_SAM3X_EXT_MAINCK default y if DEBUG help For JTAG debugging CPU clock (HCLK) should not stop. In order diff --git a/arch/arm/soc/atmel_sam/sam3x/soc.c b/arch/arm/soc/atmel_sam/sam3x/soc.c index 1e8b01fb400e32..98215571a1b528 100644 --- a/arch/arm/soc/atmel_sam/sam3x/soc.c +++ b/arch/arm/soc/atmel_sam/sam3x/soc.c @@ -50,7 +50,7 @@ static ALWAYS_INLINE void clock_init(void) /* Wait for oscillator to be stablized */ while (!(__SUPC->sr & SUPC_SR_OSCSEL)) ; -#endif /* CONFIG_SOC_ATMEL_SAM3_EXT_SLCK */ +#endif /* CONFIG_SOC_ATMEL_SAM3X_EXT_SLCK */ #ifdef CONFIG_SOC_ATMEL_SAM3X_EXT_MAINCK /* Start the external main oscillator */ @@ -88,7 +88,7 @@ static ALWAYS_INLINE void clock_init(void) /* Wait for main fast RC oscillator to be stablized */ while (!(__PMC->sr & PMC_INT_MOSCRCS)) ; -#endif /* CONFIG_SOC_ATMEL_SAM3_EXT_MAINCK */ +#endif /* CONFIG_SOC_ATMEL_SAM3X_EXT_MAINCK */ /* Use PLLA as master clock. * According to datasheet, PMC_MCKR must not be programmed in diff --git a/boards/arm/arduino_due/Kconfig.board b/boards/arm/arduino_due/Kconfig.board index 552742e6fb6bf6..5818773a88228a 100644 --- a/boards/arm/arduino_due/Kconfig.board +++ b/boards/arm/arduino_due/Kconfig.board @@ -1,4 +1,9 @@ +# Kconfig - Arduino Due Board configuration +# +# Copyright (c) 2017 Justin Watson +# SPDX-License-Identifier: Apache-2.0 +# config BOARD_ARDUINO_DUE bool "Arduino Due Board" - depends on SOC_ATMEL_SAM3X8E + depends on SOC_PART_NUMBER_SAM3X8E diff --git a/boards/arm/arduino_due/Kconfig.defconfig b/boards/arm/arduino_due/Kconfig.defconfig index 952d4e0d3e2c64..b5d1d0ebcacd28 100644 --- a/boards/arm/arduino_due/Kconfig.defconfig +++ b/boards/arm/arduino_due/Kconfig.defconfig @@ -1,14 +1,59 @@ +# Kconfig - Arduino Due Board configuration +# +# Copyright (c) 2017 Justin Watson +# SPDX-License-Identifier: Apache-2.0 +# if BOARD_ARDUINO_DUE config BOARD default arduino_due +if UART_ATMEL_SAM3 + +config UART_ATMEL_SAM3_BAUD_RATE + default 115200 + +config UART_ATMEL_SAM3_CLK_FREQ + default 84000000 + +endif # UART_ATMEL_SAM3 + +if GPIO + +config GPIO_ATMEL_SAM3 + def_bool y + +config GPIO_ATMEL_SAM3_PORTA + default y + +config GPIO_ATMEL_SAM3_PORTB + default y + +config GPIO_ATMEL_SAM3_PORTC + default y + +config GPIO_ATMEL_SAM3_PORTD + default y + +endif # GPIO + if I2C config I2C_ATMEL_SAM3 + def_bool y + +config I2C_0 + default y +config I2C_0_IRQ_PRI + default 0 + +config I2C_1 default y +config I2C_1_IRQ_PRI + default 0 + endif # I2C endif # BOARD_ARDUINO_DUE diff --git a/boards/arm/arduino_due/arduino_due_defconfig b/boards/arm/arduino_due/arduino_due_defconfig index 625064ef5be85e..73b61fd8844a35 100644 --- a/boards/arm/arduino_due/arduino_due_defconfig +++ b/boards/arm/arduino_due/arduino_due_defconfig @@ -1,10 +1,13 @@ CONFIG_ARM=y -CONFIG_SOC_ATMEL_SAM3X8E=y +CONFIG_SOC_FAMILY_SAM=y +CONFIG_SOC_SERIES_SAM3X=y +CONFIG_SOC_PART_NUMBER_SAM3X8E=y CONFIG_BOARD_ARDUINO_DUE=y CONFIG_CORTEX_M_SYSTICK=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_ATMEL_SAM3=y -CONFIG_SOC_ATMEL_SAM3_EXT_MAINCK=y +CONFIG_SOC_ATMEL_SAM3X_EXT_MAINCK=y CONFIG_PINMUX=y +CONFIG_WATCHDOG=n diff --git a/drivers/gpio/Kconfig.atmel_sam3 b/drivers/gpio/Kconfig.atmel_sam3 index 8413a8b606ce02..584b6aef0c1710 100644 --- a/drivers/gpio/Kconfig.atmel_sam3 +++ b/drivers/gpio/Kconfig.atmel_sam3 @@ -8,7 +8,7 @@ menuconfig GPIO_ATMEL_SAM3 bool "Atmel SAM3 PIO Controllers" - depends on GPIO && SOC_ATMEL_SAM3 + depends on GPIO && SOC_SERIES_SAM3X default n help Enable config options to support the PIO controllers diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 865770ca8c1915..59b723b4b8632d 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -46,14 +46,13 @@ config I2C_QMSI provided by the QMSI BSP. config I2C_ATMEL_SAM3 - bool "Atmel SAM3 I2C Driver" - depends on I2C && SOC_ATMEL_SAM3 + bool "Atmel SAM3X I2C Driver" + depends on I2C && SOC_SERIES_SAM3X default n help - Enable I2C support on the Atmel SAM3 family processor. - - Says y to enable additional options to enable support - for individual controllers. + Enable I2C support on the Atmel SAM3 family processor. + Says y to enable additional options to enable support + for individual controllers. config TWIHS_SAM bool "Atmel SAM I2C driver" diff --git a/drivers/pinmux/dev/Kconfig b/drivers/pinmux/dev/Kconfig index 418b5eaa3cc45a..87a93cb9db9f42 100644 --- a/drivers/pinmux/dev/Kconfig +++ b/drivers/pinmux/dev/Kconfig @@ -24,7 +24,7 @@ config PINMUX_DEV_NAME config PINMUX_DEV_ATMEL_SAM3X bool "Enable pinmux dev driver for Atmel SAM3X boards" - depends on PINMUX_DEV && SOC_ATMEL_SAM3X8E + depends on PINMUX_DEV && SOC_SERIES_SAM3X help Enables the pinmux dev driver for boards based on the Atmel SAM3X family of microcontrollers. diff --git a/drivers/serial/Kconfig.atmel_sam3 b/drivers/serial/Kconfig.atmel_sam3 index ef678fd30e2987..d87e92da9314b1 100644 --- a/drivers/serial/Kconfig.atmel_sam3 +++ b/drivers/serial/Kconfig.atmel_sam3 @@ -2,7 +2,7 @@ menuconfig UART_ATMEL_SAM3 bool "Atmel SAM3 family processor UART driver" default n select SERIAL_HAS_DRIVER - depends on SOC_ATMEL_SAM3 + depends on SOC_SERIES_SAM3X help This option enables the UART driver for Atmel SAM3 family processors. Note that there is only one diff --git a/samples/drivers/gpio/src/main.c b/samples/drivers/gpio/src/main.c index 8a19726bb1fb98..07ce642339d32d 100644 --- a/samples/drivers/gpio/src/main.c +++ b/samples/drivers/gpio/src/main.c @@ -114,7 +114,7 @@ #define GPIO_OUT_PIN 16 #define GPIO_INT_PIN 19 #define GPIO_NAME "GPIO_" -#elif defined(CONFIG_SOC_ATMEL_SAM3) +#elif defined(CONFIG_SOC_PART_NUMBER_SAM3X8E) #define GPIO_OUT_PIN 25 #define GPIO_INT_PIN 27 #define GPIO_NAME "GPIO_" diff --git a/samples/drivers/lcd_hd44780/src/main.c b/samples/drivers/lcd_hd44780/src/main.c index 1ed57a7a5d10f0..4b015bea08f517 100644 --- a/samples/drivers/lcd_hd44780/src/main.c +++ b/samples/drivers/lcd_hd44780/src/main.c @@ -71,13 +71,13 @@ #include -#if defined(CONFIG_GPIO_ATMEL_SAM3) +#if defined(CONFIG_SOC_PART_NUMBER_SAM3X8E) #define GPIO_DRV_NAME CONFIG_GPIO_ATMEL_SAM3_PORTC_DEV_NAME #else #error "Unsupported GPIO driver" #endif -#if defined(CONFIG_SOC_ATMEL_SAM3) +#if defined(CONFIG_SOC_PART_NUMBER_SAM3X8E) /* Define GPIO OUT to LCD */ #define GPIO_PIN_PC12_D0 12 /* PC12 - pin 51 */ #define GPIO_PIN_PC13_D1 13 /* PC13 - pin 50 */ diff --git a/samples/drivers/lcd_hd44780/testcase.ini b/samples/drivers/lcd_hd44780/testcase.ini index c0d4933d98dc5e..2d8e8587b8ecfc 100644 --- a/samples/drivers/lcd_hd44780/testcase.ini +++ b/samples/drivers/lcd_hd44780/testcase.ini @@ -1,5 +1,5 @@ [test] tags = samples build_only = true -filter = CONFIG_SOC_ATMEL_SAM3 +filter = CONFIG_SOC_SERIES_SAM3X diff --git a/tests/kernel/test_tickless/src/timestamps.c b/tests/kernel/test_tickless/src/timestamps.c index 8c097c4b324f23..ff8bac1da06a7b 100644 --- a/tests/kernel/test_tickless/src/timestamps.c +++ b/tests/kernel/test_tickless/src/timestamps.c @@ -237,7 +237,7 @@ void _TimestampClose(void) _TIMESTAMP_CTRL = 0x0; /* disable oscillator */ } -#elif defined(CONFIG_SOC_ATMEL_SAM3) +#elif defined(CONFIG_SOC_SERIES_SAM3X) /* Atmel SAM3 family processor - use RTT (Real-time Timer) */ #include diff --git a/tests/kernel/test_tickless/testcase.ini b/tests/kernel/test_tickless/testcase.ini index d217bfd1d61ae4..8903dde6c3fbdf 100644 --- a/tests/kernel/test_tickless/testcase.ini +++ b/tests/kernel/test_tickless/testcase.ini @@ -2,5 +2,5 @@ tags = core arch_exclude = nios2 filter = CONFIG_X86 or (CONFIG_ARM and - (CONFIG_SOC_MK64F12 or CONFIG_SOC_ATMEL_SAM3)) or + (CONFIG_SOC_MK64F12 or CONFIG_SOC_SERIES_SAM3X)) or (CONFIG_ARC and CONFIG_SOC_QUARK_SE_C1000_SS)