summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2019-09-09 11:31:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-09-09 15:23:41 +0200
commitc7d68aad12e739be7793b37ff4e02479883d7707 (patch)
tree9bfc7a31e9a1b2f4558a29179445474211529602
parent801b7cff0210fab83768847b2390f6821e95e2ab (diff)
downloadbarebox-c7d68aad12e739be7793b37ff4e02479883d7707.tar.gz
barebox-c7d68aad12e739be7793b37ff4e02479883d7707.tar.xz
sandbox: dts: add example for barebox, hostfile backed state
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/sandbox/dts/sandbox-state-example.dtsi50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/sandbox/dts/sandbox-state-example.dtsi b/arch/sandbox/dts/sandbox-state-example.dtsi
new file mode 100644
index 0000000000..fc17bd0788
--- /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>;
+ };
+ };
+ };
+};