Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3001
b: refs/heads/master
c: dad32bb
h: refs/heads/master
i:
  2999: 10d4a43
v: v3
  • Loading branch information
John Rose authored and Paul Mackerras committed Jun 23, 2005
1 parent 65d1154 commit f4f9d9b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 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: 8f586b2243198194240626fd9695da5564ffa7ee
refs/heads/master: dad32bbf43b496bcd32a83f73a1e7fd0a02cfd3e
35 changes: 20 additions & 15 deletions trunk/arch/ppc64/kernel/pSeries_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "pci.h"

static int __initdata s7a_workaround;
static int __initdata s7a_workaround = -1;

#if 0
void pcibios_name_device(struct pci_dev *dev)
Expand Down Expand Up @@ -65,6 +65,7 @@ static void __init check_s7a(void)
struct device_node *root;
char *model;

s7a_workaround = 0;
root = of_find_node_by_path("/");
if (root) {
model = get_property(root, "model", NULL);
Expand All @@ -74,6 +75,24 @@ static void __init check_s7a(void)
}
}

void __devinit pSeries_irq_bus_setup(struct pci_bus *bus)
{
struct pci_dev *dev;

if (s7a_workaround < 0)
check_s7a();
list_for_each_entry(dev, &bus->devices, bus_list) {
pci_read_irq_line(dev);
if (s7a_workaround) {
if (dev->irq > 16) {
dev->irq -= 3;
pci_write_config_byte(dev, PCI_INTERRUPT_LINE,
dev->irq);
}
}
}
}

static void __init pSeries_request_regions(void)
{
if (!isa_io_base)
Expand All @@ -89,20 +108,6 @@ static void __init pSeries_request_regions(void)

void __init pSeries_final_fixup(void)
{
struct pci_dev *dev = NULL;

check_s7a();

for_each_pci_dev(dev) {
pci_read_irq_line(dev);
if (s7a_workaround) {
if (dev->irq > 16) {
dev->irq -= 3;
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
}
}
}

phbs_remap_io();
pSeries_request_regions();

Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/ppc64/kernel/pSeries_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
#define DBG(fmt...)
#endif

extern void pSeries_final_fixup(void);

extern void find_udbg_vterm(void);
extern void system_reset_fwnmi(void); /* from head.S */
extern void machine_check_fwnmi(void); /* from head.S */
Expand Down Expand Up @@ -425,6 +423,7 @@ struct machdep_calls __initdata pSeries_md = {
.get_cpuinfo = pSeries_get_cpuinfo,
.log_error = pSeries_log_error,
.pcibios_fixup = pSeries_final_fixup,
.irq_bus_setup = pSeries_irq_bus_setup,
.restart = rtas_restart,
.power_off = rtas_power_off,
.halt = rtas_halt,
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/ppc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
list_for_each_entry(dev, &bus->devices, bus_list)
ppc_md.iommu_dev_setup(dev);

if (ppc_md.irq_bus_setup)
ppc_md.irq_bus_setup(bus);

if (!pci_probe_only)
return;

Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/ppc64/kernel/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev);
void pci_addr_cache_insert_device(struct pci_dev *dev);
void pci_addr_cache_remove_device(struct pci_dev *dev);

/* From pSeries_pci.h */
/* From rtas_pci.h */
void init_pci_config_tokens (void);
unsigned long get_phb_buid (struct device_node *);

/* From pSeries_pci.h */
extern void pSeries_final_fixup(void);
extern void pSeries_irq_bus_setup(struct pci_bus *bus);

extern unsigned long pci_probe_only;
extern unsigned long pci_assign_all_buses;
extern int pci_read_irq_line(struct pci_dev *pci_dev);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-ppc64/machdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct machdep_calls {
void (*tce_flush)(struct iommu_table *tbl);
void (*iommu_dev_setup)(struct pci_dev *dev);
void (*iommu_bus_setup)(struct pci_bus *bus);
void (*irq_bus_setup)(struct pci_bus *bus);

int (*probe)(int platform);
void (*setup_arch)(void);
Expand Down

0 comments on commit f4f9d9b

Please sign in to comment.