From d24bd2517a2b847f773453eab0ee5b1c8ebc74ba Mon Sep 17 00:00:00 2001 From: Felix Radensky Date: Sun, 27 Sep 2009 23:56:12 +0200 Subject: ppc4xx: Reorganize DDR2 ECC handling Reorganize DDR2 ECC handling to use common code for SPD DIMMs and soldered SDRAM. Also, use common code to display SDRAM info (ECC, CAS latency) for SPD and soldered SDRAM variants. Signed-off-by: Felix Radensky Signed-off-by: Stefan Roese --- include/ppc405.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/ppc405.h b/include/ppc405.h index 5e56897819..8a4ba3faf6 100644 --- a/include/ppc405.h +++ b/include/ppc405.h @@ -768,6 +768,10 @@ #define SDR0_SDCS_SDD (0x80000000 >> 31) +/* SDR0_SDSTP0 Serial Device Strap Register0 */ +#define SDR0_SDSTP0 0x0020 +#define SDR0_SDSTP0_PLB2xDV0_DECODE(n) ((((unsigned long)(n)) & 0x07)) + /* CUST0 Customer Configuration Register0 */ #define SDR0_CUST0 0x4000 #define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */ -- cgit From fb95169e39f2d03270bed552d27bbb02627a443e Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 28 Sep 2009 17:33:45 +0200 Subject: ppc4xx: Merge PPC4xx DDR and DDR2 ECC handling This patch merges the ECC handling (ECC parity byte writing) into one file (ecc.c) for all PPC4xx SDRAM controllers except for PPC440EPx/GRx. This exception is because only those PPC's use the completely different Denali SDRAM controller core. Previously we had two routines to generate/write the ECC parity bytes. With this patch we now only have one core function left. Tested on Kilauea (no ECC) and Katmai (with and without ECC). Signed-off-by: Stefan Roese Cc: Felix Radensky Cc: Grant Erickson Cc: Pieter Voorthuijsen --- include/asm-ppc/ppc4xx-sdram.h | 7 ++++--- include/ppc405.h | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/ppc4xx-sdram.h b/include/asm-ppc/ppc4xx-sdram.h index b6182d4f21..92be514b40 100644 --- a/include/asm-ppc/ppc4xx-sdram.h +++ b/include/asm-ppc/ppc4xx-sdram.h @@ -117,6 +117,7 @@ #define SDRAM_MCSTS_MRSC 0x80000000 #define SDRAM_MCSTS_SRMS 0x40000000 #define SDRAM_MCSTS_CIS 0x20000000 +#define SDRAM_MCSTS_IDLE_NOT 0x00000000 /* Mem contr not idle */ /* * SDRAM Refresh Timer Register @@ -416,8 +417,7 @@ #define SDRAM_SDTR3 0x87 /* DDR SDRAM timing 3 */ #define SDRAM_MMODE 0x88 /* memory mode */ #define SDRAM_MEMODE 0x89 /* memory extended mode */ -#define SDRAM_ECCCR 0x98 /* ECC error status */ -#define SDRAM_ECCES SDRAM_ECCCR +#define SDRAM_ECCES 0x98 /* ECC error status */ #define SDRAM_CID 0xA4 /* core ID */ #ifndef CONFIG_405EX #define SDRAM_RID 0xA8 /* revision ID */ @@ -1397,7 +1397,6 @@ /* * Prototypes */ -void inline blank_string(int size); inline void ppc4xx_ibm_ddr2_register_dump(void); u32 mfdcr_any(u32); void mtdcr_any(u32, u32); @@ -1405,6 +1404,8 @@ u32 ddr_wrdtr(u32); u32 ddr_clktr(u32); void spd_ddr_init_hang(void); u32 DQS_autocalibration(void); +phys_size_t sdram_memsize(void); +void dcbz_area(u32 start_address, u32 num_bytes); #endif /* __ASSEMBLY__ */ #endif /* _PPC4xx_SDRAM_H_ */ diff --git a/include/ppc405.h b/include/ppc405.h index 8a4ba3faf6..5e56897819 100644 --- a/include/ppc405.h +++ b/include/ppc405.h @@ -768,10 +768,6 @@ #define SDR0_SDCS_SDD (0x80000000 >> 31) -/* SDR0_SDSTP0 Serial Device Strap Register0 */ -#define SDR0_SDSTP0 0x0020 -#define SDR0_SDSTP0_PLB2xDV0_DECODE(n) ((((unsigned long)(n)) & 0x07)) - /* CUST0 Customer Configuration Register0 */ #define SDR0_CUST0 0x4000 #define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */ -- cgit From 3b4bd2d75c4b3c1a4570f47ffaaed66f56a78ff4 Mon Sep 17 00:00:00 2001 From: Matthias Fuchs Date: Wed, 30 Sep 2009 11:55:04 +0200 Subject: ppc4xx: Add SDRAM detection for PMC440 boards This patch adds support to detect the amount of DDR2 SDRAM on PMC440 modules. Detection is done by probing through a list of available and supported hardware configurations from 1GByte down to 256MB. The static TLB entry is replaced by dynamically created entries. Signed-off-by: Matthias Fuchs Signed-off-by: Stefan Roese --- include/configs/PMC440.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h index 012ae798d1..d6e2f6bc5e 100644 --- a/include/configs/PMC440.h +++ b/include/configs/PMC440.h @@ -215,7 +215,6 @@ /*----------------------------------------------------------------------- * DDR SDRAM *----------------------------------------------------------------------*/ -#define CONFIG_SYS_MBYTES_SDRAM (256) /* 256MB */ #if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL) #define CONFIG_DDR_DATA_EYE /* use DDR2 optimization */ #endif -- cgit