Skip to contentSkip to conversation

mpc85xx: support for Freescale COM Express P2020

PATCH Superseded Ira W. Snyder 3 participants 8 messages Nov 21, 2011 – Nov 29, 2011 PowerPC

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover mpc85xx: support for Freescale COM Express P2020

This is a cleaned up version of the U-Boot port provided with the BSP for the Freescale COM Express P2020 evaluation kit.

This board is booted from SD card or SPI flash by using the Freescale On-Chip ROM to load U-Boot into L2 SRAM. U-Boot configures and initializes the DDR SDRAM using the SPD on the module.

The 2GB DDR3 DIMM shipped with the evaluation kit is a 72bit SO-UDIMM. The U-Boot SPD decoder did not support this module type, so this patchset adds support. At the same time, support for all module types in the newest JEDEC specification was added.

Changes v4 -> v5:
- add SPD decoding support for newer module types

Changes v3 -> v4:
- address review comments
- boot via L2 SRAM (just like P2020DS)
- use SPD EEPROM to configure DDR SDRAM

Changes v2 -> v3:
- re-enable CCSR relocation

Changes v1 -> v2:
- fix checkpatch warnings
- remove references to NAND (this board lacks NAND)
- disable CCSR relocation

Ira W. Snyder (3):
mpc85xx: support board-specific reset function
mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification
mpc85xx: support for Freescale COM Express P2020

 MAINTAINERS                                     |    4 +
 arch/powerpc/cpu/mpc85xx/cpu.c                  |   17 +-
 arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |    7 +
 arch/powerpc/include/asm/immap_85xx.h           |    1 +
 board/freescale/p2020come/Makefile              |   46 ++
 board/freescale/p2020come/ddr.c                 |   45 ++
 board/freescale/p2020come/law.c                 |   39 ++
 board/freescale/p2020come/p2020come.c           |  287 +++++++++++
 board/freescale/p2020come/tlb.c                 |   99 ++++
 boards.cfg                                      |    2 +
 include/configs/P2020COME.h                     |  576 +++++++++++++++++++++++
 include/ddr_spd.h                               |    7 +
 12 files changed, 1129 insertions(+), 1 deletions(-)
 create mode 100644 board/freescale/p2020come/Makefile
 create mode 100644 board/freescale/p2020come/ddr.c
 create mode 100644 board/freescale/p2020come/law.c
 create mode 100644 board/freescale/p2020come/p2020come.c
 create mode 100644 board/freescale/p2020come/tlb.c
 create mode 100644 include/configs/P2020COME.h
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH v5 1/3 mpc85xx: support board-specific reset function

This is useful for boards which cannot be reset in the usual way for the 85xx CPU. An example is a board which can only be reset by a hardware watchdog.

---

Unchanged from v1.

 arch/powerpc/cpu/mpc85xx/cpu.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu.c +16 -1
