mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
[PATCH] xtensa: Fix asm macro
Removed dead code in arch/xtensa/kernel/pci.c and use the pci_name() macro. Fixed an error in the delay asm macro: '1' is an invalid immediate value. Signed-off-by: Chris Zankel <chris@zankel.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
e7d163f766
commit
9ec55a9bd3
@ -57,50 +57,6 @@ struct pci_controller** pci_ctrl_tail = &pci_ctrl_head;
|
|||||||
|
|
||||||
static int pci_bus_count;
|
static int pci_bus_count;
|
||||||
|
|
||||||
static void pcibios_fixup_resources(struct pci_dev* dev);
|
|
||||||
|
|
||||||
#if 0 // FIXME
|
|
||||||
struct pci_fixup pcibios_fixups[] = {
|
|
||||||
{ DECLARE_PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources },
|
|
||||||
{ 0 }
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
|
||||||
pcibios_update_resource(struct pci_dev *dev, struct resource *root,
|
|
||||||
struct resource *res, int resource)
|
|
||||||
{
|
|
||||||
u32 new, check, mask;
|
|
||||||
int reg;
|
|
||||||
struct pci_controller* pci_ctrl = dev->sysdata;
|
|
||||||
|
|
||||||
new = res->start;
|
|
||||||
if (pci_ctrl && res->flags & IORESOURCE_IO) {
|
|
||||||
new -= pci_ctrl->io_space.base;
|
|
||||||
}
|
|
||||||
new |= (res->flags & PCI_REGION_FLAG_MASK);
|
|
||||||
if (resource < 6) {
|
|
||||||
reg = PCI_BASE_ADDRESS_0 + 4*resource;
|
|
||||||
} else if (resource == PCI_ROM_RESOURCE) {
|
|
||||||
res->flags |= PCI_ROM_ADDRESS_ENABLE;
|
|
||||||
reg = dev->rom_base_reg;
|
|
||||||
} else {
|
|
||||||
/* Somebody might have asked allocation of a non-standard resource */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pci_write_config_dword(dev, reg, new);
|
|
||||||
pci_read_config_dword(dev, reg, &check);
|
|
||||||
mask = (new & PCI_BASE_ADDRESS_SPACE_IO) ?
|
|
||||||
PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK;
|
|
||||||
|
|
||||||
if ((new ^ check) & mask) {
|
|
||||||
printk(KERN_ERR "PCI: Error while updating region "
|
|
||||||
"%s/%d (%08x != %08x)\n", dev->slot_name, resource,
|
|
||||||
new, check);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to avoid collisions with `mirrored' VGA ports
|
* We need to avoid collisions with `mirrored' VGA ports
|
||||||
* and other strange ISA hardware, so we always want the
|
* and other strange ISA hardware, so we always want the
|
||||||
@ -125,7 +81,7 @@ pcibios_align_resource(void *data, struct resource *res, unsigned long size,
|
|||||||
|
|
||||||
if (size > 0x100) {
|
if (size > 0x100) {
|
||||||
printk(KERN_ERR "PCI: I/O Region %s/%d too large"
|
printk(KERN_ERR "PCI: I/O Region %s/%d too large"
|
||||||
" (%ld bytes)\n", dev->slot_name,
|
" (%ld bytes)\n", pci_name(dev),
|
||||||
dev->resource - res, size);
|
dev->resource - res, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +105,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
|
|||||||
r = &dev->resource[idx];
|
r = &dev->resource[idx];
|
||||||
if (!r->start && r->end) {
|
if (!r->start && r->end) {
|
||||||
printk (KERN_ERR "PCI: Device %s not available because "
|
printk (KERN_ERR "PCI: Device %s not available because "
|
||||||
"of resource collisions\n", dev->slot_name);
|
"of resource collisions\n", pci_name(dev));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (r->flags & IORESOURCE_IO)
|
if (r->flags & IORESOURCE_IO)
|
||||||
@ -161,7 +117,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
|
|||||||
cmd |= PCI_COMMAND_MEMORY;
|
cmd |= PCI_COMMAND_MEMORY;
|
||||||
if (cmd != old_cmd) {
|
if (cmd != old_cmd) {
|
||||||
printk("PCI: Enabling device %s (%04x -> %04x)\n",
|
printk("PCI: Enabling device %s (%04x -> %04x)\n",
|
||||||
dev->slot_name, old_cmd, cmd);
|
pci_name(dev), old_cmd, cmd);
|
||||||
pci_write_config_word(dev, PCI_COMMAND, cmd);
|
pci_write_config_word(dev, PCI_COMMAND, cmd);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -293,7 +249,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
|
|||||||
r = &dev->resource[idx];
|
r = &dev->resource[idx];
|
||||||
if (!r->start && r->end) {
|
if (!r->start && r->end) {
|
||||||
printk(KERN_ERR "PCI: Device %s not available because "
|
printk(KERN_ERR "PCI: Device %s not available because "
|
||||||
"of resource collisions\n", dev->slot_name);
|
"of resource collisions\n", pci_name(dev));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (r->flags & IORESOURCE_IO)
|
if (r->flags & IORESOURCE_IO)
|
||||||
@ -303,7 +259,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
|
|||||||
}
|
}
|
||||||
if (cmd != old_cmd) {
|
if (cmd != old_cmd) {
|
||||||
printk("PCI: Enabling device %s (%04x -> %04x)\n",
|
printk("PCI: Enabling device %s (%04x -> %04x)\n",
|
||||||
dev->slot_name, old_cmd, cmd);
|
pci_name(dev), old_cmd, cmd);
|
||||||
pci_write_config_word(dev, PCI_COMMAND, cmd);
|
pci_write_config_word(dev, PCI_COMMAND, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,47 +281,6 @@ pci_controller_num(struct pci_dev *dev)
|
|||||||
|
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
pcibios_fixup_resources(struct pci_dev *dev)
|
|
||||||
{
|
|
||||||
struct pci_controller* pci_ctrl = (struct pci_controller *)dev->sysdata;
|
|
||||||
int i;
|
|
||||||
unsigned long offset;
|
|
||||||
|
|
||||||
if (!pci_ctrl) {
|
|
||||||
printk(KERN_ERR "No pci_ctrl for PCI dev %s!\n",dev->slot_name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
|
|
||||||
struct resource *res = dev->resource + i;
|
|
||||||
if (!res->start || !res->flags)
|
|
||||||
continue;
|
|
||||||
if (res->end == 0xffffffff) {
|
|
||||||
DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
|
|
||||||
dev->slot_name, i, res->start, res->end);
|
|
||||||
res->end -= res->start;
|
|
||||||
res->start = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
offset = 0;
|
|
||||||
if (res->flags & IORESOURCE_IO)
|
|
||||||
offset = (unsigned long) pci_ctrl->io_space.base;
|
|
||||||
else if (res->flags & IORESOURCE_MEM)
|
|
||||||
offset = (unsigned long) pci_ctrl->mem_space.base;
|
|
||||||
|
|
||||||
if (offset != 0) {
|
|
||||||
res->start += offset;
|
|
||||||
res->end += offset;
|
|
||||||
#ifdef DEBUG
|
|
||||||
printk("Fixup res %d (%lx) of dev %s: %lx -> %lx\n",
|
|
||||||
i, res->flags, dev->slot_name,
|
|
||||||
res->start - offset, res->start);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Platform support for /proc/bus/pci/X/Y mmap()s,
|
* Platform support for /proc/bus/pci/X/Y mmap()s,
|
||||||
* modelled on the sparc64 implementation by Dave Miller.
|
* modelled on the sparc64 implementation by Dave Miller.
|
||||||
|
@ -21,7 +21,7 @@ extern unsigned long loops_per_jiffy;
|
|||||||
extern __inline__ void __delay(unsigned long loops)
|
extern __inline__ void __delay(unsigned long loops)
|
||||||
{
|
{
|
||||||
/* 2 cycles per loop. */
|
/* 2 cycles per loop. */
|
||||||
__asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 1, 1b"
|
__asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
|
||||||
: "=r" (loops) : "0" (loops));
|
: "=r" (loops) : "0" (loops));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user