Vijay Khemka | 45269ba | 2018-12-13 11:07:06 -0800 | [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 $2 > /sys/class/gpio/gpio$1/direction |
| 12 | } |
| 13 | |
| 14 | GPIO_BASE=$(cat /sys/class/gpio/gpio*/base) |
| 15 | |
| 16 | # FM_BMC_READY_N, GPIO S1, active low |
Vijay Khemka | 591abde | 2020-01-15 15:42:25 -0800 | [diff] [blame] | 17 | set_gpio_active_low $((${GPIO_BASE} + 144 +1)) low |
Amithash Prasad | 645ef29 | 2019-03-08 14:24:26 -0800 | [diff] [blame] | 18 | |
| 19 | # FP_PECI_MUX, active low |
| 20 | set_gpio_active_low $((${GPIO_BASE} + 212)) high |
| 21 | |
Vijay Khemka | 45269ba | 2018-12-13 11:07:06 -0800 | [diff] [blame] | 22 | exit 0; |