diff options
author | Pali Rohár <pali@kernel.org> | 2021-06-18 16:27:03 +0300 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2021-07-15 15:26:04 +0300 |
commit | cc434fccba4ccf8e3645346f3ae49e7b33733dc9 (patch) | |
tree | 31fd5198ac8c7fbed0efea9596e344811a3bc848 /board/nokia | |
parent | 149389424f6644e56909e68bb1fe2ee612dc0274 (diff) | |
download | u-boot-cc434fccba4ccf8e3645346f3ae49e7b33733dc9.tar.xz |
Nokia RX-51: Add support for booting kernel in zImage format
Enable U-Boot bootz command and update env scripts to try loading also
zImage file and to try booting via bootz command.
Update also lowlevel_init.S code for checking validity of zImage magic to
correctly relocate kernel in zImage format.
This change allows U-Boot to directly boot Linux kernel without need for
converting kernel image into U-Boot uImage format.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210618132704.32066-1-pali@kernel.org
Diffstat (limited to 'board/nokia')
-rw-r--r-- | board/nokia/rx51/lowlevel_init.S | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S index 1466d976fc..11c2cbef89 100644 --- a/board/nokia/rx51/lowlevel_init.S +++ b/board/nokia/rx51/lowlevel_init.S @@ -27,6 +27,9 @@ imagesize: /* maximal size of image */ ih_magic: /* IH_MAGIC in big endian from include/image.h */ .word 0x56190527 +z_magic: /* LINUX_ARM_ZIMAGE_MAGIC */ + .word 0x016f2818 + /* * Routine: save_boot_params (called after reset from start.S) * Description: Copy attached kernel to address KERNEL_ADDRESS @@ -75,6 +78,12 @@ copy_kernel_start: ldr r4, [r0] /* r4 - 4 bytes header of kernel */ ldr r5, ih_magic /* r5 - IH_MAGIC */ cmp r4, r5 + beq copy_kernel_loop + + /* check for valid kernel zImage */ + ldr r4, [r0, #36] /* r4 - 4 bytes header of kernel at offset 36 */ + ldr r5, z_magic /* r5 - LINUX_ARM_ZIMAGE_MAGIC */ + cmp r4, r5 bne copy_kernel_end /* skip if invalid image */ copy_kernel_loop: @@ -85,7 +94,8 @@ copy_kernel_loop: copy_kernel_end: mov r5, #0 - str r5, [r0] /* remove 4 bytes header of kernel */ + str r5, [r0] /* remove 4 bytes header of kernel uImage */ + str r5, [r0, #36] /* remove 4 bytes header of kernel zImage */ /* Fix u-boot code */ |