7
FWA-2112 User Manual
C
ha
pte
r 1
Lin
ux
P
latf
orm
S
oft
w
are
G
uid
e I
ntr
od
uc
tio
n
Please note gpio numbers like 358 depends on kernel and hardware platform,
thus it could be different.
3.
Get the GPIO pins node id.
In the case, GPIO pins are 14/15/18/22, from the following info, it is 372/373/376/380.
4.
Expose the GPIO pins and set it to output mode.
5.
Control GPIO (high/low).
1.3.2
HW GPIO
There is a gpio(internal pin) on platform, it could use as general output/input. In this
section, we will demonstrate gpio functions on our platform.
The GPIO controller provide 16 channel gpio for use.
They are controlled by the IO expander located at smbus, thus the i2c bus/device for
IO expander need to be located first then control LEDs.
There are there interfaces to control LEDs through same hardware path. One is i2c
raw commands which only depends on kernel’s i2c driver, however it requests a user
space i2c tool.
The other interface is kernel’s GPIO sysfs which provide file interface in user space,
however, it have to re-compile kernel if configuring kernel to enable it. Some modern
Linux distribution enabled GPIO sysfs by default like Ubuntu, and some are not like
Fedora/CentOS. Please check CONFIG_GPIO_SYSFS and CONFIG_GPIO_ICH in
kernel config to confirm if GPIO sysfs is enabled. For more details about kernel config
and compile, please refer to https://kernelnewbies.org/KernelBuild.
# cat /sys/kernel/debug/pinctrl/INTC3000\:00/gpio-ranges
GPIO ranges handled:
0: INTC3000:00 GPIOS [358 - 389] PINS [0 - 31]
32: INTC3000:00 GPIOS [390 - 398] PINS [32 - 40]
41: INTC3000:00 GPIOS [399 - 416] PINS [41 - 58]
59: INTC3000:00 GPIOS [417 - 448] PINS [59 - 90]
91: INTC3000:00 GPIOS [449 - 469] PINS [91 - 111]
112: INTC3000:00 GPIOS [470 - 501] PINS [112 - 143]
144: INTC3000:00 GPIOS [502 - 511] PINS [144 - 153]
# echo 372 > /sys/class/gpio/export
# echo 373 > /sys/class/gpio/export
# echo 376 > /sys/class/gpio/export
# echo 380 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio372/direction
# echo out > /sys/class/gpio/gpio373/direction
# echo out > /sys/class/gpio/gpio376/direction
# echo out > /sys/class/gpio/gpio380/direction
# echo 0 > /sys/class/gpio/gpio372/value (GPIO0 low)
# echo 0 > /sys/class/gpio/gpio373/value (GPIO1 low)
# echo 0 > /sys/class/gpio/gpio376/value (GPIO2 low)
# echo 0 > /sys/class/gpio/gpio380/value (GPIO3 low)
# echo 1 > /sys/class/gpio/gpio372/value (GPIO0 high)
# echo 1 > /sys/class/gpio/gpio373/value (GPIO1 high)
# echo 1 > /sys/class/gpio/gpio376/value (GPIO2 high)
# echo 1 > /sys/class/gpio/gpio380/value (GPIO3 high)
Содержание FWA-2112
Страница 1: ...User Manual FWA 2112 Network Security Platform ...
Страница 10: ...FWA 2112 User Manual x ...
Страница 11: ...Chapter 1 1 Linux Platform Software Guide Introduction ...
Страница 37: ...Appendix A A Glossary ...