mx6_common: Fix LOADADDR and SYS_TEXT_BASE for MX6SL and MX6SX
PATCH v2 1/1 mx6_common: Fix LOADADDR and SYS_TEXT_BASE for MX6SL and MX6SX
Commit 8183058188cd2d942 ("imx6: centralise common boot options in mx6_common.h") broke boot on mx6sl and mx6sx by assuming that all mx6 SoCs use the same LOADADDR/SYS_TEXT_BASE range, which is not correct.
DDR on mx6sx/mx6sl starts at 0x80000000.
Adjust LOADADDR/SYS_TEXT_BASE to the proper values for mx6sx/mx6sl, so that these SoCs can boot again.
Also, TQMA6 requires a custom CONFIG_SYS_TEXT_BASE value, so move its setting to mx6_common.h.
---
Build tested only.
Changes since v1:
- Fix build warnings in tqma6
include/configs/mx6_common.h | 20 +++++++++++++++++++- include/configs/tqma6.h | 7 ------- 2 files changed, 19 insertions(+), 8 deletions(-)
include/configs/mx6_common.h +19 -1
@@ -53,11 +53,29 @@#define CONFIG_REVISION_TAG /* Boot options */ + +/* place code in last 4 MiB of RAM on TQMA6 */ +#if defined(CONFIG_TARGET_TQMA6 ) +#if defined(CONFIG_MX6DL ) || defined(CONFIG_MX6S ) +#define CONFIG_SYS_TEXT_BASE 0x2fc00000 +#elif defined(CONFIG_MX6Q ) || defined(CONFIG_MX6D ) +#define CONFIG_SYS_TEXT_BASE 0x4fc00000 +#endif +#endif + +#if (defined(CONFIG_MX6SX ) || defined(CONFIG_MX6SL )) +#define CONFIG_LOADADDR 0x82000000 +#ifndef CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_TEXT_BASE 0x87800000 +#endif +#else #define CONFIG_LOADADDR 0x12000000 -#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR#ifndef CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_TEXT_BASE 0x17800000#endif +#endif +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_BOOTDELAY #define CONFIG_BOOTDELAY 3#endif
include/configs/tqma6.h +0 -7
@@ -118,13 +118,6 @@#define CONFIG_CMD_ITEST #define CONFIG_CMD_SETEXPR -/* place code in last 4 MiB of RAM */ -#if defined(CONFIG_MX6DL ) || defined(CONFIG_MX6S ) -#define CONFIG_SYS_TEXT_BASE 0x2fc00000 -#elif defined(CONFIG_MX6Q ) || defined(CONFIG_MX6D ) -#define CONFIG_SYS_TEXT_BASE 0x4fc00000 -#endif -#define CONFIG_ENV_SIZE (SZ_8K)/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * SZ_1M)
Signature · 1 line
1.9.1
PATCH v2 1/1 mx6_common: Fix LOADADDR and SYS_TEXT_BASE for MX6SL and MX6SX
Hi Fabio,
Quoted 28 lines · Fabio Estevam
Commit
8183058188cd2d942("imx6: centralise common boot options inmx6_common.h") broke boot on mx6sl and mx6sx by assuming that all mx6 SoCs use the same LOADADDR/SYS_TEXT_BASE range, which is not correct.DDR on mx6sx/mx6sl starts at
0x80000000.Adjust LOADADDR/SYS_TEXT_BASE to the proper values for mx6sx/mx6sl, so that these SoCs can boot again.
Also, TQMA6 requires a custom
CONFIG_SYS_TEXT_BASEvalue, so move its setting tomx6_common.h.Signed-off-by Fabio Estevam <[email protected]>---
Build tested only.Changes since v1:
- Fix build warnings in tqma6include/configs/mx6_common.h | 20 +++++++++++++++++++- include/configs/tqma6.h | 7 ------- 2 files changed, 19 insertions(+), 8 deletions(-)include/configs/mx6_common.h +0
-0
include/configs/mx6_common.h line 58
Quoted 6 lines
include/configs/mx6_common.h +3
-0@@ -53,11 +53,29 @@#define CONFIG_REVISION_TAG /* Boot options */ + +/* place code in last 4 MiB of RAM on TQMA6 */ +#if defined(CONFIG_TARGET_TQMA6 )
If we allow to have board specific #ifdef inside mx6_common, I am afraid we will get in ashort time the same mess we tried to order now.
What about moving the include in tqma6.h in a later point, I mean, after CONFIG_SYS_TEXT_BASE is already set ?
mx6_common.h is already well protected and should not redefine something if it is already set.
include/configs/tqma6.h +3 -2
@@ -22,8 +22,6 @@/* #endif */ -#include "mx6_common.h" -#if defined(CONFIG_MX6DL ) || defined(CONFIG_MX6S )#define PHYS_SDRAM_SIZE (512u * SZ_1M)#elif defined(CONFIG_MX6Q ) || defined(CONFIG_MX6D )
@@ -398,6 +396,9 @@* * Now include the baseboard specific configuration */ + +#include "mx6_common.h" +#ifdef CONFIG_MBA6 #include "tqma6_mba6.h"
:
Quoted 33 lines
include/configs/mx6_common.h +16
-1+#if defined(CONFIG_MX6DL ) || defined(CONFIG_MX6S ) +#define CONFIG_SYS_TEXT_BASE 0x2fc00000 +#elif defined(CONFIG_MX6Q ) || defined(CONFIG_MX6D ) +#define CONFIG_SYS_TEXT_BASE 0x4fc00000 +#endif +#endif + +#if (defined(CONFIG_MX6SX ) || defined(CONFIG_MX6SL )) +#define CONFIG_LOADADDR 0x82000000 +#ifndef CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_TEXT_BASE 0x87800000 +#endif +#else #define CONFIG_LOADADDR 0x12000000 -#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR#ifndef CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_TEXT_BASE 0x17800000#endif +#endif +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_BOOTDELAY #define CONFIG_BOOTDELAY 3#endif include/configs/tqma6.h +0
-0@@ -118,13 +118,6 @@#define CONFIG_CMD_ITEST #define CONFIG_CMD_SETEXPR
include/configs/tqma6.h line 123
Quoted 10 lines
include/configs/tqma6.h +0
-7-/* place code in last 4 MiB of RAM */ -#if defined(CONFIG_MX6DL ) || defined(CONFIG_MX6S ) -#define CONFIG_SYS_TEXT_BASE 0x2fc00000 -#elif defined(CONFIG_MX6Q ) || defined(CONFIG_MX6D ) -#define CONFIG_SYS_TEXT_BASE 0x4fc00000 -#endif -#define CONFIG_ENV_SIZE (SZ_8K)/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * SZ_1M)
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================