Skip to contentSkip to conversation

eeprom: Cleanup and support for multiple i2c busses

RFC PATCH New Marek Vasut 4 participants 37 messages Oct 20, 2014 – Nov 10, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover eeprom: Cleanup and support for multiple i2c busses

This patch series first zaps a couple of ancient boards and ugly code which was in the way of proper cleanup for the eeprom command. Once that is done, the eeprom command undergoes proper cleaning. Finally, there is one patch which adds support for selecting on which bus the I2C EEPROM is. This functionality seems to be in high demand, which is exactly the reason why some boards decided to implement this themselves :-(

This series makes U-Boot also less IoT, since it removes all the nice PHP, CSS and SQL stuff from it ;-)

Marek Vasut (25):
ppc: Zap ICU862 board
ppc: Zap MHPC board
ppc: Zap Hymod board
ppc: Zap HWW1U1A board
ppc: Zap IDS8247 board
ppc: Zap TQM8260 board
ppc: Zap TQM8272 board
arm: Zap tricorder-eeprom
eeprom: Shuffle code around
eeprom: Zap CONFIG_SYS_I2C_MULTI_EEPROMS
eeprom: Zap CONFIG_SYS_EEPROM_X40430
eeprom: Zap eeprom_probe()
eeprom: Zap CONFIG_SPI_X
eeprom: Pull out the I/O code
eeprom: Pull out address computation
eeprom: Make eeprom_write_enable() weak
eeprom: Pull out CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS
eeprom: Suck the ifdef into eeprom_init()
eeprom: Pull out CONFIG_SYS_EEPROM_PAGE_WRITE_BITS
eeprom: Pull out transfer length computation
eeprom: Pull out the RW loop
eeprom: Cultivate the ifdef mess
eeprom: Add bus argument to eeprom_init()
eeprom: Add support for selecting i2c bus
eeprom: Clean up checkpatch issues

 README                                        |   5 -
 arch/powerpc/cpu/mpc8260/Kconfig              |  16 -
 arch/powerpc/cpu/mpc8260/ether_fcc.c          |  27 +-
 arch/powerpc/cpu/mpc8260/interrupts.c         |  10 +-
 arch/powerpc/cpu/mpc8260/pci.c                |   2 -
 arch/powerpc/cpu/mpc8260/start.S              |  14 -
 arch/powerpc/cpu/mpc83xx/start.S              |  11 -
 arch/powerpc/cpu/mpc85xx/Kconfig              |   4 -
 arch/powerpc/cpu/mpc8xx/Kconfig               |   8 -
 arch/powerpc/cpu/mpc8xx/cpu_init.c            |   2 -
 arch/powerpc/cpu/mpc8xx/fec.c                 |  40 +-
 arch/powerpc/include/asm/u-boot.h             |   3 -
 board/corscience/tricorder/Makefile           |   2 +-
 board/corscience/tricorder/tricorder-eeprom.c | 251 -------
 board/corscience/tricorder/tricorder-eeprom.h |  41 --
 board/eltec/mhpc/Kconfig                      |  12 -
 board/eltec/mhpc/MAINTAINERS                  |   6 -
 board/eltec/mhpc/Makefile                     |   8 -
 board/eltec/mhpc/flash.c                      | 414 -----------
 board/eltec/mhpc/mhpc.c                       | 465 -------------
 board/eltec/mhpc/u-boot.lds.debug             | 121 ----
 board/exmeritus/hww1u1a/Kconfig               |  12 -
 board/exmeritus/hww1u1a/MAINTAINERS           |   6 -
 board/exmeritus/hww1u1a/Makefile              |  12 -
 board/exmeritus/hww1u1a/ddr.c                 |  34 -
 board/exmeritus/hww1u1a/gpios.h               |  56 --
 board/exmeritus/hww1u1a/hww1u1a.c             | 268 --------
 board/exmeritus/hww1u1a/law.c                 |  18 -
 board/exmeritus/hww1u1a/tlb.c                 |  90 ---
 board/hymod/Kconfig                           |   9 -
 board/hymod/MAINTAINERS                       |   6 -
 board/hymod/Makefile                          |   8 -
 board/hymod/bsp.c                             | 387 -----------
 board/hymod/config.mk                         |  14 -
 board/hymod/eeprom.c                          | 678 ------------------
 board/hymod/env.c                             | 221 ------
 board/hymod/fetch.c                           |  91 ---
 board/hymod/flash.c                           | 490 -------------
 board/hymod/flash.h                           | 140 ----
 board/hymod/global_env                        | 145 ----
 board/hymod/hymod.c                           | 521 --------------
 board/hymod/hymod.h                           | 305 ---------
 board/hymod/input.c                           |  91 ---
 board/hymod/u-boot.lds                        | 132 ----
 board/hymod/u-boot.lds.debug                  | 121 ----
 board/icu862/Kconfig                          |   9 -
 board/icu862/MAINTAINERS                      |   7 -
 board/icu862/Makefile                         |   8 -
 board/icu862/flash.c                          | 575 ----------------
 board/icu862/icu862.c                         | 199 ------
 board/icu862/pcmcia.c                         | 262 -------
 board/icu862/u-boot.lds                       |  82 ---
 board/icu862/u-boot.lds.debug                 | 122 ----
 board/ids/ids8247/Kconfig                     |  12 -
 board/ids/ids8247/MAINTAINERS                 |   6 -
 board/ids/ids8247/Makefile                    |  11 -
 board/ids/ids8247/ids8247.c                   | 390 -----------
 board/tqc/tqm8260/Kconfig                     |  12 -
 board/tqc/tqm8260/MAINTAINERS                 |  16 -
 board/tqc/tqm8260/Makefile                    |   8 -
 board/tqc/tqm8260/README                      | 415 -----------
 board/tqc/tqm8260/tqm8260.c                   | 352 ----------
 board/tqc/tqm8272/Kconfig                     |  12 -
 board/tqc/tqm8272/MAINTAINERS                 |   6 -
 board/tqc/tqm8272/Makefile                    |   8 -
 board/tqc/tqm8272/nand.c                      | 264 -------
 board/tqc/tqm8272/tqm8272.c                   | 944 --------------------------
 board/tqc/tqm8272/tqm8272.h                   |  37 -
 common/cmd_eeprom.c                           | 501 +++++---------
 common/env_eeprom.c                           |   4 +-
 configs/HWW1U1A_defconfig                     |   3 -
 configs/ICU862_100MHz_defconfig               |   4 -
 configs/ICU862_defconfig                      |   3 -
 configs/IDS8247_defconfig                     |   3 -
 configs/MHPC_defconfig                        |   3 -
 configs/TQM8255_AA_defconfig                  |   4 -
 configs/TQM8260_AA_defconfig                  |   4 -
 configs/TQM8260_AB_defconfig                  |   4 -
 configs/TQM8260_AC_defconfig                  |   4 -
 configs/TQM8260_AD_defconfig                  |   4 -
 configs/TQM8260_AE_defconfig                  |   4 -
 configs/TQM8260_AF_defconfig                  |   4 -
 configs/TQM8260_AG_defconfig                  |   4 -
 configs/TQM8260_AH_defconfig                  |   4 -
 configs/TQM8260_AI_defconfig                  |   4 -
 configs/TQM8265_AA_defconfig                  |   4 -
 configs/TQM8272_defconfig                     |   3 -
 configs/hymod_defconfig                       |   3 -
 include/asm-generic/u-boot.h                  |   3 -
 include/common.h                              |   8 +-
 include/commproc.h                            |  32 -
 include/configs/BSC9131RDB.h                  |   1 -
 include/configs/BSC9132QDS.h                  |   1 -
 include/configs/C29XPCIE.h                    |   1 -
 include/configs/CPCI405AB.h                   |   1 -
 include/configs/CPCI750.h                     |   1 -
 include/configs/DB64360.h                     |   1 -
 include/configs/DB64460.h                     |   1 -
 include/configs/DU440.h                       |   1 -
 include/configs/HWW1U1A.h                     | 460 -------------
 include/configs/ICU862.h                      | 443 ------------
 include/configs/IDS8247.h                     | 462 -------------
 include/configs/MHPC.h                        | 369 ----------
 include/configs/P1010RDB.h                    |   1 -
 include/configs/PMC440.h                      |   1 -
 include/configs/TQM8260.h                     | 620 -----------------
 include/configs/TQM8272.h                     | 735 --------------------
 include/configs/TQM834x.h                     |   1 -
 include/configs/W7OLMC.h                      |   1 -
 include/configs/W7OLMG.h                      |   1 -
 include/configs/acadia.h                      |   1 -
 include/configs/am335x_evm.h                  |   1 -
 include/configs/am43xx_evm.h                  |   1 -
 include/configs/axs101.h                      |   1 -
 include/configs/bamboo.h                      |   1 -
 include/configs/canyonlands.h                 |   1 -
 include/configs/cpci5200.h                    |   1 -
 include/configs/ebony.h                       |   1 -
 include/configs/hymod.h                       | 728 --------------------
 include/configs/icon.h                        |   1 -
 include/configs/intip.h                       |   1 -
 include/configs/katmai.h                      |   1 -
 include/configs/km/km-powerpc.h               |   1 -
 include/configs/km/km_arm.h                   |   1 -
 include/configs/korat.h                       |   1 -
 include/configs/ks2_evm.h                     |   1 -
 include/configs/luan.h                        |   1 -
 include/configs/m28evk.h                      |   1 -
 include/configs/mecp5200.h                    |   1 -
 include/configs/motionpro.h                   |   1 -
 include/configs/ocotea.h                      |   1 -
 include/configs/p1_p2_rdb_pc.h                |   1 -
 include/configs/p1_twr.h                      |   1 -
 include/configs/pcm051.h                      |   1 -
 include/configs/pengwyn.h                     |   1 -
 include/configs/pf5200.h                      |   1 -
 include/configs/sequoia.h                     |   1 -
 include/configs/t3corp.h                      |   1 -
 include/configs/taishan.h                     |   1 -
 include/configs/tricorder.h                   |   1 -
 include/configs/walnut.h                      |   1 -
 include/configs/yosemite.h                    |   1 -
 include/pcmcia.h                              |   2 -
 include/status_led.h                          |  19 -
 tools/bddb/README                             | 116 ----
 tools/bddb/badsubmit.php                      |  23 -
 tools/bddb/bddb.css                           | 207 ------
 tools/bddb/brlog.php                          | 109 ---
 tools/bddb/browse.php                         | 147 ----
 tools/bddb/config.php                         |  16 -
 tools/bddb/create_tables.sql                  |  90 ---
 tools/bddb/defs.php                           | 710 -------------------
 tools/bddb/dodelete.php                       |  65 --
 tools/bddb/dodellog.php                       |  57 --
 tools/bddb/doedit.php                         | 186 -----
 tools/bddb/doedlog.php                        |  76 ---
 tools/bddb/donew.php                          | 230 -------
 tools/bddb/donewlog.php                       |  86 ---
 tools/bddb/edit.php                           | 131 ----
 tools/bddb/edlog.php                          |  86 ---
 tools/bddb/execute.php                        |  33 -
 tools/bddb/index.php                          |  38 --
 tools/bddb/new.php                            | 120 ----
 tools/bddb/newlog.php                         |  54 --
 164 files changed, 174 insertions(+), 15976 deletions(-)
 delete mode 100644 board/corscience/tricorder/tricorder-eeprom.c
 delete mode 100644 board/corscience/tricorder/tricorder-eeprom.h
 delete mode 100644 board/eltec/mhpc/Kconfig
 delete mode 100644 board/eltec/mhpc/MAINTAINERS
 delete mode 100644 board/eltec/mhpc/Makefile
 delete mode 100644 board/eltec/mhpc/flash.c
 delete mode 100644 board/eltec/mhpc/mhpc.c
 delete mode 100644 board/eltec/mhpc/u-boot.lds.debug
 delete mode 100644 board/exmeritus/hww1u1a/Kconfig
 delete mode 100644 board/exmeritus/hww1u1a/MAINTAINERS
 delete mode 100644 board/exmeritus/hww1u1a/Makefile
 delete mode 100644 board/exmeritus/hww1u1a/ddr.c
 delete mode 100644 board/exmeritus/hww1u1a/gpios.h
 delete mode 100644 board/exmeritus/hww1u1a/hww1u1a.c
 delete mode 100644 board/exmeritus/hww1u1a/law.c
 delete mode 100644 board/exmeritus/hww1u1a/tlb.c
 delete mode 100644 board/hymod/Kconfig
 delete mode 100644 board/hymod/MAINTAINERS
 delete mode 100644 board/hymod/Makefile
 delete mode 100644 board/hymod/bsp.c
 delete mode 100644 board/hymod/config.mk
 delete mode 100644 board/hymod/eeprom.c
 delete mode 100644 board/hymod/env.c
 delete mode 100644 board/hymod/fetch.c
 delete mode 100644 board/hymod/flash.c
 delete mode 100644 board/hymod/flash.h
 delete mode 100644 board/hymod/global_env
 delete mode 100644 board/hymod/hymod.c
 delete mode 100644 board/hymod/hymod.h
 delete mode 100644 board/hymod/input.c
 delete mode 100644 board/hymod/u-boot.lds
 delete mode 100644 board/hymod/u-boot.lds.debug
 delete mode 100644 board/icu862/Kconfig
 delete mode 100644 board/icu862/MAINTAINERS
 delete mode 100644 board/icu862/Makefile
 delete mode 100644 board/icu862/flash.c
 delete mode 100644 board/icu862/icu862.c
 delete mode 100644 board/icu862/pcmcia.c
 delete mode 100644 board/icu862/u-boot.lds
 delete mode 100644 board/icu862/u-boot.lds.debug
 delete mode 100644 board/ids/ids8247/Kconfig
 delete mode 100644 board/ids/ids8247/MAINTAINERS
 delete mode 100644 board/ids/ids8247/Makefile
 delete mode 100644 board/ids/ids8247/ids8247.c
 delete mode 100644 board/tqc/tqm8260/Kconfig
 delete mode 100644 board/tqc/tqm8260/MAINTAINERS
 delete mode 100644 board/tqc/tqm8260/Makefile
 delete mode 100644 board/tqc/tqm8260/README
 delete mode 100644 board/tqc/tqm8260/tqm8260.c
 delete mode 100644 board/tqc/tqm8272/Kconfig
 delete mode 100644 board/tqc/tqm8272/MAINTAINERS
 delete mode 100644 board/tqc/tqm8272/Makefile
 delete mode 100644 board/tqc/tqm8272/nand.c
 delete mode 100644 board/tqc/tqm8272/tqm8272.c
 delete mode 100644 board/tqc/tqm8272/tqm8272.h
 delete mode 100644 configs/HWW1U1A_defconfig
 delete mode 100644 configs/ICU862_100MHz_defconfig
 delete mode 100644 configs/ICU862_defconfig
 delete mode 100644 configs/IDS8247_defconfig
 delete mode 100644 configs/MHPC_defconfig
 delete mode 100644 configs/TQM8255_AA_defconfig
 delete mode 100644 configs/TQM8260_AA_defconfig
 delete mode 100644 configs/TQM8260_AB_defconfig
 delete mode 100644 configs/TQM8260_AC_defconfig
 delete mode 100644 configs/TQM8260_AD_defconfig
 delete mode 100644 configs/TQM8260_AE_defconfig
 delete mode 100644 configs/TQM8260_AF_defconfig
 delete mode 100644 configs/TQM8260_AG_defconfig
 delete mode 100644 configs/TQM8260_AH_defconfig
 delete mode 100644 configs/TQM8260_AI_defconfig
 delete mode 100644 configs/TQM8265_AA_defconfig
 delete mode 100644 configs/TQM8272_defconfig
 delete mode 100644 configs/hymod_defconfig
 delete mode 100644 include/configs/HWW1U1A.h
 delete mode 100644 include/configs/ICU862.h
 delete mode 100644 include/configs/IDS8247.h
 delete mode 100644 include/configs/MHPC.h
 delete mode 100644 include/configs/TQM8260.h
 delete mode 100644 include/configs/TQM8272.h
 delete mode 100644 include/configs/hymod.h
 delete mode 100644 tools/bddb/README
 delete mode 100644 tools/bddb/badsubmit.php
 delete mode 100644 tools/bddb/bddb.css
 delete mode 100644 tools/bddb/brlog.php
 delete mode 100644 tools/bddb/browse.php
 delete mode 100644 tools/bddb/config.php
 delete mode 100644 tools/bddb/create_tables.sql
 delete mode 100644 tools/bddb/defs.php
 delete mode 100644 tools/bddb/dodelete.php
 delete mode 100644 tools/bddb/dodellog.php
 delete mode 100644 tools/bddb/doedit.php
 delete mode 100644 tools/bddb/doedlog.php
 delete mode 100644 tools/bddb/donew.php
 delete mode 100644 tools/bddb/donewlog.php
 delete mode 100644 tools/bddb/edit.php
 delete mode 100644 tools/bddb/edlog.php
 delete mode 100644 tools/bddb/execute.php
 delete mode 100644 tools/bddb/index.php
 delete mode 100644 tools/bddb/new.php
 delete mode 100644 tools/bddb/newlog.php
Cc Tom Rini <[email protected]>
Signature · 1 line
2.1.1
#1 lore raw

PATCH 1/25 ppc: Zap ICU862 board

This board is the only user of CONFIG_SYS_EEPROM_X40430 , remove it so the EEPROM command code can be cleansed of the related code as well.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc8xx/Kconfig    |   4 -
 arch/powerpc/cpu/mpc8xx/cpu_init.c |   1 -
 arch/powerpc/cpu/mpc8xx/fec.c      |  40 +--
 board/icu862/Kconfig               |   9 -
 board/icu862/MAINTAINERS           |   7 -
 board/icu862/Makefile              |   8 -
 board/icu862/flash.c               | 575 -------------------------------------
 board/icu862/icu862.c              | 199 -------------
 board/icu862/pcmcia.c              | 262 -----------------
 board/icu862/u-boot.lds            |  82 ------
 board/icu862/u-boot.lds.debug      | 122 --------
 configs/ICU862_100MHz_defconfig    |   4 -
 configs/ICU862_defconfig           |   3 -
 include/commproc.h                 |  10 -
 include/configs/ICU862.h           | 443 ----------------------------
 include/pcmcia.h                   |   2 -
 include/status_led.h               |  19 --
 17 files changed, 1 insertion(+), 1789 deletions(-)
 delete mode 100644 board/icu862/Kconfig
 delete mode 100644 board/icu862/MAINTAINERS
 delete mode 100644 board/icu862/Makefile
 delete mode 100644 board/icu862/flash.c
 delete mode 100644 board/icu862/icu862.c
 delete mode 100644 board/icu862/pcmcia.c
 delete mode 100644 board/icu862/u-boot.lds
 delete mode 100644 board/icu862/u-boot.lds.debug
 delete mode 100644 configs/ICU862_100MHz_defconfig
 delete mode 100644 configs/ICU862_defconfig
 delete mode 100644 include/configs/ICU862.h
arch/powerpc/cpu/mpc8xx/Kconfig +0 -4
index f1dca90..171bee9 100644
@@ -16,9 +16,6 @@ config TARGET_ESTEEM192E
 config TARGET_HERMES
 	bool "Support hermes"
 
-config TARGET_ICU862
-	bool "Support ICU862"
-
 config TARGET_IP860
 	bool "Support IP860"
 
@@ -124,7 +121,6 @@ source "board/eltec/mhpc/Kconfig"
 source "board/emk/top860/Kconfig"
 source "board/esteem192e/Kconfig"
 source "board/hermes/Kconfig"
-source "board/icu862/Kconfig"
 source "board/ip860/Kconfig"
 source "board/ivm/Kconfig"
 source "board/kup/kup4k/Kconfig"
arch/powerpc/cpu/mpc8xx/cpu_init.c +0 -1
index 90c7e61..b8dc14d 100644
@@ -126,7 +126,6 @@ void cpu_init_f (volatile immap_t * immr)
 	 */
 
 #if defined(CONFIG_HERMES)	|| \
-    defined(CONFIG_ICU862)	|| \
     defined(CONFIG_IP860)	|| \
     defined(CONFIG_IVML24)	|| \
     defined(CONFIG_IVMS8)	|| \
arch/powerpc/cpu/mpc8xx/fec.c +1 -39
index d12b3df..22b8ec7 100644
@@ -205,11 +205,7 @@ static int fec_send(struct eth_device *dev, void *packet, int length)
 
 	j = 0;
 	while ((rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY) && (j<TOUT_LOOP)) {
-#if defined(CONFIG_ICU862)
-		udelay(10);
-#else
 		udelay(1);
-#endif
 		j++;
 	}
 	if (j>=TOUT_LOOP) {
@@ -424,7 +420,7 @@ static void fec_pin_init(int fecidx)
 
 #endif /* !CONFIG_RMII */
 
-#elif !defined(CONFIG_ICU862)
+#else
 		/*
 		 * Configure all of port D for MII.
 		 */
@@ -437,42 +433,8 @@ static void fec_pin_init(int fecidx)
 			immr->im_ioport.iop_pddir = 0x1c58;	/* Pre rev. D */
 		else
 			immr->im_ioport.iop_pddir = 0x1fff;	/* Rev. D and later */
-#else
-		/*
-		 * Configure port A for MII.
-		 */
-
-#if defined(CONFIG_ICU862) && defined(CONFIG_SYS_DISCOVER_PHY)
-
-		/*
-		 * On the ICU862 board the MII-MDC pin is routed to PD8 pin
-		 * * of CPU, so for this board we need to configure Utopia and
-		 * * enable PD8 to MII-MDC function
-		 */
-		immr->im_ioport.iop_pdpar |= 0x4080;
 #endif
 
-		/*
-		 * Has Utopia been configured?
-		 */
-		if (immr->im_ioport.iop_pdpar & (0x8000 >> 1)) {
-			/*
-			 * YES - Use MUXED mode for UTOPIA bus.
-			 * This frees Port A for use by MII (see 862UM table 41-6).
-			 */
-			immr->im_ioport.utmode &= ~0x80;
-		} else {
-			/*
-			 * NO - set SPLIT mode for UTOPIA bus.
-			 *
-			 * This doesn't really effect UTOPIA (which isn't
-			 * enabled anyway) but just tells the 862
-			 * to use port A for MII (see 862UM table 41-6).
-			 */
-			immr->im_ioport.utmode |= 0x80;
-		}
-#endif				/* !defined(CONFIG_ICU862) */
-
 #endif	/* CONFIG_ETHER_ON_FEC1 */
 	} else if (fecidx == 1) {
 
board/icu862/Kconfig deleted +0 -9
deleted file mode 100644
index da11d7b..0000000
@@ -1,9 +0,0 @@
-if TARGET_ICU862
-
-config SYS_BOARD
-	default "icu862"
-
-config SYS_CONFIG_NAME
-	default "ICU862"
-
-endif
board/icu862/MAINTAINERS deleted +0 -7
deleted file mode 100644
index 7fe16d1..0000000
@@ -1,7 +0,0 @@
-ICU862 BOARD
-M:	Wolfgang Denk <[email protected]>
-S:	Maintained
-F:	board/icu862/
-F:	include/configs/ICU862.h
-F:	configs/ICU862_defconfig
-F:	configs/ICU862_100MHz_defconfig
board/icu862/Makefile deleted +0 -8
deleted file mode 100644
index 263f21b..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2001-2006
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	= icu862.o flash.o pcmcia.o
board/icu862/flash.c deleted +0 -575

575 lines not on this page · raw message

board/icu862/icu862.c deleted +0 -199

199 lines not on this page · raw message

board/icu862/pcmcia.c deleted +0 -262

262 lines not on this page · raw message

board/icu862/u-boot.lds deleted +0 -82

82 lines not on this page · raw message

board/icu862/u-boot.lds.debug deleted +0 -122

122 lines not on this page · raw message

configs/ICU862_100MHz_defconfig deleted +0 -4
deleted file mode 100644
index 72f0dfa..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="100MHz"
-CONFIG_PPC=y
-CONFIG_8xx=y
-CONFIG_TARGET_ICU862=y
configs/ICU862_defconfig deleted +0 -3
deleted file mode 100644
index b58ea05..0000000
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_8xx=y
-CONFIG_TARGET_ICU862=y
include/commproc.h +0 -10
index 82a1a98..d481707 100644
@@ -563,16 +563,6 @@ typedef struct scc_enet {
 
 #endif	/* CONFIG_HERMES */
 
-/*** ICU862  **********************************************************/
-
-#if defined(CONFIG_ICU862)
-
-#ifdef CONFIG_FEC_ENET
-#define FEC_ENET	/* use FEC for EThernet */
-#endif  /* CONFIG_FEC_ETHERNET */
-
-#endif /* CONFIG_ICU862 */
-
 /***  IP860  **********************************************************/
 
 #if defined(CONFIG_IP860)
include/configs/ICU862.h deleted +0 -443

443 lines not on this page · raw message

include/pcmcia.h +0 -2
index 4b667f4..00065b2 100644
@@ -29,8 +29,6 @@
 # define CONFIG_PCMCIA_SLOT_A
 #elif defined(CONFIG_LWMON)		/* The LWMON  use SLOT_B	*/
 # define CONFIG_PCMCIA_SLOT_B
-#elif defined(CONFIG_ICU862)		/* The ICU862 use SLOT_B	*/
-# define CONFIG_PCMCIA_SLOT_B
 #elif defined(CONFIG_R360MPI)		/* The R360MPI use SLOT_B	*/
 # define CONFIG_PCMCIA_SLOT_B
 #elif defined(CONFIG_ATC)		/* The ATC use SLOT_A	*/
include/status_led.h +0 -19
index c1d2242..c5de894 100644
@@ -114,25 +114,6 @@ void status_led_set  (int led, int state);
 # define STATUS_LED_GREEN	1
 # define STATUS_LED_BOOT	2		/* IDE LED used for boot status */
 
-/*****  ICU862   ********************************************************/
-#elif defined(CONFIG_ICU862)
-
-# define STATUS_LED_PAR		im_ioport.iop_papar
-# define STATUS_LED_DIR		im_ioport.iop_padir
-# define STATUS_LED_ODR		im_ioport.iop_paodr
-# define STATUS_LED_DAT		im_ioport.iop_padat
-
-# define STATUS_LED_BIT		0x4000		/* LED 0 is on PA.1 */
-# define STATUS_LED_PERIOD	(CONFIG_SYS_HZ / 2)
-# define STATUS_LED_STATE	STATUS_LED_BLINKING
-# define STATUS_LED_BIT1	0x1000		/* LED 1 is on PA.3 */
-# define STATUS_LED_PERIOD1	(CONFIG_SYS_HZ)
-# define STATUS_LED_STATE1	STATUS_LED_OFF
-
-# define STATUS_LED_ACTIVE	1		/* LED on for bit == 1	*/
-
-# define STATUS_LED_BOOT	0		/* LED 0 used for boot status */
-
 /*****  Someone else defines these  *************************************/
 #elif defined(STATUS_LED_PAR)
 
Signature · 1 line
2.1.1
#2 lore raw

PATCH 1/25 ppc: Zap ICU862 board

Hi Marek,

Quoted 10 lines · On Mon, 20 Oct 2014 03:48:02 +0200 Marek Vasut <[email protected]> wrote:

This board is the only user of CONFIG_SYS_EEPROM_X40430 , remove it so the EEPROM command code can be cleansed of the related code as well.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>

Can we do this all day long?
I am happy with 01/25 thru 07/25. :-)

There is only one item I can tell:
I know it is a tedious work, but can you update doc/README.scrapyard, please?
It seems a rule in U-boot when dumping board supports.

Best Regards
Masahiro Yamada

#3 lore raw

PATCH 1/25 ppc: Zap ICU862 board

Quoted 1 line · Masahiro Yamada

Hi Marek,

Hi!

Quoted 14 lines

On Mon, 20 Oct 2014 03:48:02 +0200

Quoted 10 lines · Marek Vasut

This board is the only user of CONFIG_SYS_EEPROM_X40430 , remove it so the EEPROM command code can be cleansed of the related code as well.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
Quoted 2 lines

Can we do this all day long?
I am happy with 01/25 thru 07/25. :-)

With pleasure ;-) Scrubbing old ad-hoc stuff is really enjoyable.

Quoted 4 lines

There is only one item I can tell:
I know it is a tedious work, but can you update doc/README.scrapyard, please?
It seems a rule in U-boot when dumping board supports.

Ah, you're right, we have this thing. One thing I'm not sure about is how is someone supposed to determine the commit in which the board was removed before the commit was created in the upstream repository. This kinda doesn't add up to me.

Best regards,
Marek Vasut

#4 lore raw

PATCH 1/25 ppc: Zap ICU862 board

Dear Marek,

Quoted 5 lines · In message <[email protected]> you wrote:

Ah, you're right, we have this thing. One thing I'm not sure about is how is someone supposed to determine the commit in which the board was removed before the commit was created in the upstream repository. This kinda doesn't add up to me.

You just insert place holders for the boards you are touching, and fix up older entries that already hit mainline.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How many seconds are there in a year? If I tell you there are 3.155 x
10^7, you won't even try to remember it. On the other hand, who could
forget that, to within half a percent, pi seconds is  a  nanocentury.
                                               -- Tom Duff, Bell Labs
#5 lore raw

PATCH 1/25 ppc: Zap ICU862 board

Quoted 10 lines · Wolfgang Denk

Dear Marek,

Quoted 4 lines · In message <[email protected]> you wrote:

Ah, you're right, we have this thing. One thing I'm not sure about is how is someone supposed to determine the commit in which the board was removed before the commit was created in the upstream repository. This kinda doesn't add up to me.

You just insert place holders for the boards you are touching, and fix up older entries that already hit mainline.

I wonder if we shouldn't get rid of this README.scrapyard. Personally, I don't find much value in it to be honest ; if I am looking for some ancient board, I just do git log -p and search for whatever I need.

That said, I will fix up the patches ... also, I will split the removal from the eeprom changes, so the removal doesn't block the eeprom stuff.

Best regards,
Marek Vasut

#6 lore raw

PATCH 1/25 ppc: Zap ICU862 board

Hi Marek,

Quoted 9 lines · On Wed, 22 Oct 2014 21:10:28 +0200 Marek Vasut <[email protected]> wrote:
Quoted 8 lines · Wolfgang Denk

Dear Marek,

Quoted 4 lines · In message <[email protected]> you wrote:

Ah, you're right, we have this thing. One thing I'm not sure about is how is someone supposed to determine the commit in which the board was removed before the commit was created in the upstream repository. This kinda doesn't add up to me.

Quoted 6 lines
Quoted 2 lines

You just insert place holders for the boards you are touching, and fix up older entries that already hit mainline.

I wonder if we shouldn't get rid of this README.scrapyard. Personally, I don't find much value in it to be honest ; if I am looking for some ancient board, I just do git log -p and search for whatever I need.

I stick to it if this rule is a decision of u-boot community, but I have also been wondering it. It is true we need some effort to maintain this file.

Maybe you should open a new thread to discuss removal of doc/README.scrapyard.

Best Regards
Masahiro Yamada

#7 lore raw

PATCH 1/25 ppc: Zap ICU862 board

Quoted 1 line · Masahiro Yamada

Hi Marek,

Hello!

Quoted 19 lines

On Wed, 22 Oct 2014 21:10:28 +0200

Quoted 9 lines · Marek Vasut
Quoted 8 lines · Wolfgang Denk

Dear Marek,

Quoted 4 lines · In message <[email protected]> you wrote:

Ah, you're right, we have this thing. One thing I'm not sure about is how is someone supposed to determine the commit in which the board was removed before the commit was created in the upstream repository. This kinda doesn't add up to me.

Quoted 6 lines
Quoted 2 lines

You just insert place holders for the boards you are touching, and fix up older entries that already hit mainline.

I wonder if we shouldn't get rid of this README.scrapyard. Personally, I don't find much value in it to be honest ; if I am looking for some ancient board, I just do git log -p and search for whatever I need.

Quoted 6 lines

I stick to it if this rule is a decision of u-boot community, but I have also been wondering it. It is true we need some effort to maintain this file.

Maybe you should open a new thread to discuss removal of doc/README.scrapyard.

You're right, done!

Best regards,
Marek Vasut

#8 lore raw

PATCH 1/25 ppc: Zap ICU862 board

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 10 lines · In message <[email protected]> you wrote:

This board is the only user of CONFIG_SYS_EEPROM_X40430 , remove it so the EEPROM command code can be cleansed of the related code as well.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>

Assuming you also add an entry to scrapyard:

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
To make this work we'd need a patch, as nobody of us tests this.
- L. Poettering in https://bugs.freedesktop.org/show_bug.cgi?id=74589
#9 lore raw

PATCH 2/25 ppc: Zap MHPC board

In reply to Marek Vasut

This board uses eeprom accessors in an incorrect way. The board is old and unsupported, just zap it.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc8xx/Kconfig    |   4 -
 arch/powerpc/cpu/mpc8xx/cpu_init.c |   1 -
 board/eltec/mhpc/Kconfig           |  12 -
 board/eltec/mhpc/MAINTAINERS       |   6 -
 board/eltec/mhpc/Makefile          |   8 -
 board/eltec/mhpc/flash.c           | 414 ---------------------------------
 board/eltec/mhpc/mhpc.c            | 465 -------------------------------------
 board/eltec/mhpc/u-boot.lds.debug  | 121 ----------
 configs/MHPC_defconfig             |   3 -
 include/commproc.h                 |  22 --
 include/configs/MHPC.h             | 369 -----------------------------
 11 files changed, 1425 deletions(-)
 delete mode 100644 board/eltec/mhpc/Kconfig
 delete mode 100644 board/eltec/mhpc/MAINTAINERS
 delete mode 100644 board/eltec/mhpc/Makefile
 delete mode 100644 board/eltec/mhpc/flash.c
 delete mode 100644 board/eltec/mhpc/mhpc.c
 delete mode 100644 board/eltec/mhpc/u-boot.lds.debug
 delete mode 100644 configs/MHPC_defconfig
 delete mode 100644 include/configs/MHPC.h
arch/powerpc/cpu/mpc8xx/Kconfig +0 -4
index 171bee9..4c150a8 100644
@@ -40,9 +40,6 @@ config TARGET_RRVISION
 config TARGET_SPD823TS
 	bool "Support SPD823TS"
 
