View Single Post
Old 08-29-2015, 06:08 PM   #70
newman
homo viator
newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.newman ought to be getting tired of karma fortunes by now.
 
newman's Avatar
 
Posts: 78
Karma: 252594
Join Date: May 2010
Device: Kindle DXi with 3.4.2 firmware, Kobo Glo HD
Am I right that
  • 2/DX uses MTD for U-Boot (regular and backup), kernel (regular and backup), ... but
  • K3 uses just the first sectors of MMC (moviNAND) for one bootloader and one kernel
  • so 2/DX with 3.x FW has to use some smart combination of both (e.g. booting from MTD but letting official update scripts to flash the 3.x kernel to a place where it can't anything bad, i.e. beginning of MMC)?

(See the rest of the post why I think so.)

FW 3.4 [moviNAND]

Luigi-based moviNAND device partition scheme:

Code:
MOVINAND_DEVICE=/dev/mmcblk0
MOVINAND_OFFSET_PARTITION=0     #0x00000000 Partition Map
MOVINAND_OFFSET_HEADER=1024     #0x00000400 DCD Header
MOVINAND_OFFSET_U_BOOT=3072     #0x00000C00 Boot Loader                       
MOVINAND_OFFSET_KERNEL=266240   #0x00041000 Linux Kernel
MOVINAND_OFFSET_ISISWF=3674112  #0x00381000 ISIS Waveform
MOVINAND_OFFSET_ROOTFS=3936256  #0x003C1000 Root filesystem
Code:
BLOCK_SIZE=1024
KERNEL_OFFSET=266,240
KERNEL_SEEK=$(( ${KERNEL_OFFSET} / ${BLOCK_SIZE} )) = 260 blocks
$ dd if=${KERNEL_FILE} of=/dev/mmcblk0 seek=${KERNEL_SEEK} bs=${BLOCK_SIZE}
`--------------------------------------^^^^--skip KERNEL_SEEK blocks (260 blocks * 512 B = 133,120 B)
3.{3,4} uImage kernel size = 2,1 MB (64 B header)

Looking at mine mmcblk0, there's no U-Boot, just an empty place to be filled eventually (see the partition scheme)

FW 2.5.8 [MTD]
  • what I have on DXi in /dev/mtdblock{1,4} is a YifanaLu's kernel (verified by dd-ing it out by md5sum)
  • in /dev/mtblock{0,3} is U-Boot from 2.5.8 (i.e. the original one) (verified by dd-ing it out by md5sum)
/proc/mtd:
Code:
dev:    size   erasesize  name
mtd0: 00020000 00010000 "Bootloader1"
mtd1: 00380000 00010000 "Kernel1"
mtd2: 00008000 00002000 "BoardId"
mtd3: 00020000 00010000 "Bootloader2"
mtd4: 00380000 00010000 "Kernel2"
mtd5: 00010000 00010000 "BootEnv"
mtd6: 00020000 00010000 "Diags"
mtd7: 00006000 00002000 "Vectors"
mtd8: 00010000 00010000 "unused0"
MTD needs to be unlocked before erase→flash
Code:
flash_unlock /dev/mtd/0..1..3..4
From 2.5.8 FW update; how to flash U-Boot and kernel, both regular and backup ones:

size of u-boot.bin = 131,072 B
Code:
$ dd if=imx31_mario/u-boot.bin of=/dev/mtdblock/0 bs=131072
$ dd if=imx31_mario/u-boot.bin of=/dev/mtdblock/3 bs=131072
size of uImage = 1,875,952 B
Code:
$ dd if=uImage of=/dev/mtdblock/1 bs=131072
$ dd if=uImage of=/dev/mtdblock/4 bs=131072
newman is offline   Reply With Quote