]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/cmd_scsi.c
net: gem: Use correct type for casting
[karo-tx-uboot.git] / common / cmd_scsi.c
index 7b97dc9332b4d275ee05eb97690102a1a95a4e3f..a0a62ebdca8e8d18e36ecfa7fac6aea6328d2df5 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <inttypes.h>
 #include <asm/processor.h>
 #include <scsi.h>
 #include <image.h>
@@ -168,7 +169,9 @@ removable:
                scsi_curr_dev = -1;
 
        printf("Found %d device(s).\n", scsi_max_devs);
+#ifndef CONFIG_SPL_BUILD
        setenv_ulong("scsidevs", scsi_max_devs);
+#endif
 }
 
 int scsi_get_disk_count(void)
@@ -214,8 +217,10 @@ void scsi_init(void)
                       (busdevfunc >> 8) & 0x7);
        }
 #endif
+       bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci");
        scsi_low_level_init(busdevfunc);
        scsi_scan(1);
+       bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI);
 }
 #endif
 
@@ -389,7 +394,7 @@ static ulong scsi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
                        blks=0;
                }
                debug("scsi_read_ext: startblk " LBAF
-                     ", blccnt %x buffer %lx\n",
+                     ", blccnt %x buffer %" PRIXPTR "\n",
                      start, smallblks, buf_addr);
                if (scsi_exec(pccb) != true) {
                        scsi_print_error(pccb);
@@ -399,7 +404,7 @@ static ulong scsi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
                buf_addr+=pccb->datalen;
        } while(blks!=0);
        debug("scsi_read_ext: end startblk " LBAF
-             ", blccnt %x buffer %lx\n", start, smallblks, buf_addr);
+             ", blccnt %x buffer %" PRIXPTR "\n", start, smallblks, buf_addr);
        return(blkcnt);
 }
 
@@ -443,7 +448,7 @@ static ulong scsi_write(int device, lbaint_t blknr,
                        start += blks;
                        blks = 0;
                }
-               debug("%s: startblk " LBAF ", blccnt %x buffer %lx\n",
+               debug("%s: startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n",
                      __func__, start, smallblks, buf_addr);
                if (scsi_exec(pccb) != true) {
                        scsi_print_error(pccb);
@@ -452,7 +457,7 @@ static ulong scsi_write(int device, lbaint_t blknr,
                }
                buf_addr += pccb->datalen;
        } while (blks != 0);
-       debug("%s: end startblk " LBAF ", blccnt %x buffer %lx\n",
+       debug("%s: end startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n",
              __func__, start, smallblks, buf_addr);
        return blkcnt;
 }