Skip to content

Commit

Permalink
Mark all partitions except full PNOR and boot kernel firmware read only
Browse files Browse the repository at this point in the history
FFS partitions don't always align on erase blocks.  Mark any paritions
not known to align on erase blocks as read only to prevent silent corruption
of adjacent partitions during erase / write from the host.

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
madscientist159 authored and stewartsmith committed May 1, 2019
1 parent 27fcf2f commit 0f42d72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ static struct dt_node *flash_add_dt_node(struct flash *flash, int id)
partition_node = dt_new_addr(partition_container_node, "partition", ffs_part_start);
dt_add_property_strings(partition_node, "label", name);
dt_add_property_cells(partition_node, "reg", ffs_part_start, ffs_part_size);
if (part_name_map[i].id != RESOURCE_ID_KERNEL_FW) {
/* Mark all partitions other than the full PNOR and the boot kernel
* firmware as read only. These two partitions are the only partitions
* that are properly erase block aligned at this time.
*/
dt_add_property(partition_node, "read-only", NULL, 0);
}
}

partition_node = dt_new_addr(partition_container_node, "partition", 0);
Expand Down

0 comments on commit 0f42d72

Please sign in to comment.