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: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
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
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
.ops = &omap1_mbox_ops,
.priv = &omap1_mbox_dsp_priv,
};
+EXPORT_SYMBOL(mbox_dsp_info);
static int __init omap1_mbox_probe(struct platform_device *pdev)
{
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
#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[] = {
.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 = {
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);
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;
}
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);
DSP_MMU_IRQ_TLBMISS)
#endif
+static int is_mmu_init;
+
static void dsp_mmu_init(void)
{
struct tlb_lock tlb_lock;
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
subsys_initcall(omap_mbox_class_init);
module_exit(omap_mbox_class_exit);
+
+MODULE_LICENSE("GPL");