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

Edge2 have advanced and flexible booting sequence… WIP:

Next information actual for MCU ver: 0x0002

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: spiemmcsd - 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)
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

Boot SPL from eMMC:

u-boot-spl-mmc.log
U-Boot SPL board init
U-Boot SPL 2017.09 (Oct 18 2022 - 20:45:10)
Trying to boot from MMC2
Card did not respond to voltage select!
mmc_init: -95, time 12
spl: mmc init failed with error: -95
Trying to boot from MMC1
spl: partition error
Trying fit image at 0x4000 sector

Boot SPL from eMMC boot oowow u-boot from SD:

u-boot-spl-mmc-sd-oowow.log
U-Boot SPL board init
U-Boot SPL 2017.09 (Oct 18 2022 - 20:45:10)
Trying to boot from MMC2
part_get_info_efi: *** ERROR: Invalid GPT ***
...
spl: partition error
Trying fit image at 0x4000 sector

SPI and eMMC boot loaders cleared. Boot SPL and oowow u-boot from SD

u-boot-spl-sd-oowow.log
U-Boot SPL board init
U-Boot SPL 2017.09 (Jul 25 2022 - 10:32:06)
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
Trying fit image at 0x4000 sector

Boot SPL android u-boot from eMMC:

u-boot-spl-mmc-android.log
U-Boot SPL board init
U-Boot SPL 2017.09-gc060f28d70-220414 #zyf (Apr 18 2022 - 18:13:34)
Failed to set cpub01
Failed to set cpub23
Trying to boot from MMC2
MMC: no card present
mmc_init: -123, time 0
spl: mmc init failed with error: -123
Trying to boot from MMC1
Trying fit image at 0x4000 sector

U-Boot stage

oowow spi uboot

boot_targets
kedge2# printenv boot_targets 
boot_targets=usb0 mmc1 mmc0 pxe dhcp fail

mmc uboot

default eMMC u-boot log for Ubuntu images

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