From d5c4ec4aa3aaa833cb535daa64a583a14304fc95 Mon Sep 17 00:00:00 2001 From: Dzmitry Sankouski Date: Tue, 22 Feb 2022 21:49:54 +0300 Subject: board: axy17lte: get board usable - add bootcmd and docs U-boot is intended to replace linux kernel in android boot image(ABL), and it's FIT payload to replace initramfs file. The boot process is similar to boot image with linux: - android bootloader (ABL) unpacks android boot image - ABL sets `linux,initrd-start property` in chosen node in unpacked FDT - ABL sets x0 register to FDT address, and passes control to u-boot - u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable - u-boot reads `linux,initrd-start` property, and stores it in `prevbl_initrd_start_addr` In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env variable, and boils down to `bootm $prevbl_initrd_start_addr`. If more control on boot process is desired, pack a boot script in FIT image, and put it to default configuration What done: - Rearrange defconfig option order - Add CONFIG_SAVE_PREV_BL_* options - Doc updates: - remove wrong SBOOT memory corruption note, because memory is changed during u-boot bringup process, not by SBOOT - put payload on ramdisk place in abl boot image creation step Signed-off-by: Dzmitry Sankouski --- doc/board/samsung/axy17lte.rst | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'doc/board') diff --git a/doc/board/samsung/axy17lte.rst b/doc/board/samsung/axy17lte.rst index e84fefec707..b7f299d1c7d 100644 --- a/doc/board/samsung/axy17lte.rst +++ b/doc/board/samsung/axy17lte.rst @@ -66,26 +66,17 @@ and is therefore SBOOT's payload. It may be pure u-boot (with loading u-boot's payload from flash in mind), or u-boot + u-boot's payload. -It should be kept in mind, that SBOOT binary patches it's payload after loading -in address range 0x401f8550-0x401f9280. Given SBOOT loads payload to 0x40001000, -a range of 0x1f7550-0x1f8280 (2061648-2065024) in a payload file -will be corrupted after loading to RAM. - Creating payload file """"""""""""""""""""" - Assemble FIT image for your kernel -- Create a file for u-boot payload ``touch sboot-payload`` -- Write zeroes till 0x200000 address to be sure SBOOT won't corrupt your info - ``dd if=/dev/zero of=sboot-payload bs=$((0x200000)) count=1`` -- Write u-boot to the start of the payload ``dd if= of=sboot-payload`` -- Write FIT image to payload from 0x200000 address - ``dd if= of=sboot-payload seek=1 bs=2M`` Creating android boot image """"""""""""""""""""""""""" Once payload created, it's time for android image:: - mkbootimg --base 0x40000000 --kernel_offset 0x00000000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --pagesize 2048 --second_offset 0x00f00000 --kernel -o uboot.img + uboot= + ramdisk= + mkbootimg --base 0x40000000 --kernel_offset 0x00000000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --pagesize 2048 --second_offset 0x00f00000 --kernel "$uboot" --ramdisk "$ramdisk" -o uboot.img Note, that stock Samsung bootloader ignores offsets, set in mkbootimg. -- cgit v1.2.3