@ -100,7 +100,7 @@ static int waiting_for_cmd_completed(u8 *offset,
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 =
@ -112,7 +112,7 @@ static int ahci_setup_oobr(struct ahci_probe_ent *probe_ent,
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 ;
@ -275,7 +275,7 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
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 ;
@ -331,10 +331,10 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
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
@ -361,7 +361,7 @@ err_out:
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 ] ) ;
@ -408,7 +408,7 @@ static void ahci_fill_cmd_slot(struct ahci_ioports *pp, u32 cmd_slot, u32 opts)
# 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 )
{
@ -461,8 +461,8 @@ static int ahci_exec_ata_cmd(struct ahci_probe_ent *probe_ent,
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 ;
@ -476,7 +476,7 @@ static void ahci_set_feature(u8 dev, u8 port)
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 ] ) ;
@ -560,7 +560,7 @@ int init_sata(int dev)
{
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 ( ) )
@ -573,7 +573,7 @@ int init_sata(int dev)
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 ) {
@ -597,7 +597,7 @@ int init_sata(int dev)
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 ) ) {
@ -605,7 +605,7 @@ int reset_sata(int dev)
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 ;
@ -636,8 +636,8 @@ static void dwc_ahsata_print_info(int dev)
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 ;
@ -655,8 +655,8 @@ static void dwc_ahsata_identify(int dev, u16 *id)
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 ] ;
@ -667,8 +667,8 @@ static void dwc_ahsata_xfer_mode(int dev, u16 *id)
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 ;
@ -698,8 +698,8 @@ static u32 dwc_ahsata_rw_cmd(int dev, u32 start, u32 blkcnt,
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 ;
@ -716,8 +716,8 @@ void dwc_ahsata_flush_cache(int dev)
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 ;
@ -753,8 +753,8 @@ static u32 dwc_ahsata_rw_cmd_ext(int dev, u32 start, lbaint_t blkcnt,
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 ;
@ -795,8 +795,8 @@ u32 dwc_ahsata_rw_ncq_cmd(int dev, u32 start, lbaint_t blkcnt,
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 ;
@ -812,8 +812,8 @@ void dwc_ahsata_flush_cache_ext(int dev)
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 ;
@ -893,7 +893,7 @@ u32 ata_low_level_rw_lba28(int dev, u32 blknr, lbaint_t blkcnt,
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 ;
@ -901,7 +901,7 @@ int sata_port_status(int dev, int port)
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 ;
@ -926,8 +926,8 @@ ulong sata_read(int dev, ulong blknr, lbaint_t blkcnt, void *buffer)
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 ) {
@ -953,8 +953,8 @@ int scan_sata(int dev)
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 ] ) ;