[PATCH 0/2] ata: fix build failures for SATA w/o SCSI

Trying to compile U-Boot for SATA but wo/o SCSI leads to multiple build failures.
Gitlab CI showed no problems for these patches: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/15763
Heinrich Schuchardt (2): ata: fix requirements for CONFIG_AHCI_PCI ata: don't use SYS_SCSI_MAX_SCSI_ID for SATA
configs/controlcenterdc_defconfig | 1 + configs/highbank_defconfig | 1 + drivers/ata/Kconfig | 9 +++++++++ drivers/ata/ahci.c | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-)

Building with CONFIG_AHCI_PCI=y and CONFIG_SCSI_AHCI=n leads to
drivers/ata/ahci-pci.o: in function `ahci_pci_probe': drivers/ata/ahci-pci.c:21: undefined reference to `ahci_probe_scsi_pci'
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 3fe53d6d4f..2ab502c260 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -37,6 +37,7 @@ config AHCI_PCI bool "Support for PCI-based AHCI controller" depends on PCI depends on DM_SCSI + depends on SCSI_AHCI help Enables support for the PCI-based AHCI controller.

On Mon, 27 Mar 2023 at 05:58, Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
Building with CONFIG_AHCI_PCI=y and CONFIG_SCSI_AHCI=n leads to
drivers/ata/ahci-pci.o: in function `ahci_pci_probe': drivers/ata/ahci-pci.c:21: undefined reference to `ahci_probe_scsi_pci'
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Simon Glass sjg@chromium.org

On Sun, Mar 26, 2023 at 06:58:25PM +0200, Heinrich Schuchardt wrote:
Building with CONFIG_AHCI_PCI=y and CONFIG_SCSI_AHCI=n leads to
drivers/ata/ahci-pci.o: in function `ahci_pci_probe': drivers/ata/ahci-pci.c:21: undefined reference to `ahci_probe_scsi_pci'
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

CONFIG_SYS_SCSI_MAX_SCSI_ID is not defined if CONFIG_SCSI=n.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- configs/controlcenterdc_defconfig | 1 + configs/highbank_defconfig | 1 + drivers/ata/Kconfig | 8 ++++++++ drivers/ata/ahci.c | 4 ++-- 4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/configs/controlcenterdc_defconfig b/configs/controlcenterdc_defconfig index 9c906edf1e..9940258881 100644 --- a/configs/controlcenterdc_defconfig +++ b/configs/controlcenterdc_defconfig @@ -72,6 +72,7 @@ CONFIG_ARP_TIMEOUT=200 CONFIG_NET_RETRY_COUNT=50 CONFIG_USE_ROOTPATH=y CONFIG_SPL_OF_TRANSLATE=y +CONFIG_SYS_SATA_MAX_PORTS=2 CONFIG_SCSI_AHCI=y CONFIG_DM_PCA953X=y CONFIG_DM_I2C=y diff --git a/configs/highbank_defconfig b/configs/highbank_defconfig index 49339d9a55..f21a0f3d86 100644 --- a/configs/highbank_defconfig +++ b/configs/highbank_defconfig @@ -30,6 +30,7 @@ CONFIG_RESET_TO_RETRY=y CONFIG_MISC_INIT_R=y # CONFIG_CMD_SETEXPR is not set CONFIG_ENV_IS_IN_NVRAM=y +CONFIG_SYS_SATA_MAX_PORTS=5 CONFIG_SCSI_AHCI=y CONFIG_SYS_64BIT_LBA=y CONFIG_BOOTCOUNT_LIMIT=y diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 2ab502c260..049f7efd10 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -20,6 +20,14 @@ config SATA
See also CMD_SATA which provides command-line support.
+config SYS_SATA_MAX_PORTS + int "Maximum supported SATA ports" + depends on SCSI_AHCI && !DM_SCSI + default 1 + help + Sets the maximum number of ports to scan when looking for devices. + Ports from 0 to (this value - 1) are scanned. + config LIBATA bool help diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 272c48b8e5..6998b82aa5 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -211,8 +211,8 @@ static int ahci_host_init(struct ahci_uc_priv *uc_priv) uc_priv->cap, uc_priv->port_map, uc_priv->n_ports);
#if !defined(CONFIG_DM_SCSI) - if (uc_priv->n_ports > CONFIG_SYS_SCSI_MAX_SCSI_ID) - uc_priv->n_ports = CONFIG_SYS_SCSI_MAX_SCSI_ID; + if (uc_priv->n_ports > CONFIG_SYS_SATA_MAX_PORTS) + uc_priv->n_ports = CONFIG_SYS_SATA_MAX_PORTS; #endif
for (i = 0; i < uc_priv->n_ports; i++) {

On Mon, 27 Mar 2023 at 05:58, Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
CONFIG_SYS_SCSI_MAX_SCSI_ID is not defined if CONFIG_SCSI=n.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
configs/controlcenterdc_defconfig | 1 + configs/highbank_defconfig | 1 + drivers/ata/Kconfig | 8 ++++++++ drivers/ata/ahci.c | 4 ++-- 4 files changed, 12 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Sun, Mar 26, 2023 at 06:58:26PM +0200, Heinrich Schuchardt wrote:
CONFIG_SYS_SCSI_MAX_SCSI_ID is not defined if CONFIG_SCSI=n.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Heinrich Schuchardt
-
Simon Glass
-
Tom Rini