}
static inline void
-cia_prepare_tbia_workaround(int cia_rev, int is_pyxis)
+cia_prepare_tbia_workaround(int window)
{
unsigned long *ppte, pte;
long i;
for (i = 0; i < CIA_BROKEN_TBIA_SIZE / sizeof(unsigned long); ++i)
ppte[i] = pte;
- if (is_pyxis || cia_rev != 1) {
- /* We can use W1 for SG on PYXIS/CIA rev 2. */
- *(vip)CIA_IOC_PCI_W1_BASE = CIA_BROKEN_TBIA_BASE | 3;
- *(vip)CIA_IOC_PCI_W1_MASK = (CIA_BROKEN_TBIA_SIZE*1024 - 1)
- & 0xfff00000;
- *(vip)CIA_IOC_PCI_T1_BASE = virt_to_phys(ppte) >> 2;
- } else {
- /* CIA rev 1 can't use W1 or W2 for SG, apparently,
- so use W3, which we made sure is not used for DAC. */
- *(vip)CIA_IOC_PCI_W3_BASE = CIA_BROKEN_TBIA_BASE | 3;
- *(vip)CIA_IOC_PCI_W3_MASK = (CIA_BROKEN_TBIA_SIZE*1024 - 1)
- & 0xfff00000;
- *(vip)CIA_IOC_PCI_T3_BASE = virt_to_phys(ppte) >> 2;
- }
+ *(vip)CIA_IOC_PCI_Wn_BASE(window) = CIA_BROKEN_TBIA_BASE | 3;
+ *(vip)CIA_IOC_PCI_Wn_MASK(window)
+ = (CIA_BROKEN_TBIA_SIZE*1024 - 1) & 0xfff00000;
+ *(vip)CIA_IOC_PCI_Tn_BASE(window) = virt_to_phys(ppte) >> 2;
}
static void __init
do_init_arch(int is_pyxis)
{
struct pci_controller *hose;
- int temp;
- int cia_rev;
+ int temp, cia_rev, tbia_window;
cia_rev = *(vip)CIA_IOC_CIA_REV & CIA_REV_MASK;
printk("pci: cia revision %d%s\n",
elsewhere, we should not claim that we support DAC unless that
4GB covers all of physical memory.
- Also, don't do DAC on CIA rev 1, it has other problems and is
- unlikely to have more than 2GB of memory anyway, so direct is
- fine.
- */
- if (cia_rev == 1 || is_pyxis ||
- max_low_pfn > (0x100000000UL >> PAGE_SHIFT)) {
+ On CIA rev 1, apparently W1 and W2 can't be used for SG.
+ At least, there are reports that it doesn't work for Alcor.
+ In that case, we have no choice but to use W3 for the TBIA
+ workaround, which means we can't use DAC at all. */
+
+ tbia_window = 1;
+ if (is_pyxis) {
+ *(vip)CIA_IOC_PCI_W3_BASE = 0;
+ } else if (cia_rev == 1) {
+ *(vip)CIA_IOC_PCI_W1_BASE = 0;
+ tbia_window = 3;
+ } else if (max_low_pfn > (0x100000000UL >> PAGE_SHIFT)) {
*(vip)CIA_IOC_PCI_W3_BASE = 0;
} else {
*(vip)CIA_IOC_PCI_W3_BASE = 0x00000000 | 1 | 8;
}
/* Prepare workaround for apparently broken tbia. */
- cia_prepare_tbia_workaround(cia_rev, is_pyxis);
+ cia_prepare_tbia_workaround(tbia_window);
}
void __init