60 lines
1.9 KiB
C
60 lines
1.9 KiB
C
#ifndef _PART_H
|
|||
|
|
#define _PART_H
|
||
|
|
#include <linux/types.h>
|
||
|
|
#include <common.h>
|
||
|
|
#define IF_TYPE_UNKNOWN 0
|
||
|
|
#define IF_TYPE_MMC 6
|
||
|
|
#define PART_TYPE_EFI 0x05
|
||
|
|
|
||
|
|
#define PAD_TO_BLOCKSIZE(size, block_dev_desc) \
|
||
|
|
(PAD_SIZE(size, block_dev_desc->blksz))
|
||
|
|
typedef struct block_dev_desc {
|
||
|
|
int if_type;
|
||
|
|
int dev;
|
||
|
|
unsigned char part_type;
|
||
|
|
unsigned char target; /* It is SCSI ID */
|
||
|
|
unsigned char lun; /* target's LUN */
|
||
|
|
unsigned char type;
|
||
|
|
unsigned char removable; /* removable device */
|
||
|
|
#ifdef CONFIG_LBA48
|
||
|
|
unsigned char lba48; /* 48bits addr (ATA/ATAPI v7) */
|
||
|
|
#endif
|
||
|
|
ulong lba; /* number of blk */
|
||
|
|
unsigned long blksz; /* blk size */
|
||
|
|
int log2blksz;
|
||
|
|
char vendor [40+1]; /* IDE model, Vendor of SCSI*/
|
||
|
|
char product[20+1]; /* IDE Serial Num, product of SCSI */
|
||
|
|
char revision[8+1]; /* fireware's revision */
|
||
|
|
unsigned long (*block_read)(int blk_dev,
|
||
|
|
ulong start_blk,
|
||
|
|
ulong blk_cnt,
|
||
|
|
void *buffer);
|
||
|
|
unsigned long (*block_write)(int blk_dev,
|
||
|
|
ulong start_blk,
|
||
|
|
ulong blk_cnt,
|
||
|
|
const void *buffer);
|
||
|
|
unsigned long (*block_erase)(int blk_dev,
|
||
|
|
ulong start_blk,
|
||
|
|
ulong blk_cnt);
|
||
|
|
void *priv; /* driver private struct pointer */
|
||
|
|
}block_dev_desc_t;
|
||
|
|
typedef struct disk_partition {
|
||
|
|
ulong start; /* # of first block in partition */
|
||
|
|
ulong size; /* number of blocks in partition */
|
||
|
|
ulong blksz; /* block size in bytes */
|
||
|
|
uint8_t name[32]; /* partition name */
|
||
|
|
uint8_t type[32]; /* string type description */
|
||
|
|
int bootable; /* Active/Bootable flag is set */
|
||
|
|
#ifdef CONFIG_PARTITION_UUIDS
|
||
|
|
char uuid[37]; /* filesystem UUID as string, if exists */
|
||
|
|
#endif
|
||
|
|
} disk_partition_t;
|
||
|
|
#endif /* _PART_H */
|
||
|
|
extern block_dev_desc_t *get_dev();
|
||
|
|
#ifdef CONFIG_UFS_LOGICAL_SET
|
||
|
|
extern block_dev_desc_t *get_dev_by_partition(uchar *partition_name);
|
||
|
|
#endif
|
||
|
|
extern int get_partition_info_by_name (block_dev_desc_t *dev_desc, uchar * partition_name,
|
||
|
|
disk_partition_t *info);
|
||
|
|
extern block_dev_desc_t *mmc_get_dev();
|