CS as a GPIO not working on our i.MX 8M Nano board, GPIO is configured as an input.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CS as a GPIO not working on our i.MX 8M Nano board, GPIO is configured as an input.

522件の閲覧回数
martintownsend
Contributor I

Hi,

We are configuring 2 Chip Selects as GPIO in our device tree but they are appearing as inputs in /sys/kernel/debug/gpio

gpiochip1: GPIOs 32-63, parent: platform/30210000.gpio, 30210000.gpio:
gpio-48 ( |spi_imx ) in lo
gpio-51 ( |spi_imx ) in lo

If I configure the direction to output using devmem2 then the CS works as expected.   The SPI driver is making the call to set the direction to an output but it's not working.  I can't even see the direction_output function implemented in the GPIO chip driver so I'm not even sure how it sets the GPIO to an output.  We are using the NXP linux-imx 5.4.24 kernel (imx_5.4.24_2.1.0 branch).  Here's the device tree fragment:

&iomuxc {

pinctrl_ecspi2_cs: ecspi2cs {
fsl,pins = <
MX8MN_IOMUXC_SD2_DATA1_GPIO2_IO16 0x40000
MX8MN_IOMUXC_SD2_RESET_B_GPIO2_IO19 0x40000
>;
};
};

&ecspi2 {
fsl,spi-num-chipselects = <3>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>;
cs-gpios = <0>, <&gpio2 16 GPIO_ACTIVE_LOW>, <&gpio2 19 GPIO_ACTIVE_LOW>;

ra8875: ra8875@0 {
compatible = "raio,ra8875";
reg = <0>;
spi-max-frequency = <1000000>;
width = <480>;
height = <272>;
buswidth = <8>;
};
spidev1: spi@1 {
reg = <1>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <5000000>;
};
spidev2: spi@2 {
reg = <2>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <5000000>;
};
};

All the relevant drivers are configured in the kernel. 

Any help is greatly appreciated,

Martin

0 件の賞賛
返信
1 返信

508件の閲覧回数
nxf63675
NXP TechSupport
NXP TechSupport

Hi @martintownsend,

 

Check if the pad is used by other peripheral modules because a pad can be configured only once in a device.

Check what functionalities can be export the targeted pad in include/dt-bindings/pinctrl/pins-imx8mn.h.

To do this I recommend using the config tools for the i.MX processors, this is the easiest way to do it.

https://www.nxp.com/design/designs/config-tools-for-i-mx-applications-processors:CONFIG-TOOLS-IMX

 

Regards,

Israel.

 

0 件の賞賛
返信