All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH-v2 0/2] Fix several bugs in qemu-mips/64 configurations
@ 2017-04-13  2:42 Kyle Edwards
  2017-04-13  2:42 ` [U-Boot] [PATCH-v2 1/2] mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config Kyle Edwards
  2017-04-13  2:42 ` [U-Boot] [PATCH-v2 2/2] mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN Kyle Edwards
  0 siblings, 2 replies; 5+ messages in thread
From: Kyle Edwards @ 2017-04-13  2:42 UTC (permalink / raw)
  To: u-boot

I recently played around with the qemu-mips/64 configurations, and
encountered several issues. Saving the environment to flash overwrites
the U-Boot code, and the malloc pool isn't big enough for
initr_malloc_bootparams(). This patchset fixes these issues.

Kyle Edwards (2):
  mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config
  mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN

 include/configs/qemu-mips.h   | 5 ++---
 include/configs/qemu-mips64.h | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH-v2 1/2] mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config
  2017-04-13  2:42 [U-Boot] [PATCH-v2 0/2] Fix several bugs in qemu-mips/64 configurations Kyle Edwards
@ 2017-04-13  2:42 ` Kyle Edwards
  2017-04-14 17:35   ` Daniel Schwierzeck
  2017-04-13  2:42 ` [U-Boot] [PATCH-v2 2/2] mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN Kyle Edwards
  1 sibling, 1 reply; 5+ messages in thread
From: Kyle Edwards @ 2017-04-13  2:42 UTC (permalink / raw)
  To: u-boot

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 <kyleedwardsny@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
---
 include/configs/qemu-mips.h   | 3 +--
 include/configs/qemu-mips64.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

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
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH-v2 2/2] mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN
  2017-04-13  2:42 [U-Boot] [PATCH-v2 0/2] Fix several bugs in qemu-mips/64 configurations Kyle Edwards
  2017-04-13  2:42 ` [U-Boot] [PATCH-v2 1/2] mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config Kyle Edwards
@ 2017-04-13  2:42 ` Kyle Edwards
  2017-04-14 17:36   ` Daniel Schwierzeck
  1 sibling, 1 reply; 5+ messages in thread
From: Kyle Edwards @ 2017-04-13  2:42 UTC (permalink / raw)
  To: u-boot

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 <kyleedwardsny@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
---
 include/configs/qemu-mips.h   | 2 +-
 include/configs/qemu-mips64.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH-v2 1/2] mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config
  2017-04-13  2:42 ` [U-Boot] [PATCH-v2 1/2] mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config Kyle Edwards
@ 2017-04-14 17:35   ` Daniel Schwierzeck
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Schwierzeck @ 2017-04-14 17:35 UTC (permalink / raw)
  To: u-boot



Am 13.04.2017 um 04:42 schrieb Kyle Edwards:
> 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 <kyleedwardsny@gmail.com>
> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> ---
>  include/configs/qemu-mips.h   | 3 +--
>  include/configs/qemu-mips64.h | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)

applied to u-boot-mips/master, thanks

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170414/427c6c76/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH-v2 2/2] mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN
  2017-04-13  2:42 ` [U-Boot] [PATCH-v2 2/2] mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN Kyle Edwards
@ 2017-04-14 17:36   ` Daniel Schwierzeck
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Schwierzeck @ 2017-04-14 17:36 UTC (permalink / raw)
  To: u-boot



Am 13.04.2017 um 04:42 schrieb Kyle Edwards:
> 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 <kyleedwardsny@gmail.com>
> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> ---
>  include/configs/qemu-mips.h   | 2 +-
>  include/configs/qemu-mips64.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 

applied to u-boot-mips/master, thanks

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170414/eb84539a/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-14 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13  2:42 [U-Boot] [PATCH-v2 0/2] Fix several bugs in qemu-mips/64 configurations Kyle Edwards
2017-04-13  2:42 ` [U-Boot] [PATCH-v2 1/2] mips: qemu-mips/64: Remove obsolete CONFIG_SYS_MONITOR_LEN from config Kyle Edwards
2017-04-14 17:35   ` Daniel Schwierzeck
2017-04-13  2:42 ` [U-Boot] [PATCH-v2 2/2] mips: qemu-mips/64: Expand malloc pool for CONFIG_SYS_BOOTPARAMS_LEN Kyle Edwards
2017-04-14 17:36   ` Daniel Schwierzeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.