All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [Uboot-stm32] [PATCH 04/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in sysconf_init
Date: Thu, 13 Aug 2020 07:23:02 +0000	[thread overview]
Message-ID: <b6803501-1ff7-066e-e5aa-45957a98c2c0@st.com> (raw)
In-Reply-To: <20200731143152.8812-4-patrick.delaunay@st.com>

Hi Patrick

On 7/31/20 4:31 PM, Patrick Delaunay wrote:
> Use IS_ENABLED to prevent ifdef in sysconf_init.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  board/st/stm32mp1/stm32mp1.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> index 3182f44598..a0a2f9978f 100644
> --- a/board/st/stm32mp1/stm32mp1.c
> +++ b/board/st/stm32mp1/stm32mp1.c
> @@ -428,14 +428,11 @@ static int board_check_usb_power(void)
>  
>  static void sysconf_init(void)
>  {
> -#ifndef CONFIG_TFABOOT
>  	u8 *syscfg;
> -#ifdef CONFIG_DM_REGULATOR
>  	struct udevice *pwr_dev;
>  	struct udevice *pwr_reg;
>  	struct udevice *dev;
>  	u32 otp = 0;
> -#endif
>  	int ret;
>  	u32 bootr, val;
>  
> @@ -453,7 +450,6 @@ static void sysconf_init(void)
>  	bootr |= (bootr & SYSCFG_BOOTR_BOOT_MASK) << SYSCFG_BOOTR_BOOTPD_SHIFT;
>  	writel(bootr, syscfg + SYSCFG_BOOTR);
>  
> -#ifdef CONFIG_DM_REGULATOR
>  	/* High Speed Low Voltage Pad mode Enable for SPI, SDMMC, ETH, QSPI
>  	 * and TRACE. Needed above ~50MHz and conditioned by AFMUX selection.
>  	 * The customer will have to disable this for low frequencies
> @@ -470,7 +466,7 @@ static void sysconf_init(void)
>  	ret = uclass_get_device_by_driver(UCLASS_PMIC,
>  					  DM_GET_DRIVER(stm32mp_pwr_pmic),
>  					  &pwr_dev);
> -	if (!ret) {
> +	if (!ret && IS_ENABLED(CONFIG_DM_REGULATOR)) {
>  		ret = uclass_get_device_by_driver(UCLASS_MISC,
>  						  DM_GET_DRIVER(stm32mp_bsec),
>  						  &dev);
> @@ -507,7 +503,6 @@ static void sysconf_init(void)
>  			debug("VDD unknown");
>  		}
>  	}
> -#endif
>  
>  	/* activate automatic I/O compensation
>  	 * warning: need to ensure CSI enabled and ready in clock driver
> @@ -524,7 +519,6 @@ static void sysconf_init(void)
>  	}
>  
>  	clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL);
> -#endif
>  }
>  
>  #ifdef CONFIG_DM_REGULATOR
> @@ -647,7 +641,8 @@ int board_init(void)
>  	regulators_enable_boot_on(_DEBUG);
>  #endif
>  
> -	sysconf_init();
> +	if (!IS_ENABLED(CONFIG_TFABOOT))
> +		sysconf_init();
>  
>  	if (CONFIG_IS_ENABLED(LED))
>  		led_default_state();

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

Patrice

  reply	other threads:[~2020-08-13  7:23 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 14:31 [PATCH 01/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in board_key_check Patrick Delaunay
2020-07-31 14:31 ` [PATCH 02/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in g_dnl_board_usb_cable_connected Patrick Delaunay
2020-08-13  7:22   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  9:49     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 03/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in board_check_usb_power Patrick Delaunay
2020-08-13  7:22   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  7:22   ` Patrice CHOTARD
2020-08-13  9:49     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 04/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in sysconf_init Patrick Delaunay
2020-08-13  7:23   ` Patrice CHOTARD [this message]
2020-08-13  9:50     ` [Uboot-stm32] " Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 05/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in set_dfu_alt_inf Patrick Delaunay
2020-08-13  7:23   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  9:51     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 06/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in dk2_i2c1_fix Patrick Delaunay
2020-08-13  7:23   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  9:51     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 07/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in board_late_init Patrick Delaunay
2020-08-13  7:24   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  9:52     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 08/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in env functions Patrick Delaunay
2020-08-13  7:24   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  9:53     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 09/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in ft_board_setup Patrick Delaunay
2020-08-13  7:24   ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  9:53     ` Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 10/11] arm: stm32mp: bsec: use IS_ENABLED to prevent ifdef Patrick Delaunay
2020-08-13  7:24   ` Patrice CHOTARD
2020-08-13  9:54     ` [Uboot-stm32] " Patrice CHOTARD
2020-07-31 14:31 ` [PATCH 11/11] arm: stm32mp: stm32prog: " Patrick Delaunay
2020-08-13  7:25   ` Patrice CHOTARD
2020-08-13  9:55     ` [Uboot-stm32] " Patrice CHOTARD
2020-08-13  7:51 ` [Uboot-stm32] [PATCH 01/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in board_key_check Patrice CHOTARD
2020-08-13  9:49   ` Patrice CHOTARD

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=b6803501-1ff7-066e-e5aa-45957a98c2c0@st.com \
    --to=patrice.chotard@st.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.