Skip to content

hw/arm: Add NPCM7XX Tachometer Device

Hao Wu qemu-arm qemu-devel 1 version Applied

Status from this message: Applied to target-arm.next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest5 patches 7 repliesApplied

Changes in v2 from the cover letter

- Split implementation of device and addition to board file to separate patches
- Adapt to new Clock API and address conflicts
- Use the new clock_ns_to_ticks API to calculate tachometer counts

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5hw/misc: Add GPIOs for duty in NPCM7xx PWMhw/misc/npcm7xx_pwm.c include/hw/misc/npcm7xx_pwm.h+7 -10 replies
2/5hw/misc: Add NPCM7XX MFT Modulehw/misc/meson.build hw/misc/npcm7xx_mft.c hw/misc/trace-events +1 more+619 -00 replies
3/5hw/arm: Add MFT device to NPCM7xx Socdocs/system/arm/nuvoton.rst hw/arm/npcm7xx.c include/hw/arm/npcm7xx.h+40 -90 replies
4/5hw/arm: Connect PWM fans in NPCM7XX boardshw/arm/npcm7xx_boards.c include/hw/arm/npcm7xx.h+109 -10 replies
5/5tests/qtest: Test PWM fan RPM using MFT in PWM testtests/qtest/npcm7xx_pwm-test.c+199 -61 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchDoug EvansTyrone TingPeter Maydell
1/5R-b R-b R-b
2/5R-b R-b
3/5R-b R-b
4/5R-b R-b R-b
5/5R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/5] hw/arm: Add NPCM7XX Tachometer Device

This patch set implements the Tachometer (a.k.a Multi Functional Timer/MFT) device in NPCM7XX SoC. This device is used by NPCM7XX boards to measure the RPM of PWM fans.

To provide the RPM of a certain fan, since RPM = MAX_RPM * duty_percentage. We convert the duty output in NPCM7XX PWM module into GPIOs and feed them into the MFT module.

The connection of PWM modules and fan modules are derived from their specific Linux device trees and coded in hw/arm/npcm7xx_boards.c.

We amend the QTest for the PWM module to include verifying the reading from the Tachometer is correct.

Changes since v1:
- Split implementation of device and addition to board file to separate patches
- Adapt to new Clock API and address conflicts
- Use the new clock_ns_to_ticks API to calculate tachometer counts

Hao Wu (5):
hw/misc: Add GPIOs for duty in NPCM7xx PWM hw/misc: Add NPCM7XX MFT Module
hw/arm: Add MFT device to NPCM7xx Soc hw/arm: Connect PWM fans in NPCM7XX boards tests/qtest: Test PWM fan RPM using MFT in PWM test

 docs/system/arm/nuvoton.rst    |   2 +-
 hw/arm/npcm7xx.c               |  45 ++-
 hw/arm/npcm7xx_boards.c        |  99 ++++++
 hw/misc/meson.build            |   1 +
 hw/misc/npcm7xx_mft.c          | 540 +++++++++++++++++++++++++++++++++
 hw/misc/npcm7xx_pwm.c          |   4 +
 hw/misc/trace-events           |   8 +
 include/hw/arm/npcm7xx.h       |  13 +-
 include/hw/misc/npcm7xx_mft.h  |  70 +++++
 include/hw/misc/npcm7xx_pwm.h  |   4 +-
 tests/qtest/npcm7xx_pwm-test.c | 205 ++++++++++++-
 11 files changed, 974 insertions(+), 17 deletions(-)
 create mode 100644 hw/misc/npcm7xx_mft.c
 create mode 100644 include/hw/misc/npcm7xx_mft.h
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog