Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f12e568ca4 | ||
|
|
0d4983930a | ||
|
|
b37c7e5e5c | ||
|
|
b0fce99bfc | ||
|
|
eeacb89cb3 | ||
|
|
3d96ede975 | ||
|
|
9d2b18a0f9 | ||
|
|
d1cbe85b08 |
No files matched your search
@@ -1,7 +1,44 @@
|
||||
======================================================================
|
||||
Changes since U-Boot 0.4.0:
|
||||
Changes for U-Boot 0.4.2:
|
||||
======================================================================
|
||||
|
||||
* Add support for NSCU board
|
||||
|
||||
* Add support for TQM823M, TQM850M, TQM855M and TQM860M modules
|
||||
|
||||
* Add support for Am29LV160ML, Am29LV320ML, and Am29LV640ML
|
||||
mirror bit flash on TQM8xxM modules
|
||||
|
||||
* Patch by Kenneth Johansson, 30 Jun 2003:
|
||||
get rid of MK_CMD_ENTRY macro; update doc/README.command
|
||||
|
||||
* Patch by Seb James, 30 Jun 2003:
|
||||
Improve documentation of I2C configuration in README
|
||||
|
||||
* Fix problems with previous log buffer "fixes"
|
||||
|
||||
* Fix minor help text issues
|
||||
|
||||
* "log append" did not append a newline
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.1:
|
||||
======================================================================
|
||||
|
||||
* Fix some missing commands, cleanup header files
|
||||
(autoscript, bmp, bsp, fat, mmc, nand, portio, ...)
|
||||
|
||||
* Rewrite command lookup and help command (fix problems with bubble
|
||||
sort when sorting command name list). Minor cleanup here and there.
|
||||
|
||||
* Merge from "stable branch", tag LABEL_2003_06_28_1800-stable:
|
||||
- Allow to call sysmon function interactively
|
||||
- PIC on LWMON board needs delay after power-on
|
||||
- Add missing RSR definitions for MPC8xx
|
||||
- Improve log buffer handling: guarantee clean reset after power-on
|
||||
- Add support for EXBITGEN board
|
||||
- Add support for SL8245 board
|
||||
|
||||
* Code cleanup:
|
||||
- remove trailing white space, trailing empty lines, C++ comments, etc.
|
||||
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
|
||||
|
||||
+3
-3
@@ -3,10 +3,7 @@
|
||||
# Regular Maintainers for U-Boot board support: #
|
||||
# #
|
||||
# For any board without permanent maintainer, please contact #
|
||||
# for PowerPC systems: #
|
||||
# Wolfgang Denk <wd@denx.de> #
|
||||
# for ARM systems: #
|
||||
# Marius Gröger <mag@sysgo.de> #
|
||||
# and Cc: the <U-Boot-Users@lists.sourceforge.net> mailing lists. #
|
||||
# #
|
||||
# Note: lists sorted by Maintainer Name #
|
||||
@@ -83,6 +80,7 @@ Wolfgang Denk <wd@denx.de>
|
||||
|
||||
CU824 MPC8240
|
||||
Sandpoint8240 MPC8240
|
||||
SL8245 MPC8245
|
||||
|
||||
ATC MPC8250
|
||||
PM825 MPC8250
|
||||
@@ -96,6 +94,8 @@ Wolfgang Denk <wd@denx.de>
|
||||
PCIPPC2 MPC750
|
||||
PCIPPC6 MPC750
|
||||
|
||||
EXBITGEN PPC405GP
|
||||
|
||||
Jon Diekema <jon.diekema@smiths-aerospace.com>
|
||||
|
||||
sbc8260 MPC8260
|
||||
|
||||
@@ -45,12 +45,12 @@ LIST_8xx=" \
|
||||
|
||||
LIST_4xx=" \
|
||||
ADCIOP AR405 ASH405 BUBINGA405EP \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 DASA_SIM \
|
||||
DU405 EBONY ERIC MIP405 \
|
||||
MIP405T ML2 OCRTC ORSG \
|
||||
PCI405 PIP405 PMC405 W7OLMC \
|
||||
W7OLMG WALNUT405 \
|
||||
DU405 EBONY ERIC EXBITGEN \
|
||||
MIP405 MIP405T ML2 OCRTC \
|
||||
ORSG PCI405 PIP405 PMC405 \
|
||||
W7OLMC W7OLMG WALNUT405 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -60,7 +60,7 @@ LIST_4xx=" \
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
MOUSSE MUSENKI OXC PN62 \
|
||||
Sandpoint8240 Sandpoint8245 utx8245 \
|
||||
Sandpoint8240 Sandpoint8245 SL8245 utx8245 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
|
||||
@@ -372,6 +372,7 @@ xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _LCD,,$(su
|
||||
|
||||
FPS850L_config \
|
||||
FPS860L_config \
|
||||
NSCU_config \
|
||||
TQM823L_config \
|
||||
TQM823L_66MHz_config \
|
||||
TQM823L_80MHz_config \
|
||||
@@ -390,6 +391,15 @@ TQM860L_80MHz_config \
|
||||
TQM862L_config \
|
||||
TQM862L_66MHz_config \
|
||||
TQM862L_80MHz_config \
|
||||
TQM855M_config \
|
||||
TQM855M_66MHz_config \
|
||||
TQM855M_80MHz_config \
|
||||
TQM860M_config \
|
||||
TQM860M_66MHz_config \
|
||||
TQM860M_80MHz_config \
|
||||
TQM862M_config \
|
||||
TQM862M_66MHz_config \
|
||||
TQM862M_80MHz_config \
|
||||
TQM862M_100MHz_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _66MHz,$@)" ] || \
|
||||
@@ -467,6 +477,9 @@ EBONY_config:unconfig
|
||||
ERIC_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx eric
|
||||
|
||||
EXBITGEN_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx exbitgen
|
||||
|
||||
MIP405_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
|
||||
|
||||
@@ -543,6 +556,9 @@ Sandpoint8240_config: unconfig
|
||||
Sandpoint8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sandpoint
|
||||
|
||||
SL8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sl8245
|
||||
|
||||
utx8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x utx8245
|
||||
|
||||
|
||||
@@ -653,6 +653,9 @@ The following options need to be configured:
|
||||
CONFIG_RTC_DS1338 - use Maxim, Inc. DS1338 RTC
|
||||
CONFIG_RTC_DS164x - use Dallas DS164x RTC
|
||||
|
||||
Note that if the RTC uses I2C, then the I2C interface
|
||||
must also be configured. See I2C Support, below.
|
||||
|
||||
- Timestamp Support:
|
||||
|
||||
When CONFIG_TIMESTAMP is selected, the timestamp
|
||||
@@ -904,29 +907,48 @@ The following options need to be configured:
|
||||
|
||||
- I2C Support: CONFIG_HARD_I2C | CONFIG_SOFT_I2C
|
||||
|
||||
Enables I2C serial bus commands. If this is selected,
|
||||
either CONFIG_HARD_I2C or CONFIG_SOFT_I2C must be defined
|
||||
to include the appropriate I2C driver.
|
||||
These enable I2C serial bus commands. Defining either of
|
||||
(but not both of) CONFIG_HARD_I2C or CONFIG_SOFT_I2C will
|
||||
include the appropriate I2C driver for the selected cpu.
|
||||
|
||||
See also: common/cmd_i2c.c for a description of the
|
||||
This will allow you to use i2c commands at the u-boot
|
||||
command line (as long as you set CFG_CMD_I2C in
|
||||
CONFIG_COMMANDS) and communicate with i2c based realtime
|
||||
clock chips. See common/cmd_i2c.c for a description of the
|
||||
command line interface.
|
||||
|
||||
CONFIG_HARD_I2C selects the CPM hardware driver for I2C.
|
||||
|
||||
CONFIG_HARD_I2C
|
||||
CONFIG_SOFT_I2C configures u-boot to use a software (aka
|
||||
bit-banging) driver instead of CPM or similar hardware
|
||||
support for I2C.
|
||||
|
||||
Selects the CPM hardware driver for I2C.
|
||||
There are several other quantities that must also be
|
||||
defined when you define CONFIG_HARD_I2C or CONFIG_SOFT_I2C.
|
||||
|
||||
CONFIG_SOFT_I2C
|
||||
In both cases you will need to define CFG_I2C_SPEED
|
||||
to be the frequency (in Hz) at which you wish your i2c bus
|
||||
to run and CFG_I2C_SLAVE to be the address of this node (ie
|
||||
the cpu's i2c node address).
|
||||
|
||||
Now, the u-boot i2c code for the mpc8xx (cpu/mpc8xx/i2c.c)
|
||||
sets the cpu up as a master node and so its address should
|
||||
therefore be cleared to 0 (See, eg, MPC823e User's Manual
|
||||
p.16-473). So, set CFG_I2C_SLAVE to 0.
|
||||
|
||||
Use software (aka bit-banging) driver instead of CPM
|
||||
or similar hardware support for I2C. This is configured
|
||||
via the following defines.
|
||||
That's all that's required for CONFIG_HARD_I2C.
|
||||
|
||||
If you use the software i2c interface (CONFIG_SOFT_I2C)
|
||||
then the following macros need to be defined (examples are
|
||||
from include/configs/lwmon.h):
|
||||
|
||||
I2C_INIT
|
||||
|
||||
(Optional). Any commands necessary to enable I2C
|
||||
(Optional). Any commands necessary to enable the I2C
|
||||
controller or configure ports.
|
||||
|
||||
eg: #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
|
||||
|
||||
I2C_PORT
|
||||
|
||||
(Only for MPC8260 CPU). The I/O port to use (the code
|
||||
@@ -939,32 +961,49 @@ The following options need to be configured:
|
||||
(driven). If the data line is open collector, this
|
||||
define can be null.
|
||||
|
||||
eg: #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
|
||||
|
||||
I2C_TRISTATE
|
||||
|
||||
The code necessary to make the I2C data line tri-stated
|
||||
(inactive). If the data line is open collector, this
|
||||
define can be null.
|
||||
|
||||
eg: #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
|
||||
|
||||
I2C_READ
|
||||
|
||||
Code that returns TRUE if the I2C data line is high,
|
||||
FALSE if it is low.
|
||||
|
||||
eg: #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
|
||||
|
||||
I2C_SDA(bit)
|
||||
|
||||
If <bit> is TRUE, sets the I2C data line high. If it
|
||||
is FALSE, it clears it (low).
|
||||
|
||||
eg: #define I2C_SDA(bit) \
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SDA
|
||||
|
||||
I2C_SCL(bit)
|
||||
|
||||
If <bit> is TRUE, sets the I2C clock line high. If it
|
||||
is FALSE, it clears it (low).
|
||||
|
||||
eg: #define I2C_SCL(bit) \
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SCL
|
||||
|
||||
I2C_DELAY
|
||||
|
||||
This delay is invoked four times per clock cycle so this
|
||||
controls the rate of data transfer. The data rate thus
|
||||
is 1 / (I2C_DELAY * 4).
|
||||
is 1 / (I2C_DELAY * 4). Often defined to be something
|
||||
like:
|
||||
|
||||
#define I2C_DELAY udelay(2)
|
||||
|
||||
CFG_I2C_INIT_BOARD
|
||||
|
||||
|
||||
@@ -121,8 +121,8 @@ int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTA) = MK_CMD_ENTRY(
|
||||
"boota", 3, 1, do_boota,
|
||||
U_BOOT_CMD(
|
||||
boota, 3, 1, do_boota,
|
||||
"boota - boot an Amiga kernel\n",
|
||||
"address disk"
|
||||
);
|
||||
|
||||
@@ -8,8 +8,8 @@ int do_menu( cmd_tbl_t *cmdtp, /*bd_t *bd,*/ int flag, int argc, char *argv[] )
|
||||
}
|
||||
|
||||
#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
cmd_tbl_t U_BOOT_CMD(MENU) = MK_CMD_ENTRY(
|
||||
"menu", 1, 1, do_menu,
|
||||
U_BOOT_CMD(
|
||||
menu, 1, 1, do_menu,
|
||||
"menu - display BIOS setup menu\n",
|
||||
""
|
||||
);
|
||||
|
||||
@@ -225,8 +225,8 @@ int do_pci9054 (cmd_tbl_t * cmdtp, int flag, int argc,
|
||||
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD (pci9054) = MK_CMD_ENTRY(
|
||||
"pci9054", 3, 1, do_pci9054,
|
||||
U_BOOT_CMD(
|
||||
pci9054, 3, 1, do_pci9054,
|
||||
"pci9054 - PLX PCI9054 EEPROM access\n",
|
||||
"pci9054 info - print EEPROM values\n"
|
||||
"pci9054 update - updates EEPROM with default values\n"
|
||||
|
||||
@@ -22,7 +22,6 @@ Skeleton NIC driver for Etherboot
|
||||
|
||||
#include <common.h>
|
||||
#include <malloc.h>
|
||||
#include <cmd_bsp.h>
|
||||
#include <galileo/gt64260R.h>
|
||||
#include <galileo/core.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
@@ -198,20 +198,20 @@ do_zuma_init_mbox (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(zuma_init_pbb) = MK_CMD_ENTRY(
|
||||
"zinit", 1, 0, do_zuma_init_pbb,
|
||||
U_BOOT_CMD(
|
||||
zinit, 1, 0, do_zuma_init_pbb,
|
||||
"zinit - init zuma pbb\n",
|
||||
"\n"
|
||||
" - init zuma pbb\n"
|
||||
);
|
||||
cmd_tbl_t U_BOOT_CMD(zuma_test_dma) = MK_CMD_ENTRY(
|
||||
"zdtest", 3, 1, do_zuma_test_dma,
|
||||
U_BOOT_CMD(
|
||||
zdtest, 3, 1, do_zuma_test_dma,
|
||||
"zdtest - run dma test\n",
|
||||
"[cmd [count]]\n"
|
||||
" - run dma cmd (w=0,v=1,cp=2,cmp=3,wi=4,vi=5), count bytes\n"
|
||||
);
|
||||
cmd_tbl_t U_BOOT_CMD(zuma_init_mbox) = MK_CMD_ENTRY(
|
||||
"zminit", 1, 0, do_zuma_init_mbox,
|
||||
U_BOOT_CMD(
|
||||
zminit, 1, 0, do_zuma_init_mbox,
|
||||
"zminit - init zuma mbox\n",
|
||||
"\n"
|
||||
" - init zuma mbox\n"
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
SOBJS = init.o
|
||||
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# ExbitGen board
|
||||
#
|
||||
|
||||
LDFLAGS += $(LINKER_UNDEFS)
|
||||
|
||||
TEXT_BASE := 0xFFF80000
|
||||
#TEXT_BASE := 0x00100000
|
||||
|
||||
PLATFORM_RELFLAGS := $(PLATFORM_RELFLAGS)
|
||||
@@ -0,0 +1,117 @@
|
||||
#include <asm/u-boot.h>
|
||||
#include <asm/processor.h>
|
||||
#include <common.h>
|
||||
#include "exbitgen.h"
|
||||
|
||||
/* ************************************************************************ */
|
||||
int board_pre_init (void)
|
||||
/* ------------------------------------------------------------------------ --
|
||||
* Purpose :
|
||||
* Remarks :
|
||||
* Restrictions:
|
||||
* See also :
|
||||
* Example :
|
||||
* ************************************************************************ */
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Interrupt controller setup for the Walnut board.
|
||||
| Note: IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
| IRQ 16 405GP internally generated; active low; level sensitive
|
||||
| IRQ 17-24 RESERVED
|
||||
| IRQ 25 (EXT IRQ 0) FPGA; active high; level sensitive
|
||||
| IRQ 26 (EXT IRQ 1) SMI; active high; level sensitive
|
||||
| IRQ 27 (EXT IRQ 2) Not Used
|
||||
| IRQ 28 (EXT IRQ 3) PCI SLOT 3; active low; level sensitive
|
||||
| IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
|
||||
| IRQ 30 (EXT IRQ 5) PCI SLOT 1; active low; level sensitive
|
||||
| IRQ 31 (EXT IRQ 6) PCI SLOT 0; active low; level sensitive
|
||||
| Note for Walnut board:
|
||||
| An interrupt taken for the FPGA (IRQ 25) indicates that either
|
||||
| the Mouse, Keyboard, IRDA, or External Expansion caused the
|
||||
| interrupt. The FPGA must be read to determine which device
|
||||
| caused the interrupt. The default setting of the FPGA clears
|
||||
|
|
||||
+-------------------------------------------------------------------------*/
|
||||
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr (uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr (uiccr, 0x00000020); /* set all but FPGA SMI to be non-critical */
|
||||
mtdcr (uicpr, 0xFFFFFF90); /* set int polarities */
|
||||
mtdcr (uictr, 0x10000000); /* set int trigger levels */
|
||||
mtdcr (uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority */
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
/* Perform reset of PHY connected to PPC via register in CPLD */
|
||||
out8 (PHY_CTRL_ADDR, 0x2e); /* activate nRESET,FDX,F100,ANEN, enable output */
|
||||
for (i = 0; i < 10000000; i++) {
|
||||
;
|
||||
}
|
||||
out8 (PHY_CTRL_ADDR, 0x2f); /* deactivate nRESET */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************ */
|
||||
int checkboard (void)
|
||||
/* ------------------------------------------------------------------------ --
|
||||
* Purpose :
|
||||
* Remarks :
|
||||
* Restrictions:
|
||||
* See also :
|
||||
* Example :
|
||||
* ************************************************************************ */
|
||||
{
|
||||
printf ("Exbit H/W id: %d\n", in8 (HW_ID_ADDR));
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
long int initdram (int board_type)
|
||||
/* ------------------------------------------------------------------------ --
|
||||
* Purpose : Determines size of mounted DRAM.
|
||||
* Remarks : Size is determined by reading SDRAM configuration registers as
|
||||
* set up by sdram_init.
|
||||
* Restrictions:
|
||||
* See also :
|
||||
* Example :
|
||||
* ************************************************************************ */
|
||||
{
|
||||
ulong tot_size;
|
||||
ulong bank_size;
|
||||
ulong tmp;
|
||||
|
||||
tot_size = 0;
|
||||
|
||||
mtdcr (memcfga, mem_mb0cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb1cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb2cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb3cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
return tot_size;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2001, 2002
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -21,9 +21,32 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _CMD_BSP_H_
|
||||
#define _CMD_BSP_H_
|
||||
#define GPIO_CPU_LED GPIO_3
|
||||
|
||||
/* do not edit this file */
|
||||
|
||||
#endif /* _CMD_BSP_H_ */
|
||||
#define CPLD_BASE 0x10000000 /* t.b.m. */
|
||||
#define DEBUG_LEDS_ADDR CPLD_BASE + 0x01
|
||||
#define HW_ID_ADDR CPLD_BASE + 0x02
|
||||
#define DIP_SWITCH_ADDR CPLD_BASE + 0x04
|
||||
#define PHY_CTRL_ADDR CPLD_BASE + 0x05
|
||||
#define SPI_OUT_ADDR CPLD_BASE + 0x07
|
||||
#define SPI_IN_ADDR CPLD_BASE + 0x08
|
||||
#define MDIO_OUT_ADDR CPLD_BASE + 0x09
|
||||
#define MDIO_IN_ADDR CPLD_BASE + 0x0A
|
||||
#define MISC_OUT_ADDR CPLD_BASE + 0x0B
|
||||
|
||||
/* Addresses used on I2C bus */
|
||||
#define LM75_CHIP_ADDR 0x9C
|
||||
#define LM75_CPU_ADDR 0x9E
|
||||
#define SDRAM_SPD_ADDR 0xA0
|
||||
|
||||
#define SDRAM_SPD_WRITE_ADDRESS (SDRAM_SPD_ADDR)
|
||||
#define SDRAM_SPD_READ_ADDRESS (SDRAM_SPD_ADDR+1)
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
@@ -0,0 +1,597 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified 4/5/2001
|
||||
* Wait for completion of each sector erase command issued
|
||||
* 4/5/2001
|
||||
* Chris Hallinan - DS4.COM, Inc. - clh@net1plus.com
|
||||
*/
|
||||
|
||||
#include <asm/u-boot.h>
|
||||
#include <asm/processor.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <common.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info);
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data);
|
||||
|
||||
#ifdef MEIGSBOARD_ONBOARD_FLASH /* onboard = 2MB */
|
||||
# ifdef CONFIG_EXBITGEN
|
||||
# define FLASH_WORD_SIZE unsigned long
|
||||
# endif
|
||||
#else /* Meigsboard socket flash = 512KB */
|
||||
# ifdef CONFIG_EXBITGEN
|
||||
# define FLASH_WORD_SIZE unsigned char
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXBITGEN
|
||||
#define ADDR0 0x5555
|
||||
#define ADDR1 0x2aaa
|
||||
#define FLASH_WORD_SIZE unsigned char
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long bank_size;
|
||||
unsigned long tot_size;
|
||||
unsigned long bank_addr;
|
||||
int i;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
flash_info[i].size = 0;
|
||||
}
|
||||
|
||||
tot_size = 0;
|
||||
|
||||
/* Detect Boot Flash */
|
||||
bank_addr = CFG_FLASH0_BASE;
|
||||
bank_size = flash_get_size((vu_long *)bank_addr, &flash_info[0]);
|
||||
if (bank_size > 0) {
|
||||
(void)flash_protect(FLAG_PROTECT_CLEAR,
|
||||
bank_addr,
|
||||
bank_addr + bank_size - 1,
|
||||
&flash_info[0]);
|
||||
}
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Boot Flash Bank\n");
|
||||
}
|
||||
flash_info[0].size = bank_size;
|
||||
tot_size += bank_size;
|
||||
|
||||
/* Detect Application Flash */
|
||||
bank_addr = CFG_FLASH1_BASE;
|
||||
for (i = 1; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
bank_size = flash_get_size((vu_long *)bank_addr, &flash_info[i]);
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
break;
|
||||
}
|
||||
if (bank_size > 0) {
|
||||
(void)flash_protect(FLAG_PROTECT_CLEAR,
|
||||
bank_addr,
|
||||
bank_addr + bank_size - 1,
|
||||
&flash_info[i]);
|
||||
}
|
||||
flash_info[i].size = bank_size;
|
||||
tot_size += bank_size;
|
||||
bank_addr += bank_size;
|
||||
}
|
||||
if (flash_info[1].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Application Flash Bank\n");
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors */
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
#if 0xfffffffc >= CFG_FLASH0_BASE
|
||||
#if 0xfffffffc <= CFG_FLASH0_BASE + CFG_FLASH0_SIZE - 1
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
0xfffffffc, 0xffffffff,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
return tot_size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
case FLASH_MAN_SST: printf ("SST "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM040: printf ("AM29F040 (512 Kbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AM400B: printf ("AM29LV400B (4 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM400T: printf ("AM29LV400T (4 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM800B: printf ("AM29LV800B (8 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM800T: printf ("AM29LV800T (8 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM160B: printf ("AM29LV160B (16 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM160T: printf ("AM29LV160T (16 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM320B: printf ("AM29LV320B (32 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM320T: printf ("AM29LV320T (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AMDLV033C: printf ("AM29LV033C (32 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AMDLV065D: printf ("AM29LV065D (64 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST800A: printf ("SST39LF/VF800 (8 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST160A: printf ("SST39LF/VF160 (16 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST040: printf ("SST39LF/VF040 (4 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld KB in %d Sectors\n",
|
||||
info->size >> 10, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " "
|
||||
);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
FLASH_WORD_SIZE value;
|
||||
ulong base = (ulong)addr;
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00900090;
|
||||
|
||||
value = addr2[0];
|
||||
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE)AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE)FUJ_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_FUJ;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE)SST_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_SST;
|
||||
break;
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr2[1]; /* device ID */
|
||||
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE)AMD_ID_F040B:
|
||||
info->flash_id += FLASH_AM040;
|
||||
info->sector_count = 8;
|
||||
info->size = 0x0080000; /* => 512 ko */
|
||||
break;
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV400T:
|
||||
info->flash_id += FLASH_AM400T;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 0.5 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV400B:
|
||||
info->flash_id += FLASH_AM400B;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 0.5 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV800T:
|
||||
info->flash_id += FLASH_AM800T;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV800B:
|
||||
info->flash_id += FLASH_AM800B;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV160T:
|
||||
info->flash_id += FLASH_AM160T;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV160B:
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV033C:
|
||||
info->flash_id += FLASH_AMDLV033C;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV065D:
|
||||
info->flash_id += FLASH_AMDLV065D;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV320T:
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)SST_ID_xF800A:
|
||||
info->flash_id += FLASH_SST800A;
|
||||
info->sector_count = 16;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)SST_ID_xF160A:
|
||||
info->flash_id += FLASH_SST160A;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
case (FLASH_WORD_SIZE)SST_ID_xF040:
|
||||
info->flash_id += FLASH_SST040;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 512KB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
(info->flash_id == FLASH_AM040) ||
|
||||
(info->flash_id == FLASH_AMDLV033C) ||
|
||||
(info->flash_id == FLASH_AMDLV065D)) {
|
||||
ulong sectsize = info->size / info->sector_count;
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * sectsize);
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00004000;
|
||||
info->start[2] = base + 0x00006000;
|
||||
info->start[3] = base + 0x00008000;
|
||||
for (i = 4; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00030000;
|
||||
}
|
||||
} else {
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00004000;
|
||||
info->start[i--] = base + info->size - 0x00006000;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00010000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
|
||||
addr2 = (volatile FLASH_WORD_SIZE *)(info->start[i]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)
|
||||
info->protect[i] = 0;
|
||||
else
|
||||
info->protect[i] = addr2[2] & 1;
|
||||
}
|
||||
|
||||
/* switch to the read mode */
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr2 = (FLASH_WORD_SIZE *)info->start[0];
|
||||
*addr2 = (FLASH_WORD_SIZE)0x00F000F0; /* reset bank */
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *addr2;
|
||||
int flag, prot, sect;
|
||||
ulong start, now, last;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (FLASH_WORD_SIZE *)(info->start[sect]);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE)0x00300030;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
while ((addr2[0] & 0x00800080) !=
|
||||
(FLASH_WORD_SIZE) 0x00800080) {
|
||||
if ((now=get_timer(start)) >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
addr[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
addr[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
}
|
||||
}
|
||||
|
||||
printf (" done\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
int i, l, rc;
|
||||
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
for (; i<4 && cnt>0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 4) {
|
||||
data = 0;
|
||||
for (i=0; i<4; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i<4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
|
||||
volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
|
||||
ulong start;
|
||||
int flag;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile ulong *)dest) & data) != data) {
|
||||
printf("dest = %08lx, *dest = %08lx, data = %08lx\n",
|
||||
dest, *(volatile ulong *)dest, data);
|
||||
return 2;
|
||||
}
|
||||
|
||||
for (i=0; i < 4/sizeof(FLASH_WORD_SIZE); i++) {
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & 0x00800080) != (data2[i] & 0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
addr2[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addr2[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
board/exbitgen/init.o (.text)
|
||||
cpu/ppc4xx/kgdb.o (.text)
|
||||
cpu/ppc4xx/traps.o (.text)
|
||||
cpu/ppc4xx/interrupts.o (.text)
|
||||
cpu/ppc4xx/serial.o (.text)
|
||||
cpu/ppc4xx/cpu_init.o (.text)
|
||||
cpu/ppc4xx/speed.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* . = env_offset;*/
|
||||
common/environment.o(.text)
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
. = ALIGN(4);
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
+4
-5
@@ -27,7 +27,6 @@
|
||||
#include <command.h>
|
||||
#include <net.h>
|
||||
#include <asm/iopin_8260.h>
|
||||
#include <cmd_bsp.h>
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Board Special Commands: FPGA load/store, EEPROM erase
|
||||
@@ -276,8 +275,8 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(fpga) = MK_CMD_ENTRY(
|
||||
"fpga", 6, 1, do_fpga,
|
||||
U_BOOT_CMD(
|
||||
fpga, 6, 1, do_fpga,
|
||||
"fpga - FPGA sub-system\n",
|
||||
"load [type] addr size\n"
|
||||
" - write the configuration data at memory address `addr',\n"
|
||||
@@ -335,8 +334,8 @@ do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(eec) = MK_CMD_ENTRY(
|
||||
"eeclear", 1, 0, do_eecl,
|
||||
U_BOOT_CMD(
|
||||
eeclear, 1, 0, do_eecl,
|
||||
"eeclear - Clear the eeprom on a Hymod board \n",
|
||||
"[type]\n"
|
||||
" - write zeroes into the EEPROM on the board of type `type'\n"
|
||||
|
||||
+9
-6
@@ -513,6 +513,9 @@ static void kbd_init (void)
|
||||
|
||||
gd->kbd_status = 0;
|
||||
|
||||
/* Forced by PIC. Delays <= 175us loose */
|
||||
udelay(1000);
|
||||
|
||||
/* Read initial keyboard error code */
|
||||
val = KEYBD_CMD_READ_STATUS;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
@@ -848,8 +851,8 @@ int do_pic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(pic) = MK_CMD_ENTRY(
|
||||
"pic", 4, 1, do_pic,
|
||||
U_BOOT_CMD(
|
||||
pic, 4, 1, do_pic,
|
||||
"pic - read and write PIC registers\n",
|
||||
"read reg - read PIC register `reg'\n"
|
||||
"pic write reg val - write value `val' to PIC register `reg'\n"
|
||||
@@ -907,8 +910,8 @@ int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(kdb) = MK_CMD_ENTRY(
|
||||
"kbd", 1, 1, do_kbd,
|
||||
U_BOOT_CMD(
|
||||
kbd, 1, 1, do_kbd,
|
||||
"kbd - read keyboard status\n",
|
||||
NULL
|
||||
);
|
||||
@@ -979,8 +982,8 @@ int do_lsb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(lsb) = MK_CMD_ENTRY(
|
||||
"lsb", 2, 1, do_lsb,
|
||||
U_BOOT_CMD(
|
||||
lsb, 2, 1, do_lsb,
|
||||
"lsb - check and set LSB switch\n",
|
||||
"on - switch LSB on\n"
|
||||
"lsb off - switch LSB off\n"
|
||||
|
||||
@@ -53,8 +53,8 @@ int do_mip405(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
return (do_mplcommon(cmdtp, flag, argc, argv));
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(mip405) = MK_CMD_ENTRY(
|
||||
"mip405", 6, 1, do_mip405,
|
||||
U_BOOT_CMD(
|
||||
mip405, 6, 1, do_mip405,
|
||||
"mip405 - MIP405 specific Cmds\n",
|
||||
"flash mem [SrcAddr] - updates U-Boot with image in memory\n"
|
||||
"mip405 flash mps - updates U-Boot with image from MPS\n"
|
||||
|
||||
@@ -58,8 +58,8 @@ int do_pip405(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
return (do_mplcommon(cmdtp, flag, argc, argv));
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(pip405) = MK_CMD_ENTRY(
|
||||
"pip405", 6, 1, do_pip405,
|
||||
U_BOOT_CMD(
|
||||
pip405, 6, 1, do_pip405,
|
||||
"pip405 - PIP405 specific Cmds\n",
|
||||
"flash mem [SrcAddr] - updates U-Boot with image in memory\n"
|
||||
"pip405 flash floppy [SrcAddr] - updates U-Boot with image from floppy\n"
|
||||
|
||||
@@ -233,8 +233,8 @@ int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(wd) = MK_CMD_ENTRY(
|
||||
"wd", 2, 1, do_wd,
|
||||
U_BOOT_CMD(
|
||||
wd, 2, 1, do_wd,
|
||||
"wd - check and set watchdog\n",
|
||||
"on - switch watchDog on\n"
|
||||
"wd off - switch watchdog off\n"
|
||||
|
||||
@@ -51,8 +51,8 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
set_led (number, function);
|
||||
return 0;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(led) = MK_CMD_ENTRY(
|
||||
"led" , 3, 1, do_led,
|
||||
U_BOOT_CMD(
|
||||
led , 3, 1, do_led,
|
||||
"led - set LED 0..11 on the PN62 board\n",
|
||||
"i fun\n"
|
||||
" - set 'i'th LED to function 'fun'\n"
|
||||
@@ -165,8 +165,8 @@ int do_loadpci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return rcode;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(loadpci) = MK_CMD_ENTRY(
|
||||
"loadpci", 2, 1, do_loadpci,
|
||||
U_BOOT_CMD(
|
||||
loadpci, 2, 1, do_loadpci,
|
||||
"loadpci - load binary file over PCI\n",
|
||||
"[addr]\n"
|
||||
" - load binary file over PCI to address 'addr'\n"
|
||||
|
||||
@@ -443,8 +443,8 @@ int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(kbd) = MK_CMD_ENTRY(
|
||||
"kbd", 1, 1, do_kbd,
|
||||
U_BOOT_CMD(
|
||||
kbd, 1, 1, do_kbd,
|
||||
"kbd - read keyboard status\n",
|
||||
NULL
|
||||
);
|
||||
@@ -291,8 +291,8 @@ int do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(fpga) = MK_CMD_ENTRY(
|
||||
"fpga", 4, 1, do_fpga,
|
||||
U_BOOT_CMD(
|
||||
fpga, 4, 1, do_fpga,
|
||||
"fpga - access FPGA(s)\n",
|
||||
"fpga status [name] - print FPGA status\n"
|
||||
"fpga reset [name] - reset FPGA\n"
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <commproc.h>
|
||||
#include <i2c.h>
|
||||
#include <command.h>
|
||||
#include <cmd_bsp.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -433,8 +432,8 @@ int do_puma (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(puma) = MK_CMD_ENTRY(
|
||||
"puma", 4, 1, do_puma,
|
||||
U_BOOT_CMD(
|
||||
puma, 4, 1, do_puma,
|
||||
"puma - access PUMA FPGA\n",
|
||||
"status - print PUMA status\n"
|
||||
"puma load addr len - load PUMA configuration data\n"
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2001 - 2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# (C) Copyright 2001 - 2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# SL8245 board
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFF00000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
|
||||
@@ -0,0 +1,488 @@
|
||||
/*
|
||||
* (C) Copyright 2001 - 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc824x.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#if defined(CFG_ENV_IS_IN_FLASH)
|
||||
# ifndef CFG_ENV_ADDR
|
||||
# define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET)
|
||||
# endif
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
# ifndef CFG_ENV_SECT_SIZE
|
||||
# define CFG_ENV_SECT_SIZE CFG_ENV_SIZE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define FLASH_BANK_SIZE 0x800000
|
||||
#define MAIN_SECT_SIZE 0x40000
|
||||
#define PARAM_SECT1_SIZE 0x20000
|
||||
#define PARAM_SECT23_SIZE 0x8000
|
||||
#define PARAM_SECT4_SIZE 0x10000
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
static int write_data (flash_info_t *info, ulong dest, ulong *data);
|
||||
static void write_via_fpu(vu_long *addr, ulong *data);
|
||||
static __inline__ unsigned long get_msr(void);
|
||||
static __inline__ void set_msr(unsigned long msr);
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
#undef DEBUG_FLASH
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef DEBUG_FLASH
|
||||
#define DEBUGF(fmt,args...) printf(fmt ,##args)
|
||||
#else
|
||||
#define DEBUGF(fmt,args...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
#define __align__ __attribute__ ((aligned (8)))
|
||||
static __align__ ulong precmd0[2] = { 0x00aa00aa, 0x00aa00aa };
|
||||
static __align__ ulong precmd1[2] = { 0x00550055, 0x00550055 };
|
||||
static __align__ ulong cmdid[2] = { 0x00900090, 0x00900090 };
|
||||
static __align__ ulong cmderase[2] = { 0x00800080, 0x00800080 };
|
||||
static __align__ ulong cmdersusp[2] = { 0x00b000b0, 0x00b000b0 };
|
||||
static __align__ ulong cmdsecter[2] = { 0x00300030, 0x00300030 };
|
||||
static __align__ ulong cmdprog[2] = { 0x00a000a0, 0x00a000a0 };
|
||||
static __align__ ulong cmdres[2] = { 0x00f000f0, 0x00f000f0 };
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i, j;
|
||||
ulong size = 0;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
vu_long *addr = (vu_long *) (CFG_FLASH_BASE + i * FLASH_BANK_SIZE);
|
||||
|
||||
write_via_fpu (&addr[0xaaa], precmd0);
|
||||
write_via_fpu (&addr[0x554], precmd1);
|
||||
write_via_fpu (&addr[0xaaa], cmdid);
|
||||
|
||||
DEBUGF ("Flash bank # %d:\n"
|
||||
"\tManuf. ID @ 0x%08lX: 0x%08lX\n"
|
||||
"\tDevice ID @ 0x%08lX: 0x%08lX\n",
|
||||
i,
|
||||
(ulong) (&addr[0]), addr[0],
|
||||
(ulong) (&addr[2]), addr[2]);
|
||||
|
||||
if ((addr[0] == addr[1]) && (addr[0] == AMD_MANUFACT) &&
|
||||
(addr[2] == addr[3]) && (addr[2] == AMD_ID_LV160T)) {
|
||||
flash_info[i].flash_id = (FLASH_MAN_AMD & FLASH_VENDMASK) |
|
||||
(FLASH_AM160T & FLASH_TYPEMASK);
|
||||
} else {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
write_via_fpu (addr, cmdres);
|
||||
goto Done;
|
||||
}
|
||||
|
||||
DEBUGF ("flash_id = 0x%08lX\n", flash_info[i].flash_id);
|
||||
|
||||
write_via_fpu (addr, cmdres);
|
||||
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
for (j = 0; j < 32; j++) {
|
||||
flash_info[i].start[j] = CFG_FLASH_BASE +
|
||||
i * FLASH_BANK_SIZE + j * MAIN_SECT_SIZE;
|
||||
}
|
||||
flash_info[i].start[32] =
|
||||
flash_info[i].start[31] + PARAM_SECT1_SIZE;
|
||||
flash_info[i].start[33] =
|
||||
flash_info[i].start[32] + PARAM_SECT23_SIZE;
|
||||
flash_info[i].start[34] =
|
||||
flash_info[i].start[33] + PARAM_SECT23_SIZE;
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE + FLASH_BANK_SIZE
|
||||
flash_protect ( FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[1]);
|
||||
#else
|
||||
flash_protect ( FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
#if CFG_ENV_ADDR >= CFG_FLASH_BASE + FLASH_BANK_SIZE
|
||||
flash_protect ( FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[1]);
|
||||
#else
|
||||
flash_protect ( FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Done:
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch ((i = info->flash_id & FLASH_VENDMASK)) {
|
||||
case (FLASH_MAN_AMD & FLASH_VENDMASK):
|
||||
printf ("Intel: ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor 0x%04x ", i);
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((i = info->flash_id & FLASH_TYPEMASK)) {
|
||||
case (FLASH_AM160T & FLASH_TYPEMASK):
|
||||
printf ("AM29LV160BT (16Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type 0x%04x\n", i);
|
||||
goto Done;
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if ((i % 5) == 0) {
|
||||
printf ("\n ");
|
||||
}
|
||||
printf (" %08lX%s", info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
Done:
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong start, now, last;
|
||||
|
||||
DEBUGF ("Erase flash bank %d sect %d ... %d\n",
|
||||
info - &flash_info[0], s_first, s_last);
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) !=
|
||||
(FLASH_MAN_AMD & FLASH_VENDMASK)) {
|
||||
printf ("Can erase only AMD flash types - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
vu_long *addr = (vu_long *) (info->start[sect]);
|
||||
|
||||
DEBUGF ("Erase sect %d @ 0x%08lX\n", sect, (ulong) addr);
|
||||
|
||||
/* Disable interrupts which might cause a timeout
|
||||
* here.
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
write_via_fpu (&addr[0xaaa], precmd0);
|
||||
write_via_fpu (&addr[0x554], precmd1);
|
||||
write_via_fpu (&addr[0xaaa], cmderase);
|
||||
write_via_fpu (&addr[0xaaa], precmd0);
|
||||
write_via_fpu (&addr[0x554], precmd1);
|
||||
write_via_fpu (&addr[0xaaa], cmdsecter);
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
while (((addr[0] & 0x00800080) != 0x00800080) ||
|
||||
((addr[1] & 0x00800080) != 0x00800080)) {
|
||||
if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
write_via_fpu (addr, cmdersusp);
|
||||
write_via_fpu (addr, cmdres);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
write_via_fpu (addr, cmdres);
|
||||
}
|
||||
}
|
||||
printf (" done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
* 4 - Flash not identified
|
||||
*/
|
||||
|
||||
#define FLASH_WIDTH 8 /* flash bus width in bytes */
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong wp, cp, msr;
|
||||
int l, rc, i;
|
||||
ulong data[2];
|
||||
ulong *datah = &data[0];
|
||||
ulong *datal = &data[1];
|
||||
|
||||
DEBUGF ("Flash write_buff: @ 0x%08lx, src 0x%08lx len %ld\n",
|
||||
addr, (ulong) src, cnt);
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
msr = get_msr ();
|
||||
set_msr (msr | MSR_FP);
|
||||
|
||||
wp = (addr & ~(FLASH_WIDTH - 1)); /* get lower aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
*datah = *datal = 0;
|
||||
|
||||
for (i = 0, cp = wp; i < l; i++, cp++) {
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < FLASH_WIDTH && cnt > 0; ++i) {
|
||||
char tmp;
|
||||
|
||||
tmp = *src;
|
||||
|
||||
src++;
|
||||
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | tmp;
|
||||
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
|
||||
for (; cnt == 0 && i < FLASH_WIDTH; ++i, ++cp) {
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datah << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_data (info, wp, data)) != 0) {
|
||||
set_msr (msr);
|
||||
return (rc);
|
||||
}
|
||||
|
||||
wp += FLASH_WIDTH;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle FLASH_WIDTH aligned part
|
||||
*/
|
||||
while (cnt >= FLASH_WIDTH) {
|
||||
*datah = *(ulong *) src;
|
||||
*datal = *(ulong *) (src + 4);
|
||||
if ((rc = write_data (info, wp, data)) != 0) {
|
||||
set_msr (msr);
|
||||
return (rc);
|
||||
}
|
||||
wp += FLASH_WIDTH;
|
||||
cnt -= FLASH_WIDTH;
|
||||
src += FLASH_WIDTH;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
set_msr (msr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
*datah = *datal = 0;
|
||||
for (i = 0, cp = wp; i < FLASH_WIDTH && cnt > 0; ++i, ++cp) {
|
||||
char tmp;
|
||||
|
||||
tmp = *src;
|
||||
|
||||
src++;
|
||||
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | tmp;
|
||||
|
||||
--cnt;
|
||||
}
|
||||
|
||||
for (; i < FLASH_WIDTH; ++i, ++cp) {
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
rc = write_data (info, wp, data);
|
||||
set_msr (msr);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data (flash_info_t * info, ulong dest, ulong * data)
|
||||
{
|
||||
vu_long *chip = (vu_long *) (info->start[0]);
|
||||
vu_long *addr = (vu_long *) dest;
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if (((addr[0] & data[0]) != data[0]) ||
|
||||
((addr[1] & data[1]) != data[1])) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
write_via_fpu (&chip[0xaaa], precmd0);
|
||||
write_via_fpu (&chip[0x554], precmd1);
|
||||
write_via_fpu (&chip[0xaaa], cmdprog);
|
||||
write_via_fpu (addr, data);
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
start = get_timer (0);
|
||||
|
||||
while (((addr[0] & 0x00800080) != (data[0] & 0x00800080)) ||
|
||||
((addr[1] & 0x00800080) != (data[1] & 0x00800080))) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
write_via_fpu (chip, cmdres);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
write_via_fpu (chip, cmdres);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void write_via_fpu (vu_long * addr, ulong * data)
|
||||
{
|
||||
__asm__ __volatile__ ("lfd 1, 0(%0)"::"r" (data));
|
||||
__asm__ __volatile__ ("stfd 1, 0(%0)"::"r" (addr));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static __inline__ unsigned long get_msr (void)
|
||||
{
|
||||
unsigned long msr;
|
||||
|
||||
__asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
|
||||
|
||||
return msr;
|
||||
}
|
||||
|
||||
static __inline__ void set_msr (unsigned long msr)
|
||||
{
|
||||
__asm__ __volatile__ ("mtmsr %0"::"r" (msr));
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc824x.h>
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
ulong busfreq = get_bus_freq(0);
|
||||
char buf[32];
|
||||
|
||||
printf("Board: SL8245, local bus @ %s MHz\n", strmhz(buf, busfreq));
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
#ifndef CFG_RAMBOOT
|
||||
int i, cnt;
|
||||
volatile uchar * base= CFG_SDRAM_BASE;
|
||||
volatile ulong * addr;
|
||||
ulong save[32];
|
||||
ulong val, ret = 0;
|
||||
|
||||
for (i=0, cnt=(CFG_MAX_RAM_SIZE / sizeof(long)) >> 1; cnt > 0; cnt >>= 1) {
|
||||
addr = (volatile ulong *)base + cnt;
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
addr = (volatile ulong *)base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
if (*addr != 0) {
|
||||
*addr = save[i];
|
||||
goto Done;
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt < CFG_MAX_RAM_SIZE / sizeof(long); cnt <<= 1) {
|
||||
addr = (volatile ulong *)base + cnt;
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
if (val != ~cnt) {
|
||||
ulong new_bank0_end = cnt * sizeof(long) - 1;
|
||||
ulong mear1 = mpc824x_mpc107_getreg(MEAR1);
|
||||
ulong emear1 = mpc824x_mpc107_getreg(EMEAR1);
|
||||
mear1 = (mear1 & 0xFFFFFF00) |
|
||||
((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT);
|
||||
emear1 = (emear1 & 0xFFFFFF00) |
|
||||
((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT);
|
||||
mpc824x_mpc107_setreg(MEAR1, mear1);
|
||||
mpc824x_mpc107_setreg(EMEAR1, emear1);
|
||||
|
||||
ret = cnt * sizeof(long);
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
|
||||
ret = CFG_MAX_RAM_SIZE;
|
||||
Done:
|
||||
return ret;
|
||||
#else
|
||||
return CFG_MAX_RAM_SIZE;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc824x/start.o (.text)
|
||||
lib_ppc/board.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
. = DEFINED(env_offset) ? env_offset : .;
|
||||
common/environment.o (.text)
|
||||
|
||||
*(.text)
|
||||
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(4096);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(4096);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
+61
-18
@@ -209,6 +209,10 @@ void flash_print_info (flash_info_t *info)
|
||||
#ifdef CONFIG_TQM8xxM /* mirror bit flash */
|
||||
case FLASH_AMLV128U: printf ("AM29LV128ML (128Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AMLV320U: printf ("AM29LV320ML (32Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AMLV640U: printf ("AM29LV640ML (64Mbit, uniform sector size)\n");
|
||||
break;
|
||||
# else /* ! TQM8xxM */
|
||||
case FLASH_AM400B: printf ("AM29LV400B (4 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
@@ -218,15 +222,15 @@ void flash_print_info (flash_info_t *info)
|
||||
break;
|
||||
case FLASH_AM800T: printf ("AM29LV800T (8 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM160B: printf ("AM29LV160B (16 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM160T: printf ("AM29LV160T (16 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM320B: printf ("AM29LV320B (32 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM320T: printf ("AM29LV320T (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
#endif /* TQM8xxM */
|
||||
case FLASH_AM160B: printf ("AM29LV160B (16 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM160T: printf ("AM29LV160T (16 Mbit, top boot sector)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
@@ -294,6 +298,14 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
switch (value) {
|
||||
#ifdef CONFIG_TQM8xxM /* mirror bit flash */
|
||||
case AMD_ID_MIRROR:
|
||||
/* Special case for AMLV320MH/L */
|
||||
if ((addr[14] & 0x00ff00ff) == 0x001d001d &&
|
||||
(addr[15] & 0x00ff00ff) == 0x00000000) {
|
||||
info->flash_id += FLASH_AMLV320U;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00800000; /* => 8 MB */
|
||||
break;
|
||||
}
|
||||
switch(addr[14]) {
|
||||
case AMD_ID_LV128U_2:
|
||||
if (addr[15] != AMD_ID_LV128U_3) {
|
||||
@@ -305,6 +317,16 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
info->size = 0x02000000;
|
||||
}
|
||||
break; /* => 32 MB */
|
||||
case AMD_ID_LV640U_2:
|
||||
if (addr[15] != AMD_ID_LV640U_3) {
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
else {
|
||||
info->flash_id += FLASH_AMLV640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x01000000;
|
||||
}
|
||||
break; /* => 16 MB */
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
@@ -335,18 +357,6 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case AMD_ID_LV160T:
|
||||
info->flash_id += FLASH_AM160T;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case AMD_ID_LV160B:
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case AMD_ID_LV320T:
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 71;
|
||||
@@ -359,6 +369,19 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 MB */
|
||||
#endif /* TQM8xxM */
|
||||
|
||||
case AMD_ID_LV160T:
|
||||
info->flash_id += FLASH_AM160T;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case AMD_ID_LV160B:
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
@@ -371,6 +394,8 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
/* only known types here - no default */
|
||||
case FLASH_AMLV128U:
|
||||
case FLASH_AMLV640U:
|
||||
case FLASH_AMLV320U:
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base;
|
||||
base += 0x20000;
|
||||
@@ -381,7 +406,6 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
# else /* ! TQM8xxM */
|
||||
case AMD_ID_LV400B:
|
||||
case AMD_ID_LV800B:
|
||||
case AMD_ID_LV160B:
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00008000;
|
||||
@@ -393,7 +417,6 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
break;
|
||||
case AMD_ID_LV400T:
|
||||
case AMD_ID_LV800T:
|
||||
case AMD_ID_LV160T:
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
@@ -428,6 +451,26 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
}
|
||||
break;
|
||||
#endif /* TQM8xxM */
|
||||
case AMD_ID_LV160B:
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00008000;
|
||||
info->start[2] = base + 0x0000C000;
|
||||
info->start[3] = base + 0x00010000;
|
||||
for (i = 4; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00020000) - 0x00060000;
|
||||
}
|
||||
break;
|
||||
case AMD_ID_LV160T:
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
info->start[i--] = base + info->size - 0x0000C000;
|
||||
info->start[i--] = base + info->size - 0x00010000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00020000;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return (0);
|
||||
break;
|
||||
|
||||
+2
-2
@@ -298,8 +298,8 @@ int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(kbd) = MK_CMD_ENTRY(
|
||||
"kbd", 1, 1, do_kbd,
|
||||
U_BOOT_CMD(
|
||||
kbd, 1, 1, do_kbd,
|
||||
"kbd - read keyboard status\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
+2
-3
@@ -27,7 +27,6 @@
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
|
||||
#include "vpd.h"
|
||||
#include "cmd_bsp.h"
|
||||
|
||||
/* ======================================================================
|
||||
* Interpreter command to retrieve board specific Vital Product Data, "VPD"
|
||||
@@ -57,8 +56,8 @@ int do_vpd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(vpd) = MK_CMD_ENTRY(
|
||||
"vpd", 2, 1, do_vpd,
|
||||
U_BOOT_CMD(
|
||||
vpd, 2, 1, do_vpd,
|
||||
"vpd - Read Vital Product Data\n",
|
||||
"[dev_addr]\n"
|
||||
" - Read VPD Data from default address, or device address 'dev_addr'.\n"
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include <hush.h>
|
||||
#endif
|
||||
|
||||
#define AUTOSCRIPT_MAGIC 0x09011962
|
||||
#if defined(CONFIG_AUTOSCRIPT) || \
|
||||
(CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT )
|
||||
|
||||
@@ -172,8 +171,8 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
|
||||
cmd_tbl_t U_BOOT_CMD(AUTOSCRIPT) = MK_CMD_ENTRY(
|
||||
"autoscr", 2, 0, do_autoscript,
|
||||
U_BOOT_CMD(
|
||||
autoscr, 2, 0, do_autoscript,
|
||||
"autoscr - run script from memory\n",
|
||||
"[addr] - run script starting at addr"
|
||||
" - A valid autoscr header must be present\n"
|
||||
|
||||
+3
-2
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <net.h> /* for print_IPaddr */
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BDI)
|
||||
@@ -171,8 +172,8 @@ static void print_str(const char *name, const char *str)
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BDINFO) = MK_CMD_ENTRY(
|
||||
"bdinfo", 1, 1, do_bdinfo,
|
||||
U_BOOT_CMD(
|
||||
bdinfo, 1, 1, do_bdinfo,
|
||||
"bdinfo - print Board Info structure\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
+16
-16
@@ -108,8 +108,8 @@ int do_bedbug_dis (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
dis_last_len = len;
|
||||
return 0;
|
||||
} /* do_bedbug_dis */
|
||||
cmd_tbl_t U_BOOT_CMD(DIS) = MK_CMD_ENTRY(
|
||||
"ds", 3, 1, do_bedbug_dis,
|
||||
U_BOOT_CMD(
|
||||
ds, 3, 1, do_bedbug_dis,
|
||||
"ds - disassemble memory\n",
|
||||
"ds <address> [# instructions]\n"
|
||||
);
|
||||
@@ -165,8 +165,8 @@ int do_bedbug_asm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
return rcode;
|
||||
} /* do_bedbug_asm */
|
||||
cmd_tbl_t U_BOOT_CMD(ASM) = MK_CMD_ENTRY(
|
||||
"as", 2, 0, do_bedbug_asm,
|
||||
U_BOOT_CMD(
|
||||
as, 2, 0, do_bedbug_asm,
|
||||
"as - assemble memory\n",
|
||||
"as <address>\n"
|
||||
);
|
||||
@@ -184,8 +184,8 @@ int do_bedbug_break (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
|
||||
} /* do_bedbug_break */
|
||||
cmd_tbl_t U_BOOT_CMD(BREAK) = MK_CMD_ENTRY(
|
||||
"break", 3, 0, do_bedbug_break,
|
||||
U_BOOT_CMD(
|
||||
break, 3, 0, do_bedbug_break,
|
||||
"break - set or clear a breakpoint\n",
|
||||
" - Set or clear a breakpoint\n"
|
||||
"break <address> - Break at an address\n"
|
||||
@@ -288,8 +288,8 @@ int do_bedbug_continue (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
bug_ctx.stopped = 0;
|
||||
return 0;
|
||||
} /* do_bedbug_continue */
|
||||
cmd_tbl_t U_BOOT_CMD(CONTINUE) = MK_CMD_ENTRY(
|
||||
"continue", 1, 0, do_bedbug_continue,
|
||||
U_BOOT_CMD(
|
||||
continue, 1, 0, do_bedbug_continue,
|
||||
"continue- continue from a breakpoint\n",
|
||||
" - continue from a breakpoint.\n"
|
||||
);
|
||||
@@ -320,8 +320,8 @@ int do_bedbug_step (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
bug_ctx.stopped = 0;
|
||||
return 0;
|
||||
} /* do_bedbug_step */
|
||||
cmd_tbl_t U_BOOT_CMD(STEP) = MK_CMD_ENTRY(
|
||||
"step", 1, 1, do_bedbug_step,
|
||||
U_BOOT_CMD(
|
||||
step, 1, 1, do_bedbug_step,
|
||||
"step - single step execution.\n",
|
||||
" - single step execution.\n"
|
||||
);
|
||||
@@ -352,8 +352,8 @@ int do_bedbug_next (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
bug_ctx.stopped = 0;
|
||||
return 0;
|
||||
} /* do_bedbug_next */
|
||||
cmd_tbl_t U_BOOT_CMD(NEXT) = MK_CMD_ENTRY(
|
||||
"next", 1, 1, do_bedbug_next,
|
||||
U_BOOT_CMD(
|
||||
next, 1, 1, do_bedbug_next,
|
||||
"next - single step execution, stepping over subroutines.\n",
|
||||
" - single step execution, stepping over subroutines.\n"
|
||||
);
|
||||
@@ -401,8 +401,8 @@ int do_bedbug_stack (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
return 0;
|
||||
} /* do_bedbug_stack */
|
||||
cmd_tbl_t U_BOOT_CMD(STACK) = MK_CMD_ENTRY(
|
||||
"where", 1, 1, do_bedbug_stack,
|
||||
U_BOOT_CMD(
|
||||
where, 1, 1, do_bedbug_stack,
|
||||
"where - Print the running stack.\n",
|
||||
" - Print the running stack.\n"
|
||||
);
|
||||
@@ -424,8 +424,8 @@ int do_bedbug_rdump (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
show_regs( bug_ctx.regs );
|
||||
return 0;
|
||||
} /* do_bedbug_rdump */
|
||||
cmd_tbl_t U_BOOT_CMD(RDUMP) = MK_CMD_ENTRY(
|
||||
"rdump", 1, 1, do_bedbug_rdump,
|
||||
U_BOOT_CMD(
|
||||
rdump, 1, 1, do_bedbug_rdump,
|
||||
"rdump - Show registers.\n",
|
||||
" - Show registers.\n"
|
||||
);
|
||||
|
||||
+8
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Dtlev Zundel, DENX Software Engineering, dzu@denx.de.
|
||||
* Detlev Zundel, DENX Software Engineering, dzu@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -73,6 +73,13 @@ int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
bmp, 3, 1, do_bmp,
|
||||
"bmp - manipulate BMP image data\n",
|
||||
"info <imageAddr> - display image info\n"
|
||||
"bmp display <imageAddr> - display image\n"
|
||||
);
|
||||
|
||||
/*
|
||||
* Subroutine: bmp_info
|
||||
*
|
||||
|
||||
+4
-5
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_autoscript.h>
|
||||
#include <net.h>
|
||||
#include <syscall.h>
|
||||
|
||||
@@ -60,8 +59,8 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(GO) = MK_CMD_ENTRY(
|
||||
"go", CFG_MAXARGS, 1, do_go,
|
||||
U_BOOT_CMD(
|
||||
go, CFG_MAXARGS, 1, do_go,
|
||||
"go - start application at address 'addr'\n",
|
||||
"addr [arg ...]\n - start application at address 'addr'\n"
|
||||
" passing 'arg' as arguments\n"
|
||||
@@ -69,8 +68,8 @@ cmd_tbl_t U_BOOT_CMD(GO) = MK_CMD_ENTRY(
|
||||
|
||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(RESET) = MK_CMD_ENTRY(
|
||||
"reset", 1, 0, do_reset,
|
||||
U_BOOT_CMD(
|
||||
reset, 1, 0, do_reset,
|
||||
"reset - Perform RESET of the CPU\n",
|
||||
NULL
|
||||
);
|
||||
+14
-6
@@ -381,8 +381,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTM) = MK_CMD_ENTRY(
|
||||
"bootm", CFG_MAXARGS, 1, do_bootm,
|
||||
U_BOOT_CMD(
|
||||
bootm, CFG_MAXARGS, 1, do_bootm,
|
||||
"bootm - boot application image from memory\n",
|
||||
"[addr [arg ...]]\n - boot application image stored in memory\n"
|
||||
" passing arguments 'arg ...'; when booting a Linux kernel,\n"
|
||||
@@ -872,8 +872,15 @@ int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return rcode;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTD) = MK_CMD_ENTRY(
|
||||
"bootd", 1, 1, do_bootd,
|
||||
U_BOOT_CMD(
|
||||
boot, 1, 1, do_bootd,
|
||||
"boot - boot default, i.e., run 'bootcmd'\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
/* keep old command name "bootd" for backward compatibility */
|
||||
U_BOOT_CMD(
|
||||
bootd, 1, 1, do_bootd,
|
||||
"bootd - boot default, i.e., run 'bootcmd'\n",
|
||||
NULL
|
||||
);
|
||||
@@ -938,8 +945,9 @@ static int image_info (ulong addr)
|
||||
printf ("OK\n");
|
||||
return 0;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(IMINFO) = MK_CMD_ENTRY(
|
||||
"iminfo", CFG_MAXARGS, 1, do_iminfo,
|
||||
|
||||
U_BOOT_CMD(
|
||||
iminfo, CFG_MAXARGS, 1, do_iminfo,
|
||||
"iminfo - print header information for application image\n",
|
||||
"addr [addr ...]\n"
|
||||
" - print header information for application image starting at\n"
|
||||
|
||||
+4
-4
@@ -95,15 +95,15 @@ static int on_off (const char *s)
|
||||
}
|
||||
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(ICACHE) = MK_CMD_ENTRY(
|
||||
"icache", 2, 1, do_icache,
|
||||
U_BOOT_CMD(
|
||||
icache, 2, 1, do_icache,
|
||||
"icache - enable or disable instruction cache\n",
|
||||
"[on, off]\n"
|
||||
" - enable or disable instruction cache\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DCACHE) = MK_CMD_ENTRY(
|
||||
"dcache", 2, 1, do_dcache,
|
||||
U_BOOT_CMD(
|
||||
dcache, 2, 1, do_dcache,
|
||||
"dcache - enable or disable data cache\n",
|
||||
"[on, off]\n"
|
||||
" - enable or disable data (writethrough) cache\n"
|
||||
|
||||
@@ -62,8 +62,8 @@ int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(CONINFO) = MK_CMD_ENTRY(
|
||||
"coninfo", 3, 1, do_coninfo,
|
||||
U_BOOT_CMD(
|
||||
coninfo, 3, 1, do_coninfo,
|
||||
"coninfo - print console devices and informations\n",
|
||||
""
|
||||
);
|
||||
|
||||
+2
-2
@@ -191,8 +191,8 @@ int mk_date (char *datestr, struct rtc_time *tmp)
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DATE) = MK_CMD_ENTRY(
|
||||
"date", 2, 1, do_date,
|
||||
U_BOOT_CMD(
|
||||
date, 2, 1, do_date,
|
||||
"date - get/set/reset date & time\n",
|
||||
"[MMDDhhmm[[CC]YY][.ss]]\ndate reset\n"
|
||||
" - without arguments: print date & time\n"
|
||||
|
||||
+4
-4
@@ -106,13 +106,13 @@ int do_setdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(GETDCR) = MK_CMD_ENTRY(
|
||||
"getdcr", 2, 1, do_getdcr,
|
||||
U_BOOT_CMD(
|
||||
getdcr, 2, 1, do_getdcr,
|
||||
"getdcr - Get an IBM PPC 4xx DCR's value\n",
|
||||
"dcrn - return a DCR's value.\n"
|
||||
);
|
||||
cmd_tbl_t U_BOOT_CMD(SETDCR) = MK_CMD_ENTRY(
|
||||
"setdcr", 2, 1, do_setdcr,
|
||||
U_BOOT_CMD(
|
||||
setdcr, 2, 1, do_setdcr,
|
||||
"setdcr - Set an IBM PPC 4xx DCR's value\n",
|
||||
"dcrn - set a DCR's value.\n"
|
||||
);
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DIAG) = MK_CMD_ENTRY(
|
||||
"diag", CFG_MAXARGS, 0, do_diag,
|
||||
U_BOOT_CMD(
|
||||
diag, CFG_MAXARGS, 0, do_diag,
|
||||
"diag - perform board diagnostics\n",
|
||||
" - print list of available tests\n"
|
||||
"diag [test1 [test2]]\n"
|
||||
|
||||
+4
-4
@@ -170,8 +170,8 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return rcode;
|
||||
}
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(DOC) = MK_CMD_ENTRY(
|
||||
"doc", 5, 1, do_doc,
|
||||
U_BOOT_CMD(
|
||||
doc, 5, 1, do_doc,
|
||||
"doc - Disk-On-Chip sub-system\n",
|
||||
"info - show available DOC devices\n"
|
||||
"doc device [dev] - show or set current device\n"
|
||||
@@ -284,8 +284,8 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return rcode;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DOCBOOT) = MK_CMD_ENTRY(
|
||||
"docboot", 4, 1, do_docboot,
|
||||
U_BOOT_CMD(
|
||||
docboot, 4, 1, do_docboot,
|
||||
"docboot - boot from DOC device\n",
|
||||
"loadAddr dev\n"
|
||||
);
|
||||
|
||||
+2
-2
@@ -47,8 +47,8 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DTT) = MK_CMD_ENTRY(
|
||||
"dtt", 1, 1, do_dtt,
|
||||
U_BOOT_CMD(
|
||||
dtt, 1, 1, do_dtt,
|
||||
"dtt - Digital Thermometer and Themostat\n",
|
||||
" - Read temperature from digital thermometer and thermostat.\n"
|
||||
);
|
||||
|
||||
+4
-4
@@ -376,16 +376,16 @@ void eeprom_init (void)
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_EEPROM)
|
||||
|
||||
#ifdef CFG_I2C_MULTI_EEPROMS
|
||||
cmd_tbl_t U_BOOT_CMD(EEPROM) = MK_CMD_ENTRY(
|
||||
"eeprom", 6, 1, do_eeprom,
|
||||
U_BOOT_CMD(
|
||||
eeprom, 6, 1, do_eeprom,
|
||||
"eeprom - EEPROM sub-system\n",
|
||||
"read devaddr addr off cnt\n"
|
||||
"eeprom write devaddr addr off cnt\n"
|
||||
" - read/write `cnt' bytes from `devaddr` EEPROM at offset `off'\n"
|
||||
);
|
||||
#else /* One EEPROM */
|
||||
cmd_tbl_t U_BOOT_CMD(EEPROM) = MK_CMD_ENTRY(
|
||||
"eeprom", 5, 1, do_eeprom,
|
||||
U_BOOT_CMD(
|
||||
eeprom, 5, 1, do_eeprom,
|
||||
"eeprom - EEPROM sub-system\n",
|
||||
"read addr off cnt\n"
|
||||
"eeprom write addr off cnt\n"
|
||||
|
||||
+4
-4
@@ -321,14 +321,14 @@ unsigned long load_elf_image (unsigned long addr)
|
||||
}
|
||||
|
||||
/* ====================================================================== */
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTELF) = MK_CMD_ENTRY(
|
||||
"bootelf", 2, 0, do_bootelf,
|
||||
U_BOOT_CMD(
|
||||
bootelf, 2, 0, do_bootelf,
|
||||
"bootelf - Boot from an ELF image in memory\n",
|
||||
" [address] - load address of ELF image.\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTVX) = MK_CMD_ENTRY(
|
||||
"bootvx", 2, 0, do_bootvx,
|
||||
U_BOOT_CMD(
|
||||
bootvx, 2, 0, do_bootvx,
|
||||
"bootvx - Boot vxWorks from an ELF image\n",
|
||||
" [address] - load address of vxWorks ELF image.\n"
|
||||
);
|
||||
|
||||
+22
-1
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_autoscript.h>
|
||||
#include <s_record.h>
|
||||
#include <net.h>
|
||||
#include <ata.h>
|
||||
@@ -63,6 +62,14 @@ int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return size;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
fatload, 4, 0, do_fat_fsload,
|
||||
"fatload - load binary file from a dos filesystem\n",
|
||||
"[ off ] [ filename ]\n"
|
||||
" - load binary file from dos filesystem\n"
|
||||
" with offset 'off'\n"
|
||||
);
|
||||
|
||||
int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
char *filename = "/";
|
||||
@@ -76,6 +83,13 @@ int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return (ret);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
fatls, 2, 1, do_fat_ls,
|
||||
"fatls - list files in a directory (default /)\n",
|
||||
"[ directory ]\n"
|
||||
" - list files in a directory\n"
|
||||
);
|
||||
|
||||
int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
@@ -87,6 +101,13 @@ int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return (ret);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
fatinfo, 1, 1, do_fat_fsinfo,
|
||||
"fatinfo - print information about filesystem\n",
|
||||
"\n"
|
||||
" - print information about filesystem\n"
|
||||
);
|
||||
|
||||
#ifdef NOT_IMPLEMENTED_YET
|
||||
/* find first device whose first partition is a DOS filesystem */
|
||||
int find_fat_partition (void)
|
||||
|
||||
+2
-2
@@ -888,8 +888,8 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_FDC)
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(FDC) = MK_CMD_ENTRY(
|
||||
"fdcboot", 3, 1, do_fdcboot,
|
||||
U_BOOT_CMD(
|
||||
fdcboot, 3, 1, do_fdcboot,
|
||||
"fdcboot - boot from floppy device\n",
|
||||
"loadAddr drive\n"
|
||||
);
|
||||
|
||||
+4
-4
@@ -142,14 +142,14 @@ int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return (dos_dir ());
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(FDOS_BOOT) = MK_CMD_ENTRY(
|
||||
"fdosboot", 3, 0, do_fdosboot,
|
||||
U_BOOT_CMD(
|
||||
fdosboot, 3, 0, do_fdosboot,
|
||||
"fdosboot- boot from a dos floppy file\n",
|
||||
"[loadAddr] [filename]\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(FDOS_LS) = MK_CMD_ENTRY(
|
||||
"fdosls", 2, 0, do_fdosls,
|
||||
U_BOOT_CMD(
|
||||
fdosls, 2, 0, do_fdosls,
|
||||
"fdosls - list files in a directory\n",
|
||||
"[directory]\n"
|
||||
);
|
||||
|
||||
+6
-6
@@ -440,15 +440,15 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
|
||||
|
||||
/**************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(FLINFO) = MK_CMD_ENTRY(
|
||||
"flinfo", 2, 1, do_flinfo,
|
||||
U_BOOT_CMD(
|
||||
flinfo, 2, 1, do_flinfo,
|
||||
"flinfo - print FLASH memory information\n",
|
||||
"\n - print information for all FLASH memory banks\n"
|
||||
"flinfo N\n - print information for FLASH memory bank # N\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(ERASE) = MK_CMD_ENTRY(
|
||||
"erase", 3, 1, do_flerase,
|
||||
U_BOOT_CMD(
|
||||
erase, 3, 1, do_flerase,
|
||||
"erase - erase FLASH memory\n",
|
||||
"start end\n"
|
||||
" - erase FLASH from addr 'start' to addr 'end'\n"
|
||||
@@ -457,8 +457,8 @@ cmd_tbl_t U_BOOT_CMD(ERASE) = MK_CMD_ENTRY(
|
||||
"erase all\n - erase all FLASH banks\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(PROTECT) = MK_CMD_ENTRY(
|
||||
"protect", 4, 1, do_protect,
|
||||
U_BOOT_CMD(
|
||||
protect, 4, 1, do_protect,
|
||||
"protect - enable or disable FLASH write protection\n",
|
||||
"on start end\n"
|
||||
" - protect FLASH from addr 'start' to addr 'end'\n"
|
||||
|
||||
+2
-3
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_bsp.h>
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
||||
#include <net.h>
|
||||
#endif
|
||||
@@ -155,8 +154,8 @@ static int fpga_get_op( char *opstr )
|
||||
return op;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(FPGA) = MK_CMD_ENTRY(
|
||||
"fpga", 6, 1, do_fpga,
|
||||
U_BOOT_CMD(
|
||||
fpga, 6, 1, do_fpga,
|
||||
"fpga - loadable FPGA image support\n",
|
||||
"fpga [operation type] [device number] [image address] [image size]\n"
|
||||
"fpga operations:\n"
|
||||
|
||||
+16
-16
@@ -867,38 +867,38 @@ int do_sdram ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IMD) = MK_CMD_ENTRY(
|
||||
"imd", 4, 1, do_i2c_md, \
|
||||
U_BOOT_CMD(
|
||||
imd, 4, 1, do_i2c_md, \
|
||||
"imd - i2c memory display\n", \
|
||||
"chip address[.0, .1, .2] [# of objects]\n - i2c memory display\n" \
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IMM) = MK_CMD_ENTRY(
|
||||
"imm", 3, 1, do_i2c_mm,
|
||||
U_BOOT_CMD(
|
||||
imm, 3, 1, do_i2c_mm,
|
||||
"imm - i2c memory modify (auto-incrementing)\n",
|
||||
"chip address[.0, .1, .2]\n"
|
||||
" - memory modify, auto increment address\n"
|
||||
);
|
||||
cmd_tbl_t U_BOOT_CMD(INM) = MK_CMD_ENTRY(
|
||||
"inm", 3, 1, do_i2c_nm,
|
||||
U_BOOT_CMD(
|
||||
inm, 3, 1, do_i2c_nm,
|
||||
"inm - memory modify (constant address)\n",
|
||||
"chip address[.0, .1, .2]\n - memory modify, read and keep address\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IMW) = MK_CMD_ENTRY(
|
||||
"imw", 5, 1, do_i2c_mw,
|
||||
U_BOOT_CMD(
|
||||
imw, 5, 1, do_i2c_mw,
|
||||
"imw - memory write (fill)\n",
|
||||
"chip address[.0, .1, .2] value [count]\n - memory write (fill)\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(ICRC) = MK_CMD_ENTRY(
|
||||
"icrc32", 5, 1, do_i2c_crc,
|
||||
U_BOOT_CMD(
|
||||
icrc32, 5, 1, do_i2c_crc,
|
||||
"icrc32 - checksum calculation\n",
|
||||
"chip address[.0, .1, .2] count\n - compute CRC32 checksum\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IPROBE) = MK_CMD_ENTRY(
|
||||
"iprobe", 1, 1, do_i2c_probe,
|
||||
U_BOOT_CMD(
|
||||
iprobe, 1, 1, do_i2c_probe,
|
||||
"iprobe - probe to discover valid I2C chip addresses\n",
|
||||
"\n -discover valid I2C chip addresses\n"
|
||||
);
|
||||
@@ -906,16 +906,16 @@ cmd_tbl_t U_BOOT_CMD(IPROBE) = MK_CMD_ENTRY(
|
||||
/*
|
||||
* Require full name for "iloop" because it is an infinite loop!
|
||||
*/
|
||||
cmd_tbl_t U_BOOT_CMD(ILOOP) = MK_CMD_ENTRY(
|
||||
"iloop", 5, 1, do_i2c_loop,
|
||||
U_BOOT_CMD(
|
||||
iloop, 5, 1, do_i2c_loop,
|
||||
"iloop - infinite loop on address range\n",
|
||||
"chip address[.0, .1, .2] [# of objects]\n"
|
||||
" - loop, reading a set of addresses\n"
|
||||
);
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
|
||||
cmd_tbl_t U_BOOT_CMD(ISDRAM) = MK_CMD_ENTRY(
|
||||
"isdram", 2, 1, do_sdram,
|
||||
U_BOOT_CMD(
|
||||
isdram, 2, 1, do_sdram,
|
||||
"isdram - print SDRAM configuration information\n",
|
||||
"chip\n - print SDRAM configuration information\n"
|
||||
" (valid chip values 50..57)\n"
|
||||
|
||||
+4
-5
@@ -39,7 +39,6 @@
|
||||
#endif
|
||||
#include <ide.h>
|
||||
#include <ata.h>
|
||||
#include <cmd_disk.h>
|
||||
#ifdef CONFIG_STATUS_LED
|
||||
# include <status_led.h>
|
||||
#endif
|
||||
@@ -1811,8 +1810,8 @@ ulong atapi_read (int device, ulong blknr, ulong blkcnt, ulong *buffer)
|
||||
|
||||
#endif /* CONFIG_ATAPI */
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IDE) = MK_CMD_ENTRY(
|
||||
"ide", 5, 1, do_ide,
|
||||
U_BOOT_CMD(
|
||||
ide, 5, 1, do_ide,
|
||||
"ide - IDE sub-system\n",
|
||||
"reset - reset IDE controller\n"
|
||||
"ide info - show available IDE devices\n"
|
||||
@@ -1824,8 +1823,8 @@ cmd_tbl_t U_BOOT_CMD(IDE) = MK_CMD_ENTRY(
|
||||
" to/from memory address `addr'\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DISK) = MK_CMD_ENTRY(
|
||||
"diskboot", 3, 1, do_diskboot,
|
||||
U_BOOT_CMD(
|
||||
diskboot, 3, 1, do_diskboot,
|
||||
"diskboot- boot from IDE device\n",
|
||||
"loadAddr dev:part\n"
|
||||
);
|
||||
|
||||
+34
-34
@@ -594,106 +594,106 @@ do_mccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SIUINFO) = MK_CMD_ENTRY(
|
||||
"siuinfo", 1, 1, do_siuinfo,
|
||||
U_BOOT_CMD(
|
||||
siuinfo, 1, 1, do_siuinfo,
|
||||
"siuinfo - print System Interface Unit (SIU) registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MEMCINFO) = MK_CMD_ENTRY(
|
||||
"memcinfo", 1, 1, do_memcinfo,
|
||||
U_BOOT_CMD(
|
||||
memcinfo, 1, 1, do_memcinfo,
|
||||
"memcinfo- print Memory Controller registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SITINFO) = MK_CMD_ENTRY(
|
||||
"sitinfo", 1, 1, do_sitinfo,
|
||||
U_BOOT_CMD(
|
||||
sitinfo, 1, 1, do_sitinfo,
|
||||
"sitinfo - print System Integration Timers (SIT) registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
#ifdef CONFIG_8260
|
||||
cmd_tbl_t U_BOOT_CMD(ICINFO) = MK_CMD_ENTRY(
|
||||
"icinfo", 1, 1, do_icinfo,
|
||||
U_BOOT_CMD(
|
||||
icinfo, 1, 1, do_icinfo,
|
||||
"icinfo - print Interrupt Controller registers\n",
|
||||
NULL
|
||||
);
|
||||
#endif
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(CARINFO) = MK_CMD_ENTRY(
|
||||
"carinfo", 1, 1, do_carinfo,
|
||||
U_BOOT_CMD(
|
||||
carinfo, 1, 1, do_carinfo,
|
||||
"carinfo - print Clocks and Reset registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IOPINFO) = MK_CMD_ENTRY(
|
||||
"iopinfo", 1, 1, do_iopinfo,
|
||||
U_BOOT_CMD(
|
||||
iopinfo, 1, 1, do_iopinfo,
|
||||
"iopinfo - print I/O Port registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IOPSET) = MK_CMD_ENTRY(
|
||||
"iopset", 5, 0, do_iopset,
|
||||
U_BOOT_CMD(
|
||||
iopset, 5, 0, do_iopset,
|
||||
"iopset - set I/O Port registers\n",
|
||||
"PORT PIN CMD VALUE\nPORT: A-D, PIN: 0-31, CMD: [dat|dir|odr|sor], VALUE: 0|1"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DMAINFO) = MK_CMD_ENTRY(
|
||||
"dmainfo", 1, 1, do_dmainfo,
|
||||
U_BOOT_CMD(
|
||||
dmainfo, 1, 1, do_dmainfo,
|
||||
"dmainfo - print SDMA/IDMA registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(FCCINFO) = MK_CMD_ENTRY(
|
||||
"fccinfo", 1, 1, do_fccinfo,
|
||||
U_BOOT_CMD(
|
||||
fccinfo, 1, 1, do_fccinfo,
|
||||
"fccinfo - print FCC registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BRGINFO) = MK_CMD_ENTRY(
|
||||
"brginfo", 1, 1, do_brginfo,
|
||||
U_BOOT_CMD(
|
||||
brginfo, 1, 1, do_brginfo,
|
||||
"brginfo - print Baud Rate Generator (BRG) registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(I2CINFO) = MK_CMD_ENTRY(
|
||||
"i2cinfo", 1, 1, do_i2cinfo,
|
||||
U_BOOT_CMD(
|
||||
i2cinfo, 1, 1, do_i2cinfo,
|
||||
"i2cinfo - print I2C registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SCCINFO) = MK_CMD_ENTRY(
|
||||
"sccinfo", 1, 1, do_sccinfo,
|
||||
U_BOOT_CMD(
|
||||
sccinfo, 1, 1, do_sccinfo,
|
||||
"sccinfo - print SCC registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SMCINFO) = MK_CMD_ENTRY(
|
||||
"smcinfo", 1, 1, do_smcinfo,
|
||||
U_BOOT_CMD(
|
||||
smcinfo, 1, 1, do_smcinfo,
|
||||
"smcinfo - print SMC registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SPIINFO) = MK_CMD_ENTRY(
|
||||
"spiinfo", 1, 1, do_spiinfo,
|
||||
U_BOOT_CMD(
|
||||
spiinfo, 1, 1, do_spiinfo,
|
||||
"spiinfo - print Serial Peripheral Interface (SPI) registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MUXINFO) = MK_CMD_ENTRY(
|
||||
"muxinfo", 1, 1, do_muxinfo,
|
||||
U_BOOT_CMD(
|
||||
muxinfo, 1, 1, do_muxinfo,
|
||||
"muxinfo - print CPM Multiplexing registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SIINFO) = MK_CMD_ENTRY(
|
||||
"siinfo", 1, 1, do_siinfo,
|
||||
U_BOOT_CMD(
|
||||
siinfo, 1, 1, do_siinfo,
|
||||
"siinfo - print Serial Interface (SI) registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MCCINFO) = MK_CMD_ENTRY(
|
||||
"mccinfo", 1, 1, do_mccinfo,
|
||||
U_BOOT_CMD(
|
||||
mccinfo, 1, 1, do_mccinfo,
|
||||
"mccinfo - print MCC registers\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
+8
-8
@@ -186,29 +186,29 @@ do_jffs2_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(JFFS2_FSLOAD) = MK_CMD_ENTRY(
|
||||
"fsload", 3, 0, do_jffs2_fsload,
|
||||
U_BOOT_CMD(
|
||||
fsload, 3, 0, do_jffs2_fsload,
|
||||
"fsload - load binary file from a filesystem image\n",
|
||||
"[ off ] [ filename ]\n"
|
||||
" - load binary file from flash bank\n"
|
||||
" with offset 'off'\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(JFFS2_FSINFO) = MK_CMD_ENTRY(
|
||||
"fsinfo", 1, 1, do_jffs2_fsinfo,
|
||||
U_BOOT_CMD(
|
||||
fsinfo, 1, 1, do_jffs2_fsinfo,
|
||||
"fsinfo - print information about filesystems\n",
|
||||
" - print information about filesystems\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(JFFS2_LS) = MK_CMD_ENTRY(
|
||||
"ls", 2, 1, do_jffs2_ls,
|
||||
U_BOOT_CMD(
|
||||
ls, 2, 1, do_jffs2_ls,
|
||||
"ls - list files in a directory (default /)\n",
|
||||
"[ directory ]\n"
|
||||
" - list files in a directory.\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(JFFS2_CHPART) = MK_CMD_ENTRY(
|
||||
"chpart", 2, 0, do_jffs2_chpart,
|
||||
U_BOOT_CMD(
|
||||
chpart, 2, 0, do_jffs2_chpart,
|
||||
"chpart - change active partition\n",
|
||||
" - change active partition\n"
|
||||
);
|
||||
|
||||
+13
-14
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_autoscript.h>
|
||||
#include <s_record.h>
|
||||
#include <net.h>
|
||||
#include <syscall.h>
|
||||
@@ -972,8 +971,8 @@ START:
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
|
||||
|
||||
#ifdef CFG_LOADS_BAUD_CHANGE
|
||||
cmd_tbl_t U_BOOT_CMD(LOADS) = MK_CMD_ENTRY(
|
||||
"loads", 3, 0, do_load_serial,
|
||||
U_BOOT_CMD(
|
||||
loads, 3, 0, do_load_serial,
|
||||
"loads - load S-Record file over serial line\n",
|
||||
"[ off ] [ baud ]\n"
|
||||
" - load S-Record file over serial line"
|
||||
@@ -981,8 +980,8 @@ cmd_tbl_t U_BOOT_CMD(LOADS) = MK_CMD_ENTRY(
|
||||
);
|
||||
|
||||
#else /* ! CFG_LOADS_BAUD_CHANGE */
|
||||
cmd_tbl_t U_BOOT_CMD(LOADS) = MK_CMD_ENTRY(
|
||||
"loads", 2, 0, do_load_serial,
|
||||
U_BOOT_CMD(
|
||||
loads, 2, 0, do_load_serial,
|
||||
"loads - load S-Record file over serial line\n",
|
||||
"[ off ]\n"
|
||||
" - load S-Record file over serial line with offset 'off'\n"
|
||||
@@ -996,16 +995,16 @@ cmd_tbl_t U_BOOT_CMD(LOADS) = MK_CMD_ENTRY(
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
|
||||
#ifdef CFG_LOADS_BAUD_CHANGE
|
||||
cmd_tbl_t U_BOOT_CMD(SAVES) = MK_CMD_ENTRY(
|
||||
"saves", 4, 0, do_save_serial,
|
||||
U_BOOT_CMD(
|
||||
saves, 4, 0, do_save_serial,
|
||||
"saves - save S-Record file over serial line\n",
|
||||
"[ off ] [size] [ baud ]\n"
|
||||
" - save S-Record file over serial line"
|
||||
" with offset 'off', size 'size' and baudrate 'baud'\n"
|
||||
);
|
||||
#else /* ! CFG_LOADS_BAUD_CHANGE */
|
||||
cmd_tbl_t U_BOOT_CMD(SAVES) = MK_CMD_ENTRY(
|
||||
"saves", 3, 0, do_save_serial,
|
||||
U_BOOT_CMD(
|
||||
saves, 3, 0, do_save_serial,
|
||||
"saves - save S-Record file over serial line\n",
|
||||
"[ off ] [size]\n"
|
||||
" - save S-Record file over serial line with offset 'off' and size 'size'\n"
|
||||
@@ -1016,8 +1015,8 @@ cmd_tbl_t U_BOOT_CMD(SAVES) = MK_CMD_ENTRY(
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
|
||||
cmd_tbl_t U_BOOT_CMD(LOADB) = MK_CMD_ENTRY(
|
||||
"loadb", 3, 0, do_load_serial_bin,
|
||||
U_BOOT_CMD(
|
||||
loadb, 3, 0, do_load_serial_bin,
|
||||
"loadb - load binary file over serial line (kermit mode)\n",
|
||||
"[ off ] [ baud ]\n"
|
||||
" - load binary file over serial line"
|
||||
@@ -1048,10 +1047,10 @@ int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(HWFLOW) = MK_CMD_ENTRY(
|
||||
"hwflow [on|off]", 2, 0, do_hwflow,
|
||||
U_BOOT_CMD(
|
||||
hwflow, 2, 0, do_hwflow,
|
||||
"hwflow - turn the harwdare flow control on/off\n",
|
||||
"\n - change RTS/CTS hardware flow control over serial line\n"
|
||||
"[on|off]\n - change RTS/CTS hardware flow control over serial line\n"
|
||||
);
|
||||
|
||||
#endif /* CFG_CMD_HWFLOW */
|
||||
+18
-12
@@ -79,13 +79,23 @@ void logbuff_init_ptrs (void)
|
||||
|
||||
log_buf = (unsigned char *)(gd->bd->bi_memsize-LOGBUFF_LEN);
|
||||
ext_tag = (unsigned long *)(log_buf)-4;
|
||||
ext_log_start = (unsigned long *)(log_buf)-3;
|
||||
ext_log_start = (unsigned long *)(log_buf)-3;
|
||||
ext_log_size = (unsigned long *)(log_buf)-2;
|
||||
ext_logged_chars = (unsigned long *)(log_buf)-1;
|
||||
if (*ext_tag!=LOGBUFF_MAGIC) {
|
||||
#ifdef CONFIG_POST
|
||||
/* The post routines have setup the word so we can simply test it */
|
||||
if ((post_word_load () & 0xffff) == POST_POWERON) {
|
||||
logged_chars = log_size = log_start = 0;
|
||||
*ext_tag = LOGBUFF_MAGIC;
|
||||
*ext_tag = LOGBUFF_MAGIC;
|
||||
}
|
||||
#else
|
||||
/* No post routines, so we do our own checking */
|
||||
if (post_word_load () != LOGBUFF_MAGIC) {
|
||||
logged_chars = log_size = log_start = 0;
|
||||
post_word_store (LOGBUFF_MAGIC);
|
||||
*ext_tag = LOGBUFF_MAGIC;
|
||||
}
|
||||
#endif
|
||||
/* Initialize default loglevel if present */
|
||||
if ((s = getenv ("loglevel")) != NULL)
|
||||
console_loglevel = (int)simple_strtoul (s, NULL, 10);
|
||||
@@ -156,12 +166,8 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
if (strcmp(argv[1],"append") == 0) {
|
||||
/* Log concatenation of all arguments separated by spaces */
|
||||
for (i=2; i<argc; i++) {
|
||||
if (i<argc-1) {
|
||||
logbuff_printk (argv[i]);
|
||||
logbuff_putc (' ');
|
||||
} else {
|
||||
logbuff_puts (argv[i]);
|
||||
}
|
||||
logbuff_printk (argv[i]);
|
||||
logbuff_putc ((i<argc-1) ? ' ' : '\n');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -196,10 +202,10 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
#if defined(CONFIG_LOGBUFFER)
|
||||
cmd_tbl_t U_BOOT_CMD(LOG) = MK_CMD_ENTRY(
|
||||
"log", 255, 1, do_log,
|
||||
U_BOOT_CMD(
|
||||
log, 255, 1, do_log,
|
||||
"log - manipulate logbuffer\n",
|
||||
"log info - show pointer details\n"
|
||||
"info - show pointer details\n"
|
||||
"log reset - clear contents\n"
|
||||
"log show - show contents\n"
|
||||
"log append <msg> - append <msg> to the logbuffer\n"
|
||||
|
||||
+24
-22
@@ -36,8 +36,10 @@
|
||||
#include <dataflash.h>
|
||||
#endif
|
||||
|
||||
#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | CFG_CMD_PCI | CFG_CMD_I2C\
|
||||
| CMD_CMD_PORTIO))
|
||||
#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | \
|
||||
CFG_CMD_I2C | \
|
||||
CFG_CMD_PCI | \
|
||||
CMD_CMD_PORTIO ) )
|
||||
int cmd_get_data_size(char* arg, int default_size)
|
||||
{
|
||||
/* Check for a size specification .b, .w or .l.
|
||||
@@ -961,66 +963,66 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/**************************************************/
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
|
||||
cmd_tbl_t U_BOOT_CMD(MD) = MK_CMD_ENTRY(
|
||||
"md", 3, 1, do_mem_md,
|
||||
U_BOOT_CMD(
|
||||
md, 3, 1, do_mem_md,
|
||||
"md - memory display\n",
|
||||
"[.b, .w, .l] address [# of objects]\n - memory display\n"
|
||||
);
|
||||
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MM) = MK_CMD_ENTRY(
|
||||
"mm", 2, 1, do_mem_mm,
|
||||
U_BOOT_CMD(
|
||||
mm, 2, 1, do_mem_mm,
|
||||
"mm - memory modify (auto-incrementing)\n",
|
||||
"[.b, .w, .l] address\n" " - memory modify, auto increment address\n"
|
||||
);
|
||||
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(NM) = MK_CMD_ENTRY(
|
||||
"nm", 2, 1, do_mem_nm,
|
||||
U_BOOT_CMD(
|
||||
nm, 2, 1, do_mem_nm,
|
||||
"nm - memory modify (constant address)\n",
|
||||
"[.b, .w, .l] address\n - memory modify, read and keep address\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MW) = MK_CMD_ENTRY(
|
||||
"mw", 4, 1, do_mem_mw,
|
||||
U_BOOT_CMD(
|
||||
mw, 4, 1, do_mem_mw,
|
||||
"mw - memory write (fill)\n",
|
||||
"[.b, .w, .l] address value [count]\n - write memory\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(CP) = MK_CMD_ENTRY(
|
||||
"cp", 4, 1, do_mem_cp,
|
||||
U_BOOT_CMD(
|
||||
cp, 4, 1, do_mem_cp,
|
||||
"cp - memory copy\n",
|
||||
"[.b, .w, .l] source target count\n - copy memory\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(CMP) = MK_CMD_ENTRY(
|
||||
"cmp", 4, 1, do_mem_cmp,
|
||||
U_BOOT_CMD(
|
||||
cmp, 4, 1, do_mem_cmp,
|
||||
"cmp - memory compare\n",
|
||||
"[.b, .w, .l] addr1 addr2 count\n - compare memory\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(CRC32) = MK_CMD_ENTRY(
|
||||
"crc32", 4, 1, do_mem_crc,
|
||||
U_BOOT_CMD(
|
||||
crc32, 4, 1, do_mem_crc,
|
||||
"crc32 - checksum calculation\n",
|
||||
"address count [addr]\n - compute CRC32 checksum [save at addr]\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BASE) = MK_CMD_ENTRY(
|
||||
"base", 2, 1, do_mem_base,
|
||||
U_BOOT_CMD(
|
||||
base, 2, 1, do_mem_base,
|
||||
"base - print or set address offset\n",
|
||||
"\n - print address offset for memory commands\n"
|
||||
"base off\n - set address offset for memory commands to 'off'\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(LOOP) = MK_CMD_ENTRY(
|
||||
"loop", 3, 1, do_mem_loop,
|
||||
U_BOOT_CMD(
|
||||
loop, 3, 1, do_mem_loop,
|
||||
"loop - infinite loop on address range\n",
|
||||
"[.b, .w, .l] address number_of_objects\n"
|
||||
" - loop on a set of addresses\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MTEST) = MK_CMD_ENTRY(
|
||||
"mtest", 4, 1, do_mem_mtest,
|
||||
U_BOOT_CMD(
|
||||
mtest, 4, 1, do_mem_mtest,
|
||||
"mtest - simple RAM test\n",
|
||||
"[start [end [pattern]]]\n"
|
||||
" - simple RAM read/write test\n"
|
||||
|
||||
+2
-2
@@ -129,8 +129,8 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MII) = MK_CMD_ENTRY(
|
||||
"mii", 5, 1, do_mii,
|
||||
U_BOOT_CMD(
|
||||
mii, 5, 1, do_mii,
|
||||
"mii - MII utility commands\n",
|
||||
"info <addr> - display MII PHY info\n"
|
||||
"mii read <addr> <reg> - read MII PHY <addr> register <reg>\n"
|
||||
|
||||
+4
-4
@@ -56,15 +56,15 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
|
||||
int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(IRQINFO) = MK_CMD_ENTRY(
|
||||
"irqinfo", 1, 1, do_irqinfo,
|
||||
U_BOOT_CMD(
|
||||
irqinfo, 1, 1, do_irqinfo,
|
||||
"irqinfo - print information about IRQs\n",
|
||||
NULL
|
||||
);
|
||||
#endif /* CONFIG_COMMANDS & CFG_CMD_IRQ */
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(MISC) = MK_CMD_ENTRY(
|
||||
"sleep" , 2, 2, do_sleep,
|
||||
U_BOOT_CMD(
|
||||
sleep , 2, 2, do_sleep,
|
||||
"sleep - delay execution for some time\n",
|
||||
"N\n"
|
||||
" - delay execution for N seconds (N is _decimal_ !!!)\n"
|
||||
|
||||
@@ -37,4 +37,10 @@ int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
mmcinit, 1, 0, do_mmc,
|
||||
"mmcinit - init mmc card\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
#endif /* CFG_CMD_MMC */
|
||||
@@ -247,6 +247,21 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
nand, 5, 1, do_nand,
|
||||
"nand - NAND sub-system\n",
|
||||
"info - show available NAND devices\n"
|
||||
"nand device [dev] - show or set current device\n"
|
||||
"nand read[.jffs2] addr off size\n"
|
||||
"nand write[.jffs2] addr off size - read/write `size' bytes starting\n"
|
||||
" at offset `off' to/from memory address `addr'\n"
|
||||
"nand erase [clean] [off size] - erase `size' bytes from\n"
|
||||
" offset `off' (entire device if not specified)\n"
|
||||
"nand bad - show bad blocks\n"
|
||||
"nand read.oob addr off size - read out-of-band data\n"
|
||||
"nand write.oob addr off size - read out-of-band data\n"
|
||||
);
|
||||
|
||||
int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
char *boot_device = NULL;
|
||||
@@ -348,6 +363,12 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return rcode;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
nboot, 4, 1, do_nandboot,
|
||||
"nboot - boot from NAND device\n",
|
||||
"loadAddr dev\n"
|
||||
);
|
||||
|
||||
/* returns 0 if block containing pos is OK:
|
||||
* valid erase block and
|
||||
* not marked bad, or no bad mark position is specified
|
||||
|
||||
+9
-11
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_autoscript.h>
|
||||
#include <net.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
||||
@@ -41,8 +40,8 @@ int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return netboot_common (BOOTP, cmdtp, argc, argv);
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTP) = MK_CMD_ENTRY(
|
||||
"bootp", 3, 1, do_bootp,
|
||||
U_BOOT_CMD(
|
||||
bootp, 3, 1, do_bootp,
|
||||
"bootp - boot image via network using BootP/TFTP protocol\n",
|
||||
"[loadAddress] [bootfilename]\n"
|
||||
);
|
||||
@@ -52,10 +51,9 @@ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return netboot_common (TFTP, cmdtp, argc, argv);
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(TFTPB) = MK_CMD_ENTRY(
|
||||
"tftpboot", 3, 1, do_tftpb,
|
||||
"tftpboot- boot image via network using TFTP protocol\n"
|
||||
" and env variables ipaddr and serverip\n",
|
||||
U_BOOT_CMD(
|
||||
tftpboot, 3, 1, do_tftpb,
|
||||
"tftpboot- boot image via network using TFTP protocol\n",
|
||||
"[loadAddress] [bootfilename]\n"
|
||||
);
|
||||
|
||||
@@ -64,8 +62,8 @@ int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return netboot_common (RARP, cmdtp, argc, argv);
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(RARPB) = MK_CMD_ENTRY(
|
||||
"rarpboot", 3, 1, do_rarpb,
|
||||
U_BOOT_CMD(
|
||||
rarpboot, 3, 1, do_rarpb,
|
||||
"rarpboot- boot image via network using RARP/TFTP protocol\n",
|
||||
"[loadAddress] [bootfilename]\n"
|
||||
);
|
||||
@@ -76,8 +74,8 @@ int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return netboot_common(DHCP, cmdtp, argc, argv);
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(DHCP) = MK_CMD_ENTRY(
|
||||
"dhcp", 3, 1, do_dhcp,
|
||||
U_BOOT_CMD(
|
||||
dhcp, 3, 1, do_dhcp,
|
||||
"dhcp - invoke DHCP client to obtain IP/boot params\n",
|
||||
"\n"
|
||||
);
|
||||
|
||||
+10
-10
@@ -561,16 +561,16 @@ envmatch (uchar *s1, int i2)
|
||||
|
||||
/**************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(PRINTENV) = MK_CMD_ENTRY(
|
||||
"printenv", CFG_MAXARGS, 1, do_printenv,
|
||||
U_BOOT_CMD(
|
||||
printenv, CFG_MAXARGS, 1, do_printenv,
|
||||
"printenv- print environment variables\n",
|
||||
"\n - print values of all environment variables\n"
|
||||
"printenv name ...\n"
|
||||
" - print value of environment variable 'name'\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SETENV) = MK_CMD_ENTRY(
|
||||
"setenv", CFG_MAXARGS, 0, do_setenv,
|
||||
U_BOOT_CMD(
|
||||
setenv, CFG_MAXARGS, 0, do_setenv,
|
||||
"setenv - set environment variables\n",
|
||||
"name value ...\n"
|
||||
" - set environment variable 'name' to 'value ...'\n"
|
||||
@@ -580,8 +580,8 @@ cmd_tbl_t U_BOOT_CMD(SETENV) = MK_CMD_ENTRY(
|
||||
|
||||
#if ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH))
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SAVEENV) = MK_CMD_ENTRY(
|
||||
"saveenv", 1, 0, do_saveenv,
|
||||
U_BOOT_CMD(
|
||||
saveenv, 1, 0, do_saveenv,
|
||||
"saveenv - save environment variables to persistent storage\n",
|
||||
NULL
|
||||
);
|
||||
@@ -590,8 +590,8 @@ cmd_tbl_t U_BOOT_CMD(SAVEENV) = MK_CMD_ENTRY(
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_ASKENV)
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(ASKENV) = MK_CMD_ENTRY(
|
||||
"askenv", CFG_MAXARGS, 1, do_askenv,
|
||||
U_BOOT_CMD(
|
||||
askenv, CFG_MAXARGS, 1, do_askenv,
|
||||
"askenv - get environment variables from stdin\n",
|
||||
"name [message] [size]\n"
|
||||
" - get environment variable 'name' from stdin (max 'size' chars)\n"
|
||||
@@ -607,8 +607,8 @@ cmd_tbl_t U_BOOT_CMD(ASKENV) = MK_CMD_ENTRY(
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_RUN)
|
||||
int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
cmd_tbl_t U_BOOT_CMD(RUN) = MK_CMD_ENTRY(
|
||||
"run", CFG_MAXARGS, 1, do_run,
|
||||
U_BOOT_CMD(
|
||||
run, CFG_MAXARGS, 1, do_run,
|
||||
"run - run commands in an environment variable\n",
|
||||
"var [...]\n"
|
||||
" - run the commands in the environment variable(s) 'var'\n"
|
||||
|
||||
+2
-2
@@ -548,8 +548,8 @@ int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
/***************************************************/
|
||||
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(PCI) = MK_CMD_ENTRY(
|
||||
"pci", 5, 1, do_pci,
|
||||
U_BOOT_CMD(
|
||||
pci, 5, 1, do_pci,
|
||||
"pci - list and access PCI Configuraton Space\n",
|
||||
"[bus] [long]\n"
|
||||
" - short or long list of PCI devices on bus 'bus'\n"
|
||||
|
||||
+2
-2
@@ -2487,8 +2487,8 @@ static int identify (volatile uchar *p)
|
||||
/**************************************************/
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
|
||||
cmd_tbl_t U_BOOT_CMD(PINIT) = MK_CMD_ENTRY(
|
||||
"pinit", 2, 1, do_pinit,
|
||||
U_BOOT_CMD(
|
||||
pinit, 2, 1, do_pinit,
|
||||
"pinit - PCMCIA sub-system\n",
|
||||
"on - power on PCMCIA socket\n"
|
||||
"pinit off - power off PCMCIA socket\n"
|
||||
|
||||
+13
-1
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_portio.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PORTIO)
|
||||
|
||||
@@ -96,6 +95,12 @@ int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
out, 3, 1, do_portio_out,
|
||||
"out - write datum to IO port\n",
|
||||
"[.b, .w, .l] port value\n - output to IO port\n"
|
||||
);
|
||||
|
||||
int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
uint addr = in_last_addr;
|
||||
@@ -154,4 +159,11 @@ int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
in, 2, 1, do_portio_in,
|
||||
"in - read data from an IO port\n",
|
||||
"[.b, .w, .l] port\n"
|
||||
" - read datum from IO port\n"
|
||||
);
|
||||
|
||||
#endif /* CFG_CMD_PORTIO */
|
||||
@@ -219,8 +219,8 @@ mfdcr(dmacr3), mfdcr(dmact3),mfdcr(dmada3), mfdcr(dmasa3), mfdcr(dmasb3) );
|
||||
#if (defined(CONFIG_8xx) || defined(CONFIG_405GP)) && \
|
||||
(CONFIG_COMMANDS & CFG_CMD_REGINFO)
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(REGINFO) = MK_CMD_ENTRY(
|
||||
"reginfo", 2, 1, do_reginfo,
|
||||
U_BOOT_CMD(
|
||||
reginfo, 2, 1, do_reginfo,
|
||||
"reginfo - print register information\n",
|
||||
);
|
||||
#endif
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <asm/processor.h>
|
||||
#include <scsi.h>
|
||||
#include <image.h>
|
||||
#include <cmd_disk.h>
|
||||
#include <pci.h>
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -131,8 +131,8 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/***************************************************/
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(SPI) = MK_CMD_ENTRY(
|
||||
"sspi", 5, 1, do_spi,
|
||||
U_BOOT_CMD(
|
||||
sspi, 5, 1, do_spi,
|
||||
"sspi - SPI utility commands\n",
|
||||
"<device> <bit_len> <dout> - Send <bit_len> bits from <dout> out the SPI\n"
|
||||
"<device> - Identifies the chip select of the device\n"
|
||||
|
||||
+6
-7
@@ -31,7 +31,6 @@
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
|
||||
#include <usb.h>
|
||||
#include <cmd_disk.h>
|
||||
|
||||
#undef CMD_USB_DEBUG
|
||||
|
||||
@@ -595,8 +594,8 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
cmd_tbl_t U_BOOT_CMD(USB) = MK_CMD_ENTRY(
|
||||
"usb", 5, 1, do_usb,
|
||||
U_BOOT_CMD(
|
||||
usb, 5, 1, do_usb,
|
||||
"usb - USB sub-system\n",
|
||||
"reset - reset (rescan) USB controller\n"
|
||||
"usb stop [f] - stop USB [f]=force stop\n"
|
||||
@@ -610,15 +609,15 @@ cmd_tbl_t U_BOOT_CMD(USB) = MK_CMD_ENTRY(
|
||||
);
|
||||
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(USBBOOT) = MK_CMD_ENTRY(
|
||||
"usbboot", 3, 1, do_usbboot,
|
||||
U_BOOT_CMD(
|
||||
usbboot, 3, 1, do_usbboot,
|
||||
"usbboot - boot from USB device\n",
|
||||
"loadAddr dev:part\n"
|
||||
);
|
||||
|
||||
#else
|
||||
cmd_tbl_t U_BOOT_CMD(USB) = MK_CMD_ENTRY(
|
||||
"usb", 5, 1, do_usb,
|
||||
U_BOOT_CMD(
|
||||
usb, 5, 1, do_usb,
|
||||
"usb - USB sub-system\n",
|
||||
"reset - reset (rescan) USB controller\n"
|
||||
"usb tree - show USB device tree\n"
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(VFD) = MK_CMD_ENTRY(
|
||||
"vfd", 2, 0, do_vfd,
|
||||
U_BOOT_CMD(
|
||||
vfd, 2, 0, do_vfd,
|
||||
"vfd - load a bitmap to the VFDs on TRAB\n",
|
||||
"N\n"
|
||||
" - load bitmap N to the VFDs (N is _decimal_ !!!)\n"
|
||||
|
||||
+74
-56
@@ -36,6 +36,12 @@ do_version (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
version, 1, 1, do_version,
|
||||
"version - print monitor version\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
int
|
||||
do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
@@ -61,6 +67,13 @@ do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
echo, CFG_MAXARGS, 1, do_echo,
|
||||
"echo - echo args to console\n",
|
||||
"[args..]\n"
|
||||
" - echo args to console; \\c suppresses newline\n"
|
||||
);
|
||||
|
||||
/*
|
||||
* Use puts() instead of printf() to avoid printf buffer overflow
|
||||
* for long help messages
|
||||
@@ -72,44 +85,44 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
if (argc == 1) { /*show list of commands */
|
||||
|
||||
int cmd_items = (((int) &__u_boot_cmd_end) -
|
||||
((int) &__u_boot_cmd_start)) /
|
||||
sizeof (*cmdtp);
|
||||
int end_sort;
|
||||
cmd_tbl_t *cmd_array[(cmd_items + 1)];
|
||||
int i;
|
||||
int cmd_items = &__u_boot_cmd_end -
|
||||
&__u_boot_cmd_start; /* pointer arith! */
|
||||
cmd_tbl_t *cmd_array[cmd_items];
|
||||
int i, j, swaps;
|
||||
|
||||
/* Make list of commands from .uboot_cmd section */
|
||||
cmdtp = (cmd_tbl_t *) & __u_boot_cmd_start;
|
||||
for (i = 1; i <= cmd_items; i++) {
|
||||
cmd_array[i] = cmdtp;
|
||||
cmdtp++;
|
||||
/* Make array of commands from .uboot_cmd section */
|
||||
cmdtp = &__u_boot_cmd_start;
|
||||
for (i = 0; i < cmd_items; i++) {
|
||||
cmd_array[i] = cmdtp++;
|
||||
}
|
||||
/* Sort command list */
|
||||
end_sort = 0;
|
||||
for (i = 1; end_sort != 1 || i <= cmd_items - 1; i++) {
|
||||
if (i == cmd_items) { /* Last command */
|
||||
end_sort = 1;
|
||||
i = 1;
|
||||
}
|
||||
|
||||
if (strcmp (cmd_array[i]->name, cmd_array[i + 1]->name) > 0) {
|
||||
end_sort = 0;
|
||||
*cmd_array[0] = *cmd_array[i];
|
||||
*cmd_array[i] = *cmd_array[i + 1];
|
||||
*cmd_array[i + 1] = *cmd_array[0];
|
||||
/* Sort command list (trivial bubble sort) */
|
||||
for (i = cmd_items - 1; i > 0; --i) {
|
||||
swaps = 0;
|
||||
for (j = 0; j < i; ++j) {
|
||||
if (strcmp (cmd_array[j]->name,
|
||||
cmd_array[j + 1]->name) > 0) {
|
||||
cmd_tbl_t *tmp;
|
||||
tmp = cmd_array[j];
|
||||
cmd_array[j] = cmd_array[j + 1];
|
||||
cmd_array[j + 1] = tmp;
|
||||
++swaps;
|
||||
}
|
||||
}
|
||||
if (!swaps)
|
||||
break;
|
||||
}
|
||||
|
||||
/* print short help (usage) */
|
||||
for (cmdtp = (cmd_tbl_t *) & __u_boot_cmd_start;
|
||||
cmdtp != (cmd_tbl_t *) & __u_boot_cmd_end; cmdtp++) {
|
||||
for (i = 0; i < cmd_items; i++) {
|
||||
const char *usage = cmd_array[i]->usage;
|
||||
|
||||
/* allow user abort */
|
||||
if (ctrlc ())
|
||||
return 1;
|
||||
if (cmdtp->usage == NULL)
|
||||
if (usage == NULL)
|
||||
continue;
|
||||
puts (cmdtp->usage);
|
||||
puts (usage);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -145,8 +158,8 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(HELP) = MK_CMD_ENTRY(
|
||||
"help", CFG_MAXARGS, 1, do_help,
|
||||
U_BOOT_CMD(
|
||||
help, CFG_MAXARGS, 1, do_help,
|
||||
"help - print online help\n",
|
||||
"[command ...]\n"
|
||||
" - show help information (for 'command')\n"
|
||||
@@ -156,24 +169,19 @@ cmd_tbl_t U_BOOT_CMD(HELP) = MK_CMD_ENTRY(
|
||||
"'help' with one or more command names as arguments.\n"
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(QUES) = MK_CMD_ENTRY(
|
||||
/* This do not ust the U_BOOT_CMD macro as ? can't be used in symbol names */
|
||||
#ifdef CFG_LONGHELP
|
||||
cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
|
||||
"?", CFG_MAXARGS, 1, do_help,
|
||||
"? - alias for 'help'\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(VERS) = MK_CMD_ENTRY(
|
||||
"version", 1, 1, do_version,
|
||||
"version - print monitor version\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(ECHO) = MK_CMD_ENTRY(
|
||||
"echo", CFG_MAXARGS, 1, do_echo,
|
||||
"echo - echo args to console\n",
|
||||
"[args..]\n"
|
||||
" - echo args to console; \\c suppresses newline\n"
|
||||
);
|
||||
};
|
||||
#else
|
||||
cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
|
||||
"?", CFG_MAXARGS, 1, do_help,
|
||||
"? - alias for 'help'\n"
|
||||
};
|
||||
#endif /* CFG_LONGHELP */
|
||||
|
||||
/***************************************************************************
|
||||
* find command table entry for a command
|
||||
@@ -181,21 +189,31 @@ cmd_tbl_t U_BOOT_CMD(ECHO) = MK_CMD_ENTRY(
|
||||
cmd_tbl_t *find_cmd (const char *cmd)
|
||||
{
|
||||
cmd_tbl_t *cmdtp;
|
||||
|
||||
cmd_tbl_t *cmdtp_temp = &__u_boot_cmd_start; /*Init value */
|
||||
int one_cmd_name = 0;
|
||||
const char *p;
|
||||
int len;
|
||||
int n_found = 0;
|
||||
|
||||
for (cmdtp = &__u_boot_cmd_start; cmdtp != &__u_boot_cmd_end; cmdtp++) {
|
||||
if ((strncmp (cmd, cmdtp->name, strlen (cmd)) == 0) &&
|
||||
(strlen (cmd) == strlen (cmdtp->name)))
|
||||
return cmdtp;
|
||||
else if (strncmp (cmd, cmdtp->name, strlen (cmd)) == 0) {
|
||||
cmdtp_temp = cmdtp;
|
||||
one_cmd_name++;
|
||||
} else;
|
||||
/*
|
||||
* Some commands allow length modifiers (like "cp.b");
|
||||
* compare command name only until first dot.
|
||||
*/
|
||||
len = ((p = strchr(cmd, '.')) == NULL) ? strlen (cmd) : (p - cmd);
|
||||
|
||||
for (cmdtp = &__u_boot_cmd_start;
|
||||
cmdtp != &__u_boot_cmd_end;
|
||||
cmdtp++) {
|
||||
if (strncmp (cmd, cmdtp->name, len) == 0) {
|
||||
if (len == strlen (cmdtp->name))
|
||||
return cmdtp; /* full match */
|
||||
|
||||
cmdtp_temp = cmdtp; /* abbreviated command ? */
|
||||
n_found++;
|
||||
}
|
||||
}
|
||||
if (one_cmd_name == 1)
|
||||
if (n_found == 1) { /* exactly one match */
|
||||
return cmdtp_temp;
|
||||
}
|
||||
|
||||
return NULL; /* not found || one_cmd_name >2 */
|
||||
return NULL; /* not found or ambiguous command */
|
||||
}
|
||||
+2
-2
@@ -573,8 +573,8 @@ do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(KGDB) = MK_CMD_ENTRY(
|
||||
"kgdb", CFG_MAXARGS, 1, do_kgdb,
|
||||
U_BOOT_CMD(
|
||||
kgdb, CFG_MAXARGS, 1, do_kgdb,
|
||||
"kgdb - enter gdb remote debug mode\n",
|
||||
"[arg0 arg1 .. argN]\n"
|
||||
" - executes a breakpoint so that kgdb mode is\n"
|
||||
|
||||
@@ -188,7 +188,7 @@ m8260_cpm_extcbrg(uint brg, uint rate, uint extclk, int pinsel)
|
||||
*bp |= CPM_BRG_EXTC_CLK5_15;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
|
||||
|
||||
void post_word_store (ulong a)
|
||||
{
|
||||
@@ -206,4 +206,4 @@ ulong post_word_load (void)
|
||||
return *save_addr;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_POST */
|
||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||
@@ -91,7 +91,7 @@ uint dpram_base_align (uint align)
|
||||
}
|
||||
#endif /* CFG_ALLOC_DPRAM */
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
|
||||
|
||||
void post_word_store (ulong a)
|
||||
{
|
||||
@@ -109,4 +109,4 @@ ulong post_word_load (void)
|
||||
return *(volatile ulong *) save_addr;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_POST */
|
||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <ide.h>
|
||||
#include <cmd_disk.h>
|
||||
|
||||
#undef PART_DEBUG
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <ide.h>
|
||||
#include <cmd_disk.h>
|
||||
#include "part_amiga.h"
|
||||
|
||||
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_AMIGA_PARTITION)
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <ide.h>
|
||||
#include <cmd_disk.h>
|
||||
#include "part_dos.h"
|
||||
|
||||
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_DOS_PARTITION)
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cmd_disk.h>
|
||||
#include "part_iso.h"
|
||||
|
||||
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_ISO_PARTITION)
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <ide.h>
|
||||
#include <cmd_disk.h>
|
||||
#include "part_mac.h"
|
||||
|
||||
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_MAC_PARTITION)
|
||||
|
||||
+31
-103
@@ -1,103 +1,31 @@
|
||||
#
|
||||
# The commands in this table are sorted alphabetically by the
|
||||
# command name and in descending order by the command name string
|
||||
# length. This is to prevent conflicts in command name parsing.
|
||||
# Please ensure that new commands are added according to that rule.
|
||||
# See $(TOPDIR)/common/command.c
|
||||
#
|
||||
########################
|
||||
#
|
||||
# command length
|
||||
#
|
||||
########################
|
||||
askenv 8
|
||||
as 2
|
||||
autoscr 5
|
||||
base 2
|
||||
bdinfo 2
|
||||
bmp 3
|
||||
bootelf 7
|
||||
bootm 5
|
||||
bootp 5
|
||||
bootvx 6
|
||||
bootd 4
|
||||
break 2
|
||||
brginfo 3
|
||||
carinfo 3
|
||||
chpart 6
|
||||
cmp 3
|
||||
coninfo 5
|
||||
continue 4
|
||||
cp 2
|
||||
crc32 3
|
||||
date 3
|
||||
dcache 2
|
||||
dhcp 4
|
||||
dmainfo 3
|
||||
ds 2
|
||||
dtt 3
|
||||
echo 4
|
||||
eeprom 3
|
||||
erase 3
|
||||
fccinfo 3
|
||||
fdcboot 4
|
||||
flinfo 3
|
||||
fpga 4
|
||||
fsinfo 5
|
||||
fsload 5
|
||||
getdcr 6 # IBM 4XX DCR registers
|
||||
go 2
|
||||
help 1
|
||||
i2cinfo 4
|
||||
i2c 3
|
||||
icache 2
|
||||
icinfo 3
|
||||
ide 3
|
||||
iminfo 3
|
||||
iopinfo 3
|
||||
irqinfo 3
|
||||
kgdb 4
|
||||
loadb 5
|
||||
loads 5
|
||||
loop 4
|
||||
ls 2
|
||||
mccinfo 3
|
||||
md 2
|
||||
memcinfo 4
|
||||
mii 3
|
||||
mm 2
|
||||
mtest 5
|
||||
muxinfo 3
|
||||
mw 2
|
||||
nand 3
|
||||
nboot 4
|
||||
next 4
|
||||
nm 2
|
||||
pciinfo 3
|
||||
pinit 4
|
||||
printenv 8
|
||||
protect 4
|
||||
rarpboot 4
|
||||
rdump 5
|
||||
reginfo 3
|
||||
reset 5
|
||||
run 3
|
||||
saveenv 4
|
||||
sccinfo 3
|
||||
scsiboot 5
|
||||
scsi 4
|
||||
siiinfo 3
|
||||
sitinfo 3
|
||||
siuinfo 3
|
||||
setdcr 6 # IBM 4XX DCR registers
|
||||
setenv 6
|
||||
smcinfo 3
|
||||
spiinfo 3
|
||||
sspi 4
|
||||
stack 5
|
||||
step 4
|
||||
tftpboot 4
|
||||
usbboot 5
|
||||
usb 4
|
||||
version 4
|
||||
? 1
|
||||
|
||||
Commands are added to U-Boot by creating a new command structure.
|
||||
This is done by first including command.h
|
||||
|
||||
Then using the U_BOOT_CMD() macro to fill in a cmd_tbl_t struct.
|
||||
|
||||
U_BOOT_CMD(name,maxargs,repeatable,command,"usage","help")
|
||||
|
||||
name: is the name of the commad. THIS IS NOT a string.
|
||||
maxargs: the maximumn numbers of arguments this function takes
|
||||
command: Function pointer (*cmd)(struct cmd_tbl_s *, int, int, char *[]);
|
||||
usage: Short description. This is a string
|
||||
help: long description. This is a string
|
||||
|
||||
|
||||
**** Behinde the scene ******
|
||||
|
||||
The structure created is named with a special prefix (__u_boot_cmd_)
|
||||
and placed by the linker in a special section.
|
||||
|
||||
This makes it possible for the final link to extract all commands
|
||||
compiled into any object code and construct a static array so the
|
||||
command can be found in an array starting at __u_boot_cmd_start.
|
||||
|
||||
If a new board is defined do not forget to define the command section
|
||||
by writing in u-boot.lds ($(TOPDIR)/board/boardname/u-boot.lds) these
|
||||
3 lines:
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, kharris@nexus-tech.net
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CMD_AUTOSCRIPT_H_
|
||||
#define _CMD_AUTOSCRIPT_H_
|
||||
|
||||
#define AUTOSCRIPT_MAGIC 0x09011962
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
|
||||
|
||||
int autoscript (ulong addr);
|
||||
#endif
|
||||
|
||||
#endif /* _CMD_AUTOSCRIPT_H_ */
|
||||
@@ -1,44 +0,0 @@
|
||||
/* (C) Copyright 2002
|
||||
* Detlev Zundel, DENX Software Engineering, dzu@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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Bitmap display support
|
||||
*/
|
||||
#ifndef _CMD_BMP_H
|
||||
#define _CMD_BMP_H
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
|
||||
#define CMD_TBL_BMP MK_CMD_TBL_ENTRY( \
|
||||
"bmp", 3, 3, 1, do_bmp, \
|
||||
"bmp - manipulate BMP image data\n", \
|
||||
"info <imageAddr> - display image info\n" \
|
||||
"bmp display <imageAddr> - display image\n" \
|
||||
),
|
||||
int do_bmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
#else
|
||||
#define CMD_TBL_BMP
|
||||
#endif
|
||||
|
||||
#endif /* _CMD_BMP_H */
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harddisk support
|
||||
*/
|
||||
#ifndef _CMD_DISK_H
|
||||
#define _CMD_DISK_H
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
|
||||
/*
|
||||
* Type string for U-Boot bootable partitions
|
||||
*/
|
||||
#define BOOT_PART_TYPE "U-Boot" /* primary boot partition type */
|
||||
#define BOOT_PART_COMP "PPCBoot" /* PPCBoot compatibility type */
|
||||
|
||||
#if 0
|
||||
|
||||
typedef struct disk_partition {
|
||||
ulong start; /* # of first block in partition */
|
||||
ulong size; /* number of blocks in partition */
|
||||
ulong blksz; /* block size in bytes */
|
||||
uchar name[32]; /* partition name */
|
||||
uchar type[32]; /* string type description */
|
||||
} disk_partition_t;
|
||||
|
||||
int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
#ifdef CONFIG_MAC_PARTITION
|
||||
int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
#endif
|
||||
#ifdef CONFIG_DOS_PARTITION
|
||||
int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
#endif
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* _CMD_DISK_H */
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Richard Jones, rjones@nexus-tech.net
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* FAT support
|
||||
*/
|
||||
#ifndef _CMD_FAT_H
|
||||
#define _CMD_FAT_H
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_FAT)
|
||||
|
||||
int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
int do_fat_dump (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
#define CMD_TBL_FAT MK_CMD_TBL_ENTRY( \
|
||||
"fatload", 5, 4, 0, do_fat_fsload, \
|
||||
"fatload - load binary file from a dos filesystem\n", \
|
||||
"[ off ] [ filename ]\n" \
|
||||
" - load binary file from dos filesystem\n" \
|
||||
" with offset 'off'\n" \
|
||||
), \
|
||||
MK_CMD_TBL_ENTRY( \
|
||||
"fatinfo", 5, 1, 1, do_fat_fsinfo, \
|
||||
"fatinfo - print information about filesystem\n", \
|
||||
"\n" \
|
||||
" - print information about filesystem\n" \
|
||||
), \
|
||||
MK_CMD_TBL_ENTRY( \
|
||||
"fatls", 2, 2, 1, do_fat_ls, \
|
||||
"fatls - list files in a directory (default /)\n", \
|
||||
"[ directory ]\n" \
|
||||
" - list files in a directory.\n" \
|
||||
),
|
||||
|
||||
#else
|
||||
#define CMD_TBL_FAT
|
||||
#endif /* CFG_CMD_FAT */
|
||||
|
||||
#endif /* _CMD_FAT_H */
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CMD_MMC_H_
|
||||
#define _CMD_MMC_H_
|
||||
|
||||
#include <command.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_MMC)
|
||||
|
||||
#define CMD_TBL_MMC MK_CMD_TBL_ENTRY( \
|
||||
"mmcinit", 4, 1, 0, do_mmc, \
|
||||
"mmcinit - init mmc card\n", \
|
||||
),
|
||||
#else
|
||||
|
||||
#define CMD_TBL_MMC
|
||||
|
||||
#endif
|
||||
|
||||
int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
#endif /* _CMD_MMC_H_ */
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* NAND support
|
||||
*/
|
||||
#ifndef _CMD_NAND_H
|
||||
#define _CMD_NAND_H
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
#define CMD_TBL_NAND MK_CMD_TBL_ENTRY( \
|
||||
"nand", 3, 5, 1, do_nand, \
|
||||
"nand - NAND sub-system\n", \
|
||||
"info - show available NAND devices\n" \
|
||||
"nand device [dev] - show or set current device\n" \
|
||||
"nand read[.jffs2] addr off size\n" \
|
||||
"nand write[.jffs2] addr off size - read/write `size' bytes starting\n" \
|
||||
" at offset `off' to/from memory address `addr'\n" \
|
||||
"nand erase [clean] [off size] - erase `size' bytes from\n" \
|
||||
" offset `off' (entire device if not specified)\n" \
|
||||
"nand bad - show bad blocks\n" \
|
||||
"nand read.oob addr off size - read out-of-band data\n" \
|
||||
"nand write.oob addr off size - read out-of-band data\n" \
|
||||
),
|
||||
|
||||
#define CMD_TBL_NANDBOOT MK_CMD_TBL_ENTRY( \
|
||||
"nboot", 4, 4, 1, do_nandboot, \
|
||||
"nboot - boot from NAND device\n", \
|
||||
"loadAddr dev\n" \
|
||||
),
|
||||
|
||||
int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
#else
|
||||
#define CMD_TBL_NAND
|
||||
#define CMD_TBL_NANDBOOT
|
||||
#endif
|
||||
|
||||
#endif /* _CMD_NAND_H */
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Marc Singer, elf@buici.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory Functions
|
||||
*/
|
||||
#ifndef _CMD_PORTIO_H
|
||||
#define _CMD_PORTIO_H
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PORTIO)
|
||||
|
||||
#define CMD_TBL_PORTIO_OUT MK_CMD_TBL_ENTRY( \
|
||||
"out", 3, 3, 1, do_portio_out, \
|
||||
"out - write datum to IO port\n", \
|
||||
"[.b, .w, .l] port value\n - output to IO port\n" \
|
||||
),
|
||||
#define CMD_TBL_PORTIO_IN MK_CMD_TBL_ENTRY( \
|
||||
"in", 2, 2, 1, do_portio_in, \
|
||||
"in - read data from an IO port\n", \
|
||||
"[.b, .w, .l] port\n" \
|
||||
" - read datum from IO port\n" \
|
||||
),
|
||||
|
||||
int do_portio_out (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
int do_portio_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
#else
|
||||
#define CMD_TBL_PORTIO_OUT
|
||||
#define CMD_TBL_PORTIO_IN
|
||||
#endif /* CFG_CMD_PORTIO */
|
||||
|
||||
#endif /* _CMD_PORTIO_H */
|
||||
+4
-6
@@ -40,7 +40,6 @@ struct cmd_tbl_s {
|
||||
char *name; /* Command Name */
|
||||
int maxargs; /* maximum number of arguments */
|
||||
int repeatable; /* autorepeat allowed? */
|
||||
|
||||
/* Implementation function */
|
||||
int (*cmd)(struct cmd_tbl_s *, int, int, char *[]);
|
||||
char *usage; /* Usage message (short) */
|
||||
@@ -83,17 +82,16 @@ typedef void command_t (cmd_tbl_t *, int, int, char *[]);
|
||||
|
||||
|
||||
#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))
|
||||
#define U_BOOT_CMD(x) __u_boot_cmd_##x Struct_Section
|
||||
|
||||
#ifdef CFG_LONGHELP
|
||||
|
||||
#define MK_CMD_ENTRY(name,maxargs,rep,cmd,usage,help) \
|
||||
{ name, maxargs, rep, cmd, usage, help }
|
||||
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
|
||||
cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage, help}
|
||||
|
||||
#else /* no long help info */
|
||||
|
||||
#define MK_CMD_ENTRY(name,maxargs,rep,cmd,usage,help) \
|
||||
{ name, maxargs, rep, cmd, usage }
|
||||
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
|
||||
cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage}
|
||||
|
||||
#endif /* CFG_LONGHELP */
|
||||
|
||||
|
||||
+4
-1
@@ -147,8 +147,11 @@ extern ulong monitor_flash_len;
|
||||
/* common/flash.c */
|
||||
void flash_perror (int);
|
||||
|
||||
/* common/cmd_autoscript.c */
|
||||
int autoscript (ulong addr);
|
||||
|
||||
/* common/cmd_bootm.c */
|
||||
void print_image_hdr (image_header_t *hdr);
|
||||
void print_image_hdr (image_header_t *hdr);
|
||||
|
||||
extern ulong load_addr; /* Default Load Address */
|
||||
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/*
|
||||
* High Level Configuration Options
|
||||
* (easy to change)
|
||||
*/
|
||||
|
||||
#define CONFIG_405GP 1 /* This is a PPC405GP CPU */
|
||||
#define CONFIG_4xx 1 /* ...member of PPC4xx family */
|
||||
#define CONFIG_EXBITGEN 1 /* on a Exbit Generic board */
|
||||
|
||||
#define CONFIG_BOARD_PRE_INIT 1 /* Call board_pre_init */
|
||||
|
||||
#define CONFIG_SYS_CLK_FREQ 25000000 /* external frequency to pll */
|
||||
|
||||
/* I2C configuration */
|
||||
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */
|
||||
#define CFG_I2C_SPEED 40000 /* I2C speed */
|
||||
#define CFG_I2C_SLAVE 0x7F /* I2C slave address */
|
||||
|
||||
/* environment is in EEPROM */
|
||||
#define CFG_ENV_IS_IN_EEPROM 1
|
||||
#undef CFG_ENV_IS_IN_FLASH
|
||||
#undef CFG_ENV_IS_IN_NVRAM
|
||||
|
||||
#ifdef CFG_ENV_IS_IN_EEPROM
|
||||
#define CFG_I2C_EEPROM_ADDR 0x56 /* 1010110 */
|
||||
#define CFG_I2C_EEPROM_ADDR_LEN 1 /* 8-bit internal addressing */
|
||||
#define CFG_I2C_EEPROM_ADDR_OVERFLOW 1 /* ... and 1 bit in I2C address */
|
||||
#define CFG_EEPROM_PAGE_WRITE_BITS 3 /* 4 bytes per page */
|
||||
#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 40 /* write takes up to 40 msec */
|
||||
#define CFG_ENV_OFFSET 4 /* Offset of Environment Sector */
|
||||
#define CFG_ENV_SIZE 350 /* that is 350 bytes only! */
|
||||
#endif
|
||||
|
||||
#define CONFIG_BOOTDELAY 10 /* autoboot after 10 seconds */
|
||||
/* Explanation:
|
||||
autbooting is altogether disabled and cannot be
|
||||
enabled if CONFIG_BOOTDELAY is negative.
|
||||
If you want shorter bootdelay, then
|
||||
- "setenv bootdelay <delay>" to the proper value
|
||||
*/
|
||||
|
||||
#define CONFIG_BOOTCOMMAND "bootm 20400000 20800000"
|
||||
|
||||
#define CONFIG_BOOTARGS "root=/dev/ram " \
|
||||
"ramdisk_size=32768 " \
|
||||
"console=ttyS0,115200 " \
|
||||
"ram=128M debug"
|
||||
|
||||
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
|
||||
#define CFG_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
|
||||
|
||||
#define CONFIG_MII 1 /* MII PHY management */
|
||||
#define CONFIG_PHY_ADDR 0 /* PHY address */
|
||||
|
||||
#define CONFIG_COMMANDS (CONFIG_CMD_DFL)
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
#undef CONFIG_WATCHDOG /* watchdog disabled */
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
*/
|
||||
#define CFG_LONGHELP /* undef to save memory */
|
||||
#define CFG_PROMPT "=> " /* Monitor Command Prompt */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
|
||||
#else
|
||||
#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
|
||||
#endif
|
||||
#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
|
||||
#define CFG_MAXARGS 16 /* max number of command args */
|
||||
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
|
||||
|
||||
#define CFG_MEMTEST_START 0x0400000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
|
||||
|
||||
/* UART configuration */
|
||||
#define CFG_BASE_BAUD 691200
|
||||
|
||||
/* Default baud rate */
|
||||
#define CONFIG_BAUDRATE 115200
|
||||
|
||||
/* The following table includes the supported baudrates */
|
||||
#define CFG_BAUDRATE_TABLE \
|
||||
{ 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, \
|
||||
57600, 115200, 230400, 460800, 921600 }
|
||||
|
||||
#define CFG_CLKS_IN_HZ 1 /* everything, incl board info, in Hz */
|
||||
|
||||
#define CFG_LOAD_ADDR 0x100000 /* default load address */
|
||||
#define CFG_EXTBDINFO 1 /* To use extended board_into (bd_t) */
|
||||
|
||||
#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PCI stuff
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#undef CONFIG_PCI /* no pci support */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* External peripheral base address
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#undef CONFIG_IDE_PCMCIA /* no pcmcia interface required */
|
||||
#undef CONFIG_IDE_LED /* no led for ide supported */
|
||||
#undef CONFIG_IDE_RESET /* no reset for ide supported */
|
||||
|
||||
#define CFG_KEY_REG_BASE_ADDR 0xF0100000
|
||||
#define CFG_IR_REG_BASE_ADDR 0xF0200000
|
||||
#define CFG_FPGA_REG_BASE_ADDR 0xF0300000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
* (Set up by the startup code)
|
||||
* Please note that CFG_SDRAM_BASE _must_ start at 0
|
||||
*/
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_FLASH0_BASE 0xFFF80000
|
||||
#define CFG_FLASH0_SIZE 0x00080000
|
||||
#define CFG_FLASH1_BASE 0x20000000
|
||||
#define CFG_FLASH1_SIZE 0x02000000
|
||||
#define CFG_FLASH_BASE CFG_FLASH0_BASE
|
||||
#define CFG_FLASH_SIZE CFG_FLASH0_SIZE
|
||||
#define CFG_MONITOR_BASE TEXT_BASE
|
||||
#define CFG_MONITOR_LEN (192 * 1024) /* Reserve 196 kB for Monitor */
|
||||
#define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */
|
||||
|
||||
#if CFG_MONITOR_BASE < CFG_FLASH0_BASE
|
||||
#define CFG_RAMSTART
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
* have to be in the first 8 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 5 /* max number of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
#define CFG_ENV_OFFSET 0x00060000 /* Offset of Environment Sector */
|
||||
#define CFG_ENV_SIZE 0x00010000 /* Total Size of Environment Sector */
|
||||
#define CFG_ENV_SECT_SIZE 0x00010000 /* see README - env sector total size */
|
||||
#endif
|
||||
|
||||
/* On Chip Memory location/size */
|
||||
#define CFG_OCM_DATA_ADDR 0xF8000000
|
||||
#define CFG_OCM_DATA_SIZE 0x1000
|
||||
|
||||
/* Global info and initial stack */
|
||||
#define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* inside of on-chip SRAM */
|
||||
#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of used area in RAM */
|
||||
#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
|
||||
/* Cache configuration */
|
||||
#define CFG_DCACHE_SIZE 8192
|
||||
#define CFG_CACHELINE_SIZE 32
|
||||
|
||||
/*
|
||||
* Internal Definitions
|
||||
*
|
||||
* Boot Flags
|
||||
*/
|
||||
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
|
||||
#define BOOTFLAG_WARM 0x02 /* Software reboot */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
|
||||
#define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
|
||||
#endif
|
||||
#endif /* __CONFIG_H */
|
||||
@@ -0,0 +1,470 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/*
|
||||
* High Level Configuration Options
|
||||
* (easy to change)
|
||||
*/
|
||||
|
||||
#define CONFIG_MPC855 1 /* This is a MPC855 CPU */
|
||||
#define CONFIG_TQM855M 1 /* ...on a TQM8xxM module */
|
||||
|
||||
#define CONFIG_8xx_CONS_SCC1 1 /* Console is on SMC1 */
|
||||
|
||||
#define CONFIG_66MHz 1 /* running at 66 MHz, 1:1 clock */
|
||||
|
||||
#define CONFIG_BAUDRATE 115200 /* console baudrate = 115kbps */
|
||||
|
||||
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
|
||||
|
||||
#undef CONFIG_CLOCKS_IN_MHZ /* clocks passsed to Linux in Hz */
|
||||
|
||||
#define CONFIG_BOARD_TYPES 1 /* support board types */
|
||||
|
||||
#define CONFIG_PREBOOT "echo;" \
|
||||
"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
|
||||
"echo"
|
||||
|
||||
#undef CONFIG_BOOTARGS
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"netdev=eth0\0" \
|
||||
"nfsargs=setenv bootargs root=/dev/nfs rw " \
|
||||
"nfsroot=$(serverip):$(rootpath)\0" \
|
||||
"ramargs=setenv bootargs root=/dev/ram rw\0" \
|
||||
"addip=setenv bootargs $(bootargs) " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)" \
|
||||
":$(hostname):$(netdev):off panic=1\0" \
|
||||
"flash_nfs=run nfsargs addip;" \
|
||||
"bootm $(kernel_addr)\0" \
|
||||
"flash_self=run ramargs addip;" \
|
||||
"bootm $(kernel_addr) $(ramdisk_addr)\0" \
|
||||
"net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0" \
|
||||
"rootpath=/opt/eldk/ppc_8xx\0" \
|
||||
"bootfile=/tftpboot/NSCU/uImage\0" \
|
||||
"kernel_addr=40080000\0" \
|
||||
"ramdisk_addr=40180000\0" \
|
||||
""
|
||||
#define CONFIG_BOOTCOMMAND "run flash_self"
|
||||
|
||||
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
|
||||
#undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */
|
||||
|
||||
#undef CONFIG_WATCHDOG /* watchdog disabled */
|
||||
|
||||
#define CONFIG_STATUS_LED 1 /* Status LED enabled */
|
||||
|
||||
#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */
|
||||
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
|
||||
|
||||
#define CONFIG_MAC_PARTITION
|
||||
#define CONFIG_DOS_PARTITION
|
||||
|
||||
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
|
||||
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
CFG_CMD_ASKENV | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_IDE | \
|
||||
CFG_CMD_DATE )
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
*/
|
||||
#define CFG_LONGHELP /* undef to save memory */
|
||||
#define CFG_PROMPT "=> " /* Monitor Command Prompt */
|
||||
|
||||
#if 0
|
||||
#define CFG_HUSH_PARSER 1 /* use "hush" command parser */
|
||||
#endif
|
||||
#ifdef CFG_HUSH_PARSER
|
||||
#define CFG_PROMPT_HUSH_PS2 "> "
|
||||
#endif
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
|
||||
#else
|
||||
#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
|
||||
#endif
|
||||
#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
|
||||
#define CFG_MAXARGS 16 /* max number of command args */
|
||||
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
|
||||
|
||||
#define CFG_MEMTEST_START 0x0400000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
|
||||
|
||||
#define CFG_LOAD_ADDR 0x100000 /* default load address */
|
||||
|
||||
#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
|
||||
|
||||
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
|
||||
|
||||
/*
|
||||
* Low Level Configuration Settings
|
||||
* (address mappings, register initial values, etc.)
|
||||
* You should know what you are doing if you make changes here.
|
||||
*/
|
||||
/*-----------------------------------------------------------------------
|
||||
* Internal Memory Mapped Register
|
||||
*/
|
||||
#define CFG_IMMR 0xFFF00000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for initial stack pointer and data area (in DPRAM)
|
||||
*/
|
||||
#define CFG_INIT_RAM_ADDR CFG_IMMR
|
||||
#define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
|
||||
#define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
* (Set up by the startup code)
|
||||
* Please note that CFG_SDRAM_BASE _must_ start at 0
|
||||
*/
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_FLASH_BASE 0x40000000
|
||||
#define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
|
||||
#define CFG_MONITOR_BASE CFG_FLASH_BASE
|
||||
#define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
* have to be in the first 8 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 256 /* max number of sectors on one chip */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
#define CFG_ENV_IS_IN_FLASH 1
|
||||
#define CFG_ENV_OFFSET 0x40000 /* Offset of Environment Sector */
|
||||
#define CFG_ENV_SIZE 0x08000 /* Total Size of Environment Sector */
|
||||
#define CFG_ENV_SECT_SIZE 0x20000 /* Total Size of Environment Sector */
|
||||
|
||||
/* Address and size of Redundant Environment Sector */
|
||||
#define CFG_ENV_OFFSET_REDUND (CFG_ENV_OFFSET+CFG_ENV_SECT_SIZE)
|
||||
#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Hardware Information Block
|
||||
*/
|
||||
#define CFG_HWINFO_OFFSET 0x0003FFC0 /* offset of HW Info block */
|
||||
#define CFG_HWINFO_SIZE 0x00000040 /* size of HW Info block */
|
||||
#define CFG_HWINFO_MAGIC 0x54514D38 /* 'TQM8' */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Cache Configuration
|
||||
*/
|
||||
#define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SYPCR - System Protection Control 11-9
|
||||
* SYPCR can only be written once after reset!
|
||||
*-----------------------------------------------------------------------
|
||||
* Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
|
||||
*/
|
||||
#if defined(CONFIG_WATCHDOG)
|
||||
#define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
|
||||
SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
|
||||
#else
|
||||
#define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SIUMCR - SIU Module Configuration 11-6
|
||||
*-----------------------------------------------------------------------
|
||||
* PCMCIA config., multi-function pin tri-state
|
||||
*/
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#else /* we must activate GPL5 in the SIUMCR for CAN */
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* TBSCR - Time Base Status and Control 11-26
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Reference Interrupt Status, Timebase freezing enabled
|
||||
*/
|
||||
#define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* RTCSC - Real-Time Clock Status and Control Register 11-27
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PISCR - Periodic Interrupt Status and Control 11-31
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
|
||||
*/
|
||||
#define CFG_PISCR (PISCR_PS | PISCR_PITF)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
|
||||
*-----------------------------------------------------------------------
|
||||
* Reset PLL lock status sticky bit, timer expired status bit and timer
|
||||
* interrupt status bit
|
||||
*
|
||||
* If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)!
|
||||
*/
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_PLPRCR \
|
||||
( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
|
||||
#else /* up to 66 MHz we use a 1:1 clock */
|
||||
#define CFG_PLPRCR (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SCCR - System Clock and reset Control Register 15-27
|
||||
*-----------------------------------------------------------------------
|
||||
* Set clock output, timebase and RTC source and divider,
|
||||
* power management and some other internal clocks
|
||||
*/
|
||||
#define SCCR_MASK SCCR_EBDF11
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_SCCR (/* SCCR_TBS | */ \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#else /* up to 66 MHz we use a 1:1 clock */
|
||||
#define CFG_SCCR (SCCR_TBS | \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PCMCIA stuff
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
#define CFG_PCMCIA_MEM_ADDR (0xE0000000)
|
||||
#define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_DMA_ADDR (0xE4000000)
|
||||
#define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_ATTRB_ADDR (0xE8000000)
|
||||
#define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_IO_ADDR (0xEC000000)
|
||||
#define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
|
||||
|
||||
#undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
|
||||
#undef CONFIG_IDE_LED /* LED for ide not supported */
|
||||
#undef CONFIG_IDE_RESET /* reset for ide not supported */
|
||||
|
||||
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
|
||||
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
|
||||
|
||||
#define CFG_ATA_IDE0_OFFSET 0x0000
|
||||
|
||||
#define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
|
||||
|
||||
/* Offset for data I/O */
|
||||
#define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
|
||||
|
||||
/* Offset for normal register accesses */
|
||||
#define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
|
||||
|
||||
/* Offset for alternate registers */
|
||||
#define CFG_ATA_ALT_OFFSET 0x0100
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
#define CFG_DER 0
|
||||
|
||||
/*
|
||||
* Init Memory Controller:
|
||||
*
|
||||
* BR0/1 and OR0/1 (FLASH)
|
||||
*/
|
||||
|
||||
#define FLASH_BASE0_PRELIM 0x40000000 /* FLASH bank #0 */
|
||||
#define FLASH_BASE1_PRELIM 0x60000000 /* FLASH bank #0 */
|
||||
|
||||
/* used to re-map FLASH both when starting from SRAM or FLASH:
|
||||
* restrict access enough to keep SRAM working (if any)
|
||||
* but not too much to meddle with FLASH accesses
|
||||
*/
|
||||
#define CFG_REMAP_OR_AM 0x80000000 /* OR addr mask */
|
||||
#define CFG_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
|
||||
|
||||
/*
|
||||
* FLASH timing:
|
||||
*/
|
||||
#if defined(CONFIG_80MHz)
|
||||
/* 80 MHz CPU - 40 MHz bus: ACS = 00, TRLX = 0, CSNT = 1, SCY = 3, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | 0 | OR_CSNT_SAM | \
|
||||
OR_SCY_3_CLK | OR_EHTR | OR_BI)
|
||||
#elif defined(CONFIG_66MHz)
|
||||
/* 66 MHz CPU - 66 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
|
||||
OR_SCY_3_CLK | OR_EHTR | OR_BI)
|
||||
#else /* 50 MHz */
|
||||
/* 50 MHz CPU - 50 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 2, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
|
||||
OR_SCY_2_CLK | OR_EHTR | OR_BI)
|
||||
#endif /*CONFIG_??MHz */
|
||||
|
||||
#define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
|
||||
#define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
|
||||
#define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )
|
||||
|
||||
#define CFG_OR1_REMAP CFG_OR0_REMAP
|
||||
#define CFG_OR1_PRELIM CFG_OR0_PRELIM
|
||||
#define CFG_BR1_PRELIM ((FLASH_BASE1_PRELIM & BR_BA_MSK) | BR_V )
|
||||
|
||||
/*
|
||||
* BR2/3 and OR2/3 (SDRAM)
|
||||
*
|
||||
*/
|
||||
#define SDRAM_BASE2_PRELIM 0x00000000 /* SDRAM bank #0 */
|
||||
#define SDRAM_BASE3_PRELIM 0x20000000 /* SDRAM bank #1 */
|
||||
#define SDRAM_MAX_SIZE 0x04000000 /* max 64 MB per bank */
|
||||
|
||||
/* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care) */
|
||||
#define CFG_OR_TIMING_SDRAM 0x00000A00
|
||||
|
||||
#define CFG_OR2_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_SDRAM )
|
||||
#define CFG_BR2_PRELIM ((SDRAM_BASE2_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_OR3_PRELIM CFG_OR2_PRELIM
|
||||
#define CFG_BR3_PRELIM ((SDRAM_BASE3_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
#else /* CAN uses CS3#, so we can have only one SDRAM bank anyway */
|
||||
#define CFG_CAN_BASE 0xC0000000 /* CAN mapped at 0xC0000000 */
|
||||
#define CFG_CAN_OR_AM 0xFFFF8000 /* 32 kB address mask */
|
||||
#define CFG_OR3_CAN (CFG_CAN_OR_AM | OR_G5LA | OR_BI)
|
||||
#define CFG_BR3_CAN ((CFG_CAN_BASE & BR_BA_MSK) | \
|
||||
BR_PS_8 | BR_MS_UPMB | BR_V )
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*
|
||||
* Memory Periodic Timer Prescaler
|
||||
*
|
||||
* The Divider for PTA (refresh timer) configuration is based on an
|
||||
* example SDRAM configuration (64 MBit, one bank). The adjustment to
|
||||
* the number of chip selects (NCS) and the actually needed refresh
|
||||
* rate is done by setting MPTPR.
|
||||
*
|
||||
* PTA is calculated from
|
||||
* PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS)
|
||||
*
|
||||
* gclk CPU clock (not bus clock!)
|
||||
* Trefresh Refresh cycle * 4 (four word bursts used)
|
||||
*
|
||||
* 4096 Rows from SDRAM example configuration
|
||||
* 1000 factor s -> ms
|
||||
* 32 PTP (pre-divider from MPTPR) from SDRAM example configuration
|
||||
* 4 Number of refresh cycles per period
|
||||
* 64 Refresh cycle in ms per number of rows
|
||||
* --------------------------------------------
|
||||
* Divider = 4096 * 32 * 1000 / (4 * 64) = 512000
|
||||
*
|
||||
* 50 MHz => 50.000.000 / Divider = 98
|
||||
* 66 Mhz => 66.000.000 / Divider = 129
|
||||
* 80 Mhz => 80.000.000 / Divider = 156
|
||||
*/
|
||||
#if defined(CONFIG_80MHz)
|
||||
#define CFG_MAMR_PTA 156
|
||||
#elif defined(CONFIG_66MHz)
|
||||
#define CFG_MAMR_PTA 129
|
||||
#else /* 50 MHz */
|
||||
#define CFG_MAMR_PTA 98
|
||||
#endif /*CONFIG_??MHz */
|
||||
|
||||
/*
|
||||
* For 16 MBit, refresh rates could be 31.3 us
|
||||
* (= 64 ms / 2K = 125 / quad bursts).
|
||||
* For a simpler initialization, 15.6 us is used instead.
|
||||
*
|
||||
* #define CFG_MPTPR_2BK_2K MPTPR_PTP_DIV32 for 2 banks
|
||||
* #define CFG_MPTPR_1BK_2K MPTPR_PTP_DIV64 for 1 bank
|
||||
*/
|
||||
#define CFG_MPTPR_2BK_4K MPTPR_PTP_DIV16 /* setting for 2 banks */
|
||||
#define CFG_MPTPR_1BK_4K MPTPR_PTP_DIV32 /* setting for 1 bank */
|
||||
|
||||
/* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256 MBit */
|
||||
#define CFG_MPTPR_2BK_8K MPTPR_PTP_DIV8 /* setting for 2 banks */
|
||||
#define CFG_MPTPR_1BK_8K MPTPR_PTP_DIV16 /* setting for 1 bank */
|
||||
|
||||
/*
|
||||
* MAMR settings for SDRAM
|
||||
*/
|
||||
|
||||
/* 8 column SDRAM */
|
||||
#define CFG_MAMR_8COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
|
||||
MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 | \
|
||||
MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
|
||||
/* 9 column SDRAM */
|
||||
#define CFG_MAMR_9COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
|
||||
MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 | \
|
||||
MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
|
||||
|
||||
|
||||
/*
|
||||
* Internal Definitions
|
||||
*
|
||||
* Boot Flags
|
||||
*/
|
||||
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
|
||||
#define BOOTFLAG_WARM 0x02 /* Software reboot */
|
||||
|
||||
#undef CONFIG_SCC1_ENET
|
||||
#define CONFIG_FEC_ENET
|
||||
/* #define CONFIG_ETHPRIME "FEC ETHERNET" */
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
@@ -0,0 +1,268 @@
|
||||
/*
|
||||
* (C) Copyright 2001 - 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/*
|
||||
* Configuration settings for the SL8245 board.
|
||||
*/
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/*
|
||||
* High Level Configuration Options
|
||||
* (easy to change)
|
||||
*/
|
||||
|
||||
#define CONFIG_MPC824X 1
|
||||
#define CONFIG_MPC8245 1
|
||||
#define CONFIG_SL8245 1
|
||||
|
||||
|
||||
#define CONFIG_CONS_INDEX 1
|
||||
#define CONFIG_BAUDRATE 115200
|
||||
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
|
||||
|
||||
#define CONFIG_BOOTDELAY 5
|
||||
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL & ~CFG_CMD_NET )
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
*/
|
||||
#undef CFG_LONGHELP /* undef to save memory */
|
||||
#define CFG_PROMPT "=> " /* Monitor Command Prompt */
|
||||
#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
|
||||
|
||||
/* Print Buffer Size
|
||||
*/
|
||||
#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
|
||||
#define CFG_MAXARGS 8 /* Max number of command args */
|
||||
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
|
||||
#define CFG_LOAD_ADDR 0x00400000 /* Default load address */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
* (Set up by the startup code)
|
||||
* Please note that CFG_SDRAM_BASE _must_ start at 0
|
||||
*/
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
|
||||
#define CFG_FLASH_BASE0_PRELIM 0xFF800000 /* FLASH bank on RCS#0 */
|
||||
#define CFG_FLASH_BASE CFG_FLASH_BASE0_PRELIM
|
||||
#define CFG_FLASH_BANKS { CFG_FLASH_BASE0_PRELIM }
|
||||
|
||||
#define CFG_RESET_ADDRESS 0xFFF00100
|
||||
|
||||
#define CFG_EUMB_ADDR 0xFC000000
|
||||
|
||||
#define CFG_MONITOR_BASE TEXT_BASE
|
||||
#define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
|
||||
#define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
|
||||
|
||||
#define CFG_MEMTEST_START 0x00004000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x02000000 /* 0 ... 32 MB in DRAM */
|
||||
|
||||
/* Maximum amount of RAM.
|
||||
*/
|
||||
#define CFG_MAX_RAM_SIZE 0x10000000 /* 0 .. 256 MB of (S)DRAM */
|
||||
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
#undef CFG_RAMBOOT
|
||||
#else
|
||||
#define CFG_RAMBOOT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NS16550 Configuration
|
||||
*/
|
||||
#define CFG_NS16550
|
||||
#define CFG_NS16550_SERIAL
|
||||
|
||||
#define CFG_NS16550_REG_SIZE 1
|
||||
|
||||
#define CFG_NS16550_CLK get_bus_freq(0)
|
||||
|
||||
#define CFG_NS16550_COM1 (CFG_EUMB_ADDR + 0x4500)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for initial stack pointer and data area
|
||||
*/
|
||||
|
||||
#define CFG_GBL_DATA_SIZE 128
|
||||
#define CFG_INIT_RAM_ADDR 0x40000000
|
||||
#define CFG_INIT_RAM_END 0x1000
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
|
||||
/*
|
||||
* Low Level Configuration Settings
|
||||
* (address mappings, register initial values, etc.)
|
||||
* You should know what you are doing if you make changes here.
|
||||
* For the detail description refer to the MPC8240 user's manual.
|
||||
*/
|
||||
|
||||
#define CONFIG_SYS_CLK_FREQ 66666666 /* external frequency to pll */
|
||||
#define CFG_HZ 1000
|
||||
|
||||
/* Bit-field values for MCCR1.
|
||||
*/
|
||||
#define CFG_ROMNAL 0
|
||||
#define CFG_ROMFAL 7
|
||||
#define CFG_BANK0_ROW 2
|
||||
|
||||
/* Bit-field values for MCCR2.
|
||||
*/
|
||||
#define CFG_REFINT 0x400 /* Refresh interval FIXME: was 0t430 */
|
||||
|
||||
/* Burst To Precharge. Bits of this value go to MCCR3 and MCCR4.
|
||||
*/
|
||||
#define CFG_BSTOPRE 192
|
||||
|
||||
/* Bit-field values for MCCR3.
|
||||
*/
|
||||
#define CFG_REFREC 2 /* Refresh to activate interval */
|
||||
|
||||
/* Bit-field values for MCCR4.
|
||||
*/
|
||||
#define CFG_PRETOACT 2 /* Precharge to activate interval */
|
||||
#define CFG_ACTTOPRE 5 /* Activate to Precharge interval */
|
||||
#define CFG_ACTORW 3 /* FIXME was 2 */
|
||||
#define CFG_SDMODE_CAS_LAT 3 /* SDMODE CAS latancy */
|
||||
#define CFG_SDMODE_WRAP 0 /* SDMODE wrap type */
|
||||
#define CFG_REGISTERD_TYPE_BUFFER 1
|
||||
#define CFG_EXTROM 1
|
||||
#define CFG_REGDIMM 0
|
||||
|
||||
#define CFG_ODCR 0xff /* configures line driver impedances, */
|
||||
/* see 8245 book for bit definitions */
|
||||
#define CFG_PGMAX 0x32 /* how long the 8245 retains the */
|
||||
/* currently accessed page in memory */
|
||||
/* see 8245 book for details */
|
||||
|
||||
/* Memory bank settings.
|
||||
* Only bits 20-29 are actually used from these vales to set the
|
||||
* start/end addresses. The upper two bits will always be 0, and the lower
|
||||
* 20 bits will be 0x00000 for a start address, or 0xfffff for an end
|
||||
* address. Refer to the MPC8240 book.
|
||||
*/
|
||||
|
||||
#define CFG_BANK0_START 0x00000000
|
||||
#define CFG_BANK0_END (CFG_MAX_RAM_SIZE - 1)
|
||||
#define CFG_BANK0_ENABLE 1
|
||||
#define CFG_BANK1_START 0x3ff00000
|
||||
#define CFG_BANK1_END 0x3fffffff
|
||||
#define CFG_BANK1_ENABLE 0
|
||||
#define CFG_BANK2_START 0x3ff00000
|
||||
#define CFG_BANK2_END 0x3fffffff
|
||||
#define CFG_BANK2_ENABLE 0
|
||||
#define CFG_BANK3_START 0x3ff00000
|
||||
#define CFG_BANK3_END 0x3fffffff
|
||||
#define CFG_BANK3_ENABLE 0
|
||||
#define CFG_BANK4_START 0x3ff00000
|
||||
#define CFG_BANK4_END 0x3fffffff
|
||||
#define CFG_BANK4_ENABLE 0
|
||||
#define CFG_BANK5_START 0x3ff00000
|
||||
#define CFG_BANK5_END 0x3fffffff
|
||||
#define CFG_BANK5_ENABLE 0
|
||||
#define CFG_BANK6_START 0x3ff00000
|
||||
#define CFG_BANK6_END 0x3fffffff
|
||||
#define CFG_BANK6_ENABLE 0
|
||||
#define CFG_BANK7_START 0x3ff00000
|
||||
#define CFG_BANK7_END 0x3fffffff
|
||||
#define CFG_BANK7_ENABLE 0
|
||||
|
||||
#define CFG_IBAT0L (CFG_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
|
||||
#define CFG_IBAT0U (CFG_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
|
||||
|
||||
#define CFG_IBAT1L (CFG_INIT_RAM_ADDR | BATL_PP_10 | BATL_MEMCOHERENCE)
|
||||
#define CFG_IBAT1U (CFG_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
|
||||
|
||||
#define CFG_IBAT2L (0x80000000 | BATL_PP_10 | BATL_CACHEINHIBIT)
|
||||
#define CFG_IBAT2U (0x80000000 | BATU_BL_256M | BATU_VS | BATU_VP)
|
||||
|
||||
#define CFG_IBAT3L (0xF0000000 | BATL_PP_10 | BATL_CACHEINHIBIT)
|
||||
#define CFG_IBAT3U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
|
||||
|
||||
#define CFG_DBAT0L CFG_IBAT0L
|
||||
#define CFG_DBAT0U CFG_IBAT0U
|
||||
#define CFG_DBAT1L CFG_IBAT1L
|
||||
#define CFG_DBAT1U CFG_IBAT1U
|
||||
#define CFG_DBAT2L CFG_IBAT2L
|
||||
#define CFG_DBAT2U CFG_IBAT2U
|
||||
#define CFG_DBAT3L CFG_IBAT3L
|
||||
#define CFG_DBAT3U CFG_IBAT3U
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
* have to be in the first 8 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 1 /* Max number of flash banks */
|
||||
#define CFG_MAX_FLASH_SECT 35 /* Max number of sectors per flash */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
|
||||
/* Warining: environment is not EMBEDDED in the U-Boot code.
|
||||
* It's stored in flash separately.
|
||||
*/
|
||||
#define CFG_ENV_IS_IN_FLASH 1
|
||||
#define CFG_ENV_ADDR 0xFFFF0000
|
||||
#define CFG_ENV_SIZE 0x00010000 /* Size of the Environment */
|
||||
#define CFG_ENV_SECT_SIZE 0x00010000 /* Size of the Environment Sector */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Cache Configuration
|
||||
*/
|
||||
#define CFG_CACHELINE_SIZE 32
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
# define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Internal Definitions
|
||||
*
|
||||
* Boot Flags
|
||||
*/
|
||||
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
|
||||
#define BOOTFLAG_WARM 0x02 /* Software reboot */
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000, 2001, 2002
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -261,7 +261,7 @@
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_PLPRCR \
|
||||
( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
|
||||
#else /* up to 50 MHz we use a 1:1 clock */
|
||||
#else /* up to 66 MHz we use a 1:1 clock */
|
||||
#define CFG_PLPRCR (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#else /* up to 50 MHz we use a 1:1 clock */
|
||||
#else /* up to 66 MHz we use a 1:1 clock */
|
||||
#define CFG_SCCR (SCCR_TBS | \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/*
|
||||
* High Level Configuration Options
|
||||
* (easy to change)
|
||||
*/
|
||||
|
||||
#define CONFIG_MPC823 1 /* This is a MPC823 CPU */
|
||||
#define CONFIG_TQM823M 1 /* ...on a TQM8xxM module */
|
||||
|
||||
#ifdef CONFIG_LCD /* with LCD controller ? */
|
||||
/* #define CONFIG_NEC_NL6648BC20 1 / * use NEC NL6648BC20 display */
|
||||
#endif
|
||||
|
||||
#define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
|
||||
#undef CONFIG_8xx_CONS_SMC2
|
||||
#undef CONFIG_8xx_CONS_NONE
|
||||
#define CONFIG_BAUDRATE 115200 /* console baudrate = 115kbps */
|
||||
#if 0
|
||||
#define CONFIG_BOOTDELAY -1 /* autoboot disabled */
|
||||
#else
|
||||
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
|
||||
#endif
|
||||
|
||||
#define CONFIG_CLOCKS_IN_MHZ 1 /* clocks passsed to Linux in MHz */
|
||||
|
||||
#define CONFIG_BOARD_TYPES 1 /* support board types */
|
||||
|
||||
#define CONFIG_PREBOOT "echo;echo Type \"run flash_nfs\" to mount root filesystem over NFS;echo"
|
||||
|
||||
#undef CONFIG_BOOTARGS
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"netdev=eth0\0" \
|
||||
"nfsargs=setenv bootargs root=/dev/nfs rw " \
|
||||
"nfsroot=$(serverip):$(rootpath)\0" \
|
||||
"ramargs=setenv bootargs root=/dev/ram rw\0" \
|
||||
"addip=setenv bootargs $(bootargs) " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)" \
|
||||
":$(hostname):$(netdev):off panic=1\0" \
|
||||
"flash_nfs=run nfsargs addip;" \
|
||||
"bootm $(kernel_addr)\0" \
|
||||
"flash_self=run ramargs addip;" \
|
||||
"bootm $(kernel_addr) $(ramdisk_addr)\0" \
|
||||
"net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0" \
|
||||
"rootpath=/opt/eldk/ppc_8xx\0" \
|
||||
"bootfile=/tftpboot/TQM823M/uImage\0" \
|
||||
"kernel_addr=40080000\0" \
|
||||
"ramdisk_addr=40180000\0" \
|
||||
""
|
||||
#define CONFIG_BOOTCOMMAND "run flash_self"
|
||||
|
||||
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
|
||||
#undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */
|
||||
|
||||
#undef CONFIG_WATCHDOG /* watchdog disabled */
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
# undef CONFIG_STATUS_LED /* disturbs display */
|
||||
#else
|
||||
# define CONFIG_STATUS_LED 1 /* Status LED enabled */
|
||||
#endif /* CONFIG_LCD */
|
||||
|
||||
#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */
|
||||
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
|
||||
|
||||
#define CONFIG_MAC_PARTITION
|
||||
#define CONFIG_DOS_PARTITION
|
||||
|
||||
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
|
||||
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
CFG_CMD_ASKENV | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_IDE | \
|
||||
CFG_CMD_DATE )
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
*/
|
||||
#define CFG_LONGHELP /* undef to save memory */
|
||||
#define CFG_PROMPT "=> " /* Monitor Command Prompt */
|
||||
|
||||
#if 0
|
||||
#define CFG_HUSH_PARSER 1 /* use "hush" command parser */
|
||||
#endif
|
||||
#ifdef CFG_HUSH_PARSER
|
||||
#define CFG_PROMPT_HUSH_PS2 "> "
|
||||
#endif
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
|
||||
#else
|
||||
#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
|
||||
#endif
|
||||
#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
|
||||
#define CFG_MAXARGS 16 /* max number of command args */
|
||||
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
|
||||
|
||||
#define CFG_MEMTEST_START 0x0400000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
|
||||
|
||||
#define CFG_LOAD_ADDR 0x100000 /* default load address */
|
||||
|
||||
#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
|
||||
|
||||
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
|
||||
|
||||
/*
|
||||
* Low Level Configuration Settings
|
||||
* (address mappings, register initial values, etc.)
|
||||
* You should know what you are doing if you make changes here.
|
||||
*/
|
||||
/*-----------------------------------------------------------------------
|
||||
* Internal Memory Mapped Register
|
||||
*/
|
||||
#define CFG_IMMR 0xFFF00000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for initial stack pointer and data area (in DPRAM)
|
||||
*/
|
||||
#define CFG_INIT_RAM_ADDR CFG_IMMR
|
||||
#define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
|
||||
#define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
* (Set up by the startup code)
|
||||
* Please note that CFG_SDRAM_BASE _must_ start at 0
|
||||
*/
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_FLASH_BASE 0x40000000
|
||||
#define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
|
||||
#define CFG_MONITOR_BASE CFG_FLASH_BASE
|
||||
#define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
* have to be in the first 8 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 256 /* max number of sectors on one chip */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
#define CFG_ENV_IS_IN_FLASH 1
|
||||
#define CFG_ENV_OFFSET 0x40000 /* Offset of Environment Sector */
|
||||
#define CFG_ENV_SIZE 0x08000 /* Total Size of Environment Sector */
|
||||
#define CFG_ENV_SECT_SIZE 0x20000 /* Total Size of Environment Sector */
|
||||
|
||||
/* Address and size of Redundant Environment Sector */
|
||||
#define CFG_ENV_OFFSET_REDUND (CFG_ENV_OFFSET+CFG_ENV_SECT_SIZE)
|
||||
#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Hardware Information Block
|
||||
*/
|
||||
#define CFG_HWINFO_OFFSET 0x0003FFC0 /* offset of HW Info block */
|
||||
#define CFG_HWINFO_SIZE 0x00000040 /* size of HW Info block */
|
||||
#define CFG_HWINFO_MAGIC 0x54514D38 /* 'TQM8' */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Cache Configuration
|
||||
*/
|
||||
#define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SYPCR - System Protection Control 11-9
|
||||
* SYPCR can only be written once after reset!
|
||||
*-----------------------------------------------------------------------
|
||||
* Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
|
||||
*/
|
||||
#if defined(CONFIG_WATCHDOG)
|
||||
#define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
|
||||
SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
|
||||
#else
|
||||
#define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SIUMCR - SIU Module Configuration 11-6
|
||||
*-----------------------------------------------------------------------
|
||||
* PCMCIA config., multi-function pin tri-state
|
||||
*/
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#else /* we must activate GPL5 in the SIUMCR for CAN */
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* TBSCR - Time Base Status and Control 11-26
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Reference Interrupt Status, Timebase freezing enabled
|
||||
*/
|
||||
#define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* RTCSC - Real-Time Clock Status and Control Register 11-27
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PISCR - Periodic Interrupt Status and Control 11-31
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
|
||||
*/
|
||||
#define CFG_PISCR (PISCR_PS | PISCR_PITF)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
|
||||
*-----------------------------------------------------------------------
|
||||
* Reset PLL lock status sticky bit, timer expired status bit and timer
|
||||
* interrupt status bit
|
||||
*
|
||||
* If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)!
|
||||
*/
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_PLPRCR \
|
||||
( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
|
||||
#else /* up to 66 MHz we use a 1:1 clock */
|
||||
#define CFG_PLPRCR (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SCCR - System Clock and reset Control Register 15-27
|
||||
*-----------------------------------------------------------------------
|
||||
* Set clock output, timebase and RTC source and divider,
|
||||
* power management and some other internal clocks
|
||||
*/
|
||||
#define SCCR_MASK SCCR_EBDF11
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_SCCR (/* SCCR_TBS | */ \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#else /* up to 66 MHz we use a 1:1 clock */
|
||||
#define CFG_SCCR (SCCR_TBS | \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PCMCIA stuff
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
#define CFG_PCMCIA_MEM_ADDR (0xE0000000)
|
||||
#define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_DMA_ADDR (0xE4000000)
|
||||
#define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_ATTRB_ADDR (0xE8000000)
|
||||
#define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_IO_ADDR (0xEC000000)
|
||||
#define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
|
||||
|
||||
#undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
|
||||
#undef CONFIG_IDE_LED /* LED for ide not supported */
|
||||
#undef CONFIG_IDE_RESET /* reset for ide not supported */
|
||||
|
||||
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
|
||||
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
|
||||
|
||||
#define CFG_ATA_IDE0_OFFSET 0x0000
|
||||
|
||||
#define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
|
||||
|
||||
/* Offset for data I/O */
|
||||
#define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
|
||||
|
||||
/* Offset for normal register accesses */
|
||||
#define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
|
||||
|
||||
/* Offset for alternate registers */
|
||||
#define CFG_ATA_ALT_OFFSET 0x0100
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
#define CFG_DER 0
|
||||
|
||||
/*
|
||||
* Init Memory Controller:
|
||||
*
|
||||
* BR0/1 and OR0/1 (FLASH)
|
||||
*/
|
||||
|
||||
#define FLASH_BASE0_PRELIM 0x40000000 /* FLASH bank #0 */
|
||||
#define FLASH_BASE1_PRELIM 0x60000000 /* FLASH bank #0 */
|
||||
|
||||
/* used to re-map FLASH both when starting from SRAM or FLASH:
|
||||
* restrict access enough to keep SRAM working (if any)
|
||||
* but not too much to meddle with FLASH accesses
|
||||
*/
|
||||
#define CFG_REMAP_OR_AM 0x80000000 /* OR addr mask */
|
||||
#define CFG_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
|
||||
|
||||
/*
|
||||
* FLASH timing:
|
||||
*/
|
||||
#if defined(CONFIG_80MHz)
|
||||
/* 80 MHz CPU - 40 MHz bus: ACS = 00, TRLX = 0, CSNT = 1, SCY = 3, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | 0 | OR_CSNT_SAM | \
|
||||
OR_SCY_3_CLK | OR_EHTR | OR_BI)
|
||||
#elif defined(CONFIG_66MHz)
|
||||
/* 66 MHz CPU - 66 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
|
||||
OR_SCY_3_CLK | OR_EHTR | OR_BI)
|
||||
#else /* 50 MHz */
|
||||
/* 50 MHz CPU - 50 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 2, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
|
||||
OR_SCY_2_CLK | OR_EHTR | OR_BI)
|
||||
#endif /*CONFIG_??MHz */
|
||||
|
||||
#define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
|
||||
#define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
|
||||
#define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )
|
||||
|
||||
#define CFG_OR1_REMAP CFG_OR0_REMAP
|
||||
#define CFG_OR1_PRELIM CFG_OR0_PRELIM
|
||||
#define CFG_BR1_PRELIM ((FLASH_BASE1_PRELIM & BR_BA_MSK) | BR_V )
|
||||
|
||||
/*
|
||||
* BR2/3 and OR2/3 (SDRAM)
|
||||
*
|
||||
*/
|
||||
#define SDRAM_BASE2_PRELIM 0x00000000 /* SDRAM bank #0 */
|
||||
#define SDRAM_BASE3_PRELIM 0x20000000 /* SDRAM bank #1 */
|
||||
#define SDRAM_MAX_SIZE 0x04000000 /* max 64 MB per bank */
|
||||
|
||||
/* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care) */
|
||||
#define CFG_OR_TIMING_SDRAM 0x00000A00
|
||||
|
||||
#define CFG_OR2_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_SDRAM )
|
||||
#define CFG_BR2_PRELIM ((SDRAM_BASE2_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_OR3_PRELIM CFG_OR2_PRELIM
|
||||
#define CFG_BR3_PRELIM ((SDRAM_BASE3_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
#else /* CAN uses CS3#, so we can have only one SDRAM bank anyway */
|
||||
#define CFG_CAN_BASE 0xC0000000 /* CAN mapped at 0xC0000000 */
|
||||
#define CFG_CAN_OR_AM 0xFFFF8000 /* 32 kB address mask */
|
||||
#define CFG_OR3_CAN (CFG_CAN_OR_AM | OR_G5LA | OR_BI)
|
||||
#define CFG_BR3_CAN ((CFG_CAN_BASE & BR_BA_MSK) | \
|
||||
BR_PS_8 | BR_MS_UPMB | BR_V )
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*
|
||||
* Memory Periodic Timer Prescaler
|
||||
*
|
||||
* The Divider for PTA (refresh timer) configuration is based on an
|
||||
* example SDRAM configuration (64 MBit, one bank). The adjustment to
|
||||
* the number of chip selects (NCS) and the actually needed refresh
|
||||
* rate is done by setting MPTPR.
|
||||
*
|
||||
* PTA is calculated from
|
||||
* PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS)
|
||||
*
|
||||
* gclk CPU clock (not bus clock!)
|
||||
* Trefresh Refresh cycle * 4 (four word bursts used)
|
||||
*
|
||||
* 4096 Rows from SDRAM example configuration
|
||||
* 1000 factor s -> ms
|
||||
* 32 PTP (pre-divider from MPTPR) from SDRAM example configuration
|
||||
* 4 Number of refresh cycles per period
|
||||
* 64 Refresh cycle in ms per number of rows
|
||||
* --------------------------------------------
|
||||
* Divider = 4096 * 32 * 1000 / (4 * 64) = 512000
|
||||
*
|
||||
* 50 MHz => 50.000.000 / Divider = 98
|
||||
* 66 Mhz => 66.000.000 / Divider = 129
|
||||
* 80 Mhz => 80.000.000 / Divider = 156
|
||||
*/
|
||||
#if defined(CONFIG_80MHz)
|
||||
#define CFG_MAMR_PTA 156
|
||||
#elif defined(CONFIG_66MHz)
|
||||
#define CFG_MAMR_PTA 129
|
||||
#else /* 50 MHz */
|
||||
#define CFG_MAMR_PTA 98
|
||||
#endif /*CONFIG_??MHz */
|
||||
|
||||
/*
|
||||
* For 16 MBit, refresh rates could be 31.3 us
|
||||
* (= 64 ms / 2K = 125 / quad bursts).
|
||||
* For a simpler initialization, 15.6 us is used instead.
|
||||
*
|
||||
* #define CFG_MPTPR_2BK_2K MPTPR_PTP_DIV32 for 2 banks
|
||||
* #define CFG_MPTPR_1BK_2K MPTPR_PTP_DIV64 for 1 bank
|
||||
*/
|
||||
#define CFG_MPTPR_2BK_4K MPTPR_PTP_DIV16 /* setting for 2 banks */
|
||||
#define CFG_MPTPR_1BK_4K MPTPR_PTP_DIV32 /* setting for 1 bank */
|
||||
|
||||
/* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256 MBit */
|
||||
#define CFG_MPTPR_2BK_8K MPTPR_PTP_DIV8 /* setting for 2 banks */
|
||||
#define CFG_MPTPR_1BK_8K MPTPR_PTP_DIV16 /* setting for 1 bank */
|
||||
|
||||
/*
|
||||
* MAMR settings for SDRAM
|
||||
*/
|
||||
|
||||
/* 8 column SDRAM */
|
||||
#define CFG_MAMR_8COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
|
||||
MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 | \
|
||||
MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
|
||||
/* 9 column SDRAM */
|
||||
#define CFG_MAMR_9COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
|
||||
MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 | \
|
||||
MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
|
||||
|
||||
|
||||
/*
|
||||
* Internal Definitions
|
||||
*
|
||||
* Boot Flags
|
||||
*/
|
||||
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
|
||||
#define BOOTFLAG_WARM 0x02 /* Software reboot */
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* (C) Copyright 2001-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
|
||||
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user