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 24335C433EF for ; Sun, 30 Jan 2022 10:40:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3D5A58129B; Sun, 30 Jan 2022 11:40:00 +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="CiDm4ATs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 167D282FA3; Sun, 30 Jan 2022 11:39:58 +0100 (CET) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 8FE0D80FD2 for ; Sun, 30 Jan 2022 11:39:55 +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-x529.google.com with SMTP id u24so20659774eds.11 for ; Sun, 30 Jan 2022 02:39:55 -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=rvEd48+602TdTfMHaynYFuxIqdnwv3pHKUFKa5/ItIo=; b=CiDm4ATs+T/WnF2fhXOD+P8jbBra3OcjVA5BYbnyKtwXBBLeBxX8q8XxJJPLFm9zVz SFMj7VVu/r6ysDpyPG8R2VU9DSWgigWPuSRtgsLO2PR0hjoLYvGr9kQzs0v+dBecTJSK Ge2jadCBDr8Tm8ka2nigM8xYFmLLKTd5to5mdJDjkYhIHFUDoExfkStcgyUTras3MQmm igksX7VziyYfkLghg94AFGwKJpvNwG8gDVT7dx+FlryRDqZZtZjcEYLLVFB6eqZdrSaO bvaxu/1EtT/2+QL2t0jc8kWvABwVG/Y3gBcq0xDibxImO8Z48lL2jNr8UY69C9DGwG92 LPaw== 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=rvEd48+602TdTfMHaynYFuxIqdnwv3pHKUFKa5/ItIo=; b=b1wvAKnb9HFtdBZ9nWtG+VouGZTs2rHS9PWa8cGNb9s6u2zwzlcGCUo+esECeqlY3R Znb5jLHxwwjeXU+COEvhRXr7jMsjeC3CZoXvuwHgNFIbQyzMB0yecwi/IB8Jo3JAOqjE h/5qGopSbIzTpnNOnUOsBDheJNS6fJyFqZi48Tz2G4q5i9la0lI3FNwAZfYJS1xizKXf kpZRf8PBWNREjCoT206KE7pVNtCtkmEifZDKRjqG3wqLNXoj/rXrmE6GBdFk4KMV1JUe gn17cAGULm79a99Xkn4RghsH1O4CXQQsDU5tyD3MMV5kweJGSnAmFWqrx82nvGcWClzX IHFA== X-Gm-Message-State: AOAM531RLF/d++F3oa4fn3khYnMxFTpJ45NJTbzl1fTfg5bohRiQPHUq SDA0dmdsyI7p1Bxg3yXdf8Se8wEIH/lx8w== X-Google-Smtp-Source: ABdhPJyb3hDfS2xDC60XxH2f6jz/JJRS2FpiWgQzRQUGAS30QBh3ILsC2cIRKGs4NyNapxMQ77y+kg== X-Received: by 2002:a05:6402:22bb:: with SMTP id cx27mr15744316edb.304.1643539194994; Sun, 30 Jan 2022 02:39:54 -0800 (PST) Received: from localhost.localdomain ([46.216.45.177]) by smtp.gmail.com with ESMTPSA id c14sm15937702edy.66.2022.01.30.02.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 02:39:54 -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, 30 Jan 2022 13:40:15 +0300 Message-Id: <20220130104018.25511-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/lib/Makefile | 2 + arch/arm/lib/save_prev_bl_data.c | 93 +++++++++++++++++++++++++++++ boot/Kconfig | 79 +++++++++++++++--------- configs/a3y17lte_defconfig | 12 ++-- configs/a5y17lte_defconfig | 13 ++-- configs/a7y17lte_defconfig | 13 ++-- configs/starqltechn_defconfig | 13 ++-- doc/board/qualcomm/sdm845.rst | 47 ++++++++++++++- doc/board/samsung/axy17lte.rst | 15 +---- include/configs/exynos78x0-common.h | 4 ++ include/configs/sdm845.h | 5 ++ include/init.h | 13 ++++ 12 files changed, 250 insertions(+), 59 deletions(-) create mode 100644 arch/arm/lib/save_prev_bl_data.c -- 2.20.1