Board support series for the eXMeritus HWW-1U-1A
v5 cover Board support series for the eXMeritus HWW-1U-1A
This is the latest respin of the eXMeritus HWW-1U-1A board support patches. It's down to just a 3-patch series, with all of the other patches submitted separately.
This series techncially depends on the reset rework, the "reset" command will not work properly on the HWW-1U-1A hardware without those patches. It will not cause a build failure however, as this board port simply defines an otherwise-unused __board_restart() function.
I believe these 3 patches at least are ready to be merged, as all concerns presented so far have been resolved.
Cheers,
Kyle Moffett
PATCH v5 1/3 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v5 1/3 mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements
Quoted 11 lines · Kyle Moffett
The numeric constants in the switch statements are replaced by #defines added to the common
ddr_spd.hheader. 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.
Signed-off-by Kyle Moffett <[email protected]>Cc Andy Fleming <[email protected]>Cc Kumar Gala <[email protected]>Cc Kim Phillips <[email protected]>
Quoted 7 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(-)
Ack.
York
PATCH v5 1/3 mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements
In reply to Kyle MoffettQuoted 11 lines · Kyle Moffett
The numeric constants in the switch statements are replaced by #defines added to the common
ddr_spd.hheader. 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.
Signed-off-by Kyle Moffett <[email protected]>Cc Andy Fleming <[email protected]>Cc Kumar Gala <[email protected]>Cc Kim Phillips <[email protected]>
Quoted 7 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(-)
PATCH v5 1/3 mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements
In reply to Kyle MoffettQuoted 11 lines · Kyle Moffett
The numeric constants in the switch statements are replaced by #defines added to the common
ddr_spd.hheader. 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.
Signed-off-by Kyle Moffett <[email protected]>Cc Andy Fleming <[email protected]>Cc Kumar Gala <[email protected]>Cc Kim Phillips <[email protected]>
Quoted 6 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(-)
Can you rebase on 'next' branch of git://git.denx.de/u-boot-mpc85xx.git
- k
PATCH v5 2/3 mpc85xx: Add inline GPIO acessor functions
In reply to Kyle MoffettTo 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 Linux-compatible gpio_request() interface around the MPC85xx-specific functions. This can be enabled with the config option CONFIG_MPC85XX_GENERIC_GPIO.
--- 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
@@ -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
PATCH v5 3/3 mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices
In reply to Kyle MoffettThe 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_restart() function in hww1u1a.c
--- MAINTAINERS | 4 + board/exmeritus/hww1u1a/Makefile | 54 ++++ board/exmeritus/hww1u1a/ddr.c | 51 ++++ board/exmeritus/hww1u1a/gpios.h | 67 +++++ board/exmeritus/hww1u1a/hww1u1a.c | 549 +++++++++++++++++++++++++++++++++++++ board/exmeritus/hww1u1a/law.c | 34 +++ board/exmeritus/hww1u1a/tlb.c | 106 +++++++ boards.cfg | 2 + include/configs/HWW1U1A.h | 474 ++++++++++++++++++++++++++++++++ 9 files changed, 1341 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
@@ -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 +51 -0
51 lines not on this page · raw message
board/exmeritus/hww1u1a/gpios.h new file +67 -0
67 lines not on this page · raw message
board/exmeritus/hww1u1a/hww1u1a.c new file +549 -0
549 lines not on this page · raw message
board/exmeritus/hww1u1a/law.c new file +34 -0
@@ -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
@@ -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