From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ED7CC4338F for ; Mon, 2 Aug 2021 20:55:48 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5259060F48 for ; Mon, 2 Aug 2021 20:55:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5259060F48 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CF84833FB; Mon, 2 Aug 2021 22:55:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="h1U4EyxP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FE3082D96; Mon, 2 Aug 2021 22:55:43 +0200 (CEST) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C9CE582D84 for ; Mon, 2 Aug 2021 22:55:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x729.google.com with SMTP id 184so17994292qkh.1 for ; Mon, 02 Aug 2021 13:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=r1qdQBaWF4TxmbVzuh0sGP5tdVI+0wH2N5P/WqYMDfY=; b=h1U4EyxPKBgvHG5S/BmRlApnpmuR84jYVjYScpG1+oCNkbiYXYSpi22PsTjqeTzS/T nrVinpG5AdvOaRcyJjs/hcHlqcypaUn8wNGs++AbpOJ3rBYxN/MP52ko4bntWejl5n6L cGY+RG2Ug9lI378Yds5DKgNayecdYJROD7LG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=r1qdQBaWF4TxmbVzuh0sGP5tdVI+0wH2N5P/WqYMDfY=; b=cG2NPp+vSCBPSc/LH6w9q/EVnG1KnYXPMIr/dqe7XA8VjoICATQ2uJXZU5n1Ekclb7 pRRmXLZPxsRVQbqmk+mufVsBU9Dc6s+1ecT9ewdqBhejXcettv5lDacMfWx5RAqohJey LDJdg1ARLfRwdeYshs9zXY82VrAC5NNAoJrMQdIfRVHlYVaqHtfqmBd0xbHHGX0Wep+v ylzYrZo+wz4yOQbiF7VJ4ySKtqUPm9JuTG0ht8Febw1X6myKZ65LEBgZ7BsX3rxSeyCc 4K66nOrNFMfUXb5ZWofESDJ8I9RRhAnmWmqUk1GiqYsu+SjKhdkZLscbB7vWttB98OX7 aFxw== X-Gm-Message-State: AOAM532gO4PiFMXa9i5cZU3iA4Ez0mtjVGzArbNrGkgWG2X74pZAH6dh ghcMsB5dbWLFhzDSFNvv1rr1AA== X-Google-Smtp-Source: ABdhPJyRpkd5TgIrqECvCt9L1OQCYsxpq8omZNbf5v8zz92ki4FM+U/k6N6Ja5fTc5ZCkmthZwJHtQ== X-Received: by 2002:ae9:f817:: with SMTP id x23mr17000100qkh.103.1627937738556; Mon, 02 Aug 2021 13:55:38 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-a0a3-ef76-0712-405d.res6.spectrum.com. [2603:6081:7b01:cbda:a0a3:ef76:712:405d]) by smtp.gmail.com with ESMTPSA id 6sm6672984qkv.115.2021.08.02.13.55.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Aug 2021 13:55:37 -0700 (PDT) Date: Mon, 2 Aug 2021 16:55:34 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Simon Glass , Stefan Roese , Masami Hiramatsu , Frank Wunderlich , Marek =?iso-8859-1?Q?Beh=FAn?= , u-boot@lists.denx.de Subject: Re: Broken CONFIG_SPL_SATA_SUPPORT=y Message-ID: <20210802205534.GC9379@bill-the-cat> References: <20210801122516.dl6vykk22aumzjfd@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KUzZGiWCrYuJuQi6" Content-Disposition: inline In-Reply-To: <20210801122516.dl6vykk22aumzjfd@pali> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --KUzZGiWCrYuJuQi6 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 01, 2021 at 02:25:16PM +0200, Pali Roh=E1r wrote: > Hello! >=20 > Option CONFIG_SPL_SATA_SUPPORT=3Dy is currently broken in u-boot master > branch. If I try to enable it for A38x platform I'm getting following > compiler error: >=20 > LD spl/u-boot-spl > arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.o: in function `ahci_probe= _scsi_pci': > drivers/ata/ahci.c:1205: undefined reference to `dm_pci_map_bar' > arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.c:1215: undefined referenc= e to `dm_pci_read_config16' > arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.c:1216: undefined referenc= e to `dm_pci_read_config16' > arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.c:1220: undefined referenc= e to `dm_pci_map_bar' > make[1]: *** [scripts/Makefile.spl:512: spl/u-boot-spl] Error 1 > make: *** [Makefile:1977: spl/u-boot-spl] Error 2 >=20 > You can reproduce it by running following commands: >=20 > $ make turris_omnia_defconfig > $ echo CONFIG_SPL_SATA_SUPPORT=3Dy >> .config > $ make CROSS_COMPILE=3Darm-linux-gnueabihf- >=20 > I workaround it by following patch: >=20 > diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c > index d4047c04f5d0..6bad72e4cfa4 100644 > --- a/drivers/ata/ahci.c > +++ b/drivers/ata/ahci.c > @@ -1196,7 +1196,7 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong= base) > return 0; > } > =20 > -#ifdef CONFIG_DM_PCI > +#if CONFIG_IS_ENABLED(DM_PCI) > int ahci_probe_scsi_pci(struct udevice *ahci_dev) > { > ulong base; >=20 > It fixed this particular problem. So it looks like that CONFIG_DM_PCI is > defined also when building SPL even when it is not enabled for SPL. > Whole PCI is disabled in SPL. >=20 > But then I got another compile error: >=20 > LD spl/u-boot-spl > arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci-pci.o: in function `ahci_p= ci_probe': > drivers/ata/ahci-pci.c:21: undefined reference to `ahci_probe_scsi_pci' > make[1]: *** [scripts/Makefile.spl:512: spl/u-boot-spl] Error 1 > make: *** [Makefile:1977: spl/u-boot-spl] Error 2 >=20 > Seems that u-boot is trying to compile and link ahci-pci.o into SPL > binary even when it is not enabled nor used. PCI is completed disabled > in SPL for this case. >=20 > I workaround it by putting whole ahci-pci.c file into one big #idef: >=20 > diff --git a/drivers/ata/ahci-pci.c b/drivers/ata/ahci-pci.c > index b1d231e0f9e1..34afebd2f87f 100644 > --- a/drivers/ata/ahci-pci.c > +++ b/drivers/ata/ahci-pci.c > @@ -9,6 +9,8 @@ > #include > #include > =20 > +#if CONFIG_IS_ENABLED(DM_PCI) > + > static int ahci_pci_bind(struct udevice *dev) > { > struct udevice *scsi_dev; > @@ -42,3 +44,5 @@ static struct pci_device_id ahci_pci_supported[] =3D { > }; > =20 > U_BOOT_PCI_DEVICE(ahci_pci, ahci_pci_supported); > + > +#endif >=20 > And then finally U-Boot produced final target image u-boot-spl.kwb: >=20 > LD spl/u-boot-spl > OBJCOPY spl/u-boot-spl-nodtb.bin > SYM spl/u-boot-spl.sym > CAT spl/u-boot-spl-dtb.bin > COPY spl/u-boot-spl.bin > MKIMAGE u-boot-spl.kwb >=20 > So this looks like a bug in Kconfig or Makefile dependences that build > system is trying to compile and link also files which should not be > linked at all. Yes, it's a missing dependency in Kconfig. You need to enable SPL_DM and then quite possibly SPL_OF_CONTROL (I forget if that was a hard dependency on the main conversion or not) on the platform. --=20 Tom --KUzZGiWCrYuJuQi6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEIW8MACgkQFHw5/5Y0 tyyGMQv+LqoApZlKjLPyDZvORUlv6tb/Fxold8jFHfO0kE9thpqCq8vEPRWZo4cU uamUR9xkFXipYOqAvNl9DYtnJOb4svpA05dhzPljp00McUqzvuRoKUPndCPV48Xl VmFl3j1r7EsuoaRUBrlXWDs1M3wZstNsnqwLEGsbnJ34uUh1N9y05glhFNErphct RBdimE9+lDbcYMhb6WERlGPsZvwZDG8qytoihvGAdk9dBrTCjA2i60w+kSqFaie3 AMnqx54CDZ5s447MXzuAqfFzZ8A+jIFaAgAqmJ2clztpifpaWYPFNcb15rpc9wHB SYgUeLlUIXMUfY34Txz9Kap6lPP1d0dj71LzDlbGgcIXUvVmwbf3dTxs3/8IpUR1 SvFpiJbQLpSHGrWYm7W88hK0L4VpIrgUw/ay63155NrQFZs0L/7533q+mLJERMJE VN0J2YDb9OIvmHpHs+RsqpOdHJQo7RRoNtRG08QUzFDXk/R80RDSCd1+XT0AgH/M 45mO+Z+h =LRUq -----END PGP SIGNATURE----- --KUzZGiWCrYuJuQi6--