summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-04-27 22:57:41 +0200
committerWolfgang Denk <wd@denx.de>2010-04-27 22:57:41 +0200
commitc303176aa0cf8c5fc38e7c2d5e181e89cca72ef6 (patch)
treecfac3ea66f6977c3875dbb091370ee8483e462cb /drivers
parentc88d6ab19ffab06f372b15c290bdf5d6f1ebfe9a (diff)
parent7e1afb62a7e68843248b9a76a265c9193e716768 (diff)
downloadu-boot-imx-c303176aa0cf8c5fc38e7c2d5e181e89cca72ef6.zip
u-boot-imx-c303176aa0cf8c5fc38e7c2d5e181e89cca72ef6.tar.gz
u-boot-imx-c303176aa0cf8c5fc38e7c2d5e181e89cca72ef6.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/fsl_sata.c22
-rw-r--r--drivers/block/fsl_sata.h8
2 files changed, 28 insertions, 2 deletions
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
index abcda6f..8878560 100644
--- a/drivers/block/fsl_sata.c
+++ b/drivers/block/fsl_sata.c
@@ -21,6 +21,7 @@
#include <common.h>
#include <command.h>
#include <asm/io.h>
+#include <asm/processor.h>
#include <malloc.h>
#include <libata.h>
#include <fis.h>
@@ -191,6 +192,27 @@ int init_sata(int dev)
/* Wait the controller offline */
ata_wait_register(&reg->hstatus, HSTATUS_ONOFF, 0, 1000);
+#if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_FSL_SATA_ERRATUM_A001)
+ /*
+ * For P1022/1013 Rev1.0 silicon, after power on SATA host
+ * controller is configured in legacy mode instead of the
+ * expected enterprise mode. software needs to clear bit[28]
+ * of HControl register to change to enterprise mode from
+ * legacy mode.
+ */
+ {
+ u32 svr = get_svr();
+ if (IS_SVR_REV(svr, 1, 0) &&
+ ((SVR_SOC_VER(svr) == SVR_P1022) ||
+ (SVR_SOC_VER(svr) == SVR_P1022_E) ||
+ (SVR_SOC_VER(svr) == SVR_P1013) ||
+ (SVR_SOC_VER(svr) == SVR_P1013_E))) {
+ out_le32(&reg->hstatus, 0x20000000);
+ out_le32(&reg->hcontrol, 0x00000100);
+ }
+ }
+#endif
+
/* Set the command header base address to CHBA register to tell DMA */
out_le32(&reg->chba, (u32)cmd_hdr & ~0x3);
diff --git a/drivers/block/fsl_sata.h b/drivers/block/fsl_sata.h
index 18e88fa..576efaf 100644
--- a/drivers/block/fsl_sata.h
+++ b/drivers/block/fsl_sata.h
@@ -243,8 +243,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)