Skip to contentSkip to conversation

Board support series for the eXMeritus HWW-1U-1A

PATCH Superseded Kyle Moffett 4 participants 15 messages Mar 15, 2011 – Mar 31, 2011 PowerPC

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Board support series for the eXMeritus HWW-1U-1A

This is the latest respin of the eXMeritus HWW-1U-1A board support patches, rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

As Wolfgang NAKed the more involved reset rework, I've moved the patch for a simple board-specific restart hook back into this series.

I believe these 4 patches are ready to be merged, as all concerns presented so far have been addressed.

Cheers,
Kyle Moffett

#1 lore raw

PATCH v6 1/4 mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements

The numeric constants in the switch statements are replaced by #defines added to the common ddr_spd.h header. This dramatically improves the readability of the switch statments.

In addition, a few of the longer lines were cleaned up, and the DDR2 type for an SO-RDIMM module was added to the DDR2 switch statement.

Cc Andy Fleming <[email protected]>
Cc Kumar Gala <[email protected]>
Cc Kim Phillips <[email protected]>

---
Changelog:
v2: Moved the constants to include/ddr_spd.h and also fixed DDR3
v3: No changes
v4: Fixed up excessively long lines
v5: No changes
v6: Rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

 arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c |   23 +++++++-----
 arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |   43 ++++++++++------------
 common/ddr_spd.c                                |    2 +-
 include/ddr_spd.h                               |   28 ++++++++++-----
 4 files changed, 53 insertions(+), 43 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c +13 -10
