Bootable SD card format

Michal Suchanek hramrach at gmail.com
Mon Dec 15 08:45:36 PST 2014


Hello,

I can download a pre-built SD card with Ubuntu and I can replace the
kernel on it just fine.

However, I don't know how to build such SD card.

>From the random articles floating around the net I found

- parameter file is found at sector 0x2000 (4MiB)

- parameter file defines user partition layout parsing kernel mtdpart
commandline argument

- user partition 'boot' specified in kernel commandline in parameter
file contains the kernel image loaded

Replacing kernel and parameters works fine.

However, the header before parameters file is problematic. Reportedly
it is RC4 encrypted and using this script should produce 'encrypted'
binaries that the rom can read:

dd if=3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin conv=sync | split -b 512 \
--filter='openssl rc4 -K 7c4e0304550509072d2c7b38170d1711' > FlashData.bin

Supposedly this header starts at sector 64. Partitioning a card,
copying sector 64 from a bootable card, copying a DDR init code at
sector 68 and copying u-boot at sector 92 I get a card that prints
what seems DDR Init code messages and does nothing more. Copying some
random bootloader binary downloaded separately to the card makes the
device boot from flash again.

So I wonder if I destroyed the header somehow and the SD card is just
skipped or if I need a special bootloader configured for reading the
kernel from SD card or if there is some parameter in that header
somewhere which tells the rom to tell the bootloader where to look for
the kernel.

Also is the layout with sector 68 and 92 fixed or does the header
contain information where FlashData and FlashBoot starts?

Thanks

Michal



More information about the Linux-rockchip mailing list