[v2 13/25] spi: cadence_qspi: Migrate CONFIG_CQSPI_REF_CLK to Kconfig

Pratyush Yadav p.yadav at ti.com
Mon Apr 11 21:05:42 CEST 2022


On 08/04/22 10:47AM, Tom Rini wrote:
> On Thu, Mar 31, 2022 at 03:35:26PM -0400, Tom Rini wrote:
> 
> > 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.
> > 
> > Cc: Jagan Teki <jagan at amarulasolutions.com>
> > Signed-off-by: Tom Rini <trini at konsulko.com>
> 
> 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.

Interesting! I remember trying the IS_ENABLED() thing a while back, and 
I remember it working fine when the functions don't exist if the config 
is not enabled. I figured that was because of the compiler eliminating 
dead code. But I think here it is the preprocessor raising the error and 
maybe it is not so smart. Dunno.

Anyway, I am fine with reverting this to v1 for now. I'll try to look at 
it later if I ever get some time to spare.

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.


More information about the U-Boot mailing list