Skip to content

Commit 7b2c92f

Browse files
peterwangszkartben
authored andcommitted
boards: frdm_mcxa166, frdm_mcxa276: add flash support
1. enable flash support 2. verified test/driver/flash Signed-off-by: Peter Wang <[email protected]>
1 parent 393c8d1 commit 7b2c92f

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

boards/nxp/frdm_mcxa166/frdm_mcxa166.dts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
zephyr,sram = &sram0;
2727
zephyr,flash = &flash;
2828
zephyr,flash-controller = &fmu;
29+
zephyr,code-partition = &slot0_partition;
2930
zephyr,console = &lpuart2;
3031
zephyr,shell-uart = &lpuart2;
3132
};
@@ -113,3 +114,29 @@
113114
pinctrl-0 = <&pinmux_lpuart2>;
114115
pinctrl-names = "default";
115116
};
117+
118+
&flash {
119+
partitions {
120+
compatible = "fixed-partitions";
121+
#address-cells = <1>;
122+
#size-cells = <1>;
123+
124+
boot_partition: partition@0 {
125+
label = "mcuboot";
126+
reg = <0x00000000 DT_SIZE_K(64)>;
127+
read-only;
128+
};
129+
slot0_partition: partition@10000 {
130+
label = "image-0";
131+
reg = <0x00010000 DT_SIZE_K(400)>;
132+
};
133+
slot1_partition: partition@74000 {
134+
label = "image-1";
135+
reg = <0x00074000 DT_SIZE_K(400)>;
136+
};
137+
storage_partition: partition@d8000 {
138+
label = "storage";
139+
reg = <0x000d8000 DT_SIZE_K(112)>;
140+
};
141+
};
142+
};

boards/nxp/frdm_mcxa166/frdm_mcxa166.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ toolchain:
1616
supported:
1717
- gpio
1818
- uart
19+
- flash
1920
vendor: nxp

boards/nxp/frdm_mcxa276/frdm_mcxa276.dts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
zephyr,sram = &sram0;
2727
zephyr,flash = &flash;
2828
zephyr,flash-controller = &fmu;
29+
zephyr,code-partition = &slot0_partition;
2930
zephyr,console = &lpuart2;
3031
zephyr,shell-uart = &lpuart2;
3132
};
@@ -113,3 +114,29 @@
113114
pinctrl-0 = <&pinmux_lpuart2>;
114115
pinctrl-names = "default";
115116
};
117+
118+
&flash {
119+
partitions {
120+
compatible = "fixed-partitions";
121+
#address-cells = <1>;
122+
#size-cells = <1>;
123+
124+
boot_partition: partition@0 {
125+
label = "mcuboot";
126+
reg = <0x00000000 DT_SIZE_K(64)>;
127+
read-only;
128+
};
129+
slot0_partition: partition@10000 {
130+
label = "image-0";
131+
reg = <0x00010000 DT_SIZE_K(400)>;
132+
};
133+
slot1_partition: partition@74000 {
134+
label = "image-1";
135+
reg = <0x00074000 DT_SIZE_K(400)>;
136+
};
137+
storage_partition: partition@d8000 {
138+
label = "storage";
139+
reg = <0x000d8000 DT_SIZE_K(112)>;
140+
};
141+
};
142+
};

boards/nxp/frdm_mcxa276/frdm_mcxa276.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ toolchain:
1616
supported:
1717
- gpio
1818
- uart
19+
- flash
1920
vendor: nxp

drivers/flash/soc_flash_mcux.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ static void clear_flash_caches(void)
138138
/* this bit clears the code cache */
139139
*lpcac_ctrl |= BIT(1);
140140
}
141+
#elif CONFIG_SOC_SERIES_MCXA
142+
static void clear_flash_caches(void)
143+
{
144+
SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC(1U);
145+
}
141146
#else
142147
#undef SOC_FLASH_NEED_CLEAR_CACHES
143148
#define clear_flash_caches(...)

0 commit comments

Comments
 (0)