[PATCH v3 4/6] qtest: bail from irq_intercept_in if name is specified

2023-07-28 Thread Chris Laplante
Named interception of in-GPIOs is not supported yet. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- softmmu/qtest.c | 8 1 file changed, 8 insertions(+) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 0f1d478bda..66757ba261 100644 --- a/softmmu/qtest.c +++ b

[PATCH v3 3/6] qtest: implement named interception of out-GPIO

2023-07-28 Thread Chris Laplante
Adds qtest_irq_intercept_out_named method, which utilizes a new optional name parameter to the irq_intercept_out qtest command. Signed-off-by: Chris Laplante --- softmmu/qtest.c| 18 ++ tests/qtest/libqtest.c | 6 ++ tests/qtest/libqtest.h | 11 +++ 3 files

[PATCH v3 5/6] qtest: irq_intercept_[out/in]: return FAIL if no intercepts are installed

2023-07-28 Thread Chris Laplante
This is much better than just silently failing with OK. Signed-off-by: Chris Laplante --- softmmu/qtest.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 66757ba261..35b643a274 100644 --- a/softmmu/qtest.c +++ b/softmmu

[PATCH v3 2/6] qtest: factor out qtest_install_gpio_out_intercept

2023-07-28 Thread Chris Laplante
Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- softmmu/qtest.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index f8d764b719..1b86489162 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -365,6 +365,15

[PATCH v3 0/6] Add nRF51 DETECT signal with test

2023-07-28 Thread Chris Laplante
le named out-GPIOs, not just one (Peter) Chris Laplante (6): hw/gpio/nrf51: implement DETECT signal qtest: factor out qtest_install_gpio_out_intercept qtest: implement named interception of out-GPIO qtest: bail from irq_intercept_in if name is specified qtest: irq_intercept_[out/in]: retu

[PATCH v3 6/6] qtest: microbit-test: add tests for nRF51 DETECT

2023-07-28 Thread Chris Laplante
Exercise the DETECT mechanism of the GPIO peripheral. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- tests/qtest/microbit-test.c | 42 + 1 file changed, 42 insertions(+) diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c

[PATCH v3 1/6] hw/gpio/nrf51: implement DETECT signal

2023-07-28 Thread Chris Laplante
see a reason to model these. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- hw/gpio/nrf51_gpio.c | 14 +- include/hw/gpio/nrf51_gpio.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/gpio/nrf51_gpio.c b/hw/gpio/nrf51_gpio.c index b47fd

Re: [PATCH 0/6] Add nRF51 DETECT signal with test

2023-07-27 Thread Chris Laplante
Hi Peter, > > 2. I also have some implementations for pieces of CLOCK, namely the > > HFCLKSTART/HFCLKSTOP events and HFCLKSTARTED event. Should I include that > > in this patch series, or would you prefer it in a separate series? It is > > unrelated to DETECT and POWER. > > > If you think th

Re: [PATCH v2 3/6] qtest: implement named interception of out-GPIO

2023-07-27 Thread Chris Laplante
> (g_strcmp0() can handle the NULL case without having > to special case it -- this is how qdev_get_named_gpio_list() > finds entries in the ngl list.) > > Apologies for not noticing that on the first round of review. No worries - it makes the code much simpler anyway. Should we bother factorin

[PATCH v2 5/6] qtest: irq_intercept_[out/in]: return FAIL if no intercepts are installed

2023-07-25 Thread Chris Laplante
This is much better than just silently failing with OK. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- softmmu/qtest.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 1719bbddc3..c9751f527f 100644 --- a

[PATCH v2 4/6] qtest: bail from irq_intercept_in if name is specified

2023-07-25 Thread Chris Laplante
Named interception of in-GPIOs is not supported yet. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- softmmu/qtest.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 7fd8546ed2..1719bbddc3 100644 --- a/softmmu

[PATCH v2 1/6] hw/gpio/nrf51: implement DETECT signal

