summaryrefslogtreecommitdiff
path: root/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
blob: 08b882d6d2a038de26e03b8a31c54600e77c9bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

findmtd() {
  m=$(grep -xl "$1" /sys/class/mtd/*/name)
  m=${m%/name}
  m=${m##*/}
  echo $m
}

rom_lists=(host-prime host-second vrom-prime vrom-second)
rom_mtd_list=()

for f in "${rom_lists[@]}"
do
  image=$(findmtd ${f})
  if test -z "$image"
  then
    echo "Unable to find mtd partition for ${f}"
    exit 1
  fi
  rom_mtd_list+=($image)
done

#enable vrom
# host-prime to vrom-prime
dd if=/dev/${rom_mtd_list[0]} of=/dev/${rom_mtd_list[2]}
# host-second to vrom-second
dd if=/dev/${rom_mtd_list[1]} of=/dev/${rom_mtd_list[3]}

echo 0x1800008a > /sys/class/soc/srom/vromoff

while [ true ]
do
        devmem 0x8000005C 8 0
        devmem 0xd1000306 8 5
        devmem 0xd1000318 8 0x03
        devmem 0xd100030f 8 0x04
        sleep 1
done