[PATCH 1/4] configs: imx8m: use common imx8m.h for i.MX8MM

From: Peng Fan peng.fan@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@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" \

From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MN.
Signed-off-by: Peng Fan peng.fan@nxp.com --- include/configs/imx8m.h | 10 ++++++++++ include/configs/imx8mn_bsh_smm_s2_common.h | 17 +---------------- include/configs/imx8mn_evk.h | 20 +------------------- include/configs/imx8mn_var_som.h | 15 +-------------- include/configs/imx8mn_venice.h | 18 +----------------- 5 files changed, 14 insertions(+), 66 deletions(-)
diff --git a/include/configs/imx8m.h b/include/configs/imx8m.h index 3d4ea834bd0..30dc01221e6 100644 --- a/include/configs/imx8m.h +++ b/include/configs/imx8m.h @@ -16,6 +16,8 @@ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
#ifdef CONFIG_SPL_BUILD + +#ifdef CONFIG_IMX8MM #define CONFIG_SPL_STACK 0x920000 #define CONFIG_SPL_BSS_START_ADDR 0x910000 #define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */ @@ -25,5 +27,13 @@ /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ #define CONFIG_MALLOC_F_ADDR 0x930000
+#elif defined(CONFIG_IMX8MN) +#define CONFIG_SPL_STACK 0x980000 +#define CONFIG_SPL_BSS_START_ADDR 0x950000 +#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 */ + +#endif #endif #endif diff --git a/include/configs/imx8mn_bsh_smm_s2_common.h b/include/configs/imx8mn_bsh_smm_s2_common.h index 57be38d9433..eb210dc597b 100644 --- a/include/configs/imx8mn_bsh_smm_s2_common.h +++ b/include/configs/imx8mn_bsh_smm_s2_common.h @@ -6,25 +6,10 @@ #ifndef __IMX8MN_BSH_SMM_S2_COMMON_H #define __IMX8MN_BSH_SMM_S2_COMMON_H
-#include <linux/sizes.h> -#include <linux/stringify.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
-#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) - -#define CONFIG_SPL_STACK 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K - - - #define MEM_LAYOUT_ENV_SETTINGS \ "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h index c0e9b0e9872..6e21192ea03 100644 --- a/include/configs/imx8mn_evk.h +++ b/include/configs/imx8mn_evk.h @@ -6,28 +6,10 @@ #ifndef __IMX8MN_EVK_H #define __IMX8MN_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 (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 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#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 */ - -/* For RAW image gives a error info not panic */ - -#endif - #ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ diff --git a/include/configs/imx8mn_var_som.h b/include/configs/imx8mn_var_som.h index 6ce60b0d704..fc9c4ca4530 100644 --- a/include/configs/imx8mn_var_som.h +++ b/include/configs/imx8mn_var_som.h @@ -6,23 +6,10 @@ #ifndef __IMX8MN_VAR_SOM_H #define __IMX8MN_VAR_SOM_H
-#include <linux/sizes.h> -#include <linux/stringify.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
-#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) - -#define CONFIG_SPL_STACK 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K - #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \ diff --git a/include/configs/imx8mn_venice.h b/include/configs/imx8mn_venice.h index 6f36440b4f2..0bd407c8e8d 100644 --- a/include/configs/imx8mn_venice.h +++ b/include/configs/imx8mn_venice.h @@ -6,23 +6,7 @@ #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) - -#ifdef CONFIG_SPL_BUILD -#define CONFIG_SPL_STACK 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#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 */ - -/* For RAW image gives a error info not panic */ -#endif +#include <configs/imx8m.h>
#define MEM_LAYOUT_ENV_SETTINGS \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \

