X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fblock%2Ffsl_sata.h;h=18d679e782376ca9e975c7d6e7adafb83622c471;hb=c316f57;hp=874c0dc740cc65fcd810317980e3cc3c3f2a8223;hpb=3596d55eb22703d3f4f1b839fe4b000fabe081b3;p=u-boot diff --git a/drivers/block/fsl_sata.h b/drivers/block/fsl_sata.h index 874c0dc740..18d679e782 100644 --- a/drivers/block/fsl_sata.h +++ b/drivers/block/fsl_sata.h @@ -2,20 +2,7 @@ * Copyright (C) 2007-2008 Freescale Semiconductor, Inc. * Dave Liu * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __FSL_SATA_H__ @@ -103,6 +90,7 @@ typedef struct fsl_sata_reg { */ #define HCONTROL_ONOFF 0x80000000 /* Online or offline request */ #define HCONTROL_FORCE_OFFLINE 0x40000000 /* Force offline request */ +#define HCONTROL_ENTERPRISE_EN 0x10000000 /* Enterprise mode enabled */ #define HCONTROL_HDR_SNOOP 0x00000400 /* Command header snoop */ #define HCONTROL_PMP_ATTACHED 0x00000200 /* Port multiplier attached */ @@ -175,10 +163,11 @@ typedef struct fsl_sata_reg { * Command Header Entry */ typedef struct cmd_hdr_entry { - u32 cda; /* Command Descriptor Address, 4 bytes aligned */ - u32 prde_fis_len; /* Number of PRD entries and FIS length */ - u32 ttl; /* Total transfer length */ - u32 attribute; /* the attribute of command */ + __le32 cda; /* Command Descriptor Address, + 4 bytes aligned */ + __le32 prde_fis_len; /* Number of PRD entries and FIS length */ + __le32 ttl; /* Total transfer length */ + __le32 attribute; /* the attribute of command */ } __attribute__ ((packed)) cmd_hdr_entry_t; #define SATA_HC_CMD_HDR_ENTRY_SIZE sizeof(struct cmd_hdr_entry) @@ -229,10 +218,10 @@ typedef struct cmd_hdr_tbl { * PRD entry - Physical Region Descriptor entry */ typedef struct prd_entry { - u32 dba; /* Data base address, 4 bytes aligned */ + __le32 dba; /* Data base address, 4 bytes aligned */ u32 res1; u32 res2; - u32 ext_c_ddc; /* Indirect PRD flags, snoop and data word count */ + __le32 ext_c_ddc; /* Indirect PRD flags, snoop and data word count */ } __attribute__ ((packed)) prd_entry_t; #define SATA_HC_CMD_DESC_PRD_SIZE sizeof(struct prd_entry) @@ -243,8 +232,12 @@ typedef struct prd_entry { /* ext_c_ddc */ -#define PRD_ENTRY_EXT 0x80000000 /* extension flag or called indirect descriptor flag */ -#define PRD_ENTRY_DATA_SNOOP 0x00400000 /* Snoop enable for all data associated with the PRD entry */ +#define PRD_ENTRY_EXT 0x80000000 /* extension flag */ +#ifdef CONFIG_FSL_SATA_V2 +#define PRD_ENTRY_DATA_SNOOP 0x10000000 /* Data snoop enable */ +#else +#define PRD_ENTRY_DATA_SNOOP 0x00400000 /* Data snoop enable */ +#endif #define PRD_ENTRY_LEN_MASK 0x003fffff /* Data word count */ #define PRD_ENTRY_MAX_XFER_SZ (PRD_ENTRY_LEN_MASK + 1) @@ -288,52 +281,6 @@ typedef struct cmd_desc { #define SATA_HC_CMD_DESC_SIZE sizeof(struct cmd_desc) #define SATA_HC_CMD_DESC_ALIGN 4 -/* -* CFIS - Command FIS, which is H2D register FIS, the struct defination -* of Non-Queued command is different than NCQ command. see them is sata2.h -*/ -typedef struct cfis { - u8 fis_type; - u8 pm_port_c; - u8 command; - u8 features; - u8 lba_low; - u8 lba_mid; - u8 lba_high; - u8 device; - u8 lba_low_exp; - u8 lba_mid_exp; - u8 lba_high_exp; - u8 features_exp; - u8 sector_count; - u8 sector_count_exp; - u8 res1; - u8 control; - u8 res2[4]; -} __attribute__ ((packed)) cfis_t; - -/* -* SFIS - Status FIS, which is D2H register FIS. -*/ -typedef struct sfis { - u8 fis_type; - u8 pm_port_i; - u8 status; - u8 error; - u8 lba_low; - u8 lba_mid; - u8 lba_high; - u8 device; - u8 lba_low_exp; - u8 lba_mid_exp; - u8 lba_high_exp; - u8 res1; - u8 sector_count; - u8 sector_count_exp; - u8 res2[2]; - u8 res3[4]; -} __attribute__ ((packed)) sfis_t; - /* * SATA device driver info */