mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
f1a2481c0a
commit
e546f21b4b
1 changed files with 5 additions and 20 deletions
|
@ -220,20 +220,7 @@ void __init omap_map_sram(void)
|
|||
if (omap_sram_size == 0)
|
||||
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()) {
|
||||
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
|
||||
* CORE DPLL M2 divider change code (in SRAM) runs with the
|
||||
|
@ -244,13 +231,11 @@ void __init omap_map_sram(void)
|
|||
omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;
|
||||
}
|
||||
|
||||
if (cpu_is_omap44xx()) {
|
||||
omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA;
|
||||
base = OMAP4_SRAM_PA;
|
||||
base = ROUND_DOWN(base, PAGE_SIZE);
|
||||
omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
|
||||
}
|
||||
omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */
|
||||
omap_sram_io_desc[0].virtual = omap_sram_base;
|
||||
base = omap_sram_start;
|
||||
base = ROUND_DOWN(base, PAGE_SIZE);
|
||||
omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
|
||||
omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE);
|
||||
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",
|
||||
|
|
Loading…
Reference in a new issue