blob: 08b882d6d2a038de26e03b8a31c54600e77c9bb4 [file] [log] [blame]
Mike Garrettc088ff22021-08-27 16:59:09 -05001#!/bin/sh
2
3findmtd() {
4 m=$(grep -xl "$1" /sys/class/mtd/*/name)
5 m=${m%/name}
6 m=${m##*/}
7 echo $m
8}
9
10rom_lists=(host-prime host-second vrom-prime vrom-second)
11rom_mtd_list=()
12
13for f in "${rom_lists[@]}"
14do
15 image=$(findmtd ${f})
16 if test -z "$image"
17 then
18 echo "Unable to find mtd partition for ${f}"
19 exit 1
20 fi
21 rom_mtd_list+=($image)
22done
23
24#enable vrom
25# host-prime to vrom-prime
26dd if=/dev/${rom_mtd_list[0]} of=/dev/${rom_mtd_list[2]}
27# host-second to vrom-second
28dd if=/dev/${rom_mtd_list[1]} of=/dev/${rom_mtd_list[3]}
29
30echo 0x1800008a > /sys/class/soc/srom/vromoff
31
32while [ true ]
33do
34 devmem 0x8000005C 8 0
35 devmem 0xd1000306 8 5
36 devmem 0xd1000318 8 0x03
37 devmem 0xd100030f 8 0x04
38 sleep 1
39done
40