aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2012-01-07 11:52:53 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2012-01-07 11:52:53 +0700
commit10fd786bd425a310b63eb6be4bb8ccf9f7c92f39 (patch)
tree45f8c02ad73c07ac8781d01c50595bcf0cc20a1e /arch/arm/mach-s5pv210
parentcfc1e3fd257bffbf6d8ce7865a7b9b2817eed617 (diff)
downloadkernel_samsung_aries-10fd786bd425a310b63eb6be4bb8ccf9f7c92f39.zip
kernel_samsung_aries-10fd786bd425a310b63eb6be4bb8ccf9f7c92f39.tar.gz
kernel_samsung_aries-10fd786bd425a310b63eb6be4bb8ccf9f7c92f39.tar.bz2
aries: Add bootmode injection support
Allows reboot recovery to work without /cache/.startrecovery hack - Renames s3c_usb_set_serial to aries_inject_cmdline
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r--arch/arm/mach-s5pv210/mach-aries.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/mach-s5pv210/mach-aries.c b/arch/arm/mach-s5pv210/mach-aries.c
index 7908c07..eb46197 100644
--- a/arch/arm/mach-s5pv210/mach-aries.c
+++ b/arch/arm/mach-s5pv210/mach-aries.c
@@ -146,9 +146,7 @@ static int aries_notifier_call(struct notifier_block *this,
if ((code == SYS_RESTART) && _cmd) {
if (!strcmp((char *)_cmd, "recovery"))
- mode = REBOOT_MODE_RECOVERY;
- else if (!strcmp((char *)_cmd, "bootloader"))
- mode = REBOOT_MODE_FAST_BOOT;
+ mode = 2; // It's not REBOOT_MODE_RECOVERY, blame Samsung
else
mode = REBOOT_MODE_NONE;
}
@@ -5176,12 +5174,26 @@ static void aries_pm_restart(char mode, const char *cmd)
arm_machine_restart(mode, cmd);
}
+// Ugly hack to inject parameters (e.g. device serial, bootmode) into /proc/cmdline
+static void __init aries_inject_cmdline(void) {
+ char *new_command_line;
+ int size;
+
+ size = strlen(boot_command_line);
+ new_command_line = kmalloc(size + 40 + 11, GFP_KERNEL);
+ strcpy(new_command_line, saved_command_line);
+ size += sprintf(new_command_line + size, " androidboot.serialno=%08X%08X",
+ system_serial_high, system_serial_low);
+ size += sprintf(new_command_line + size, " bootmode=%d", __raw_readl(S5P_INFORM6));
+ saved_command_line = new_command_line;
+}
+
static void __init aries_machine_init(void)
{
arm_pm_restart = aries_pm_restart;
setup_ram_console_mem();
- s3c_usb_set_serial();
+ aries_inject_cmdline();
platform_add_devices(aries_devices, ARRAY_SIZE(aries_devices));
/* smb380 */