diff --git a/common/board_r.c b/common/board_r.c
index b471bb08..d3adf839 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -84,6 +84,13 @@ struct boardcfg_t {
 };
 
 static struct spi_flash *flash;
+
+#ifdef BYPASS_ADV_LOADER
+#define SABRESD_NANDF_CS0       IMX_GPIO_NR(6, 11) //GPIO6_11
+#define SABRESD_NANDF_CS1       IMX_GPIO_NR(6, 14) //GPIO6_14
+#define SABRESD_NANDF_CS2       IMX_GPIO_NR(6, 15) //GPIO6_15
+#endif
+
 #endif /* CONFIG_ADVANTECH */
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -122,6 +129,104 @@ static int initr_secondary_cpu(void)
 	return 0;
 }
 
+#ifdef BYPASS_ADV_LOADER
+int mmc_check(int dev)
+{
+        struct mmc *mmc = find_mmc_device(dev);
+	if(mmc_init(mmc))
+		return 0;
+	else
+                return 1;
+}
+
+void set_boot_device(void)
+{
+#ifdef CONFIG_BOOT_SELECT
+        int board_cs0, board_cs1, board_cs2;
+
+        gpio_request(SABRESD_NANDF_CS0, "Board_CS0");
+        gpio_direction_input(SABRESD_NANDF_CS0);
+
+        gpio_request(SABRESD_NANDF_CS1, "Board_CS1");
+        gpio_direction_input(SABRESD_NANDF_CS1);
+
+        gpio_request(SABRESD_NANDF_CS2, "Board_CS2");
+        gpio_direction_input(SABRESD_NANDF_CS2);
+
+        board_cs0 = gpio_get_value(SABRESD_NANDF_CS0);
+        board_cs1 = gpio_get_value(SABRESD_NANDF_CS1);
+        board_cs2 = gpio_get_value(SABRESD_NANDF_CS2);
+
+        printf("Boot_Switch: cs0=%d,cs1=%d,cs2=%d\n",board_cs0,board_cs1,board_cs2);
+        //--------------------------------------------------------------------
+
+        if((!board_cs2)&&(!board_cs1)&&(!board_cs0))            //Carrier SATA//
+        {
+                *(int *)0x22200000 = 0x02;
+        }
+        else if((!board_cs2)&&(!board_cs1)&&(board_cs0))        //Carrier SD Card//
+        {
+                *(int *)0x22200000 = 0x01;
+        }
+        else if((!board_cs2)&&(board_cs1)&&(!board_cs0))        //Carrier eMMC Flash//
+        {
+                printf("booting from Carrier eMMC Flash\n");
+        }
+        else if((!board_cs2)&&(board_cs1)&&(board_cs0))         //Carrier SPI//
+        {
+                *(int *)0x22200000 = 0x04;
+        }
+        else if((board_cs2)&&(!board_cs1)&&(!board_cs0))        //Module device//
+        {
+                printf("booting from Module device\n");
+        }
+        else if((board_cs2)&&(!board_cs1)&&(board_cs0))         //Remote boot//
+        {
+                printf("booting from Remote boot\n");
+        }
+        else if((board_cs2)&&(board_cs1)&&(!board_cs0))         //Module eMMC Flash//
+        {
+                *(int *)0x22200000 = 0x03;
+        }
+        else if((board_cs2)&&(board_cs1)&&(board_cs0))          //Module SPI//
+        {
+                printf("booting from Module SPI\n");
+        }
+        else
+        {
+                printf("booting not support\n");
+        }
+#else
+        printf("BOOT_DEVICE_AUTO\n");
+        /* 1. SD card */
+        if (mmc_check(CONFIG_SD_DEV_NUM)) {
+                *(int *)0x22200000 = 0x01;
+        } else
+        /* 5. Carrier SD card for ROM-7421 */
+#ifdef CONFIG_CARRIERSD_DEV_NUM
+        if (mmc_check(CONFIG_CARRIERSD_DEV_NUM)) {
+                *(int *)0x22200000 = 0x05;
+        } else
+#endif
+        /* 2. SATA disk */
+#ifdef CONFIG_SATA_DEV_NUM
+        if (!init_sata(CONFIG_SATA_DEV_NUM)) {
+                *(int *)0x22200000 = 0x02;
+        } else
+#endif
+        /* 3. eMMC flash */
+        if(mmc_check(CONFIG_EMMC_DEV_NUM)) {
+                *(int *)0x22200000 = 0x03;
+        } else
+        {
+                printf("No bootable device is found!\n");
+                hang();
+        }
+
+#endif
+}
+#endif //BYPASS_ADV_LOADER
+
 static int initr_trace(void)
 {
 #ifdef CONFIG_TRACE
@@ -833,6 +938,7 @@ static int initr_check_fastboot(void)
 }
 #endif
 
+
 #ifdef CONFIG_ADVANTECH
 int check_emmc_exist(void)
 {
@@ -857,9 +963,9 @@ int board_set_boot_device(void)
 	char uboot_version[128];
 	char *pch,*s;
 	 
+	set_boot_device();
 	int dev = (*(int *)0x22200000);
 	int emmc_exist = 0;
-
 	/* log uboot version */
 	strncpy(advboot_version, (void *)0x22300000, 128);
 
diff --git a/include/configs/mx6rom5420.h b/include/configs/mx6rom5420.h
index 6170a0c6..102b91fd 100644
--- a/include/configs/mx6rom5420.h
+++ b/include/configs/mx6rom5420.h
@@ -60,6 +60,12 @@
 /* don't use pmic */
 #undef CONFIG_LDO_BYPASS_CHECK
 
+/* By-pass adv-loader */
+#define BYPASS_ADV_LOADER
+#ifdef BYPASS_ADV_LOADER
+#define CONFIG_BOOT_SELECT
+#endif
+
 /* support SPI boot */
 #ifdef CONFIG_MX6Q
 #define CONFIG_SPI_BOOT
