Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113117
b: refs/heads/master
c: d3ae4b5
h: refs/heads/master
i:
  113115: 16d5719
v: v3
  • Loading branch information
David S. Miller committed Sep 11, 2008
1 parent 6c207cd commit 12955d6
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 242 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: ab138c031f72f6d030afa1a06a3a537e85ae843e
refs/heads/master: d3ae4b5bc7186a53731d35187ad4ba3bca147cf6
3 changes: 3 additions & 0 deletions trunk/arch/sparc/include/asm/iommu_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ struct strbuf {
unsigned long strbuf_control;
unsigned long strbuf_pflush;
unsigned long strbuf_fsync;
unsigned long strbuf_err_stat;
unsigned long strbuf_tag_diag;
unsigned long strbuf_line_diag;
unsigned long strbuf_ctxflush;
unsigned long strbuf_ctxmatch_base;
unsigned long strbuf_flushflag_pa;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sparc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,14 +977,14 @@ int pcibus_to_node(struct pci_bus *pbus)
EXPORT_SYMBOL(pcibus_to_node);
#endif

/* Return the domain nuber for this pci bus */
/* Return the domain number for this pci bus */

int pci_domain_nr(struct pci_bus *pbus)
{
struct pci_pbm_info *pbm = pbus->sysdata;
int ret;

if (pbm == NULL || pbm->parent == NULL) {
if (!pbm) {
ret = -ENXIO;
} else {
ret = pbm->index;
Expand Down
55 changes: 17 additions & 38 deletions trunk/arch/sparc64/kernel/pci_fire.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,22 +431,13 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)
fire_write(pbm->pbm_regs + FIRE_PEC_IENAB, ~(u64)0);
}

static int __init pci_fire_pbm_init(struct pci_controller_info *p,
static int __init pci_fire_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, u32 portid)
{
const struct linux_prom64_registers *regs;
struct device_node *dp = op->node;
struct pci_pbm_info *pbm;
int err;

if ((portid & 1) == 0)
pbm = &p->pbm_A;
else
pbm = &p->pbm_B;

pbm->next = pci_pbm_root;
pci_pbm_root = pbm;

pbm->numa_node = -1;

pbm->pci_ops = &sun4u_pci_ops;
Expand All @@ -455,7 +446,6 @@ static int __init pci_fire_pbm_init(struct pci_controller_info *p,
pbm->index = pci_num_pbms++;

pbm->portid = portid;
pbm->parent = p;
pbm->prom_node = dp;
pbm->name = dp->full_name;

Expand All @@ -481,62 +471,51 @@ static int __init pci_fire_pbm_init(struct pci_controller_info *p,

/* XXX register error interrupt handlers XXX */

return 0;
}
pbm->next = pci_pbm_root;
pci_pbm_root = pbm;

static inline int portid_compare(u32 x, u32 y)
{
if (x == (y ^ 1))
return 1;
return 0;
}

static int __devinit fire_probe(struct of_device *op,
const struct of_device_id *match)
{
struct device_node *dp = op->node;
struct pci_controller_info *p;
struct pci_pbm_info *pbm;
struct iommu *iommu;
u32 portid;
int err;

portid = of_getintprop_default(dp, "portid", 0xff);
for (pbm = pci_pbm_root; pbm; pbm = pbm->next) {
if (portid_compare(pbm->portid, portid))
return pci_fire_pbm_init(pbm->parent, op, portid);
}

err = -ENOMEM;
p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
if (!p) {
printk(KERN_ERR PFX "Cannot allocate controller info.\n");
pbm = kzalloc(sizeof(*pbm), GFP_KERNEL);
if (!pbm) {
printk(KERN_ERR PFX "Cannot allocate pci_pbminfo.\n");
goto out_err;
}

iommu = kzalloc(sizeof(struct iommu), GFP_ATOMIC);
iommu = kzalloc(sizeof(struct iommu), GFP_KERNEL);
if (!iommu) {
printk(KERN_ERR PFX "Cannot allocate PBM A iommu.\n");
printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n");
goto out_free_controller;
}

p->pbm_A.iommu = iommu;
pbm->iommu = iommu;

iommu = kzalloc(sizeof(struct iommu), GFP_ATOMIC);
if (!iommu) {
printk(KERN_ERR PFX "Cannot allocate PBM A iommu.\n");
goto out_free_iommu_A;
}
err = pci_fire_pbm_init(pbm, op, portid);
if (err)
goto out_free_iommu;

p->pbm_B.iommu = iommu;
dev_set_drvdata(&op->dev, pbm);

return pci_fire_pbm_init(p, op, portid);
return 0;

out_free_iommu_A:
kfree(p->pbm_A.iommu);
out_free_iommu:
kfree(pbm->iommu);

out_free_controller:
kfree(p);
kfree(pbm);

out_err:
return err;
Expand Down
16 changes: 5 additions & 11 deletions trunk/arch/sparc64/kernel/pci_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,11 @@ struct sparc64_msiq_cookie {
};
#endif

struct pci_controller_info;

struct pci_pbm_info {
struct pci_pbm_info *next;
struct pci_pbm_info *sibling;
int index;

/* PCI controller we sit under. */
struct pci_controller_info *parent;

/* Physical address base of controller registers. */
unsigned long controller_regs;

Expand Down Expand Up @@ -107,6 +103,10 @@ struct pci_pbm_info {
/* This will be 12 on PCI-E controllers, 8 elsewhere. */
unsigned long config_space_reg_bits;

unsigned long pci_afsr;
unsigned long pci_afar;
unsigned long pci_csr;

/* State of 66MHz capabilities on this PBM. */
int is_66mhz_capable;
int all_devs_66mhz;
Expand Down Expand Up @@ -151,12 +151,6 @@ struct pci_pbm_info {
int numa_node;
};

struct pci_controller_info {
/* The PCI bus modules controlled by us. */
struct pci_pbm_info pbm_A;
struct pci_pbm_info pbm_B;
};

extern struct pci_pbm_info *pci_pbm_root;

extern int pci_num_pbms;
Expand Down
Loading

0 comments on commit 12955d6

Please sign in to comment.