Commit 6230719e authored by Hiroshi DOYU's avatar Hiroshi DOYU Committed by Tony Lindgren

DSP: Fix build problem with OMAP1

Based on Dirk Behme's comment:

http://linux.omap.com/pipermail/linux-omap-open-source/2007-April/009461.htmlSigned-off-by: default avatarHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b26e8247
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/err.h> #include <linux/err.h>
#include "mmu.h" #include "mmu.h"
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
...@@ -35,6 +36,10 @@ ...@@ -35,6 +36,10 @@
static void *dspvect_page; static void *dspvect_page;
#define DSP_INIT_PAGE 0xfff000 #define DSP_INIT_PAGE 0xfff000
#define MMUFAULT_MASK (OMAP_MMU_FAULT_ST_PERM |\
OMAP_MMU_FAULT_ST_TLB_MISS |\
OMAP_MMU_FAULT_ST_TRANS)
static unsigned int get_cam_l_va_mask(u16 pgsz) static unsigned int get_cam_l_va_mask(u16 pgsz)
{ {
switch (pgsz) { switch (pgsz) {
...@@ -267,11 +272,11 @@ static void omap1_mmu_interrupt(struct omap_mmu *mmu) ...@@ -267,11 +272,11 @@ static void omap1_mmu_interrupt(struct omap_mmu *mmu)
unsigned long dp; unsigned long dp;
unsigned long va; unsigned long va;
status = omap_mmu_read_reg(mmu, MMU_FAULT_ST); status = omap_mmu_read_reg(mmu, OMAP_MMU_FAULT_ST);
adh = omap_mmu_read_reg(mmu, MMU_FAULT_AD_H); adh = omap_mmu_read_reg(mmu, OMAP_MMU_FAULT_AD_H);
adl = omap_mmu_read_reg(mmu, MMU_FAULT_AD_L); adl = omap_mmu_read_reg(mmu, OMAP_MMU_FAULT_AD_L);
dp = adh & MMU_FAULT_AD_H_DP; dp = adh & OMAP_MMU_FAULT_AD_H_DP;
va = MK32(adh & MMU_FAULT_AD_H_ADR_MASK, adl); va = (((adh & OMAP_MMU_FAULT_AD_H_ADR_MASK) << 16) | adl);
/* if the fault is masked, nothing to do */ /* if the fault is masked, nothing to do */
if ((status & MMUFAULT_MASK) == 0) { if ((status & MMUFAULT_MASK) == 0) {
...@@ -284,42 +289,42 @@ static void omap1_mmu_interrupt(struct omap_mmu *mmu) ...@@ -284,42 +289,42 @@ static void omap1_mmu_interrupt(struct omap_mmu *mmu)
*/ */
if (status) { if (status) {
pr_debug( "%s%s%s%s\n", pr_debug( "%s%s%s%s\n",
(status & MMU_FAULT_ST_PREF)? (status & OMAP_MMU_FAULT_ST_PREF)?
" (prefetch err)" : "", " (prefetch err)" : "",
(status & MMU_FAULT_ST_PERM)? (status & OMAP_MMU_FAULT_ST_PERM)?
" (permission fault)" : "", " (permission fault)" : "",
(status & MMU_FAULT_ST_TLB_MISS)? (status & OMAP_MMU_FAULT_ST_TLB_MISS)?
" (TLB miss)" : "", " (TLB miss)" : "",
(status & MMU_FAULT_ST_TRANS) ? (status & OMAP_MMU_FAULT_ST_TRANS) ?
" (translation fault)": ""); " (translation fault)": "");
pr_debug( "fault address = %#08x\n", va); pr_debug( "fault address = %#08lx\n", va);
} }
enable_irq(mmu->irq); enable_irq(mmu->irq);
return; return;
} }
pr_info("%s%s%s%s\n", pr_info("%s%s%s%s\n",
(status & MMU_FAULT_ST_PREF)? (status & OMAP_MMU_FAULT_ST_PREF)?
(MMUFAULT_MASK & MMU_FAULT_ST_PREF)? (MMUFAULT_MASK & OMAP_MMU_FAULT_ST_PREF)?
" prefetch err": " prefetch err":
" (prefetch err)": " (prefetch err)":
"", "",
(status & MMU_FAULT_ST_PERM)? (status & OMAP_MMU_FAULT_ST_PERM)?
(MMUFAULT_MASK & MMU_FAULT_ST_PERM)? (MMUFAULT_MASK & OMAP_MMU_FAULT_ST_PERM)?
" permission fault": " permission fault":
" (permission fault)": " (permission fault)":
"", "",
(status & MMU_FAULT_ST_TLB_MISS)? (status & OMAP_MMU_FAULT_ST_TLB_MISS)?
(MMUFAULT_MASK & MMU_FAULT_ST_TLB_MISS)? (MMUFAULT_MASK & OMAP_MMU_FAULT_ST_TLB_MISS)?
" TLB miss": " TLB miss":
" (TLB miss)": " (TLB miss)":
"", "",
(status & MMU_FAULT_ST_TRANS)? (status & OMAP_MMU_FAULT_ST_TRANS)?
(MMUFAULT_MASK & MMU_FAULT_ST_TRANS)? (MMUFAULT_MASK & OMAP_MMU_FAULT_ST_TRANS)?
" translation fault": " translation fault":
" (translation fault)": " (translation fault)":
""); "");
pr_info("fault address = %#08x\n", va); pr_info("fault address = %#08lx\n", va);
mmu->fault_address = va; mmu->fault_address = va;
schedule_work(&mmu->irq_work); schedule_work(&mmu->irq_work);
......
...@@ -344,8 +344,6 @@ static int dsp_mem_ioctl(struct inode *inode, struct file *file, ...@@ -344,8 +344,6 @@ static int dsp_mem_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct omap_dsp_mapinfo mapinfo; struct omap_dsp_mapinfo mapinfo;
dsp_long_t dspadr;
int ret;
__u32 size; __u32 size;
switch (cmd) { switch (cmd) {
...@@ -370,6 +368,9 @@ static int dsp_mem_ioctl(struct inode *inode, struct file *file, ...@@ -370,6 +368,9 @@ static int dsp_mem_ioctl(struct inode *inode, struct file *file,
return 0; return 0;
#ifdef CONFIG_OMAP_DSP_FBEXPORT #ifdef CONFIG_OMAP_DSP_FBEXPORT
case MEM_IOCTL_FBEXPORT: case MEM_IOCTL_FBEXPORT:
{
dsp_long_t dspadr;
int ret;
if (copy_from_user(&dspadr, (void __user *)arg, if (copy_from_user(&dspadr, (void __user *)arg,
sizeof(dsp_long_t))) sizeof(dsp_long_t)))
return -EFAULT; return -EFAULT;
...@@ -378,6 +379,7 @@ static int dsp_mem_ioctl(struct inode *inode, struct file *file, ...@@ -378,6 +379,7 @@ static int dsp_mem_ioctl(struct inode *inode, struct file *file,
sizeof(dsp_long_t))) sizeof(dsp_long_t)))
return -EFAULT; return -EFAULT;
return ret; return ret;
}
#endif #endif
case MEM_IOCTL_MMUITACK: case MEM_IOCTL_MMUITACK:
return dsp_mmu_itack(); return dsp_mmu_itack();
......
...@@ -83,7 +83,7 @@ static int dsp_mmu_itack(void) ...@@ -83,7 +83,7 @@ static int dsp_mmu_itack(void)
printk(KERN_ERR "omapdsp: DSP MMU error has not been set.\n"); printk(KERN_ERR "omapdsp: DSP MMU error has not been set.\n");
return -EINVAL; return -EINVAL;
} }
dspadr = dsp_fault_adr & ~(SZ_4K-1); dspadr = dsp_mmu.fault_address & ~(SZ_4K-1);
/* FIXME: reserve TLB entry for this */ /* FIXME: reserve TLB entry for this */
omap_mmu_exmap(&dsp_mmu, dspadr, 0, SZ_4K, EXMAP_TYPE_MEM); omap_mmu_exmap(&dsp_mmu, dspadr, 0, SZ_4K, EXMAP_TYPE_MEM);
pr_info("omapdsp: falling into recovery runlevel...\n"); pr_info("omapdsp: falling into recovery runlevel...\n");
......
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