Hi,
I'm trying to put together my own "update.img" file so that I can update
the eMMC of a firefly device based on a kernel and filesystem I've
built. I think I'm close, but it's not quite working and I'm hoping
someone might have some thoughts.
If you'd like I could write down my exact, step-by-step procedure to
obtain all these pieces. But maybe just looking through my output
someone will know what my problem is.
I'm using the following tools:
- mkbootimg and afptool from
git://
github.com/neo-technologies/rockchip-mkbootimg.git
- img_maker from git://
github.com/TeeFirefly/rk2918_tools.git
My package-file looks like:
# NAME Relative path
package-file package-file
bootloader loader.bin
parameter parameter
boot boot.img
linuxroot core-image-minimal-firefly-20150710061125.rootfs.ext4
My parameter file looks like:
FIRMWARE_VER:1.0
MACHINE_MODEL:firefly
MACHINE_ID:007
MANUFACTURER:OpenEmbedded
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3066
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
#KERNEL_IMG: 0x60408000
#FDT_NAME: rk-kernel.dtb
#RECOVER_KEY: 1,1,0,20,0
CMDLINE:console=tty0 console=ttyS2 earlyprintk
root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init
initrd=0x62000000,0x00800000
mtdparts=rk29xxnand:0x00008000@0x00002000(boot),-@0x0000A000(linuxroot)
I run:
mkbootimg --kernel zImage --ramdisk
firefly-initramfs-image-firefly.cpio -o boot.img
afptool -pack . core-image-minimal-firefly.raw.img
img_maker -rk32 loader.bin core-image-minimal-firefly.raw.img update.img
When I load this update.img into my firefly with the
Linux_Upgrade_Tool_v1.2 using "upgrade_tool uf update.img" it upgrades ok:
Loading firmware...
Support Type:RK32 FW Ver:1.0.7fd1 FW Time:2015-07-10 01:42:08
Loader ver:2.17 Loader Time:2015-01-21 17:08:29
Upgrade firmware ok.
When I boot, however, it doesn't succeed:
DDR Version 1.00 20141007
In
Channel a: DDR3 200MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Channel b: DDR3 200MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Memory OK
Memory OK
OUT
U-Boot 2014.10-RK3288-02 (Jan 21 2015 - 17:07:53)
CPU: rk3288
CPU's clock information:
arm pll = 600000000HZ
periph pll = 300000000HZ
ddr pll = 200000000HZ
codec pll = 594000000HZ
Board: Rockchip platform Board
DRAM: Found dram banks:1
Adding bank:0000000000000000(0000000080000000)
128 MiB
storage init OK!
Using default environment
GetParam
check parameter success
Unknow param: MACHINE_MODEL:firefly!
Unknow param: MACHINE_ID:007!
Unknow param: MANUFACTURER:OpenEmbedded!
Unknow param: PWR_HLD: 0,0,A,0,1!
failed to prepare fdt from boot!
failed to find part:resource
failed to prepare fdt from resource!
no adc node
can't find dts node for led
can't find dts node for ricoh619
can't find dts node for act8846
can't find dts node for rk808
can't find dts node for rk818
Can't find dts node for fuel guage cw201x
SecureBootEn = 0, SecureBootLock = 0
#Boot ver: 2015-01-21#2.17
sn:10061200020001BE
checkKey
vbus = 1
no fuel gauge found
no fuel gauge found
read logo_on switch from dts [0]
no fuel gauge found
failed to find part:misc
misc partition not found!
Hit any key to stop autoboot: 0
failed to load fdt from boot!
failed to find part:resource
failed to load fdt!
Unable to boot:boot
try to start recovery
failed to find part:recovery
'recovery' does not seem to be a partition nor an address
Unable to boot:recovery
try to start backup
failed to find part:backup
'backup' does not seem to be a partition nor an address
Unable to boot:backup
try to start rockusb
I think my failure is in the line: "Unable to boot:boot". It looks like
it's trying to find the dtb and can't find it? I do have a dtb for my
kernel, how do I go about adding it to my update.img?
When I unpack my update.img it looks fine, although I'm not certain the
unpacked sizes and locations match the data in the parameters section:
********RKImageMaker ver 1.62********
Unpacking image, please wait...
Exporting boot.bin
Exporting firmware.img
Unpacking image success.
Android Firmware Package Tool v1.62
Check file... OK
------- UNPACK ------
package-file 0x0000000000000800 0x00000000000000A9
loader.bin 0x0000000000001000 0x000000000005E94E
parameter 0x0000000000060000 0x00000000000001CC
boot.img 0x0000000000060800 0x00000000006D8000
core-image-minimal-firefly-20150710054149.rootfs.ext4
0x0000000000738800 0x0000000000800000
Unpack firmware OK!
------ OK ------
$ file core-image-minimal-firefly-20150710054149.rootfs.ext4
core-image-minimal-firefly-20150710054149.rootfs.ext4: Linux rev 1.0
ext4 filesystem data, UUID=2f432297-e27a-4aad
-bfe5-14be4d399931 (extents) (huge files)
$ file Image/boot.img
Image/boot.img: Android bootimg, kernel (0x60408000), ramdisk
(0x62000000), page size: 16384
If I use rkflashtool to extract the boot section from my device it looks
fine:
# ./rkflashtool r boot > boot.img
rkflashtool: info: rkflashtool v5.2
rkflashtool: info: Detected RK3288...
rkflashtool: info: interface claimed
rkflashtool: info: working with partition: boot
rkflashtool: info: found offset: 0x00002000
rkflashtool: info: found size: 0x00008000
rkflashtool: info: reading flash memory at offset 0x00009fe0... Done!
# file boot.img
boot.img: Android bootimg, kernel (0x60408000), ramdisk
(0x62000000), page size: 16384
Thankfully the loader mode works, so the problem isn't too bad. It would
be nice, however, if the boot code could provide a little more hint as
to why it couldn't boot from the boot section.
Thoughts?
Best regards,
Trevor