public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Nishanth Menon <nm@ti.com>, Neha Francis <n-francis@ti.com>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@google.com>
Cc: Bryan <bb@ti.com>, Praneeth <praneeth@ti.com>,
	Andrew <afd@ti.com>, Robert Nelson <robertcnelson@gmail.com>,
	Vignesh <vigneshr@ti.com>,
	u-boot@lists.denx.de, Jan Kiszka <jan.kiszka@siemens.com>,
	Nishanth Menon <nm@ti.com>
Subject: Re: [PATCH V5 10/17] arm: mach-k3: am625_init: Use IS_ENABLED()
Date: Thu, 24 Aug 2023 10:34:46 +0200	[thread overview]
Message-ID: <87a5ugrg7t.fsf@baylibre.com> (raw)
In-Reply-To: <20230824031101.3460411-11-nm@ti.com>

On mer., août 23, 2023 at 22:10, Nishanth Menon <nm@ti.com> wrote:

> Drop the #ifdeffery and use IS_ENABLED() inline check and let the compiler
> do it's thing.
>
> Signed-off-by: Nishanth Menon <nm@ti.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
> new patch (cleanup before modifying for adding UDA-FS)
>
>  arch/arm/mach-k3/am625_init.c | 35 +++++++++++++++++------------------
>  1 file changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
> index 0e5d44269ebf..165bca6885ef 100644
> --- a/arch/arm/mach-k3/am625_init.c
> +++ b/arch/arm/mach-k3/am625_init.c
> @@ -121,10 +121,10 @@ void board_init_f(ulong dummy)
>  	struct udevice *dev;
>  	int ret;
>  
> -#if defined(CONFIG_CPU_V7R)
> -	setup_k3_mpu_regions();
> -	rtc_erratumi2327_init();
> -#endif
> +	if (IS_ENABLED(CONFIG_CPU_V7R)) {
> +		setup_k3_mpu_regions();
> +		rtc_erratumi2327_init();
> +	}
>  
>  	/*
>  	 * Cannot delay this further as there is a chance that
> @@ -156,29 +156,28 @@ void board_init_f(ulong dummy)
>  
>  	preloader_console_init();
>  
> -#ifdef CONFIG_K3_EARLY_CONS
>  	/*
>  	 * Allow establishing an early console as required for example when
>  	 * doing a UART-based boot. Note that this console may not "survive"
>  	 * through a SYSFW PM-init step and will need a re-init in some way
>  	 * due to changing module clock frequencies.
>  	 */
> -	early_console_init();
> -#endif
> +	if (IS_ENABLED(CONFIG_K3_EARLY_CONS))
> +		early_console_init();
>  
> -#if defined(CONFIG_K3_LOAD_SYSFW)
>  	/*
>  	 * Configure and start up system controller firmware. Provide
>  	 * the U-Boot console init function to the SYSFW post-PM configuration
>  	 * callback hook, effectively switching on (or over) the console
>  	 * output.
>  	 */
> -	ret = is_rom_loaded_sysfw(&bootdata);
> -	if (!ret)
> -		panic("ROM has not loaded TIFS firmware\n");
> +	if (IS_ENABLED(CONFIG_K3_LOAD_SYSFW)) {
> +		ret = is_rom_loaded_sysfw(&bootdata);
> +		if (!ret)
> +			panic("ROM has not loaded TIFS firmware\n");
>  
> -	k3_sysfw_loader(true, NULL, NULL);
> -#endif
> +		k3_sysfw_loader(true, NULL, NULL);
> +	}
>  
>  	/*
>  	 * Force probe of clk_k3 driver here to ensure basic default clock
> @@ -209,11 +208,11 @@ void board_init_f(ulong dummy)
>  		enable_mcu_esm_reset();
>  	}
>  
> -#if defined(CONFIG_K3_AM64_DDRSS)
> -	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> -	if (ret)
> -		panic("DRAM init failed: %d\n", ret);
> -#endif
> +	if (IS_ENABLED(CONFIG_K3_AM64_DDRSS)) {
> +		ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> +		if (ret)
> +			panic("DRAM init failed: %d\n", ret);
> +	}
>  	spl_enable_dcache();
>  }
>  
> -- 
> 2.40.0

  reply	other threads:[~2023-08-24  8:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  3:10 [PATCH V5 00/17] board: ti: Add support for BeaglePlay Nishanth Menon
2023-08-24  3:10 ` [PATCH V5 01/17] include: configs: ti_armv7_common: Add documentation for protected section Nishanth Menon
2023-08-24  8:06   ` Mattijs Korpershoek
2023-08-24  3:10 ` [PATCH V5 02/17] include: configs: am62x_evm: Drop unused SDRAM address Nishanth Menon
2023-08-24  8:13   ` Mattijs Korpershoek
2023-08-24 12:05     ` Nishanth Menon
2023-08-24 13:02       ` Marcel Ziswiler
2023-08-24 16:09         ` Francesco Dolcini
2023-08-24 16:15           ` Francesco Dolcini
2023-08-28 21:56             ` Marcel Ziswiler
2023-08-24  3:10 ` [PATCH V5 03/17] include: configs: am62x_evm: Wrap distroboot with CONFIG_DISTRO_DEFAULTS Nishanth Menon
2023-08-24 14:53   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 04/17] board: ti: am62x: am62x.env: Add explicit boot_targets Nishanth Menon
2023-08-24  3:10 ` [PATCH V5 05/17] configs: am62x_evm_a53_defconfig: Switch to bootstd Nishanth Menon
2023-08-24 14:54   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 06/17] include: configs: am62x_evm: Drop distro_bootcmd usage Nishanth Menon
2023-08-24 14:54   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 07/17] include: env: ti: ti_armv7_common.env: Rename to ti_common.env Nishanth Menon
2023-08-24  8:29   ` Mattijs Korpershoek
2023-08-24 14:55   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 08/17] include: env: ti: ti_common: Add a generic findfdt Nishanth Menon
2023-08-24 15:14   ` Tom Rini
2023-08-24 16:22     ` Nishanth Menon
2023-08-24 16:29       ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 09/17] board: ti: am62x: am62x.env: Use default findfdt Nishanth Menon
2023-08-24 15:14   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 10/17] arm: mach-k3: am625_init: Use IS_ENABLED() Nishanth Menon
2023-08-24  8:34   ` Mattijs Korpershoek [this message]
2023-08-24 15:14   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 11/17] arm: mach-k3: am625_init: Convert rtc_erratumi2327_init to static Nishanth Menon
2023-08-24  8:36   ` Mattijs Korpershoek
2023-08-24 15:14   ` Tom Rini
2023-08-24  3:10 ` [PATCH V5 12/17] configs: am62x_evm*: Enable EMMC_BOOT configuration Nishanth Menon
2023-08-24  3:10 ` [PATCH V5 13/17] arm: mach-k3: am625: Add support for UDA FS Nishanth Menon
2023-08-24  8:39   ` Mattijs Korpershoek
2023-08-24  3:10 ` [PATCH V5 14/17] arm: dts: k3-am625-sk-binman: Add labels for unsigned binary Nishanth Menon
2023-08-24  3:10 ` [PATCH V5 15/17] arm: dts: Add k3-am625-beagleplay Nishanth Menon
2023-08-24  3:11 ` [PATCH V5 16/17] board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file Nishanth Menon
2023-08-24  8:43   ` Mattijs Korpershoek
2023-08-24 21:53   ` [PATCH] board: ti: am62x: beagleplay: Disable semi-functional PSCI reset support Jan Kiszka
2023-08-24 21:58     ` Tom Rini
2023-08-25  1:16       ` Nishanth Menon
2023-08-24  3:11 ` [PATCH V5 17/17] doc: board: ti: Add BeaglePlay documentation Nishanth Menon
2023-08-24  3:31 ` [PATCH V5 00/17] board: ti: Add support for BeaglePlay Nishanth Menon
2023-08-24  8:02 ` Mattijs Korpershoek

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=87a5ugrg7t.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=afd@ti.com \
    --cc=bb@ti.com \
    --cc=jan.kiszka@siemens.com \
    --cc=n-francis@ti.com \
    --cc=nm@ti.com \
    --cc=praneeth@ti.com \
    --cc=robertcnelson@gmail.com \
    --cc=sjg@google.com \
    --cc=trini@konsulko.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