[U-Boot] i2c: rework multibus/multiadapter functionality

Heiko Schocher hs at denx.de
Sat Jul 18 10:07:26 CEST 2009


Hello Wolfgang,

Wolfgang Denk wrote:
> In message <49C89574.9040302 at denx.de> you wrote:
>> I want now, because the merge window is open again, restart the
>> the multibus/multiadapter discussion.
> 
> No negative feedback has been posted, as far as I can tell.
> 
> Will you post patches for this merge window?

I am not completly ready (I ported hopefully all drivers, hold it in
sync with mainline, but I need to test this again), so I think, it
would be better to wait for the next release cycle, but if now a
discussion is starting, if it is in principle ok, code can be found
at:

http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus_v2

I hope to have this ready for next merge window, so a big test
phase can start!

Missing:
- overall cleanup
- completly delete CONFIG_HARD_I2C
- adapt README
- test, test, test
- "dynamic i2c bus"

Also this should be discussed:
- i2c devices must/should be ported to the new multibus functionality.

Here a short statistic for the actual state:

The following changes since commit bfadb17f69c256196620c32164775f063a59c34f:
  Anton Vorontsov (1):
        mpc83xx: MPC837xEMDS: Use hwconfig instead of pci_external_arbiter variable

are available in the git repository at:

  git://git.denx.de/u-boot-i2c.git multibus_v2

