[PATCH V2 4/4] configs: imx8m: use common imx8m.h for i.MX8MQ

Peng Fan (OSS) peng.fan at oss.nxp.com
Thu May 5 11:10:46 CEST 2022


From: Peng Fan <peng.fan at nxp.com>

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

Signed-off-by: Peng Fan <peng.fan at 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 9dc92f7b2df..7a69493a3b9 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
 
+#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 */
-- 
2.36.0



More information about the U-Boot mailing list