Skip to contentSkip to conversation

at91: spi suport + pinctrl

GIT PULL Superseded Jean-Christophe PLAGNIOL-VILLARD 1 participant 4 messages Nov 23, 2012

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

HI,

	the following patch add the spi and its pinctrl support
	to the sam9 IP that use the PDC (9263/9260/9g20/9g45)

based on the mmc pull request

please pull

The following changes since commit c12a819e3ad9147acec3f20201fd51144f2244e9:

ARM: at91: pm9g45: add mmc support (2012-11-20 01:10:28 +0800)

are available in the git repository at:

git://github.com/at91linux/linux-at91.git at91-3.8-pinctrl+mmc+spi

for you to fetch changes up to 1869d34b6e3ff5bcdf7059dad431b8ae3818a4f6:

ARM: at91: dt: sam9m10g45ek add spi support (2012-11-22 04:51:42 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (2):
ARM: at91: sam9: add spi dt support
ARM: at91: dt: sam9m10g45ek add spi support

 arch/arm/boot/dts/at91sam9260.dtsi     |   40 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/at91sam9263.dtsi     |   40 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/at91sam9g45.dtsi     |   40 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/at91sam9m10g45ek.dts |   33 +++++++++++++++++++++++++++++++++
 arch/arm/mach-at91/at91sam9260.c       |    2 ++
 arch/arm/mach-at91/at91sam9g45.c       |    2 ++
 6 files changed, 157 insertions(+)

Best Regards,
J.

#1 lore raw

PATCH 1/3 ARM: at91: sam9: add spi dt support

for now on does not add 9x5 and 9n12 as they use IP version 2.1 that use DMA instead of the PDC

---
 arch/arm/boot/dts/at91sam9260.dtsi |   40 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/at91sam9263.dtsi |   40 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/at91sam9g45.dtsi |   40 ++++++++++++++++++++++++++++++++++++
 arch/arm/mach-at91/at91sam9260.c   |    2 ++
 arch/arm/mach-at91/at91sam9g45.c   |    2 ++
 5 files changed, 124 insertions(+)
arch/arm/boot/dts/at91sam9260.dtsi +40 -0
index b1d3fab..240a6ed 100644
@@ -92,6 +92,28 @@
 				interrupts = <17 4 0 18 4 0 19 4 0>;
 			};
 
+			spi0: spi at fffc8000 {
+				compatible = "atmel,at91rm9200-spi";
+				reg = <0xfffc8000 0x4000>;
+				interrupts = <12 4 5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_spi0>;
+				status = "disabled";
+			};
+
+			spi1: spi at fffcc000 {
+				compatible = "atmel,at91rm9200-spi";
+				reg = <0xfffcc000 0x4000>;
+				interrupts = <13 4 5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_spi1>;
+				status = "disabled";
+			};
+
 			tcb1: timer at fffdc000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffdc000 0x100>;
@@ -305,6 +327,24 @@
 					};
 				};
 
+				spi0 {
+					pinctrl_spi0: spi0-0 {
+						atmel,pins =
+							<0 0 0x1 0x0	/* PA0 periph A */
+							 0 1 0x1 0x0	/* PA1 periph A */
+							 0 2 0x1 0x0>;	/* PA2 periph A */
+					};
+				};
+
+				spi1 {
+					pinctrl_spi1: spi1-0 {
+						atmel,pins =
+							<1 0 0x1 0x0	/* PB0 periph A */
+							 1 1 0x1 0x0	/* PB1 periph A */
+							 1 2 0x1 0x0>;	/* PB2 periph A */
+					};
+				};
+
 				pioA: gpio at fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
arch/arm/boot/dts/at91sam9263.dtsi +40 -0
index 66106ee..dc118c3 100644
@@ -269,6 +269,24 @@
 					};
 				};
 
+				spi0 {
+					pinctrl_spi0: spi0-0 {
+						atmel,pins =
+							<0 0 0x2 0x0	/* PA0 periph B */
+							 0 1 0x2 0x0	/* PA1 periph B */
+							 0 2 0x2 0x0>;	/* PA2 periph B */
+					};
+				};
+
+				spi1 {
+					pinctrl_spi1: spi1-0 {
+						atmel,pins =
+							<1 12 0x1 0x0	/* PB12 periph A */
+							 1 13 0x1 0x0	/* PB13 periph A */
+							 1 14 0x1 0x0>;	/* PB14 periph A */
+					};
+				};
+
 				pioA: gpio at fffff200 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x200>;
@@ -371,6 +389,28 @@
 				status = "disabled";
 			};
 
