forked from rubenslte/android_kernel_samsung_msm8226
msm8974: Reserve memory for ramconsole
* Samsung's implementation of ramconsole depends on the device being at DEBUG_LEVEL_HIGH, which makes collecting crash logs from devices in the wild impossible. * Enable the standard ramconsole by reserving persistent ram. Change-Id: I6a6f0afb56ba603e0e4a04bd8ad35ae5876ff73b Signed-off-by: Kevin F. Haggerty <kevin.f.haggerty@gmail.com>
This commit is contained in:
committed by
Francescodario Cuzzocrea
parent
6622e3aad7
commit
d2d13a9f03
@@ -2381,6 +2381,11 @@
|
||||
0xfa00000 0x800000>; /* Address and Size of Hole */
|
||||
};
|
||||
|
||||
ram_console {
|
||||
compatible = "ram_console";
|
||||
bootinfo = <0>;
|
||||
};
|
||||
|
||||
/* uart7: uart@f995d000 { /*BLSP #2, UART #7 */
|
||||
/* compatible = "qcom,msm-hsuart-v14";
|
||||
status = "disabled";
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
#include <mach/socinfo.h>
|
||||
#include <mach/msm_smem.h>
|
||||
#include <linux/module.h>
|
||||
#ifdef CONFIG_ANDROID_PERSISTENT_RAM
|
||||
#include <linux/persistent_ram.h>
|
||||
#endif
|
||||
|
||||
#include "board-dt.h"
|
||||
#include "clock.h"
|
||||
@@ -103,6 +106,41 @@ extern int msm_show_resume_irq_mask;
|
||||
#include "board-patek-keypad.c"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ANDROID_PERSISTENT_RAM
|
||||
/* CONFIG_SEC_DEBUG reserving memory for persistent RAM*/
|
||||
#define PERSISTENT_RAM_BASE 0x7FA00000
|
||||
#define PERSISTENT_RAM_SIZE SZ_1M
|
||||
#define RAM_CONSOLE_SIZE (124*SZ_1K * 2)
|
||||
|
||||
static struct persistent_ram_descriptor per_ram_descs[] __initdata = {
|
||||
#ifdef CONFIG_ANDROID_RAM_CONSOLE
|
||||
{
|
||||
.name = "ram_console",
|
||||
.size = RAM_CONSOLE_SIZE,
|
||||
}
|
||||
#endif /* CONFIG_ANDROID_RAM_CONSOLE */
|
||||
};
|
||||
|
||||
static struct persistent_ram per_ram __initdata = {
|
||||
.descs = per_ram_descs,
|
||||
.num_descs = ARRAY_SIZE(per_ram_descs),
|
||||
.start = PERSISTENT_RAM_BASE,
|
||||
.size = PERSISTENT_RAM_SIZE
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ANDROID_RAM_CONSOLE
|
||||
static struct platform_device ram_console_device = {
|
||||
.name = "ram_console",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
void __init add_ramconsole_devices(void)
|
||||
{
|
||||
platform_device_register(&ram_console_device);
|
||||
}
|
||||
#endif /* CONFIG_ANDROID_RAM_CONSOLE */
|
||||
#endif /* CONFIG_ANDROID_PERSISTENT_RAM */
|
||||
|
||||
extern int poweroff_charging;
|
||||
|
||||
#ifdef CONFIG_SEC_S_PROJECT
|
||||
@@ -448,6 +486,9 @@ void __init msm_8974_reserve(void)
|
||||
{
|
||||
reserve_info = &msm8974_reserve_info;
|
||||
of_scan_flat_dt(dt_scan_for_memory_reserve, msm8974_reserve_table);
|
||||
#ifdef CONFIG_ANDROID_PERSISTENT_RAM
|
||||
persistent_ram_early_init(&per_ram);
|
||||
#endif
|
||||
msm_reserve();
|
||||
}
|
||||
|
||||
@@ -593,6 +634,9 @@ void __init msm8974_init(void)
|
||||
samsung_sys_class_init();
|
||||
msm_8974_init_gpiomux();
|
||||
regulator_has_full_constraints();
|
||||
#ifdef CONFIG_ANDROID_RAM_CONSOLE
|
||||
add_ramconsole_devices();
|
||||
#endif
|
||||
board_dt_populate(adata);
|
||||
msm8974_add_drivers();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user