index dcb37ce..b565e33 100644
@@ -250,24 +250,27 @@ ddr_compute_dimm_parameters(const ddr2_spd_eeprom_t *spd,
 	pdimm->primary_sdram_width = spd->primw;
 	pdimm->ec_sdram_width = spd->ecw;
 
-	/* FIXME: what about registered SO-DIMM? */
+	/* These are all the types defined by the JEDEC DDR2 SPD 1.3 spec */
 	switch (spd->dimm_type) {
-	case 0x01:	/* RDIMM */
-	case 0x10:	/* Mini-RDIMM */
-		pdimm->registered_dimm = 1; /* register buffered */
+	case DDR2_SPD_DIMMTYPE_RDIMM:
+	case DDR2_SPD_DIMMTYPE_72B_SO_RDIMM:
+	case DDR2_SPD_DIMMTYPE_MINI_RDIMM:
+		/* Registered/buffered DIMMs */
+		pdimm->registered_dimm = 1;
 		break;
 
-	case 0x02:	/* UDIMM */
-	case 0x04:	/* SO-DIMM */
-	case 0x08:	/* Micro-DIMM */
-	case 0x20:	/* Mini-UDIMM */
-		pdimm->registered_dimm = 0;	/* unbuffered */
+	case DDR2_SPD_DIMMTYPE_UDIMM:
+	case DDR2_SPD_DIMMTYPE_SO_DIMM:
+	case DDR2_SPD_DIMMTYPE_MICRO_DIMM:
+	case DDR2_SPD_DIMMTYPE_MINI_UDIMM:
+		/* Unbuffered DIMMs */
+		pdimm->registered_dimm = 0;
 		break;
 
+	case DDR2_SPD_DIMMTYPE_72B_SO_CDIMM:
 	default:
 		printf("unknown dimm_type 0x%02X\n", spd->dimm_type);
 		return 1;
-		break;
 	}
 
 	/* SDRAM device parameters */
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +20 -23

60 lines not on this page · raw message

common/ddr_spd.c +1 -1
index a7a30de..7a388bb 100644
@@ -18,7 +18,7 @@ spd_check(const u8 *buf, u8 spd_rev, u8 spd_cksum)
 
 	/*
 	 * Check SPD revision supported
-	 * Rev 1.2 or less supported by this code
+	 * Rev 1.X or less supported by this code
 	 */
 	if (spd_rev >= 0x20) {
 		printf("SPD revision %02X not supported by this code\n",
include/ddr_spd.h +19 -9
index 710e528..e895d61 100644
@@ -304,14 +304,24 @@ extern unsigned int ddr3_spd_check(const ddr3_spd_eeprom_t *spd);
 #define SPD_MEMTYPE_DDR2_FBDIMM_PROBE	(0x0A)
 #define SPD_MEMTYPE_DDR3	(0x0B)
 
-/*
- * Byte 3 Key Byte / Module Type for DDR3 SPD
- */
-#define SPD_MODULETYPE_RDIMM		(0x01)
-#define SPD_MODULETYPE_UDIMM		(0x02)
-#define SPD_MODULETYPE_SODIMM		(0x03)
-#define SPD_MODULETYPE_MICRODIMM	(0x04)
-#define SPD_MODULETYPE_MINIRDIMM	(0x05)
-#define SPD_MODULETYPE_MINIUDIMM	(0x06)
+/* DIMM Type for DDR2 SPD (according to v1.3) */
+#define DDR2_SPD_DIMMTYPE_UNDEFINED	(0x00)
+#define DDR2_SPD_DIMMTYPE_RDIMM		(0x01)
+#define DDR2_SPD_DIMMTYPE_UDIMM		(0x02)
+#define DDR2_SPD_DIMMTYPE_SO_DIMM	(0x04)
+#define DDR2_SPD_DIMMTYPE_72B_SO_CDIMM	(0x06)
+#define DDR2_SPD_DIMMTYPE_72B_SO_RDIMM	(0x07)
+#define DDR2_SPD_DIMMTYPE_MICRO_DIMM	(0x08)
+#define DDR2_SPD_DIMMTYPE_MINI_RDIMM	(0x10)
+#define DDR2_SPD_DIMMTYPE_MINI_UDIMM	(0x20)
+
+/* Byte 3 Key Byte / Module Type for DDR3 SPD */
+#define DDR3_SPD_MODULETYPE_MASK	(0x0f)
+#define DDR3_SPD_MODULETYPE_RDIMM	(0x01)
+#define DDR3_SPD_MODULETYPE_UDIMM	(0x02)
+#define DDR3_SPD_MODULETYPE_SO_DIMM	(0x03)
+#define DDR3_SPD_MODULETYPE_MICRO_DIMM	(0x04)
+#define DDR3_SPD_MODULETYPE_MINI_RDIMM	(0x05)
+#define DDR3_SPD_MODULETYPE_MINI_UDIMM	(0x06)
 
 #endif /* _DDR_SPD_H_ */
Signature · 1 line
1.7.2.3
Applied
#2 lore raw

PATCH v6 1/4 mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements

Quoted 20 lines · Kyle Moffett

The numeric constants in the switch statements are replaced by #defines added to the common ddr_spd.h header. This dramatically improves the readability of the switch statments.

In addition, a few of the longer lines were cleaned up, and the DDR2 type for an SO-RDIMM module was added to the DDR2 switch statement.

Cc Andy Fleming <[email protected]>
Cc Kumar Gala <[email protected]>
Cc Kim Phillips <[email protected]>

---
Changelog:
v2: Moved the constants to include/ddr_spd.h and also fixed DDR3
v3: No changes
v4: Fixed up excessively long lines
v5: No changes
v6: Rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

Quoted 5 lines
arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c |   23 +++++++-----
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |   43 ++++++++++------------
common/ddr_spd.c                                |    2 +-
include/ddr_spd.h                               |   28 ++++++++++-----
4 files changed, 53 insertions(+), 43 deletions(-)

applied to 85xx next

- k

#3 lore raw

PATCH v6 2/4 mpc85xx: Add inline GPIO acessor functions

In reply to Kyle Moffett

To ease the implementation of other MPC85xx board ports, several common GPIO helpers are added to <asm/mpc85xx_gpio.h>.

Since each of these compiles to no more than 4-5 instructions it would be very inefficient to call them out of line, therefore we put them entirely in the header file.

The HWW-1U-1A board port which these were written for strongly prefers to set multiple GPIOs as a single batch operation, so the API is designed around that basis.

To assist other board ports, a small set of wrappers are used which provides a standard gpio_request() interface around the MPC85xx-specific functions. This can be enabled with CONFIG_MPC85XX_GENERIC_GPIO

Cc Andy Fleming <[email protected]>
Cc Kumar Gala <[email protected]>
Cc Peter Tyser <[email protected]>

---
Changelog:
v2: Moved the inline functions to a non-board-specific header
v3: Added generic Linux-standard GPIO wrappers
v4: Improved comments and fixed minor bugs in the wrapper functions
v5: No changes
v6: Rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

 arch/powerpc/include/asm/mpc85xx_gpio.h |  120 +++++++++++++++++++++++++++++++
 1 files changed, 120 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/include/asm/mpc85xx_gpio.h
arch/powerpc/include/asm/mpc85xx_gpio.h new file +120 -0
new file mode 100644
index 0000000..ad54b4e
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2010 eXMeritus, A Boeing Company
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <asm/immap_85xx.h>
+
+/*
+ * The following internal functions are an MPC85XX-specific GPIO API which
+ * allows setting and querying multiple GPIOs in a single operation.
+ *
+ * All of these look relatively large, but the arguments are almost always
+ * constants, so they compile down to just a few instructions and a
+ * memory-mapped IO operation or two.
+ */
+static inline void mpc85xx_gpio_set(unsigned int mask,
+		unsigned int dir, unsigned int val)
+{
+	ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00);
+
+	/* First mask off the unwanted parts of "dir" and "val" */
+	dir &= mask;
+	val &= mask;
+
+	/* Now read in the values we're supposed to preserve */
+	dir |= (in_be32(&gpio->gpdir) & ~mask);
+	val |= (in_be32(&gpio->gpdat) & ~mask);
+
+	/*
+	 * Poke the new output values first, then set the direction.  This
+	 * helps to avoid transient data when switching from input to output
+	 * and vice versa.
+	 */
+	out_be32(&gpio->gpdat, val);
+	out_be32(&gpio->gpdir, dir);
+}
+
+static inline void mpc85xx_gpio_set_in(unsigned int gpios)
+{
+	mpc85xx_gpio_set(gpios, 0x00000000, 0x00000000);
+}
+
+static inline void mpc85xx_gpio_set_low(unsigned int gpios)
+{
+	mpc85xx_gpio_set(gpios, 0xFFFFFFFF, 0x00000000);
+}
+
+static inline void mpc85xx_gpio_set_high(unsigned int gpios)
+{
+	mpc85xx_gpio_set(gpios, 0xFFFFFFFF, 0xFFFFFFFF);
+}
+
+static inline unsigned int mpc85xx_gpio_get(unsigned int mask)
+{
+	ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00);
+
+	/* Read the requested values */
+	return in_be32(&gpio->gpdat) & mask;
+}
+
+/*
+ * These implement the generic Linux GPIO API on top of the other functions
+ * in this header.
+ */
+#ifdef CONFIG_MPC85XX_GENERIC_GPIO
+static inline int gpio_request(unsigned gpio, const char *label)
+{
+	/* Compatibility shim */
+	return 0;
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+	/* Compatibility shim */
+}
+
+static inline int gpio_direction_input(unsigned gpio)
+{
+	mpc85xx_gpio_set_in(1U << gpio);
+	return 0;
+}
+
+static inline int gpio_direction_output(unsigned gpio, int value)
+{
+	mpc85xx_gpio_set_low(1U << gpio);
+	return 0;
+}
+
+static inline int gpio_get_value(unsigned gpio)
+{
+	return !!mpc85xx_gpio_get(1U << gpio)
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+	if (value)
+		mpc85xx_gpio_set_high(1U << gpio);
+	else
+		mpc85xx_gpio_set_low(1U << gpio);
+}
+
+static inline int gpio_is_valid(int gpio)
+{
+	return (gpio >= 0) && (gpio < 32);
+}
+#endif /* CONFIG_MPC85XX_GENERIC_GPIO */
Signature · 1 line
1.7.2.3
#4 lore raw

PATCH v6 3/4 mpc85xx: Add a board-specific restart hook

In reply to Kyle Moffett

The HWW-1U-1A board needs to be able to override the "reset" command due to hardware design limitations.

Cc Andy Fleming <[email protected]>
Cc Kumar Gala <[email protected]>

---
Changelog:
v2: Removed in favor of more involved reset rework
v6: Resurrected again (the more involved rework was NAKed)

 arch/powerpc/cpu/mpc85xx/cpu.c |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu.c +22 -5
index 49ea6cc..75e4aab 100644
@@ -203,11 +203,17 @@ int checkcpu (void)
 
 /* ------------------------------------------------------------------------- */
 
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+/* Board-specific reset stub */
+__attribute__((__weak__))
+int __board_restart(void)
 {
-/* Everything after the first generation of PQ3 parts has RSTCR */
+	return 0;
+}
+
 #if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
     defined(CONFIG_MPC8555) || defined(CONFIG_MPC8560)
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
 	unsigned long val, msr;
 
 	/*
@@ -221,14 +227,25 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	val = mfspr(DBCR0);
 	val |= 0x70000000;
 	mtspr(DBCR0,val);
+}
 #else
-	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	/* Everything after the first generation of PQ3 parts has RSTCR */
+	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+	/* Allow boards to override the reset */
+	int err = __board_restart();
+	if (err)
+		return err;
+
 	out_be32(&gur->rstcr, 0x2);	/* HRESET_REQ */
 	udelay(100);
-#endif
-
 	return 1;
 }
