rk29: add board_boot_mode API
author黄涛 <huangtao@rock-chips.com>
Sat, 22 Jan 2011 08:13:03 +0000 (16:13 +0800)
committer黄涛 <huangtao@rock-chips.com>
Tue, 25 Jan 2011 12:12:08 +0000 (20:12 +0800)
arch/arm/mach-rk29/devices.c
arch/arm/mach-rk29/include/mach/board.h

index 73008be7b96b81bd6155bcc6086b9d41f9fe9178..fc2258670367e6c8e5c86073b2bf99db9eed732e 100755 (executable)
@@ -23,6 +23,7 @@
 #include <mach/rk29_iomap.h>
 #include <mach/rk29-dma-pl330.h> 
 #include <mach/rk29_camera.h>                          /* ddl@rock-chips.com : camera support */
+#include <mach/board.h>
 #include "devices.h"
 #ifdef CONFIG_ADC_RK29
 static struct resource rk29_adc_resource[] = {
@@ -718,3 +719,29 @@ struct platform_device rk29_device_usb20_host = {
 };
 #endif
 
+static int boot_mode;
+static int __init boot_mode_init(char *s)
+{
+       if (!strcmp(s, "normal"))
+               boot_mode = BOOT_MODE_NORMAL;
+       else if (!strcmp(s, "factory2"))
+               boot_mode = BOOT_MODE_FACTORY2;
+       else if (!strcmp(s, "recovery"))
+               boot_mode = BOOT_MODE_RECOVERY;
+       else if (!strcmp(s, "charge"))
+               boot_mode = BOOT_MODE_CHARGE;
+       else if (!strcmp(s, "power_test"))
+               boot_mode = BOOT_MODE_POWER_TEST;
+       else if (!strcmp(s, "offmode_charging"))
+               boot_mode = BOOT_MODE_OFFMODE_CHARGING;
+
+       return 1;
+}
+__setup("androidboot.mode=", boot_mode_init);
+
+int board_boot_mode(void)
+{
+       return boot_mode;
+}
+EXPORT_SYMBOL(board_boot_mode);
+
index eaa56d7895cf09f0098de076921579c0a8d48997..a971ffe2b6e663211b3236fcc4809cbf32180696 100755 (executable)
@@ -169,4 +169,12 @@ struct akm8975_platform_data {
 void __init rk29_map_common_io(void);
 void __init rk29_clock_init(void);
 
+#define BOOT_MODE_NORMAL               0
+#define BOOT_MODE_FACTORY2             1
+#define BOOT_MODE_RECOVERY             2
+#define BOOT_MODE_CHARGE               3
+#define BOOT_MODE_POWER_TEST           4
+#define BOOT_MODE_OFFMODE_CHARGING     5
+int board_boot_mode(void);
+
 #endif