PN544 driver for imx8mm

cancel
Showing results for 
Search instead for 
Did you mean: 

PN544 driver for imx8mm

769 Views
PramodKumar
Contributor IV

I am adding the PN544 driver in dts file but the IRQ handler is getting failed and I want to know that which pin we should add in enable-gpio and in firmware-gpio .

below are the dts file changes done by me :

       

/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */        
        pinctrl_i2c4: i2c4grp {
            fsl,pins = <
                MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL            0x400001c3
                MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA            0x400001c3
            >;
        };
/* +++++++++++++++++++++


     /* ADD THE DRIVER ENABLE FUNCTION FOR PN7150  WITH I2C4 */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
&i2c4{
        clock-frequency = <400000>;  
        pinctrl-names = "default";  
        pinctrl-0 = <&pinctrl_i2c4>;
        status = "okay";
    
    pn544:pn544@28{
        compatible = "nxp,pn544,","nxp,pn544-i2c","nxp,pn544_hci_i2c","fsl,imx8mm-i2c", "fsl,imx21-i2c";
        reg = <0x28>;
        gpio-controller;
/*        clock-frequency = <400000>;
        gpio_intr = <&gpio3 24 GPIO_ACTIVE_LOW>; */
        
        
        interrupt-parent = <&gpio3>;
        interrupts = <24 GPIO_ACTIVE_HIGH>;
        enable-gpios    = <&gpio5 20 GPIO_ACTIVE_HIGH>;
        firmware-gpios        = <&gpio5 22 GPIO_ACTIVE_HIGH>;
        };
};

0 Kudos
3 Replies

625 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi PRAMOD,

See below, please!

------------------

1. IOMUX on hardware
GPIO3_IO24---->SAI5_RXD3 (CPU pin)
GPIO5_IO20---->I2C4_SCL (CPU pin)
GPIO5_IO22---->UART1_RXD (CPU pin)

2. IOMUX in device tree
[Comment]
For the reason you are using I2C4 port, so you can't use GPIO5_IO20, which can only be routed to I2C4_SCL pin, which can cause I2C4 not to work normally. see linux_top/include/dt-bindings/pinctrl/pins-imx8mm.h. 
in fsl-imx8mm-evk.dts

iomux {
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_hog>;
         imx8mm-evk {
            pinctrl_hog: hoggrp {
            fsl,pins = <
                MX8MM_IOMUXC_I2C4_SCL_GPIO5_IO20        0x19
                MX8MM_IOMUXC_UART1_RXD_GPIO5_IO22        0x19
            >;
        };
......
pinctrl_i2c4_pn544_io: pn544_iogrp {
            fsl,pins = <
                MX8MM_IOMUXC_SAI5_RXD3_GPIO3_IO24        0x19    /* NFC reader int */
            >;
        };
......
}

&i2c4{
        clock-frequency = <400000>;  
        pinctrl-names = "default";  
        pinctrl-0 = <&pinctrl_i2c4>;
        status = "okay";
    
    pn544:pn544@28{
        compatible = "nxp,pn544,","nxp,pn544-i2c","nxp,pn544_hci_i2c","fsl,imx8mm-i2c", "fsl,imx21-i2c";
        reg = <0x28>;
        gpio-controller;
/*        clock-frequency = <400000>;
        gpio_intr = <&gpio3 24 GPIO_ACTIVE_LOW>; */
        
        pinctrl-0 = <&pinctrl_i2c4_pn544_io>;
        interrupt-parent = <&gpio3>;
        interrupts = <24 GPIO_ACTIVE_HIGH>;
        enable-gpios    = <&gpio5 20 GPIO_ACTIVE_HIGH>;  /* GPIO5_IO20's mulplexing conflicts with that of I2C4_SCL. */
        firmware-gpios        = <&gpio5 22 GPIO_ACTIVE_HIGH>;
        };
};

Hope above information is helpful for you!

Have a nice day!

B.R,

Weidong

0 Kudos

625 Views
PramodKumar
Contributor IV

Hii ,

I am getting the below error in kernel logs :

[ 1.282152] pn544_hci_i2c 3-0028: NFC:
[ 1.282152]
[ 1.282152]
[ 1.282152]
[ 1.282152] Unable to get +++++++++++++ FW GPIO
[ 1.282152]
[ 1.282152]
[ 1.282152]
[ 1.299429] pn544_hci_i2c: probe of 3-0028 failed with error -2

What is this for ? Kindly suggest for the same ,.

B.R

Pramod

0 Kudos

625 Views
PramodKumar
Contributor IV

How to select the firmware GPIO pins , I am not aware with this pin .

0 Kudos