Skip to contentSkip to conversation

Keymile boards mainlining, part 2 (resend)

PATCH New Valentin Longchamp 4 participants 64 messages Apr 8, 2011 – May 12, 2011

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

cover Keymile boards mainlining, part 2 (resend)

This series is the second effort of merging the Keymile boards support back into mainline.

Most of the patches are only keymile relevant and should only affect our boards.

There are also patches for the i2c deblocking support and cramfs for ARM.

The whole series is based on current denx-master with the our first patch series posted by Heiko that was reviewed previous weeks and should still be merged during the current merge window:

http://lists.denx.de/pipermail/u-boot/2011-April/089530.html

Heiko Schocher (5):
lib, vsprintf: introduce strict_strtoul
arm/km: add CRAMFS support for keymile boards
cramfs: make cramfs usable without a NOR flash
i2c, soft_i2c: deblock bus if switching to another i2c bus arm, powerpc, keymile boards: move keymile specific header in subdir

Holger Brunck (18):
km/common: remove hdlc_enet implementation powerpc/km82xx: cleanup coding style for mgcoge.c powerpc/km82xx: rename mgcoge files to km82xx powerpc/km82xx: move SDRAM config to board config powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support poweprc/km82xx: add board specific environment variable arm/km: add addbootcount environment variable arm/km: remove last_stage_init and unneeded printouts arm/km: add second serial interface for kirkwood common/hush: make get_local_var visible for other users km/common: implement setboardid as a command km/common: add pnvramsize to default environment km/common: fix coding style issues in generic header km/common: simplify default environment
arm/km: rename mgcoge2un to mgcoge3un
arm/km: change default settings for egiga on mgcoge3un arm/km: update mgcoge3un board support

Huber, Andreas (1):
powerpc/km82xx: add DIP switch detection

Stefan Bigler (1):
i2c: add i2c deblock sequence before and after every mux config

Thomas Herzmann (2):
km/common: fix initial_boot_bank for bootpackages km/common: replace env var checkboardidlist by function

Valentin Longchamp (3):
arm/km: add mkimage config file for uart download arm/km: add BootROM config files for memphis SDRAM arm/km: disable ls (through jffs2 support)

 MAINTAINERS                                    |    4 +-
 board/keymile/common/common.c                  |  156 ++++++-
 board/keymile/common/common.h                  |   84 +++-
 board/keymile/common/keymile_hdlc_enet.c       |  620 ------------------------
 board/keymile/{mgcoge => km82xx}/Makefile      |    3 +-
 board/keymile/km82xx/km82xx.c                  |  373 ++++++++++++++
 board/keymile/km_arm/km_arm.c                  |   93 +++-
 board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 ++++++++
 board/keymile/km_arm/kwbimage-memphis.cfg      |  197 ++++++++
 board/keymile/km_arm/kwbimage-uart.cfg         |  179 +++++++
 board/keymile/mgcoge/mgcoge.c                  |  333 -------------
 board/keymile/mgcoge/mgcoge_hdlc_enet.c        |  276 -----------
 board/keymile/scripts/README                   |   25 +
 board/keymile/scripts/debug-arm-env.txt        |    2 +
 board/keymile/scripts/debug-common-env.txt     |    9 +
 board/keymile/scripts/debug-ppc-env.txt        |    2 +
 boards.cfg                                     |    6 +-
 common/cmd_cramfs.c                            |   12 +-
 common/cmd_i2c.c                               |   12 +
 common/hush.c                                  |    3 +-
 drivers/i2c/soft_i2c.c                         |    1 +
 drivers/net/mvgbe.h                            |    2 +
 fs/cramfs/cramfs.c                             |    4 +
 include/_exports.h                             |    1 +
 include/common.h                               |    1 +
 include/configs/{ => km}/keymile-common.h      |  175 +------
 include/configs/{ => km}/km-powerpc.h          |   12 +-
 include/configs/{ => km}/km82xx-common.h       |   29 +-
 include/configs/{ => km}/km8321-common.h       |    0
 include/configs/{ => km}/km83xx-common.h       |    0
 include/configs/{ => km}/km_arm.h              |   25 +-
 include/configs/kmeter1.h                      |    2 +-
 include/configs/kmsupx5.h                      |    2 +-
 include/configs/mgcoge.h                       |   35 ++-
 include/configs/{mgcoge2ne.h => mgcoge3ne.h}   |   57 ++-
 include/configs/{mgcoge2un.h => mgcoge3un.h}   |   37 ++-
 include/configs/suen3.h                        |    2 +-
 include/configs/suen8.h                        |    2 +-
 include/configs/suvd3.h                        |    2 +-
 include/configs/tuda1.h                        |    2 +-
 include/configs/tuxa1.h                        |    2 +-
 include/exports.h                              |    1 +
 include/hush.h                                 |    1 +
 include/i2c.h                                  |    2 -
 lib/vsprintf.c                                 |   47 ++
 45 files changed, 1531 insertions(+), 1499 deletions(-)
 delete mode 100644 board/keymile/common/keymile_hdlc_enet.c
 rename board/keymile/{mgcoge => km82xx}/Makefile (94%)
 create mode 100644 board/keymile/km82xx/km82xx.c
 create mode 100644 board/keymile/km_arm/kwbimage-memphis-uart.cfg
 create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg
 create mode 100644 board/keymile/km_arm/kwbimage-uart.cfg
 delete mode 100644 board/keymile/mgcoge/mgcoge.c
 delete mode 100644 board/keymile/mgcoge/mgcoge_hdlc_enet.c
 create mode 100644 board/keymile/scripts/README
 create mode 100644 board/keymile/scripts/debug-arm-env.txt
 create mode 100644 board/keymile/scripts/debug-common-env.txt
 create mode 100644 board/keymile/scripts/debug-ppc-env.txt
 rename include/configs/{ => km}/keymile-common.h (63%)
 rename include/configs/{ => km}/km-powerpc.h (91%)
 rename include/configs/{ => km}/km82xx-common.h (93%)
 rename include/configs/{ => km}/km8321-common.h (100%)
 rename include/configs/{ => km}/km83xx-common.h (100%)
 rename include/configs/{ => km}/km_arm.h (93%)
 rename include/configs/{mgcoge2ne.h => mgcoge3ne.h} (57%)
 rename include/configs/{mgcoge2un.h => mgcoge3un.h} (65%)
#1 lore raw

PATCH 1/30 lib, vsprintf: introduce strict_strtoul

From: Heiko Schocher <[email protected]>

as checkpatch proposes to use strict_strtoul instead of simple_strtoul, introduce it.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 include/_exports.h |    1 +
 include/common.h   |    1 +
 include/exports.h  |    1 +
 lib/vsprintf.c     |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+), 0 deletions(-)
include/_exports.h +1 -0
index d89b65b..349a3c5 100644
@@ -19,6 +19,7 @@ EXPORT_FUNC(do_reset)
 EXPORT_FUNC(getenv)
 EXPORT_FUNC(setenv)
 EXPORT_FUNC(simple_strtoul)
+EXPORT_FUNC(strict_strtoul)
 EXPORT_FUNC(simple_strtol)
 EXPORT_FUNC(strcmp)
 EXPORT_FUNC(i2c_write)
include/common.h +1 -0
index 49c884c..d180da2 100644
@@ -648,6 +648,7 @@ void	udelay        (unsigned long);
 
 /* lib/vsprintf.c */
 ulong	simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 unsigned long long	simple_strtoull(const char *cp,char **endp,unsigned int base);
 long	simple_strtol(const char *cp,char **endp,unsigned int base);
 void	panic(const char *fmt, ...)
include/exports.h +1 -0
index 6382311..2f49cea 100644
@@ -20,6 +20,7 @@ void __udelay(unsigned long);
 unsigned long get_timer(unsigned long);
 int vprintf(const char *, va_list);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 char *getenv (char *name);
 int setenv (char *varname, char *varvalue);
 long simple_strtol(const char *cp,char **endp,unsigned int base);
lib/vsprintf.c +47 -0

59 lines not on this page · raw message

Signature · 1 line
1.7.0.5
#2 lore raw

PATCH 1/30 lib, vsprintf: introduce strict_strtoul

Dear Valentin Longchamp,

Quoted 4 lines · In message <e0c1c0de6c89e3723ac3d1874ce4819a4a47c8f2.1302272395.git.valentin.lo…

From: Heiko Schocher <[email protected]>

as checkpatch proposes to use strict_strtoul instead of simple_strtoul, introduce it.

Same comment as prvious version: please provide full reference / attribution.

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
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.                                          -- Tallulah Bankhead
#3 lore raw

PATCH v2 1/1 lib, vsprintf: introduce strict_strtoul

In reply to Valentin Longchamp

as checkpatch proposes to use strict_strtoul instead of simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>

---
changes for v2:
- added origin source for this new function, as Wolfgang Denk suggested.
- Patch no longer in the patchserie, as it is an independent change.

 include/_exports.h |    1 +
 include/common.h   |    1 +
 include/exports.h  |    1 +
 lib/vsprintf.c     |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 0 deletions(-)
include/_exports.h +1 -0
index d89b65b..349a3c5 100644
@@ -19,6 +19,7 @@ EXPORT_FUNC(do_reset)
 EXPORT_FUNC(getenv)
 EXPORT_FUNC(setenv)
 EXPORT_FUNC(simple_strtoul)
+EXPORT_FUNC(strict_strtoul)
 EXPORT_FUNC(simple_strtol)
 EXPORT_FUNC(strcmp)
 EXPORT_FUNC(i2c_write)
include/common.h +1 -0
index 00e266e..1e4a6a5 100644
@@ -650,6 +650,7 @@ void	udelay        (unsigned long);
 
 /* lib/vsprintf.c */
 ulong	simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 unsigned long long	simple_strtoull(const char *cp,char **endp,unsigned int base);
 long	simple_strtol(const char *cp,char **endp,unsigned int base);
 void	panic(const char *fmt, ...)
include/exports.h +1 -0
index ddd1bf4..e14d727 100644
@@ -20,6 +20,7 @@ void __udelay(unsigned long);
 unsigned long get_timer(unsigned long);
 int vprintf(const char *, va_list);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 char *getenv (char *name);
 int setenv (char *varname, char *varvalue);
 long simple_strtol(const char *cp,char **endp,unsigned int base);
lib/vsprintf.c +51 -0

63 lines not on this page · raw message

Signature · 1 line
1.7.4.4
#4 lore raw

PATCH v2 1/1 lib, vsprintf: introduce strict_strtoul

Dear Heiko Schocher,

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

as checkpatch proposes to use strict_strtoul instead of simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>

---
changes for v2:
- added origin source for this new function, as Wolfgang Denk suggested.
- Patch no longer in the patchserie, as it is an independent change.

Quoted 5 lines
 include/_exports.h |    1 +
 include/common.h   |    1 +
 include/exports.h  |    1 +
 lib/vsprintf.c     |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 0 deletions(-)

Appplied, thanks.

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
So we follow our wandering paths, and the very darkness acts  as  our
guide and our doubts serve to reassure us. - Jean-Pierre de Caussade,
eighteenth-century Jesuit priest
#5 lore raw

PATCH 2/30 powerpc/km82xx: add DIP switch detection

In reply to Valentin Longchamp

From: Huber, Andreas <[email protected]>

This reads the DIP switch register in the BFTICU (0x40000089). If 'Full reset' or 'DB erase' is selected, 'actual_bank' is set to 0. This loads the Bootloader application who does the erase stuff. To access the register a struct for the bfticu I/O map was added to common.h.

---
 board/keymile/common/common.h |   79 +++++++++++++++++++++++++++++++++++++++++
 board/keymile/mgcoge/mgcoge.c |   12 ++++++
 2 files changed, 91 insertions(+), 0 deletions(-)
board/keymile/common/common.h +79 -0
index 099de98..cdc35b6 100644
@@ -39,6 +39,85 @@ struct km_bec_fpga {
 	unsigned char	pgy_eth;
 };
 
+#define BFTICU_DIPSWITCH_MASK   0x0f
+
+/*
+ * BFTICU FPGA iomap
+ * BFTICU is used on mgcoge and mgocge3ne
+ */
+struct bfticu_iomap {
+	u8	xi_ena;		/* General defect enable */
+	u8	pack1[3];
+	u8	en_csn;
+	u8	pack2;
+	u8	safe_mem;
+	u8	pack3;
+	u8	id;
+	u8	pack4;
+	u8	rev;
+	u8	build;
+	u8	p_frc;
+	u8	p_msk;
+	u8	pack5[2];
+	u8	xg_int;
+	u8	pack6[15];
+	u8	s_conf;
+	u8	pack7;
+	u8	dmx_conf12;
+	u8	pack8;
+	u8	s_clkslv;
+	u8	pack9[11];
+	u8	d_conf;
+	u8	d_mask_ca;
+	u8	d_pll_del;
+	u8	pack10[16];
+	u8	t_conf_ca;
+	u8	t_mask_ca;
+	u8	pack11[13];
+	u8	m_def0;
+	u8	m_def1;
+	u8	m_def2;
+	u8	m_def3;
+	u8	m_def4;
+	u8	m_def5;
+	u8	m_def_trap0;
+	u8	m_def_trap1;
+	u8	m_def_trap2;
+	u8	m_def_trap3;
+	u8	m_def_trap4;
+	u8	m_def_trap5;
+	u8	m_mask_def0;
+	u8	m_mask_def1;
+	u8	m_mask_def2;
+	u8	m_mask_def3;
+	u8	m_mask_def4;
+	u8	m_mask_def5;
+	u8	m_def_mask0;
+	u8	m_def_mask1;
+	u8	m_def_mask2;
+	u8	m_def_mask3;
+	u8	m_def_mask4;
+	u8	m_def_mask5;
+	u8	m_def_pri;
+	u8	pack12[11];
+	u8	hw_status;
+	u8	pack13;
+	u8	hw_control1;
+	u8	hw_control2;
+	u8	hw_control3;
+	u8	pack14[7];
+	u8	led_on;		/* Leds */
+	u8	pack15;
+	u8	sfp_control;	/* SFP modules */
+	u8	pack16;
+	u8	alarm_control;	/* Alarm output */
+	u8	pack17;
+	u8	icps;		/* ICN clock pulse shaping */
+	u8	mswitch;	/* Read mode switch */
+	u8	pack18[6];
+	u8	pb_dbug;
+};
+
 #if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
 #define CONFIG_PIGGY_MAC_ADRESS_OFFSET	0
 #endif
board/keymile/mgcoge/mgcoge.c +12 -0
index 340016b..11a0f79 100644
@@ -315,6 +315,18 @@ int board_early_init_r(void)
 
 int last_stage_init(void)
 {
+	struct bfticu_iomap *base =
+		(struct bfticu_iomap *)CONFIG_SYS_FPGA_BASE;
+	u8 dip_switch;
+
+	dip_switch = in_8(&base->mswitch);
+	dip_switch &= BFTICU_DIPSWITCH_MASK;
+	/* dip switch 'full reset' or 'db erase' */
+	if (dip_switch & 0x1 || dip_switch & 0x2) {
+		/* start bootloader */
+		puts("DIP:   Enabled\n");
+		setenv("actual_bank", "0");
+	}
 	set_km_env();
 	return 0;
 }
Signature · 1 line
1.7.0.5
#6 lore raw

PATCH 3/30 km/common: remove hdlc_enet implementation

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

The hdlc implementation for mgcoge was initially developed, but later on not used. Remove the C files, the references in mgcoge.c and the Makefile to decrease maintenance effort.

---
 board/keymile/common/common.c            |    3 -
 board/keymile/common/common.h            |    4 -
 board/keymile/common/keymile_hdlc_enet.c |  620 ------------------------------
 board/keymile/mgcoge/Makefile            |    3 +-
 board/keymile/mgcoge/mgcoge_hdlc_enet.c  |  276 -------------
 5 files changed, 1 insertions(+), 905 deletions(-)
 delete mode 100644 board/keymile/common/keymile_hdlc_enet.c
 delete mode 100644 board/keymile/mgcoge/mgcoge_hdlc_enet.c
