Lines Matching +full:part +full:- +full:number
1 // SPDX-License-Identifier: GPL-2.0+
11 #include <image-sparse.h>
19 struct part_info *part; member
34 struct part_info **part, in fb_nand_lookup() argument
48 ret = find_dev_and_part(partname, &dev, &pnum, part); in fb_nand_lookup()
55 if (dev->id->type != MTD_DEV_TYPE_NAND) { in fb_nand_lookup()
59 return -EINVAL; in fb_nand_lookup()
62 *mtd = get_nand_dev_by_index(dev->id->num); in fb_nand_lookup()
67 static int _fb_nand_erase(struct mtd_info *mtd, struct part_info *part) in _fb_nand_erase() argument
73 opts.offset = part->offset; in _fb_nand_erase()
74 opts.length = part->size; in _fb_nand_erase()
78 part->offset, part->offset + part->size); in _fb_nand_erase()
85 part->size, part->name); in _fb_nand_erase()
90 static int _fb_nand_write(struct mtd_info *mtd, struct part_info *part, in _fb_nand_write() argument
101 part->size - (offset - part->offset), in _fb_nand_write()
108 struct fb_nand_sparse *sparse = info->priv; in fb_nand_sparse_write()
112 ret = _fb_nand_write(sparse->mtd, sparse->part, (void *)buffer, in fb_nand_sparse_write()
113 blk * info->blksz, in fb_nand_sparse_write()
114 blkcnt * info->blksz, &written); in fb_nand_sparse_write()
120 /* TODO - verify that the value "written" includes the "bad-blocks" ... */ in fb_nand_sparse_write()
123 * the return value must be 'blkcnt' ("good-blocks") plus the in fb_nand_sparse_write()
124 * number of "bad-blocks" encountered within this space... in fb_nand_sparse_write()
126 return written / info->blksz; in fb_nand_sparse_write()
135 * TODO - implement a function to determine the total number in fb_nand_sparse_reserve()
137 * number ("blkcnt") of "good-blocks", starting at "blk"... in fb_nand_sparse_reserve()
142 * the return value must be 'blkcnt' ("good-blocks") plus the in fb_nand_sparse_reserve()
143 * number of "bad-blocks" encountered within this space... in fb_nand_sparse_reserve()
149 * fastboot_nand_get_part_info() - Lookup NAND partion by name
164 * fastboot_nand_flash_write() - Write image to NAND for fastboot
174 struct part_info *part; in fastboot_nand_flash_write() local
178 ret = fb_nand_lookup(cmd, &mtd, &part, response); in fastboot_nand_flash_write()
185 ret = board_fastboot_write_partition_setup(part->name); in fastboot_nand_flash_write()
194 sparse_priv.part = part; in fastboot_nand_flash_write()
196 sparse.blksz = mtd->writesize; in fastboot_nand_flash_write()
197 sparse.start = part->offset / sparse.blksz; in fastboot_nand_flash_write()
198 sparse.size = part->size / sparse.blksz; in fastboot_nand_flash_write()
213 part->offset); in fastboot_nand_flash_write()
215 ret = _fb_nand_write(mtd, part, download_buffer, part->offset, in fastboot_nand_flash_write()
219 download_bytes, part->name); in fastboot_nand_flash_write()
231 * fastboot_nand_flash_erase() - Erase NAND for fastboot
238 struct part_info *part; in fastboot_nand_erase() local
242 ret = fb_nand_lookup(cmd, &mtd, &part, response); in fastboot_nand_erase()
249 ret = board_fastboot_erase_partition_setup(part->name); in fastboot_nand_erase()
253 ret = _fb_nand_erase(mtd, part); in fastboot_nand_erase()
255 pr_err("failed erasing from device %s", mtd->name); in fastboot_nand_erase()