Skip to content

Linaro's ADFU (Actions Device Firmware Update) tool for Bubblegum96

Notifications You must be signed in to change notification settings

ofree/linaro-adfu-tool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linaro ADFU Tools for flashing Bubblegum-96

==============================================

Dependencies

  1. libusb
  2. libconfig

Build

  1. cmake .
  2. make

Things you should have before running this tool

  1. You should have a u-boot image "u-boot-dtb.img" from http://builds.96boards.org/snapshots/bubblegum/linaro/u-boot/latest/
  2. You should have a boot img "boot.emmc.img" from http://builds.96boards.org/snapshots/bubblegum/linaro/debian/latest/
  3. You should have a Debian rootfs "bubblegum-jessie_*.emmc.img" from http://builds.96boards.org/snapshots/bubblegum/linaro/debian/latest/

How to de-brick Bubblegum-96

  1. Setup udev rules on the Host machine, then you don't need root permission to run linaro-adfu-tool.

    echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"10d6\", MODE=\"0666\"" | sudo tee /etc/udev/rules.d/51-adfu.rules
    
  2. Connect the serial console. Baud rate is 115200,8n1.

  3. Connect USB cable.

  4. Don’t connect the power yet. Push the ADFU button and then connect the power. Wait for 5 secs. Release the button. Use "lsusb", you should find a device 10d6:10d6

  5. "sudo ./src/linaro-adfu-tool"

  6. When seeing u-boot starts running on serial console, press enter to break it and entering the u-boot shell.

  7. Use the following command to re-construct the gpt table:

    setenv partitions "name=BOOTLOADER,size=8MiB;name=BOOT,size=50MiB;name=SYSTEM,size=6500MiB;name=SWAP,size=768MiB;name=BOOT_MSG,size=-;"
    gpt write mmc 1 ${partitions}
    
  8. Run “fastboot usb” in serial console to entering the fastboot mode.

  9. Run “fastboot flash BOOT boot.emmc.img” on host computer.

  10. Run “fastboot flash SYSTEM bubblegum-jessie_*.emmc.img” on host computer.

  11. Redo the step 3 to 5.

  12. Run “setenv bootpart 2; boot”

  13. You should be able to login into Debian.

  14. "sudo dd if=bootloader.bin of=/dev/mmcblk0 seek=4097 bs=512" bootloader.bin can be found in the de-brick tool.

  15. "sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=6144 bs=512"

  16. Reboot.

De-brick done.

TODO

This section contains some TODO or ideas for debrick.

Flashing back to Actions' firmware

If you want to flash back Actions' firmware instead of Linaro's image. You can first use tools/extract_actions_fw.py to de-compose Actions' firmware to fastboot images.

Actions' Android image.

We should alter the gpt tables by:

  1. setenv partitions "name=MISC,size=48MiB,start=8MiB;name=RECOVERY,size=48MiB;name=SYSTEM,size=1560MiB;name=BOOT_MSG,size=1MiB;name=DATA,size=2048MiB;name=CACHE,size=512MiB;name=DATA_BAK,size=1MiB;name=VENDOR_APP,size=1MiB;name=MNT_MEDIA,size=1MiB;name=SWAP,size=1MiB;name=UDISK,size=-;"
  2. gpt write mmc 1 ${partitions}

And then flash MISC, RECOVERY, and SYSTEM partitions by fastboot.

Actions' Debian image.

We should alter the gpt tables by:

  1. setenv partitions "name=MISC,size=50MiB,start=8MiB;name=SYSTEM,size=6500MiB;name=SWAP,size=768MiB;name=BOOT_MSG,size=-;"
  2. gpt write mmc 1 ${partitions}

And then flash MISC and SYSTEM partitions by fastboot.

Directly write u-boot from u-boot.

We can use XMODEM to transfer u-boot-dtb.img to memory. But currently u-boot crashed on mmc commands. Thus doesn't work.

  1. "loadx 0x10000000"
  2. Send bootloader.bin through XMODEM protocol.
  3. "mmc dev 1; mmc write 0x10000000 4097 2048"
  4. "loadx 0x10000000"
  5. Send u-boot-dtb.img through XMODEM protocol.
  6. "mmc dev 1; mmc write 0x10000000 6144 2048"

Create bootloader.img and use fastboot flash bootloader.bin and u-boot.

We might be able to flash the bootloader by fastboot. But "BOOTLOADER" partition needs to be created first.

The following commands runs on PC:

  1. "dd if=/dev/zero of=bootloader.img bs=1M count=6" Creates a 6MiB empty image.
  2. "dd conv=notrunc if=bootloader.bin of=bootloader.img seek=4063 bs=512" Place bootloader.bin to correct place.
  3. "dd conv=notrunc if=u-boot-dtb.img of=bootloader.img seek=6110 bs=512" Place u-boot-dtb.img to correct place.
  4. "fastboot flash BOOTLOADER bootloader.img" Use fastboot to flash BOOTLOADER partition.

Maybe we can use CI to generate such image automatically?

About

Linaro's ADFU (Actions Device Firmware Update) tool for Bubblegum96

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.2%
  • CMake 4.8%