summaryrefslogtreecommitdiff
path: root/cmd/sata.c
diff options
context:
space:
mode:
authorEric Nelson <eric@nelint.com>2016-03-27 12:00:15 -0700
committerTom Rini <trini@konsulko.com>2016-04-01 17:18:28 -0400
commit96baf368a88bc6f2bce93177c0e996b7354c289f (patch)
tree23be58a06b82980622f1656b14ca7be134094258 /cmd/sata.c
parentbcfde7ffb0beff80dc9e2f689099b813f5f0e052 (diff)
downloadu-boot-96baf368a88bc6f2bce93177c0e996b7354c289f.tar.gz
u-boot-96baf368a88bc6f2bce93177c0e996b7354c289f.tar.bz2
u-boot-96baf368a88bc6f2bce93177c0e996b7354c289f.zip
sata: use block layer for sata command
Call blk_dread, blk_dwrite, blk_derase to ensure that the block cache is used if enabled and to remove build breakage when CONFIG_BLK is enabled. Signed-off-by: Eric Nelson <eric@nelint.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'cmd/sata.c')
-rw-r--r--cmd/sata.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/sata.c b/cmd/sata.c
index c8de9a3f83..8748ccef69 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -183,7 +183,8 @@ static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("\nSATA read: device %d block # %ld, count %ld ... ",
sata_curr_device, blk, cnt);
- n = sata_read(sata_curr_device, blk, cnt, (u32 *)addr);
+ n = blk_dread(&sata_dev_desc[sata_curr_device],
+ blk, cnt, (u32 *)addr);
/* flush cache after read */
flush_cache(addr, cnt * sata_dev_desc[sata_curr_device].blksz);
@@ -201,7 +202,8 @@ static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("\nSATA write: device %d block # %ld, count %ld ... ",
sata_curr_device, blk, cnt);
- n = sata_write(sata_curr_device, blk, cnt, (u32 *)addr);
+ n = blk_dwrite(&sata_dev_desc[sata_curr_device],
+ blk, cnt, (u32 *)addr);
printf("%ld blocks written: %s\n",
n, (n == cnt) ? "OK" : "ERROR");