Closed PabloPL closed 6 years ago
Yeah, it would work just fine, presuming there's no bad blocks. If there's a bad block on the first couple of pages on the u-boot partition, then things get interesting as the SBL would try to load those blocks from the reservoir while the MTD subsystem would have simply skipped the bad blocks.
A command to load it would be something like
ext4load mmc 0 0x33000000 u-boot.bin; onenand write 0x33000000 0x1200000 0x780000;
If there's bad blocks, we have a couple of options
Edit: Personally, I'm of the opinion to just check for bad blocks, since we only use the first two blocks for u-boot anyways, the chances of there being a bad block there are very limited and if someone does run into the issue too bad, so sad (presuming we don't overwrite anything first...)
Funny, tried command which you posted and now it's not booting (good that i've unbrickable). Having this would make normal users much easier switch to mainline.
Oops, maybe I messed up the offsets/sizes... Sorry. I'll figure out the right numbers and try to get it working.
Well, looks like I'm getting the unbrickable mod whether I like it or not... While testing, I accidentally switched up the offset and size and ended up overwriting part of the SBL but not the PBL, so the PBL is stuck trying to load a corrupted SBL.
Checking sizes and offsets, I'm still finding the same values that I posted up above. Was your brick a hard brick (ie no PBL/SBL) or just no u-boot?
It looks like it's hard brick (no logs on uart) - i'm using 150k resistor. Was able to use unbrickable software to run sbl, but heimdall (1.4.2 build from github repo on ubuntu 16.04 - which version are You using?) is not able to connect to it (had the same issue when not bricked and workaround was to quickly connect cable after boot, but now after using unbrickable sofrwate - when device is connected for whole time - it's getting tricky). Will try to recover my device tomorrow (currently always getting ERROR: Protocol initialisation failed!).
I'm using Heimdall v1.4.0 built from source as I had issues with newer versions as well, packages in the stable Debian repositories had issues connecting as well.
Alright, I have unbrickable mod now.
I've created branch https://github.com/xc-racer99/u-boot-galaxys4g/tree/u-boot-update which contains a couple of commits to check if there's bad blocks on the first three pages of the u-boot partition and then write to it from the SD card
Ok, my device is working again (after reflash of all bootloaders). Tried to use "Update U-Boot from SD Card" but got information, that onenand contains error and need to use odin/heimdall to flash, so i can't test if it's working fine. And heimdall 1.4.0 is MUCH better/stable - no more connection problems.
Edit 1: It looks like uboot has something like standalone apps. Maybe we could make something like bml_over_mtd which would do all magic (and we won't have to add this code to uboot). Just an idea for later.
What does
onenand bad
show? If you are unlucky and have a bad block right at the start, it might explain why the previous command didn't work
Aries # onenand bad
Device 0 bad blocks:
1ffc0000
Hmm, looks like I've messed up on either the onenand check code or the uboot_update script. Back to the drawing board.
Implemented in 5fe3fc82af88698c06951f2af4fad7233e3bbb64
Since we're now able to update kernel (only in sdcard/mmc - onenand needs to be handled) when in uboot, using mass storage mode, it would be nice to have similar possibility for uboot (maybe enabled by another bootmenu option).