All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms
@ 2018-04-06  9:13 Jean-Jacques Hiblot
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 1/2] dwc_ahci: Fix breakage Jean-Jacques Hiblot
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jean-Jacques Hiblot @ 2018-04-06  9:13 UTC (permalink / raw)
  To: u-boot

Enhancements to SCSI support for driver model have broken the support for
DM_SCSI on DRA7 platforms. This series fixes it.

Tested on:
- dra76 evm


Jean-Jacques Hiblot (2):
  dwc_ahci: Fix breakage
  configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3

 configs/dra7xx_evm_defconfig    |  2 ++
 configs/dra7xx_hs_evm_defconfig |  2 ++
 drivers/ata/dwc_ahci.c          | 23 ++++++++++-------------
 3 files changed, 14 insertions(+), 13 deletions(-)

-- 
2.7.4

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

* [U-Boot] [PATCH v1 1/2] dwc_ahci: Fix breakage
  2018-04-06  9:13 [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Jean-Jacques Hiblot
@ 2018-04-06  9:13 ` Jean-Jacques Hiblot
  2018-04-13 21:08   ` [U-Boot] [U-Boot,v1,1/2] " Tom Rini
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3 Jean-Jacques Hiblot
  2018-04-06 12:00 ` [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Michal Simek
  2 siblings, 1 reply; 8+ messages in thread
From: Jean-Jacques Hiblot @ 2018-04-06  9:13 UTC (permalink / raw)
  To: u-boot

The dwc_ahci has been broken for quite some time now. The breakage has been
introduced by the series "dm: scsi: Enhance SCSI support for driver model"

Use ahci_bind_scsi() and ahci_probe_scsi() to properly bind and probe the
driver.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

 drivers/ata/dwc_ahci.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/ata/dwc_ahci.c b/drivers/ata/dwc_ahci.c
index 029b778..6c7371e 100644
--- a/drivers/ata/dwc_ahci.c
+++ b/drivers/ata/dwc_ahci.c
@@ -25,17 +25,18 @@ struct dwc_ahci_priv {
 	void *wrapper_base;
 };
 
+static int dwc_ahci_bind(struct udevice *dev)
+{
+	struct udevice *scsi_dev;
+
+	return ahci_bind_scsi(dev, &scsi_dev);
+}
+
 static int dwc_ahci_ofdata_to_platdata(struct udevice *dev)
 {
 	struct dwc_ahci_priv *priv = dev_get_priv(dev);
-	struct scsi_platdata *plat = dev_get_uclass_platdata(dev);
 	fdt_addr_t addr;
 
-	plat->max_id = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
-				       "max-id", CONFIG_SYS_SCSI_MAX_SCSI_ID);
-	plat->max_lun = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
-					"max-lun", CONFIG_SYS_SCSI_MAX_LUN);
-
 	priv->base = map_physmem(devfdt_get_addr(dev), sizeof(void *),
 				 MAP_NOCACHE);
 
@@ -81,11 +82,7 @@ static int dwc_ahci_probe(struct udevice *dev)
 		writel(val, priv->wrapper_base + TI_SATA_SYSCONFIG);
 	}
 
-	ret = ahci_init_dm(dev, priv->base);
-	if (ret)
-		return ret;
-
-	return ahci_start_ports_dm(dev);
+	return ahci_probe_scsi(dev, (ulong)priv->base);
 }
 
 static const struct udevice_id dwc_ahci_ids[] = {
@@ -95,11 +92,11 @@ static const struct udevice_id dwc_ahci_ids[] = {
 
 U_BOOT_DRIVER(dwc_ahci) = {
 	.name	= "dwc_ahci",
-	.id	= UCLASS_SCSI,
+	.id	= UCLASS_AHCI,
 	.of_match = dwc_ahci_ids,
+	.bind	= dwc_ahci_bind,
 	.ofdata_to_platdata = dwc_ahci_ofdata_to_platdata,
 	.ops	= &scsi_ops,
 	.probe	= dwc_ahci_probe,
 	.priv_auto_alloc_size = sizeof(struct dwc_ahci_priv),
-	.flags = DM_FLAG_ALLOC_PRIV_DMA,
 };
-- 
2.7.4

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

* [U-Boot] [PATCH v1 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3
  2018-04-06  9:13 [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Jean-Jacques Hiblot
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 1/2] dwc_ahci: Fix breakage Jean-Jacques Hiblot
@ 2018-04-06  9:13 ` Jean-Jacques Hiblot
  2018-04-13 21:08   ` [U-Boot] [U-Boot, v1, " Tom Rini
  2018-04-06 12:00 ` [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Michal Simek
  2 siblings, 1 reply; 8+ messages in thread
From: Jean-Jacques Hiblot @ 2018-04-06  9:13 UTC (permalink / raw)
  To: u-boot

Those options are required to enable support for SATA on DRA7 platforms.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

 configs/dra7xx_evm_defconfig    | 2 ++
 configs/dra7xx_hs_evm_defconfig | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig
index 2b83a0c..1dadbd4 100644
--- a/configs/dra7xx_evm_defconfig
+++ b/configs/dra7xx_evm_defconfig
@@ -9,6 +9,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_ARMV7_LPAE=y
 CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
+CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
@@ -64,6 +65,7 @@ CONFIG_PHYLIB=y
 CONFIG_DM_ETH=y
 CONFIG_PHY_GIGE=y
 CONFIG_SPL_PHY=y
+CONFIG_PIPE3_PHY=y
 CONFIG_PMIC_PALMAS=y
 CONFIG_PMIC_LP873X=y
 CONFIG_DM_REGULATOR_FIXED=y
diff --git a/configs/dra7xx_hs_evm_defconfig b/configs/dra7xx_hs_evm_defconfig
index 5a8129c..61b4f1c 100644
--- a/configs/dra7xx_hs_evm_defconfig
+++ b/configs/dra7xx_hs_evm_defconfig
@@ -13,6 +13,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_ARMV7_LPAE=y
 CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
+CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
@@ -63,6 +64,7 @@ CONFIG_PHYLIB=y
 CONFIG_DM_ETH=y
 CONFIG_PHY_GIGE=y
 CONFIG_SPL_PHY=y
+CONFIG_PIPE3_PHY=y
 CONFIG_PMIC_PALMAS=y
 CONFIG_PMIC_LP873X=y
 CONFIG_DM_REGULATOR_FIXED=y
-- 
2.7.4

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

* [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms
  2018-04-06  9:13 [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Jean-Jacques Hiblot
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 1/2] dwc_ahci: Fix breakage Jean-Jacques Hiblot
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3 Jean-Jacques Hiblot
@ 2018-04-06 12:00 ` Michal Simek
  2018-04-06 13:58   ` Jean-Jacques Hiblot
  2 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2018-04-06 12:00 UTC (permalink / raw)
  To: u-boot

Hi,

On 6.4.2018 11:13, Jean-Jacques Hiblot wrote:
> Enhancements to SCSI support for driver model have broken the support for
> DM_SCSI on DRA7 platforms. This series fixes it.
> 
> Tested on:
> - dra76 evm
> 
> 
> Jean-Jacques Hiblot (2):
>   dwc_ahci: Fix breakage
>   configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3
> 
>  configs/dra7xx_evm_defconfig    |  2 ++
>  configs/dra7xx_hs_evm_defconfig |  2 ++
>  drivers/ata/dwc_ahci.c          | 23 ++++++++++-------------
>  3 files changed, 14 insertions(+), 13 deletions(-)
> 

I have seen similar issue with 2018.01 release but I have just tested it
with sata_ceva.c on latest on zcu102 and I can't see any issue.

Here was my quick hack.
https://github.com/Xilinx/u-boot-xlnx/commit/df365a0d76352c4b675444c660cc4eb53b36d51e

Anyway I have used your patch as source of changes for ceva sata and I
have tested it on the top of latest and also on xilinx v2018.1(+ revert
of my hack) and it is working properly.

Anyway I think that will be good if you can retest driver on the HEAD
and see if there is still an issue. If there is no issue the patch which
fixes this should be identified.

Thanks,
Michal

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

* [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms
  2018-04-06 12:00 ` [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Michal Simek
@ 2018-04-06 13:58   ` Jean-Jacques Hiblot
  2018-04-09  6:19     ` Michal Simek
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Jacques Hiblot @ 2018-04-06 13:58 UTC (permalink / raw)
  To: u-boot



On 06/04/2018 14:00, Michal Simek wrote:
> Hi,
>
> On 6.4.2018 11:13, Jean-Jacques Hiblot wrote:
>> Enhancements to SCSI support for driver model have broken the support for
>> DM_SCSI on DRA7 platforms. This series fixes it.
>>
>> Tested on:
>> - dra76 evm
>>
>>
>> Jean-Jacques Hiblot (2):
>>    dwc_ahci: Fix breakage
>>    configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3
>>
>>   configs/dra7xx_evm_defconfig    |  2 ++
>>   configs/dra7xx_hs_evm_defconfig |  2 ++
>>   drivers/ata/dwc_ahci.c          | 23 ++++++++++-------------
>>   3 files changed, 14 insertions(+), 13 deletions(-)
>>
> I have seen similar issue with 2018.01 release but I have just tested it
> with sata_ceva.c on latest on zcu102 and I can't see any issue.
>
> Here was my quick hack.
> https://github.com/Xilinx/u-boot-xlnx/commit/df365a0d76352c4b675444c660cc4eb53b36d51e
>
> Anyway I have used your patch as source of changes for ceva sata and I
> have tested it on the top of latest and also on xilinx v2018.1(+ revert
> of my hack) and it is working properly.
>
> Anyway I think that will be good if you can retest driver on the HEAD
I'm not sure I understand what you mean by HEAD.
I had tested the disk with commit 
e294ba0678359bc32085c1714329af37e33e8f16 (4th april, so pretty recent), 
it didn't work.
Honestly I haven't tried to understand the reason why it broke, I just 
modified the driver to match was is done in the straightforward PCI driver.

JJ

> and see if there is still an issue. If there is no issue the patch which
> fixes this should be identified.
>
> Thanks,
> Michal
>

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

* [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms
  2018-04-06 13:58   ` Jean-Jacques Hiblot
@ 2018-04-09  6:19     ` Michal Simek
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Simek @ 2018-04-09  6:19 UTC (permalink / raw)
  To: u-boot

On 6.4.2018 15:58, Jean-Jacques Hiblot wrote:
> 
> 
> On 06/04/2018 14:00, Michal Simek wrote:
>> Hi,
>>
>> On 6.4.2018 11:13, Jean-Jacques Hiblot wrote:
>>> Enhancements to SCSI support for driver model have broken the support
>>> for
>>> DM_SCSI on DRA7 platforms. This series fixes it.
>>>
>>> Tested on:
>>> - dra76 evm
>>>
>>>
>>> Jean-Jacques Hiblot (2):
>>>    dwc_ahci: Fix breakage
>>>    configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3
>>>
>>>   configs/dra7xx_evm_defconfig    |  2 ++
>>>   configs/dra7xx_hs_evm_defconfig |  2 ++
>>>   drivers/ata/dwc_ahci.c          | 23 ++++++++++-------------
>>>   3 files changed, 14 insertions(+), 13 deletions(-)
>>>
>> I have seen similar issue with 2018.01 release but I have just tested it
>> with sata_ceva.c on latest on zcu102 and I can't see any issue.
>>
>> Here was my quick hack.
>> https://github.com/Xilinx/u-boot-xlnx/commit/df365a0d76352c4b675444c660cc4eb53b36d51e
>>
>>
>> Anyway I have used your patch as source of changes for ceva sata and I
>> have tested it on the top of latest and also on xilinx v2018.1(+ revert
>> of my hack) and it is working properly.
>>
>> Anyway I think that will be good if you can retest driver on the HEAD
> I'm not sure I understand what you mean by HEAD.
> I had tested the disk with commit
> e294ba0678359bc32085c1714329af37e33e8f16 (4th april, so pretty recent),
> it didn't work.


HEAD - latest u-boot commit in master branch.

> Honestly I haven't tried to understand the reason why it broke, I just
> modified the driver to match was is done in the straightforward PCI driver.

Ok. I get it.

Thanks,
Michal

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

* [U-Boot] [U-Boot,v1,1/2] dwc_ahci: Fix breakage
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 1/2] dwc_ahci: Fix breakage Jean-Jacques Hiblot
@ 2018-04-13 21:08   ` Tom Rini
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Rini @ 2018-04-13 21:08 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 06, 2018 at 11:13:53AM +0200, Jean-Jacques Hiblot wrote:

> The dwc_ahci has been broken for quite some time now. The breakage has been
> introduced by the series "dm: scsi: Enhance SCSI support for driver model"
> 
> Use ahci_bind_scsi() and ahci_probe_scsi() to properly bind and probe the
> driver.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@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: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180413/840ec78e/attachment.sig>

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

* [U-Boot] [U-Boot, v1, 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3
  2018-04-06  9:13 ` [U-Boot] [PATCH v1 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3 Jean-Jacques Hiblot
@ 2018-04-13 21:08   ` Tom Rini
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Rini @ 2018-04-13 21:08 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 06, 2018 at 11:13:54AM +0200, Jean-Jacques Hiblot wrote:

> Those options are required to enable support for SATA on DRA7 platforms.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@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: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180413/79ebaa8b/attachment.sig>

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

end of thread, other threads:[~2018-04-13 21:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06  9:13 [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Jean-Jacques Hiblot
2018-04-06  9:13 ` [U-Boot] [PATCH v1 1/2] dwc_ahci: Fix breakage Jean-Jacques Hiblot
2018-04-13 21:08   ` [U-Boot] [U-Boot,v1,1/2] " Tom Rini
2018-04-06  9:13 ` [U-Boot] [PATCH v1 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3 Jean-Jacques Hiblot
2018-04-13 21:08   ` [U-Boot] [U-Boot, v1, " Tom Rini
2018-04-06 12:00 ` [U-Boot] [PATCH v1 0/2] Fix DM_SCSI on DRA7 platforms Michal Simek
2018-04-06 13:58   ` Jean-Jacques Hiblot
2018-04-09  6:19     ` Michal Simek

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.