[PATCH 1/4] configs: imx8m: use common imx8m.h for i.MX8MM
Tim Harvey
tharvey at gateworks.com
Tue May 3 17:26:54 CEST 2022
On Tue, May 3, 2022 at 4:39 AM Peng Fan (OSS) <peng.fan at oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan at nxp.com>
>
> Some SPL definitions could be gerneralized, so use imx8m.h for that.
> i.MX8MN/Q/P will follow up.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
> include/configs/imx8m.h | 29 +++++++++++++++++++++
> include/configs/imx8mm-cl-iot-gate.h | 17 ++----------
> include/configs/imx8mm_beacon.h | 21 +--------------
> include/configs/imx8mm_data_modul_edm_sbc.h | 15 +++--------
> include/configs/imx8mm_evk.h | 21 +--------------
> include/configs/imx8mm_icore_mx8mm.h | 20 +-------------
> include/configs/imx8mm_venice.h | 18 ++-----------
> include/configs/kontron-sl-mx8mm.h | 14 +---------
> include/configs/phycore_imx8mm.h | 20 +-------------
> include/configs/verdin-imx8mm.h | 20 +-------------
> 10 files changed, 42 insertions(+), 153 deletions(-)
> create mode 100644 include/configs/imx8m.h
>
> diff --git a/include/configs/imx8m.h b/include/configs/imx8m.h
> new file mode 100644
> index 00000000000..3d4ea834bd0
> --- /dev/null
> +++ b/include/configs/imx8m.h
> @@ -0,0 +1,29 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright 2022 NXP
> + */
> +
> +#ifndef __IMX8MM_H
> +#define __IMX8MM_H
> +
> +#include <linux/sizes.h>
> +#include <linux/stringify.h>
> +#include <asm/arch/imx-regs.h>
> +
> +#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> +#define CONFIG_SYS_MONITOR_LEN SZ_512K
> +#define CONFIG_SYS_UBOOT_BASE \
> + (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> +
> +#ifdef CONFIG_SPL_BUILD
> +#define CONFIG_SPL_STACK 0x920000
> +#define CONFIG_SPL_BSS_START_ADDR 0x910000
> +#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */
> +#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
> +#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
> +
> +/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> +#define CONFIG_MALLOC_F_ADDR 0x930000
> +
> +#endif
> +#endif
> diff --git a/include/configs/imx8mm-cl-iot-gate.h b/include/configs/imx8mm-cl-iot-gate.h
> index e6c220bf0a8..80074a1a2ac 100644
> --- a/include/configs/imx8mm-cl-iot-gate.h
> +++ b/include/configs/imx8mm-cl-iot-gate.h
> @@ -6,28 +6,15 @@
> #ifndef __IMX8MM_CL_IOT_GATE_H
> #define __IMX8MM_CL_IOT_GATE_H
>
> -#include <linux/sizes.h>
> -#include <linux/stringify.h>
> -#include <asm/arch/imx-regs.h>
> +#include <configs/imx8m.h>
> #include <config_distro_bootcmd.h>
>
> #define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
> -#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
>
> #ifdef CONFIG_SPL_BUILD
> -#define CONFIG_SPL_STACK 0x920000
> -#define CONFIG_SPL_BSS_START_ADDR 0x910000
> -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */
> -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
> -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
> -
> +#undef CONFIG_MALLOC_F_ADDR
> /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> #define CONFIG_MALLOC_F_ADDR 0x912000
> -/* For RAW image gives a error info not panic */
> -
> #endif
>
> /* GUIDs for capsule updatable firmware images */
> diff --git a/include/configs/imx8mm_beacon.h b/include/configs/imx8mm_beacon.h
> index a9ca13a9da4..c73188a16f2 100644
> --- a/include/configs/imx8mm_beacon.h
> +++ b/include/configs/imx8mm_beacon.h
> @@ -6,26 +6,7 @@
> #ifndef __IMX8MM_BEACON_H
> #define __IMX8MM_BEACON_H
>
> -#include <linux/sizes.h>
> -#include <asm/arch/imx-regs.h>
> -
> -#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> -
> -#ifdef CONFIG_SPL_BUILD
> -#define CONFIG_SPL_STACK 0x920000
> -#define CONFIG_SPL_BSS_START_ADDR 0x910000
> -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */
> -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
> -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
> -
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -/* For RAW image gives a error info not panic */
> -
> -#endif
> +#include <configs/imx8m.h>
>
> /* Initial environment variables */
> #define CONFIG_EXTRA_ENV_SETTINGS \
> diff --git a/include/configs/imx8mm_data_modul_edm_sbc.h b/include/configs/imx8mm_data_modul_edm_sbc.h
> index b5c445df9ce..48a13dbc7f4 100644
> --- a/include/configs/imx8mm_data_modul_edm_sbc.h
> +++ b/include/configs/imx8mm_data_modul_edm_sbc.h
> @@ -6,26 +6,17 @@
> #ifndef __IMX8MM_DATA_MODUL_EDM_SBC_H
> #define __IMX8MM_DATA_MODUL_EDM_SBC_H
>
> -#include <linux/sizes.h>
> -#include <linux/stringify.h>
> -#include <asm/arch/imx-regs.h>
> +#include <configs/imx8m.h>
>
> #define CONFIG_SYS_BOOTM_LEN SZ_128M
>
> #define CONFIG_SPL_MAX_SIZE (148 * 1024)
> +#undef CONFIG_SYS_MONITOR_LEN
> #define CONFIG_SYS_MONITOR_LEN SZ_1M
>
> -#define CONFIG_SPL_STACK 0x920000
> #ifdef CONFIG_SPL_BUILD
> -#define CONFIG_SPL_BSS_START_ADDR 0x910000
> -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 kiB */
> -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
> +#undef CONFIG_SYS_SPL_MALLOC_SIZE
> #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M /* 16 MiB */
> -
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -
> -/* For RAW image gives a error info not panic */
> -
> #endif
>
> /* Link Definitions */
> diff --git a/include/configs/imx8mm_evk.h b/include/configs/imx8mm_evk.h
> index 98be481fce7..2ec993ccedc 100644
> --- a/include/configs/imx8mm_evk.h
> +++ b/include/configs/imx8mm_evk.h
> @@ -6,28 +6,9 @@
> #ifndef __IMX8MM_EVK_H
> #define __IMX8MM_EVK_H
>
> -#include <linux/sizes.h>
> -#include <linux/stringify.h>
> -#include <asm/arch/imx-regs.h>
> +#include <configs/imx8m.h>
>
> #define CONFIG_SYS_BOOTM_LEN (64 * SZ_1M)
> -#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> -
> -#ifdef CONFIG_SPL_BUILD
> -#define CONFIG_SPL_STACK 0x920000
> -#define CONFIG_SPL_BSS_START_ADDR 0x910000
> -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */
> -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
> -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
> -
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -/* For RAW image gives a error info not panic */
> -
> -#endif
>
> #ifndef CONFIG_SPL_BUILD
> #define BOOT_TARGET_DEVICES(func) \
> diff --git a/include/configs/imx8mm_icore_mx8mm.h b/include/configs/imx8mm_icore_mx8mm.h
> index 34993cafdaf..7d52d43ef13 100644
> --- a/include/configs/imx8mm_icore_mx8mm.h
> +++ b/include/configs/imx8mm_icore_mx8mm.h
> @@ -7,25 +7,7 @@
> #ifndef __IMX8MM_ICORE_MX8MM_H
> #define __IMX8MM_ICORE_MX8MM_H
>
> -#include <linux/sizes.h>
> -#include <asm/arch/imx-regs.h>
> -
> -#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> -
> -#ifdef CONFIG_SPL_BUILD
> -# 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
> -
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -# define CONFIG_MALLOC_F_ADDR 0x930000
> -/* For RAW image gives a error info not panic */
> -#endif /* CONFIG_SPL_BUILD */
> +#include <configs/imx8m.h>
>
> #ifndef CONFIG_SPL_BUILD
> #define BOOT_TARGET_DEVICES(func) \
> diff --git a/include/configs/imx8mm_venice.h b/include/configs/imx8mm_venice.h
> index ba8379db784..8073d1b76b5 100644
> --- a/include/configs/imx8mm_venice.h
> +++ b/include/configs/imx8mm_venice.h
> @@ -6,25 +6,11 @@
> #ifndef __IMX8MM_VENICE_H
> #define __IMX8MM_VENICE_H
>
> -#include <asm/arch/imx-regs.h>
> -#include <linux/sizes.h>
> -
> -#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> +#include <configs/imx8m.h>
>
> #ifdef CONFIG_SPL_BUILD
> -#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
> +#undef CONFIG_SYS_SPL_MALLOC_SIZE
> #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_1M
> -
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -/* For RAW image gives a error info not panic */
> -
> #endif
>
> #define MEM_LAYOUT_ENV_SETTINGS \
> diff --git a/include/configs/kontron-sl-mx8mm.h b/include/configs/kontron-sl-mx8mm.h
> index 20f7f7a74f5..fb2def79f19 100644
> --- a/include/configs/kontron-sl-mx8mm.h
> +++ b/include/configs/kontron-sl-mx8mm.h
> @@ -7,8 +7,7 @@
> #ifndef __KONTRON_MX8MM_CONFIG_H
> #define __KONTRON_MX8MM_CONFIG_H
>
> -#include <asm/arch/imx-regs.h>
> -#include <linux/sizes.h>
> +#include <configs/imx8m.h>
>
> #ifdef CONFIG_SPL_BUILD
> #include <config.h>
> @@ -57,17 +56,6 @@
> #endif
>
> #define CONFIG_SYS_BOOTM_LEN SZ_64M
> -#define CONFIG_SPL_MAX_SIZE (148 * SZ_1K)
> -
> -#ifdef CONFIG_SPL_BUILD
> -#define CONFIG_SPL_STACK 0x91fff0
> -#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
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -#endif
>
> #define FEC_QUIRK_ENET_MAC
>
> diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h
> index b70c31ca633..7fdb429c79a 100644
> --- a/include/configs/phycore_imx8mm.h
> +++ b/include/configs/phycore_imx8mm.h
> @@ -7,27 +7,9 @@
> #ifndef __PHYCORE_IMX8MM_H
> #define __PHYCORE_IMX8MM_H
>
> -#include <linux/sizes.h>
> -#include <linux/stringify.h>
> -#include <asm/arch/imx-regs.h>
> +#include <configs/imx8m.h>
>
> #define CONFIG_SYS_BOOTM_LEN SZ_64M
> -#define CONFIG_SPL_MAX_SIZE (148 * SZ_1K)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> -
> -#ifdef CONFIG_SPL_BUILD
> -#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
> -
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -/* For RAW image gives a error info not panic */
> -#endif
>
> #define CONFIG_EXTRA_ENV_SETTINGS \
> "image=Image\0" \
> diff --git a/include/configs/verdin-imx8mm.h b/include/configs/verdin-imx8mm.h
> index 04959590596..87a80967374 100644
> --- a/include/configs/verdin-imx8mm.h
> +++ b/include/configs/verdin-imx8mm.h
> @@ -6,28 +6,10 @@
> #ifndef __VERDIN_IMX8MM_H
> #define __VERDIN_IMX8MM_H
>
> -#include <asm/arch/imx-regs.h>
> -#include <linux/sizes.h>
> -
> -#define CONFIG_SPL_MAX_SIZE (148 * 1024)
> -#define CONFIG_SYS_MONITOR_LEN SZ_512K
> -#define CONFIG_SYS_UBOOT_BASE \
> - (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
> +#include <configs/imx8m.h>
>
> #define CONFIG_SYS_BOOTM_LEN SZ_64M
>
> -#ifdef CONFIG_SPL_BUILD
> -#define CONFIG_SPL_STACK 0x920000
> -#define CONFIG_SPL_BSS_START_ADDR 0x910000
> -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */
> -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
> -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
> -
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR 0x930000
> -/* For RAW image gives a error info not panic */
> -#endif
> -
> #define MEM_LAYOUT_ENV_SETTINGS \
> "fdt_addr_r=0x44000000\0" \
> "kernel_addr_r=0x42000000\0" \
> --
> 2.36.0
>
Peng,
Great cleanup - thanks! This is a great start to getting rid of the
remaining items in the config headers.
Works great for Venice. I also tested venice with
CONFIG_SYS_SPL_MALLOC_SIZE of SZ_512K and it worked fine so we can
remove the re-define of that, but I will do that as a later patch so
that this patch makes no code changes.
Tested-by: Tim Harvey <tharvey at gateworks.com> #imx8mm-venice-*
More information about the U-Boot
mailing list