]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/block/ata_piix.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / drivers / block / ata_piix.c
index 0404771ee4c64bef9b7b1519ae21ba6f2a76e90e..5cf91ade8d2cb343a42898306d951b9e4d913155 100644 (file)
@@ -3,20 +3,7 @@
  * Author: Mushtaq Khan <mushtaq_k@procsys.com>
  *                     <mushtaqk_921@yahoo.co.in>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * with the reference to ata_piix driver in kernel 2.4.32
  */
@@ -34,9 +21,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 +393,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 +609,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;