OSDN Git Service

hw/misc: Add a PWM module for NPCM7XX
authorHao Wu <wuhaotsh@google.com>
Fri, 8 Jan 2021 19:09:43 +0000 (11:09 -0800)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 12 Jan 2021 21:19:02 +0000 (21:19 +0000)
commit1e943c586a03f049be8f4080376884f1d4971592
tree5df8d59f75628e620ad4321b40076407c5f39545
parent77c05b0b746119a78bffb595b0313d39ac6b20fc
hw/misc: Add a PWM module for NPCM7XX

The PWM module is part of NPCM7XX module. Each NPCM7XX module has two
identical PWM modules. Each module contains 4 PWM entries. Each PWM has
two outputs: frequency and duty_cycle. Both are computed using inputs
from software side.

This module does not model detail pulse signals since it is expensive.
It also does not model interrupts and watchdogs that are dependant on
the detail models. The interfaces for these are left in the module so
that anyone in need for these functionalities can implement on their
own.

The user can read the duty cycle and frequency using qom-get command.

Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20210108190945.949196-5-wuhaotsh@google.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
docs/system/arm/nuvoton.rst
hw/arm/npcm7xx.c
hw/misc/meson.build
hw/misc/npcm7xx_pwm.c [new file with mode: 0644]
hw/misc/trace-events
include/hw/arm/npcm7xx.h
include/hw/misc/npcm7xx_pwm.h [new file with mode: 0644]