qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Arun Kumar Kashinath Agasar" <arun.kka@samsung.com>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Klaus Jensen" <k.jensen@samsung.com>,
	qemu-devel@nongnu.org, "Jeremy Kerr" <jk@ozlabs.org>,
	qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"Padmakar Kalghatgi" <p.kalghatgi@samsung.com>,
	"Matt Johnston" <matt@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>
Subject: Re: [RFC PATCH 3/4] hw/i2c: add slave mode for aspeed_i2c
Date: Fri, 1 Apr 2022 08:30:14 +0200	[thread overview]
Message-ID: <Ykab9mR/B79iI916@apples> (raw)
In-Reply-To: <7300ef1f-8702-733d-2a50-4253345fde45@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]

On Mar 31 22:44, Philippe Mathieu-Daudé wrote:
> On 31/3/22 18:57, Klaus Jensen wrote:
> > From: Klaus Jensen <k.jensen@samsung.com>
> > 
> > Add slave mode functionality for the Aspeed I2C controller. This is
> > implemented by creating an Aspeed I2C Slave device that attaches to the
> > bus.
> > 
> > This i2c slave device only implements the asynchronous version of
> > i2c_send() and the event callback.
> > 
> > Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> > ---
> >   hw/i2c/aspeed_i2c.c         | 95 +++++++++++++++++++++++++++++++++----
> >   hw/i2c/trace-events         |  2 +-
> >   hw/misc/meson.build         |  2 +
> >   include/hw/i2c/aspeed_i2c.h |  8 ++++
> >   4 files changed, 97 insertions(+), 10 deletions(-)
> 
> > @@ -558,14 +565,19 @@ static void aspeed_i2c_bus_write(void *opaque, hwaddr offset,
> >               bus->controller->intr_status &= ~(1 << bus->id);
> >               qemu_irq_lower(aic->bus_get_irq(bus));
> >           }
> > -        if (handle_rx && (bus->cmd & (I2CD_M_RX_CMD | I2CD_M_S_RX_CMD_LAST))) {
> > -            aspeed_i2c_handle_rx_cmd(bus);
> > -            aspeed_i2c_bus_raise_interrupt(bus);
> > +
> > +        if (handle_rx) {
> > +            if (bus->cmd & (I2CD_M_RX_CMD | I2CD_M_S_RX_CMD_LAST)) {
> > +                aspeed_i2c_handle_rx_cmd(bus);
> > +                aspeed_i2c_bus_raise_interrupt(bus);
> 
> Eventually split this hunk into a separate patch to have better readability.
> 

Alright.

> > +            }
> >           }
> 
> > diff --git a/hw/misc/meson.build b/hw/misc/meson.build
> > index 6fb69612e064..c1c1abea41dd 100644
> > --- a/hw/misc/meson.build
> > +++ b/hw/misc/meson.build
> > @@ -122,6 +122,8 @@ softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_rng.c'))
> >   softmmu_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_ahb_apb_pnp.c'))
> > +softmmu_ss.add(when: 'CONFIG_I2C', if_true: files('i2c-echo.c'))
> 
> This change belongs to the next patch.

Woops. Chopping up my changes went a bit too fast I think :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-04-01  6:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 16:57 [RFC PATCH 0/4] hw/i2c: i2c slave mode support Klaus Jensen
2022-03-31 16:57 ` [RFC PATCH 1/4] hw/i2c: support multiple masters Klaus Jensen
2022-03-31 16:57 ` [RFC PATCH 2/4] hw/i2c: add async send Klaus Jensen
2022-03-31 16:57 ` [RFC PATCH 3/4] hw/i2c: add slave mode for aspeed_i2c Klaus Jensen
2022-03-31 20:44   ` Philippe Mathieu-Daudé
2022-04-01  6:30     ` Klaus Jensen [this message]
2022-04-06  6:14   ` Cédric Le Goater
2022-04-06  7:40     ` Klaus Jensen
2022-04-06  8:52       ` Cédric Le Goater
2022-04-06  9:16         ` Klaus Jensen
2022-04-06  9:44           ` Cédric Le Goater
2022-03-31 16:57 ` [RFC PATCH 4/4] hw/misc: add a toy i2c echo device Klaus Jensen
2022-03-31 20:32 ` [RFC PATCH 0/4] hw/i2c: i2c slave mode support Corey Minyard
2022-04-01  6:29   ` Klaus Jensen
2022-04-01  8:58     ` Damien Hedde
2022-04-01  9:05       ` Klaus Jensen
2022-04-01 13:06     ` Corey Minyard
2022-04-05 20:52 ` Peter Delevoryas
2022-04-06  6:07   ` Klaus Jensen
2022-04-06 17:03     ` Peter Delevoryas
2022-04-06 18:41       ` Klaus Jensen
2022-04-06 22:06         ` Peter Delevoryas
2022-05-06 14:07 ` Jonathan Cameron via
2022-05-06 16:49   ` Cédric Le Goater

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=Ykab9mR/B79iI916@apples \
    --to=its@irrelevant.dk \
    --cc=andrew@aj.id.au \
    --cc=arun.kka@samsung.com \
    --cc=clg@kaod.org \
    --cc=cminyard@mvista.com \
    --cc=jk@ozlabs.org \
    --cc=joel@jms.id.au \
    --cc=k.jensen@samsung.com \
    --cc=matt@codeconstruct.com.au \
    --cc=p.kalghatgi@samsung.com \
    --cc=peter.maydell@linaro.org \
    --cc=philippe.mathieu.daude@gmail.com \
    --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).