boards: dts: Add mcr20a bindings and fix networking samples
Adds dts bindings for the mcr20a wireless transceiver. The frdm_k64f
board supports the mcr20a via an Arduino shield, therefore the dts node
is added to the board dts. The kw2xd is a SiP and thus the mcr20a dts
node is added to the soc dts.
The networking samples using prj_frdm_k64f_mcr20a.conf have been broken
since the refactoring of the mcux gpio driver to dts in commit
4e8f29f319
. The sample is now fixed.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
ae2a9b0f3e
commit
0d1beb2f9e
9 changed files with 91 additions and 19 deletions
|
@ -80,6 +80,16 @@
|
|||
#define CONFIG_SPI_1_IRQ_PRI NXP_KINETIS_DSPI_4002D000_IRQ_0_PRIORITY
|
||||
#define CONFIG_SPI_1_CLOCK_NAME NXP_KINETIS_DSPI_4002D000_CLOCK_CONTROLLER
|
||||
#define CONFIG_SPI_1_CLOCK_SUBSYS NXP_KINETIS_DSPI_4002D000_CLOCK_NAME
|
||||
|
||||
#define CONFIG_IEEE802154_MCR20A_SPI_DRV_NAME NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_BUS_NAME
|
||||
#define CONFIG_IEEE802154_MCR20A_SPI_SLAVE NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_BASE_ADDRESS
|
||||
#define CONFIG_IEEE802154_MCR20A_SPI_FREQ NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_SPI_MAX_FREQUENCY
|
||||
#define CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS_DRV_NAME NXP_KINETIS_DSPI_4002D000_CS_GPIOS_CONTROLLER
|
||||
#define CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS_PIN NXP_KINETIS_DSPI_4002D000_CS_GPIOS_PIN
|
||||
#define CONFIG_MCR20A_GPIO_IRQ_B_NAME NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_IRQB_GPIOS_CONTROLLER
|
||||
#define CONFIG_MCR20A_GPIO_IRQ_B_PIN NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_IRQB_GPIOS_PIN
|
||||
#define CONFIG_MCR20A_GPIO_RESET_NAME NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_RESET_GPIOS_CONTROLLER
|
||||
#define CONFIG_MCR20A_GPIO_RESET_PIN NXP_KINETIS_DSPI_4002D000_NXP_MCR20A_0_RESET_GPIOS_PIN
|
||||
#endif /* CONFIG_SOC_MKW22D5 || CONFIG_SOC_MKW24D5 */
|
||||
|
||||
#if defined(CONFIG_SOC_MKW40Z4) || defined(CONFIG_SOC_MKW41Z4)
|
||||
|
|
|
@ -6,3 +6,4 @@ config BOARD_FRDM_K64F
|
|||
select HAS_DTS_GPIO_DEVICE
|
||||
select HAS_DTS_I2C_DEVICE
|
||||
select HAS_DTS_SPI_DEVICE
|
||||
select HAS_DTS_SPI_PINS
|
||||
|
|
|
@ -3,3 +3,13 @@
|
|||
#define CONFIG_FXOS8700_I2C_ADDRESS NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_BASE_ADDRESS
|
||||
#define CONFIG_FXOS8700_GPIO_NAME NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_INT2_GPIOS_CONTROLLER
|
||||
#define CONFIG_FXOS8700_GPIO_PIN NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_INT2_GPIOS_PIN
|
||||
|
||||
#define CONFIG_IEEE802154_MCR20A_SPI_DRV_NAME NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_BUS_NAME
|
||||
#define CONFIG_IEEE802154_MCR20A_SPI_SLAVE NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_BASE_ADDRESS
|
||||
#define CONFIG_IEEE802154_MCR20A_SPI_FREQ NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_SPI_MAX_FREQUENCY
|
||||
#define CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS_DRV_NAME NXP_KINETIS_DSPI_4002C000_CS_GPIOS_CONTROLLER
|
||||
#define CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS_PIN NXP_KINETIS_DSPI_4002C000_CS_GPIOS_PIN
|
||||
#define CONFIG_MCR20A_GPIO_IRQ_B_NAME NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_IRQB_GPIOS_CONTROLLER
|
||||
#define CONFIG_MCR20A_GPIO_IRQ_B_PIN NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_IRQB_GPIOS_PIN
|
||||
#define CONFIG_MCR20A_GPIO_RESET_NAME NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_RESET_GPIOS_CONTROLLER
|
||||
#define CONFIG_MCR20A_GPIO_RESET_PIN NXP_KINETIS_DSPI_4002C000_NXP_MCR20A_0_RESET_GPIOS_PIN
|
||||
|
|
|
@ -94,6 +94,21 @@
|
|||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "ok";
|
||||
cs-gpios = <&gpiod 0 0>;
|
||||
|
||||
mcr20a@0 {
|
||||
compatible = "nxp,mcr20a";
|
||||
reg = <0x0>;
|
||||
label = "mcr20a";
|
||||
spi-max-frequency = <4000000>;
|
||||
irqb-gpios = <&gpiob 9 0>;
|
||||
reset-gpios = <&gpioa 2 0>;
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&pwm3 {
|
||||
status = "ok";
|
||||
};
|
||||
|
|
|
@ -9,4 +9,6 @@ config BOARD_USB_KW24D512
|
|||
bool "NXP USB-KW24D512"
|
||||
depends on SOC_SERIES_KINETIS_KWX
|
||||
select SOC_PART_NUMBER_MKW24D512VHA5
|
||||
select HAS_DTS_GPIO_DEVICE
|
||||
select HAS_DTS_SPI_DEVICE
|
||||
select HAS_DTS_SPI_PINS
|
||||
|
|
|
@ -101,24 +101,6 @@ endif # SPI
|
|||
|
||||
if IEEE802154_MCR20A
|
||||
|
||||
config IEEE802154_MCR20A_SPI_DRV_NAME
|
||||
default SPI_1_NAME
|
||||
|
||||
config MCR20A_GPIO_IRQ_B_NAME
|
||||
default GPIO_MCUX_PORTB_NAME
|
||||
|
||||
config MCR20A_GPIO_IRQ_B_PIN
|
||||
default 3
|
||||
|
||||
config MCR20A_GPIO_RESET_NAME
|
||||
default GPIO_MCUX_PORTB_NAME
|
||||
|
||||
config MCR20A_GPIO_RESET_PIN
|
||||
default 19
|
||||
|
||||
config IEEE802154_MCR20A_SPI_FREQ
|
||||
default 8000000
|
||||
|
||||
config MCR20A_IS_PART_OF_KW2XD_SIP
|
||||
default y
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ config IEEE802154_MCR20A_DRV_NAME
|
|||
help
|
||||
This option sets the driver name
|
||||
|
||||
if !HAS_DTS_SPI_DEVICE
|
||||
|
||||
config IEEE802154_MCR20A_SPI_DRV_NAME
|
||||
string "SPI driver's name to use to access MCR20A"
|
||||
default SPI_0_NAME
|
||||
|
@ -41,6 +43,8 @@ config IEEE802154_MCR20A_SPI_SLAVE
|
|||
This option sets the SPI slave number SPI controller has to switch
|
||||
to when dealing with MCR20A chip.
|
||||
|
||||
endif # !HAS_DTS_SPI_DEVICE
|
||||
|
||||
config IEEE802154_MCR20A_GPIO_SPI_CS
|
||||
bool "Manage SPI CS through a GPIO pin"
|
||||
default n
|
||||
|
@ -48,6 +52,8 @@ config IEEE802154_MCR20A_GPIO_SPI_CS
|
|||
This option is useful if one needs to manage SPI CS through a GPIO
|
||||
pin to by-pass the SPI controller's CS logic.
|
||||
|
||||
if !HAS_DTS_SPI_PINS
|
||||
|
||||
config IEEE802154_MCR20A_GPIO_SPI_CS_DRV_NAME
|
||||
string "GPIO driver's name to use to drive SPI CS through"
|
||||
default ""
|
||||
|
@ -64,6 +70,10 @@ config IEEE802154_MCR20A_GPIO_SPI_CS_PIN
|
|||
This option is mandatory to set which GPIO pin to use in order
|
||||
to actually emulate the SPI CS.
|
||||
|
||||
endif # !HAS_DTS_SPI_PINS
|
||||
|
||||
if !HAS_DTS_GPIO_DEVICE
|
||||
|
||||
config MCR20A_GPIO_IRQ_B_NAME
|
||||
string "GPIO device used for IRQ_B output of MCR20A"
|
||||
default GPIO_MCUX_PORTB_NAME
|
||||
|
@ -80,6 +90,8 @@ config MCR20A_GPIO_RESET_PIN
|
|||
int "GPIO pin connected to RESET input of MCR20A"
|
||||
default 2
|
||||
|
||||
endif # !HAS_DTS_GPIO_DEVICE
|
||||
|
||||
config MCR20A_IS_PART_OF_KW2XD_SIP
|
||||
bool "MCR20A device is part of KW2xD SiP"
|
||||
default n
|
||||
|
|
|
@ -253,11 +253,21 @@
|
|||
label = "SPI_1";
|
||||
clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>;
|
||||
|
||||
cs = <&gpiob 10 0>;
|
||||
cs-gpios = <&gpiob 10 0>;
|
||||
pinctrl-0 = <&spi1_default>;
|
||||
pinctrl-names = "default";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
mcr20a@0 {
|
||||
compatible = "nxp,mcr20a";
|
||||
reg = <0x0>;
|
||||
label = "mcr20a";
|
||||
spi-max-frequency = <8000000>;
|
||||
irqb-gpios = <&gpiob 3 0>;
|
||||
reset-gpios = <&gpiob 19 0>;
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
wdog: watchdog@40052000 {
|
||||
|
|
30
dts/bindings/ieee802154/nxp,mcr20a.yaml
Normal file
30
dts/bindings/ieee802154/nxp,mcr20a.yaml
Normal file
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# Copyright (c) 2018, NXP
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
---
|
||||
title: NXP MCR20A 802.15.4 Wireless Transceiver
|
||||
id: nxp,mcr20a
|
||||
version: 0.1
|
||||
|
||||
description: >
|
||||
This is a representation of the NXP MCR20A wireless transceiver.
|
||||
|
||||
inherits:
|
||||
!include spi-device.yaml
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
constraint: "nxp,mcr20a"
|
||||
|
||||
irqb-gpios:
|
||||
type: compound
|
||||
category: required
|
||||
generation: define, use-prop-name
|
||||
|
||||
reset-gpios:
|
||||
type: compound
|
||||
category: required
|
||||
generation: define, use-prop-name
|
||||
...
|
Loading…
Add table
Add a link
Reference in a new issue