[PATCH v5 0/2] RTC support for QEMU RISC-V virt machine

Anup Patel posted 2 patches 4 years, 5 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
hw/riscv/Kconfig              |   1 +
hw/riscv/virt.c               |  15 ++
hw/rtc/Kconfig                |   3 +
hw/rtc/Makefile.objs          |   1 +
hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
hw/rtc/trace-events           |   4 +
include/hw/riscv/virt.h       |   2 +
include/hw/rtc/goldfish_rtc.h |  46 ++++++
8 files changed, 360 insertions(+)
create mode 100644 hw/rtc/goldfish_rtc.c
create mode 100644 include/hw/rtc/goldfish_rtc.h
[PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Anup Patel 4 years, 5 months ago
This series adds RTC device to QEMU RISC-V virt machine. We have
selected Goldfish RTC device model for this. It's a pretty simple
synthetic device with few MMIO registers and no dependency external
clock. The driver for Goldfish RTC is already available in Linux so
we just need to enable it in Kconfig for RISCV and also update Linux
defconfigs.

We have tested this series with Linux-5.4-rc4 plus defconfig changes
available in 'goldfish_rtc_v2' branch of:
https://github.com/avpatel/linux.git

Changes since v4:
 - Fixed typo in trace event usage
 - Moved goldfish_rtc.h to correct location

Changes since v3:
 - Address all nit comments from Alistair

Changes since v2:
 - Rebased on RTC code refactoring

Changes since v1:
 - Implemented VMState save/restore callbacks

Anup Patel (2):
  hw: rtc: Add Goldfish RTC device
  riscv: virt: Use Goldfish RTC device

 hw/riscv/Kconfig              |   1 +
 hw/riscv/virt.c               |  15 ++
 hw/rtc/Kconfig                |   3 +
 hw/rtc/Makefile.objs          |   1 +
 hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
 hw/rtc/trace-events           |   4 +
 include/hw/riscv/virt.h       |   2 +
 include/hw/rtc/goldfish_rtc.h |  46 ++++++
 8 files changed, 360 insertions(+)
 create mode 100644 hw/rtc/goldfish_rtc.c
 create mode 100644 include/hw/rtc/goldfish_rtc.h

--
2.17.1

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Alistair Francis 4 years, 5 months ago
On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
>
> This series adds RTC device to QEMU RISC-V virt machine. We have
> selected Goldfish RTC device model for this. It's a pretty simple
> synthetic device with few MMIO registers and no dependency external
> clock. The driver for Goldfish RTC is already available in Linux so
> we just need to enable it in Kconfig for RISCV and also update Linux
> defconfigs.
>
> We have tested this series with Linux-5.4-rc4 plus defconfig changes
> available in 'goldfish_rtc_v2' branch of:
> https://github.com/avpatel/linux.git

@Peter Maydell this has been reviewed, do you mind taking this in you
next PR? I don't see a maintainer for hw/rtc.

Alistair

>
> Changes since v4:
>  - Fixed typo in trace event usage
>  - Moved goldfish_rtc.h to correct location
>
> Changes since v3:
>  - Address all nit comments from Alistair
>
> Changes since v2:
>  - Rebased on RTC code refactoring
>
> Changes since v1:
>  - Implemented VMState save/restore callbacks
>
> Anup Patel (2):
>   hw: rtc: Add Goldfish RTC device
>   riscv: virt: Use Goldfish RTC device
>
>  hw/riscv/Kconfig              |   1 +
>  hw/riscv/virt.c               |  15 ++
>  hw/rtc/Kconfig                |   3 +
>  hw/rtc/Makefile.objs          |   1 +
>  hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
>  hw/rtc/trace-events           |   4 +
>  include/hw/riscv/virt.h       |   2 +
>  include/hw/rtc/goldfish_rtc.h |  46 ++++++
>  8 files changed, 360 insertions(+)
>  create mode 100644 hw/rtc/goldfish_rtc.c
>  create mode 100644 include/hw/rtc/goldfish_rtc.h
>
> --
> 2.17.1
>

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Peter Maydell 4 years, 4 months ago
On Tue, 29 Oct 2019 at 13:25, Alistair Francis <alistair23@gmail.com> wrote:
>
> On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
> >
> > This series adds RTC device to QEMU RISC-V virt machine. We have
> > selected Goldfish RTC device model for this. It's a pretty simple
> > synthetic device with few MMIO registers and no dependency external
> > clock. The driver for Goldfish RTC is already available in Linux so
> > we just need to enable it in Kconfig for RISCV and also update Linux
> > defconfigs.
> >
> > We have tested this series with Linux-5.4-rc4 plus defconfig changes
> > available in 'goldfish_rtc_v2' branch of:
> > https://github.com/avpatel/linux.git
>
> @Peter Maydell this has been reviewed, do you mind taking this in you
> next PR? I don't see a maintainer for hw/rtc.

Generally devices used by a single architecture should
go via the tree of the maintainer who handles that
architecture -- in this case that's riscv. (The reason
is that it's only riscv folks who can test whether the
device works in the machine model, and only riscv
folks who can reasonably review whether the device
is the right way of implementing the functionality for
them.)

