Skip to content

Commit e32c2ee

Browse files
aaronyegxcarlescufi
authored andcommitted
dts: arm: ambiq: add flash controller instance for Apollo3 Blue SOC
This commit adds flash controller instance for Ambiq Apollo3 Blue SOC and Apollo3 Blue Plus SOC. Also create the partitions on this flash controller node for apollo3_evb and apollo3p_evb. Signed-off-by: Aaron Ye <[email protected]>
1 parent 6d4ed7e commit e32c2ee

File tree

4 files changed

+64
-12
lines changed

4 files changed

+64
-12
lines changed

boards/ambiq/apollo3_evb/apollo3_evb.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,31 @@
1414
zephyr,console = &uart0;
1515
zephyr,shell-uart = &uart0;
1616
zephyr,uart-pipe = &uart0;
17+
zephyr,flash-controller = &flash;
1718
};
1819

1920
aliases {
2021
watchdog0 = &wdt0;
2122
};
2223
};
2324

25+
&flash0 {
26+
erase-block-size = <8192>;
27+
write-block-size = <4>;
28+
29+
partitions {
30+
compatible = "fixed-partitions";
31+
#address-cells = <1>;
32+
#size-cells = <1>;
33+
34+
/* Set 16KB of storage at the end of the 976KB of flash */
35+
storage_partition: partition@f0000 {
36+
label = "storage";
37+
reg = <0x000f0000 0x4000>;
38+
};
39+
};
40+
};
41+
2442
&uart0 {
2543
current-speed = <115200>;
2644
pinctrl-0 = <&uart0_default>;

boards/ambiq/apollo3p_evb/apollo3p_evb.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,31 @@
1414
zephyr,console = &uart0;
1515
zephyr,shell-uart = &uart0;
1616
zephyr,uart-pipe = &uart0;
17+
zephyr,flash-controller = &flash;
1718
};
1819

1920
aliases {
2021
watchdog0 = &wdt0;
2122
};
2223
};
2324

25+
&flash0 {
26+
erase-block-size = <8192>;
27+
write-block-size = <4>;
28+
29+
partitions {
30+
compatible = "fixed-partitions";
31+
#address-cells = <1>;
32+
#size-cells = <1>;
33+
34+
/* Set 16KB of storage at the end of the 2000KB of flash */
35+
storage_partition: partition@1f0000 {
36+
label = "storage";
37+
reg = <0x001f0000 0x4000>;
38+
};
39+
};
40+
};
41+
2442
&uart0 {
2543
current-speed = <115200>;
2644
pinctrl-0 = <&uart0_default>;

dts/arm/ambiq/ambiq_apollo3_blue.dtsi

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
};
2626
};
2727

28-
/* Flash region */
29-
flash0: flash@C000 {
30-
compatible = "soc-nv-flash";
31-
reg = <0x0000C000 0xF4000>;
32-
};
33-
3428
/* TCM */
3529
tcm: tcm@10000000 {
3630
compatible = "zephyr,memory-region";
@@ -47,6 +41,20 @@
4741
soc {
4842
compatible = "ambiq,apollo3-blue", "ambiq,apollo3x", "simple-bus";
4943

44+
flash: flash-controller@c000 {
45+
compatible = "ambiq,flash-controller";
46+
reg = <0x0000c000 0xf4000>;
47+
48+
#address-cells = <1>;
49+
#size-cells = <1>;
50+
51+
/* Flash region */
52+
flash0: flash@c000 {
53+
compatible = "soc-nv-flash";
54+
reg = <0x0000c000 0xf4000>;
55+
};
56+
};
57+
5058
pwrcfg: pwrcfg@40021000 {
5159
compatible = "ambiq,pwrctrl";
5260
reg = <0x40021000 0x400>;

dts/arm/ambiq/ambiq_apollo3p_blue.dtsi

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
};
2626
};
2727

28-
/* Flash region */
29-
flash0: flash@C000 {
30-
compatible = "soc-nv-flash";
31-
reg = <0x0000C000 0x1F4000>;
32-
};
33-
3428
/* TCM */
3529
tcm: tcm@10000000 {
3630
compatible = "zephyr,memory-region";
@@ -47,6 +41,20 @@
4741
soc {
4842
compatible = "ambiq,apollo3p-blue", "ambiq,apollo3x", "simple-bus";
4943

44+
flash: flash-controller@c000 {
45+
compatible = "ambiq,flash-controller";
46+
reg = <0x0000c000 0x1f4000>;
47+
48+
#address-cells = <1>;
49+
#size-cells = <1>;
50+
51+
/* Flash region */
52+
flash0: flash@c000 {
53+
compatible = "soc-nv-flash";
54+
reg = <0x0000c000 0x1f4000>;
55+
};
56+
};
57+
5058
pwrcfg: pwrcfg@40021000 {
5159
compatible = "ambiq,pwrctrl";
5260
reg = <0x40021000 0x400>;

0 commit comments

Comments
 (0)