From patchwork Tue Oct 30 12:55:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Auer X-Patchwork-Id: 990824 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aisec.fraunhofer.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42ksHq0Y05z9s4s for ; Wed, 31 Oct 2018 00:09:26 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 99E35C22116; Tue, 30 Oct 2018 13:03:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E8F45C22174; Tue, 30 Oct 2018 12:58:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 58EDDC2216B; Tue, 30 Oct 2018 12:57:30 +0000 (UTC) Received: from mail-edgeKA24.fraunhofer.de (mail-edgeka24.fraunhofer.de [153.96.1.24]) by lists.denx.de (Postfix) with ESMTPS id E25FDC22112 for ; Tue, 30 Oct 2018 12:57:25 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2E5AAC/VNhb/xoBYJlkGwEBAQEDAQEBBwMBAQGBVAMBAQELAYIEgg2MbaZgDYRsAoMlIjcKDQEDAQECAQECAgJpKIU8BnQFEFFXBg4FgyGCAQGqLYomCQGHN4QmgVg/iW6FDgKKZ5QpBwKBDoEEBI5mCxiJOocOgmuUO4FZI4FVMxokgzuCJhcSjgluAYt3AQE X-IPAS-Result: A2E5AAC/VNhb/xoBYJlkGwEBAQEDAQEBBwMBAQGBVAMBAQELAYIEgg2MbaZgDYRsAoMlIjcKDQEDAQECAQECAgJpKIU8BnQFEFFXBg4FgyGCAQGqLYomCQGHN4QmgVg/iW6FDgKKZ5QpBwKBDoEEBI5mCxiJOocOgmuUO4FZI4FVMxokgzuCJhcSjgluAYt3AQE X-IronPort-AV: E=Sophos;i="5.54,444,1534802400"; d="scan'208";a="10904651" Received: from mail-mtaka26.fraunhofer.de ([153.96.1.26]) by mail-edgeKA24.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2018 13:57:25 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ClAACMVNhb/xBhWMBkHAEBAQQBAQcEAQGBVAQBAQsBg1c6jG2mYA2EbAKDRjcKDQEDAQECAQECbSiFOwZ0BRBRVwYOBYMhggKqLoomCQGHN4V+P4luhQ4CimeUKQcCgQ6BBASOZgsYiTqHDoJrlDuBWSKBVTMaJIM7giYXEo4JPjABi3cBAQ X-IronPort-AV: E=Sophos;i="5.54,444,1534802400"; d="scan'208";a="16525691" Received: from fgdemucivp01ltm.xch.fraunhofer.de (HELO FGDEMUCIMP12EXC.ads.fraunhofer.de) ([192.88.97.16]) by mail-mtaKA26.fraunhofer.de with ESMTP/TLS/AES256-SHA; 30 Oct 2018 13:57:25 +0100 Received: from muc-nb-035.aisec.fraunhofer.de (10.80.233.51) by FGDEMUCIMP12EXC.ads.fraunhofer.de (10.80.232.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 30 Oct 2018 13:57:24 +0100 From: Lukas Auer To: Date: Tue, 30 Oct 2018 13:55:47 +0100 Message-ID: <20181030125553.5230-25-lukas.auer@aisec.fraunhofer.de> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030125553.5230-1-lukas.auer@aisec.fraunhofer.de> References: <20181030125553.5230-1-lukas.auer@aisec.fraunhofer.de> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.200.1013-24188.007 X-TM-AS-Result: No--4.340700-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Alexander Graf , Rajan Vaja , Michal Simek , Greentime Hu Subject: [U-Boot] [PATCH v2 24/29] riscv: store device tree passed by prior boot stage in environment X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The device tree passed by the prior boot stage can be used to boot Linux. Store it as environment variable "prior_stage_dtb", so that it can be used as part of the boot command. Signed-off-by: Lukas Auer --- Changes in v2: - New patch arch/Kconfig | 1 + arch/riscv/cpu/cpu.c | 7 +++++++ arch/riscv/include/asm/u-boot-riscv.h | 1 + 3 files changed, 9 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 9fdd2f7e66..883e4a9308 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -74,6 +74,7 @@ config RISCV imply MTD imply TIMER imply CMD_DM + imply ARCH_MISC_INIT config SANDBOX bool "Sandbox" diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c index d9f820c44c..e06a8c6bab 100644 --- a/arch/riscv/cpu/cpu.c +++ b/arch/riscv/cpu/cpu.c @@ -53,3 +53,10 @@ int print_cpuinfo(void) return 0; } + +int arch_misc_init(void) +{ + env_set_hex("prior_stage_dtb", prior_stage_fdt_address); + + return 0; +} diff --git a/arch/riscv/include/asm/u-boot-riscv.h b/arch/riscv/include/asm/u-boot-riscv.h index 49febd5881..937b2682dc 100644 --- a/arch/riscv/include/asm/u-boot-riscv.h +++ b/arch/riscv/include/asm/u-boot-riscv.h @@ -13,6 +13,7 @@ /* cpu/.../cpu.c */ int cleanup_before_linux(void); +int arch_misc_init(void); /* board/.../... */ int board_init(void);