Skip to content

Commit

Permalink
same70: Add SPI1, SPI2 support
Browse files Browse the repository at this point in the history
Add SPI1/2 pinmap, dts.fixup for atmel sam series soc

Signed-off-by: qianfan Zhao <[email protected]>
  • Loading branch information
qianfan-Zhao authored and galak committed Oct 10, 2018
1 parent 5a07a12 commit 3974978
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions soc/arm/atmel_sam/same70/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ config DMA_SAM_XDMAC
default y
endif # DMA

if SPI
config SPI_SAM
def_bool y
endif # SPI

endif # SOC_SERIES_SAME70
12 changes: 12 additions & 0 deletions soc/arm/atmel_sam/same70/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@
#define CONFIG_I2C_2_IRQ_PRI ATMEL_SAM_I2C_TWIHS_40060000_IRQ_0_PRIORITY
#define CONFIG_I2C_2_PERIPHERAL_ID ATMEL_SAM_I2C_TWIHS_40060000_PERIPHERAL_ID

#define CONFIG_SPI_0_BASE_ADDRESS ATMEL_SAM_SPI_40008000_BASE_ADDRESS
#define CONFIG_SPI_0_NAME ATMEL_SAM_SPI_40008000_LABEL
#define CONFIG_SPI_0_IRQ ATMEL_SAM_SPI_40008000_IRQ_0
#define CONFIG_SPI_0_IRQ_PRI ATMEL_SAM_SPI_40008000_IRQ_0_PRIORITY
#define CONFIG_SPI_0_PERIPHERAL_ID ATMEL_SAM_SPI_40008000_PERIPHERAL_ID

#define CONFIG_SPI_1_BASE_ADDRESS ATMEL_SAM_SPI_40058000_BASE_ADDRESS
#define CONFIG_SPI_1_NAME ATMEL_SAM_SPI_40058000_LABEL
#define CONFIG_SPI_1_IRQ ATMEL_SAM_SPI_40058000_IRQ_0
#define CONFIG_SPI_1_IRQ_PRI ATMEL_SAM_SPI_40058000_IRQ_0_PRIORITY
#define CONFIG_SPI_1_PERIPHERAL_ID ATMEL_SAM_SPI_40058000_PERIPHERAL_ID

#define CONFIG_UART_SAM_PORT_0_NAME ATMEL_SAM_UART_400E0800_LABEL
#define CONFIG_UART_SAM_PORT_0_BAUD_RATE ATMEL_SAM_UART_400E0800_CURRENT_SPEED
#define CONFIG_UART_SAM_PORT_0_IRQ ATMEL_SAM_UART_400E0800_IRQ_0
Expand Down
10 changes: 10 additions & 0 deletions soc/arm/atmel_sam/same70/soc_pinmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,14 @@

#define PINS_TWIHS2 {PIN_TWIHS2_TWCK, PIN_TWIHS2_TWD}

/* Serial Peripheral Interface (SPI) */

#define PINS_SPI0_MASK \
(PIO_PD20B_SPI0_MISO | PIO_PD21B_SPI0_MOSI | PIO_PD22B_SPI0_SPCK)
#define PINS_SPI0 {PINS_SPI0_MASK, PIOD, ID_PIOD, SOC_GPIO_FUNC_B}

#define PINS_SPI1_MASK \
(PIO_PC26C_SPI1_MISO | PIO_PC27C_SPI1_MOSI | PIO_PC24C_SPI1_SPCK)
#define PINS_SPI1 {PINS_SPI1_MASK, PIOC, ID_PIOC, SOC_GPIO_FUNC_C}

#endif /* _ATMEL_SAM_SOC_PINMAP_H_ */

0 comments on commit 3974978

Please sign in to comment.