aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc/sba_iommu.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@parisc-linux.org>2005-10-21 22:33:38 -0400
committerKyle McMartin <kyle@parisc-linux.org>2005-10-21 22:33:38 -0400
commit5658374766d9e0249bd04e9d62bdb8456b916b64 (patch)
tree61ae77a2c8faf7bb420be00d989b89c5ffd1f4ee /drivers/parisc/sba_iommu.c
parent63172cb3d5ef762dcb60a292bc7f016b85cf6e1f (diff)
[PARISC] Convert parisc_device tree to use struct device klists
Fix parse_tree_node. much more needs to be done to fix this file. Signed-off-by: Matthew Wilcox <willy@parisc-linux.org> Make drivers.c compile based on a patch from Pat Mochel. From: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org> Fix drivers.c to create new device tree nodes when no match is found. Signed-off-by: Richard Hirst <rhirst@parisc-linux.org> Do a proper depth-first search returning parents before children, using the new klist infrastructure. Signed-off-by: Richard Hirst <rhirst@parisc-linux.org> Fixed parisc_device traversal so that pdc_stable works again Fixed check_dev so it doesn't dereference a parisc_device until it has verified the bus type Signed-off-by: Randolph Chung <tausq@parisc-linux.org> Convert pa_dev->hpa from an unsigned long to a struct resource. Use insert_resource() instead of request_mem_region(). Request resources at bus walk time instead of driver probe time. Don't release the resources as we don't have any hotplug parisc_device support yet. Add parisc_pathname() to conveniently get the textual representation of the hwpath used in sysfs. Inline the remnants of claim_device() into its caller. Signed-off-by: Matthew Wilcox <willy@parisc-linux.org> I noticed that some of the STI regions weren't showing up in iomem. Reading the STI spec indicated that all STI devices occupy at least 32MB. So check for STI HPAs and give them 32MB instead of 4kB. Signed-off-by: Matthew Wilcox <willy@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/parisc/sba_iommu.c')
-rw-r--r--drivers/parisc/sba_iommu.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 82ea68b55df4..a8405f05fb5f 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1322,19 +1322,29 @@ sba_alloc_pdir(unsigned int pdir_size)
1322 return (void *) pdir_base; 1322 return (void *) pdir_base;
1323} 1323}
1324 1324
1325static struct device *next_device(struct klist_iter *i)
1326{
1327 struct klist_node * n = klist_next(i);
1328 return n ? container_of(n, struct device, knode_parent) : NULL;
1329}
1330
1325/* setup Mercury or Elroy IBASE/IMASK registers. */ 1331/* setup Mercury or Elroy IBASE/IMASK registers. */
1326static void setup_ibase_imask(struct parisc_device *sba, struct ioc *ioc, int ioc_num) 1332static void
1333setup_ibase_imask(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
1327{ 1334{
1328 /* lba_set_iregs() is in drivers/parisc/lba_pci.c */ 1335 /* lba_set_iregs() is in drivers/parisc/lba_pci.c */
1329 extern void lba_set_iregs(struct parisc_device *, u32, u32); 1336 extern void lba_set_iregs(struct parisc_device *, u32, u32);
1330 struct device *dev; 1337 struct device *dev;
1338 struct klist_iter i;
1331 1339
1332 list_for_each_entry(dev, &sba->dev.children, node) { 1340 klist_iter_init(&sba->dev.klist_children, &i);
1341 while ((dev = next_device(&i))) {
1333 struct parisc_device *lba = to_parisc_device(dev); 1342 struct parisc_device *lba = to_parisc_device(dev);
1334 int rope_num = (lba->hpa >> 13) & 0xf; 1343 int rope_num = (lba->hpa.start >> 13) & 0xf;
1335 if (rope_num >> 3 == ioc_num) 1344 if (rope_num >> 3 == ioc_num)
1336 lba_set_iregs(lba, ioc->ibase, ioc->imask); 1345 lba_set_iregs(lba, ioc->ibase, ioc->imask);
1337 } 1346 }
1347 klist_iter_exit(&i);
1338} 1348}
1339 1349
1340static void 1350static void