]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/block/fsl_sata.c
Kconfig: Add CONFIG_SATA to enable SATA
[people/ms/u-boot.git] / drivers / block / fsl_sata.c
index ebd626178d098ce2beb4a00221997dc585feb10a..31f7fab8b47aaae1fdc6dda5001a123506250053 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <console.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fsl_serdes.h>
@@ -113,7 +114,7 @@ int init_sata(int dev)
        /* Save the private struct to block device struct */
        sata_dev_desc[dev].priv = (void *)sata;
 
-       sprintf(sata->name, "SATA%d", dev);
+       snprintf(sata->name, 12, "SATA%d", dev);
 
        /* Set the controller register base address to device struct */
        reg = (fsl_sata_reg_t *)(fsl_sata_info[dev].sata_reg_base);
@@ -123,7 +124,7 @@ int init_sata(int dev)
        length = sizeof(struct cmd_hdr_tbl);
        align = SATA_HC_CMD_HDR_TBL_ALIGN;
        sata->cmd_hdr_tbl_offset = (void *)malloc(length + align);
-       if (!sata) {
+       if (!sata->cmd_hdr_tbl_offset) {
                printf("alloc the command header failed\n\r");
                return -1;
        }
@@ -255,6 +256,11 @@ int init_sata(int dev)
        return 0;
 }
 
+int reset_sata(int dev)
+{
+       return 0;
+}
+
 static void fsl_sata_dump_regs(fsl_sata_reg_t __iomem *reg)
 {
        printf("\n\rSATA:           %08x\n\r", (u32)reg);
@@ -392,7 +398,7 @@ static int fsl_ata_exec_ata_cmd(struct fsl_sata *sata, struct sata_fis_h2d *cfis
        debug("attribute = %08x\n\r", val32);
        cmd_hdr->attribute = cpu_to_le32(val32);
 
-       /* Make sure cmd desc and cmd slot valid before commmand issue */
+       /* Make sure cmd desc and cmd slot valid before command issue */
        sync();
 
        /* PMP*/