Skip to content

Commit

Permalink
boards: esp32xx: Use common partition tables
Browse files Browse the repository at this point in the history
* Replace copies of fixed-partitions nodes in related boards by
referencing the apropriate partition table from the available list.
* For better reference the `partitions_*.dtsi` file has boot offset,
purpose and the flash size encoded in the file name. Default flash size
is considered to be 4MB.
* Added the flash size node for the boards which are not based on the
module.
* Removed flash size registry from the esp32.*common.dtsi

Signed-off-by: Marek Matej <[email protected]>
(cherry picked from commit 78c1def)
  • Loading branch information
Marek Matej committed Dec 5, 2024
1 parent 2c5fb2d commit 72c917f
Show file tree
Hide file tree
Showing 44 changed files with 233 additions and 825 deletions.
35 changes: 1 addition & 34 deletions boards/01space/esp32c3_042_oled/esp32c3_042_oled.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <espressif/esp32c3/esp32c3_fx4.dtsi>
#include "esp32c3_042_oled-pinctrl.dtsi"
#include <espressif/partitions_0x0_default.dtsi>

/ {
model = "01space ESP32C3 0.42 OLED";
Expand Down Expand Up @@ -104,37 +105,3 @@
&esp32_bt_hci {
status = "okay";
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000F000>;
read-only;
};

slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};

slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};

scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};
2 changes: 1 addition & 1 deletion boards/dptechnics/walter/walter_esp32s3_appcpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
/dts-v1/;

#include <espressif/esp32s3/esp32s3_appcpu.dtsi>
#include "espressif/esp32s3/esp32s3_wroom_n16r2.dtsi"
#include <espressif/partitions_0x0_amp.dtsi>

/ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
/dts-v1/;

#include <espressif/esp32s3/esp32s3_appcpu.dtsi>
#include <espressif/esp32s3/esp32s3_wroom_n8.dtsi>
#include <espressif/partitions_0x0_amp.dtsi>
#include "esp32s3_devkitc-pinctrl.dtsi"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
/dts-v1/;

#include <espressif/esp32s3/esp32s3_appcpu.dtsi>
#include <espressif/esp32s3/esp32s3_mini_n8.dtsi>
#include <espressif/partitions_0x0_amp.dtsi>
#include "esp32s3_devkitm-pinctrl.dtsi"

Expand Down
4 changes: 4 additions & 0 deletions boards/espressif/esp32s3_eye/esp32s3_eye_appcpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
};
};

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};

&trng0 {
status = "okay";
};
Expand Down
40 changes: 1 addition & 39 deletions boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
#include <espressif/partitions_0x0_amp.dtsi>

/ {
model = "Espressif ESP32S3-EYE PROCPU";
Expand Down Expand Up @@ -200,45 +201,6 @@
status = "okay";
};

&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserve 64kB for the bootloader */
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x00010000>;
read-only;
};

/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};

/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};

/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

&esp32_bt_hci {
status = "okay";
};
40 changes: 1 addition & 39 deletions boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <espressif/esp32s2/esp32s2_wroom.dtsi>
#include "esp32s2_franzininho-pinctrl.dtsi"
#include <espressif/partitions_0x1000_default.dtsi>

/ {
model = "ESP32S2 Franzininho";
Expand Down Expand Up @@ -107,45 +108,6 @@
pinctrl-names = "default";
};

&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserve 60kB for the bootloader */
boot_partition: partition@1000 {
label = "mcuboot";
reg = <0x00001000 0x0000F000>;
read-only;
};

/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};

/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};

/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

&wdt0 {
status = "okay";
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/dts-v1/;

#include <espressif/esp32/esp32_appcpu.dtsi>
#include <espressif/partitions_0x1000_amp.dtsi>

/ {
model = "Heltec Wi-Fi Lora32 V2 APPCPU";
Expand All @@ -25,42 +26,3 @@
&trng0 {
status = "okay";
};

&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserve 60kB for the bootloader */
boot_partition: partition@1000 {
label = "mcuboot";
reg = <0x00001000 0x0000F000>;
read-only;
};

/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};

/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};

/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <espressif/esp32/esp32_d0wd_v3.dtsi>
#include "heltec_wifi_lora32_v2-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <espressif/partitions_0x1000_amp.dtsi>

/ {
model = "Heltec Wi-Fi Lora32 V2 PROCPU";
Expand Down Expand Up @@ -59,6 +60,10 @@
};
};

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};

&uart0 {
status = "okay";
current-speed = <115200>;
Expand Down Expand Up @@ -106,50 +111,6 @@
};
};

&flash0 {
/* the board is using plain d0wd SoC part without the flash
* so any additional flash size should be defined at the board level
*/
reg = <0x0 DT_SIZE_M(8)>;

status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserve 60kB for the bootloader */
boot_partition: partition@1000 {
label = "mcuboot";
reg = <0x00001000 0x0000F000>;
read-only;
};

/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};

/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};

/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

&esp32_bt_hci {
status = "okay";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
};
};

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};

&trng0 {
status = "okay";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/lora/sx126x.h>
#include <espressif/partitions_0x0_amp.dtsi>

/ {
model = "Heltec Wireless Stick Lite V3 PROCPU";
Expand Down Expand Up @@ -76,6 +77,10 @@
};
};

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};

&adc1 {
status ="okay";
};
Expand Down Expand Up @@ -168,45 +173,6 @@
pinctrl-names = "default";
};

&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserve 64kB for the bootloader */
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x00010000>;
read-only;
};

/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};

/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};

/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

&esp32_bt_hci {
status = "okay";
};
Loading

0 comments on commit 72c917f

Please sign in to comment.