From: Moritz Augsburger <ml+barebox@moritz.augsburger.name>
To: barebox@lists.infradead.org
Subject: Re: Raspberry Pi Barebox State Integration - SD card
Date: Tue, 04 Jun 2019 10:59:23 +0200 [thread overview]
Message-ID: <e7c88d1ca9dd8acc056490158be54e39@moritz.augsburger.name> (raw)
In-Reply-To: <CAPYMOwmwmX3G0cHp6DSmw+GxRmENThtABnQdSS-2cL=kgfYYPg@mail.gmail.com>
Hi,
Am 2019-06-04 08:32, schrieb Valentina Rusu:
> The issue to integrate Barebox state are the following:
> * we need to specify a backend for the "state" node;
> * the backend should point to an of partition on a non-volatile memory;
> * other boards have EEPROM, NAND besides SD card and they are
> described in the device tree; RPi has no such thing;
> * somehow I need to write the state on the SD card in a location where
> does not interfere with the partitions created (boot, rootfs, user
> partitions, etc);
> * the SD card device (mci0) is automatically detected at startup, and
> not described in the device tree;
Below is a part of my patches, using the emmc on a Compute Module as
state backend.
It uses the region between MBR and first partition (starting @4MB) to
save the state.
The patch may contain changes already done to the latest version, so
apply carefully.
diff --git a/arch/arm/dts/bcm2837-rpi-3.dts
b/arch/arm/dts/bcm2837-rpi-3.dts
index 51883613c..420525b9e 100644
--- a/arch/arm/dts/bcm2837-rpi-3.dts
+++ b/arch/arm/dts/bcm2837-rpi-3.dts
@@ -11,10 +11,5 @@
};
&sdhci {
- pinctrl-0 = <&emmc_gpio48>;
- /delete-node/ wifi@1;
-};
-
-&sdhost {
status = "disabled";
};
diff --git a/arch/arm/dts/bcm2837-rpi-cm3.dts
b/arch/arm/dts/bcm2837-rpi-cm3.dts
index cfbffe175..d0144dcbc 100644
--- a/arch/arm/dts/bcm2837-rpi-cm3.dts
+++ b/arch/arm/dts/bcm2837-rpi-cm3.dts
@@ -8,11 +8,76 @@
memory {
reg = <0x0 0x0>;
};
+
+ state: state {
+ magic = <0x4d433230>;
+ compatible = "barebox,state";
+ backend-type = "raw";
+ backend = <&backend_state_sdhost>;
+ backend-storage-type = "circular";
+ backend-stridesize = <0x800>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ bootstate {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ system0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ remaining_attempts {
+ reg = <0x0 0x4>;
+ type = "uint32";
+ default = <3>;
+ };
+ priority {
+ reg = <0x4 0x4>;
+ type = "uint32";
+ default = <21>;
+ };
+ };
+
+ system1 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ remaining_attempts {
+ reg = <0x10 0x4>;
+ type = "uint32";
+ default = <3>;
+ };
+ priority {
+ reg = <0x14 0x4>;
+ type = "uint32";
+ default = <20>;
+ };
+ };
+ last_chosen {
+ reg = <0x2C 0x4>;
+ type = "uint32";
+ };
+ };
+ };
+
+ aliases {
+ state = &state;
+ };
+
};
-&sdhci {
- pinctrl-0 = <&emmc_gpio48>;
- no-sd;
- non-removable;
+&sdhost {
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdhost_gpio48>;
+ bus-width = <4>;
+ vmmc-supply = <®_3v3>;
+ vqmmc-supply = <®_1v8>;
status = "okay";
+ partitions {
+ compatible = "fixed-partitions";
+ #size-cells = <1>;
+ #address-cells = <1>;
+ backend_state_sdhost: part@200000 {
+ label = "state_sdhost";
+ reg = <0x200000 0x200000>;
+ };
+ };
};
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-06-04 8:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 6:32 Valentina Rusu
2019-06-04 7:52 ` Tomaž Šolc
2019-06-04 8:59 ` Moritz Augsburger [this message]
[not found] <mailman.44637.1559659159.2376.barebox@lists.infradead.org>
2019-06-05 4:26 ` Valentina Rusu
2019-06-05 6:46 ` Moritz Augsburger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e7c88d1ca9dd8acc056490158be54e39@moritz.augsburger.name \
--to=ml+barebox@moritz.augsburger.name \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox