Author: mcayland
Date: Sun Jan 2 01:06:34 2011
New Revision: 1003
URL: http://tracker.coreboot.org/trac/openbios/changeset/1003
Log:
Add ofmem_init() function to openbios.c taking into account that unlike SPARC64, OFMEM needs to be setup *before* the MMU so
that the page table allocation routines can use it.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Tested-by: Blue Swirl <blauwirbel(a)gmail.com>
Reviewed-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Sun Jan 2 01:06:12 2011 (r1002)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Sun Jan 2 01:06:34 2011 (r1003)
@@ -25,6 +25,7 @@
#include "packages/video.h"
#define NO_QEMU_PROTOS
#include "arch/common/fw_cfg.h"
+#include "libopenbios/ofmem.h"
#define MEMORY_SIZE (16*1024) /* 16K ram for hosted system */
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
@@ -946,6 +947,9 @@
if (!hwdef)
for(;;); // Internal inconsistency, hang
+ /* Make sure we setup OFMEM before the MMU as we need malloc() to setup page tables */
+ ofmem_init();
+
#ifdef CONFIG_DRIVER_SBUS
init_mmu_swift();
#endif
Author: mcayland
Date: Sun Jan 2 01:05:51 2011
New Revision: 999
URL: http://tracker.coreboot.org/trac/openbios/changeset/999
Log:
Reduce memory of the Forth machine to 16k.
Since this memory is only being used by alloc-mem and free-mem then the majority of memory allocations will not actually be
taken from this pool but from the C malloc()/free() implementations instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Tested-by: Blue Swirl <blauwirbel(a)gmail.com>
Reviewed-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/ldscript
trunk/openbios-devel/arch/sparc32/openbios.c
Modified: trunk/openbios-devel/arch/sparc32/ldscript
==============================================================================
--- trunk/openbios-devel/arch/sparc32/ldscript Sun Jan 2 01:05:44 2011 (r998)
+++ trunk/openbios-devel/arch/sparc32/ldscript Sun Jan 2 01:05:51 2011 (r999)
@@ -12,8 +12,8 @@
/* 16KB stack */
STACK_SIZE = 16384;
-/* 256k general alloc + 256k Forth dictionary + 128k Forth memory */
-VMEM_SIZE = (256 + 256 + 128) * 1024;
+/* 256k general alloc + 256k Forth dictionary + 16k Forth memory */
+VMEM_SIZE = (256 + 256 + 16) * 1024;
IOMEM_SIZE = 256 * 1024 + 768 * 1024;
SECTIONS
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Sun Jan 2 01:05:44 2011 (r998)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Sun Jan 2 01:05:51 2011 (r999)
@@ -26,7 +26,7 @@
#define NO_QEMU_PROTOS
#include "arch/common/fw_cfg.h"
-#define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */
+#define MEMORY_SIZE (16*1024) /* 16K ram for hosted system */
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
#define FW_CFG_SUN4M_DEPTH (FW_CFG_ARCH_LOCAL + 0x00)