Expansion port connector with Linux ?

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

Expansion port connector with Linux ?

Jump to solution
1,883 Views
aidameriem
Contributor II

Hello everyone,

I need to control the 112 pin of the J63 connector, which correspond to the SSP2_SCK. I'm using Linux on my iMX28 (Linux version 4.0.4-fslc+g48548f7).

I know that I just have to find the GPIO_A_B number of my pin and then apply : pin = 32xA + B

But that's the thing, on the hardware schematic datasheet, all pins are adressed that way except the expansion connector ones.

How do I find the pin number of my GPIO ? So I can just run :

echo 1 > /sys/class/gpio/gpioXX/value

To be more specific, I'm using yocto.

Merci!

Labels (3)
0 Kudos
Reply
1 Solution
1,674 Views
aidameriem
Contributor II

I found it !

I just had to modify the device tree this way : (by adding my pins to the Hog)

                       ssp2: ssp@80014000 {

                                compatible = "fsl,imx28-mmc";

                                bus-width = <8>;

                        };

                        pinctrl@80018000 {

                                pinctrl-names = "default";

                                pinctrl-0 = <&hog_pins_a>;

                                hog_pins_a: hog@0 {

                                        reg = <0>;

                                        fsl,pinmux-ids = <

                                                MX28_PAD_SSP2_SCK__GPIO_2_16  /* MY PIN */

                                                MX28_PAD_SSP1_CMD__GPIO_2_13

                                                MX28_PAD_SSP1_DATA3__GPIO_2_15

                                                MX28_PAD_ENET0_RX_CLK__GPIO_4_13

                                                MX28_PAD_SSP1_SCK__GPIO_2_12

                                                MX28_PAD_PWM3__GPIO_3_28

                                                MX28_PAD_LCD_RESET__GPIO_3_30

                                                MX28_PAD_AUART2_RX__GPIO_3_8

                                                MX28_PAD_AUART2_TX__GPIO_3_9

                                        >;

                                        fsl,drive-strength = <MXS_DRIVE_4mA>;

                                        fsl,voltage = <MXS_VOLTAGE_HIGH>;

                                        fsl,pull-up = <MXS_PULL_DISABLE>;

                                };

Thank you !

View solution in original post

0 Kudos
Reply
7 Replies
1,674 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I am not sure if what you are looking for is the GPIO corresponding to that signal. If so, GPIO2_16 is the one used for SSP2_SCK.

/Alejandro

0 Kudos
Reply
1,674 Views
aidameriem
Contributor II

Thank you Alejandro for your response.

Well I do know (it's the 80 GPIO), actually I understood my problem, I have to change the defaults configuration of the SSP2_SCK into simple GPIO.

To do that, I need to change the device tree file imx28-evk.dts.

I'm trying this : (don't know if it's gonna work)

ssp2: ssp@80014000 {

                                compatible = "fsl,imx28-mmc";

                                pinctrl-names = "default";

                                pinctrl-0 = <&my_pins_a>;

                        };

pinctrl@80018000 {

                              pinctrl-names = "default";

                              pinctrl-0 = <&hog_pins_a>;

                             

                              my_pins_a : mypin@0 {

                                   fsl,pinmux-ids = <

                                        MX28_PAD_SSP2_SCK__GPIO_2_16

                                   >;

                                   fsl,drive-strength = <MXS_DRIVE_4mA>;

                                   fsl,voltage = <MXS_VOLTAGE_HIGH>;

                                   fsl,pull-up = <MXS_PULL_DISABLE>;

                                   };

                         

                       

But right now, my biggest problem is how to make yocto generate a new kernel everytime I change the imx28-evk.dts file...

By the way, I bought a Flash memory and I plugged it on the Nand Flash Socket, and I don't know how to put my linux on it ! I'm using a SD card and I simply use :

sudo dd if=imx28-vulog-image-imx28evk.sdcard of=/dev/sdb

So wether I'll have to install U-boot on the Flash and then use /tftpboot procedure (and I don't know how to do that...), or maybe there's I sudo dd command for the nand flash ?

Thank you

0 Kudos
Reply
1,674 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I doubt there is need to use yocto to generate the dtb again.

You can try the next from the top source directory:

make ARCH=arm dtbs

it should generate again all the dtbs with the new configuration.

/Alejandro

0 Kudos
Reply
1,674 Views
aidameriem
Contributor II

alejandrolozano:

Hi,

I doubt there is need to use yocto to generate the dtb again.

You can try the next from the top source directory:

make ARCH=arm dtbs

it should generate again all the dtbs with the new configuration.

/Alejandro

But is it gonna change the imx28-vulog-image-imx28evk.sdcard ?

0 Kudos
Reply
1,674 Views
alejandrolozan1
NXP Employee
NXP Employee

No, it won't. I will just generate the dtb, which you just have to copy to the FAT partition.

/Alejandro

0 Kudos
Reply
1,674 Views
aidameriem
Contributor II

It works ! I simply modified my imx28-evk.dts in "build/tmp/work-shared/imx28evk/kernel-source/arch/arm/boot/dts/imx28-evk.dts"

And then in the build directory I ran :

> > bitbake -c devshell virtual/kernel

> > make dtbs

I found the dtb file in "tmp/work/imx28evk-poky-linux-gnueabi/linux-fslc/4.0+gitAUTOINC+48548f793f-r0/build/arch/arm/boot/dts/imx28-evk.dtb"

After that I made a recipe to copy it in my imx28 in "/usr/bin/" and on the imx I replaced the dtb in "/run/media/mmcblk0p2" by mine. After a reboot, the gpio80 was not configured as spi2_sck anymore !

But the pin still doesn't change. When I run echo 1 > /sys/class/gpio/gpio80/value, the pin is still at 0...

I'm looking into my dts... any idea ? I replaced the "compatible = "fsl,imx28-mmc""; by "compatible = "fsl,imx28-gpio";" but still nothing...

0 Kudos
Reply
1,675 Views
aidameriem
Contributor II

I found it !

I just had to modify the device tree this way : (by adding my pins to the Hog)

                       ssp2: ssp@80014000 {

                                compatible = "fsl,imx28-mmc";

                                bus-width = <8>;

                        };

                        pinctrl@80018000 {

                                pinctrl-names = "default";

                                pinctrl-0 = <&hog_pins_a>;

                                hog_pins_a: hog@0 {

                                        reg = <0>;

                                        fsl,pinmux-ids = <

                                                MX28_PAD_SSP2_SCK__GPIO_2_16  /* MY PIN */

                                                MX28_PAD_SSP1_CMD__GPIO_2_13

                                                MX28_PAD_SSP1_DATA3__GPIO_2_15

                                                MX28_PAD_ENET0_RX_CLK__GPIO_4_13

                                                MX28_PAD_SSP1_SCK__GPIO_2_12

                                                MX28_PAD_PWM3__GPIO_3_28

                                                MX28_PAD_LCD_RESET__GPIO_3_30

                                                MX28_PAD_AUART2_RX__GPIO_3_8

                                                MX28_PAD_AUART2_TX__GPIO_3_9

                                        >;

                                        fsl,drive-strength = <MXS_DRIVE_4mA>;

                                        fsl,voltage = <MXS_VOLTAGE_HIGH>;

                                        fsl,pull-up = <MXS_PULL_DISABLE>;

                                };

Thank you !

0 Kudos
Reply