From 9828d050cf5026b27c6acdf615c5161b5a269092 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 12 Apr 2017 22:42:31 -0400 Subject: mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config This fixes an issue with the saveenv command causing U-Boot to no longer work on the QEMU Mips pseudoboard. Because the offset of the environment was being determined by CONFIG_SYS_MONITOR_LEN, and this value was less than the actual size of U-Boot, saveenv was overwriting parts of the U-Boot code. Because CONFIG_SYS_MONITOR_LEN is no longer used on MIPS, this patch removes it and places the environment at the end of the pseudoboard's 4MB flash. Signed-off-by: Kyle Edwards Cc: Daniel Schwierzeck diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index be7f4f2..b67d413 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -102,7 +102,6 @@ */ /* The following #defines are needed to get flash environment right */ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE -#define CONFIG_SYS_MONITOR_LEN (192 << 10) #define CONFIG_SYS_INIT_SP_OFFSET 0x400000 @@ -115,10 +114,10 @@ #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE #define CONFIG_ENV_IS_IN_FLASH -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN) /* Address and size of Primary Environment Sector */ #define CONFIG_ENV_SIZE 0x8000 +#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + (4 << 20) - CONFIG_ENV_SIZE) #define CONFIG_ENV_OVERWRITE 1 diff --git a/include/configs/qemu-mips64.h b/include/configs/qemu-mips64.h index 39afbff..4856087 100644 --- a/include/configs/qemu-mips64.h +++ b/include/configs/qemu-mips64.h @@ -102,7 +102,6 @@ */ /* The following #defines are needed to get flash environment right */ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE -#define CONFIG_SYS_MONITOR_LEN (192 << 10) #define CONFIG_SYS_INIT_SP_OFFSET 0x400000 @@ -115,10 +114,10 @@ #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE #define CONFIG_ENV_IS_IN_FLASH -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN) /* Address and size of Primary Environment Sector */ #define CONFIG_ENV_SIZE 0x8000 +#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + (4 << 20) - CONFIG_ENV_SIZE) #define CONFIG_ENV_OVERWRITE 1 -- cgit v0.10.2 From 1967228b028b5ddf0b0b41806e5bd10e49e836a6 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 12 Apr 2017 22:42:32 -0400 Subject: mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN Before this patch, CONFIG_SYS_BOOTPARAMS_LEN was the same size as CONFIG_SYS_MALLOC_LEN. So, if malloc() had previously been called, and initr_malloc_bootparams() was called, it would fail with an out-of- memory error. This patch fixes this issue by expanding the malloc pool to 256KB. Signed-off-by: Kyle Edwards Cc: Daniel Schwierzeck diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index b67d413..59a793b 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -80,7 +80,7 @@ /* max number of command args */ #define CONFIG_SYS_MAXARGS 16 -#define CONFIG_SYS_MALLOC_LEN 128*1024 +#define CONFIG_SYS_MALLOC_LEN (256 << 10) #define CONFIG_SYS_BOOTPARAMS_LEN 128*1024 diff --git a/include/configs/qemu-mips64.h b/include/configs/qemu-mips64.h index 4856087..28b791a 100644 --- a/include/configs/qemu-mips64.h +++ b/include/configs/qemu-mips64.h @@ -80,7 +80,7 @@ /* max number of command args */ #define CONFIG_SYS_MAXARGS 16 -#define CONFIG_SYS_MALLOC_LEN 128*1024 +#define CONFIG_SYS_MALLOC_LEN (256 << 10) #define CONFIG_SYS_BOOTPARAMS_LEN 128*1024 -- cgit v0.10.2