Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63025
b: refs/heads/master
c: 6dfbde2
h: refs/heads/master
i:
  63023: 3eee81a
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Jul 26, 2007
1 parent 15a66cf commit fd66446
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5d834fc34e61f1a40435981062000e5d2b2baa8
refs/heads/master: 6dfbde209171cd15407e7540d363a434a489aaca
23 changes: 23 additions & 0 deletions trunk/arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,29 @@ void pcibios_free_controller(struct pci_controller *phb)
kfree(phb);
}

int pcibios_vaddr_is_ioport(void __iomem *address)
{
int ret = 0;
struct pci_controller *hose;
unsigned long size;

spin_lock(&hose_spinlock);
list_for_each_entry(hose, &hose_list, list_node) {
#ifdef CONFIG_PPC64
size = hose->pci_io_size;
#else
size = hose->io_resource.end - hose->io_resource.start + 1;
#endif
if (address >= hose->io_base_virt &&
address < (hose->io_base_virt + size)) {
ret = 1;
break;
}
}
spin_unlock(&hose_spinlock);
return ret;
}

/*
* Return the domain number for this bus.
*/
Expand Down
20 changes: 20 additions & 0 deletions trunk/include/asm-powerpc/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
return bus->sysdata;
}

static inline int isa_vaddr_is_ioport(void __iomem *address)
{
/* No specific ISA handling on ppc32 at this stage, it
* all goes through PCI
*/
return 0;
}

/* These are used for config access before all the PCI probing
has been done. */
int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
Expand Down Expand Up @@ -241,6 +249,13 @@ extern void pcibios_free_controller(struct pci_controller *phb);

extern void isa_bridge_find_early(struct pci_controller *hose);

static inline int isa_vaddr_is_ioport(void __iomem *address)
{
/* Check if address hits the reserved legacy IO range */
unsigned long ea = (unsigned long)address;
return ea >= ISA_IO_BASE && ea < ISA_IO_END;
}

extern int pcibios_unmap_io_space(struct pci_bus *bus);
extern int pcibios_map_io_space(struct pci_bus *bus);

Expand Down Expand Up @@ -271,11 +286,16 @@ extern struct pci_controller *
pcibios_alloc_controller(struct device_node *dev);
#ifdef CONFIG_PCI
extern unsigned long pci_address_to_pio(phys_addr_t address);
extern int pcibios_vaddr_is_ioport(void __iomem *address);
#else
static inline unsigned long pci_address_to_pio(phys_addr_t address)
{
return (unsigned long)-1;
}
static inline int pcibios_vaddr_is_ioport(void __iomem *address)
{
return 0;
}
#endif


Expand Down

0 comments on commit fd66446

Please sign in to comment.