TX2 GPIO Debugs (using A300/A302
2019-03-20 本文已影响37人
童年雅趣
NVIDIA GPIO
NVIDIA Resource:
Forum GPIO Description
GPIO 分类 MAIN 和 AON GPIO(TX1/NANO无AON)
Main GPIO Controller: 0x02200000
AON GPIO Controller: 0x0C2F0000
In order to access your GPIO device you need to get your GPIO number. To do this:
1. Find the processor base value:
Main Processor base value is: 320
AON Processor base value is: 256
2. From the port listing above find the index of your port.
As an example AA would be: 5
3. Get the offset from your port, which is the number after your port.
AA0 -> Offset 0
4. Use the following formula to to calculate the userland GPIO:
<AON Processor Base> + <8 * Port Index> + Offset
256 + 8 * 5 + 0 = 296
This is value you should put into /sys/class/gpio/export
1. GPIO 4Pin控制门锁(GPIO for DoorLocker)
Multifunction Port W5 for the GPIO interface:
- GPIO9 as output (with 3.3volt level) --- GPIO298.No(TX2)
- GPIO8 as input --- GPIO388.No(TX2)
- GPIO_EXP0_INT as input --- GPIO480.No(TX2)
- GPIO_EXP1_INT as input --- GPIO486.No(TX2)
2.操作方法(Operate Method:root)
$sudo -s
---Set GPIO file to operate
echo 388 > export
---Set input/output
echo 'out' > gpio388/direction
---Set low/high
echo 1 > gpio388/value
echo 0 > gpio388/value
The same to GPIO480/486/298 and so on.
3. 查看当下GPIO状态:GPIO.No、输入/出、Hi/Lo
root@tegra-ubuntu:~# cat /sys/kernel/debug/gpio
GPIOs 232-239, platform/max77620-gpio, max77620-gpio, can sleep:
gpio-232 ( |external-connection:) in hi
gpio-237 ( |spmic_gpio_input_5 ) in lo
gpio-238 ( |spmic_gpio_input_6 ) in hi
GPIOs 240-255, i2c/0-0074, tca9539, can sleep:
gpio-240 ( |vdd-usb2-5v ) out hi
gpio-241 ( |en-vdd-ts-1v8 ) out hi
gpio-242 ( |en-vdd-ts-hv-3v3 ) out hi
gpio-243 ( |en-vdd-disp-3v3 ) out lo
gpio-244 ( |vdd-fan ) out hi
gpio-247 ( |en-mdm-pwr-3v7 ) out lo
gpio-249 ( |en-vdd-disp-1v8 ) out lo
gpio-250 ( |dis-vdd-1v2 ) out hi
gpio-252 ( |vdd-hdmi ) out hi
gpio-253 ( |en-vdd-cam-hv-2v8 ) out lo
GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
gpio-272 ( |temp_alert ) in hi
gpio-298 ( |locker-gpio9 ) out hi
gpio-312 ( |Power ) in hi
gpio-313 ( |Volume Up ) in hi
gpio-314 ( |Volume Down ) in hi
gpio-315 ( |wifi-wake-ap ) in hi
gpio-316 ( |bt_host_wake ) in hi
GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
gpio-381 ( |reset_gpio ) out lo
gpio-388 ( |gpio8-input ) in hi
gpio-412 ( |vdd-usb0-5v ) out lo
gpio-413 ( |vdd-usb1-5v ) in hi
gpio-420 ( |eqos_phy_reset ) out hi
gpio-421 ( |eqos_phy_intr ) in hi
gpio-424 ( |wlan_pwr ) out lo
gpio-426 ( |cam1-pwdn ) out lo
gpio-441 ( |hdmi2.0_hpd ) in lo
gpio-444 ( |wp ) in lo
gpio-445 ( |cd ) in hi
gpio-446 ( |en-vdd-sd ) out lo
gpio-456 ( |cam0-pwdn ) out lo
gpio-457 ( |cam1-rst ) out lo
gpio-459 ( |pcie-lane2-mux ) out lo
gpio-461 ( |cam0-rst ) out lo
gpio-479 ( |external-connection:) in lo
gpio-480 ( |exp0-int ) in lo
gpio-484 ( |bt_ext_wake ) out hi
gpio-486 ( |exp1-int ) in lo