summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-20 21:39:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-20 21:39:02 +0000
commit144ad337741f463b0283875109c1ca7c1628a0f1 (patch)
tree8984b98327af817c41ffc467521f9c699b466bdb /c/src/lib/libbsp
parent2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-144ad337741f463b0283875109c1ca7c1628a0f1.tar.bz2
2008-09-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, include/bsp.h, network_5200/network.c, 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.
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/ChangeLog7
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/Makefile.am2
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/include/bsp.h11
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/network_5200/network.c6
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/start/start.S2
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c50
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c11
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c20
8 files changed, 35 insertions, 74 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog
index b16e3552b6..549483143d 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, include/bsp.h, network_5200/network.c, 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.
diff --git a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
index 7ccab062ea..3ae1ea9324 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
@@ -105,7 +105,7 @@ startup_SOURCES = ../../shared/bootcard.c \
../shared/uboot_dump_bdinfo.c \
../shared/uboot_getenv.c \
startup/bspclean.c \
- startup/bspgetworkarea.c \
+ ../../shared/bspgetworkarea.c \
startup/bspstart.c \
startup/cpuinit.c \
startup/uboot_support.c
diff --git a/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h b/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h
index 43b1d44766..4e3153f28e 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h
@@ -149,8 +149,7 @@ extern "C" {
#define CONFIG_MPC5xxx
#include <u-boot.h>
-extern bd_t *uboot_bdinfo_ptr;
-extern bd_t uboot_bdinfo_copy;
+extern bd_t bsp_uboot_board_info;
#endif
/*
@@ -205,9 +204,9 @@ extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig
/* clock settings */
#if defined(HAS_UBOOT)
-#define IPB_CLOCK (uboot_bdinfo_ptr->bi_ipbfreq)
-#define XLB_CLOCK (uboot_bdinfo_ptr->bi_busfreq)
-#define G2_CLOCK (uboot_bdinfo_ptr->bi_intfreq)
+#define IPB_CLOCK (bsp_uboot_board_info.bi_ipbfreq)
+#define XLB_CLOCK (bsp_uboot_board_info.bi_busfreq)
+#define G2_CLOCK (bsp_uboot_board_info.bi_intfreq)
#else
#define IPB_CLOCK 33000000 /* 33 MHz */
#define XLB_CLOCK 66000000 /* 66 MHz */
@@ -215,7 +214,7 @@ extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig
#endif
#if defined(HAS_UBOOT)
-#define GEN5200_CONSOLE_BAUD (uboot_bdinfo_ptr->bi_baudrate)
+#define GEN5200_CONSOLE_BAUD (bsp_uboot_board_info.bi_baudrate)
#else
#define GEN5200_CONSOLE_BAUD 9600
#endif
diff --git a/c/src/lib/libbsp/powerpc/gen5200/network_5200/network.c b/c/src/lib/libbsp/powerpc/gen5200/network_5200/network.c
index ca8e365d1c..8b4ede4d08 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/network_5200/network.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/network_5200/network.c
@@ -1769,7 +1769,11 @@ int rtems_mpc5200_fec_driver_attach(struct rtems_bsdnet_ifconfig *config)
if ((sc->arpcom.ac_enaddr[0] == 0) &&
(sc->arpcom.ac_enaddr[1] == 0) &&
(sc->arpcom.ac_enaddr[2] == 0)) {
- memcpy((void *)sc->arpcom.ac_enaddr, uboot_bdinfo_ptr->bi_enetaddr, ETHER_ADDR_LEN);
+ memcpy(
+ (void *)sc->arpcom.ac_enaddr,
+ bsp_uboot_board_info.bi_enetaddr,
+ ETHER_ADDR_LEN
+ );
}
#endif
if(config->mtu)
diff --git a/c/src/lib/libbsp/powerpc/gen5200/start/start.S b/c/src/lib/libbsp/powerpc/gen5200/start/start.S
index ff4a916e01..63d12b5cff 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/start/start.S
+++ b/c/src/lib/libbsp/powerpc/gen5200/start/start.S
@@ -167,7 +167,7 @@ start:
#if defined(HAS_UBOOT)
/* store pointer to UBoot bd_info board info structure */
- LWI r31,uboot_bdinfo_ptr
+ LWI r31,bsp_uboot_board_info_ptr
stw r3,0(r31)
#endif /* defined(HAS_UBOOT) */
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c
deleted file mode 100644
index 935088ed06..0000000000
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/bspgetworkarea.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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>
-#include <stdint.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[];
-
-#if defined(HAS_UBOOT)
- extern bd_t *uboot_bdinfo_ptr;
-#endif
-
-/*
- * This method returns the base address and size of the area which
- * is to be allocated between the RTEMS Workspace and the C Program
- * Heap.
- */
-
-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 *) uboot_bdinfo_ptr->bi_memstart +
- uboot_bdinfo_ptr->bi_memsize;
- #else /* HAS_UBOOT */
- char *ram_end = (uintptr_t)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;
-}
-
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
index f9c09824d1..d81133229d 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
@@ -107,8 +107,10 @@
#include <bsp/irq.h>
#if defined(HAS_UBOOT)
-bd_t *uboot_bdinfo_ptr = (bd_t *)1; /* will be overwritten from startup code */
-bd_t uboot_bdinfo_copy; /* will be overwritten with copy of bdinfo */
+/* will be overwritten from startup code */
+bd_t *bsp_uboot_board_info_ptr = (bd_t *)1;
+/* will be overwritten with copy of board information */
+bd_t bsp_uboot_board_info;
#endif
/*
@@ -142,14 +144,13 @@ void bsp_start(void)
myCpuRevision = get_ppc_cpu_revision();
#if defined(HAS_UBOOT)
- uboot_bdinfo_copy = *uboot_bdinfo_ptr;
- uboot_bdinfo_ptr = &uboot_bdinfo_copy;
+ bsp_uboot_board_info = *bsp_uboot_board_info_ptr;
#endif
#if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS)
{
void dumpUBootBDInfo( bd_t * );
- dumpUBootBDInfo( uboot_bdinfo_ptr );
+ dumpUBootBDInfo( bsp_uboot_board_info_ptr );
}
#endif
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c b/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c
index ed78e7d247..a2e988279a 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c
@@ -176,8 +176,8 @@ void cpu_init_bsp(void)
*/
calc_dbat_regvals(
&dbat,
- uboot_bdinfo_ptr->bi_memstart,
- uboot_bdinfo_ptr->bi_memsize,
+ bsp_uboot_board_info.bi_memstart,
+ bsp_uboot_board_info.bi_memsize,
true,
false,
false,
@@ -193,16 +193,16 @@ void cpu_init_bsp(void)
* U-Boot that lies about the starting address of Flash. This check
* corrects that.
*/
- if ((uboot_bdinfo_ptr->bi_flashstart + uboot_bdinfo_ptr->bi_flashsize)
- < uboot_bdinfo_ptr->bi_flashstart) {
- start = 0 - uboot_bdinfo_ptr->bi_flashsize;
+ if ((bsp_uboot_board_info.bi_flashstart + bsp_uboot_board_info.bi_flashsize)
+ < bsp_uboot_board_info.bi_flashstart) {
+ start = 0 - bsp_uboot_board_info.bi_flashsize;
} else {
- start = uboot_bdinfo_ptr->bi_flashstart;
+ start = bsp_uboot_board_info.bi_flashstart;
}
calc_dbat_regvals(
&dbat,
start,
- uboot_bdinfo_ptr->bi_flashsize,
+ bsp_uboot_board_info.bi_flashsize,
true,
false,
false,
@@ -229,11 +229,11 @@ void cpu_init_bsp(void)
/*
* If there is SRAM, program BAT3 for that memory
*/
- if (uboot_bdinfo_ptr->bi_sramsize != 0) {
+ if (bsp_uboot_board_info.bi_sramsize != 0) {
calc_dbat_regvals(
&dbat,
- uboot_bdinfo_ptr->bi_sramstart,
- uboot_bdinfo_ptr->bi_sramsize,
+ bsp_uboot_board_info.bi_sramstart,
+ bsp_uboot_board_info.bi_sramsize,
false,
true,
true,