board/keymile/common/common.c +0 -3
index 3908e63..b113c0a 100644
@@ -677,9 +677,6 @@ int ethernet_present(void)
 
 int board_eth_init(bd_t *bis)
 {
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-	(void)keymile_hdlc_enet_initialize(bis);
-#endif
 	if (ethernet_present())
 		return cpu_eth_init(bis);
 
board/keymile/common/common.h +0 -4
index cdc35b6..6ce992a 100644
@@ -125,10 +125,6 @@ struct bfticu_iomap {
 int ethernet_present(void);
 int ivm_read_eeprom(void);
 
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-int keymile_hdlc_enet_initialize(bd_t *bis);
-#endif
-
 int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
 			char *nodename,
board/keymile/common/keymile_hdlc_enet.c deleted +0 -620

620 lines not on this page · raw message

board/keymile/mgcoge/Makefile +1 -2
index 3308621..a2b9da4 100644
@@ -28,8 +28,7 @@ endif
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= $(BOARD).o ../common/common.o ../common/keymile_hdlc_enet.o \
-		mgcoge_hdlc_enet.o
+COBJS	:= $(BOARD).o ../common/common.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/keymile/mgcoge/mgcoge_hdlc_enet.c deleted +0 -276

276 lines not on this page · raw message

Signature · 1 line
1.7.0.5
#7 lore raw

PATCH 4/30 powerpc/km82xx: cleanup coding style for mgcoge.c

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

---
 board/keymile/mgcoge/mgcoge.c |  291 +++++++++++++++++++++--------------------
 1 files changed, 146 insertions(+), 145 deletions(-)
board/keymile/mgcoge/mgcoge.c +149 -148
index 11a0f79..3db3c7b 100644
@@ -45,154 +45,154 @@
  */
 const iop_conf_t iop_conf_tab[4][32] = {
 
-    /* Port A */
-    {	/*	      conf	ppar psor pdir podr pdat */
-	/* PA31 */ { 0,		 0,   0,   0,	0,   0 }, /* PA31	     */
-	/* PA30 */ { 0,		 0,   0,   0,	0,   0 }, /* PA30	     */
-	/* PA29 */ { 0,		 0,   0,   0,	0,   0 }, /* PA29	     */
-	/* PA28 */ { 0,		 0,   0,   0,	0,   0 }, /* PA28	     */
-	/* PA27 */ { 0,		 0,   0,   0,	0,   0 }, /* PA27	     */
-	/* PA26 */ { 0,		 0,   0,   0,	0,   0 }, /* PA26	     */
-	/* PA25 */ { 0,		 0,   0,   0,	0,   0 }, /* PA25	     */
-	/* PA24 */ { 0,		 0,   0,   0,	0,   0 }, /* PA24	     */
-	/* PA23 */ { 0,		 0,   0,   0,	0,   0 }, /* PA23	     */
-	/* PA22 */ { 0,		 0,   0,   0,	0,   0 }, /* PA22	     */
-	/* PA21 */ { 0,		 0,   0,   0,	0,   0 }, /* PA21	     */
-	/* PA20 */ { 0,		 0,   0,   0,	0,   0 }, /* PA20	     */
-	/* PA19 */ { 0,		 0,   0,   0,	0,   0 }, /* PA19	     */
-	/* PA18 */ { 0,		 0,   0,   0,	0,   0 }, /* PA18	     */
-	/* PA17 */ { 0,		 0,   0,   0,	0,   0 }, /* PA17	     */
-	/* PA16 */ { 0,		 0,   0,   0,	0,   0 }, /* PA16	     */
-	/* PA15 */ { 0,		 0,   0,   0,	0,   0 }, /* PA15	     */
-	/* PA14 */ { 0,		 0,   0,   0,	0,   0 }, /* PA14	     */
-	/* PA13 */ { 0,		 0,   0,   0,	0,   0 }, /* PA13	     */
-	/* PA12 */ { 0,		 0,   0,   0,	0,   0 }, /* PA12	     */
-	/* PA11 */ { 0,		 0,   0,   0,	0,   0 }, /* PA11	     */
-	/* PA10 */ { 0,		 0,   0,   0,	0,   0 }, /* PA10	     */
-	/* PA9	*/ { 1,		 1,   0,   1,	0,   0 }, /* SMC2 TxD	     */
-	/* PA8	*/ { 1,		 1,   0,   0,	0,   0 }, /* SMC2 RxD	     */
-	/* PA7	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA7	     */
-	/* PA6	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA6	     */
-	/* PA5	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA5	     */
-	/* PA4	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA4	     */
-	/* PA3	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA3	     */
-	/* PA2	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA2	     */
-	/* PA1	*/ { 0,		 0,   0,   0,	0,   0 }, /* PA1	     */
-	/* PA0	*/ { 0,		 0,   0,   0,	0,   0 }  /* PA0	     */
-    },
-
-    /* Port B */
-    {	/*	      conf	ppar psor pdir podr pdat */
-	/* PB31 */ { 0,		 0,   0,   0,	0,   0 }, /* PB31	     */
-	/* PB30 */ { 0,		 0,   0,   0,	0,   0 }, /* PB30	     */
-	/* PB29 */ { 0,		 0,   0,   0,	0,   0 }, /* PB29	     */
-	/* PB28 */ { 0,		 0,   0,   0,	0,   0 }, /* PB28	     */
-	/* PB27 */ { 0,		 0,   0,   0,	0,   0 }, /* PB27	     */
-	/* PB26 */ { 0,		 0,   0,   0,	0,   0 }, /* PB26	     */
-	/* PB25 */ { 0,		 0,   0,   0,	0,   0 }, /* PB25	     */
-	/* PB24 */ { 0,		 0,   0,   0,	0,   0 }, /* PB24	     */
-	/* PB23 */ { 0,		 0,   0,   0,	0,   0 }, /* PB23	     */
-	/* PB22 */ { 0,		 0,   0,   0,	0,   0 }, /* PB22	     */
-	/* PB21 */ { 0,		 0,   0,   0,	0,   0 }, /* PB21	     */
-	/* PB20 */ { 0,		 0,   0,   0,	0,   0 }, /* PB20	     */
-	/* PB19 */ { 0,		 0,   0,   0,	0,   0 }, /* PB19	     */
-	/* PB18 */ { 0,		 0,   0,   0,	0,   0 }, /* PB18	     */
-	/* PB17 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB16 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB15 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB14 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB13 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB12 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB11 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB10 */ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB9	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB8	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB7	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB6	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB5	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB4	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB3	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB2	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB1	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PB0	*/ { 0,		 0,   0,   0,	0,   0 }  /* non-existent    */
-    },
-
-    /* Port C */
-    {	/*	      conf	ppar psor pdir podr pdat */
-	/* PC31 */ { 0,		 0,   0,   0,	0,   0 }, /* PC31	     */
-	/* PC30 */ { 0,		 0,   0,   0,	0,   0 }, /* PC30	     */
-	/* PC29 */ { 0,		 0,   0,   0,	0,   0 }, /* PC29	     */
-	/* PC28 */ { 0,		 0,   0,   0,	0,   0 }, /* PC28	     */
-	/* PC27 */ { 0,		 0,   0,   0,	0,   0 }, /* PC27	     */
-	/* PC26 */ { 0,		 0,   0,   0,	0,   0 }, /* PC26	     */
-	/* PC25 */ { 1,		 1,   0,   0,	0,   0 }, /* SCC4 RxClk      */
-	/* PC24 */ { 1,		 1,   0,   0,	0,   0 }, /* SCC4 TxClk      */
-	/* PC23 */ { 0,		 0,   0,   0,	0,   0 }, /* PC23	     */
-	/* PC22 */ { 0,		 0,   0,   0,	0,   0 }, /* PC22	     */
-	/* PC21 */ { 0,		 0,   0,   0,	0,   0 }, /* PC21	     */
-	/* PC20 */ { 0,		 0,   0,   0,	0,   0 }, /* PC20	     */
-	/* PC19 */ { 0,		 0,   0,   0,	0,   0 }, /* PC19	     */
-	/* PC18 */ { 0,		 0,   0,   0,	0,   0 }, /* PC18	     */
-	/* PC17 */ { 0,		 0,   0,   0,	0,   0 }, /* PC17	     */
-	/* PC16 */ { 0,		 0,   0,   0,	0,   0 }, /* PC16	     */
-	/* PC15 */ { 0,		 0,   0,   0,	0,   0 }, /* PC15	     */
-	/* PC14 */ { 0,		 0,   0,   0,	0,   0 }, /* PC14	     */
-	/* PC13 */ { 0,		 0,   0,   0,	0,   0 }, /* PC13	     */
-	/* PC12 */ { 0,		 0,   0,   0,	0,   0 }, /* PC12	     */
-	/* PC11 */ { 0,		 0,   0,   0,	0,   0 }, /* PC11	     */
-	/* PC10 */ { 0,		 0,   0,   0,	0,   0 }, /* PC10	     */
-	/* PC9	*/ { 1,		 1,   0,   0,	0,   0 }, /* SCC4: CTS	     */
-	/* PC8	*/ { 1,		 1,   0,   0,	0,   0 }, /* SCC4: CD	     */
-	/* PC7	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC7	     */
-	/* PC6	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC6	     */
-	/* PC5	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC5	     */
-	/* PC4	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC4	     */
-	/* PC3	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC3	     */
-	/* PC2	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC2	     */
-	/* PC1	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC1	     */
-	/* PC0	*/ { 0,		 0,   0,   0,	0,   0 }, /* PC0	     */
-    },
-
-    /* Port D */
-    {	/*	      conf	ppar psor pdir podr pdat */
-	/* PD31 */ { 0,		 0,   0,   0,	0,   0 }, /* PD31	     */
-	/* PD30 */ { 0,		 0,   0,   0,	0,   0 }, /* PD30	     */
-	/* PD29 */ { 0,		 0,   0,   0,	0,   0 }, /* PD29	     */
-	/* PD28 */ { 0,		 0,   0,   0,	0,   0 }, /* PD28	     */
-	/* PD27 */ { 0,		 0,   0,   0,	0,   0 }, /* PD27	     */
-	/* PD26 */ { 0,		 0,   0,   0,	0,   0 }, /* PD26	     */
-	/* PD25 */ { 0,		 0,   0,   0,	0,   0 }, /* PD25	     */
-	/* PD24 */ { 0,		 0,   0,   0,	0,   0 }, /* PD24	     */
-	/* PD23 */ { 0,		 0,   0,   0,	0,   0 }, /* PD23	     */
-	/* PD22 */ { 1,		 1,   0,   0,	0,   0 }, /* SCC4: RXD	     */
-	/* PD21 */ { 1,		 1,   0,   1,	0,   0 }, /* SCC4: TXD	     */
-	/* PD20 */ { 1,		 1,   0,   1,	0,   0 }, /* SCC4: RTS	     */
-	/* PD19 */ { 0,		 0,   0,   0,	0,   0 }, /* PD19	     */
-	/* PD18 */ { 0,		 0,   0,   0,	0,   0 }, /* PD18	     */
-	/* PD17 */ { 0,		 0,   0,   0,	0,   0 }, /* PD17	     */
-	/* PD16 */ { 0,		 0,   0,   0,	0,   0 }, /* PD16	     */
+	/* Port A */
+	{	/*	      conf	ppar psor pdir podr pdat */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA31	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA30	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA29	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA28	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA27	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA26	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA25	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA24	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA23	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA22	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA21	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA20	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA19	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA18	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA17	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA16	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA15	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA14	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA13	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA12	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA11	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA10	     */
+		{ 1,		 1,   0,   1,	0,   0 }, /* PA9 SMC2 TxD    */
+		{ 1,		 1,   0,   0,	0,   0 }, /* PA8 SMC2 RxD    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA7	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA6	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA5	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA4	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA3	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA2	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PA1	     */
+		{ 0,		 0,   0,   0,	0,   0 }  /* PA0	     */
+	},
+
+	/* Port B */
+	{	/*	      conf	ppar psor pdir podr pdat */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB31	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB30	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB29	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB28	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB27	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB26	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB25	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB24	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB23	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB22	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB21	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB20	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB19	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PB18	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }  /* non-existent    */
+	},
+
+	/* Port C */
+	{	/*	      conf	ppar psor pdir podr pdat */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC31	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC30	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC29	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC28	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC27	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC26	     */
+		{ 1,		 1,   0,   0,	0,   0 }, /* PC25 RxClk      */
+		{ 1,		 1,   0,   0,	0,   0 }, /* PC24 TxClk      */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC23	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC22	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC21	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC20	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC19	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC18	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC17	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC16	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC15	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC14	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC13	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC12	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC11	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC10	     */
+		{ 1,		 1,   0,   0,	0,   0 }, /* PC9  SCC4: CTS  */
+		{ 1,		 1,   0,   0,	0,   0 }, /* PC8  SCC4: CD   */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC7	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC6	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC5	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC4	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC3	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC2	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC1	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PC0	     */
+	},
+
+	/* Port D */
+	{	/*	      conf	ppar psor pdir podr pdat */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD31	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD30	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD29	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD28	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD27	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD26	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD25	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD24	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD23	     */
+		{ 1,		 1,   0,   0,	0,   0 }, /* PD22 SCC4: RXD  */
+		{ 1,		 1,   0,   1,	0,   0 }, /* PD21 SCC4: TXD  */
+		{ 1,		 1,   0,   1,	0,   0 }, /* PD20 SCC4: RTS  */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD19	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD18	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD17	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD16	     */
 #if defined(CONFIG_HARD_I2C)
-	/* PD15 */ { 1,		 1,   1,   0,	1,   0 }, /* I2C SDA	     */
-	/* PD14 */ { 1,		 1,   1,   0,	1,   0 }, /* I2C SCL	     */
+		{ 1,		 1,   1,   0,	1,   0 }, /* PD15 I2C SDA    */
+		{ 1,		 1,   1,   0,	1,   0 }, /* PD14 I2C SCL    */
 #else
-	/* PD15 */ { 1,		 0,   0,   0,	1,   1 }, /* PD15	     */
-	/* PD14 */ { 1,		 0,   0,   1,	1,   1 }, /* PD14	     */
+		{ 1,		 0,   0,   0,	1,   1 }, /* PD15	     */
+		{ 1,		 0,   0,   1,	1,   1 }, /* PD14	     */
 #endif
-	/* PD13 */ { 0,		 0,   0,   0,	0,   0 }, /* PD13	     */
-	/* PD12 */ { 0,		 0,   0,   0,	0,   0 }, /* PD12	     */
-	/* PD11 */ { 0,		 0,   0,   0,	0,   0 }, /* PD11	     */
-	/* PD10 */ { 0,		 0,   0,   0,	0,   0 }, /* PD10	     */
-	/* PD9	*/ { 0,		 0,   0,   0,	0,   0 }, /* PD9	     */
-	/* PD8	*/ { 0,		 0,   0,   0,	0,   0 }, /* PD8	     */
-	/* PD7	*/ { 0,		 0,   0,   0,	0,   0 }, /* PD7	     */
-	/* PD6	*/ { 0,		 0,   0,   0,	0,   0 }, /* PD6	     */
-	/* PD5	*/ { 0,		 0,   0,   0,	0,   0 }, /* PD5	     */
-	/* PD4	*/ { 0,		 0,   0,   0,	0,   0 }, /* PD4	     */
-	/* PD3	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PD2	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PD1	*/ { 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
-	/* PD0	*/ { 0,		 0,   0,   0,	0,   0 }  /* non-existent    */
-    }
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD13	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD12	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD11	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD10	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD9	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD8	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD7	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD6	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD5	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* PD4	     */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }, /* non-existent    */
+		{ 0,		 0,   0,   0,	0,   0 }  /* non-existent    */
+	}
 };
 
 /*
@@ -237,7 +237,8 @@ static long int try_init(memctl8260_t *memctl, ulong sdmr,
 	 *  accessing the SDRAM with a single-byte transaction."
 	 *
 	 * The appropriate BRx/ORx registers have already been set when we
-	 * get here. The SDRAM can be accessed at the address CONFIG_SYS_SDRAM_BASE.
+	 * get here. The SDRAM can be accessed at the address
+	 * CONFIG_SYS_SDRAM_BASE.
 	 */
 
 	out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_PREA);
@@ -257,7 +258,7 @@ static long int try_init(memctl8260_t *memctl, ulong sdmr,
 	size = get_ram_size((long *)base, maxsize);
 	out_be32(&memctl->memc_or1, orx | ~(size - 1));
 
-	return (size);
+	return size;
 }
 
 phys_size_t initdram(int board_type)
@@ -279,7 +280,7 @@ phys_size_t initdram(int board_type)
 
 	icache_enable();
 
-	return (psize);
+	return psize;
 }
 
 int checkboard(void)
Signature · 1 line
1.7.0.5
#8 lore raw

PATCH 5/30 powerpc/km82xx: rename mgcoge files to km82xx

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

The directory and file mgcoge was renamed to km82xx. Because other keymile 82xx will follow and will use the same platform code.

---
 board/keymile/{mgcoge => km82xx}/Makefile          |    0
 board/keymile/{mgcoge/mgcoge.c => km82xx/km82xx.c} |    0
 boards.cfg                                         |    4 ++--
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename board/keymile/{mgcoge => km82xx}/Makefile (100%)
 rename board/keymile/{mgcoge/mgcoge.c => km82xx/km82xx.c} (100%)
board/keymile/km82xx/Makefile renamed from board/keymile/mgcoge/Makefile +0 -0
similarity index 100%
rename from board/keymile/mgcoge/Makefile
rename to board/keymile/km82xx/Makefile
board/keymile/km82xx/km82xx.c renamed from board/keymile/mgcoge/mgcoge.c +0 -0
similarity index 100%
rename from board/keymile/mgcoge/mgcoge.c
rename to board/keymile/km82xx/km82xx.c
boards.cfg +2 -2
index 79266c9..4c52770 100644
@@ -422,8 +422,8 @@ PQ2FADS-ZU_66MHz             powerpc     mpc8260     mpc8260ads          freesca
 PQ2FADS-ZU_66MHz_lowboot     powerpc     mpc8260     mpc8260ads          freescale      -           MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,8260_CLKIN=66000000,SYS_TEXT_BASE=0xFF800000
 PQ2FADS-ZU_lowboot           powerpc     mpc8260     mpc8260ads          freescale      -           MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF800000
 VoVPN-GW_66MHz               powerpc     mpc8260     vovpn-gw            funkwerk       -           VoVPN-GW:CLKIN_66MHz
-mgcoge                       powerpc     mpc8260     -                   keymile
-mgcoge2ne                    powerpc     mpc8260     mgcoge              keymile
+mgcoge                       powerpc     mpc8260     km82xx              keymile
+mgcoge2ne                    powerpc     mpc8260     km82xx              keymile
 SCM                          powerpc     mpc8260     -                   siemens
 TQM8255_AA                   powerpc     mpc8260     tqm8260             tqc            -           TQM8260:MPC8255,300MHz
 TQM8260_AA                   powerpc     mpc8260     tqm8260             tqc            -           TQM8260:MPC8260,200MHz
Signature · 1 line
1.7.0.5
#9 lore raw

PATCH 6/30 powerpc/km82xx: move SDRAM config to board config

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

To be prepared for mgcoge3ne which has a different SDRAM on board. The config was moved from generic code to board specific header.

---
 include/configs/km82xx-common.h |   26 --------------------------
 include/configs/mgcoge.h        |   26 ++++++++++++++++++++++++++
 include/configs/mgcoge2ne.h     |   23 +++++++++++++++++++++++
 3 files changed, 49 insertions(+), 26 deletions(-)
include/configs/km82xx-common.h +0 -26
index 345212c..da551c9 100644
@@ -243,13 +243,6 @@
 			 ORxG_SCY_5_CLK			|\
 			 ORxG_TRLX)
 
-
-/*
- * Bank 1 - 60x bus SDRAM
- */
-#define SDRAM_MAX_SIZE	0x08000000	/* max. 128 MB		*/
-#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT	(256 << 20)	/* less than 256 MB */
-
 #define CONFIG_SYS_MPTPR       0x1800
 
 /*
@@ -268,25 +261,6 @@
 #define CONFIG_SYS_OR1_PRELIM	CONFIG_SYS_OR1
 
 /*
- *  SDRAM initialization values
- */
-
-#define CONFIG_SYS_OR1 ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
-			 ORxS_BPD_8			|\
-			 ORxS_ROWST_PBI0_A7		|\
-			 ORxS_NUMR_13)
-
-#define CONFIG_SYS_PSDMR (PSDMR_SDAM_A14_IS_A5	|\
-			 PSDMR_BSMA_A14_A16	|\
-			 PSDMR_SDA10_PBI0_A9	|\
-			 PSDMR_RFRC_5_CLK	|\
-			 PSDMR_PRETOACT_2W	|\
-			 PSDMR_ACTTORW_2W	|\
-			 PSDMR_LDOTOPRE_1C	|\
-			 PSDMR_WRC_1C		|\
-			 PSDMR_CL_2)
-
-/*
  * UPIO FPGA (GPIO/PIGGY) on CS3 initialization values
  */
 #define CONFIG_SYS_KMBEC_FPGA_BASE	0x30000000
include/configs/mgcoge.h +26 -0
index 3d2ee24..aed1526 100644
@@ -58,6 +58,32 @@
 					CONFIG_SYS_FLASH_BASE_2 }
 #define MTDIDS_DEFAULT		"nor3=app"
 
+/*
+ * Bank 1 - 60x bus SDRAM
+ */
+#define SDRAM_MAX_SIZE	0x08000000			/* max. 128 MB	*/
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT	(256 << 20)	/* less than 256 MB */
+
+/* SDRAM initialization values
+*/
+
+#define CONFIG_SYS_OR1    ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & \
+			 ORxS_SDAM_MSK) |\
+			 ORxS_BPD_8                     |\
+			 ORxS_ROWST_PBI0_A7		|\
+			 ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
+			 PSDMR_BSMA_A14_A16           |\
+			 PSDMR_SDA10_PBI0_A9		|\
+			 PSDMR_RFRC_5_CLK               |\
+			 PSDMR_PRETOACT_2W              |\
+			 PSDMR_ACTTORW_2W               |\
+			 PSDMR_LDOTOPRE_1C              |\
+			 PSDMR_WRC_1C                   |\
+			 PSDMR_CL_2)
+
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
include/configs/mgcoge2ne.h +23 -0
index 287b717..2b09b42 100644
@@ -58,6 +58,29 @@
 
 #define MTDIDS_DEFAULT		"nor2=app"
 
