]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/esd/cpci750/ide.c
imported Freescale specific U-Boot additions for i.MX28,... release L2.6.31_10.08.01
[karo-tx-uboot.git] / board / esd / cpci750 / ide.c
index bea99ce8e721b13e2b33ea04c5179fab75789c48..638219f65ecac248e85a1f6d292b3f7d1522592a 100755 (executable)
 
 
 #include <common.h>
-#ifdef CFG_CMD_IDE
+#if defined(CONFIG_CMD_IDE)
 #include <ata.h>
 #include <ide.h>
 #include <pci.h>
 
-extern ulong ide_bus_offset[CFG_IDE_MAXBUS];
+extern ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS];
 
 int ide_preinit (void)
 {
@@ -39,23 +39,27 @@ int ide_preinit (void)
        int l;
 
        status = 1;
-       for (l = 0; l < CFG_IDE_MAXBUS; l++) {
+       if (CPCI750_SLAVE_TEST != 0)
+               return status;
+       for (l = 0; l < CONFIG_SYS_IDE_MAXBUS; l++) {
                ide_bus_offset[l] = -ATA_STATUS;
        }
        devbusfn = pci_find_device (0x1103, 0x0004, 0);
+       if (devbusfn == -1)
+               devbusfn = pci_find_device (0x1095, 0x3114, 0);
        if (devbusfn != -1) {
                status = 0;
 
                pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
                                       (u32 *) & ide_bus_offset[0]);
                ide_bus_offset[0] &= 0xfffffffe;
-               ide_bus_offset[0] += CFG_PCI0_IO_SPACE;
+               ide_bus_offset[0] += CONFIG_SYS_PCI0_IO_SPACE;
                pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_2,
                                       (u32 *) & ide_bus_offset[1]);
                ide_bus_offset[1] &= 0xfffffffe;
-               ide_bus_offset[1] += CFG_PCI0_IO_SPACE;
+               ide_bus_offset[1] += CONFIG_SYS_PCI0_IO_SPACE;
        }
-       return (status);
+       return status;
 }
 
 void ide_set_reset (int flag) {