Commit 4f2a64e3 authored by Toshihiro Kobayashi's avatar Toshihiro Kobayashi Committed by Tony Lindgren

ARM: OMAP: Fix for mailbox and dsp module (repost)

Fix to build DSP Gateway as a module.

After this fix, modules regarding mailbox will be built as follows.

arch/arm/mach-omap[12]/mailbox.o -> mailbox_mach.ko
arch/arm/plat-omap/mailbox.o ->mailbox.ko
Signed-off-by: default avatarToshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
parent 37bab328
...@@ -11,7 +11,8 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += time.o ...@@ -11,7 +11,8 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += time.o
obj-$(CONFIG_PM) += pm.o sleep.o obj-$(CONFIG_PM) += pm.o sleep.o
# DSP # DSP
obj-$(CONFIG_OMAP_DSP) += mailbox.o obj-$(CONFIG_OMAP_DSP) += mailbox_mach.o
mailbox_mach-objs := mailbox.o
led-y := leds.o led-y := leds.o
......
...@@ -61,7 +61,7 @@ static void omap_init_rtc(void) ...@@ -61,7 +61,7 @@ static void omap_init_rtc(void)
static inline void omap_init_rtc(void) {} static inline void omap_init_rtc(void) {}
#endif #endif
#if defined(CONFIG_OMAP_DSP) #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
#if defined(CONFIG_ARCH_OMAP15XX) #if defined(CONFIG_ARCH_OMAP15XX)
# define OMAP1_MBOX_SIZE 0x23 # define OMAP1_MBOX_SIZE 0x23
......
...@@ -141,6 +141,7 @@ struct omap_mbox mbox_dsp_info = { ...@@ -141,6 +141,7 @@ struct omap_mbox mbox_dsp_info = {
.ops = &omap1_mbox_ops, .ops = &omap1_mbox_ops,
.priv = &omap1_mbox_dsp_priv, .priv = &omap1_mbox_dsp_priv,
}; };
EXPORT_SYMBOL(mbox_dsp_info);
static int __init omap1_mbox_probe(struct platform_device *pdev) static int __init omap1_mbox_probe(struct platform_device *pdev)
{ {
......
...@@ -12,7 +12,8 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o ...@@ -12,7 +12,8 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o
obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o
# DSP # DSP
obj-$(CONFIG_OMAP_DSP) += mailbox.o obj-$(CONFIG_OMAP_DSP) += mailbox_mach.o
mailbox_mach-objs := mailbox.o
# Specific board support # Specific board support
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
......
...@@ -66,7 +66,7 @@ static void omap_init_i2c(void) {} ...@@ -66,7 +66,7 @@ static void omap_init_i2c(void) {}
#endif #endif
#if defined(CONFIG_OMAP_DSP) #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE) #define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
static struct resource mbox_resources[] = { static struct resource mbox_resources[] = {
......
...@@ -209,11 +209,12 @@ static struct omap_mbox2_priv omap2_mbox_dsp_priv = { ...@@ -209,11 +209,12 @@ static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.newmsg_bit = MAILBOX_IRQ_NEWMSG(1), .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
}; };
static struct omap_mbox mbox_dsp_info = { struct omap_mbox mbox_dsp_info = {
.name = "dsp", .name = "dsp",
.ops = &omap2_mbox_ops, .ops = &omap2_mbox_ops,
.priv = &omap2_mbox_dsp_priv, .priv = &omap2_mbox_dsp_priv,
}; };
EXPORT_SYMBOL(mbox_dsp_info);
/* IVA */ /* IVA */
static struct omap_mbox2_priv omap2_mbox_iva_priv = { static struct omap_mbox2_priv omap2_mbox_iva_priv = {
......
...@@ -587,6 +587,7 @@ EXPORT_SYMBOL(api_ck_handle); ...@@ -587,6 +587,7 @@ EXPORT_SYMBOL(api_ck_handle);
EXPORT_SYMBOL(dsp_fck_handle); EXPORT_SYMBOL(dsp_fck_handle);
EXPORT_SYMBOL(dsp_ick_handle); EXPORT_SYMBOL(dsp_ick_handle);
#endif #endif
EXPORT_SYMBOL(omap_dsp);
EXPORT_SYMBOL(dspmem_base); EXPORT_SYMBOL(dspmem_base);
EXPORT_SYMBOL(dspmem_size); EXPORT_SYMBOL(dspmem_size);
EXPORT_SYMBOL(daram_base); EXPORT_SYMBOL(daram_base);
......
...@@ -406,7 +406,7 @@ int dsp_mbox_config(void *p) ...@@ -406,7 +406,7 @@ int dsp_mbox_config(void *p)
static int __init dsp_mbox_init(void) static int __init dsp_mbox_init(void)
{ {
omap_dsp->mbox = omap_mbox_get("dsp"); omap_dsp->mbox = omap_mbox_get("dsp");
if (IS_ERR(omap_dsp->mbox)) { if (omap_dsp->mbox == NULL) {
printk(KERN_ERR "failed to get mailbox handler for DSP.\n"); printk(KERN_ERR "failed to get mailbox handler for DSP.\n");
return -ENODEV; return -ENODEV;
} }
...@@ -677,5 +677,9 @@ static void __exit omap_dsp_mod_exit(void) ...@@ -677,5 +677,9 @@ static void __exit omap_dsp_mod_exit(void)
platform_driver_unregister(&dsp_driver); platform_driver_unregister(&dsp_driver);
} }
/* module dependency: need mailbox module that have mbox_dsp_info */
extern struct omap_mbox mbox_dsp_info;
struct omap_mbox *mbox_dep = &mbox_dsp_info;
module_init(omap_dsp_mod_init); module_init(omap_dsp_mod_init);
module_exit(omap_dsp_mod_exit); module_exit(omap_dsp_mod_exit);
...@@ -1647,6 +1647,8 @@ static int dsp_mmu_itack(void) ...@@ -1647,6 +1647,8 @@ static int dsp_mmu_itack(void)
DSP_MMU_IRQ_TLBMISS) DSP_MMU_IRQ_TLBMISS)
#endif #endif
static int is_mmu_init;
static void dsp_mmu_init(void) static void dsp_mmu_init(void)
{ {
struct tlb_lock tlb_lock; struct tlb_lock tlb_lock;
...@@ -1682,13 +1684,17 @@ static void dsp_mmu_init(void) ...@@ -1682,13 +1684,17 @@ static void dsp_mmu_init(void)
omap_dsp_release_mem(); omap_dsp_release_mem();
clk_disable(dsp_ck_handle); clk_disable(dsp_ck_handle);
#endif #endif
is_mmu_init = 1;
} }
static void dsp_mmu_shutdown(void) static void dsp_mmu_shutdown(void)
{ {
if (is_mmu_init) {
exmap_flush(); exmap_flush();
exmap_clear_preserved_entries(); exmap_clear_preserved_entries();
dsp_mmu_disable(); dsp_mmu_disable();
}
} }
#ifdef CONFIG_ARCH_OMAP1 #ifdef CONFIG_ARCH_OMAP1
......
...@@ -345,3 +345,5 @@ static void __exit omap_mbox_class_exit(void) ...@@ -345,3 +345,5 @@ static void __exit omap_mbox_class_exit(void)
subsys_initcall(omap_mbox_class_init); subsys_initcall(omap_mbox_class_init);
module_exit(omap_mbox_class_exit); module_exit(omap_mbox_class_exit);
MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment