Dave Liu | f17c963 | 2008-03-27 18:51:17 +0800 | [diff] [blame] | 1 | #ifndef __SATA_H__ |
| 2 | #define __SATA_H__ |
Pavel Herrmann | 9e9f628 | 2012-09-27 23:18:04 +0000 | [diff] [blame] | 3 | #include <part.h> |
Dave Liu | f17c963 | 2008-03-27 18:51:17 +0800 | [diff] [blame] | 4 | |
Simon Glass | 6c857ad | 2017-07-29 11:35:13 -0600 | [diff] [blame] | 5 | #if !defined(CONFIG_DM_SCSI) && !defined(CONFIG_AHCI) |
Dave Liu | 76596ba | 2008-03-26 22:49:44 +0800 | [diff] [blame] | 6 | int init_sata(int dev); |
Nikita Kiryanov | b9666d6 | 2014-11-21 12:47:23 +0200 | [diff] [blame] | 7 | int reset_sata(int dev); |
Dave Liu | 76596ba | 2008-03-26 22:49:44 +0800 | [diff] [blame] | 8 | int scan_sata(int dev); |
Pavel Herrmann | 9e9f628 | 2012-09-27 23:18:04 +0000 | [diff] [blame] | 9 | ulong sata_read(int dev, ulong blknr, lbaint_t blkcnt, void *buffer); |
| 10 | ulong sata_write(int dev, ulong blknr, lbaint_t blkcnt, const void *buffer); |
Dave Liu | 76596ba | 2008-03-26 22:49:44 +0800 | [diff] [blame] | 11 | |
| 12 | int sata_initialize(void); |
Mike Frysinger | e66dc08 | 2009-01-27 16:12:21 -0500 | [diff] [blame] | 13 | int __sata_initialize(void); |
Nikita Kiryanov | 44fd1f9 | 2014-11-21 12:47:24 +0200 | [diff] [blame] | 14 | int sata_stop(void); |
| 15 | int __sata_stop(void); |
Nikita Kiryanov | 6691404 | 2014-08-20 15:08:53 +0300 | [diff] [blame] | 16 | int sata_port_status(int dev, int port); |
Dave Liu | f17c963 | 2008-03-27 18:51:17 +0800 | [diff] [blame] | 17 | |
Simon Glass | e339475 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 18 | extern struct blk_desc sata_dev_desc[]; |
Michal Simek | c886f35 | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 19 | #endif |
Pavel Herrmann | 9e9f628 | 2012-09-27 23:18:04 +0000 | [diff] [blame] | 20 | |
Simon Glass | 6c857ad | 2017-07-29 11:35:13 -0600 | [diff] [blame] | 21 | int sata_probe(int devnum); |
| 22 | int sata_remove(int devnum); |
| 23 | |
Tony Dinh | a87cbb8 | 2023-10-11 13:26:42 -0700 | [diff] [blame] | 24 | /* |
| 25 | * Remove existing AHCI SATA device uclass and all of its children, |
| 26 | * if any, and probe it again. |
| 27 | */ |
| 28 | int sata_rescan(bool verbose); |
| 29 | |
Dave Liu | f17c963 | 2008-03-27 18:51:17 +0800 | [diff] [blame] | 30 | #endif |