2023-07-25 Thread Chris Laplante
see a reason to model these. Signed-off-by: Chris Laplante --- hw/gpio/nrf51_gpio.c | 14 +- include/hw/gpio/nrf51_gpio.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/gpio/nrf51_gpio.c b/hw/gpio/nrf51_gpio.c index b47fddf4ed..08396c69a4 100644 ---

[PATCH v2 6/6] qtest: microbit-test: add tests for nRF51 DETECT

2023-07-25 Thread Chris Laplante
Exercise the DETECT mechanism of the GPIO peripheral. Signed-off-by: Chris Laplante Reviewed-by: Peter Maydell --- tests/qtest/microbit-test.c | 42 + 1 file changed, 42 insertions(+) diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c

[PATCH v2 0/6] Add nRF51 DETECT signal with test

2023-07-25 Thread Chris Laplante
= v2: factor out qtest_install_gpio_out_intercept before usage (Peter) renamed qtest_install_gpio_out_intercepts => qtest_install_gpio_out_intercept don't pass DETECT to soc level (Peter) change qtest to use DETECT at GPIO level (Peter) Chris Laplante (6): hw/gpio/nrf51: imp

[PATCH v2 2/6] qtest: factor out qtest_install_gpio_out_intercept

2023-07-25 Thread Chris Laplante
Signed-off-by: Chris Laplante --- softmmu/qtest.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index f8d764b719..1c92e5a6a3 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -365,6 +365,15 @@ void qtest_set_command_cb

[PATCH v2 3/6] qtest: implement named interception of out-GPIO

2023-07-25 Thread Chris Laplante
Adds qtest_irq_intercept_out_named method, which utilizes a new optional name parameter to the irq_intercept_out qtest command. Signed-off-by: Chris Laplante --- softmmu/qtest.c| 24 tests/qtest/libqtest.c | 6 ++ tests/qtest/libqtest.h | 11 +++ 3

Re: [PATCH 0/6] Add nRF51 DETECT signal with test

2023-07-25 Thread Chris Laplante
> > 2. I also have some implementations for pieces of CLOCK, namely the > > HFCLKSTART/HFCLKSTOP events and HFCLKSTARTED event. Should I include that > > in this patch series, or would you prefer it in a separate series? It is > > unrelated to DETECT and POWER. > > > If you think they're ready

Re: [PATCH 5/6] qtest: irq_intercept_[out/in]: return FAIL if no intercepts are installed

2023-07-24 Thread Chris Laplante
> Makes sense. Did you do a 'make check' on an > all-targets-enabled build just to confirm we haven't > accidentally let any bogus uses of the command in while > it was returning OK for these cases? > > Reviewed-by: Peter Maydell peter.mayd...@linaro.org Yes, I just did a 'make check' and got:

Re: [PATCH 0/6] Add nRF51 DETECT signal with test

2023-07-24 Thread Chris Laplante
Hi Peter, > Thanks for this patchset and especially for the work > improving the qtest infrastructure. I've given my > comments on the different patches, and in some cases > reviewed-by tags. (Where I've given one of those, you should > add it to your commit message for the relevant patch under >

Thoughts on implementing SEGGER RTT