+/*
+ * Bank 1 - 60x bus SDRAM
+ * mgcoge2ne has 128M RAM
+ */
+#define SDRAM_MAX_SIZE	0x08000000			/* max. 128 MB	*/
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT	(256 << 20)	/* less than 256 MB */
+
+#define CONFIG_SYS_OR1    ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & \
+			 ORxS_SDAM_MSK) |\
+			 ORxS_BPD_8                     |\
+			 ORxS_ROWST_PBI0_A7		|\
+			 ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
+			 PSDMR_BSMA_A14_A16           |\
+			 PSDMR_SDA10_PBI0_A9		|\
+			 PSDMR_RFRC_5_CLK               |\
+			 PSDMR_PRETOACT_2W              |\
+			 PSDMR_ACTTORW_2W               |\
+			 PSDMR_LDOTOPRE_1C              |\
+			 PSDMR_WRC_1C                   |\
+			 PSDMR_CL_2)
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
Signature · 1 line
1.7.0.5
#10 lore raw

PATCH 6/30 powerpc/km82xx: move SDRAM config to board config

Dear Valentin Longchamp,

Quoted 11 lines · In message <08249e40b548fff1e636cecf980e11adabda14ac.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

To be prepared for mgcoge3ne which has a different SDRAM on board. The config was moved from generic code to board specific header.

Quoted 5 lines
---
 include/configs/km82xx-common.h |   26 --------------------------
 include/configs/mgcoge.h        |   26 ++++++++++++++++++++++++++
 include/configs/mgcoge2ne.h     |   23 +++++++++++++++++++++++
 3 files changed, 49 insertions(+), 26 deletions(-)

If I'm understanding this right, we now duplicate the definitions into two files, because two boards happen to use the same SDRAM. Would it not make more sense to move this into a single copy of a SDRAM specific header, which then gets included by all boards that use this SDRAM type? This way we can avoid multiple copied of the same stuff (which always is a maintenance nightmare) for popular RAM types.

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
"Stupidity, like virtue, is its own reward"     - William E. Davidsen
#11 lore raw

PATCH 6/30 powerpc/km82xx: move SDRAM config to board config

Hello,

Quoted 20 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 11 lines · In message <08249e40b548fff1e636cecf980e11adabda14ac.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

To be prepared for mgcoge3ne which has a different SDRAM on board. The config was moved from generic code to board specific header.

Quoted 5 lines
---
 include/configs/km82xx-common.h |   26 --------------------------
 include/configs/mgcoge.h        |   26 ++++++++++++++++++++++++++
 include/configs/mgcoge2ne.h     |   23 +++++++++++++++++++++++
 3 files changed, 49 insertions(+), 26 deletions(-)
Quoted 2 lines

If I'm understanding this right, we now duplicate the definitions into two files, because two boards happen to use the same SDRAM. Would it

Yes.

Quoted 5 lines

not make more sense to move this into a single copy of a SDRAM specific header, which then gets included by all boards that use this SDRAM type? This way we can avoid multiple copied of the same stuff (which always is a maintenance nightmare) for popular RAM types.

Yes this sounds reasonable. But later on in the patch serie we replace the mgcoge2ne support with the support for mgcoge3ne which has a different SDRAM. And therefore this common file would become obsolete. I try to rebase these patches that the mgcoge3ne support is also part of this patch.

BTW: What would your proposal for a filename for a SDRAM specific header?

Best regards
Holger Brunck

#12 lore raw

PATCH 6/30 powerpc/km82xx: move SDRAM config to board config

Dear Holger Brunck,

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

BTW: What would your proposal for a filename for a SDRAM specific header?

Name it after the SDRAM chip type?

I think we should create a directory hierarchy for this:

	chips/sdram/
	chips/ddr/
	chips/ddr2/
	chips/ddr3/

We already have a few of such files - but this shows also how it should NOT be done (because we have here lots of duplicated files again):

	-> find * -name 'mt4*'
	board/canmb/mt48lc16m32s2-75.h
	board/esd/cpci5200/mt46v16m16-75.h
	board/esd/pf5200/mt46v16m16-75.h
	board/esd/mecp5200/mt46v16m16-75.h
	board/a4m072/mt46v32m16.h
	board/icecube/mt46v16m16-75.h
	board/icecube/mt46v32m16.h
	board/icecube/mt48lc16m16a2-75.h
	board/inka4x0/mt46v16m16-75.h
	board/inka4x0/mt46v32m16-75.h
	board/inka4x0/mt48lc16m16a2-75.h
	board/bc3450/mt48lc16m16a2-75.h
	board/pm520/mt46v16m16-75.h
	board/pm520/mt48lc16m16a2-75.h
	board/total5200/mt48lc16m16a2-75.h
	board/total5200/mt48lc32m16a2-75.h
	board/mcc200/mt48lc8m32b2-6-7.h
	board/mcc200/mt46v16m16-75.h
	board/mcc200/mt48lc16m16a2-75.h
	board/mcc200/mt48lc16m32s2-75.h
	board/munices/mt48lc16m16a2-75.h
	board/phytec/pcm030/mt46v32m16-75.h
	board/tqc/tqm5200/mt48lc16m16a2-75.h

Eventually this is the start of a bigger cleanup action then :-)

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
Due to lack of disk space, this fortune database has been discontinued.
#13 lore raw

PATCH 7/30 powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

Reserved bit was changed according to the processors manual.

---
 include/configs/km82xx-common.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/km82xx-common.h +1 -1
index da551c9..894e015 100644
@@ -182,7 +182,7 @@
 #define CONFIG_SYS_HID2		0
 
 #define CONFIG_SYS_SIUMCR		0x4020c200
-#define CONFIG_SYS_SYPCR		0xFFFFFFC3
+#define CONFIG_SYS_SYPCR		0xFFFFFF83
 #define CONFIG_SYS_BCR			0x10000000
 #define CONFIG_SYS_SCCR		(SCCR_PCI_MODE | SCCR_PCI_MODCK)
 
Signature · 1 line
1.7.0.5
#14 lore raw

PATCH 8/30 powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

This patch rename mgcoge2ne board support to mgcoge3ne. The board is similar to mgcoge. The difference is that a NUMONYX flash is used and a larger SDRAM (256MB). Also introduce CONFIG_KM_82XX to collect ppc82xx common settings.

---
 MAINTAINERS                                  |    2 +-
 board/keymile/common/common.c                |    6 +-
 board/keymile/common/common.h                |    1 +
 board/keymile/km82xx/km82xx.c                |   27 ++++++++++++
 boards.cfg                                   |    2 +-
 include/configs/mgcoge.h                     |    1 +
 include/configs/{mgcoge2ne.h => mgcoge3ne.h} |   58 +++++++++++++++-----------
 7 files changed, 67 insertions(+), 30 deletions(-)
 rename include/configs/{mgcoge2ne.h => mgcoge3ne.h} (65%)
MAINTAINERS +1 -1
index 9586bcb..37e03c9 100644
@@ -429,7 +429,7 @@ Heiko Schocher <[email protected]>
 	kmeter1		MPC8360
 	kmsupx5		MPC8321
 	mgcoge		MPC8247
-	mgcoge2ne	MPC8247
+	mgcoge3ne	MPC8247
 	mgcoge2un	ARM926EJS (Kirkwood SoC)
 	mucmc52		MPC5200
 	muas3001	MPC8270
board/keymile/common/common.c +3 -3
index b113c0a..3a7980d 100644
@@ -22,7 +22,7 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
+#if defined(CONFIG_KM82XX)
 #include <mpc8260.h>
 #endif
 #include <ioports.h>
@@ -398,10 +398,10 @@ int ivm_read_eeprom(void)
 #define DELAY_ABORT_SEQ		62  /* @200kHz 9 clocks = 44us, 62us is ok */
 #define DELAY_HALF_PERIOD	(500 / (CONFIG_SYS_I2C_SPEED / 1000))
 
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
+#if defined(CONFIG_KM_82XX)
 #define SDA_MASK	0x00010000
 #define SCL_MASK	0x00020000
-static void set_pin(int state, unsigned long mask)
+void set_pin(int state, unsigned long mask)
 {
 	ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3);
 
board/keymile/common/common.h +1 -0
index 6ce992a..cee24d4 100644
@@ -124,6 +124,7 @@ struct bfticu_iomap {
 
 int ethernet_present(void);
 int ivm_read_eeprom(void);
+void set_pin(int state, unsigned long mask);
 
 int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
board/keymile/km82xx/km82xx.c +27 -0
index 3db3c7b..5dc7ffa 100644
@@ -287,6 +287,8 @@ int checkboard(void)
 {
 #if defined(CONFIG_MGCOGE)
 	puts("Board: Keymile mgcoge");
+#elif defined(CONFIG_MGCOGE3NE)
+	puts("Board: Keymile mgcoge3ne");
 #else
 	puts("Board: Keymile mgcoge2ne");
 #endif
@@ -296,6 +298,28 @@ int checkboard(void)
 	return 0;
 }
 
+#ifdef CONFIG_MGCOGE3NE
+/*
+ * For mgcoge3ne boards, the mgcoge3un control is controlled from
+ * a GPIO line on the PPC CPU. If bobcatreset is set the line
+ * will toggle once what forces the mgocge3un part to restart
+ * immediately.
+ */
+void handle_mgcoge3un_reset(void)
+{
+	char *bobcatreset = getenv("bobcatreset");
+	if (bobcatreset) {
+		if (strcmp(bobcatreset, "true") == 0) {
+			puts("Forcing bobcat reset\n");
+			set_pin(0, 0x00000004);	/* clear PD29 to reset arm */
+			udelay(1000);
+			set_pin(1, 0x00000004);
+		} else
+			set_pin(1, 0x00000004);	/* set PD29 to not reset arm */
+	}
+}
+#endif
+
 /*
  * Early board initalization.
  */
@@ -311,6 +335,9 @@ int board_early_init_r(void)
 	out_8(&base->oprtl, (H_OPORTS_SCC4_ENA | H_OPORTS_SCC4_FD_ENA |
 		H_OPORTS_FCC1_PW_DWN));
 
+#ifdef CONFIG_MGCOGE3NE
+	handle_mgcoge3un_reset();
+#endif
 	return 0;
 }
 
boards.cfg +1 -1
index 4c52770..f6105be 100644
@@ -423,7 +423,7 @@ PQ2FADS-ZU_66MHz_lowboot     powerpc     mpc8260     mpc8260ads          freesca
 PQ2FADS-ZU_lowboot           powerpc     mpc8260     mpc8260ads          freescale      -           MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF800000
 VoVPN-GW_66MHz               powerpc     mpc8260     vovpn-gw            funkwerk       -           VoVPN-GW:CLKIN_66MHz
 mgcoge                       powerpc     mpc8260     km82xx              keymile
-mgcoge2ne                    powerpc     mpc8260     km82xx              keymile
+mgcoge3ne                    powerpc     mpc8260     km82xx              keymile
 SCM                          powerpc     mpc8260     -                   siemens
 TQM8255_AA                   powerpc     mpc8260     tqm8260             tqc            -           TQM8260:MPC8255,300MHz
 TQM8260_AA                   powerpc     mpc8260     tqm8260             tqc            -           TQM8260:MPC8260,200MHz
include/configs/mgcoge.h +1 -0
index aed1526..93a6f4a 100644
@@ -32,6 +32,7 @@
 #define CONFIG_MPC8247
 #define CONFIG_MGCOGE
 #define CONFIG_HOSTNAME		mgcoge
+#define CONFIG_KM_82XX
 
 #define	CONFIG_SYS_TEXT_BASE	0xFE000000
 
include/configs/mgcoge3ne.h renamed from include/configs/mgcoge2ne.h +33 -25

97 lines not on this page · raw message

Signature · 1 line
1.7.0.5
#15 lore raw

PATCH 8/30 powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

Dear Valentin Longchamp,

Quoted 7 lines · In message <c5ba4fd44d7260d169b924ddda97c4a4c7460dd5.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

This patch rename mgcoge2ne board support to mgcoge3ne. The board is similar to mgcoge. The difference is that a NUMONYX flash is used and a larger SDRAM (256MB). Also introduce CONFIG_KM_82XX to collect ppc82xx common settings.

I understand this is just a rename, but I want to ask anyway: if flash type and RAM size are the only differences, then why do we need two separate board definitions here?

Would not even the same U-Boot binary image run on both boards? These flashes are CFI compatible, so the CFI driver would work on both, and RAM size autodetection has been available in U-Boot forever.

In worst case, we coul differentiate boards by an additional #define, which means we only need a single line entry in boards.cfg.

Why do we need to support two board entries?

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
Military secrets are the most fleeting of all.
	-- Spock, "The Enterprise Incident", stardate 5027.4
#16 lore raw

PATCH 8/30 powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

Hello,

Quoted 15 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 7 lines · In message <c5ba4fd44d7260d169b924ddda97c4a4c7460dd5.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

This patch rename mgcoge2ne board support to mgcoge3ne. The board is similar to mgcoge. The difference is that a NUMONYX flash is used and a larger SDRAM (256MB). Also introduce CONFIG_KM_82XX to collect ppc82xx common settings.

I understand this is just a rename, but I want to ask anyway: if flash type and RAM size are the only differences, then why do we need two separate board definitions here?

Quoted 9 lines

Would not even the same U-Boot binary image run on both boards? These flashes are CFI compatible, so the CFI driver would work on both, and RAM size autodetection has been available in U-Boot forever.

In worst case, we coul differentiate boards by an additional #define, which means we only need a single line entry in boards.cfg.

Why do we need to support two board entries?

the SDRAM configuration is different to mgcoge. And the CFI flash on mgcoge has a dual die in a single chip and therefore e.g.CONFIG_SYS_MAX_FLASH_BANKS is different to mgcoge3ne.

Additionaly some functional differences are part of the board support, this is added later on. E.g. mgcoge3ne is part of mgcoge3 which has two processors deployed and there are some connections between the processors via GPIOs which are not present on mgcoge. So in my opinion an additional board suport is reasonable in this case.

Best regards
Holger Brunck

#17 lore raw

PATCH 8/30 powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

Dear Holger Brunck,

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

the SDRAM configuration is different to mgcoge. And the CFI flash on mgcoge has a dual die in a single chip and therefore e.g.CONFIG_SYS_MAX_FLASH_BANKS is different to mgcoge3ne.

OK, but these can trivially be handled within one set of board files.

Quoted 5 lines

Additionaly some functional differences are part of the board support, this is added later on. E.g. mgcoge3ne is part of mgcoge3 which has two processors deployed and there are some connections between the processors via GPIOs which are not present on mgcoge. So in my opinion an additional board suport is reasonable in this case.

Well, it's your board and you have to maintain it in the long run, but I'm not convinced that this is a wise decision.

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
There is a multi-legged creature crawling on your shoulder.
	-- Spock, "A Taste of Armageddon", stardate 3193.9
#18 lore raw

PATCH 8/30 powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

Quoted 10 lines · Wolfgang Denk

Dear Holger Brunck,

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

the SDRAM configuration is different to mgcoge. And the CFI flash on mgcoge has a dual die in a single chip and therefore e.g.CONFIG_SYS_MAX_FLASH_BANKS is different to mgcoge3ne.

OK, but these can trivially be handled within one set of board files.

with a lot of #ifdef MGCOGE3NE in one config file or do I misunderstand something?

Quoted 9 lines
Quoted 5 lines

Additionaly some functional differences are part of the board support, this is added later on. E.g. mgcoge3ne is part of mgcoge3 which has two processors deployed and there are some connections between the processors via GPIOs which are not present on mgcoge. So in my opinion an additional board suport is reasonable in this case.

Well, it's your board and you have to maintain it in the long run, but I'm not convinced that this is a wise decision.

So your proposal would be to do something like
mgcoge powerpc mpc8260 km82xx keymile - mgcoge3ne:MGCOGE3NE,...
in boards.cfg and only one config file for both boards?

Best regards
Holger Brunck

#19 lore raw

PATCH 8/30 powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

Dear Holger Brunck,

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

the SDRAM configuration is different to mgcoge. And the CFI flash on mgcoge has a dual die in a single chip and therefore e.g.CONFIG_SYS_MAX_FLASH_BANKS is different to mgcoge3ne.

OK, but these can trivially be handled within one set of board files.

with a lot of #ifdef MGCOGE3NE in one config file or do I misunderstand something?

Well, I would expect to have one #ifdef for the SDRAM configuration, and another one for CONFIG_SYS_MAX_FLASH_BANKS - both in the common board config file.

Quoted 3 lines

So your proposal would be to do something like
mgcoge powerpc mpc8260 km82xx keymile - mgcoge3ne:MGCOGE3NE,...
in boards.cfg and only one config file for both boards?

Yes.

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
"'Tis true, 'tis pity, and pity 'tis 'tis true."
    - Poloniouius, in Willie the Shake's _Hamlet, Prince of Darkness_
#20 lore raw

PATCH 9/30 poweprc/km82xx: add board specific environment variable

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

On mgcoge3ne a new environment variable bobcatreset is used. So this patch adds a possibility to add board specific environment variables in general and this specific variable for mgcoge3ne.

---
 include/configs/km82xx-common.h |    1 +
 include/configs/mgcoge.h        |    2 ++
 include/configs/mgcoge3ne.h     |    2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)
include/configs/km82xx-common.h +1 -0
index 894e015..446c1d0 100644
@@ -80,6 +80,7 @@
  * Default environment settings
  */
 #define	CONFIG_EXTRA_ENV_SETTINGS					\
+	CONFIG_KM_BOARD_EXTRA_ENV					\
 	CONFIG_KM_DEF_ENV						\
 	"EEprom_ivm=pca9544a:70:4 \0"					\
 	"unlock=yes\0"							\
include/configs/mgcoge.h +2 -0
index 93a6f4a..0745855 100644
@@ -85,6 +85,8 @@
 			 PSDMR_CL_2)
 
 
+#define CONFIG_KM_BOARD_EXTRA_ENV	""
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
include/configs/mgcoge3ne.h +2 -0
index 3df7ef1..78ce468 100644
@@ -89,6 +89,8 @@
 			PSDMR_WRC_2C				|\
 			PSDMR_CL_2)
 
+#define CONFIG_KM_BOARD_EXTRA_ENV	"bobcatreset=true\0"
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
Signature · 1 line
1.7.0.5
#21 lore raw

PATCH 10/30 arm/km: add addbootcount environment variable

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

This environment variable is used to set the bootcount address for the kernel.

---
 board/keymile/common/common.c |    7 +++++++
 include/configs/km_arm.h      |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)
board/keymile/common/common.c +7 -0
index 3a7980d..9ec0022 100644
@@ -106,6 +106,13 @@ int set_km_env(void)
 	varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
 	sprintf((char *)buf, "0x%x", varaddr);
 	setenv("varaddr", (char *)buf);
+
+#ifdef BOOTCOUNT_ADDR
+	unsigned int bootcountaddr;
+	bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM;
+	sprintf((char *)buf, "0x%x", bootcountaddr);
+	setenv("bootcountaddr", (char *)buf);
+#endif
 	return 0;
 }
 
include/configs/km_arm.h +3 -0
index 70113d4..89f9d35 100644
@@ -64,6 +64,9 @@
 #define CONFIG_KM_KERNEL_ADDR	0x2000000	/* 4096KBytes */
 
 #define CONFIG_KM_DEF_ENV_CPU						\
+	"addbootcount="							\
+		"setenv bootargs ${bootargs} "				\
+		"bootcountaddr=${bootcountaddr}\0"			\
 	"addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0"		\
 	"boot=bootm ${actual_kernel_addr} - -\0"			\
 	"cramfsloadfdt=echo \\\\c\0"					\
