From 7693640acd5222f5a64e59ccf5e3bc511e8054b9 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Tue, 8 Dec 2009 09:10:04 +0100 Subject: mpc83xx: spd_sdram.c: Disable memory controller before initializing The memory controller could already be enabled, when spd_sdram() is called. This could be the case for example, when the SDRAM is initialized by the JTAG debugger. The "sync" after the register access via the accessor function is still needed, because the macro uses the sync before the real write is done. So until not all accesses are converted to using accessor functions, this sync still needs to be made "manually" here. Signed-off-by: Stefan Roese Cc: Reinhard Arlt Acked-by: Dave Liu Signed-off-by: Kim Phillips --- cpu/mpc83xx/spd_sdram.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cpu') diff --git a/cpu/mpc83xx/spd_sdram.c b/cpu/mpc83xx/spd_sdram.c index 0f611804a..44aaa9abc 100644 --- a/cpu/mpc83xx/spd_sdram.c +++ b/cpu/mpc83xx/spd_sdram.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -150,6 +151,14 @@ long int spd_sdram() unsigned int ddrc_ecc_enable; unsigned int pvr = get_pvr(); + /* + * First disable the memory controller (could be enabled + * by the debugger) + */ + clrsetbits_be32(&ddr->sdram_cfg, SDRAM_CFG_MEM_EN, 0); + sync(); + isync(); + /* Read SPD parameters with I2C */ CONFIG_SYS_READ_SPD(SPD_EEPROM_ADDRESS, 0, 1, (uchar *) & spd, sizeof (spd)); #ifdef SPD_DEBUG -- cgit v1.2.3 From a3f5da1bee9a8c343a411080d7d468bdc78794a4 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 7 Jan 2010 08:56:00 +0100 Subject: mpc83xx: add support configure bus parking Add support to configure bus parking mode and master in bus arbitration configuration (ACR). Add this for the kmeter1 port: Configure bus arbiter with recommended values from Freescale to improve bus latency/throughput for application with intensive QuiccEngine activity. Signed-off-by: Heiko Schocher Signed-off-by: Kim Phillips --- cpu/mpc83xx/cpu_init.c | 12 ++++++++++++ include/configs/kmeter1.h | 8 ++++++++ 2 files changed, 20 insertions(+) (limited to 'cpu') diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c index 0d6a5fec9..75b45222b 100644 --- a/cpu/mpc83xx/cpu_init.c +++ b/cpu/mpc83xx/cpu_init.c @@ -69,6 +69,12 @@ void cpu_init_f (volatile immap_t * im) #endif #ifdef CONFIG_SYS_ACR_RPTCNT /* Arbiter repeat count */ (ACR_RPTCNT << ACR_RPTCNT_SHIFT) | +#endif +#ifdef CONFIG_SYS_ACR_APARK /* Arbiter address parking mode */ + (ACR_APARK << ACR_APARK_SHIFT) | +#endif +#ifdef CONFIG_SYS_ACR_PARKM /* Arbiter parking master */ + (ACR_PARKM << ACR_PARKM_SHIFT) | #endif 0; __be32 acr_val = @@ -77,6 +83,12 @@ void cpu_init_f (volatile immap_t * im) #endif #ifdef CONFIG_SYS_ACR_RPTCNT /* Arbiter repeat count */ (CONFIG_SYS_ACR_RPTCNT << ACR_RPTCNT_SHIFT) | +#endif +#ifdef CONFIG_SYS_ACR_APARK /* Arbiter address parking mode */ + (CONFIG_SYS_ACR_APARK << ACR_APARK_SHIFT) | +#endif +#ifdef CONFIG_SYS_ACR_PARKM /* Arbiter parking master */ + (CONFIG_SYS_ACR_PARKM << ACR_PARKM_SHIFT) | #endif 0; __be32 spcr_mask = diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h index bec08dab1..b02332650 100644 --- a/include/configs/kmeter1.h +++ b/include/configs/kmeter1.h @@ -71,6 +71,14 @@ */ #define CONFIG_SYS_IMMR 0xE0000000 +/* + * Bus Arbitration Configuration Register (ACR) + */ +#define CONFIG_SYS_ACR_PIPE_DEP 3 /* pipeline depth 4 transactions */ +#define CONFIG_SYS_ACR_RPTCNT 3 /* 4 consecutive transactions */ +#define CONFIG_SYS_ACR_APARK 0 /* park bus to master (below) */ +#define CONFIG_SYS_ACR_PARKM 3 /* parking master = QuiccEngine */ + /* * DDR Setup */ -- cgit v1.2.3