+			spi0: spi at fffa4000 {
+				compatible = "atmel,at91rm9200-spi";
+				reg = <0xfffa4000 0x4000>;
+				interrupts = <14 4 5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_spi0>;
+				status = "disabled";
+			};
+
+			spi1: spi at fffa8000 {
+				compatible = "atmel,at91rm9200-spi";
+				reg = <0xfffa8000 0x4000>;
+				interrupts = <15 4 5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_spi1>;
+				status = "disabled";
+			};
+
 			usb1: gadget at fff78000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfff78000 0x4000>;
arch/arm/boot/dts/at91sam9g45.dtsi +40 -0
index 0741cae..d0eb2db 100644
@@ -96,6 +96,28 @@
 				interrupts = <18 4 0>;
 			};
 
+			spi0: spi at fffa4000 {
+				compatible = "atmel,at91rm9200-spi";
+				reg = <0xfffa4000 0x4000>;
+				interrupts = <14 4 5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_spi0>;
+				status = "disabled";
+			};
+
+			spi1: spi at fffa8000 {
+				compatible = "atmel,at91rm9200-spi";
+				reg = <0xfffa8000 0x4000>;
+				interrupts = <15 4 5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_spi1>;
+				status = "disabled";
+			};
+
 			tcb1: timer at fffd4000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffd4000 0x100>;
@@ -288,6 +310,24 @@
 					};
 				};
 
+				spi0 {
+					pinctrl_spi0: spi0-0 {
+						atmel,pins =
+							<1 0 0x1 0x0	/* PB0 periph A */
+							 1 1 0x1 0x0	/* PB1 periph A */
+							 1 2 0x1 0x0>;	/* PB2 periph A */
+					};
+				};
+
+				spi1 {
+					pinctrl_spi1: spi1-0 {
+						atmel,pins =
+							<1 14 0x1 0x0	/* PB14 periph A */
+							 1 15 0x1 0x0	/* PB15 periph A */
+							 1 16 0x1 0x0>;	/* PB16 periph A */
+					};
+				};
+
 				pioA: gpio at fffff200 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x200>;
arch/arm/mach-at91/at91sam9260.c +2 -0
index c9e029e..64e33e1 100644
@@ -239,6 +239,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
 	CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
 	CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
+	CLKDEV_CON_DEV_ID("spi_clk", "fffc8000.spi", &spi0_clk),
+	CLKDEV_CON_DEV_ID("spi_clk", "fffcc000.spi", &spi1_clk)
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
arch/arm/mach-at91/at91sam9g45.c +2 -0
index c5c2acc..4f51dbf 100644
@@ -267,6 +267,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioC_clk),
 	CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioDE_clk),
 	CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioDE_clk),
+	CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk),
+	CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk),
 
 	CLKDEV_CON_ID("pioA", &pioA_clk),
 	CLKDEV_CON_ID("pioB", &pioB_clk),
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/3 ARM: at91: dt: sam9m10g45ek add spi support

---
 arch/arm/boot/dts/at91sam9m10g45ek.dts |   33 ++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm/boot/dts/at91sam9m10g45ek.dts +33 -0
index 20c3191..829cbb1 100644
@@ -102,6 +102,39 @@
 					};
 				};
 			};
+
+			spi0: spi at fffa4000 {
+				cs-gpios = <&pioB 3 0>;
+				status = "okay";
+
+				flash: at45db321d at 0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
+					reg = <0>;
+					spi-max-frequency = <15000000>;
+
+					bootstrap at 0 {
+						label = "bootstrap";
+						reg = <0x0 0x7fe0>;
+					};
+
+					barebox at 7fe0 {
+						label = "barebox";
+						reg = <0x7fe0 0x40110>;
+					};
+
+					bareboxenv at 480f0 {
+						label = "bareboxenv";
+						reg = <0x480f0 0x7fe0>;
+					};
+
+					kernel at 500d0 {
+						label = "Kernel";
+						reg = <0x500d0 0x3cff30>;
+					};
+				};
+			};
 		};
 
 		nand0: nand at 40000000 {
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/3 ARM: at91: usb-a9g20: dt: add mmc-spi support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/boot/dts/usb_a9g20.dts |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/usb_a9g20.dts +16 -0
index 2dacb16c..503f604 100644
@@ -21,6 +21,22 @@
 		reg = <0x20000000 0x4000000>;
 	};
 
+	ahb {
+		apb {
+			spi1: spi at fffcc000 {
+				cs-gpios = <&pioB 3 0>;
+				status = "okay";
+
+				mmc-slot at 0 {
+					compatible = "mmc-spi-slot";
+					reg = <0>;
+					gpios = <&pioC 4 0>;	/* CD */
+					spi-max-frequency = <25000000>;
+				};
+			};
+		};
+	};
+
 	i2c at 0 {
 		rv3029c2 at 56 {
 			compatible = "rv3029c2";
Signature · 1 line
1.7.10.4