-config TARGET_MHPC
-	bool "Support MHPC"
-
 config TARGET_TOP860
 	bool "Support TOP860"
 
@@ -117,7 +114,6 @@ endchoice
 source "board/LEOX/elpt860/Kconfig"
 source "board/RRvision/Kconfig"
 source "board/cogent/Kconfig"
-source "board/eltec/mhpc/Kconfig"
 source "board/emk/top860/Kconfig"
 source "board/esteem192e/Kconfig"
 source "board/hermes/Kconfig"
arch/powerpc/cpu/mpc8xx/cpu_init.c +0 -1
index b8dc14d..60c401e 100644
@@ -130,7 +130,6 @@ void cpu_init_f (volatile immap_t * immr)
     defined(CONFIG_IVML24)	|| \
     defined(CONFIG_IVMS8)	|| \
     defined(CONFIG_LWMON)	|| \
-    defined(CONFIG_MHPC)	|| \
     defined(CONFIG_R360MPI)	|| \
     defined(CONFIG_RMU)		|| \
     defined(CONFIG_SPD823TS)
board/eltec/mhpc/Kconfig deleted +0 -12
deleted file mode 100644
index 5a4c884..0000000
@@ -1,12 +0,0 @@
-if TARGET_MHPC
-
-config SYS_BOARD
-	default "mhpc"
-
-config SYS_VENDOR
-	default "eltec"
-
-config SYS_CONFIG_NAME
-	default "MHPC"
-
-endif
board/eltec/mhpc/MAINTAINERS deleted +0 -6
deleted file mode 100644
index 4d84a35..0000000
@@ -1,6 +0,0 @@
-MHPC BOARD
-M:	Frank Gottschling <[email protected]>
-S:	Maintained
-F:	board/eltec/mhpc/
-F:	include/configs/MHPC.h
-F:	configs/MHPC_defconfig
board/eltec/mhpc/Makefile deleted +0 -8
deleted file mode 100644
index f3fcc2f..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2000-2006
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	= mhpc.o flash.o
board/eltec/mhpc/flash.c deleted +0 -414

414 lines not on this page · raw message

board/eltec/mhpc/mhpc.c deleted +0 -465

465 lines not on this page · raw message

board/eltec/mhpc/u-boot.lds.debug deleted +0 -121

121 lines not on this page · raw message

configs/MHPC_defconfig deleted +0 -3
deleted file mode 100644
index b05d3c4..0000000
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_8xx=y
-CONFIG_TARGET_MHPC=y
include/commproc.h +0 -22
index d481707..d78ab00 100644
@@ -703,28 +703,6 @@ typedef struct scc_enet {
 #define SICR_ENET_CLKRT	((uint)0x00250000)
 #endif	/* CONFIG_KM8XX */
 
-
-/***  MHPC  ********************************************************/
-
-#if defined(CONFIG_MHPC)
-/* This ENET stuff is for the MHPC with ethernet on SCC2.
- * Note TENA is on Port B.
- */
-#define	PROFF_ENET	PROFF_SCC2
-#define	CPM_CR_ENET	CPM_CR_CH_SCC2
-#define	SCC_ENET	1
-#define PA_ENET_RXD	((ushort)0x0004)	/* PA 13 */
-#define PA_ENET_TXD	((ushort)0x0008)	/* PA 12 */
-#define PA_ENET_RCLK	((ushort)0x0200)	/* PA 6 */
-#define PA_ENET_TCLK	((ushort)0x0400)	/* PA 5 */
-#define PB_ENET_TENA	((uint)0x00002000)	/* PB 18 */
-#define PC_ENET_CLSN	((ushort)0x0040)	/* PC 9 */
-#define PC_ENET_RENA	((ushort)0x0080)	/* PC 8 */
-
-#define SICR_ENET_MASK	((uint)0x0000ff00)
-#define SICR_ENET_CLKRT	((uint)0x00002e00)	/* RCLK-CLK2, TCLK-CLK3 */
-#endif	/* CONFIG_MHPC */
-
 /***  NETVIA  *******************************************************/
 
 #if defined(CONFIG_NETVIA)
include/configs/MHPC.h deleted +0 -369

369 lines not on this page · raw message

Signature · 1 line
2.1.1
#10 lore raw

PATCH 3/25 ppc: Zap Hymod board

In reply to Marek Vasut

Remove this board as this is the only one last user of eeprom_probe(), which is pretty non-standard stuff.

This patch also removes all the PHP, SQL and CSS stuff from U-Boot, which probably makes U-Boot a bit less IoT ;-)

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc8260/Kconfig      |   4 -
 arch/powerpc/cpu/mpc8260/ether_fcc.c  |  27 +-
 arch/powerpc/cpu/mpc8260/interrupts.c |  10 +-
 arch/powerpc/cpu/mpc8260/start.S      |  14 -
 arch/powerpc/cpu/mpc83xx/start.S      |  11 -
 arch/powerpc/include/asm/u-boot.h     |   3 -
 board/hymod/Kconfig                   |   9 -
 board/hymod/MAINTAINERS               |   6 -
 board/hymod/Makefile                  |   8 -
 board/hymod/bsp.c                     | 387 ------------------
 board/hymod/config.mk                 |  14 -
 board/hymod/eeprom.c                  | 678 -------------------------------
 board/hymod/env.c                     | 221 -----------
 board/hymod/fetch.c                   |  91 -----
 board/hymod/flash.c                   | 490 -----------------------
 board/hymod/flash.h                   | 140 -------
 board/hymod/global_env                | 145 -------
 board/hymod/hymod.c                   | 521 ------------------------
 board/hymod/hymod.h                   | 305 --------------
 board/hymod/input.c                   |  91 -----
 board/hymod/u-boot.lds                | 132 ------
 board/hymod/u-boot.lds.debug          | 121 ------
 configs/hymod_defconfig               |   3 -
 include/asm-generic/u-boot.h          |   3 -
 include/common.h                      |   3 -
 include/configs/hymod.h               | 728 ----------------------------------
 tools/bddb/README                     | 116 ------
 tools/bddb/badsubmit.php              |  23 --
 tools/bddb/bddb.css                   | 207 ----------
 tools/bddb/brlog.php                  | 109 -----
 tools/bddb/browse.php                 | 147 -------
 tools/bddb/config.php                 |  16 -
 tools/bddb/create_tables.sql          |  90 -----
 tools/bddb/defs.php                   | 710 ---------------------------------
 tools/bddb/dodelete.php               |  65 ---
 tools/bddb/dodellog.php               |  57 ---
 tools/bddb/doedit.php                 | 186 ---------
 tools/bddb/doedlog.php                |  76 ----
 tools/bddb/donew.php                  | 230 -----------
 tools/bddb/donewlog.php               |  86 ----
 tools/bddb/edit.php                   | 131 ------
 tools/bddb/edlog.php                  |  86 ----
 tools/bddb/execute.php                |  33 --
 tools/bddb/index.php                  |  38 --
 tools/bddb/new.php                    | 120 ------
 tools/bddb/newlog.php                 |  54 ---
 46 files changed, 2 insertions(+), 6743 deletions(-)
 delete mode 100644 board/hymod/Kconfig
 delete mode 100644 board/hymod/MAINTAINERS
 delete mode 100644 board/hymod/Makefile
 delete mode 100644 board/hymod/bsp.c
 delete mode 100644 board/hymod/config.mk
 delete mode 100644 board/hymod/eeprom.c
 delete mode 100644 board/hymod/env.c
 delete mode 100644 board/hymod/fetch.c
 delete mode 100644 board/hymod/flash.c
 delete mode 100644 board/hymod/flash.h
 delete mode 100644 board/hymod/global_env
 delete mode 100644 board/hymod/hymod.c
 delete mode 100644 board/hymod/hymod.h
 delete mode 100644 board/hymod/input.c
 delete mode 100644 board/hymod/u-boot.lds
 delete mode 100644 board/hymod/u-boot.lds.debug
 delete mode 100644 configs/hymod_defconfig
 delete mode 100644 include/configs/hymod.h
 delete mode 100644 tools/bddb/README
 delete mode 100644 tools/bddb/badsubmit.php
 delete mode 100644 tools/bddb/bddb.css
 delete mode 100644 tools/bddb/brlog.php
 delete mode 100644 tools/bddb/browse.php
 delete mode 100644 tools/bddb/config.php
 delete mode 100644 tools/bddb/create_tables.sql
 delete mode 100644 tools/bddb/defs.php
 delete mode 100644 tools/bddb/dodelete.php
 delete mode 100644 tools/bddb/dodellog.php
 delete mode 100644 tools/bddb/doedit.php
 delete mode 100644 tools/bddb/doedlog.php
 delete mode 100644 tools/bddb/donew.php
 delete mode 100644 tools/bddb/donewlog.php
 delete mode 100644 tools/bddb/edit.php
 delete mode 100644 tools/bddb/edlog.php
 delete mode 100644 tools/bddb/execute.php
 delete mode 100644 tools/bddb/index.php
 delete mode 100644 tools/bddb/new.php
 delete mode 100644 tools/bddb/newlog.php
arch/powerpc/cpu/mpc8260/Kconfig +0 -4
index 41e4e5f..7f246ff 100644
@@ -28,9 +28,6 @@ config TARGET_EP82XXM
 config TARGET_GW8260
 	bool "Support gw8260"
 
-config TARGET_HYMOD
-	bool "Support hymod"
-
 config TARGET_IPHASE4539
 	bool "Support IPHASE4539"
 
@@ -78,7 +75,6 @@ source "board/ep82xxm/Kconfig"
 source "board/freescale/mpc8266ads/Kconfig"
 source "board/funkwerk/vovpn-gw/Kconfig"
 source "board/gw8260/Kconfig"
-source "board/hymod/Kconfig"
 source "board/ids/ids8247/Kconfig"
 source "board/iphase4539/Kconfig"
 source "board/keymile/km82xx/Kconfig"
arch/powerpc/cpu/mpc8260/ether_fcc.c +1 -26
index d93a991..f9f15b5 100644
@@ -645,32 +645,7 @@ eth_loopback_test (void)
 
 	/* 28.9 - (1-2): ioports have been set up already */
 
-#if defined(CONFIG_HYMOD)
-	/*
-	 * Attention: this is board-specific
-	 * 0, FCC1
-	 * 1, FCC2
-	 * 2, FCC3
-	 */
-#       define FCC_START_LOOP 0
-#       define FCC_END_LOOP   2
-
-	/*
-	 * Attention: this is board-specific
-	 * - FCC1 Rx-CLK is CLK10
-	 * - FCC1 Tx-CLK is CLK11
-	 * - FCC2 Rx-CLK is CLK13
-	 * - FCC2 Tx-CLK is CLK14
-	 * - FCC3 Rx-CLK is CLK15
-	 * - FCC3 Tx-CLK is CLK16
-	 */
-
-	/* 28.9 - (3): connect FCC's tx and rx clocks */
-	immr->im_cpmux.cmx_uar = 0;
-	immr->im_cpmux.cmx_fcr = CMXFCR_RF1CS_CLK10|CMXFCR_TF1CS_CLK11|\
-	    CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14|\
-	    CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16;
-#elif defined(CONFIG_SACSng)
+#if defined(CONFIG_SACSng)
 	/*
 	 * Attention: this is board-specific
 	 * 1, FCC2
arch/powerpc/cpu/mpc8260/interrupts.c +1 -9
index 30125a7..41d2c04 100644
@@ -142,15 +142,7 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	immr->im_intctl.ic_sipnrh = 0xffffffff;
 	immr->im_intctl.ic_sipnrl = 0xffffffff;
 
-#ifdef CONFIG_HYMOD
-	/*
-	 * ensure all external interrupt sources default to trigger on
-	 * high-to-low transition (i.e. edge triggered active low)
-	 */
-	immr->im_intctl.ic_siexr = -1;
-#endif
-
-	return (0);
+	return 0;
 }
 
 /****************************************************************************/
arch/powerpc/cpu/mpc8260/start.S +0 -14
index d7eaf13..5f1e174 100644
@@ -48,9 +48,6 @@
 	GOT_ENTRY(__init_end)
 	GOT_ENTRY(__bss_end)
 	GOT_ENTRY(__bss_start)
-#if defined(CONFIG_HYMOD)
-	GOT_ENTRY(environment)
-#endif
 	END_GOT
 
 /*
@@ -878,18 +875,7 @@ clear_bss:
 	 * Now clear BSS segment
 	 */
 	lwz	r3,GOT(__bss_start)
-#if defined(CONFIG_HYMOD)
-	/*
-	 * For HYMOD - the environment is the very last item in flash.
-	 * The real .bss stops just before environment starts, so only
-	 * clear up to that point.
-	 *
-	 * taken from mods for FADS board
-	 */
-	lwz	r4,GOT(environment)
-#else
 	lwz	r4,GOT(__bss_end)
-#endif
 
 	cmplw	0, r3, r4
 	beq	6f
arch/powerpc/cpu/mpc83xx/start.S +0 -11
index 36724e5..af75c63 100644
@@ -958,18 +958,7 @@ clear_bss:
 	 * Now clear BSS segment
 	 */
 	lwz	r3,GOT(__bss_start)
-#if defined(CONFIG_HYMOD)
-	/*
-	 * For HYMOD - the environment is the very last item in flash.
-	 * The real .bss stops just before environment starts, so only
-	 * clear up to that point.
-	 *
-	 * taken from mods for FADS board
-	 */
-	lwz	r4,GOT(environment)
-#else
 	lwz	r4,GOT(__bss_end)
-#endif
 
 	cmplw	0, r3, r4
 	beq	6f
