Lines Matching +full:arm +full:- +full:firmware +full:- +full:suite

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 drivers/mtd/afs.c: ARM Flash Layout/Partitioning
6 Copyright © 2000 ARM Limited
10 This is access code for flashes using ARM's flash partitioning
34 u32 type; /* Area type: ARM Image, SIB, customer */
47 u32 headerType; /* AIF, RLF, s-record etc. */
56 while (num--) in word_sum()
81 u_int ptr = off + mtd->erasesize - 12; in afs_is_v1()
101 u_int ptr = off + mtd->erasesize - 8; in afs_is_v2()
140 mask = mtd->size - 1; in afs_parse_v1_partition()
142 ptr = off + mtd->erasesize - sizeof(fs); in afs_parse_v1_partition()
145 ret = -EINVAL; in afs_parse_v1_partition()
155 return -EINVAL; in afs_parse_v1_partition()
186 return -EINVAL; in afs_parse_v1_partition()
190 return -EINVAL; in afs_parse_v1_partition()
193 * Validate the name - it must be NUL terminated. in afs_parse_v1_partition()
199 return -EINVAL; in afs_parse_v1_partition()
201 part->name = kstrdup(iis.name, GFP_KERNEL); in afs_parse_v1_partition()
202 if (!part->name) in afs_parse_v1_partition()
203 return -ENOMEM; in afs_parse_v1_partition()
205 part->size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1); in afs_parse_v1_partition()
206 part->offset = img_ptr; in afs_parse_v1_partition()
207 part->mask_flags = 0; in afs_parse_v1_partition()
210 img_ptr, part->size / 1024, in afs_parse_v1_partition()
211 iis.imageNumber, part->name); in afs_parse_v1_partition()
235 pr_debug("Parsing v2 partition @%08x-%08x\n", in afs_parse_v2_partition()
236 off, off + mtd->erasesize); in afs_parse_v2_partition()
239 ptr = off + mtd->erasesize - sizeof(footer); in afs_parse_v2_partition()
244 return -EIO; in afs_parse_v2_partition()
248 ptr = off + mtd->erasesize - sizeof(footer) - footer[8]; in afs_parse_v2_partition()
258 return -EIO; in afs_parse_v2_partition()
276 return -EINVAL; in afs_parse_v2_partition()
306 region_end += (mtd->erasesize - 1); in afs_parse_v2_partition()
307 region_end &= ~(mtd->erasesize -1); in afs_parse_v2_partition()
312 part->name = kstrdup(name, GFP_KERNEL); in afs_parse_v2_partition()
313 if (!part->name) in afs_parse_v2_partition()
314 return -ENOMEM; in afs_parse_v2_partition()
315 part->offset = region_start; in afs_parse_v2_partition()
316 part->size = region_end - region_start; in afs_parse_v2_partition()
317 part->mask_flags = 0; in afs_parse_v2_partition()
333 for (i = off = sz = 0; off < mtd->size; off += mtd->erasesize) { in parse_afs_partitions()
349 return -ENOMEM; in parse_afs_partitions()
354 for (i = off = 0; off < mtd->size; off += mtd->erasesize) { in parse_afs_partitions()
373 while (--i >= 0) in parse_afs_partitions()
381 { .compatible = "arm,arm-firmware-suite" },
393 MODULE_AUTHOR("ARM Ltd");
394 MODULE_DESCRIPTION("ARM Firmware Suite partition parser");