u-boot/arch/arm
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
..
cpu tegra: Boot in non-secure mode by default 2015-05-13 09:24:16 -07:00
dts tpm: Rename Infineon TPM to slb9645tt 2015-05-14 18:49:33 -06:00
imx-common i2c: mxc: refactor i2c driver and support dm 2015-05-14 18:49:36 -06:00
include i2c: mxc: refactor i2c driver and support dm 2015-05-14 18:49:36 -06:00
lib arch/arm/lib/bootm-fdt.c: Guard the include of <asm/armv7.h> 2015-05-14 11:07:03 -04:00
mach-at91 ARM: at91: remove non-generic boards 2015-05-13 13:01:25 +02:00
mach-bcm283x arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-davinci arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-highbank ARM: highbank: move SoC sources to mach-highbank 2015-02-21 08:23:51 -05:00
mach-integrator arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-keystone arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-kirkwood arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-mvebu arm: mvebu: Remove "u-boot.kwb" CONFIG_BUILD_TARGET for non-SPL targets 2015-05-05 14:32:05 +02:00
mach-nomadik arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-orion5x arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-socfpga arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-tegra ARM: tegra: move NVIDIA common files to arch/arm/mach-tegra 2015-05-13 09:46:19 -07:00
mach-uniphier arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mach-versatile ARM: versatile: move SoC sources to mach-versatile 2015-02-21 08:23:51 -05:00
mach-zynq arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
mvebu-common arm: mvebu: Move mvebu-common into mach-mvebu 2015-05-05 14:28:29 +02:00
config.mk arm: Include the .got section in the binary 2015-05-14 18:49:34 -06:00
Kconfig arch: Make board selection choices optional 2015-05-12 18:10:02 -04:00
Kconfig.debug arm: debug: add Kconfig entries for lowlevel debug 2014-10-26 22:23:12 +01:00
Makefile ARM: socfpga: move SoC sources to mach-socfpga 2015-05-07 05:21:12 +02:00