How to assign pin mux option to a gpio expander

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to assign pin mux option to a gpio expander

1,030 Views
brownls
Contributor I

We have the IMX8MP on a custom board.  We have at least one gpio that we had to move to an expander that would otherwise have been a mux from the default pad name to the desired use.  For instance:

MX8MP_IOMUXC_I2C4_SCL__PCIE_CLKREQ_B would normally set the clkreq for PCIe from the pad that would have been I2C4_SCL.  If we moved this to an expander how do we tell the processor that for instance gpio_expander_2 IO 4 should be used for clkreq_b? 

That description in the expander is currently:


mPCIe-clkreq-hog {
gpio-hog;
gpios = <4 GPIO_ACTIVE_LOW>;
input;
line-name = "mPCIe-clk-request";
};

In other definitions there are variables the driver will utilize such as reset-gpio= and so on.  But this driver doesn't seem to have a variable for clkreq.  Is there a way to tell the processor this is "PCIE_CLKREQ_B"?

Thanks in advance for any assistance!

Labels (1)
0 Kudos
Reply
2 Replies

1,001 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello,

 

You can refer to this device tree example of i.mx93evk to how to configure a gpio with a gpio expander.

 

Best regards.

Salas.

0 Kudos
Reply

966 Views
brownls
Contributor I

The question I'm trying to see if there is a solution for is this:  In the link you shared the expander is the pcal6524.  There appear to be...

reg_vdd_12v: regulator-vdd-12v {
    ...
    gpio = <&pcal6524 14 GPIO_ACTIVE_HIGH>;
}

reg_usdhc3_vmmc: regulator-usdhc3 {
    ...
    gpio = <&pcal6524 20 GPIO_ACTIVE_HIGH>;
}

usdhc3_pwrseq: usdhc3_pwrseq {
    ...
    reset-gpios = <&pcal6524 12 GPIO_ACTIVE_LOW>;
}

sound-wm8962 {
    ....
    hp-det-gpio = <&pcal6524 4 GPIO_ACTIVE_HIGH>;
}

And so on for a couple more.  So as an example there IO assignments to the processor for various drivers that the drivers will go to the processor to access.  So down in the pinctrl block for the first Ethernet controller let's say...

MX93_PAD_ENET1_RD0__ENET_QOS_RGMII_RD0 0x57e

is being muxed on this board.  In a new spin of the board MX93_PAD_ENET1_RD0 ends up being used for something else and we want to use a port from the expander.  Lets say this expander IO 1 is wired to the Ethernet pin for use as ENET_QOS_RGMII_RD0.  AFAIK the Ethernet driver does not have an of function that has a matching variable for this.  How do I assign that IO to that driver?

I assume there must be some way and want to understand how to achieve it.  For the entries above where there are of functions with variables such as "reset-gpios" and "hp-det-gpio" it's pretty easy.  BTW, there a lot of IO ports that don't appear to be in use.   IE 4, 12, 14, and 20 are represented here and there are only 2 more.  What is 0, 1, 2, 3, 5, 6 etc being used for?  Did the designer really only use these sparse 6 ports?

 

 

0 Kudos
Reply