Barebox state on am335x-phytec-phycore-som

Sam Ravnborg sam at ravnborg.org
Thu Jul 20 08:06:14 PDT 2017


Hi Martin.

On Thu, Jul 20, 2017 at 01:09:54PM +0000, Martin Hollingsworth wrote:
> Hi,
> I am trying to enable the barebox state framework and use it to
> store the bootchooser variables on the am335x-phytec-phycore-som
> board. I want to do that, so that the variables can be stored
> in EEPROM rather than in NAND (due to write/erase cycles).
> 
> I am following the steps from the documentation and from
> the mailing list from 2016
> (http://lists.infradead.org/pipermail/barebox/2016-October/028312.html).
> However, all entries I try to add to the DTS/DTSI files fail
> to compile with a syntax error, even the example dtsi entry
> from the documentation.
> 
> Has anyone running a similar configuration and could help
> with some advice what has to be adapted?
> Can anyone recommend a good example code of the barebox state placed on EEPROM?

The following builds. Maybe this is a small step in the right direction.
Just added from state-example.dts and from the documentation.

	Sam

diff --git a/arch/arm/dts/am335x-phytec-phycore-som.dts b/arch/arm/dts/am335x-phytec-phycore-som.dts
index f13e0d6bd..f62620be0 100644
--- a/arch/arm/dts/am335x-phytec-phycore-som.dts
+++ b/arch/arm/dts/am335x-phytec-phycore-som.dts
@@ -13,12 +13,41 @@
 / {
 	model = "Phytec phyCORE AM335x";
 	compatible = "phytec,phycore-am335x-som", "phytec,am335x-som", "ti,am33xx";
+
+	state: state {
+		magic = <0x27031977>;
+		compatible = "barebox,state";
+		backend-type = "raw";
+		backend = <&backend_state_eeprom>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		foo {
+			reg = <0x00 0x4>;
+			type = "uint32";
+			default = <0x0>;
+		};
+
+		bar {
+			reg = <0x10 0x4>;
+			type = "enum32";
+			names = "baz", "qux";
+			default = <1>;
+		};
+	};
 };
 
 &spi0 {
 	status = "okay";
 };
-
 &eeprom {
 	status = "okay";
+		partitions {
+			compatible = "fixed-partitions";
+			#size-cells = <1>;
+			#address-cells = <1>;
+			backend_state_eeprom: state at 400 {
+				reg = <0x400 0x400>;
+				label = "state-eeprom";
+			};
+		};
 };



More information about the barebox mailing list