All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Make WDOGCONTROL.INTEN the counter enable of the CMSDK APB Watchdog
@ 2024-11-15 16:03 Roque Arcudia Hernandez
  2024-11-15 16:03 ` [PATCH 1/5] hw/watchdog/cmsdk_apb_watchdog: Fix broken link Roque Arcudia Hernandez
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Roque Arcudia Hernandez @ 2024-11-15 16:03 UTC (permalink / raw)
  To: peter.maydell, farosas, lvivier, slongfield, komlodi, pbonzini,
	venture
  Cc: qemu-devel, qemu-arm, Roque Arcudia Hernandez

The following patchset tries to address an issue where the watchdog
counter was running as soon as the device is out of reset. This
created a few problems with the firmware under test. It was pointed
out that the firmware under test was already working on an emulator
using the real RTL. Further review showed that the WDOGCONTROL.INTEN
is also expected to be the counter enable as it is defined in this
page from ARM:

https://developer.arm.com/documentation/ddi0479/d/apb-components/apb-watchdog/programmers-model?lang=en

     |       | Enable the interrupt event, WDOGINT. Set to 1 to
     |       | enable the counter and the interrupt, or to 0 to
 [0] | INTEN | disable the counter and interrupt. Reloads the
     |       | counter from the value in WDOGLOAD when the interrupt
     |       | is enabled, after previously being disabled.

The second half of the patch is focused on adding tests for this
behavior. It was required to modify the test to be able to run some
test cases in the MPS2 since the the stellaris machine had 2 issues:

  - The stellaris machine did not run the counter out of reset
    because of the way it is reset. The function
    ssys_calculate_system_clock is not called until the reset phase
    stellaris_sys_reset_hold which is after the watchdog executes its
    reset, so the watchdog would not start the counter due to the
    clock not being set up at the time of reset.

  - The Stellaris machine uses a derived watchdog and not the
    original CMSDK one which has a special behavior where it cannot
    be stopped.

The MPS2 machine on the other hand uses the standard CMSDK watchdog
and could expose the problems we were dealing with.

Roque Arcudia Hernandez (5):
  hw/watchdog/cmsdk_apb_watchdog: Fix broken link
  hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues
  tests/qtest/cmsdk-apb-watchdog-test: Parameterize tests
  tests/qtest/cmsdk-apb-watchdog-test: Don't abort on assertion failure
  tests/qtest/cmsdk-apb-watchdog-test: Test INTEN as counter enable

 hw/watchdog/cmsdk-apb-watchdog.c      |  38 ++-
 tests/qtest/cmsdk-apb-watchdog-test.c | 328 +++++++++++++++++++++++---
 tests/qtest/meson.build               |   3 +-
 3 files changed, 329 insertions(+), 40 deletions(-)

-- 
2.47.0.338.g60cca15819-goog


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-18 13:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15 16:03 [PATCH 0/5] Make WDOGCONTROL.INTEN the counter enable of the CMSDK APB Watchdog Roque Arcudia Hernandez
2024-11-15 16:03 ` [PATCH 1/5] hw/watchdog/cmsdk_apb_watchdog: Fix broken link Roque Arcudia Hernandez
2024-11-15 16:36   ` Philippe Mathieu-Daudé
2024-11-15 16:03 ` [PATCH 2/5] hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues Roque Arcudia Hernandez
2024-11-15 16:03 ` [PATCH 3/5] tests/qtest/cmsdk-apb-watchdog-test: Parameterize tests Roque Arcudia Hernandez
2024-11-15 16:03 ` [PATCH 4/5] tests/qtest/cmsdk-apb-watchdog-test: Don't abort on assertion failure Roque Arcudia Hernandez
2024-11-15 16:03 ` [PATCH 5/5] tests/qtest/cmsdk-apb-watchdog-test: Test INTEN as counter enable Roque Arcudia Hernandez
2024-11-15 17:21 ` [PATCH 0/5] Make WDOGCONTROL.INTEN the counter enable of the CMSDK APB Watchdog Roque Arcudia Hernandez
2024-11-15 17:25   ` Peter Maydell
2024-11-18 13:20 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.