[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/5] tests/qtest: Test PWM fan RPM using MFT in PWM test
From: |
Peter Maydell |
Subject: |
Re: [PATCH v2 5/5] tests/qtest: Test PWM fan RPM using MFT in PWM test |
Date: |
Sun, 14 Mar 2021 13:18:06 +0000 |
On Thu, 11 Mar 2021 at 18:09, Hao Wu <wuhaotsh@google.com> wrote:
>
> This patch adds testing of PWM fan RPMs in the existing npcm7xx pwm
> test. It tests whether the MFT module can measure correct fan values
> for a PWM fan in NPCM7XX boards.
>
> Reviewed-by: Doug Evans <dje@google.com>
> Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
> Signed-off-by: Hao Wu <wuhaotsh@google.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> +static void mft_verify_rpm(QTestState *qts, const TestData *td, uint64_t
> duty)
> +{
> + int index = mft_compute_index(td);
> + uint16_t cnt, cr;
> + uint32_t rpm = DEFAULT_RPM * duty / MAX_DUTY;
> + uint64_t clk = read_pclk(qts, true);
> + int32_t expected_cnt = mft_compute_cnt(rpm, clk);
> +
> + qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic");
> + g_test_message(
> + "verifying rpm for mft[%d]: clk: %lu, duty: %lu, rpm: %u, cnt: %d",
> + index, clk, duty, rpm, expected_cnt);
Hi -- this won't build on 32-bit hosts (or on OSX, and it warns on OpenBSD),
because uint64_t and 'long' aren't the same thing. You need to use the
PRIu64 etc macros when printing uint64_t values, so the argument type and
the format string match.
I've fixed this up in the pullreq.
thanks
-- PMM
- [PATCH v2 0/5] hw/arm: Add NPCM7XX Tachometer Device, Hao Wu, 2021/03/11
- [PATCH v2 1/5] hw/misc: Add GPIOs for duty in NPCM7xx PWM, Hao Wu, 2021/03/11
- [PATCH v2 2/5] hw/misc: Add NPCM7XX MFT Module, Hao Wu, 2021/03/11
- [PATCH v2 3/5] hw/arm: Add MFT device to NPCM7xx Soc, Hao Wu, 2021/03/11
- [PATCH v2 4/5] hw/arm: Connect PWM fans in NPCM7XX boards, Hao Wu, 2021/03/11
- [PATCH v2 5/5] tests/qtest: Test PWM fan RPM using MFT in PWM test, Hao Wu, 2021/03/11
- Re: [PATCH v2 5/5] tests/qtest: Test PWM fan RPM using MFT in PWM test,
Peter Maydell <=
- Re: [PATCH v2 0/5] hw/arm: Add NPCM7XX Tachometer Device, Peter Maydell, 2021/03/12