Signature · 1 line
1.7.0.5
#22 lore raw

PATCH 10/30 arm/km: add addbootcount environment variable

Dear Valentin Longchamp,

Quoted 4 lines · In message <ab89ca576a2ad8bcde3b08039a71a9a7695a7eef.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

This environment variable is used to set the bootcount address for the kernel.

"addbootcount" reads to me as "add something to the boot counter". I do not expect that this has anything to do with an address. Please use something like "bootcount_addr" (or "bootcnt_addr" or similar) instead.

board/keymile/common/common.c int set_km_env(void) · line 115

Quoted 11 lines
board/keymile/common/common.c +7 -0
@@ -106,6 +106,13 @@ int set_km_env(void)
 	varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
 	sprintf((char *)buf, "0x%x", varaddr);
 	setenv("varaddr", (char *)buf);
+
+#ifdef BOOTCOUNT_ADDR
+	unsigned int bootcountaddr;
+	bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM;
+	sprintf((char *)buf, "0x%x", bootcountaddr);
+	setenv("bootcountaddr", (char *)buf);
+#endif

NAK. We don't allow declarations in the middle of the code.

include/configs/km_arm.h line 69

Quoted 13 lines
(quoted diff) +0 -0
 }
 
include/configs/km_arm.h +3 -0
index 70113d4..89f9d35 100644
@@ -64,6 +64,9 @@
 #define CONFIG_KM_KERNEL_ADDR	0x2000000	/* 4096KBytes */
 
 #define CONFIG_KM_DEF_ENV_CPU						\
+	"addbootcount="							\
+		"setenv bootargs ${bootargs} "				\
+		"bootcountaddr=${bootcountaddr}\0"			\

Argh. Not I see what you mean. Please fix the description,it is completely misleading.

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
"The number  of  Unix  installations  has  grown  to  10,  with  more
expected."    - The Unix Programmer's Manual, 2nd Edition, June, 1972
#23 lore raw

PATCH 10/30 arm/km: add addbootcount environment variable

Hello,

Quoted 13 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 4 lines · In message <ab89ca576a2ad8bcde3b08039a71a9a7695a7eef.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

This environment variable is used to set the bootcount address for the kernel.

"addbootcount" reads to me as "add something to the boot counter". I do not expect that this has anything to do with an address. Please use something like "bootcount_addr" (or "bootcnt_addr" or similar) instead.

Quoted 14 lines

board/keymile/common/common.c int set_km_env(void) · line 115

Quoted 11 lines
board/keymile/common/common.c +7 -0
@@ -106,6 +106,13 @@ int set_km_env(void)
 	varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
 	sprintf((char *)buf, "0x%x", varaddr);
 	setenv("varaddr", (char *)buf);
+
+#ifdef BOOTCOUNT_ADDR
+	unsigned int bootcountaddr;
+	bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM;
+	sprintf((char *)buf, "0x%x", bootcountaddr);
+	setenv("bootcountaddr", (char *)buf);
+#endif

NAK. We don't allow declarations in the middle of the code.

Ok.

Quoted 9 lines
Quoted 9 lines
(quoted diff) +0 -0
 }
 
include/configs/km_arm.h +0 -0
index 70113d4..89f9d35 100644
@@ -64,6 +64,9 @@
 #define CONFIG_KM_KERNEL_ADDR	0x2000000	/* 4096KBytes */
 
Quoted 8 lines

include/configs/km_arm.h line 69

Quoted 4 lines
include/configs/km_arm.h +3 -0
 #define CONFIG_KM_DEF_ENV_CPU						\
+	"addbootcount="							\
+		"setenv bootargs ${bootargs} "				\
+		"bootcountaddr=${bootcountaddr}\0"			\

Argh. Not I see what you mean. Please fix the description,it is completely misleading.

Ok, I will adapt this. Thanks for reviewing.

Best regards
Holger Brunck

#24 lore raw

PATCH 11/30 arm/km: remove last_stage_init and unneeded printouts

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

last_stage_init is not available for arm platforms. So move the call to set_km_var to misc_init_r and remove this function. Additionally some unneeded printouts were removed.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
---
 board/keymile/km_arm/km_arm.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
board/keymile/km_arm/km_arm.c +1 -12
index c772ee2..a64cdd8 100644
@@ -150,11 +150,6 @@ int misc_init_r(void)
 	char *str;
 	int mach_type;
 
-	puts("Piggy:");
-	if (ethernet_present() == 0)
-		puts (" not");
-	puts(" present\n");
-
 	str = getenv("mach_type");
 	if (str != NULL) {
 		mach_type = simple_strtoul(str, NULL, 10);
@@ -163,6 +158,7 @@ int misc_init_r(void)
 	}
 
 	initialize_unit_leds();
+	set_km_env();
 
 	return 0;
 }
@@ -182,7 +178,6 @@ int board_early_init_f(void)
 	writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
 	tmp = readl(KW_GPIO0_BASE + 4);
 	writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
-	printf("KM: setting NAND mode\n");
 
 #if defined(CONFIG_SOFT_I2C)
 	/* init the GPIO for I2C Bitbang driver */
@@ -212,12 +207,6 @@ int board_init(void)
 	return 0;
 }
 
-int last_stage_init(void)
-{
-	set_km_env();
-	return 0;
-}
-
 #if defined(CONFIG_CMD_SF)
 int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
Signature · 1 line
1.7.0.5
#25 lore raw

PATCH 12/30 arm/km: add CRAMFS support for keymile boards

In reply to Valentin Longchamp

From: Heiko Schocher <[email protected]>

---
 include/configs/keymile-common.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/configs/keymile-common.h +2 -0
index cb6d0fb..6329a1c 100644
@@ -136,6 +136,8 @@
 #define CONFIG_MTD_PARTITIONS
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_CONCAT
+#define CONFIG_CMD_CRAMFS
+#define CONFIG_CRAMFS_CMDLINE
 
 /* common powerpc specific env settings */
 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
Signature · 1 line
1.7.0.5
#26 lore raw

PATCH 13/30 arm/km: add mkimage config file for uart download

In reply to Valentin Longchamp
---
 board/keymile/km_arm/kwbimage-uart.cfg |  179 ++++++++++++++++++++++++++++++++
 1 files changed, 179 insertions(+), 0 deletions(-)
 create mode 100644 board/keymile/km_arm/kwbimage-uart.cfg
board/keymile/km_arm/kwbimage-uart.cfg new file +179 -0
new file mode 100644
index 0000000..d8c517c
@@ -0,0 +1,179 @@
+#
+# (C) Copyright 2010
+# Heiko Schocher, DENX Software Engineering, hs at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM	uart	# Boot from SPI flash
+
+DATA 0xFFD10000 0x01112222	# MPP Control 0 Register
+# bit 3-0:   MPPSel0	2, NF_IO[2]
+# bit 7-4:   MPPSel1	2, NF_IO[3]
+# bit 12-8:  MPPSel2	2, NF_IO[4]
+# bit 15-12: MPPSel3	2, NF_IO[5]
+# bit 19-16: MPPSel4	1, NF_IO[6]
+# bit 23-20: MPPSel5	1, NF_IO[7]
+# bit 27-24: MPPSel6	1, SYSRST_O
+# bit 31-28: MPPSel7	0, GPO[7]
+
+DATA 0xFFD10004 0x03303300
+
+DATA 0xFFD10008 0x00001100	# MPP Control 2 Register
+# bit 3-0:   MPPSel16	0, GPIO[16]
+# bit 7-4:   MPPSel17	0, GPIO[17]
+# bit 12-8:  MPPSel18	1, NF_IO[0]
+# bit 15-12: MPPSel19	1, NF_IO[1]
+# bit 19-16: MPPSel20	0, GPIO[20]
+# bit 23-20: MPPSel21	0, GPIO[21]
+# bit 27-24: MPPSel22	0, GPIO[22]
+# bit 31-28: MPPSel23	0, GPIO[23]
+
+DATA 0xFFD100E0 0x1B1B1B1B	# IO Configuration 0 Register
+DATA 0xFFD20134 0x66666666	# L2 RAM Timing 0 Register
+DATA 0xFFD20138 0x66666666	# L2 RAM Timing 1 Register
+DATA 0xFFD20154 0x00000200	# CPU RAM Management Control3 Register
+DATA 0xFFD2014C 0x00001C00	# CPU RAM Management Control1 Register
+DATA 0xFFD20148 0x00000001	# CPU RAM Management Control0 Register
+
+# Dram initalization
+DATA 0xFFD01400 0x43000400	# SDRAM Configuration Register
+# bit13-0:  0x400 (DDR2 clks refresh rate)
+# bit23-14: zero
+# bit24: 1= enable exit self refresh mode on DDR access
+# bit25: 1 required
+# bit29-26: zero
+# bit31-30: 01
+
+DATA 0xFFD01404 0x39543000	# DDR Controller Control Low
+# bit 3-0:  0 reserved
+# bit 4:    0=addr/cmd in smame cycle
+# bit 5:    0=clk is driven during self refresh, we don't care for APX
+# bit 6:    0=use recommended falling edge of clk for addr/cmd
+# bit14:    0=input buffer always powered up
+# bit18:    1=cpu lock transaction enabled
+# bit23-20: 3=recommended value for CL=3 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 6= CL+3, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM
+# bit30-28: 3 required
+# bit31:    0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x34136552	# DDR Timing (Low) (active cycles value +1)
+# bit3-0:   TRAS lsbs
+# bit7-4:   TRCD
+# bit11- 8: TRP
+# bit15-12: TWR
+# bit19-16: TWTR
+# bit20:    TRAS msb
+# bit23-21: 0x0
+# bit27-24: TRRD
+# bit31-28: TRTP
+
+DATA 0xFFD0140C 0x00000033	#  DDR Timing (High)
+# bit6-0:   TRFC
+# bit8-7:   TR2R
+# bit10-9:  TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x0000000D	#  DDR Address Control
+# bit1-0:   01, Cs0width=x16
+# bit3-2:   11, Cs0size=1Gb
+# bit5-4:   00, Cs2width=nonexistent
+# bit7-6:   00, Cs1size =nonexistent
+# bit9-8:   00, Cs2width=nonexistent
+# bit11-10: 00, Cs2size =nonexistent
+# bit13-12: 00, Cs3width=nonexistent
+# bit15-14: 00, Cs3size =nonexistent
+# bit16:    0,  Cs0AddrSel
+# bit17:    0,  Cs1AddrSel
+# bit18:    0,  Cs2AddrSel
+# bit19:    0,  Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x00000000	#  DDR Open Pages Control
+# bit0:    0,  OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x00000000	#  DDR Operation
+# bit3-0:   0x0, DDR cmd
+# bit31-4:  0 required
+
+DATA 0xFFD0141C 0x00000652	#  DDR Mode
+DATA 0xFFD01420 0x00000044	#  DDR Extended Mode
+# bit0:    0,  DDR DLL enabled
+# bit1:    0,  DDR drive strenght normal
+# bit2:    1,  DDR ODT control lsd disabled
+# bit5-3:  000, required
+# bit6:    1,  DDR ODT control msb, enabled
+# bit9-7:  000, required
+# bit10:   0,  differential DQS enabled
+# bit11:   0, required
+# bit12:   0, DDR output buffer enabled
+# bit31-13: 0 required
+
+DATA 0xFFD01424 0x0000F07F	#  DDR Controller Control High
+# bit2-0:  111, required
+# bit3  :  1  , MBUS Burst Chop disabled
+# bit6-4:  111, required
+# bit7  :  0
+# bit8  :  0  , no sample stage
+# bit9  :  0  , no half clock cycle addition to dataout
+# bit10 :  0  , 1/4 clock cycle skew enabled for addr/ctl signals
+# bit11 :  0  , 1/4 clock cycle skew disabled for write mesh
+# bit15-12: 1111 required
+# bit31-16: 0    required
+DATA 0xFFD01428 0x00074510
+DATA 0xFFD0147c 0x00007451
+
+DATA 0xFFD01500 0x00000000	# CS[0]n Base address to 0x0
+DATA 0xFFD01504 0x07FFFFF1	# CS[0]n Size
+# bit0:    1,  Window enabled
+# bit1:    0,  Write Protect disabled
+# bit3-2:  00, CS0 hit selected
+# bit23-4: ones, required
+# bit31-24: 0x07, Size (i.e. 128MB)
+
+DATA 0xFFD0150C 0x00000000	# CS[1]n Size, window disabled
+DATA 0xFFD01514 0x00000000	# CS[2]n Size, window disabled
+DATA 0xFFD0151C 0x00000000	# CS[3]n Size, window disabled
+
+DATA 0xFFD01494 0x00010001	#  DDR ODT Control (Low)
+# bit3-0:  0, ODT0Rd, MODT[0] asserted during read from DRAM CS0
+# bit19-16:0, ODT0Wr, MODT[0] asserted during write to DRAM CS0
+
+DATA 0xFFD01498 0x00000000	#  DDR ODT Control (High)
+# bit1-0:  00, ODT0 controlled by ODT Control (low) register above
+# bit3-2:  00, ODT1 controlled by register
+# bit31-4: zero, required
+
+DATA 0xFFD0149C 0x0000FC11	# CPU ODT Control
+# bit3-0:  F, ODT0Rd, Internal ODT asserted during read from DRAM bank0
+# bit7-4:  0, ODT0Wr, Internal ODT asserted during write to DRAM bank0
+# bit9-8:  1, ODTEn, never active
+# bit11-10:2, DQ_ODTSel. ODT select turned on, 75 ohm
+
+DATA 0xFFD01480 0x00000001	# DDR Initialization Control
+# bit0=1, enable DDR init upon this register write
+
+# End of Header extension
+DATA 0x0 0x0
Signature · 1 line
1.7.0.5
#27 lore raw

PATCH 14/30 arm/km: add BootROM config files for memphis SDRAM

In reply to Valentin Longchamp

This RAM is used on mgcoge3un and needs other initialization values for the SDRAM controller.

---
 board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 ++++++++++++++++++++++++
 board/keymile/km_arm/kwbimage-memphis.cfg      |  197 ++++++++++++++++++++++++
 2 files changed, 394 insertions(+), 0 deletions(-)
 create mode 100644 board/keymile/km_arm/kwbimage-memphis-uart.cfg
 create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg
board/keymile/km_arm/kwbimage-memphis-uart.cfg new file +197 -0
new file mode 100644
index 0000000..214f6b6
@@ -0,0 +1,197 @@
+#
+# (C) Copyright 2010
+# Heiko Schocher, DENX Software Engineering, hs at denx.de.
+#
+# (C) Copyright 2011
+# Valentin Longchamp, Keymile AG, valentin.longchamp at keymile.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM	uart	# Boot from SPI flash
+
+DATA 0xFFD10000 0x01112222	# MPP Control 0 Register
+# bit 3-0:   MPPSel0	2, NF_IO[2]
+# bit 7-4:   MPPSel1	2, NF_IO[3]
+# bit 12-8:  MPPSel2	2, NF_IO[4]
+# bit 15-12: MPPSel3	2, NF_IO[5]
+# bit 19-16: MPPSel4	1, NF_IO[6]
+# bit 23-20: MPPSel5	1, NF_IO[7]
+# bit 27-24: MPPSel6	1, SYSRST_O
+# bit 31-28: MPPSel7	0, GPO[7]
+
+DATA 0xFFD10004 0x03303300
+
+DATA 0xFFD10008 0x00001100	# MPP Control 2 Register
+# bit 3-0:   MPPSel16	0, GPIO[16]
+# bit 7-4:   MPPSel17	0, GPIO[17]
+# bit 12-8:  MPPSel18	1, NF_IO[0]
+# bit 15-12: MPPSel19	1, NF_IO[1]
+# bit 19-16: MPPSel20	0, GPIO[20]
+# bit 23-20: MPPSel21	0, GPIO[21]
+# bit 27-24: MPPSel22	0, GPIO[22]
+# bit 31-28: MPPSel23	0, GPIO[23]
+
+DATA 0xFFD100E0 0x1B1B1B1B	# IO Configuration 0 Register
+DATA 0xFFD20134 0x66666666	# L2 RAM Timing 0 Register
+DATA 0xFFD20138 0x66666666	# L2 RAM Timing 1 Register
+DATA 0xFFD20154 0x00000200	# CPU RAM Management Control3 Register
+DATA 0xFFD2014C 0x00001C00	# CPU RAM Management Control1 Register
+DATA 0xFFD20148 0x00000001	# CPU RAM Management Control0 Register
+
+#Dram initalization
+DATA 0xFFD01400 0x430004E0	# SDRAM Configuration Register
+# bit13-0:  0x4E0 (DDR2 clks refresh rate)
+# bit23-14: zero
+# bit24: 1= enable exit self refresh mode on DDR access
+# bit25: 1 required
+# bit29-26: zero
+# bit31-30: 01
+
+DATA 0xFFD01404 0x38543000	# DDR Controller Control Low
+# bit 3-0:  0 reserved
+# bit 4:    0=addr/cmd in smame cycle
+# bit 5:    0=clk is driven during self refresh, we don't care for APX
+# bit 6:    0=use recommended falling edge of clk for addr/cmd
+# bit14:    0=input buffer always powered up
+# bit18:    1=cpu lock transaction enabled
+# bit23-20: 5=recommended value for CL=4 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 8= CL+4, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM
+# bit30-28: 3 required
+# bit31:    0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x2302433E	# DDR Timing (Low) (active cycles value +1)
+# bit3-0:   TRAS lsbs
+# bit7-4:   TRCD
+# bit11- 8: TRP
+# bit15-12: TWR
+# bit19-16: TWTR
+# bit20:    TRAS msb
+# bit23-21: 0x0
+# bit27-24: TRRD
+# bit31-28: TRTP
+
+DATA 0xFFD0140C 0x00000A3E	#  DDR Timing (High)
+# bit6-0:   TRFC
+# bit8-7:   TR2R
+# bit10-9:  TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x00000001	#  DDR Address Control
+# bit1-0:   01, Cs0width=x16
+# bit3-2:   00, Cs0size=2Gb
+# bit5-4:   00, Cs2width=nonexistent
+# bit7-6:   00, Cs1size =nonexistent
+# bit9-8:   00, Cs2width=nonexistent
+# bit11-10: 00, Cs2size =nonexistent
+# bit13-12: 00, Cs3width=nonexistent
+# bit15-14: 00, Cs3size =nonexistent
+# bit16:    0,  Cs0AddrSel
+# bit17:    0,  Cs1AddrSel
+# bit18:    0,  Cs2AddrSel
+# bit19:    0,  Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x00000000	#  DDR Open Pages Control
+# bit0:    0,  OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x00000000	#  DDR Operation
+# bit3-0:   0x0, DDR cmd
+# bit31-4:  0 required
+
+DATA 0xFFD0141C 0x00000652	#  DDR Mode
+DATA 0xFFD01420 0x00000006	#  DDR Extended Mode
+# bit0:    0,  DDR DLL enabled
+# bit1:    1,  DDR drive strenght reduced
+# bit2:    1,  DDR ODT control lsd disabled
+# bit5-3:  000, required
+# bit6:    0,  DDR ODT control msb disabled
+# bit9-7:  000, required
+# bit10:   0,  differential DQS enabled
+# bit11:   0, required
+# bit12:   0, DDR output buffer enabled
+# bit31-13: 0 required
+
+DATA 0xFFD01424 0x0000F17F	#  DDR Controller Control High
+# bit2-0:  111, required
+# bit3  :  1  , MBUS Burst Chop disabled
+# bit6-4:  111, required
+# bit7  :  0
+# bit8  :  1  , add a sample stage
+# bit9  :  0  , no half clock cycle addition to dataout
+# bit10 :  0  , 1/4 clock cycle skew enabled for addr/ctl signals
+# bit11 :  0  , 1/4 clock cycle skew disabled for write mesh
+# bit15-12: 1111 required
+# bit31-16: 0    required
+
+DATA 0xFFD01428 0x00084520	# DDR2 SDRAM Timing Low
+# bit3-0  : 0000, required
+# bit7-4  : 0010, M_ODT assertion 2 cycles after read
+# bit11-8 : 1001, M_ODT de-assertion 5 cycles after read
+# bit15-12: 0100, internal ODT assertion 4 cycles after read
+# bit19-16: 1000, internal ODT de-assertion 8 cycles after read
+# bit31-20: 0   , required
+
+DATA 0xFFD0147c 0x00008451	# DDR2 SDRAM Timing High
+# bit3-0  : 0001, M_ODT assertion same cycle as write
+# bit7-4  : 0101, M_ODT de-assertion x cycles after write
+# bit11-8 : 0100, internal ODT assertion x cycles after write
+# bit15-12: 1000, internal ODT de-assertion x cycles after write
+
+DATA 0xFFD01500 0x00000000	# CS[0]n Base address to 0x0
+DATA 0xFFD01504 0x0FFFFFF1	# CS[0]n Size
+# bit0:    1,  Window enabled
+# bit1:    0,  Write Protect disabled
+# bit3-2:  00, CS0 hit selected
+# bit23-4: ones, required
+# bit31-24: 0x0F, Size (i.e. 256MB)
+
+DATA 0xFFD0150C 0x00000000	# CS[1]n Size, window disabled
+DATA 0xFFD01514 0x00000000	# CS[2]n Size, window disabled
+DATA 0xFFD0151C 0x00000000	# CS[3]n Size, window disabled
+
+DATA 0xFFD01494 0x00010000	#  DDR ODT Control (Low)
+# bit3-0:  0, ODT0Rd, MODT[0] not asserted during read from DRAM CS0
+# bit19-16:1, ODT0Wr, MODT[0] asserted during write to DRAM CS0
+
+DATA 0xFFD01498 0x00000000	#  DDR ODT Control (High)
+# bit1-0:  00, ODT0 controlled by ODT Control (low) register above
+# bit3-2:  00, ODT1 controlled by register
+# bit31-4: zero, required
+
+DATA 0xFFD0149C 0x0000F801	# CPU ODT Control
+# bit3-0:  1, ODT0Rd, Internal ODT asserted during read from DRAM bank0
+# bit7-4:  0, ODT0Wr, Internal ODT not asserted during write to DRAM bank0
+# bit9-8:  0, ODTEn, controlled by ODT0Rd and ODT0Wr
+# bit11-10:2, DQ_ODTSel. ODT select turned on, 75 ohm
+# bit13-12:3, STARTBURST ODT buffer selected, 50 ohm
+# bit14   :1, STARTBURST ODT enabled
+# bit15   :1, Use ODT Block
+
+DATA 0xFFD01480 0x00000001	# DDR Initialization Control
+# bit0=1, enable DDR init upon this register write
+
+# End of Header extension
+DATA 0x0 0x0
board/keymile/km_arm/kwbimage-memphis.cfg new file +197 -0

197 lines not on this page · raw message

Signature · 1 line
1.7.0.5
#28 lore raw

PATCH 15/30 arm/km: disable ls (through jffs2 support)

In reply to Valentin Longchamp

This is not supported on our km-arm boards since we have defined CONFIG_SYS_NO_FLASH for our NAND Flash chip.

With CONFIG_CMD_JFFS2, the ls command is present and works very badly on our km-arm boards.

---
 include/configs/km_arm.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/km_arm.h +1 -0
index 89f9d35..a8a4d77 100644
@@ -248,6 +248,7 @@ int get_scl (void);
 #if defined(CONFIG_SYS_NO_FLASH)
 #define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
 #undef	CONFIG_FLASH_CFI_MTD
+#undef	CONFIG_CMD_JFFS2
 #undef	CONFIG_JFFS2_CMDLINE
 #endif
 
Signature · 1 line
1.7.0.5
#29 lore raw

PATCH 16/30 arm/km: add second serial interface for kirkwood

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
---
 include/configs/km_arm.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
include/configs/km_arm.h +6 -0
index a8a4d77..06f91fe 100644
@@ -92,6 +92,7 @@
 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
 #define CONFIG_SYS_NS16550_CLK		CONFIG_SYS_TCLK
 #define CONFIG_SYS_NS16550_COM1		KW_UART0_BASE
+#define CONFIG_SYS_NS16550_COM2		KW_UART1_BASE
 
 /*
  * Serial Port configuration
@@ -136,7 +137,12 @@
 
 #define BOOTFLASH_START		0x0
 
+/* Kirkwood has two serial IF */
+#if (CONFIG_CONS_INDEX == 2)
+#define CONFIG_KM_CONSOLE_TTY	"ttyS1"
+#else
 #define CONFIG_KM_CONSOLE_TTY	"ttyS0"
+#endif
 
 /* size in bytes reserved for initial data */
 
Signature · 1 line
1.7.0.5
#30 lore raw

PATCH 17/30 cramfs: make cramfs usable without a NOR flash

In reply to Valentin Longchamp

From: Heiko Schocher <[email protected]>

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 common/cmd_cramfs.c |   12 +++++++++++-
 fs/cramfs/cramfs.c  |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)
common/cmd_cramfs.c +11 -1
index 8c86dc5..5e1487f 100644
@@ -43,7 +43,9 @@
 #endif
 
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+#include <flash.h>
+#endif
 
 #ifndef CONFIG_CMD_JFFS2
 #include <linux/stat.h>
@@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif
 
 	/* pre-set Boot file name */
 	if ((filename = getenv("bootfile")) == NULL) {
@@ -182,7 +188,11 @@ int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif
 
 	if (argc == 2)
 		filename = argv[1];
fs/cramfs/cramfs.c +4 -0
index 2956d39..910955d 100644
@@ -41,8 +41,12 @@ struct cramfs_super super;
 
 /* CPU address space offset calculation macro, struct part_info offset is
  * device address space offset, so we need to shift it by a device start address. */
+#if !defined(CONFIG_SYS_NO_FLASH)
 extern flash_info_t flash_info[];
 #define PART_OFFSET(x)	(x->offset + flash_info[x->dev->id->num].start[0])
+#else
+#define PART_OFFSET(x)	(x->offset)
+#endif
 
 static int cramfs_read_super (struct part_info *info)
 {
Signature · 1 line
1.7.0.5
#31 lore raw

PATCH 17/30 cramfs: make cramfs usable without a NOR flash

Dear Valentin Longchamp,

Quoted 18 lines · In message <e0cad960c27371170bf2d2d4be3362d6665fbbfa.1302272395.git.valentin.lo…

From: Heiko Schocher <[email protected]>

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 common/cmd_cramfs.c |   12 +++++++++++-
 fs/cramfs/cramfs.c  |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)
common/cmd_cramfs.c +0 -0
index 8c86dc5..5e1487f 100644

common/cmd_cramfs.c line 48

Quoted 7 lines
common/cmd_cramfs.c +3 -1
@@ -43,7 +43,9 @@
 #endif
 
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+#include <flash.h>
+#endif

Do we need the #ifndef here? I don;t thik it hurts if we unconditionally #include <flash.h> ?

But note: there was no "extern" in this declaration of flash_info[], i. e. we _did_ allocate storage here. Is the new code really equivalent? How extensively has it been tested?

common/cmd_cramfs.c int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 128

Quoted 11 lines
common/cmd_cramfs.c +4 -0
 #ifndef CONFIG_CMD_JFFS2
 #include <linux/stat.h>
@@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif

Sequences like this repeat a number of times. How about

#ifdef CONFIG_SYS_NO_FLASH

# define OFFSET_ADJUSTMENT(x)	0
#else
# define OFFSET_ADJUSTMENT(x)	(flash_info[id.num].start[x])
#endif
...
	dev.id = &id;
	part.dev = &dev;
	/* fake the address offset */
	part.offset = addr - OFFSET_ADJUSTMENT(0);

common/cmd_cramfs.c int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 128

Quoted 5 lines
common/cmd_cramfs.c +4 -0
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif
	part.offset = addr - OFFSET_ADJUSTMENT(0);

common/cmd_cramfs.c

Quoted 4 lines

extern flash_info_t flash_info[];
#define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0])

common/cmd_cramfs.c +2 -0
+#else
+#define PART_OFFSET(x)	(x->offset)

#define PART_OFFSET(x) (x->offset + OFFSET_ADJUSTMENT(0))

[If we always refer to start[0] only, we can even omit the argument.]

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
We are all agreed that your  theory  is  crazy.  The  question  which
divides  us  is  whether it is crazy enough to have a chance of being
correct. My own feeling is that it is not crazy enough.  - Niels Bohr
#32 lore raw

PATCH 17/30 cramfs: make cramfs usable without a NOR flash

Hello Wolfgang,

Quoted 23 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 20 lines · In message <e0cad960c27371170bf2d2d4be3362d6665fbbfa.1302272395.git.valentin.lo…

From: Heiko Schocher <[email protected]>

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 common/cmd_cramfs.c |   12 +++++++++++-
 fs/cramfs/cramfs.c  |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)
common/cmd_cramfs.c +0 -0
index 8c86dc5..5e1487f 100644
@@ -43,7 +43,9 @@
 #endif
 
Quoted 8 lines

common/cmd_cramfs.c line 48

Quoted 5 lines
common/cmd_cramfs.c +3 -1
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+#include <flash.h>
+#endif

Do we need the #ifndef here? I don;t thik it hurts if we unconditionally #include <flash.h> ?

Yep, you are right.

Quoted 3 lines

But note: there was no "extern" in this declaration of flash_info[], i. e. we _did_ allocate storage here. Is the new code really equivalent? How extensively has it been tested?

flash_info is defined in the flash driver, so this is OK. It is tested on the keymile boards, and a MAKEALL runs clean.

Quoted 15 lines

common/cmd_cramfs.c int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 128

Quoted 11 lines
common/cmd_cramfs.c +4 -0
 #ifndef CONFIG_CMD_JFFS2
 #include <linux/stat.h>
@@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif

Sequences like this repeat a number of times. How about

#ifdef CONFIG_SYS_NO_FLASH

Quoted 9 lines
# define OFFSET_ADJUSTMENT(x)	0
#else
# define OFFSET_ADJUSTMENT(x)	(flash_info[id.num].start[x])
#endif
...
	dev.id = &id;
	part.dev = &dev;
	/* fake the address offset */
	part.offset = addr - OFFSET_ADJUSTMENT(0);

Yep, that looks better, I change this.

Quoted 16 lines

common/cmd_cramfs.c int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 128

Quoted 5 lines
common/cmd_cramfs.c +4 -0
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif
	part.offset = addr - OFFSET_ADJUSTMENT(0);

common/cmd_cramfs.c

Quoted 4 lines

extern flash_info_t flash_info[];
#define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0])

common/cmd_cramfs.c +2 -0
+#else
+#define PART_OFFSET(x)	(x->offset)

#define PART_OFFSET(x) (x->offset + OFFSET_ADJUSTMENT(0))

Quoted 1 line

[If we always refer to start[0] only, we can even omit the argument.]

Yep.

Wolfgang? Is it OK, to send a v2 which is not in this patchseries, as I think this is an independent patch?

bye,
Heiko

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

PATCH 17/30 cramfs: make cramfs usable without a NOR flash

Dear Heiko Schocher,

Quoted 17 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 6 lines
common/cmd_cramfs.c +0 -0
@@ -43,7 +43,9 @@
 #endif
 
Quoted 8 lines

common/cmd_cramfs.c line 48

Quoted 5 lines
common/cmd_cramfs.c +3 -1
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+#include <flash.h>
+#endif

Do we need the #ifndef here? I don;t thik it hurts if we unconditionally #include <flash.h> ?

Yep, you are right.

Quoted 7 lines
Quoted 3 lines

But note: there was no "extern" in this declaration of flash_info[], i. e. we _did_ allocate storage here. Is the new code really equivalent? How extensively has it been tested?

flash_info is defined in the flash driver, so this is OK. It is tested on the keymile boards, and a MAKEALL runs clean.

You are probably right that the code with your patch is correct, i. e. that this one-line deletion fixes an actual bug in the existing code. But you don't mention this in the commit message.

These are two unrelated changes, that belon into separate commits.

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
Presidency:  The greased pig in the field game of American politics.
- Ambrose Bierce
#34 lore raw

PATCH v2 1/2 cramfs: fix bug in using CONFIG_CRAMFS_CMDLINE

In reply to Valentin Longchamp

do not define own flash_info variable, instead use the flash_info variable defined in your flash driver.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>

---
changes for v2:
- added comments from Wolfgang Denk:
- new patch in this version
- no ifndef around include <flash.h> needed

 common/cmd_cramfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_cramfs.c +1 -1
index 8c86dc5..9060ecc 100644
@@ -43,7 +43,7 @@
 #endif
 
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#include <flash.h>
 
 #ifndef CONFIG_CMD_JFFS2
 #include <linux/stat.h>
Signature · 1 line
1.7.4.4
#35 lore raw

PATCH v2 1/2 cramfs: fix bug in using CONFIG_CRAMFS_CMDLINE

Dear Heiko Schocher,

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

do not define own flash_info variable, instead use the flash_info variable defined in your flash driver.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
Quoted 8 lines

---
changes for v2:
- added comments from Wolfgang Denk:
- new patch in this version
- no ifndef around include <flash.h> needed

 common/cmd_cramfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

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
Murder is contrary to the laws of man and God.
	-- M-5 Computer, "The Ultimate Computer", stardate 4731.3
#36 lore raw

PATCH v2 2/2 cramfs: make cramfs usable without a NOR flash

In reply to Valentin Longchamp
cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>

---
changes for v2:
- added comments from Wolfgang Denk:
- introduce define OFFSET_ADJUSTMENT, so command can be used without a NOR flash.

 common/cmd_cramfs.c |   10 ++++++++--
 fs/cramfs/cramfs.c  |    4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)
common/cmd_cramfs.c +8 -2
index 9060ecc..e7f496e 100644
@@ -45,6 +45,12 @@
 #ifdef CONFIG_CRAMFS_CMDLINE
 #include <flash.h>
 
+#ifdef CONFIG_SYS_NO_FLASH
+# define OFFSET_ADJUSTMENT	0
+#else
+# define OFFSET_ADJUSTMENT	(flash_info[id.num].start[0])
+#endif
+
 #ifndef CONFIG_CMD_JFFS2
 #include <linux/stat.h>
 char *mkmodestr(unsigned long mode, char *str)
