All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] dm: scsi: ahci: fill max_lun and max_id members of scsi_platdata
Date: Fri, 24 Mar 2017 13:24:45 +0100	[thread overview]
Message-ID: <1490358287-15304-6-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1490358287-15304-1-git-send-email-jjhiblot@ti.com>

Those 2 values are required for proper operation of the DM_SCSI version of
scsi_scan().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---
 drivers/block/ahci.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 3fa14a7..3c5359f 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -971,7 +971,9 @@ void scsi_low_level_init(int busdevfunc)
 {
 	int i;
 	u32 linkmap;
-
+#ifdef CONFIG_DM_SCSI
+	struct scsi_platdata *plat = dev_get_platdata(dev);
+#endif
 #ifndef CONFIG_SCSI_AHCI_PLAT
 # if defined(CONFIG_DM_PCI)
 	struct udevice *dev;
@@ -990,6 +992,13 @@ void scsi_low_level_init(int busdevfunc)
 
 	linkmap = probe_ent->link_port_map;
 
+#ifdef CONFIG_DM_SCSI
+	if (plat) {
+		plat->max_lun = 1;
+		plat->max_id = ffs(linkmap);
+	}
+#endif
+
 	for (i = 0; i < CONFIG_SYS_SCSI_MAX_SCSI_ID; i++) {
 		if (((linkmap >> i) & 0x01)) {
 			if (ahci_port_start((u8) i)) {
@@ -1047,6 +1056,7 @@ err_out:
 
 void __weak scsi_init(void)
 {
+	printf("AHCI\n");
 }
 
 #endif
-- 
1.9.1

  parent reply	other threads:[~2017-03-24 12:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 12:24 [U-Boot] [PATCH 0/7] OMAP: Move SATA to use block driver model Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 1/7] arm: omap: sata: move enable sata clocks to enable_basic_clocks() Jean-Jacques Hiblot
2017-04-05 17:43   ` Tom Rini
2017-03-24 12:24 ` [U-Boot] [PATCH 2/7] arm: omap: sata: compile out sata init apis when CONFIG_DM_SCSI is defined Jean-Jacques Hiblot
2017-04-05 17:43   ` Tom Rini
2017-03-24 12:24 ` [U-Boot] [PATCH 3/7] arm: omap-common: sata: prepare driver for DM conversion Jean-Jacques Hiblot
2017-04-01  4:21   ` Simon Glass
2017-04-04 10:34     ` Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 4/7] drivers: block: dwc_ahci: Implement a driver for Synopsys DWC sata device Jean-Jacques Hiblot
2017-03-24 12:24 ` Jean-Jacques Hiblot [this message]
2017-04-01  4:21   ` [U-Boot] [PATCH 5/7] dm: scsi: ahci: fill max_lun and max_id members of scsi_platdata Simon Glass
2017-03-24 12:24 ` [U-Boot] [PATCH 6/7] dm: scsi: fix scan Jean-Jacques Hiblot
2017-04-01  4:22   ` Simon Glass
2017-04-04 10:43     ` Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 7/7] defconfig: dra7xx_evm: enable CONFIG_BLK and disk driver model for SCSI Jean-Jacques Hiblot
2017-04-01  4:22   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490358287-15304-6-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.