How to Retain the Extended Pin Function after Removing the IO Extended Chip?

The OKT507-C from Forlinx Embedded is a popular EVK with various interfaces. The OKT507-C's CPU does not have so many pin resources, so how does it provide various interfaces? The key point is: IO Extended Chip—TCA6424A.

It is a 24-bit I2C and System Management Bus (SMBus). Inputs and outputs (I/O) extender has interrupt outputs, reset, and configuration registers. To meet the needs of a wide range of customers and to keep as many functions as possible while reducing costs. Forlinx Embedded provides a method to retain the extended pin function after removing the IO extended chip on OKT507-C.

OKT507-C SBC

The IO ports on the extended chip are used by the WiFi, Bluetooth, MIPI camera TP2854, DVP camera, and line-out port power enable pins. We need to use other pins on the SoM that can be multiplexed for these functions to achieve the retain goal.

In this article, we will take LCD function pin multiplexing as an example, users can choose the function pin according to their actual needs. Please refer to the method as below:

01 How to choose the pin

The relative function pins are shown in the table below:

Function Pin Function IO Extended Chip Top Pin SoM Top Pin
MIPI5640 or TP2854 MIPI_RST 15 Pin (P16) PD1
MIPI_PWRDN 14 Pin (P15) PD3
DVP5640 CSI_RST 12 Pin(P13) PD5
CSI_PWRDN 11(P12) PD7
WiFi WIFI_REG_ON 5 Pin (P04) PD17
Bluetooth BT_REG_ON 1 Pin (P00) PD18
CODEC CODEC_PWREN 10 Pin(P11) PD13

02 How to turn off the original function of gpio_ext and multiplexing pins?

After modifying the device tree to turn off the LCD function, this group of pins can be used as normal GPIOs. Modify the path as follows:

vi OKT507-linux-sdk/kernel/linux4.9/arch/arm64/boot/dts/sunxi/OKT507-C Common.dtsi

1. Turn off the IO extended chip function

Turn off the extended chip node because the chip has been removed.

IO extended chip

2. Disable the pin function to be multiplexed.

Turn off the LCD function, as in this article we take LCD as an example, and users can turn off the specific functions according to actual needs.

Change lcd_used to 0.

Disable the pin function

lcd0 node add status = "disabled";

disabled

03 How to change the GPIOs used in a device node?

1. MIPI-5640 pin configuration
The path is as follows:

vi OKT507-linux-sdk/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/OKT507-C-Common.dtsi

change the GPIOs

2. TP2854 pin configuration
The path is as follows:

vi OKT507-linux-sdk/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/OKT507-C-Common-TP2854M.dtsi

OKT507-linux

We should note that the MIPI5640 and TP2854 share a MIPI interface, and both functions use the MIPI_PWRDN pin, so we can only choose one function in actual use. Therefore, we selected the same pin for both function tests in this article.

3. DVP-5640 pin configuration
The path is as follows:

vi OKT507-linux-sdk/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/OKT507-C-Common.dtsi

OKT507-C-Common

4. WiFi pin configuration
The path is as follows:

vi OKT507-linux-sdk/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/OKT507-C-Common.dtsi

WiFi pin configuration

5. Blue pin configuration
The path is as follows:

vi OKT507-linux-sdk/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/OKT507-C-Common.dtsi

Blue pin configuration

6. Audio pins
The path is as follows:

vi OKT507-linux-sdk/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/OKT507-C-Common.dtsi

Audio pins

The above is how to realize the function of retaining the extended pins after removing the IO extended chip on the Forlinx OKT507-C SBC.