[U-Boot] [PATCH 0/4] 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(-)

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

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_SPIN_UP; writel_with_flush(cmd, port_mmio + PORT_CMD);cmd |= PORT_CMD_FIS_RX;

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!

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

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!

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); }

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!

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); }

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!
participants (3)
-
Ian Campbell
-
Roger Quadros
-
Tom Rini