diff options
author | Kyle McMartin <kyle@parisc-linux.org> | 2006-08-24 21:33:40 -0400 |
---|---|---|
committer | Matthew Wilcox <willy@parisc-linux.org> | 2006-10-04 08:50:16 -0400 |
commit | 08a6436816f7a16113c73be767ee8d50440e494e (patch) | |
tree | 158c7aba479931fb8182905151fcd0258990b9bf /drivers/parisc/sba_iommu.c | |
parent | 983daeec99f07fca0a8a9180ba1ca65bbd40c820 (diff) |
[PARISC] Add support for Quicksilver AGPGART
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/parisc/sba_iommu.c')
-rw-r--r-- | drivers/parisc/sba_iommu.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index eed99bdcfb6b..294c1117098d 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -89,7 +89,8 @@ | |||
89 | 89 | ||
90 | #define DEFAULT_DMA_HINT_REG 0 | 90 | #define DEFAULT_DMA_HINT_REG 0 |
91 | 91 | ||
92 | static struct sba_device *sba_list; | 92 | struct sba_device *sba_list; |
93 | EXPORT_SYMBOL_GPL(sba_list); | ||
93 | 94 | ||
94 | static unsigned long ioc_needs_fdc = 0; | 95 | static unsigned long ioc_needs_fdc = 0; |
95 | 96 | ||
@@ -102,8 +103,14 @@ static unsigned long piranha_bad_128k = 0; | |||
102 | /* Looks nice and keeps the compiler happy */ | 103 | /* Looks nice and keeps the compiler happy */ |
103 | #define SBA_DEV(d) ((struct sba_device *) (d)) | 104 | #define SBA_DEV(d) ((struct sba_device *) (d)) |
104 | 105 | ||
106 | #ifdef CONFIG_AGP_PARISC | ||
107 | #define SBA_AGP_SUPPORT | ||
108 | #endif /*CONFIG_AGP_PARISC*/ | ||
109 | |||
105 | #ifdef SBA_AGP_SUPPORT | 110 | #ifdef SBA_AGP_SUPPORT |
106 | static int reserve_sba_gart = 1; | 111 | static int sba_reserve_agpgart = 1; |
112 | module_param(sba_reserve_agpgart, int, 1); | ||
113 | MODULE_PARM_DESC(sba_reserve_agpgart, "Reserve half of IO pdir as AGPGART"); | ||
107 | #endif | 114 | #endif |
108 | 115 | ||
109 | #define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) | 116 | #define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) |
@@ -1300,6 +1307,10 @@ sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | |||
1300 | WRITE_REG(ioc->ibase | 31, ioc->ioc_hpa + IOC_PCOM); | 1307 | WRITE_REG(ioc->ibase | 31, ioc->ioc_hpa + IOC_PCOM); |
1301 | 1308 | ||
1302 | #ifdef SBA_AGP_SUPPORT | 1309 | #ifdef SBA_AGP_SUPPORT |
1310 | { | ||
1311 | struct klist_iter i; | ||
1312 | struct device *dev = NULL; | ||
1313 | |||
1303 | /* | 1314 | /* |
1304 | ** If an AGP device is present, only use half of the IOV space | 1315 | ** If an AGP device is present, only use half of the IOV space |
1305 | ** for PCI DMA. Unfortunately we can't know ahead of time | 1316 | ** for PCI DMA. Unfortunately we can't know ahead of time |
@@ -1308,20 +1319,22 @@ sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | |||
1308 | ** We program the next pdir index after we stop w/ a key for | 1319 | ** We program the next pdir index after we stop w/ a key for |
1309 | ** the GART code to handshake on. | 1320 | ** the GART code to handshake on. |
1310 | */ | 1321 | */ |
1311 | device=NULL; | 1322 | klist_iter_init(&sba->dev.klist_children, &i); |
1312 | for (lba = sba->child; lba; lba = lba->sibling) { | 1323 | while (dev = next_device(&i)) { |
1324 | struct parisc_device *lba = to_parisc_device(dev); | ||
1313 | if (IS_QUICKSILVER(lba)) | 1325 | if (IS_QUICKSILVER(lba)) |
1314 | break; | 1326 | agp_found = 1; |
1315 | } | 1327 | } |
1328 | klist_iter_exit(&sba->dev.klist_children, &i); | ||
1316 | 1329 | ||
1317 | if (lba) { | 1330 | if (agp_found && sba_reserve_agpgart) { |
1318 | DBG_INIT("%s: Reserving half of IOVA space for AGP GART support\n", __FUNCTION__); | 1331 | printk(KERN_INFO "%s: reserving %dMb of IOVA space for agpgart\n", |
1332 | __FUNCTION__, (iova_space_size/2) >> 20); | ||
1319 | ioc->pdir_size /= 2; | 1333 | ioc->pdir_size /= 2; |
1320 | ((u64 *)ioc->pdir_base)[PDIR_INDEX(iova_space_size/2)] = SBA_IOMMU_COOKIE; | 1334 | ioc->pdir_base[PDIR_INDEX(iova_space_size/2)] = SBA_AGPGART_COOKIE; |
1321 | } else { | ||
1322 | DBG_INIT("%s: No GART needed - no AGP controller found\n", __FUNCTION__); | ||
1323 | } | 1335 | } |
1324 | #endif /* 0 */ | 1336 | } |
1337 | #endif /*SBA_AGP_SUPPORT*/ | ||
1325 | 1338 | ||
1326 | } | 1339 | } |
1327 | 1340 | ||