Updating U-Boot for Orange Pi H3
Moved discussion from this thread
Quote:
[snip] Quote:
Quote:
Quote:
Quote:
https://patchwork.ozlabs.org/patch/214468/ However, the issue seems pretty clear now. With the new SD card images, writing U-Boot to the image is overwriting the FAT partition, as I can see by mounting the SD card. Code:
root@kitt:~# mount /dev/sdd1 /mnt/floppy/ I need to spend some more time hacking on that to get it working, but it's probably almost there. |
so, in effect, the env was threading on the partition?
And the save to file didn't work yet? |
Quote:
I'm guessing that once that's fixed, saveenv will work. |
Quote:
AFAIK the partitioning data and the dd overlap only in the "master boot record" and that is a simple thing or re-dd if needed? |
Making progress!
I've made an image with a FAT partition, and the latest u-boot. It seems that if there's MMC (not SD card) even if there are no partitions, U-Boot restricts itself to looking on that device rather than the SD card. So, I have put the SD card image on to the MMC and it works fine. The next step is to figure out either why it doesn't check the SD card (it finds it using the u-boot mmc commands, and can load a file from the file system - so it all works), or to figure out how to hard code the device number of the SD card; although that's far from ideal either. I'll probably upload this stuff next week. Code:
U-Boot SPL 2019.04-rc1-dirty (Feb 16 2019 - 16:15:14 +0000) |
My MMC you mean MTD? (in the sense of board soldered on flash storage)
Only otheer option would be actual MMC card vs SD card? If so, isn't the env code responsible for preference? Or, eventually is there in the u-boot a hard coded order of preference? |
Quote:
I think I've cracked it now. It's hard coded to look at device 1 (eMMC), so I've patched it to be 0. I'm not yet sure if device 1 becomes 0 if there's no SD card though, but it'll suffice for the need I'm addressing. |
Maybe note upstream (to make it configurable)?
|
Quote:
It's sorted now! I've uploaded v2019.04-rc2 and have tested it with my Orange Pi Plus 2E. I've now got HDMI console working and am using X11. I tried adding those U-Boot configurations you'd asked for, but they needed some more work. The new SD card images have a single FAT partition - having more than 1 partition is a pain, and is likely to get broken if people faff around with the partition table anyway. The only thing I'd like to get working is to be able to dump this SD card image to the eMMC, and have the possibility to live without the SD card (you'd still need it to boot the latest U-Boot, but once you'd installed the OS you could overwrite U-Boot on the eMMC). To make it work, I had to configure U-Boot to look for its environment on 0:0 which means it doesn't work if there's no SD card. The other option is to switch it back to saving the environment on to the MMC (meaning not writing it to a FAT file system: I believe the previous version of U-Boot wrote it to the eMMC directly), which should allow us to do that. I'm not in the mood for more U-Boot work now though! |
Good work! Glad you've pushed it thru!
OTOH, ideally the u-boot would be aware what it booted from and store the environment to that media: if eMMC is present -> eMMC if booted from SD -> SD if setup booted from SD -> to eMMC if present otherwise to SD if that makes any sense? if setup booted from USB -> to eMMC, or SD card or USB in that order of preference kind of (or the like) |
Quote:
I doubt U-Boot is able to know where it was originally loaded _from_ unless the ROM code passes that info to the SPL and into U-Boot proper. |
So far only the system can discern that - and act upon the fact:scratch:
right? |
All times are GMT -5. The time now is 12:45 AM. |