Skip to content

[DNM] drivers: spi: Add shim for nrfx SPI driver #6458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
49a3950
drivers/spi: Cleanup the Kconfig files
Jun 21, 2017
34cfd6d
api/spi: Disable legacy API by default
Jan 31, 2018
9513c64
api/spi: Make spi_config parameter constant
Jan 29, 2018
e052826
api/spi: Reduce parameter number on transceive function
Jan 30, 2018
2c38f68
api/spi: Add a dedicated Kconfig option for asynchronous mode enablement
Jan 29, 2018
e001b67
api/spi: Removing eeprom mode in configuration
Jan 29, 2018
b5c411f
api/spi: Add octal MISO lines mode
Feb 5, 2018
09cbec9
api/spi: Make cs attribute in struct spi_config constant
Feb 5, 2018
fafbb65
drivers/ieee802154: Switch CC2520 to new SPI API
Sep 29, 2017
c7e5a3b
drivers/flash: Switch W25QXXDV driver to new SPI API
Jan 30, 2018
83eff9d
drivers/sensors: Switch bme280 driver to new SPI API
Jan 30, 2018
bb697d1
drivers/sensors: Switch bmi160 driver to new SPI API
Jan 30, 2018
5433356
drivers/sensors: Switch adxl362 driver to new SPI API
Jan 30, 2018
aae735b
drivers/sensors: Switch lis2dh driver to new SPI API
Jan 30, 2018
f709a43
drivers/adc: Switch ti_adc108s102 driver to new SPI API
Jan 31, 2018
ff25964
drivers/bluetooth: Switch SPI based HCI driver to new SPI API
Jan 31, 2018
81510ef
samples/drivers: Switch Fujistu FRAM sample to new SPI API
Feb 1, 2018
12b910e
drivers/bluetooth: Get rid completely of legacy SPI API in SPI HCI
Feb 2, 2018
637ccdc
drivers/spi: Adapt Kconfig and generic context to enable slave support
Jun 28, 2017
da2dc64
api/spi: Add the possibility to request CS active high logic
Feb 6, 2018
953b7c4
drivers/ethernet: Switch enc28j60 to new SPI API
locomuco Sep 5, 2017
34ecea3
tests/drivers: Removing old SPI test
Feb 8, 2018
4af812c
api/spi: Precise a bit the documentation
Feb 15, 2018
cf7680f
drivers/spi: Add support for TX or RX only modes on DW driver
May 15, 2017
82eead2
arch/quark_se: Switch to native SPI DW driver
Jan 18, 2018
eca8166
drivers/spi: Remove legacy DesignWare SPI driver
Feb 16, 2018
7df0c09
drivers/spi: Specify options per-port on DW driver
Feb 27, 2018
9d771c4
drivers/clock_control: Enable ARC core support on quark_se driver
Feb 27, 2018
255b970
drivers/spi: Enable port 3 and 4 on DW driver
Feb 27, 2018
b806924
drivers/spi: Fix typo on parameters type in DW arc regs definitions
Feb 27, 2018
260a43d
arch/quark_se_c1000_ss: Switch to SPI DW driver
Feb 27, 2018
8b48fc0
arch/quark_d2000: Switch to SPI DW driver
Feb 27, 2018
8979839
drivers/spi: Removing QMSI driver as it does not support new API
Feb 27, 2018
99c65ae
tests/spi: Remove excluded boards
Feb 27, 2018
542dc77
drivers/spi: Switch Intel driver to new SPI API
Feb 16, 2018
19941ef
spi: Implement new spi api in the mcux dspi driver
MaureenHelm Feb 14, 2018
3a5ee47
tests: spi_loopback: Add frdm_k64f configuration
MaureenHelm Feb 14, 2018
1142a81
drivers/ieee802154: Switch MCR20A driver to new SPI API
Mar 5, 2018
248c844
drivers/spi: Remove legacy API support from mcux dspi driver
Mar 7, 2018
7609644
drivers/spi: Add slave mode support to the DesignWare driver
Jun 28, 2017
f9e588c
boards/x86: Pinmux SPI port 2 relevantly on quark_se_c1000_devboard
Jan 26, 2018
bf1c187
arch/quark_se: Enable SPI port 2 as a slave only
Feb 15, 2018
d894887
drivers/spi: Simplify how error is forwarded from ISR handler in DW
Mar 28, 2018
3deb1f4
drivers/spi: spi_context lock makes transceive function reentrant in DW
Mar 28, 2018
fb15270
drivers/ethernet: No need of semaphore for spi in enc28j60
Mar 28, 2018
fcdcab9
drivers/ieee802154: No need of semaphore for spi in mcr20a
Mar 28, 2018
774397e
samples/bluetooth: Move hci_spi to new SPI API
Mar 28, 2018
099c25e
drivers: spi: Add shim for nrfx SPI driver
anangl Mar 2, 2018
c0b0667
tests: spi_loopback: Add configurations for a few nRF5 boards
anangl Mar 2, 2018
b542ddc
drivers/spi: Remove legacy NRF5 master and slave drivers
Mar 28, 2018
f013ba9
spi: Remove SPI legacy API
Mar 28, 2018
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
62 changes: 34 additions & 28 deletions arch/arc/soc/quark_se_c1000_ss/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -218,54 +218,60 @@ endif # UART_QMSI

