From 4bb6f26b05450777d14aa96e10783066c2503dc2 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 11 Nov 2020 16:17:52 -0600 Subject: Add new BSP submodule for Atmel Processors. --- recipes-bsp/u-boot/u-boot-2016.09.01/i2c.patch | 114 +++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot-2016.09.01/i2c.patch (limited to 'recipes-bsp/u-boot/u-boot-2016.09.01/i2c.patch') diff --git a/recipes-bsp/u-boot/u-boot-2016.09.01/i2c.patch b/recipes-bsp/u-boot/u-boot-2016.09.01/i2c.patch new file mode 100644 index 0000000..a5087ea --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2016.09.01/i2c.patch @@ -0,0 +1,114 @@ +diff -raNu old/include/i2c.h new/include/i2c.h +--- old/include/i2c.h 2017-04-28 17:26:27.854898005 -0500 ++++ new/include/i2c.h 2017-05-01 17:27:32.673437788 -0500 +@@ -17,6 +17,27 @@ + #ifndef _I2C_H_ + #define _I2C_H_ + ++#define U_BOOT_I2C_MKENT_COMPLETE(_init, _probe, _read, _write, \ ++ _set_speed, _speed, _slaveaddr, _hwadapnr, _name) \ ++ { \ ++ .init = _init, \ ++ .probe = _probe, \ ++ .read = _read, \ ++ .write = _write, \ ++ .set_bus_speed = _set_speed, \ ++ .speed = _speed, \ ++ .slaveaddr = _slaveaddr, \ ++ .init_done = 0, \ ++ .hwadapnr = _hwadapnr, \ ++ .name = #_name \ ++}; ++ ++#define U_BOOT_I2C_ADAP_COMPLETE(_name, _init, _probe, _read, _write, \ ++ _set_speed, _speed, _slaveaddr, _hwadapnr) \ ++ ll_entry_declare(struct i2c_adapter, _name, i2c) = \ ++ U_BOOT_I2C_MKENT_COMPLETE(_init, _probe, _read, _write, \ ++ _set_speed, _speed, _slaveaddr, _hwadapnr, _name); ++ + /* + * For now there are essentially two parts to this file - driver model + * here at the top, and the older code below (with CONFIG_SYS_I2C being +@@ -538,6 +559,26 @@ + */ + void i2c_dump_msgs(struct i2c_msg *msg, int nmsgs); + ++ ++struct i2c_adapter { ++ void (*init)(struct i2c_adapter *adap, int speed, ++ int slaveaddr); ++ int (*probe)(struct i2c_adapter *adap, uint8_t chip); ++ int (*read)(struct i2c_adapter *adap, uint8_t chip, ++ uint addr, int alen, uint8_t *buffer, ++ int len); ++ int (*write)(struct i2c_adapter *adap, uint8_t chip, ++ uint addr, int alen, uint8_t *buffer, ++ int len); ++ uint (*set_bus_speed)(struct i2c_adapter *adap, ++ uint speed); ++ int speed; ++ int waitdelay; ++ int slaveaddr; ++ int init_done; ++ int hwadapnr; ++ char *name; ++}; + #ifndef CONFIG_DM_I2C + + /* +@@ -578,46 +619,6 @@ + #define CONFIG_SYS_SPD_BUS_NUM 0 + #endif + +-struct i2c_adapter { +- void (*init)(struct i2c_adapter *adap, int speed, +- int slaveaddr); +- int (*probe)(struct i2c_adapter *adap, uint8_t chip); +- int (*read)(struct i2c_adapter *adap, uint8_t chip, +- uint addr, int alen, uint8_t *buffer, +- int len); +- int (*write)(struct i2c_adapter *adap, uint8_t chip, +- uint addr, int alen, uint8_t *buffer, +- int len); +- uint (*set_bus_speed)(struct i2c_adapter *adap, +- uint speed); +- int speed; +- int waitdelay; +- int slaveaddr; +- int init_done; +- int hwadapnr; +- char *name; +-}; +- +-#define U_BOOT_I2C_MKENT_COMPLETE(_init, _probe, _read, _write, \ +- _set_speed, _speed, _slaveaddr, _hwadapnr, _name) \ +- { \ +- .init = _init, \ +- .probe = _probe, \ +- .read = _read, \ +- .write = _write, \ +- .set_bus_speed = _set_speed, \ +- .speed = _speed, \ +- .slaveaddr = _slaveaddr, \ +- .init_done = 0, \ +- .hwadapnr = _hwadapnr, \ +- .name = #_name \ +-}; +- +-#define U_BOOT_I2C_ADAP_COMPLETE(_name, _init, _probe, _read, _write, \ +- _set_speed, _speed, _slaveaddr, _hwadapnr) \ +- ll_entry_declare(struct i2c_adapter, _name, i2c) = \ +- U_BOOT_I2C_MKENT_COMPLETE(_init, _probe, _read, _write, \ +- _set_speed, _speed, _slaveaddr, _hwadapnr, _name); + + struct i2c_adapter *i2c_get_adapter(int index); + +@@ -803,7 +804,7 @@ + void i2c_soft_scl(int bit); + void i2c_soft_delay(void); + #endif +-#else ++#elif !defined(CONFIG_DM_I2C_COMPAT) + + /* + * Probe the given I2C chip address. Returns 0 if a chip responded, -- cgit v1.2.3