index 49c0551..c1815e8 100644
@@ -42,6 +42,16 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Default board reset function
+ */
+static void
+__board_reset(void)
+{
+	/* Do nothing */
+}
+void board_reset(void) __attribute__((weak, alias("__board_reset")));
+
 int checkcpu (void)
 {
 	sys_info_t sysinfo;
@@ -215,7 +225,12 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	mtspr(DBCR0,val);
 #else
 	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-	out_be32(&gur->rstcr, 0x2);	/* HRESET_REQ */
+
+	/* Attempt board-specific reset */
+	board_reset();
+
+	/* Next try asserting HRESET_REQ */
+	out_be32(&gur->rstcr, 0x2);
 	udelay(100);
 #endif
 
Signature · 1 line
1.7.3.4
Applied
#2 lore raw

PATCH v5 1/3 mpc85xx: support board-specific reset function

Quoted 11 lines · Ira W. Snyder

This is useful for boards which cannot be reset in the usual way for the 85xx CPU. An example is a board which can only be reset by a hardware watchdog.

---

Unchanged from v1.

arch/powerpc/cpu/mpc85xx/cpu.c | 17 ++++++++++++++++-

1 files changed, 16 insertions(+), 1 deletions(-)

applied to 85xx

- k

#3 lore raw

PATCH v5 2/3 mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification

In reply to Ira W. Snyder

Newer JEDEC DDR3 SPD Specifications define several additional values for the DDR3 module_type field which were undefined when this code was written. Update the code to handle the newer module types.

---

New in v5. Supercedes the patch titled:
[PATCH v4 2/3] mpc8xxx: assume unregistered DIMM for invalid SPD module_type

JEDEC Specification used:
http://www.jedec.org/standards-documents/docs/spd-4010211

 arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |    7 +++++++
 include/ddr_spd.h                               |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +7 -0
index ffb503a..d0a5466 100644
@@ -135,6 +135,7 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
 	switch (spd->module_type & DDR3_SPD_MODULETYPE_MASK) {
 	case DDR3_SPD_MODULETYPE_RDIMM:
 	case DDR3_SPD_MODULETYPE_MINI_RDIMM:
+	case DDR3_SPD_MODULETYPE_72B_SO_RDIMM:
 		/* Registered/buffered DIMMs */
 		pdimm->registered_dimm = 1;
 		for (i = 0; i < 16; i += 2) {
@@ -148,6 +149,12 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
 	case DDR3_SPD_MODULETYPE_SO_DIMM:
 	case DDR3_SPD_MODULETYPE_MICRO_DIMM:
 	case DDR3_SPD_MODULETYPE_MINI_UDIMM:
+	case DDR3_SPD_MODULETYPE_MINI_CDIMM:
+	case DDR3_SPD_MODULETYPE_72B_SO_UDIMM:
+	case DDR3_SPD_MODULETYPE_72B_SO_CDIMM:
+	case DDR3_SPD_MODULETYPE_LRDIMM:
+	case DDR3_SPD_MODULETYPE_16B_SO_DIMM:
+	case DDR3_SPD_MODULETYPE_32B_SO_DIMM:
 		/* Unbuffered DIMMs */
 		if (spd->mod_section.unbuffered.addr_mapping & 0x1)
 			pdimm->mirrored_dimm = 1;
include/ddr_spd.h +7 -0
index 40a0463..a9230b9 100644
@@ -325,5 +325,12 @@ extern unsigned int ddr3_spd_check(const ddr3_spd_eeprom_t *spd);
 #define DDR3_SPD_MODULETYPE_MICRO_DIMM	(0x04)
 #define DDR3_SPD_MODULETYPE_MINI_RDIMM	(0x05)
 #define DDR3_SPD_MODULETYPE_MINI_UDIMM	(0x06)
+#define DDR3_SPD_MODULETYPE_MINI_CDIMM	(0x07)
+#define DDR3_SPD_MODULETYPE_72B_SO_UDIMM	(0x08)
+#define DDR3_SPD_MODULETYPE_72B_SO_RDIMM	(0x09)
+#define DDR3_SPD_MODULETYPE_72B_SO_CDIMM	(0x0A)
+#define DDR3_SPD_MODULETYPE_LRDIMM	(0x0B)
+#define DDR3_SPD_MODULETYPE_16B_SO_DIMM	(0x0C)
+#define DDR3_SPD_MODULETYPE_32B_SO_DIMM	(0x0D)
 
 #endif /* _DDR_SPD_H_ */
Signature · 1 line
1.7.3.4
#4 lore raw

PATCH v5 2/3 mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification

Quoted 7 lines · Ira W. Snyder

Newer JEDEC DDR3 SPD Specifications define several additional values for the DDR3 module_type field which were undefined when this code was written. Update the code to handle the newer module types.

---

Thanks. This looks much better.

York

Applied
#5 lore raw

PATCH v5 2/3 mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification

In reply to Ira W. Snyder
Quoted 11 lines · Ira W. Snyder

Newer JEDEC DDR3 SPD Specifications define several additional values for the DDR3 module_type field which were undefined when this code was written. Update the code to handle the newer module types.

---

New in v5. Supercedes the patch titled:
[PATCH v4 2/3] mpc8xxx: assume unregistered DIMM for invalid SPD module_type

Quoted 6 lines

JEDEC Specification used:
http://www.jedec.org/standards-documents/docs/spd-4010211

arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |    7 +++++++
include/ddr_spd.h                               |    7 +++++++
2 files changed, 14 insertions(+), 0 deletions(-)

applied to 85xx

- k

#6 lore raw

PATCH v5 3/3 mpc85xx: support for Freescale COM Express P2020

In reply to Ira W. Snyder

This adds support for the Freescale COM Express P2020 board. This board is similar to the P1_P2_RDB, but has some extra (as well as missing) peripherals.

Unlike all other mpc85xx boards, it uses a watchdog timeout to reset. Using the HRESET_REQ register does not work.

This board has no NOR flash, and can only be booted via SD or SPI. This procedure is documented in Freescale Document Number AN3659 "Booting from On-Chip ROM (eSDHC or eSPI)." Some alternative documentation is provided in Freescale Document Number P2020RM "P2020 QorIQ Integrated Processor Reference Manual" (section 4.5).

---

Changes v4 -> v5:
- unchanged

Changes v3 -> v4:
- address review comments (magic numbers, etc.)
- boot via L2 SRAM
- use SPD EEPROM to initialize DDR SDRAM

Changes v2 -> v3:
- re-enable CCSR relocation

Changes v1 -> v2:
- fix checkpatch warnings
- remove all references to NAND
- update to top of tree U-Boot
- remove CCSR relocation

 MAINTAINERS                           |    4 +
 arch/powerpc/include/asm/immap_85xx.h |    1 +
 board/freescale/p2020come/Makefile    |   46 +++
 board/freescale/p2020come/ddr.c       |   45 +++
 board/freescale/p2020come/law.c       |   39 +++
 board/freescale/p2020come/p2020come.c |  287 ++++++++++++++++
 board/freescale/p2020come/tlb.c       |   99 ++++++
 boards.cfg                            |    2 +
 include/configs/P2020COME.h           |  576 +++++++++++++++++++++++++++++++++
 9 files changed, 1099 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/p2020come/Makefile
 create mode 100644 board/freescale/p2020come/ddr.c
 create mode 100644 board/freescale/p2020come/law.c
 create mode 100644 board/freescale/p2020come/p2020come.c
 create mode 100644 board/freescale/p2020come/tlb.c
 create mode 100644 include/configs/P2020COME.h
MAINTAINERS +4 -0
index f6f6b72..6ac8177 100644
@@ -450,6 +450,10 @@ Jon Smirl <[email protected]>
 
 	pcm030		MPC5200
 
+Ira W. Snyder <[email protected]>
+
+	P2020COME	P2020
+
 Timur Tabi <[email protected]>
 
 	MPC8349E-mITX	MPC8349
arch/powerpc/include/asm/immap_85xx.h +1 -0
index 99fe97d..9b08cb8 100644
@@ -2420,6 +2420,7 @@ struct ccsr_rman {
 #define CONFIG_SYS_MPC85xx_L2_OFFSET		0x20000
 #define CONFIG_SYS_MPC85xx_DMA_OFFSET		0x21000
 #define CONFIG_SYS_MPC85xx_USB_OFFSET		0x22000
+#define CONFIG_SYS_MPC85xx_USB2_OFFSET		0x23000
 #ifdef CONFIG_TSECV2
 #define CONFIG_SYS_TSEC1_OFFSET			0xB0000
 #else
board/freescale/p2020come/Makefile new file +46 -0

46 lines not on this page · raw message

board/freescale/p2020come/ddr.c new file +45 -0

45 lines not on this page · raw message

board/freescale/p2020come/law.c new file +39 -0
new file mode 100644
index 0000000..20ba36f
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009 Freescale Semiconductor, Inc.
+ *
+ * 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>
+
+/*
+ * Create a dummy LAW entry for the DDR SDRAM which will be replaced when
+ * the DDR SPD setup code runs.
+ *
+ * This table would be empty, except that it is used before the BSS section is
+ * initialized, and therefore must have at least one entry to push it into
+ * the DATA section.
+ */
+struct law_entry law_table[] = {
+	SET_LAW(CONFIG_SYS_SDRAM_BASE, LAW_SIZE_4K, LAW_TRGT_IF_DDR),
+};
+
+int num_law_entries = ARRAY_SIZE(law_table);
board/freescale/p2020come/p2020come.c new file +287 -0

287 lines not on this page · raw message

board/freescale/p2020come/tlb.c new file +99 -0

99 lines not on this page · raw message

boards.cfg +2 -0
index c83d861..5948e28 100644
@@ -717,6 +717,8 @@ P2020RDB-PC_36BIT            powerpc     mpc85xx     p1_p2_rdb_pc        freesca
 P2020RDB-PC_36BIT_NAND       powerpc     mpc85xx     p1_p2_rdb_pc        freescale      -           p1_p2_rdb_pc:P2020RDB,36BIT,NAND
 P2020RDB-PC_36BIT_SDCARD     powerpc     mpc85xx     p1_p2_rdb_pc        freescale      -           p1_p2_rdb_pc:P2020RDB,36BIT,SDCARD
 P2020RDB-PC_36BIT_SPIFLASH   powerpc     mpc85xx     p1_p2_rdb_pc        freescale      -           p1_p2_rdb_pc:P2020RDB,36BIT,SPIFLASH
+P2020COME_SDCARD             powerpc     mpc85xx     p2020come           freescale      -           P2020COME:SDCARD
+P2020COME_SPIFLASH           powerpc     mpc85xx     p2020come           freescale      -           P2020COME:SPIFLASH
 P2041RDB                     powerpc     mpc85xx     p2041rdb            freescale
 P2041RDB_SDCARD              powerpc     mpc85xx     p2041rdb            freescale      -           P2041RDB:RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF80000
 P2041RDB_SECURE_BOOT         powerpc     mpc85xx     p2041rdb            freescale      -           P2041RDB:SECURE_BOOT
include/configs/P2020COME.h new file +576 -0

576 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#7 lore raw

PATCH v5 3/3 mpc85xx: support for Freescale COM Express P2020

Quoted 43 lines · Ira W. Snyder

This adds support for the Freescale COM Express P2020 board. This board is similar to the P1_P2_RDB, but has some extra (as well as missing) peripherals.

Unlike all other mpc85xx boards, it uses a watchdog timeout to reset. Using the HRESET_REQ register does not work.

This board has no NOR flash, and can only be booted via SD or SPI. This procedure is documented in Freescale Document Number AN3659 "Booting from On-Chip ROM (eSDHC or eSPI)." Some alternative documentation is provided in Freescale Document Number P2020RM "P2020 QorIQ Integrated Processor Reference Manual" (section 4.5).

---

Changes v4 -> v5:
- unchanged

Changes v3 -> v4:
- address review comments (magic numbers, etc.)
- boot via L2 SRAM
- use SPD EEPROM to initialize DDR SDRAM

Changes v2 -> v3:
- re-enable CCSR relocation

Changes v1 -> v2:
- fix checkpatch warnings
- remove all references to NAND
- update to top of tree U-Boot
- remove CCSR relocation

MAINTAINERS                           |    4 +
arch/powerpc/include/asm/immap_85xx.h |    1 +
board/freescale/p2020come/Makefile    |   46 +++
board/freescale/p2020come/ddr.c       |   45 +++
board/freescale/p2020come/law.c       |   39 +++
board/freescale/p2020come/p2020come.c |  287 ++++++++++++++++
board/freescale/p2020come/tlb.c       |   99 ++++++
boards.cfg                            |    2 +
include/configs/P2020COME.h           |  576 +++++++++++++++++++++++++++++++++
9 files changed, 1099 insertions(+), 0 deletions(-)
Quoted 6 lines

create mode 100644 board/freescale/p2020come/Makefile create mode 100644 board/freescale/p2020come/ddr.c create mode 100644 board/freescale/p2020come/law.c create mode 100644 board/freescale/p2020come/p2020come.c create mode 100644 board/freescale/p2020come/tlb.c create mode 100644 include/configs/P2020COME.h

Some compiler warnings to deal with:

speed.c: In function 'get_sys_info':
speed.c:184:4: warning: implicit declaration of function 'get_board_ddr_clk' speed.c: In function 'get_sys_info':
speed.c:184:4: warning: implicit declaration of function 'get_board_ddr_clk'

Do you want 'CONFIG_FSL_DDR_INTERACTIVE' turned on by default?

interactive.c: In function 'fsl_ddr_interactive':
interactive.c:1357:15: warning: variable 'len' set but not used [-Wunused-but-set-variable]

I'll look at this one.

- k