if SPI

config SPI_QMSI
def_bool n

if SPI_QMSI
config SPI_0
config SPI_DW
def_bool y

config SPI_0_NAME
default "SPI_2"
if SPI_DW

config SPI_0_IRQ_PRI
default 1
config SPI_DW_FIFO_DEPTH
default 7

config SPI_1
config CLOCK_CONTROL
def_bool y

config SPI_1_NAME
default "SPI_3"

config SPI_1_IRQ_PRI
default 1
config CLOCK_CONTROL_QUARK_SE
def_bool y

endif
config CLOCK_CONTROL_QUARK_SE_SENSOR
def_bool y

config SPI_QMSI_SS
config SPI_0
def_bool y

if SPI_QMSI_SS
config SPI_SS_0
config SPI_DW_PORT_0_INTERRUPT_SINGLE_LINE
def_bool n

config SPI_DW_PORT_0_CLOCK_GATE
def_bool y

config SPI_SS_0_NAME
default "SPI_0"
config SPI_DW_PORT_0_CLOCK_GATE_DRV_NAME
default CLOCK_CONTROL_QUARK_SE_SENSOR_DRV_NAME

config SPI_DW_PORT_0_CLOCK_GATE_SUBSYS
default 3

config SPI_SS_0_IRQ_PRI
config SPI_0_IRQ_PRI
default 1

config SPI_SS_1
config SPI_1
def_bool y

config SPI_SS_1_NAME
default "SPI_1"
config SPI_DW_PORT_1_INTERRUPT_SINGLE_LINE
def_bool n

config SPI_SS_1_IRQ_PRI
default 1
config SPI_DW_PORT_1_CLOCK_GATE
def_bool y

endif
config SPI_DW_PORT_1_CLOCK_GATE_DRV_NAME
default CLOCK_CONTROL_QUARK_SE_SENSOR_DRV_NAME

config SPI_DW_PORT_1_CLOCK_GATE_SUBSYS
default 4

config SPI_1_IRQ_PRI
default 1

endif # SPI_DW
endif # SPI

if AIO_COMPARATOR
Expand Down
37 changes: 28 additions & 9 deletions arch/arc/soc/quark_se_c1000_ss/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,37 @@
* SPI
*/

#define SPI_DW_PORT_0_REGS 0x80010000
#define SPI_DW_PORT_1_REGS 0x80010100
#ifdef CONFIG_SPI_DW

#define SPI_DW_PORT_0_ERROR_INT_MASK (SCSS_REGISTER_BASE + 0x430)
#define SPI_DW_PORT_0_RX_INT_MASK (SCSS_REGISTER_BASE + 0x434)
#define SPI_DW_PORT_0_TX_INT_MASK (SCSS_REGISTER_BASE + 0x438)
#define SPI_DW_PORT_0_REGS 0x80010000
#define SPI_DW_PORT_1_REGS 0x80010100

#define SPI_DW_PORT_1_ERROR_INT_MASK (SCSS_REGISTER_BASE + 0x43C)
#define SPI_DW_PORT_1_RX_INT_MASK (SCSS_REGISTER_BASE + 0x440)
#define SPI_DW_PORT_1_TX_INT_MASK (SCSS_REGISTER_BASE + 0x444)
#define SPI_DW_PORT_0_ERROR_INT_MASK (SCSS_REGISTER_BASE + 0x430)
#define SPI_DW_PORT_0_RX_INT_MASK (SCSS_REGISTER_BASE + 0x434)
#define SPI_DW_PORT_0_TX_INT_MASK (SCSS_REGISTER_BASE + 0x438)

