From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46A5EC433F5 for ; Tue, 22 Feb 2022 18:50:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7BAAE83B69; Tue, 22 Feb 2022 19:50:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="STmfrBnN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7493483C22; Tue, 22 Feb 2022 19:50:20 +0100 (CET) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 53DFF83C8B for ; Tue, 22 Feb 2022 19:50:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dsankouski@gmail.com Received: by mail-ed1-x52f.google.com with SMTP id m3so33194126eda.10 for ; Tue, 22 Feb 2022 10:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q8O0FZXILfMCiQdTjQi6C+0fdCoVqluJcijZ6IOz+qY=; b=STmfrBnNQrQyl2mFKO7NLTmBgqgJM+HQKHis8d9vPKo4iWk2eePmRuCnb9PDOt6YJf HUKszIHDWPBwkvr4Weyj67hYOCKmvXSbK+ngQxJ9AxItC9XL6ClEfJrTUhszH4/5iNi2 wARq1cbsVDO3hoZuGJczIjD2fiehRC9+S1ir4yYUHN36l2dtWNZeRPpIMLqtU+l8VSK+ 6MK3MGgunQUNxnBPsBFHAjObWShHqCCunstx+mhhtKxrUpkVs95g8dhQ80Sjj2kvHLP7 kFzTzHN1o7ULlwZsKkbZ7Obc4mK33h5qIrCzeevHrpPbN1qnxEdCWZO0C6AspiEieb5K xnfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q8O0FZXILfMCiQdTjQi6C+0fdCoVqluJcijZ6IOz+qY=; b=B5XtNu5vo9T8ux80nOZnLkQf4sHiQTBoEtQd3QvprqlXWSU6gTv/qbStLHqhdWhP/k HuiDNoljK6fKBz2XpClu1w/CcxN+GKGYUUwVR/ty9WQKY0Zt+IoTuEFG4n8G0lhqvwD4 9f/Rav2Ulwvd9rvRxUXveh+jtXDn1uWWosn5Ft0Lsiem6/LaxRWvV8mCktJLTuzWiYpI GtESky6KToRX+oLoCGQ60c24CZVlZpFbyhhmyEL0e1858Z9TBetECow6myrUc2eYpXGl S7i49bJDXiKeWh2+0n2U8QCebtCp0yYG/JIYX21xiLyFsayG/Qzef+fJ0xxWjlY7hCGr 0i1w== X-Gm-Message-State: AOAM532SKYQOhRsmDS5SBsA/ahnjFALfjMRixnOOwo3WbU+4SAqulXtJ G6imP3pr994WhHkH1cB4b8bcWK9rDjU= X-Google-Smtp-Source: ABdhPJx7SuJMIVq1w5X+nkC0CSZE8r3SU8+m1DGVdQIrDTTtfQV9OkdIZH6hoaiM4x5SSu/qMSjDSQ== X-Received: by 2002:a50:da4b:0:b0:40f:28f0:c2c0 with SMTP id a11-20020a50da4b000000b0040f28f0c2c0mr27607003edk.374.1645555811707; Tue, 22 Feb 2022 10:50:11 -0800 (PST) Received: from localhost.localdomain ([46.216.60.43]) by smtp.gmail.com with ESMTPSA id i1sm6568592ejy.138.2022.02.22.10.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 10:50:11 -0800 (PST) From: Dzmitry Sankouski To: u-boot@lists.denx.de Cc: Dzmitry Sankouski Subject: [PATCH 3/3 v2] board: axy17lte: get board usable - add bootcmd and docs Date: Tue, 22 Feb 2022 21:49:54 +0300 Message-Id: <20220222184954.27024-4-dsankouski@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220222184954.27024-1-dsankouski@gmail.com> References: <20220222184954.27024-1-dsankouski@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 --- Changes for v2: - increase CONFIG_LMB_MAX_REGIONS and CONFIG_SYS_BOOTM_LEN - change signed off line - add CONFIG_SAVE_PREV_BL_FDT_ADDR. It's needed to boot android - change bootcmd to source bootscript from FIT image for more flexibility configs/a3y17lte_defconfig | 12 +++++++----- configs/a5y17lte_defconfig | 13 ++++++++----- configs/a7y17lte_defconfig | 13 ++++++++----- doc/board/samsung/axy17lte.rst | 15 +++------------ include/configs/exynos78x0-common.h | 4 ++++ 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/configs/a3y17lte_defconfig b/configs/a3y17lte_defconfig index ddc1801a59..e120263ec6 100644 --- a/configs/a3y17lte_defconfig +++ b/configs/a3y17lte_defconfig @@ -1,13 +1,13 @@ CONFIG_ARM=y -CONFIG_SYS_CONFIG_NAME="exynos78x0-common" -CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_ARCH_EXYNOS=y -CONFIG_SYS_TEXT_BASE=0x40001000 CONFIG_ARCH_EXYNOS7=y CONFIG_TARGET_A3Y17LTE=y +CONFIG_SYS_CONFIG_NAME="exynos78x0-common" +CONFIG_SYS_TEXT_BASE=0x40001000 +CONFIG_SYS_LOAD_ADDR=0x40001000 +CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_NR_DRAM_BANKS=8 CONFIG_DEFAULT_DEVICE_TREE="exynos78x0-axy17lte" -CONFIG_SYS_LOAD_ADDR=0x40001000 CONFIG_FIT=y CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="echo Read pressed buttons status;KEY_VOLUMEUP=gpa20;KEY_HOME=gpa17;KEY_VOLUMEDOWN=gpa21;KEY_POWER=gpa00;PRESSED=0;RELEASED=1;if gpio input $KEY_VOLUMEUP; then setenv VOLUME_UP $PRESSED; else setenv VOLUME_UP $RELEASED; fi;if gpio input $KEY_VOLUMEDOWN; then setenv VOLUME_DOWN $PRESSED; else setenv VOLUME_DOWN $RELEASED; fi;if gpio input $KEY_HOME; then setenv HOME $PRESSED; else setenv HOME $RELEASED; fi;if gpio input $KEY_POWER; then setenv POWER $PRESSED; else setenv POWER $RELEASED; fi;" @@ -16,4 +16,6 @@ CONFIG_HUSH_PARSER=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_DM_I2C_GPIO=y -CONFIG_PINCTRL_EXYNOS78x0=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_LMB_MAX_REGIONS=64 diff --git a/configs/a5y17lte_defconfig b/configs/a5y17lte_defconfig index 2534ab0573..95fee179fd 100644 --- a/configs/a5y17lte_defconfig +++ b/configs/a5y17lte_defconfig @@ -1,18 +1,21 @@ CONFIG_ARM=y -CONFIG_SYS_CONFIG_NAME="exynos78x0-common" -CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_ARCH_EXYNOS=y -CONFIG_SYS_TEXT_BASE=0x40001000 CONFIG_ARCH_EXYNOS7=y CONFIG_TARGET_A5Y17LTE=y +CONFIG_SYS_CONFIG_NAME="exynos78x0-common" +CONFIG_SYS_TEXT_BASE=0x40001000 +CONFIG_SYS_LOAD_ADDR=0x40001000 +CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_NR_DRAM_BANKS=12 CONFIG_DEFAULT_DEVICE_TREE="exynos78x0-axy17lte" -CONFIG_SYS_LOAD_ADDR=0x40001000 +CONFIG_HUSH_PARSER=y CONFIG_FIT=y CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="echo Read pressed buttons status;KEY_VOLUMEUP=gpa20;KEY_HOME=gpa17;KEY_VOLUMEDOWN=gpa21;KEY_POWER=gpa00;PRESSED=0;RELEASED=1;if gpio input $KEY_VOLUMEUP; then setenv VOLUME_UP $PRESSED; else setenv VOLUME_UP $RELEASED; fi;if gpio input $KEY_VOLUMEDOWN; then setenv VOLUME_DOWN $PRESSED; else setenv VOLUME_DOWN $RELEASED; fi;if gpio input $KEY_HOME; then setenv HOME $PRESSED; else setenv HOME $RELEASED; fi;if gpio input $KEY_POWER; then setenv POWER $PRESSED; else setenv POWER $RELEASED; fi;" # CONFIG_DISPLAY_CPUINFO is not set -CONFIG_HUSH_PARSER=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_DM_I2C_GPIO=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_LMB_MAX_REGIONS=64 diff --git a/configs/a7y17lte_defconfig b/configs/a7y17lte_defconfig index a2d76377ab..5564ab51a2 100644 --- a/configs/a7y17lte_defconfig +++ b/configs/a7y17lte_defconfig @@ -1,18 +1,21 @@ CONFIG_ARM=y -CONFIG_SYS_CONFIG_NAME="exynos78x0-common" -CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_ARCH_EXYNOS=y -CONFIG_SYS_TEXT_BASE=0x40001000 CONFIG_ARCH_EXYNOS7=y CONFIG_TARGET_A7Y17LTE=y +CONFIG_SYS_CONFIG_NAME="exynos78x0-common" +CONFIG_SYS_TEXT_BASE=0x40001000 +CONFIG_SYS_LOAD_ADDR=0x40001000 +CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_NR_DRAM_BANKS=12 CONFIG_DEFAULT_DEVICE_TREE="exynos78x0-axy17lte" -CONFIG_SYS_LOAD_ADDR=0x40001000 +CONFIG_HUSH_PARSER=y CONFIG_FIT=y CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="echo Read pressed buttons status;KEY_VOLUMEUP=gpa20;KEY_HOME=gpa17;KEY_VOLUMEDOWN=gpa21;KEY_POWER=gpa00;PRESSED=0;RELEASED=1;if gpio input $KEY_VOLUMEUP; then setenv VOLUME_UP $PRESSED; else setenv VOLUME_UP $RELEASED; fi;if gpio input $KEY_VOLUMEDOWN; then setenv VOLUME_DOWN $PRESSED; else setenv VOLUME_DOWN $RELEASED; fi;if gpio input $KEY_HOME; then setenv HOME $PRESSED; else setenv HOME $RELEASED; fi;if gpio input $KEY_POWER; then setenv POWER $PRESSED; else setenv POWER $RELEASED; fi;" # CONFIG_DISPLAY_CPUINFO is not set -CONFIG_HUSH_PARSER=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_DM_I2C_GPIO=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_LMB_MAX_REGIONS=64 diff --git a/doc/board/samsung/axy17lte.rst b/doc/board/samsung/axy17lte.rst index e84fefec70..b7f299d1c7 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. diff --git a/include/configs/exynos78x0-common.h b/include/configs/exynos78x0-common.h index 8d3449f028..46efb16b65 100644 --- a/include/configs/exynos78x0-common.h +++ b/include/configs/exynos78x0-common.h @@ -40,6 +40,7 @@ #define CONFIG_SYS_SDRAM_BASE 0x40000000 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE + SZ_2M - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_BOOTM_LEN SZ_32M /* DRAM Memory Banks */ #define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */ #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE @@ -85,6 +86,9 @@ #endif #define EXTRA_ENV_SETTINGS \ + /* Cannot use bootdelay > 0, because timer is not working */ + "bootdelay=0\0" \ + "bootcmd=source $prevbl_initrd_start_addr:bootscript\0" \ EXYNOS_DEVICE_SETTINGS \ EXYNOS_FDTFILE_SETTING \ MEM_LAYOUT_ENV_SETTINGS -- 2.20.1