qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
	Sagar Karandikar <sagark@eecs.berkeley.edu>,
	Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	linux@roeck-us.net
Subject: Re: [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd
Date: Thu, 15 Aug 2019 09:30:59 +0800	[thread overview]
Message-ID: <CAEUhbmVb-rfZ74mY_2QHTNw8R-FYTwxggHAPCCWviYpZZXNtAg@mail.gmail.com> (raw)
In-Reply-To: <mhng-b7d8bc3c-3d03-4b2a-910f-8a9ceb18a046@palmer-si-x1c4>

Hi Palmer,

On Thu, Aug 15, 2019 at 1:06 AM Palmer Dabbelt <palmer@sifive.com> wrote:
>
> On Mon, 12 Aug 2019 16:48:00 PDT (-0700), bmeng.cn@gmail.com wrote:
> > Hi Palmer,
> >
> > On Tue, Aug 13, 2019 at 6:45 AM Palmer Dabbelt <palmer@sifive.com> wrote:
> >>
> >> On Fri, 19 Jul 2019 06:40:43 PDT (-0700), linux@roeck-us.net wrote:
> >> > Add support for loading initrd with "-initrd <filename>"
> >> > to the sifive_u machine. This lets us boot into Linux without
> >> > disk drive.
> >> >
> >> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> >> > ---
> >> >  hw/riscv/sifive_u.c | 20 +++++++++++++++++---
> >> >  1 file changed, 17 insertions(+), 3 deletions(-)
> >> >
> >> > diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> >> > index 71b8083..0657046 100644
> >> > --- a/hw/riscv/sifive_u.c
> >> > +++ b/hw/riscv/sifive_u.c
> >> > @@ -67,7 +67,7 @@ static const struct MemmapEntry {
> >> >
> >> >  #define GEM_REVISION        0x10070109
> >> >
> >> > -static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
> >> > +static void *create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
> >> >      uint64_t mem_size, const char *cmdline)
> >> >  {
> >> >      void *fdt;
> >> > @@ -244,11 +244,14 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
> >> >          qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
> >> >      }
> >> >      g_free(nodename);
> >> > +
> >> > +    return fdt;
> >> >  }
> >> >
> >> >  static void riscv_sifive_u_init(MachineState *machine)
> >> >  {
> >> >      const struct MemmapEntry *memmap = sifive_u_memmap;
> >> > +    void *fdt;
> >> >
> >> >      SiFiveUState *s = g_new0(SiFiveUState, 1);
> >> >      MemoryRegion *system_memory = get_system_memory();
> >> > @@ -269,13 +272,24 @@ static void riscv_sifive_u_init(MachineState *machine)
> >> >                                  main_mem);
> >> >
> >> >      /* create device tree */
> >> > -    create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
> >> > +    fdt = create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
> >> >
> >> >      riscv_find_and_load_firmware(machine, BIOS_FILENAME,
> >> >                                   memmap[SIFIVE_U_DRAM].base);
> >> >
> >> >      if (machine->kernel_filename) {
> >> > -        riscv_load_kernel(machine->kernel_filename);
> >> > +        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
> >> > +
> >> > +        if (machine->initrd_filename) {
> >> > +            hwaddr start;
> >> > +            hwaddr end = riscv_load_initrd(machine->initrd_filename,
> >> > +                                           machine->ram_size, kernel_entry,
> >> > +                                           &start);
> >> > +            qemu_fdt_setprop_cell(fdt, "/chosen",
> >> > +                                  "linux,initrd-start", start);
> >> > +            qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end",
> >> > +                                  end);
> >> > +        }
> >> >      }
> >> >
> >> >      /* reset vector */
> >>
> >> Thanks.  I've queued all three of these.
> >>
> >
> > Ah, looks I did a duplicate.
> > http://patchwork.ozlabs.org/patch/1145247/
> >
> > Which git repo/branch should I rebase my series on?
>
> github.com/palmer-dabbelt/riscv-qemu -b for-master

I did not see branch "for-master" in the riscv-qemu repo. However I
did find the branch in the github.com/palmer-dabbelt/qemu repo.

I assume that's the correct one I should rebase my patch series on.

Regards,
Bin


  reply	other threads:[~2019-08-15  1:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEUhbmU8s5cEt4J-ae0wqfgFHEWe=YWQaDn_Au_MhtK1J7OntA@mail.gmail.com>
2019-08-14 17:06 ` [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd Palmer Dabbelt
2019-08-15  1:30   ` Bin Meng [this message]
2019-08-15  1:53     ` Palmer Dabbelt
     [not found] <1563543645-20804-1-git-send-email-linux@roeck-us.net>
2019-07-22 22:28 ` Alistair Francis
2019-08-12 22:44 ` Palmer Dabbelt

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=CAEUhbmVb-rfZ74mY_2QHTNw8R-FYTwxggHAPCCWviYpZZXNtAg@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=linux@roeck-us.net \
    --cc=palmer@sifive.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=sagark@eecs.berkeley.edu \
    /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).