On Tue, Aug 26, 2014 at 8:05 PM, Dallas Clement
<dallas.a.clem...@gmail.com> wrote:
> Hi All,
>
> I am trying to enable both SPI devices in the 3.14 kernel for a beaglebone
> black.  I understand that the capemgr support is no longer there.  I need
> some tips on how to enable these devices in the kernel.  I don't care if it
> is done statically at kernel build time.  My application has no need to
> runtime enabling/disabling as is possible with capemgr and device tree
> overlays.
>
> I see device tree source for spi0 but not spi1 in the 3.14 kernel source.
>
> ./arch/arm/boot/dts/am335x-bone-spi0-spidev.dtsi
>
> Looks like SPI support is half-baked.  I am pulling my source from here:
>
> https://github.com/beagleboard/linux.git
>
> Am I going down the wrong path with 3.14?  Building from the 3.8 branch in
> this repo has compilation errors.

Well, looks we have a volunteer.. Apply this on top of the latest 3.14
branch (i force pushed out an update about an hour ago)

Just enable either spi1/spi1a via:

#include "am335x-bone-spi1-spidev.dtsi"
(or)
#include "am335x-bone-spi1a-spidev.dtsi"

Regards,

-- 
Robert Nelson
http://www.rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
From c9835cb84fa92fced9b0b26e556fb15861d5257c Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnel...@gmail.com>
Date: Tue, 26 Aug 2014 20:26:40 -0500
Subject: [PATCH] testing: add spi1/spi1a

Signed-off-by: Robert Nelson <robertcnel...@gmail.com>
---
 arch/arm/boot/dts/am335x-bone-common-pinmux.dtsi | 21 +++++++++++++++++++
 arch/arm/boot/dts/am335x-bone-spi1-spidev.dtsi   | 26 ++++++++++++++++++++++++
 arch/arm/boot/dts/am335x-bone-spi1a-spidev.dtsi  | 26 ++++++++++++++++++++++++
 arch/arm/boot/dts/am335x-boneblack.dts           | 14 +++++++++++++
 4 files changed, 87 insertions(+)
 create mode 100644 arch/arm/boot/dts/am335x-bone-spi1-spidev.dtsi
 create mode 100644 arch/arm/boot/dts/am335x-bone-spi1a-spidev.dtsi

diff --git a/arch/arm/boot/dts/am335x-bone-common-pinmux.dtsi b/arch/arm/boot/dts/am335x-bone-common-pinmux.dtsi
index 7519b71..4cef01c 100644
--- a/arch/arm/boot/dts/am335x-bone-common-pinmux.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common-pinmux.dtsi
@@ -303,6 +303,27 @@
 		>;
 	};
 
+	spi1_pins: pinmux_spi1_pins {
+		pinctrl-single,pins = <
+			0x190 0x33	/* mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | MODE3 */
+			0x194 0x33	/* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */
+			0x198 0x13	/* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */
+			0x19c 0x13	/* mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */
+			// 0x164 0x12	/* eCAP0_in_PWM0_out.spi1_cs1 OUTPUT_PULLUP | MODE2 */
+		>;
+	};
+
+	spi1a_pins: pinmux_spi1a_pins {
+		pinctrl-single,pins = <
+			0x164 0x34	/* eCAP0_in_PWM0_out.spi1_sclk, INPUT_PULLUP | MODE4 */
+					/* NOTE: P9.42 is connected to two pads */
+			// 0x1A0 0x27	/* set the other pad to gpio input */
+			0x194 0x33	/* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */
+			0x198 0x13	/* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */
+			0x178 0x14	/* uart1_ctsn.spi1_cs0, OUTPUT_PULLUP | MODE4 */
+		>;
+	};
+
 	uart0_pins: pinmux_uart0_pins {
 		pinctrl-single,pins = <
 			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
diff --git a/arch/arm/boot/dts/am335x-bone-spi1-spidev.dtsi b/arch/arm/boot/dts/am335x-bone-spi1-spidev.dtsi
new file mode 100644
index 0000000..24013d8a6b
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-bone-spi1-spidev.dtsi
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+&spi1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi1_pins>;
+	status = "okay";
+
+	spidev0: spi@0 {
+		compatible = "spidev";
+		reg = <0>;
+		spi-max-frequency = <16000000>;
+		spi-cpha;
+	};
+
+	spidev1: spi@1 {
+		compatible = "spidev";
+		reg = <1>;
+		spi-max-frequency = <16000000>;
+	};
+};
diff --git a/arch/arm/boot/dts/am335x-bone-spi1a-spidev.dtsi b/arch/arm/boot/dts/am335x-bone-spi1a-spidev.dtsi
new file mode 100644
index 0000000..b2185dd
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-bone-spi1a-spidev.dtsi
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+&spi1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi1a_pins>;
+	status = "okay";
+
+	spidev0: spi@0 {
+		compatible = "spidev";
+		reg = <0>;
+		spi-max-frequency = <16000000>;
+		spi-cpha;
+	};
+
+	spidev1: spi@1 {
+		compatible = "spidev";
+		reg = <1>;
+		spi-max-frequency = <16000000>;
+	};
+};
diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts
index 364e728..5778f3b 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -31,6 +31,20 @@
 /* spi0: P9.17, P9.18, P9.21, P9.22 */
 /* #include "am335x-bone-spi0-spidev.dtsi" */
 
+/* spi1: */
+/* P9.31 spi1_sclk */
+/* P9.29 spi1_d0 */
+/* P9.30 spi1_d1 */
+/* P9.28 spi1_cs0 */
+/* #include "am335x-bone-spi1-spidev.dtsi" */
+
+/* spi1a: */
+/* P9.42 spi1_sclk */
+/* P9.29 spi1_d0 */
+/* P9.30 spi1_d1 */
+/* P9.20 spi1_cs0 */
+/* #include "am335x-bone-spi1a-spidev.dtsi" */
+
 /* uart1: P9.24, P9.26 */
 /* #include "am335x-bone-ttyO1.dtsi" */
 /* uart2: P9.21, P9.22 */
-- 
2.1.0

Reply via email to