Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8155
b: refs/heads/master
c: b3743fa
h: refs/heads/master
i:
  8153: 7719914
  8151: c6eb50a
v: v3
  • Loading branch information
Dominik Brodowski authored and Linus Torvalds committed Sep 9, 2005
1 parent 3ca9a7a commit ca502e5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 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: 76fa82fb7156aa7191dfd1fdede1fc0da51d45dd
refs/heads/master: b3743fa4442fc172e950ff0eaf6aa96e7d5ce9be
4 changes: 2 additions & 2 deletions trunk/drivers/pci/setup-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ pbus_assign_resources_sorted(struct pci_bus *bus)
}
}

static void __devinit
pci_setup_cardbus(struct pci_bus *bus)
void pci_setup_cardbus(struct pci_bus *bus)
{
struct pci_dev *bridge = bus->self;
struct pci_bus_region region;
Expand Down Expand Up @@ -130,6 +129,7 @@ pci_setup_cardbus(struct pci_bus *bus)
region.end);
}
}
EXPORT_SYMBOL(pci_setup_cardbus);

/* Initialize bridges with base/limit values we have collected.
PCI-to-PCI Bridge Architecture Specification rev. 1.1 (1998)
Expand Down
41 changes: 18 additions & 23 deletions trunk/drivers/pcmcia/yenta_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
return 0;
}

static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end)
static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end)
{
struct resource *root, *res;
struct pci_bus_region region;
Expand All @@ -676,7 +676,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr;
/* Already allocated? */
if (res->parent)
return;
return 0;

/* The granularity of the memory limit is 4kB, on IO it's 4 bytes */
mask = ~0xfff;
Expand All @@ -692,58 +692,53 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ
pcibios_bus_to_resource(socket->dev, res, &region);
root = pci_find_parent_resource(socket->dev, res);
if (root && (request_resource(root, res) == 0))
return;
return 0;
printk(KERN_INFO "yenta %s: Preassigned resource %d busy or not available, reconfiguring...\n",
pci_name(socket->dev), nr);
}

if (type & IORESOURCE_IO) {
if ((yenta_search_res(socket, res, BRIDGE_IO_MAX)) ||
(yenta_search_res(socket, res, BRIDGE_IO_ACC)) ||
(yenta_search_res(socket, res, BRIDGE_IO_MIN))) {
config_writel(socket, addr_start, res->start);
config_writel(socket, addr_end, res->end);
return;
}
(yenta_search_res(socket, res, BRIDGE_IO_MIN)))
return 1;
} else {
if (type & IORESOURCE_PREFETCH) {
if ((yenta_search_res(socket, res, BRIDGE_MEM_MAX)) ||
(yenta_search_res(socket, res, BRIDGE_MEM_ACC)) ||
(yenta_search_res(socket, res, BRIDGE_MEM_MIN))) {
config_writel(socket, addr_start, res->start);
config_writel(socket, addr_end, res->end);
return;
}
(yenta_search_res(socket, res, BRIDGE_MEM_MIN)))
return 1;
/* Approximating prefetchable by non-prefetchable */
res->flags = IORESOURCE_MEM;
}
if ((yenta_search_res(socket, res, BRIDGE_MEM_MAX)) ||
(yenta_search_res(socket, res, BRIDGE_MEM_ACC)) ||
(yenta_search_res(socket, res, BRIDGE_MEM_MIN))) {
config_writel(socket, addr_start, res->start);
config_writel(socket, addr_end, res->end);
return;
}
(yenta_search_res(socket, res, BRIDGE_MEM_MIN)))
return 1;
}

printk(KERN_INFO "yenta %s: no resource of type %x available, trying to continue...\n",
pci_name(socket->dev), type);
res->start = res->end = res->flags = 0;
return 0;
}

/*
* Allocate the bridge mappings for the device..
*/
static void yenta_allocate_resources(struct yenta_socket *socket)
{
yenta_allocate_res(socket, 0, IORESOURCE_IO,
int program = 0;
program += yenta_allocate_res(socket, 0, IORESOURCE_IO,
PCI_CB_IO_BASE_0, PCI_CB_IO_LIMIT_0);
yenta_allocate_res(socket, 1, IORESOURCE_IO,
program += yenta_allocate_res(socket, 1, IORESOURCE_IO,
PCI_CB_IO_BASE_1, PCI_CB_IO_LIMIT_1);
yenta_allocate_res(socket, 2, IORESOURCE_MEM|IORESOURCE_PREFETCH,
program += yenta_allocate_res(socket, 2, IORESOURCE_MEM|IORESOURCE_PREFETCH,
PCI_CB_MEMORY_BASE_0, PCI_CB_MEMORY_LIMIT_0);
yenta_allocate_res(socket, 3, IORESOURCE_MEM,
program += yenta_allocate_res(socket, 3, IORESOURCE_MEM,
PCI_CB_MEMORY_BASE_1, PCI_CB_MEMORY_LIMIT_1);
if (program)
pci_setup_cardbus(socket->dev->subordinate);
}


Expand All @@ -758,7 +753,7 @@ static void yenta_free_resources(struct yenta_socket *socket)
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + i;
if (res->start != 0 && res->end != 0)
release_resource(res);
res->start = res->end = 0;
res->start = res->end = res->flags = 0;
}
}

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
extern void pci_dev_put(struct pci_dev *dev);
extern void pci_remove_bus(struct pci_bus *b);
extern void pci_remove_bus_device(struct pci_dev *dev);
void pci_setup_cardbus(struct pci_bus *bus);

/* Generic PCI functions exported to card drivers */

Expand Down

0 comments on commit ca502e5

Please sign in to comment.