flash: sam0: Define LOCK_REGIONS in dts
The amount of lock regions differs between different sam0 MCUs. saml10: 2 saml11: 4 samd2x: 16 saml2x: 16 samd5x: 32 ASF does not provide a definition for this, so create a new one in dts. Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This commit is contained in:
parent
cafc074d06
commit
fc7f458ab3
3 changed files with 8 additions and 1 deletions
|
@ -30,7 +30,7 @@ LOG_MODULE_REGISTER(flash_sam0);
|
||||||
* Number of lock regions. The number is fixed and the region size
|
* Number of lock regions. The number is fixed and the region size
|
||||||
* grows with the flash size.
|
* grows with the flash size.
|
||||||
*/
|
*/
|
||||||
#define LOCK_REGIONS 16
|
#define LOCK_REGIONS DT_ATMEL_SAM0_NVMCTRL_0_LOCK_REGIONS
|
||||||
#define LOCK_REGION_SIZE (FLASH_SIZE / LOCK_REGIONS)
|
#define LOCK_REGION_SIZE (FLASH_SIZE / LOCK_REGIONS)
|
||||||
|
|
||||||
#if defined(NVMCTRL_BLOCK_SIZE)
|
#if defined(NVMCTRL_BLOCK_SIZE)
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
label = "FLASH_CTRL";
|
label = "FLASH_CTRL";
|
||||||
reg = <0x41004000 0x22>;
|
reg = <0x41004000 0x22>;
|
||||||
interrupts = <5 0>;
|
interrupts = <5 0>;
|
||||||
|
lock-regions = <16>;
|
||||||
|
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
|
|
|
@ -3,3 +3,9 @@ description: Atmel SAM0 NVMC (Non-Volatile Memory Controller)
|
||||||
compatible: "atmel,sam0-nvmctrl"
|
compatible: "atmel,sam0-nvmctrl"
|
||||||
|
|
||||||
include: flash-controller.yaml
|
include: flash-controller.yaml
|
||||||
|
|
||||||
|
properties:
|
||||||
|
lock-regions:
|
||||||
|
type: int
|
||||||
|
required: true
|
||||||
|
description: Number of lock regions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue