mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-26 16:41:42 +00:00
board: stm32mp1: use IS_ENABLED to prevent ifdef in sysconf_init
Use IS_ENABLED to prevent ifdef in sysconf_init. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
parent
feb6179ffe
commit
3434bbe698
1 changed files with 3 additions and 8 deletions
|
@ -428,14 +428,11 @@ static int board_check_usb_power(void)
|
||||||
|
|
||||||
static void sysconf_init(void)
|
static void sysconf_init(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_TFABOOT
|
|
||||||
u8 *syscfg;
|
u8 *syscfg;
|
||||||
#ifdef CONFIG_DM_REGULATOR
|
|
||||||
struct udevice *pwr_dev;
|
struct udevice *pwr_dev;
|
||||||
struct udevice *pwr_reg;
|
struct udevice *pwr_reg;
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
u32 otp = 0;
|
u32 otp = 0;
|
||||||
#endif
|
|
||||||
int ret;
|
int ret;
|
||||||
u32 bootr, val;
|
u32 bootr, val;
|
||||||
|
|
||||||
|
@ -453,7 +450,6 @@ static void sysconf_init(void)
|
||||||
bootr |= (bootr & SYSCFG_BOOTR_BOOT_MASK) << SYSCFG_BOOTR_BOOTPD_SHIFT;
|
bootr |= (bootr & SYSCFG_BOOTR_BOOT_MASK) << SYSCFG_BOOTR_BOOTPD_SHIFT;
|
||||||
writel(bootr, syscfg + SYSCFG_BOOTR);
|
writel(bootr, syscfg + SYSCFG_BOOTR);
|
||||||
|
|
||||||
#ifdef CONFIG_DM_REGULATOR
|
|
||||||
/* High Speed Low Voltage Pad mode Enable for SPI, SDMMC, ETH, QSPI
|
/* High Speed Low Voltage Pad mode Enable for SPI, SDMMC, ETH, QSPI
|
||||||
* and TRACE. Needed above ~50MHz and conditioned by AFMUX selection.
|
* and TRACE. Needed above ~50MHz and conditioned by AFMUX selection.
|
||||||
* The customer will have to disable this for low frequencies
|
* 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,
|
ret = uclass_get_device_by_driver(UCLASS_PMIC,
|
||||||
DM_GET_DRIVER(stm32mp_pwr_pmic),
|
DM_GET_DRIVER(stm32mp_pwr_pmic),
|
||||||
&pwr_dev);
|
&pwr_dev);
|
||||||
if (!ret) {
|
if (!ret && IS_ENABLED(CONFIG_DM_REGULATOR)) {
|
||||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||||
DM_GET_DRIVER(stm32mp_bsec),
|
DM_GET_DRIVER(stm32mp_bsec),
|
||||||
&dev);
|
&dev);
|
||||||
|
@ -507,7 +503,6 @@ static void sysconf_init(void)
|
||||||
debug("VDD unknown");
|
debug("VDD unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* activate automatic I/O compensation
|
/* activate automatic I/O compensation
|
||||||
* warning: need to ensure CSI enabled and ready in clock driver
|
* 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);
|
clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DM_REGULATOR
|
#ifdef CONFIG_DM_REGULATOR
|
||||||
|
@ -647,7 +641,8 @@ int board_init(void)
|
||||||
regulators_enable_boot_on(_DEBUG);
|
regulators_enable_boot_on(_DEBUG);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sysconf_init();
|
if (!IS_ENABLED(CONFIG_TFABOOT))
|
||||||
|
sysconf_init();
|
||||||
|
|
||||||
if (CONFIG_IS_ENABLED(LED))
|
if (CONFIG_IS_ENABLED(LED))
|
||||||
led_default_state();
|
led_default_state();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue