SPI uboot install

As part of troubleshooting, I need to switch from ayufans mainline uboot to the one included with manjaro. Pacman can fetch the current uboot but it assumes I want to flash to an SD card or emmc. How do I put that into SPI?

You better check this, idbloader offset 0, uboot.itb at 6M
I think it has to be itb (mtd-tools?)
But, shouldn’t you test it first?
The emmc “gets the baton” first (with blank SPI),
save emmc mbr, save 1st-16M, zero 1st-16M, write chosen uboot(&friends), restore mbr (no boot until mbr restored)
It’s not that hard
And if you change your mind, just write saved 16 back
Right now, my emmc uboot is blanked, I get whatever is on SD
But I know what to do for hard locks, so only a little risky

Can I get a walkthrough of this? I don’t understand all thats going on.

If you need help, probably it is not something that you should do
mtd-tools(sorry, mtd-utils) have a bunch of utility programs to do with mtd devices, this is what SPI is
But, since uboot for pbp is still evolving, better to write to emmc,
easier to recover from any errors
That, I can advise about
I’ll explain a bit
If the uboot is not correct or badly written, it will not boot
So, it will have to be erased or made right
The back has to come off, you have to hope like hell
that the buttons to short spi clock and reset are working,
they don’t always, then you have to manually short spi clock
There are some ‘tricks’, it is not a trivial procedure, not that hard
if you know what you are doing, this is not all that common
OR, you can remove ALL media and use rkdeveloptool
Better to wait a bit
For TV boxes this often had to be done when wrong image was
flashed to soldered on emmc, shorting emmc clock
This is a bit easier, larger pads (&fewer)

@wdt - I’ve run this on Mrfixit’s Debian (after backing up mbr partition table):

dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=1M count=16

Then put the mbr back. And got Manjaro to run from eMMc for the first time since the 19.12 image!

But I went on to try that with the Archiso and though the light is green and the mini SD card still boots, the image doesn’t.

Any idea why?
Thank you for that

Your post is not so clear, I’m guessing SD uboot(mrfixit)->emmc ??
And mrfixit on SD stiil boots OK, but not an arch image ??
Do other images (on SD) boot OK?
You could save the emmc 1st-16(mrfixit) and try manjaro’s bsp uboot
If you were to change your mind, this would have right mbr partition table
Do give good self-documenting names, so a month later …
And, one last thought, iso is for optical disks, seldom used on ARM
So, is this an arm distro, or could it be x86?

I am sorry, you’re totally right, I was very unclear.

I have a Pinebook Pro, and I wasn’t able to install Manjaro to the eMMc with the 2020 versions (the last I could install to the eMMc was the 19.12 version). Every time I installed I had an orange/red light and no screen. Bricked uboot, I would say.

So first I want to thank you for your suggestion of backing up mbr, dd-ing the first 16M from Mrfixit’s image to the eMMc containing the Manjaro image, and putting mbr back. That worked for me!

However, if it works for the Manjaro image, I can’t use it for the Archiso-pbp (GitHub - nadiaholmquist/archiso-pbp: archiso customized for the Pinebook Pro) - iso is the name given to it, I don’t know why.

It does install uboot because I have a green light. What happens next that it won’t boot is a mistery to me, but the bootloader seems to be working, just the system won’t start.

OK, a couple more questions, where are you installing arch to?
If you put it on SD, with mrfixit (uboot)/manjaro on emmc, does it boot?
Nearly always, when booted, caps/numlk toogle leds, otherwise maybe not booted
Sometimes a vt (virtual terminal) works, hold ctrl-alt, any F key, F2->F6
You could check partition layout is “right” fdisk on image or install,part start 32768 or>
Manjaro has a bsp u-boot, could try saving mrfixit, write that
(uboot-pinebookpro-bsp)(for this you have to do seek=64 and bs=1M seek=8)
Do realize that with mainline uboot, s3, s2ram sleep won’t work
And, of course, double check that extlinux.conf/fstab is right (easy to make UUID typo)

I tried installing Arch in different SDs and I tried the eMMc. I couln’t make it work.

I can run Debian and Manjaro, both on SD and on the eMMc. The uboot-pinebookpro-esp is also a solution for me to run Manjaro on the eMMc.

I tried ctl+alt+Fkey several times, but that didn’t work.

To avoid typos on the /boot/extlinux/extlinux.conf file, I copy it from the /etc/fstab and then edit. leaving the UUID unchanged.

I’m now going to try to convert a Manjaro install to an Arch install.

Anyway, thanks for your suggestions!

TL:DR sounds like bad dtb to me
If it wouldn’t boot on SD, using emmc uboot, and an install on emmc, using its own uboot
Then something is really screwed up
After uboot finds extlinux (or boot.scr) it uses the dtb referenced there,
since it is SPECIFIC for that hardware
Before that, it used an internal generic (and limited) dtb for that cpu family
And then, slightly later, the kernel does the same, for same reason
Just a guess, you could experiment, trying different distros dtb
That is, rename original to bak, copy a different pbp dtb
I had a TV box, dtb changes A->T, ie 20 or so, someone else got it right
(non-standard regulator drive, power loss to SD slot)

1 Like

You absolutely got it!!!

I replaced the dtb (from a Manjaro image) to the install and it finally worked!

This has got to do with something specific to my pinebook pro or to the eMMc, you think?

Because I’m using the img built specifically for the pinebookpro.

Many thanks!

Well, the dtb sets parameters for EVERYTHING
memory speed and timing, addresses, regulators and on
So, only one thing has to wrong (if it’s the “right” wrong thing), and no boot
You could try to “find out”, use dtc to decompile both, compare good with bad
dtc is NOT a complicated compiler, not that hard to use
What is hard is to get the dts mostly right (dts is source or de-compiled dtb)
Dealing with a de-compiled dts is a bit hard, the symbolic names have been replaced by 4byte pointers

1 Like