KEXEC: add support for (and enable) KEXEC with RAM CONSOLE
/arch/arm/mach-msm/board-m2_vzw.c
blob:b1e806f61725f45c5d96f00f15f94aa16511044e -> blob:6879c73bdad14639e06443d0f403669b574b37f0
--- arch/arm/mach-msm/board-m2_vzw.c
+++ arch/arm/mach-msm/board-m2_vzw.c
@@ -172,6 +172,9 @@
#include <linux/sec_jack.h>
#endif
+#ifdef CONFIG_KEXEC_HARDBOOT
+#include <asm/kexec.h>
+#endif
#ifdef CONFIG_TOUCHSCREEN_MMS144
struct tsp_callbacks *charger_callbacks;
struct tsp_callbacks {
@@ -1051,6 +1054,25 @@ static int __init ext_display_setup(char
}
early_param("ext_display", ext_display_setup);
+/* Exclude the last 4 kB to preserve the kexec hardboot page. */
+#ifdef CONFIG_ANDROID_RAM_CONSOLE
+#define RAM_CONSOLE_START 0xfff00000
+#define RAM_CONSOLE_SIZE (SZ_1M-SZ_4K)
+
+static struct resource ram_console_resource[] = {
+ {
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device ram_console_device = {
+ .name = "ram_console",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(ram_console_resource),
+ .resource = ram_console_resource,
+};
+#endif
+
unsigned int address = 0xea000000;
unsigned int size = 0x100000;
@@ -1076,6 +1098,17 @@ static void __init msm8960_reserve(void)
ret = memblock_remove(address, size);
BUG_ON(ret);
}
+
+#ifdef CONFIG_ANDROID_RAM_CONSOLE
+ if (memblock_remove(RAM_CONSOLE_START, RAM_CONSOLE_SIZE) == 0) {
+ ram_console_resource[0].start = RAM_CONSOLE_START;
+ ram_console_resource[0].end = RAM_CONSOLE_START+RAM_CONSOLE_SIZE-1;
+ }
+#endif
+
+#ifdef CONFIG_KEXEC_HARDBOOT
+ memblock_remove(KEXEC_HB_PAGE_ADDR, SZ_4K);
+#endif
}
static int msm8960_change_memory_power(u64 start, u64 size,
@@ -4465,6 +4498,9 @@ static struct platform_device *m2_vzw_de
#ifdef CONFIG_VIBETONZ
&vibetonz_device,
#endif /* CONFIG_VIBETONZ */
+#ifdef CONFIG_ANDROID_RAM_CONSOLE
+ &ram_console_device,
+#endif
};
static void __init msm8960_i2c_init(void)