imx7 Sim Card Device Tree

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

imx7 Sim Card Device Tree

Jump to solution
1,005 Views
eoin_oconnell
Contributor I

Hi all,

 

I have a SIM card that is connected to my imx7D processor on the following pins (through a level shifter IC):

 

pinctrl_sim1: sim-grp {
fsl,pins = <
MX7D_PAD_EPDC_DATA00__SIM1_PORT2_TRXD 0x00   /* SODIMM 111*/ 
MX7D_PAD_EPDC_DATA01__SIM1_PORT2_CLK 0x00 /* SODIMM 113*/
MX7D_PAD_EPDC_DATA02__SIM1_PORT2_RST_B 0x00 /* SODIMM 115*/
MX7D_PAD_EPDC_DATA03__SIM1_PORT2_SVEN 0x00 /* SODIMM 117*/
MX7D_PAD_EPDC_DATA04__SIM1_PORT2_PD 0x50 /* SODIMM 119 47k pull up*/ 
>;
};

I have the card detect pin from my sim connector connected to MX7D_PAD_EPDC_DATA04__SIM1_PORT2_PD, when the card is present it pulls this pin down to ground.

To define the SIM in the device tree I tried this:

&sim1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sim1>;
	clocks = <&clks IMX7D_SIM1_ROOT_CLK>;
	assigned-clock-rates = <240000000>;
	pinctrl-assert-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
	port = <2>;
	sven_high_active;
	status = "okay";
};

Unfortunately the sim peripheral does not show up in /dev/mxc_sim, however I do measure sensible voltages on the SIM pins and my card detect hardware is working.

 

I also added this extra define into my Kernel build, CONFIG_MXC_SIMv2 = y.

 

Does anybody know what I might have done wrong?

0 Kudos
1 Solution
995 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos
2 Replies
989 Views
eoin_oconnell
Contributor I

I found the issue, the port in the device tree needs to be defined as the port number -1. So for me SIM1 PORT2 needed to be defined as Port 1

0 Kudos
996 Views
igorpadykov
NXP Employee
NXP Employee

Hi eoin_oconnell

 

sim dts example can be found on

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/boot/dts/imx7d-sdb.dts?h=imx_5.4....

One can test it on i.MX7D Sabre SD board with Demo Image i.MX 7Dual SABRESD

simple unit test

https://source.codeaurora.org/external/imx/imx-test/tree/test/mxc_sim_test?h=imx_5.4.47_2.2.0

 

Best regards
igor

0 Kudos