summaryrefslogtreecommitdiff
path: root/include/part.h
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2011-08-12 12:54:58 +0800
committerTerry Lv <r65388@freescale.com>2011-09-01 11:45:02 +0800
commit72ac6998a7700c2c64a4a7f4d6d44bbc980558f6 (patch)
tree1c07090998bd507e3cde3c481e0fa859ec25a3d5 /include/part.h
parentd187eb3675f1408d206e9013bcde38793f5d1ca8 (diff)
downloadu-boot-imx-72ac6998a7700c2c64a4a7f4d6d44bbc980558f6.zip
u-boot-imx-72ac6998a7700c2c64a4a7f4d6d44bbc980558f6.tar.gz
u-boot-imx-72ac6998a7700c2c64a4a7f4d6d44bbc980558f6.tar.bz2
ENGR00154666-3: Align u-boot mmc command with community
This patch will enhance mmc command. 1. Add erase command. 2. Abandon dev_no in mmc command. User need to switch slot with "mmc dev" command. 3. Add mmc part switch command. Enhance partition switch support. 4. Add mmc bootpart. Boot partition support is more flexible. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'include/part.h')
-rw-r--r--include/part.h75
1 files changed, 48 insertions, 27 deletions
diff --git a/include/part.h b/include/part.h
index 3cdae02..e68ddcc 100644
--- a/include/part.h
+++ b/include/part.h
@@ -2,6 +2,8 @@
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
+ * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -49,6 +51,9 @@ typedef struct block_dev_desc {
unsigned long start,
lbaint_t blkcnt,
const void *buffer);
+ unsigned long (*block_erase)(int dev,
+ unsigned long start,
+ lbaint_t blkcnt);
void *priv; /* driver private struct pointer */
}block_dev_desc_t;
@@ -93,55 +98,71 @@ typedef struct disk_partition {
} disk_partition_t;
/* Misc _get_dev functions */
-block_dev_desc_t* get_dev(char* ifname, int dev);
-block_dev_desc_t* ide_get_dev(int dev);
-block_dev_desc_t* sata_get_dev(int dev);
-block_dev_desc_t* scsi_get_dev(int dev);
-block_dev_desc_t* usb_stor_get_dev(int dev);
-block_dev_desc_t* mmc_get_dev(int dev);
-block_dev_desc_t* systemace_get_dev(int dev);
-block_dev_desc_t* mg_disk_get_dev(int dev);
+#ifdef CONFIG_PARTITIONS
+block_dev_desc_t *get_dev(char* ifname, int dev);
+block_dev_desc_t *ide_get_dev(int dev);
+block_dev_desc_t *sata_get_dev(int dev);
+block_dev_desc_t *scsi_get_dev(int dev);
+block_dev_desc_t *usb_stor_get_dev(int dev);
+block_dev_desc_t *mmc_get_dev(int dev);
+block_dev_desc_t *systemace_get_dev(int dev);
+block_dev_desc_t *mg_disk_get_dev(int dev);
/* disk/part.c */
-int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part (block_dev_desc_t *dev_desc);
-void init_part (block_dev_desc_t *dev_desc);
+int get_partition_info(block_dev_desc_t *dev_desc, int part, disk_partition_t *info);
+void print_part(block_dev_desc_t *dev_desc);
+void init_part(block_dev_desc_t *dev_desc);
void dev_print(block_dev_desc_t *dev_desc);
-
+#else
+static inline block_dev_desc_t *get_dev(char* ifname, int dev) { return NULL; }
+static inline block_dev_desc_t *ide_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t *sata_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t *scsi_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t *usb_stor_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t *mmc_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t *systemace_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t *mg_disk_get_dev(int dev) { return NULL; }
+
+static inline int get_partition_info(block_dev_desc_t *dev_desc, int part,
+ disk_partition_t *info) { return -1; }
+static inline void print_part(block_dev_desc_t *dev_desc) {}
+static inline void init_part(block_dev_desc_t *dev_desc) {}
+static inline void dev_print(block_dev_desc_t *dev_desc) {}
+#endif
#ifdef CONFIG_MAC_PARTITION
/* disk/part_mac.c */
-int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_mac (block_dev_desc_t *dev_desc);
-int test_part_mac (block_dev_desc_t *dev_desc);
+int get_partition_info_mac(block_dev_desc_t *dev_desc, int part, disk_partition_t *info);
+void print_part_mac(block_dev_desc_t *dev_desc);
+int test_part_mac(block_dev_desc_t *dev_desc);
#endif
#ifdef CONFIG_DOS_PARTITION
/* disk/part_dos.c */
-int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_dos (block_dev_desc_t *dev_desc);
-int test_part_dos (block_dev_desc_t *dev_desc);
+int get_partition_info_dos(block_dev_desc_t *dev_desc, int part, disk_partition_t *info);
+void print_part_dos(block_dev_desc_t *dev_desc);
+int test_part_dos(block_dev_desc_t *dev_desc);
#endif
#ifdef CONFIG_ISO_PARTITION
/* disk/part_iso.c */
-int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_iso (block_dev_desc_t *dev_desc);
-int test_part_iso (block_dev_desc_t *dev_desc);
+int get_partition_info_iso(block_dev_desc_t *dev_desc, int part, disk_partition_t *info);
+void print_part_iso(block_dev_desc_t *dev_desc);
+int test_part_iso(block_dev_desc_t *dev_desc);
#endif
#ifdef CONFIG_AMIGA_PARTITION
/* disk/part_amiga.c */
-int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_amiga (block_dev_desc_t *dev_desc);
-int test_part_amiga (block_dev_desc_t *dev_desc);
+int get_partition_info_amiga(block_dev_desc_t *dev_desc, int part, disk_partition_t *info);
+void print_part_amiga(block_dev_desc_t *dev_desc);
+int test_part_amiga(block_dev_desc_t *dev_desc);
#endif
#ifdef CONFIG_EFI_PARTITION
/* disk/part_efi.c */
-int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_efi (block_dev_desc_t *dev_desc);
-int test_part_efi (block_dev_desc_t *dev_desc);
+int get_partition_info_efi(block_dev_desc_t *dev_desc, int part, disk_partition_t *info);
+void print_part_efi(block_dev_desc_t *dev_desc);
+int test_part_efi(block_dev_desc_t *dev_desc);
#endif
#endif /* _PART_H */