#define SPI_DW_IRQ_FLAGS 0
#define SPI_DW_PORT_1_ERROR_INT_MASK (SCSS_REGISTER_BASE + 0x43C)
#define SPI_DW_PORT_1_RX_INT_MASK (SCSS_REGISTER_BASE + 0x440)
#define SPI_DW_PORT_1_TX_INT_MASK (SCSS_REGISTER_BASE + 0x444)

#define SPI_DW_IRQ_FLAGS 0

#define SPI_DW_PORT_2_REGS 0xB0001000
#define SPI_DW_PORT_2_IRQ IRQ_SPI_MST0_INTR
#define SPI_DW_PORT_2_INT_MASK (SCSS_REGISTER_BASE + 0x454)

#define SPI_DW_PORT_3_REGS 0xB0001400
#define SPI_DW_PORT_3_IRQ IRQ_SPI_MST1_INTR
#define SPI_DW_PORT_3_INT_MASK (SCSS_REGISTER_BASE + 0x458)

#endif /* CONFIG_SPI_DW */

/* Clock */
#define CLOCK_PERIPHERAL_BASE_ADDR (SCSS_REGISTER_BASE + 0x18)
#define CLOCK_EXTERNAL_BASE_ADDR (SCSS_REGISTER_BASE + 0x24)
#define CLOCK_SENSOR_BASE_ADDR (SCSS_REGISTER_BASE + 0x28)
#define CLOCK_SYSTEM_CLOCK_CONTROL (SCSS_REGISTER_BASE + \
SCSS_CCU_SYS_CLK_CTL)

