From: "Cédric Le Goater" <clg@kaod.org>
To: Peter Delevoryas <peter@pjd.dev>
Cc: <patrick@stwcx.xyz>, <peter.maydell@linaro.org>,
<andrew@aj.id.au>, <joel@jms.id.au>, <hskinnemoen@google.com>,
<kfting@nuvoton.com>, <qemu-arm@nongnu.org>,
<qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/6] hw/nvram/eeprom_at24c: Add header w/ init helper
Date: Mon, 16 Jan 2023 12:13:34 +0100 [thread overview]
Message-ID: <3413fbee-f200-2b4b-4132-1bac82d1fdbd@kaod.org> (raw)
In-Reply-To: <20230114170151.87833-2-peter@pjd.dev>
On 1/14/23 18:01, Peter Delevoryas wrote:
> Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Please add some short commit log explaining how the helper could be useful.
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> hw/nvram/eeprom_at24c.c | 10 ++++++++++
> include/hw/nvram/eeprom_at24c.h | 10 ++++++++++
> 2 files changed, 20 insertions(+)
> create mode 100644 include/hw/nvram/eeprom_at24c.h
>
> diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c
> index 2d4d8b952f38..0c27eae2b354 100644
> --- a/hw/nvram/eeprom_at24c.c
> +++ b/hw/nvram/eeprom_at24c.c
> @@ -12,6 +12,7 @@
> #include "qapi/error.h"
> #include "qemu/module.h"
> #include "hw/i2c/i2c.h"
> +#include "hw/nvram/eeprom_at24c.h"
> #include "hw/qdev-properties.h"
> #include "hw/qdev-properties-system.h"
> #include "sysemu/block-backend.h"
> @@ -128,6 +129,15 @@ int at24c_eeprom_send(I2CSlave *s, uint8_t data)
> return 0;
> }
>
> +void at24c_eeprom_init(I2CBus *bus, uint8_t address, uint32_t rom_size)
> +{
> + I2CSlave *i2c_dev = i2c_slave_new("at24c-eeprom", address);
> + DeviceState *dev = DEVICE(i2c_dev);
> +
> + qdev_prop_set_uint32(dev, "rom-size", rom_size);
> + i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort);
> +}
> +
> static void at24c_eeprom_realize(DeviceState *dev, Error **errp)
> {
> EEPROMState *ee = AT24C_EE(dev);
> diff --git a/include/hw/nvram/eeprom_at24c.h b/include/hw/nvram/eeprom_at24c.h
> new file mode 100644
> index 000000000000..9d9cf212757c
> --- /dev/null
> +++ b/include/hw/nvram/eeprom_at24c.h
> @@ -0,0 +1,10 @@
> +/* Copyright (c) Meta Platforms, Inc. and affiliates. */
> +
> +#ifndef EEPROM_AT24C_H
> +#define EEPROM_AT24C_H
> +
> +#include "hw/i2c/i2c.h"
> +
> +void at24c_eeprom_init(I2CBus *bus, uint8_t address, uint32_t rom_size);
> +
> +#endif
next prev parent reply other threads:[~2023-01-16 11:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-14 17:01 [PATCH 0/6] hw/nvram/eeprom_at24c: Cleanup + FRUID EEPROM init example Peter Delevoryas
2023-01-14 17:01 ` [PATCH 1/6] hw/nvram/eeprom_at24c: Add header w/ init helper Peter Delevoryas
2023-01-16 11:13 ` Cédric Le Goater [this message]
2023-01-16 12:23 ` Philippe Mathieu-Daudé
2023-01-16 17:21 ` Peter Delevoryas
2023-01-14 17:01 ` [PATCH 2/6] hw/arm/aspeed: Remove local copy of at24c_eeprom_init Peter Delevoryas
2023-01-16 11:13 ` Cédric Le Goater
2023-01-16 12:24 ` Philippe Mathieu-Daudé
2023-01-16 17:21 ` Peter Delevoryas
2023-01-14 17:01 ` [PATCH 3/6] hw/arm/aspeed: Replace aspeed_eeprom_init with at24c_eeprom_init Peter Delevoryas
2023-01-16 11:14 ` Cédric Le Goater
2023-01-16 12:25 ` Philippe Mathieu-Daudé
2023-01-14 17:01 ` [PATCH 4/6] hw/arm/npcm7xx: Remove local copy of at24c_eeprom_init Peter Delevoryas
2023-01-16 11:14 ` Cédric Le Goater
2023-01-16 12:26 ` Philippe Mathieu-Daudé
2023-01-14 17:01 ` [PATCH 5/6] hw/nvram/eeprom_at24c: Add I2C write helper Peter Delevoryas
2023-01-14 17:01 ` [PATCH 6/6] hw/arm/aspeed: Init fby35 BMC FRUID EEPROM Peter Delevoryas
2023-01-16 12:30 ` Philippe Mathieu-Daudé
2023-01-16 17:23 ` Peter Delevoryas
2023-01-17 6:47 ` Philippe Mathieu-Daudé
2023-01-17 17:49 ` Peter Delevoryas
2023-01-16 12:42 ` Cédric Le Goater
2023-01-16 17:19 ` Peter Delevoryas
2023-01-14 17:07 ` [PATCH 0/6] hw/nvram/eeprom_at24c: Cleanup + FRUID EEPROM init example Peter Delevoryas
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=3413fbee-f200-2b4b-4132-1bac82d1fdbd@kaod.org \
--to=clg@kaod.org \
--cc=andrew@aj.id.au \
--cc=hskinnemoen@google.com \
--cc=joel@jms.id.au \
--cc=kfting@nuvoton.com \
--cc=patrick@stwcx.xyz \
--cc=peter.maydell@linaro.org \
--cc=peter@pjd.dev \
--cc=qemu-arm@nongnu.org \
--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).