Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • U uboot-imx
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Librem5
  • uboot-imx
  • Merge requests
  • !4

Load the M4 code from the same eMMC partition the SPL booted from

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Hugo Grostabussiat requested to merge Bonstra/uboot-imx:load-m4-from-hardware-boot-partition into devkit-wip Jan 16, 2019
  • Overview 12
  • Commits 2
  • Pipelines 0
  • Changes 1

This merge request enables the U-boot SPL to load the M4 firmware from the eMMC hardware partition the SoC booted from.

It makes possible to store all the bootloader images on the eMMC boot partitions (/dev/mmcblk0boot{0,1}), which are isolated from the eMMC user area, and are write-protected (in software) by default in Linux. This makes it more difficult for users to accidentally brick their phone by messing with the partition layout or attempting to switch between Linux distros.

It also paves the way for being able to move away from MBR and use GPT instead: librem5-devkit-tools#7

If the SPL was booted from boot1, the M4 binary will be loaded from boot1; if it was booted from the user area, m4.bin will be loaded from the user area. I tested both configurations and they were all booting correctly, so it should not break anything.

If you want to test this patch by yourself, you can use this UUU script:

FB: ucmd setenv fastboot_buffer 0x43000000
FB: download -f flash.bin
FB: ucmd mmc partconf 0 0 1 1
FB: ucmd mmc write 0x43000000 0x42 0x800
FB: download -f m4.bin
FB: ucmd mmc partconf 0 0 1 1
FB: ucmd mmc write 0x43000000 0x4 0x3e
FB: Done

This will set your eMMC to boot from the boot1 partition, and flash the binaries there.

To configure the eMMC to boot from the user area again:

FB: ucmd mmc partconf 0 0 7 0
FB: Done
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: load-m4-from-hardware-boot-partition