[OMAP4] Add ION Memmanager support

Add a common ION file to initialize the ION memory
spaces for DUCATI, Tiler and large surfaces

Change-Id: I17e608d90c5568bd4be1285cee1976e05192950d
Signed-off-by: Dan Murphy <dmurphy@ti.com>

Conflicts:
	arch/arm/mach-omap2/Makefile
[OMAP4] OMAP4: reduce TILER ion heap to match max tiler size

The size of the tiler carveout should be no larger than the maximum
size of memory (128MB) that can be mapped into the TILER.

Change-Id: I1b6bbef196e424aa1c03f28f560600b1348a63b2
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Andy Gross <andy.gross@ti.com>
omap4: relocate and resize ion carveout memories

The ion secure input heap is moved towards the end of the RAM.
It needs to be preceded by the ducati carveout memory, which is
also increased from 101MB to 103MB. IPC will be using this
additional 2MB for its IO. These changes are done to match the
corresponding memory relocations in the Blaze/Panda board files.

Change-Id: I9b0ab1789f19d39c42819e5c61c74dfe9e60ec06
Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: OMAP4: Add nonsecure TILER carveout

Add a 32MB nonsecure TILER carveout to be used by framebuffer.

Change-Id: I186dd37046ef731e0896e98de7c079b3af038c07
Signed-off-by: Dan Murphy <dmurphy@ti.com>

Conflicts:
	arch/arm/mach-omap2/omap4_ion.c
 ARM: Update ION code for commonality

Created a omap4_ion.h so that multiple products can configure
the same ION support
 ARM: OMAP4: Move common ION #defines to omap4_ion.h

Move the #define allocations to the common omap4_ion header.
Rename OMAP_ION_HEAP_SECURE_INPUT_SIZE to OMAP4_ION_HEAP_SECURE_INPUT_SIZE
Rename OMAP_ION_HEAP_NONSECURE_TILER_SIZE to OMAP4_ION_HEAP_NONSECURE_TILER_SIZE

Change-Id: Ic6bd49fa29b21cccab47ceb4e6b5e26e4c611dd7
Signed-off-by: Dan Murphy <dmurphy@ti.com>

Conflicts:
	arch/arm/mach-omap2/board-tuna.c
ARM: OMAP4: ION:Remove large-surfaces ION carveout

The large-surfaces carveout is not used.  This gives 32M back to the system.

Change-Id: Iaecc533787e2354079c5b0bf5e132884d1cd0071
Signed-off-by: Dan Murphy <dmurphy@ti.com>
 OMAP4: Tuna/Panda: fix vram overlap with static carveouts

omap_reserve function may call into different reserve functions
that do dynamic memblock allocations, so needs to be called
absolute last after all the static memblock_remove calls are
invoked.

Also, omap_reserve function need to be invoked always, so
code has been cleaned up to move the call outside of any
conditional preprocessor macros.
omap: ion: remove ram console memory reserve

After d7b9a8f9a6faa6265bcdc7d8da87d29d32d5e1aa RAM console
support was properly implemented and memory for the console is
reserved in omap_ram_console.c. This causes double reservation
of the same region at the begining of the second 512MB of RAM,
which triggers a "bug" in memblock_remove.

With this double removal of the same memblock region we are
getting 478MB of available RAM on IS.2.

This commit removes the double reservation avoiding the unexpected
behavior of memblock_remove, resulting in 680MB available RAM.

Change-Id: I3887b349cdb1a0552e27e9d51bcb8f23c6b691d6
Signed-off-by: Aleksandar Krsteski <x0163611@ti.com>
 OMAP4: ion: move omap4_ion.h under mach/include

This is because tiler and ion is really a platform device, but
they are defined in mach, and other platform devices need to refer
to them.
tuna/board-config , fix errors from prev commits
more stuff
OMAP4: ion: Calculate carveout addresses based on sizes

Calculate carveout addresses somewhat dynamically.

- calculate the carveout addresses based on starting or ending
address and size.

- get the tiler2D and nonsecure tiler2D sizes from a separate
platform config variable

- lay out nonsecure tiler2D carveout before tiler2D carvout.
This allows only aligning the sum of these two carveout to
2MB, instead of the size of each.

Change-Id: I38c12459e6229ab9ef2deb89c0bce712e424a2a9
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>

Conflicts:
	arch/arm/mach-omap2/include/mach/omap4_ion.h
omap4_ion.h configurable OMAP4_ION_HEAP_TILER_SIZE
omap: common: add kernel API to query RAM size

Add kernel api omap_total_ram_size() to query the
exact size of physical ram available in system.
Its derived from mem arguments passed to kernel via
bootargs and is expected to be used by board files and drivers.
Note: omap_init_ram_size() has to be invoked at the earliest
during board init to update memory size.

Change-Id: I8511fd66ba51343bc64a58db04994af930cbe709
Signed-off-by: Devaraj Rangasamy <dev@ti.com>

Conflicts:
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-44xx-tablet.c
	arch/arm/mach-omap2/board-omap4panda.c
build fix
omap: Add ION system heap to omap board file

gives ion clients access to system heap for allocation
instead of being restricted to pre-allocated carveouts

Change-Id: I560e7b8cda1b561d737b9c5bc427b5cbf2591731
Signed-off-by: David Schleef <ds@ti.com>
tuna: use the new ion allocator

Conflicts:
	arch/arm/mach-omap2/board-tuna.c
x
x