forked from Imagelibrary/rtems
2010-12-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/u-boot.h: Removed file. * include/u-boot-config.h: New file. * include/bsp.h, start/start.S, startup/bspstart.c: Use new U-Boot support. * Makefile.am, preinstall.am: Reflect changes above.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2010-12-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* include/u-boot.h: Removed file.
|
||||
* include/u-boot-config.h: New file.
|
||||
* include/bsp.h, start/start.S, startup/bspstart.c: Use new U-Boot
|
||||
support.
|
||||
* Makefile.am, preinstall.am: Reflect changes above.
|
||||
|
||||
2010-11-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* mscan/mscan-base.c: Do not use sleep mode to enter init mode. Do
|
||||
|
||||
@@ -14,12 +14,11 @@ include_bestcomm_task_apidir = $(include_bestcommdir)/task_api
|
||||
|
||||
dist_project_lib_DATA = bsp_specs
|
||||
|
||||
include_HEADERS = include/bsp.h include/i2cdrv.h include/u-boot.h \
|
||||
include_HEADERS = include/bsp.h include/i2cdrv.h \
|
||||
include/i2c.h
|
||||
include_HEADERS += include/tm27.h
|
||||
|
||||
nodist_include_HEADERS = include/bspopts.h
|
||||
nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
|
||||
DISTCLEANFILES = include/bspopts.h
|
||||
|
||||
noinst_PROGRAMS =
|
||||
@@ -92,12 +91,15 @@ libbsp_a_SOURCES += ide/idecfg.c ide/pcmcia_ide.c ide/pcmcia_ide.h
|
||||
include_bsp_HEADERS = ../../shared/include/irq-generic.h \
|
||||
../../shared/include/irq-info.h \
|
||||
../../shared/include/utility.h \
|
||||
../../shared/include/bootcard.h \
|
||||
../../shared/include/u-boot.h \
|
||||
../shared/include/u-boot-board-info.h \
|
||||
include/irq.h \
|
||||
include/i2cdrv.h \
|
||||
include/i2c.h \
|
||||
include/mpc5200.h \
|
||||
include/mscan-base.h \
|
||||
include/u-boot.h \
|
||||
include/u-boot-config.h \
|
||||
mscan/mscan.h
|
||||
|
||||
# irq
|
||||
@@ -132,6 +134,7 @@ libbsp_a_SOURCES += ../../shared/bootcard.c \
|
||||
../../shared/bsppredriverhook.c \
|
||||
../../shared/gnatinstallhandler.c \
|
||||
../../shared/sbrk.c \
|
||||
../../shared/src/bsp-uboot-board-info.c \
|
||||
../shared/showbats.c \
|
||||
../shared/uboot_dump_bdinfo.c \
|
||||
../shared/uboot_getenv.c \
|
||||
|
||||
@@ -116,19 +116,11 @@ extern "C" {
|
||||
#include <i2cdrv.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/vectors.h>
|
||||
#include <bsp/u-boot.h>
|
||||
|
||||
#if defined(HAS_UBOOT)
|
||||
/* This is the define U-Boot uses to configure which entries in the structure are valid */
|
||||
#define CONFIG_MPC5xxx
|
||||
#include <u-boot.h>
|
||||
|
||||
extern bd_t bsp_uboot_board_info;
|
||||
#else
|
||||
|
||||
/* we need the low level initialization in start.S*/
|
||||
#define NEED_LOW_LEVEL_INIT
|
||||
|
||||
|
||||
#if !defined(HAS_UBOOT)
|
||||
/* we need the low level initialization in start.S*/
|
||||
#define NEED_LOW_LEVEL_INIT
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
22
c/src/lib/libbsp/powerpc/gen5200/include/u-boot-config.h
Normal file
22
c/src/lib/libbsp/powerpc/gen5200/include/u-boot-config.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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_GEN52XX_U_BOOT_CONFIG_H
|
||||
#define LIBBSP_POWERPC_GEN52XX_U_BOOT_CONFIG_H
|
||||
|
||||
#define CONFIG_MPC5xxx
|
||||
|
||||
#endif /* LIBBSP_POWERPC_GEN52XX_U_BOOT_CONFIG_H */
|
||||
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2000 - 2002
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
********************************************************************
|
||||
* NOTE: This header file defines an interface to U-Boot. Including
|
||||
* this (unmodified) header file in another file is considered normal
|
||||
* use of U-Boot, and does *not* fall under the heading of "derived
|
||||
* work".
|
||||
********************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __U_BOOT_H__
|
||||
#define __U_BOOT_H__
|
||||
|
||||
/*
|
||||
* Board information passed to Linux kernel from U-Boot
|
||||
*
|
||||
* include/asm-ppc/u-boot.h
|
||||
*/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
typedef struct bd_info {
|
||||
unsigned long bi_memstart; /* start of DRAM memory */
|
||||
unsigned long bi_memsize; /* size of DRAM memory in bytes */
|
||||
unsigned long bi_flashstart; /* start of FLASH memory */
|
||||
unsigned long bi_flashsize; /* size of FLASH memory */
|
||||
unsigned long bi_flashoffset; /* reserved area for startup monitor */
|
||||
unsigned long bi_sramstart; /* start of SRAM memory */
|
||||
unsigned long bi_sramsize; /* size of SRAM memory */
|
||||
#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \
|
||||
|| defined(CONFIG_E500)
|
||||
unsigned long bi_immr_base; /* base of IMMR register */
|
||||
#endif
|
||||
#if defined(CONFIG_MPC5xxx)
|
||||
unsigned long bi_mbar_base; /* base of internal registers */
|
||||
#endif
|
||||
#if defined(CONFIG_MPC83XX)
|
||||
unsigned long bi_immrbar;
|
||||
#endif
|
||||
#if defined(CONFIG_MPC8220)
|
||||
unsigned long bi_mbar_base; /* base of internal registers */
|
||||
unsigned long bi_inpfreq; /* Input Freq, In MHz */
|
||||
unsigned long bi_pcifreq; /* PCI Freq, in MHz */
|
||||
unsigned long bi_pevfreq; /* PEV Freq, in MHz */
|
||||
unsigned long bi_flbfreq; /* Flexbus Freq, in MHz */
|
||||
unsigned long bi_vcofreq; /* VCO Freq, in MHz */
|
||||
#endif
|
||||
unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
|
||||
unsigned long bi_ip_addr; /* IP Address */
|
||||
unsigned char bi_enetaddr[6]; /* Ethernet adress */
|
||||
unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
|
||||
unsigned long bi_intfreq; /* Internal Freq, in MHz */
|
||||
unsigned long bi_busfreq; /* Bus Freq, in MHz */
|
||||
#if defined(CONFIG_CPM2)
|
||||
unsigned long bi_cpmfreq; /* CPM_CLK Freq, in MHz */
|
||||
unsigned long bi_brgfreq; /* BRG_CLK Freq, in MHz */
|
||||
unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */
|
||||
unsigned long bi_vco; /* VCO Out from PLL, in MHz */
|
||||
#endif
|
||||
#if defined(CONFIG_MPC5xxx)
|
||||
unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */
|
||||
unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */
|
||||
#endif
|
||||
unsigned long bi_baudrate; /* Console Baudrate */
|
||||
#if defined(CONFIG_405) || \
|
||||
defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_405CR) || \
|
||||
defined(CONFIG_405EP) || \
|
||||
defined(CONFIG_440)
|
||||
unsigned char bi_s_version[4]; /* Version of this structure */
|
||||
unsigned char bi_r_version[32]; /* Version of the ROM (AMCC) */
|
||||
unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */
|
||||
unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */
|
||||
unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
|
||||
unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
|
||||
#endif
|
||||
#if defined(CONFIG_HYMOD)
|
||||
hymod_conf_t bi_hymod_conf; /* hymod configuration information */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_ETH1
|
||||
/* second onboard ethernet port */
|
||||
unsigned char bi_enet1addr[6];
|
||||
#endif
|
||||
#ifdef CONFIG_HAS_ETH2
|
||||
/* third onboard ethernet port */
|
||||
unsigned char bi_enet2addr[6];
|
||||
#endif
|
||||
#ifdef CONFIG_HAS_ETH3
|
||||
unsigned char bi_enet3addr[6];
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined (CONFIG_440GX) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
unsigned int bi_opbfreq; /* OPB clock in Hz */
|
||||
int bi_iic_fast[2]; /* Use fast i2c mode */
|
||||
#endif
|
||||
#if defined(CONFIG_NX823)
|
||||
unsigned char bi_sernum[8];
|
||||
#endif
|
||||
#if defined(CONFIG_4xx)
|
||||
#if defined(CONFIG_440GX)
|
||||
int bi_phynum[4]; /* Determines phy mapping */
|
||||
int bi_phymode[4]; /* Determines phy mode */
|
||||
#elif defined(CONFIG_405EP) || defined(CONFIG_440)
|
||||
int bi_phynum[2]; /* Determines phy mapping */
|
||||
int bi_phymode[2]; /* Determines phy mode */
|
||||
#else
|
||||
int bi_phynum[1]; /* Determines phy mapping */
|
||||
int bi_phymode[1]; /* Determines phy mode */
|
||||
#endif
|
||||
#endif /* defined(CONFIG_4xx) */
|
||||
} bd_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __U_BOOT_H__ */
|
||||
@@ -65,10 +65,6 @@ $(PROJECT_INCLUDE)/i2cdrv.h: include/i2cdrv.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/i2cdrv.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/i2cdrv.h
|
||||
|
||||
$(PROJECT_INCLUDE)/u-boot.h: include/u-boot.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/u-boot.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/u-boot.h
|
||||
|
||||
$(PROJECT_INCLUDE)/i2c.h: include/i2c.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/i2c.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/i2c.h
|
||||
@@ -81,10 +77,6 @@ $(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
|
||||
|
||||
$(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
|
||||
@@ -177,6 +169,18 @@ $(PROJECT_INCLUDE)/bsp/utility.h: ../../shared/include/utility.h $(PROJECT_INCLU
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/utility.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/utility.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
|
||||
|
||||
$(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/irq.h: include/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
|
||||
@@ -197,9 +201,9 @@ $(PROJECT_INCLUDE)/bsp/mscan-base.h: include/mscan-base.h $(PROJECT_INCLUDE)/bsp
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mscan-base.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mscan-base.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/u-boot.h: 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-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
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/mscan.h: mscan/mscan.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mscan.h
|
||||
|
||||
@@ -165,11 +165,9 @@ start:
|
||||
CLRBITS r30, r29, MSR_EE
|
||||
mtmsr r30 /* Set RI/ME, Clr EE in MSR */
|
||||
|
||||
#if defined(HAS_UBOOT)
|
||||
/* store pointer to UBoot bd_info board info structure */
|
||||
LWI r31,bsp_uboot_board_info_ptr
|
||||
stw r3,0(r31)
|
||||
#endif /* defined(HAS_UBOOT) */
|
||||
#ifdef HAS_UBOOT
|
||||
mr r14, r3
|
||||
#endif /* HAS_UBOOT */
|
||||
|
||||
#if defined(NEED_LOW_LEVEL_INIT)
|
||||
/* initialize the MBAR (common RAM/ROM startup) */
|
||||
@@ -405,6 +403,10 @@ skip_ROM_start:
|
||||
|
||||
bl clr_mem /* Clear the bss section */
|
||||
|
||||
#ifdef HAS_UBOOT
|
||||
mr r3, r14
|
||||
bl bsp_uboot_copy_board_info
|
||||
#endif /* HAS_UBOOT */
|
||||
|
||||
/* set stack pointer (common for RAM/ROM startup) */
|
||||
LA r1, bsp_section_text_start
|
||||
|
||||
@@ -104,13 +104,6 @@
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
|
||||
#if defined(HAS_UBOOT)
|
||||
/* 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
|
||||
|
||||
/*
|
||||
* Driver configuration parameters
|
||||
*/
|
||||
@@ -142,14 +135,10 @@ void bsp_start(void)
|
||||
myCpu = get_ppc_cpu_type();
|
||||
myCpuRevision = get_ppc_cpu_revision();
|
||||
|
||||
#if defined(HAS_UBOOT)
|
||||
bsp_uboot_board_info = *bsp_uboot_board_info_ptr;
|
||||
#endif
|
||||
|
||||
#if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS)
|
||||
{
|
||||
void dumpUBootBDInfo( bd_t * );
|
||||
dumpUBootBDInfo( bsp_uboot_board_info_ptr );
|
||||
dumpUBootBDInfo( &bsp_uboot_board_info );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user