[PATCH v2 2/5] configs: Add imx8mm-common header

Tim Harvey tharvey at gateworks.com
Tue Mar 16 16:52:53 CET 2021


On Mon, Mar 15, 2021 at 10:46 AM Jagan Teki <jagan at amarulasolutions.com> wrote:
>
> Move the redundant config item like SPL, memory-related
> across all imx8mm config files in the common config header,
> imx8mm-common.h
>
> Verified the built files, seems almost the same as before.
>
> Cc: Tim Harvey <tharvey at gateworks.com>
> Cc: Adam Ford <aford173 at gmail.com>
> Cc: Peng Fan <peng.fan at nxp.com>
> Cc: Teresa Remmet <t.remmet at phytec.de>
> Cc: Igor Opaniuk <igor.opaniuk at toradex.com>
> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> ---
> Changes for v2:
> - add venice changes
>
>  include/configs/imx8mm-common.h  | 48 ++++++++++++++++++++++++++++++++
>  include/configs/imx8mm_beacon.h  | 48 ++++----------------------------
>  include/configs/imx8mm_evk.h     | 45 ++----------------------------
>  include/configs/imx8mm_venice.h  | 46 ++++--------------------------
>  include/configs/phycore_imx8mm.h | 43 ++--------------------------
>  include/configs/verdin-imx8mm.h  | 42 +++-------------------------
>  6 files changed, 68 insertions(+), 204 deletions(-)
>  create mode 100644 include/configs/imx8mm-common.h
>
> diff --git a/include/configs/imx8mm-common.h b/include/configs/imx8mm-common.h
> new file mode 100644
> index 0000000000..f1afa5c5a9
> --- /dev/null
> +++ b/include/configs/imx8mm-common.h
> @@ -0,0 +1,48 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright (c) 2019 NXP
> + * Copyright (c) 2020 Amarula Solutions(India)
> + */
> +
> +#ifndef __IMX8MM_COMMON_H
> +#define __IMX8MM_COMMON_H
> +
> +#include <linux/sizes.h>
> +#include <asm/arch/imx-regs.h>
> +
> +#ifdef CONFIG_SPL_BUILD
> +#define CONFIG_SPL_MAX_SIZE            (148 * 1024)
> +#define CONFIG_SPL_STACK               0x920000
> +#define CONFIG_SPL_BSS_START_ADDR      0x910000
> +#define CONFIG_SPL_BSS_MAX_SIZE                SZ_8K
> +#define CONFIG_SYS_SPL_MALLOC_START    0x42200000
> +#define CONFIG_SYS_SPL_MALLOC_SIZE     SZ_512K

Jagan,

Seems like a good idea, thanks for your work here!

I ran into an issue with imx8mm-venice due to my FIT image being
larger than 512KiB causing me to bump CONFIG_SYS_SPL_MALLOC_SIZE (I
bumped to 1MiB).

I have a pending patch for that [1] which would collide with this and
I wonder what your feelings are about SYS_SPL_MALLOC_SIZE. When I
started work on imx8mm-venice support the SPL did not use a malloc
buffer for loading the FIT image so I never ran into an issue but that
changed with  commit 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d
buffer for loading images")' and after that I was not able to load my
FIT image. I'm honestly not sure how the other imx8mm boards are not
affected unless they just barely fit with a 512K malloc pool.

I'm not sure what the downside would be to doubling it to 1MiB or even
more and I would be boards using FIT with multiple dtb's would go over
512KiB pretty quickly (as opposed to having to undef and re-define it
per board).

Best regards,

Tim
[1] http://patchwork.ozlabs.org/project/uboot/patch/20210308215236.27722-2-tharvey@gateworks.com/


More information about the U-Boot mailing list