diff options
Diffstat (limited to 'arch/arm/plat-omap/sram.c')
-rw-r--r-- | arch/arm/plat-omap/sram.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 766181cb5c95..024f3b08db29 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -68,6 +68,7 @@ | |||
68 | 68 | ||
69 | static unsigned long omap_sram_start; | 69 | static unsigned long omap_sram_start; |
70 | static void __iomem *omap_sram_base; | 70 | static void __iomem *omap_sram_base; |
71 | static unsigned long omap_sram_skip; | ||
71 | static unsigned long omap_sram_size; | 72 | static unsigned long omap_sram_size; |
72 | static void __iomem *omap_sram_ceil; | 73 | static void __iomem *omap_sram_ceil; |
73 | 74 | ||
@@ -106,6 +107,7 @@ static int is_sram_locked(void) | |||
106 | */ | 107 | */ |
107 | static void __init omap_detect_sram(void) | 108 | static void __init omap_detect_sram(void) |
108 | { | 109 | { |
110 | omap_sram_skip = SRAM_BOOTLOADER_SZ; | ||
109 | if (cpu_class_is_omap2()) { | 111 | if (cpu_class_is_omap2()) { |
110 | if (is_sram_locked()) { | 112 | if (is_sram_locked()) { |
111 | if (cpu_is_omap34xx()) { | 113 | if (cpu_is_omap34xx()) { |
@@ -113,6 +115,7 @@ static void __init omap_detect_sram(void) | |||
113 | if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || | 115 | if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || |
114 | (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { | 116 | (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { |
115 | omap_sram_size = 0x7000; /* 28K */ | 117 | omap_sram_size = 0x7000; /* 28K */ |
118 | omap_sram_skip += SZ_16K; | ||
116 | } else { | 119 | } else { |
117 | omap_sram_size = 0x8000; /* 32K */ | 120 | omap_sram_size = 0x8000; /* 32K */ |
118 | } | 121 | } |
@@ -175,8 +178,10 @@ static void __init omap_map_sram(void) | |||
175 | return; | 178 | return; |
176 | 179 | ||
177 | #ifdef CONFIG_OMAP4_ERRATA_I688 | 180 | #ifdef CONFIG_OMAP4_ERRATA_I688 |
181 | if (cpu_is_omap44xx()) { | ||
178 | omap_sram_start += PAGE_SIZE; | 182 | omap_sram_start += PAGE_SIZE; |
179 | omap_sram_size -= SZ_16K; | 183 | omap_sram_size -= SZ_16K; |
184 | } | ||
180 | #endif | 185 | #endif |
181 | if (cpu_is_omap34xx()) { | 186 | if (cpu_is_omap34xx()) { |
182 | /* | 187 | /* |
@@ -203,8 +208,8 @@ static void __init omap_map_sram(void) | |||
203 | * Looks like we need to preserve some bootloader code at the | 208 | * Looks like we need to preserve some bootloader code at the |
204 | * beginning of SRAM for jumping to flash for reboot to work... | 209 | * beginning of SRAM for jumping to flash for reboot to work... |
205 | */ | 210 | */ |
206 | memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0, | 211 | memset_io(omap_sram_base + omap_sram_skip, 0, |
207 | omap_sram_size - SRAM_BOOTLOADER_SZ); | 212 | omap_sram_size - omap_sram_skip); |
208 | } | 213 | } |
209 | 214 | ||
210 | /* | 215 | /* |
@@ -218,7 +223,7 @@ void *omap_sram_push_address(unsigned long size) | |||
218 | { | 223 | { |
219 | unsigned long available, new_ceil = (unsigned long)omap_sram_ceil; | 224 | unsigned long available, new_ceil = (unsigned long)omap_sram_ceil; |
220 | 225 | ||
221 | available = omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ); | 226 | available = omap_sram_ceil - (omap_sram_base + omap_sram_skip); |
222 | 227 | ||
223 | if (size > available) { | 228 | if (size > available) { |
224 | pr_err("Not enough space in SRAM\n"); | 229 | pr_err("Not enough space in SRAM\n"); |