aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/android/persistent_ram.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-05-17staging: android: persistent_ram: Move to fs/pstore/ram_core.cAnton Vorontsov1-82/+0
This is a first step for adding ECC support for pstore RAM backend: we will use the persistent_ram routines, kindly provided by Google. Basically, persistent_ram is a set of helper routines to deal with the [optionally] ECC-protected persistent ram regions. A bit of Makefile, Kconfig and header files adjustments were needed because of the move. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16staging: android: persistent_ram: Remove never used struct persistent_ram_zone membersAnton Vorontsov1-2/+0
Remove 'old_log_footer_size' and 'early' members of struct persistent_ram_zone, as these were never used at all. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14staging: android: persistent_ram: Introduce persistent_ram_free()Anton Vorontsov1-0/+3
A corresponding function to persistent_ram_new(). Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14staging: android: persistent_ram: Introduce persistent_ram_new()Anton Vorontsov1-0/+4
The routine just creates a persistent ram zone at a specified address. For persistent_ram_init_ringbuffer() we'd need to add a 'struct persistent_ram' to the global list, and associate it with a device. We don't need all this complexity in pstore_ram, so we introduce the simple function. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14persistent_ram: Remove prz->nodeAnton Vorontsov1-1/+0
The 'node' struct member is unused, so remove it. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: persistent_ram: handle reserving and mapping memoryColin Cross1-2/+22
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>
2012-03-08staging: android: persistent_ram: refactor ecc supportColin Cross1-3/+9
Remove CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION and related #ifdefs. Also allow persistent ram zones without ecc enabled. For some use cases, like the data portion of the upcoming persistent_vars patches, or a persistent ftrace ringbuffer, ecc on every update is too expensive. 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>
2012-03-08staging: android: ram_console: split out persistent ramColin Cross1-0/+52
Split ram_console into two halves. persistent_ram is a set of apis that handle a block of memory that does not get erased across a reboot. It provides functions to fill it as a single buffer or a ring buffer, and to extract the old data after a reboot. It handles ecc on the data to correct bit errors introduced during reboot. ram_console is now a small wrapper around persistent_ram that feeds console data into the ringbuffer, and exports the old data to /proc/last_kmsg after a reboot. [jstultz: Moved persistent_ram.h to staging dir] 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>