Hi Albert, On 16 March 2015 at 14:28, Albert ARIBAUD <albert.u.b...@aribaud.net> wrote: > Hello Simon, > > On Mon, 16 Mar 2015 11:40:54 -0600, Simon Glass <s...@chromium.org> > wrote: >> Hi Anish, >> >> On 16 March 2015 at 10:28, Anish Khurana <anish.khurana130...@gmail.com> >> wrote: >> > Hi Simon, >> > >> > can you please share the git branch so that I can also review it. I am >> > writing for LPC2148 board. >> >> This is Albert's work. Once he shares if I am sure it will be public. > > Since this is a derivative of the patch series I've posted here, I > could hardly see a problem in making it public anyway. > > I've pushed the broken series, the one with I2C DM and COMPAT, as > branch dm-i2c of repo u-boot-arm. Anyone feel free to fiddle with > it.
This does not build for me - e.g. lpc32xx_i2c_set_bus_speed() uses a struct i2c_adaptor * when it should use struct udevice *. Do I have the right version? /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:64:4: warning: ‘struct i2c_adapter’ declared inside parameter list [enabled by default] unsigned int speed) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:64:4: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] In file included from /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:13:0: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: In function ‘lpc32xx_i2c_set_bus_speed’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:76:39: error: dereferencing pointer to incomplete type writel(half_period, &lpc32xx_i2c[adap->hwadapnr]->clk_hi); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/arch/arm/include/asm/io.h:77:55: note: in definition of macro ‘__arch_putl’ #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:76:2: note: in expansion of macro ‘writel’ writel(half_period, &lpc32xx_i2c[adap->hwadapnr]->clk_hi); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:77:39: error: dereferencing pointer to incomplete type writel(half_period, &lpc32xx_i2c[adap->hwadapnr]->clk_lo); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/arch/arm/include/asm/io.h:146:48: note: in expansion of macro ‘__arch_putl’ #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:77:2: note: in expansion of macro ‘writel’ writel(half_period, &lpc32xx_i2c[adap->hwadapnr]->clk_lo); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: At top level: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:82:37: warning: ‘struct i2c_adapter’ declared inside parameter list [enabled by default] static int lpc32xx_i2c_probe(struct i2c_adapter *adap, u8 dev) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: In function ‘lpc32xx_i2c_probe’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:84:54: error: dereferencing pointer to incomplete type struct lpc32xx_i2c_registers *i2c = lpc32xx_i2c[adap->hwadapnr]; ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: In function ‘lpc32xx_i2c_read_data’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:133:7: error: ‘data’ undeclared (first use in this function) *(data++) = readl(®s->rx); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:133:7: note: each undeclared identifier is reported only once for each function it appears in In file included from /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:13:0: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: In function ‘lpc32xx_i2c_xfer’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:194:34: error: ‘i2c’ undeclared (first use in this function) writel(LPC32XX_I2C_SOFT_RESET, &i2c->ctrl); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/arch/arm/include/asm/io.h:77:55: note: in definition of macro ‘__arch_putl’ #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:194:2: note: in expansion of macro ‘writel’ writel(LPC32XX_I2C_SOFT_RESET, &i2c->ctrl); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: In function ‘lpc32xx_i2c_ofdata_to_platdata’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:223:9: error: ‘struct lpc32xx_i2c_bus’ has no member named ‘regs’ i2c_bus->regs = (struct lpc32xx_i2c_registers *) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:219:12: warning: unused variable ‘flags’ [-Wunused-variable] int node, flags; ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c: At top level: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:231:2: warning: initialization from incompatible pointer type [enabled by default] .probe_chip = lpc32xx_i2c_probe, ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:231:2: warning: (near initialization for ‘lpc32xx_i2c_ops.probe_chip’) [enabled by default] /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:232:2: warning: initialization from incompatible pointer type [enabled by default] .set_bus_speed = lpc32xx_i2c_set_bus_speed, ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:232:2: warning: (near initialization for ‘lpc32xx_i2c_ops.set_bus_speed’) [enabled by default] /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/i2c/lpc32xx_i2c.c:236:45: error: ‘LPC32XX_I2C’ undeclared here (not in a function) { .compatible = "nxp,lpc32xx-i2c", .data = LPC32XX_I2C }, ^ make[2]: *** [drivers/i2c/lpc32xx_i2c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/rtc/ds1374.c: In function ‘rtc_read’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/rtc/ds1374.c:217:2: warning: implicit declaration of function ‘i2c_reg_read’ [-Wimplicit-function-declaration] return (i2c_reg_read (CONFIG_SYS_I2C_RTC_ADDR, reg)); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/rtc/ds1374.c: In function ‘rtc_write’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/drivers/rtc/ds1374.c:224:3: warning: implicit declaration of function ‘i2c_reg_write’ [-Wimplicit-function-declaration] i2c_reg_write (CONFIG_SYS_I2C_RTC_ADDR, reg, val); ^ make[1]: *** [drivers/i2c] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_date.c: In function ‘do_date’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_date.c:42:14: error: ‘CONFIG_SYS_RTC_BUS_NUM’ undeclared (first use in this function) I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_date.c:42:14: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [common/cmd_date.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_eeprom.c: In function ‘eeprom_read’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_eeprom.c:155:16: error: ‘I2C_RXTX_LEN’ undeclared (first use in this function) if (maxlen > I2C_RXTX_LEN) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_eeprom.c:155:16: note: each undeclared identifier is reported only once for each function it appears in /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_eeprom.c: In function ‘eeprom_write’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_eeprom.c:253:16: error: ‘I2C_RXTX_LEN’ undeclared (first use in this function) if (maxlen > I2C_RXTX_LEN) ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_dtt.c: In function ‘dtt_init’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_dtt.c:41:14: error: ‘CONFIG_SYS_DTT_BUS_NUM’ undeclared (first use in this function) I2C_SET_BUS(CONFIG_SYS_DTT_BUS_NUM); ^ /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_dtt.c:41:14: note: each undeclared identifier is reported only once for each function it appears in /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_dtt.c: In function ‘dtt_i2c’: /usr/local/google/c/cosarm/src/third_party/u-boot/files/common/cmd_dtt.c:65:14: error: ‘CONFIG_SYS_DTT_BUS_NUM’ undeclared (first use in this function) I2C_SET_BUS(CONFIG_SYS_DTT_BUS_NUM); ^ make[2]: *** [common/cmd_eeprom.o] Error 1 make[2]: *** [common/cmd_dtt.o] Error 1 make[1]: *** [common] Error 2 make[1]: *** wait: No child processes. Stop. Regards, Simon _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot