Other Parts Discussed in Thread: AM4372
Tool/software: Linux
Dear,
Our board is broadly based on AM437X-gp-evm and SDK is 4.02. I am using General purpose pin for my isolated input and output.
I am using some of the pins from GPIO0, GPIO1, GPIO2, GPIO4 and GPIO5
I tried with GPIO0_24 as given below from calculation (0x32+24 = 24).
root@x-gp-evm:/sys/class/gpio# echo 24 > export
root@x-gp-evm:/sys/class/gpio/gpio24# echo "out" > direction
root@x-gp-evm:/sys/class/gpio/gpio24# echo 1 > value
It works good.
But GPIO5_4 in the user space, i have calculated like (5x32)+4= 164 and entered as given below in my console.
root@x-gp-evm:/sys/class/gpio# echo 164 > export
But it says below error
" [ 44.513931] export_store: invalid GPIO 164
-sh echo: write error: Invalid argument".
If i execute, "root@x-gp-evm:/sys/class/gpio# ls ", i got below message.
export gpio16 gpiogpio0 gpiochip32 gpiochip64 unexport.
GPIO5 related dts entries as given below
&gpio5 {
pinctrl-names = "default";
pinctrl-0 = <&gpio5_pins_default>;
status = "okay";
p28 {
gpio-hog;
gpios = <28 GPIO_ACTIVE_LOW>;
output-high;
lines-name = "rs232-2-TX-Enable";
};
p29 {
gpio-hog;
gpios = <29 GPIO_ACTIVE_LOW>;
output-high;
lines-name = "rs232-1-TX-Enable";
};
};
gpio5_pins_default: gpio5_pins_default {
pinctrl-single,pins = <
0x250 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (P25) spi4_sclk.gpio5[4] */
0x254 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (R24) spi4_d0.gpio5[5] */
0x258 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (P24) spi4_d1.gpio5[6] */
0x25c ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (N25) spi4_cs0.gpio5[7] */
0x238 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (D25) gpio5_8.gpio5[8] */
0x23c ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (F24) gpio5_9.gpio5[9] */
0x244 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (F23) gpio5_11.gpio5[11] */
/*extra 3 digital input entry for adding 8 gpi */
0x24c ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (E24) gpio5_13.gpio5[13] */
0x208 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (AE18) cam0_data0.gpio5[19] */
0x20c ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (AB18) cam0_data1.gpio5[20] */
/* 4 output pin for rs485 direction control */
0x270 ( PIN_OUTPUT_PULLUP | MUX_MODE9 ) /* (D24) xdma_event_intr0.gpio5[28] */
0x274 ( PIN_OUTPUT_PULLUP | MUX_MODE9 ) /* (C24) xdma_event_intr1.gpio5[29] */
0x230 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (H22) uart3_ctsn.gpio5[0] */
0x234 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (K24) uart3_rtsn.gpio5[1] */
>;
};
How do i calculate GPIO pin(GPIO0 to GPIO5) and set in the user space?
Regards,
Winiston.P