thanks
-- PMM

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Alistair Francis 4 years, 4 months ago
On Sat, Nov 2, 2019 at 3:37 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Tue, 29 Oct 2019 at 13:25, Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
> > >
> > > This series adds RTC device to QEMU RISC-V virt machine. We have
> > > selected Goldfish RTC device model for this. It's a pretty simple
> > > synthetic device with few MMIO registers and no dependency external
> > > clock. The driver for Goldfish RTC is already available in Linux so
> > > we just need to enable it in Kconfig for RISCV and also update Linux
> > > defconfigs.
> > >
> > > We have tested this series with Linux-5.4-rc4 plus defconfig changes
> > > available in 'goldfish_rtc_v2' branch of:
> > > https://github.com/avpatel/linux.git
> >
> > @Peter Maydell this has been reviewed, do you mind taking this in you
> > next PR? I don't see a maintainer for hw/rtc.
>
> Generally devices used by a single architecture should
> go via the tree of the maintainer who handles that
> architecture -- in this case that's riscv. (The reason
> is that it's only riscv folks who can test whether the
> device works in the machine model, and only riscv
> folks who can reasonably review whether the device
> is the right way of implementing the functionality for
> them.)

Makes sense

Alistair

>
> thanks
> -- PMM

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Palmer Dabbelt 4 years, 4 months ago
On Sat, 02 Nov 2019 03:37:42 PDT (-0700), Peter Maydell wrote:
> On Tue, 29 Oct 2019 at 13:25, Alistair Francis <alistair23@gmail.com> wrote:
>>
>> On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
>> >
>> > This series adds RTC device to QEMU RISC-V virt machine. We have
>> > selected Goldfish RTC device model for this. It's a pretty simple
>> > synthetic device with few MMIO registers and no dependency external
>> > clock. The driver for Goldfish RTC is already available in Linux so
>> > we just need to enable it in Kconfig for RISCV and also update Linux
>> > defconfigs.
>> >
>> > We have tested this series with Linux-5.4-rc4 plus defconfig changes
>> > available in 'goldfish_rtc_v2' branch of:
>> > https://github.com/avpatel/linux.git
>>
>> @Peter Maydell this has been reviewed, do you mind taking this in you
>> next PR? I don't see a maintainer for hw/rtc.
>
> Generally devices used by a single architecture should
> go via the tree of the maintainer who handles that
> architecture -- in this case that's riscv. (The reason
> is that it's only riscv folks who can test whether the
> device works in the machine model, and only riscv
> folks who can reasonably review whether the device
> is the right way of implementing the functionality for
> them.)

OK, I'm taking it via the RISC-V tree.  I'll send the PR for 4.3.

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Anup Patel 4 years, 4 months ago
On Tue, Oct 29, 2019 at 6:55 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
> >
> > This series adds RTC device to QEMU RISC-V virt machine. We have
> > selected Goldfish RTC device model for this. It's a pretty simple
> > synthetic device with few MMIO registers and no dependency external
> > clock. The driver for Goldfish RTC is already available in Linux so
> > we just need to enable it in Kconfig for RISCV and also update Linux
> > defconfigs.
> >
> > We have tested this series with Linux-5.4-rc4 plus defconfig changes
> > available in 'goldfish_rtc_v2' branch of:
> > https://github.com/avpatel/linux.git
>
> @Peter Maydell this has been reviewed, do you mind taking this in you
> next PR? I don't see a maintainer for hw/rtc.

It would be great if this series can be taken for QEMU-4.2

Regards,
Anup

