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 182C7C433EF for ; Sun, 13 Feb 2022 19:39:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 912E783BB4; Sun, 13 Feb 2022 20:39:24 +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="KwJfsBQm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20DCA83BB2; Sun, 13 Feb 2022 20:39:23 +0100 (CET) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 21F6B83BA6 for ; Sun, 13 Feb 2022 20:39:20 +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-wm1-x32a.google.com with SMTP id m126-20020a1ca384000000b0037bb8e379feso10408308wme.5 for ; Sun, 13 Feb 2022 11:39:20 -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:mime-version :content-transfer-encoding; bh=SpFZshgRYAhMTFSHstiVYNvkd67yzq1L22Yz5h54058=; b=KwJfsBQmRUUgvkD5M1ZDfA+BuHS0NK1dMspf+0yowV1GTEAkvoIPMiyV0bzWJWKNy4 Q+CVZc1bXdj7fvQn+x97JdygaGTYOY/pDgy38M5BsvLmgE/MpUu3wqKR+HhNdI5yNeAm xFQqJMJM4a1kD65/4IoAx5YVzrEeH2ubqCSziai7mSLTpxPPpaotK2e1+yfGt2VXSgQW CPTV66d6HEhzxhoOi8vGr9nukSwsD82i87VylVgOztkK9BUcmm+TDAdUnyq5wRx5BU3n iWwJl5krlPXzeXKcb+f9u/maZ98UPksZIOY5Q1ZkBfkfnegy2xMxyFvDsvOv6gNNgPbi MiPw== 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:mime-version :content-transfer-encoding; bh=SpFZshgRYAhMTFSHstiVYNvkd67yzq1L22Yz5h54058=; b=rODVFvosliudNUctNFaPk48vdMyXtaNdM/tyBQ+PAuAM7D9O68lQU6B6XOqNcx8Mjo Q+YfGsDqDA4/g+Yq7sWsCXal+dGnGJpEZ3UL4HvAP2+h0xy2CuErcr+HFHckBfzHy3RD p1va3oQCMYyTDTSNKKfTH6Y5CiyoqbVxzyjO6fPjevWyKADa3BYmyyc+7r5QnvagQXKV eozVewX+9PWWwnb6+Ja379wok7iL5n7a9BnoLjSzmtlQN1D3c5wjF3YdBkKaRSuGkdmg WfoezrV7RdARJgEyoe3flUtHHvBKIUpiEidNiIL/cgFrLLMZdUdIaSl1ocok2aW01IVH TPew== X-Gm-Message-State: AOAM530d1SJtbUhaHzzPr8A5yfxK+cRmf8b/NY6RTIWskkB2zrcH9L8r LcaKAWKWGvGampJgVhtBfEXXFYJKn4s= X-Google-Smtp-Source: ABdhPJxwzUVnLn+QwoXZFfYVOXt2j8ibGrr1LPg8Dyrfyqzxc8cRXhdanlJlmcRWOvX0lz+tPdRxSw== X-Received: by 2002:a1c:2584:: with SMTP id l126mr8283305wml.143.1644781159528; Sun, 13 Feb 2022 11:39:19 -0800 (PST) Received: from localhost.localdomain ([46.216.45.177]) by smtp.gmail.com with ESMTPSA id s26sm9746037wmh.47.2022.02.13.11.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 11:39:18 -0800 (PST) From: Dzmitry Sankouski To: u-boot@lists.denx.de Cc: Dzmitry Sankouski Subject: [PATCH 0/3] save prev bootloader data, when u-boot chainloaded Date: Sun, 13 Feb 2022 22:39:03 +0300 Message-Id: <20220213193906.28002-1-dsankouski@gmail.com> X-Mailer: git-send-email 2.20.1 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 When u-boot is used as a chain-loaded bootloader (replacing OS kernel), previous bootloader leaves data in RAM, that can be reused. For example, on recent arm linux system, when chainloading u-boot, there are initramfs and fdt in RAM prepared for OS booting. Initramfs may be modified to store u-boot's payload, thus providing the ability to use chainloaded u-boot to boot OS without any storage support. Two config options added: - SAVE_PREV_BL_INITRAMFS_START_ADDR saves initramfs start address to 'prevbl_initrd_start_addr' environment variable - SAVE_PREV_BL_FDT_ADDR saves fdt address to 'prevbl_fdt_addr' environment variable This feature will be used for axy17lte and starqltechn boards for now, and more phones in future. Dzmitry Sankouski (3): arm: init: save previous bootloader data board: starqltechn: get board usable - add bootcmd and docs board: axy17lte: get board usable - add bootcmd and docs arch/arm/dts/starqltechn-uboot.dtsi | 9 ++- arch/arm/dts/starqltechn.dts | 13 ++++- arch/arm/lib/Makefile | 5 ++ arch/arm/lib/save_prev_bl_data.c | 91 +++++++++++++++++++++++++++++ boot/Kconfig | 79 ++++++++++++++++--------- common/board_r.c | 5 ++ configs/a3y17lte_defconfig | 12 ++-- configs/a5y17lte_defconfig | 13 +++-- configs/a7y17lte_defconfig | 13 +++-- configs/starqltechn_defconfig | 18 +++++- doc/board/qualcomm/sdm845.rst | 47 ++++++++++++++- doc/board/samsung/axy17lte.rst | 15 +---- include/configs/exynos78x0-common.h | 4 ++ include/configs/sdm845.h | 8 +++ include/init.h | 13 +++++ 15 files changed, 282 insertions(+), 63 deletions(-) create mode 100644 arch/arm/lib/save_prev_bl_data.c -- 2.20.1