Skip to contentSkip to conversation

mpc832x: add support for the mpc8321 based suvd3 board

PATCH New Heiko Schocher 2 participants 3 messages Apr 12, 2010 – Apr 23, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 mpc832x: add support for the mpc8321 based suvd3 board

- serial console on UART1
- Ethernet RMII over UCC4
- PHY SMSC LAN8700
- 64MB Flash
- 128 MB DDR2 RAM
- I2C
- bootcount

This board is similiar to the kmeter1 (8360) board, so common config options are extracted into the include/configs/km83xx-common.h file.

---
 MAINTAINERS                                        |    1 +
 MAKEALL                                            |    1 +
 Makefile                                           |    5 +-
 board/keymile/common/common.c                      |    4 +-
 board/keymile/{kmeter1 => km83xx}/Makefile         |    0
 board/keymile/{kmeter1 => km83xx}/config.mk        |    0
 .../keymile/{kmeter1/kmeter1.c => km83xx/km83xx.c} |   86 ++++-
 cpu/mpc83xx/cpu.c                                  |    2 +-
 cpu/mpc83xx/fdt.c                                  |    3 +-
 include/configs/km83xx-common.h                    |  348 ++++++++++++++++++++
 include/configs/kmeter1.h                          |  334 +------------------
 include/configs/suvd3.h                            |  216 ++++++++++++
 12 files changed, 666 insertions(+), 334 deletions(-)
 rename board/keymile/{kmeter1 => km83xx}/Makefile (100%)
 rename board/keymile/{kmeter1 => km83xx}/config.mk (100%)
 rename board/keymile/{kmeter1/kmeter1.c => km83xx/km83xx.c} (67%)
 create mode 100644 include/configs/km83xx-common.h
 create mode 100644 include/configs/suvd3.h
MAINTAINERS +1 -0
index 04c8730..47ff4c1 100644
@@ -412,6 +412,7 @@ Heiko Schocher <[email protected]>
 	municse		MPC5200
 	sc3		PPC405GP
 	suen3		ARM926EJS (Kirkwood SoC)
+	suvd3		MPC8321
 	uc101		MPC5200
 
 Peter De Schrijver <[email protected]>
MAKEALL +1 -0
index fb1f7a3..9ae17c3 100755
@@ -375,6 +375,7 @@ LIST_83xx="		\
 	MVBLM7		\
 	sbc8349		\
 	SIMPC8313_LP	\
+	suvd3		\
 	TQM834x		\
 	vme8349		\
 "
Makefile +4 -1
index 5d314c6..38b0488 100644
@@ -2229,7 +2229,7 @@ TASREG_config :		unconfig
 #########################################################################
 
 kmeter1_config: unconfig
-	@$(MKCONFIG) kmeter1 ppc mpc83xx kmeter1 keymile
+	@$(MKCONFIG) kmeter1 ppc mpc83xx km83xx keymile
 
 MPC8313ERDB_33_config \
 MPC8313ERDB_66_config \
@@ -2388,6 +2388,9 @@ SIMPC8313_SP_config: unconfig
 	@$(MKCONFIG) -a SIMPC8313 ppc mpc83xx simpc8313 sheldon
 	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
 
+suvd3_config: unconfig
+	@$(MKCONFIG) suvd3 ppc mpc83xx km83xx keymile
+
 TQM834x_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc83xx tqm834x tqc
 
board/keymile/common/common.c +2 -2
index 7b4eefd..9325eee 100644
@@ -424,7 +424,7 @@ static int get_scl (void)
 }
 #endif
 
