Skip to content

Commit

Permalink
boards: nrf52840 common partition dtsi
Browse files Browse the repository at this point in the history
Add common default flash partition layout for nrf52840 as many boards
have used identical flash layouts.

The default flash layout was updated to remove scrach in 2022 (9a84258)
but almost all boards were still using the previous layout, so this
updates them to the new layout with allows for larger applications.

This commit also incorporates feeedback from @nordicjm in PR #77791 to
change slot0 to 0x00077000 and slot1 to 0x00075000: "If you use swap
using move, you need a sector for the data to be moved up by, and you
need space for the swap status fields, which is about a sector, so by
making the changes here you get the full 0x65000 for an image, without
these changes you get 0x64000.

Signed-off-by: Jacob Winther <[email protected]>
  • Loading branch information
jacobw committed Sep 10, 2024
1 parent 3f2790b commit de4f3b4
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 897 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/ {

chosen {
zephyr,sram = &sram0;
zephyr,ieee802154 = &ieee802154;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2020 Tobias Svehagen
* Copyright (c) 2024 Jacob Winther
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include "adafruit_feather_nrf52840_common.dtsi"
#include <nordic/nrf52840_partition.dtsi>

/ {
model = "Adafruit Feather nRF52840 Express";
compatible = "adafruit,feather_nrf52840-express";

chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
};

leds {
led0: led_0 {
gpios = <&gpio1 15 0>;
};
};
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

/dts-v1/;
#include "adafruit_feather_nrf52840_common.dtsi"
#include "adafruit_feather_nrf52840_flash.dtsi"

#include <nordic/nrf52840_partition.dtsi>
/ {
model = "Adafruit Feather nRF52840 Sense";
compatible = "adafruit,feather-nrf52840-sense-uf2";
Expand Down
44 changes: 1 addition & 43 deletions boards/contextualelectronics/abc/contextualelectronics_abc.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition.dtsi>
#include "contextualelectronics_abc-pinctrl.dtsi"

/ {
Expand All @@ -15,9 +16,6 @@
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};

aliases {
Expand Down Expand Up @@ -95,43 +93,3 @@ arduino_i2c: &i2c0 {
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
};

&flash0 {

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

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x00067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x00067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001e000>;
};

/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/

/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};
44 changes: 1 addition & 43 deletions boards/electronut/nrf52840_blip/nrf52840_blip.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition.dtsi>
#include "nrf52840_blip-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

Expand All @@ -17,14 +18,11 @@
compatible = "nordic,pca10056-dk";

chosen {
zephyr,code-partition = &slot0_partition;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,ieee802154 = &ieee802154;
};

Expand Down Expand Up @@ -149,46 +147,6 @@
status = "okay";
};

&flash0 {

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

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x00067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x00067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001e000>;
};

/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/

/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};

zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
Expand Down
43 changes: 1 addition & 42 deletions boards/electronut/nrf52840_papyr/nrf52840_papyr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition.dtsi>
#include "nrf52840_papyr-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

Expand All @@ -14,14 +15,11 @@
compatible = "nordic,pca10056-dk";

chosen {
zephyr,code-partition = &slot0_partition;
zephyr,console = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,ieee802154 = &ieee802154;
};

Expand Down Expand Up @@ -142,45 +140,6 @@
status = "okay";
};

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

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x00067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x00067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001e000>;
};

/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/

/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};

zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
Expand Down
44 changes: 1 addition & 43 deletions boards/ezurio/bl654_dvk/bl654_dvk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition.dtsi>
#include "bl654_dvk-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

Expand All @@ -21,9 +22,6 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;
};

Expand Down Expand Up @@ -182,46 +180,6 @@
status = "okay";
};

&flash0 {

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

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x00067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x00067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001e000>;
};

/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/

/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};

zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
Expand Down
Loading

0 comments on commit de4f3b4

Please sign in to comment.