2023-07-17 Thread Chris Laplante
Hi all, SEGGER RTT (https://wiki.segger.com/RTT) is a software debug mechanism which, among other things, exposes convenient virtual terminals. It is implemented as ring buffers in RAM. There is a control block with a fixed ID so it can be located by the RTT viewer (which runs on your PC, for e

[PATCH 2/6] qtest: implement named interception of out-GPIO

2023-07-14 Thread Chris Laplante
Adds qtest_irq_intercept_out_named method, which utilizes a new optional name parameter to the irq_intercept_out qtest command. Signed-off-by: Chris Laplante --- softmmu/qtest.c| 39 ++- tests/qtest/libqtest.c | 6 ++ tests/qtest/libqtest.h | 11

[PATCH 5/6] qtest: irq_intercept_[out/in]: return FAIL if no intercepts are installed

2023-07-14 Thread Chris Laplante
This is much better than just silently failing with OK. Signed-off-by: Chris Laplante --- softmmu/qtest.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 051bbf4177..e888acb319 100644 --- a/softmmu/qtest.c +++ b/softmmu

[PATCH 6/6] qtest: microbit-test: add tests for nRF51 DETECT

2023-07-14 Thread Chris Laplante
Exercise the DETECT mechanism of the GPIO peripheral. Signed-off-by: Chris Laplante --- tests/qtest/microbit-test.c | 42 + 1 file changed, 42 insertions(+) diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c index 6022a92b6a..3c85adba37

[PATCH 4/6] qtest: factor out qtest_install_gpio_out_intercepts

2023-07-14 Thread Chris Laplante
Simplify the code a bit. Signed-off-by: Chris Laplante --- softmmu/qtest.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 74482ce3cd..051bbf4177 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -365,6

[PATCH 3/6] qtest: bail from irq_intercept_in if name is specified

2023-07-14 Thread Chris Laplante
Named interception of in-GPIOs is not supported yet. Signed-off-by: Chris Laplante --- softmmu/qtest.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 7c3dea5760..74482ce3cd 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c

[PATCH 0/6] Add nRF51 DETECT signal with test

2023-07-14 Thread Chris Laplante
;FAIL' responses when interception fails. Otherwise, it is frustrating to troubleshoot why calls to qtest_irq_intercept_out and friends appears to do nothing. Chris Laplante (6): hw/gpio/nrf51: implement DETECT signal qtest: implement named interception of out-GPIO qtest: bail from irq_inter

[PATCH 1/6] hw/gpio/nrf51: implement DETECT signal

2023-07-14 Thread Chris Laplante
see a reason to model these. Signed-off-by: Chris Laplante --- hw/arm/nrf51_soc.c | 1 + hw/gpio/nrf51_gpio.c | 14 +- include/hw/gpio/nrf51_gpio.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c

Re: Addition of qtest_irq_intercept_out_named, or modify qtest_irq_interrupt_out?

2023-07-09 Thread Chris Laplante
[sorry, resending because I forgot to reply-all] > qtest_irq_intercept_out() takes a QOM path argument. Whether it is > a named IRQ or not should be irrelevant at this layer. I'm a little confused about the QOM path. Currently the code in qtest_process_command() is calling object_resolve_path, b

Re: Emulation of 'System OFF' mode in ARM nRF51 SoCs

2023-07-06 Thread Chris Laplante
Hi Peter, > > > > Working on adding this now. One question - if the CPU is off (via > > arm_set_cpu_off), will the 'DETECT' IRQ I add to nrf51_gpio.c still fire? > > > Yes. The only thing that turning the CPU off affects is > the CPU -- all the rest of the devices in the system > continue to b

Addition of qtest_irq_intercept_out_named, or modify qtest_irq_interrupt_out?

2023-07-06 Thread Chris Laplante
Hello all, I have a test case that needs to intercept a named GPIO out interrupt. qtest_irq_intercept_out doesn't support this currently. I would like to send a patch to add this functionality. Does anyone have a preference if I implement it is a new function (qtest_irq_intercept_out_named), vs

Re: Emulation of 'System OFF' mode in ARM nRF51 SoCs

2023-07-01 Thread Chris Laplante
Hi Peter, > The reference manual is very unclear about what this "emulated > system off" mode actually does. I think that implementing > real "system off" is probably simpler. For that you should be able > to implement it something like this: > > (1) the power management device implements the SYS

Re: Emulation of 'System OFF' mode in ARM nRF51 SoCs

2023-07-01 Thread Chris Laplante
Hi Phil, > What problem are you getting with a single CPU? > The "arm/arm-powerctl.h" API should work well. > If you scheduled a timer, I expect it to awake > your CPU on expiration. You can also use a QMP > command to toggle a GPIO and trigger an IRQ. > > You can use the qtest API to test your c

Emulation of 'System OFF' mode in ARM nRF51 SoCs

2023-06-14 Thread Chris Laplante
Hi all, I am working on improving nRF51 emulation. Specifically I want to implement the special "System OFF" mode. System OFF is a power saving mode. In this mode, the system can only be woken up by a reset or a handful of peripherals (most notably, GPIO via high/low level detection on configur