Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372122
b: refs/heads/master
c: 029baf1
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Petazzoni authored and Russell King committed Apr 3, 2013
1 parent 5700e00 commit 2d60dba
Show file tree
Hide file tree
Showing 3 changed files with 18 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: 01223f365074d62bbc24709dad9b4a905206fa02
refs/heads/master: 029baf14a027a44b3ac8a9fe5cb1e516cbb9007e
11 changes: 11 additions & 0 deletions trunk/arch/arm/include/asm/mach/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ struct hw_pci {
void (*postinit)(void);
u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
resource_size_t (*align_resource)(struct pci_dev *dev,
const struct resource *res,
resource_size_t start,
resource_size_t size,
resource_size_t align);
};

/*
Expand All @@ -51,6 +56,12 @@ struct pci_sys_data {
u8 (*swizzle)(struct pci_dev *, u8 *);
/* IRQ mapping */
int (*map_irq)(const struct pci_dev *, u8, u8);
/* Resource alignement requirements */
resource_size_t (*align_resource)(struct pci_dev *dev,
const struct resource *res,
resource_size_t start,
resource_size_t size,
resource_size_t align);
void *private_data; /* platform controller private data */
};

Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/kernel/bios32.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ static void pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
sys->busnr = busnr;
sys->swizzle = hw->swizzle;
sys->map_irq = hw->map_irq;
sys->align_resource = hw->align_resource;
INIT_LIST_HEAD(&sys->resources);

if (hw->private_data)
Expand Down Expand Up @@ -574,13 +575,18 @@ char * __init pcibios_setup(char *str)
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;
struct pci_sys_data *sys = dev->sysdata;
resource_size_t start = res->start;

if (res->flags & IORESOURCE_IO && start & 0x300)
start = (start + 0x3ff) & ~0x3ff;

start = (start + align - 1) & ~(align - 1);

if (sys->align_resource)
return sys->align_resource(dev, res, start, size, align);

return start;
}

Expand Down

0 comments on commit 2d60dba

Please sign in to comment.