msm: Add SPI QUP support for APQ8064
Add the device definitions and platform data to support
SPI QUP on APQ8064 simulator and RUMI3 targets.
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-apq8064.c b/arch/arm/mach-msm/board-apq8064.c
index 30006ce..99c1610 100644
--- a/arch/arm/mach-msm/board-apq8064.c
+++ b/arch/arm/mach-msm/board-apq8064.c
@@ -23,9 +23,9 @@
#include <linux/usb/msm_hsusb.h>
#include <linux/usb/android.h>
#include <mach/socinfo.h>
+#include <mach/msm_spi.h>
#include "timer.h"
#include "devices.h"
-#include <mach/msm_spi.h>
#include <mach/gpio.h>
#include <mach/gpiomux.h>
@@ -71,7 +71,12 @@
static struct platform_device *common_devices[] __initdata = {
&msm_device_dmov,
- &apq8064_device_uart_gsbi3
+ &apq8064_device_uart_gsbi3,
+ &apq8064_device_qup_spi_gsbi5,
+};
+
+static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
+ .max_clock_speed = 26000000,
};
static struct msm_otg_platform_data msm_otg_pdata = {
@@ -101,6 +106,8 @@
pr_err("socinfo_init() failed!\n");
msm_clock_init(msm_clocks_8064_dummy, msm_num_clocks_8064_dummy);
gpiomux_init();
+ apq8064_device_qup_spi_gsbi5.dev.platform_data =
+ &apq8064_qup_spi_gsbi5_pdata;
platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
}
diff --git a/arch/arm/mach-msm/devices-8064.c b/arch/arm/mach-msm/devices-8064.c
index d368e2c..89f1811 100644
--- a/arch/arm/mach-msm/devices-8064.c
+++ b/arch/arm/mach-msm/devices-8064.c
@@ -24,8 +24,22 @@
/* Address of GSBI blocks */
#define MSM_GSBI3_PHYS 0x16200000
+#define MSM_GSBI4_PHYS 0x16300000
+#define MSM_GSBI5_PHYS 0x1A200000
+#define MSM_GSBI6_PHYS 0x16500000
+#define MSM_GSBI7_PHYS 0x16600000
+
#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
+/* GSBI QUP devices */
+#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
+#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
+#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
+#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
+#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
+#define MSM_QUP_SIZE SZ_4K
+
+
static struct resource msm_dmov_resource[] = {
{
.start = ADM_0_SCSS_0_IRQ,
@@ -426,7 +440,7 @@
CLK_DUMMY("gsbi_qup_clk", GSBI2_QUP_CLK, NULL, OFF),
CLK_DUMMY("gsbi_qup_clk", GSBI3_QUP_CLK, NULL, OFF),
CLK_DUMMY("gsbi_qup_clk", GSBI4_QUP_CLK, NULL, OFF),
- CLK_DUMMY("gsbi_qup_clk", GSBI5_QUP_CLK, NULL, OFF),
+ CLK_DUMMY("spi_clk", GSBI5_QUP_CLK, "spi_qsd.0", OFF),
CLK_DUMMY("gsbi_qup_clk", GSBI6_QUP_CLK, NULL, OFF),
CLK_DUMMY("gsbi_qup_clk", GSBI7_QUP_CLK, NULL, OFF),
CLK_DUMMY("gsbi_qup_clk", GSBI8_QUP_CLK, NULL, OFF),
@@ -459,7 +473,7 @@
CLK_DUMMY("gsbi_pclk", GSBI3_P_CLK,
"msm_serial_hsl.0", OFF),
CLK_DUMMY("gsbi_pclk", GSBI4_P_CLK, NULL, OFF),
- CLK_DUMMY("gsbi_pclk", GSBI5_P_CLK, NULL, OFF),
+ CLK_DUMMY("spi_pclk", GSBI5_P_CLK, "spi_qsd.0", OFF),
CLK_DUMMY("uartdm_pclk", GSBI6_P_CLK, NULL, OFF),
CLK_DUMMY("gsbi_pclk", GSBI7_P_CLK, NULL, OFF),
CLK_DUMMY("gsbi_pclk", GSBI8_P_CLK, NULL, OFF),
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 474ba9c..4bb0024 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -54,6 +54,7 @@
extern struct platform_device msm8960_gemini_device;
extern struct platform_device apq8064_device_uart_gsbi3;
+extern struct platform_device apq8064_device_qup_spi_gsbi5;
extern struct platform_device msm_device_sdc1;
extern struct platform_device msm_device_sdc2;