>
> Alistair
>
> >
> > Changes since v4:
> >  - Fixed typo in trace event usage
> >  - Moved goldfish_rtc.h to correct location
> >
> > Changes since v3:
> >  - Address all nit comments from Alistair
> >
> > Changes since v2:
> >  - Rebased on RTC code refactoring
> >
> > Changes since v1:
> >  - Implemented VMState save/restore callbacks
> >
> > Anup Patel (2):
> >   hw: rtc: Add Goldfish RTC device
> >   riscv: virt: Use Goldfish RTC device
> >
> >  hw/riscv/Kconfig              |   1 +
> >  hw/riscv/virt.c               |  15 ++
> >  hw/rtc/Kconfig                |   3 +
> >  hw/rtc/Makefile.objs          |   1 +
> >  hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
> >  hw/rtc/trace-events           |   4 +
> >  include/hw/riscv/virt.h       |   2 +
> >  include/hw/rtc/goldfish_rtc.h |  46 ++++++
> >  8 files changed, 360 insertions(+)
> >  create mode 100644 hw/rtc/goldfish_rtc.c
> >  create mode 100644 include/hw/rtc/goldfish_rtc.h
> >
> > --
> > 2.17.1
> >

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Palmer Dabbelt 4 years, 4 months ago
On Fri, 01 Nov 2019 08:40:24 PDT (-0700), anup@brainfault.org wrote:
> On Tue, Oct 29, 2019 at 6:55 PM Alistair Francis <alistair23@gmail.com> wrote:
>>
>> On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
>> >
>> > This series adds RTC device to QEMU RISC-V virt machine. We have
>> > selected Goldfish RTC device model for this. It's a pretty simple
>> > synthetic device with few MMIO registers and no dependency external
>> > clock. The driver for Goldfish RTC is already available in Linux so
>> > we just need to enable it in Kconfig for RISCV and also update Linux
>> > defconfigs.
>> >
>> > We have tested this series with Linux-5.4-rc4 plus defconfig changes
>> > available in 'goldfish_rtc_v2' branch of:
>> > https://github.com/avpatel/linux.git
>>
>> @Peter Maydell this has been reviewed, do you mind taking this in you
>> next PR? I don't see a maintainer for hw/rtc.
>
> It would be great if this series can be taken for QEMU-4.2

It doesn't look like there's anyone who maintains hw/rtc, so maybe that's why 
this has been going slowly?  I'd happy to PR it, but I don't really have the 
bandwidth to sign up to maintain more stuff right now.

>
> Regards,
> Anup
>
>>
>> Alistair
>>
>> >
>> > Changes since v4:
>> >  - Fixed typo in trace event usage
>> >  - Moved goldfish_rtc.h to correct location
>> >
>> > Changes since v3:
>> >  - Address all nit comments from Alistair
>> >
>> > Changes since v2:
>> >  - Rebased on RTC code refactoring
>> >
>> > Changes since v1:
>> >  - Implemented VMState save/restore callbacks
>> >
>> > Anup Patel (2):
>> >   hw: rtc: Add Goldfish RTC device
>> >   riscv: virt: Use Goldfish RTC device
>> >
>> >  hw/riscv/Kconfig              |   1 +
>> >  hw/riscv/virt.c               |  15 ++
>> >  hw/rtc/Kconfig                |   3 +
>> >  hw/rtc/Makefile.objs          |   1 +
>> >  hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
>> >  hw/rtc/trace-events           |   4 +
>> >  include/hw/riscv/virt.h       |   2 +
>> >  include/hw/rtc/goldfish_rtc.h |  46 ++++++
>> >  8 files changed, 360 insertions(+)
>> >  create mode 100644 hw/rtc/goldfish_rtc.c
>> >  create mode 100644 include/hw/rtc/goldfish_rtc.h
>> >
>> > --
>> > 2.17.1
>> >

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Anup Patel 4 years, 4 months ago
On Sat, Nov 2, 2019 at 4:44 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> On Fri, 01 Nov 2019 08:40:24 PDT (-0700), anup@brainfault.org wrote:
> > On Tue, Oct 29, 2019 at 6:55 PM Alistair Francis <alistair23@gmail.com> wrote:
> >>
> >> On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
> >> >
> >> > This series adds RTC device to QEMU RISC-V virt machine. We have
> >> > selected Goldfish RTC device model for this. It's a pretty simple
> >> > synthetic device with few MMIO registers and no dependency external
> >> > clock. The driver for Goldfish RTC is already available in Linux so
> >> > we just need to enable it in Kconfig for RISCV and also update Linux
> >> > defconfigs.
> >> >
> >> > We have tested this series with Linux-5.4-rc4 plus defconfig changes
> >> > available in 'goldfish_rtc_v2' branch of:
> >> > https://github.com/avpatel/linux.git
> >>
> >> @Peter Maydell this has been reviewed, do you mind taking this in you
> >> next PR? I don't see a maintainer for hw/rtc.
> >
> > It would be great if this series can be taken for QEMU-4.2
>
> It doesn't look like there's anyone who maintains hw/rtc, so maybe that's why
> this has been going slowly?  I'd happy to PR it, but I don't really have the
> bandwidth to sign up to maintain more stuff right now.

No problem, I will maintain Goldfish RTC emulation until someone else
is willing to maintain it.

Regards,
Anup

