Skip to content
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

SPI tests for nrf54h20dk and nrf54l15pdk #1598

Merged
merged 6 commits into from
Apr 22, 2024
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
14 changes: 14 additions & 0 deletions drivers/spi/Kconfig.nrfx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 5 additions & 14 deletions drivers/spi/spi_nrfx_spis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

#ifdef CONFIG_HAS_HW_NRF_SPIS1
SPI_NRFX_SPIS_DEFINE(1);
#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_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, (), (), _)
10 changes: 10 additions & 0 deletions dts/arm/nordic/nrf54l15_cpuapp_peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spi00: spi@4a000 {
interrupts = <74 NRF_DEFAULT_IRQ_PRIORITY>;
max-frequency = <DT_FREQ_M(32)>;
easydma-maxcnt-bits = <16>;
rx-delay-supported;
rx-delay = <1>;
status = "disabled";
};

Expand Down Expand Up @@ -124,6 +126,8 @@ spi20: spi@c6000 {
interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>;
max-frequency = <DT_FREQ_M(8)>;
easydma-maxcnt-bits = <16>;
rx-delay-supported;
rx-delay = <1>;
status = "disabled";
};

Expand Down Expand Up @@ -159,6 +163,8 @@ spi21: spi@c7000 {
interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>;
max-frequency = <DT_FREQ_M(8)>;
easydma-maxcnt-bits = <16>;
rx-delay-supported;
rx-delay = <1>;
status = "disabled";
};

Expand Down Expand Up @@ -194,6 +200,8 @@ spi22: spi@c8000 {
interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>;
max-frequency = <DT_FREQ_M(8)>;
easydma-maxcnt-bits = <16>;
rx-delay-supported;
rx-delay = <1>;
status = "disabled";
};

Expand Down Expand Up @@ -391,6 +399,8 @@ spi30: spi@104000 {
interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>;
max-frequency = <DT_FREQ_M(8)>;
easydma-maxcnt-bits = <16>;
rx-delay-supported;
rx-delay = <1>;
status = "disabled";
};

Expand Down
20 changes: 20 additions & 0 deletions dts/common/nordic/nrf54h20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@
max-frequency = <DT_FREQ_M(32)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart120: uart@8e6000 {
Expand All @@ -380,6 +382,8 @@
max-frequency = <DT_FREQ_M(32)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

cpuppr_vpr: vpr@908000 {
Expand Down Expand Up @@ -637,6 +641,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart130: uart@9a5000 {
Expand Down Expand Up @@ -665,6 +671,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart131: uart@9a6000 {
Expand Down Expand Up @@ -727,6 +735,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart132: uart@9b5000 {
Expand Down Expand Up @@ -755,6 +765,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart133: uart@9b6000 {
Expand Down Expand Up @@ -817,6 +829,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart134: uart@9c5000 {
Expand Down Expand Up @@ -845,6 +859,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart135: uart@9c6000 {
Expand Down Expand Up @@ -907,6 +923,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart136: uart@9d5000 {
Expand Down Expand Up @@ -935,6 +953,8 @@
max-frequency = <DT_FREQ_M(8)>;
#address-cells = <1>;
#size-cells = <0>;
rx-delay-supported;
rx-delay = <1>;
};

uart137: uart@9d6000 {
Expand Down
70 changes: 70 additions & 0 deletions modules/hal_nordic/nrfx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,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
Expand Down
48 changes: 46 additions & 2 deletions modules/hal_nordic/nrfx/nrfx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,10 @@
#ifdef CONFIG_NRFX_SPIM4
#define NRFX_SPIM4_ENABLED 1
#endif
#if (DT_PROP(DT_NODELABEL(spi3), rx_delay_supported) || \
DT_PROP(DT_NODELABEL(spi4), rx_delay_supported))

#define NRFX_SPIM_DT_HAS_RX_DELAY(node) DT_PROP(node, rx_delay_supported) +

#if DT_FOREACH_STATUS_OKAY(nordic_nrf_spim, NRFX_SPIM_DT_HAS_RX_DELAY) 0
#define NRFX_SPIM_EXTENDED_ENABLED 1
#endif
#ifdef CONFIG_NRFX_SPIM00
Expand Down Expand Up @@ -449,6 +451,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
Expand Down
42 changes: 42 additions & 0 deletions soc/common/nordic_nrf/Kconfig.peripherals
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,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))

Expand Down
Loading
Loading