@@ -119,7 +125,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
-	part.offset = addr - flash_info[id.num].start[0];
+	part.offset = addr - OFFSET_ADJUSTMENT;
 
 	/* pre-set Boot file name */
 	if ((filename = getenv("bootfile")) == NULL) {
@@ -182,7 +188,7 @@ int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
-	part.offset = addr - flash_info[id.num].start[0];
+	part.offset = addr - OFFSET_ADJUSTMENT;
 
 	if (argc == 2)
 		filename = argv[1];
fs/cramfs/cramfs.c +4 -0
index 2956d39..910955d 100644
@@ -41,8 +41,12 @@ struct cramfs_super super;
 
 /* CPU address space offset calculation macro, struct part_info offset is
  * device address space offset, so we need to shift it by a device start address. */
+#if !defined(CONFIG_SYS_NO_FLASH)
 extern flash_info_t flash_info[];
 #define PART_OFFSET(x)	(x->offset + flash_info[x->dev->id->num].start[0])
+#else
+#define PART_OFFSET(x)	(x->offset)
+#endif
 
 static int cramfs_read_super (struct part_info *info)
 {
Signature · 1 line
1.7.4.4
#37 lore raw

PATCH v2 2/2 cramfs: make cramfs usable without a NOR flash

Dear Heiko Schocher,

Quoted 11 lines · In message <[email protected]> you wrote:
cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>

---
changes for v2:
- added comments from Wolfgang Denk:
- introduce define OFFSET_ADJUSTMENT, so command can be used without a NOR flash.

Quoted 3 lines
 common/cmd_cramfs.c |   10 ++++++++--
 fs/cramfs/cramfs.c  |    4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)

Applied, thanks.

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
Experience is what causes a person to make new  mistakes  instead  of
old ones.
#38 lore raw

PATCH 18/30 i2c: add i2c deblock sequence before and after every mux config

In reply to Valentin Longchamp

From: Stefan Bigler <[email protected]>

To make sure that the mux can be configured a deblocking sequence is done before the mux configuration. After the mux switch the new leaf of, the i2c tree must be again deblocked.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 common/cmd_i2c.c |   12 ++++++++++++
 include/i2c.h    |    2 --
 2 files changed, 12 insertions(+), 2 deletions(-)
common/cmd_i2c.c +12 -0
index c272b0d..d913e13 100644
@@ -132,6 +132,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define DISP_LINE_LEN	16
 
+/* implement possible board specific board init */
+void __def_i2c_init_board(void)
+{
+	return;
+}
+void i2c_init_board(void)
+	__attribute__((weak, alias("__def_i2c_init_board")));
+
 /* TODO: Implement architecture-specific get/set functions */
 unsigned int __def_i2c_get_bus_speed(void)
 {
@@ -1541,6 +1549,8 @@ int i2x_mux_select_mux(int bus)
 
 	mux = dev->mux;
 	while (mux != NULL) {
+		/* do deblocking on each level of mux, before mux config */
+		i2c_init_board();
 		if (i2c_write(mux->chip, 0, 0, &mux->channel, 1) != 0) {
 			printf ("Error setting Mux: chip:%x channel: \
 				%x\n", mux->chip, mux->channel);
@@ -1548,6 +1558,8 @@ int i2x_mux_select_mux(int bus)
 		}
 		mux = mux->next;
 	}
+	/* do deblocking on each level of mux and after mux config */
+	i2c_init_board();
 	return 0;
 }
 #endif /* CONFIG_I2C_MUX */
include/i2c.h +0 -2
index cd23c8a..8ceb4c8 100644
@@ -108,9 +108,7 @@
  * repeatedly to change the speed and slave addresses.
  */
 void i2c_init(int speed, int slaveaddr);
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
 void i2c_init_board(void);
-#endif
 #ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
 void i2c_board_late_init(void);
 #endif
Signature · 1 line
1.7.0.5
#39 lore raw

PATCH 18/30 i2c: add i2c deblock sequence before and after every mux config

Hello Valentin,

Quoted 14 lines · Valentin Longchamp

From: Stefan Bigler <[email protected]>

To make sure that the mux can be configured a deblocking sequence is done before the mux configuration. After the mux switch the new leaf of, the i2c tree must be again deblocked.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
Quoted 4 lines
---
 common/cmd_i2c.c |   12 ++++++++++++
 include/i2c.h    |    2 --
 2 files changed, 12 insertions(+), 2 deletions(-)

Thanks! Applied to u-boot-i2c. As this patch is independent, it must not be in a patchseries, so I applied it directly to the i2c-tree.

bye,
Heiko

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

PATCH 19/30 i2c, soft_i2c: deblock bus if switching to another i2c bus

In reply to Valentin Longchamp

From: Heiko Schocher <[email protected]>

Deblock i2c bus when switching to another i2c bus, if using i2c_set_bus_num().

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 drivers/i2c/soft_i2c.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/i2c/soft_i2c.c +1 -0
index 69b5f42..9b02e89 100644
@@ -286,6 +286,7 @@ int i2c_set_bus_num(unsigned int bus)
 		int	ret;
 
 		ret = i2x_mux_select_mux(bus);
+		i2c_init_board();
 		if (ret == 0)
 			i2c_bus_num = bus;
 		else
Signature · 1 line
1.7.0.5
#41 lore raw

PATCH 19/30 i2c, soft_i2c: deblock bus if switching to another i2c bus

Hello Valentin,

Quoted 11 lines · Valentin Longchamp

From: Heiko Schocher <[email protected]>

Deblock i2c bus when switching to another i2c bus, if using i2c_set_bus_num().

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
Quoted 3 lines
---
 drivers/i2c/soft_i2c.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Thanks! Applied to u-boot-i2c. As this patch is independent, it must not be in a patchseries, so I applied it directly to the i2c-tree.

bye,
Heiko

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

PATCH 20/30 km/common: fix initial_boot_bank for bootpackages

In reply to Valentin Longchamp

From: Thomas Herzmann <[email protected]>

The initial_boot_bank can be set when more than one application is used in a bootpackage. But a value n <> 0 never led to booting from bank n. Instead, bank 0 was booted. This patch fixes this.

---
 include/configs/keymile-common.h |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
include/configs/keymile-common.h +8 -7
index 6329a1c..5c32023 100644
@@ -249,10 +249,10 @@
 		"printbootargs boot "					\
 		"\" && "						\
 		"setenv bootcmd \'"					\
-		"run bootrunner; reset"					\
+		"run actual bootrunner; reset"				\
 		"\' && "						\
 		"setenv altbootcmd \'"					\
-		"run actual0 bootcmd; reset"				\
+		"run backup bootrunner; reset"				\
 		"\' && "						\
 		"saveenv && "						\
 		"reset\0"						\
@@ -290,7 +290,7 @@
 	"addramfs="							\
 		"setenv bootargs \""					\
 		"${bootargs} phram.phram="				\
-		"rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0"	\
+		"rootfs${boot_bank},${rootfsaddr},${rootfssize}\"\0"	\
 	"addtty="							\
 		"setenv bootargs ${bootargs}"				\
 		" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0"	\
@@ -305,7 +305,7 @@
 	"flashargs="							\
 		"setenv bootargs "					\
 		"ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " "		\
-		"root=mtdblock:rootfs${actual_bank} "			\
+		"root=mtdblock:rootfs${boot_bank} "			\
 		"rootfstype=squashfs ro\0"				\
 	""
 
@@ -354,7 +354,7 @@
 		"cramfsload ${kernel_addr_r} uImage && "		\
 		"setenv actual_kernel_addr ${kernel_addr_r}\0"		\
 	"ubiattach=ubi part ${ubipartition}\0"				\
-	"ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0"		\
+	"ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0"		\
 	"ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0"		\
 	""
 
@@ -384,9 +384,10 @@
  * - 'default': setup default environment
  */
 #define CONFIG_KM_DEF_ENV_CONSTANTS					\
-	"actual=setenv actual_bank ${initial_boot_bank}\0"		\
-	"actual0=setenv actual_bank 0\0"				\
+	"actual=setenv boot_bank ${actual_bank}\0"			\
+	"backup=setenv boot_bank ${backup_bank}\0"			\
 	"actual_bank=${initial_boot_bank}\0"				\
+	"backup_bank=0\0"						\
 	"default="							\
 		"setenv default 'run newenv; reset' &&  "		\
 		"run release && saveenv; reset\0"			\
Signature · 1 line
1.7.0.5
#43 lore raw

PATCH 21/30 common/hush: make get_local_var visible for other users

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

---
 common/hush.c  |    3 +--
 include/hush.h |    1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
common/hush.c +1 -2
index 8021a68..85a6030 100644
@@ -497,7 +497,6 @@ static void remove_bg_job(struct pipe *pi);
 /*     local variable support */
 static char **make_list_in(char **inp, char *name);
 static char *insert_var_value(char *inp);
-static char *get_local_var(const char *var);
 
 #ifndef __U_BOOT__
 /* Table of built-in functions.  They can be forked or not, depending on
@@ -2169,7 +2168,7 @@ static char *get_dollar_var(char ch);
 #endif
 
 /* This is used to get/check local shell variables */
-static char *get_local_var(const char *s)
+char *get_local_var(const char *s)
 {
 	struct variables *cur;
 
include/hush.h +1 -0
index 0805ff3..5c566cc 100644
@@ -34,6 +34,7 @@ extern int parse_file_outer(void);
 
 int set_local_var(const char *s, int flg_export);
 void unset_local_var(const char *name);
+char *get_local_var(const char *s);
 
 #if defined(CONFIG_HUSH_INIT_VAR)
 extern int hush_init_var (void);
Signature · 1 line
1.7.0.5
#44 lore raw

PATCH 21/30 common/hush: make get_local_var visible for other users

Dear Valentin Longchamp,

Quoted 8 lines · In message <bcd3f91d4c8a00436c4eafa44b9cc3fa77e09063.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

What is the rationale for this change?

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
When a man sits with a pretty girl for  an  hour,  it  seems  like  a
minute.  But let him sit on a hot stove for a minute -- and it's lon-
ger than any hour. That's relativity.              -- Albert Einstein
#45 lore raw

PATCH 21/30 common/hush: make get_local_var visible for other users

Hello Wolfgang,

Quoted 5 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 2 lines · In message <bcd3f91d4c8a00436c4eafa44b9cc3fa77e09063.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

Quoted 8 lines
Quoted 6 lines

What is the rationale for this change?

We can actually only set from c-code local hush shell variables, with this patch we can also read them from c-code.

bye,
Heiko

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

PATCH 21/30 common/hush: make get_local_var visible for other users

Dear Heiko Schocher,

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

What is the rationale for this change?

We can actually only set from c-code local hush shell variables, with this patch we can also read them from c-code.

I see, thanks.

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
"The best index to a person's character is a) how  he  treats  people
who can't do him any good and b) how he treats people who can't fight
back."                                            - Abigail Van Buren
#47 lore raw

PATCH 22/30 km/common: implement setboardid as a command

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

Read out board id and HW key from the IVM eeprom and set these values as an environment variable was now done inside the code as a command.

---
 board/keymile/common/common.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
board/keymile/common/common.c +25 -0
index 9ec0022..5704b7f 100644
@@ -25,6 +25,7 @@
 #if defined(CONFIG_KM82XX)
 #include <mpc8260.h>
 #endif
+#include <command.h>
 #include <ioports.h>
 #include <malloc.h>
 #include <hush.h>
@@ -689,3 +690,27 @@ int board_eth_init(bd_t *bis)
 
 	return -1;
 }
+
+/*
+ * do_setboardid command
+ * read out the board id and the hw key from the intventory EEPROM and set
+ * this values as environment variables.
+ */
+static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
+				char *const argv[])
+{
+	unsigned char buf[32];
+	char *p;
+
+	p = get_local_var("IVM_BoardId");
+	sprintf((char *)buf, "%s", p);
+	setenv("boardid", (char *)buf);
+	p = get_local_var("IVM_HWKey");
+	sprintf((char *)buf, "%s", p);
+	setenv("hwkey", (char *)buf);
+	return 0;
+}
+
+U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and "
+				 "hwkey from IVM and set in environment");
+
Signature · 1 line
1.7.0.5
#48 lore raw

PATCH 22/30 km/common: implement setboardid as a command

Dear Valentin Longchamp,

Quoted 5 lines · In message <30d7413306aba80ca4540c3353d884bdffe9a643.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

Read out board id and HW key from the IVM eeprom and set these values as an environment variable was now done inside the code as a command.

This begs to ask: and how has it been done so far? Should this patch not remove some old code, then?

board/keymile/common/common.c int board_eth_init(bd_t *bis) · line 710

