* Re: [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd
[not found] <CAEUhbmU8s5cEt4J-ae0wqfgFHEWe=YWQaDn_Au_MhtK1J7OntA@mail.gmail.com>
@ 2019-08-14 17:06 ` Palmer Dabbelt
2019-08-15 1:30 ` Bin Meng
0 siblings, 1 reply; 5+ messages in thread
From: Palmer Dabbelt @ 2019-08-14 17:06 UTC (permalink / raw)
To: bmeng.cn
Cc: qemu-riscv, sagark, Bastian Koppelmann, qemu-devel,
Alistair Francis, linux
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd
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
2019-08-15 1:53 ` Palmer Dabbelt
0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2019-08-15 1:30 UTC (permalink / raw)
To: Palmer Dabbelt
Cc: open list:RISC-V, Sagar Karandikar, Bastian Koppelmann,
qemu-devel@nongnu.org Developers, Alistair Francis, linux
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd
2019-08-15 1:30 ` Bin Meng
@ 2019-08-15 1:53 ` Palmer Dabbelt
0 siblings, 0 replies; 5+ messages in thread
From: Palmer Dabbelt @ 2019-08-15 1:53 UTC (permalink / raw)
To: bmeng.cn
Cc: qemu-riscv, sagark, Bastian Koppelmann, qemu-devel,
Alistair Francis, linux
On Wed, 14 Aug 2019 18:30:59 PDT (-0700), bmeng.cn@gmail.com wrote:
> 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.
Thanks, I've deleted that confusing fork.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd
[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
1 sibling, 0 replies; 5+ messages in thread
From: Palmer Dabbelt @ 2019-08-12 22:44 UTC (permalink / raw)
To: linux
Cc: qemu-riscv, sagark, Bastian Koppelmann, qemu-devel,
Alistair Francis, linux
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] riscv: sifive_u: Add support for loading initrd
[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
1 sibling, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2019-07-22 22:28 UTC (permalink / raw)
To: linux, palmer; +Cc: kbastian, qemu-riscv, qemu-devel, sagark
On Fri, 2019-07-19 at 06:40 -0700, Guenter Roeck 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>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> 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 */
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-08-15 1:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[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
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
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).