Message ID | 20200412085428.27519-20-biwen.li@oss.nxp.com |
---|---|
State | New |
Headers | show |
Series | [01/27] rtc: ds1337: Add driver model support | expand |
>-----Original Message----- >From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Biwen Li >Sent: Sunday, April 12, 2020 2:24 PM >To: Jagdish Gediya <jagdish.gediya at nxp.com>; Priyanka Jain ><priyanka.jain at nxp.com>; hs at denx.de; jagan at amarulasolutions.com; >aford173 at gmail.com; Alison Wang <alison.wang at nxp.com>; >jh80.chung at samsung.com; Pramod Kumar <pramod.kumar_1 at nxp.com>; >Rajesh Bhagat <rajesh.bhagat at nxp.com>; Ruchika Gupta ><ruchika.gupta at nxp.com>; olteanv at gmail.com >Cc: Xiaobo Xie <xiaobo.xie at nxp.com>; Jiafei Pan <jiafei.pan at nxp.com>; u- >boot at lists.denx.de; Z.q. Hou <zhiqiang.hou at nxp.com>; Biwen Li ><biwen.li at nxp.com> >Subject: [PATCH 20/27] dm: ppc: MPC8548CDS: add i2c DM support > >From: Biwen Li <biwen.li at nxp.com> > >This supports i2c DM for board MPC8548CDS > >Signed-off-by: Biwen Li <biwen.li at nxp.com> >--- > board/freescale/common/sys_eeprom.c | 3 ++- > include/configs/MPC8548CDS.h | 9 ++++++++- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/board/freescale/common/sys_eeprom.c >b/board/freescale/common/sys_eeprom.c >index 6f151b0f71..c52af7060e 100644 >--- a/board/freescale/common/sys_eeprom.c >+++ b/board/freescale/common/sys_eeprom.c >@@ -589,6 +589,7 @@ unsigned int get_cpu_board_revision(void) > u8 major; /* 0x04 Board revision, major */ > u8 minor; /* 0x05 Board revision, minor */ > } be; >+ int ret; > > #ifndef CONFIG_DM_I2C > i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, >CONFIG_SYS_I2C_EEPROM_ADDR_LEN, @@ -603,7 +604,7 @@ unsigned int >get_cpu_board_revision(void) #else > ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR, > CONFIG_SYS_I2C_EEPROM_ADDR_LEN, >- &dev) >+ &dev); Was this compilation error exist before this patch series as well? > #endif > if (!ret) > dm_i2c_read(dev, 0, (void *)&be, sizeof(be)); diff --git >a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index >a68d190f6a..d185926cab 100644 >--- a/include/configs/MPC8548CDS.h >+++ b/include/configs/MPC8548CDS.h >@@ -1,6 +1,7 @@ > /* SPDX-License-Identifier: GPL-2.0+ */ > /* > * Copyright 2004, 2007, 2010-2011 Freescale Semiconductor. >+ * Copyright 2020 NXP > */ > > /* >@@ -304,12 +305,18 @@ extern unsigned long get_clock_freq(void); > /* > * I2C > */ >+#ifndef CONFIG_DM_I2C > #define CONFIG_SYS_I2C >+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } >+#else >+#define CONFIG_SYS_SPD_BUS_NUM 0 >+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM >+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0 >+#endif > #define CONFIG_SYS_I2C_FSL > #define CONFIG_SYS_FSL_I2C_SPEED 400000 In other similar patches, you were adding this kind of defines under #ifndef CONFIG_DM_I2C Why it is different for this patch? Priyanka > #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F > #define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 >-#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } > > /* EEPROM */ > #define CONFIG_ID_EEPROM >-- >2.17.1
> > > >From: Biwen Li <biwen.li at nxp.com> > > > >This supports i2c DM for board MPC8548CDS > > > >Signed-off-by: Biwen Li <biwen.li at nxp.com> > >--- > > board/freescale/common/sys_eeprom.c | 3 ++- > > include/configs/MPC8548CDS.h | 9 ++++++++- > > 2 files changed, 10 insertions(+), 2 deletions(-) > > > >diff --git a/board/freescale/common/sys_eeprom.c > >b/board/freescale/common/sys_eeprom.c > >index 6f151b0f71..c52af7060e 100644 > >--- a/board/freescale/common/sys_eeprom.c > >+++ b/board/freescale/common/sys_eeprom.c > >@@ -589,6 +589,7 @@ unsigned int get_cpu_board_revision(void) > > u8 major; /* 0x04 Board revision, major */ > > u8 minor; /* 0x05 Board revision, minor */ > > } be; > >+ int ret; > > > > #ifndef CONFIG_DM_I2C > > i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, > >CONFIG_SYS_I2C_EEPROM_ADDR_LEN, @@ -603,7 +604,7 @@ unsigned int > >get_cpu_board_revision(void) #else > > ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR, > > CONFIG_SYS_I2C_EEPROM_ADDR_LEN, > >- &dev) > >+ &dev); > Was this compilation error exist before this patch series as well? Yes, it is. > > > #endif > > if (!ret) > > dm_i2c_read(dev, 0, (void *)&be, sizeof(be)); diff --git > >a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index > >a68d190f6a..d185926cab 100644 > >--- a/include/configs/MPC8548CDS.h > >+++ b/include/configs/MPC8548CDS.h > >@@ -1,6 +1,7 @@ > > /* SPDX-License-Identifier: GPL-2.0+ */ > > /* > > * Copyright 2004, 2007, 2010-2011 Freescale Semiconductor. > >+ * Copyright 2020 NXP > > */ > > > > /* > >@@ -304,12 +305,18 @@ extern unsigned long get_clock_freq(void); > > /* > > * I2C > > */ > >+#ifndef CONFIG_DM_I2C > > #define CONFIG_SYS_I2C > >+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } > >+#else > >+#define CONFIG_SYS_SPD_BUS_NUM 0 > >+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM > >+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0 > >+#endif > > #define CONFIG_SYS_I2C_FSL > > #define CONFIG_SYS_FSL_I2C_SPEED 400000 > In other similar patches, you were adding this kind of defines under #ifndef > CONFIG_DM_I2C Why it is different for this patch? > > Priyanka > > #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F > > #define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 > >-#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } > > > > /* EEPROM */ > > #define CONFIG_ID_EEPROM > >-- > >2.17.1
> Subject: RE: [PATCH 20/27] dm: ppc: MPC8548CDS: add i2c DM support > > >-----Original Message----- > >From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Biwen Li > >Sent: Sunday, April 12, 2020 2:24 PM > >To: Jagdish Gediya <jagdish.gediya at nxp.com>; Priyanka Jain > ><priyanka.jain at nxp.com>; hs at denx.de; jagan at amarulasolutions.com; > >aford173 at gmail.com; Alison Wang <alison.wang at nxp.com>; > >jh80.chung at samsung.com; Pramod Kumar <pramod.kumar_1 at nxp.com>; > Rajesh > >Bhagat <rajesh.bhagat at nxp.com>; Ruchika Gupta > <ruchika.gupta at nxp.com>; > >olteanv at gmail.com > >Cc: Xiaobo Xie <xiaobo.xie at nxp.com>; Jiafei Pan <jiafei.pan at nxp.com>; > >u- boot at lists.denx.de; Z.q. Hou <zhiqiang.hou at nxp.com>; Biwen Li > ><biwen.li at nxp.com> > >Subject: [PATCH 20/27] dm: ppc: MPC8548CDS: add i2c DM support > > > >From: Biwen Li <biwen.li at nxp.com> > > > >This supports i2c DM for board MPC8548CDS > > > >Signed-off-by: Biwen Li <biwen.li at nxp.com> > >--- > > board/freescale/common/sys_eeprom.c | 3 ++- > > include/configs/MPC8548CDS.h | 9 ++++++++- > > 2 files changed, 10 insertions(+), 2 deletions(-) > > > >diff --git a/board/freescale/common/sys_eeprom.c > >b/board/freescale/common/sys_eeprom.c > >index 6f151b0f71..c52af7060e 100644 > >--- a/board/freescale/common/sys_eeprom.c > >+++ b/board/freescale/common/sys_eeprom.c > >@@ -589,6 +589,7 @@ unsigned int get_cpu_board_revision(void) > > u8 major; /* 0x04 Board revision, major */ > > u8 minor; /* 0x05 Board revision, minor */ > > } be; > >+ int ret; > > > > #ifndef CONFIG_DM_I2C > > i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, > >CONFIG_SYS_I2C_EEPROM_ADDR_LEN, @@ -603,7 +604,7 @@ unsigned int > >get_cpu_board_revision(void) #else > > ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR, > > CONFIG_SYS_I2C_EEPROM_ADDR_LEN, > >- &dev) > >+ &dev); > Was this compilation error exist before this patch series as well? > > > #endif > > if (!ret) > > dm_i2c_read(dev, 0, (void *)&be, sizeof(be)); diff --git > >a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index > >a68d190f6a..d185926cab 100644 > >--- a/include/configs/MPC8548CDS.h > >+++ b/include/configs/MPC8548CDS.h > >@@ -1,6 +1,7 @@ > > /* SPDX-License-Identifier: GPL-2.0+ */ > > /* > > * Copyright 2004, 2007, 2010-2011 Freescale Semiconductor. > >+ * Copyright 2020 NXP > > */ > > > > /* > >@@ -304,12 +305,18 @@ extern unsigned long get_clock_freq(void); > > /* > > * I2C > > */ > >+#ifndef CONFIG_DM_I2C > > #define CONFIG_SYS_I2C > >+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } > >+#else > >+#define CONFIG_SYS_SPD_BUS_NUM 0 > >+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM > >+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0 > >+#endif > > #define CONFIG_SYS_I2C_FSL > > #define CONFIG_SYS_FSL_I2C_SPEED 400000 > In other similar patches, you were adding this kind of defines under #ifndef > CONFIG_DM_I2C Why it is different for this patch? I will move it to #ifndef CONFIG_DM_I2C, and below configs in v2. #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F #define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 > Priyanka > > #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F > > #define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 > >-#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } > > > > /* EEPROM */ > > #define CONFIG_ID_EEPROM > >-- > >2.17.1
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index 6f151b0f71..c52af7060e 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -589,6 +589,7 @@ unsigned int get_cpu_board_revision(void) u8 major; /* 0x04 Board revision, major */ u8 minor; /* 0x05 Board revision, minor */ } be; + int ret; #ifndef CONFIG_DM_I2C i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, @@ -603,7 +604,7 @@ unsigned int get_cpu_board_revision(void) #else ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, - &dev) + &dev); #endif if (!ret) dm_i2c_read(dev, 0, (void *)&be, sizeof(be)); diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index a68d190f6a..d185926cab 100644 --- a/include/configs/MPC8548CDS.h +++ b/include/configs/MPC8548CDS.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2004, 2007, 2010-2011 Freescale Semiconductor. + * Copyright 2020 NXP */ /* @@ -304,12 +305,18 @@ extern unsigned long get_clock_freq(void); /* * I2C */ +#ifndef CONFIG_DM_I2C #define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } +#else +#define CONFIG_SYS_SPD_BUS_NUM 0 +#define CONFIG_I2C_SET_DEFAULT_BUS_NUM +#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0 +#endif #define CONFIG_SYS_I2C_FSL #define CONFIG_SYS_FSL_I2C_SPEED 400000 #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F #define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 -#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } /* EEPROM */ #define CONFIG_ID_EEPROM