blob: 205ecaff0fc5aea06148cb28eeb739594d7ae963 [file] [log] [blame]
Patrick Venturec8eec652017-04-10 15:21:32 -07001#!/bin/bash
2
3# Set all output GPIOs as such and drive them with reasonable values.
4function 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 Venture8837cc82017-11-18 13:46:23 -080015GPIO_BASE=$(cat /sys/devices/platform/ahb/ahb:apb/1e780000.gpio/gpio/*/base)
Patrick Venturec8eec652017-04-10 15:21:32 -070016
17# FM_BMC_READY_N, GPIO Q4, active low
18set_gpio_active_low $((${GPIO_BASE} + 128 + 4)) high
19
20# FM_BMC_SSB_SMI_LPC_N, GPIO Q6, active low
21set_gpio_active_low $((${GPIO_BASE} + 128 + 6)) high
22
23# FM_BMC_SYS_THROTTLE_N, GPIO A3, active low
24set_gpio_active_low $((${GPIO_BASE} + 0 + 3)) high
25
26# FM_BMC_SSB_SCI_LPC_N, GPIO E4, active low
27set_gpio_active_low $((${GPIO_BASE} + 32 + 4)) high
28
29# FP_PWR_BTN_PASS_R_N, GPIO D3, active low
30set_gpio_active_low $((${GPIO_BASE} + 24 + 3)) high
31
32exit 0;