u-boot-brain/arch/arm/imx-common
Peng Fan 71204e95ce i2c: mxc: refactor i2c driver and support dm
1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
   used for non-DM and DM.
2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
   registers based on `base` entry of `struct mxc_i2c_bus`.
3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
   flags. A new flag is introduced, I2C_QUIRK_FLAG.
4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
   Make most functions common to DM and non-DM, try to avoid duplicated code.
5. Support DM, but pinctrl is not included. Pinmux setting is still set
   by setup_i2c, but we do not need bus_i2c_init for DM.
6. struct i2c_parms and struct sram_data are removed.
7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
   paramter of bus_i2c_init is modified to i2c index. Add new prototype
   i2c_idle_bus and force_bus_idle. Since bus_i2c_init is not good for
   DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus.
   Board file take the responsibility to implement this function, like this:
   "
   int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
   {
	   if (i2c_bus->index == 0)
		   force_bus_idle(i2c_pads_info0);
	   else if (i2c_bus->index == 1)
		   force_bus_idle(i2c_pads_info1);
	   else
		   xxxxxx
   }
   "
8. Introduce a weak function, enable_i2c_clk
9. Tested on an i.MX7 platform. Log info:
 => dm tree
 Class       Probed   Name
 ----------------------------------------
 root        [ + ]    root_driver
 simple_bus  [   ]    |-- soc
 simple_bus  [   ]    |   |-- aips-bus@30000000
 simple_bus  [   ]    |   |   |-- anatop@30360000
 simple_bus  [   ]    |   |   `-- snvs@30370000
 simple_bus  [   ]    |   |-- aips-bus@30400000
 simple_bus  [   ]    |   `-- aips-bus@30800000
 i2c         [   ]    |       |-- i2c@30a20000
 i2c         [   ]    |       `-- i2c@30a40000
 simple_bus  [   ]    `-- regulators
 => i2c dev 0
 Setting bus to 0
 => i2c probe
 Valid chip addresses: 08 50
 => i2c md 8 31
 0031: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-05-14 18:49:36 -06:00
..
cmd_bmode.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_dek.c imx6: Added DEK blob generator command 2015-03-02 09:57:06 +01:00
cmd_hdmidet.c Merge git://git.denx.de/u-boot-arm 2013-07-31 11:30:38 +02:00
cpu.c ARM: i.MX: provide access to reset cause through get_imx_reset_cause() 2015-02-17 10:42:54 +01:00
ddrmc-vf610.c ARM: vf610: Move DDR3 initialization to imx-common 2015-04-23 14:56:08 -04:00
i2c-mxv7.c i2c: mxc: refactor i2c driver and support dm 2015-05-14 18:49:36 -06:00
iomux-v3.c imx: mx6 sabreauto: Add board support for USB EHCI 2014-11-03 11:21:49 +01:00
Kconfig ARM: iMX: define an IMX_CONFIG Kconfig option 2015-03-23 13:19:17 +01:00
Makefile ARM: vf610: Move DDR3 initialization to imx-common 2015-04-23 14:56:08 -04:00
misc.c imx: add missing includes 2014-10-25 15:27:35 -04:00
sata.c mx6: Remove duplication of iomuxc structure 2014-07-23 12:25:41 +02:00
speed.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
spl_sd.cfg mx6: Use a common SPL configuration file 2014-11-20 10:30:18 +01:00
spl.c imx SPL: enable boot from eMMC boot partitions. 2014-12-30 14:05:36 +01:00
timer.c imx6: Added DEK blob generator command 2015-03-02 09:57:06 +01:00
video.c mx6: video_skip: Fix crash on NULL pointer 2014-11-13 17:56:15 +01:00