Skip to content
Snippets Groups Projects
Commit 51f924e5 authored by Becky Bruce's avatar Becky Bruce Committed by Kumar Gala
Browse files

board/tqm85xx: Create and tear down TLB for get_ram_size()


We need a TLB entry to call get_ram_size(); the common code doesn't create
one until *after* fixed_sdram() has determined the size.  So we set up tlbs
for the max possible size and tear them down once we're done with
get_ram_size(); the common 85xx code will then set up a final set of tlb
entries for the *actual* detected size of ddr.

This prevents us from having TLB entries that are larger than DDR sitting
around for very long, which is not a recommended scenario.

Signed-off-by: default avatarBecky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 9cdfe281
No related branches found
No related tags found
No related merge requests found
...@@ -363,6 +363,12 @@ static phys_size_t sdram_setup(int casl) ...@@ -363,6 +363,12 @@ static phys_size_t sdram_setup(int casl)
udelay (1000); udelay (1000);
#endif /* CONFIG_TQM8548 */ #endif /* CONFIG_TQM8548 */
/*
* get_ram_size() depends on having tlbs for the DDR, but they are
* not yet setup because we don't know the size. Set up a temp
* mapping and delete it when done.
*/
setup_ddr_tlbs(CONFIG_SYS_DDR_EARLY_SIZE_MB);
for (i = 0; i < N_DDR_CS_CONF; i++) { for (i = 0; i < N_DDR_CS_CONF; i++) {
ddr->cs0_config = ddr_cs_conf[i].reg; ddr->cs0_config = ddr_cs_conf[i].reg;
...@@ -376,6 +382,7 @@ static phys_size_t sdram_setup(int casl) ...@@ -376,6 +382,7 @@ static phys_size_t sdram_setup(int casl)
break; break;
} }
} }
clear_ddr_tlbs(CONFIG_SYS_DDR_EARLY_SIZE_MB);
#ifdef CONFIG_TQM8548 #ifdef CONFIG_TQM8548
if (i < N_DDR_CS_CONF) { if (i < N_DDR_CS_CONF) {
......
...@@ -147,10 +147,16 @@ ...@@ -147,10 +147,16 @@
* DDR Setup * DDR Setup
*/ */
#define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000 /* DDR is system memory */ #define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000 /* DDR is system memory */
#if defined(CONFIG_TQM_BIGFLASH) || \ #if defined(CONFIG_TQM_BIGFLASH) || \
(!defined(CONFIG_TQM8548_AG) && !defined(CONFIG_TQM8548_BE)) (!defined(CONFIG_TQM8548_AG) && !defined(CONFIG_TQM8548_BE))
#define CONFIG_SYS_PPC_DDR_WIMGE (MAS2_I | MAS2_G) #define CONFIG_SYS_PPC_DDR_WIMGE (MAS2_I | MAS2_G)
#define CONFIG_SYS_DDR_EARLY_SIZE_MB (512)
#else
#define CONFIG_SYS_PPC_DDR_WIMGE (0)
#define CONFIG_SYS_DDR_EARLY_SIZE_MB (2 * 1024)
#endif #endif
#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
#ifdef CONFIG_TQM8548_AG #ifdef CONFIG_TQM8548_AG
#define CONFIG_VERY_BIG_RAM #define CONFIG_VERY_BIG_RAM
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment