Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81433
b: refs/heads/master
c: c96b512
h: refs/heads/master
i:
  81431: 8ae6c31
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Jan 31, 2008
1 parent 3fa028f commit d080229
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 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: 41347917280bcd96619441dae20507711608b4b8
refs/heads/master: c96b51265ad4658eb82fd4379c98b9beb98f99d0
23 changes: 17 additions & 6 deletions trunk/arch/powerpc/platforms/cell/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,25 +443,36 @@ static struct iommu_window *find_window(struct cbe_iommu *iommu,
}
#endif

static inline u32 cell_iommu_get_ioid(struct device_node *np)
{
const u32 *ioid;

ioid = of_get_property(np, "ioid", NULL);
if (ioid == NULL) {
printk(KERN_WARNING "iommu: missing ioid for %s using 0\n",
np->full_name);
return 0;
}

return *ioid;
}

static struct iommu_window * __init
cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
unsigned long offset, unsigned long size,
unsigned long pte_offset)
{
struct iommu_window *window;
const unsigned int *ioid;
u32 ioid;

ioid = of_get_property(np, "ioid", NULL);
if (ioid == NULL)
printk(KERN_WARNING "iommu: missing ioid for %s using 0\n",
np->full_name);
ioid = cell_iommu_get_ioid(np);

window = kmalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid);
BUG_ON(window == NULL);

window->offset = offset;
window->size = size;
window->ioid = ioid ? *ioid : 0;
window->ioid = ioid;
window->iommu = iommu;
window->pte_offset = pte_offset;

Expand Down

0 comments on commit d080229

Please sign in to comment.