* [PATCH] [POWERPC] Remove update_bridge_resource
@ 2008-01-15 2:46 Kumar Gala
2008-01-15 4:22 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Kumar Gala @ 2008-01-15 2:46 UTC (permalink / raw)
To: linuxppc-dev
The 85xx/86xx pci code no longer uses update_bridge_resource and it was the
only caller.
---
in my git tree.
arch/powerpc/kernel/pci_32.c | 58 --------------------------------------
include/asm-powerpc/pci-bridge.h | 3 --
2 files changed, 0 insertions(+), 61 deletions(-)
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index a9c6cb2..1698beb 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -93,64 +93,6 @@ fixup_cpc710_pci64(struct pci_dev* dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
-
-void __init
-update_bridge_resource(struct pci_dev *dev, struct resource *res)
-{
- u8 io_base_lo, io_limit_lo;
- u16 mem_base, mem_limit;
- u16 cmd;
- resource_size_t start, end, off;
- struct pci_controller *hose = dev->sysdata;
-
- if (!hose) {
- printk("update_bridge_base: no hose?\n");
- return;
- }
- pci_read_config_word(dev, PCI_COMMAND, &cmd);
- pci_write_config_word(dev, PCI_COMMAND,
- cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
- if (res->flags & IORESOURCE_IO) {
- off = (unsigned long) hose->io_base_virt - isa_io_base;
- start = res->start - off;
- end = res->end - off;
- io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
- io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
- if (end > 0xffff)
- io_base_lo |= PCI_IO_RANGE_TYPE_32;
- else
- io_base_lo |= PCI_IO_RANGE_TYPE_16;
- pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
- start >> 16);
- pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
- end >> 16);
- pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
- pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
-
- } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
- == IORESOURCE_MEM) {
- off = hose->pci_mem_offset;
- mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
- mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
- pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
- pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
-
- } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
- == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
- off = hose->pci_mem_offset;
- mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
- mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
- pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
- pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
-
- } else {
- DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
- pci_name(dev), res->flags);
- }
- pci_write_config_word(dev, PCI_COMMAND, cmd);
-}
-
-
#ifdef CONFIG_PPC_OF
/*
* Functions below are used on OpenFirmware machines.
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 9b16d3b..d644452 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -152,9 +152,6 @@ extern void setup_indirect_pci(struct pci_controller* hose,
resource_size_t cfg_addr,
resource_size_t cfg_data, u32 flags);
extern void setup_grackle(struct pci_controller *hose);
-extern void __init update_bridge_resource(struct pci_dev *dev,
- struct resource *res);
-
#else /* CONFIG_PPC64 */
/*
--
1.5.3.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [POWERPC] Remove update_bridge_resource
2008-01-15 2:46 [PATCH] [POWERPC] Remove update_bridge_resource Kumar Gala
@ 2008-01-15 4:22 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2008-01-15 4:22 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
On Mon, 2008-01-14 at 20:46 -0600, Kumar Gala wrote:
> The 85xx/86xx pci code no longer uses update_bridge_resource and it was the
> only caller.
Ack.
> ---
>
> in my git tree.
>
> arch/powerpc/kernel/pci_32.c | 58 --------------------------------------
> include/asm-powerpc/pci-bridge.h | 3 --
> 2 files changed, 0 insertions(+), 61 deletions(-)
>
> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
> index a9c6cb2..1698beb 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -93,64 +93,6 @@ fixup_cpc710_pci64(struct pci_dev* dev)
> }
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
>
> -
> -void __init
> -update_bridge_resource(struct pci_dev *dev, struct resource *res)
> -{
> - u8 io_base_lo, io_limit_lo;
> - u16 mem_base, mem_limit;
> - u16 cmd;
> - resource_size_t start, end, off;
> - struct pci_controller *hose = dev->sysdata;
> -
> - if (!hose) {
> - printk("update_bridge_base: no hose?\n");
> - return;
> - }
> - pci_read_config_word(dev, PCI_COMMAND, &cmd);
> - pci_write_config_word(dev, PCI_COMMAND,
> - cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
> - if (res->flags & IORESOURCE_IO) {
> - off = (unsigned long) hose->io_base_virt - isa_io_base;
> - start = res->start - off;
> - end = res->end - off;
> - io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
> - io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
> - if (end > 0xffff)
> - io_base_lo |= PCI_IO_RANGE_TYPE_32;
> - else
> - io_base_lo |= PCI_IO_RANGE_TYPE_16;
> - pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
> - start >> 16);
> - pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
> - end >> 16);
> - pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
> - pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
> -
> - } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
> - == IORESOURCE_MEM) {
> - off = hose->pci_mem_offset;
> - mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
> - mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
> - pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
> - pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
> -
> - } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
> - == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
> - off = hose->pci_mem_offset;
> - mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
> - mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
> - pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
> - pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
> -
> - } else {
> - DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
> - pci_name(dev), res->flags);
> - }
> - pci_write_config_word(dev, PCI_COMMAND, cmd);
> -}
> -
> -
> #ifdef CONFIG_PPC_OF
> /*
> * Functions below are used on OpenFirmware machines.
> diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
> index 9b16d3b..d644452 100644
> --- a/include/asm-powerpc/pci-bridge.h
> +++ b/include/asm-powerpc/pci-bridge.h
> @@ -152,9 +152,6 @@ extern void setup_indirect_pci(struct pci_controller* hose,
> resource_size_t cfg_addr,
> resource_size_t cfg_data, u32 flags);
> extern void setup_grackle(struct pci_controller *hose);
> -extern void __init update_bridge_resource(struct pci_dev *dev,
> - struct resource *res);
> -
> #else /* CONFIG_PPC64 */
>
> /*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-15 4:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 2:46 [PATCH] [POWERPC] Remove update_bridge_resource Kumar Gala
2008-01-15 4:22 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).