[coreboot] [FILO] r102 - trunk/filo/drivers

svn at coreboot.org svn at coreboot.org
Sat Jul 18 16:44:04 CEST 2009


Author: stepan
Date: 2009-07-18 16:44:04 +0200 (Sat, 18 Jul 2009)
New Revision: 102

Modified:
   trunk/filo/drivers/ide_new.c
Log:
* fix up comments in ide driver
* remove some dead code
* skip certain TI smart card slots because they show up
  as IDE devices if enabled and confuse the boot device
  order.


Modified: trunk/filo/drivers/ide_new.c
===================================================================
--- trunk/filo/drivers/ide_new.c	2009-07-18 14:40:15 UTC (rev 101)
+++ trunk/filo/drivers/ide_new.c	2009-07-18 14:44:04 UTC (rev 102)
@@ -3,9 +3,9 @@
  *   
  *   Copyright (C) 2004 Jens Axboe <axboe at suse.de>
  *   Copyright (C) 2005 Stefan Reinauer <stepan at openbios.org>
+ *   Copyright (C) 2009 coresystems GmbH
  *
  *   Credit goes to Hale Landis for his excellent ata demo software
- *   OF node handling and some fixes by Stefan Reinauer
  *
  *   This program is free software; you can redistribute it and/or
  *   modify it under the terms of the GNU General Public License
@@ -13,11 +13,6 @@
  *
  */
 
-/*
- * TODO:
- *  - Really probe for interfaces, don't just rely on legacy
- */
-
 #define GRUB
 
 #include <libpayload.h>
@@ -25,7 +20,6 @@
 #include <arch/byteorder.h>
 
 #include <fs.h>
-#include <debug.h>
 #include "ide_new.h"
 #include "hdreg.h"
 
@@ -33,11 +27,8 @@
 #include <pci.h>
 #endif
 
-#if 0
-#define dprintf printf
-#else
-#define dprintf(x...) 
-#endif
+#define DEBUG_THIS CONFIG_DEBUG_IDE
+#include <debug.h>
 
 /*
  * define to 2 for the standard 2 channels only
@@ -1117,25 +1108,6 @@
 	}
 }
 
-#ifdef OPENBIOS
-/*
- * The following functions are interfacing with OpenBIOS. They
- * are device node methods. Thus they have to do proper stack handling.
- * 
- */
-
-/*
- * 255 sectors for ata lba28, 65535 for lba48, and 31 sectors for atapi
- */
-static int
-ob_ide_max_transfer(int *idx)
-{
-	struct ide_drive *drive=&ob_ide_channels[idx[1]].drives[idx[0]];
-
-	return (drive->max_sectors * drive->bs);
-}
-#endif
-
 int
 ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, unsigned char* dest)
 {
@@ -1145,11 +1117,11 @@
 		if (len > drive->max_sectors)
 			len = drive->max_sectors;
 			
-		dprintf("reading %d sectors from blk %d\n",len, blk);
+		debug("reading %d sectors from blk %d\n",len, blk);
 		if (ob_ide_read_sectors(drive, blk, dest, len)) {
 			return n-1;
 		}
-		dprintf("done\n");
+		debug("done\n");
 
 		dest += len * drive->bs;
 		n -= len;
@@ -1159,15 +1131,6 @@
 	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)
 {
@@ -1186,6 +1149,11 @@
 			    val == 0x0000ffff || val == 0xffff0000)
 				continue;
 
+			if (val == 0xac8f104c) {
+				debug("Skipping TI bridge\n");
+				continue;
+			}
+
 			class = pci_read_config16(currdev, 0x0a);
 			debug("%02x:%02x.%02x [%04x:%04x] class %04x\n",
 				bus, slot, func, val & 0xffff, val >> 16, class);





More information about the coreboot mailing list