blob: cac3b20c7d0f7b6691c5e29c87fe1345f21e1cc6 [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
Patrick Williams552e93e2021-10-27 10:15:20 -050010 echo "$1" > /sys/class/gpio/export
11 echo "$2" > "/sys/class/gpio/gpio$1/direction"
Vijay Khemka45269ba2018-12-13 11:07:06 -080012}
13
14GPIO_BASE=$(cat /sys/class/gpio/gpio*/base)
15
16# FM_BMC_READY_N, GPIO S1, active low
Patrick Williams552e93e2021-10-27 10:15:20 -050017set_gpio_active_low $((GPIO_BASE + 144 +1)) low
Amithash Prasad645ef292019-03-08 14:24:26 -080018
19# FP_PECI_MUX, active low
Patrick Williams552e93e2021-10-27 10:15:20 -050020set_gpio_active_low $((GPIO_BASE + 212)) high
Amithash Prasad645ef292019-03-08 14:24:26 -080021
Vijay Khemka45269ba2018-12-13 11:07:06 -080022exit 0;