Skip to content

Allow jumping to jump_addr if it was requested in the script#1

Open
ynezz wants to merge 3 commits intotoradex:imx_usb_batch_mode_refactoredfrom
ynezz:ynezz/imx_usb_batch_mode_refactored-openwrt
Open

Allow jumping to jump_addr if it was requested in the script#1
ynezz wants to merge 3 commits intotoradex:imx_usb_batch_mode_refactoredfrom
ynezz:ynezz/imx_usb_batch_mode_refactored-openwrt

Conversation

@ynezz
Copy link

@ynezz ynezz commented Nov 26, 2018

Hi,

I'm preparing support for Apalis/Ixora for OpenWrt, and in my recovery script I'm flashing SPL, U-boot and rootfs in one go:

# openwrt-imx6-apalis-u-boot-with-spl.imx
mmc dev 0 1
mmc write 0x12100000 0x2 0x800

# openwrt-imx6-apalis-squashfs.combined.bin
run set_blkcnt
mmc dev 0 0
mmc write 0x12500000 0 ${blkcnt}

For that I'm using following imx_loader script/config:

mx6_usb_sdp_uboot
hid,1024,0x10000000,1G,0x00907000,0x31000
openwrt-imx6-apalis-recovery.scr:load 0x12000000
openwrt-imx6-apalis-u-boot-with-spl.imx:load 0x12100000
openwrt-imx6-apalis-squashfs.combined.bin:load 0x12500000,jump 0x12000000

Currently it's not possible to load image and jump to the script loaded in different address:

openwrt-imx6-apalis-squashfs.combined.bin:load 0x12500000,jump 0x12000000

It would simply load rootfs to 0x12500000 but also jump to 0x12500000 and not to the script at 0x12000000. This PR contains fix for this issue, then there's one cosmetic fixup and load_size command addition, which was helpful for me during development.

Once I'm finished with the support in OpenWrt, I would like to write recovery/flashing procedure and I would like to point to this upstream imx_loader repository and branch on GitHub as I don't want to maintain fork. Could you please consider merging those small changes? Thanks!

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Currently the jump_command.addr is hardcoded to header_addr, so it will
always jump to header_addr, even if we specify different jump address in
the script. So this patch allows jumping to jump_addr if it was
specified.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
This change would allow us to load just part of the image.

 u-boot-with-spl.bin:load 0x00907400,load_size 0x11000,jump 0x00907400

One can specify load_size in dec or hex notation.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant