From: Peter Maydell <peter.maydell@linaro.org>
To: Hao Wu <wuhaotsh@google.com>
Cc: Patrick Venture <venture@google.com>,
Havard Skinnemoen <hskinnemoen@google.com>,
QEMU Developers <qemu-devel@nongnu.org>,
CS20 KFTing <kfting@nuvoton.com>, qemu-arm <qemu-arm@nongnu.org>,
IS20 Avi Fishman <Avi.Fishman@nuvoton.com>,
Doug Evans <dje@google.com>
Subject: Re: [PATCH 2/4] hw/misc: Add NPCM7XX MFT Module
Date: Thu, 11 Mar 2021 12:07:18 +0000 [thread overview]
Message-ID: <CAFEAcA_q0WW_1FA_2McFB-o3cC_XWDEZJsw3C+zj4057L9YpDg@mail.gmail.com> (raw)
In-Reply-To: <20210305183857.3120188-3-wuhaotsh@google.com>
On Fri, 5 Mar 2021 at 18:40, Hao Wu <wuhaotsh@google.com> wrote:
>
> This patch adds Multi Function Timer (MFT) module for NPCM7XX Soc.
> This module is mainly used to configure PWM fans. It has just enough
> functionality to make the PWM fan kernel module work.
>
> The module takes two input, the max_rpm of a fan (modifiable via QMP)
> and duty cycle (a GPIO from the PWM module.) The actual measured RPM
> is equal to max_rpm * duty_cycle / NPCM7XX_PWM_MAX_DUTY. The RPM is
> measured as a counter compared to a prescaled input clock. The kernel
> driver reads this counter and report to user space.
>
> Refs:
> https://github.com/torvalds/linux/blob/master/drivers/hwmon/npcm750-pwm-fan.c
>
> Reviewed-by: Doug Evans <dje@google.com>
> Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
> Signed-off-by: Hao Wu <wuhaotsh@google.com>
> ---
> docs/system/arm/nuvoton.rst | 2 +-
> hw/arm/npcm7xx.c | 45 ++-
> hw/misc/meson.build | 1 +
> hw/misc/npcm7xx_mft.c | 541 ++++++++++++++++++++++++++++++++++
> hw/misc/trace-events | 8 +
> include/hw/arm/npcm7xx.h | 2 +
> include/hw/misc/npcm7xx_mft.h | 70 +++++
> 7 files changed, 660 insertions(+), 9 deletions(-)
> create mode 100644 hw/misc/npcm7xx_mft.c
> create mode 100644 include/hw/misc/npcm7xx_mft.h
Can you split "implement new device" and "add new device to board"
into separate patches, please?
> +static void npcm7xx_mft_init(Object *obj)
> +{
> + NPCM7xxMFTState *s = NPCM7XX_MFT(obj);
> + SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
> + DeviceState *dev = DEVICE(obj);
> +
> + memory_region_init_io(&s->iomem, obj, &npcm7xx_mft_ops, s,
> + TYPE_NPCM7XX_MFT, 4 * KiB);
> + sysbus_init_mmio(sbd, &s->iomem);
> + sysbus_init_irq(sbd, &s->irq);
> + s->clock_in = qdev_init_clock_in(dev, "clock-in",
> + npcm7xx_mft_update_clock, s);
You'll need to update this for the change to the Clock API that's
now in master, I'm afraid.
(You'll also find some conflicts in the docs and in the board .c file
when you rebase now the ethernet device patchset has landed, but those
are easy to fix.)
thanks
-- PMM
next prev parent reply other threads:[~2021-03-11 12:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 18:38 [PATCH 0/4] hw/misc: Add NPCM7XX Tachometer Device Hao Wu via
2021-03-05 18:38 ` [PATCH 1/4] hw/misc: Add GPIOs for duty in NPCM7xx PWM Hao Wu via
2021-03-11 12:05 ` Peter Maydell
2021-03-05 18:38 ` [PATCH 2/4] hw/misc: Add NPCM7XX MFT Module Hao Wu via
2021-03-11 12:07 ` Peter Maydell [this message]
2021-03-05 18:38 ` [PATCH 3/4] hw/arm: Connect PWM fans in NPCM7XX boards Hao Wu via
2021-03-11 12:08 ` Peter Maydell
2021-03-05 18:38 ` [PATCH 4/4] tests/qtest: Test PWM fan RPM using MFT in PWM test Hao Wu via
2021-03-11 12:09 ` Peter Maydell
2021-03-05 19:00 ` [PATCH 0/4] hw/misc: Add NPCM7XX Tachometer Device no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA_q0WW_1FA_2McFB-o3cC_XWDEZJsw3C+zj4057L9YpDg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=Avi.Fishman@nuvoton.com \
--cc=dje@google.com \
--cc=hskinnemoen@google.com \
--cc=kfting@nuvoton.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=venture@google.com \
--cc=wuhaotsh@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.