Skip to contentSkip to conversation

sata: ahci: fix OMAP L3 error

PATCH New Roger Quadros 3 participants 10 messages Sep 23, 2014 – Oct 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover sata: ahci: fix OMAP L3 error

Hi,

Patch 1 fixes a bug in the AHCI code that was causing L3 errors on OMAP platforms.

Patches 3, 4 and 5 clean up the SATA/SCSI implementation for OMAP platorms.

cheers,
-roger

---

Roger Quadros (4):
ahci: Don't start command DMA engine before buffers are set OMAP5+: sata/scsi: Implement scsi_init()
ARM: OMAP5+: sata: Move scsi_scan() to the right place
common: spl_sata: perform SCSI scan before getting device

 arch/arm/cpu/armv7/omap-common/sata.c | 8 +++++++-
 board/ti/dra7xx/evm.c                 | 1 -
 board/ti/omap5_uevm/evm.c             | 6 ------
 common/spl/spl_sata.c                 | 1 +
 drivers/block/ahci.c                  | 1 -
 include/configs/omap5_uevm.h          | 1 -
 6 files changed, 8 insertions(+), 10 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/4 ahci: Don't start command DMA engine before buffers are set

The DMA/FIS buffers are set in ahci_port_start() which is called after ahci_host_init(). So don't start the DMA engine here (i.e. don't set FIS_RX)

This fixes the following error at kernel boot on OMAP platforms (e.g. DRA7x)

WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x260/0x358()

44000000.ocp:L3 Custom Error: MASTER SATA TARGET GPMC (Idle): Data Access in User mode during Functional access

---
 drivers/block/ahci.c | 1 -
 1 file changed, 1 deletion(-)
drivers/block/ahci.c +0 -1
index dce99ad..a93a8e1 100644
@@ -229,7 +229,6 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
 		 * already be on in the command register.
 		 */
 		cmd = readl(port_mmio + PORT_CMD);
-		cmd |= PORT_CMD_FIS_RX;
 		cmd |= PORT_CMD_SPIN_UP;
 		writel_with_flush(cmd, port_mmio + PORT_CMD);
 
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/4 ahci: Don't start command DMA engine before buffers are set

Quoted 9 lines · Roger Quadros

The DMA/FIS buffers are set in ahci_port_start() which is called after ahci_host_init(). So don't start the DMA engine here (i.e. don't set FIS_RX)

This fixes the following error at kernel boot on OMAP platforms (e.g. DRA7x)

WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x260/0x358()

44000000.ocp:L3 Custom Error: MASTER SATA TARGET GPMC (Idle): Data Access in User mode during Functional access

FWIW this also appears to have solved an issue I've been having getting sata working from u-boot on arndale (porting some patches from chromeos tree). Not sure if that quite qualifies as an Ack or Tested - by...

Quoted 16 lines
---
 drivers/block/ahci.c | 1 -
 1 file changed, 1 deletion(-)
drivers/block/ahci.c +0 -1
index dce99ad..a93a8e1 100644
@@ -229,7 +229,6 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
 		 * already be on in the command register.
 		 */
 		cmd = readl(port_mmio + PORT_CMD);
-		cmd |= PORT_CMD_FIS_RX;
 		cmd |= PORT_CMD_SPIN_UP;
 		writel_with_flush(cmd, port_mmio + PORT_CMD);
 
#3 lore raw

PATCH 1/4 ahci: Don't start command DMA engine before buffers are set

In reply to Roger Quadros
Quoted 9 lines · Roger Quadros

The DMA/FIS buffers are set in ahci_port_start() which is called after ahci_host_init(). So don't start the DMA engine here (i.e. don't set FIS_RX)

This fixes the following error at kernel boot on OMAP platforms (e.g. DRA7x)

WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x260/0x358()

44000000.ocp:L3 Custom Error: MASTER SATA TARGET GPMC (Idle): Data Access in User mode during Functional access

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141010/f09f38aa/attachment.pgp>
#4 lore raw

PATCH 2/4 OMAP5+: sata/scsi: Implement scsi_init()

In reply to Roger Quadros

On OMAP platforms, SATA controller provides the SCSI subsystem so implement scsi_init().

Get rid of the unnecessary sata_init() call from dra7xx-evm and omap5-uevm board files.

---
 arch/arm/cpu/armv7/omap-common/sata.c | 6 ++++++
 board/ti/dra7xx/evm.c                 | 1 -
 board/ti/omap5_uevm/evm.c             | 6 ------
 include/configs/omap5_uevm.h          | 1 -
 4 files changed, 6 insertions(+), 8 deletions(-)
arch/arm/cpu/armv7/omap-common/sata.c +6 -0
index cad4fee..131d082 100644
@@ -74,3 +74,9 @@ int init_sata(int dev)
 
 	return ret;
 }
+
+/* On OMAP platforms SATA provides the SCSI subsystem */
+void scsi_init(void)
+{
+	init_sata(0);
+}
board/ti/dra7xx/evm.c +0 -1
index 5592fc5..37df7b2 100644
@@ -93,7 +93,6 @@ int board_late_init(void)
 	else
 		setenv("board_name", "dra7xx");
 #endif
-	init_sata(0);
 	return 0;
 }
 
board/ti/omap5_uevm/evm.c +0 -6
index 4666b38..833ffe9 100644
@@ -69,12 +69,6 @@ int board_init(void)
 	return 0;
 }
 
-int board_late_init(void)
-{
-	init_sata(0);
-	return 0;
-}
-
 int board_eth_init(bd_t *bis)
 {
 	return 0;
include/configs/omap5_uevm.h +0 -1
index 7e2ecd5..e8dc462 100644
@@ -72,7 +72,6 @@
 /* Max time to hold reset on this board, see doc/README.omap-reset-time */
 #define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC	16296
 
-#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_CMD_SCSI
 #define CONFIG_LIBATA
 #define CONFIG_SCSI_AHCI
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH 2/4 OMAP5+: sata/scsi: Implement scsi_init()

Quoted 7 lines · Roger Quadros

On OMAP platforms, SATA controller provides the SCSI subsystem so implement scsi_init().

Get rid of the unnecessary sata_init() call from dra7xx-evm and omap5-uevm board files.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141010/b096a4d7/attachment.pgp>
#6 lore raw

PATCH 3/4 ARM: OMAP5+: sata: Move scsi_scan() to the right place

In reply to Roger Quadros

scsi_scan() must be called as part of scsi_init() and not as part of sata_init().

---
 arch/arm/cpu/armv7/omap-common/sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/omap-common/sata.c +1 -1
index 131d082..3b4dd3f 100644
@@ -70,7 +70,6 @@ int init_sata(int dev)
 	writel(val, TI_SATA_WRAPPER_BASE + TI_SATA_SYSCONFIG);
 
 	ret = ahci_init(DWC_AHSATA_BASE);
-	scsi_scan(1);
 
 	return ret;
 }
@@ -79,4 +78,5 @@ int init_sata(int dev)
 void scsi_init(void)
 {
 	init_sata(0);
+	scsi_scan(1);
 }
Signature · 1 line
1.8.3.2
#7 lore raw

PATCH 3/4 ARM: OMAP5+: sata: Move scsi_scan() to the right place

Quoted 4 lines · Roger Quadros

scsi_scan() must be called as part of scsi_init() and not as part of sata_init().

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141010/4d8e5aba/attachment.pgp>
#8 lore raw

PATCH 4/4 common: spl_sata: perform SCSI scan before getting device

In reply to Roger Quadros

At least on OMAP, init_sata() no longer performs scsi_scan() so we must do it explicitly here.

---
 common/spl/spl_sata.c | 1 +
 1 file changed, 1 insertion(+)
common/spl/spl_sata.c +1 -0
index 2e7adca..12e16d9 100644
@@ -32,6 +32,7 @@ void spl_sata_load_image(void)
 		hang();
 	} else {
 		/* try to recognize storage devices immediately */
+		scsi_scan(0);
 		stor_dev = scsi_get_dev(0);
 	}
 
Signature · 1 line
1.8.3.2
#9 lore raw

PATCH 4/4 common: spl_sata: perform SCSI scan before getting device

Quoted 5 lines · Roger Quadros

At least on OMAP, init_sata() no longer performs scsi_scan() so we must do it explicitly here.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141010/2fc2aeaa/attachment.pgp>