On Tue, May 3, 2022 at 4:39 AM Peng Fan (OSS) peng.fan@oss.nxp.com wrote:
From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MN.
Peng,
s/gerneralized/generalized
(looks like that typo is all the patches in your series)
Great cleanup - thanks! This is a great start to getting rid of the remaining items in the config headers.
If you do end up doing a 2nd version you can probably remove the comments on the sizes, for example 'SZ_8K /* 8 KB */'' as I think the comment is not needed.
Works great for imx8mn-venice-*.
Tested-by: Tim Harvey tharvey@gateworks.com #imx8mm-venice-*
Signed-off-by: Peng Fan peng.fan@nxp.com
include/configs/imx8m.h | 10 ++++++++++ include/configs/imx8mn_bsh_smm_s2_common.h | 17 +---------------- include/configs/imx8mn_evk.h | 20 +------------------- include/configs/imx8mn_var_som.h | 15 +-------------- include/configs/imx8mn_venice.h | 18 +----------------- 5 files changed, 14 insertions(+), 66 deletions(-)
diff --git a/include/configs/imx8m.h b/include/configs/imx8m.h index 3d4ea834bd0..30dc01221e6 100644 --- a/include/configs/imx8m.h +++ b/include/configs/imx8m.h @@ -16,6 +16,8 @@ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_IMX8MM #define CONFIG_SPL_STACK 0x920000 #define CONFIG_SPL_BSS_START_ADDR 0x910000 #define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */ @@ -25,5 +27,13 @@ /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ #define CONFIG_MALLOC_F_ADDR 0x930000
+#elif defined(CONFIG_IMX8MN) +#define CONFIG_SPL_STACK 0x980000 +#define CONFIG_SPL_BSS_START_ADDR 0x950000 +#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 */
+#endif #endif #endif diff --git a/include/configs/imx8mn_bsh_smm_s2_common.h b/include/configs/imx8mn_bsh_smm_s2_common.h index 57be38d9433..eb210dc597b 100644 --- a/include/configs/imx8mn_bsh_smm_s2_common.h +++ b/include/configs/imx8mn_bsh_smm_s2_common.h @@ -6,25 +6,10 @@ #ifndef __IMX8MN_BSH_SMM_S2_COMMON_H #define __IMX8MN_BSH_SMM_S2_COMMON_H
-#include <linux/sizes.h> -#include <linux/stringify.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
-#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)
-#define CONFIG_SPL_STACK 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
#define MEM_LAYOUT_ENV_SETTINGS \ "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h index c0e9b0e9872..6e21192ea03 100644 --- a/include/configs/imx8mn_evk.h +++ b/include/configs/imx8mn_evk.h @@ -6,28 +6,10 @@ #ifndef __IMX8MN_EVK_H #define __IMX8MN_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 (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 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#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 */
-/* For RAW image gives a error info not panic */
-#endif
#ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ diff --git a/include/configs/imx8mn_var_som.h b/include/configs/imx8mn_var_som.h index 6ce60b0d704..fc9c4ca4530 100644 --- a/include/configs/imx8mn_var_som.h +++ b/include/configs/imx8mn_var_som.h @@ -6,23 +6,10 @@ #ifndef __IMX8MN_VAR_SOM_H #define __IMX8MN_VAR_SOM_H
-#include <linux/sizes.h> -#include <linux/stringify.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
-#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)
-#define CONFIG_SPL_STACK 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
#define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \ diff --git a/include/configs/imx8mn_venice.h b/include/configs/imx8mn_venice.h index 6f36440b4f2..0bd407c8e8d 100644 --- a/include/configs/imx8mn_venice.h +++ b/include/configs/imx8mn_venice.h @@ -6,23 +6,7 @@ #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)
-#ifdef CONFIG_SPL_BUILD -#define CONFIG_SPL_STACK 0x980000 -#define CONFIG_SPL_BSS_START_ADDR 0x950000 -#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 */
-/* For RAW image gives a error info not panic */ -#endif +#include <configs/imx8m.h>
#define MEM_LAYOUT_ENV_SETTINGS \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ -- 2.36.0

Hi Peng,
On 5/3/22 12:43, Tim Harvey wrote:
On Tue, May 3, 2022 at 4:39 AM Peng Fan (OSS) peng.fan@oss.nxp.com wrote:
From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MN.
Peng,
s/gerneralized/generalized
(looks like that typo is all the patches in your series)
Great cleanup - thanks! This is a great start to getting rid of the remaining items in the config headers.
If you do end up doing a 2nd version you can probably remove the comments on the sizes, for example 'SZ_8K /* 8 KB */'' as I think the comment is not needed.
Works great for imx8mn-venice-*.
Tested-by: Tim Harvey tharvey@gateworks.com #imx8mm-venice-*
Thanks a lot for the cleanup! I agree with Tim's comments, would be worth removing those redundant sizes comments.
Tested on i.MX8MN BSH SMM S2 PRO board. Tested-by: Ariel D'Alessandro ariel.dalessandro@collabora.com
Signed-off-by: Peng Fan peng.fan@nxp.com
include/configs/imx8m.h | 10 ++++++++++ include/configs/imx8mn_bsh_smm_s2_common.h | 17 +---------------- include/configs/imx8mn_evk.h | 20 +------------------- include/configs/imx8mn_var_som.h | 15 +-------------- include/configs/imx8mn_venice.h | 18 +----------------- 5 files changed, 14 insertions(+), 66 deletions(-)
[snip]

Peng,
On 5/4/22 16:30, Ariel D'Alessandro wrote:
Hi Peng,
On 5/3/22 12:43, Tim Harvey wrote:
On Tue, May 3, 2022 at 4:39 AM Peng Fan (OSS) peng.fan@oss.nxp.com wrote:
From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MN.
Peng,
s/gerneralized/generalized
(looks like that typo is all the patches in your series)
Great cleanup - thanks! This is a great start to getting rid of the remaining items in the config headers.
If you do end up doing a 2nd version you can probably remove the comments on the sizes, for example 'SZ_8K /* 8 KB */'' as I think the comment is not needed.
Works great for imx8mn-venice-*.
Tested-by: Tim Harvey tharvey@gateworks.com #imx8mm-venice-*
Thanks a lot for the cleanup! I agree with Tim's comments, would be worth removing those redundant sizes comments.
Tested on i.MX8MN BSH SMM S2 PRO board. Tested-by: Ariel D'Alessandro ariel.dalessandro@collabora.com
Tested on i.MX8MN Variscite Symphony board Tested-by: Ariel D'Alessandro ariel.dalessandro@collabora.com
Signed-off-by: Peng Fan peng.fan@nxp.com
include/configs/imx8m.h | 10 ++++++++++ include/configs/imx8mn_bsh_smm_s2_common.h | 17 +---------------- include/configs/imx8mn_evk.h | 20 +------------------- include/configs/imx8mn_var_som.h | 15 +-------------- include/configs/imx8mn_venice.h | 18 +----------------- 5 files changed, 14 insertions(+), 66 deletions(-)
[snip]

