]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/block/ata_piix.c
part/dev_desc: Add log2 of blocksize to block_dev_desc data struct
[karo-tx-uboot.git] / drivers / block / ata_piix.c
index 0404771ee4c64bef9b7b1519ae21ba6f2a76e90e..fcae44850837b0e9a2c3a65f860a862ea0605bee 100644 (file)
@@ -34,9 +34,7 @@
 #include <part.h>
 #include <ide.h>
 #include <ata.h>
-
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-extern int sata_curr_device;
+#include <sata.h>
 
 #define DEBUG_SATA 0           /* For debug prints set DEBUG_SATA to 1 */
 
@@ -408,6 +406,7 @@ void sata_identify(int num, int dev)
        /* assuming HD */
        sata_dev_desc[devno].type = DEV_TYPE_HARDDISK;
        sata_dev_desc[devno].blksz = ATA_BLOCKSIZE;
+       sata_dev_desc[devno].log2blksz = LOG2(sata_dev_desc[devno].blksz);
        sata_dev_desc[devno].lun = 0;   /* just to fill something in... */
 }
 
@@ -623,7 +622,7 @@ ulong sata_read(int device, ulong blknr, lbaint_t blkcnt, void *buff)
        return n;
 }
 
-ulong sata_write(int device, ulong blknr, lbaint_t blkcnt, void *buff)
+ulong sata_write(int device, ulong blknr, lbaint_t blkcnt, const void *buff)
 {
        ulong n = 0, *buffer = (ulong *)buff;
        unsigned char status = 0, num = 0, dev = 0, mask = 0;