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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3DA9AC433F5 for ; Mon, 11 Apr 2022 19:30:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EAAEC83E47; Mon, 11 Apr 2022 21:30:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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="FoSfbA7b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EDE2283DEF; Mon, 11 Apr 2022 21:30:26 +0200 (CEST) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 2089183E46 for ; Mon, 11 Apr 2022 21:30:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf34.google.com with SMTP id a10so2924470qvm.8 for ; Mon, 11 Apr 2022 12:30:24 -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; bh=K8PoIFUiMTb3Dd5xgnHHvR9LjhYfnw+CiQAdJc8nqm0=; b=FoSfbA7b9nr2X4ytObjtOlsWxUpvlYblkAV0pm2V0ORieCwxbJ53b6oxw7E/UwCh8p dEyeUoY1xvi22RUREQhoNuzIuXaaXIPAhnGo+AjLFKJp6cAELuP3r+KK3J0Tj5TUiH8m U+ZBLxpqoRC6MwBRAPJHg3L3X8mj2RfqQgstU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=K8PoIFUiMTb3Dd5xgnHHvR9LjhYfnw+CiQAdJc8nqm0=; b=aEM4qjl5Er9jXRjHvGLj29BR3tEN091ECX99xqw5Y9D66FT4f+ek5NPHr3DOgk6jQS sKsoBJL7BhEqN7G2GTKKLbgnC1nnJbko3Qz9GaoHfPduUjyfxbxd5XyUX/tPLhxpD9iW LlL37OZVvDyxOrSbQWi6EvCnvNZIzJOH9VTImr7wggz6wS0BLMuWi2txiznD1gmcKgi4 ZU6BcB91hwGJJi6/o8fdm48bV0Prb2arJx+rI6vmVU3UuNXju5eURiRC4B3R/s3gcqXh g/AjUr8YEDct5NRKW4cgvxfdVSe3vnmp+Xxb6dgn8Z0HwlIZVHuZmg2THIPsQRK3Ktyb Q1ug== X-Gm-Message-State: AOAM530YJWnEwIFQMDT6WRIHAAhTwg6+20HJQ/i9hWZUnFZbNFynuVA8 IVaOkstO0krdJEqz9LKneCWIeg== X-Google-Smtp-Source: ABdhPJyQPz59xMTQJUQY/aSyXi5k9lzEpPDVnOLVXiN6An6SUHVMEI3JNM2wb6bMtYXMjjiqNAyaUg== X-Received: by 2002:a05:6214:2a46:b0:444:4c40:5f83 with SMTP id jf6-20020a0562142a4600b004444c405f83mr3344412qvb.121.1649705422927; Mon, 11 Apr 2022 12:30:22 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id e15-20020ac8670f000000b002e22d9c756dsm22784878qtp.30.2022.04.11.12.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 12:30:22 -0700 (PDT) Date: Mon, 11 Apr 2022 15:30:20 -0400 From: Tom Rini To: Pratyush Yadav Cc: u-boot@lists.denx.de, Jagan Teki Subject: Re: [v2 13/25] spi: cadence_qspi: Migrate CONFIG_CQSPI_REF_CLK to Kconfig Message-ID: <20220411193020.GM14282@bill-the-cat> References: <20220330220735.908616-13-trini@konsulko.com> <20220331193526.909109-1-trini@konsulko.com> <20220408144733.GC14282@bill-the-cat> <20220411190542.y4mw5mm4ty3reyut@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2r9at8cGmvB+qaMS" Content-Disposition: inline In-Reply-To: <20220411190542.y4mw5mm4ty3reyut@ti.com> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean --2r9at8cGmvB+qaMS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 12, 2022 at 12:35:42AM +0530, Pratyush Yadav wrote: > On 08/04/22 10:47AM, Tom Rini wrote: > > On Thu, Mar 31, 2022 at 03:35:26PM -0400, Tom Rini wrote: > >=20 > > > This is a little tricky since SoCFPGA has code to determine this as > > > runtime. Introduce a guard variable for platforms to select if they > > > have a static value to use. Then for ARCH_SOCFPGA, call > > > cm_get_qspi_controller_clk_hz() and otherwise continue the previous > > > behavior. > > >=20 > > > Cc: Jagan Teki > > > Signed-off-by: Tom Rini > >=20 > > OK, so there's a problem with using IS_ENABLED(..) which is that we get > > a failure to build in the not-enabled case over CONFIG_CQSPI_REF_CLK > > being unset. And then we can't use if (CONFIG_VAL(..)) because we then > > run in to needing it to exist for SPL as well. I'm going to go back to > > v1 of this particular patch. >=20 > Interesting! I remember trying the IS_ENABLED() thing a while back, and= =20 > I remember it working fine when the functions don't exist if the config= =20 > is not enabled. I figured that was because of the compiler eliminating=20 > dead code. But I think here it is the preprocessor raising the error and= =20 > maybe it is not so smart. Dunno. >=20 > Anyway, I am fine with reverting this to v1 for now. I'll try to look at= =20 > it later if I ever get some time to spare. Right, dead code elimination works fine since it's a reference to function that's never called so we don't fail to link. But if we don't have a static value available, it fails to compile outright. And there wasn't a clean way I could see to use a default of 0 and have it work. But the final part was that it was TI platforms, and I think just 2 others, that even set a static value here and you said TI ones should just not set the value. So I think the next reasonable clean-up might be to just drop the static value case (and cc the board maintainers for the other users), and only support the SoCFPGA one as being special. --=20 Tom --2r9at8cGmvB+qaMS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJUgckACgkQFHw5/5Y0 tyxRwwwAogjTNte+QPyyRuUg9aLfaTngLzvzszhqO/LeDzD/xoTi/Ah6lodWe9Ho 97JcbastNG4r839v501delUXAYcsGdE8tOConJJ4hUgDp/LoB+L0X7A4D6cq0RpW EiuXvPzuFkIabNPM3bWDkcdE5HYqqT2HMOG4pnsdtdxbDEfEbcKnuhHhAApB2mJj 9l6jWq87lWZLkKxxY1pxPnoKRMc4WZeYdj6kDaAkS/AJEwMyPLaUhFLGXuNNIjfl gNemYA1tW+oCBq97gZa6Zf0PX8rygEb4TY+C91B3z4BOcN+znc92EIExZZpyuXrm xkmTwZ1Z34FMvpqc2PzKgrLsgwIpbsCXU10/+bCTsCiuPxVdmJcH9AmUoI2PFG0e YjZ3+FWvYIaCPlhKL9NiRpyaVrJMrw8C4RKmYtZKzRuXMpGAXjfoK2D1UoFnMY4m ZTHx7u5aED+ai1mBeQIByYtj2kVxbyPsvnMNOQTsNGFUC/+sZEFibHk8IiZUWC7O umt+1MM1 =YUSZ -----END PGP SIGNATURE----- --2r9at8cGmvB+qaMS--