Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146660
b: refs/heads/master
c: 09cfeb1
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Apr 20, 2009
1 parent 052d8cd commit cd5ed7b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 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: e79066a659b893debe19010179d3f3f015d76d1c
refs/heads/master: 09cfeb133e3cac39b8b9a2cb1d8ab4f77e396248
18 changes: 9 additions & 9 deletions trunk/arch/sh/drivers/pci/pci-new.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev,
struct pci_bus *bus)
{
/* Update device resources. */
struct pci_channel *chan = bus->sysdata;
struct pci_channel *hose = bus->sysdata;
unsigned long offset = 0;
int i;

Expand All @@ -115,9 +115,9 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev,
if (dev->resource[i].flags & IORESOURCE_PCI_FIXED)
continue;
if (dev->resource[i].flags & IORESOURCE_IO)
offset = chan->io_base;
offset = hose->io_offset;
else if (dev->resource[i].flags & IORESOURCE_MEM)
offset = 0;
offset = hose->mem_offset;

dev->resource[i].start += offset;
dev->resource[i].end += offset;
Expand Down Expand Up @@ -150,13 +150,13 @@ void __devinit __weak pcibios_fixup_bus(struct pci_bus *bus)
void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
struct resource *res)
{
struct pci_channel *chan = dev->sysdata;
struct pci_channel *hose = dev->sysdata;
unsigned long offset = 0;

if (res->flags & IORESOURCE_IO)
offset = chan->io_base;
offset = hose->io_offset;
else if (res->flags & IORESOURCE_MEM)
offset = 0;
offset = hose->mem_offset;

region->start = res->start - offset;
region->end = res->end - offset;
Expand All @@ -166,13 +166,13 @@ void __devinit
pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
struct pci_bus_region *region)
{
struct pci_channel *chan = dev->sysdata;
struct pci_channel *hose = dev->sysdata;
unsigned long offset = 0;

if (res->flags & IORESOURCE_IO)
offset = chan->io_base;
offset = hose->io_offset;
else if (res->flags & IORESOURCE_MEM)
offset = 0;
offset = hose->mem_offset;

res->start = region->start + offset;
res->end = region->end + offset;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sh/drivers/pci/pci-sh7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ static struct resource sh7785_mem_resource = {
static struct pci_channel sh7780_pci_controller = {
.pci_ops = &sh4_pci_ops,
.mem_resource = &sh7785_mem_resource,
.mem_offset = 0x00000000,
.io_resource = &sh7785_io_resource,
.io_offset = 0x00000000,
};

static struct sh4_pci_address_map sh7780_pci_map = {
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/sh/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ struct pci_channel {
struct resource *io_resource;
struct resource *mem_resource;

unsigned long io_offset;
unsigned long mem_offset;

int first_devfn;
int last_devfn;
int enabled;
Expand Down

0 comments on commit cd5ed7b

Please sign in to comment.