ARM: OMAP1: OCPI: move to mach-omap1/
authorPaul Walmsley <paul@pwsan.com>
Fri, 13 Apr 2012 12:34:27 +0000 (06:34 -0600)
committerPaul Walmsley <paul@pwsan.com>
Fri, 13 Apr 2012 12:34:27 +0000 (06:34 -0600)
Move the OMAP1 OCPI "bus" code to arch/arm/mach-omap1, since it is
only used on OMAP1 devices.  In the long term, it probably makes sense
to move the OCPI bus code to somewhere under drivers/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/Makefile
arch/arm/mach-omap1/common.h
arch/arm/mach-omap1/ocpi.c [new file with mode: 0644]
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/ocpi.c [deleted file]

index 9923f92b5450e4f74701d560a31c9ba04782748f..20d65af64580d58c31ff42e5b3bc10dbd31cb236 100644 (file)
@@ -12,6 +12,9 @@ endif
 
 obj-$(CONFIG_OMAP_32K_TIMER)   += timer32k.o
 
+# OCPI interconnect support for 1710, 1610 and 5912
+obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
+
 # Power Management
 obj-$(CONFIG_PM) += pm.o sleep.o
 
index ef656ff6ffd2cf71b09fb49a2df9b6a302f8531a..a90b9d7e749a3f419499a469a999421268f203a2 100644 (file)
@@ -63,4 +63,6 @@ extern bool omap_32k_timer_init(void);
 
 extern u32 omap_irq_flags;
 