+#endif
+
+
 
 
 /*
Signature · 1 line
1.7.2.3
#5 lore raw

PATCH v6 3/4 mpc85xx: Add a board-specific restart hook

Dear Kyle Moffett,

Quoted 6 lines · In message <[email protected]> you…

The HWW-1U-1A board needs to be able to override the "reset" command due to hardware design limitations.

Cc Andy Fleming <[email protected]>
Cc Kumar Gala <[email protected]>

Please run checkpatch on your submissions!

arch/powerpc/cpu/mpc85xx/cpu.c int checkcpu (void) · line 217

Quoted 5 lines
 #if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
     defined(CONFIG_MPC8555) || defined(CONFIG_MPC8560)
arch/powerpc/cpu/mpc85xx/cpu.c +2 -0
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
 	unsigned long val, msr;

WARNING: space prohibited between function name and open parenthesis '(' #114: FILE: arch/powerpc/cpu/mpc85xx/cpu.c:215:
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

arch/powerpc/cpu/mpc85xx/cpu.c int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 233

Quoted 3 lines
arch/powerpc/cpu/mpc85xx/cpu.c +2 -1
-	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{

WARNING: space prohibited between function name and open parenthesis '(' #126: FILE: arch/powerpc/cpu/mpc85xx/cpu.c:232:
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

arch/powerpc/cpu/mpc85xx/cpu.c int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 248

Quoted 3 lines
arch/powerpc/cpu/mpc85xx/cpu.c +3 -0
+#endif
+
+

Please don't add trailing empty lines.

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
Humanity has the  stars  in  its  future,  and  that  future  is  too
important  to be lost under the burden of juvenile folly and ignorant
superstition.                                          - Isaac Asimov
#6 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

In reply to Kyle Moffett

The eXMeritus HWW-1U-1A unit is a DO-160-certified 13lb 1U chassis with 3 independent TEMPEST zones. Two independent P2020 computers may be found inside each zone. Complete hardware support is included.

High-level hardware overview:
* DO-160 certified for passenger aircraft (noncritical)
* TEMPEST ceritified for RED/BLACK separation
* 3 zones per chassis, 2 computers per zone (total of 6)
* Dual-core 1.066GHz P2020 per computer
* One 2GB DDR2 SO-RDIMM module per computer (upgradable to 4GB)
* Removable 80GB or 160GB Intel X18-M SSD per computer
* Front-accessible dual-port E1000E per computer
* Front-accessible serial console per computer
* Front-accessible USB port per computer
* Internal Gigabit crossover within each TEMPEST zone
* Internal unidirectional fiber links across TEMPEST zones
* Battery-backed DS1339 I2C RTC on each CPU.

Combined, each 13lb 1U chassis contains 12GB RAM, 12 cores @ 1.066GHz, 12 front-accessible Gigabit Ethernet ports and 960GB of solid-state storage with a total power consumption of ~200W.

Additional notes:
* SPD detection is only known to work with the DO-160-certified DIMMs

* A U-Boot built with 36-bit address-space seems to work, but I don't yet have a usable 36-bit kernel or DTB, so it's mostly untested.

* CPU reset is a little quirky due to hardware misfeature, see the extensive comments in the board_reset() function in hww1u1a.c

Cc Andy Fleming <[email protected]>
Cc Kumar Gala <[email protected]>
---
 MAINTAINERS                       |    4 +
 board/exmeritus/hww1u1a/Makefile  |   54 ++++
 board/exmeritus/hww1u1a/ddr.c     |   34 +++
 board/exmeritus/hww1u1a/gpios.h   |   67 +++++
 board/exmeritus/hww1u1a/hww1u1a.c |  543 +++++++++++++++++++++++++++++++++++++
 board/exmeritus/hww1u1a/law.c     |   34 +++
 board/exmeritus/hww1u1a/tlb.c     |  106 +++++++
 boards.cfg                        |    2 +
 include/configs/HWW1U1A.h         |  474 ++++++++++++++++++++++++++++++++
 9 files changed, 1318 insertions(+), 0 deletions(-)
 create mode 100644 board/exmeritus/hww1u1a/Makefile
 create mode 100644 board/exmeritus/hww1u1a/ddr.c
 create mode 100644 board/exmeritus/hww1u1a/gpios.h
 create mode 100644 board/exmeritus/hww1u1a/hww1u1a.c
 create mode 100644 board/exmeritus/hww1u1a/law.c
 create mode 100644 board/exmeritus/hww1u1a/tlb.c
 create mode 100644 include/configs/HWW1U1A.h
MAINTAINERS +4 -0
index 4756f14..6644baf 100644
@@ -320,6 +320,10 @@ Reinhard Meyer <[email protected]>
 	TOP5200		MPC5200
 	TOP9000		ARM926EJS (AT91SAM9xxx SoC)
 
+Kyle Moffett <[email protected]>
+
+	HWW1U1A		P2020
+
 Tolunay Orkun <[email protected]>
 
 	csb272		PPC405GP
board/exmeritus/hww1u1a/Makefile new file +54 -0

54 lines not on this page · raw message

board/exmeritus/hww1u1a/ddr.c new file +34 -0
new file mode 100644
index 0000000..36d02ad
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2009-2010 eXMeritus, A Boeing Company
+ * Copyright 2008-2009 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include <common.h>
+
+#include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
+
+void fsl_ddr_board_options(memctl_options_t *popts,
+				dimm_params_t *pdimm,
+				unsigned int ctrl_num)
+{
+	/*
+	 * We only support one DIMM, so according to the P2020 docs we should
+	 * set the options as follows:
+	 */
+	popts->cs_local_opts[0].odt_rd_cfg = 0;
+	popts->cs_local_opts[0].odt_wr_cfg = 4;
+	popts->cs_local_opts[1].odt_rd_cfg = 0;
+	popts->cs_local_opts[1].odt_wr_cfg = 0;
+	popts->half_strength_driver_enable = 0;
+
+	/* Manually configured for our static clock rate */
+	popts->clk_adjust = 4;
+	popts->cpo_override = 4;
+	popts->write_data_delay = 2;
+	popts->twoT_en = 0;
+}
board/exmeritus/hww1u1a/gpios.h new file +67 -0

