blob: 85b80ff8d3922a8b8787d09ca1fb71468f4c34a1 [file] [log] [blame]
Charles Kearney25b7d782023-05-30 14:21:02 -05001#!/bin/sh
2
3devmem 0xd1000008 8 128
4devmem 0xd1000009 8 36
5devmem 0xd1000041 8 255
6devmem 0xd100004b 8 8
7# Configure UART
8# 4d is allocating UEFI SOC ROM to GXP
9# 5d is allocating UEFI VAR ROM access to GXP
10# devmem 0xd1000119 8 0x4d
11devmem 0xc00000af 8 9
12# enable UART on rl300
13systemctl start obmc-console@ttyS1.service
14devmem 0xd100011a 8 0x00
15# setup PCIe ID
16devmem 0x802f002e 16 0x03d8
17
18# Check the current power status
19
20currentstate=$(busctl get-property xyz.openbmc_project.State.Chassis0 /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis CurrentPowerState | awk '{ print $2 }')
21
22if [ "$currentstate" = "\"xyz.openbmc_project.State.Chassis.PowerState.On\"" ]
23then
24 systemctl stop phosphor-virtual-sensor.service
25 modprobe smpro-misc
26 modprobe smpro-errmon
27 modprobe smpro-hwmon
28 modprobe smpro-mfd
29 systemctl restart xyz.openbmc_project.ampere_host_error_monitor.service
30 systemctl restart xyz.openbmc_project.amperecpusensor.service
31 systemctl restart xyz.openbmc_project.EntityManager.service
32 systemctl restart phosphor-pid-control.service
33 systemctl start phosphor-virtual-sensor.service
34else
35 # We can start the ROM Version check services
36 rmmod gxp_spifi_ctrl1
37 devmem 0xd1000119 8 0x4d
38 modprobe gxp_spifi_ctrl1
39 systemctl start com.hpe.hpe-uefi-version.service
40fi
41
42while true
43do
44 sleep 1
45done