Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e546f21b authored by Santosh Shilimkar's avatar Santosh Shilimkar Committed by Russell King
Browse files

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: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent f1a2481c
Loading
Loading
Loading
Loading
+5 −20
Original line number Diff line number Diff line
@@ -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;
	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 = 1024 * 1024;	/* Use section desc */
	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",