qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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 3/6] hw/arm: Add I2C device tree for NPCM750 eval board
Date: Thu, 28 Jan 2021 17:32:32 +0000	[thread overview]
Message-ID: <CAFEAcA80eo9X1v180D6msDsgd7bEkLfuSNmxggKPF256jJqLBw@mail.gmail.com> (raw)
In-Reply-To: <20210126193237.1534208-4-wuhaotsh@google.com>

On Tue, 26 Jan 2021 at 19:32, Hao Wu <wuhaotsh@google.com> wrote:
>
> Add an I2C device tree for NPCM750 evaluation board.
>
> Reviewed-by: Doug Evans<dje@google.com>
> Reviewed-by: Tyrong Ting<kfting@nuvoton.com>
> Signed-off-by: Hao Wu <wuhaotsh@google.com>

Slightly confusing commit message, because "device tree"
usually means the data structure describing hardware for Linux
(https://www.kernel.org/doc/html/latest/devicetree/usage-model.html).

Something like "Create the I2C tmp105 temperature sensor devices"
would be clearer, I think.

> ---
>  hw/arm/npcm7xx_boards.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c
> index 3fdd5cab01..2d82f48848 100644
> --- a/hw/arm/npcm7xx_boards.c
> +++ b/hw/arm/npcm7xx_boards.c
> @@ -98,6 +98,20 @@ static NPCM7xxState *npcm7xx_create_soc(MachineState *machine,
>      return NPCM7XX(obj);
>  }
>
> +static I2CBus *npcm7xx_i2c_get_bus(NPCM7xxState *soc, uint32_t num)
> +{
> +    g_assert(num < ARRAY_SIZE(soc->smbus));
> +    return I2C_BUS(qdev_get_child_bus(DEVICE(&soc->smbus[num]), "i2c-bus"));
> +}
> +
> +static void npcm750_evb_i2c_init(NPCM7xxState *soc)
> +{
> +    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 0), "tmp105", 0x48);
> +    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 1), "tmp105", 0x48);
> +    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 2), "tmp105", 0x48);
> +    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 6), "tmp105", 0x48);

I assume these correspond to temperature sensors on the real board.
Might be worth having a comment saying what their function is
(I'm guessing they're measuring temperature of different bits of
the board somehow?)

> +}
> +
>  static void npcm750_evb_init(MachineState *machine)
>  {
>      NPCM7xxState *soc;
> @@ -108,6 +122,7 @@ static void npcm750_evb_init(MachineState *machine)
>
>      npcm7xx_load_bootrom(machine, soc);
>      npcm7xx_connect_flash(&soc->fiu[0], 0, "w25q256", drive_get(IF_MTD, 0, 0));
> +    npcm750_evb_i2c_init(soc);
>      npcm7xx_load_kernel(machine, soc);
>  }
>
> --
> 2.30.0.365.g02bc693789-goog

thanks
-- PMM


  reply	other threads:[~2021-01-28 17:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 19:32 [PATCH 0/6] hw/i2c: Add NPCM7XX SMBus Device wuhaotsh--- via
2021-01-26 19:32 ` [PATCH 1/6] hw/arm: Remove GPIO from unimplemented NPCM7XX wuhaotsh--- via
2021-01-26 19:32 ` [PATCH 2/6] hw/i2c: Implement NPCM7XX SMBus Module Single Mode wuhaotsh--- via
2021-01-26 23:00   ` Corey Minyard
2021-01-28 17:28   ` Peter Maydell
2021-01-26 19:32 ` [PATCH 3/6] hw/arm: Add I2C device tree for NPCM750 eval board wuhaotsh--- via
2021-01-28 17:32   ` Peter Maydell [this message]
2021-01-26 19:32 ` [PATCH 4/6] hw/arm: Add I2C device tree for Quanta GSJ wuhaotsh--- via
2021-01-26 23:05   ` Corey Minyard
2021-01-28 17:33   ` Peter Maydell
2021-01-26 19:32 ` [PATCH 5/6] hw/i2c: Add a QTest for NPCM7XX SMBus Device wuhaotsh--- via
2021-01-26 19:32 ` [PATCH 6/6] hw/i2c: Implement NPCM7XX SMBus Module FIFO Mode wuhaotsh--- via
2021-01-26 23:47   ` Corey Minyard
2021-01-27 20:37     ` wuhaotsh--- via
2021-01-27 21:42       ` Corey Minyard
2021-01-27 21:59         ` wuhaotsh--- via
2021-01-27 23:37           ` Corey Minyard
2021-01-28  5:36             ` Corey Minyard

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=CAFEAcA80eo9X1v180D6msDsgd7bEkLfuSNmxggKPF256jJqLBw@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 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).