Skip to content

Commit 853d7e3

Browse files
committed
mask GPIOs to monitor only valid ones in U-Boot boot selection
Signed-off-by: Michel-FK <[email protected]>
1 parent dfc375e commit 853d7e3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

FunKey/board/funkey/rootfs-overlay/etc/u-boot.env

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ args_mmc=setenv bootargs console=ttyS0,115200 panic=5 rootwait fbcon=map:10 fbco
22
baudrate=115200
33
bootcmd=run getbootpart; run check_keys; if test ${found} = 1; then setenv bootpart 1; fi; run args_mmc; run loadfdt; run loadimage; bootz ${loadaddr} - ${fdtaddr}
44
bootdelay=0
5-
check_keys=run set_pullups; setenv found 0; setenv timeout ${delay}; while test ${timeout} > 0; do run read_keys; if test ${keys} = f83f; then setenv found 1; setenv timeout 0; else setexpr timeout ${timeout} - 1; fi; done
5+
check_keys=run probe_i2c; run set_pullups; setenv found 0; setenv timeout ${delay}; while test ${timeout} > 0; do run read_keys; echo ${keys}; if test ${keys} = f83f; then setenv found 1; setenv timeout 0; else setexpr timeout ${timeout} - 1; fi; done
66
console=ttyS0,115200
77
delay=1
88
fdt_high=0xffffffff
@@ -11,8 +11,9 @@ getbootpart=part list mmc 0 -bootable bootpart
1111
loadaddr=0x41000000
1212
loadfdt=load mmc 0:${bootpart} ${fdtaddr} /boot/sun8i-v3s-funkey.dtb
1313
loadimage=load mmc 0:${bootpart} ${loadaddr} /boot/zImage
14-
read_keys=i2c read 20 0 2 1c20500; setexpr.w keys *1c20500
15-
set_pullups=i2c mw 20 46 df; i2c mw 20 47 f8
14+
probe_i2c=if i2c probe 76; then setenv i2caddr 76; else setenv i2caddr 20; fi
15+
read_keys=i2c read ${i2caddr} 0 2 1c20500; setexpr.w keys *1c20500 \\& 0xf8ff
16+
set_pullups=i2c mw ${i2caddr} 46 df; i2c mw ${i2caddr} 47 f8
1617
stderr=serial@01c28000
1718
stdin=serial@01c28000
1819
stdout=serial@01c28000

Recovery/board/funkey/rootfs-overlay/etc/u-boot.env

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ args_mmc=setenv bootargs console=ttyS0,115200 panic=5 rootwait fbcon=map:10 fbco
22
baudrate=115200
33
bootcmd=run getbootpart; run check_keys; if test ${found} = 1; then setenv bootpart 1; fi; run args_mmc; run loadfdt; run loadimage; bootz ${loadaddr} - ${fdtaddr}
44
bootdelay=0
5-
check_keys=run set_pullups; setenv found 0; setenv timeout ${delay}; while test ${timeout} > 0; do run read_keys; if test ${keys} = f83f; then setenv found 1; setenv timeout 0; else setexpr timeout ${timeout} - 1; fi; done
5+
check_keys=run probe_i2c; run set_pullups; setenv found 0; setenv timeout ${delay}; while test ${timeout} > 0; do run read_keys; echo ${keys}; if test ${keys} = f83f; then setenv found 1; setenv timeout 0; else setexpr timeout ${timeout} - 1; fi; done
66
console=ttyS0,115200
77
delay=1
88
fdt_high=0xffffffff
@@ -11,8 +11,9 @@ getbootpart=part list mmc 0 -bootable bootpart
1111
loadaddr=0x41000000
1212
loadfdt=load mmc 0:${bootpart} ${fdtaddr} /boot/sun8i-v3s-funkey.dtb
1313
loadimage=load mmc 0:${bootpart} ${loadaddr} /boot/zImage
14-
read_keys=i2c read 20 0 2 1c20500; setexpr.w keys *1c20500
15-
set_pullups=i2c mw 20 46 df; i2c mw 20 47 f8
14+
probe_i2c=if i2c probe 76; then setenv i2caddr 76; else setenv i2caddr 20; fi
15+
read_keys=i2c read ${i2caddr} 0 2 1c20500; setexpr.w keys *1c20500 \\& 0xf8ff
16+
set_pullups=i2c mw ${i2caddr} 46 df; i2c mw ${i2caddr} 47 f8
1617
stderr=serial@01c28000
1718
stdin=serial@01c28000
1819
stdout=serial@01c28000

0 commit comments

Comments
 (0)