Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:edge2:hardware:edge2-boot-flow

This is an old revision of the document!


Edge2 Boot flow

WIP:

Edge2 have advanced and flexible booting sequence…

Bootmode

i2cget -f -y 2 0x18 0x20

bootmode value
spi 0
mmc 1

OOWOW mode

i2cget -f -y 2 0x18 0x92

oowow_mode value
disabled 0
request 1
activated 2
passed 3
rescue 5

Reboot modes by MCU

i2cset -f -y 2 0x18 0x91 value

oowow_mode value
spi 0
mmc 1
default reboot 2

At this moment all modes works same as spi

Boot modes oowow shell usage

WIP:

Set boot mode

~# bootmode
spi
 
~# bootmode mmc
[i] /opt/bootmode spi -> mmc(sd)
 
~# bootmode
mmc
 
~# bootmode spi
[i] /opt/bootmode mmc -> spi

Set oowow mode

~# mcu_oowow_mode set 1
[i] set with 1
 
~# mcu_oowow_mode clean
[i] set with 0
 
~# mcu_oowow_mode && echo activated
0x01
activated
 
~# mcu_oowow_mode clean
[i] set with 0
 
~# mcu_oowow_mode || echo disabled
disabled
 
~# i2cset -f -y 2 0x18 0x92 1
 
~# i2cget -f -y 2 0x18 0x92
0x01

Reboot by MCU

Forced hardware reboot

~# mcu_reboot
 
~# i2cset -f -y 2 0x18 0x91 2

SPL stage

SPL boot loader priority: spimmc - hard-coded

SPL boot loader priority not same as mcu bootmode. MCU boot mode works only after SPL boot stage passed.

Boot mode mmc logs:

u-boot-spl-mmc.log
U-Boot SPL board init
U-Boot SPL 2017.09 (Sep 15 2022 - 14:38:28)
Failed to set cpub01
Failed to set cpub23
I2c2 speed: 100000Hz
MCU: bootmode: 1, oowow 3
MCU: oowow 0
board_boot_order: /chosen found, using spl_boot_device()
!!! same-as-spl: 
!!! /mmc@fe2c0000: 
!!! /mmc@fe2e0000: 
!!! /spi@fe2b0000/flash@1: 
Trying to boot from MMC2 :: 0
Card did not respond to voltage select!
mmc_init: -95, time 12
spl: mmc init failed with error: -95
Trying to boot from MMC1 :: 1
Trying fit image at 0x4000 sector

Boot mode spi logs

u-boot-spl-spi.log
U-Boot SPL board init
U-Boot SPL 2017.09 (Sep 15 2022 - 14:38:28)
MCU: bootmode: 0, oowow 3
MCU: oowow 0
board_boot_order: /chosen found, using spl_boot_device()
!!! same-as-spl: 
board_spl_was_booted_from: brom_bootdevice_id 6 maps to '/spi@fe2b0000/flash@1'
+++ /spi@fe2b0000/flash@1: 
!!! /mmc@fe2c0000: 
!!! /mmc@fe2e0000: 
!!! /spi@fe2b0000/flash@1: 
Trying to boot from MTD2 :: 0
Trying fit image at 0x300 sector

Boot OOWOW - hold FUNCTION and short press RESET then release FUNCTION

u-boot-spl-oowow-mode.log
U-Boot SPL board init
U-Boot SPL 2017.09 (Sep 15 2022 - 14:38:28)
MCU: bootmode: 0, oowow 1
MCU: oowow 2
board_boot_order: /chosen found, using spl_boot_device()
!!! same-as-spl: 
+++ /spi@fe2b0000/flash@1: 
!!! /mmc@fe2c0000: 
!!! /mmc@fe2e0000: 
!!! /spi@fe2b0000/flash@1: 
Trying to boot from MTD2 :: 0
Trying fit image at 0x300 sector

U-Boot stage

boot_targets
kedge2# printenv boot_targets 
boot_targets=usb0 mmc1 mmc0 pxe dhcp fail
Last modified: 2022/10/31 02:15 by hyphop