From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MP.
Signed-off-by: Peng Fan peng.fan@nxp.com --- include/configs/imx8m.h | 8 ++++++++ include/configs/imx8mp_evk.h | 17 +---------------- include/configs/imx8mp_rsb3720.h | 16 +--------------- include/configs/imx8mp_venice.h | 18 +----------------- include/configs/phycore_imx8mp.h | 16 +--------------- include/configs/verdin-imx8mp.h | 16 +--------------- 6 files changed, 13 insertions(+), 78 deletions(-)
diff --git a/include/configs/imx8m.h b/include/configs/imx8m.h index 30dc01221e6..b127d0fb847 100644 --- a/include/configs/imx8m.h +++ b/include/configs/imx8m.h @@ -34,6 +34,14 @@ #define CONFIG_SYS_SPL_MALLOC_START 0x42200000 #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
+#elif defined(CONFIG_IMX8MP) +/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ +#define CONFIG_SPL_STACK 0x960000 +#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 +#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ +#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 +#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ + #endif #endif #endif diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h index 55691821f90..60c2d9ee4e4 100644 --- a/include/configs/imx8mp_evk.h +++ b/include/configs/imx8mp_evk.h @@ -6,27 +6,12 @@ #ifndef __IMX8MP_EVK_H #define __IMX8MP_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 (32 * SZ_1M)
-#define CONFIG_SPL_MAX_SIZE (152 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) -#define CONFIG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) - #ifdef CONFIG_SPL_BUILD -/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 -#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ - - #define CONFIG_POWER_PCA9450 - #endif
#if defined(CONFIG_CMD_NET) diff --git a/include/configs/imx8mp_rsb3720.h b/include/configs/imx8mp_rsb3720.h index 7c2babbb0ae..008439915d8 100644 --- a/include/configs/imx8mp_rsb3720.h +++ b/include/configs/imx8mp_rsb3720.h @@ -7,17 +7,11 @@ #ifndef __IMX8MP_RSB3720_H #define __IMX8MP_RSB3720_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 (152 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) -#define CONFIG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) - /* GUIDs for capsule updatable firmware images */ #define IMX8MP_RSB3720A1_4G_FIT_IMAGE_GUID \ EFI_GUID(0xb1251e89, 0x384a, 0x4635, 0xa8, 0x06, \ @@ -28,18 +22,10 @@ 0x5f, 0xd3, 0x6b, 0x9b, 0xe5, 0xb9)
#ifdef CONFIG_SPL_BUILD -#define CONFIG_SPL_STACK 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 -#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ - #define CONFIG_MALLOC_F_ADDR 0x184000 /* malloc f used before \ * GD_FLG_FULL_MALLOC_INIT \ * set \ */ - - #if defined(CONFIG_NAND_BOOT) #define CONFIG_SPL_NAND_MXS #endif diff --git a/include/configs/imx8mp_venice.h b/include/configs/imx8mp_venice.h index 161f2e8d366..0697a48b7ea 100644 --- a/include/configs/imx8mp_venice.h +++ b/include/configs/imx8mp_venice.h @@ -6,23 +6,7 @@ #ifndef __IMX8MP_VENICE_H #define __IMX8MP_VENICE_H
-#include <asm/arch/imx-regs.h> -#include <linux/sizes.h> - -#define CONFIG_SPL_MAX_SIZE (152 * 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 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 -#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ - -/* For RAW image gives a error info not panic */ -#endif +#include <configs/imx8m.h>
#define MEM_LAYOUT_ENV_SETTINGS \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/phycore_imx8mp.h b/include/configs/phycore_imx8mp.h index 95d70bb92d1..eaa91f66bfd 100644 --- a/include/configs/phycore_imx8mp.h +++ b/include/configs/phycore_imx8mp.h @@ -7,26 +7,12 @@ #ifndef __PHYCORE_IMX8MP_H #define __PHYCORE_IMX8MP_H
-#include <linux/sizes.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN SZ_64M
-#define CONFIG_SPL_MAX_SIZE (152 * 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 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x98FC00 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_1K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K - - #define CONFIG_POWER_PCA9450 - #endif
#define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/configs/verdin-imx8mp.h b/include/configs/verdin-imx8mp.h index 4f61a5e0582..941f3a95906 100644 --- a/include/configs/verdin-imx8mp.h +++ b/include/configs/verdin-imx8mp.h @@ -6,25 +6,11 @@ #ifndef __VERDIN_IMX8MP_H #define __VERDIN_IMX8MP_H
-#include <asm/arch/imx-regs.h> -#include <linux/sizes.h> - -#define CONFIG_SPL_MAX_SIZE (152 * 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_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098fc00 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_1K -#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 0x184000 -/* For RAW image gives a error info not panic */
#define CONFIG_POWER_PCA9450