Quoted 10 lines
board/keymile/common/common.c +10 -0
+{
+	unsigned char buf[32];
+	char *p;
+
+	p = get_local_var("IVM_BoardId");
+	sprintf((char *)buf, "%s", p);
+	setenv("boardid", (char *)buf);
+	p = get_local_var("IVM_HWKey");
+	sprintf((char *)buf, "%s", p);
+	setenv("hwkey", (char *)buf);

get_local_var() will return NULL in some cases. Error handling missing.

board/keymile/common/common.c int board_eth_init(bd_t *bis) · line 711

Quoted 1 line
board/keymile/common/common.c +1 -0
+	return 0;

As is, the return 0 makes no sense, but I guess this will change when you add error handling.

Best regards,

Wolfgang Denk

Signature · 9 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 Empire didn't encourage its subjects to go far away, in case they
saw things that might disturb them. For the same reason it had  built
a  wall  around  the  entire country, patrolled by the Heavenly Guard
whose main function was to tread heavily on the fingers of any  inha-
bitants who felt they might like to step outside for five minutes for
a breath of fresh air.                      - Terry Pratchett, _Mort_
#49 lore raw

PATCH 22/30 km/common: implement setboardid as a command

Hi,

Quoted 12 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 5 lines · In message <30d7413306aba80ca4540c3353d884bdffe9a643.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

Read out board id and HW key from the IVM eeprom and set these values as an environment variable was now done inside the code as a command.

This begs to ask: and how has it been done so far? Should this patch not remove some old code, then?

Yes it does, we did it previously in the default environment. But this was an out of tree patch so far. Maybe I should adapt the commit message.

Quoted 5 lines
Quoted 5 lines
board/keymile/common/common.c +5 -0
+{
+	unsigned char buf[32];
+	char *p;
+
+	p = get_local_var("IVM_BoardId");
Quoted 9 lines

board/keymile/common/common.c int board_eth_init(bd_t *bis) · line 710

Quoted 5 lines
board/keymile/common/common.c +5 -0
+	sprintf((char *)buf, "%s", p);
+	setenv("boardid", (char *)buf);
+	p = get_local_var("IVM_HWKey");
+	sprintf((char *)buf, "%s", p);
+	setenv("hwkey", (char *)buf);

get_local_var() will return NULL in some cases. Error handling missing.

Ok.

Quoted 5 lines

board/keymile/common/common.c int board_eth_init(bd_t *bis) · line 711

Quoted 1 line
board/keymile/common/common.c +1 -0
+	return 0;

As is, the return 0 makes no sense, but I guess this will change when you add error handling.

Yes.

Thanks.

Best regards
Holger Brunck

#50 lore raw

PATCH 23/30 km/common: replace env var checkboardidlist by function

In reply to Valentin Longchamp

From: Thomas Herzmann <[email protected]>

The environment variable (defining a checkboardidlist function) has been replaced by a u-boot function call. This call is much faster and the environment is a leaner.

---
 board/keymile/common/common.c    |  112 ++++++++++++++++++++++++++++++++++++++
 include/configs/keymile-common.h |   30 +----------
 2 files changed, 113 insertions(+), 29 deletions(-)
board/keymile/common/common.c +112 -0
index 5704b7f..72278a0 100644
@@ -32,6 +32,7 @@
 #include <net.h>
 #include <netdev.h>
 #include <asm/io.h>
+#include <linux/ctype.h>
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
@@ -714,3 +715,114 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
 U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and "
 				 "hwkey from IVM and set in environment");
 
+/*
+ * command km_checkboardidlist
+ *	if "boardid" and "hwkey" are not already set in the environment, do:
+ *		if a "boardIdListHex" exists in the environment:
+ *			- read ivm data for boardid and hwkey
+ *			- compare each entry of the boardIdListHex with the
+ *				IVM data:
+ *			if match:
+ *				set environment variables boardid, boardId,
+ *				hwkey, hwKey to	the found values
+ *				both (boardid and boardId) are set because
+ *				they might be used differently in the
+ *				application and in the init scripts (?)
+ *	return 0 in case of match, 1 if not match or error
+ */
+int do_checkboardidlist(cmd_tbl_t *cmdtp, int flag, int argc,
+			char *const argv[])
+{
+	unsigned long ivmbid = 0, ivmhwkey = 0;
+	unsigned long envbid = 0, envhwkey = 0;
+	char *p;
+	int verbose = argc > 1 && *argv[1] == 'v';
+	int rc = 1;	/* default: no match */
+
+	p = get_local_var("IVM_BoardId");
+	strict_strtoul(p, 16, &ivmbid);
+	p = get_local_var("IVM_HWKey");
+	strict_strtoul(p, 16, &ivmhwkey);
+
+	if (!ivmbid || !ivmhwkey) {
+		printf("Error: IVM_BoardId and/or IVM_HWKey not set!\n");
+		return rc;
+	}
+
+	/* try to read values from environment */
+	p = getenv("boardid");
+	if (p != NULL)
+		strict_strtoul(p, 16, &envbid);
+	p = getenv("hwkey");
+	if (p != NULL)
+		strict_strtoul(p, 16, &envhwkey);
+
+	if (!envbid || !envhwkey) {
+		/* must set environment first */
+		char *bidhwklist = getenv("boardIdListHex");
+		if (bidhwklist) {
+			int found = 0;
+			char *rest = bidhwklist;
+			char *endp;
+			if (verbose) {
+				printf("IVM_BoardId: %ld, IVM_HWKey=%ld\n",
+					ivmbid, ivmhwkey);
+				printf("boardIdHwKeyList: %s\n",
+					bidhwklist);
+			}
+			while (!found) {
+				/* loop over each bid/hwkey pair in the list */
+				unsigned long bid   = 0;
+				unsigned long hwkey = 0;
+				while (*rest && !isxdigit(*rest))
+					rest++;
+				bid = simple_strtoul(rest, &endp, 16);
+				if (*endp == '_') {
+					rest  = endp + 1;
+					hwkey =	simple_strtoul(rest, &endp, 16);
+					rest  = endp;
+					while (*rest && !isxdigit(*rest))
+						rest++;
+				}
+				if ((!bid) || (!hwkey)) {
+					/* end of list */
+					break;
+				}
+				if (verbose) {
+					printf("trying bid=0x%lX, hwkey=%ld\n",
+						bid, hwkey);
+				}
+				if ((bid == ivmbid) && (hwkey == ivmhwkey)) {
+					char buf[10];
+
+					found = 1;
+					envbid   = bid;
+					envhwkey = hwkey;
+					sprintf(buf, "%lx", bid);
+					setenv("boardid", buf);
+					sprintf(buf, "%lx", hwkey);
+					setenv("hwkey", buf);
+					saveenv();
+				}
+			} /* end while( ! found ) */
+		}
+	}
+
+	/* compare now the values */
+	if ((ivmbid == envbid) && (ivmhwkey == envhwkey)) {
+		printf("boardid=0x%3lX, hwkey=%ld\n", envbid, envhwkey);
+		rc = 0;
+	} else {
+		printf("Error: env bId=0x%3lX, hwKey=%ld\n", envbid, envhwkey);
+		printf("       IVM bId=0x%3lX, hwKey=%ld\n", ivmbid, ivmhwkey);
+	}
+	return rc;
+}
+
+U_BOOT_CMD(km_checkbidhwk, 2, 0, do_checkboardidlist,
+		"check boardid and hwkey",
+		"[v]\n  - check environment parameter "\
+		"\"boardIdListHex\" against stored boardid and hwkey "\
+		"from the IVM\n    v: verbose output"
+);
+
include/configs/keymile-common.h +1 -29
index 5c32023..a6d3bcf 100644
@@ -240,7 +240,6 @@
 	"release="							\
 		"setenv actual_bank ${initial_boot_bank} && "		\
 		"setenv subbootcmds \""					\
-		"checkboardidlist "					\
 		"checkboardid "						\
 		"ubiattach ubicopy "					\
 		"cramfsloadfdt cramfsloadkernel "			\
@@ -391,36 +390,9 @@
 	"default="							\
 		"setenv default 'run newenv; reset' &&  "		\
 		"run release && saveenv; reset\0"			\
-	"checkboardidlist="						\
-		"if test \"x${boardIdListHex}\" != \"x\"; then "	\
-		"IVMbidhwk=${IVM_BoardId}_${IVM_HWKey}; "		\
-		"found=0; "						\
-		"for bidhwk in \"${boardIdListHex}\"; do "		\
-		"echo trying $bidhwk ...; "				\
-		"if test \"x$bidhwk\" = \"x$IVMbidhwk\"; then "		\
-		"found=1; "						\
-		"echo match found for $bidhwk; "			\
-		"if test \"x$bidhwk\" != \"x${boardId}_${hwKey}\";then "\
-			"setenv boardid ${IVM_BoardId}; "		\
-			"setenv boardId ${IVM_BoardId}; "		\
-			"setenv hwkey ${IVM_HWKey}; "			\
-			"setenv hwKey ${IVM_HWKey}; "			\
-			"echo \"boardId set to ${boardId}\"; "		\
-			"echo \"hwKey   set to ${hwKey}\"; "		\
-			"saveenv; "					\
-		"fi; "							\
-		"fi; "							\
-		"done; "						\
-		"else "							\
-			"echo \"boardIdListHex not set, not checked\"; "\
-			"found=1; "					\
-		"fi; "							\
-		"test \"$found\" = 1 \0"				\
-	"checkboardid="							\
-		"test \"x${boardId}\" = \"x${IVM_BoardId}\" && "	\
-		"test \"x${hwKey}\" = \"x${IVM_HWKey}\"\0"		\
 	"printbootargs=print bootargs\0"				\
 	"rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0"		\
+	"checkboardid=km_checkbidhwk\0"					\
 	""
 
 #ifndef CONFIG_KM_DEF_ENV
Signature · 1 line
1.7.0.5
#51 lore raw

PATCH 23/30 km/common: replace env var checkboardidlist by function

Dear Valentin Longchamp,

Quoted 5 lines · In message <e341fcb668eb67e1eb44ea638e96f9bb514c8bfb.1302272395.git.valentin.lo…

From: Thomas Herzmann <[email protected]>

The environment variable (defining a checkboardidlist function) has been replaced by a u-boot function call. This call is much faster and the environment is a leaner.

...

board/keymile/common/common.c static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc, · line 745

Quoted 4 lines
board/keymile/common/common.c +4 -0
+	p = get_local_var("IVM_BoardId");
+	strict_strtoul(p, 16, &ivmbid);
+	p = get_local_var("IVM_HWKey");
+	strict_strtoul(p, 16, &ivmhwkey);

Error handling missing.

Quoted 24 lines
board/keymile/common/common.c +24 -0
+			while (!found) {
+				/* loop over each bid/hwkey pair in the list */
+				unsigned long bid   = 0;
+				unsigned long hwkey = 0;
+				while (*rest && !isxdigit(*rest))
+					rest++;
+				bid = simple_strtoul(rest, &endp, 16);
+				if (*endp == '_') {
+					rest  = endp + 1;
+					hwkey =	simple_strtoul(rest, &endp, 16);
+					rest  = endp;
+					while (*rest && !isxdigit(*rest))
+						rest++;
+				}
+				if ((!bid) || (!hwkey)) {
+					/* end of list */
+					break;
+				}
+				if (verbose) {
+					printf("trying bid=0x%lX, hwkey=%ld\n",
+						bid, hwkey);
+				}
+				if ((bid == ivmbid) && (hwkey == ivmhwkey)) {
+					char buf[10];

board/keymile/common/common.c static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc, · line 806

Quoted 10 lines
board/keymile/common/common.c +10 -0
+
+					found = 1;
+					envbid   = bid;
+					envhwkey = hwkey;
+					sprintf(buf, "%lx", bid);
+					setenv("boardid", buf);
+					sprintf(buf, "%lx", hwkey);
+					setenv("hwkey", buf);
+					saveenv();
+				}

How well has this code been tested? I may not understand it correctly (which might be an indication that some comments are missing that actually explain what you are doing), or there might be some unhandled error cases.

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
HANDLE WITH EXTREME CARE:  This Product Contains  Minute Electrically
Charged  Particles  Moving  at  Velocities  in Excess of Five Hundred
Million Miles Per Hour.
#52 lore raw

PATCH 23/30 km/common: replace env var checkboardidlist by function

Hello,

Quoted 8 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 5 lines · In message <e341fcb668eb67e1eb44ea638e96f9bb514c8bfb.1302272395.git.valentin.lo…

From: Thomas Herzmann <[email protected]>

The environment variable (defining a checkboardidlist function) has been replaced by a u-boot function call. This call is much faster and the environment is a leaner.

Quoted 8 lines

...

board/keymile/common/common.c static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc, · line 745

Quoted 4 lines
board/keymile/common/common.c +4 -0
+	p = get_local_var("IVM_BoardId");
+	strict_strtoul(p, 16, &ivmbid);
+	p = get_local_var("IVM_HWKey");
+	strict_strtoul(p, 16, &ivmhwkey);

Error handling missing.

Ok.

Quoted 31 lines
Quoted 31 lines
board/keymile/common/common.c +31 -0
+			while (!found) {
+				/* loop over each bid/hwkey pair in the list */
+				unsigned long bid   = 0;
+				unsigned long hwkey = 0;
+				while (*rest && !isxdigit(*rest))
+					rest++;
+				bid = simple_strtoul(rest, &endp, 16);
+				if (*endp == '_') {
+					rest  = endp + 1;
+					hwkey =	simple_strtoul(rest, &endp, 16);
+					rest  = endp;
+					while (*rest && !isxdigit(*rest))
+						rest++;
+				}
+				if ((!bid) || (!hwkey)) {
+					/* end of list */
+					break;
+				}
+				if (verbose) {
+					printf("trying bid=0x%lX, hwkey=%ld\n",
+						bid, hwkey);
+				}
+				if ((bid == ivmbid) && (hwkey == ivmhwkey)) {
+					char buf[10];
+
+					found = 1;
+					envbid   = bid;
+					envhwkey = hwkey;
+					sprintf(buf, "%lx", bid);
+					setenv("boardid", buf);
+					sprintf(buf, "%lx", hwkey);
Quoted 9 lines

board/keymile/common/common.c static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc, · line 806

Quoted 3 lines
board/keymile/common/common.c +3 -0
+					setenv("hwkey", buf);
+					saveenv();
+				}

How well has this code been tested? I may not understand it correctly (which might be an indication that some comments are missing that actually explain what you are doing), or there might be some unhandled error cases.

It is tested on our boards. But indeed the commit message should be better to be able to understand the functionality. Additionaly we check if additionaly some error cases are not handled.

Best regards
Holger Brunck

#53 lore raw

PATCH 23/30 km/common: replace env var checkboardidlist by function

Dear Holger Brunck,

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

How well has this code been tested? I may not understand it correctly (which might be an indication that some comments are missing that actually explain what you are doing), or there might be some unhandled error cases.

It is tested on our boards. But indeed the commit message should be better to be able to understand the functionality. Additionaly we check if additionaly some error cases are not handled.

And please comment the _code_!

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
"Life, loathe it or ignore it, you can't like it."
- Marvin the paranoid android
#54 lore raw

PATCH 24/30 km/common: add pnvramsize to default environment

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

The pnvram size was used later from start scripts in linux. Therefore it must be set inside u-boot.

---
 board/keymile/common/common.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
board/keymile/common/common.c +3 -0
index 72278a0..da73f66 100644
@@ -100,6 +100,9 @@ int set_km_env(void)
 	sprintf((char *)buf, "0x%x", pnvramaddr);
 	setenv("pnvramaddr", (char *)buf);
 
+	sprintf((char *)buf, "0x%x", CONFIG_KM_PNVRAM);
+	setenv("pnvramsize", (char *)buf);
+
 	pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) /
 		0x400;
 	sprintf((char *)buf, "0x%x", pram);
Signature · 1 line
1.7.0.5
#55 lore raw

PATCH 24/30 km/common: add pnvramsize to default environment

Dear Valentin Longchamp,

Quoted 4 lines · In message <ba20e078a0b5ac55510f321b282dbff192ffba15.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

The pnvram size was used later from start scripts in linux. Therefore it must be set inside u-boot.

How does this work? A plain setenv() here just adds an entry to the hash table where U-Boot stores the variables. This data is not accessable in Linux ("start scripts in linux" being init scripts?)

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
For those who like this sort of thing, this is the sort of thing they
like.                                               - Abraham Lincoln
#56 lore raw

PATCH 24/30 km/common: add pnvramsize to default environment

Hi Mr. Denk,

Quoted 12 lines · Wolfgang Denk

Dear Valentin Longchamp,

Quoted 4 lines · In message <ba20e078a0b5ac55510f321b282dbff192ffba15.1302272395.git.valentin.lo…

From: Holger Brunck <[email protected]>

The pnvram size was used later from start scripts in linux. Therefore it must be set inside u-boot.

How does this work? A plain setenv() here just adds an entry to the hash table where U-Boot stores the variables. This data is not accessable in Linux ("start scripts in linux" being init scripts?)

Argh. Good catch. It actually works because we do initially one time a saveenv when we start a boot with the "release environment". But it isn't good to be dependent to a previously saveenv. I will remove it there and add this variable to the default environment.

Best regards
Holger Brunck

#57 lore raw

PATCH 25/30 km/common: fix coding style issues in generic header

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

---
 include/configs/keymile-common.h |    4 ++--
 include/configs/km_arm.h         |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
include/configs/keymile-common.h +2 -2
index a6d3bcf..b313b2e 100644
@@ -86,7 +86,7 @@
 #define CONFIG_SYS_HZ			1000	/* decr. freq: 1 ms ticks */
 
 #define CONFIG_BAUDRATE			115200
-#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200, 230400 }
+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
 
 #define CONFIG_LOADS_ECHO
 #define CONFIG_SYS_LOADS_BAUD_CHANGE
@@ -425,6 +425,6 @@
 	""
 #endif /* CONFIG_KM_DEF_ENV */
 
-#define CONFIG_VERSION_VARIABLE 	/* include version env variable */
+#define CONFIG_VERSION_VARIABLE	/* include version env variable */
 
 #endif /* __CONFIG_KEYMILE_H */
include/configs/km_arm.h +5 -5
index 06f91fe..0148b24 100644
@@ -110,7 +110,7 @@
 #define CONFIG_BOOTMAPSZ	(8 << 20)	/* Initial Memmap for Linux */
 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs  */
 #define CONFIG_INITRD_TAG		/* enable INITRD tag */
-#define CONFIG_SETUP_MEMORY_TAGS 	/* enable memory tag */
+#define CONFIG_SETUP_MEMORY_TAGS	/* enable memory tag */
 
 /*
  * Commands configuration
@@ -185,10 +185,10 @@
 #ifndef __ASSEMBLY__
 #include <asm/arch-kirkwood/gpio.h>
 extern void __set_direction(unsigned pin, int high);
-void set_sda (int state);
-void set_scl (int state);
-int get_sda (void);
-int get_scl (void);
+void set_sda(int state);
+void set_scl(int state);
+int get_sda(void);
+int get_scl(void);
 #define KM_KIRKWOOD_SDA_PIN	8
 #define KM_KIRKWOOD_SCL_PIN	9
 #define KM_KIRKWOOD_ENV_WP	38
Signature · 1 line
1.7.0.5
#58 lore raw

PATCH 26/30 arm, powerpc, keymile boards: move keymile specific header in subdir

In reply to Valentin Longchamp

From: Heiko Schocher <[email protected]>

Collect all keymile specific common headers in include/configs/km.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Kim Phillips <[email protected]>
cc Valentin Longchamp <[email protected]>
cc Holger Brunck <[email protected]>
---
 include/configs/{ => km}/keymile-common.h |    0
 include/configs/{ => km}/km-powerpc.h     |    0
 include/configs/{ => km}/km82xx-common.h  |    0
 include/configs/{ => km}/km8321-common.h  |    0
 include/configs/{ => km}/km83xx-common.h  |    0
 include/configs/{ => km}/km_arm.h         |    0
 include/configs/kmeter1.h                 |    2 +-
 include/configs/kmsupx5.h                 |    2 +-
 include/configs/mgcoge.h                  |    6 +++---
 include/configs/mgcoge2un.h               |    2 +-
 include/configs/mgcoge3ne.h               |    6 +++---
 include/configs/suen3.h                   |    2 +-
 include/configs/suen8.h                   |    2 +-
 include/configs/suvd3.h                   |    2 +-
 include/configs/tuda1.h                   |    2 +-
 include/configs/tuxa1.h                   |    2 +-
 16 files changed, 14 insertions(+), 14 deletions(-)
 rename include/configs/{ => km}/keymile-common.h (100%)
 rename include/configs/{ => km}/km-powerpc.h (100%)
 rename include/configs/{ => km}/km82xx-common.h (100%)
 rename include/configs/{ => km}/km8321-common.h (100%)
 rename include/configs/{ => km}/km83xx-common.h (100%)
 rename include/configs/{ => km}/km_arm.h (100%)
include/configs/km/keymile-common.h renamed from include/configs/keymile-common.h +0 -0
similarity index 100%
rename from include/configs/keymile-common.h
rename to include/configs/km/keymile-common.h
include/configs/km/km-powerpc.h renamed from include/configs/km-powerpc.h +0 -0
similarity index 100%
rename from include/configs/km-powerpc.h
rename to include/configs/km/km-powerpc.h
include/configs/km/km82xx-common.h renamed from include/configs/km82xx-common.h +0 -0
similarity index 100%
rename from include/configs/km82xx-common.h
rename to include/configs/km/km82xx-common.h
include/configs/km/km8321-common.h renamed from include/configs/km8321-common.h +0 -0
similarity index 100%
rename from include/configs/km8321-common.h
rename to include/configs/km/km8321-common.h
include/configs/km/km83xx-common.h renamed from include/configs/km83xx-common.h +0 -0
similarity index 100%
rename from include/configs/km83xx-common.h
rename to include/configs/km/km83xx-common.h
include/configs/km/km_arm.h renamed from include/configs/km_arm.h +0 -0
similarity index 100%
rename from include/configs/km_arm.h
rename to include/configs/km/km_arm.h
include/configs/kmeter1.h +1 -1
index 2fcecaf..8639ddd 100644
@@ -34,7 +34,7 @@
 	"netdev=eth2\0"		\
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+#include "km/km83xx-common.h"
 
 #define CONFIG_MISC_INIT_R
 /*
include/configs/kmsupx5.h +1 -1
index 55ed3f6..f8cd8e0 100644
@@ -36,7 +36,7 @@
 #define	CONFIG_SYS_TEXT_BASE	0xF0000000
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+#include "km/km8321-common.h"
 
 /*
  * Init Local Bus Memory Controller:
include/configs/mgcoge.h +3 -3
index 0745855..b736c56 100644
@@ -37,8 +37,8 @@
 #define	CONFIG_SYS_TEXT_BASE	0xFE000000
 
 /* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
-#include "km-powerpc.h"
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
 
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
 #define CONFIG_SYS_FLASH_BASE		0xFE000000
@@ -88,6 +88,6 @@
 #define CONFIG_KM_BOARD_EXTRA_ENV	""
 
 /* include further common stuff for all keymile 82xx boards */
-#include "km82xx-common.h"
+#include "km/km82xx-common.h"
 
 #endif /* __CONFIG_H */
include/configs/mgcoge2un.h +1 -1
index d3c7bdc..6256035 100644
@@ -35,7 +35,7 @@
 #define _CONFIG_MGCOGE2UN_H
 
 /* include common defines/options for all arm based Keymile boards */
-#include "km_arm.h"
+#include "km/km_arm.h"
 
 /*
  * Version number information
include/configs/mgcoge3ne.h +3 -3
index 78ce468..027754a 100644
@@ -37,8 +37,8 @@
 #define	CONFIG_SYS_TEXT_BASE	0xFE000000
 
 /* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
-#include "km-powerpc.h"
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
 
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
 #define CONFIG_SYS_FLASH_BASE		0xFE000000
@@ -92,6 +92,6 @@
 #define CONFIG_KM_BOARD_EXTRA_ENV	"bobcatreset=true\0"
 
 /* include further common stuff for all keymile 82xx boards */
-#include "km82xx-common.h"
+#include "km/km82xx-common.h"
 
 #endif /* __MGCOGE3NE */
include/configs/suen3.h +1 -1
index 2b6f19e..aa4d778 100644
@@ -34,7 +34,7 @@
 #define _CONFIG_SUEN3_H
 
 /* include common defines/options for all arm based Keymile boards */
-#include "km_arm.h"
+#include "km/km_arm.h"
 
 /*
  * Version number information
include/configs/suen8.h +1 -1
index 3f60bc3..b680dfb 100644
@@ -35,7 +35,7 @@
 #define _CONFIG_SUEN8_H
 
 /* include common defines/options for all arm based Keymile boards */
-#include "km_arm.h"
+#include "km/km_arm.h"
 
 /*
  * Version number information
include/configs/suvd3.h +1 -1
index d9eb201..0b59d51 100644
@@ -30,7 +30,7 @@
 #define	CONFIG_SYS_TEXT_BASE	0xF0000000
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+#include "km/km8321-common.h"
 
 #define CONFIG_SYS_APP1_BASE		0xA0000000
 #define	CONFIG_SYS_APP1_SIZE		256 /* Megabytes */
include/configs/tuda1.h +1 -1
index 1c0b3e0..853c00a 100644
@@ -33,7 +33,7 @@
 #define	CONFIG_SYS_TEXT_BASE	0xF0000000
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+#include "km/km8321-common.h"
 
 #define CONFIG_SYS_APP1_BASE	0xA0000000    /* PAXG */
 #define	CONFIG_SYS_APP1_SIZE	256 /* Megabytes */
include/configs/tuxa1.h +1 -1
index 012db96..ceeb5a3 100644
@@ -33,7 +33,7 @@
 #define	CONFIG_SYS_TEXT_BASE	0xF0000000
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+#include "km/km8321-common.h"
 
 #define	CONFIG_SYS_LPXF_BASE		0xA0000000    /* LPXF */
 #define	CONFIG_SYS_LPXF_SIZE		256 /* Megabytes */
Signature · 1 line
1.7.0.5
#59 lore raw

PATCH 27/30 km/common: simplify default environment

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

This is a first step to simplify the default environment. Move all the environment variables which are only needed for debugging purpose to textfiles in the scripts directory. In case of debugging these files can be loaded via tftp into RAM and set via the env import command. Other variables are identified as obsolete and were removed.

---
 board/keymile/scripts/README               |   25 ++++++
 board/keymile/scripts/debug-arm-env.txt    |    2 +
 board/keymile/scripts/debug-common-env.txt |    9 ++
 board/keymile/scripts/debug-ppc-env.txt    |    2 +
 include/configs/km/keymile-common.h        |  128 +++-------------------------
 include/configs/km/km-powerpc.h            |   12 +--
 include/configs/km/km_arm.h                |    5 +-
 7 files changed, 57 insertions(+), 126 deletions(-)
 create mode 100644 board/keymile/scripts/README
 create mode 100644 board/keymile/scripts/debug-arm-env.txt
 create mode 100644 board/keymile/scripts/debug-common-env.txt
 create mode 100644 board/keymile/scripts/debug-ppc-env.txt
board/keymile/scripts/README new file +25 -0
new file mode 100644
index 0000000..ce6d79a
@@ -0,0 +1,25 @@
+debug-common-env.txt
+============================
+This file defines environment variables which are valid for powerpc boards
+and for arm boards.
+
+addramfs: add phram device for the rootfilesysten in ram
+develop: for development, laod kernel via tftp and mount  rootfs via NFS
+nfsargs: default arguments for nfs boot
+ramfs: load rootfilesystem in RAM  kernel
+rootfsfile: loacation of the rootfs file for ramfs
+setramfspram: compute PRAM size for ramfs target
+setrootfsaddr: compute rootfilesystem address for phram
+tftpkernel: load a kernel with tftp into ram
+tftpramfs: load rootfs with tftp into ram
+
+debug-ppc-env.txt
+============================
+fdt_file: location of the dtb file on the tftp server
+tftpfdt: load dtb file and set fdt address
+
+debug-arm-env.txt
+============================
+tftpfdt: for arm only a dummy variable, because we have no fdt on arm
+
+
board/keymile/scripts/debug-arm-env.txt new file +2 -0
new file mode 100644
index 0000000..84498af
@@ -0,0 +1,2 @@
+debug_env_common=tftpboot 0x200000 scripts/debug-common-env.txt && env import -t 0x200000 ${filesize}
+tftpfdt=true
board/keymile/scripts/debug-common-env.txt new file +9 -0
new file mode 100644
index 0000000..1fd4b0c
@@ -0,0 +1,9 @@
+addramfs=setenv bootargs "${bootargs} phram.phram=rootfs${boot_bank},${rootfsaddr},${rootfssize}"
+develop=setenv subbootcmds "tftpfdt tftpkernel nfsargs ${commonargs} boot " && setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && km_setboardid && saveenv && reset
+nfsargs=setenv bootargs ubi.mtd=ubi0 root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
+ramfs=setenv actual_bank -1 && setenv subbootcmds "tftpfdt tftpkernel setrootfsaddr tftpramfs flashargs ${commonargs} addpanic addramfs boot " && setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && run setboardid && run setramfspram && run setpnvramaddr && saveenv && reset
+rootfsfile=${hostname}/rootfsImage
+setramfspram=setexpr value 0 + ${reservedpram} && setexpr value 0x${value} + ${rootfssize} && setexpr value 0x${value} + ${varsize} && setexpr value 0x${value} + ${pnvramsize} && setexpr value 0x${value} / 0x400 && setenv pram 0x${value}
+tftpkernel=tftpboot ${kernel_addr_r} ${hostname}/uImage && setenv actual_kernel_addr ${kernel_addr_r}
+tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage && setenv loadaddr
+setrootfsaddr=setexpr value ${pnvramsize} - ${rootfssize} && setenv rootfsaddr 0x${value}
board/keymile/scripts/debug-ppc-env.txt new file +2 -0
new file mode 100644
index 0000000..3c06ff1
@@ -0,0 +1,2 @@
+debug_env_common=tftpboot 0x200000 scripts/debug-common-env.txt && env import -t 0x200000 ${filesize}
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb && setenv actual_fdt_addr ${fdt_addr_r}
include/configs/km/keymile-common.h +13 -115

221 lines not on this page · raw message

include/configs/km/km-powerpc.h +4 -8
index 3351609..d6db8d7 100644
@@ -67,20 +67,14 @@
 #define CONFIG_KM_FDT_ADDR	0x7E0000	/* 128Kbytes */
 
 #define CONFIG_KM_DEF_ENV_CPU						\
-	"addbootcount=echo \\\\c\0"					\
-	"addmtdparts=echo \\\\c\0"					\
+	"addbootcount=true\0"						\
+	"addmtdparts=true\0"						\
 	"boot=bootm ${actual_kernel_addr} - ${actual_fdt_addr}\0"	\
 	"cramfsloadfdt="						\
 		"cramfsload ${fdt_addr_r} "				\
 		"fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb && "		\
 		"setenv actual_fdt_addr ${fdt_addr_r}\0"		\
 	"fdt_addr_r=" xstr(CONFIG_KM_FDT_ADDR) "\0"			\
-	"fdt_file="							\
-		xstr(CONFIG_HOSTNAME) "/"				\
-		xstr(CONFIG_HOSTNAME) ".dtb\0"				\
-	"tftpfdt="							\
-		"tftpboot ${fdt_addr_r} ${fdt_file} && "		\
-		"setenv actual_fdt_addr ${fdt_addr_r} \0"		\
 	"update="							\
 		"protect off " xstr(BOOTFLASH_START) " +${filesize} && "\
 		"erase " xstr(BOOTFLASH_START) "  +${filesize} && "	\
@@ -89,4 +83,6 @@
 		"protect on " xstr(BOOTFLASH_START) "  +${filesize}\0"  \
 	""
 
+#define CONFIG_KM_ARCH_DBG_FILE		"scripts/debug-ppc-env.txt"
+
 #endif /* __CONFIG_KEYMILE_POWERPC_H */
include/configs/km/km_arm.h +2 -3
index 0148b24..33a8678 100644
@@ -69,12 +69,11 @@
 		"bootcountaddr=${bootcountaddr}\0"			\
 	"addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0"		\
 	"boot=bootm ${actual_kernel_addr} - -\0"			\
-	"cramfsloadfdt=echo \\\\c\0"					\
-	"tftpfdt=echo \\\\c\0"						\
+	"cramfsloadfdt=true\0"						\
 	CONFIG_KM_DEF_ENV_UPDATE					\
 	""
 
-
+#define CONFIG_KM_ARCH_DBG_FILE		"scripts/debug-arm-env.txt"
 
 #define CONFIG_MD5	/* get_random_hex on krikwood needs MD5 support */
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
Signature · 1 line
1.7.0.5
#60 lore raw

PATCH 28/30 arm/km: rename mgcoge2un to mgcoge3un

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

The mgcoge2un target was only an intermediate step to mgcoge3un. For this reason the mgcoge2un support was moved to mgcoge3un, because it isn't needed to support both targets.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
---
 MAINTAINERS                                  |    2 +-
 boards.cfg                                   |    2 +-
 include/configs/{mgcoge2un.h => mgcoge3un.h} |   10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)
 rename include/configs/{mgcoge2un.h => mgcoge3un.h} (92%)
MAINTAINERS +1 -1
index 37e03c9..7fb778f 100644
@@ -430,7 +430,7 @@ Heiko Schocher <[email protected]>
 	kmsupx5		MPC8321
 	mgcoge		MPC8247
 	mgcoge3ne	MPC8247
-	mgcoge2un	ARM926EJS (Kirkwood SoC)
+	mgcoge3un	ARM926EJS (Kirkwood SoC)
 	mucmc52		MPC5200
 	muas3001	MPC8270
 	municse		MPC5200
boards.cfg +1 -1
index f6105be..6c5400e 100644
@@ -95,7 +95,7 @@ davinci_sffsdr               arm         arm926ejs   sffsdr              davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 suen3                        arm         arm926ejs   km_arm              keymile        kirkwood
 suen8                        arm         arm926ejs   km_arm              keymile        kirkwood
-mgcoge2un                    arm         arm926ejs   km_arm              keymile        kirkwood
+mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   -                   Marvell        kirkwood
include/configs/mgcoge3un.h renamed from include/configs/mgcoge2un.h +5 -5
similarity index 92%
rename from include/configs/mgcoge2un.h
rename to include/configs/mgcoge3un.h
index 6256035..da5935b 100644
@@ -31,8 +31,8 @@
 /* for linking errors see
  * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
 
-#ifndef _CONFIG_MGCOGE2UN_H
-#define _CONFIG_MGCOGE2UN_H
+#ifndef _CONFIG_MGCOGE3UN_H
+#define _CONFIG_MGCOGE3UN_H
 
 /* include common defines/options for all arm based Keymile boards */
 #include "km/km_arm.h"
@@ -40,9 +40,9 @@
 /*
  * Version number information
  */
-#define CONFIG_IDENT_STRING	"\nKeymile MGCOGE2UN"
-
-#define CONFIG_HOSTNAME			mgcoge2un
+#define CONFIG_IDENT_STRING	"\nKeymile MGCOGE3UN"
+#define CONFIG_HOSTNAME		mgcoge3un
+#define CONFIG_MGCOGE3UN
 
 #define KM_IVM_BUS	"pca9547:70:9" /* I2C2 (Mux-Port 1)*/
 #define KM_ENV_BUS	"pca9547:70:d" /* I2C2 (Mux-Port 5)*/
Signature · 1 line
1.7.0.5
#61 lore raw

PATCH 29/30 arm/km: change default settings for egiga on mgcoge3un

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

The reason we need this is that we have the gig port on mgcoge3un connected using a back-to-back pair of PHYs. There are no magnetics and because of that the port has to be run with a fixd configuration and auto-negotiation must be disabled. In the default mode the egiga driver uses autoneg to determine port speed - which defaults to 1G (we need 100M full duplex).

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
---
 drivers/net/mvgbe.h         |    2 ++
 include/configs/mgcoge3un.h |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
drivers/net/mvgbe.h +2 -0
index 3de98d0..d8a5429 100644
@@ -84,6 +84,7 @@
 	MVGBE_TX_BURST_SIZE_16_64BIT)
 
 /* Default port serial control value */
