blob: 1c59aa00f6dc3c609965aa87129fd9925c988d4c [file] [log] [blame]
Charles Boyer765c66a2022-05-03 11:01:24 -05001#!/bin/bash
2
3# Provide source directive to shellcheck.
4# shellcheck source=meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-lib.sh
5source /usr/libexec/mori-fw/mori-lib.sh
6
7function set_mux_default(){
8 # set all mux route to CPU before power on host
9 # BMC_CPU_DDR_I2C_SEL
10 set_gpio_ctrl CPU_DDR_SEL 1
11 # BMC_CPU_EEPROM_I2C_SEL
12 set_gpio_ctrl CPU_EEPROM_SEL 1
13 # BMC_CPU_PMBUS_SEL
14 set_gpio_ctrl CPU_VRD_SEL 1
15
16 # CPU Host UART Mux
17 set_gpio_ctrl S0_UART0_BMC_SEL 0
18 # SCP Host UART Mux
19 set_gpio_ctrl S0_UART1_BMC_SEL 0
20
21 # LED control
22 # LED_BMC_LIVE
23 set_gpio_ctrl LED_BMC_ALIVE 1
24}
25
26set_mux_default
27set_gpio_ctrl HPM_STBY_RST_N 1
28sleep 5
29set_gpio_ctrl S0_BMC_OK 1
30
31# Create /run/openbmc for system power files
32if [[ ! -d "/run/openbmc" ]]; then
33 mkdir "/run/openbmc"
34fi
35
36echo "BMC initialization complete"