Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions boards/microchip/sam/sam_e54_xpro/sam_e54_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
zephyr,shell-uart = &sercom2;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,flash-controller = &nvmctrl;
};

aliases {
Expand All @@ -40,14 +42,21 @@
#address-cells = <1>;
#size-cells = <1>;

/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@fc000 {
label = "storage";
reg = <0x000fc000 0x00004000>;
boot_partition: partition@0 {
reg = <0x00000000 0x00010000>; /* 64 KB bootloader */
read-only;
};

slot0_partition: partition@10000 {
reg = <0x00010000 0x00070000>; /* 448 KB primary app slot */
};

slot1_partition: partition@80000 {
reg = <0x00080000 0x00070000>; /* 448 KB secondary app slot */
};

storage_partition: partition@f0000 {
reg = <0x000f0000 0x00010000>; /* 64 KB storage area */
};
};
};
Expand Down
2 changes: 2 additions & 0 deletions boards/microchip/sam/sam_e54_xpro/sam_e54_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ toolchain:
flash: 1024
ram: 256
supported:
- flash
- mcuboot
- pinctrl
- pwm
- reset
Expand Down
1 change: 1 addition & 0 deletions drivers/flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ zephyr_library_sources_ifdef(CONFIG_FLASH_ANDES_QSPI_XIP flash_andes_qspi_xip.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_CAD_QSPI_NOR flash_cadence_qspi_nor.c flash_cadence_qspi_nor_ll.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_CDNS_NAND flash_cadence_nand.c flash_cadence_nand_ll.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_INFINEON_CAT1 flash_ifx_cat1.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_MCHP_NVMCTRL_G1 flash_mchp_nvmctrl_g1.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_HYPERFLASH flash_mcux_flexspi_hyperflash.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_MX25UM51345G flash_mcux_flexspi_mx25um51345g.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_NOR flash_mcux_flexspi_nor.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ source "drivers/flash/Kconfig.it51xxx_m1k"
source "drivers/flash/Kconfig.it8xxx2"
source "drivers/flash/Kconfig.lpc"
source "drivers/flash/Kconfig.max32"
source "drivers/flash/Kconfig.mchp"
source "drivers/flash/Kconfig.mcux"
source "drivers/flash/Kconfig.mspi"
source "drivers/flash/Kconfig.nor"
Expand Down
26 changes: 26 additions & 0 deletions drivers/flash/Kconfig.mchp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2025 Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0

config FLASH_MCHP_NVMCTRL_G1
bool "Microchip G1 Flash Driver for NVMCTRL"
default y
depends on DT_HAS_MICROCHIP_NVMCTRL_G1_FLASH_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_EX_OP
select FLASH_EX_OP_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_EXPLICIT_ERASE
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
help
Enable Flash driver for Microchip Non Volatile Memory Controller.

config FLASH_HAS_UNALIGNED_WRITE
bool "Provide unaligned write support"
depends on FLASH_MCHP_NVMCTRL_G1
help
Enable this option to allow the Zephyr flash API to write data to flash
memory at offsets that are not aligned to the device's write block size
When enabled, the driver will handle unaligned writes internally, typically
using read-modify-write operations to ensure data integrity. This allows
applications to write data starting at any offset within the flash memory
space, not just at aligned addresses.
Loading