public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Pratyush Yadav <p.yadav@ti.com>
Cc: u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH 13/25] spi: cadence_qspi: Migrate CONFIG_CQSPI_REF_CLK to Kconfig
Date: Thu, 31 Mar 2022 13:41:26 -0400	[thread overview]
Message-ID: <20220331174126.GF14476@bill-the-cat> (raw)
In-Reply-To: <20220331163052.av45lnxwutel3ngi@ti.com>

[-- Attachment #1: Type: text/plain, Size: 4477 bytes --]

On Thu, Mar 31, 2022 at 10:00:52PM +0530, Pratyush Yadav wrote:
> +Vignesh
> 
> Hi Tom,
> 
> On 30/03/22 06:07PM, 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@amarulasolutions.com>
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> >  arch/arm/mach-socfpga/misc_soc64.c     | 1 +
> >  configs/j7200_evm_a72_defconfig        | 2 ++
> >  configs/j7200_evm_r5_defconfig         | 2 ++
> >  configs/j721e_evm_a72_defconfig        | 2 ++
> >  configs/j721e_evm_r5_defconfig         | 2 ++
> >  configs/j721e_hs_evm_a72_defconfig     | 2 ++
> >  configs/j721e_hs_evm_r5_defconfig      | 2 ++
> >  configs/j721s2_evm_a72_defconfig       | 2 ++
> >  configs/j721s2_evm_r5_defconfig        | 2 ++
> >  configs/k2g_evm_defconfig              | 2 ++
> >  configs/k2g_hs_evm_defconfig           | 2 ++
> >  configs/stv0991_defconfig              | 2 ++
> >  drivers/spi/Kconfig                    | 8 ++++++++
> >  drivers/spi/cadence_qspi.c             | 4 +++-
> >  drivers/spi/cadence_qspi.h             | 1 +
> >  include/configs/j721e_evm.h            | 1 -
> >  include/configs/j721s2_evm.h           | 1 -
> >  include/configs/k2g_evm.h              | 4 ----
> >  include/configs/socfpga_common.h       | 9 ---------
> >  include/configs/socfpga_soc64_common.h | 5 -----
> >  include/configs/stv0991.h              | 8 --------
> >  21 files changed, 35 insertions(+), 29 deletions(-)
> > 
> > diff --git a/arch/arm/mach-socfpga/misc_soc64.c b/arch/arm/mach-socfpga/misc_soc64.c
> > index 7b973a79e807..2acdfad07b35 100644
> > --- a/arch/arm/mach-socfpga/misc_soc64.c
> > +++ b/arch/arm/mach-socfpga/misc_soc64.c
> > @@ -16,6 +16,7 @@
> >  #include <errno.h>
> >  #include <init.h>
> >  #include <log.h>
> > +#include <mach/clock_manager.h>
> >  
> >  DECLARE_GLOBAL_DATA_PTR;
> >  
> > diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig
> > index eb1d7d46b82a..3d0d1977ff99 100644
> > --- a/configs/j7200_evm_a72_defconfig
> > +++ b/configs/j7200_evm_a72_defconfig
> > @@ -173,6 +173,8 @@ CONFIG_SOC_TI=y
> >  CONFIG_SPI=y
> >  CONFIG_DM_SPI=y
> >  CONFIG_CADENCE_QSPI=y
> > +CONFIG_HAS_CQSPI_REF_CLK=y
> > +CONFIG_CQSPI_REF_CLK=133333333
> >  CONFIG_SYSRESET=y
> >  CONFIG_SPL_SYSRESET=y
> >  CONFIG_SYSRESET_TI_SCI=y
> > diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig
> > index e500a27bb692..0f4b006b80b5 100644
> > --- a/configs/j7200_evm_r5_defconfig
> > +++ b/configs/j7200_evm_r5_defconfig
> > @@ -134,6 +134,8 @@ CONFIG_SOC_TI=y
> >  CONFIG_SPI=y
> >  CONFIG_DM_SPI=y
> >  CONFIG_CADENCE_QSPI=y
> > +CONFIG_HAS_CQSPI_REF_CLK=y
> > +CONFIG_CQSPI_REF_CLK=133333333
> 
> This clock is configured to 166 MHz via device tree. I would prefer TI 
> platforms to use device tree and not set CONFIG_HAS_CQSPI_REF_CLK at 
> all. The clock _is_ 133 MHz by default but I think it is better if we 
> just return an error when clk_get fails.

For these migration patches, it's important to not include functional
changes as the same time in case there's problems later on (see for
example the SYS_IMMR fix I merged today).  So please send a follow-up to
this patch or something vs master to disable the current behavior on the
TI platforms.

