2008-09-20 Joel Sherrill <joel.sherrill@oarcorp.com>

* bspgetworkarea.c: Augment to optionally know U-Boot.
This commit is contained in:
Joel Sherrill
2008-09-20 21:44:57 +00:00
parent f044f9c20e
commit 2785a80d3e
2 changed files with 27 additions and 7 deletions

View File

@@ -1,3 +1,7 @@
2008-09-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* bspgetworkarea.c: Augment to optionally know U-Boot.
2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* bootcard.c: Perform bsp_start() before bsp_get_work_area().

View File

@@ -19,10 +19,18 @@
/*
* These are provided by the linkcmds for ALL of the BSPs which use this file.
*/
extern char RamBase[];
extern char WorkAreaBase[];
extern char HeapSize[];
extern char RamSize[];
/*
* We may get the size information from U-Boot or the linker scripts.
*/
#ifdef HAS_UBOOT
extern bd_t bsp_uboot_board_info;
#else
extern char RamBase[];
extern char RamSize[];
#endif /* HAS_UBOOT */
/*
* This method returns the base address and size of the area which
@@ -36,9 +44,17 @@ void bsp_get_work_area(
size_t *heap_size
)
{
*work_area_start = WorkAreaBase;
*work_area_size = (uintptr_t) RamBase + (uintptr_t) RamSize -
(uintptr_t) WorkAreaBase;
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
*heap_size = (size_t) HeapSize;
uintptr_t ram_end;
#ifdef HAS_UBOOT
ram_end = (uintptr_t) bsp_uboot_board_info.bi_memstart +
bsp_uboot_board_info.bi_memsize;
#else
ram_end = RamBase + (uintptr_t)RamSize;
#endif
*work_area_start = WorkAreaBase;
*work_area_size = ram_end = (uintptr_t) WorkAreaBase;
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
*heap_size = (size_t) HeapSize;
}