s5p: add info action for special function
authorDonghwa Lee <dh09.lee@samsung.com>
Mon, 29 Nov 2010 05:34:26 +0000 (14:34 +0900)
committerDonghwa Lee <dh09.lee@samsung.com>
Mon, 29 Nov 2010 05:34:26 +0000 (14:34 +0900)
- It can be used SD boot and log display for lcd function

arch/arm/lib/board.c
include/common.h
include/configs/s5pc110_universal.h
include/configs/s5pc210_universal.h

index ae7886c..9580e74 100644 (file)
@@ -671,6 +671,31 @@ void board_init_f (ulong bootflag)
 static char *failed = "*** failed ***\n";
 #endif
 
+static void info_action_check()
+{
+       struct info_action *ia = (struct info_action *) CONFIG_INFO_ADDRESS;
+       struct mmc *mmc = find_mmc_device(1);
+
+       if (ia->magic == INFO_ACTION_MAGIC) {
+               switch (ia->action) {
+               case INFO_ACTION_SDCARD_BOOT:
+                       if (!mmc)
+                               printf("sdcard scan failed\n");
+                       else {
+                               mmc_init(mmc);
+                               printf("sdcard scan success\n");
+                               run_command("run loaduimage", 0);
+                               run_command("run sdboot", 0);
+                       }
+                       break;
+               case INFO_ACTION_LCD_CONSOLE:
+                       break;
+               default:
+                       break;
+               }
+       }
+}
+
 /************************************************************************
  *
  * This is the next part if the initialization sequence: we are now
@@ -873,6 +898,7 @@ extern void davinci_eth_set_mac_addr (const u_int8_t *addr);
 #ifdef CONFIG_BITBANGMII
        bb_miiphy_init();
 #endif
+       info_action_check();
 #if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        puts ("Net:   ");
index 0686a17..d764cec 100644 (file)
@@ -210,6 +210,18 @@ typedef void (interrupt_handler_t)(void *);
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})
 
+#define INFO_ACTION_MAGIC      0xcafe
+
+struct info_action {
+       u16 magic;
+       u16 action;
+};
+
+enum {
+       INFO_ACTION_RESERVED,           /* Since action should be start 1 */
+       INFO_ACTION_SDCARD_BOOT,
+       INFO_ACTION_LCD_CONSOLE,
+};
 /*
  * Function Prototypes
  */
index 2718ffa..9fffc93 100644 (file)
 #define CONFIG_SERIAL_MULTI    1
 #define CONFIG_SERIAL2          1      /* we use SERIAL 2 on S5PC100 */
 
+/* INFORM0~3 registers are cleared by asserting XnRESET pin */
+/* INFORM4~7 registers are cleared only by power-up reset */
+#define CONFIG_INFO_ADDRESS            0xE010F010      /* INFORM4 */
+
 /* 
  * spi gpio 
  */
 
 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
 
-#define CONFIG_BOOTCOMMAND \
-       "if mmc rescan 1; then " \
-               "if run loaduimage; then " \
-                       "run sdboot; " \
-               "else run ubifsboot; " \
-               "fi; " \
-       "else run ubifsboot; fi"
+#define CONFIG_BOOTCOMMAND "run ubifsboot"
 
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
 
index 42dcbdb..3a4fe42 100644 (file)
 #define CONFIG_SERIAL_MULTI    1
 #define CONFIG_SERIAL2          1      /* we use SERIAL 2 on S5PC210 */
 
+/* INFORM0~3 registers are cleared by asserting XnRESET pin */
+/* INFORM4~7 registers are cleared only by power-up reset */
+#define CONFIG_INFO_ADDRESS            0x10020810      /* INFORM4 */
+
 /* 
  * spi gpio 
  */
 
 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
 
-#define CONFIG_BOOTCOMMAND \
-       "if mmc rescan 1; then " \
-               "if run loaduimage; then " \
-                       "run sdboot; " \
-               "else run ubifsboot; " \
-               "fi; " \
-       "else run ubifsboot; fi"
+#define CONFIG_BOOTCOMMAND "run ubifsboot"
 
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"