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

* Makefile.am, include/bsp.h, start/start.S, startup/bspstart.c,
	startup/cpuinit.c: Use top level shared bsp_get_work_area()
	implementation. Augment it to know about U-Boot.
	* startup/bspgetworkarea.c: Removed.
This commit is contained in:
Joel Sherrill
2008-09-20 21:39:53 +00:00
parent 144ad33774
commit f044f9c20e
7 changed files with 26 additions and 75 deletions

View File

@@ -1,3 +1,10 @@
2008-09-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, include/bsp.h, start/start.S, startup/bspstart.c,
startup/cpuinit.c: Use top level shared bsp_get_work_area()
implementation. Augment it to know about U-Boot.
* startup/bspgetworkarea.c: Removed.
2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h: Remove unnecessary boilerplate comments.

View File

@@ -54,7 +54,7 @@ startup_SOURCES = ../../shared/bsplibc.c \
startup/cpuinit.c \
startup/bspstart.c \
startup/bspclean.c \
startup/bspgetworkarea.c \
../../shared/bspgetworkarea.c \
startup/uboot_support.c \
../shared/uboot_getenv.c

View File

@@ -93,8 +93,7 @@ extern "C" {
#include <bsp/u-boot.h>
extern bd_t mpc83xx_uboot_board_info;
extern bd_t bsp_uboot_board_info;
extern const size_t mpc83xx_uboot_board_info_size;
#endif /* HAS_UBOOT */

View File

@@ -59,8 +59,8 @@ start:
#ifdef HAS_UBOOT
.extern mpc83xx_uboot_board_info
.extern mpc83xx_uboot_board_info_size
.extern bsp_uboot_board_info
.extern bsp_uboot_board_info_size
/* Reset time base */
li r0, 0
@@ -68,8 +68,8 @@ start:
mtspr TBWL, r0
/* Copy board info */
LA r6, mpc83xx_uboot_board_info
LW r5, mpc83xx_uboot_board_info_size
LA r6, bsp_uboot_board_info
LW r5, bsp_uboot_board_info_size
mtctr r5
copy_uboot_board_info:

View File

@@ -1,55 +0,0 @@
/**
* @file
*
* @ingroup mpc83xx
*
* @brief Source for BSP startup code.
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <bsp.h>
#include <bsp/bootcard.h>
/*
* 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[];
#ifdef HAS_UBOOT
extern bd_t mpc83xx_uboot_board_info;
#endif /* HAS_UBOOT */
void bsp_get_work_area(
void **work_area_start,
size_t *work_area_size,
void **heap_start,
size_t *heap_size)
{
#ifdef HAS_UBOOT
char *ram_end = (char *) mpc83xx_uboot_board_info.bi_memstart +
mpc83xx_uboot_board_info.bi_memsize;
#else /* HAS_UBOOT */
char *ram_end = RamBase + (uintptr_t)RamSize;
#endif /* HAS_UBOOT */
*work_area_start = bsp_work_area_start;
*work_area_size = ram_end - bsp_work_area_start;
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
*heap_size = HeapSize;
}

View File

@@ -34,10 +34,10 @@
* We want this in the data section, because the startup code clears the BSS
* section after the initialization of the board info.
*/
bd_t mpc83xx_uboot_board_info = { .bi_baudrate = 123 };
bd_t bsp_uboot_board_info = { .bi_baudrate = 123 };
/* Size in words */
const size_t mpc83xx_uboot_board_info_size = (sizeof( bd_t) + 3) / 4;
const size_t bsp_uboot_board_info_size = (sizeof( bd_t) + 3) / 4;
#endif /* HAS_UBOOT */
@@ -122,8 +122,8 @@ void bsp_start( void)
/* Initialize some device driver parameters */
#ifdef HAS_UBOOT
BSP_bus_frequency = mpc83xx_uboot_board_info.bi_busfreq;
bsp_clicks_per_usec = mpc83xx_uboot_board_info.bi_busfreq / 4000000;
BSP_bus_frequency = bsp_uboot_board_info.bi_busfreq;
bsp_clicks_per_usec = bsp_uboot_board_info.bi_busfreq / 4000000;
#else /* HAS_UBOOT */
BSP_bus_frequency = BSP_CLKIN_FRQ * BSP_SYSPLL_MF / BSP_SYSPLL_CKID;
bsp_clicks_per_usec = BSP_bus_frequency / 1000000;

View File

@@ -167,8 +167,8 @@ void cpu_init( void)
calc_dbat_regvals(
&ibat,
#ifdef HAS_UBOOT
mpc83xx_uboot_board_info.bi_memstart,
mpc83xx_uboot_board_info.bi_memsize,
bsp_uboot_board_info.bi_memstart,
bsp_uboot_board_info.bi_memsize,
#else /* HAS_UBOOT */
(uint32_t) bsp_ram_start,
(uint32_t) bsp_ram_size,
@@ -184,8 +184,8 @@ void cpu_init( void)
calc_dbat_regvals(
&ibat,
#ifdef HAS_UBOOT
mpc83xx_uboot_board_info.bi_flashstart,
mpc83xx_uboot_board_info.bi_flashsize,
bsp_uboot_board_info.bi_flashstart,
bsp_uboot_board_info.bi_flashsize,
#else /* HAS_UBOOT */
(uint32_t) bsp_rom_start,
(uint32_t) bsp_rom_size,
@@ -212,8 +212,8 @@ void cpu_init( void)
calc_dbat_regvals(
&dbat,
#ifdef HAS_UBOOT
mpc83xx_uboot_board_info.bi_memstart,
mpc83xx_uboot_board_info.bi_memsize,
bsp_uboot_board_info.bi_memstart,
bsp_uboot_board_info.bi_memsize,
#else /* HAS_UBOOT */
(uint32_t) bsp_ram_start,
(uint32_t) bsp_ram_size,
@@ -229,8 +229,8 @@ void cpu_init( void)
calc_dbat_regvals(
&dbat,
#ifdef HAS_UBOOT
mpc83xx_uboot_board_info.bi_flashstart,
mpc83xx_uboot_board_info.bi_flashsize,
bsp_uboot_board_info.bi_flashstart,
bsp_uboot_board_info.bi_flashsize,
#else /* HAS_UBOOT */
(uint32_t) bsp_rom_start,
(uint32_t) bsp_rom_size,
@@ -246,7 +246,7 @@ void cpu_init( void)
calc_dbat_regvals(
&dbat,
#ifdef HAS_UBOOT
mpc83xx_uboot_board_info.bi_immrbar,
bsp_uboot_board_info.bi_immrbar,
#else /* HAS_UBOOT */
(uint32_t) IMMRBAR,
#endif /* HAS_UBOOT */