On Tue, May 3, 2022 at 4:39 AM Peng Fan (OSS) peng.fan@oss.nxp.com wrote:
From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MP.
Signed-off-by: Peng Fan peng.fan@nxp.com
include/configs/imx8m.h | 8 ++++++++ include/configs/imx8mp_evk.h | 17 +---------------- include/configs/imx8mp_rsb3720.h | 16 +--------------- include/configs/imx8mp_venice.h | 18 +----------------- include/configs/phycore_imx8mp.h | 16 +--------------- include/configs/verdin-imx8mp.h | 16 +--------------- 6 files changed, 13 insertions(+), 78 deletions(-)
diff --git a/include/configs/imx8m.h b/include/configs/imx8m.h index 30dc01221e6..b127d0fb847 100644 --- a/include/configs/imx8m.h +++ b/include/configs/imx8m.h @@ -34,6 +34,14 @@ #define CONFIG_SYS_SPL_MALLOC_START 0x42200000 #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
+#elif defined(CONFIG_IMX8MP) +/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ +#define CONFIG_SPL_STACK 0x960000 +#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 +#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ +#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 +#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
#endif #endif #endif diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h index 55691821f90..60c2d9ee4e4 100644 --- a/include/configs/imx8mp_evk.h +++ b/include/configs/imx8mp_evk.h @@ -6,27 +6,12 @@ #ifndef __IMX8MP_EVK_H #define __IMX8MP_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 (32 * SZ_1M)
-#define CONFIG_SPL_MAX_SIZE (152 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) -#define CONFIG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
#ifdef CONFIG_SPL_BUILD -/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 -#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
#define CONFIG_POWER_PCA9450
#endif
#if defined(CONFIG_CMD_NET) diff --git a/include/configs/imx8mp_rsb3720.h b/include/configs/imx8mp_rsb3720.h index 7c2babbb0ae..008439915d8 100644 --- a/include/configs/imx8mp_rsb3720.h +++ b/include/configs/imx8mp_rsb3720.h @@ -7,17 +7,11 @@ #ifndef __IMX8MP_RSB3720_H #define __IMX8MP_RSB3720_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 (152 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) -#define CONFIG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
/* GUIDs for capsule updatable firmware images */ #define IMX8MP_RSB3720A1_4G_FIT_IMAGE_GUID \ EFI_GUID(0xb1251e89, 0x384a, 0x4635, 0xa8, 0x06, \ @@ -28,18 +22,10 @@ 0x5f, 0xd3, 0x6b, 0x9b, 0xe5, 0xb9)
#ifdef CONFIG_SPL_BUILD -#define CONFIG_SPL_STACK 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 -#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
#define CONFIG_MALLOC_F_ADDR 0x184000 /* malloc f used before \ * GD_FLG_FULL_MALLOC_INIT \ * set \ */
#if defined(CONFIG_NAND_BOOT) #define CONFIG_SPL_NAND_MXS #endif diff --git a/include/configs/imx8mp_venice.h b/include/configs/imx8mp_venice.h index 161f2e8d366..0697a48b7ea 100644 --- a/include/configs/imx8mp_venice.h +++ b/include/configs/imx8mp_venice.h @@ -6,23 +6,7 @@ #ifndef __IMX8MP_VENICE_H #define __IMX8MP_VENICE_H
-#include <asm/arch/imx-regs.h> -#include <linux/sizes.h>
-#define CONFIG_SPL_MAX_SIZE (152 * 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 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098FC00 -#define CONFIG_SPL_BSS_MAX_SIZE 0x400 /* 1 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
-/* For RAW image gives a error info not panic */ -#endif +#include <configs/imx8m.h>
#define MEM_LAYOUT_ENV_SETTINGS \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/phycore_imx8mp.h b/include/configs/phycore_imx8mp.h index 95d70bb92d1..eaa91f66bfd 100644 --- a/include/configs/phycore_imx8mp.h +++ b/include/configs/phycore_imx8mp.h @@ -7,26 +7,12 @@ #ifndef __PHYCORE_IMX8MP_H #define __PHYCORE_IMX8MP_H
-#include <linux/sizes.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN SZ_64M
-#define CONFIG_SPL_MAX_SIZE (152 * 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 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x98FC00 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_1K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
#define CONFIG_POWER_PCA9450
#endif
#define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/configs/verdin-imx8mp.h b/include/configs/verdin-imx8mp.h index 4f61a5e0582..941f3a95906 100644 --- a/include/configs/verdin-imx8mp.h +++ b/include/configs/verdin-imx8mp.h @@ -6,25 +6,11 @@ #ifndef __VERDIN_IMX8MP_H #define __VERDIN_IMX8MP_H
-#include <asm/arch/imx-regs.h> -#include <linux/sizes.h>
-#define CONFIG_SPL_MAX_SIZE (152 * 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_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x960000 -#define CONFIG_SPL_BSS_START_ADDR 0x0098fc00 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_1K -#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 0x184000 -/* For RAW image gives a error info not panic */
#define CONFIG_POWER_PCA9450
-- 2.36.0
Peng,
Great cleanup - thanks! This is a great start to getting rid of the remaining items in the config headers.
Same comment on the commit typo and eliminating the comments on the sizes.
Works great for imx8mp-venice-*
Tested-by: Tim Harvey tharvey@gateworks.com #imx8mp-venice-*
Best Regards,
Tim

