Skip to contentSkip to conversation

Add "chip_config" command for PPC4xx bootstrap configuration

PATCH Superseded Stefan Roese 2 participants 3 messages Jul 20, 2009

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add "chip_config" command for PPC4xx bootstrap configuration

This patch adds a generic command for programming I2C bootstrap eeproms on PPC4xx. An implementation for Canyonlands board is included.

The command name is intentionally chosen not to be PPC4xx specific. This way other CPU's/SoC's can implement a similar command under the same name, perhaps with a different syntax.

Usage on Canyonlands:

=> chip_config
Available configurations (I2C address 0x52):

600-nor          - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
600-nand         - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
800-nor          - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
800-nand         - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
1000-nor         - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
1000-nand        - NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
1066-nor         - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
1066-nand        - NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88

=> chip_config 600-nor
Using configuration:
600-nor - NOR CPU: 600 PLB: 200 OPB: 100 EBC: 100
done (dump via 'i2c md 52 0.1 10')
Reset the board for the changes to take effect

Other 4xx boards will be migrated to use this command soon as well.

sdfsdf

sdfsdf

---
v4:
- Command name changed from cpu_config to chip_config
- Used eeprom_read/eeprom_write if available
- Added CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET

v3:
- Line length of one printf reduced

v2:
- Patch authorship changes to Stefan
- s-o-b from Dirk added
- Added current configuration detection
- Minor coding style cleanup

 board/amcc/canyonlands/Makefile      |    5 +-
 board/amcc/canyonlands/bootstrap.c   |  195 ----------------------------------
 board/amcc/canyonlands/chip_config.c |   55 ++++++++++
 cpu/ppc4xx/Makefile                  |    3 +
 cpu/ppc4xx/cmd_chip_config.c         |  142 ++++++++++++++++++++++++
 include/asm-ppc/ppc4xx_config.h      |   42 +++++++
 include/configs/canyonlands.h        |    6 +
 7 files changed, 251 insertions(+), 197 deletions(-)
 delete mode 100644 board/amcc/canyonlands/bootstrap.c
 create mode 100644 board/amcc/canyonlands/chip_config.c
 create mode 100644 cpu/ppc4xx/cmd_chip_config.c
 create mode 100644 include/asm-ppc/ppc4xx_config.h
board/amcc/canyonlands/Makefile +3 -2
index 2aeead6..12f8a64 100644
@@ -25,10 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o
-COBJS	+= bootstrap.o
+COBJS-y	:= $(BOARD).o
+COBJS-$(CONFIG_CMD_CHIP_CONFIG) += chip_config.o
 SOBJS	:= init.o
 
+COBJS   := $(COBJS-y)
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
board/amcc/canyonlands/bootstrap.c deleted +0 -195

195 lines not on this page · raw message

board/amcc/canyonlands/chip_config.c new file +55 -0

55 lines not on this page · raw message

cpu/ppc4xx/Makefile +3 -0
index 6f52dfd..2050b17 100644
@@ -41,6 +41,9 @@ endif
 COBJS	+= 4xx_pci.o
 COBJS	+= 4xx_pcie.o
 COBJS	+= bedbug_405.o
+ifdef CONFIG_CMD_CHIP_CONFIG
+COBJS	+= cmd_chip_config.o
+endif
 COBJS	+= commproc.o
 COBJS	+= cpu.o
 COBJS	+= cpu_init.o
cpu/ppc4xx/cmd_chip_config.c new file +142 -0

142 lines not on this page · raw message

include/asm-ppc/ppc4xx_config.h new file +42 -0

42 lines not on this page · raw message

include/configs/canyonlands.h +6 -0
index d22d411..217a8ee 100644
@@ -330,6 +330,11 @@
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	10
 
+/* I2C bootstrap EEPROM */
+#define CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR	0x52
+#define CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET	0
+#define CONFIG_4xx_CONFIG_BLOCKSIZE		16
+
 /* I2C SYSMON (LM75, AD7414 is almost compatible)			*/
 #define CONFIG_DTT_LM75		1		/* ON Semi's LM75	*/
 #define CONFIG_DTT_AD7414	1		/* use AD7414		*/
@@ -442,6 +447,7 @@
 /*
  * Commands additional to the ones defined in amcc-common.h
  */
+#define CONFIG_CMD_CHIP_CONFIG
 #if defined(CONFIG_ARCHES)
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_PCI
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH v4 1/1 Add "chip_config" command for PPC4xx bootstrap configuration

<snip>

Quoted 7 lines

Other 4xx boards will be migrated to use this command soon as well.

Quoted 7 lines

sdfsdf

sdfsdf

Hi Stefan,
Looks like there's some squashed commit remnants above?

Best,
Peter

#2 lore raw

PATCH v4 1/1 Add "chip_config" command for PPC4xx bootstrap configuration

Quoted 11 lines · On Monday 20 July 2009 07:24:41 Peter Tyser wrote:

<snip>

Quoted 9 lines

Other 4xx boards will be migrated to use this command soon as well.

sdfsdf

Quoted 8 lines
Quoted 5 lines

sdfsdf

Hi Stefan,
Looks like there's some squashed commit remnants above?

Ups. Will resend in a short while. Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================