All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] sata: ahci: fix OMAP L3 error
@ 2014-09-23 15:07 Roger Quadros
  2014-09-23 15:07 ` [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set Roger Quadros
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Roger Quadros @ 2014-09-23 15:07 UTC (permalink / raw)
  To: u-boot

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(-)

-- 
1.8.3.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set
  2014-09-23 15:07 [U-Boot] [PATCH 0/4] sata: ahci: fix OMAP L3 error Roger Quadros
@ 2014-09-23 15:07 ` Roger Quadros
  2014-10-05  8:37   ` Ian Campbell
  2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini
  2014-09-23 15:07 ` [U-Boot] [PATCH 2/4] OMAP5+: sata/scsi: Implement scsi_init() Roger Quadros
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Roger Quadros @ 2014-09-23 15:07 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/block/ahci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index dce99ad..a93a8e1 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -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);
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 2/4] OMAP5+: sata/scsi: Implement scsi_init()
  2014-09-23 15:07 [U-Boot] [PATCH 0/4] sata: ahci: fix OMAP L3 error Roger Quadros
  2014-09-23 15:07 ` [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set Roger Quadros
@ 2014-09-23 15:07 ` Roger Quadros
  2014-10-10 14:40   ` [U-Boot] [U-Boot,2/4] " Tom Rini
  2014-09-23 15:07 ` [U-Boot] [PATCH 3/4] ARM: OMAP5+: sata: Move scsi_scan() to the right place Roger Quadros
  2014-09-23 15:07 ` [U-Boot] [PATCH 4/4] common: spl_sata: perform SCSI scan before getting device Roger Quadros
  3 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2014-09-23 15:07 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 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(-)

diff --git a/arch/arm/cpu/armv7/omap-common/sata.c b/arch/arm/cpu/armv7/omap-common/sata.c
index cad4fee..131d082 100644
--- a/arch/arm/cpu/armv7/omap-common/sata.c
+++ b/arch/arm/cpu/armv7/omap-common/sata.c
@@ -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);
+}
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 5592fc5..37df7b2 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -93,7 +93,6 @@ int board_late_init(void)
 	else
 		setenv("board_name", "dra7xx");
 #endif
-	init_sata(0);
 	return 0;
 }
 
diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index 4666b38..833ffe9 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -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;
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 7e2ecd5..e8dc462 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -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
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 3/4] ARM: OMAP5+: sata: Move scsi_scan() to the right place
  2014-09-23 15:07 [U-Boot] [PATCH 0/4] sata: ahci: fix OMAP L3 error Roger Quadros
  2014-09-23 15:07 ` [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set Roger Quadros
  2014-09-23 15:07 ` [U-Boot] [PATCH 2/4] OMAP5+: sata/scsi: Implement scsi_init() Roger Quadros
@ 2014-09-23 15:07 ` Roger Quadros
  2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini
  2014-09-23 15:07 ` [U-Boot] [PATCH 4/4] common: spl_sata: perform SCSI scan before getting device Roger Quadros
  3 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2014-09-23 15:07 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/cpu/armv7/omap-common/sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/omap-common/sata.c b/arch/arm/cpu/armv7/omap-common/sata.c
index 131d082..3b4dd3f 100644
--- a/arch/arm/cpu/armv7/omap-common/sata.c
+++ b/arch/arm/cpu/armv7/omap-common/sata.c
@@ -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);
 }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 4/4] common: spl_sata: perform SCSI scan before getting device
  2014-09-23 15:07 [U-Boot] [PATCH 0/4] sata: ahci: fix OMAP L3 error Roger Quadros
                   ` (2 preceding siblings ...)
  2014-09-23 15:07 ` [U-Boot] [PATCH 3/4] ARM: OMAP5+: sata: Move scsi_scan() to the right place Roger Quadros
@ 2014-09-23 15:07 ` Roger Quadros
  2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini
  3 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2014-09-23 15:07 UTC (permalink / raw)
  To: u-boot

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

Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 common/spl/spl_sata.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 2e7adca..12e16d9 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -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);
 	}
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set
  2014-09-23 15:07 ` [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set Roger Quadros
@ 2014-10-05  8:37   ` Ian Campbell
  2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2014-10-05  8:37 UTC (permalink / raw)
  To: u-boot

On Tue, 2014-09-23 at 18:07 +0300, Roger Quadros wrote:
> 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
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

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...

> ---
>  drivers/block/ahci.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
> index dce99ad..a93a8e1 100644
> --- a/drivers/block/ahci.c
> +++ b/drivers/block/ahci.c
> @@ -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);
>  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [U-Boot, 1/4] ahci: Don't start command DMA engine before buffers are set
  2014-09-23 15:07 ` [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set Roger Quadros
  2014-10-05  8:37   ` Ian Campbell
@ 2014-10-10 14:40   ` Tom Rini
  1 sibling, 0 replies; 10+ messages in thread
From: Tom Rini @ 2014-10-10 14:40 UTC (permalink / raw)
  To: u-boot

On Tue, Sep 23, 2014 at 06:07:01PM +0300, Roger Quadros wrote:

> 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
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [U-Boot,2/4] OMAP5+: sata/scsi: Implement scsi_init()
  2014-09-23 15:07 ` [U-Boot] [PATCH 2/4] OMAP5+: sata/scsi: Implement scsi_init() Roger Quadros
@ 2014-10-10 14:40   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2014-10-10 14:40 UTC (permalink / raw)
  To: u-boot

On Tue, Sep 23, 2014 at 06:07:02PM +0300, Roger Quadros wrote:

> 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.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [U-Boot, 3/4] ARM: OMAP5+: sata: Move scsi_scan() to the right place
  2014-09-23 15:07 ` [U-Boot] [PATCH 3/4] ARM: OMAP5+: sata: Move scsi_scan() to the right place Roger Quadros
@ 2014-10-10 14:40   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2014-10-10 14:40 UTC (permalink / raw)
  To: u-boot

On Tue, Sep 23, 2014 at 06:07:03PM +0300, Roger Quadros wrote:

> scsi_scan() must be called as part of scsi_init() and not
> as part of sata_init().
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [U-Boot, 4/4] common: spl_sata: perform SCSI scan before getting device
  2014-09-23 15:07 ` [U-Boot] [PATCH 4/4] common: spl_sata: perform SCSI scan before getting device Roger Quadros
@ 2014-10-10 14:40   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2014-10-10 14:40 UTC (permalink / raw)
  To: u-boot

On Tue, Sep 23, 2014 at 06:07:04PM +0300, Roger Quadros wrote:

> At least on OMAP, init_sata() no longer performs scsi_scan()
> so we must do it explicitly here.
> 
> Cc: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-10 14:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 15:07 [U-Boot] [PATCH 0/4] sata: ahci: fix OMAP L3 error Roger Quadros
2014-09-23 15:07 ` [U-Boot] [PATCH 1/4] ahci: Don't start command DMA engine before buffers are set Roger Quadros
2014-10-05  8:37   ` Ian Campbell
2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini
2014-09-23 15:07 ` [U-Boot] [PATCH 2/4] OMAP5+: sata/scsi: Implement scsi_init() Roger Quadros
2014-10-10 14:40   ` [U-Boot] [U-Boot,2/4] " Tom Rini
2014-09-23 15:07 ` [U-Boot] [PATCH 3/4] ARM: OMAP5+: sata: Move scsi_scan() to the right place Roger Quadros
2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini
2014-09-23 15:07 ` [U-Boot] [PATCH 4/4] common: spl_sata: perform SCSI scan before getting device Roger Quadros
2014-10-10 14:40   ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.