-#if !defined(CONFIG_KMETER1)
+#if !defined(CONFIG_MPC83xx)
 static void writeStartSeq (void)
 {
 	set_sda (1);
@@ -483,7 +483,7 @@ static int i2c_make_abort (void)
  */
 void i2c_init_board(void)
 {
-#if defined(CONFIG_KMETER1)
+#if defined(CONFIG_MPC83xx)
 	struct fsl_i2c *dev;
 	dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
 	uchar	dummy;
board/keymile/km83xx/Makefile renamed from board/keymile/kmeter1/Makefile +0 -0
similarity index 100%
rename from board/keymile/kmeter1/Makefile
rename to board/keymile/km83xx/Makefile
board/keymile/km83xx/config.mk renamed from board/keymile/kmeter1/config.mk +0 -0
similarity index 100%
rename from board/keymile/kmeter1/config.mk
rename to board/keymile/km83xx/config.mk
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +72 -14

135 lines not on this page · raw message

cpu/mpc83xx/cpu.c +1 -1
index 51180d6..5ca6f83 100644
@@ -305,7 +305,7 @@ int cpu_mmc_init(bd_t *bis)
 
 #ifdef CONFIG_BOOTCOUNT_LIMIT
 
-#if !defined(CONFIG_MPC8360)
+#if !defined(CONFIG_MPC8360) && !defined(CONFIG_MPC832x)
 #error "CONFIG_BOOTCOUNT_LIMIT only for MPC8360 implemented"
 #endif
 
cpu/mpc83xx/fdt.c +2 -1
index daf73a6..482aa7a 100644
@@ -32,7 +32,8 @@ extern void ft_qe_setup(void *blob);
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_BOOTCOUNT_LIMIT) && defined(CONFIG_MPC8360)
+#if defined(CONFIG_BOOTCOUNT_LIMIT) && \
+    (defined(CONFIG_MPC8360) || defined(CONFIG_MPC832x))
 #include <asm/immap_qe.h>
 
 void fdt_fixup_muram (void *blob)
include/configs/km83xx-common.h new file +348 -0

348 lines not on this page · raw message

include/configs/kmeter1.h +19 -315

399 lines not on this page · raw message

include/configs/suvd3.h new file +216 -0

216 lines not on this page · raw message

Signature · 5 lines
1.6.2.5

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

PATCH 2/4 mpc832x: add support for the mpc8321 based suvd3 board

Dear Heiko Schocher,

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

- serial console on UART1
- Ethernet RMII over UCC4
- PHY SMSC LAN8700
- 64MB Flash
- 128 MB DDR2 RAM
- I2C
- bootcount

This board is similiar to the kmeter1 (8360) board, so common config options are extracted into the include/configs/km83xx-common.h file.

board/keymile/km83xx/km83xx.c line 16

Quoted 6 lines
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +3 -0
@@ -11,6 +11,9 @@
  * (C) Copyright 2008
  * Heiko Schocher, DENX Software Engineering, hs at denx.de.
  *
+ * (C) Copyright 2009
+ * Heiko Schocher, DENX Software Engineering, hs at denx.de.
+ *

Please use a single entry and use "2008-2009" instead. Please fix globally.

Or is this 2010 actually?

Quoted 10 lines
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +10 -0
+#if defined(CONFIG_SUVD3)
+const uint upma_table[] =
+{ 0x1ffedc00, 0x0ffcdc80, 0x0ffcdc80, 0x0ffcdc04, //Words 0 to 3
+  0x0ffcdc00, 0xffffcc00, 0xffffcc01, 0xfffffc01, //Words 4 to 7
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 8 to 11
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 12 to 15
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 16 to 19
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 20 to 23
+  0x9cfffc00, 0x00fffc80, 0x00fffc80, 0x00fffc00, //Words 24 to 27
+  0xffffec04, 0xffffec01, 0xfffffc01, 0xfffffc01, //Words 28 to 31

board/keymile/km83xx/km83xx.c static int board_init_i2c_busses (void) · line 138

Quoted 10 lines
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +10 -0
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 32 to 35
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 36 to 39
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 40 to 43
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 44 to 47
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 48 to 51
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 52 to 55
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 56 to 59
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01  //Words 60 to 63
+};
+#endif

No C++ comments, please. Please fix globally.

board/keymile/km83xx/km83xx.c phys_size_t initdram (int board_type) · line 253

Quoted 5 lines

int checkboard (void)
{

board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +2 -1
-	puts ("Board: Keymile kmeter1");
+	puts ("Board: Keymile ");
+	puts(CONFIG_KM_BOARD_NAME);

Please write:

	puts("Board: Keymile " CONFIG_KM_BOARD_NAME);

cpu/mpc83xx/cpu.c int cpu_mmc_init(bd_t *bis) · line 309

Quoted 9 lines
cpu/mpc83xx/cpu.c +1 -1
@@ -305,7 +305,7 @@ int cpu_mmc_init(bd_t *bis)
 
 #ifdef CONFIG_BOOTCOUNT_LIMIT
 
-#if !defined(CONFIG_MPC8360)
+#if !defined(CONFIG_MPC8360) && !defined(CONFIG_MPC832x)
 #error "CONFIG_BOOTCOUNT_LIMIT only for MPC8360 implemented"

Code and comments don't agree.

And please keep list sorted (832x < 8360). Please fix globally.

...

cpu/mpc83xx/cpu.c int cpu_mmc_init(bd_t *bis)

Quoted 7 lines
cpu/mpc83xx/cpu.c +7 -0
+#undef CONFIG_DDR_ECC
+
+/*
+ * DDRCDR - DDR Control Driver Register
+ */
+
+#undef CONFIG_SPD_EEPROM	/* Do not use SPD EEPROM for DDR setup */

No need to undefine what is not defined anyway.

cpu/mpc83xx/cpu.c

Quoted 5 lines
cpu/mpc83xx/cpu.c +5 -0
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE		2048 /* MB */

Do you use get_ram_size() for auto-sizing?

cpu/mpc83xx/cpu.c

Quoted 5 lines
cpu/mpc83xx/cpu.c +5 -0
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#else
+#undef	CONFIG_SYS_RAMBOOT
+#endif

Please do not #undef what is not defined - please fix globally.

cpu/mpc83xx/cpu.c

Quoted 8 lines
cpu/mpc83xx/cpu.c +8 -0
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK	1
+#define CONFIG_SYS_INIT_RAM_ADDR	0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_END	0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_SIZE	0x100 /* num bytes initial data */
+#define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)

Line too long. please fix globally.

...

Quoted 1 line

+#ifndef CONFIG_SYS_RAMBOOT

...

Quoted 1 line

+#else /* CFG_RAMBOOT */

...

Quoted 1 line

+#endif /* CFG_RAMBOOT */

CFG_RAMBOOT ??? Seems this needs cleanup.

cpu/mpc83xx/cpu.c

Quoted 3 lines
cpu/mpc83xx/cpu.c +3 -0
+#if defined(CFG_RAMBOOT)
+#undef CONFIG_CMD_SAVEENV
+#undef CONFIG_CMD_LOADS

Why?

cpu/mpc83xx/cpu.c

Quoted 10 lines
cpu/mpc83xx/cpu.c +10 -0
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       CONFIG_KM_DEF_ENV						\
+       CONFIG_KM_DEF_ROOTPATH						\
+	"dtt_bus=pca9547:70:a\0"					\
+	"EEprom_ivm=pca9547:70:9\0"					\
+	"newenv="							\
+		"prot off 0xF00C0000 +0x40000 && "			\
+		"era 0xF00C0000 +0x40000\0" 				\
+	"unlock=yes\0"							\
+	""

Indentation by TAB only. Please fix globally.

Best regards,

Wolfgang Denk

Signature · 4 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
Nobody goes to that restaurant anymore. It's too crowded.
#2 lore raw

PATCH 2/4 mpc832x: add support for the mpc8321 based suvd3 board

Hello Wolfgang,

Quoted 26 lines · Wolfgang Denk
Quoted 15 lines · In message <[email protected]> you wrote:

- serial console on UART1
- Ethernet RMII over UCC4
- PHY SMSC LAN8700
- 64MB Flash
- 128 MB DDR2 RAM
- I2C
- bootcount

This board is similiar to the kmeter1 (8360) board, so common config options are extracted into the include/configs/km83xx-common.h file.

board/keymile/km83xx/km83xx.c line 16

Quoted 6 lines
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +3 -0
@@ -11,6 +11,9 @@
  * (C) Copyright 2008
  * Heiko Schocher, DENX Software Engineering, hs at denx.de.
  *
+ * (C) Copyright 2009
+ * Heiko Schocher, DENX Software Engineering, hs at denx.de.
+ *

Please use a single entry and use "2008-2009" instead. Please fix globally.

Quoted 1 line

Or is this 2010 actually?

It is 2008-2010, fixed.

Quoted 14 lines
Quoted 14 lines
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +14 -0
+#if defined(CONFIG_SUVD3)
+const uint upma_table[] =
+{ 0x1ffedc00, 0x0ffcdc80, 0x0ffcdc80, 0x0ffcdc04, //Words 0 to 3
+  0x0ffcdc00, 0xffffcc00, 0xffffcc01, 0xfffffc01, //Words 4 to 7
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 8 to 11
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 12 to 15
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 16 to 19
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 20 to 23
+  0x9cfffc00, 0x00fffc80, 0x00fffc80, 0x00fffc00, //Words 24 to 27
+  0xffffec04, 0xffffec01, 0xfffffc01, 0xfffffc01, //Words 28 to 31
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 32 to 35
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 36 to 39
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 40 to 43
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 44 to 47
Quoted 8 lines

board/keymile/km83xx/km83xx.c static int board_init_i2c_busses (void) · line 138

Quoted 6 lines
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +6 -0
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 48 to 51
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 52 to 55
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, //Words 56 to 59
+  0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01  //Words 60 to 63
+};
+#endif

No C++ comments, please. Please fix globally.

fixed.

Quoted 9 lines

board/keymile/km83xx/km83xx.c phys_size_t initdram (int board_type) · line 253

Quoted 5 lines

int checkboard (void)
{

board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +2 -1
-	puts ("Board: Keymile kmeter1");
+	puts ("Board: Keymile ");
+	puts(CONFIG_KM_BOARD_NAME);

Please write:

	puts("Board: Keymile " CONFIG_KM_BOARD_NAME);

fixed.

Quoted 6 lines
Quoted 6 lines
cpu/mpc83xx/cpu.c +0 -0
@@ -305,7 +305,7 @@ int cpu_mmc_init(bd_t *bis)
 
 #ifdef CONFIG_BOOTCOUNT_LIMIT
 
Quoted 7 lines

cpu/mpc83xx/cpu.c int cpu_mmc_init(bd_t *bis) · line 309

Quoted 3 lines
cpu/mpc83xx/cpu.c +1 -1
-#if !defined(CONFIG_MPC8360)
+#if !defined(CONFIG_MPC8360) && !defined(CONFIG_MPC832x)
 #error "CONFIG_BOOTCOUNT_LIMIT only for MPC8360 implemented"

Code and comments don't agree.

And please keep list sorted (832x < 8360). Please fix globally.

fixed.

Quoted 10 lines

...

cpu/mpc83xx/cpu.c

Quoted 7 lines
cpu/mpc83xx/cpu.c +7 -0
+#undef CONFIG_DDR_ECC
+
+/*
+ * DDRCDR - DDR Control Driver Register
+ */
+
+#undef CONFIG_SPD_EEPROM	/* Do not use SPD EEPROM for DDR setup */

No need to undefine what is not defined anyway.

Yep.

Quoted 7 lines

cpu/mpc83xx/cpu.c

Quoted 5 lines
cpu/mpc83xx/cpu.c +5 -0
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE		2048 /* MB */

Do you use get_ram_size() for auto-sizing?

Yes, this is the maximum size ...

Quoted 7 lines

cpu/mpc83xx/cpu.c

Quoted 5 lines
cpu/mpc83xx/cpu.c +5 -0
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#else
+#undef	CONFIG_SYS_RAMBOOT
+#endif

Please do not #undef what is not defined - please fix globally.

OK, fixed.

Quoted 10 lines

cpu/mpc83xx/cpu.c

Quoted 8 lines
cpu/mpc83xx/cpu.c +8 -0
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK	1
+#define CONFIG_SYS_INIT_RAM_ADDR	0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_END	0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_SIZE	0x100 /* num bytes initial data */
+#define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)

Line too long. please fix globally.

Ok.

Quoted 8 lines

...

Quoted 1 line

+#ifndef CONFIG_SYS_RAMBOOT

...

Quoted 1 line

+#else /* CFG_RAMBOOT */

...

Quoted 1 line

+#endif /* CFG_RAMBOOT */

CFG_RAMBOOT ??? Seems this needs cleanup.

Yep.

Quoted 5 lines

cpu/mpc83xx/cpu.c

Quoted 3 lines
cpu/mpc83xx/cpu.c +3 -0
+#if defined(CFG_RAMBOOT)
+#undef CONFIG_CMD_SAVEENV
+#undef CONFIG_CMD_LOADS

Why?

Good question ... I delete this.

Quoted 4 lines
Quoted 4 lines
cpu/mpc83xx/cpu.c +4 -0
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       CONFIG_KM_DEF_ENV						\
+       CONFIG_KM_DEF_ROOTPATH						\
+	"dtt_bus=pca9547:70:a\0"					\
Quoted 8 lines

cpu/mpc83xx/cpu.c

Quoted 6 lines
cpu/mpc83xx/cpu.c +6 -0
+	"EEprom_ivm=pca9547:70:9\0"					\
+	"newenv="							\
+		"prot off 0xF00C0000 +0x40000 && "			\
+		"era 0xF00C0000 +0x40000\0" 				\
+	"unlock=yes\0"							\
+	""

Indentation by TAB only. Please fix globally.

fixed.

Thanks for the review.

bye
Heiko

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