Skip to contentSkip to conversation

dm: ahci: Fix dwc_ahci

PATCH New Jean-Jacques Hiblot 2 participants 5 messages Jul 7, 2017 – Jul 11, 2017

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

cover dm: ahci: Fix dwc_ahci

This series applies to u-boot-dm/master. It fixes 2 issues preventing usage of SATA on DRA7/AM57 platforms

The first patch is a simply fix to the Kconfig that allows building the driver again.

The second patch fixes an issue introduced by commit 7278fc4f7256628b ("dm: ahci: Drop use of probe_ent"). The root cause is that the uclass private data is not allocated.

Jean-Jacques Hiblot (2):
pipe3: Fix broken dependency
ahci: dm: Fix memory allocation for uclass private data

 drivers/ata/ahci.c  | 8 +++++++-
 drivers/phy/Kconfig | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 pipe3: Fix broken dependency

ARCH_OMAP2 has been renamed ARCH_OMAP2PLUS in commit a93fbf4a7892 ("ARM: omap2+: rename config to ARCH_OMAP2PLUS and consolidate Kconfig")

---
 drivers/phy/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/Kconfig +2 -2
index a91a694..7841554 100644
@@ -43,7 +43,7 @@ config PHY_SANDBOX
 
 config PIPE3_PHY
 	bool "Support omap's PIPE3 PHY"
-	depends on PHY && ARCH_OMAP2
+	depends on PHY && ARCH_OMAP2PLUS
 	help
 	  Support for the omap PIPE3 phy for sata
 
@@ -52,7 +52,7 @@ config PIPE3_PHY
 
 config SPL_PIPE3_PHY
 	bool "Support omap's PIPE3 PHY in SPL"
-	depends on SPL_PHY && ARCH_OMAP2
+	depends on SPL_PHY && ARCH_OMAP2PLUS
 	help
 	  Support for the omap PIPE3 phy for sata in SPL
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/2 pipe3: Fix broken dependency

Quoted 4 lines · Jean-Jacques Hiblot

ARCH_OMAP2 has been renamed ARCH_OMAP2PLUS in commit a93fbf4a7892 ("ARM: omap2+: rename config to ARCH_OMAP2PLUS and consolidate Kconfig")

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

PATCH 1/2 pipe3: Fix broken dependency

In reply to Jean-Jacques Hiblot
Quoted 5 lines · Jean-Jacques Hiblot

ARCH_OMAP2 has been renamed ARCH_OMAP2PLUS in commit a93fbf4a7892 ("ARM: omap2+: rename config to ARCH_OMAP2PLUS and consolidate Kconfig")

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: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170711/2c6193e0/attachment.sig>
#4 lore raw

PATCH 2/2 ahci: dm: Fix memory allocation for uclass private data

In reply to Jean-Jacques Hiblot

Allocate manually the uclass private data in ahci_init_dm(). Don't do this in the declaration of the scsi uclass driver with .per_device_auto_alloc_size because it is AHCI specific.

---
 drivers/ata/ahci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/ahci.c +7 -1
index 6da412d..1d88472 100644
@@ -1090,7 +1090,13 @@ int ahci_init(void __iomem *base)
 
 int ahci_init_dm(struct udevice *dev, void __iomem *base)
 {
-	struct ahci_uc_priv *uc_priv = dev_get_uclass_priv(dev);
+	struct ahci_uc_priv *uc_priv;
+
+	uc_priv = calloc(1, sizeof(struct ahci_uc_priv));
+	if (!uc_priv)
+		return -ENOMEM;
+
+	dev->uclass_priv = uc_priv;
 
 	return ahci_init_common(uc_priv, base);
 }
Signature · 1 line
1.9.1