Author: stepan
Date: 2009-04-29 21:19:55 +0200 (Wed, 29 Apr 2009)
New Revision: 93

Modified:
   trunk/filo/configs/defconfig
   trunk/filo/drivers/ide_new.c
   trunk/filo/drivers/ide_new.h
Log:
disable some dead code in the new IDE driver, and enable the new ide driver per
default.


Modified: trunk/filo/configs/defconfig
===================================================================
--- trunk/filo/configs/defconfig        2009-04-29 19:15:52 UTC (rev 92)
+++ trunk/filo/configs/defconfig        2009-04-29 19:19:55 UTC (rev 93)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# FILO version: 0.6.0b1
-# Thu Sep 11 20:18:11 2008
+# FILO version: 0.6.0
+# Wed Apr 29 21:18:12 2009
 #
 CONFIG_TARGET_I386=y
 # CONFIG_REVIEW is not set
@@ -18,12 +18,9 @@
 #
 # Drivers
 #
-CONFIG_IDE_DISK=y
-CONFIG_IDE_DISK_POLL_DELAY=0
-# CONFIG_SLOW_SATA is not set
-# CONFIG_PCMCIA_CF is not set
+# CONFIG_IDE_DISK is not set
+CONFIG_IDE_NEW_DISK=y
 CONFIG_USB_NEW_DISK=y
-# CONFIG_USB_DISK is not set
 # CONFIG_FLASH_DISK is not set
 CONFIG_SUPPORT_PCI=y
 # CONFIG_PCI_BRUTE_SCAN is not set

Modified: trunk/filo/drivers/ide_new.c
===================================================================
--- trunk/filo/drivers/ide_new.c        2009-04-29 19:15:52 UTC (rev 92)
+++ trunk/filo/drivers/ide_new.c        2009-04-29 19:19:55 UTC (rev 93)
@@ -63,9 +63,9 @@
  */
 #undef ATA_PEDANTIC
 
+#ifdef CONFIG_DEBUG_IDE
 static void dump_drive(struct ide_drive *drive)
 {
-#ifdef CONFIG_DEBUG_IDE
        printk("IDE DRIVE @%lx:\n", (unsigned long)drive);
        printk("unit: %d\n",drive->unit);
        printk("present: %d\n",drive->present);
@@ -77,8 +77,8 @@
        printk("head: %d\n",drive->head);
        printk("sect: %d\n",drive->sect);
        printk("bs: %d\n",drive->bs);
+}
 #endif
-}
 
 /*
  * old style io port operations
@@ -673,7 +673,7 @@
  * read from an atapi device, using READ_10
  */
 static int
-ob_ide_read_atapi(struct ide_drive *drive, unsigned long long block, char *buf,
+ob_ide_read_atapi(struct ide_drive *drive, unsigned long long block, unsigned 
char *buf,
                  unsigned int sectors)
 {
        struct atapi_command *cmd = &drive->channel->atapi_cmd;
@@ -682,7 +682,7 @@
                return 1;
 
        if (drive->bs == 2048) {
-               if ((block & 3 != 0) || (sectors & 3 != 0)) {
+               if (((block & 3) != 0) || ((sectors & 3) != 0)) {
                        printf("ob_ide_read_atapi: unaligned atapi access: %x 
blocks, starting from %x\n", sectors, block);
                }
                block >>= 2;
@@ -711,7 +711,7 @@
 
 static int
 ob_ide_read_ata_chs(struct ide_drive *drive, unsigned long long block,
-                   char *buf, unsigned int sectors)
+                   unsigned char *buf, unsigned int sectors)
 {
        struct ata_command *cmd = &drive->channel->ata_cmd;
        unsigned int track = (block / drive->sect);
@@ -740,7 +740,7 @@
 
 static int
 ob_ide_read_ata_lba28(struct ide_drive *drive, unsigned long long block,
-                     char *buf, unsigned int sectors)
+                     unsigned char *buf, unsigned int sectors)
 {
        struct ata_command *cmd = &drive->channel->ata_cmd;
 
@@ -766,7 +766,7 @@
 
 static int
 ob_ide_read_ata_lba48(struct ide_drive *drive, unsigned long long block,
-                     char *buf, unsigned int sectors)
+                     unsigned char *buf, unsigned int sectors)
 {
        struct ata_command *cmd = &drive->channel->ata_cmd;
        struct ata_sector ata_sector;
@@ -799,8 +799,8 @@
  * read 'sectors' sectors from ata device
  */
 static int
-ob_ide_read_ata(struct ide_drive *drive, unsigned long long block, char *buf,
-               unsigned int sectors)
+ob_ide_read_ata(struct ide_drive *drive, unsigned long long block, 
+               unsigned char *buf, unsigned int sectors)
 {
        unsigned long long end_block = block + sectors;
        const int need_lba48 = (end_block > (1ULL << 28)) || (sectors > 255);
@@ -823,7 +823,7 @@
 
 static int
 ob_ide_read_sectors(struct ide_drive *drive, unsigned long long block,
-                   char *buf, unsigned int sectors)
+                   unsigned char *buf, unsigned int sectors)
 {
        if (!sectors)
                return 1;
@@ -938,7 +938,7 @@
                drive->sect = id.sectors;
        }
 
-       strcpy(drive->model, id.model);
+       strcpy(drive->model, (char *)id.model);
        return 0;
 }
 
@@ -1116,6 +1116,7 @@
        }
 }
 
+#ifdef OPENBIOS
 /*
  * The following functions are interfacing with OpenBIOS. They
  * are device node methods. Thus they have to do proper stack handling.
@@ -1132,9 +1133,10 @@
 
        return (drive->max_sectors * drive->bs);
 }
+#endif
 
 int
-ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, char* dest)
+ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, unsigned char* 
dest)
 {
        int cnt = n;
        while (n) {
@@ -1156,12 +1158,14 @@
        return (cnt);
 }
 
+#ifdef OPENBIOS
 static int
 ob_ide_block_size(int *idx)
 {
        struct ide_drive *drive=&ob_ide_channels[idx[1]].drives[idx[0]];
        return(drive->bs);
 }
+#endif
 
 #ifdef CONFIG_SUPPORT_PCI
 static int pci_find_ata_device_on_bus(int bus, pcidev_t * dev, int *index, int 
sata, int pata)
@@ -1418,8 +1422,6 @@
        return 0;
 }
 
-static int inited=0;
-
 int ide_probe(int drive)
 {
        struct ide_drive *curr_drive = & ob_ide_channels[drive / 
2].drives[drive % 2];

Modified: trunk/filo/drivers/ide_new.h
===================================================================
--- trunk/filo/drivers/ide_new.h        2009-04-29 19:15:52 UTC (rev 92)
+++ trunk/filo/drivers/ide_new.h        2009-04-29 19:19:55 UTC (rev 93)
@@ -98,7 +98,7 @@
  * simple ata command that works for everything (except 48-bit lba commands)
  */
 struct ata_command {
-       char *buffer;
+       unsigned char *buffer;
        unsigned int buflen;
 
        /*
@@ -214,7 +214,7 @@
 };
 
 int
-ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, char* dest);
+ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, unsigned char* 
dest);
 static int
 ob_ide_atapi_request_sense(struct ide_drive *drive);
 //int ob_ide_init(int (*func)(struct ide_drive*));


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to