mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Martin Hollingsworth <Martin.Hollingsworth@itk-engineering.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: Barebox state on am335x-phytec-phycore-som
Date: Thu, 20 Jul 2017 17:06:14 +0200	[thread overview]
Message-ID: <20170720150614.GA29320@ravnborg.org> (raw)
In-Reply-To: <a4ee1a13786643a29c3ae0c998da3511@itk-engineering.de>

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@400 {
+				reg = <0x400 0x400>;
+				label = "state-eeprom";
+			};
+		};
 };

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-07-20 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 13:09 Martin Hollingsworth
2017-07-20 15:06 ` Sam Ravnborg [this message]
2017-07-21  6:46   ` Çağlar Kilimci
2017-07-21 11:35     ` AW: " Martin Hollingsworth

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=20170720150614.GA29320@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=Martin.Hollingsworth@itk-engineering.de \
    --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