[RFC v2 10/10] WIP: MIPS: black-swift: use GPIO

Antony Pavlov antonynpavlov at gmail.com
Sun Sep 20 16:23:53 PDT 2015


Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 arch/mips/boot/start.S        |  2 ++
 arch/mips/dts/black-swift.dts | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/arch/mips/boot/start.S b/arch/mips/boot/start.S
index 1ddce95..d6449e1 100644
--- a/arch/mips/boot/start.S
+++ b/arch/mips/boot/start.S
@@ -34,6 +34,8 @@ EXPORT(_start)
 
 	mips_disable_interrupts
 
+	pbl_reg_set (1 << 18), 0xb80600ac
+
 	copy_to_link_location _start
 
 	stack_setup
diff --git a/arch/mips/dts/black-swift.dts b/arch/mips/dts/black-swift.dts
index 270374d..e2d1271 100644
--- a/arch/mips/dts/black-swift.dts
+++ b/arch/mips/dts/black-swift.dts
@@ -1,6 +1,8 @@
 /dts-v1/;
 
 #include "ar9331.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
 	model = "Black Swift";
@@ -13,6 +15,26 @@
 	aliases {
 		spiflash = &spiflash;
 	};
+
+	buttons {
+		compatible = "gpio-keys";
+
+		s1 {
+			label = "S1";
+			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_UP>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		s1 {
+			label = "LED1";
+			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
 };
 
 &serial0 {
@@ -32,3 +54,7 @@
 		reg = <0>;
 	};
 };
+
+&gpio {
+	status = "okay";
+};
-- 
2.5.0




More information about the barebox mailing list