Skip to contentSkip to conversation

fsl_sata: Add the workaround for errata SATA-A001

PATCH New Dave Liu 3 participants 3 messages Apr 8, 2010 Block layer

lore
Share & tools
lore

Dave Liu

author
#0 lore raw

PATCH 2/3 fsl_sata: Add the workaround for errata SATA-A001

After power on, the SATA host controller of P1022 Rev1 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 after bringing the host offline.

---
 drivers/block/fsl_sata.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
drivers/block/fsl_sata.c +14 -0
index abcda6f..d875581 100644
@@ -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,19 @@ int init_sata(int dev)
 	/* Wait the controller offline */
 	ata_wait_register(&reg->hstatus, HSTATUS_ONOFF, 0, 1000);
 
+#ifdef CONFIG_SYS_P1022_ERRATUM_SATA-A001
+	/* For P1022 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.
+	 */
+	if (IS_SVR_REV(get_svr(), 1, 0)) {
+		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);
 
Signature · 1 line
1.6.4
#1 lore raw

PATCH 2/3 fsl_sata: Add the workaround for errata SATA-A001

Quoted 24 lines · Dave Liu

After power on, the SATA host controller of P1022 Rev1 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 after bringing the host offline.

---
drivers/block/fsl_sata.c | 14 ++++++++++++++

1 files changed, 14 insertions(+), 0 deletions(-)
drivers/block/fsl_sata.c +1 -0
index abcda6f..d875581 100644
@@ -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>

drivers/block/fsl_sata.c int init_sata(int dev) · line 195

Quoted 4 lines
drivers/block/fsl_sata.c +1 -0
@@ -191,6 +192,19 @@ int init_sata(int dev)
 	/* Wait the controller offline */
 	ata_wait_register(&reg->hstatus, HSTATUS_ONOFF, 0, 1000);
 
+#ifdef CONFIG_SYS_P1022_ERRATUM_SATA-A001

This should just be #ifdef CONFIG_SYS_FSL_SATA_ERRATUM_A001 (the A001 # is not specific to P1022). Also I want to standardize on all underscores instead of a mix with a dash even of the errata doc uses '-'.

drivers/block/fsl_sata.c int init_sata(int dev) · line 205

Quoted 10 lines
drivers/block/fsl_sata.c +10 -0
+	/* For P1022 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.
+	 */
+	if (IS_SVR_REV(get_svr(), 1, 0)) {
+		out_le32(&reg->hstatus, 0x20000000);
+		out_le32(&reg->hcontrol, 0x00000100);
+	}

I'm trying to determine from the HW guys if we have a version register in the IP block to detect this at runtime in a chip unique way.

Quoted 12 lines
drivers/block/fsl_sata.c +2 -0
+#endif
+
 	/* Set the command header base address to CHBA register to tell DMA */
 	out_le32(&reg->chba, (u32)cmd_hdr & ~0x3);
 
Signature · 6 lines
1.6.4

_______________________________________________
u-boot-release mailing list
u-boot-release at linux.freescale.net
http://linux.freescale.net/mailman/listinfo/u-boot-release
#2 lore raw

PATCH 2/3 fsl_sata: Add the workaround for errata SATA-A001

Quoted 10 lines

drivers/block/fsl_sata.c int init_sata(int dev) · line 195

Quoted 5 lines
drivers/block/fsl_sata.c +1 -0
@@ -191,6 +192,19 @@ int init_sata(int dev)
 	/* Wait the controller offline */
 	ata_wait_register(&reg->hstatus, HSTATUS_ONOFF, 0, 1000);
 
+#ifdef CONFIG_SYS_P1022_ERRATUM_SATA-A001

This should just be #ifdef CONFIG_SYS_FSL_SATA_ERRATUM_A001 (the A001 # is not specific to P1022). Also I want to standardize on all underscores instead of a mix with a dash even of the errata doc uses '-'.

Ok. Will use the CONFIG_SYS_FSL_SATA_ERRATUM_A001

Quoted 6 lines
Quoted 6 lines
drivers/block/fsl_sata.c +6 -0
+	/* For P1022 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.
+	 */
Quoted 8 lines

drivers/block/fsl_sata.c int init_sata(int dev) · line 205

Quoted 4 lines
drivers/block/fsl_sata.c +4 -0
+	if (IS_SVR_REV(get_svr(), 1, 0)) {
+		out_le32(&reg->hstatus, 0x20000000);
+		out_le32(&reg->hcontrol, 0x00000100);
+	}

I'm trying to determine from the HW guys if we have a version register in the IP block to detect this at runtime in a chip unique way.

Unfortunately, no such IP version register in the block.