Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53983
b: refs/heads/master
c: 3603ab2
h: refs/heads/master
i:
  53981: bf9922a
  53979: d3c839d
  53975: 95e6763
  53967: 069e705
  53951: 95f816d
v: v3
  • Loading branch information
Russell King authored and Russell King committed May 5, 2007
1 parent 917396e commit e764f20
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 49 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: 0af92befeb4b330c46cce6b520b2cc775cd6931f
refs/heads/master: 3603ab2b62ad8372fc93816b080b370dd55d7cec
10 changes: 5 additions & 5 deletions trunk/arch/arm/mach-iop13xx/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void * __iomem __iop13xx_io(unsigned long io_addr)
EXPORT_SYMBOL(__iop13xx_io);

void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
unsigned long flags)
unsigned int mtype)
{
void __iomem * retval;

Expand All @@ -61,9 +61,9 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
(cookie - IOP13XX_PCIE_LOWER_MEM_RA));
break;
case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
retval = __ioremap(IOP13XX_PBI_LOWER_MEM_PA +
(cookie - IOP13XX_PBI_LOWER_MEM_RA),
size, flags);
retval = __arm_ioremap(IOP13XX_PBI_LOWER_MEM_PA +
(cookie - IOP13XX_PBI_LOWER_MEM_RA),
size, mtype);
break;
case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
Expand All @@ -75,7 +75,7 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
break;
default:
retval = __ioremap(cookie, size, flags);
retval = __arm_ioremap(cookie, size, mtype);
}

return retval;
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/arm/mach-iop13xx/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ void iop13xx_map_pci_memory(void)

if (end) {
iop13xx_atux_mem_base =
(u32) __ioremap_pfn(
(u32) __arm_ioremap_pfn(
__phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA)
, 0, iop13xx_atux_mem_size, 0);
, 0, iop13xx_atux_mem_size, MT_DEVICE);
if (!iop13xx_atux_mem_base) {
printk("%s: atux allocation "
"failed\n", __FUNCTION__);
Expand All @@ -114,9 +114,9 @@ void iop13xx_map_pci_memory(void)

if (end) {
iop13xx_atue_mem_base =
(u32) __ioremap_pfn(
(u32) __arm_ioremap_pfn(
__phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA)
, 0, iop13xx_atue_mem_size, 0);
, 0, iop13xx_atue_mem_size, MT_DEVICE);
if (!iop13xx_atue_mem_base) {
printk("%s: atue allocation "
"failed\n", __FUNCTION__);
Expand Down
20 changes: 9 additions & 11 deletions trunk/arch/arm/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,10 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
* mapping. See include/asm-arm/proc-armv/pgtable.h for more information.
*/
void __iomem *
__ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
unsigned long flags)
__arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
unsigned int mtype)
{
const struct mem_type *type;
struct mem_type t;
int err;
unsigned long addr;
struct vm_struct * area;
Expand All @@ -277,10 +276,9 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
return NULL;

t = *get_mem_type(MT_DEVICE);
t.prot_sect |= flags;
t.prot_pte |= flags;
type = &t;
type = get_mem_type(mtype);
if (!type)
return NULL;

size = PAGE_ALIGN(size);

Expand Down Expand Up @@ -311,10 +309,10 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
flush_cache_vmap(addr, addr + size);
return (void __iomem *) (offset + addr);
}
EXPORT_SYMBOL(__ioremap_pfn);
EXPORT_SYMBOL(__arm_ioremap_pfn);

void __iomem *
__ioremap(unsigned long phys_addr, size_t size, unsigned long flags)
__arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
{
unsigned long last_addr;
unsigned long offset = phys_addr & ~PAGE_MASK;
Expand All @@ -332,9 +330,9 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags)
*/
size = PAGE_ALIGN(last_addr + 1) - phys_addr;

return __ioremap_pfn(pfn, offset, size, flags);
return __arm_ioremap_pfn(pfn, offset, size, mtype);
}
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(__arm_ioremap);