From: Peng Fan peng.fan@nxp.com
Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MQ.
Signed-off-by: Peng Fan peng.fan@nxp.com --- include/configs/imx8m.h | 10 ++++++++++ include/configs/imx8mq_cm.h | 24 +----------------------- include/configs/imx8mq_evk.h | 19 +------------------ include/configs/imx8mq_phanbell.h | 19 ++----------------- include/configs/kontron_pitx_imx8m.h | 19 +------------------ include/configs/pico-imx8mq.h | 20 +------------------- 6 files changed, 16 insertions(+), 95 deletions(-)
diff --git a/include/configs/imx8m.h b/include/configs/imx8m.h index b127d0fb847..dcf6c38a2ce 100644 --- a/include/configs/imx8m.h +++ b/include/configs/imx8m.h @@ -42,6 +42,16 @@ #define CONFIG_SYS_SPL_MALLOC_START 0x42200000 #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */
+#elif defined(CONFIG_IMX8MQ) +/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ +#define CONFIG_SPL_STACK 0x187FF0 +#define CONFIG_SPL_BSS_START_ADDR 0x00180000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x2000 /* 8 KB */ +#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 /* 512 KB */ +#define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 +/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ +#define CONFIG_MALLOC_F_ADDR 0x182000 #endif #endif #endif diff --git a/include/configs/imx8mq_cm.h b/include/configs/imx8mq_cm.h index 34d64f7ae45..016737f0907 100644 --- a/include/configs/imx8mq_cm.h +++ b/include/configs/imx8mq_cm.h @@ -6,32 +6,10 @@ #ifndef __IMX8M_CM_H #define __IMX8M_CM_H
-#include <linux/sizes.h> -#include <linux/stringify.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
-#define CONFIG_SPL_MAX_SIZE (124 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) - -#ifdef CONFIG_SPL_BUILD -#define CONFIG_SPL_STACK 0x187FF0 -#define CONFIG_SPL_BSS_START_ADDR 0x00180000 -#define CONFIG_SPL_BSS_MAX_SIZE 0x2000 /* 8 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 /* 512 KB */ -#define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ - -#endif - -/* ENET Config */ -/* ENET1 */ - #ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) \ diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h index 98257e8ba81..29683480be1 100644 --- a/include/configs/imx8mq_evk.h +++ b/include/configs/imx8mq_evk.h @@ -6,28 +6,11 @@ #ifndef __IMX8M_EVK_H #define __IMX8M_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 (124 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) - #ifdef CONFIG_SPL_BUILD -/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x187FF0 -#define CONFIG_SPL_BSS_START_ADDR 0x00180000 -#define CONFIG_SPL_BSS_MAX_SIZE 0x2000 /* 8 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 /* 512 KB */ -#define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ - #define CONFIG_POWER_PFUZE100 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08 #endif diff --git a/include/configs/imx8mq_phanbell.h b/include/configs/imx8mq_phanbell.h index 19381b6b778..646b384f342 100644 --- a/include/configs/imx8mq_phanbell.h +++ b/include/configs/imx8mq_phanbell.h @@ -6,25 +6,10 @@ #ifndef __IMX8M_PHANBELL_H #define __IMX8M_PHANBELL_H
-#include <linux/sizes.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
+#undef CONFIG_SPL_MAX_SIZE #define CONFIG_SPL_MAX_SIZE (172 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) - -#ifdef CONFIG_SPL_BUILD -/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x187FF0 -#define CONFIG_SPL_BSS_START_ADDR 0x00180000 -#define CONFIG_SPL_BSS_MAX_SIZE 0x2000 /* 8 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 /* 512 KB */ -#define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ -#endif
/* ENET Config */ /* ENET1 */ diff --git a/include/configs/kontron_pitx_imx8m.h b/include/configs/kontron_pitx_imx8m.h index d519935b064..1b8b4671bc5 100644 --- a/include/configs/kontron_pitx_imx8m.h +++ b/include/configs/kontron_pitx_imx8m.h @@ -3,33 +3,16 @@ #ifndef __KONTRON_PITX_IMX8M_H #define __KONTRON_PITX_IMX8M_H
-#include <linux/sizes.h> -#include <linux/stringify.h> -#include <asm/arch/imx-regs.h> +#include <configs/imx8m.h>
#define CONFIG_SYS_BOOTM_LEN (32 * SZ_1M)
-#define CONFIG_SPL_MAX_SIZE (124 * SZ_1K) -#define CONFIG_SYS_MONITOR_LEN (512 * SZ_1K) - /* GUID for capsule updatable firmware image */ #define KONTRON_PITX_IMX8M_FIT_IMAGE_GUID \ EFI_GUID(0xc898e959, 0x5b1f, 0x4e6d, 0x88, 0xe0, \ 0x40, 0xd4, 0x5c, 0xca, 0x13, 0x99)
#ifdef CONFIG_SPL_BUILD -#define CONFIG_SPL_STACK 0x187FF0 -#define CONFIG_SPL_BSS_START_ADDR 0x00180000 -#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K -#define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ - - #define CONFIG_POWER_PFUZE100 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08 #endif diff --git a/include/configs/pico-imx8mq.h b/include/configs/pico-imx8mq.h index 1de54e6431c..691e711855d 100644 --- a/include/configs/pico-imx8mq.h +++ b/include/configs/pico-imx8mq.h @@ -6,25 +6,7 @@ #ifndef __IMX8M_PICOPI_H #define __IMX8M_PICOPI_H
-#include <linux/sizes.h> -#include <asm/arch/imx-regs.h> - -#define CONFIG_SPL_MAX_SIZE (124 * 1024) -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) - -#ifdef CONFIG_SPL_BUILD -/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ -#define CONFIG_SPL_STACK 0x187FF0 -#define CONFIG_SPL_BSS_START_ADDR 0x00180000 -#define CONFIG_SPL_BSS_MAX_SIZE 0x2000 /* 8 KB */ -#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 /* 512 KB */ -#define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ -#endif +#include <configs/imx8m.h>
/* ENET Config */ /* ENET1 */

On Tue, May 3, 2022 at 4:39 AM Peng Fan (OSS) peng.fan@oss.nxp.com wrote:
From: Peng Fan peng.fan@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@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@gateworks.com #imx8mm-venice-*
participants (3)
-
Ariel D'Alessandro
-
Peng Fan (OSS)
-
Tim Harvey