mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-27 15:12:21 +00:00
71204e95ce
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> |
||
---|---|---|
.. | ||
arch-am33xx | ||
arch-armada100 | ||
arch-armv7 | ||
arch-bcm281xx | ||
arch-bcmcygnus | ||
arch-bcmnsp | ||
arch-ep93xx | ||
arch-exynos | ||
arch-fsl-lsch3 | ||
arch-imx | ||
arch-lpc32xx | ||
arch-ls102xa | ||
arch-mvebu | ||
arch-mx5 | ||
arch-mx6 | ||
arch-mx25 | ||
arch-mx27 | ||
arch-mx31 | ||
arch-mx35 | ||
arch-mxs | ||
arch-omap3 | ||
arch-omap4 | ||
arch-omap5 | ||
arch-orion5x | ||
arch-pxa | ||
arch-rmobile | ||
arch-s3c24x0 | ||
arch-s5pc1xx | ||
arch-sa1100 | ||
arch-spear | ||
arch-stm32f4 | ||
arch-stv0991 | ||
arch-sunxi | ||
arch-tegra | ||
arch-tegra20 | ||
arch-tegra30 | ||
arch-tegra114 | ||
arch-tegra124 | ||
arch-tegra210 | ||
arch-u8500 | ||
arch-vf610 | ||
arch-zynqmp | ||
armv8 | ||
imx-common | ||
iproc-common | ||
kona-common | ||
proc-armv | ||
ti-common | ||
armv7.h | ||
armv7m.h | ||
assembler.h | ||
atomic.h | ||
bitops.h | ||
bootm.h | ||
byteorder.h | ||
cache.h | ||
config.h | ||
davinci_rtc.h | ||
dma-mapping.h | ||
ehci-omap.h | ||
emif.h | ||
errno.h | ||
fsl_secure_boot.h | ||
gic.h | ||
global_data.h | ||
gpio.h | ||
hardware.h | ||
io.h | ||
linkage.h | ||
mach-types.h | ||
macro.h | ||
memory.h | ||
omap_boot.h | ||
omap_common.h | ||
omap_gpio.h | ||
omap_mmc.h | ||
omap_musb.h | ||
pl310.h | ||
posix_types.h | ||
processor.h | ||
psci.h | ||
ptrace.h | ||
sections.h | ||
secure.h | ||
setup.h | ||
spl.h | ||
string.h | ||
system.h | ||
types.h | ||
u-boot-arm.h | ||
u-boot.h | ||
unaligned.h | ||
utils.h |