Patrick Venture | c8eec65 | 2017-04-10 15:21:32 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Set all output GPIOs as such and drive them with reasonable values. |
| 4 | function set_gpio_active_low() { |
| 5 | if [ $# -ne 2 ]; then |
| 6 | echo "set_gpio_active_low: need both GPIO# and initial level"; |
| 7 | return; |
| 8 | fi |
| 9 | |
| 10 | echo $1 > /sys/class/gpio/export |
| 11 | echo 1 > /sys/class/gpio/gpio$1/active_low |
| 12 | echo $2 > /sys/class/gpio/gpio$1/direction |
| 13 | } |
| 14 | |
Patrick Venture | 8837cc8 | 2017-11-18 13:46:23 -0800 | [diff] [blame] | 15 | GPIO_BASE=$(cat /sys/devices/platform/ahb/ahb:apb/1e780000.gpio/gpio/*/base) |
Patrick Venture | c8eec65 | 2017-04-10 15:21:32 -0700 | [diff] [blame] | 16 | |
| 17 | # FM_BMC_READY_N, GPIO Q4, active low |
| 18 | set_gpio_active_low $((${GPIO_BASE} + 128 + 4)) high |
| 19 | |
| 20 | # FM_BMC_SSB_SMI_LPC_N, GPIO Q6, active low |
| 21 | set_gpio_active_low $((${GPIO_BASE} + 128 + 6)) high |
| 22 | |
| 23 | # FM_BMC_SYS_THROTTLE_N, GPIO A3, active low |
| 24 | set_gpio_active_low $((${GPIO_BASE} + 0 + 3)) high |
| 25 | |
| 26 | # FM_BMC_SSB_SCI_LPC_N, GPIO E4, active low |
| 27 | set_gpio_active_low $((${GPIO_BASE} + 32 + 4)) high |
| 28 | |
| 29 | # FP_PWR_BTN_PASS_R_N, GPIO D3, active low |
| 30 | set_gpio_active_low $((${GPIO_BASE} + 24 + 3)) high |
| 31 | |
| 32 | exit 0; |