From: Boris Lysov <arzamas-16@mail.ee>
To: linux-i2c@vger.kernel.org
Cc: qii.wang@mediatek.com, matthias.bgg@gmail.com
Subject: [RFC] i2c: i2c-mt65xx and DMA on MT6577 (compatibility issue)
Date: Sun, 6 Sep 2020 16:00:47 +0300 [thread overview]
Message-ID: <20200906160047.7c5fb42f@hp15> (raw)
Hello,
I ran into the issue with using i2c-mt65xx driver on MT6577 hardware.
Device tree documentation for the driver says "reg" property requires 2 addresses:
> reg: physical base address of the controller and dma base
Physical base address for MT6577 is 0xC1012000, but AFAIK MT6577 does not have
a DMA base dedicated especially to I2C.
What value has to be used as DMA base on MT6577?
For the sake of example, I did my own research and checked other SoC listed as
compatible in dt-binding doc. I compared the source code of Linux kernels for
devices based on MT6589 and MT6577. See example below.
MT6589, Lenovo A820: https://github.com/jawad6233/Lenovo_A820_Kernel
There are IRQ IDs defined for I2C DMA:
mediatek/platform/mt6589/kernel/core/include/mach/mt_irq.h (line 47)
> #define MT_DMA_I2C1_ID (GIC_PRIVATE_SIGNALS + 62)
> #define MT_DMA_I2C2_ID (GIC_PRIVATE_SIGNALS + 63)
> #define MT_DMA_I2C3_ID (GIC_PRIVATE_SIGNALS + 64)
> #define MT_DMA_I2C4_ID (GIC_PRIVATE_SIGNALS + 65)
> #define MT_DMA_I2C5_ID (GIC_PRIVATE_SIGNALS + 66)
> #define MT_DMA_I2C6_ID (GIC_PRIVATE_SIGNALS + 67)
> #define MT_DMA_I2C7_ID (GIC_PRIVATE_SIGNALS + 68)
There are DMA address calculations for various I2C busses:
mediatek/platform/mt6589/kernel/drivers/i2c/i2c.c (line 1135)
> i2c->pdmabase = AP_DMA_BASE + 0x300 + (0x80*(i2c->id));
MT6577, ZTE v970: https://github.com/dragonpt/Kernel_3.4.67_KK_ZTE_v970
There are no IRQ IDs defined for I2C DMA:
mediatek/platform/mt6577/kernel/core/include/mach/mt_irq.h
From line 80 down to line 92 there are DMA addresses for various subsystems except I2C.
And there are no DMA address calculaltions either:
mediatek/platform/mt6577/kernel/drivers/i2c/i2c.c
Please point me to DMA base I should use on MT6577.
Thanks.
reply other threads:[~2020-09-06 13:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200906160047.7c5fb42f@hp15 \
--to=arzamas-16@mail.ee \
--cc=linux-i2c@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=qii.wang@mediatek.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