static inline void _quark_se_ss_ready(void)
{
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/soc/st_stm32/common/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ if SPI && (SPI_1 || SPI_2 || SPI_3)
config SPI_STM32
def_bool y

config SPI_LEGACY_API
def_bool n

endif # SPI

if I2C && (I2C_1 || I2C_2 || I2C_3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ config DMA_QMSI
endif

if SPI
config SPI_QMSI
config SPI_DW
def_bool y
config SPI_DW_FIFO_DEPTH
default 7
config SPI_0
def_bool y
config SPI_0_IRQ_PRI
Expand Down
10 changes: 10 additions & 0 deletions arch/x86/soc/intel_quark/quark_d2000/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,14 @@

#define UART_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)

#ifdef CONFIG_SPI_DW

#define SPI_DW_PORT_0_REGS 0xB0001000
#define SPI_DW_PORT_0_IRQ 2
#define SPI_DW_PORT_0_INT_MASK (SCSS_REGISTER_BASE + 0x454)

#define SPI_DW_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)

#endif

#endif /* __SOC_H_ */
18 changes: 14 additions & 4 deletions arch/x86/soc/intel_quark/quark_se/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ endif


if SPI
config SPI_QMSI
config SPI_DW
def_bool y

config SPI_0
Expand All @@ -156,12 +156,22 @@ config SPI_1
config SPI_1_IRQ_PRI
default 2

config SPI_DW
def_bool n

config SPI_DW_FIFO_DEPTH
default 7

if SPI_SLAVE

config SPI_2
def_bool y

config SPI_2_OP_MODES
default 2

config SPI_2_IRQ_PRI
default 2

endif # SPI_SLAVE

endif # SPI


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ CONFIG_SOC_ATMEL_SAMD_XOSC32K=y
CONFIG_SOC_ATMEL_SAMD_XOSC32K_AS_MAIN=y
CONFIG_SPI=y
CONFIG_SPI_SAM0=y
CONFIG_SPI_LEGACY_API=n
CONFIG_PINMUX=y
CONFIG_PINMUX_SAM0=y
CONFIG_USB=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ CONFIG_WATCHDOG=y
CONFIG_WDT_SAM0=y
CONFIG_SPI=y
CONFIG_SPI_SAM0=y
CONFIG_SPI_LEGACY_API=n
CONFIG_PINMUX=y
CONFIG_PINMUX_SAM0=y
CONFIG_USB=y
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/arduino_zero/arduino_zero_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CONFIG_SOC_ATMEL_SAMD_XOSC32K=y
CONFIG_SOC_ATMEL_SAMD_XOSC32K_AS_MAIN=y
CONFIG_SPI=y
CONFIG_SPI_SAM0=y
CONFIG_SPI_LEGACY_API=n
CONFIG_SPI_4=y
CONFIG_PINMUX=y
CONFIG_PINMUX_SAM0=y
CONFIG_USB=y
Expand Down
24 changes: 0 additions & 24 deletions boards/x86/galileo/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,12 @@ config PWM
config SPI
def_bool y

config ADC
def_bool y

config SHARED_IRQ
def_bool y

config PCI_ENUMERATION
def_bool y

if ADC

config ADC_TI_ADC108S102
def_bool y

if ADC_TI_ADC108S102

config ADC_TI_ADC108S102_SPI_PORT_NAME
default "SPI_0"
config ADC_TI_ADC108S102_SPI_CONFIGURATION
default 0x81
config ADC_TI_ADC108S102_SPI_MAX_FREQ
default 0x20000000

endif # ADC_TI_AC108S102

endif # ADC

if GPIO && I2C

config GPIO_PCAL9535A
Expand Down Expand Up @@ -131,7 +110,4 @@ config SPI_INIT_PRIORITY
config PINMUX_INIT_PRIORITY
default 80 if PINMUX

config ADC_INIT_PRIORITY
default 95

endif # BOARD_GALILEO
22 changes: 6 additions & 16 deletions boards/x86/quark_se_c1000_devboard/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,42 @@ if IEEE802154_CC2520

config SPI
def_bool y

config GPIO
def_bool y

config IEEE802154_CC2520_SPI_DRV_NAME
default SPI_1_NAME
config IEEE802154_CC2520_SPI_FREQ
default 4
default 8000000
config IEEE802154_CC2520_SPI_SLAVE
default 1


if GPIO_QMSI

config IEEE802154_CC2520_GPIO_0_NAME
default GPIO_QMSI_0_NAME
config IEEE802154_CC2520_GPIO_1_NAME
default GPIO_QMSI_1_NAME

endif # GPIO_QMSI

if SPI_QMSI
config SPI_CS_GPIO
config IEEE802154_CC2520_GPIO_SPI_CS
def_bool y
config SPI_1_CS_GPIO_PORT
config IEEE802154_CC2520_GPIO_SPI_CS_DRV_NAME
default GPIO_QMSI_0_NAME
config SPI_1_CS_GPIO_PIN
config IEEE802154_CC2520_GPIO_SPI_CS_PIN
default 11

config IEEE802154_CC2520_GPIO_0_NAME
string
default GPIO_QMSI_0_NAME
config IEEE802154_CC2520_GPIO_1_NAME
string
default GPIO_QMSI_1_NAME
endif

endif # IEEE802154_CC2520

if IEEE802154_CC1200

config SPI
def_bool y
config SPI_QMSI
def_bool n
config SPI_DW
def_bool y

config GPIO
def_bool y

Expand Down
7 changes: 7 additions & 0 deletions boards/x86/quark_se_c1000_devboard/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,17 @@ static void _pinmux_defaults(u32_t base)
u32_t mux_config[PINMUX_MAX_REGISTERS] = { 0, 0, 0, 0, 0};
int i = 0;

#if defined(CONFIG_SPI_2)
PIN_CONFIG(mux_config, 0, PINMUX_FUNC_C);
PIN_CONFIG(mux_config, 1, PINMUX_FUNC_C);
PIN_CONFIG(mux_config, 2, PINMUX_FUNC_C);
PIN_CONFIG(mux_config, 3, PINMUX_FUNC_C);
#else
PIN_CONFIG(mux_config, 0, PINMUX_FUNC_B);
PIN_CONFIG(mux_config, 1, PINMUX_FUNC_B);
PIN_CONFIG(mux_config, 2, PINMUX_FUNC_B);
PIN_CONFIG(mux_config, 3, PINMUX_FUNC_B);
#endif
PIN_CONFIG(mux_config, 8, PINMUX_FUNC_C);
PIN_CONFIG(mux_config, 9, PINMUX_FUNC_C);
PIN_CONFIG(mux_config, 16, PINMUX_FUNC_C);
Expand Down
14 changes: 4 additions & 10 deletions drivers/adc/Kconfig.ti_adc108s102
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ config ADC_TI_ADC108S102_SPI_PORT_NAME
help
Master SPI port name through which adc108s102 chip is accessed.

config ADC_TI_ADC108S102_SPI_CONFIGURATION
hex "Master SPI port configuration"
default 0x0
help
Master SPI port configuration flags used to access adc108s102 chip.

config ADC_TI_ADC108S102_SPI_MAX_FREQ
hex "Master SPI port max frequency"
default 0x0
config ADC_TI_ADC108S102_SPI_FREQ
int "Master SPI port max frequency"
default 0
help
Master SPI port maximum frequency used to access adc108s102 chip.
Master SPI port frequency used to access adc108s102 chip.

config ADC_TI_ADC108S102_SPI_SLAVE
int "SPI slave slot"
Expand Down
Loading