Lines Matching +full:sc +full:- +full:partitions
1 // SPDX-License-Identifier: GPL-2.0-or-later
12 #include <linux/mtd/partitions.h>
42 return ((pdesc->part_id != 0xffffffffUL) && in scpart_desc_is_valid()
43 (pdesc->part_offs != 0xffffffffUL) && in scpart_desc_is_valid()
44 (pdesc->part_bytes != 0xffffffffUL)); in scpart_desc_is_valid()
59 buf = kzalloc(master->erasesize, GFP_KERNEL); in scpart_scan_partmap()
61 res = -ENOMEM; in scpart_scan_partmap()
65 res2 = mtd_read(master, partmap_offs, master->erasesize, &retlen, buf); in scpart_scan_partmap()
66 if (res2 || retlen != master->erasesize) { in scpart_scan_partmap()
67 res = -EIO; in scpart_scan_partmap()
72 offs < master->erasesize - sizeof(*tmpdesc); in scpart_scan_partmap()
85 res = -ENOMEM; in scpart_scan_partmap()
112 (offs < master->size) && in scpart_find_partmap()
116 res = -EIO; in scpart_find_partmap()
126 offs += master->erasesize; in scpart_find_partmap()
131 pr_info("Valid 'SC PART MAP' (%d partitions) found at 0x%llx\n", res, offs); in scpart_find_partmap()
133 pr_info("No valid 'SC PART MAP' was found\n"); in scpart_find_partmap()
155 res = -ENOENT; in scpart_parse()
159 ofpart_node = of_get_child_by_name(mtd_node, "partitions"); in scpart_parse()
161 pr_info("%s: 'partitions' subnode not found on %pOF.\n", in scpart_parse()
162 master->name, mtd_node); in scpart_parse()
163 res = -ENOENT; in scpart_parse()
169 pr_info("No any partitions was found in 'SC PART MAP'.\n"); in scpart_parse()
170 res = -ENOENT; in scpart_parse()
177 res = -ENOMEM; in scpart_parse()
184 if (of_property_read_u32(pp, "sercomm,scpart-id", &scpart_id)) in scpart_parse()
202 if (of_property_read_bool(pp, "read-only")) in scpart_parse()
217 pr_info("No partition in OF matches partition ID with 'SC PART MAP'.\n"); in scpart_parse()
232 { .compatible = "sercomm,sc-partitions" },