[PATCH v2 2/3] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-22 Thread Tyler Ng
ndex 2 instead of 3. Found when testing the OpenTitan Always-On watchdog bark interrupt on ZephyrOS. Fixes: 0feb4a7129eb4f120c75849ddc9e50495c50cb63 Signed-off-by: Tyler Ng --- hw/intc/sifive_plic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/intc/sifive_plic.c b/h

[PATCH v2 1/3] hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan

2022-09-22 Thread Tyler Ng
tself. include/hw/riscv/opentitan.h: Add watchdog bark/wakeup IRQs and timer. include/hw/watchdog/wdt_ibex_aon.h: Add watchdog. tests/qtest/ibex-aon-timer-test.c: Ibex AON Timer test. tests/qtest/meson.build: Build the timer test. Signed-off-by: Tyler Ng --- hw/riscv/Kconfig | 4

[PATCH v2 3/3] hw/timer: ibex_timer.c: Add support for writes to mtime

2022-09-22 Thread Tyler Ng
a qtest for the ibex timer. Signed-off-by: Tyler Ng --- hw/timer/ibex_timer.c | 98 +-- include/hw/timer/ibex_timer.h | 6 ++ tests/qtest/ibex-timer-test.c | 178 ++ tests/qtest/meson.build | 3 +- 4 files changed, 256 insertions

[PATCH v2 0/3] Implement the Opentitan watchdog

2022-09-22 Thread Tyler Ng
/top_earlgrey_memory.h The main components of this patch series are: 1. The OpenTitan AON Timer device itself, and an associated qtest. 2. Fix a bug found with the sifive plic device. 3. Adds support for writes to mtime in the Ibex timer device and adds a qtest for it. Tyler Ng (3): hw/watchdog

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-26 Thread Tyler Ng
nes. > > Thanks, > Jim Shu > > > > > On Tue, Sep 6, 2022 at 11:21 PM Tyler Ng wrote: > > > > Here's the patch SHA that introduced the offset: > 0feb4a7129eb4f120c75849ddc9e50495c50cb63 > > > > -Tyler > > > > On Mon, Sep 5, 2022 at 6:1

Re: [PATCH v2 1/3] hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan

2022-09-26 Thread Tyler Ng
Hi Thomas, On Thu, Sep 22, 2022 at 9:17 AM Thomas Huth wrote: > On 22/09/2022 17.58, Tyler Ng wrote: > > This commit adds most of an implementation of the OpenTitan Always-On > > Timer. The documentation for this timer is found here: > > > > https://docs.openti

Re: [PATCH v2 1/3] hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan

2022-09-26 Thread Tyler Ng
Hi Eddie, On Mon, Sep 26, 2022 at 1:46 PM Dong, Eddie wrote: > > > > -Original Message- > > From: Qemu-devel > > On Behalf Of Tyler Ng > > Sent: Thursday, September 22, 2022 8:59 AM > > To: open list:RISC-V ; qemu-devel@nongnu.org > > Develo

Re: [PATCH v2 3/3] hw/timer: ibex_timer.c: Add support for writes to mtime

2022-09-26 Thread Tyler Ng
On Thu, Sep 22, 2022 at 2:45 PM Philippe Mathieu-Daudé wrote: > On 22/9/22 17:58, Tyler Ng wrote: > > 1. Adds fields to hold the value of mtime in timer_upper0 and > timer_lower0. > > > > 2. Changes the read and write functions to use the mtime fields. > > > &

Re: [PATCH v2 3/3] hw/timer: ibex_timer.c: Add support for writes to mtime

2022-09-26 Thread Tyler Ng
Hi Eddie, On Mon, Sep 26, 2022 at 2:06 PM Dong, Eddie wrote: > > > > -Original Message- > > From: Qemu-devel > > On Behalf Of Tyler Ng > > Sent: Thursday, September 22, 2022 8:59 AM > > To: open list:RISC-V ; qemu-devel@nongnu.org > > Develo

Re: [PATCH v2 1/3] hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan

