mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Subject: [PATCH v2 2/3] sandbox: dts: add example for barebox, hostfile backed state
Date: Mon,  9 Sep 2019 11:31:29 +0200	[thread overview]
Message-ID: <20190909093130.30666-3-ahmad@a3f.at> (raw)
In-Reply-To: <20190909093130.30666-1-ahmad@a3f.at>

Previous commit now allows probing barebox,hostfile to be probed from
device tree. Add a barebox state node that shows how to use it. It's not
included by default, same as barebox-libftdi-example.dtsi in the same
directory.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 arch/sandbox/dts/sandbox-state-example.dtsi | 50 +++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 arch/sandbox/dts/sandbox-state-example.dtsi

diff --git a/arch/sandbox/dts/sandbox-state-example.dtsi b/arch/sandbox/dts/sandbox-state-example.dtsi
new file mode 100644
index 000000000000..fc17bd078899
--- /dev/null
+++ b/arch/sandbox/dts/sandbox-state-example.dtsi
@@ -0,0 +1,50 @@
+/ {
+	aliases {
+		state = &state;
+	};
+
+	disk {
+		compatible = "barebox,hostfile";
+		barebox,filename = "disk";
+		reg = <0x0 0x0 0x100000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			hostfile_state: state@0 {
+				reg = <0x0 0x1000>;
+				label = "state";
+			};
+		};
+	};
+
+	state: state {
+		magic = <0xaa3b86a6>;
+		compatible = "barebox,state";
+		backend-type = "raw";
+		backend = <&hostfile_state>;
+		backend-storage-type = "direct";
+		backend-stridesize = <64>;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+		vars {
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			x {
+				reg = <0x0 0x4>;
+				type = "uint32";
+				default = <1>;
+			};
+
+			y {
+				reg = <0x4 0x4>;
+				type = "uint32";
+				default = <3>;
+			};
+		};
+	};
+};
-- 
2.20.1


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

  parent reply	other threads:[~2019-09-09  9:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09  9:31 [PATCH v2 0/3] sandbox: add HWRNG driver for host /dev/random Ahmad Fatoum
2019-09-09  9:31 ` [PATCH v2 1/3] sandbox: hostfile: allow probing from device tree Ahmad Fatoum
2019-09-09  9:31 ` Ahmad Fatoum [this message]
2019-09-09  9:31 ` [PATCH v2 3/3] hwrng: add sandbox driver interface to host /dev/random Ahmad Fatoum
2019-09-09 13:23 ` [PATCH v2 0/3] sandbox: add HWRNG driver for " Sascha Hauer

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=20190909093130.30666-3-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --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