From: Peng Fan <peng....@nxp.com>

Some SPL definitions could be gerneralized, so use imx8m.h for iMX8MN.

Signed-off-by: Peng Fan <peng....@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

Reply via email to