void __iounmap(volatile void __iomem *addr)
{
Expand Down
12 changes: 6 additions & 6 deletions trunk/arch/arm/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@ void flush_dcache_page(struct page *page)
}
EXPORT_SYMBOL(flush_dcache_page);

void __iomem *__ioremap_pfn(unsigned long pfn, unsigned long offset,
size_t size, unsigned long flags)
void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
size_t size, unsigned int mtype)
{
if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
return NULL;
return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
}
EXPORT_SYMBOL(__ioremap_pfn);
EXPORT_SYMBOL(__arm_ioremap_pfn);

void __iomem *__ioremap(unsigned long phys_addr, size_t size,
unsigned long flags)
void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
unsigned int mtype)
{
return (void __iomem *)phys_addr;
}
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(__arm_ioremap);

void __iounmap(volatile void __iomem *addr)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/plat-iop/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <asm/io.h>

void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
unsigned long flags)
unsigned int mtype)
{
void __iomem * retval;

Expand All @@ -34,7 +34,7 @@ void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);
break;
default:
retval = __ioremap(cookie, size, flags);
retval = __arm_ioremap(cookie, size, mtype);
}

return retval;
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-arm/arch-ixp23xx/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <linux/kernel.h> /* For BUG */

static inline void __iomem *
ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned long flags)
ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
{
if (addr >= IXP23XX_PCI_MEM_START &&
addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {
Expand All @@ -34,7 +34,7 @@ ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned long flags)
((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT);
}

return __ioremap(addr, size, flags);
return __arm_ioremap(addr, size, mtype);
}

static inline void
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-arm/arch-ixp4xx/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
* fallback to the default.
*/
static inline void __iomem *
__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags)
__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype)
{
if((addr < 0x48000000) || (addr > 0x4fffffff))
return __ioremap(addr, size, flags);
return __arm_ioremap(addr, size, mtype);

return (void *)addr;
}
Expand Down
33 changes: 21 additions & 12 deletions trunk/include/asm-arm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,22 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);

/*
* Architecture ioremap implementation.
*
* __ioremap takes CPU physical address.
*
* __ioremap_pfn takes a Page Frame Number and an offset into that page
*/
extern void __iomem * __ioremap_pfn(unsigned long, unsigned long, size_t, unsigned long);
extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
#define MT_DEVICE 0
#define MT_DEVICE_NONSHARED 1
#define MT_DEVICE_CACHED 2
#define MT_DEVICE_IXP2000 3
/*
* types 4 onwards can be found in asm/mach/map.h and are undefined
* for ioremap
*/

/*
* __arm_ioremap takes CPU physical address.
* __arm_ioremap_pfn takes a Page Frame Number and an offset into that page
*/
extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int);
extern void __iounmap(volatile void __iomem *addr);

/*
Expand Down Expand Up @@ -203,14 +212,14 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
*
*/
#ifndef __arch_ioremap
#define ioremap(cookie,size) __ioremap(cookie,size,0)
#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0)
#define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE)
#define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
#define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
#define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
#define iounmap(cookie) __iounmap(cookie)
#else
#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0)
#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0)
#define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE)
#define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE)
#define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE)
#define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED)
#define iounmap(cookie) __arch_iounmap(cookie)
#endif

Expand Down
7 changes: 3 additions & 4 deletions trunk/include/asm-arm/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
*
* Page table mapping constructs and function prototypes
*/
#include <asm/io.h>

struct map_desc {
unsigned long virtual;
unsigned long pfn;
unsigned long length;
unsigned int type;
};

#define MT_DEVICE 0
#define MT_DEVICE_NONSHARED 1
#define MT_DEVICE_CACHED 2
#define MT_DEVICE_IXP2000 3
/* types 0-3 are defined in asm/io.h */
#define MT_CACHECLEAN 4
#define MT_MINICLEAN 5
#define MT_LOW_VECTORS 6
Expand Down

0 comments on commit e764f20

Please sign in to comment.