2022-09-27 Thread Tyler Ng
Hi Eddie, On Tue, Sep 27, 2022 at 3:04 PM Dong, Eddie wrote: > Hi Tyler: > > > +} > > + > > +/* Called when the bark timer expires */ static void > > +ibex_aon_barker_expired(void *opaque) { > This may happen during ibex_aon_update_count(), right? > > > +IbexAONTimerState *s = IBEX_AON_TIME

Re: [PATCH v2 3/3] hw/timer: ibex_timer.c: Add support for writes to mtime

2022-09-29 Thread Tyler Ng
On Wed, Sep 28, 2022 at 4:00 PM Dong, Eddie wrote: > > > From: Tyler Ng > Sent: Monday, September 26, 2022 4:38 PM > To: Dong, Eddie > Cc: open list:RISC-V ; qemu-devel@nongnu.org > Developers ; Alistair Francis < > alistair.fran...@wdc.com>; Meng, Bin ; Thomas &

[PATCH 3/4] hw/timer: ibex_timer.c: Update register addresses

2022-09-01 Thread Tyler Ng
Updates the register addresses to match the OpenTitan spec. These changes were made in this commit: https://github.com/lowRISC/opentitan/commit/a25e162b8f91bd0ca32258c83d1d480f93327204 Signed-off-by: Tyler Ng --- hw/timer/ibex_timer.c | 20 ++-- 1 file changed, 10 insertions

[PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-01 Thread Tyler Ng
ndex 2 instead of 3. Signed-off-by: Tyler Ng --- hw/intc/sifive_plic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c index af4ae3630e..e75c47300a 100644 --- a/hw/intc/sifive_plic.c +++ b/hw/intc/sifive_plic.c @@ -178,7 +178,7 @@

[PATCH 0/4] Implement the OpenTitan watchdog

2022-09-01 Thread Tyler Ng
2) is necessary for the bark interrupt to work. (3) will bring the Ibex timer up to spec. Tyler Ng (4): hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan hw/intc: sifive_plic.c: Fix interrupt priority index. hw/timer: ibex_timer.c: Update register addresses hw/timer: ibex_ti

[PATCH 1/4] hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan

2022-09-01 Thread Tyler Ng
akeup IRQs and timer. include/hw/watchdog/wdt_ibex_aon.h: Add watchdog. tests/qtest/ibex-aon-timer-test.c: Ibex Timer test. tests/qtest/meson.build: Build the timer test. Signed-off-by: Tyler Ng --- hw/riscv/Kconfig | 4 + hw/riscv/opentitan.c | 22 +- hw/wat

[PATCH 4/4] hw/timer: ibex_timer.c: Add support for writes to mtime

2022-09-01 Thread Tyler Ng
-off-by: Tyler Ng --- hw/timer/ibex_timer.c | 94 +-- include/hw/timer/ibex_timer.h | 5 ++ 2 files changed, 73 insertions(+), 26 deletions(-) diff --git a/hw/timer/ibex_timer.c b/hw/timer/ibex_timer.c index 9ffd4821e8..7d0ea2db1e 100644 --- a/hw/timer

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-06 Thread Tyler Ng
Here's the patch SHA that introduced the offset: 0feb4a7129eb4f120c75849ddc9e50495c50cb63 -Tyler On Mon, Sep 5, 2022 at 6:15 AM Andrew Jones wrote: > On Thu, Sep 01, 2022 at 03:50:06PM -0700, Tyler Ng wrote: > > Fixes a bug in which the index of the interrupt priority is off

Re: [PATCH 1/4] hw/watchdog: wdt_ibex_aon.c: Implement the watchdog for the OpenTitan

2022-09-08 Thread Tyler Ng
On Thu, Sep 8, 2022 at 4:52 AM Alistair Francis wrote: > On Fri, Sep 2, 2022 at 3:29 AM Tyler Ng wrote: > > > > This commit adds most of an implementation of the OpenTitan Always-On > > Timer. The documentation for this timer is found here: > > > > https://docs.

Re: [PATCH 3/4] hw/timer: ibex_timer.c: Update register addresses

2022-09-08 Thread Tyler Ng
On Thu, Sep 8, 2022 at 4:56 AM Alistair Francis wrote: > On Fri, Sep 2, 2022 at 3:24 AM Tyler Ng wrote: > > > > Updates the register addresses to match the OpenTitan spec. > > > > These changes were made in this commit: > > > https:/