From: Boris Lysov <arzamas-16@mail.ee>
To: Qii Wang <qii.wang@mediatek.com>
Cc: <linux-i2c@vger.kernel.org>, <robh+dt@kernel.org>,
<matthias.bgg@gmail.com>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH] dt-bindings: i2c: i2c-mt65xx: Update binding example
Date: Mon, 7 Sep 2020 18:08:41 +0300 [thread overview]
Message-ID: <20200907180841.0044d571@hp15> (raw)
In-Reply-To: <1599442087.25719.2.camel@mhfsdcap03>
On Mon, 7 Sep 2020 09:28:07 +0800
Qii Wang <qii.wang@mediatek.com> wrote:
> On Fri, 2020-09-04 at 22:33 +0300, Boris Lysov wrote:
> > Example uses values for MT6589 SoC, but MT6577 was specified in "compatible" property.
> >
>
> Why do you think the example is MT6589 SoC, not MT6577?
>
The best way to explain why it's for MT6589 instead of MT6577 is to provide
an example ;) I will refer to various downstream Linux kernel sources, I hope
sharing GitHub links is appropriate.
This is the kernel source code of Lenovo P780 (MT6589)
https://github.com/andreya108/bindu-kernel-mediatek
mediatek/platform/mt6589/kernel/core/include/mach/mt_reg_base.h , line 115:
> #define I2C0_BASE 0xF100D000
This address is virtual, and it translates into physical address 0x1100D000
0x1100D000 equals to the value in example
mediatek/platform/mt6589/kernel/core/mt_devs.c , line 846:
> .end = IO_VIRT_TO_PHYS(I2C0_BASE) + 0x70,
0x70 shows length of memory region, which also equals to the value in example
mediatek/platform/mt6589/kernel/drivers/i2c/i2c.c , line 1140:
> i2c->pdmabase = AP_DMA_BASE + 0x300 + (0x80*(i2c->id));
For id=0, physical pdmabase is 0x11000300 which also matches the address in example
mediatek/platform/mt6589/kernel/core/include/mach/mt_irq.h , line 29:
> #define MT_I2C0_IRQ_ID (GIC_PRIVATE_SIGNALS + 44)
The IRQ ID (44) equals to one specified in dt-binding example:
> interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_LOW>;
These values are same for other MT6589 devices, here are few other repositories
containing same lines of code as above (line numbers might be off for a few lines,
but the values I am referring to are same):
Micromax A116 (MT6589) - https://github.com/neomanu/NeoKernel-MT6589-A116
Acer V370 (MT6589) - https://github.com/Shr3ps/android_kernel_acer_V370_MT6589
bq Aquaris 5.7 (MT6589) - https://github.com/luckasfb/aquaris-5.7
Now lets take a look at MT6577 devices. This is the kernel source code of ZTE v970:
https://github.com/dragonpt/Kernel_3.4.67_KK_ZTE_v970
mediatek/platform/mt6589/kernel/core/include/mach/mt_reg_base.h , line 68:
> #define I2C0_BASE 0xF1012000
This address is virtual, and it translates into physical address 0xC1012000
0xC1012000 does not equal to 0x1100d000 listed in example!
mediatek/platform/mt6577/kernel/drivers/i2c/i2c.c
No mentions of pdmabase. There are no DMA addresses in this file!
mediatek/platform/mt6577/kernel/core/include/mach/mt_irq.h , line 70:
> #define MT_I2C0_IRQ_ID (GIC_PRIVATE_SIGNALS + 49)
The IRQ ID (49) does not match the ID (44) specified in example!
Other MT6577 kernels with same values:
Acer V360 (MT6577) - https://github.com/aquila-dev/mt6577_kernel3.4
Acer C10 (MT6577) - https://github.com/Dr-Shadow/android_kernel_acer_c10
Wiko Cink Slim (MT6577) - https://github.com/theboleslaw/kernel_wiko_s8073
As you can see, current dt-binding example represents MT6589 SoC values, not MT6577.
I have sent additional email about i2c-mt65xx and MT6577 compatibility, where
I voiced my concerns about I2C DMA on that SoC. I hope you can look into it.
next prev parent reply other threads:[~2020-09-07 15:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 19:33 [PATCH] dt-bindings: i2c: i2c-mt65xx: Update binding example Boris Lysov
2020-09-07 1:28 ` Qii Wang
2020-09-07 15:08 ` Boris Lysov [this message]
2020-09-14 2:09 ` Qii Wang
2020-10-25 18:53 ` Boris Lysov
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=20200907180841.0044d571@hp15 \
--to=arzamas-16@mail.ee \
--cc=devicetree@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=qii.wang@mediatek.com \
--cc=robh+dt@kernel.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).