drivers: spi: nrf: Add new SPIS instances

Add support for upcomming SPIS instances.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2024-01-22 13:40:44 +01:00 committed by Carles Cufí
parent 961b83a431
commit c975910f84
5 changed files with 173 additions and 14 deletions

View file

@ -51,6 +51,20 @@ config SPI_NRFX_SPIS
select NRFX_SPIS1 if HAS_HW_NRF_SPIS1
select NRFX_SPIS2 if HAS_HW_NRF_SPIS2
select NRFX_SPIS3 if HAS_HW_NRF_SPIS3
select NRFX_SPIS00 if HAS_HW_NRF_SPIS00
select NRFX_SPIS20 if HAS_HW_NRF_SPIS20
select NRFX_SPIS21 if HAS_HW_NRF_SPIS21
select NRFX_SPIS22 if HAS_HW_NRF_SPIS22
select NRFX_SPIS30 if HAS_HW_NRF_SPIS30
select NRFX_SPIS120 if HAS_HW_NRF_SPIS120
select NRFX_SPIS130 if HAS_HW_NRF_SPIS130
select NRFX_SPIS131 if HAS_HW_NRF_SPIS131
select NRFX_SPIS132 if HAS_HW_NRF_SPIS132
select NRFX_SPIS133 if HAS_HW_NRF_SPIS133
select NRFX_SPIS134 if HAS_HW_NRF_SPIS134
select NRFX_SPIS135 if HAS_HW_NRF_SPIS135
select NRFX_SPIS136 if HAS_HW_NRF_SPIS136
select NRFX_SPIS137 if HAS_HW_NRF_SPIS137
config SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58
depends on SOC_NRF52832

View file

@ -399,18 +399,9 @@ static int spi_nrfx_init(const struct device *dev)
CONFIG_SPI_INIT_PRIORITY, \
&spi_nrfx_driver_api)
#ifdef CONFIG_HAS_HW_NRF_SPIS0
SPI_NRFX_SPIS_DEFINE(0);
#endif
/* Macro creates device instance if it is enabled in devicetree. */
#define SPIS_DEVICE(periph, prefix, id, _) \
IF_ENABLED(CONFIG_HAS_HW_NRF_SPIS##prefix##id, (SPI_NRFX_SPIS_DEFINE(prefix##id);))
#ifdef CONFIG_HAS_HW_NRF_SPIS1
SPI_NRFX_SPIS_DEFINE(1);
#endif
#ifdef CONFIG_HAS_HW_NRF_SPIS2
SPI_NRFX_SPIS_DEFINE(2);
#endif
#ifdef CONFIG_HAS_HW_NRF_SPIS3
SPI_NRFX_SPIS_DEFINE(3);
#endif
/* Macro iterates over nrfx_spis instances enabled in the nrfx_config.h. */
NRFX_FOREACH_ENABLED(SPIS, SPIS_DEVICE, (), (), _)

View file

@ -401,6 +401,76 @@ config NRFX_SPIS3
depends on $(dt_nodelabel_has_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS00
bool "SPIS00 driver instance"
depends on $(dt_nodelabel_has_compat,spi00,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS20
bool "SPIS20 driver instance"
depends on $(dt_nodelabel_has_compat,spi20,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS21
bool "SPIS21 driver instance"
depends on $(dt_nodelabel_has_compat,spi21,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS22
bool "SPIS22 driver instance"
depends on $(dt_nodelabel_has_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS30
bool "SPIS30 driver instance"
depends on $(dt_nodelabel_has_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS120
bool "SPIS120 driver instance"
depends on $(dt_nodelabel_has_compat,spi120,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS130
bool "SPIS130 driver instance"
depends on $(dt_nodelabel_has_compat,spi130,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS131
bool "SPIS131 driver instance"
depends on $(dt_nodelabel_has_compat,spi131,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS132
bool "SPIS132 driver instance"
depends on $(dt_nodelabel_has_compat,spi132,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS133
bool "SPIS133 driver instance"
depends on $(dt_nodelabel_has_compat,spi133,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS134
bool "SPIS134 driver instance"
depends on $(dt_nodelabel_has_compat,spi134,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS135
bool "SPIS135 driver instance"
depends on $(dt_nodelabel_has_compat,spi135,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS136
bool "SPIS136 driver instance"
depends on $(dt_nodelabel_has_compat,spi136,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SPIS137
bool "SPIS137 driver instance"
depends on $(dt_nodelabel_has_compat,spi137,$(DT_COMPAT_NORDIC_NRF_SPIS))
select NRFX_SPIS
config NRFX_SYSTICK
bool "SYSTICK driver"
depends on CPU_CORTEX_M_HAS_SYSTICK

View file

@ -424,6 +424,48 @@
#ifdef CONFIG_NRFX_SPIS3
#define NRFX_SPIS3_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS00
#define NRFX_SPIS00_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS20
#define NRFX_SPIS20_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS21
#define NRFX_SPIS21_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS22
#define NRFX_SPIS22_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS30
#define NRFX_SPIS30_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS120
#define NRFX_SPIS120_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS130
#define NRFX_SPIS130_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS131
#define NRFX_SPIS131_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS132
#define NRFX_SPIS132_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS133
#define NRFX_SPIS133_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS134
#define NRFX_SPIS134_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS135
#define NRFX_SPIS135_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS136
#define NRFX_SPIS136_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIS137
#define NRFX_SPIS130_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SYSTICK
#define NRFX_SYSTICK_ENABLED 1

View file

@ -291,6 +291,48 @@ config HAS_HW_NRF_SPIS2
config HAS_HW_NRF_SPIS3
def_bool $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS00
def_bool $(dt_nodelabel_enabled_with_compat,spi00,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS20
def_bool $(dt_nodelabel_enabled_with_compat,spi20,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS21
def_bool $(dt_nodelabel_enabled_with_compat,spi21,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS22
def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS30
def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS120
def_bool $(dt_nodelabel_enabled_with_compat,spi120,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS130
def_bool $(dt_nodelabel_enabled_with_compat,spi130,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS131
def_bool $(dt_nodelabel_enabled_with_compat,spi131,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS132
def_bool $(dt_nodelabel_enabled_with_compat,spi132,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS133
def_bool $(dt_nodelabel_enabled_with_compat,spi133,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS134
def_bool $(dt_nodelabel_enabled_with_compat,spi134,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS135
def_bool $(dt_nodelabel_enabled_with_compat,spi135,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS136
def_bool $(dt_nodelabel_enabled_with_compat,spi136,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPIS137
def_bool $(dt_nodelabel_enabled_with_compat,spi137,$(DT_COMPAT_NORDIC_NRF_SPIS))
config HAS_HW_NRF_SPU
def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_SPU))