Skip to contentSkip to conversation

mpc85xx: support for Freescale COM Express P2020

PATCH Superseded Ira W. Snyder 2 participants 6 messages Nov 21, 2011 PowerPC

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 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 SPD on the 2GB DDR3 DIMM shipped with this evaluation kit has an invalid value (0x08) in the module_type field (eeprom address 0x03). Therefore, a workaround patch was added to the SPD decoder to assume an unregistered DIMM in this case. Other suggestions are welcome.

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: assume unregistered DIMM for invalid SPD module_type
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 +++++++++++++++++++++++
 11 files changed, 1118 insertions(+), 5 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 v4 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
#2 lore raw

PATCH v4 2/3 mpc8xxx: assume unregistered DIMM for invalid SPD module_type

In reply to Ira W. Snyder

The generic Freescale DDR SDRAM SPD parsing code fails when the SPD's module_type field has an unknown value. In this case, we should assume that the memory module is an unregistered DIMM (the usual case).

The DDR3 DIMM shipped with the Freescale COM Express P2020 Evaluation Kit has the module_type field set to 0x08. This is an unknown value in all documentation I can find online.

---

New in v4. Suggestions for other ways to solve this are welcome.

 arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +3 -4
index ffb503a..b2c0899 100644
@@ -144,6 +144,9 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
 		}
 		break;
 
+	default:
+		printf("unknown module_type 0x%02X\n", spd->module_type);
+		/* assume normal unbuffered DIMM (fallthrough) */
 	case DDR3_SPD_MODULETYPE_UDIMM:
 	case DDR3_SPD_MODULETYPE_SO_DIMM:
 	case DDR3_SPD_MODULETYPE_MICRO_DIMM:
@@ -152,10 +155,6 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
 		if (spd->mod_section.unbuffered.addr_mapping & 0x1)
 			pdimm->mirrored_dimm = 1;
 		break;
-
-	default:
-		printf("unknown module_type 0x%02X\n", spd->module_type);
-		return 1;
 	}
 
 	/* SDRAM device parameters */
Signature · 1 line
1.7.3.4
#3 lore raw

PATCH v4 2/3 mpc8xxx: assume unregistered DIMM for invalid SPD module_type

________________________________________
From: Ira W. Snyder [iws at ovro.caltech.edu]
Sent: Monday, November 21, 2011 10:59 AM
To: u-boot at lists.denx.de
Cc: sun york-R58495
Subject: [PATCH v4 2/3] mpc8xxx: assume unregistered DIMM for invalid SPD module_type

The generic Freescale DDR SDRAM SPD parsing code fails when the SPD's module_type field has an unknown value. In this case, we should assume that the memory module is an unregistered DIMM (the usual case).

The DDR3 DIMM shipped with the Freescale COM Express P2020 Evaluation Kit has the module_type field set to 0x08. This is an unknown value in all documentation I can find online.

---

Isn't 0x08 72b-SO-UDIMM?

York

#4 lore raw

PATCH v4 2/3 mpc8xxx: assume unregistered DIMM for invalid SPD module_type

Quoted 15 lines · On Mon, Nov 21, 2011 at 07:11:14PM +0000, sun york-R58495 wrote:

________________________________________
From: Ira W. Snyder [iws at ovro.caltech.edu]
Sent: Monday, November 21, 2011 10:59 AM
To: u-boot at lists.denx.de
Cc: sun york-R58495
Subject: [PATCH v4 2/3] mpc8xxx: assume unregistered DIMM for invalid SPD module_type

The generic Freescale DDR SDRAM SPD parsing code fails when the SPD's module_type field has an unknown value. In this case, we should assume that the memory module is an unregistered DIMM (the usual case).

The DDR3 DIMM shipped with the Freescale COM Express P2020 Evaluation Kit has the module_type field set to 0x08. This is an unknown value in all documentation I can find online.

Quoted 6 lines

---

Isn't 0x08 72b-SO-UDIMM?

I found this document, which specifies 7 modes not listed in U-Boot's include/ddr_spd.h.

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

I'll try to add support for all of the other types defined as I add support for the module type that I have.

Thanks,
Ira

#5 lore raw

PATCH v4 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 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