]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/block/systemace.c
Merge branch 'master' of git://git.denx.de/u-boot-uniphier
[karo-tx-uboot.git] / drivers / block / systemace.c
index 247cf060e43ef4695cb4f5e81dd200ba0105c511..fdf75b5abfc90ea2b9eb4d6afcc53d880ebd81c1 100644 (file)
@@ -2,20 +2,7 @@
  * Copyright (c) 2004 Picture Elements, Inc.
  *    Stephen Williams (XXXXXXXXXXXXXXXX)
  *
- *    This source code is free software; you can redistribute it
- *    and/or modify it in source code form 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+
  */
 
 /*
@@ -65,8 +52,8 @@ static void ace_writew(u16 val, unsigned off)
                writeb(val, base + off);
                writeb(val >> 8, base + off + 1);
 #endif
-       }
-       out16(base + off, val);
+       } else
+               out16(base + off, val);
 }
 
 static u16 ace_readw(unsigned off)
@@ -83,7 +70,7 @@ static u16 ace_readw(unsigned off)
 }
 
 static unsigned long systemace_read(int dev, unsigned long start,
-                                   unsigned long blkcnt, void *buffer);
+                                       lbaint_t blkcnt, void *buffer);
 
 static block_dev_desc_t systemace_dev = { 0 };
 
@@ -127,6 +114,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
                systemace_dev.part_type = PART_TYPE_UNKNOWN;
                systemace_dev.type = DEV_TYPE_HARDDISK;
                systemace_dev.blksz = 512;
+               systemace_dev.log2blksz = LOG2(systemace_dev.blksz);
                systemace_dev.removable = 1;
                systemace_dev.block_read = systemace_read;
 
@@ -149,7 +137,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
  * number of blocks read. A zero return indicates an error.
  */
 static unsigned long systemace_read(int dev, unsigned long start,
-                                   unsigned long blkcnt, void *buffer)
+                                       lbaint_t blkcnt, void *buffer)
 {
        int retry;
        unsigned blk_countdown;