]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/psdkla-u-boot.git/commitdiff
U-boot: Put NAND functions under storage-type check
authorMoiz Sonasath <m-sonasath@ti.com>
Fri, 16 Jul 2010 17:05:45 +0000 (12:05 -0500)
committerVikram Pandita <vikram.pandita@ti.com>
Tue, 10 Aug 2010 18:00:35 +0000 (13:00 -0500)
This patch introduces NO functionality changes. It just puts
the execution of NAND erase/write functions under storage
medium check (#if defined CONFIG_STORAGE_NAND).

Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
common/cmd_fastboot.c

index 1d809d8ef3b39a0f209d3e7353c927f64679286d..12f6314051f9ed7c1564c1cb8c0f6c6e9e3d4032 100644 (file)
@@ -64,7 +64,9 @@
 /* Use do_reset for fastboot's 'reboot' command */
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 /* Use do_nand for fastboot's flash commands */
+#if defined(CONFIG_STORAGE_NAND)
 extern int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+#endif
 /* Use do_setenv and do_saveenv to permenantly save data */
 int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -758,6 +760,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                                printf ("\ndownloading of %d bytes finished\n",
                                        download_bytes);
 
+#if defined(CONFIG_STORAGE_NAND)
                                /* Pad to block length
                                   In most cases, padding the download to be
                                   block aligned is correct. The exception is
@@ -787,6 +790,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                                                }
                                        }
                                }
+#endif
                        }
 
                        /* Provide some feedback */
@@ -878,6 +882,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                   Board has to set up flash partitions */
 
                if(memcmp(cmdbuf, "erase:", 6) == 0){
+#if defined(CONFIG_STORAGE_NAND)
                        struct fastboot_ptentry *ptn;
 
                        ptn = fastboot_flash_find_ptn(cmdbuf + 6);
@@ -927,6 +932,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                                }
                        
                        }
+#endif
                        ret = 0;
                }
 
@@ -1058,7 +1064,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                   Flash what was downloaded */
 
                if(memcmp(cmdbuf, "flash:", 6) == 0) {
-
+#if defined(CONFIG_STORAGE_NAND)
                        if (download_bytes) 
                        {
                                struct fastboot_ptentry *ptn;
@@ -1100,7 +1106,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                        {
                                sprintf(response, "FAILno image downloaded");
                        }
-
+#endif
                        ret = 0;
                }
 
@@ -1116,7 +1122,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                   Upload just the data in a partition */
                if ((memcmp(cmdbuf, "upload:", 7) == 0) ||
                    (memcmp(cmdbuf, "uploadraw:", 10) == 0)) {
-
+#if defined(CONFIG_STORAGE_NAND)
                        unsigned int adv, delim_index, len;
                        struct fastboot_ptentry *ptn;
                        unsigned int is_raw = 0;
@@ -1253,6 +1259,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
                                        sprintf(response, "DATA%08x", size);
                                }
                        }
+#endif
                        ret = 0;
                }