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
obj-$(CONFIG_PM) += pm.o sleep.o
# DSP
obj-$(CONFIG_OMAP_DSP) += mailbox.o
obj-$(CONFIG_OMAP_DSP) += mailbox_mach.o
mailbox_mach-objs := mailbox.o
led-y := leds.o
......
......@@ -61,7 +61,7 @@ static void omap_init_rtc(void)
static inline void omap_init_rtc(void) {}
#endif
#if defined(CONFIG_OMAP_DSP)
#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
#if defined(CONFIG_ARCH_OMAP15XX)
# define OMAP1_MBOX_SIZE 0x23
......
......@@ -141,6 +141,7 @@ struct omap_mbox mbox_dsp_info = {
.ops = &omap1_mbox_ops,
.priv = &omap1_mbox_dsp_priv,
};
EXPORT_SYMBOL(mbox_dsp_info);
static int __init omap1_mbox_probe(struct platform_device *pdev)
{
......
......@@ -12,7 +12,8 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o
obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o
# DSP
obj-$(CONFIG_OMAP_DSP) += mailbox.o
obj-$(CONFIG_OMAP_DSP) += mailbox_mach.o
mailbox_mach-objs := mailbox.o
# Specific board support
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
......
......@@ -66,7 +66,7 @@ static void omap_init_i2c(void) {}
#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)
static struct resource mbox_resources[] = {
......
......@@ -209,11 +209,12 @@ static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
};
static struct omap_mbox mbox_dsp_info = {
struct omap_mbox mbox_dsp_info = {
.name = "dsp",
.ops = &omap2_mbox_ops,
.priv = &omap2_mbox_dsp_priv,
};
EXPORT_SYMBOL(mbox_dsp_info);
/* IVA */
static struct omap_mbox2_priv omap2_mbox_iva_priv = {
......
......@@ -587,6 +587,7 @@ EXPORT_SYMBOL(api_ck_handle);
EXPORT_SYMBOL(dsp_fck_handle);
EXPORT_SYMBOL(dsp_ick_handle);
#endif
EXPORT_SYMBOL(omap_dsp);
EXPORT_SYMBOL(dspmem_base);
EXPORT_SYMBOL(dspmem_size);
EXPORT_SYMBOL(daram_base);
......
......@@ -406,7 +406,7 @@ int dsp_mbox_config(void *p)
static int __init dsp_mbox_init(void)
{
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");
return -ENODEV;
}
......@@ -677,5 +677,9 @@ static void __exit omap_dsp_mod_exit(void)
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_exit(omap_dsp_mod_exit);
......@@ -1647,6 +1647,8 @@ static int dsp_mmu_itack(void)
DSP_MMU_IRQ_TLBMISS)
#endif
static int is_mmu_init;
static void dsp_mmu_init(void)
{
struct tlb_lock tlb_lock;
......@@ -1682,13 +1684,17 @@ static void dsp_mmu_init(void)
omap_dsp_release_mem();
clk_disable(dsp_ck_handle);
#endif
is_mmu_init = 1;
}
static void dsp_mmu_shutdown(void)
{
exmap_flush();
exmap_clear_preserved_entries();
dsp_mmu_disable();
if (is_mmu_init) {
exmap_flush();
exmap_clear_preserved_entries();
dsp_mmu_disable();
}
}
#ifdef CONFIG_ARCH_OMAP1
......
......@@ -345,3 +345,5 @@ static void __exit omap_mbox_class_exit(void)
subsys_initcall(omap_mbox_class_init);
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