summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/ChangeLog9
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/Makefile.am9
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h12
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/include/tsec-config.h28
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/include/u-boot-config.h23
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/network/network.c18
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/preinstall.am22
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/start/start.S25
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c14
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/startup/cpuinit.c1
10 files changed, 104 insertions, 57 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog b/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
index c987ec10c6..fa9cb3f0f3 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * include/u-boot.h: Removed file.
+ * include/u-boot-config.h, include/tsec-config.h: New files.
+ * include/bsp.h, start/start.S, startup/bspstart.c: Use new U-Boot
+ support.
+ * network/network.c: Update for API changes.
+ * Makefile.am, preinstall.am: Reflect changes above.
+
2010-11-12 Sebastian Huber <sebastian.huber@embedded-brains.de>
* console/console.h, console/console.c, console/config.c,
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
index cbb6e265bf..6a5bb11124 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
@@ -57,7 +57,7 @@ libbsp_a_SOURCES += ../../shared/bsplibc.c \
../../shared/bspclean.c \
startup/bspreset.c \
../../shared/bspgetworkarea.c \
- startup/uboot_support.c \
+ ../../shared/src/bsp-uboot-board-info.c \
../shared/uboot_getenv.c
# clock
@@ -66,9 +66,12 @@ libbsp_a_SOURCES += ../shared/clock/clock.c
include_bsp_HEADERS = include/irq.h \
../../shared/include/irq-generic.h \
../../shared/include/irq-info.h \
+ ../../shared/include/u-boot.h \
+ ../shared/include/u-boot-board-info.h \
+ ../shared/include/tictac.h \
include/hwreg_vals.h \
- ../shared/include/u-boot.h \
- ../shared/include/tictac.h
+ include/tsec-config.h \
+ include/u-boot-config.h
# irq
libbsp_a_SOURCES += irq/irq.c \
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h b/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h
index 971d7c71b6..781039eb69 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h
@@ -72,18 +72,6 @@ extern "C" {
#include <bsp/vectors.h>
#include <bsp/irq.h>
-#ifdef HAS_UBOOT
- #ifdef MPC8313ERDB
- #define CONFIG_MPC83XX
- #define CONFIG_HAS_ETH1
- #endif
-
- #include <bsp/u-boot.h>
-
- extern bd_t bsp_uboot_board_info;
- extern const size_t bsp_uboot_board_info_size;
-#endif
-
/*
* indicate, that BSP has no IDE driver
*/
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/include/tsec-config.h b/c/src/lib/libbsp/powerpc/gen83xx/include/tsec-config.h
new file mode 100644
index 0000000000..4dad6fd158
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/gen83xx/include/tsec-config.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 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.
+ */
+
+#ifndef LIBBSP_POWERPC_GEN83XX_TSEC_CONFIG_H
+#define LIBBSP_POWERPC_GEN83XX_TSEC_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define TSEC_COUNT 2
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_POWERPC_GEN83XX_TSEC_CONFIG_H */
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/include/u-boot-config.h b/c/src/lib/libbsp/powerpc/gen83xx/include/u-boot-config.h
new file mode 100644
index 0000000000..2e92df68e5
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/gen83xx/include/u-boot-config.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 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$
+ */
+
+#ifndef LIBBSP_POWERPC_GEN83XX_U_BOOT_CONFIG_H
+#define LIBBSP_POWERPC_GEN83XX_U_BOOT_CONFIG_H
+
+#define CONFIG_MPC83xx
+#define CONFIG_HAS_ETH1
+
+#endif /* LIBBSP_POWERPC_GEN83XX_U_BOOT_CONFIG_H */
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/network/network.c b/c/src/lib/libbsp/powerpc/gen83xx/network/network.c
index 272bfad587..fce060b3af 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/network/network.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/network/network.c
@@ -22,7 +22,8 @@
#include <rtems/rtems_bsdnet.h>
#include <rtems/rtems_bsdnet_internal.h>
#include <bsp.h>
-#include <mpc83xx/tsec.h>
+#include <bsp/tsec.h>
+#include <bsp/u-boot.h>
#include <mpc83xx/mpc83xx.h>
#include <stdio.h>
@@ -67,11 +68,12 @@ int BSP_tsec_attach
\*=========================================================================*/
{
int unitNumber;
+ char *unitName;
/*
* Parse driver name
*/
- if((unitNumber = rtems_bsdnet_parse_driver_name(config, NULL)) < 0) {
+ if((unitNumber = rtems_bsdnet_parse_driver_name(config, &unitName)) < 0) {
return 0;
}
if (attaching) {
@@ -181,8 +183,12 @@ int BSP_tsec_attach
/*
* call attach function of board independent driver
*/
- if (0 == rtems_mpc83xx_tsec_driver_attach_detach(config,attaching)) {
- return 0;
- }
- return 1;
+ return tsec_driver_attach_detach(
+ config,
+ unitNumber,
+ unitName,
+ &mpc83xx.tsec [unitNumber - 1],
+ &mpc83xx.tsec [0],
+ attaching
+ );
}
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am b/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am
index d612d00b6e..31438ab737 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am
@@ -101,15 +101,27 @@ $(PROJECT_INCLUDE)/bsp/irq-info.h: ../../shared/include/irq-info.h $(PROJECT_INC
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-info.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-info.h
-$(PROJECT_INCLUDE)/bsp/hwreg_vals.h: include/hwreg_vals.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/hwreg_vals.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/hwreg_vals.h
-
-$(PROJECT_INCLUDE)/bsp/u-boot.h: ../shared/include/u-boot.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+$(PROJECT_INCLUDE)/bsp/u-boot.h: ../../shared/include/u-boot.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/u-boot.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/u-boot.h
+$(PROJECT_INCLUDE)/bsp/u-boot-board-info.h: ../shared/include/u-boot-board-info.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/u-boot-board-info.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/u-boot-board-info.h
+
$(PROJECT_INCLUDE)/bsp/tictac.h: ../shared/include/tictac.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/tictac.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/tictac.h
+$(PROJECT_INCLUDE)/bsp/hwreg_vals.h: include/hwreg_vals.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/hwreg_vals.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/hwreg_vals.h
+
+$(PROJECT_INCLUDE)/bsp/tsec-config.h: include/tsec-config.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/tsec-config.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/tsec-config.h
+
+$(PROJECT_INCLUDE)/bsp/u-boot-config.h: include/u-boot-config.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/u-boot-config.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/u-boot-config.h
+
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/start/start.S b/c/src/lib/libbsp/powerpc/gen83xx/start/start.S
index ace422bb44..6059379c7a 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/start/start.S
+++ b/c/src/lib/libbsp/powerpc/gen83xx/start/start.S
@@ -58,29 +58,13 @@ reset_vec:
PUBLIC_VAR (start)
start:
-#ifdef HAS_UBOOT
-
-.extern bsp_uboot_board_info
-.extern bsp_uboot_board_info_size
-
/* Reset time base */
li r0, 0
mtspr TBWU, r0
mtspr TBWL, r0
- /* Copy board info */
- LA r6, bsp_uboot_board_info
- LW r5, bsp_uboot_board_info_size
- mtctr r5
-
-copy_uboot_board_info:
-
- lwz r5, 0(r3)
- addi r3, r3, 4
- stw r5, 0(r6)
- addi r6, r6, 4
- bdnz copy_uboot_board_info
-
+#ifdef HAS_UBOOT
+ mr r14, r3
#endif /* HAS_UBOOT */
/*
@@ -422,6 +406,11 @@ start_code_in_ram:
LA r3, bsp_section_bss_start /* get start address of bss section */
LWI r4, bsp_section_bss_size /* get size of bss section */
bl mpc83xx_zero_4 /* Clear the bss section */
+
+#ifdef HAS_UBOOT
+ mr r3, r14
+ bl bsp_uboot_copy_board_info
+#endif /* HAS_UBOOT */
/*
* call boot_card
*/
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
index 3e88cf2ee6..152671dc40 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
@@ -28,19 +28,7 @@
#include <bsp/vectors.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
-
-#ifdef HAS_UBOOT
-
-/*
- * We want this in the data section, because the startup code clears the BSS
- * section after the initialization of the board info.
- */
-bd_t bsp_uboot_board_info = { .bi_baudrate = 123 };
-
-/* Size in words */
-const size_t bsp_uboot_board_info_size = (sizeof( bd_t) + 3) / 4;
-
-#endif /* HAS_UBOOT */
+#include <bsp/u-boot.h>
/* Configuration parameters for console driver, ... */
unsigned int BSP_bus_frequency;
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/cpuinit.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/cpuinit.c
index 44c3439e90..2e1cbd4f80 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/cpuinit.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/cpuinit.c
@@ -79,6 +79,7 @@
#include <mpc83xx/mpc83xx.h>
#include <bsp.h>
+#include <bsp/u-boot.h>
#define SET_DBAT( n, uv, lv) \
do { \