Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions arch/arm/soc/arm/mps2/soc_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
#define CMSDK_APB_DUALTIMER_IRQ IRQ_DUAL_TIMER
#endif /* CONFIG_COUNTER */

#if defined(CONFIG_I2C_SBCON)
#define I2C_SBCON_0_BASE_ADDR I2C_TOUCH_BASE_ADDR
#define I2C_SBCON_1_BASE_ADDR I2C_AUDIO_CONF_BASE_ADDR
#define I2C_SBCON_2_BASE_ADDR I2C_SHIELD0_BASE_ADDR
#define I2C_SBCON_3_BASE_ADDR I2C_SHIELD1_BASE_ADDR
#endif

#ifndef _ASMLANGUAGE

#include "soc_registers.h"
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/soc/arm/mps2/soc_memory_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#define UART_4_BASE_ADDR (MPS2_APB_BASE_ADDR + 0x9000)

/* MPS2 peripherals in FPGA APB subsystem */
#define FPGAIO_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x8000)
#define I2C_TOUCH_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x2000)
#define I2C_AUDIO_CONF_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x3000)
#define FPGAIO_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x8000)
#define I2C_SHIELD0_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x9000)
#define I2C_SHIELD1_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0xa000)

#endif /* _SOC_MEMORY_MAP_H_ */
5 changes: 0 additions & 5 deletions arch/arm/soc/atmel_sam/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion arch/arm/soc/atmel_sam/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
59 changes: 6 additions & 53 deletions arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
# SPDX-License-Identifier: Apache-2.0
#

if SOC_SERIES_SAM3X || SOC_ATMEL_SAM3X8E
if SOC_SERIES_SAM3X

config SOC_SERIES
string
default sam3x

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
Expand Down Expand Up @@ -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
10 changes: 0 additions & 10 deletions arch/arm/soc/atmel_sam/sam3x/Kconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions arch/arm/soc/atmel_sam/sam3x/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/soc/atmel_sam/sam3x/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion boards/arm/arduino_due/Kconfig.board
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions boards/arm/arduino_due/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions boards/arm/arduino_due/arduino_due_defconfig
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion boards/arm/disco_l475_iot1/disco_l475_iot1_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ CONFIG_I2C_STM32LX=y
#configure HTS221 sensor
CONFIG_HTS221_I2C_MASTER_DEV_NAME="I2C_2"
CONFIG_HTS221_TRIGGER_NONE=y
CONFIG_HTS221_I2C_ADDR=0x5F
31 changes: 31 additions & 0 deletions boards/arm/mps2_an385/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,35 @@ endif # TIMER_DTMR_CMSDK_APB

endif # COUNTER

if I2C

config I2C_SBCON
def_bool y

config I2C_SBCON_0
def_bool y

config I2C_SBCON_0_NAME
default I2C_TOUCH

config I2C_SBCON_1
def_bool y

config I2C_SBCON_1_NAME
default I2C_AUDIO_CONF

config I2C_SBCON_2
def_bool y

config I2C_SBCON_2_NAME
default I2C_SHIELD0

config I2C_SBCON_3
def_bool y

config I2C_SBCON_3_NAME
default I2C_SHIELD1

endif # I2C

endif
2 changes: 2 additions & 0 deletions boards/arm/mps2_an385/mps2_an385_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_0"

# Watchdog
CONFIG_WATCHDOG=y

CONFIG_I2C=y
2 changes: 1 addition & 1 deletion drivers/gpio/Kconfig.atmel_sam3
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ config I2C_QMSI
provided by the QMSI BSP.

config I2C_ATMEL_SAM3
bool "Atmel SAM3 I2C Driver"
depends on SOC_ATMEL_SAM3
bool "Atmel SAM3X I2C Driver"
depends on 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.

Expand Down Expand Up @@ -111,6 +110,8 @@ config I2C_BITBANG
help
Enable library used for software driven (bit banging) I2C support

source "drivers/i2c/Kconfig.sbcon"

source "drivers/i2c/Kconfig.gpio"

config I2C_INIT_PRIORITY
Expand Down
Loading