I put a working SD card into my USB card reader, then ran fdisk on it, and I see:
Command (m for help): p Disk /dev/sdf: 29.72 GiB, 31914983424 bytes, 62333952 sectors Sector size (logical/physical): 512 bytes / 512 bytes Disklabel type: dos Device Boot Start End Sectors Size Id Type /dev/sdf1 2048 657407 655360 320M b W95 FAT32So, there is a pretty big area (1M) on the card before we get to the first (and only) patition with a FAT filesystem. In that filesystem, I see these 3 files:
-rw-r--r-- 1 tom tom 53180 Jan 22 2025 BOOT.BIN -rw-r--r-- 1 tom tom 131072 Dec 31 1979 uboot.env -rw-r--r-- 1 tom tom 480605 Jan 22 2025 u-boot.imgI use "dd" to extract the first 1M (2048 sectors) of the disk. It is by no means blank. It of course contains the partition table, but there seems to be a good deal more there.
The question quickly arises as to "where did this SD card come from?". As I remember, I downloaded a bootable "rescue/update" disk for the Antminer. This disk could boot linux and then perform an upgrade to the stuff on NAND. Presumably (as I remember), I examined this image, looked at the partition table, and used dd to just copy through the first partition (since all I wanted was U-boot). I would have also had to delete the linux partitions. I am unsure exactly what I did, but that is definitely where this copy of U-boot came from.
An interesting question arises. I see the file uboot.env in the FAT partition. When the U-boot on this card does a saveenv, does it save to this file in FAT or to a fixed offset in NAND? My memory tells me that is saves to NAND in an impolite way, but I would like to perform this experiment and find out for sure.
Tom's software pages / tom@mmto.org