summaryrefslogtreecommitdiff
path: root/common/cmd_universe.c
diff options
context:
space:
mode:
authorstroese <stroese>2005-05-03 06:06:41 +0000
committerstroese <stroese>2005-05-03 06:06:41 +0000
commitdcb2f95a60c094d482574fa9fb01001b2e711a4e (patch)
tree62f0182d173886bb45b04cc3b6be66f338220f96 /common/cmd_universe.c
parent9f709b6cee2e567510a59c145bb0814dabefdaa5 (diff)
downloadu-boot-imx-dcb2f95a60c094d482574fa9fb01001b2e711a4e.zip
u-boot-imx-dcb2f95a60c094d482574fa9fb01001b2e711a4e.tar.gz
u-boot-imx-dcb2f95a60c094d482574fa9fb01001b2e711a4e.tar.bz2
* Patch by Stefan Roese, 03 May 2005:
Update for P3G4 Fix problems in cmd_universe.c
Diffstat (limited to 'common/cmd_universe.c')
-rw-r--r--common/cmd_universe.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/common/cmd_universe.c b/common/cmd_universe.c
index a8febff..8d7b6fe 100644
--- a/common/cmd_universe.c
+++ b/common/cmd_universe.c
@@ -72,6 +72,9 @@ int universe_init(void)
dev->busdevfn = busdevfn;
pci_read_config_dword(busdevfn, PCI_BASE_ADDRESS_1, &val);
+ if (val & 1) {
+ pci_read_config_dword(busdevfn, PCI_BASE_ADDRESS_0, &val);
+ }
val &= ~0xf;
dev->uregs = (UNIVERSE *)val;
@@ -102,7 +105,13 @@ int universe_init(void)
* Arbitration Mode
* DTACK Enable
*/
- writel(0x15060000, &dev->uregs->misc_ctl);
+ writel(0x15040000 | (readl(&dev->uregs->misc_ctl) & 0x00020000), &dev->uregs->misc_ctl);
+
+ if (readl(&dev->uregs->misc_ctl) & 0x00020000) {
+ debug ("System Controller!\n"); /* test-only */
+ } else {
+ debug ("Not System Controller!\n"); /* test-only */
+ }
/*
* Lets turn off interrupts
@@ -114,12 +123,14 @@ int universe_init(void)
writel(0x0000, &dev->uregs->lint_map1); /* Map all ints to 0 */
eieio();
+ return 0;
+
break_30:
free(dev);
break_20:
lastError = result;
- return 0;
+ return result;
}
@@ -193,13 +204,13 @@ int universe_pci_slave_window(unsigned int pciAddr, unsigned int vmeAddr, int si
switch (pms & PCI_MS_Mxx) {
case PCI_MS_MEM:
- ctl = 0x00000000;
+ ctl |= 0x00000000;
break;
case PCI_MS_IO:
- ctl = 0x00000001;
+ ctl |= 0x00000001;
break;
case PCI_MS_CONFIG:
- ctl = 0x00000002;
+ ctl |= 0x00000002;
break;
}
@@ -278,13 +289,13 @@ int universe_vme_slave_window(unsigned int vmeAddr, unsigned int pciAddr, int si
switch (pms & PCI_MS_Mxx) {
case PCI_MS_MEM:
- ctl = 0x00000000;
+ ctl |= 0x00000000;
break;
case PCI_MS_IO:
- ctl = 0x00000001;
+ ctl |= 0x00000001;
break;
case PCI_MS_CONFIG:
- ctl = 0x00000002;
+ ctl |= 0x00000002;
break;
}