Skip to content

Instantly share code, notes, and snippets.

@btolfa
Created February 25, 2016 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btolfa/1256411f76613e9d7752 to your computer and use it in GitHub Desktop.
Save btolfa/1256411f76613e9d7752 to your computer and use it in GitHub Desktop.
Patch: Add canbus binding in dts for A10-OlinuXino-LIME
From 102e17cff416395aa70d4f423e72a354cd778308 Mon Sep 17 00:00:00 2001
From: Tengiz Sharafiev <btolfa@gmail.com>
Date: Thu, 25 Feb 2016 17:36:38 +0300
Subject: [PATCH] Add dts binding for sun4i_can
Based on https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/net/can/sun4i_can.txt
---
arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts | 6 ++++++
arch/arm/boot/dts/sun4i-a10.dtsi | 15 +++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
index b350448..900962a 100644
--- a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
+++ b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
@@ -136,6 +136,12 @@
};
};
+&can0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&can0_pins_a>;
+ status = "okay";
+};
+
&mdio {
status = "okay";
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index aa90f31..7da378c 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -969,6 +969,13 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
+
+ can0_pins_a: can0@0 {
+ allwinner,pins = "PH20","PH21";
+ allwinner,function = "can";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
};
timer@01c20c00 {
@@ -1172,5 +1179,13 @@
clocks = <&apb1_gates 7>;
status = "disabled";
};
+
+ can0: can@01c2bc00 {
+ compatible = "allwinner,sun4i-a10-can";
+ reg = <0x01c2bc00 0x400>;
+ interrupts = <26>;
+ clocks = <&apb1_gates 4>;
+ status = "disabled";
+ };
};
};
--
2.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment