]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_disk.c
mmc: add function to get the number of available mmc interfaces
[karo-tx-uboot.git] / common / cmd_disk.c
index ee4e21551b172000b4cdb6c2f191245529163e4e..8a1fda9f68a412a0afa232df5a6e3c0ed7d69890 100644 (file)
@@ -2,24 +2,7 @@
  * (C) Copyright 2000-2011
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <command.h>
@@ -34,7 +17,9 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
        ulong addr = CONFIG_SYS_LOAD_ADDR;
        ulong cnt;
        disk_partition_t info;
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
        image_header_t *hdr;
+#endif
        block_dev_desc_t *dev_desc;
 
 #if defined(CONFIG_FIT)
@@ -67,7 +52,8 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
               "Name: %.32s  Type: %.32s\n", intf, dev, part, info.name,
               info.type);
 
-       debug("First Block: %ld,  # of blocks: %ld, Block Size: %ld\n",
+       debug("First Block: " LBAFU ",  # of blocks: " LBAFU
+             ", Block Size: %ld\n",
              info.start, info.size, info.blksz);
 
        if (dev_desc->block_read(dev, info.start, 1, (ulong *) addr) != 1) {
@@ -78,6 +64,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
        bootstage_mark(BOOTSTAGE_ID_IDE_PART_READ);
 
        switch (genimg_get_format((void *) addr)) {
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
        case IMAGE_FORMAT_LEGACY:
                hdr = (image_header_t *) addr;
 
@@ -94,6 +81,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
 
                cnt = image_get_image_size(hdr);
                break;
+#endif
 #if defined(CONFIG_FIT)
        case IMAGE_FORMAT_FIT:
                fit_hdr = (const void *) addr;