From: Trilok Soni Date: Sun, 25 Feb 2007 13:52:50 +0000 (+0530) Subject: ARM: OMAP: MMU fwk modulisation and misc. changes. X-Git-Tag: v2.6.21-omap1~98 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=997059003ce31a1c611e2db9b8a56cabf6bbc330;p=linux-2.6-omap-h63xx.git ARM: OMAP: MMU fwk modulisation and misc. changes. - MMU fwk modulisations - Patch from Doyu-San for OMAP1 Signed-off-by: Trilok Soni Signed-off-by: Hiroshi DOYU --- diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index 6819d0c42b5..83776653906 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile @@ -11,8 +11,10 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += time.o obj-$(CONFIG_PM) += pm.o sleep.o # DSP -obj-$(CONFIG_OMAP_DSP) += mailbox_mach.o mmu.o -mailbox_mach-objs := mailbox.o +obj-$(CONFIG_OMAP_MMU_FWK) += mmu_mach.o +obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o +mailbox_mach-objs := mailbox.o +mmu_mach-objs := mmu.o led-y := leds.o diff --git a/arch/arm/mach-omap1/mmu.c b/arch/arm/mach-omap1/mmu.c index 108e75c47fd..7417124a45a 100644 --- a/arch/arm/mach-omap1/mmu.c +++ b/arch/arm/mach-omap1/mmu.c @@ -72,6 +72,7 @@ void dsp_mem_usecount_clear(void) omap_dsp_release_mem(); } } +EXPORT_SYMBOL_GPL(dsp_mem_usecount_clear); static int omap1_mmu_mem_enable(struct omap_mmu *mmu, void *addr) { @@ -271,4 +272,4 @@ struct omap_mmu_ops omap1_mmu_ops = { .cam_ram_alloc = omap1_mmu_cam_ram_alloc, .cam_ram_valid = omap1_mmu_cam_ram_valid, }; - +EXPORT_SYMBOL_GPL(omap1_mmu_ops); diff --git a/arch/arm/mach-omap1/mmu.h b/arch/arm/mach-omap1/mmu.h index 31ce3b835d9..3acbb846a98 100644 --- a/arch/arm/mach-omap1/mmu.h +++ b/arch/arm/mach-omap1/mmu.h @@ -107,13 +107,13 @@ struct omap_mmu_tlb_entry { static inline unsigned short omap_mmu_read_reg(struct omap_mmu *mmu, unsigned long reg) { - return omap_readw(mmu->base + reg); + return __raw_readw(mmu->base + reg); } static void omap_mmu_write_reg(struct omap_mmu *mmu, unsigned short val, unsigned long reg) { - omap_writew(val, mmu->base + reg); + __raw_writew(val, mmu->base + reg); } int omap_dsp_request_mem(void); diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 9f5811bff05..6842b2824ba 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -12,8 +12,10 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o obj-$(CONFIG_PM) += pm.o sleep.o # DSP -obj-$(CONFIG_OMAP_DSP) += mailbox_mach.o mmu.o -mailbox_mach-objs := mailbox.o +obj-$(CONFIG_OMAP_MMU_FWK) += mmu_mach.o +obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o +mailbox_mach-objs := mailbox.o +mmu_mach-objs := mmu.o # Specific board support obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o diff --git a/arch/arm/mach-omap2/mmu.c b/arch/arm/mach-omap2/mmu.c index 5f74e845f31..be8764d1728 100644 --- a/arch/arm/mach-omap2/mmu.c +++ b/arch/arm/mach-omap2/mmu.c @@ -286,3 +286,6 @@ struct omap_mmu_ops omap2_mmu_ops = { .cam_ram_alloc = omap2_mmu_cam_ram_alloc, .cam_ram_valid = omap2_mmu_cam_ram_valid, }; +EXPORT_SYMBOL_GPL(omap2_mmu_ops); + +MODULE_LICENSE("GPL"); diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 3114d8271b5..6facd962b48 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -119,6 +119,22 @@ config OMAP_MCBSP Say Y here if you want support for the OMAP Multichannel Buffered Serial Port. +config OMAP_MMU_FWK + tristate "MMU framework support" + depends on ARCH_OMAP + default n + help + Say Y here if you want to use OMAP MMU framework support for + DSP, IVA1.0 and Camera in OMAP1/2. + +config OMAP_MBOX_FWK + tristate "Mailbox framework support" + depends on ARCH_OMAP + default n + help + Say Y here if you want to use OMAP Mailbox framework support for + DSP and IVA1.0 in OMAP1/2. + choice prompt "System timer" default OMAP_MPU_TIMER diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 05eb3cb1dc9..d17ca1a211a 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -27,6 +27,11 @@ obj-$(CONFIG_OMAP_GPIO_SWITCH) += gpio-switch.o obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o +# OMAP MMU framework +obj-$(CONFIG_OMAP_MMU_FWK) += mmu.o + +# OMAP mailbox framework +obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o + # DSP subsystem obj-y += dsp/ -obj-$(CONFIG_OMAP_DSP) += mailbox.o mmu.o diff --git a/arch/arm/plat-omap/dsp/Kconfig b/arch/arm/plat-omap/dsp/Kconfig index 71da40bc538..592740fcc12 100644 --- a/arch/arm/plat-omap/dsp/Kconfig +++ b/arch/arm/plat-omap/dsp/Kconfig @@ -2,6 +2,8 @@ config OMAP_DSP tristate "OMAP DSP driver (DSP Gateway)" depends on ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP24XX + select OMAP_MMU_FWK + select OMAP_MBOX_FWK help This enables OMAP DSP driver, DSP Gateway. diff --git a/arch/arm/plat-omap/dsp/dsp_common.c b/arch/arm/plat-omap/dsp/dsp_common.c index 2f3117e31b2..2751324d0f8 100644 --- a/arch/arm/plat-omap/dsp/dsp_common.c +++ b/arch/arm/plat-omap/dsp/dsp_common.c @@ -607,10 +607,8 @@ EXPORT_SYMBOL(dsp_cpustat_request); EXPORT_SYMBOL(dsp_cpustat_get_stat); EXPORT_SYMBOL(dsp_cpustat_get_icrmask); EXPORT_SYMBOL(dsp_cpustat_set_icrmask); -#ifdef CONFIG_ARCH_OMAP1 EXPORT_SYMBOL(dsp_register_mem_cb); EXPORT_SYMBOL(dsp_unregister_mem_cb); -#endif /* CONFIG_ARCH_OMAP1 */ EXPORT_SYMBOL(__cpu_flush_kern_tlb_range); EXPORT_SYMBOL(cpu_architecture); diff --git a/arch/arm/plat-omap/dsp/mmu.h b/arch/arm/plat-omap/dsp/mmu.h index ab9953ab9ec..822071c086a 100644 --- a/arch/arm/plat-omap/dsp/mmu.h +++ b/arch/arm/plat-omap/dsp/mmu.h @@ -7,7 +7,7 @@ struct omap_mmu dsp_mmu = { .name = "dsp", .type = OMAP_MMU_DSP, - .base = OMAP15XX_DSP_START, + .base = DSP_MMU_BASE, .membase = OMAP15XX_DSP_BASE, .memsize = OMAP15XX_DSP_SIZE, .nr_tlb_entries = 32, @@ -19,7 +19,7 @@ struct omap_mmu dsp_mmu = { struct omap_mmu dsp_mmu = { .name = "dsp", .type = OMAP_MMU_DSP, - .base = OMAP16XX_DSP_START, + .base = DSP_MMU_BASE, .membase = OMAP16XX_DSP_BASE, .memsize = OMAP16XX_DSP_SIZE, .nr_tlb_entries = 32, diff --git a/arch/arm/plat-omap/dsp/omap1_dsp.h b/arch/arm/plat-omap/dsp/omap1_dsp.h index 8dfe4d6ec39..45fdb507d99 100644 --- a/arch/arm/plat-omap/dsp/omap1_dsp.h +++ b/arch/arm/plat-omap/dsp/omap1_dsp.h @@ -103,7 +103,7 @@ /* * DSP MMU */ -#define DSP_MMU_BASE (0xfffed200) +#define DSP_MMU_BASE (0xfefed200) #define DSP_MMU_PREFETCH (DSP_MMU_BASE + 0x00) #define DSP_MMU_WALKING_ST (DSP_MMU_BASE + 0x04) #define DSP_MMU_CNTL (DSP_MMU_BASE + 0x08) diff --git a/arch/arm/plat-omap/dsp/taskwatch.c b/arch/arm/plat-omap/dsp/taskwatch.c index cfec6b3e5e5..0a5781d4e4a 100644 --- a/arch/arm/plat-omap/dsp/taskwatch.c +++ b/arch/arm/plat-omap/dsp/taskwatch.c @@ -26,9 +26,9 @@ #include #include #include +#include #include "dsp_mbcmd.h" #include "dsp.h" -#include "ioctl.h" static DECLARE_WAIT_QUEUE_HEAD(read_wait_q); static unsigned int change_cnt; diff --git a/arch/arm/plat-omap/mmu.c b/arch/arm/plat-omap/mmu.c index d5af168b882..a7c06421c03 100644 --- a/arch/arm/plat-omap/mmu.c +++ b/arch/arm/plat-omap/mmu.c @@ -281,6 +281,7 @@ start: return 0; } +EXPORT_SYMBOL_GPL(exmap_valid); /* * omap_mmu_exmap_use(), unuse(): @@ -361,6 +362,7 @@ omap_mmu_virt_to_phys(struct omap_mmu *mmu, void *vadr, size_t *len) /* valid mapping not found */ return 0; } +EXPORT_SYMBOL_GPL(omap_mmu_virt_to_phys); /* * MMU operations @@ -708,6 +710,7 @@ fail: omap_mmu_exunmap(mmu, dspadr); return status; } +EXPORT_SYMBOL_GPL(omap_mmu_exmap); static unsigned long unmap_free_arm(struct exmap_tbl *ent) { @@ -831,6 +834,7 @@ void exmap_setup_preserved_mem_page(struct omap_mmu *mmu, void *buf, INIT_TLB_ENTRY_4KB_PRESERVED(&tlb_ent, dspadr, phys); omap_mmu_load_tlb_entry(mmu, &tlb_ent); } +EXPORT_SYMBOL_GPL(exmap_setup_preserved_mem_page); void exmap_clear_mem_page(struct omap_mmu *mmu, unsigned long dspadr) { @@ -839,6 +843,7 @@ void exmap_clear_mem_page(struct omap_mmu *mmu, unsigned long dspadr) exmap_clear_armmmu((unsigned long)virt, PAGE_SIZE); /* DSP MMU is shutting down. not handled here. */ } +EXPORT_SYMBOL_GPL(exmap_clear_mem_page); static void omap_mmu_reset(struct omap_mmu *mmu) { @@ -1300,6 +1305,7 @@ err_dev_register: mmu->exmap_tbl = NULL; return ret; } +EXPORT_SYMBOL_GPL(omap_mmu_register); void omap_mmu_unregister(struct omap_mmu *mmu) { @@ -1318,6 +1324,7 @@ void omap_mmu_unregister(struct omap_mmu *mmu) device_unregister(&mmu->dev); } +EXPORT_SYMBOL_GPL(omap_mmu_unregister); static int __init omap_mmu_class_init(void) { @@ -1336,3 +1343,5 @@ static void __exit omap_mmu_class_exit(void) subsys_initcall(omap_mmu_class_init); module_exit(omap_mmu_class_exit); + +MODULE_LICENSE("GPL");