static int ata_io_flush(u8 port);
-struct ahci_probe_ent *probe_ent = NULL;
+struct ahci_uc_priv *probe_ent = NULL;
u16 *ataid[AHCI_MAX_PORTS];
#define writel_with_flush(a,b) do { writel(a,b); readl(b); } while (0)
return (i < timeout_msec) ? 0 : -1;
}
-int __weak ahci_link_up(struct ahci_probe_ent *probe_ent, u8 port)
+int __weak ahci_link_up(struct ahci_uc_priv *probe_ent, u8 port)
{
u32 tmp;
int j = 0;
return 0;
}
-static int ahci_host_init(struct ahci_probe_ent *probe_ent)
+static int ahci_host_init(struct ahci_uc_priv *probe_ent)
{
#if !defined(CONFIG_SCSI_AHCI_PLAT) && !defined(CONFIG_DM_SCSI)
# ifdef CONFIG_DM_PCI
}
-static void ahci_print_info(struct ahci_probe_ent *probe_ent)
+static void ahci_print_info(struct ahci_uc_priv *probe_ent)
{
#if !defined(CONFIG_SCSI_AHCI_PLAT) && !defined(CONFIG_DM_SCSI)
# if defined(CONFIG_DM_PCI)
#endif
int rc;
- probe_ent = malloc(sizeof(struct ahci_probe_ent));
+ probe_ent = malloc(sizeof(struct ahci_uc_priv));
if (!probe_ent) {
printf("%s: No memory for probe_ent\n", __func__);
return -ENOMEM;
}
- memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
+ memset(probe_ent, 0, sizeof(struct ahci_uc_priv));
probe_ent->dev = dev;
probe_ent->host_flags = ATA_FLAG_SATA
int i, rc = 0;
u32 linkmap;
- probe_ent = malloc(sizeof(struct ahci_probe_ent));
+ probe_ent = malloc(sizeof(struct ahci_uc_priv));
if (!probe_ent) {
printf("%s: No memory for probe_ent\n", __func__);
return -ENOMEM;
}
- memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
+ memset(probe_ent, 0, sizeof(struct ahci_uc_priv));
probe_ent->host_flags = ATA_FLAG_SATA
| ATA_FLAG_NO_LEGACY
return (i < timeout_msec) ? 0 : -1;
}
-static int ahci_setup_oobr(struct ahci_probe_ent *probe_ent,
+static int ahci_setup_oobr(struct ahci_uc_priv *probe_ent,
int clk)
{
struct sata_host_regs *host_mmio =
return 0;
}
-static int ahci_host_init(struct ahci_probe_ent *probe_ent)
+static int ahci_host_init(struct ahci_uc_priv *probe_ent)
{
u32 tmp, cap_save, num_ports;
int i, j, timeout = 1000;
return 0;
}
-static void ahci_print_info(struct ahci_probe_ent *probe_ent)
+static void ahci_print_info(struct ahci_uc_priv *probe_ent)
{
struct sata_host_regs *host_mmio =
(struct sata_host_regs *)probe_ent->mmio_base;
static int ahci_init_one(int pdev)
{
int rc;
- struct ahci_probe_ent *probe_ent = NULL;
+ struct ahci_uc_priv *probe_ent = NULL;
- probe_ent = malloc(sizeof(struct ahci_probe_ent));
- memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
+ probe_ent = malloc(sizeof(struct ahci_uc_priv));
+ memset(probe_ent, 0, sizeof(struct ahci_uc_priv));
probe_ent->dev = pdev;
probe_ent->host_flags = ATA_FLAG_SATA
return rc;
}
-static int ahci_fill_sg(struct ahci_probe_ent *probe_ent,
+static int ahci_fill_sg(struct ahci_uc_priv *probe_ent,
u8 port, unsigned char *buf, int buf_len)
{
struct ahci_ioports *pp = &(probe_ent->port[port]);
#define AHCI_GET_CMD_SLOT(c) ((c) ? ffs(c) : 0)
-static int ahci_exec_ata_cmd(struct ahci_probe_ent *probe_ent,
+static int ahci_exec_ata_cmd(struct ahci_uc_priv *probe_ent,
u8 port, struct sata_fis_h2d *cfis,
u8 *buf, u32 buf_len, s32 is_write)
{
static void ahci_set_feature(u8 dev, u8 port)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
ahci_exec_ata_cmd(probe_ent, port, cfis, NULL, 0, READ_CMD);
}
-static int ahci_port_start(struct ahci_probe_ent *probe_ent,
+static int ahci_port_start(struct ahci_uc_priv *probe_ent,
u8 port)
{
struct ahci_ioports *pp = &(probe_ent->port[port]);
{
int i;
u32 linkmap;
- struct ahci_probe_ent *probe_ent = NULL;
+ struct ahci_uc_priv *probe_ent = NULL;
#if defined(CONFIG_MX6)
if (!is_mx6dq() && !is_mx6dqp())
ahci_init_one(dev);
- probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
linkmap = probe_ent->link_port_map;
if (0 == linkmap) {
int reset_sata(int dev)
{
- struct ahci_probe_ent *probe_ent;
+ struct ahci_uc_priv *probe_ent;
struct sata_host_regs *host_mmio;
if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) {
return -1;
}
- probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
if (NULL == probe_ent)
/* not initialized, so nothing to reset */
return 0;
static void dwc_ahsata_identify(int dev, u16 *id)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
u8 port = probe_ent->hard_port_no;
static void dwc_ahsata_xfer_mode(int dev, u16 *id)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
probe_ent->pio_mask = id[ATA_ID_PIO_MODES];
probe_ent->udma_mask = id[ATA_ID_UDMA_MODES];
static u32 dwc_ahsata_rw_cmd(int dev, u32 start, u32 blkcnt,
u8 *buffer, int is_write)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
u8 port = probe_ent->hard_port_no;
void dwc_ahsata_flush_cache(int dev)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
u8 port = probe_ent->hard_port_no;
static u32 dwc_ahsata_rw_cmd_ext(int dev, u32 start, lbaint_t blkcnt,
u8 *buffer, int is_write)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
u8 port = probe_ent->hard_port_no;
u32 dwc_ahsata_rw_ncq_cmd(int dev, u32 start, lbaint_t blkcnt,
u8 *buffer, int is_write)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
u8 port = probe_ent->hard_port_no;
void dwc_ahsata_flush_cache_ext(int dev)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
struct sata_fis_h2d *cfis = &h2d;
u8 port = probe_ent->hard_port_no;
static void dwc_ahsata_init_wcache(int dev, u16 *id)
{
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
if (ata_id_has_wcache(id) && ata_id_wcache_enabled(id))
probe_ent->flags |= SATA_FLAG_WCACHE;
int sata_port_status(int dev, int port)
{
struct sata_port_regs *port_mmio;
- struct ahci_probe_ent *probe_ent = NULL;
+ struct ahci_uc_priv *probe_ent = NULL;
if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1))
return -EINVAL;
if (sata_dev_desc[dev].priv == NULL)
return -ENODEV;
- probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
port_mmio = (struct sata_port_regs *)probe_ent->port[port].port_mmio;
return readl(&(port_mmio->ssts)) & SATA_PORT_SSTS_DET_MASK;
ulong sata_write(int dev, ulong blknr, lbaint_t blkcnt, const void *buffer)
{
u32 rc;
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
u32 flags = probe_ent->flags;
if (sata_dev_desc[dev].lba48) {
u8 product[ATA_ID_PROD_LEN + 1] = { 0 };
u16 *id;
u64 n_sectors;
- struct ahci_probe_ent *probe_ent =
- (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
+ struct ahci_uc_priv *probe_ent =
+ (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
u8 port = probe_ent->hard_port_no;
struct blk_desc *pdev = &(sata_dev_desc[dev]);