提交 e546f21b 编写于 作者: S Santosh Shilimkar 提交者: Russell King

ARM: 6408/1: omap: Map only available sram memory

Currently we map 1 MB section while setting up SRAM on OMAPs
Regardless of the actual memory. The physical OCM RAM available
on OMAP SOCs is in order of KBs. This patch maps only available
sram and cleans up some un-necessary cpu_is_xxx checks.

Mapping un-available or non-accessible(secure) memory on the newer ARM
processor is dangerous. Because ARM CPUs can now speculatively prefetch,
we should avoid mapping any no-existing or secure memory.
Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 f1a2481c
...@@ -220,20 +220,7 @@ void __init omap_map_sram(void) ...@@ -220,20 +220,7 @@ void __init omap_map_sram(void)
if (omap_sram_size == 0) if (omap_sram_size == 0)
return; return;
if (cpu_is_omap24xx()) {
omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA;
base = OMAP2_SRAM_PA;
base = ROUND_DOWN(base, PAGE_SIZE);
omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
}
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA;
base = OMAP3_SRAM_PA;
base = ROUND_DOWN(base, PAGE_SIZE);
omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
/* /*
* SRAM must be marked as non-cached on OMAP3 since the * SRAM must be marked as non-cached on OMAP3 since the
* CORE DPLL M2 divider change code (in SRAM) runs with the * CORE DPLL M2 divider change code (in SRAM) runs with the
...@@ -244,13 +231,11 @@ void __init omap_map_sram(void) ...@@ -244,13 +231,11 @@ void __init omap_map_sram(void)
omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;
} }
if (cpu_is_omap44xx()) { omap_sram_io_desc[0].virtual = omap_sram_base;
omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA; base = omap_sram_start;
base = OMAP4_SRAM_PA; base = ROUND_DOWN(base, PAGE_SIZE);
base = ROUND_DOWN(base, PAGE_SIZE); omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
omap_sram_io_desc[0].pfn = __phys_to_pfn(base); omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE);
}
omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */
iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));
printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册