From 72ac6998a7700c2c64a4a7f4d6d44bbc980558f6 Mon Sep 17 00:00:00 2001 From: Terry Lv Date: Fri, 12 Aug 2011 12:54:58 +0800 Subject: 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 --- include/part.h | 75 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 27 deletions(-) (limited to 'include/part.h') 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 */ -- cgit v1.1