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 3A7EFC433F5 for ; Tue, 22 Feb 2022 18:50:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 661F583A98; Tue, 22 Feb 2022 19:50:15 +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="j4+LtlV/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B49783C37; Tue, 22 Feb 2022 19:50:13 +0100 (CET) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (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 95C5F838FD for ; Tue, 22 Feb 2022 19:50:09 +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-x531.google.com with SMTP id cm8so29578783edb.3 for ; Tue, 22 Feb 2022 10:50:09 -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=j4+LtlV/BmVD9mTd4Vt7NgVEh8XKUm+De5CVgQCgi9m22pGHw4TSTt2kSYbaZATabw BhjPFVFKKUHmgbonQC4czJEfJPxaFLn29e5m6GcIVToov5qZ+WZOl7OQ35d7NIX6vPMn fOckRqxtRQdNYLJsHa1lQfGbGyKi/qbHd7ZIuam9eO9Arw2ZE3nrwOwvGm06YHwVbh86 gpYPx0iyziKbTxrik5jRLHL4lqWW9BeNRCfx98BboT3euFFmnpTSVk/GAFMo1WEjs0xp RPvKnnr//LR3Ad6i/PWxsTaUCCnM6eVAFqvHR1Qy5U/p6yicnfRNSFCh4YIBMNSrDOdu dUqQ== 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=jgbbAkWPnfQK+92QSVFVsc3JV2+piPBkxjHQOJUkQ2nNrcj81ltG4M1e65jzEbUbET WaOPON6J/Ih2EHEdixN/ykRk/KtSnu6q8CFOGoRyOsoCdHjNwwXlZpPwkiGR0QbXLKO2 IlPjhtllps665p1qAVoDTWC/5sAnelxgdGGvHYQ84wW0muOBvl+HxA+xL5tznmGJCUux G/2gmlgUHz1VXAzlibC13nTJDjEInnBvkRS1fLS1W6bUFTOcCyyYV4oFo/Al6NdnkKQJ kdWqdBnfXrPHGiHQPXRwRvSZF3lu+JifiMnVEEdxe5h9Jmz/eHj285urGt+DwRA/3bwG LxkA== X-Gm-Message-State: AOAM532opCDE5rgPArCq6EzLiaZGqIMBUR27NxwawRlRvJIl/I5pMmg1 2wb6WK/RPCnGXpOVdNj4SeYiH1u7mn0= X-Google-Smtp-Source: ABdhPJwieh6PtcySJ8iQ2vJFipx20kuXbLJ9ZS40YxwsOa2POFRHiDlRjh2b59XmQ1Pc0zT+aCe1VA== X-Received: by 2002:a05:6402:228d:b0:410:d437:293a with SMTP id cw13-20020a056402228d00b00410d437293amr27619667edb.245.1645555809034; Tue, 22 Feb 2022 10:50:09 -0800 (PST) Received: from localhost.localdomain ([46.216.60.43]) by smtp.gmail.com with ESMTPSA id i1sm6568592ejy.138.2022.02.22.10.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 10:50:08 -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: Tue, 22 Feb 2022 21:49:51 +0300 Message-Id: <20220222184954.27024-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