67 lines not on this page · raw message

board/exmeritus/hww1u1a/hww1u1a.c new file +543 -0

543 lines not on this page · raw message

board/exmeritus/hww1u1a/law.c new file +34 -0
new file mode 100644
index 0000000..1281c56
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008-2009 Freescale Semiconductor, Inc.
+ *
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, [email protected].
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/fsl_law.h>
+#include <asm/mmu.h>
+
+struct law_entry law_table[] = {
+	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+};
+
+int num_law_entries = ARRAY_SIZE(law_table);
board/exmeritus/hww1u1a/tlb.c new file +106 -0

106 lines not on this page · raw message

boards.cfg +2 -0
index 45c3102..743e016 100644
@@ -487,6 +487,8 @@ sbc8560                      powerpc     mpc85xx     sbc8560             -
 sbc8560_33                   powerpc     mpc85xx     sbc8560             -              -           sbc8560
 sbc8560_66                   powerpc     mpc85xx     sbc8560             -              -           sbc8560
 socrates                     powerpc     mpc85xx     socrates
+HWW1U1A                      powerpc     mpc85xx     hww1u1a             exmeritus
+HWW1U1A_36BIT                powerpc     mpc85xx     hww1u1a             exmeritus      -           HWW1U1A:36BIT
 MPC8536DS                    powerpc     mpc85xx     mpc8536ds           freescale      -           MPC8536DS
 MPC8536DS_36BIT              powerpc     mpc85xx     mpc8536ds           freescale      -           MPC8536DS:36BIT
 MPC8536DS_NAND               powerpc     mpc85xx     mpc8536ds           freescale      -           MPC8536DS:NAND
include/configs/HWW1U1A.h new file +474 -0

474 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#7 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

Dear Kyle Moffett,

Quoted 3 lines · In message <[email protected]> you…

The eXMeritus HWW-1U-1A unit is a DO-160-certified 13lb 1U chassis with 3 independent TEMPEST zones. Two independent P2020 computers may be found inside each zone. Complete hardware support is included.

Please run checkpatch on your submissions!

...

board/exmeritus/hww1u1a/hww1u1a.c line 102

Quoted 4 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +4 -0
+	/* Ok, now go ahead and program all of those in one go */
+	mpc85xx_gpio_set(	gpio_high|gpio_low|gpio_in,
+				gpio_high|gpio_low,
+				gpio_high);

