[PATCH v3 1/5] i2c: mediatek: add basic driver support

Heiko Schocher hs at denx.de
Mon Nov 23 12:04:04 CET 2020


Hello mingming lee,

Am 16.10.20 um 05:27 schrieb mingming lee:
> From: Mingming Lee <Mingming.Lee at mediatek.com>
> 
> Add MediaTek I2C basic driver
> 
> Reviewed-by: Heiko Schocher <hs at denx.de>
> Signed-off-by: Mingming Lee <Mingming.Lee at mediatek.com>
> ---
> Changes for v3:
>    - fixed code veriew note in v2
>    - optimize the dma read/write flow in mtk_i2c_do_transfer()
> 
> Changes for v2:
>    - using error number defined in include/linux/errno.h
> ---
>  drivers/i2c/Kconfig  |   8 +
>  drivers/i2c/Makefile |   1 +
>  drivers/i2c/mt_i2c.c | 713 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 722 insertions(+)
>  create mode 100644 drivers/i2c/mt_i2c.c

Applied your changes to my testtree at:

https://github.com/hsdenx/u-boot-i2c/commits/work

and for this travis build fails with:

https://travis-ci.org/github/hsdenx/u-boot-i2c/jobs/745329353#L1350

   aarch64:  +   mt8512_bm1_emmc
+drivers/i2c/mt_i2c.c: In function 'mtk_i2c_do_transfer':
+drivers/i2c/mt_i2c.c:453:10: error: initialization of 'u32' {aka 'unsigned int'} from 'u8 *' {aka
'unsigned char *'} makes integer from pointer without a cast [-Werror=int-conversion]
+  453 |   writel(msgs->buf, priv->pdmabase + REG_RX_MEM_ADDR);
+      |          ^~~~
+arch/arm/include/asm/io.h:122:34: note: in definition of macro 'writel'
+  122 | #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
+      |                                  ^
+drivers/i2c/mt_i2c.c:463:10: error: initialization of 'u32' {aka 'unsigned int'} from 'u8 *' {aka
'unsigned char *'} makes integer from pointer without a cast [-Werror=int-conversion]
+  463 |   writel(msgs->buf, priv->pdmabase + REG_TX_MEM_ADDR);
+drivers/i2c/mt_i2c.c:474:10: error: initialization of 'u32' {aka 'unsigned int'} from 'u8 *' {aka
'unsigned char *'} makes integer from pointer without a cast [-Werror=int-conversion]
+  474 |   writel(msgs->buf, priv->pdmabase + REG_TX_MEM_ADDR);
+drivers/i2c/mt_i2c.c:476:10: error: initialization of 'u32' {aka 'unsigned int'} from 'u8 *' {aka
'unsigned char *'} makes integer from pointer without a cast [-Werror=int-conversion]
+  476 |   writel((msgs + 1)->buf, priv->pdmabase + REG_RX_MEM_ADDR);
+      |          ^
+cc1: all warnings being treated as errors
+make[2]: *** [drivers/i2c/mt_i2c.o] Error 1
+make[1]: *** [drivers/i2c] Error 2
+make: *** [sub-make] Error 2

Could you please take a look and send an update?

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list