+extern int ocpi_enable(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/ocpi.c b/arch/arm/mach-omap1/ocpi.c
new file mode 100644 (file)
index 0000000..238170c
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * linux/arch/arm/plat-omap/ocpi.c
+ *
+ * Minimal OCP bus support for omap16xx
+ *
+ * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2012 Texas Instruments, Inc.
+ * Written by Tony Lindgren <tony@atomide.com>
+ *
+ * Modified for clock framework by Paul Mundt <paul.mundt@nokia.com>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+
+#include <mach/hardware.h>
+
+#include "common.h"
+
+#define OCPI_BASE              0xfffec320
+#define OCPI_FAULT             (OCPI_BASE + 0x00)
+#define OCPI_CMD_FAULT         (OCPI_BASE + 0x04)
+#define OCPI_SINT0             (OCPI_BASE + 0x08)
+#define OCPI_TABORT            (OCPI_BASE + 0x0c)
+#define OCPI_SINT1             (OCPI_BASE + 0x10)
+#define OCPI_PROT              (OCPI_BASE + 0x14)
+#define OCPI_SEC               (OCPI_BASE + 0x18)
+
+/* USB OHCI OCPI access error registers */
+#define HOSTUEADDR     0xfffba0e0
+#define HOSTUESTATUS   0xfffba0e4
+
+static struct clk *ocpi_ck;
+
+/*
+ * Enables device access to OMAP buses via the OCPI bridge
+ * FIXME: Add locking
+ */
+int ocpi_enable(void)
+{
+       unsigned int val;
+
+       if (!cpu_is_omap16xx())
+               return -ENODEV;
+
+       /* Enable access for OHCI in OCPI */
+       val = omap_readl(OCPI_PROT);
+       val &= ~0xff;
+       /* val &= (1 << 0);      Allow access only to EMIFS */
+       omap_writel(val, OCPI_PROT);
+
+       val = omap_readl(OCPI_SEC);
+       val &= ~0xff;
+       omap_writel(val, OCPI_SEC);
+
+       return 0;
+}
+EXPORT_SYMBOL(ocpi_enable);
+
+static int __init omap_ocpi_init(void)
+{
+       if (!cpu_is_omap16xx())
+               return -ENODEV;
+
+       ocpi_ck = clk_get(NULL, "l3_ocpi_ck");
+       if (IS_ERR(ocpi_ck))
+               return PTR_ERR(ocpi_ck);
+
+       clk_enable(ocpi_ck);
+       ocpi_enable();
+       pr_info("OMAP OCPI interconnect driver loaded\n");
+
+       return 0;
+}
+
+static void __exit omap_ocpi_exit(void)
+{
+       /* REVISIT: Disable OCPI */
+
+       if (!cpu_is_omap16xx())
+               return;
+
+       clk_disable(ocpi_ck);
+       clk_put(ocpi_ck);
+}
+
+MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
+MODULE_DESCRIPTION("OMAP OCPI bus controller module");
+MODULE_LICENSE("GPL");
+module_init(omap_ocpi_init);
+module_exit(omap_ocpi_exit);
index c0fe2757b695e74f098edbdca4125541d842d4a1..ed8605f0115561ac44dc542c52d27afc0f98233b 100644 (file)
@@ -9,9 +9,6 @@ obj-m :=
 obj-n :=
 obj-  :=
 
-# OCPI interconnect support for 1710, 1610 and 5912
-obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
-
 # omap_device support (OMAP2+ only at the moment)
 obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
 obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/plat-omap/ocpi.c
deleted file mode 100644 (file)
index ebe0c73..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * linux/arch/arm/plat-omap/ocpi.c
- *
- * Minimal OCP bus support for omap16xx
- *
- * Copyright (C) 2003 - 2005 Nokia Corporation
- * Written by Tony Lindgren <tony@atomide.com>
- *
- * Modified for clock framework by Paul Mundt <paul.mundt@nokia.com>.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-
-#define OCPI_BASE              0xfffec320
-#define OCPI_FAULT             (OCPI_BASE + 0x00)
-#define OCPI_CMD_FAULT         (OCPI_BASE + 0x04)
-#define OCPI_SINT0             (OCPI_BASE + 0x08)
-#define OCPI_TABORT            (OCPI_BASE + 0x0c)
-#define OCPI_SINT1             (OCPI_BASE + 0x10)
-#define OCPI_PROT              (OCPI_BASE + 0x14)
-#define OCPI_SEC               (OCPI_BASE + 0x18)
-
-/* USB OHCI OCPI access error registers */
-#define HOSTUEADDR     0xfffba0e0
-#define HOSTUESTATUS   0xfffba0e4
-
-static struct clk *ocpi_ck;
-
-/*
- * Enables device access to OMAP buses via the OCPI bridge
- * FIXME: Add locking
- */
-int ocpi_enable(void)
-{
-       unsigned int val;
-
-       if (!cpu_is_omap16xx())
-               return -ENODEV;
-
-       /* Enable access for OHCI in OCPI */
-       val = omap_readl(OCPI_PROT);
-       val &= ~0xff;
-       //val &= (1 << 0);      /* Allow access only to EMIFS */
-       omap_writel(val, OCPI_PROT);
-
-       val = omap_readl(OCPI_SEC);
-       val &= ~0xff;
-       omap_writel(val, OCPI_SEC);
-
-       return 0;
-}
-EXPORT_SYMBOL(ocpi_enable);
-
-static int __init omap_ocpi_init(void)
-{
-       if (!cpu_is_omap16xx())
-               return -ENODEV;
-
-       ocpi_ck = clk_get(NULL, "l3_ocpi_ck");
-       if (IS_ERR(ocpi_ck))
-               return PTR_ERR(ocpi_ck);
-
-       clk_enable(ocpi_ck);
-       ocpi_enable();
-       printk("OMAP OCPI interconnect driver loaded\n");
-
-       return 0;
-}
-
-static void __exit omap_ocpi_exit(void)
-{
-       /* REVISIT: Disable OCPI */
-
-       if (!cpu_is_omap16xx())
-               return;
-
-       clk_disable(ocpi_ck);
-       clk_put(ocpi_ck);
-}
-
-MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
-MODULE_DESCRIPTION("OMAP OCPI bus controller module");
-MODULE_LICENSE("GPL");
-module_init(omap_ocpi_init);
-module_exit(omap_ocpi_exit);