[RFC PATCH v3 5/5] phytec: phycore_imx8mp: override env_get_location in phycore-imx8mp.c
Teresa Remmet
T.Remmet at phytec.de
Tue Jan 4 11:56:20 CET 2022
Hello Tommaso,
thank you for working on this.
Am Samstag, dem 25.12.2021 um 21:25 +0100 schrieb Tommaso Merciai:
> Override env_get_location function at board level, previously dropped
> down from arch/arm/mach-imx/imx8m/soc.c
>
> References:
> - commit 37d3e3bb95d7532e2503f115dd6c6762fd3b0262
>
> Signed-off-by: Tommaso Merciai <tomm.merciai at gmail.com>
> ---
> board/phytec/phycore_imx8mp/phycore-imx8mp.c | 33
> ++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/board/phytec/phycore_imx8mp/phycore-imx8mp.c
> b/board/phytec/phycore_imx8mp/phycore-imx8mp.c
> index a8f0821437..05926eefa3 100644
> --- a/board/phytec/phycore_imx8mp/phycore-imx8mp.c
> +++ b/board/phytec/phycore_imx8mp/phycore-imx8mp.c
> @@ -11,9 +11,42 @@
> #include <asm/mach-imx/boot_mode.h>
> #include <env.h>
> #include <miiphy.h>
> +#include <env_internal.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
> +enum env_location env_get_location(enum env_operation op, int prio)
> +{
> + enum boot_device dev = get_boot_device();
> + enum env_location env_loc = ENVL_UNKNOWN;
> +
> + if (prio)
> + return env_loc;
> +
> + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH) && dev == QSPI_BOOT)
> {
> + env_loc = ENVL_SPI_FLASH;
> + } else if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND) && dev ==
> NAND_BOOT) {
> + env_loc = ENVL_NAND;
For phyCORE-i.MX8MP board code you could just remove the NAND part. As
there is no NAND flash available on the hardware.
Thanks,
Teresa
> + } else if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC)) {
> + switch (dev) {
> + case SD1_BOOT:
> + case SD2_BOOT:
> + case SD3_BOOT:
> + case MMC1_BOOT:
> + case MMC2_BOOT:
> + case MMC3_BOOT:
> + env_loc = ENVL_MMC;
> + break;
> + default:
> + break;
> + }
> + } else if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) {
> + env_loc = ENVL_MMC;
> + }
> +
> + return env_loc;
> +}
> +
> static int setup_fec(void)
> {
> struct iomuxc_gpr_base_regs *gpr =
--
PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz | St.Nr. 266500608, DE
149059855
More information about the U-Boot
mailing list