msm: board: Add board and devices file for MSM9615
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-9615.c b/arch/arm/mach-msm/board-9615.c
new file mode 100644
index 0000000..1488fb6
--- /dev/null
+++ b/arch/arm/mach-msm/board-9615.c
@@ -0,0 +1,64 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/board.h>
+#include <mach/msm_iomap.h>
+#include <mach/gpio.h>
+#include <mach/gpiomux.h>
+#include "timer.h"
+#include "devices.h"
+
+static int __init gpiomux_init(void)
+{
+ int rc;
+
+ rc = msm_gpiomux_init(NR_GPIO_IRQS);
+ if (rc) {
+ pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
+ return rc;
+ }
+ return 0;
+}
+
+static void __init msm9615_common_init(void)
+{
+ msm9615_device_init();
+ gpiomux_init();
+}
+
+static void __init msm9615_cdp_init(void)
+{
+ msm9615_common_init();
+}
+
+static void __init msm9615_mtp_init(void)
+{
+ msm9615_common_init();
+}
+
+MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP")
+ .map_io = msm9615_map_io,
+ .init_irq = msm9615_init_irq,
+ .timer = &msm_timer,
+ .init_machine = msm9615_cdp_init,
+MACHINE_END
+
+MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP")
+ .map_io = msm9615_map_io,
+ .init_irq = msm9615_init_irq,
+ .timer = &msm_timer,
+ .init_machine = msm9615_mtp_init,
+MACHINE_END
diff --git a/arch/arm/mach-msm/devices-9615.c b/arch/arm/mach-msm/devices-9615.c
new file mode 100644
index 0000000..b255f3c
--- /dev/null
+++ b/arch/arm/mach-msm/devices-9615.c
@@ -0,0 +1,58 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/hardware/gic.h>
+#include <mach/board.h>
+#include <mach/msm_iomap.h>
+#include <mach/irqs.h>
+#include <mach/socinfo.h>
+#include "devices.h"
+
+void __init msm9615_device_init(void)
+{
+ if (socinfo_init() < 0)
+ pr_err("socinfo_init() failed!\n");
+
+}
+
+void __init msm9615_map_io(void)
+{
+ msm_map_msm9615_io();
+}
+
+void __init msm9615_init_irq(void)
+{
+ unsigned int i;
+ gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
+ (void *)MSM_QGIC_CPU_BASE);
+
+ /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
+ writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
+
+ writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
+ mb();
+
+ /*
+ * FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
+ * as they are configured as level, which does not play nice with
+ * handle_percpu_irq.
+ */
+ for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
+ if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
+ irq_set_handler(i, handle_percpu_irq);
+ }
+}
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 72e4ec2..69450ad 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -19,8 +19,13 @@
#include <linux/clkdev.h>
#include <linux/platform_device.h>
-
#include "clock.h"
+
+void __init msm9615_device_init(void);
+void __init msm9615_map_io(void);
+void __init msm_map_msm9615_io(void);
+void __init msm9615_init_irq(void);
+
extern struct platform_device asoc_msm_pcm;
extern struct platform_device asoc_msm_dai0;
extern struct platform_device asoc_msm_dai1;