Skip to content

Commit d868bc7

Browse files
dts: nxp: Add binding for C40 flash and flash controller
Introduce DT bindings for on-chip C40 flash and its controller and describe their corresponding nodes in nxp_s32k344_m7.dtsi. - Binding: dts/bindings/mtd/nxp,c40-flash.yaml Erase/write block sizes. - Binding: dts/bindings/flash_controller/nxp,c40-flash-controller.yaml Describe flash device (child) ranges - SoC nodes: With the new compatible and geometry properties. Keep status = "disabled" at the SoC level so boards opt-in. This prepares the platform for using Zephyr’s flash API / FLASH_MAP / MCUboot with internal code flash. Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
1 parent 0d40dff commit d868bc7

File tree

3 files changed

+55
-10
lines changed

3 files changed

+55
-10
lines changed

dts/arm/nxp/nxp_s32k344_m7.dtsi

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,23 @@
6262
reg = <0x20400000 DT_SIZE_K(320)>;
6363
};
6464

65-
/*
66-
* Last 48Kb is reserved by Secure BAF, application core cannot access it.
67-
*
68-
* Do not assign the compatible for this now, when Flash API is implemented,
69-
* need to check if "soc-nv-flash" can be used or a new binding need to be
70-
* created, based on it.
71-
*/
72-
flash0: flash@400000 {
73-
reg = <0x00400000 DT_SIZE_K(4048)>;
74-
status = "disabled";
65+
c40fc: flash-controller@40268000 {
66+
compatible = "nxp,c40-flash-controller";
67+
reg = <0x40268000 0x1000>;
68+
#address-cells = <1>;
69+
#size-cells = <1>;
70+
71+
/* Map child address 0x0..size onto CPU 0x0040_0000.. */
72+
/* Last 48Kb is reserved by Secure BAF, app core cannot access it.*/
73+
ranges = <0x0 0x00400000 DT_SIZE_K(4048)>; /* 4048 KiB Flash window */
74+
75+
flash0: flash@0 {
76+
compatible = "nxp,c40-flash";
77+
reg = <0x0 DT_SIZE_K(4048)>;
78+
erase-block-size = <DT_SIZE_K(8)>; /* 8 KiB sectors */
79+
write-block-size = <8>; /* 8-byte min program unit */
80+
status = "disabled";
81+
};
7582
};
7683

7784
clock: clock-controller@402c8000 {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
title: NXP C40 Flash Controller
4+
5+
description: |
6+
Controller for the on-chip NXP C40 flash array.
7+
8+
compatible: "nxp,c40-flash-controller"
9+
10+
include: base.yaml
11+
12+
properties:
13+
"#address-cells":
14+
const: 1
15+
description: Number of address cells for child flash nodes.
16+
17+
"#size-cells":
18+
const: 1
19+
description: Number of size cells for child flash nodes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
title: NXP C40 Internal Flash
4+
5+
description: |
6+
On-chip C40 flash array used with NXP C40 flash controller.
7+
8+
compatible: "nxp,c40-flash"
9+
10+
include: soc-nv-flash.yaml
11+
12+
properties:
13+
erase-block-size:
14+
const: 8192
15+
description: Minimum erase size for C40 is 8 KiB.
16+
17+
write-block-size:
18+
const: 8
19+
description: Smallest programmable unit is 8 bytes.

0 commit comments

Comments
 (0)