>
> >
> > Regards,
> > Anup
> >
> >>
> >> Alistair
> >>
> >> >
> >> > Changes since v4:
> >> >  - Fixed typo in trace event usage
> >> >  - Moved goldfish_rtc.h to correct location
> >> >
> >> > Changes since v3:
> >> >  - Address all nit comments from Alistair
> >> >
> >> > Changes since v2:
> >> >  - Rebased on RTC code refactoring
> >> >
> >> > Changes since v1:
> >> >  - Implemented VMState save/restore callbacks
> >> >
> >> > Anup Patel (2):
> >> >   hw: rtc: Add Goldfish RTC device
> >> >   riscv: virt: Use Goldfish RTC device
> >> >
> >> >  hw/riscv/Kconfig              |   1 +
> >> >  hw/riscv/virt.c               |  15 ++
> >> >  hw/rtc/Kconfig                |   3 +
> >> >  hw/rtc/Makefile.objs          |   1 +
> >> >  hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
> >> >  hw/rtc/trace-events           |   4 +
> >> >  include/hw/riscv/virt.h       |   2 +
> >> >  include/hw/rtc/goldfish_rtc.h |  46 ++++++
> >> >  8 files changed, 360 insertions(+)
> >> >  create mode 100644 hw/rtc/goldfish_rtc.c
> >> >  create mode 100644 include/hw/rtc/goldfish_rtc.h
> >> >
> >> > --
> >> > 2.17.1
> >> >

Re: [PATCH v5 0/2] RTC support for QEMU RISC-V virt machine
Posted by Alistair Francis 4 years, 4 months ago
On Sun, Nov 3, 2019 at 12:12 AM Anup Patel <anup@brainfault.org> wrote:
>
> On Sat, Nov 2, 2019 at 4:44 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> >
> > On Fri, 01 Nov 2019 08:40:24 PDT (-0700), anup@brainfault.org wrote:
> > > On Tue, Oct 29, 2019 at 6:55 PM Alistair Francis <alistair23@gmail.com> wrote:
> > >>
> > >> On Fri, Oct 25, 2019 at 6:28 AM Anup Patel <Anup.Patel@wdc.com> wrote:
> > >> >
> > >> > This series adds RTC device to QEMU RISC-V virt machine. We have
> > >> > selected Goldfish RTC device model for this. It's a pretty simple
> > >> > synthetic device with few MMIO registers and no dependency external
> > >> > clock. The driver for Goldfish RTC is already available in Linux so
> > >> > we just need to enable it in Kconfig for RISCV and also update Linux
> > >> > defconfigs.
> > >> >
> > >> > We have tested this series with Linux-5.4-rc4 plus defconfig changes
> > >> > available in 'goldfish_rtc_v2' branch of:
> > >> > https://github.com/avpatel/linux.git
> > >>
> > >> @Peter Maydell this has been reviewed, do you mind taking this in you
> > >> next PR? I don't see a maintainer for hw/rtc.
> > >
> > > It would be great if this series can be taken for QEMU-4.2
> >
> > It doesn't look like there's anyone who maintains hw/rtc, so maybe that's why
> > this has been going slowly?  I'd happy to PR it, but I don't really have the
> > bandwidth to sign up to maintain more stuff right now.

The PR is reviewed so it should be ok to merge now (and it made it
into soft freeze).

>
> No problem, I will maintain Goldfish RTC emulation until someone else
> is willing to maintain it.

You can add me as a maintainer as well if you want.

Alistair

>
> Regards,
> Anup
>
> >
> > >
> > > Regards,
> > > Anup
> > >
> > >>
> > >> Alistair
> > >>
> > >> >
> > >> > Changes since v4:
> > >> >  - Fixed typo in trace event usage
> > >> >  - Moved goldfish_rtc.h to correct location
> > >> >
> > >> > Changes since v3:
> > >> >  - Address all nit comments from Alistair
> > >> >
> > >> > Changes since v2:
> > >> >  - Rebased on RTC code refactoring
> > >> >
> > >> > Changes since v1:
> > >> >  - Implemented VMState save/restore callbacks
> > >> >
> > >> > Anup Patel (2):
> > >> >   hw: rtc: Add Goldfish RTC device
> > >> >   riscv: virt: Use Goldfish RTC device
> > >> >
> > >> >  hw/riscv/Kconfig              |   1 +
> > >> >  hw/riscv/virt.c               |  15 ++
> > >> >  hw/rtc/Kconfig                |   3 +
> > >> >  hw/rtc/Makefile.objs          |   1 +
> > >> >  hw/rtc/goldfish_rtc.c         | 288 ++++++++++++++++++++++++++++++++++
> > >> >  hw/rtc/trace-events           |   4 +
> > >> >  include/hw/riscv/virt.h       |   2 +
> > >> >  include/hw/rtc/goldfish_rtc.h |  46 ++++++
> > >> >  8 files changed, 360 insertions(+)
> > >> >  create mode 100644 hw/rtc/goldfish_rtc.c
> > >> >  create mode 100644 include/hw/rtc/goldfish_rtc.h
> > >> >
> > >> > --
> > >> > 2.17.1
> > >> >