+#ifndef PORT_SERIAL_CONTROL_VALUE
 #define PORT_SERIAL_CONTROL_VALUE		( \
 	MVGBE_FORCE_LINK_PASS			| \
 	MVGBE_DIS_AUTO_NEG_FOR_DUPLX		| \
@@ -101,6 +102,7 @@
 	MVGBE_CLR_EXT_LOOPBACK			| \
 	MVGBE_SET_FULL_DUPLEX_MODE		| \
 	MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX)
+#endif
 
 /* Tx WRR confoguration macros */
 #define PORT_MAX_TRAN_UNIT	0x24	/* MTU register (default) 9KByte */
include/configs/mgcoge3un.h +25 -0
index da5935b..c7f9056 100644
@@ -48,6 +48,31 @@
 #define KM_ENV_BUS	"pca9547:70:d" /* I2C2 (Mux-Port 5)*/
 
 /*
+ * mgcoge3un has a fixed link to the marvell switch
+ * with 100MB full duplex and autoneg off, for this
+ * reason we have to change the default settings
+ */
+#define PORT_SERIAL_CONTROL_VALUE		( \
+	MVGBE_FORCE_LINK_PASS			| \
+	MVGBE_DIS_AUTO_NEG_FOR_DUPLX		| \
+	MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL	| \
+	MVGBE_ADV_NO_FLOW_CTRL			| \
+	MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX	| \
+	MVGBE_FORCE_BP_MODE_NO_JAM		| \
+	(1 << 9) /* Reserved bit has to be 1 */	| \
+	MVGBE_DO_NOT_FORCE_LINK_FAIL		| \
+	MVGBE_DIS_AUTO_NEG_SPEED_GMII		| \
+	MVGBE_DTE_ADV_0				| \
+	MVGBE_MIIPHY_MAC_MODE			| \
+	MVGBE_AUTO_NEG_NO_CHANGE		| \
+	MVGBE_MAX_RX_PACKET_1552BYTE		| \
+	MVGBE_CLR_EXT_LOOPBACK			| \
+	MVGBE_SET_FULL_DUPLEX_MODE		| \
+	MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX	|\
+	MVGBE_SET_GMII_SPEED_TO_10_100	|\
+	MVGBE_SET_MII_SPEED_TO_100)
+
+/*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS					\
Signature · 1 line
1.7.0.5
#62 lore raw

PATCH 30/30 arm/km: update mgcoge3un board support

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

Add wait for the GPIO line connected to mgcoge3ne before starting mgcoge3un. A board specific ethernet present function was added, because on this board ethernet is always present. The BOCO FPGA access was enhanced and changed to use register definitions.

cc Wolfgang Denk <[email protected]>
cc Detlev Zundel <[email protected]>
cc Prafulla Wadaskar <[email protected]>
cc Valentin Longchamp <[email protected]>
---
 board/keymile/km_arm/km_arm.c |   80 +++++++++++++++++++++++++++++++++-------
 1 files changed, 66 insertions(+), 14 deletions(-)
board/keymile/km_arm/km_arm.c +66 -14
index a64cdd8..0b4d75b 100644
@@ -41,6 +41,16 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * BOCO FPGA definitions
+ */
+#define BOCO		0x10
+#define REG_CTRL_H		0x02
+#define MASK_WRL_UNITRUN	0x01
+#define MASK_RBX_PGY_PRESENT	0x40
+#define REG_IRQ_CIRQ2		0x2d
+#define MASK_RBI_DEFECT_16	0x01
+
 /* Multi-Purpose Pins Functionality configuration */
 u32 kwmpp_config[] = {
 	MPP0_NF_IO2,
@@ -102,43 +112,64 @@ u32 kwmpp_config[] = {
 	0
 };
 
+#if defined(CONFIG_MGCOGE3UN)
+/*
+ * Wait for startup OK from mgcoge3ne
+ */
+int startup_allowed(void)
+{
+	unsigned char buf;
+
+	/*
+	 * Read CIRQ16 bit (bit 0)
+	 */
+	if (i2c_read(BOCO, REG_IRQ_CIRQ2, 1, &buf, 1) != 0)
+		printf("%s: Error reading Boco\n", __func__);
+	else
+		if ((buf & MASK_RBI_DEFECT_16) == MASK_RBI_DEFECT_16)
+			return 1;
+	return 0;
+}
+
+/*
+ * mgcoge3un has always ethernet present. Its connected to the 6061 switch
+ * and provides ICNev and piggy4 connections.
+ */
+int ethernet_present(void)
+{
+	return 1;
+}
+#else
 int ethernet_present(void)
 {
 	uchar	buf;
 	int	ret = 0;
 
-	if (i2c_read(0x10, 2, 1, &buf, 1) != 0) {
+	if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
 		printf("%s: Error reading Boco\n", __func__);
 		return -1;
 	}
-	if ((buf & 0x40) == 0x40)
+	if ((buf & MASK_RBX_PGY_PRESENT) == MASK_RBX_PGY_PRESENT)
 		ret = 1;
 
 	return ret;
 }
+#endif
 
 int initialize_unit_leds(void)
 {
 	/*
-	 * init the unit LEDs
-	 * per default they all are
+	 * Init the unit LEDs per default they all are
 	 * ok apart from bootstat
-	 * LED connected through BOCO
-	 * BOCO	lies at the address  0x10
-	 * LEDs are in the block CTRL_H	(addr 0x02)
-	 * BOOTSTAT LED is the first 0x01
 	 */
-	#define BOCO        0x10
-	#define CTRL_H      0x02
-	#define APPLEDMASK  0x01
 	uchar buf;
 
-	if (i2c_read(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+	if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
 		printf("%s: Error reading Boco\n", __func__);
 		return -1;
 	}
-	buf |= APPLEDMASK;
-	if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+	buf |= MASK_WRL_UNITRUN;
+	if (i2c_write(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
 		printf("%s: Error writing Boco\n", __func__);
 		return -1;
 	}
@@ -156,6 +187,27 @@ int misc_init_r(void)
 		printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
 		gd->bd->bi_arch_number = mach_type;
 	}
+#if defined(CONFIG_MGCOGE3UN)
+	char *wait_for_ne;
+	wait_for_ne = getenv("waitforne");
+	if (wait_for_ne != NULL) {
+		if (strcmp(wait_for_ne, "true") == 0) {
+			int cnt = 0;
+			puts("NE go: ");
+			while (startup_allowed() == 0) {
+				udelay(200000);
+				cnt++;
+				if (cnt == 5)
+					puts("wait\b\b\b\b");
+				if (cnt == 10) {
+					cnt = 0;
+					puts("    \b\b\b\b");
+				}
+			}
+			puts("OK\n");
+		}
+	}
+#endif
 
 	initialize_unit_leds();
 	set_km_env();
Signature · 1 line
1.7.0.5
#63 lore raw

cover Keymile boards mainlining, part 2 (resend)

In reply to Valentin Longchamp

Hello,

Quoted 7 lines · Valentin Longchamp

This series is the second effort of merging the Keymile boards support back into mainline.

Most of the patches are only keymile relevant and should only affect our boards.

There are also patches for the i2c deblocking support and cramfs for ARM.

We have split the whole series so that it gets easier to apply through the various trees:

1) the i2c patches were sent by Heiko and already applied
2) lib, vsprintf: introduce strict_strtoul and cramfs: make cramfs usable without a NOR flash are (or already have been) resent as standalone patches
3) Holger is going to send a series for km82xx changes
4) Holger is going to send a series with the keymile changes
5) I will send a series with the ARM/marvell changes

I hope this will simplify the review and merging of these patches into mainline.

Best Regards

Valentin

Quoted 116 lines

The whole series is based on current denx-master with the our first patch series posted by Heiko that was reviewed previous weeks and should still be merged during the current merge window:

http://lists.denx.de/pipermail/u-boot/2011-April/089530.html

Heiko Schocher (5):
lib, vsprintf: introduce strict_strtoul
arm/km: add CRAMFS support for keymile boards
cramfs: make cramfs usable without a NOR flash
i2c, soft_i2c: deblock bus if switching to another i2c bus arm, powerpc, keymile boards: move keymile specific header in subdir

Holger Brunck (18):
km/common: remove hdlc_enet implementation powerpc/km82xx: cleanup coding style for mgcoge.c powerpc/km82xx: rename mgcoge files to km82xx powerpc/km82xx: move SDRAM config to board config powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support poweprc/km82xx: add board specific environment variable arm/km: add addbootcount environment variable arm/km: remove last_stage_init and unneeded printouts arm/km: add second serial interface for kirkwood common/hush: make get_local_var visible for other users km/common: implement setboardid as a command km/common: add pnvramsize to default environment km/common: fix coding style issues in generic header km/common: simplify default environment
arm/km: rename mgcoge2un to mgcoge3un
arm/km: change default settings for egiga on mgcoge3un arm/km: update mgcoge3un board support

Huber, Andreas (1):
powerpc/km82xx: add DIP switch detection

Stefan Bigler (1):
i2c: add i2c deblock sequence before and after every mux config

Thomas Herzmann (2):
km/common: fix initial_boot_bank for bootpackages km/common: replace env var checkboardidlist by function

Valentin Longchamp (3):
arm/km: add mkimage config file for uart download arm/km: add BootROM config files for memphis SDRAM arm/km: disable ls (through jffs2 support)

 MAINTAINERS                                    |    4 +-
 board/keymile/common/common.c                  |  156 ++++++-
 board/keymile/common/common.h                  |   84 +++-
 board/keymile/common/keymile_hdlc_enet.c       |  620 ------------------------
 board/keymile/{mgcoge => km82xx}/Makefile      |    3 +-
 board/keymile/km82xx/km82xx.c                  |  373 ++++++++++++++
 board/keymile/km_arm/km_arm.c                  |   93 +++-
 board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 ++++++++
 board/keymile/km_arm/kwbimage-memphis.cfg      |  197 ++++++++
 board/keymile/km_arm/kwbimage-uart.cfg         |  179 +++++++
 board/keymile/mgcoge/mgcoge.c                  |  333 -------------
 board/keymile/mgcoge/mgcoge_hdlc_enet.c        |  276 -----------
 board/keymile/scripts/README                   |   25 +
 board/keymile/scripts/debug-arm-env.txt        |    2 +
 board/keymile/scripts/debug-common-env.txt     |    9 +
 board/keymile/scripts/debug-ppc-env.txt        |    2 +
 boards.cfg                                     |    6 +-
 common/cmd_cramfs.c                            |   12 +-
 common/cmd_i2c.c                               |   12 +
 common/hush.c                                  |    3 +-
 drivers/i2c/soft_i2c.c                         |    1 +
 drivers/net/mvgbe.h                            |    2 +
 fs/cramfs/cramfs.c                             |    4 +
 include/_exports.h                             |    1 +
 include/common.h                               |    1 +
 include/configs/{ => km}/keymile-common.h      |  175 +------
 include/configs/{ => km}/km-powerpc.h          |   12 +-
 include/configs/{ => km}/km82xx-common.h       |   29 +-
 include/configs/{ => km}/km8321-common.h       |    0
 include/configs/{ => km}/km83xx-common.h       |    0
 include/configs/{ => km}/km_arm.h              |   25 +-
 include/configs/kmeter1.h                      |    2 +-
 include/configs/kmsupx5.h                      |    2 +-
 include/configs/mgcoge.h                       |   35 ++-
 include/configs/{mgcoge2ne.h => mgcoge3ne.h}   |   57 ++-
 include/configs/{mgcoge2un.h => mgcoge3un.h}   |   37 ++-
 include/configs/suen3.h                        |    2 +-
 include/configs/suen8.h                        |    2 +-
 include/configs/suvd3.h                        |    2 +-
 include/configs/tuda1.h                        |    2 +-
 include/configs/tuxa1.h                        |    2 +-
 include/exports.h                              |    1 +
 include/hush.h                                 |    1 +
 include/i2c.h                                  |    2 -
 lib/vsprintf.c                                 |   47 ++
 45 files changed, 1531 insertions(+), 1499 deletions(-)
 delete mode 100644 board/keymile/common/keymile_hdlc_enet.c
 rename board/keymile/{mgcoge => km82xx}/Makefile (94%)
 create mode 100644 board/keymile/km82xx/km82xx.c
 create mode 100644 board/keymile/km_arm/kwbimage-memphis-uart.cfg
 create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg
 create mode 100644 board/keymile/km_arm/kwbimage-uart.cfg
 delete mode 100644 board/keymile/mgcoge/mgcoge.c
 delete mode 100644 board/keymile/mgcoge/mgcoge_hdlc_enet.c
 create mode 100644 board/keymile/scripts/README
 create mode 100644 board/keymile/scripts/debug-arm-env.txt
 create mode 100644 board/keymile/scripts/debug-common-env.txt
 create mode 100644 board/keymile/scripts/debug-ppc-env.txt
 rename include/configs/{ => km}/keymile-common.h (63%)
 rename include/configs/{ => km}/km-powerpc.h (91%)
 rename include/configs/{ => km}/km82xx-common.h (93%)
 rename include/configs/{ => km}/km8321-common.h (100%)
 rename include/configs/{ => km}/km83xx-common.h (100%)
 rename include/configs/{ => km}/km_arm.h (93%)
 rename include/configs/{mgcoge2ne.h => mgcoge3ne.h} (57%)
 rename include/configs/{mgcoge2un.h => mgcoge3un.h} (65%)
Signature · 13 lines
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax   +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner