i2c: mediatek: Dump i2c/dma register when a timeout occurs
Subsystems (2)
Quoted 7 lines · On Sun, 10 Oct 2021 15:05:13 +0800 Kewei Xu <[email protected]> wrote:
When a timeout error occurs in i2c transter, it is usually related to the i2c/dma IP hardware configuration. Therefore, the purpose of this patch is to dump the key register values of i2c/dma when a timeout occurs in i2c for debugging.
Signed-off-by Kewei Xu <[email protected]>Reviewed-by Qii Wang <[email protected]>
I would like to test this patchset on one of supported platforms, an mt6577-powered device. This driver requires a DMA base...
Quoted 3 lines
i2c->pdmabase = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(i2c->pdmabase)) return PTR_ERR(i2c->pdmabase);
... however I am not sure what address should I specify in the .dts file. While other i2c busses supported by this driver such as mt6589 [1][2] and mt6797 [3] have designated DMA for I2C, mt6577 seems to lack dedicated DMA engine for I2C [4][5].
Do I need to specify the Generic DMA base address [4] instead?
Worth mentioning I brought up this issue in the past [5][6].
[1] ALPS.KK1.MP5.V1.3_EASTAEON89_WET_KK source code (downstream)
[2] MT6589 HSPA+ Smartphone Application Processor Datasheet v1.0, page 869
[3] MT6797 LTE-A Smartphone Application Processor Register Table (Part 1) v1.1, page 1796
[4] MT6577 HSPA Smartphone Application Processor Datasheet v0.94, page 547
[5] ALPS.JB.MP.V1.19_MBK77_TB_JB source code (downstream)
[6] https://marc.info/?l=devicetree&m=159949247901831&w=2
[7] https://marc.info/?l=linux-i2c&m=159939730714187&w=2
Quoted 29 lines · Boris Lysov
Quoted 7 lines · On Sun, 10 Oct 2021 15:05:13 +0800 Kewei Xu <[email protected]> wrote:
When a timeout error occurs in i2c transter, it is usually related to the i2c/dma IP hardware configuration. Therefore, the purpose of this patch is to dump the key register values of i2c/dma when a timeout occurs in i2c for debugging.
Signed-off-by Kewei Xu <[email protected]>Reviewed-by Qii Wang <[email protected]>I would like to test this patchset on one of supported platforms, an mt6577-powered device. This driver requires a DMA base...
Quoted 3 lines
i2c->pdmabase = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(i2c->pdmabase)) return PTR_ERR(i2c->pdmabase);... however I am not sure what address should I specify in the .dts file. While
other i2c busses supported by this driver such as mt6589 [1][2] and mt6797 [3]
have designated DMA for I2C, mt6577 seems to lack dedicated DMA engine for I2C
[4][5].Do I need to specify the Generic DMA base address [4] instead?
Worth mentioning I brought up this issue in the past [5][6].
Quoted 11 lines
[1] ALPS.KK1.MP5.V1.3_EASTAEON89_WET_KK source code (downstream)
[2] MT6589 HSPA+ Smartphone Application Processor Datasheet v1.0, page 869
[3] MT6797 LTE-A Smartphone Application Processor Register Table (Part 1) v1.1,
page 1796
[4] MT6577 HSPA Smartphone Application Processor Datasheet v0.94, page 547
[5] ALPS.JB.MP.V1.19_MBK77_TB_JB source code (downstream)
[6] https://marc.info/?l=devicetree&m=159949247901831&w=2
[7] https://marc.info/?l=linux-i2c&m=159939730714187&w=2
Hi, This patch only applies to APDMA(application processor DMA) and does not use GDMA(Generic DMA).In addition, the file i2c-mt65xx.c only supports APDMA mode by default. If APDMA address is not configured in dts, i2c transmission will be fail.thx~