Skip to content

Commit

Permalink
[nrf noup] pm: Adapt to changes in partition manager
Browse files Browse the repository at this point in the history
Use 'inside' and 'inherit_size'.
Add KConfig-based size entries.

Signed-off-by: Øyvind Rønningstad <[email protected]>
  • Loading branch information
oyvindronningstad authored and carlescufi committed May 13, 2019
1 parent aebd4b9 commit 4b91989
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions boot/zephyr/include/sysflash/sysflash.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#if USE_PARTITION_MANAGER
#include <pm_config.h>

#define FLASH_AREA_IMAGE_PRIMARY PM_MCUBOOT_PARTITIONS_PRIMARY_ID
#define FLASH_AREA_IMAGE_SECONDARY PM_MCUBOOT_PARTITIONS_SECONDARY_ID
#define FLASH_AREA_IMAGE_PRIMARY PM_MCUBOOT_PRIMARY_ID
#define FLASH_AREA_IMAGE_SECONDARY PM_MCUBOOT_SECONDARY_ID
#define FLASH_AREA_IMAGE_SCRATCH PM_MCUBOOT_SCRATCH_ID

#else
Expand Down
37 changes: 21 additions & 16 deletions boot/zephyr/pm.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
# The size of this partition is defined by the kconfig symbol
# CONFIG_PM_PARTITION_SIZE_MCUBOOT
#include <autoconf.h>

mcuboot:
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT
placement:
# MCUboot must be placed in front of 'mcuboot_pad'.
before: [mcuboot_pad]
before: [mcuboot_primary]

mcuboot_primary_app:
# All images to be placed in MCUboot's slot 0 should be placed in this
# partition
span: [app]

mcuboot_partitions:
# Define a set of sub-partitions which spans over 'mcuboot_pad', 'spm' and
# 'app' if both are present. If only 'app' is present, then these partitions
# will only span across that partition.
# The sub partitions share the size of the parent partition(s) equally.
sub_partitions: [primary, secondary]
span: [mcuboot_pad, spm, app]
mcuboot_primary:
span: [mcuboot_pad, mcuboot_primary_app]

mcuboot_secondary:
share_size: [mcuboot_primary]
placement:
after:
[mcuboot_primary]

# The size of this partition is defined by the kconfig symbol
# CONFIG_PM_PARTITION_SIZE_MCUBOOT_SCRATCH
mcuboot_scratch:
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_SCRATCH
placement:
after: [app]

# The size of this partition is defined by the kconfig symbol
# CONFIG_PM_PARTITION_SIZE_MCUBOOT_STORAGE
mcuboot_storage:
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_STORAGE
placement:
after: [mcuboot_scratch]

# Padding placed before image to boot
mcuboot_pad:
# MCUboot pad must be placed before the 'spm' partition if that is present.
# If 'spm' partition is not present, it must be placed before the 'app'.
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_PAD
placement:
before: [spm, app]
before: [mcuboot_primary_app]

0 comments on commit 4b91989

Please sign in to comment.