]>
git.ipfire.org Git - people/ms/u-boot.git/blob - include/blk.h
fd545202eb4f8ae3cd7539950c764a5d1f729f34
2 * (C) Copyright 2000-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
11 #ifdef CONFIG_SYS_64BIT_LBA
12 typedef uint64_t lbaint_t
;
13 #define LBAFlength "ll"
15 typedef ulong lbaint_t
;
16 #define LBAFlength "l"
18 #define LBAF "%" LBAFlength "x"
19 #define LBAFU "%" LBAFlength "u"
21 /* Interface types: */
34 IF_TYPE_COUNT
, /* Number of interface types */
38 enum if_type if_type
; /* type of the interface */
39 int dev
; /* device number */
40 unsigned char part_type
; /* partition type */
41 unsigned char target
; /* target SCSI ID */
42 unsigned char lun
; /* target LUN */
43 unsigned char hwpart
; /* HW partition, e.g. for eMMC */
44 unsigned char type
; /* device type */
45 unsigned char removable
; /* removable device */
47 /* device can use 48bit addr (ATA/ATAPI v7) */
50 lbaint_t lba
; /* number of blocks */
51 unsigned long blksz
; /* block size */
52 int log2blksz
; /* for convenience: log2(blksz) */
53 char vendor
[40+1]; /* IDE model, SCSI Vendor */
54 char product
[20+1]; /* IDE Serial no, SCSI product */
55 char revision
[8+1]; /* firmware revision */
56 unsigned long (*block_read
)(struct blk_desc
*block_dev
,
60 unsigned long (*block_write
)(struct blk_desc
*block_dev
,
64 unsigned long (*block_erase
)(struct blk_desc
*block_dev
,
67 void *priv
; /* driver private struct pointer */
70 #define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz))
71 #define PAD_TO_BLOCKSIZE(size, blk_desc) \
72 (PAD_SIZE(size, blk_desc->blksz))