ERROR: space prohibited after that open parenthesis '(' #427: FILE: board/exmeritus/hww1u1a/hww1u1a.c:100:
+ mpc85xx_gpio_set( gpio_high|gpio_low|gpio_in,

board/exmeritus/hww1u1a/hww1u1a.c line 110

Quoted 7 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +7 -0
+	/*
+	 * If things have been taken out of reset early (for example, by one
+	 * of the BDI3000 debuggers), then we need to put them back in reset
+	 * and delay a while before we continue.
+	 */
+#define GPIO_RESETS (GPIO_DIMM_RESET|GPIO_USB_RESET|GPIO_GETH0_RESET)
+	if (mpc85xx_gpio_get(GPIO_RESETS)) {

Please don;t add #defines right in the middle of the code.

board/exmeritus/hww1u1a/hww1u1a.c line 136

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+/*
+ * This little shell function just returns whether or not it's CPU A.
+ * It can be used to select the right device-tree when booting, etc.
+ */
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

WARNING: line over 80 characters
#463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

board/exmeritus/hww1u1a/hww1u1a.c line 150

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+U_BOOT_CMD(
+	hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
+	"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
+	/*  */" && <command-if-true>\n"
+	"hww1u1a_test_cpu_a || <command-if-false>\n"

What is this empty comment needed for?

board/exmeritus/hww1u1a/hww1u1a.c line 202

Quoted 4 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +4 -0
+	/* Now the serial# part of the hostname */
+	for (j = 0; serialnr[j]; j++)
+		if (isalnum(serialnr[j]))
+			hww1u1a_prompt[i++] = tolower(serialnr[j]);

Braces needed for multiline statements.

...

board/exmeritus/hww1u1a/hww1u1a.c line 499

Quoted 6 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +6 -0
+		/* Turn on the "HRESET_REQ" pin (hard-reset request) */
+		printf("\nRESET: Hardware reset triggered, waiting...\n");
+		out_be32(&gur->rstcr, 0x2);
+		while (1)
+			udelay(10000);
+	}

Should that not be an infinite wait here?

...

include/configs/HWW1U1A.h line 297

Quoted 3 lines
include/configs/HWW1U1A.h new file +3 -0
+/* Enable the U-Boot "memory test" */
+#define CONFIG_SYS_MEMTEST_START 0x00000000
+#define CONFIG_SYS_MEMTEST_END   0x7fffffff

I think this has not been tested, right?

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
News is what a chap who doesn't care much  about  anything  wants  to
read. And it's only news until he's read it. After that it's dead.
                           - Evelyn Waugh _Scoop_ (1938) bk. 1, ch. 5
#8 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

Wolfgang,

Thanks for your detailed reviews!

Once I get these last few style issues resolved, what more do I need to do to get this merged? I don't really want to spam the list with more nearly identical copies of these patches unless I'm sure that all the necessary review items have been taken care of.

Quoted 6 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you…

The eXMeritus HWW-1U-1A unit is a DO-160-certified 13lb 1U chassis with 3 independent TEMPEST zones. Two independent P2020 computers may be found inside each zone. Complete hardware support is included.

Please run checkpatch on your submissions!

I did run it on this patch, although I forgot to run it on the resurrected reset patch (which is also now fixed). It's a common gripe on the LKML that the tool is overzealous about certain warnings in cases where the "fix" makes the code less readable.

Specifically:

Quoted 9 lines

...

board/exmeritus/hww1u1a/hww1u1a.c line 102

Quoted 4 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +4 -0
+	/* Ok, now go ahead and program all of those in one go */
+	mpc85xx_gpio_set(	gpio_high|gpio_low|gpio_in,
+				gpio_high|gpio_low,
+				gpio_high);

ERROR: space prohibited after that open parenthesis '(' #427: FILE: board/exmeritus/hww1u1a/hww1u1a.c:100:
+ mpc85xx_gpio_set( gpio_high|gpio_low|gpio_in,

I could "fix" this code to read:

        mpc85xx_gpio_set(gpio_high|gpio_low|gpio_in,
                                gpio_high|gpio_low, gpio_high);

And it would be much harder to visually compare the three bitmask arguments against each other.

Quoted 9 lines

board/exmeritus/hww1u1a/hww1u1a.c line 110

Quoted 7 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +7 -0
+	/*
+	 * If things have been taken out of reset early (for example, by one
+	 * of the BDI3000 debuggers), then we need to put them back in reset
+	 * and delay a while before we continue.
+	 */
+#define GPIO_RESETS (GPIO_DIMM_RESET|GPIO_USB_RESET|GPIO_GETH0_RESET)
+	if (mpc85xx_gpio_get(GPIO_RESETS)) {

Please don;t add #defines right in the middle of the code.

Fixed, thanks!

Quoted 9 lines

board/exmeritus/hww1u1a/hww1u1a.c line 136

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+/*
+ * This little shell function just returns whether or not it's CPU A.
+ * It can be used to select the right device-tree when booting, etc.
+ */
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

WARNING: line over 80 characters
#463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

This one is only a warning, and it's much more readable to have 1 84-character line than split it across 2 different lines. Even still, this warning is only issued if you pass "--subjective" to checkpatch, which is documented to "enable more subjective tests". This thread discusses it further:
http://lkml.org/lkml/2009/12/15/490

Quoted 7 lines

board/exmeritus/hww1u1a/hww1u1a.c line 150

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+U_BOOT_CMD(
+	hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
+	"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
+	/*  */" && <command-if-true>\n"
+	"hww1u1a_test_cpu_a || <command-if-false>\n"

What is this empty comment needed for?

Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts the name of the command in that spot. Will remove.

Quoted 6 lines

board/exmeritus/hww1u1a/hww1u1a.c line 202

Quoted 4 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +4 -0
+	/* Now the serial# part of the hostname */
+	for (j = 0; serialnr[j]; j++)
+		if (isalnum(serialnr[j]))
+			hww1u1a_prompt[i++] = tolower(serialnr[j]);

Braces needed for multiline statements.

Fixed, thanks!

Quoted 8 lines

board/exmeritus/hww1u1a/hww1u1a.c line 499

Quoted 6 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +6 -0
+		/* Turn on the "HRESET_REQ" pin (hard-reset request) */
+		printf("\nRESET: Hardware reset triggered, waiting...\n");
+		out_be32(&gur->rstcr, 0x2);
+		while (1)
+			udelay(10000);
+	}

Should that not be an infinite wait here?

At this point if the board does not reset due to hardware failure it's better off hanging than silently falling through.

Quoted 5 lines

include/configs/HWW1U1A.h line 297

Quoted 3 lines
include/configs/HWW1U1A.h new file +3 -0
+/* Enable the U-Boot "memory test" */
+#define CONFIG_SYS_MEMTEST_START 0x00000000
+#define CONFIG_SYS_MEMTEST_END   0x7fffffff

I think this has not been tested, right?

I'm pretty sure it's been tested, but not very recently; the memory on all the shipped units is ECC anyways.

Cheers,
Kyle Moffett

#9 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

Dear "Moffett, Kyle D",

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

WARNING: line over 80 characters
#463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * c=

onst argv[])

This one is only a warning, and it's much more readable to have 1 84-charac=

In U-Boot, it is considered to be an ERROR.

Quoted 3 lines

ter line than split it across 2 different lines. Even still, this warning = is only issued if you pass "--subjective" to checkpatch, which is documente= d to "enable more subjective tests". This thread discusses it further:

No, I get this warning without such flags. The command I run is just "checkpatch.pl --no-tree"

BTW - could you please restrict your line length to some 70 characters or so? Thanks.

Quoted 10 lines
Quoted 7 lines

board/exmeritus/hww1u1a/hww1u1a.c line 150

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+U_BOOT_CMD(
+	hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
+	"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
+	/*  */" && <command-if-true>\n"
+	"hww1u1a_test_cpu_a || <command-if-false>\n"

=20
What is this empty comment needed for?

Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts th= e name of the command in that spot. Will remove.

We don't provide usage examples in the help text. This should be fixed in the first place.

Quoted 11 lines
Quoted 8 lines

board/exmeritus/hww1u1a/hww1u1a.c line 499

Quoted 6 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +6 -0
+		/* Turn on the "HRESET_REQ" pin (hard-reset request) */
+		printf("\nRESET: Hardware reset triggered, waiting...\n");
+		out_be32(&gur->rstcr, 0x2);
+		while (1)
+			udelay(10000);
+	}

=20
Should that not be an infinite wait here?

At this point if the board does not reset due to hardware failure it's bett= er off hanging than silently falling through.

Why don't you simply call "hang()" then?

Quoted 8 lines
Quoted 5 lines

include/configs/HWW1U1A.h line 297

Quoted 3 lines
include/configs/HWW1U1A.h new file +3 -0
+/* Enable the U-Boot "memory test" */
+#define CONFIG_SYS_MEMTEST_START 0x00000000
+#define CONFIG_SYS_MEMTEST_END   0x7fffffff

=20
I think this has not been tested, right?

I'm pretty sure it's been tested, but not very recently; the memory on all = the shipped units is ECC anyways.

I guess testing it would reveal that it crashes your system because you are overwriting the exception vectors.

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
Madness has no purpose.  Or reason.  But it may have a goal.
	-- Spock, "The Alternative Factor", stardate 3088.7
#10 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

Quoted 10 lines · Wolfgang Denk
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines

WARNING: line over 80 characters
#463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

This one is only a warning, and it's much more readable to have 1 84-charac

In U-Boot, it is considered to be an ERROR.

Just looking at the last ~200 commits (actually 187, because it ignores merges):

$ git format-patch -o recent-patches -200 origin/master
$ ./checkpatch.pl --no-tree --strict recent-patches/* >checkpatch.log 2>&1
$ grep 'over 80 char' checkpatch.log | wc -l
130

That's 130 lines in the last 200 patches which are over 80 characters?!?! How are those patches any different from mine?

$ grep '^ERROR:' checkpatch.log | wc -l
113

And that's 113 HARD ERRORS from checkpatch!?!?!

Of those, 32 are "Missing Signed-off-by: line(s)", 20 are "macros with complex values should be enclosed in parenthesis", 19 are inconsistent or missing whitespace issues, 4 are "(foo*) instead of "(foo *)", 3 are invalid UTF-8 errors, 4 are "return is not a function" errors, etc, etc.

Look, I'm really trying to comply with U-Boot coding standards, but I'm really of pissed off about the inconsistent requirements you are applying to my patches versus a lot of other things that YOU ARE MERGING on a regular basis.

So why are you picking on my board-specific code so hard here? This is extremely frustrating for me and a strong deterrent against us *ever* contributing to U-Boot again in the future.

Quoted 6 lines
Quoted 3 lines

ter line than split it across 2 different lines. Even still, this warning is only issued if you pass "--subjective" to checkpatch, which is documented to "enable more subjective tests".

No, I get this warning without such flags. The command I run is just "checkpatch.pl --no-tree"

What version of checkpatch are you running? I copied version 0.31 out of my latest Linux kernel tree, which identical to the latest version from here:

http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/

If U-Boot policy is to run checkpatch then you'd better either specify a particular version and command-line options or be willing to accept the default output of the latest version.

Quoted 2 lines

BTW - could you please restrict your line length to some 70 characters or so? Thanks.

Sorry about that, sending email through an Exchange server is no fun :-(. Hopefully I've got it fixed.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

board/exmeritus/hww1u1a/hww1u1a.c line 150

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+U_BOOT_CMD(
+	hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
+	"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
+	/*  */" && <command-if-true>\n"
+	"hww1u1a_test_cpu_a || <command-if-false>\n"

=20
What is this empty comment needed for?

Quoted 5 lines
Quoted 2 lines

Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts the name of the command in that spot. Will remove.

We don't provide usage examples in the help text. This should be fixed in the first place.

This *IS* the help text, and not a sample usage. This is visually and effectively no different from this text in common/cmd_mp.c:

U_BOOT_CMD(
cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd,
"Multiprocessor CPU boot manipulation and release",
"<num> reset - Reset cpu <num>\n"
"cpu <num> status - Status of cpu <num>\n"
"cpu <num> disable - Disable cpu <num>\n"
"cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"

#ifdef CPU_ARCH_HELP
        "\n"
        CPU_ARCH_HELP

#endif
);

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

board/exmeritus/hww1u1a/hww1u1a.c line 499

Quoted 6 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +6 -0
+		/* Turn on the "HRESET_REQ" pin (hard-reset request) */
+		printf("\nRESET: Hardware reset triggered, waiting...\n");
+		out_be32(&gur->rstcr, 0x2);
+		while (1)
+			udelay(10000);
+	}

Should that not be an infinite wait here?

Quoted 4 lines
Quoted 2 lines

At this point if the board does not reset due to hardware failure it's better off hanging than silently falling through.

Why don't you simply call "hang()" then?

Didn't know it existed at the time the code was written. Will fix.

Cheers,
Kyle Moffett

#11 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

Dear "Moffett, Kyle D",

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

Just looking at the last ~200 commits (actually 187, because it ignores mer= ges):

$ git format-patch -o recent-patches -200 origin/master
$ ./checkpatch.pl --no-tree --strict recent-patches/* >checkpatch.log 2>&1
$ grep 'over 80 char' checkpatch.log | wc -l
130

That's 130 lines in the last 200 patches which are over 80 characters?!?! How are those patches any different from mine?

The difference is: They were not detected.

Patches welcome.

Quoted 5 lines

Look, I'm really trying to comply with U-Boot coding standards, but I'm rea= lly
of pissed off about the inconsistent requirements you are applying to my patches versus a lot of other things that YOU ARE MERGING on a regular basi= s.

The requirements are NOT inconsistent. It's just that nobody is perfect, and nobody ever claimed that we manage to get 100% of review coverage.

Quoted 1 line

So why are you picking on my board-specific code so hard here? This is

It's just that the problems got noticed.

Quoted 5 lines
Quoted 1 line

"checkpatch.pl --no-tree"

What version of checkpatch are you running? I copied version 0.31 out of my latest Linux kernel tree, which identical to the latest version from here:

-> checkpatch.pl --version
Usage: checkpatch.pl [OPTION]... [FILE]...
Version: 0.31
...

Quoted 3 lines

If U-Boot policy is to run checkpatch then you'd better either specify a particular version and command-line options or be willing to accept the default output of the latest version.

I don't see any version issue here, nor do I use any non-standard options.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

board/exmeritus/hww1u1a/hww1u1a.c line 150

Quoted 5 lines
board/exmeritus/hww1u1a/hww1u1a.c new file +5 -0
+U_BOOT_CMD(
+	hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
+	"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
+	/*  */" && <command-if-true>\n"
+	"hww1u1a_test_cpu_a || <command-if-false>\n"

=20
What is this empty comment needed for?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts the name of the command in that spot. Will remove.

We don't provide usage examples in the help text. This should be fixed in the first place.

This *IS* the help text, and not a sample usage. This is visually and effectively no different from this text in common/cmd_mp.c:

The synopsis of a command gives the command name and possible options, and explains what the command does and what the options do.

"name && <command-if-true>" does NOT fall into that pattern.

Look, alternatively I can claim your help message is highly incomplete as it fails to cover use cases like

	name || <command-if-false>

etc.

Not to mention that the usage message is plain wrong for all boards that don't have the hush shell enabled.

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
Ninety-Ninety Rule of Project Schedules:
        The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.
#12 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

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

Just looking at the last ~200 commits (actually 187, because it ignores merges):

$ git format-patch -o recent-patches -200 origin/master
$ ./checkpatch.pl --no-tree --strict recent-patches/* >checkpatch.log 2>&1
$ grep 'over 80 char' checkpatch.log | wc -l
130
Quoted 6 lines
Quoted 2 lines

That's 130 lines in the last 200 patches which are over 80 characters?!?! How are those patches any different from mine?

The difference is: They were not detected.

Patches welcome.

If those were patches from two years ago and your style policies had significantly changed since then I would understand.

But those are patches from *LAST MONTH* which you were perfectly happy to merge from dozens of different developers, but had *I* submitted identical patches they would have been rejected without even a second glance.

That is inconsistent at best, and in my humble opinion downright rude.

Quoted 8 lines
Quoted 4 lines

Look, I'm really trying to comply with U-Boot coding standards, but I'm really of pissed off about the inconsistent requirements you are applying to my patches versus a lot of other things that YOU ARE MERGING on a regular basis.

The requirements are NOT inconsistent. It's just that nobody is perfect, and nobody ever claimed that we manage to get 100% of review coverage.

I give up.

I apparently cannot rely on the U-Boot *CODE* to understand what the U-Boot *CODING* style is.

The time investment to get reasonable board support merged into U-Boot is proving to be *greater* than the time investment to just maintain our board ports out of tree.

If anyone would like to use our code as a reference or try to get it merged themselves, I will continue to maintain our GPLed out-of-tree patchset here:
http://opensource.exmeritus.com/git/

But otherwise I see no valid reason I should waste any more of my time submitting patches which get torn apart out of hand over issues which are completely ignored for patches which come in from other maintainers.

In the future we will have to weigh other boot-loader alternatives due to the unfriendly attitude here.

Good luck.

Cheers,
Kyle Moffett

#13 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

Dear "Moffett, Kyle D",

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

I apparently cannot rely on the U-Boot *CODE* to understand what the U-Boot *CODING* style is.

You don't have to rely on the code. It's clearly documented.

The README says:

Coding Standards:
-----------------

All contributions to U-Boot should conform to the Linux kernel coding style; see the file "Documentation/CodingStyle" and the script "scripts/Lindent" in your Linux kernel source directory...

http://www.denx.de/wiki/U-Boot/CodingStyle says the same.

And the referred document says:

Chapter 2: Breaking long lines and strings

Coding style is all about readability and maintainability using commonly
available tools.

The limit on the length of lines is 80 columns and this is a strongly preferred limit.

Statements longer than 80 columns will be broken into sensible chunks.

Now what exactly is unclear here?

And no, you are not the only one who is asked to fix his code beause of "Line too long" errors. Here just a small collection from the last 4 months or so:

11/11 To:Xiangfu Liu Re: [U-Boot] [PATCH 1/5] those files are jz4740 base files

      http://article.gmane.org/gmane.comp.boot-loaders.u-boot/88655
12/04 To:Luigi 'Comio'   Re: [U-Boot] [PATCH 5/6 v2] Enable bootstrap support for MIPS architecture.
      http://article.gmane.org/gmane.comp.boot-loaders.u-boot/90325
12/12 To:Macpaul Lin     Re: [U-Boot] [PATCH] ftgmac100: support of gigabit eth ftgmac100
      http://article.gmane.org/gmane.comp.boot-loaders.u-boot/90740
12/12 To:Macpaul Lin     Re: [U-Boot] [PATCH] ftgmac100: support of gigabit eth ftgmac100
      http://article.gmane.org/gmane.comp.boot-loaders.u-boot/90740
03/13 To:Heiko Schocher  Re: [U-Boot] [PATCH 01/20] keymile: rework headerfiles for keymile boards
      http://article.gmane.org/gmane.comp.boot-loaders.u-boot/95728
Quoted 3 lines

But otherwise I see no valid reason I should waste any more of my time submitting patches which get torn apart out of hand over issues which are completely ignored for patches which come in from other maintainers.

This is simply not true. But I'm not sure if you are still listening to any rational arguments. I can only ask you to calm down, and eventually reconsider. Sorry.

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
Quote from a recent meeting:   "We are going to continue having these
meetings everyday until I find out why no work is getting done."
#14 lore raw

PATCH v6 4/4 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

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

I apparently cannot rely on the U-Boot *CODE* to understand what the U-Boot *CODING* style is.

You don't have to rely on the code. It's clearly documented.

The README says:

Quoted 8 lines

Coding Standards:
-----------------

All contributions to U-Boot should conform to the Linux kernel coding style; see the file "Documentation/CodingStyle" and the script "scripts/Lindent" in your Linux kernel source directory...

http://www.denx.de/wiki/U-Boot/CodingStyle says the same.

So here it is claimed that the U-Boot coding style is the same as the Linux Kernel coding style.

Quoted 11 lines · But previously you
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

WARNING: line over 80 characters
#463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
+int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

This one is only a warning, and it's much more readable to have 1 84-character line than split it across 2 different lines. Even still, this warning is only issued if you pass "--subjective" to checkpatch, which is documented to "enable more subjective tests".

In U-Boot, it is considered to be an ERROR.

So which is it?

If U-Boot uses the official Linux Kernel CodingStyle, then a few >80-char lines are OK if it increases readability, for example by not having to wrap a simple U_BOOT_CMD function declaration that goes just a whole 4 characters over the limit.

If U-Boot does NOT use the Linux Kernel CodingStyle and wants to refuse all patches with over 80 characters then you should copy checkpatch.pl and the CodingStyle document and change that wording from "strongly preferred" to "hard requirement", and change the "WARNING" to "ERROR".

Quoted 7 lines

And the referred document says:
Chapter 2: Breaking long lines and strings

Coding style is all about readability and maintainability using commonly
available tools.

Quoted 6 lines

The limit on the length of lines is 80 columns and this is a strongly preferred limit.

Statements longer than 80 columns will be broken into sensible chunks.

Now what exactly is unclear here?

You removed the very next paragraph in the Linux CodingStyle file, which contains:

Quoted 3 lines

The only exception to this is where exceeding 80 columns significantly increases

readability and does not hide information.

Furthermore, Linus Torvalds himself said in an email:

Quoted 8 lines
Quoted 8 lines

We fixed that to allow checkpatch to skip those warnings, but the fact is, the fundamnetal problem has always been the "80 character" part.

I don't think any kernel developers use a vt100 any more. And even if they do, I bet they curse the "24 lines" more than they curse the occasional 80+ character lines.

Quoted 8 lines
Quoted 8 lines

I'd be ok with changing the warning to 132 characters, which is another perfectly fine historical limit. Or we can split the difference, and say "ok, 106 characters is too much". I don't care. But 80 characters is causing too many idiotic changes.

There are way worse problems in many patches than long lines. Too complex expressions. Too deep indentation. Pure crap code. People seem to get way too hung up on ".. but at least it passes checkpatch".

The line you were complaining about is a static U_BOOT_CMD function declaration for goodness sakes! It's about as common as dirt in the U-Boot code and the only reason it doesn't fit on one line anymore is because I made the name of the function *NAME* about 8 characters longer in this version of the patch than it was in a previous patch.

It's not any more complex than it was before, nor is it any harder to read.

I'm tired and fed up with this whole mess. If you think it's likely to be accepted I'll go ahead and submit one more final respin tomorrow, assuming I feel up to it. Otherwise, I wish you the best of luck with U-Boot.

Good night.

Cheers,
Kyle Moffett