staging: android: persistent_ram: handle reserving and mapping memory
authorColin Cross <ccross@android.com>
Thu, 8 Mar 2012 01:34:34 +0000 (17:34 -0800)
committerGrazvydas Ignotas <notasas@gmail.com>
Wed, 25 Apr 2012 22:25:02 +0000 (01:25 +0300)
commita3abddf0b231787ddb1e36189060aba122904581
treedab9bed049fb6527cb88b45921cf31d5a7c80386
parent4b75d3ef7a1f295738c8c7d7f55c9ada23460b24
staging: android: persistent_ram: handle reserving and mapping memory

Replace the ioremapped memory passed in from the drivers with
a memblock_reserve and vmap.  Adds a new function,
persistent_ram_early_init, designed to be called from the machine
init_early callback, that calls memblock_remove and saves the
provided persistent ram area layout.

Drivers only pass in their struct device * and ecc settings.
Locating and mapping the memory is now handled entirely within
persistent_ram.

Also, convert ram_console to the new persistent_ram_init
parameters that only take a struct device * and ecc settings.

[jstultz: Fix pr_info casting issues on 64bit, folded two
patches as the build breaks if they are apart. Also replaced
phys_to_page() w/ pfn_to_page(addr>>PAGE_SHIFT), as phys_to_page
is only on a few arches.]
CC: Greg KH <gregkh@linuxfoundation.org>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/persistent_ram.c
drivers/staging/android/persistent_ram.h
drivers/staging/android/ram_console.c