summaryrefslogtreecommitdiff
path: root/example/ice4pi_prog
blob: 9e90f7cc603614dd34e712b7fc5d199ea55b3300 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

gpioset `gpiofind GPIO24`=1
sleep 1
gpioset `gpiofind GPIO24`=0

tr '\0' '\377' < /dev/zero | dd bs=1M count=4 of=image iflag=fullblock
dd if=${1} conv=notrunc of=image
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image
#workaround first time fails after initial programming
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image
gpioset `gpiofind GPIO24`=1
sleep 1
gpioget `gpiofind GPIO24`
gpioget `gpiofind GPIO25`