2: “Load u-boot from eMMC…”
BPI-R2> md 0x81dffff0
81dffff0: 434d4d65 feef7f7f f9beffff fffffffb eMMC............
3/4: “Load u-boot from SD Card…”
BPI-R2> md 0x81dffff0
81dffff0: 434d4d65 feef7f7f f9beffff fffffffb eMMC............
so still emmc…mhm, thats wrong, seems that uboot is loaded from sd, but preloader from emmc or preloader from sdcard does not touch this memory-address (state from previous boot)
5:
BPI-R2> mw.l 0x81dffff0 0x0
BPI-R2> md 0x81dffff0
81dffff0: 00000000 feef7f7f f9beffff fffffffb ................
like your expectation
6: after reset again “Load u-boot from SD Card…”
7: oh…
BPI-R2> md 0x81dffff0
81dffff0: 434d4d65 feef7f7f f9beffff fffffffb eMMC............
emmc is set again
conclusion, it seem that if first booted from emmc the memory is always set to emmc, but uboot (and maybe preloader) are loaded from sdcard…we still not know if bootrom or preloader setting this memory-position, but it contains the first boot-information after power cycle and will be rewritten after each boot to this.
just a thought…preloader/bootrom set the string to a physical memory-address and give that to uboot, now uboot takes this memory-block and copies it to an own range (around the 0x81dffff0). so uboot does not change the original position of the string…only a copy
i.e.
(uboots) RAM starts at 0x81E00000, like this line shows:
bootloader load uboot ,the address of uboot is 81E00000
and this area does always rewritten by bootrom/preloader with contents from bootmedia and our bootinfo-string which will never changed till a power-cycle. your changes with md are only in ram and do not change the source-string
but i do not know about your last test (loading linux and make a reboot there)…or do you make a real power-reset? maybe reset there triggers bootrom again (watchdog,acpi or similar) to erase the string in emmc
is there any way in uboot to search a string in memory (to get and compare “Load u-boot from …”)?