[PATCH v2 2/3] sandbox: dts: add example for barebox, hostfile backed state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux