Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181212
b: refs/heads/master
c: 7bdda62
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Feb 17, 2010
1 parent ba11745 commit 3a687c9
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49f3bfe9334a4cf86079d2ee1d08e674b58862a9
refs/heads/master: 7bdda6209f224aa784a036df54b22cb338d2e859
5 changes: 3 additions & 2 deletions trunk/arch/sh/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#ifndef __ASSEMBLY__
#include <linux/errno.h>
#include <linux/threads.h>
#include <asm/page.h>

/* Default "unsigned long" context */
typedef unsigned long mm_context_id_t[NR_CPUS];
Expand Down Expand Up @@ -71,13 +72,13 @@ struct pmb_entry {
#ifdef CONFIG_PMB
/* arch/sh/mm/pmb.c */
long pmb_remap(unsigned long virt, unsigned long phys,
unsigned long size, unsigned long flags);
unsigned long size, pgprot_t prot);
void pmb_unmap(unsigned long addr);
int pmb_init(void);
bool __in_29bit_mode(void);
#else
static inline long pmb_remap(unsigned long virt, unsigned long phys,
unsigned long size, unsigned long flags)
unsigned long size, pgprot_t prot)
{
return -EINVAL;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/sh/include/cpu-sh4/cpu/sq.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define __ASM_CPU_SH4_SQ_H

#include <asm/addrspace.h>
#include <asm/page.h>

/*
* Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be
Expand All @@ -28,7 +29,7 @@

/* arch/sh/kernel/cpu/sh4/sq.c */
unsigned long sq_remap(unsigned long phys, unsigned int size,
const char *name, unsigned long flags);
const char *name, pgprot_t prot);
void sq_unmap(unsigned long vaddr);
void sq_flush_range(unsigned long start, unsigned int len);

Expand Down
13 changes: 6 additions & 7 deletions trunk/arch/sh/kernel/cpu/sh4/sq.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static inline void sq_mapping_list_del(struct sq_mapping *map)
spin_unlock_irq(&sq_mapping_lock);
}

static int __sq_remap(struct sq_mapping *map, unsigned long flags)
static int __sq_remap(struct sq_mapping *map, pgprot_t prot)
{
#if defined(CONFIG_MMU)
struct vm_struct *vma;
Expand All @@ -113,7 +113,7 @@ static int __sq_remap(struct sq_mapping *map, unsigned long flags)

if (ioremap_page_range((unsigned long)vma->addr,
(unsigned long)vma->addr + map->size,
vma->phys_addr, __pgprot(flags))) {
vma->phys_addr, prot)) {
vunmap(vma->addr);
return -EAGAIN;
}
Expand All @@ -135,14 +135,14 @@ static int __sq_remap(struct sq_mapping *map, unsigned long flags)
* @phys: Physical address of mapping.
* @size: Length of mapping.
* @name: User invoking mapping.
* @flags: Protection flags.
* @prot: Protection bits.
*
* Remaps the physical address @phys through the next available store queue
* address of @size length. @name is logged at boot time as well as through
* the sysfs interface.
*/
unsigned long sq_remap(unsigned long phys, unsigned int size,
const char *name, unsigned long flags)
const char *name, pgprot_t prot)
{
struct sq_mapping *map;
unsigned long end;
Expand Down Expand Up @@ -177,7 +177,7 @@ unsigned long sq_remap(unsigned long phys, unsigned int size,

map->sq_addr = P4SEG_STORE_QUE + (page << PAGE_SHIFT);

ret = __sq_remap(map, pgprot_val(PAGE_KERNEL_NOCACHE) | flags);
ret = __sq_remap(map, prot);
if (unlikely(ret != 0))
goto out;

Expand Down Expand Up @@ -309,8 +309,7 @@ static ssize_t mapping_store(const char *buf, size_t count)
return -EIO;

if (likely(len)) {
int ret = sq_remap(base, len, "Userspace",
pgprot_val(PAGE_SHARED));
int ret = sq_remap(base, len, "Userspace", PAGE_SHARED);
if (ret < 0)
return ret;
} else
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ __ioremap_caller(unsigned long phys_addr, unsigned long size,
if (unlikely(phys_addr >= P1SEG)) {
unsigned long mapped;

mapped = pmb_remap(addr, phys_addr, size, pgprot_val(pgprot));
mapped = pmb_remap(addr, phys_addr, size, pgprot);
if (likely(mapped)) {
addr += mapped;
phys_addr += mapped;
Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/mmu.h>
#include <asm/io.h>
#include <asm/mmu_context.h>
Expand Down Expand Up @@ -166,12 +167,15 @@ static struct {
};

long pmb_remap(unsigned long vaddr, unsigned long phys,
unsigned long size, unsigned long flags)
unsigned long size, pgprot_t prot)
{
struct pmb_entry *pmbp, *pmbe;
unsigned long wanted;
int pmb_flags, i;
long err;
u64 flags;

flags = pgprot_val(prot);

/* Convert typical pgprot value to the PMB equivalent */
if (flags & _PAGE_CACHABLE) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/video/pvr2fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ static int __devinit pvr2fb_common_init(void)
printk(KERN_NOTICE "fb%d: registering with SQ API\n", fb_info->node);

pvr2fb_map = sq_remap(fb_info->fix.smem_start, fb_info->fix.smem_len,
fb_info->fix.id, pgprot_val(PAGE_SHARED));
fb_info->fix.id, PAGE_SHARED);

printk(KERN_NOTICE "fb%d: Mapped video memory to SQ addr 0x%lx\n",
fb_info->node, pvr2fb_map);
Expand Down

0 comments on commit 3a687c9

Please sign in to comment.