Porting NRC7394 802.11ah device on ESPI2
skip all other spi device in device tree DTS file
My settings: based on imx8mm-evk.dtsi
https://github.com/nxp-imx/linux-imx/blob/lf-5.15.y/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
modification:
/*skip default one
&ecspi2 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
status = "okay";
spidev0: spi@0 {
reg = <0>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <500000>;
};
};
*/
//add for nrc7394
&ecspi2 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
//pinctrl-0 = <&pinctrl_nrc_spi &pinctrl_ecspi2_cs>;
pinctrl-0 = <&pinctrl_nrc_spi>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
status = "okay";
nrc: nrc-cspi@0 {
reg = <0>;
compatible = "nrc80211";
spi-max-frequency = <20000000>;
interrupt-parent = <&gpio5>;
interrupts = <9 8>;
};
};
...
/*skip
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x82
MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x82
MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x82
>;
};
*/
//add for nrc7394
pinctrl_nrc_spi: nrcspigrp {
fsl,pins = <
MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x82
MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x82
MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x82
//MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19
>;
};
But after insmod nrc.ko, I always get: Chip select 0 is occupied
[ 20.944333] nrc: loading out-of-tree module taints kernel.
[ 20.954075] spi_imx 30830000.spi: chipselect 0 already in use
[ 20.960032] spi_master spi1: Failed to instantiate a new spi device.
[ 20.966510] nrc80211 spi1.0: [Error] gpio_reqeust() is failed (5)
[ 20.972655] nrc80211 spi1.0: Failed to nrc_cspi_gpio_alloc
[ 20.978185] nrc80211: probe of spi1.0 failed with error -22
I can see spi1.0 device is only the nrc one and there is no other spix.x in spi_master
cat /sys/class/spi_master/spi1/spi1.0/modalias
spi:nrc80211
I also try prebuild image LF_v6.1.55-2.2.0, there is no this issue with same DTS settings.
want to know if its the kernel 5.15 known issue?
Thanks.