Skip to contentSkip to conversation

SAMSUNG: SPI platform support

PATCH New Jassi Brar 1 participant 4 messages May 18, 2010

Subsystems (3)
lore
Share & tools
lore

Jassi Brar

author
#0 lore raw

PATCH 1/1 SAMSUNG: SPI platform support

Hi,
Following are few patches to define and add spi devices' support
for latest Samsung SoCs, namely S5P6440, S5P6442, S5PC100 and S5PV210
The device drivers will be enabled to run these via SPI tree.

Thanks.

author
#1 lore raw

PATCH 1/4 ARM: S5PC100: Define SPI platform devices

Define SPI platform devices for the SoC.

---
 arch/arm/mach-s5pc100/Makefile                   |    1 +
 arch/arm/mach-s5pc100/dev-spi.c                  |  233 ++++++++++++++++++++++
 arch/arm/mach-s5pc100/include/mach/map.h         |    5 +
 arch/arm/mach-s5pc100/include/mach/spi-clocks.h  |   18 ++
 arch/arm/plat-samsung/include/plat/devs.h        |    4 +
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |    1 +
 6 files changed, 262 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc100/dev-spi.c
 create mode 100644 arch/arm/mach-s5pc100/include/mach/spi-clocks.h
arch/arm/mach-s5pc100/Makefile +1 -0
index a81abef..abbcbe5 100644
@@ -22,3 +22,4 @@ obj-$(CONFIG_MACH_SMDKC100)	+= mach-smdkc100.o
 
 # device support
 obj-y				+= dev-audio.o
+obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
arch/arm/mach-s5pc100/dev-spi.c new file +233 -0

233 lines not on this page · raw message

arch/arm/mach-s5pc100/include/mach/map.h +5 -0
index de3891c..06730b2 100644
@@ -82,6 +82,11 @@
 #define S5PC100_PA_I2C		(0xEC100000)
 #define S5PC100_PA_I2C1		(0xEC200000)
 
+/* SPI */
+#define S5PC100_PA_SPI0		0xEC300000
+#define S5PC100_PA_SPI1		0xEC400000
+#define S5PC100_PA_SPI2		0xEC500000
+
 /* USB HS OTG */
 #define S5PC100_PA_USB_HSOTG	(0xED200000)
 #define S5PC100_PA_USB_HSPHY	(0xED300000)
arch/arm/mach-s5pc100/include/mach/spi-clocks.h new file +18 -0
new file mode 100644
index 0000000..65e4263
@@ -0,0 +1,18 @@
+/* linux/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
+ *
+ * Copyright (C) 2010 Samsung Electronics Co. Ltd.
+ *	Jaswinder Singh <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef __S5PC100_PLAT_SPI_CLKS_H
+#define __S5PC100_PLAT_SPI_CLKS_H __FILE__
+
+#define S5PC100_SPI_SRCCLK_PCLK		0
+#define S5PC100_SPI_SRCCLK_48M		1
+#define S5PC100_SPI_SRCCLK_SPIBUS	2
+
+#endif /* __S5PC100_PLAT_SPI_CLKS_H */
arch/arm/plat-samsung/include/plat/devs.h +4 -0
index 4380ca6..f5a0c4a 100644
@@ -57,6 +57,10 @@ extern struct platform_device s3c_device_hsmmc2;
 extern struct platform_device s3c_device_spi0;
 extern struct platform_device s3c_device_spi1;
 
+extern struct platform_device s5pc100_device_spi0;
+extern struct platform_device s5pc100_device_spi1;
+extern struct platform_device s5pc100_device_spi2;
+
 extern struct platform_device s3c_device_hwmon;
 
 extern struct platform_device s3c_device_nand;
arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +1 -0
index d177241..49ba71f 100644
@@ -63,5 +63,6 @@ struct s3c64xx_spi_info {
  * has some chips attached to it.
  */
 extern void s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
+extern void s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 
 #endif /* __S3C64XX_PLAT_SPI_H */
Signature · 1 line
1.6.2.5
author
#2 lore raw

PATCH 2/4 ARM: S5PV210: Define SPI platform devices

In reply to Jassi Brar

Define SPI platform devices for the SoC.

---
 arch/arm/mach-s5pv210/Makefile                   |    1 +
 arch/arm/mach-s5pv210/dev-spi.c                  |  178 ++++++++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/map.h         |    4 +
 arch/arm/mach-s5pv210/include/mach/spi-clocks.h  |   17 ++
 arch/arm/plat-samsung/include/plat/devs.h        |    2 +
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |    1 +
 6 files changed, 203 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/dev-spi.c
 create mode 100644 arch/arm/mach-s5pv210/include/mach/spi-clocks.h
arch/arm/mach-s5pv210/Makefile +1 -0
index 6ecfa9d..4ed901b 100644
@@ -22,3 +22,4 @@ obj-$(CONFIG_MACH_SMDKC110)	+= mach-smdkc110.o
 # device support
 
 obj-y				+= dev-audio.o
+obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
arch/arm/mach-s5pv210/dev-spi.c new file +178 -0

178 lines not on this page · raw message

arch/arm/mach-s5pv210/include/mach/map.h +4 -0
index 5adcb9f..9ab0069 100644
@@ -25,6 +25,10 @@
 #define S5PV210_PA_GPIO		(0xE0200000)
 #define S5P_PA_GPIO		S5PV210_PA_GPIO
 
+/* SPI */
+#define S5PV210_PA_SPI0		0xE1300000
+#define S5PV210_PA_SPI1		0xE1400000
+
 #define S5PV210_PA_IIC0		(0xE1800000)
 
 #define S5PV210_PA_TIMER	(0xE2500000)
arch/arm/mach-s5pv210/include/mach/spi-clocks.h new file +17 -0
new file mode 100644
index 0000000..02acded
@@ -0,0 +1,17 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
+ *
+ * Copyright (C) 2010 Samsung Electronics Co. Ltd.
+ *	Jaswinder Singh <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef __S5PV210_PLAT_SPI_CLKS_H
+#define __S5PV210_PLAT_SPI_CLKS_H __FILE__
+
+#define S5PV210_SPI_SRCCLK_PCLK		0
+#define S5PV210_SPI_SRCCLK_SCLK		1
+
+#endif /* __S5PV210_PLAT_SPI_CLKS_H */
arch/arm/plat-samsung/include/plat/devs.h +2 -0
index f5a0c4a..0759c50 100644
@@ -60,6 +60,8 @@ extern struct platform_device s3c_device_spi1;
 extern struct platform_device s5pc100_device_spi0;
 extern struct platform_device s5pc100_device_spi1;
 extern struct platform_device s5pc100_device_spi2;
+extern struct platform_device s5pv210_device_spi0;
+extern struct platform_device s5pv210_device_spi1;
 
 extern struct platform_device s3c_device_hwmon;
 
arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +1 -0
index 49ba71f..fdb40c3 100644
@@ -64,5 +64,6 @@ struct s3c64xx_spi_info {
  */
 extern void s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 extern void s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
+extern void s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 
 #endif /* __S3C64XX_PLAT_SPI_H */
Signature · 1 line
1.6.2.5
author
#3 lore raw

PATCH 4/4 ARM: S5P6442: Define SPI platform devices

In reply to Jassi Brar

Define SPI platform devices for the SoC.

---
 arch/arm/mach-s5p6442/Makefile                   |    1 +
 arch/arm/mach-s5p6442/dev-spi.c                  |  123 ++++++++++++++++++++++
 arch/arm/mach-s5p6442/include/mach/map.h         |    2 +
 arch/arm/mach-s5p6442/include/mach/spi-clocks.h  |   17 +++
 arch/arm/plat-samsung/include/plat/devs.h        |    1 +
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |    1 +
 6 files changed, 145 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p6442/dev-spi.c
 create mode 100644 arch/arm/mach-s5p6442/include/mach/spi-clocks.h
arch/arm/mach-s5p6442/Makefile +1 -0
index bf30550..1cd2cd6 100644
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_SMDK6442)	+= mach-smdk6442.o
 
 # device support
 obj-y				+= dev-audio.o
+obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
arch/arm/mach-s5p6442/dev-spi.c new file +123 -0

123 lines not on this page · raw message

arch/arm/mach-s5p6442/include/mach/map.h +2 -0
index 7568dc0..32ca424 100644
@@ -54,6 +54,8 @@
 #define S5P6442_PA_SDRAM	(0x20000000)
 #define S5P_PA_SDRAM		S5P6442_PA_SDRAM
 
+#define S5P6442_PA_SPI		0xEC300000
+
 /* I2S */
 #define S5P6442_PA_I2S0		0xC0B00000
 #define S5P6442_PA_I2S1		0xF2200000
arch/arm/mach-s5p6442/include/mach/spi-clocks.h new file +17 -0
new file mode 100644
index 0000000..7fd8820
@@ -0,0 +1,17 @@
+/* linux/arch/arm/mach-s5p6442/include/mach/spi-clocks.h
+ *
+ * Copyright (C) 2010 Samsung Electronics Co. Ltd.
+ *	Jaswinder Singh <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef __S5P6442_PLAT_SPI_CLKS_H
+#define __S5P6442_PLAT_SPI_CLKS_H __FILE__
+
+#define S5P6442_SPI_SRCCLK_PCLK		0
+#define S5P6442_SPI_SRCCLK_SCLK		1
+
+#endif /* __S5P6442_PLAT_SPI_CLKS_H */
arch/arm/plat-samsung/include/plat/devs.h +1 -0
index 01bd80e..c6975e5 100644
@@ -64,6 +64,7 @@ extern struct platform_device s5pv210_device_spi0;
 extern struct platform_device s5pv210_device_spi1;
 extern struct platform_device s5p6440_device_spi0;
 extern struct platform_device s5p6440_device_spi1;
+extern struct platform_device s5p6442_device_spi;
 
 extern struct platform_device s3c_device_hwmon;
 
arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +1 -0
index 043e9f6..e5aba8f 100644
@@ -66,5 +66,6 @@ extern void s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 extern void s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 extern void s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 extern void s5p6440_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
+extern void s5p6442_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
 
 #endif /* __S3C64XX_PLAT_SPI_H */
Signature · 1 line
1.6.2.5