* 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.
This commit is contained in:
Sebastian Huber
2010-12-30 13:16:41 +00:00
parent 4bb492529a
commit ce0922e685
10 changed files with 104 additions and 57 deletions

View File

@@ -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,

View File

@@ -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 \

View File

@@ -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
*/

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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
);
}

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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;

View File

@@ -79,6 +79,7 @@
#include <mpc83xx/mpc83xx.h>
#include <bsp.h>
#include <bsp/u-boot.h>
#define SET_DBAT( n, uv, lv) \
do { \