diff --git a/litex/soc/software/liblitesata/sata.c b/litex/soc/software/liblitesata/sata.c index e57052389..43ff0b22c 100644 --- a/litex/soc/software/liblitesata/sata.c +++ b/litex/soc/software/liblitesata/sata.c @@ -13,12 +13,12 @@ #include #include "sata.h" -#ifdef CSR_SATA_SECTOR2MEM_BASE - /*-----------------------------------------------------------------------*/ /* SATA user functions */ /*-----------------------------------------------------------------------*/ +#ifdef CSR_SATA_PHY_BASE + int sata_init(void) { uint16_t timeout; @@ -38,16 +38,20 @@ int sata_init(void) { return 0; } -void sata_read(uint32_t block, uint32_t count, uint8_t* buf) +#endif + +#ifdef CSR_SATA_SECTOR2MEM_BASE + +void sata_read(uint32_t sector, uint32_t count, uint8_t* buf) { uint32_t i; - /* Read blocks */ + /* Write sectors */ for (i=0; i -#ifdef CSR_SATA_SECTOR2MEM_BASE - /*-----------------------------------------------------------------------*/ /* SATA user functions */ /*-----------------------------------------------------------------------*/ +#ifdef CSR_SATA_PHY_BASE + int sata_init(void); + +#endif + +#ifdef CSR_SATA_SECTOR2MEM_BASE + void sata_read(uint32_t sector, uint32_t count, uint8_t* buf); -#endif /* CSR_SATA_BASE */ +#endif + +#ifdef CSR_SATA_MEM2SECTOR_BASE + +void sata_write(uint32_t sector, uint32_t count, uint8_t* buf); + +#endif #endif /* __SATA_H */