qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
To: Klaus Jensen <its@irrelevant.dk>, qemu-devel@nongnu.org
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>,
	"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: Thu, 31 Mar 2022 22:44:10 +0200	[thread overview]
Message-ID: <7300ef1f-8702-733d-2a50-4253345fde45@gmail.com> (raw)
In-Reply-To: <20220331165737.1073520-4-its@irrelevant.dk>

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.

> +            }
>           }

> 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.


  reply	other threads:[~2022-03-31 20:46 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é [this message]
2022-04-01  6:30     ` Klaus Jensen
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=7300ef1f-8702-733d-2a50-4253345fde45@gmail.com \
    --to=philippe.mathieu.daude@gmail.com \
    --cc=andrew@aj.id.au \
    --cc=arun.kka@samsung.com \
    --cc=clg@kaod.org \
    --cc=cminyard@mvista.com \
    --cc=its@irrelevant.dk \
    --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=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).