arch/powerpc/include/asm/u-boot.h +0 -3
index e1b566f..a61e998 100644
@@ -77,9 +77,6 @@ typedef struct bd_info {
 	unsigned int	bi_pci_busfreq;	/* PCI Bus speed, in Hz */
 	unsigned char	bi_pci_enetaddr[6];	/* PCI Ethernet MAC address */
 #endif
-#if defined(CONFIG_HYMOD)
-	hymod_conf_t	bi_hymod_conf;	/* hymod configuration information */
-#endif
 
 #ifdef CONFIG_HAS_ETH1
 	unsigned char   bi_enet1addr[6];	/* OLD: see README.enetaddr */
board/hymod/Kconfig deleted +0 -9
deleted file mode 100644
index fa162eb..0000000
@@ -1,9 +0,0 @@
-if TARGET_HYMOD
-
-config SYS_BOARD
-	default "hymod"
-
-config SYS_CONFIG_NAME
-	default "hymod"
-
-endif
board/hymod/MAINTAINERS deleted +0 -6
deleted file mode 100644
index e27fe97..0000000
@@ -1,6 +0,0 @@
-HYMOD BOARD
-M:	Murray Jensen <[email protected]>
-S:	Maintained
-F:	board/hymod/
-F:	include/configs/hymod.h
-F:	configs/hymod_defconfig
board/hymod/Makefile deleted +0 -8
deleted file mode 100644
index b9080b0..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2000-2006
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	= hymod.o flash.o bsp.o eeprom.o fetch.o input.o env.o
board/hymod/bsp.c deleted +0 -387

387 lines not on this page · raw message

board/hymod/config.mk deleted +0 -14
deleted file mode 100644
index 2eeea50..0000000
@@ -1,14 +0,0 @@
-#
-# (C) Copyright 2000
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-#
-# HYMOD boards
-#
-
-PLATFORM_CPPFLAGS += -I$(srctree)
-
-OBJCOPYFLAGS = --remove-section=.ppcenv
board/hymod/eeprom.c deleted +0 -678

678 lines not on this page · raw message

board/hymod/env.c deleted +0 -221

221 lines not on this page · raw message

board/hymod/fetch.c deleted +0 -91

91 lines not on this page · raw message

board/hymod/flash.c deleted +0 -490

490 lines not on this page · raw message

board/hymod/flash.h deleted +0 -140

140 lines not on this page · raw message

board/hymod/global_env deleted +0 -145

145 lines not on this page · raw message

board/hymod/hymod.c deleted +0 -521

521 lines not on this page · raw message

board/hymod/hymod.h deleted +0 -305

171 lines not on this page · raw message

board/hymod/input.c deleted +0 -91

91 lines not on this page · raw message

board/hymod/u-boot.lds deleted +0 -132

132 lines not on this page · raw message

board/hymod/u-boot.lds.debug deleted +0 -121

121 lines not on this page · raw message

configs/hymod_defconfig deleted +0 -3
deleted file mode 100644
index a6dc1d8..0000000

Lines of this file are not shown. View the raw message.

include/asm-generic/u-boot.h +0 -3
index 62cb1ea..aef39d7 100644

Lines of this file are not shown. View the raw message.

include/common.h +0 -3
index d5020c8..c96b58e 100644

Lines of this file are not shown. View the raw message.

include/configs/hymod.h deleted +0 -728

728 lines not on this page · raw message

tools/bddb/README deleted +0 -116

116 lines not on this page · raw message

tools/bddb/badsubmit.php deleted +0 -23
deleted file mode 100644
index 5092a31..0000000

Lines of this file are not shown. View the raw message.

tools/bddb/bddb.css deleted +0 -207

207 lines not on this page · raw message

tools/bddb/brlog.php deleted +0 -109

109 lines not on this page · raw message

tools/bddb/browse.php deleted +0 -147

147 lines not on this page · raw message

tools/bddb/config.php deleted +0 -16
deleted file mode 100644
index 6725757..0000000

Lines of this file are not shown. View the raw message.

tools/bddb/create_tables.sql deleted +0 -90

90 lines not on this page · raw message

tools/bddb/defs.php deleted +0 -710

710 lines not on this page · raw message

tools/bddb/dodelete.php deleted +0 -65

65 lines not on this page · raw message

tools/bddb/dodellog.php deleted +0 -57

57 lines not on this page · raw message

tools/bddb/doedit.php deleted +0 -186

186 lines not on this page · raw message

tools/bddb/doedlog.php deleted +0 -76

76 lines not on this page · raw message

tools/bddb/donew.php deleted +0 -230

230 lines not on this page · raw message

tools/bddb/donewlog.php deleted +0 -86

86 lines not on this page · raw message

tools/bddb/edit.php deleted +0 -131

131 lines not on this page · raw message

tools/bddb/edlog.php deleted +0 -86

86 lines not on this page · raw message

tools/bddb/execute.php deleted +0 -33
deleted file mode 100644
index 0b62882..0000000

Lines of this file are not shown. View the raw message.

tools/bddb/index.php deleted +0 -38
deleted file mode 100644
index 842aed5..0000000

Lines of this file are not shown. View the raw message.

tools/bddb/new.php deleted +0 -120

120 lines not on this page · raw message

tools/bddb/newlog.php deleted +0 -54

54 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.1

Part of the diff is not shown here. View the raw message.

#11 lore raw

PATCH 4/25 ppc: Zap HWW1U1A board

In reply to Marek Vasut

This is the only used of CONFIG_SPI_X macro, just zap this.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc85xx/Kconfig    |   4 -
 board/exmeritus/hww1u1a/Kconfig     |  12 -
 board/exmeritus/hww1u1a/MAINTAINERS |   6 -
 board/exmeritus/hww1u1a/Makefile    |  12 -
 board/exmeritus/hww1u1a/ddr.c       |  34 ---
 board/exmeritus/hww1u1a/gpios.h     |  56 -----
 board/exmeritus/hww1u1a/hww1u1a.c   | 268 ---------------------
 board/exmeritus/hww1u1a/law.c       |  18 --
 board/exmeritus/hww1u1a/tlb.c       |  90 -------
 configs/HWW1U1A_defconfig           |   3 -
 include/configs/HWW1U1A.h           | 460 ------------------------------------
 11 files changed, 963 deletions(-)
 delete mode 100644 board/exmeritus/hww1u1a/Kconfig
 delete mode 100644 board/exmeritus/hww1u1a/MAINTAINERS
 delete mode 100644 board/exmeritus/hww1u1a/Makefile
 delete mode 100644 board/exmeritus/hww1u1a/ddr.c
 delete mode 100644 board/exmeritus/hww1u1a/gpios.h
 delete mode 100644 board/exmeritus/hww1u1a/hww1u1a.c
 delete mode 100644 board/exmeritus/hww1u1a/law.c
 delete mode 100644 board/exmeritus/hww1u1a/tlb.c
 delete mode 100644 configs/HWW1U1A_defconfig
 delete mode 100644 include/configs/HWW1U1A.h
arch/powerpc/cpu/mpc85xx/Kconfig +0 -4
index 8c1c01c..c0bb67b 100644
@@ -13,9 +13,6 @@ config TARGET_SBC8548
 config TARGET_SOCRATES
 	bool "Support socrates"
 
-config TARGET_HWW1U1A
-	bool "Support HWW1U1A"
-
 config TARGET_B4860QDS
 	bool "Support B4860QDS"
 
@@ -144,7 +141,6 @@ config TARGET_XPEDITE550X
 
 endchoice
 
-source "board/exmeritus/hww1u1a/Kconfig"
 source "board/freescale/b4860qds/Kconfig"
 source "board/freescale/bsc9131rdb/Kconfig"
 source "board/freescale/bsc9132qds/Kconfig"
board/exmeritus/hww1u1a/Kconfig deleted +0 -12
deleted file mode 100644
index 7a76b43..0000000
@@ -1,12 +0,0 @@
-if TARGET_HWW1U1A
-
-config SYS_BOARD
-	default "hww1u1a"
-
-config SYS_VENDOR
-	default "exmeritus"
-
-config SYS_CONFIG_NAME
-	default "HWW1U1A"
-
-endif
board/exmeritus/hww1u1a/MAINTAINERS deleted +0 -6
deleted file mode 100644
index b37f10b..0000000
@@ -1,6 +0,0 @@
-HWW1U1A BOARD
-#M:	Kyle Moffett <[email protected]>
-S:	Orphan (since 2014-06)
-F:	board/exmeritus/hww1u1a/
-F:	include/configs/HWW1U1A.h
-F:	configs/HWW1U1A_defconfig
board/exmeritus/hww1u1a/Makefile deleted +0 -12
deleted file mode 100644
index d0cd878..0000000
@@ -1,12 +0,0 @@
-#
-# Copyright 2007-2009 Freescale Semiconductor, Inc.
-# (C) Copyright 2001-2006
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	+= hww1u1a.o
-obj-y	+= law.o
-obj-y	+= tlb.o
-obj-$(CONFIG_DDR_SPD) += ddr.o
board/exmeritus/hww1u1a/ddr.c deleted +0 -34
deleted file mode 100644
index e1f6865..0000000
@@ -1,34 +0,0 @@
-/*
- * Copyright 2009-2010 eXMeritus, A Boeing Company
- * Copyright 2008-2009 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- */
-
-#include <common.h>
-
-#include <fsl_ddr_sdram.h>
-#include <fsl_ddr_dimm_params.h>
-
-void fsl_ddr_board_options(memctl_options_t *popts,
-				dimm_params_t *pdimm,
-				unsigned int ctrl_num)
-{
-	/*
-	 * We only support one DIMM, so according to the P2020 docs we should
-	 * set the options as follows:
-	 */
-	popts->cs_local_opts[0].odt_rd_cfg = 0;
-	popts->cs_local_opts[0].odt_wr_cfg = 4;
-	popts->cs_local_opts[1].odt_rd_cfg = 0;
-	popts->cs_local_opts[1].odt_wr_cfg = 0;
-	popts->half_strength_driver_enable = 0;
-
-	/* Manually configured for our static clock rate */
-	popts->clk_adjust = 4;
-	popts->cpo_override = 4;
-	popts->write_data_delay = 2;
-	popts->twot_en = 0;
-}
board/exmeritus/hww1u1a/gpios.h deleted +0 -56

56 lines not on this page · raw message

board/exmeritus/hww1u1a/hww1u1a.c deleted +0 -268

268 lines not on this page · raw message

board/exmeritus/hww1u1a/law.c deleted +0 -18
deleted file mode 100644
index c7dc58d..0000000
@@ -1,18 +0,0 @@
-/*
- * Copyright 2008-2009 Freescale Semiconductor, Inc.
- *
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, [email protected].
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/fsl_law.h>
-#include <asm/mmu.h>
-
-struct law_entry law_table[] = {
-	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
-};
-
-int num_law_entries = ARRAY_SIZE(law_table);
board/exmeritus/hww1u1a/tlb.c deleted +0 -90

90 lines not on this page · raw message

configs/HWW1U1A_defconfig deleted +0 -3
deleted file mode 100644
index 8947be2..0000000
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_HWW1U1A=y
include/configs/HWW1U1A.h deleted +0 -460

460 lines not on this page · raw message

Signature · 1 line
2.1.1
#12 lore raw

PATCH 5/25 ppc: Zap IDS8247 board

In reply to Marek Vasut

This board is old and is using CONFIG_I2C_X, which is wrong.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc8260/Kconfig |   4 -
 board/ids/ids8247/Kconfig        |  12 -
 board/ids/ids8247/MAINTAINERS    |   6 -
 board/ids/ids8247/Makefile       |  11 -
 board/ids/ids8247/ids8247.c      | 390 ---------------------------------
 configs/IDS8247_defconfig        |   3 -
 include/configs/IDS8247.h        | 462 ---------------------------------------
 7 files changed, 888 deletions(-)
 delete mode 100644 board/ids/ids8247/Kconfig
 delete mode 100644 board/ids/ids8247/MAINTAINERS
 delete mode 100644 board/ids/ids8247/Makefile
 delete mode 100644 board/ids/ids8247/ids8247.c
 delete mode 100644 configs/IDS8247_defconfig
 delete mode 100644 include/configs/IDS8247.h
arch/powerpc/cpu/mpc8260/Kconfig +0 -4
index 7f246ff..7e28170 100644
@@ -52,9 +52,6 @@ config TARGET_MPC8266ADS
 config TARGET_VOVPN_GW
 	bool "Support VoVPN-GW"
 
-config TARGET_IDS8247
-	bool "Support IDS8247"
-
 config TARGET_KM82XX
 	bool "Support km82xx"
 
@@ -75,7 +72,6 @@ source "board/ep82xxm/Kconfig"
 source "board/freescale/mpc8266ads/Kconfig"
 source "board/funkwerk/vovpn-gw/Kconfig"
 source "board/gw8260/Kconfig"
-source "board/ids/ids8247/Kconfig"
 source "board/iphase4539/Kconfig"
 source "board/keymile/km82xx/Kconfig"
 source "board/muas3001/Kconfig"
board/ids/ids8247/Kconfig deleted +0 -12
deleted file mode 100644
index bbab727..0000000
@@ -1,12 +0,0 @@
-if TARGET_IDS8247
-
-config SYS_BOARD
-	default "ids8247"
-
-config SYS_VENDOR
-	default "ids"
-
-config SYS_CONFIG_NAME
-	default "IDS8247"
-
-endif
board/ids/ids8247/MAINTAINERS deleted +0 -6
deleted file mode 100644
index 3173cdf..0000000
@@ -1,6 +0,0 @@
-IDS8247 BOARD
-M:	Heiko Schocher <[email protected]>
-S:	Maintained
-F:	board/ids/ids8247/
-F:	include/configs/IDS8247.h
-F:	configs/IDS8247_defconfig
board/ids/ids8247/Makefile deleted +0 -11
deleted file mode 100644
index 99c47b6..0000000
@@ -1,11 +0,0 @@
-#
-# (C) Copyright 2006
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# (C) Copyright 2005
-# Heiko Schocher, DENX Software Engineering, <[email protected]>
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	= ids8247.o
board/ids/ids8247/ids8247.c deleted +0 -390

390 lines not on this page · raw message

configs/IDS8247_defconfig deleted +0 -3
deleted file mode 100644
index b4dd23f..0000000
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_IDS8247=y
include/configs/IDS8247.h deleted +0 -462

462 lines not on this page · raw message

Signature · 1 line
2.1.1
#13 lore raw

PATCH 6/25 ppc: Zap TQM8260 board

In reply to Marek Vasut

This board is old and is using CONFIG_I2C_X, which is wrong.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc8260/Kconfig |   4 -
 board/tqc/tqm8260/Kconfig        |  12 -
 board/tqc/tqm8260/MAINTAINERS    |  16 -
 board/tqc/tqm8260/Makefile       |   8 -
 board/tqc/tqm8260/README         | 415 --------------------------
 board/tqc/tqm8260/tqm8260.c      | 352 ----------------------
 configs/TQM8255_AA_defconfig     |   4 -
 configs/TQM8260_AA_defconfig     |   4 -
 configs/TQM8260_AB_defconfig     |   4 -
 configs/TQM8260_AC_defconfig     |   4 -
 configs/TQM8260_AD_defconfig     |   4 -
 configs/TQM8260_AE_defconfig     |   4 -
 configs/TQM8260_AF_defconfig     |   4 -
 configs/TQM8260_AG_defconfig     |   4 -
 configs/TQM8260_AH_defconfig     |   4 -
 configs/TQM8260_AI_defconfig     |   4 -
 configs/TQM8265_AA_defconfig     |   4 -
 include/configs/TQM8260.h        | 620 ---------------------------------------
 18 files changed, 1471 deletions(-)
 delete mode 100644 board/tqc/tqm8260/Kconfig
 delete mode 100644 board/tqc/tqm8260/MAINTAINERS
 delete mode 100644 board/tqc/tqm8260/Makefile
 delete mode 100644 board/tqc/tqm8260/README
 delete mode 100644 board/tqc/tqm8260/tqm8260.c
 delete mode 100644 configs/TQM8255_AA_defconfig
 delete mode 100644 configs/TQM8260_AA_defconfig
 delete mode 100644 configs/TQM8260_AB_defconfig
 delete mode 100644 configs/TQM8260_AC_defconfig
 delete mode 100644 configs/TQM8260_AD_defconfig
 delete mode 100644 configs/TQM8260_AE_defconfig
 delete mode 100644 configs/TQM8260_AF_defconfig
 delete mode 100644 configs/TQM8260_AG_defconfig
 delete mode 100644 configs/TQM8260_AH_defconfig
 delete mode 100644 configs/TQM8260_AI_defconfig
 delete mode 100644 configs/TQM8265_AA_defconfig
 delete mode 100644 include/configs/TQM8260.h
arch/powerpc/cpu/mpc8260/Kconfig +0 -4
index 7e28170..e28628f 100644
@@ -55,9 +55,6 @@ config TARGET_VOVPN_GW
 config TARGET_KM82XX
 	bool "Support km82xx"
 
-config TARGET_TQM8260
-	bool "Support TQM8260"
-
 config TARGET_TQM8272
 	bool "Support TQM8272"
 
@@ -79,7 +76,6 @@ source "board/pm826/Kconfig"
 source "board/pm828/Kconfig"
 source "board/ppmc8260/Kconfig"
 source "board/sacsng/Kconfig"
-source "board/tqc/tqm8260/Kconfig"
 source "board/tqc/tqm8272/Kconfig"
 
 endmenu
board/tqc/tqm8260/Kconfig deleted +0 -12
deleted file mode 100644
index 90a96eb..0000000
@@ -1,12 +0,0 @@
-if TARGET_TQM8260
-
-config SYS_BOARD
-	default "tqm8260"
-
-config SYS_VENDOR
-	default "tqc"
-
-config SYS_CONFIG_NAME
-	default "TQM8260"
-
-endif
board/tqc/tqm8260/MAINTAINERS deleted +0 -16
deleted file mode 100644
index 266910f..0000000
@@ -1,16 +0,0 @@
-TQM8260 BOARD
-M:	Wolfgang Denk <[email protected]>
-S:	Maintained
-F:	board/tqc/tqm8260/
-F:	include/configs/TQM8260.h
-F:	configs/TQM8255_AA_defconfig
-F:	configs/TQM8260_AA_defconfig
-F:	configs/TQM8260_AB_defconfig
-F:	configs/TQM8260_AC_defconfig
-F:	configs/TQM8260_AD_defconfig
-F:	configs/TQM8260_AE_defconfig
-F:	configs/TQM8260_AF_defconfig
-F:	configs/TQM8260_AG_defconfig
-F:	configs/TQM8260_AH_defconfig
-F:	configs/TQM8260_AI_defconfig
-F:	configs/TQM8265_AA_defconfig
board/tqc/tqm8260/Makefile deleted +0 -8
deleted file mode 100644
index 6b8573d..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2001-2006
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	= tqm8260.o ../tqm8xx/load_sernum_ethaddr.o
board/tqc/tqm8260/README deleted +0 -415

415 lines not on this page · raw message

board/tqc/tqm8260/tqm8260.c deleted +0 -352

352 lines not on this page · raw message

configs/TQM8255_AA_defconfig deleted +0 -4
deleted file mode 100644
index a9f9f01..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8255,300MHz"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AA_defconfig deleted +0 -4
deleted file mode 100644
index b762fe4..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,200MHz"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AB_defconfig deleted +0 -4
deleted file mode 100644
index 6ff8d17..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,200MHz,L2_CACHE,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AC_defconfig deleted +0 -4
deleted file mode 100644
index 6ff8d17..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,200MHz,L2_CACHE,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AD_defconfig deleted +0 -4
deleted file mode 100644
index 3f406a4..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,300MHz,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AE_defconfig deleted +0 -4
deleted file mode 100644
index 1077b19..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,266MHz"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AF_defconfig deleted +0 -4
deleted file mode 100644
index 3f406a4..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,300MHz,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AG_defconfig deleted +0 -4
deleted file mode 100644
index b0d67fa..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,300MHz"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AH_defconfig deleted +0 -4
deleted file mode 100644
index 65c73e8..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,300MHz,L2_CACHE,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8260_AI_defconfig deleted +0 -4
deleted file mode 100644
index 3f406a4..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8260,300MHz,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
configs/TQM8265_AA_defconfig deleted +0 -4
deleted file mode 100644
index d8806c4..0000000
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC8265,300MHz,BUSMODE_60x"
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8260=y
include/configs/TQM8260.h deleted +0 -620

620 lines not on this page · raw message

Signature · 1 line
2.1.1
#14 lore raw

PATCH 6/25 ppc: Zap TQM8260 board

Dear Marek Vasut,

Quoted 8 lines · In message <[email protected]> you wrote:

This board is old and is using CONFIG_I2C_X, which is wrong.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>

Assuming you also add an entry to scrapyard:

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is better to be silent and thought a fool then to speak and remove
all doubt.
#15 lore raw

PATCH 7/25 ppc: Zap TQM8272 board

In reply to Marek Vasut

This board is old and is using CONFIG_I2C_X, which is wrong.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/powerpc/cpu/mpc8260/Kconfig |   4 -
 arch/powerpc/cpu/mpc8260/pci.c   |   2 -
 board/tqc/tqm8272/Kconfig        |  12 -
 board/tqc/tqm8272/MAINTAINERS    |   6 -
 board/tqc/tqm8272/Makefile       |   8 -
 board/tqc/tqm8272/nand.c         | 264 -----------
 board/tqc/tqm8272/tqm8272.c      | 944 ---------------------------------------
 board/tqc/tqm8272/tqm8272.h      |  37 --
 configs/TQM8272_defconfig        |   3 -
 include/configs/TQM8272.h        | 735 ------------------------------
 10 files changed, 2015 deletions(-)
 delete mode 100644 board/tqc/tqm8272/Kconfig
 delete mode 100644 board/tqc/tqm8272/MAINTAINERS
 delete mode 100644 board/tqc/tqm8272/Makefile
 delete mode 100644 board/tqc/tqm8272/nand.c
 delete mode 100644 board/tqc/tqm8272/tqm8272.c
 delete mode 100644 board/tqc/tqm8272/tqm8272.h
 delete mode 100644 configs/TQM8272_defconfig
 delete mode 100644 include/configs/TQM8272.h
arch/powerpc/cpu/mpc8260/Kconfig +0 -4
index e28628f..2541400 100644
@@ -55,9 +55,6 @@ config TARGET_VOVPN_GW
 config TARGET_KM82XX
 	bool "Support km82xx"
 
-config TARGET_TQM8272
-	bool "Support TQM8272"
-
 endchoice
 
 source "board/atc/Kconfig"
@@ -76,6 +73,5 @@ source "board/pm826/Kconfig"
 source "board/pm828/Kconfig"
 source "board/ppmc8260/Kconfig"
 source "board/sacsng/Kconfig"
-source "board/tqc/tqm8272/Kconfig"
 
 endmenu
arch/powerpc/cpu/mpc8260/pci.c +0 -2
index 0a47fdc..f7bb05d 100644
@@ -262,8 +262,6 @@ void pci_mpc8250_init (struct pci_controller *hose)
 				  | SIUMCR_CS10PC00
 				  | SIUMCR_BCTLC00
 				  | SIUMCR_MMR11;
-#elif defined(CONFIG_TQM8272)
-/* nothing to do for this Board here */
 #else
 	/*
 	 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
board/tqc/tqm8272/Kconfig deleted +0 -12
deleted file mode 100644
index 7b5cd8b..0000000
@@ -1,12 +0,0 @@
-if TARGET_TQM8272
-
-config SYS_BOARD
-	default "tqm8272"
-
-config SYS_VENDOR
-	default "tqc"
-
-config SYS_CONFIG_NAME
-	default "TQM8272"
-
-endif
board/tqc/tqm8272/MAINTAINERS deleted +0 -6
deleted file mode 100644
index 988d2b1..0000000
@@ -1,6 +0,0 @@
-TQM8272 BOARD
-#M:	-
-S:	Maintained
-F:	board/tqc/tqm8272/
-F:	include/configs/TQM8272.h
-F:	configs/TQM8272_defconfig
board/tqc/tqm8272/Makefile deleted +0 -8
deleted file mode 100644
index 8bf0241..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2001-2008
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	= tqm8272.o ../tqm8xx/load_sernum_ethaddr.o nand.o
board/tqc/tqm8272/nand.c deleted +0 -264

264 lines not on this page · raw message

board/tqc/tqm8272/tqm8272.c deleted +0 -944

944 lines not on this page · raw message

board/tqc/tqm8272/tqm8272.h deleted +0 -37
deleted file mode 100644
index 1eeaf0e..0000000
@@ -1,37 +0,0 @@
-/*
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, hs at denx.de.
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef	_TQM8272_HEADER_H
-#define	_TQM8272_HEADER_H
-
-#define _NOT_USED_	0xFFFFFFFF
-
-typedef struct{
-	int	Bus;
-	int	flash;
-	int	flash_nr;
-	int	ram;
-	int	ram_cs;
-	int	nand;
-	int	nand_cs;
-	int	eeprom;
-	int	can;
-	unsigned long	cpunr;
-	unsigned long	option;
-	int	SecEng;
-	int	cpucl;
-	int	cpmcl;
-	int	buscl;
-	int	busclk_real_ok;
-	int	busclk_real;
-	unsigned char	OK;
-	unsigned char  ethaddr[20];
-} HWIB_INFO;
-
-static HWIB_INFO	hwinf = {0, 0, 1, 0, 1, 0, 0, 0, 0, 8272, 0 ,0,
-			 0, 0, 0, 0, 0, 0};
-#endif	/* __CONFIG_H */
configs/TQM8272_defconfig deleted +0 -3
deleted file mode 100644
index 0070baf..0000000
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC8260=y
-CONFIG_TARGET_TQM8272=y
include/configs/TQM8272.h deleted +0 -735

735 lines not on this page · raw message

Signature · 1 line
2.1.1
#16 lore raw

PATCH 7/25 ppc: Zap TQM8272 board

Dear Marek Vasut,

Quoted 8 lines · In message <[email protected]> you wrote:

This board is old and is using CONFIG_I2C_X, which is wrong.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>

Assuming you also add an entry to scrapyard:

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
At the source of every error which is blamed on the computer you will
find at least two human errors, including the error of blaming it  on
the computer.
#17 lore raw

PATCH 8/25 arm: Zap tricorder-eeprom

In reply to Marek Vasut

This is a reimplementation of the cmd_eeprom with the added bit where it can select I2C bus. Just remove this ugly duplication. If someone needs this code, there should be proper implementation submitted.

Cc Andreas Bie?mann <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 board/corscience/tricorder/Makefile           |   2 +-
 board/corscience/tricorder/tricorder-eeprom.c | 251 --------------------------
 board/corscience/tricorder/tricorder-eeprom.h |  41 -----
 3 files changed, 1 insertion(+), 293 deletions(-)
 delete mode 100644 board/corscience/tricorder/tricorder-eeprom.c
 delete mode 100644 board/corscience/tricorder/tricorder-eeprom.h
board/corscience/tricorder/Makefile +1 -1
index 266432d..c14ff07 100644
@@ -8,4 +8,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y	:= tricorder.o tricorder-eeprom.o led.o
+obj-y	:= tricorder.o led.o
board/corscience/tricorder/tricorder-eeprom.c deleted +0 -251

251 lines not on this page · raw message

board/corscience/tricorder/tricorder-eeprom.h deleted +0 -41

41 lines not on this page · raw message

Signature · 1 line
2.1.1
#18 lore raw

RFC PATCH 1/1 tricorder: rewrite tricordereeprom command

This rewrite uses lately promoted eeprom_init(int) function to choose the right I2C bus when writing data to the EEPROM.

---

Hi Marek,

works this for you? I can't kill the i2c_read() cause eeprom_read() will blow up my SPL size.
While you are on it, there are some other eeprom implementations (freescale) not yet covered by your removal.

regards

Andreas Bie?mann

 board/corscience/tricorder/tricorder-eeprom.c | 36 +++++++--------------------
 1 file changed, 9 insertions(+), 27 deletions(-)
board/corscience/tricorder/tricorder-eeprom.c +9 -27
index 1c74a0f..340a009 100644
@@ -77,17 +77,13 @@ static int handle_eeprom_v1(struct tricorder_eeprom *eeprom)
 
 int tricorder_get_eeprom(int addr, struct tricorder_eeprom *eeprom)
 {
-#ifdef CONFIG_SYS_EEPROM_BUS_NUM
 	unsigned int bus = i2c_get_bus_num();
 	i2c_set_bus_num(CONFIG_SYS_EEPROM_BUS_NUM);
-#endif
 
 	memset(eeprom, 0, TRICORDER_EEPROM_SIZE);
 
 	i2c_read(addr, 0, 2, (unsigned char *)eeprom, TRICORDER_EEPROM_SIZE);
-#ifdef CONFIG_SYS_EEPROM_BUS_NUM
 	i2c_set_bus_num(bus);
-#endif
 
 	if (be32_to_cpu(eeprom->magic) != TRICORDER_EEPROM_MAGIC) {
 		warn_wrong_value("magic", TRICORDER_EEPROM_MAGIC,
@@ -138,9 +134,6 @@ int tricorder_eeprom_write(unsigned devaddr, const char *name,
 	int ret;
 	unsigned char *p;
 	int i;
-#ifdef CONFIG_SYS_EEPROM_BUS_NUM
-	unsigned int bus;
-#endif
 
 	memset(eeprom, 0, TRICORDER_EEPROM_SIZE);
 	memset(eeprom_verify, 0, TRICORDER_EEPROM_SIZE);
@@ -172,33 +165,23 @@ int tricorder_eeprom_write(unsigned devaddr, const char *name,
 	print_buffer(0, &eeprom, 1, sizeof(eeprom), 16);
 #endif
 
-#ifdef CONFIG_SYS_EEPROM_BUS_NUM
-	bus = i2c_get_bus_num();
-	i2c_set_bus_num(CONFIG_SYS_EEPROM_BUS_NUM);
-#endif
+	eeprom_init(CONFIG_SYS_EEPROM_BUS_NUM);
 
-	/* do page write to the eeprom */
-	for (i = 0, p = (unsigned char *)&eeprom;
-	     i < sizeof(eeprom);
-	     i += 32, p += 32) {
-		ret = i2c_write(devaddr, i, CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
-				p, min(sizeof(eeprom) - i, 32));
-		if (ret)
-			break;
-		udelay(5000); /* 5ms write cycle timing */
-	}
+	ret = eeprom_write(devaddr, 0, (unsigned char *)&eeprom,
+			TRICORDER_EEPROM_SIZE);
+	if (ret)
+		printf("Tricorder: Could not write EEPROM content!\n");
 
-	ret = i2c_read(devaddr, 0, 2, (unsigned char *)&eeprom_verify,
+	ret = eeprom_read(devaddr, 0, (unsigned char *)&eeprom_verify,
 			TRICORDER_EEPROM_SIZE);
+	if (ret)
+		printf("Tricorder: Could not read EEPROM content!\n");
 
 	if (memcmp(&eeprom, &eeprom_verify, sizeof(eeprom)) != 0) {
 		printf("Tricorder: Could not verify EEPROM content!\n");
 		ret = 1;
 	}
 
-#ifdef CONFIG_SYS_EEPROM_BUS_NUM
-	i2c_set_bus_num(bus);
-#endif
 	return ret;
 }
 
@@ -206,7 +189,7 @@ int do_tricorder_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 	if (argc == 3) {
 		ulong dev_addr = simple_strtoul(argv[2], NULL, 16);
-		eeprom_init();
+
 		if (strcmp(argv[1], "read") == 0) {
 			int rcode;
 
@@ -220,7 +203,6 @@ int do_tricorder_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		char *version = argv[4];
 		char *serial = argv[5];
 		char *interface = NULL;
-		eeprom_init();
 
 		if (argc == 7)
 			interface = argv[6];
Signature · 1 line
2.1.1
#19 lore raw

RFC PATCH 1/1 tricorder: rewrite tricordereeprom command

Quoted 5 lines · Andreas Bie?mann

This rewrite uses lately promoted eeprom_init(int) function to choose the right I2C bus when writing data to the EEPROM.

I am back! Yes, picked this up, thanks!

Best regards,
Marek Vasut

#20 lore raw

PATCH 9/25 eeprom: Shuffle code around

In reply to Marek Vasut

Just move the code around so that the forward declarations are not necessary. Also zap a few checkpatch issues where applicable and zap the use of #ifdef CONFIG_CMD_EEPROM in the code, since this is always true.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 176 ++++++++++++++++++++++------------------------------
 1 file changed, 74 insertions(+), 102 deletions(-)
common/cmd_eeprom.c +74 -102
index a02f0cb..17d241d 100644
@@ -25,94 +25,60 @@
 #include <command.h>
 #include <i2c.h>
 
-extern void eeprom_init  (void);
-extern int  eeprom_read  (unsigned dev_addr, unsigned offset,
-			  uchar *buffer, unsigned cnt);
-extern int  eeprom_write (unsigned dev_addr, unsigned offset,
-			  uchar *buffer, unsigned cnt);
-#if defined(CONFIG_SYS_EEPROM_WREN)
-extern int eeprom_write_enable (unsigned dev_addr, int state);
+#ifndef	CONFIG_SYS_I2C_SPEED
+#define	CONFIG_SYS_I2C_SPEED	50000
 #endif
 
-
+/* Maximum number of times to poll for acknowledge after write */
 #if defined(CONFIG_SYS_EEPROM_X40430)
-	/* Maximum number of times to poll for acknowledge after write */
 #define MAX_ACKNOWLEDGE_POLLS	10
 #endif
 
-/* ------------------------------------------------------------------------- */
-
-#if defined(CONFIG_CMD_EEPROM)
-static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	const char *const fmt =
-		"\nEEPROM @0x%lX %s: addr %08lx  off %04lx  count %ld ... ";
-
-#if defined(CONFIG_SYS_I2C_MULTI_EEPROMS)
-	if (argc == 6) {
-		ulong dev_addr = simple_strtoul (argv[2], NULL, 16);
-		ulong addr = simple_strtoul (argv[3], NULL, 16);
-		ulong off  = simple_strtoul (argv[4], NULL, 16);
-		ulong cnt  = simple_strtoul (argv[5], NULL, 16);
-#else
-	if (argc == 5) {
-		ulong dev_addr = CONFIG_SYS_DEF_EEPROM_ADDR;
-		ulong addr = simple_strtoul (argv[2], NULL, 16);
-		ulong off  = simple_strtoul (argv[3], NULL, 16);
-		ulong cnt  = simple_strtoul (argv[4], NULL, 16);
-#endif /* CONFIG_SYS_I2C_MULTI_EEPROMS */
-
-# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-		eeprom_init ();
-# endif /* !CONFIG_SPI */
-
-		if (strcmp (argv[1], "read") == 0) {
-			int rcode;
-
-			printf (fmt, dev_addr, argv[1], addr, off, cnt);
-
-			rcode = eeprom_read (dev_addr, off, (uchar *) addr, cnt);
-
-			puts ("done\n");
-			return rcode;
-		} else if (strcmp (argv[1], "write") == 0) {
-			int rcode;
-
-			printf (fmt, dev_addr, argv[1], addr, off, cnt);
-
-			rcode = eeprom_write (dev_addr, off, (uchar *) addr, cnt);
-
-			puts ("done\n");
-			return rcode;
-		}
-	}
-
-	return CMD_RET_USAGE;
-}
-#endif
-
-/*-----------------------------------------------------------------------
- *
+/*
  * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is
  *   0x000nxxxx for EEPROM address selectors at n, offset xxxx in EEPROM.
  *
  * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1 (8-bit EEPROM page address) offset is
  *   0x00000nxx for EEPROM address selectors and page number at n.
  */
-
 #if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-#if !defined(CONFIG_SYS_I2C_EEPROM_ADDR_LEN) || CONFIG_SYS_I2C_EEPROM_ADDR_LEN < 1 || CONFIG_SYS_I2C_EEPROM_ADDR_LEN > 2
+#if !defined(CONFIG_SYS_I2C_EEPROM_ADDR_LEN) || \
+    (CONFIG_SYS_I2C_EEPROM_ADDR_LEN < 1) || \
+    (CONFIG_SYS_I2C_EEPROM_ADDR_LEN > 2)
 #error CONFIG_SYS_I2C_EEPROM_ADDR_LEN must be 1 or 2
 #endif
 #endif
 
+#if defined(CONFIG_SYS_EEPROM_WREN)
+extern int eeprom_write_enable (unsigned dev_addr, int state);
+#endif
+
+void eeprom_init(void)
+{
+	/* SPI EEPROM */
+#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
+	spi_init_f ();
+#endif
+
+	/* I2C EEPROM */
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT) || \
+	defined(CONFIG_SYS_I2C)
+#ifdef CONFIG_SYS_I2C
+	i2c_init_all();
+#else
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+#endif
+}
+
 int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 {
 	unsigned end = offset + cnt;
 	unsigned blk_off;
 	int rcode = 0;
 
-	/* Read data until done or would cross a page boundary.
+	/*
+	 * Read data until done or would cross a page boundary.
 	 * We must write the address again when changing pages
 	 * because the next page may be in a different device.
 	 */
@@ -171,15 +137,6 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 	return rcode;
 }
 
-/*-----------------------------------------------------------------------
- *
- * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is
- *   0x000nxxxx for EEPROM address selectors at n, offset xxxx in EEPROM.
- *
- * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1 (8-bit EEPROM page address) offset is
- *   0x00000nxx for EEPROM address selectors and page number at n.
- */
-
 int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 {
 	unsigned end = offset + cnt;
@@ -197,7 +154,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 #if defined(CONFIG_SYS_EEPROM_WREN)
 	eeprom_write_enable (dev_addr,1);
 #endif
-	/* Write data until done or would cross a write page boundary.
+	/*
+	 * Write data until done or would cross a write page boundary.
 	 * We must write the address again when changing pages
 	 * because the address counter only increments within a page.
 	 */
@@ -357,8 +315,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 }
 
 #if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-int
-eeprom_probe (unsigned dev_addr, unsigned offset)
+int eeprom_probe(unsigned dev_addr, unsigned offset)
 {
 	unsigned char chip;
 
@@ -376,35 +333,52 @@ eeprom_probe (unsigned dev_addr, unsigned offset)
 }
 #endif
 
-/*-----------------------------------------------------------------------
- * Set default values
- */
-#ifndef	CONFIG_SYS_I2C_SPEED
-#define	CONFIG_SYS_I2C_SPEED	50000
-#endif
-
-void eeprom_init  (void)
+static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
+	const char *const fmt =
+		"\nEEPROM @0x%lX %s: addr %08lx  off %04lx  count %ld ... ";
 
-#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-	spi_init_f ();
-#endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT) || \
-	defined(CONFIG_SYS_I2C)
-#ifdef CONFIG_SYS_I2C
-	i2c_init_all();
+#if defined(CONFIG_SYS_I2C_MULTI_EEPROMS)
+	if (argc == 6) {
+		ulong dev_addr = simple_strtoul (argv[2], NULL, 16);
+		ulong addr = simple_strtoul (argv[3], NULL, 16);
+		ulong off  = simple_strtoul (argv[4], NULL, 16);
+		ulong cnt  = simple_strtoul (argv[5], NULL, 16);
 #else
-	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
-#endif
-}
+	if (argc == 5) {
+		ulong dev_addr = CONFIG_SYS_DEF_EEPROM_ADDR;
+		ulong addr = simple_strtoul (argv[2], NULL, 16);
+		ulong off  = simple_strtoul (argv[3], NULL, 16);
+		ulong cnt  = simple_strtoul (argv[4], NULL, 16);
+#endif /* CONFIG_SYS_I2C_MULTI_EEPROMS */
 
-/*-----------------------------------------------------------------------
- */
+# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
+		eeprom_init ();
+# endif /* !CONFIG_SPI */
 
-/***************************************************/
+		if (strcmp (argv[1], "read") == 0) {
+			int rcode;
 
-#if defined(CONFIG_CMD_EEPROM)
+			printf (fmt, dev_addr, argv[1], addr, off, cnt);
+
+			rcode = eeprom_read (dev_addr, off, (uchar *) addr, cnt);
+
+			puts ("done\n");
+			return rcode;
+		} else if (strcmp (argv[1], "write") == 0) {
+			int rcode;
+
+			printf (fmt, dev_addr, argv[1], addr, off, cnt);
+
+			rcode = eeprom_write (dev_addr, off, (uchar *) addr, cnt);
+
+			puts ("done\n");
+			return rcode;
+		}
+	}
+
+	return CMD_RET_USAGE;
+}
 
 #ifdef CONFIG_SYS_I2C_MULTI_EEPROMS
 U_BOOT_CMD(
@@ -423,5 +397,3 @@ U_BOOT_CMD(
 	"       - read/write `cnt' bytes at EEPROM offset `off'"
 )
 #endif /* CONFIG_SYS_I2C_MULTI_EEPROMS */
-
-#endif
Signature · 1 line
2.1.1
#21 lore raw

PATCH 10/25 eeprom: Zap CONFIG_SYS_I2C_MULTI_EEPROMS

In reply to Marek Vasut

This option only complicates the code unnecessarily, just use CONFIG_SYS_DEF_EEPROM_ADDR as the default address if there are only five arguments to eeprom {read/write} if this is defined. If CONFIG_SYS_DEF_EEPROM_ADDR is not defined, we mandate all six arguments.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c             | 69 ++++++++++++++++++-----------------------
 include/configs/BSC9131RDB.h    |  1 -
 include/configs/BSC9132QDS.h    |  1 -
 include/configs/C29XPCIE.h      |  1 -
 include/configs/CPCI405AB.h     |  1 -
 include/configs/CPCI750.h       |  1 -
 include/configs/DB64360.h       |  1 -
 include/configs/DB64460.h       |  1 -
 include/configs/DU440.h         |  1 -
 include/configs/P1010RDB.h      |  1 -
 include/configs/PMC440.h        |  1 -
 include/configs/TQM834x.h       |  1 -
 include/configs/W7OLMC.h        |  1 -
 include/configs/W7OLMG.h        |  1 -
 include/configs/acadia.h        |  1 -
 include/configs/am335x_evm.h    |  1 -
 include/configs/am43xx_evm.h    |  1 -
 include/configs/axs101.h        |  1 -
 include/configs/bamboo.h        |  1 -
 include/configs/canyonlands.h   |  1 -
 include/configs/cpci5200.h      |  1 -
 include/configs/ebony.h         |  1 -
 include/configs/icon.h          |  1 -
 include/configs/intip.h         |  1 -
 include/configs/katmai.h        |  1 -
 include/configs/km/km-powerpc.h |  1 -
 include/configs/km/km_arm.h     |  1 -
 include/configs/korat.h         |  1 -
 include/configs/ks2_evm.h       |  1 -
 include/configs/luan.h          |  1 -
 include/configs/m28evk.h        |  1 -
 include/configs/mecp5200.h      |  1 -
 include/configs/motionpro.h     |  1 -
 include/configs/ocotea.h        |  1 -
 include/configs/p1_p2_rdb_pc.h  |  1 -
 include/configs/p1_twr.h        |  1 -
 include/configs/pcm051.h        |  1 -
 include/configs/pengwyn.h       |  1 -
 include/configs/pf5200.h        |  1 -
 include/configs/sequoia.h       |  1 -
 include/configs/t3corp.h        |  1 -
 include/configs/taishan.h       |  1 -
 include/configs/tricorder.h     |  1 -
 include/configs/walnut.h        |  1 -
 include/configs/yosemite.h      |  1 -
 45 files changed, 30 insertions(+), 83 deletions(-)
common/cmd_eeprom.c +30 -39
index 17d241d..67de730 100644
@@ -337,50 +337,50 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	const char *const fmt =
 		"\nEEPROM @0x%lX %s: addr %08lx  off %04lx  count %ld ... ";
+	char * const *args = &argv[2];
+	int rcode;
+	ulong dev_addr, addr, off, cnt;
+
+	switch (argc) {
+#ifdef CONFIG_SYS_DEF_EEPROM_ADDR
+	case 5:
+		dev_addr = CONFIG_SYS_DEF_EEPROM_ADDR;
+		break;
+#endif
+	case 6:
+		dev_addr = simple_strtoul(*args++, NULL, 16);
+		break;
+	default:
+		return CMD_RET_USAGE;
+	}
 
-#if defined(CONFIG_SYS_I2C_MULTI_EEPROMS)
-	if (argc == 6) {
-		ulong dev_addr = simple_strtoul (argv[2], NULL, 16);
-		ulong addr = simple_strtoul (argv[3], NULL, 16);
-		ulong off  = simple_strtoul (argv[4], NULL, 16);
-		ulong cnt  = simple_strtoul (argv[5], NULL, 16);
-#else
-	if (argc == 5) {
-		ulong dev_addr = CONFIG_SYS_DEF_EEPROM_ADDR;
-		ulong addr = simple_strtoul (argv[2], NULL, 16);
-		ulong off  = simple_strtoul (argv[3], NULL, 16);
-		ulong cnt  = simple_strtoul (argv[4], NULL, 16);
-#endif /* CONFIG_SYS_I2C_MULTI_EEPROMS */
+	addr = simple_strtoul(*args++, NULL, 16);
+	off = simple_strtoul(*args++, NULL, 16);
+	cnt = simple_strtoul(*args++, NULL, 16);
 
 # if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-		eeprom_init ();
+	eeprom_init ();
 # endif /* !CONFIG_SPI */
 
-		if (strcmp (argv[1], "read") == 0) {
-			int rcode;
-
-			printf (fmt, dev_addr, argv[1], addr, off, cnt);
-
-			rcode = eeprom_read (dev_addr, off, (uchar *) addr, cnt);
+	if (strcmp (argv[1], "read") == 0) {
+		printf(fmt, dev_addr, argv[1], addr, off, cnt);
 
-			puts ("done\n");
-			return rcode;
-		} else if (strcmp (argv[1], "write") == 0) {
-			int rcode;
+		rcode = eeprom_read(dev_addr, off, (uchar *) addr, cnt);
 
-			printf (fmt, dev_addr, argv[1], addr, off, cnt);
+		puts ("done\n");
+		return rcode;
+	} else if (strcmp (argv[1], "write") == 0) {
+		printf(fmt, dev_addr, argv[1], addr, off, cnt);
 
-			rcode = eeprom_write (dev_addr, off, (uchar *) addr, cnt);
+		rcode = eeprom_write(dev_addr, off, (uchar *) addr, cnt);
 
-			puts ("done\n");
-			return rcode;
-		}
+		puts ("done\n");
+		return rcode;
 	}
 
 	return CMD_RET_USAGE;
 }
 
-#ifdef CONFIG_SYS_I2C_MULTI_EEPROMS
 U_BOOT_CMD(
 	eeprom,	6,	1,	do_eeprom,
 	"EEPROM sub-system",
@@ -388,12 +388,3 @@ U_BOOT_CMD(
 	"eeprom write devaddr addr off cnt\n"
 	"       - read/write `cnt' bytes from `devaddr` EEPROM at offset `off'"
 )
-#else /* One EEPROM */
-U_BOOT_CMD(
-	eeprom,	5,	1,	do_eeprom,
-	"EEPROM sub-system",
-	"read  addr off cnt\n"
-	"eeprom write addr off cnt\n"
-	"       - read/write `cnt' bytes at EEPROM offset `off'"
-)
-#endif /* CONFIG_SYS_I2C_MULTI_EEPROMS */
include/configs/BSC9131RDB.h +0 -1
index 56a3e94..3d488c7 100644
@@ -265,7 +265,6 @@ extern unsigned long get_sdram_size(void);
 
 /* I2C EEPROM */
 #define CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
include/configs/BSC9132QDS.h +0 -1
index aeded6d..a75775a 100644
@@ -464,7 +464,6 @@ combinations. this should be removed later
 
 /* enable read and write access to EEPROM */
 #define CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
include/configs/C29XPCIE.h +0 -1
index 715616d..a8da16d 100644
@@ -422,7 +422,6 @@
 /* I2C EEPROM */
 /* enable read and write access to EEPROM */
 #define CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
include/configs/CPCI405AB.h +0 -1
index 7d58e9d..94b3efa 100644
@@ -253,7 +253,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2	/* Bytes of address		*/
 /* mask of address bits that overflow into the "EEPROM chip address"	*/
 #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW	0x01
-#define CONFIG_SYS_I2C_MULTI_EEPROMS   1       /* more than one eeprom used!   */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5	/* The Catalyst CAT24WC32 has	*/
 					/* 32 byte page write mode using*/
 					/* last 5 bits of the address	*/
include/configs/CPCI750.h +0 -1
index 304a12b..c57457b 100644
@@ -167,7 +167,6 @@
  * Miscellaneous configurable options
  */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_SPEED	80000		/* I2C speed default */
 
 #define CONFIG_PRAM 0
include/configs/DB64360.h +0 -1
index b77c8b2..03f38c2 100644
@@ -250,7 +250,6 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  * Miscellaneous configurable options
  */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_SPEED	40000		/* I2C speed default */
 
 /* #define CONFIG_SYS_GT_DUAL_CPU	 also for JTAG even with one cpu */
include/configs/DB64460.h +0 -1
index abc4434..96a6254 100644
@@ -188,7 +188,6 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  * Miscellaneous configurable options
  */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_SPEED	40000		/* I2C speed default */
 
 /* #define CONFIG_SYS_GT_DUAL_CPU	 also for JTAG even with one cpu */
include/configs/DU440.h +0 -1
index be5494b..4409553 100644
@@ -170,7 +170,6 @@
 #define IIC1_USB2507_ADDR	0x2c
 #define CONFIG_SYS_I2C_NOPROBES		{ {1, IIC1_USB2507_ADDR} }
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x54
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5
include/configs/P1010RDB.h +0 -1
index a373990..eed836b 100644
@@ -661,7 +661,6 @@ extern unsigned long get_sdram_size(void);
 #endif
 /* enable read and write access to EEPROM */
 #define CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
include/configs/PMC440.h +0 -1
index c5e2f16..eb23839 100644
@@ -156,7 +156,6 @@
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_1		400000
 #define CONFIG_SYS_I2C_PPC4XX_SLAVE_1		0x7F
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR		0x54
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
include/configs/TQM834x.h +0 -1
index 6762e3a..7792ccb 100644
@@ -181,7 +181,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2	/* 16 bit */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	5	/* 32 bytes/write */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	12	/* 10ms +/- 20% */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS		/* more than one eeprom */
 
 /* I2C RTC */
 #define CONFIG_RTC_DS1337			/* use ds1337 rtc via i2c */
include/configs/W7OLMC.h +0 -1
index 895ad46..de4585d 100644
@@ -273,7 +273,6 @@
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4	/* The Catalyst CAT24WC08 has	*/
 					/* 16 byte page write mode using*/
 					/* last	4 bits of the address	*/
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 /*-----------------------------------------------------------------------
  * Definitions for Serial Presence Detect EEPROM address
  * (to get SDRAM settings)
include/configs/W7OLMG.h +0 -1
index 2a38116..bac5ba9 100644
@@ -276,7 +276,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50		/* EEPROM ATMEL 24C04N		*/
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1		/* Bytes of address		*/
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 /*-----------------------------------------------------------------------
  * Definitions for Serial Presence Detect EEPROM address
  * (to get SDRAM settings)
include/configs/acadia.h +0 -1
index 4dd5720..2f53d73 100644
@@ -120,7 +120,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/am335x_evm.h +0 -1
index 476430d..07cd2d8 100644
@@ -209,7 +209,6 @@
 #define CONFIG_ENV_EEPROM_IS_ON_I2C
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* Main EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 
 /* PMIC support */
 #define CONFIG_POWER_TPS65217
include/configs/am43xx_evm.h +0 -1
index 0707827..3f92dd2 100644
@@ -30,7 +30,6 @@
 #define CONFIG_ENV_EEPROM_IS_ON_I2C
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* Main EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 
 /* Power */
 #define CONFIG_POWER
include/configs/axs101.h +0 -1
index 1bf8390..008d394 100644
@@ -98,7 +98,6 @@
 /*
  * EEPROM configuration
  */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR		(0xA8 >> 1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1
 #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW	1
include/configs/bamboo.h +0 -1
index 6ba4aaf..5b8b22f 100644
@@ -139,7 +139,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/canyonlands.h +0 -1
index 8eeb15c..5349511 100644
@@ -246,7 +246,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR		(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
include/configs/cpci5200.h +0 -1
index ec926fd..92c1900 100644
@@ -173,7 +173,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	5
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	20
-#define CONFIG_SYS_I2C_MULTI_EEPROMS		1
 /*
  * Flash configuration
  */
include/configs/ebony.h +0 -1
index 3f0ad69..18012bb 100644
@@ -123,7 +123,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/icon.h +0 -1
index bbe9b59..d9a3671 100644
@@ -107,7 +107,6 @@
 
 #define CONFIG_SYS_SPD_BUS_NUM	0	/* The I2C bus for SPD		*/
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/intip.h +0 -1
index 928eb5b..1accb64 100644
@@ -217,7 +217,6 @@
  */
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR		(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
include/configs/katmai.h +0 -1
index fa72eb0..664896b 100644
@@ -109,7 +109,6 @@
 #define IIC0_BOOTPROM_ADDR	0x50
 #define IIC0_ALT_BOOTPROM_ADDR	0x54
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0x50)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/km/km-powerpc.h +0 -1
index eb85a74..2b0b9dc 100644
@@ -21,7 +21,6 @@
 #define CONFIG_KM_COMMON_ETH_INIT
 
 /* EEprom support 24C08, 24C16, 24C64 */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3  /* 8 Byte write page */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	10
include/configs/km/km_arm.h +0 -1
index d31e674..1061d1d 100644
@@ -218,7 +218,6 @@ int get_scl(void);
 #define	CONFIG_SYS_I2C_SOFT_SPEED	100000
 
 /* EEprom support 24C128, 24C256 valid for environment eeprom */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	6 /* 64 Byte write page */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	10
include/configs/korat.h +0 -1
index 5494a60..1085237 100644
@@ -147,7 +147,6 @@
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 #define CONFIG_SYS_I2C_PPC4XX_SLAVE_0		0x7F
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/ks2_evm.h +0 -1
index 51926f7..c6cee42 100644
@@ -120,7 +120,6 @@
 #define I2C_BUS_MAX			3
 
 /* EEPROM definitions */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
 #define CONFIG_SYS_I2C_EEPROM_ADDR		0x50
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	6
include/configs/luan.h +0 -1
index 15e4a7e..e22d0e8 100644
@@ -119,7 +119,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/m28evk.h +0 -1
index efe770b..b566e54 100644
@@ -97,7 +97,6 @@
 
 /* EEPROM */
 #ifdef CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
 #endif
 
include/configs/mecp5200.h +0 -1
index b270429..aab787d 100644
@@ -148,7 +148,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	5
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	20
-#define CONFIG_SYS_I2C_MULTI_EEPROMS		1
 /*
  * Flash configuration
  */
include/configs/motionpro.h +0 -1
index e8b0593..2d2fcd8 100644
@@ -296,7 +296,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	1	/* 2 bytes per write cycle */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5	/* 2ms/cycle + 3ms extra */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS		1	/* 2 EEPROMs (addr:50,52) */
 
 /*
  * RTC configuration
include/configs/ocotea.h +0 -1
index 4ff2f05..cd9e5ea 100644
@@ -136,7 +136,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/p1_p2_rdb_pc.h +0 -1
index 9b58950..95250f3 100644
@@ -665,7 +665,6 @@
 
 /* enable read and write access to EEPROM */
 #define CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
include/configs/p1_twr.h +0 -1
index 911203d..203d041 100644
@@ -261,7 +261,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 /* enable read and write access to EEPROM */
 #define CONFIG_CMD_EEPROM
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
include/configs/pcm051.h +0 -1
index 7d102a4..e99a5c6 100644
@@ -109,7 +109,6 @@
 #define CONFIG_ENV_EEPROM_IS_ON_I2C
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* Main EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 110, 300, 600, 1200, 2400, \
 4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200 }
include/configs/pengwyn.h +0 -1
index 4684ad6..fdb103f 100644
@@ -112,7 +112,6 @@
 #define CONFIG_ENV_EEPROM_IS_ON_I2C
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 
 /* SPL */
 #define CONFIG_SPL_POWER_SUPPORT
include/configs/pf5200.h +0 -1
index be76478..af334f7 100644
@@ -165,7 +165,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	5
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	20
-#define CONFIG_SYS_I2C_MULTI_EEPROMS		1
 /*
  * Flash configuration
  */
include/configs/sequoia.h +0 -1
index b6a5e6a..5af751b 100644
@@ -160,7 +160,6 @@
  */
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/t3corp.h +0 -1
index 502e795..7942865 100644
@@ -307,7 +307,6 @@
  */
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0			400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR		(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
include/configs/taishan.h +0 -1
index 3d5c351..64568fe 100644
@@ -121,7 +121,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#undef CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/tricorder.h +0 -1
index 6ddf3d5..7a46e60 100644
@@ -109,7 +109,6 @@
  
 
 /* EEPROM */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_CMD_EEPROM
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
 #define CONFIG_SYS_EEPROM_BUS_NUM	1
include/configs/walnut.h +0 -1
index 8b803a2..dd6b519 100644
@@ -80,7 +80,6 @@
  */
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
include/configs/yosemite.h +0 -1
index 8508a80..0cffab8 100644
@@ -122,7 +122,6 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_I2C_PPC4XX_SPEED_0		400000
 
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR	(0xa8>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
Signature · 1 line
2.1.1
#22 lore raw

PATCH 11/25 eeprom: Zap CONFIG_SYS_EEPROM_X40430

In reply to Marek Vasut

Now that the only user of CONFIG_SYS_EEPROM_X40430 was removed, remove this unused code from cmd_eeprom.c

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 95 -----------------------------------------------------
 1 file changed, 95 deletions(-)
common/cmd_eeprom.c +0 -95
index 67de730..b0acf11 100644
@@ -29,11 +29,6 @@
 #define	CONFIG_SYS_I2C_SPEED	50000
 #endif
 
-/* Maximum number of times to poll for acknowledge after write */
-#if defined(CONFIG_SYS_EEPROM_X40430)
-#define MAX_ACKNOWLEDGE_POLLS	10
-#endif
-
 /*
  * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is
  *   0x000nxxxx for EEPROM address selectors at n, offset xxxx in EEPROM.
@@ -143,14 +138,6 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 	unsigned blk_off;
 	int rcode = 0;
 
-#if defined(CONFIG_SYS_EEPROM_X40430)
-	uchar	contr_r_addr[2];
-	uchar	addr_void[2];
-	uchar	contr_reg[2];
-	uchar	ctrl_reg_v;
-	int	i;
-#endif
-
 #if defined(CONFIG_SYS_EEPROM_WREN)
 	eeprom_write_enable (dev_addr,1);
 #endif
@@ -215,88 +202,6 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
 		spi_write (addr, alen, buffer, len);
 #else
-#if defined(CONFIG_SYS_EEPROM_X40430)
-		/* Get the value of the control register.
-		 * Set current address (internal pointer in the x40430)
-		 * to 0x1ff.
-		 */
-		contr_r_addr[0] = 9;
-		contr_r_addr[1] = 0xff;
-		addr_void[0]    = 0;
-		addr_void[1]    = addr[1];
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR
-		contr_r_addr[0] |= CONFIG_SYS_I2C_EEPROM_ADDR;
-		addr_void[0]    |= CONFIG_SYS_I2C_EEPROM_ADDR;
-#endif
-		contr_reg[0] = 0xff;
-		if (i2c_read (contr_r_addr[0], contr_r_addr[1], 1, contr_reg, 1) != 0) {
-			rcode = 1;
-		}
-		ctrl_reg_v = contr_reg[0];
-
-		/* Are any of the eeprom blocks write protected?
-		 */
-		if (ctrl_reg_v & 0x18) {
-			ctrl_reg_v &= ~0x18;   /* reset block protect bits  */
-			ctrl_reg_v |=  0x02;   /* set write enable latch    */
-			ctrl_reg_v &= ~0x04;   /* clear RWEL                */
-
-			/* Set write enable latch.
-			 */
-			contr_reg[0] = 0x02;
-			if (i2c_write (contr_r_addr[0], 0xff, 1, contr_reg, 1) != 0) {
-				rcode = 1;
-			}
-
-			/* Set register write enable latch.
-			 */
-			contr_reg[0] = 0x06;
-			if (i2c_write (contr_r_addr[0], 0xFF, 1, contr_reg, 1) != 0) {
-				rcode = 1;
-			}
-
-			/* Modify ctrl register.
-			 */
-			contr_reg[0] = ctrl_reg_v;
-			if (i2c_write (contr_r_addr[0], 0xFF, 1, contr_reg, 1) != 0) {
-				rcode = 1;
-			}
-
-			/* The write (above) is an operation on NV memory.
-			 * These can take some time (~5ms), and the device
-			 * will not respond to further I2C messages till
-			 * it's completed the write.
-			 * So poll device for an I2C acknowledge.
-			 * When we get one we know we can continue with other
-			 * operations.
-			 */
-			contr_reg[0] = 0;
-			for (i = 0; i < MAX_ACKNOWLEDGE_POLLS; i++) {
-				if (i2c_read (addr_void[0], addr_void[1], 1, contr_reg, 1) == 0)
-					break;	/* got ack */
-#if defined(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS)
-				udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
-#endif
-			}
-			if (i == MAX_ACKNOWLEDGE_POLLS) {
-				puts ("EEPROM poll acknowledge failed\n");
-				rcode = 1;
-			}
-		}
-
-		/* Is the write enable latch on?.
-		 */
-		else if (!(ctrl_reg_v & 0x02)) {
-			/* Set write enable latch.
-			 */
-			contr_reg[0] = 0x02;
-			if (i2c_write (contr_r_addr[0], 0xFF, 1, contr_reg, 1) != 0) {
-			       rcode = 1;
-			}
-		}
-		/* Write is enabled ... now write eeprom value.
-		 */
-#endif
 		if (i2c_write(addr[0], offset, alen - 1, buffer, len))
 			rcode = 1;
 
Signature · 1 line
2.1.1
#23 lore raw

PATCH 12/25 eeprom: Zap eeprom_probe()

In reply to Marek Vasut

Remove this function as it's no longer used.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 19 -------------------
 include/common.h    |  3 ---
 2 files changed, 22 deletions(-)
common/cmd_eeprom.c +0 -19
index b0acf11..ff492c4 100644
@@ -219,25 +219,6 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 	return rcode;
 }
 
-#if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-int eeprom_probe(unsigned dev_addr, unsigned offset)
-{
-	unsigned char chip;
-
-	/* Probe the chip address
-	 */
-#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1 && !defined(CONFIG_SPI_X)
-	chip = offset >> 8;		/* block number */
-#else
-	chip = offset >> 16;		/* block number */
-#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN, CONFIG_SPI_X */
-
-	chip |= dev_addr;		/* insert device address */
-
-	return (i2c_probe (chip));
-}
-#endif
-
 static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	const char *const fmt =
include/common.h +0 -3
index c96b58e..68596fc 100644
@@ -456,9 +456,6 @@ void	fdc_hw_init   (void);
 
 /* $(BOARD)/eeprom.c */
 void eeprom_init  (void);
-#ifndef CONFIG_SPI
-int  eeprom_probe (unsigned dev_addr, unsigned offset);
-#endif
 int  eeprom_read  (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
 int  eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
 #ifdef CONFIG_LWMON
Signature · 1 line
2.1.1
#24 lore raw

PATCH 13/25 eeprom: Zap CONFIG_SPI_X

In reply to Marek Vasut

This macro is no longer used, so just reap it.

Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 README              | 5 -----
 common/cmd_eeprom.c | 8 ++++----
 2 files changed, 4 insertions(+), 9 deletions(-)
README +0 -5
index 46def00..d267b6a 100644
@@ -2609,11 +2609,6 @@ CBFS (Coreboot Filesystem) support
 		Enables the driver for SPI controller on SuperH. Currently
 		only SH7757 is supported.
 
-		CONFIG_SPI_X
-
-		Enables extended (16-bit) SPI EEPROM addressing.
-		(symmetrical to CONFIG_I2C_X)
-
 		CONFIG_SOFT_SPI
 
 		Enables a software (bit-bang) SPI driver rather than
common/cmd_eeprom.c +4 -4
index ff492c4..d00598b 100644
@@ -83,7 +83,7 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 		unsigned maxlen;
 #endif
 
-#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1 && !defined(CONFIG_SPI_X)
+#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1
 		uchar addr[2];
 
 		blk_off = offset & 0xFF;	/* block offset */
@@ -100,7 +100,7 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 		addr[1] = offset >>  8;		/* upper address octet */
 		addr[2] = blk_off;		/* lower address octet */
 		alen	= 3;
-#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN, CONFIG_SPI_X */
+#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN */
 
 		addr[0] |= dev_addr;		/* insert device address */
 
@@ -153,7 +153,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 		unsigned maxlen;
 #endif
 
-#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1 && !defined(CONFIG_SPI_X)
+#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1
 		uchar addr[2];
 
 		blk_off = offset & 0xFF;	/* block offset */
@@ -170,7 +170,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 		addr[1] = offset >>  8;		/* upper address octet */
 		addr[2] = blk_off;		/* lower address octet */
 		alen	= 3;
-#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN, CONFIG_SPI_X */
+#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN */
 
 		addr[0] |= dev_addr;		/* insert device address */
 
Signature · 1 line
2.1.1
#25 lore raw

PATCH 14/25 eeprom: Pull out the I/O code

In reply to Marek Vasut

Pull out the code which does the I2C or SPI read/write, so that the beefy ifdef around it is contained in a single function.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)
common/cmd_eeprom.c +26 -12
index d00598b..b956233 100644
@@ -66,6 +66,29 @@ void eeprom_init(void)
 #endif
 }
 
+static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen,
+			   uchar *buffer, unsigned len, bool read)
+{
+	int ret = 0;
+
+	/* SPI */
+#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
+	if (read)
+		spi_read(addr, alen, buffer, len);
+	else
+		spi_write(addr, alen, buffer, len);
+#else	/* I2C */
+	if (read)
+		ret = i2c_read(addr[0], offset, alen - 1, buffer, len);
+	else
+		ret = i2c_write(addr[0], offset, alen - 1, buffer, len);
+
+	if (ret)
+		ret = 1;
+#endif
+	return ret;
+}
+
 int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 {
 	unsigned end = offset + cnt;
@@ -119,12 +142,8 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 			len = maxlen;
 #endif
 
-#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-		spi_read (addr, alen, buffer, len);
-#else
-		if (i2c_read(addr[0], offset, alen - 1, buffer, len))
-			rcode = 1;
-#endif
+		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, 1);
+
 		buffer += len;
 		offset += len;
 	}
@@ -199,13 +218,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 			len = maxlen;
 #endif
 
-#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-		spi_write (addr, alen, buffer, len);
-#else
-		if (i2c_write(addr[0], offset, alen - 1, buffer, len))
-			rcode = 1;
+		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, 0);
 
-#endif
 		buffer += len;
 		offset += len;
 
Signature · 1 line
2.1.1
#26 lore raw

PATCH 15/25 eeprom: Pull out address computation

In reply to Marek Vasut

Pull out the code computing the EEPROM address into separate function so that it's not duplicated.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 64 ++++++++++++++++++++++-------------------------------
 1 file changed, 26 insertions(+), 38 deletions(-)
common/cmd_eeprom.c +26 -38
index b956233..78c6121 100644
@@ -66,6 +66,28 @@ void eeprom_init(void)
 #endif
 }
 
+static int eeprom_addr(unsigned dev_addr, unsigned offset, uchar *addr)
+{
+	unsigned blk_off;
+	int alen;
+
+	blk_off = offset & 0xff;	/* block offset */
+#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1
+	addr[0] = offset >> 8;		/* block number */
+	addr[1] = blk_off;		/* block offset */
+	alen = 2;
+#else
+	addr[0] = offset >> 16;		/* block number */
+	addr[1] = offset >>  8;		/* upper address octet */
+	addr[2] = blk_off;		/* lower address octet */
+	alen = 3;
+#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN */
+
+	addr[0] |= dev_addr;		/* insert device address */
+
+	return alen;
+}
+
 static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen,
 			   uchar *buffer, unsigned len, bool read)
 {
@@ -94,6 +116,7 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 	unsigned end = offset + cnt;
 	unsigned blk_off;
 	int rcode = 0;
+	uchar addr[3];
 
 	/*
 	 * Read data until done or would cross a page boundary.
@@ -106,26 +129,8 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 		unsigned maxlen;
 #endif
 
-#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1
-		uchar addr[2];
-
-		blk_off = offset & 0xFF;	/* block offset */
-
-		addr[0] = offset >> 8;		/* block number */
-		addr[1] = blk_off;		/* block offset */
-		alen	= 2;
-#else
-		uchar addr[3];
-
 		blk_off = offset & 0xFF;	/* block offset */
-
-		addr[0] = offset >> 16;		/* block number */
-		addr[1] = offset >>  8;		/* upper address octet */
-		addr[2] = blk_off;		/* lower address octet */
-		alen	= 3;
-#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN */
-
-		addr[0] |= dev_addr;		/* insert device address */
+		alen = eeprom_addr(dev_addr, offset, addr);
 
 		len = end - offset;
 
@@ -156,6 +161,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 	unsigned end = offset + cnt;
 	unsigned blk_off;
 	int rcode = 0;
+	uchar addr[3];
 
 #if defined(CONFIG_SYS_EEPROM_WREN)
 	eeprom_write_enable (dev_addr,1);
@@ -172,26 +178,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 		unsigned maxlen;
 #endif
 
-#if CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 1
-		uchar addr[2];
-
 		blk_off = offset & 0xFF;	/* block offset */
-
-		addr[0] = offset >> 8;		/* block number */
-		addr[1] = blk_off;		/* block offset */
-		alen	= 2;
-#else
-		uchar addr[3];
-
-		blk_off = offset & 0xFF;	/* block offset */
-
-		addr[0] = offset >> 16;		/* block number */
-		addr[1] = offset >>  8;		/* upper address octet */
-		addr[2] = blk_off;		/* lower address octet */
-		alen	= 3;
-#endif	/* CONFIG_SYS_I2C_EEPROM_ADDR_LEN */
-
-		addr[0] |= dev_addr;		/* insert device address */
+		alen = eeprom_addr(dev_addr, offset, addr);
 
 		len = end - offset;
 
Signature · 1 line
2.1.1
#27 lore raw

PATCH 16/25 eeprom: Make eeprom_write_enable() weak

In reply to Marek Vasut

Make this function weak and implement it's weak implementation so that the boards can just reimplement it. This zaps the horrid CONFIG_SYS_EEPROM_WREN macro.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
common/cmd_eeprom.c +9 -9
index 78c6121..3fc3706 100644
@@ -44,9 +44,10 @@
 #endif
 #endif
 
-#if defined(CONFIG_SYS_EEPROM_WREN)
-extern int eeprom_write_enable (unsigned dev_addr, int state);
-#endif
+__weak int eeprom_write_enable(unsigned dev_addr, int state)
+{
+	return 0;
+}
 
 void eeprom_init(void)
 {
@@ -163,9 +164,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 	int rcode = 0;
 	uchar addr[3];
 
-#if defined(CONFIG_SYS_EEPROM_WREN)
-	eeprom_write_enable (dev_addr,1);
-#endif
+	eeprom_write_enable(dev_addr, 1);
+
 	/*
 	 * Write data until done or would cross a write page boundary.
 	 * We must write the address again when changing pages
@@ -215,9 +215,9 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 		udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
 #endif
 	}
-#if defined(CONFIG_SYS_EEPROM_WREN)
-	eeprom_write_enable (dev_addr,0);
-#endif
+
+	eeprom_write_enable(dev_addr, 0);
+
 	return rcode;
 }
 
Signature · 1 line
2.1.1
#28 lore raw

PATCH 17/25 eeprom: Pull out CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS

In reply to Marek Vasut

Pull this macro to the beginning of the cmd_eeprom.c and remove another nasty ifdef from the code. Note that this is legal, since udelay(0) changes the behavior only such that it pings the WDT if WDT is enabled and otherwise does not wait.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
common/cmd_eeprom.c +4 -2
index 3fc3706..918def4 100644
@@ -29,6 +29,10 @@
 #define	CONFIG_SYS_I2C_SPEED	50000
 #endif
 
+#ifndef CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	0
+#endif
+
 /*
  * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is
  *   0x000nxxxx for EEPROM address selectors at n, offset xxxx in EEPROM.
@@ -211,9 +215,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 		buffer += len;
 		offset += len;
 
-#if defined(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS)
 		udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
-#endif
 	}
 
 	eeprom_write_enable(dev_addr, 0);
Signature · 1 line
2.1.1
#29 lore raw

PATCH 18/25 eeprom: Suck the ifdef into eeprom_init()

In reply to Marek Vasut

Just suck the ugly ifdef around eeprom_init() call into eeprom_init() function itself. This puts all of the ifdef mess into one place.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
common/cmd_eeprom.c +5 -3
index 918def4..97747de 100644
@@ -55,6 +55,8 @@ __weak int eeprom_write_enable(unsigned dev_addr, int state)
 
 void eeprom_init(void)
 {
+# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
+
 	/* SPI EEPROM */
 #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
 	spi_init_f ();
@@ -69,6 +71,8 @@ void eeprom_init(void)
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
 #endif
+
+# endif /* !CONFIG_SPI */
 }
 
 static int eeprom_addr(unsigned dev_addr, unsigned offset, uchar *addr)
@@ -248,9 +252,7 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	off = simple_strtoul(*args++, NULL, 16);
 	cnt = simple_strtoul(*args++, NULL, 16);
 
-# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-	eeprom_init ();
-# endif /* !CONFIG_SPI */
+	eeprom_init();
 
 	if (strcmp (argv[1], "read") == 0) {
 		printf(fmt, dev_addr, argv[1], addr, off, cnt);
Signature · 1 line
2.1.1
#30 lore raw

PATCH 19/25 eeprom: Pull out CONFIG_SYS_EEPROM_PAGE_WRITE_BITS

In reply to Marek Vasut

Implement default value of 8 for this macro and pull out all of this macro out of the code. The default value of 8 actually does implement exactly the same behavior as the previous code which was in the #else clause of the ifdef.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
common/cmd_eeprom.c +8 -8
index 97747de..6f55306 100644
@@ -33,6 +33,13 @@
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	0
 #endif
 
+#ifndef CONFIG_SYS_EEPROM_PAGE_WRITE_BITS
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	8
+#endif
+
+#define	EEPROM_PAGE_SIZE	(1 << CONFIG_SYS_EEPROM_PAGE_WRITE_BITS)
+#define	EEPROM_PAGE_OFFSET(x)	((x) & (EEPROM_PAGE_SIZE - 1))
+
 /*
  * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is
  *   0x000nxxxx for EEPROM address selectors@n, offset xxxx in EEPROM.
@@ -198,15 +205,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 		 */
 #if !defined(CONFIG_SYS_I2C_FRAM)
 
-#if defined(CONFIG_SYS_EEPROM_PAGE_WRITE_BITS)
-
-#define	EEPROM_PAGE_SIZE	(1 << CONFIG_SYS_EEPROM_PAGE_WRITE_BITS)
-#define	EEPROM_PAGE_OFFSET(x)	((x) & (EEPROM_PAGE_SIZE - 1))
-
 		maxlen = EEPROM_PAGE_SIZE - EEPROM_PAGE_OFFSET(blk_off);
-#else
-		maxlen = 0x100 - blk_off;
-#endif
+
 		if (maxlen > I2C_RXTX_LEN)
 			maxlen = I2C_RXTX_LEN;
 
Signature · 1 line
2.1.1
#31 lore raw

PATCH 20/25 eeprom: Pull out transfer length computation

In reply to Marek Vasut

Pull out the code which computes the length of the transfer into separate code and clean it up a little. This again trims down the code duplication.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 66 ++++++++++++++++++++---------------------------------
 1 file changed, 25 insertions(+), 41 deletions(-)
common/cmd_eeprom.c +25 -41
index 6f55306..231f424 100644
@@ -104,6 +104,29 @@ static int eeprom_addr(unsigned dev_addr, unsigned offset, uchar *addr)
 	return alen;
 }
 
+static int eeprom_len(unsigned offset, unsigned end)
+{
+	unsigned len = end - offset;
+
+	/*
+	 * For a FRAM device there is no limit on the number of the
+	 * bytes that can be ccessed with the single read or write
+	 * operation.
+	 */
+#if !defined(CONFIG_SYS_I2C_FRAM)
+	unsigned blk_off = offset & 0xff;
+	unsigned maxlen = EEPROM_PAGE_SIZE - EEPROM_PAGE_OFFSET(blk_off);
+
+	if (maxlen > I2C_RXTX_LEN)
+		maxlen = I2C_RXTX_LEN;
+
+	if (len > maxlen)
+		len = maxlen;
+#endif
+
+	return len;
+}
+
 static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen,
 			   uchar *buffer, unsigned len, bool read)
 {
@@ -130,7 +153,6 @@ static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen,
 int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 {
 	unsigned end = offset + cnt;
-	unsigned blk_off;
 	int rcode = 0;
 	uchar addr[3];
 
@@ -141,27 +163,10 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 	 */
 	while (offset < end) {
 		unsigned alen, len;
-#if !defined(CONFIG_SYS_I2C_FRAM)
-		unsigned maxlen;
-#endif
 
-		blk_off = offset & 0xFF;	/* block offset */
 		alen = eeprom_addr(dev_addr, offset, addr);
 
-		len = end - offset;
-
-		/*
-		 * For a FRAM device there is no limit on the number of the
-		 * bytes that can be ccessed with the single read or write
-		 * operation.
-		 */
-#if !defined(CONFIG_SYS_I2C_FRAM)
-		maxlen = 0x100 - blk_off;
-		if (maxlen > I2C_RXTX_LEN)
-			maxlen = I2C_RXTX_LEN;
-		if (len > maxlen)
-			len = maxlen;
-#endif
+		len = eeprom_len(offset, end);
 
 		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, 1);
 
@@ -175,7 +180,6 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 {
 	unsigned end = offset + cnt;
-	unsigned blk_off;
 	int rcode = 0;
 	uchar addr[3];
 
@@ -189,30 +193,10 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 
 	while (offset < end) {
 		unsigned alen, len;
-#if !defined(CONFIG_SYS_I2C_FRAM)
-		unsigned maxlen;
-#endif
 
-		blk_off = offset & 0xFF;	/* block offset */
 		alen = eeprom_addr(dev_addr, offset, addr);
 
-		len = end - offset;
-
-		/*
-		 * For a FRAM device there is no limit on the number of the
-		 * bytes that can be accessed with the single read or write
-		 * operation.
-		 */
-#if !defined(CONFIG_SYS_I2C_FRAM)
-
-		maxlen = EEPROM_PAGE_SIZE - EEPROM_PAGE_OFFSET(blk_off);
-
-		if (maxlen > I2C_RXTX_LEN)
-			maxlen = I2C_RXTX_LEN;
-
-		if (len > maxlen)
-			len = maxlen;
-#endif
+		len = eeprom_len(offset, end);
 
 		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, 0);
 
Signature · 1 line
2.1.1
#32 lore raw

PATCH 21/25 eeprom: Pull out the RW loop

In reply to Marek Vasut

Unify the code for doing read/write into single function, since the code for both the read and write is almost identical. This again trims down the code duplication.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 51 +++++++++++++++++++++------------------------------
 1 file changed, 21 insertions(+), 30 deletions(-)
common/cmd_eeprom.c +21 -30
index 231f424..6a02496 100644
@@ -150,38 +150,44 @@ static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen,
 	return ret;
 }
 
-int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
+static int eeprom_rw(unsigned dev_addr, unsigned offset, uchar *buffer,
+		     unsigned cnt, bool read)
 {
 	unsigned end = offset + cnt;
+	unsigned alen, len;
 	int rcode = 0;
 	uchar addr[3];
 
-	/*
-	 * Read data until done or would cross a page boundary.
-	 * We must write the address again when changing pages
-	 * because the next page may be in a different device.
-	 */
 	while (offset < end) {
-		unsigned alen, len;
-
 		alen = eeprom_addr(dev_addr, offset, addr);
 
 		len = eeprom_len(offset, end);
 
-		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, 1);
+		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, read);
 
 		buffer += len;
 		offset += len;
+
+		if (!read)
+			udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
 	}
 
 	return rcode;
 }
 
-int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
+int eeprom_read(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 {
-	unsigned end = offset + cnt;
-	int rcode = 0;
-	uchar addr[3];
+	/*
+	 * Read data until done or would cross a page boundary.
+	 * We must write the address again when changing pages
+	 * because the next page may be in a different device.
+	 */
+	return eeprom_rw(dev_addr, offset, buffer, cnt, 1);
+}
+
+int eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
+{
+	int ret;
 
 	eeprom_write_enable(dev_addr, 1);
 
@@ -190,25 +196,10 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 	 * We must write the address again when changing pages
 	 * because the address counter only increments within a page.
 	 */
-
-	while (offset < end) {
-		unsigned alen, len;
-
-		alen = eeprom_addr(dev_addr, offset, addr);
-
-		len = eeprom_len(offset, end);
-
-		rcode = eeprom_rw_block(offset, addr, alen, buffer, len, 0);
-
-		buffer += len;
-		offset += len;
-
-		udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
-	}
+	ret = eeprom_rw(dev_addr, offset, buffer, cnt, 1);
 
 	eeprom_write_enable(dev_addr, 0);
-
-	return rcode;
+	return ret;
 }
 
 static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Signature · 1 line
2.1.1
#33 lore raw

PATCH 22/25 eeprom: Cultivate the ifdef mess

In reply to Marek Vasut

Just squash the ad-hoc ifdef chaos into single #else statement. It's not worth having so many checks in place, since this only leads to complicated code and if the first test for SPI && not env in I2C EEPROM fails, then we're dealing with I2C EEPROM.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
common/cmd_eeprom.c +3 -9
index 6a02496..5bc836f 100644
@@ -62,24 +62,18 @@ __weak int eeprom_write_enable(unsigned dev_addr, int state)
 
 void eeprom_init(void)
 {
-# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-
 	/* SPI EEPROM */
 #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
-	spi_init_f ();
-#endif
-
+	spi_init_f();
+#else
 	/* I2C EEPROM */
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT) || \
-	defined(CONFIG_SYS_I2C)
 #ifdef CONFIG_SYS_I2C
 	i2c_init_all();
 #else
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
-#endif
 
-# endif /* !CONFIG_SPI */
+#endif
 }
 
 static int eeprom_addr(unsigned dev_addr, unsigned offset, uchar *addr)
Signature · 1 line
2.1.1
#34 lore raw

PATCH 23/25 eeprom: Add bus argument to eeprom_init()

In reply to Marek Vasut

Add bus argument to eeprom_init(), so that it can select the I2C bus number on which the eeprom resides. Any negative value of the $bus argument will preserve the old behavior. This is in place so that old code does not randomly break.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 7 ++++---
 common/env_eeprom.c | 4 ++--
 include/common.h    | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)
common/cmd_eeprom.c +4 -3
index 5bc836f..0133b50 100644
@@ -60,7 +60,7 @@ __weak int eeprom_write_enable(unsigned dev_addr, int state)
 	return 0;
 }
 
-void eeprom_init(void)
+void eeprom_init(int bus)
 {
 	/* SPI EEPROM */
 #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
@@ -72,7 +72,8 @@ void eeprom_init(void)
 #else
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
-
+	if (bus >= 0)
+		i2c_set_bus_num(bus);
 #endif
 }
 
@@ -221,7 +222,7 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	off = simple_strtoul(*args++, NULL, 16);
 	cnt = simple_strtoul(*args++, NULL, 16);
 
-	eeprom_init();
+	eeprom_init(-1);
 
 	if (strcmp (argv[1], "read") == 0) {
 		printf(fmt, dev_addr, argv[1], addr, off, cnt);
common/env_eeprom.c +2 -2
index 905d39a..d82e8da 100644
@@ -153,7 +153,7 @@ int env_init(void)
 	uchar buf[64], flags[2];
 	int i, crc_ok[2] = {0, 0};
 
-	eeprom_init();	/* prepare for EEPROM read/write */
+	eeprom_init(-1);	/* prepare for EEPROM read/write */
 
 	off_env[0] = CONFIG_ENV_OFFSET;
 	off_env[1] = CONFIG_ENV_OFFSET_REDUND;
@@ -227,7 +227,7 @@ int env_init(void)
 	unsigned off;
 	uchar buf[64];
 
-	eeprom_init();	/* prepare for EEPROM read/write */
+	eeprom_init(-1);	/* prepare for EEPROM read/write */
 
 	/* read old CRC */
 	eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
include/common.h +1 -1
index 68596fc..ab70526 100644
@@ -455,7 +455,7 @@ void	reset_phy     (void);
 void	fdc_hw_init   (void);
 
 /* $(BOARD)/eeprom.c */
-void eeprom_init  (void);
+void eeprom_init  (int bus);
 int  eeprom_read  (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
 int  eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
 #ifdef CONFIG_LWMON
Signature · 1 line
2.1.1
#35 lore raw

PATCH 24/25 eeprom: Add support for selecting i2c bus

In reply to Marek Vasut

Add additional parameter into the eeprom command to select the I2C bus on which the eeprom resides.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
common/cmd_eeprom.c +11 -4
index 0133b50..3b156ee 100644
@@ -204,14 +204,21 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	char * const *args = &argv[2];
 	int rcode;
 	ulong dev_addr, addr, off, cnt;
+	int bus_addr;
 
 	switch (argc) {
 #ifdef CONFIG_SYS_DEF_EEPROM_ADDR
 	case 5:
+		bus_addr = -1;
 		dev_addr = CONFIG_SYS_DEF_EEPROM_ADDR;
 		break;
 #endif
 	case 6:
+		bus_addr = -1;
+		dev_addr = simple_strtoul(*args++, NULL, 16);
+		break;
+	case 7:
+		bus_addr = simple_strtoul(*args++, NULL, 16);
 		dev_addr = simple_strtoul(*args++, NULL, 16);
 		break;
 	default:
@@ -222,7 +229,7 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	off = simple_strtoul(*args++, NULL, 16);
 	cnt = simple_strtoul(*args++, NULL, 16);
 
-	eeprom_init(-1);
+	eeprom_init(bus_addr);
 
 	if (strcmp (argv[1], "read") == 0) {
 		printf(fmt, dev_addr, argv[1], addr, off, cnt);
@@ -244,9 +251,9 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 
 U_BOOT_CMD(
-	eeprom,	6,	1,	do_eeprom,
+	eeprom,	7,	1,	do_eeprom,
 	"EEPROM sub-system",
-	"read  devaddr addr off cnt\n"
-	"eeprom write devaddr addr off cnt\n"
+	"read  <bus> <devaddr> addr off cnt\n"
+	"eeprom write <bus> <devaddr> addr off cnt\n"
 	"       - read/write `cnt' bytes from `devaddr` EEPROM at offset `off'"
 )
Signature · 1 line
2.1.1
#36 lore raw

PATCH 25/25 eeprom: Clean up checkpatch issues

In reply to Marek Vasut

Cosmetic fixes to the file, make it checkpatch clean.

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 common/cmd_eeprom.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
common/cmd_eeprom.c +10 -9
index 3b156ee..a619504 100644
@@ -49,8 +49,8 @@
  */
 #if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
 #if !defined(CONFIG_SYS_I2C_EEPROM_ADDR_LEN) || \
-    (CONFIG_SYS_I2C_EEPROM_ADDR_LEN < 1) || \
-    (CONFIG_SYS_I2C_EEPROM_ADDR_LEN > 2)
+	(CONFIG_SYS_I2C_EEPROM_ADDR_LEN < 1) || \
+	(CONFIG_SYS_I2C_EEPROM_ADDR_LEN > 2)
 #error CONFIG_SYS_I2C_EEPROM_ADDR_LEN must be 1 or 2
 #endif
 #endif
@@ -180,7 +180,8 @@ int eeprom_read(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
 	return eeprom_rw(dev_addr, offset, buffer, cnt, 1);
 }
 
-int eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
+int eeprom_write(unsigned dev_addr, unsigned offset,
+		 uchar *buffer, unsigned cnt)
 {
 	int ret;
 
@@ -231,19 +232,19 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	eeprom_init(bus_addr);
 
-	if (strcmp (argv[1], "read") == 0) {
+	if (strcmp(argv[1], "read") == 0) {
 		printf(fmt, dev_addr, argv[1], addr, off, cnt);
 
-		rcode = eeprom_read(dev_addr, off, (uchar *) addr, cnt);
+		rcode = eeprom_read(dev_addr, off, (uchar *)addr, cnt);
 
-		puts ("done\n");
+		puts("done\n");
 		return rcode;
-	} else if (strcmp (argv[1], "write") == 0) {
+	} else if (strcmp(argv[1], "write") == 0) {
 		printf(fmt, dev_addr, argv[1], addr, off, cnt);
 
-		rcode = eeprom_write(dev_addr, off, (uchar *) addr, cnt);
+		rcode = eeprom_write(dev_addr, off, (uchar *)addr, cnt);
 
-		puts ("done\n");
+		puts("done\n");
 		return rcode;
 	}
 
Signature · 1 line
2.1.1