All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 24/29] riscv: store device tree passed by prior boot stage in environment
Date: Tue, 30 Oct 2018 13:55:47 +0100	[thread overview]
Message-ID: <20181030125553.5230-25-lukas.auer@aisec.fraunhofer.de> (raw)
In-Reply-To: <20181030125553.5230-1-lukas.auer@aisec.fraunhofer.de>

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 <lukas.auer@aisec.fraunhofer.de>
---

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);
-- 
2.17.2

  parent reply	other threads:[~2018-10-30 12:55 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 12:55 [U-Boot] [PATCH v2 00/29] General fixes / cleanup for RISC-V and improvements to qemu-riscv Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 01/29] tools: .gitignore: add prelink-riscv Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 02/29] dts: riscv: update makefile to also clean the RISC-V dts directory Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 03/29] riscv: rename CPU_RISCV_32/64 to match architecture names ARCH_RV32I/64I Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 04/29] riscv: select CONFIG_PHYS_64BIT on RV64I systems Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 05/29] riscv: add Kconfig entries for the C and A ISA extensions Lukas Auer
2018-10-31  2:13   ` Bin Meng
2018-10-30 12:55 ` [U-Boot] [PATCH v2 06/29] riscv: set -march and -mabi based on the Kconfig configuration Lukas Auer
2018-10-31  2:13   ` Bin Meng
2018-10-30 12:55 ` [U-Boot] [PATCH v2 07/29] riscv: add Kconfig entries for the code model Lukas Auer
2018-10-31  2:13   ` Bin Meng
2018-10-31 15:01     ` Auer, Lukas
2018-11-13  7:34       ` Bin Meng
2018-11-13 10:20         ` Auer, Lukas
2018-10-30 12:55 ` [U-Boot] [PATCH v2 08/29] riscv: enable -fdata-sections Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 09/29] riscv: fix use of incorrectly sized variables Lukas Auer
2018-10-31  2:13   ` Bin Meng
2018-10-30 12:55 ` [U-Boot] [PATCH v2 10/29] riscv: make use of the barrier functions from Linux Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 11/29] riscv: do not reimplement generic io functions Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 12/29] riscv: complete the list of exception codes Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 13/29] riscv: treat undefined exception codes as reserved Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 14/29] riscv: hang on unhandled exceptions Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 15/29] riscv: implement the invalidate_icache_* functions Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 16/29] riscv: invalidate the instruction cache before jumping to Linux Lukas Auer
2018-10-31  2:14   ` Bin Meng
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA3A3ECAA@ATCPCS16.andestech.com>
2018-11-01  4:23     ` Rick Chen
2018-10-30 12:55 ` [U-Boot] [PATCH v2 17/29] riscv: fix inconsistent use of spaces and tabs in start.S Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 18/29] riscv: align mtvec on a 4-byte boundary Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 19/29] Drop CONFIG_INIT_CRITICAL Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 20/29] riscv: remove unused labels in start.S Lukas Auer
2018-10-31  2:14   ` Bin Meng
2018-10-30 12:55 ` [U-Boot] [PATCH v2 21/29] riscv: do not blindly modify the mstatus CSR Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 22/29] riscv: save hart ID and device tree passed by prior boot stage Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 23/29] riscv: qemu: use " Lukas Auer
2018-10-30 12:55 ` Lukas Auer [this message]
2018-10-30 13:19   ` [U-Boot] [PATCH v2 24/29] riscv: store device tree passed by prior boot stage in environment Alexander Graf
2018-10-30 13:44     ` Auer, Lukas
2018-10-30 13:53       ` Alexander Graf
2018-10-30 14:51         ` Auer, Lukas
2018-10-30 12:55 ` [U-Boot] [PATCH v2 25/29] riscv: qemu: support booting Linux Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 26/29] riscv: align bootm implementation with that of other architectures Lukas Auer
2018-10-30 12:55 ` [U-Boot] [PATCH v2 27/29] dm: core: add missing prototype for ofnode_read_u64 Lukas Auer
2018-10-31  2:14   ` Bin Meng
2018-11-03  6:08   ` Simon Glass
2018-10-30 12:55 ` [U-Boot] [PATCH v2 28/29] riscv: qemu: detect and boot the kernel passed by QEMU Lukas Auer
2018-10-30 15:02   ` Auer, Lukas
2018-10-30 15:27     ` Alexander Graf
2018-10-30 17:13       ` Auer, Lukas
2018-11-03 17:07       ` Auer, Lukas
2018-11-03 19:33         ` Alexander Graf
2018-11-04 12:52           ` Auer, Lukas
2018-11-04 21:19             ` Alexander Graf
2018-11-04 14:39   ` Bin Meng
2018-11-04 19:41     ` Auer, Lukas
2018-10-30 12:55 ` [U-Boot] [PATCH v2 29/29] riscv: qemu: clear kernel-start/-end in device tree as workaround for BBL Lukas Auer
2018-10-31  2:14   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181030125553.5230-25-lukas.auer@aisec.fraunhofer.de \
    --to=lukas.auer@aisec.fraunhofer.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.