All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
To: "Cédric Le Goater" <clg@kaod.org>,
	"Brendan Higgins" <brendanhiggins@google.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Joel Stanley" <joel@jms.id.au>,
	"Andrew Jeffery" <andrew@aj.id.au>
Cc: openbmc@lists.ozlabs.org
Subject: Re: [RFC PATCH dev-5.1 0/6] Aspeed I2C buffer/DMA mode support
Date: Fri, 21 Jun 2019 09:57:54 -0700	[thread overview]
Message-ID: <c3c8ae72-fa70-37ec-35b4-6e43dcab5c30@linux.intel.com> (raw)
In-Reply-To: <2e5fb83f-8884-5c24-1cd5-d7c1e7b930b9@kaod.org>

On 6/21/2019 8:46 AM, Cédric Le Goater wrote:
> On 20/06/2019 21:49, Jae Hyun Yoo wrote:
>> This patch series adds buffer mode and DMA mode transfer support for the
>> Aspeed I2C driver. With this change, default transfer mode will be set to
>> buffer mode for better performance, and DMA mode can be selectively used
>> depends on platform configuration.
>>
>> * Buffer mode
>>    AST2400:
>>      It has 2 KBytes (256 Bytes x 8 pages) of I2C SRAM buffer pool from
>>      0x1e78a800 to 0x1e78afff that can be used for all busses with
>>      buffer pool manipulation. To simplify implementation for supporting
>>      both AST2400 and AST2500, it assigns each 128 Bytes per bus without
>>      using buffer pool manipulation so total 1792 Bytes of I2C SRAM
>>      buffer will be used.
>>
>>    AST2500:
>>      It has 16 Bytes of individual I2C SRAM buffer per each bus and its
>>      range is from 0x1e78a200 to 0x1e78a2df, so it doesn't have 'buffer
>>      page selection' bit field in the Function control register, and
>>      neither 'base address pointer' bit field in the Pool buffer control
>>      register it has. To simplify implementation for supporting both
>>      AST2400 and AST2500, it writes zeros on those register bit fields
>>      but it's okay because it does nothing in AST2500.
>>
>> * DMA mode
>>    Only AST2500 supports DMA mode under some limitations:
>>      I2C is sharing the DMA H/W with UHCI host controller and MCTP
>>      controller. Since those controllers operate with DMA mode only, I2C
>>      has to use buffer mode or byte mode instead if one of those
>>      controllers is enabled. Also make sure that if SD/eMMC or Port80
>>      snoop uses DMA mode instead of PIO or FIFO respectively, I2C can't
>>      use DMA mode..
>>
>> I'm submitting this series as an RFC because it needs more test on real
>> AST2400 BMC mahines, also it needs to check if QEMU can handle this change
>> so please review and test it.
> 
> QEMU should have some support for the I2C DMA mode. Lightly tested
> though. The DT would activate it, right ?
> 
> C.

Hi Cédric,

Right, DMA should be enabled in dt by adding below setting into each bus
node if you are going to use I2C DMA mode.

aspeed,dma-buf-size = <4096>;

Please see an example in the 1/6 patch of this series.

Also, you should disable USB host features by disabling CONFIG_USB from
kernel configs. You could remove it from defconfig like this:
https://gerrit.openbmc-project.xyz/c/openbmc/meta-aspeed/+/22808
Or, you can simply add CONFIG_USB=n into your machine layer kernel
config overlay.

Thanks,
Jae

>> Jae Hyun Yoo (6):
>>    dt-bindings: i2c: aspeed: add buffer and DMA mode transfer support
>>    ARM: dts: aspeed: add I2C buffer mode support
>>    irqchip/aspeed-i2c-ic: add I2C SRAM enabling control
>>    i2c: aspeed: fix master pending state handling
>>    i2c: aspeed: add buffer mode transfer support
>>    i2c: aspeed: add DMA mode transfer support
>>
>>   .../devicetree/bindings/i2c/i2c-aspeed.txt    |  52 +-
>>   arch/arm/boot/dts/aspeed-g4.dtsi              |  42 +-
>>   arch/arm/boot/dts/aspeed-g5.dtsi              |  42 +-
>>   drivers/i2c/busses/i2c-aspeed.c               | 469 ++++++++++++++++--
>>   drivers/irqchip/irq-aspeed-i2c-ic.c           |   8 +
>>   5 files changed, 548 insertions(+), 65 deletions(-)
>>
> 

      reply	other threads:[~2019-06-21 16:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 19:49 [RFC PATCH dev-5.1 0/6] Aspeed I2C buffer/DMA mode support Jae Hyun Yoo
2019-06-20 19:49 ` [RFC PATCH dev-5.1 1/6] dt-bindings: i2c: aspeed: add buffer and DMA mode transfer support Jae Hyun Yoo
2019-06-20 19:49 ` [RFC PATCH dev-5.1 2/6] ARM: dts: aspeed: add I2C buffer mode support Jae Hyun Yoo
2019-06-20 19:49 ` [RFC PATCH dev-5.1 3/6] irqchip/aspeed-i2c-ic: add I2C SRAM enabling control Jae Hyun Yoo
2019-06-21  0:33   ` Ryan Chen
2019-06-21 18:41     ` Jae Hyun Yoo
2019-06-25 17:23       ` Jae Hyun Yoo
2019-06-26  5:10         ` Ryan Chen
2019-06-26 21:18           ` Jae Hyun Yoo
2019-06-20 19:49 ` [RFC PATCH dev-5.1 4/6] i2c: aspeed: fix master pending state handling Jae Hyun Yoo
2019-06-20 20:30   ` Tao Ren
2019-06-20 20:34     ` Jae Hyun Yoo
2019-06-21 22:11       ` Tao Ren
2019-06-21 22:33         ` Jae Hyun Yoo
2019-06-20 19:49 ` [RFC PATCH dev-5.1 5/6] i2c: aspeed: add buffer mode transfer support Jae Hyun Yoo
2019-06-21 22:29   ` Tao Ren
2019-06-21 22:34     ` Jae Hyun Yoo
2019-06-24 23:54       ` Tao Ren
2019-06-25 17:18         ` Jae Hyun Yoo
2019-06-20 19:49 ` [RFC PATCH dev-5.1 6/6] i2c: aspeed: add DMA " Jae Hyun Yoo
2019-06-21 15:46 ` [RFC PATCH dev-5.1 0/6] Aspeed I2C buffer/DMA mode support Cédric Le Goater
2019-06-21 16:57   ` Jae Hyun Yoo [this message]

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=c3c8ae72-fa70-37ec-35b4-6e43dcab5c30@linux.intel.com \
    --to=jae.hyun.yoo@linux.intel.com \
    --cc=andrew@aj.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=brendanhiggins@google.com \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.