qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com
Subject: Re: [PATCHv3 02/13] hw/arm/fsl-imx8mm: Implemented CCM(Clock Control Module) and Analog IP
Date: Mon, 1 Dec 2025 20:52:16 +0000	[thread overview]
Message-ID: <CAFEAcA8WHgKtPPVQKNSRV2R5xVPCZ3vNxQgy9rcVu=ECrxNE2Q@mail.gmail.com> (raw)
In-Reply-To: <20251119130027.3312971-3-gaurav.sharma_7@nxp.com>

On Wed, 19 Nov 2025 at 13:00, Gaurav Sharma <gaurav.sharma_7@nxp.com> wrote:
>
> Implemented Analog device model
> Implemented CCM device model
>
> Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>

Can I ask you to split this one up a bit more, please? Where
we add a new device, this should be two patches:
 (1) implement the new device
 (2) add the device to the relevant SoC or board

In this case we have two distinct devices, so unless there's
some reason I missed they should be separate patches, which
would make 4 in total.

But: why do we need a new imx8mm_ccm device ? I did a diff
against our existing imx8mp_ccm source files, and unless
I missed something, they're exactly identical apart from
changing function names etc from 'mp' to 'mm'. Can we just
use the existing device we have ?

The analog devices also look very similar. In this case there
is a tiny difference in the ANALOG_ARM_PLL_FDIV_CTL0 value.
But unless we expect these devices to diverge a lot in
functionality we haven't yet implemented, this kind of
"almost the same device with minor tweaks" is better done
by some other method than "copy and paste the source for the
entire device". A couple of options:

 * you can have an abstract base class, which the different
   variants inherit from, with the shared functionality in
   the base class. hw/char/stm32l4x5_usart.c is an example.

 * you can have one device, with some properties that the
   SoC sets to configure it. hw/misc/mps2-scc.c is an
   example of this, with uint32 properties for some config
   and ID register reset values.

 * you can have one device, with a single property for
   "revision of this h/w" which then drives several different
   unrelated behaviour differences. hw/misc/iotkit-sectl.c
   does this.

Based on the differences I've seen here (i.e. only one
register value is different), I would suggest the "uint32
properties for register reset values that differ" approach.
But you might think one of the other options is more
suitable based on better knowledge of the actual hardware
than I have.

thanks
-- PMM


  reply	other threads:[~2025-12-01 20:53 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 13:00 [PATCHv3 00/13] Adding comprehensive support for i.MX8MM EVK board Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 01/13] hw/arm: Add the i.MX 8MM EVK(Evaluation Kit) board Gaurav Sharma
2025-12-02  9:59   ` Peter Maydell
2025-12-02 10:33     ` [EXT] " Gaurav Sharma
2025-12-02 10:46       ` Peter Maydell
2025-12-02 11:09         ` Gaurav Sharma
2025-12-02 11:42   ` Bernhard Beschow
2025-12-02 15:10     ` [EXT] " Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 02/13] hw/arm/fsl-imx8mm: Implemented CCM(Clock Control Module) and Analog IP Gaurav Sharma
2025-12-01 20:52   ` Peter Maydell [this message]
2025-12-02  9:32     ` [EXT] " Gaurav Sharma
2025-12-02  9:47       ` Peter Maydell
2025-12-02  9:50         ` Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 03/13] hw/arm/fsl-imx8mm: Implemented support for SNVS Gaurav Sharma
2025-12-01 20:27   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 04/13] hw/arm/fsl-imx8mm: Adding support for USDHC storage controllers Gaurav Sharma
2025-12-01 20:30   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 05/13] hw/arm/fsl-imx8mm: Add PCIe support Gaurav Sharma
2025-12-01 20:28   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 06/13] hw/arm/fsl-imx8mm: Add GPIO controllers Gaurav Sharma
2025-12-01 20:28   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 07/13] hw/arm/fsl-imx8mm: Adding support for I2C emulation Gaurav Sharma
2025-12-01 20:29   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 08/13] hw/arm/fsl-imx8mm: Adding support for SPI controller Gaurav Sharma
2025-12-01 20:30   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 09/13] hw/arm/fsl-imx8mm: Adding support for Watchdog Timers Gaurav Sharma
2025-12-01 20:31   ` Peter Maydell
2025-12-02  5:27     ` [EXT] " Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 10/13] hw/arm/fsl-imx8mm: Adding support for General Purpose Timers Gaurav Sharma
2025-12-01 20:33   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 11/13] hw/arm/fsl-imx8mm: Adding support for ENET ethernet controller Gaurav Sharma
2025-12-01 20:33   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 12/13] hw/arm/fsl-imx8mm: Adding support for USB controller Gaurav Sharma
2025-12-01 20:34   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation Gaurav Sharma
2025-11-25  5:22 ` [PATCHv3 00/13] Adding comprehensive support for i.MX8MM EVK board Gaurav Sharma
2025-12-01 20:19   ` Peter Maydell
2025-12-02  5:19     ` [EXT] " Gaurav Sharma
2025-12-02  9:43       ` Peter Maydell
2025-12-02  9:46         ` Gaurav Sharma

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='CAFEAcA8WHgKtPPVQKNSRV2R5xVPCZ3vNxQgy9rcVu=ECrxNE2Q@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=gaurav.sharma_7@nxp.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 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).