> >  CONFIG_SYSRESET=y
> >  CONFIG_SPL_SYSRESET=y
> >  CONFIG_SYSRESET_TI_SCI=y
> [...]
> > diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
> > index db680618ee9b..7209bb43a776 100644
> > --- a/drivers/spi/cadence_qspi.c
> > +++ b/drivers/spi/cadence_qspi.c
> > @@ -188,8 +188,10 @@ static int cadence_spi_probe(struct udevice *bus)
> >  	if (plat->ref_clk_hz == 0) {
> >  		ret = clk_get_by_index(bus, 0, &clk);
> >  		if (ret) {
> > -#ifdef CONFIG_CQSPI_REF_CLK
> > +#ifdef CONFIG_HAS_CQSPI_REF_CLK
> >  			plat->ref_clk_hz = CONFIG_CQSPI_REF_CLK;
> > +#elif defined(CONFIG_ARCH_SOCFPGA)
> > +			plat->ref_clk_hz = cm_get_qspi_controller_clk_hz();
> 
> While you are here, please change all this to use if (IS_ENABLED()) 
> instead.

In this case IS_ENABLED() does not increase readibity of the code nor
increase static code coverage testing.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2022-03-31 17:41 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 22:07 [PATCH 01/25] Convert CONFIG_BOARD_SIZE_LIMIT to Kconfig Tom Rini
2022-03-30 22:07 ` [PATCH 02/25] mvebu: Move BOOTROM_ERR_REG out of CONFIG namespace Tom Rini
2022-03-31  8:58   ` Stefan Roese
2022-04-08 18:02   ` Tom Rini
2022-03-30 22:07 ` [PATCH 03/25] tegra: Migrate CI_UDC_HAS_HOSTPC to Kconfig Tom Rini
2022-04-01 16:21   ` Peter Robinson
2022-04-08 18:02   ` Tom Rini
2022-03-30 22:07 ` [PATCH 04/25] Convert CONFIG_CMDLINE_PS_SUPPORT " Tom Rini
2022-04-08 18:02   ` Tom Rini
2022-03-30 22:07 ` [PATCH 05/25] arm: integrator: Migrate platform-specific options and cleanup armcoremodule.h Tom Rini
2022-04-08 18:02   ` Tom Rini
2022-03-30 22:07 ` [PATCH 06/25] s5p_goni, smdkc100: Move some environment settings out of CONFIG Tom Rini
2022-04-04  4:19   ` Minkyu Kang
2022-04-08 18:02   ` Tom Rini
2022-04-22 12:04   ` Jaehoon Chung
2022-03-30 22:07 ` [PATCH 07/25] MPC837XERDB: Stop using CONFIG_RAMDISKFILE Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 08/25] corvus: Migrate CONFIG_*_LED out of CONFIG namespace Tom Rini
2022-03-31  4:19   ` Heiko Schocher
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 09/25] stm32f429-discovery: " Tom Rini
2022-03-31  7:20   ` Patrice CHOTARD
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 10/25] at91: Remove unused LED code Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 11/25] Convert CONFIG_CONS_SCIF0 et al to Kconfig Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 12/25] Convert CONFIG_SH_SCIF_CLK_FREQ " Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 13/25] spi: cadence_qspi: Migrate CONFIG_CQSPI_REF_CLK " Tom Rini
2022-03-31 16:30   ` Pratyush Yadav
2022-03-31 17:41     ` Tom Rini [this message]
2022-03-31 18:54       ` Pratyush Yadav
2022-03-31 19:35   ` [v2 " Tom Rini
2022-03-31 19:43     ` Pratyush Yadav
2022-04-08 14:47     ` Tom Rini
2022-04-11 19:05       ` Pratyush Yadav
2022-04-11 19:30         ` Tom Rini
2022-04-08 18:05   ` [PATCH " Tom Rini
2022-03-30 22:07 ` [PATCH 14/25] controlcenterdc: Migrate CUSTOMER_BOARD_SUPPORT " Tom Rini
2022-03-31  9:00   ` Stefan Roese
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 15/25] tegra: Drop CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 16/25] microblaze: Migrate DCACHE/ICACHE to Kconfig Tom Rini
2022-03-31  5:42   ` Michal Simek
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 17/25] ls1021atwr: Use DEBUG and not CONFIG_DEBUG Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 18/25] nds32: Migrate CONFIG_DEBUG_LED to Kconfig Tom Rini
2022-04-08 18:03   ` Tom Rini
2022-03-30 22:07 ` [PATCH 19/25] powerpc: mpc83xx: Migrate DEFAULT_IMMR " Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-03-30 22:07 ` [PATCH 20/25] galileo: Remove CONFIG_DESIGNWARE_ETH reference Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-03-30 22:07 ` [PATCH 21/25] Convert CONFIG_DIMM_SLOTS_PER_CTLR to Kconfig Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-03-30 22:07 ` [PATCH 22/25] Convert CONFIG_FSL_QIXIS et al " Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-03-30 22:07 ` [PATCH 23/25] m53menlo: Drop CONFIG_DISCOVER_PHY Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-03-30 22:07 ` [PATCH 24/25] siemens-am33x-common: Drop CONFIG_DMA_COHERENT* Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-03-30 22:07 ` [PATCH 25/25] arm: fsl-layerscape: Migrate more DP-DDR options to Kconfig Tom Rini
2022-04-08 18:04   ` Tom Rini
2022-04-08 18:02 ` [PATCH 01/25] Convert CONFIG_BOARD_SIZE_LIMIT " Tom Rini

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=20220331174126.GF14476@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=jagan@amarulasolutions.com \
    --cc=p.yadav@ti.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox