Switch PineBook Pro BSP uBoot to mainline

I am looking to switch my PBP from BSP uboot to mainline since I don’t think S3 sleep will be working any longer using BSP uboot at least in newer kernels. I think I tried to do this a few months before and it messed everything up.

Let me know if I am doing this wrong, but here are the steps I plan on trying:

  1. Make sure I have mainline uboot-pinebookpro downloaded: sudo pacman -S uboot-pinebookpro
  2. Backup then clear the first 16Mb of emmc sudo dd if=/dev/zero of=/dev/mmcblkX bs=1024 count=16 conv=notrunc
  3. Then run the dd commands to flash mainline uboot to eMMC: ‘sudo dd if=/boot/idbloader.img of=/dev/mmcblkX seek=64 conv=notrunc,fsync
    sudo if=/boot/u-boot.itb of=/dev/mmcblkX seek=16384 conv=notrunc,fsync’

If feel like I am missing a step. Something about backing up and restoring MBR. Can anyone chime in on the proper way to do this?
Thanks!

I think this should be 32mb
sudo dd if=/dev/zero of=/dev/mmcblkX bs=1024 count=32 conv=notrunc,fsync

then flash the boot files but make sure to uninstall uboot-pinebookpro-bsp

sudo dd if=/boot/idbloader.img of=/dev/mmcblkX seek=64 conv=notrunc,fsync

sudo if=/boot/u-boot.itb of=/dev/mmcblkX seek=16384 conv=notrunc,fsync

I assume you’re changing the X in the mmcblkX to the drive number of emmc, if you’re using the exact same command then you’re doing it wrong.

Can you share the output of lsblk and also what size is your emmc and the sd card you’re using.

Thanks @spikerguy for the reply.
Yes, mmcblkX in my case is mmcblk2. I have not pulled the trigger yet on switching over but will report back when I do.
As per your request:

$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 276.6M 1 loop /var/lib/anbox/rootfs
mmcblk2 179:0 0 58.2G 0 disk
├─mmcblk2p1 179:1 0 213.6M 0 part /boot
└─mmcblk2p2 179:2 0 58G 0 part /
mmcblk2boot0 179:32 0 4M 1 disk
mmcblk2boot1 179:64 0 4M 1 disk
zram0 252:0 0 5.6G 0 disk [SWAP]

As an update, I think I cleared too much of the eMMC (using count=32 in my dd command) and it cleared out my MBR as well…
I ended up just flashing the first 32mb of the Manjaro ARM ISO and resizing my root partition in the MBR.

My last issue to figure out is why bluetooth isn’t working after this switch…

I will say that I am happy to report I no longer have the issue with mainline uBoot where it would only boot 1 out of 7 tries :slight_smile:

I do appreciate the help @spikerguy. Thanks!

1 Like