Add "cpu_config" command for PPC4xx bootstrap configuration
PATCH v2 1/1 Add "cpu_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:
=> cpu_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
=> cpu_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.
---
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/cpu_config.c | 55 ++++++++++ cpu/ppc4xx/Makefile | 3 + cpu/ppc4xx/cmd_cpu_config.c | 127 +++++++++++++++++++++++ include/asm-ppc/ppc4xx_config.h | 42 ++++++++ include/configs/canyonlands.h | 4 + 7 files changed, 234 insertions(+), 197 deletions(-) delete mode 100644 board/amcc/canyonlands/bootstrap.c create mode 100644 board/amcc/canyonlands/cpu_config.c create mode 100644 cpu/ppc4xx/cmd_cpu_config.c create mode 100644 include/asm-ppc/ppc4xx_config.h
board/amcc/canyonlands/Makefile +3 -2
@@ -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_CPU_CONFIG) += cpu_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/cpu_config.c new file +55 -0
55 lines not on this page · raw message
cpu/ppc4xx/Makefile +3 -0
@@ -41,6 +41,9 @@ endif COBJS += 4xx_pci.o COBJS += 4xx_pcie.o COBJS += bedbug_405.o +ifdef CONFIG_CMD_CPU_CONFIG +COBJS += cmd_cpu_config.o +endif COBJS += commproc.o COBJS += cpu.o COBJS += cpu_init.o
cpu/ppc4xx/cmd_cpu_config.c new file +127 -0
127 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 +4 -0
@@ -330,6 +330,9 @@#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 +#define CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR 0x52 +#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 +445,7 @@/* * Commands additional to the ones defined in amcc-common.h */ +#define CONFIG_CMD_CPU_CONFIG #if defined(CONFIG_ARCHES )#define CONFIG_CMD_DTT #define CONFIG_CMD_PCI
Signature · 1 line
1.6.3.3
PATCH v2 1/1 Add "cpu_config" command for PPC4xx bootstrap configuration
Dear Stefan Roese,
Quoted 12 lines · In message <[email protected]> you wrote:
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:
=>
cpu_config
Available configurations (I2C address0x52):
Quoted 8 lines
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
I like that!
Quoted 5 lines
cpu/ppc4xx/cmd_cpu_config.c new file +0
-0
...
Quoted 2 lines
cpu/ppc4xx/cmd_cpu_config.c new file +2
-0+static int do_cpu_config (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) +{
...
cpu/ppc4xx/cmd_cpu_config.c line 74
Quoted 3 lines
cpu/ppc4xx/cmd_cpu_config.c new file +3
-0+if (cur_config_nr ==-1 ) { +printf ("Warning: The I2C bootstrap EEPROM values don't match any" +" of the available config options!\n" );
This message doesn't fit into a single line. Please shorten or make 2 lines.
Best regards,
Wolfgang Denk
Signature · 8 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
The so-called "desktop metaphor" of today's workstations is instead
an "airplane-seat" metaphor. Anyone who has shuffled a lap full of
papers while seated between two portly passengers will recognize the
difference -- one can see only a very few things at once.
- Fred Brooks, Jr.