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 02229C433EF for ; Thu, 27 Jan 2022 15:33:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A12AF83108; Thu, 27 Jan 2022 16:33:17 +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="RmOtpmPX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2900F83388; Thu, 27 Jan 2022 16:33:16 +0100 (CET) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (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 7B4AC82F91 for ; Thu, 27 Jan 2022 16:33:13 +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-qk1-x72c.google.com with SMTP id j24so611356qkk.10 for ; Thu, 27 Jan 2022 07:33:13 -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=w2JSl01GgPmfvOd7pJh4mRDs31Dc1iEm3U4VB/VNll4=; b=RmOtpmPX2mx44e7ncJtC8E15h9zQ9A/E067hj+ggcHGYlpI0Hz8cwbTRrY/PjMJzE7 1C+gsH6QJ+HnCmDYjYtryD5Rgvpyuarp0aEimfIqLTy1WcBM0uMjWFbO3ONwtP3h+zsa 0TBfsRQwIYM73NJ1M7LsrWpn7savVnFYoUZga6THm4fJEBrmnLaVLNItOMJ+mIe/1UNs OqLS/+u1RYMWi4b8XC0lzYyjf3gnasv7HjFOZAOPKLglodYRmZ9QwdPRZqyaq1vuaXQC XSNMf2tm/8KqtjSvm5JEcJVr2hjBY0SBWE5Xb8vTHdqck2H+muDSUziL391JYQuthFvr nhlA== 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=w2JSl01GgPmfvOd7pJh4mRDs31Dc1iEm3U4VB/VNll4=; b=KvGVrRG7bOE5kjKy5eC/nAIibh1ZN3IsQ9rAdP1aD0fu+4DCO+eAQsKC+Vekr1v/yl 2c3Wy0ztvM6Sf59b+4fcb9pVpjZKMACpvQZH9OwHjGU1B10qDIgsBky78iA2NfmQ0lwe FMjhXSlSoRSxh1T+rACBZn1khTbGUK6TNxAce3Bj8jYRW9QzVDAv97nJBho5nc8PZ2zg lfwb2xchXkFARWN+VwTEWeMZEOOX0yn885m+LHsOU9D+DvWlbB9c/WU9gR6V7obQR4Xz SCQbMtQYOesDgsdsVco/fIAfhSOOVkC7mjLtcx5oYMpBmT3t+Vt7BlCQQnztm9vALH5H 88oQ== X-Gm-Message-State: AOAM533ScJH/Pz+brFvSBktpivJ2n8JhoMgaytMIhuk/uyZSV2G56flX Hxk2ZuCQPvrhcIvT2nL5LnMD3avVMxk= X-Google-Smtp-Source: ABdhPJyZ7OIfE/mFIo+b+YMBqasMx8GiVDUS2gGXi6ZKF8F/8x3bjo+RqeqrdPlz3hDO5Bcd6ASQyw== X-Received: by 2002:a05:620a:103c:: with SMTP id a28mr3022405qkk.425.1643297591785; Thu, 27 Jan 2022 07:33:11 -0800 (PST) Received: from localhost.localdomain ([86.57.159.214]) by smtp.gmail.com with ESMTPSA id u16sm1599127qko.130.2022.01.27.07.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 07:33:11 -0800 (PST) From: sankouski-dzmitry X-Google-Original-From: sankouski-dzmitry To: u-boot@lists.denx.de Cc: Dzmitry Sankouski Subject: [PATCH 0/3] save prev bootloader data, when u-boot chainloaded Date: Thu, 27 Jan 2022 18:32:31 +0300 Message-Id: <20220127153234.1964353-1-sankouski.dzmitry@gmail.com> X-Mailer: git-send-email 2.25.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 From: Dzmitry Sankouski 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 | 11 ++-- configs/a5y17lte_defconfig | 10 ++-- configs/a7y17lte_defconfig | 10 ++-- configs/starqltechn_defconfig | 12 ++-- doc/board/qualcomm/sdm845.rst | 47 ++++++++++++++- doc/board/samsung/axy17lte.rst | 15 +---- include/configs/exynos78x0-common.h | 1 + include/configs/sdm845.h | 5 ++ include/init.h | 13 ++++ 12 files changed, 241 insertions(+), 57 deletions(-) create mode 100644 arch/arm/lib/save_prev_bl_data.c -- 2.25.1