blob: 07522053349124742ebae92e9c5949a0957b7a82 [file] [log] [blame]
charkearee5dd4a2023-05-17 15:53:43 -05001#!/bin/sh
Mike Garrettc088ff22021-08-27 16:59:09 -05002
3findmtd() {
4 m=$(grep -xl "$1" /sys/class/mtd/*/name)
5 m=${m%/name}
6 m=${m##*/}
Patrick Williams8b86a412023-04-14 14:29:45 -05007 echo "$m"
Mike Garrettc088ff22021-08-27 16:59:09 -05008}
9
charkearee5dd4a2023-05-17 15:53:43 -050010set -- host-prime host-second vrom-prime vrom-second
Mike Garrettc088ff22021-08-27 16:59:09 -050011
charkearee5dd4a2023-05-17 15:53:43 -050012for f in "$@"
Mike Garrettc088ff22021-08-27 16:59:09 -050013do
Patrick Williams8b86a412023-04-14 14:29:45 -050014 image=$(findmtd "${f}")
Mike Garrettc088ff22021-08-27 16:59:09 -050015 if test -z "$image"
16 then
17 echo "Unable to find mtd partition for ${f}"
18 exit 1
19 fi
Mike Garrettc088ff22021-08-27 16:59:09 -050020done
21
22#enable vrom
23# host-prime to vrom-prime
charkearee5dd4a2023-05-17 15:53:43 -050024dd if="/dev/$(findmtd host-prime)" of="/dev/$(findmtd vrom-prime)"
Mike Garrettc088ff22021-08-27 16:59:09 -050025# host-second to vrom-second
charkearee5dd4a2023-05-17 15:53:43 -050026dd if="/dev/$(findmtd host-second)" of="/dev/$(findmtd vrom-second)"
Mike Garrettc088ff22021-08-27 16:59:09 -050027
28echo 0x1800008a > /sys/class/soc/srom/vromoff
29
Patrick Williams8b86a412023-04-14 14:29:45 -050030while true
Mike Garrettc088ff22021-08-27 16:59:09 -050031do
32 devmem 0x8000005C 8 0
33 devmem 0xd1000306 8 5
34 devmem 0xd1000318 8 0x03
35 devmem 0xd100030f 8 0x04
36 sleep 1
37done
38
charkearee5dd4a2023-05-17 15:53:43 -050039