Heiko Schocher (20):
      i2c: added i2c_core and prepared for new multibus support
      i2c, common: common changes for multibus/multiadapter support
      i2c, soft-i2c: switch to new multibus/multiadapter support
      i2c, fsl_i2c: switch to new multibus/multiadapter support
      i2c, mpc8260_i2c: added new multibus/multiadapter support
      i2c, ppc4xx_i2c: added new multibus/multiadapter support
      i2c, 8xx: added new multibus/multiadapter support
      i2c, mpc5xxx: added new multibus/multiadapter support
      i2c, mpc512x: added new multibus/multiadapter support
      i2c, mpc8220: added new multibus/multiadapter support
      i2c, bfin: added new multibus/multiadapter support
      i2c, davinci: added new multibus/multiadapter support
      i2c, mxc: added new multibus/multiadapter support
      i2c, omap1510: added new multibus/multiadapter support
      i2c, omap24xx: added new multibus/multiadapter support
      i2c, s3c24x0: added new multibus/multiadapter support
      i2c, s3c44b0: added new multibus/multiadapter support
      i2c, tsi108: added new multibus/multiadapter support
      i2c, mpc824x: added new multibus/multiadapter support
      i2c, pxa: added new multibus/multiadapter support

 board/atc/atc.c                                    |    4 +-
 board/cm5200/cm5200.c                              |    6 +-
 board/cmc_pu2/load_sernum_ethaddr.c                |    4 +-
 board/cpc45/cpc45.c                                |    2 +-
 board/cpu86/cpu86.c                                |    4 +-
 board/cpu87/cpu87.c                                |    4 +-
 board/csb272/csb272.c                              |    2 +-
 board/etin/debris/debris.c                         |    2 +-
 board/fads/fads.h                                  |    8 +-
 board/freescale/mpc8266ads/mpc8266ads.c            |    2 +-
 board/freescale/mpc8548cds/mpc8548cds.c            |   34 ++
 board/hymod/hymod.c                                |    2 +-
 board/ids8247/ids8247.c                            |    4 +-
 board/keymile/common/common.c                      |   41 +-
 board/keymile/km8xx/km8xx.c                        |   55 ++-
 board/keymile/kmeter1/kmeter1.c                    |    9 +-
 board/keymile/mgcoge/mgcoge.c                      |    6 +-
 board/lwmon/lwmon.c                                |    2 +-
 board/lwmon/pcmcia.c                               |    4 +-
 board/lwmon5/kbd.c                                 |    2 +-
 board/m501sk/eeprom.c                              |    2 +-
 board/mpl/pip405/pip405.c                          |    2 +-
 board/muas3001/muas3001.c                          |    2 +-
 board/pm826/pm826.c                                |    4 +-
 board/pm828/pm828.c                                |    4 +-
 board/rsdproto/rsdproto.c                          |    2 +-
 board/sacsng/ioconfig.h                            |    4 +-
 board/sandburst/common/ppc440gx_i2c.c              |  507 ------------------
 board/sandburst/common/ppc440gx_i2c.h              |   60 ---
 board/sandburst/common/sb_common.c                 |   39 +-
 board/sandburst/common/sb_common.h                 |    1 -
 board/sandburst/karef/Makefile                     |    2 +-
 board/sandburst/karef/karef.c                      |    6 -
 board/sandburst/metrobox/Makefile                  |    2 +-
 board/sandburst/metrobox/metrobox.c                |    6 -
 board/sbc8260/sbc8260.c                            |    4 +-
 board/siemens/SCM/scm.c                            |    2 +-
 board/tqc/tqm8260/tqm8260.c                        |    4 +-
 board/tqc/tqm8272/tqm8272.c                        |    4 +-
 board/xpedite1k/xpedite1k.c                        |    2 +-
 common/cmd_date.c                                  |    9 +
 common/cmd_dtt.c                                   |    9 +
 common/cmd_eeprom.c                                |    2 +-
 common/cmd_i2c.c                                   |  157 ++++---
 common/devices.c                                   |   14 +-
 cpu/mpc512x/Makefile                               |    1 -
 cpu/mpc512x/i2c.c                                  |  403 --------------
 cpu/mpc5xxx/Makefile                               |    4 +-
 cpu/mpc5xxx/i2c.c                                  |  393 --------------
 cpu/mpc8220/Makefile                               |    2 +-
 cpu/mpc8220/i2c.c                                  |  390 --------------
 cpu/mpc824x/Makefile                               |    3 +-
 cpu/mpc8260/Makefile                               |    2 +-
 cpu/mpc8260/commproc.c                             |    2 +-
 cpu/mpc8xx/Makefile                                |    1 -
 cpu/mpc8xx/video.c                                 |    4 +
 cpu/ppc4xx/40x_spd_sdram.c                         |   10 +-
 cpu/ppc4xx/44x_spd_ddr.c                           |   10 +-
 cpu/ppc4xx/44x_spd_ddr2.c                          |    3 +-
 cpu/ppc4xx/Makefile                                |    1 -
 cpu/ppc4xx/denali_spd_ddr2.c                       |    3 +-
 cpu/pxa/Makefile                                   |    1 -
 doc/README.m52277evb                               |    2 +-
 doc/README.m53017evb                               |    2 +-
 doc/README.m5373evb                                |    2 +-
 doc/README.m54455evb                               |    2 +-
 doc/README.m5475evb                                |    2 +-
 drivers/hwmon/adm1021.c                            |    4 +
 drivers/hwmon/lm75.c                               |    9 +
 drivers/i2c/Makefile                               |   16 +-
 drivers/i2c/bfin-twi_i2c.c                         |   41 ++-
 drivers/i2c/davinci_i2c.c                          |   38 ++-
 drivers/i2c/fsl_i2c.c                              |  221 ++++-----
 drivers/i2c/i2c_core.c                             |  388 ++++++++++++++
 drivers/i2c/mpc5xxx_i2c.c                          |  552 ++++++++++++++++++++
 .../drivers/i2c/i2c.c => drivers/i2c/mpc824x_i2c.c |   38 ++-
 cpu/mpc8260/i2c.c => drivers/i2c/mpc8260_i2c.c     |   79 ++--
 cpu/mpc8xx/i2c.c => drivers/i2c/mpc8xx_i2c.c       |   42 ++-
 drivers/i2c/mxc_i2c.c                              |   41 ++-
 drivers/i2c/omap1510_i2c.c                         |   37 ++-
 drivers/i2c/omap24xx_i2c.c                         |   37 ++-
 cpu/ppc4xx/i2c.c => drivers/i2c/ppc4xx_i2c.c       |  182 ++++---
 cpu/pxa/i2c.c => drivers/i2c/pxa_i2c.c             |   41 ++-
 drivers/i2c/s3c24x0_i2c.c                          |   39 ++-
 drivers/i2c/s3c44b0_i2c.c                          |   37 ++-
 drivers/i2c/soft_i2c.c                             |  120 +++--
 drivers/i2c/tsi108_i2c.c                           |   41 ++-
 include/4xx_i2c.h                                  |   20 +-
 include/asm-arm/global_data.h                      |    3 +
 include/asm-avr32/global_data.h                    |    3 +
 include/asm-blackfin/global_data.h                 |    3 +
 include/asm-i386/global_data.h                     |    3 +
 include/asm-m68k/global_data.h                     |    3 +
 include/asm-microblaze/global_data.h               |    3 +
 include/asm-mips/global_data.h                     |    3 +
 include/asm-nios/global_data.h                     |    3 +
 include/asm-nios2/global_data.h                    |    3 +
 include/asm-ppc/global_data.h                      |    3 +
 include/asm-sh/global_data.h                       |    3 +
 include/asm-sparc/global_data.h                    |    3 +
 include/configs/A3000.h                            |    9 +-
 include/configs/APC405.h                           |   10 +-
 include/configs/ASH405.h                           |   11 +-
 include/configs/ATUM8548.h                         |   16 +-
 include/configs/Alaska8220.h                       |    7 +-
 include/configs/B2.h                               |    9 +-
 include/configs/BC3450.h                           |   10 +-
 include/configs/CANBT.h                            |   11 +-
 include/configs/CATcenter.h                        |   10 +-
 include/configs/CMS700.h                           |   11 +-
 include/configs/CPC45.h                            |    9 +-
 include/configs/CPCI2DP.h                          |   11 +-
 include/configs/CPCI405.h                          |   11 +-
 include/configs/CPCI4052.h                         |   11 +-
 include/configs/CPCI405AB.h                        |   11 +-
 include/configs/CPCI405DT.h                        |   11 +-
 include/configs/CPCIISER4.h                        |   11 +-
 include/configs/CPU86.h                            |    9 +-
 include/configs/CPU87.h                            |    9 +-
 include/configs/CRAYL1.h                           |   11 +-
 include/configs/DASA_SIM.h                         |    2 +-
 include/configs/DP405.h                            |   11 +-
 include/configs/DU405.h                            |   11 +-
 include/configs/DU440.h                            |   15 +-
 include/configs/ERIC.h                             |   11 +-
 include/configs/EXBITGEN.h                         |   11 +-
 include/configs/FADS823.h                          |    8 +-
 include/configs/G2000.h                            |   11 +-
 include/configs/GEN860T.h                          |   20 +-
 include/configs/HH405.h                            |   13 +-
 include/configs/HIDDEN_DRAGON.h                    |   20 +-
 include/configs/HMI10.h                            |   11 +-
 include/configs/HUB405.h                           |   11 +-
 include/configs/IAD210.h                           |   12 +-
 include/configs/ICU862.h                           |   14 +-
 include/configs/IDS8247.h                          |   10 +-
 include/configs/IP860.h                            |   10 +-
 include/configs/IPHASE4539.h                       |   12 +-
 include/configs/IceCube.h                          |   10 +-
 include/configs/JSE.h                              |   13 +-
 include/configs/KAREF.h                            |   18 +-
 include/configs/KUP4K.h                            |   13 +-
 include/configs/KUP4X.h                            |   14 +-
 include/configs/M52277EVB.h                        |   12 +-
 include/configs/M5235EVB.h                         |   10 +-
 include/configs/M5253DEMO.h                        |    9 +-
 include/configs/M5271EVB.h                         |   10 +-
 include/configs/M5275EVB.h                         |   10 +-
 include/configs/M53017EVB.h                        |   10 +-
 include/configs/M5329EVB.h                         |   10 +-
 include/configs/M5373EVB.h                         |   10 +-
 include/configs/M54451EVB.h                        |   10 +-
 include/configs/M54455EVB.h                        |   10 +-
 include/configs/M5475EVB.h                         |   10 +-
 include/configs/M5485EVB.h                         |   10 +-
 include/configs/METROBOX.h                         |   17 +-
 include/configs/MHPC.h                             |    9 +-
 include/configs/MIP405.h                           |   11 +-
 include/configs/MPC8260ADS.h                       |   11 +-
 include/configs/MPC8266ADS.h                       |   11 +-
 include/configs/MPC8313ERDB.h                      |   17 +-
 include/configs/MPC8315ERDB.h                      |   12 +-
 include/configs/MPC8323ERDB.h                      |   12 +-
 include/configs/MPC832XEMDS.h                      |   12 +-
 include/configs/MPC8349EMDS.h                      |   18 +-
 include/configs/MPC8349ITX.h                       |   32 +-
 include/configs/MPC8360EMDS.h                      |   13 +-
 include/configs/MPC8360ERDK.h                      |   18 +-
 include/configs/MPC837XEMDS.h                      |   13 +-
 include/configs/MPC837XERDB.h                      |   13 +-
 include/configs/MPC8536DS.h                        |   20 +-
 include/configs/MPC8540ADS.h                       |   14 +-
 include/configs/MPC8540EVAL.h                      |   14 +-
 include/configs/MPC8541CDS.h                       |   14 +-
 include/configs/MPC8544DS.h                        |   14 +-
 include/configs/MPC8548CDS.h                       |  105 +++-
 include/configs/MPC8555CDS.h                       |   14 +-
 include/configs/MPC8560ADS.h                       |   14 +-
 include/configs/MPC8568MDS.h                       |   21 +-
 include/configs/MPC8569MDS.h                       |   17 +-
 include/configs/MPC8572DS.h                        |   21 +-
 include/configs/MPC8610HPCD.h                      |   14 +-
 include/configs/MPC8641HPCN.h                      |   14 +-
 include/configs/MVBLM7.h                           |   18 +-
 include/configs/NC650.h                            |   10 +-
 include/configs/OCRTC.h                            |   11 +-
 include/configs/ORSG.h                             |   11 +-
 include/configs/OXC.h                              |    9 +-
 include/configs/P2020DS.h                          |   21 +-
 include/configs/PCI405.h                           |   11 +-
 include/configs/PIP405.h                           |   11 +-
 include/configs/PLU405.h                           |   11 +-
 include/configs/PM520.h                            |   11 +-
 include/configs/PM826.h                            |    9 +-
 include/configs/PM828.h                            |    9 +-
 include/configs/PM854.h                            |   14 +-
 include/configs/PM856.h                            |   14 +-
 include/configs/PMC405.h                           |   11 +-
 include/configs/PMC440.h                           |   14 +-
 include/configs/PPChameleonEVB.h                   |   11 +-
 include/configs/R360MPI.h                          |   19 +-
 include/configs/RBC823.h                           |    9 +-
 include/configs/RPXClassic.h                       |   23 +-
 include/configs/RPXsuper.h                         |   12 +-
 include/configs/RRvision.h                         |   13 +-
 include/configs/SBC8540.h                          |   14 +-
 include/configs/SCM.h                              |   11 +-
 include/configs/SIMPC8313.h                        |   15 +-
 include/configs/SMN42.h                            |   22 +-
 include/configs/SX1.h                              |    7 +-
 include/configs/SXNI855T.h                         |    8 +-
 include/configs/Sandpoint8240.h                    |   20 +-
 include/configs/Sandpoint8245.h                    |   20 +-
 include/configs/TASREG.h                           |   27 +-
 include/configs/TB5200.h                           |   12 +-
 include/configs/TK885D.h                           |   13 +-
 include/configs/TOP5200.h                          |   26 +-
 include/configs/TOP860.h                           |   11 +-
 include/configs/TQM5200.h                          |   12 +-
 include/configs/TQM8260.h                          |    9 +-
 include/configs/TQM8272.h                          |   15 +-
 include/configs/TQM834x.h                          |   10 +-
 include/configs/TQM855M.h                          |   13 +-
 include/configs/TQM85xx.h                          |   14 +-
 include/configs/TQM866M.h                          |   13 +-
 include/configs/TQM885D.h                          |   13 +-
 include/configs/Total5200.h                        |   11 +-
 include/configs/VCMA9.h                            |   10 +-
 include/configs/VOH405.h                           |   11 +-
 include/configs/VOM405.h                           |   11 +-
 include/configs/W7OLMC.h                           |   11 +-
 include/configs/W7OLMG.h                           |   11 +-
 include/configs/WUH405.h                           |   11 +-
 include/configs/XPEDITE1K.h                        |   12 +-
 include/configs/XPEDITE5200.h                      |   17 +-
 include/configs/XPEDITE5370.h                      |   17 +-
 include/configs/Yukon8220.h                        |    7 +-
 include/configs/acadia.h                           |    2 +-
 include/configs/aev.h                              |   12 +-
 include/configs/alpr.h                             |   12 +-
 include/configs/amcc-common.h                      |   16 +-
 include/configs/aria.h                             |   25 +-
 include/configs/bamboo.h                           |    2 +-
 include/configs/barco.h                            |   20 +-
 include/configs/bf518f-ezbrd.h                     |    9 +-
 include/configs/bf526-ezbrd.h                      |    9 +-
 include/configs/bf527-ezkit.h                      |    9 +-
 include/configs/bf533-ezkit.h                      |   11 +-
 include/configs/bf533-stamp.h                      |   48 ++-
 include/configs/bf537-stamp.h                      |    9 +-
 include/configs/bf538f-ezkit.h                     |    9 +-
 include/configs/bf548-ezkit.h                      |    9 +-
 include/configs/bf561-ezkit.h                      |    9 +-
 include/configs/bfin_adi_common.h                  |    2 +-
 include/configs/bubinga.h                          |    2 +-
 include/configs/canyonlands.h                      |    2 +-
 include/configs/cm5200.h                           |   12 +-
 include/configs/cogent_mpc8xx.h                    |    9 +-
 include/configs/cpci5200.h                         |   11 +-
 include/configs/csb272.h                           |   11 +-
 include/configs/csb472.h                           |   11 +-
 include/configs/davinci_dvevm.h                    |    7 +-
 include/configs/davinci_schmoogie.h                |    7 +-
 include/configs/davinci_sffsdr.h                   |    7 +-
 include/configs/davinci_sonata.h                   |    7 +-
 include/configs/debris.h                           |   20 +-
 include/configs/delta.h                            |   10 +-
 include/configs/digsy_mtc.h                        |   10 +-
 include/configs/eXalion.h                          |    9 +-
 include/configs/ebony.h                            |    2 +-
 include/configs/ep8248.h                           |   11 +-
 include/configs/ep8260.h                           |   14 +-
 include/configs/ep82xxm.h                          |   11 +-
 include/configs/gdppc440etx.h                      |    2 +-
 include/configs/hmi1001.h                          |   10 +-
 include/configs/hymod.h                            |   12 +-
 include/configs/imx31_phycore.h                    |    9 +-
 include/configs/innokom.h                          |    8 +-
 include/configs/jupiter.h                          |   19 -
 include/configs/katmai.h                           |    2 +-
 include/configs/kilauea.h                          |    2 +-
 include/configs/km8xx.h                            |   29 +-
 include/configs/kmeter1.h                          |   30 +-
 include/configs/kmsupx4.h                          |   21 +
 include/configs/korat.h                            |   12 +-
 include/configs/kvme080.h                          |    8 +-
 include/configs/luan.h                             |    2 +-
 include/configs/lwmon.h                            |   13 +-
 include/configs/lwmon5.h                           |   12 +-
 include/configs/makalu.h                           |    2 +-
 include/configs/mcc200.h                           |   10 +-
 include/configs/mecp5123.h                         |   22 +-
 include/configs/mecp5200.h                         |   10 +-
 include/configs/mgcoge.h                           |   33 +-
 include/configs/mgsuvd.h                           |   24 +
 include/configs/motionpro.h                        |   10 +-
 include/configs/mpc5121ads.h                       |   21 +-
 include/configs/mpc7448hpc2.h                      |    8 +-
 include/configs/muas3001.h                         |   11 +-
 include/configs/mucmc52.h                          |   10 +-
 include/configs/neo.h                              |    2 +-
 include/configs/netstal-common.h                   |   11 +-
 include/configs/netstar.h                          |    7 +-
 include/configs/o2dnt.h                            |   11 +-
 include/configs/ocotea.h                           |    2 +-
 include/configs/omap2420h4.h                       |    7 +-
 include/configs/p3p440.h                           |   12 +-
 include/configs/pcs440ep.h                         |   12 +-
 include/configs/pcu_e.h                            |    9 +-
 include/configs/pdnb3.h                            |   11 +-
 include/configs/pf5200.h                           |   11 +-
 include/configs/quad100hd.h                        |   12 +-
 include/configs/redwood.h                          |    2 +-
 include/configs/rmu.h                              |   11 +-
 include/configs/rsdproto.h                         |   11 +-
 include/configs/sacsng.h                           |   12 +-
 include/configs/sbc405.h                           |   12 +-
 include/configs/sbc8260.h                          |   12 +-
 include/configs/sbc8349.h                          |   15 +-
 include/configs/sbc8548.h                          |   12 +-
 include/configs/sbc8560.h                          |   14 +-
 include/configs/sbc8641d.h                         |   14 +-
 include/configs/sc3.h                              |   13 +-
 include/configs/sequoia.h                          |    2 +-
 include/configs/smmaco4.h                          |   12 +-
 include/configs/socrates.h                         |   19 +-
 include/configs/sorcery.h                          |    8 +-
 include/configs/spc1920.h                          |   13 +-
 include/configs/stxgp3.h                           |   18 +-
 include/configs/stxssa.h                           |   13 +-
 include/configs/taihu.h                            |    2 +-
 include/configs/taishan.h                          |    2 +-
 include/configs/trab.h                             |   10 +-
 include/configs/uc100.h                            |   13 +-
 include/configs/uc101.h                            |   11 +-
 include/configs/utx8245.h                          |   12 +-
 include/configs/v38b.h                             |   10 +-
 include/configs/vct.h                              |   12 +-
 include/configs/voiceblue.h                        |    7 +-
 include/configs/walnut.h                           |    2 +-
 include/configs/xm250.h                            |    8 +-
 include/configs/yosemite.h                         |    2 +-
 include/configs/yucca.h                            |    2 +-
 include/configs/zeus.h                             |   12 +-
 include/i2c.h                                      |  216 +++++++-
 include/mpc8220.h                                  |   26 +
 lib_arm/board.c                                    |   14 +-
 lib_blackfin/board.c                               |    8 +
 lib_m68k/board.c                                   |   15 +-
 lib_mips/board.c                                   |    8 +
 lib_ppc/board.c                                    |   15 +-
 351 files changed, 4085 insertions(+), 3570 deletions(-)
 delete mode 100644 board/sandburst/common/ppc440gx_i2c.c
 delete mode 100644 board/sandburst/common/ppc440gx_i2c.h
 delete mode 100644 cpu/mpc512x/i2c.c
 delete mode 100644 cpu/mpc5xxx/i2c.c
 delete mode 100644 cpu/mpc8220/i2c.c
 create mode 100644 drivers/i2c/i2c_core.c
 create mode 100644 drivers/i2c/mpc5xxx_i2c.c
 rename cpu/mpc824x/drivers/i2c/i2c.c => drivers/i2c/mpc824x_i2c.c (85%)
 rename cpu/mpc8260/i2c.c => drivers/i2c/mpc8260_i2c.c (94%)
 rename cpu/mpc8xx/i2c.c => drivers/i2c/mpc8xx_i2c.c (95%)
 rename cpu/ppc4xx/i2c.c => drivers/i2c/ppc4xx_i2c.c (72%)
 rename cpu/pxa/i2c.c => drivers/i2c/pxa_i2c.c (92%)

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list