Skip to content

Commit e476d31

Browse files
committed
variants/common/arduino_flash_fs.dtsi: Add common FS config.
Provides a common file system configuration, fstab entries, disks and partitions that can just be included by overlays to enable file system support. Signed-off-by: iabdalkader <[email protected]>
1 parent 63756ce commit e476d31

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Common filesystem configuration
3+
*
4+
* This file defines the following:
5+
*
6+
* 1- Common partition layout for 16MB flash:
7+
* - mbr: 4KB @ 0x000000 (Master Boot Record - protected)
8+
* - wlan: ~1020KB @ 0x001000 (Network certificates)
9+
* - ota: 5MB @ 0x100000 (OTA updates)
10+
* - kvs: 1MB @ 0x600000 (Key-Value Store)
11+
* - storage: 7MB @ 0x700000 (User data)
12+
*
13+
* 2- fstab entries and flash-disk devices for:
14+
* - /wlan: (FAT) - Network certificates partition
15+
* - /ota: (FAT) - OTA update partition
16+
* - /storage (LittleFS) - User data partition
17+
*/
18+
&qspi_flash {
19+
/delete-node/ partitions;
20+
partitions {
21+
compatible = "fixed-partitions";
22+
#address-cells = <1>;
23+
#size-cells = <1>;
24+
25+
mbr_partition: partition@0 {
26+
label = "mbr";
27+
reg = <0x000000 DT_SIZE_K(4)>;
28+
};
29+
30+
/* Partition 1: Network certificates 1MB - 4KB (MBR reserved at 0x0) */
31+
wlan_partition: partition@1000 {
32+
label = "wlan";
33+
reg = <0x001000 (DT_SIZE_M(1) - DT_SIZE_K(4))>;
34+
};
35+
36+
/* Partition 2: OTA 5MB */
37+
ota_partition: partition@100000 {
38+
label = "ota";
39+
reg = <0x100000 DT_SIZE_M(5)>;
40+
};
41+
42+
/* Partition 3: Provisioning KVStore 1MB */
43+
kvs_partition: partition@600000 {
44+
label = "kvs";
45+
reg = <0x600000 DT_SIZE_M(1)>;
46+
};
47+
48+
/* Partition 4: User data 7MB */
49+
storage_partition: partition@700000 {
50+
label = "storage";
51+
reg = <0x700000 DT_SIZE_M(7)>;
52+
};
53+
54+
/* Partition 5: Binary FW image for the Airoc WLAN */
55+
airoc_firmware: partition@f80000 {
56+
label = "4343WA1.bin";
57+
reg = <0xf80000 DT_SIZE_K(512)>;
58+
};
59+
};
60+
};
61+
62+
/ {
63+
flash_disk0 {
64+
status = "okay";
65+
compatible = "zephyr,flash-disk";
66+
partition = <&wlan_partition>;
67+
disk-name = "wlan";
68+
sector-size = <4096>;
69+
cache-size = <4096>;
70+
};
71+
72+
flash_disk1 {
73+
status = "okay";
74+
compatible = "zephyr,flash-disk";
75+
partition = <&ota_partition>;
76+
disk-name = "ota";
77+
sector-size = <4096>;
78+
cache-size = <4096>;
79+
};
80+
81+
fstab {
82+
compatible = "zephyr,fstab";
83+
84+
wlan_fs: wlan_fs {
85+
compatible = "zephyr,fstab,fatfs";
86+
automount;
87+
disk-access;
88+
mount-point = "/wlan:";
89+
};
90+
91+
ota_fs: ota_fs {
92+
compatible = "zephyr,fstab,fatfs";
93+
automount;
94+
disk-access;
95+
mount-point = "/ota:";
96+
};
97+
98+
storage_fs: storage_fs {
99+
compatible = "zephyr,fstab,littlefs";
100+
automount;
101+
mount-point = "/storage";
102+
partition = <&storage_partition>;
103+
read-size = <16>;
104+
prog-size = <4096>;
105+
cache-size = <4096>;
106+
lookahead-size = <32>;
107+
block-cycles = <512>;
108+
};
109+
};
110+
};

0 commit comments

Comments
 (0)