Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39379
b: refs/heads/master
c: 399ad77
h: refs/heads/master
i:
  39377: a944e44
  39375: 51d6e69
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Oct 11, 2006
1 parent d530fa7 commit 2b67bb9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 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: fc048b5b0f2554bc953a8ada5b2e3b82bde2fcb0
refs/heads/master: 399ad77b9098ed2eb27cbfbeb6449c1caab3c18e
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-versatile/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ static struct map_desc versatile_io_desc[] __initdata = {
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = VERSATILE_PCI_VIRT_BASE,
.virtual = (unsigned long)VERSATILE_PCI_VIRT_BASE,
.pfn = __phys_to_pfn(VERSATILE_PCI_BASE),
.length = VERSATILE_PCI_BASE_SIZE,
.type = MT_DEVICE
}, {
.virtual = VERSATILE_PCI_CFG_VIRT_BASE,
.virtual = (unsigned long)VERSATILE_PCI_CFG_VIRT_BASE,
.pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE),
.length = VERSATILE_PCI_CFG_BASE_SIZE,
.type = MT_DEVICE
Expand Down
32 changes: 16 additions & 16 deletions trunk/arch/arm/mach-versatile/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
* Cfg 42000000 - 42FFFFFF PCI config
*
*/
#define SYS_PCICTL IO_ADDRESS(VERSATILE_SYS_PCICTL)
#define PCI_IMAP0 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x0)
#define PCI_IMAP1 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x4)
#define PCI_IMAP2 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x8)
#define PCI_SMAP0 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x10)
#define PCI_SMAP1 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x14)
#define PCI_SMAP2 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x18)
#define PCI_SELFID IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0xc)
#define __IO_ADDRESS(n) ((void __iomem *)(unsigned long)IO_ADDRESS(n))
#define SYS_PCICTL __IO_ADDRESS(VERSATILE_SYS_PCICTL)
#define PCI_IMAP0 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x0)
#define PCI_IMAP1 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x4)
#define PCI_IMAP2 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x8)
#define PCI_SMAP0 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x10)
#define PCI_SMAP1 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x14)
#define PCI_SMAP2 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x18)
#define PCI_SELFID __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0xc)

#define DEVICE_ID_OFFSET 0x00
#define CSR_OFFSET 0x04
Expand Down Expand Up @@ -76,7 +77,7 @@ static int __init versatile_pci_slot_ignore(char *str)
__setup("pci_slot_ignore=", versatile_pci_slot_ignore);


static unsigned long __pci_addr(struct pci_bus *bus,
static void __iomem *__pci_addr(struct pci_bus *bus,
unsigned int devfn, int offset)
{
unsigned int busnr = bus->number;
Expand All @@ -91,14 +92,14 @@ static unsigned long __pci_addr(struct pci_bus *bus,
if (devfn > 255)
BUG();

return (VERSATILE_PCI_CFG_VIRT_BASE | (busnr << 16) |
return VERSATILE_PCI_CFG_VIRT_BASE + ((busnr << 16) |
(PCI_SLOT(devfn) << 11) | (PCI_FUNC(devfn) << 8) | offset);
}

static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 *val)
{
unsigned long addr = __pci_addr(bus, devfn, where);
void __iomem *addr = __pci_addr(bus, devfn, where & ~3);
u32 v;
int slot = PCI_SLOT(devfn);

Expand All @@ -121,13 +122,12 @@ static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int wh
break;

case 2:
v = __raw_readl(addr & ~3);
if (addr & 2) v >>= 16;
v = __raw_readl(addr);
if (where & 2) v >>= 16;
v &= 0xffff;
break;

default:
addr &= ~3;
v = __raw_readl(addr);
break;
}
Expand All @@ -140,7 +140,7 @@ static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int wh
static int versatile_write_config(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 val)
{
unsigned long addr = __pci_addr(bus, devfn, where);
void __iomem *addr = __pci_addr(bus, devfn, where);
int slot = PCI_SLOT(devfn);

if (pci_slot_ignore & (1 << slot)) {
Expand Down Expand Up @@ -279,7 +279,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
printk("PCI core found (slot %d)\n",myslot);

__raw_writel(myslot, PCI_SELFID);
local_pci_cfg_base = (void *) VERSATILE_PCI_CFG_VIRT_BASE + (myslot << 11);
local_pci_cfg_base = VERSATILE_PCI_CFG_VIRT_BASE + (myslot << 11);

val = __raw_readl(local_pci_cfg_base + CSR_OFFSET);
val |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-arm/arch-versatile/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
/*
* PCI space virtual addresses
*/
#define VERSATILE_PCI_VIRT_BASE 0xe8000000
#define VERSATILE_PCI_CFG_VIRT_BASE 0xe9000000
#define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul
#define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul

#if 0
#define VERSATILE_PCI_VIRT_MEM_BASE0 0xf4000000
Expand Down

0 comments on commit 2b67bb9

Please sign in to comment.