blob: 1b1b2e3f0ca781a828f22c83e86a2b8c60b012da [file] [log] [blame]
Vijay Khemka45269ba2018-12-13 11:07:06 -08001#!/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 $2 > /sys/class/gpio/gpio$1/direction
12}
13
14GPIO_BASE=$(cat /sys/class/gpio/gpio*/base)
15
16# FM_BMC_READY_N, GPIO S1, active low
17set_gpio_active_low $((${GPIO_BASE} + 144 +1)) high
18
19# FM_BMC_SSB_SMI_LPC_N, GPIO Q6, active low
Amithash Prasad645ef292019-03-08 14:24:26 -080020#set_gpio_active_low $((${GPIO_BASE} + 128 + 6)) high
Vijay Khemka45269ba2018-12-13 11:07:06 -080021
22# FP_PWR_BTN_PASS_R_N, GPIO E3, active low
23set_gpio_active_low $((${GPIO_BASE} + 32 + 3)) high
24
25# FP_PWR_GOOD, GPIO B6, active low
Amithash Prasad645ef292019-03-08 14:24:26 -080026set_gpio_active_low $((${GPIO_BASE} + 8 + 6)) in
27
28# SYSRST_BTN_OUT_N, GPIO E1, active low
29set_gpio_active_low $((${GPIO_BASE} + 32 + 1)) high
30
31# FP_PECI_MUX, active low
32set_gpio_active_low $((${GPIO_BASE} + 212)) high
33
34# Set PECI Mux to high to select Peci interface
35echo 1 > /sys/class/gpio/gpio$((${GPIO_BASE} + 212))/value
36
Vijay Khemka45269ba2018-12-13 11:07:06 -080037
38exit 0;