Lines Matching +full:start +full:- +full:up

2  * (C) Copyright 2000-2004
5 * SPDX-License-Identifier: GPL-2.0+
105 * parameter. This field allows them to look up the associated
111 lbaint_t start,
115 lbaint_t start,
119 lbaint_t start,
125 #define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz))
127 (PAD_SIZE(size, blk_desc->blksz))
131 * blkcache_read() - attempt to read a set of blocks from cache
133 * @param iftype - IF_TYPE_x for type of device
134 * @param dev - device index of particular type
135 * @param start - starting block number
136 * @param blkcnt - number of blocks to read
137 * @param blksz - size in bytes of each block
138 * @param buf - buffer to contain cached data
140 * @return - '1' if block returned from cache, '0' otherwise.
143 lbaint_t start, lbaint_t blkcnt,
147 * blkcache_fill() - make data read from a block device available
150 * @param iftype - IF_TYPE_x for type of device
151 * @param dev - device index of particular type
152 * @param start - starting block number
153 * @param blkcnt - number of blocks available
154 * @param blksz - size in bytes of each block
155 * @param buf - buffer containing data to cache
159 lbaint_t start, lbaint_t blkcnt,
163 * blkcache_invalidate() - discard the cache for a set of blocks
166 * @param iftype - IF_TYPE_x for type of device
167 * @param dev - device index of particular type
172 * blkcache_configure() - configure block cache
174 * @param blocks - maximum blocks per entry
175 * @param entries - maximum entries in cache
191 * get_blkcache_stats() - return statistics and reset
193 * @param stats - statistics are copied here
200 lbaint_t start, lbaint_t blkcnt, in blkcache_read() argument
207 lbaint_t start, lbaint_t blkcnt, in blkcache_fill() argument
220 * read() - read from a block device
223 * @start: Start block number to read (0=first)
226 * @return number of blocks read, or -ve error number (see the
229 unsigned long (*read)(struct udevice *dev, lbaint_t start,
233 * write() - write to a block device
236 * @start: Start block number to write (0=first)
239 * @return number of blocks written, or -ve error number (see the
242 unsigned long (*write)(struct udevice *dev, lbaint_t start,
246 * erase() - erase a section of a block device
249 * @start: Start block number to erase (0=first)
251 * @return number of blocks erased, or -ve error number (see the
254 unsigned long (*erase)(struct udevice *dev, lbaint_t start,
258 * select_hwpart() - select a particular hardware partition
262 * software-based partitions. MMC hardware partitions must be
267 * rpmb (3), and up to 4 addition general-purpose partitions (4-7).
272 * @return 0 if OK, -ve on error
277 #define blk_get_ops(dev) ((struct blk_ops *)(dev)->driver->ops)
285 unsigned long blk_dread(struct blk_desc *block_dev, lbaint_t start,
287 unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start,
289 unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start,
293 * blk_find_device() - Find a block device
301 * @return 0 if found, -ENODEV if no device found, or other -ve error value
306 * blk_get_device() - Find and probe a block device ready for use
311 * @return 0 if found, -ENODEV if no device found, or other -ve error value
316 * blk_first_device() - Find the first device for a given interface
322 * @return 0 if found, -ENODEV if no device, or other -ve error value
327 * blk_next_device() - Find the next device for a given interface
336 * @return 0 if found, -ENODEV if no device, or other -ve error value
341 * blk_create_device() - Create a new block device
347 * @devnum: Device number, specific to the interface type, or -1 to
358 * blk_create_devicef() - Create a new named block device
364 * @devnum: Device number, specific to the interface type, or -1 to
375 * blk_prepare_device() - Prepare a block device for use
380 * @return 0 if ok, -ve on error
385 * blk_unbind_all() - Unbind all device of the given interface type
390 * @return 0 if OK, -ve on error
395 * blk_find_max_devnum() - find the maximum device number for an interface type
401 * @return maximum device number found, or -ENODEV if none, or other -ve on
407 * blk_select_hwpart() - select a hardware partition
413 * @return 0 if OK, -ve on error
418 * blk_get_from_parent() - obtain a block device by looking up its parent
432 static inline ulong blk_dread(struct blk_desc *block_dev, lbaint_t start, in blk_dread() argument
436 if (blkcache_read(block_dev->if_type, block_dev->devnum, in blk_dread()
437 start, blkcnt, block_dev->blksz, buffer)) in blk_dread()
441 * We could check if block_read is NULL and return -ENOSYS. But this in blk_dread()
445 blks_read = block_dev->block_read(block_dev, start, blkcnt, buffer); in blk_dread()
447 blkcache_fill(block_dev->if_type, block_dev->devnum, in blk_dread()
448 start, blkcnt, block_dev->blksz, buffer); in blk_dread()
453 static inline ulong blk_dwrite(struct blk_desc *block_dev, lbaint_t start, in blk_dwrite() argument
456 blkcache_invalidate(block_dev->if_type, block_dev->devnum); in blk_dwrite()
457 return block_dev->block_write(block_dev, start, blkcnt, buffer); in blk_dwrite()
460 static inline ulong blk_derase(struct blk_desc *block_dev, lbaint_t start, in blk_derase() argument
463 blkcache_invalidate(block_dev->if_type, block_dev->devnum); in blk_derase()
464 return block_dev->block_erase(block_dev, start, blkcnt); in blk_derase()
468 * struct blk_driver - Driver for block interface types
486 * get_dev() - get a pointer to a block device given its number
496 * @return 0 if OK, -ve on error
501 * select_hwpart() - Select a hardware partition
505 * software-based partitions. MMC hardware partitions must be
510 * rpmb (3), and up to 4 addition general-purpose partitions (4-7).
511 * Partition 0 is the main user-data partition.
515 * user-data partition, 1 is the first partition, 2 is
523 * Declare a new U-Boot legacy block driver. New drivers should use driver
534 * blk_get_devnum_by_typename() - Get a block device by type and number
546 * blk_get_devnum_by_type() - Get a block device by type name, and number
548 * This looks up the block device type based on @if_typename, then calls
559 * blk_dselect_hwpart() - select a hardware partition
567 * @return 0 if OK, -ve on error
572 * blk_list_part() - list the partitions for block devices of a given type
574 * This looks up the partition type for each block device of type @if_type,
578 * @return 0 if OK, -ENODEV if there is none of that type
583 * blk_list_devices() - list the block devices of a given type
586 * as well as type-specific information.
593 * blk_show_device() - show information about a given block device
595 * This shows the block device capacity as well as type-specific information.
599 * @return 0 if OK, -ENODEV for invalid device number
604 * blk_print_device_num() - show information about a given block device
611 * @return 0 if OK, -ENODEV for invalid device number, -ENOENT if the block
617 * blk_print_part_devnum() - print the partition information for a device
621 * @return 0 if OK, -ENOENT if the block device is not connected, -ENOSYS if
622 * the interface type is not supported, other -ve on other error
627 * blk_read_devnum() - read blocks from a device
633 * @return number of blocks read, or -ve error number on error
635 ulong blk_read_devnum(enum if_type if_type, int devnum, lbaint_t start,
639 * blk_write_devnum() - write blocks to a device
645 * @return number of blocks written, or -ve error number on error
647 ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t start,
651 * blk_erase_devnum() - erase blocks to a device
656 * @return number of blocks erased, or -ve error number on error
658 ulong blk_erase_devnum(enum if_type if_type, int devnum, lbaint_t start,
661 * blk_select_hwpart_devnum() - select a hardware partition
663 * This is similar to blk_dselect_hwpart() but it looks up the interface and
669 * @return 0 if OK, -ve on error
674 * blk_get_if_type_name() - Get the name of an interface type
682 * blk_common_cmd() - handle common commands with block devices
694 * if_typename_to_iftype() - get iftype according to iftype name