dts: nrf: Remove SPI dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup. Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
This commit is contained in:
parent
5a10087a25
commit
c1f7e0c955
9 changed files with 116 additions and 149 deletions
|
@ -275,12 +275,12 @@ static int init_spi(struct device *dev, const nrfx_spi_config_t *config)
|
||||||
static int spi_##idx##_init(struct device *dev) \
|
static int spi_##idx##_init(struct device *dev) \
|
||||||
{ \
|
{ \
|
||||||
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPI##idx), \
|
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPI##idx), \
|
||||||
CONFIG_SPI_##idx##_IRQ_PRI, \
|
DT_NORDIC_NRF_SPI_SPI_##idx##_IRQ_PRIORITY, \
|
||||||
nrfx_isr, nrfx_spi_##idx##_irq_handler, 0); \
|
nrfx_isr, nrfx_spi_##idx##_irq_handler, 0); \
|
||||||
const nrfx_spi_config_t config = { \
|
const nrfx_spi_config_t config = { \
|
||||||
.sck_pin = DT_SPI_##idx##_NRF_SCK_PIN, \
|
.sck_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_SCK_PIN, \
|
||||||
.mosi_pin = DT_SPI_##idx##_NRF_MOSI_PIN, \
|
.mosi_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MOSI_PIN, \
|
||||||
.miso_pin = DT_SPI_##idx##_NRF_MISO_PIN, \
|
.miso_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MISO_PIN, \
|
||||||
.ss_pin = NRFX_SPI_PIN_NOT_USED, \
|
.ss_pin = NRFX_SPI_PIN_NOT_USED, \
|
||||||
.orc = CONFIG_SPI_##idx##_NRF_ORC, \
|
.orc = CONFIG_SPI_##idx##_NRF_ORC, \
|
||||||
.frequency = NRF_SPI_FREQ_4M, \
|
.frequency = NRF_SPI_FREQ_4M, \
|
||||||
|
@ -297,7 +297,7 @@ static int init_spi(struct device *dev, const nrfx_spi_config_t *config)
|
||||||
static const struct spi_nrfx_config spi_##idx##_config = { \
|
static const struct spi_nrfx_config spi_##idx##_config = { \
|
||||||
.spi = NRFX_SPI_INSTANCE(idx), \
|
.spi = NRFX_SPI_INSTANCE(idx), \
|
||||||
}; \
|
}; \
|
||||||
DEVICE_AND_API_INIT(spi_##idx, CONFIG_SPI_##idx##_NAME, \
|
DEVICE_AND_API_INIT(spi_##idx, DT_NORDIC_NRF_SPI_SPI_##idx##_LABEL, \
|
||||||
spi_##idx##_init, \
|
spi_##idx##_init, \
|
||||||
&spi_##idx##_data, \
|
&spi_##idx##_data, \
|
||||||
&spi_##idx##_config, \
|
&spi_##idx##_config, \
|
||||||
|
|
|
@ -311,12 +311,12 @@ static int init_spim(struct device *dev, const nrfx_spim_config_t *config)
|
||||||
static int spi_##idx##_init(struct device *dev) \
|
static int spi_##idx##_init(struct device *dev) \
|
||||||
{ \
|
{ \
|
||||||
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM##idx), \
|
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM##idx), \
|
||||||
CONFIG_SPI_##idx##_IRQ_PRI, \
|
DT_NORDIC_NRF_SPI_SPI_##idx##_IRQ_PRIORITY, \
|
||||||
nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \
|
nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \
|
||||||
const nrfx_spim_config_t config = { \
|
const nrfx_spim_config_t config = { \
|
||||||
.sck_pin = DT_SPI_##idx##_NRF_SCK_PIN, \
|
.sck_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_SCK_PIN, \
|
||||||
.mosi_pin = DT_SPI_##idx##_NRF_MOSI_PIN, \
|
.mosi_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MOSI_PIN, \
|
||||||
.miso_pin = DT_SPI_##idx##_NRF_MISO_PIN, \
|
.miso_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MISO_PIN, \
|
||||||
.ss_pin = NRFX_SPIM_PIN_NOT_USED, \
|
.ss_pin = NRFX_SPIM_PIN_NOT_USED, \
|
||||||
.orc = CONFIG_SPI_##idx##_NRF_ORC, \
|
.orc = CONFIG_SPI_##idx##_NRF_ORC, \
|
||||||
.frequency = NRF_SPIM_FREQ_4M, \
|
.frequency = NRF_SPIM_FREQ_4M, \
|
||||||
|
@ -335,7 +335,8 @@ static int init_spim(struct device *dev, const nrfx_spim_config_t *config)
|
||||||
.spim = NRFX_SPIM_INSTANCE(idx), \
|
.spim = NRFX_SPIM_INSTANCE(idx), \
|
||||||
.max_chunk_len = (1 << SPIM##idx##_EASYDMA_MAXCNT_SIZE) - 1, \
|
.max_chunk_len = (1 << SPIM##idx##_EASYDMA_MAXCNT_SIZE) - 1, \
|
||||||
}; \
|
}; \
|
||||||
DEVICE_AND_API_INIT(spi_##idx, DT_SPI_##idx##_NAME, \
|
DEVICE_AND_API_INIT(spi_##idx, \
|
||||||
|
DT_NORDIC_NRF_SPI_SPI_##idx##_LABEL, \
|
||||||
spi_##idx##_init, \
|
spi_##idx##_init, \
|
||||||
&spi_##idx##_data, \
|
&spi_##idx##_data, \
|
||||||
&spi_##idx##_config, \
|
&spi_##idx##_config, \
|
||||||
|
|
|
@ -251,13 +251,13 @@ static int init_spis(struct device *dev, const nrfx_spis_config_t *config)
|
||||||
static int spi_##idx##_init(struct device *dev) \
|
static int spi_##idx##_init(struct device *dev) \
|
||||||
{ \
|
{ \
|
||||||
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS##idx), \
|
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS##idx), \
|
||||||
CONFIG_SPI_##idx##_IRQ_PRI, \
|
DT_NORDIC_NRF_SPI_SPI_##idx##_IRQ_PRIORITY, \
|
||||||
nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \
|
nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \
|
||||||
const nrfx_spis_config_t config = { \
|
const nrfx_spis_config_t config = { \
|
||||||
.sck_pin = DT_SPI_##idx##_NRF_SCK_PIN, \
|
.sck_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_SCK_PIN, \
|
||||||
.mosi_pin = DT_SPI_##idx##_NRF_MOSI_PIN, \
|
.mosi_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MOSI_PIN, \
|
||||||
.miso_pin = DT_SPI_##idx##_NRF_MISO_PIN, \
|
.miso_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MISO_PIN, \
|
||||||
.csn_pin = DT_SPI_##idx##_NRF_CSN_PIN, \
|
.csn_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_CSN_PIN, \
|
||||||
.mode = NRF_SPIS_MODE_0, \
|
.mode = NRF_SPIS_MODE_0, \
|
||||||
.bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \
|
.bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \
|
||||||
.csn_pullup = NRFX_SPIS_DEFAULT_CSN_PULLUP, \
|
.csn_pullup = NRFX_SPIS_DEFAULT_CSN_PULLUP, \
|
||||||
|
@ -275,11 +275,13 @@ static int init_spis(struct device *dev, const nrfx_spis_config_t *config)
|
||||||
.spis = NRFX_SPIS_INSTANCE(idx), \
|
.spis = NRFX_SPIS_INSTANCE(idx), \
|
||||||
.max_buf_len = (1 << SPIS##idx##_EASYDMA_MAXCNT_SIZE) - 1, \
|
.max_buf_len = (1 << SPIS##idx##_EASYDMA_MAXCNT_SIZE) - 1, \
|
||||||
}; \
|
}; \
|
||||||
DEVICE_AND_API_INIT(spi_##idx, DT_SPI_##idx##_NAME, \
|
DEVICE_AND_API_INIT(spi_##idx, \
|
||||||
|
DT_NORDIC_NRF_SPI_SPI_##idx##_LABEL, \
|
||||||
spi_##idx##_init, \
|
spi_##idx##_init, \
|
||||||
&spi_##idx##_data, \
|
&spi_##idx##_data, \
|
||||||
&spi_##idx##_config, \
|
&spi_##idx##_config, \
|
||||||
POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
|
POST_KERNEL, \
|
||||||
|
CONFIG_SPI_INIT_PRIORITY, \
|
||||||
&spi_nrfx_driver_api)
|
&spi_nrfx_driver_api)
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_0_NRF_SPIS
|
#ifdef CONFIG_SPI_0_NRF_SPIS
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
aliases {
|
aliases {
|
||||||
i2c-0 = &i2c0;
|
i2c-0 = &i2c0;
|
||||||
i2c-1 = &i2c1;
|
i2c-1 = &i2c1;
|
||||||
|
spi-0 = &spi0;
|
||||||
|
spi-1 = &spi1;
|
||||||
};
|
};
|
||||||
|
|
||||||
soc {
|
soc {
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
|
|
||||||
aliases {
|
aliases {
|
||||||
i2c-0 = &i2c0;
|
i2c-0 = &i2c0;
|
||||||
|
spi-0 = &spi0;
|
||||||
};
|
};
|
||||||
|
|
||||||
soc {
|
soc {
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
aliases {
|
aliases {
|
||||||
i2c-0 = &i2c0;
|
i2c-0 = &i2c0;
|
||||||
i2c-1 = &i2c1;
|
i2c-1 = &i2c1;
|
||||||
|
spi-0 = &spi0;
|
||||||
|
spi-1 = &spi1;
|
||||||
|
spi-2 = &spi2;
|
||||||
};
|
};
|
||||||
|
|
||||||
soc {
|
soc {
|
||||||
|
|
|
@ -39,6 +39,10 @@
|
||||||
aliases {
|
aliases {
|
||||||
i2c-0 = &i2c0;
|
i2c-0 = &i2c0;
|
||||||
i2c-1 = &i2c1;
|
i2c-1 = &i2c1;
|
||||||
|
spi-0 = &spi0;
|
||||||
|
spi-1 = &spi1;
|
||||||
|
spi-2 = &spi2;
|
||||||
|
spi-3 = &spi3;
|
||||||
};
|
};
|
||||||
|
|
||||||
soc {
|
soc {
|
||||||
|
|
|
@ -44,23 +44,8 @@
|
||||||
#define DT_QDEC_LED_PRE DT_NORDIC_NRF_QDEC_40012000_LED_PRE
|
#define DT_QDEC_LED_PRE DT_NORDIC_NRF_QDEC_40012000_LED_PRE
|
||||||
#define DT_QDEC_STEPS DT_NORDIC_NRF_QDEC_40012000_STEPS
|
#define DT_QDEC_STEPS DT_NORDIC_NRF_QDEC_40012000_STEPS
|
||||||
|
|
||||||
#define DT_SPI_0_BASE_ADDRESS DT_NORDIC_NRF_SPI_40003000_BASE_ADDRESS
|
#define DT_SPI_0_NAME DT_NORDIC_NRF_SPI_SPI_0_LABEL
|
||||||
#define DT_SPI_0_NAME DT_NORDIC_NRF_SPI_40003000_LABEL
|
#define DT_SPI_1_NAME DT_NORDIC_NRF_SPI_SPI_1_LABEL
|
||||||
#define CONFIG_SPI_0_IRQ_PRI DT_NORDIC_NRF_SPI_40003000_IRQ_0_PRIORITY
|
|
||||||
#define DT_SPI_0_IRQ DT_NORDIC_NRF_SPI_40003000_IRQ_0
|
|
||||||
#define DT_SPI_0_NRF_SCK_PIN DT_NORDIC_NRF_SPI_40003000_SCK_PIN
|
|
||||||
#define DT_SPI_0_NRF_MOSI_PIN DT_NORDIC_NRF_SPI_40003000_MOSI_PIN
|
|
||||||
#define DT_SPI_0_NRF_MISO_PIN DT_NORDIC_NRF_SPI_40003000_MISO_PIN
|
|
||||||
#define DT_SPI_0_NRF_CSN_PIN DT_NORDIC_NRF_SPI_40003000_CSN_PIN
|
|
||||||
|
|
||||||
#define DT_SPI_1_BASE_ADDRESS DT_NORDIC_NRF_SPI_40004000_BASE_ADDRESS
|
|
||||||
#define DT_SPI_1_NAME DT_NORDIC_NRF_SPI_40004000_LABEL
|
|
||||||
#define CONFIG_SPI_1_IRQ_PRI DT_NORDIC_NRF_SPI_40004000_IRQ_0_PRIORITY
|
|
||||||
#define DT_SPI_1_IRQ DT_NORDIC_NRF_SPI_40004000_IRQ_0
|
|
||||||
#define DT_SPI_1_NRF_SCK_PIN DT_NORDIC_NRF_SPI_40004000_SCK_PIN
|
|
||||||
#define DT_SPI_1_NRF_MOSI_PIN DT_NORDIC_NRF_SPI_40004000_MOSI_PIN
|
|
||||||
#define DT_SPI_1_NRF_MISO_PIN DT_NORDIC_NRF_SPI_40004000_MISO_PIN
|
|
||||||
#define DT_SPI_1_NRF_CSN_PIN DT_NORDIC_NRF_SPI_40004000_CSN_PIN
|
|
||||||
|
|
||||||
#define CONFIG_WDT_0_NAME DT_NORDIC_NRF_WATCHDOG_40010000_LABEL
|
#define CONFIG_WDT_0_NAME DT_NORDIC_NRF_WATCHDOG_40010000_LABEL
|
||||||
#define DT_WDT_NRF_IRQ DT_NORDIC_NRF_WATCHDOG_40010000_IRQ_WDT
|
#define DT_WDT_NRF_IRQ DT_NORDIC_NRF_WATCHDOG_40010000_IRQ_WDT
|
||||||
|
|
|
@ -77,41 +77,10 @@
|
||||||
#define DT_QDEC_LED_PRE DT_NORDIC_NRF_QDEC_40012000_LED_PRE
|
#define DT_QDEC_LED_PRE DT_NORDIC_NRF_QDEC_40012000_LED_PRE
|
||||||
#define DT_QDEC_STEPS DT_NORDIC_NRF_QDEC_40012000_STEPS
|
#define DT_QDEC_STEPS DT_NORDIC_NRF_QDEC_40012000_STEPS
|
||||||
|
|
||||||
#define DT_SPI_0_BASE_ADDRESS DT_NORDIC_NRF_SPI_40003000_BASE_ADDRESS
|
#define DT_SPI_0_NAME DT_NORDIC_NRF_SPI_SPI_0_LABEL
|
||||||
#define DT_SPI_0_NAME DT_NORDIC_NRF_SPI_40003000_LABEL
|
#define DT_SPI_1_NAME DT_NORDIC_NRF_SPI_SPI_1_LABEL
|
||||||
#define CONFIG_SPI_0_IRQ_PRI DT_NORDIC_NRF_SPI_40003000_IRQ_0_PRIORITY
|
#define DT_SPI_2_NAME DT_NORDIC_NRF_SPI_SPI_2_LABEL
|
||||||
#define DT_SPI_0_IRQ DT_NORDIC_NRF_SPI_40003000_IRQ_0
|
#define DT_SPI_3_NAME DT_NORDIC_NRF_SPI_SPI_3_LABEL
|
||||||
#define DT_SPI_0_NRF_SCK_PIN DT_NORDIC_NRF_SPI_40003000_SCK_PIN
|
|
||||||
#define DT_SPI_0_NRF_MOSI_PIN DT_NORDIC_NRF_SPI_40003000_MOSI_PIN
|
|
||||||
#define DT_SPI_0_NRF_MISO_PIN DT_NORDIC_NRF_SPI_40003000_MISO_PIN
|
|
||||||
#define DT_SPI_0_NRF_CSN_PIN DT_NORDIC_NRF_SPI_40003000_CSN_PIN
|
|
||||||
|
|
||||||
#define DT_SPI_1_BASE_ADDRESS DT_NORDIC_NRF_SPI_40004000_BASE_ADDRESS
|
|
||||||
#define DT_SPI_1_NAME DT_NORDIC_NRF_SPI_40004000_LABEL
|
|
||||||
#define CONFIG_SPI_1_IRQ_PRI DT_NORDIC_NRF_SPI_40004000_IRQ_0_PRIORITY
|
|
||||||
#define DT_SPI_1_IRQ DT_NORDIC_NRF_SPI_40004000_IRQ_0
|
|
||||||
#define DT_SPI_1_NRF_SCK_PIN DT_NORDIC_NRF_SPI_40004000_SCK_PIN
|
|
||||||
#define DT_SPI_1_NRF_MOSI_PIN DT_NORDIC_NRF_SPI_40004000_MOSI_PIN
|
|
||||||
#define DT_SPI_1_NRF_MISO_PIN DT_NORDIC_NRF_SPI_40004000_MISO_PIN
|
|
||||||
#define DT_SPI_1_NRF_CSN_PIN DT_NORDIC_NRF_SPI_40004000_CSN_PIN
|
|
||||||
|
|
||||||
#define DT_SPI_2_BASE_ADDRESS DT_NORDIC_NRF_SPI_40023000_BASE_ADDRESS
|
|
||||||
#define DT_SPI_2_NAME DT_NORDIC_NRF_SPI_40023000_LABEL
|
|
||||||
#define CONFIG_SPI_2_IRQ_PRI DT_NORDIC_NRF_SPI_40023000_IRQ_0_PRIORITY
|
|
||||||
#define DT_SPI_2_IRQ DT_NORDIC_NRF_SPI_40023000_IRQ_0
|
|
||||||
#define DT_SPI_2_NRF_SCK_PIN DT_NORDIC_NRF_SPI_40023000_SCK_PIN
|
|
||||||
#define DT_SPI_2_NRF_MOSI_PIN DT_NORDIC_NRF_SPI_40023000_MOSI_PIN
|
|
||||||
#define DT_SPI_2_NRF_MISO_PIN DT_NORDIC_NRF_SPI_40023000_MISO_PIN
|
|
||||||
#define DT_SPI_2_NRF_CSN_PIN DT_NORDIC_NRF_SPI_40023000_CSN_PIN
|
|
||||||
|
|
||||||
#define DT_SPI_3_BASE_ADDRESS DT_NORDIC_NRF_SPI_4002B000_BASE_ADDRESS
|
|
||||||
#define DT_SPI_3_NAME DT_NORDIC_NRF_SPI_4002B000_LABEL
|
|
||||||
#define CONFIG_SPI_3_IRQ_PRI DT_NORDIC_NRF_SPI_4002B000_IRQ_0_PRIORITY
|
|
||||||
#define DT_SPI_3_IRQ DT_NORDIC_NRF_SPI_4002B000_IRQ_0
|
|
||||||
#define DT_SPI_3_NRF_SCK_PIN DT_NORDIC_NRF_SPI_4002B000_SCK_PIN
|
|
||||||
#define DT_SPI_3_NRF_MOSI_PIN DT_NORDIC_NRF_SPI_4002B000_MOSI_PIN
|
|
||||||
#define DT_SPI_3_NRF_MISO_PIN DT_NORDIC_NRF_SPI_4002B000_MISO_PIN
|
|
||||||
#define DT_SPI_3_NRF_CSN_PIN DT_NORDIC_NRF_SPI_4002B000_CSN_PIN
|
|
||||||
|
|
||||||
#define DT_USBD_NRF_IRQ DT_NORDIC_NRF_USBD_40027000_IRQ_USBD
|
#define DT_USBD_NRF_IRQ DT_NORDIC_NRF_USBD_40027000_IRQ_USBD
|
||||||
#define DT_USBD_NRF_IRQ_PRI DT_NORDIC_NRF_USBD_40027000_IRQ_USBD_PRIORITY
|
#define DT_USBD_NRF_IRQ_PRI DT_NORDIC_NRF_USBD_40027000_IRQ_USBD_PRIORITY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue