linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: Nick Kossifidis <mick@ics.forth.gr>,
	Atish Patra <atish.patra@wdc.com>,
	linux-riscv@lists.infradead.org
Subject: [PATCH 07/12] riscv: cleanup the parse_dtb calling conventions
Date: Fri, 12 Apr 2019 16:39:43 +0200	[thread overview]
Message-ID: <20190412143948.12478-8-hch@lst.de> (raw)
In-Reply-To: <20190412143948.12478-1-hch@lst.de>

No need to pass the hartid, and the dtb address passed is a physical
address, so don't pretend it is a kernel pointer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/riscv/kernel/head.S  | 3 +--
 arch/riscv/kernel/setup.c | 6 ++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 62d2c9c85433..478821d31bb3 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -72,8 +72,7 @@ clear_bss_done:
 	la sp, init_thread_union + THREAD_SIZE
 
 	/* Start the kernel */
-	mv a0, s0
-	mv a1, s1
+	mv a0, s1
 	call parse_dtb
 	tail start_kernel
 
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 540a331d1376..d93bcce004e3 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -52,9 +52,11 @@ struct screen_info screen_info = {
 atomic_t hart_lottery;
 unsigned long boot_cpu_hartid;
 
-void __init parse_dtb(unsigned int hartid, void *dtb)
+void __init parse_dtb(phys_addr_t dtb_phys)
 {
-	if (early_init_dt_scan(__va(dtb)))
+	void *dtb = __va(dtb_phys);
+
+	if (early_init_dt_scan(dtb))
 		return;
 
 	pr_err("No DTB passed to the kernel\n");
-- 
2.20.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2019-04-12 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 14:39 misc cleanups v2 Christoph Hellwig
2019-04-12 14:39 ` [PATCH 01/12] riscv: use asm-generic/extable.h Christoph Hellwig
2019-04-12 14:39 ` [PATCH 02/12] riscv: turn mm_segment_t into a struct Christoph Hellwig
2019-04-12 14:39 ` [PATCH 03/12] riscv: remove unreachable big endian code Christoph Hellwig
2019-04-12 14:39 ` [PATCH 04/12] riscv: remove CONFIG_RISCV_ISA_A Christoph Hellwig
2019-04-12 14:39 ` [PATCH 05/12] riscv: clear all pending interrupts when booting Christoph Hellwig
2019-04-12 14:39 ` [PATCH 06/12] riscv: simplify the stack pointer setup in head.S Christoph Hellwig
2019-04-12 14:39 ` Christoph Hellwig [this message]
2019-04-12 14:39 ` [PATCH 08/12] riscv: remove unreachable !CONFIG_FRAME_POINTER code Christoph Hellwig
2019-04-12 14:39 ` [PATCH 09/12] riscv: remove unreachable !HAVE_FUNCTION_GRAPH_RET_ADDR_PTR code Christoph Hellwig
2019-04-12 14:39 ` [PATCH 10/12] riscv: remove duplicate macros from ptrace.h Christoph Hellwig
2019-04-12 14:39 ` [PATCH 11/12] riscv: print the unexpected interrupt cause Christoph Hellwig
2019-04-12 16:09   ` Nick Kossifidis
2019-04-12 14:39 ` [PATCH 12/12] riscv: call pm_power_off from machine_halt / machine_power_off Christoph Hellwig

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=20190412143948.12478-8-hch@lst.de \
    --to=hch@lst.de \
    --cc=atish.patra@wdc.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mick@ics.forth.gr \
    --cc=palmer@sifive.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).