]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: common: mmc: remove debug code
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Apr 2014 08:22:12 +0000 (10:22 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Apr 2014 08:22:12 +0000 (10:22 +0200)
board/karo/common/mmc.c

index 635220e24bf733c9d8a06df47696376a6e3c311a..eb8804384cf0e0a00d490f22cf600958c453a16f 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
-*/
+ */
 
 #include <common.h>
 #include <errno.h>
 #include <libfdt.h>
 #include <fdt_support.h>
-//#include <nand.h>
 #include <mmc.h>
 #include <mxcfb.h>
 #include <linux/list.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void __maybe_unused memdmp(void *addr, size_t len)
-{
-       size_t i;
-
-       for (i = 0; i < len; i+= 16) {
-               size_t j;
-               u32 *wp = addr + i;
-
-               debug("%p: ", addr + i);
-               for (j = 0; j < 4; j++) {
-                       debug(" %08x", wp[j]);
-               }
-               debug("\n");
-       }
-}
-
 #define MAX_SEARCH_PARTITIONS 16
 
 static int find_efi_partition(const char *ifname, int devno, const char *part_str,
@@ -61,8 +44,6 @@ static int find_efi_partition(const char *ifname, int devno, const char *part_st
        int part;
        block_dev_desc_t *dd;
 
-printf("Searching for partition '%s'\n", part_str);
-
        dd = get_dev(ifname, devno);
        if (!dd || dd->type == DEV_TYPE_UNKNOWN) {
                printf("** Bad device %s %d **\n", ifname, devno);
@@ -113,6 +94,7 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
        disk_partition_t part_info;
        int devno = CONFIG_MMC_BOOT_DEV;
        uint blk_start, blk_cnt;
+       block_dev_desc_t *mmc_dev;
 
        mmc = find_mmc_device(devno);
        if (!mmc) {
@@ -122,10 +104,6 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
 
        mmc_init(mmc);
 
-//     mmc_boot_part_access(mmc, 1, part_num, part_num);
-#if 1
-       block_dev_desc_t *mmc_dev;
-
        ret = find_efi_partition("mmc", devno, part, &mmc_dev, &part_info);
        if (ret < 0) {
                printf("eMMC partition '%s' not found: %d\n", part, ret);
@@ -136,30 +114,22 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
        blk_start = 0;
        blk_cnt = DIV_ROUND_UP(len, part_info.blksz);
 
-       printf("Using mmc%d blksz %lu blks %lu\n", devno,
-               mmc_dev->blksz, mmc_dev->lba);
-#endif
        debug("Found partition '%s': offset=%08x size=%08lx\n",
                part, blk_start, part_info.size);
-       if (part_info.size < blk_cnt) {
-               printf("Warning: partition '%s' smaller than requested size: %u; truncating data to %lu blocks\n",
-                       part, len, part_info.size * mmc->read_bl_len);
+       if (part_info.size < blk_cnt)
                blk_cnt = part_info.size;
-       }
 
        debug("Reading %u blks from MMC partition '%s' offset %u to %p\n",
                blk_cnt, part, blk_start, addr);
        ret = mmc->block_dev.block_read(devno, blk_start, blk_cnt, addr);
        if (ret == 0) {
                printf("Failed to read MMC partition %s\n", part);
+               ret = -EIO;
                goto out;
        }
        debug("Read %u byte from partition '%s' @ offset %08x\n",
                ret * mmc->read_bl_len, part, blk_start);
-       memdmp(addr, 512);
-       ret = 0;
 out:
-//     mmc_boot_part_access(mmc, 1, part_num, 0);
        mmc_switch_part(devno, 0);
-       return ret;
+       return ret < 0 ? ret : 0;
 }