qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable
@ 2019-12-19 18:51 Philippe Mathieu-Daudé
  2019-12-19 18:51 ` [PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition Philippe Mathieu-Daudé
                   ` (13 more replies)
  0 siblings, 14 replies; 20+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-19 18:51 UTC (permalink / raw)
  To: qemu-devel, Niek Linnenbank
  Cc: Beniamino Galvani, Peter Maydell, qemu-arm,
	Philippe Mathieu-Daudé

Hi,

Niek added the H3 SoC in [1] and noticed in [2] the timer
controller is very similar (less timers, watchdog register
placed at different address).

On 12/18/19 9:14 PM, Niek Linnenbank wrote:
> Actually, I copied the timer support code from the existing cubieboard.c
> that has
> the Allwinner A10, so potentially the same problem is there.
>
> While looking more closer at this part, I now also discovered that the
> timer module from the Allwinner H3 is
> mostly a stripped down version of the timer module in the Allwinner A10:
>
>    Allwinner A10, 10.2 Timer Register List, page 85:
> https://linux-sunxi.org/images/1/1e/Allwinner_A10_User_manual_V1.5.pdf
>
> The A10 version has six timers, where the H3 has only two. That should
> be fine I would say, the guest would simply
> use those available on H3 and ignore the rest. There is however one
> conflicting difference: the WDOG0 registers in the Allwinner H3 start
> at a different offset and are also different. The current A10 timer does
> not currently implement the watchdog part.
[...]
> So in my opinion its a bit of a trade off here: we can keep it like this
> and re-use the A10 timer for now, and perhaps
> attempt to generalize that module for proper use in both SoCs. Or we can
> introduce a new H3 specific timer module.
> What do you think?

As an answer to his question, this series is to help him to
reuse the A10 timer controller instead of adding a new model
to the codebase.

[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg665532.html
[2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg666304.html

Philippe Mathieu-Daudé (13):
  hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition
  hw/timer/allwinner: Add AW_PIT_TIMER_MAX definition
  hw/timer/allwinner: Remove unused definitions
  hw/timer/allwinner: Move definitions from header to source
  hw/timer/allwinner: Rename the ptimer field
  hw/timer/allwinner: Rename 'timer_context' as 'timer'
  hw/timer/allwinner: Move timer specific fields into AwA10TimerContext
  hw/timer/allwinner: Add a timer_count field
  hw/timer/allwinner: Rename AwA10TimerContext as AllwinnerTmrState
  hw/timer/allwinner: Rename AwA10PITState as AllwinnerTmrCtrlState
  hw/timer/allwinner: Introduce TYPE_AW_COMMON_PIT abstract device
  hw/timer/allwinner: Rename AW_A10_PIT() as AW_TIMER_CTRL()
  hw/timer/allwinner: Rename functions not specific to the A10 SoC

 include/hw/arm/allwinner-a10.h       |   2 +-
 include/hw/timer/allwinner-a10-pit.h |  54 ++----
 hw/timer/allwinner-a10-pit.c         | 271 +++++++++++++++++----------
 3 files changed, 192 insertions(+), 135 deletions(-)

-- 
2.21.0



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

end of thread, other threads:[~2019-12-20 21:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 18:51 [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable Philippe Mathieu-Daudé
2019-12-19 18:51 ` [PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition Philippe Mathieu-Daudé
2019-12-20 21:19   ` Niek Linnenbank
2019-12-19 18:51 ` [PATCH 02/13] hw/timer/allwinner: Add AW_PIT_TIMER_MAX definition Philippe Mathieu-Daudé
2019-12-20 21:27   ` Niek Linnenbank
2019-12-19 18:51 ` [PATCH 03/13] hw/timer/allwinner: Remove unused definitions Philippe Mathieu-Daudé
2019-12-20 21:36   ` Niek Linnenbank
2019-12-19 18:51 ` [PATCH 04/13] hw/timer/allwinner: Move definitions from header to source Philippe Mathieu-Daudé
2019-12-20 21:41   ` Niek Linnenbank
2019-12-19 18:51 ` [RFC PATCH 05/13] hw/timer/allwinner: Rename the ptimer field Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 06/13] hw/timer/allwinner: Rename 'timer_context' as 'timer' Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 07/13] hw/timer/allwinner: Move timer specific fields into AwA10TimerContext Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 08/13] hw/timer/allwinner: Add a timer_count field Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 09/13] hw/timer/allwinner: Rename AwA10TimerContext as AllwinnerTmrState Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 10/13] hw/timer/allwinner: Rename AwA10PITState as AllwinnerTmrCtrlState Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 11/13] hw/timer/allwinner: Introduce TYPE_AW_COMMON_PIT abstract device Philippe Mathieu-Daudé
2019-12-20 21:11   ` Niek Linnenbank
2019-12-19 18:51 ` [RFC PATCH 12/13] hw/timer/allwinner: Rename AW_A10_PIT() as AW_TIMER_CTRL() Philippe Mathieu-Daudé
2019-12-19 18:51 ` [RFC PATCH 13/13] hw/timer/allwinner: Rename functions not specific to the A10 SoC Philippe Mathieu-Daudé
2019-12-20 20:53 ` [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable Niek Linnenbank

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).