* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)master
parent
993cad9364
commit
8bde7f776c
22
CHANGELOG
22
CHANGELOG
|
@ -1,11 +1,25 @@
|
|||
======================================================================
|
||||
Changes since U-Boot 0.3.1:
|
||||
Changes since U-Boot 0.4.0:
|
||||
======================================================================
|
||||
|
||||
* Code cleanup:
|
||||
- remove trailing white space, trailing empty lines, C++ comments, etc.
|
||||
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
|
||||
|
||||
* Patches by Kenneth Johansson, 25 Jun 2003:
|
||||
- major rework of command structure
|
||||
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.0:
|
||||
======================================================================
|
||||
|
||||
* Patches by Robert Schwebel, 26 Jun 2003:
|
||||
- logdl
|
||||
- csb226
|
||||
- innokom
|
||||
- csb226 configuration updated
|
||||
- credits for logodl port updated
|
||||
- innokom configuration updated
|
||||
- logodl tree update, still with coding style inconsistencies
|
||||
- added OCM for ppc405 warning to README
|
||||
|
||||
* Patch by Pantelis Antoniou, 25 Jun 2003:
|
||||
update NetVia with V2 board support
|
||||
|
|
2
CREDITS
2
CREDITS
|
@ -67,7 +67,7 @@ E: jonathan.debruyne@siemens.atea.be
|
|||
D: Port to Siemens IAD210 board
|
||||
|
||||
N: Ken Chou
|
||||
E: kchou@ieee.org
|
||||
E: kchou@ieee.org
|
||||
D: Support for A3000 SBC board
|
||||
|
||||
N: Conn Clark
|
||||
|
|
10
MAKEALL
10
MAKEALL
|
@ -45,10 +45,10 @@ LIST_8xx=" \
|
|||
|
||||
LIST_4xx=" \
|
||||
ADCIOP AR405 ASH405 BUBINGA405EP \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 DASA_SIM \
|
||||
DU405 EBONY ERIC MIP405 \
|
||||
MIP405T ML2 OCRTC ORSG \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 DASA_SIM \
|
||||
DU405 EBONY ERIC MIP405 \
|
||||
MIP405T ML2 OCRTC ORSG \
|
||||
PCI405 PIP405 PMC405 W7OLMC \
|
||||
W7OLMG WALNUT405 \
|
||||
"
|
||||
|
@ -58,7 +58,7 @@ LIST_4xx=" \
|
|||
#########################################################################
|
||||
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
MOUSSE MUSENKI OXC PN62 \
|
||||
Sandpoint8240 Sandpoint8245 utx8245 \
|
||||
"
|
||||
|
|
5
Makefile
5
Makefile
|
@ -134,7 +134,8 @@ u-boot.dis: u-boot
|
|||
$(OBJDUMP) -d $< > $@
|
||||
|
||||
u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
|
||||
$(LD) $(LDFLAGS) $(OBJS) \
|
||||
UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
|
||||
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
|
||||
--start-group $(LIBS) --end-group \
|
||||
-Map u-boot.map -o u-boot
|
||||
|
||||
|
@ -741,7 +742,7 @@ ep7312_config : unconfig
|
|||
#########################################################################
|
||||
|
||||
cradle_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa cradle
|
||||
@./mkconfig $(@:_config=) arm pxa cradle
|
||||
|
||||
csb226_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa csb226
|
||||
|
|
181
README
181
README
|
@ -735,12 +735,12 @@ The following options need to be configured:
|
|||
(TEAC FD-05PUB).
|
||||
|
||||
- MMC Support:
|
||||
The MMC controller on the Intel PXA is supported. To
|
||||
enable this define CONFIG_MMC. The MMC can be
|
||||
accessed from the boot prompt by mapping the device
|
||||
The MMC controller on the Intel PXA is supported. To
|
||||
enable this define CONFIG_MMC. The MMC can be
|
||||
accessed from the boot prompt by mapping the device
|
||||
to physical memory similar to flash. Command line is
|
||||
enabled with CFG_CMD_MMC. The MMC driver also works with
|
||||
the FAT fs. This is enabled with CFG_CMD_FAT.
|
||||
the FAT fs. This is enabled with CFG_CMD_FAT.
|
||||
|
||||
- Keyboard Support:
|
||||
CONFIG_ISA_KEYBOARD
|
||||
|
@ -782,12 +782,12 @@ The following options need to be configured:
|
|||
or CONFIG_VIDEO_SED13806_16BPP
|
||||
|
||||
- Keyboard Support:
|
||||
CONFIG_KEYBOARD
|
||||
CONFIG_KEYBOARD
|
||||
|
||||
Define this to enable a custom keyboard support.
|
||||
This simply calls drv_keyboard_init() which must be
|
||||
defined in your board-specific files.
|
||||
The only board using this so far is RBC823.
|
||||
Define this to enable a custom keyboard support.
|
||||
This simply calls drv_keyboard_init() which must be
|
||||
defined in your board-specific files.
|
||||
The only board using this so far is RBC823.
|
||||
|
||||
- LCD Support: CONFIG_LCD
|
||||
|
||||
|
@ -834,14 +834,14 @@ The following options need to be configured:
|
|||
|
||||
- Spash Screen Support: CONFIG_SPLASH_SCREEN
|
||||
|
||||
If this option is set, the environment is checked for
|
||||
a variable "splashimage". If found, the usual display
|
||||
of logo, copyright and system information on the LCD
|
||||
is supressed and the BMP image at the address
|
||||
specified in "splashimage" is loaded instead. The
|
||||
console is redirected to the "nulldev", too. This
|
||||
allows for a "silent" boot where a splash screen is
|
||||
loaded very quickly after power-on.
|
||||
If this option is set, the environment is checked for
|
||||
a variable "splashimage". If found, the usual display
|
||||
of logo, copyright and system information on the LCD
|
||||
is supressed and the BMP image at the address
|
||||
specified in "splashimage" is loaded instead. The
|
||||
console is redirected to the "nulldev", too. This
|
||||
allows for a "silent" boot where a splash screen is
|
||||
loaded very quickly after power-on.
|
||||
|
||||
|
||||
- Ethernet address:
|
||||
|
@ -968,14 +968,14 @@ The following options need to be configured:
|
|||
|
||||
CFG_I2C_INIT_BOARD
|
||||
|
||||
When a board is reset during an i2c bus transfer
|
||||
chips might think that the current transfer is still
|
||||
in progress. On some boards it is possible to access
|
||||
the i2c SCLK line directly, either by using the
|
||||
processor pin as a GPIO or by having a second pin
|
||||
connected to the bus. If this option is defined a
|
||||
custom i2c_init_board() routine in boards/xxx/board.c
|
||||
is run early in the boot sequence.
|
||||
When a board is reset during an i2c bus transfer
|
||||
chips might think that the current transfer is still
|
||||
in progress. On some boards it is possible to access
|
||||
the i2c SCLK line directly, either by using the
|
||||
processor pin as a GPIO or by having a second pin
|
||||
connected to the bus. If this option is defined a
|
||||
custom i2c_init_board() routine in boards/xxx/board.c
|
||||
is run early in the boot sequence.
|
||||
|
||||
- SPI Support: CONFIG_SPI
|
||||
|
||||
|
@ -1006,9 +1006,9 @@ The following options need to be configured:
|
|||
|
||||
Used to specify the types of FPGA devices. For
|
||||
example,
|
||||
#define CONFIG_FPGA CFG_XILINX_VIRTEX2
|
||||
#define CONFIG_FPGA CFG_XILINX_VIRTEX2
|
||||
|
||||
CFG_FPGA_PROG_FEEDBACK
|
||||
CFG_FPGA_PROG_FEEDBACK
|
||||
|
||||
Enable printing of hash marks during FPGA
|
||||
configuration.
|
||||
|
@ -1054,16 +1054,16 @@ The following options need to be configured:
|
|||
|
||||
- FPGA Support: CONFIG_FPGA_COUNT
|
||||
|
||||
Specify the number of FPGA devices to support.
|
||||
Specify the number of FPGA devices to support.
|
||||
|
||||
CONFIG_FPGA
|
||||
CONFIG_FPGA
|
||||
|
||||
Used to specify the types of FPGA devices. For example,
|
||||
#define CONFIG_FPGA CFG_XILINX_VIRTEX2
|
||||
Used to specify the types of FPGA devices. For example,
|
||||
#define CONFIG_FPGA CFG_XILINX_VIRTEX2
|
||||
|
||||
CFG_FPGA_PROG_FEEDBACK
|
||||
CFG_FPGA_PROG_FEEDBACK
|
||||
|
||||
Enable printing of hash marks during FPGA configuration.
|
||||
Enable printing of hash marks during FPGA configuration.
|
||||
|
||||
CFG_FPGA_CHECK_BUSY
|
||||
|
||||
|
@ -1205,13 +1205,13 @@ The following options need to be configured:
|
|||
|
||||
Note:
|
||||
|
||||
In the current implementation, the local variables
|
||||
space and global environment variables space are
|
||||
separated. Local variables are those you define by
|
||||
simply typing `name=value'. To access a local
|
||||
variable later on, you have write `$name' or
|
||||
`${name}'; to execute the contents of a variable
|
||||
directly type `$name' at the command prompt.
|
||||
In the current implementation, the local variables
|
||||
space and global environment variables space are
|
||||
separated. Local variables are those you define by
|
||||
simply typing `name=value'. To access a local
|
||||
variable later on, you have write `$name' or
|
||||
`${name}'; to execute the contents of a variable
|
||||
directly type `$name' at the command prompt.
|
||||
|
||||
Global environment variables are those you use
|
||||
setenv/printenv to work with. To run a command stored
|
||||
|
@ -1253,9 +1253,9 @@ The following options need to be configured:
|
|||
- DataFlash Support
|
||||
CONFIG_HAS_DATAFLASH
|
||||
|
||||
Defining this option enables DataFlash features and
|
||||
allows to read/write in Dataflash via the standard
|
||||
commands cp, md...
|
||||
Defining this option enables DataFlash features and
|
||||
allows to read/write in Dataflash via the standard
|
||||
commands cp, md...
|
||||
|
||||
- Show boot progress
|
||||
CONFIG_SHOW_BOOT_PROGRESS
|
||||
|
@ -1349,8 +1349,6 @@ Modem Support:
|
|||
See also: doc/README.Modem
|
||||
|
||||
|
||||
|
||||
|
||||
Configuration Settings:
|
||||
-----------------------
|
||||
|
||||
|
@ -1374,16 +1372,16 @@ Configuration Settings:
|
|||
List of legal baudrate settings for this board.
|
||||
|
||||
- CFG_CONSOLE_INFO_QUIET
|
||||
Suppress display of console information at boot.
|
||||
Suppress display of console information at boot.
|
||||
|
||||
- CFG_CONSOLE_IS_IN_ENV
|
||||
If the board specific function
|
||||
extern int overwrite_console (void);
|
||||
returns 1, the stdin, stderr and stdout are switched to the
|
||||
If the board specific function
|
||||
extern int overwrite_console (void);
|
||||
returns 1, the stdin, stderr and stdout are switched to the
|
||||
serial port, else the settings in the environment are used.
|
||||
|
||||
- CFG_CONSOLE_OVERWRITE_ROUTINE
|
||||
Enable the call to overwrite_console().
|
||||
Enable the call to overwrite_console().
|
||||
|
||||
- CFG_CONSOLE_ENV_OVERWRITE
|
||||
Enable overwrite of previous console environment settings.
|
||||
|
@ -1393,7 +1391,7 @@ Configuration Settings:
|
|||
simple memory test.
|
||||
|
||||
- CFG_ALT_MEMTEST:
|
||||
Enable an alternate, more extensive memory test.
|
||||
Enable an alternate, more extensive memory test.
|
||||
|
||||
- CFG_TFTP_LOADADDR:
|
||||
Default load address for network file downloads
|
||||
|
@ -1418,10 +1416,10 @@ Configuration Settings:
|
|||
CFG_FLASH_BASE when booting from flash.
|
||||
|
||||
- CFG_MONITOR_LEN:
|
||||
Size of memory reserved for monitor code, used to
|
||||
determine _at_compile_time_ (!) if the environment is
|
||||
embedded within the U-Boot image, or in a separate
|
||||
flash sector.
|
||||
Size of memory reserved for monitor code, used to
|
||||
determine _at_compile_time_ (!) if the environment is
|
||||
embedded within the U-Boot image, or in a separate
|
||||
flash sector.
|
||||
|
||||
- CFG_MALLOC_LEN:
|
||||
Size of DRAM reserved for malloc() use.
|
||||
|
@ -1842,7 +1840,6 @@ Note: for some board special configuration names may exist; check if
|
|||
etc.
|
||||
|
||||
|
||||
|
||||
Finally, type "make all", and you should get some working U-Boot
|
||||
images ready for downlod to / installation on your system:
|
||||
|
||||
|
@ -1906,7 +1903,6 @@ or to build on a native PowerPC system you can type
|
|||
See also "U-Boot Porting Guide" below.
|
||||
|
||||
|
||||
|
||||
Monitor Commands - Overview:
|
||||
============================
|
||||
|
||||
|
@ -2029,13 +2025,13 @@ Some configuration options can be set using Environment Variables:
|
|||
|
||||
setenv initrd_high 00c00000
|
||||
|
||||
If you set initrd_high to 0xFFFFFFFF, this is an
|
||||
indication to U-Boot that all addresses are legal
|
||||
for the Linux kernel, including addresses in flash
|
||||
memory. In this case U-Boot will NOT COPY the
|
||||
ramdisk at all. This may be useful to reduce the
|
||||
boot time on your system, but requires that this
|
||||
feature is supported by your Linux kernel.
|
||||
If you set initrd_high to 0xFFFFFFFF, this is an
|
||||
indication to U-Boot that all addresses are legal
|
||||
for the Linux kernel, including addresses in flash
|
||||
memory. In this case U-Boot will NOT COPY the
|
||||
ramdisk at all. This may be useful to reduce the
|
||||
boot time on your system, but requires that this
|
||||
feature is supported by your Linux kernel.
|
||||
|
||||
ipaddr - IP address; needed for tftpboot command
|
||||
|
||||
|
@ -2165,7 +2161,6 @@ o If neither SROM nor the environment contain a MAC address, an error
|
|||
is raised.
|
||||
|
||||
|
||||
|
||||
Image Formats:
|
||||
==============
|
||||
|
||||
|
@ -2428,7 +2423,6 @@ corruption happened:
|
|||
Verifying Checksum ... OK
|
||||
|
||||
|
||||
|
||||
Boot Linux:
|
||||
-----------
|
||||
|
||||
|
@ -2518,39 +2512,39 @@ More About U-Boot Image Types:
|
|||
U-Boot supports the following image types:
|
||||
|
||||
"Standalone Programs" are directly runnable in the environment
|
||||
provided by U-Boot; it is expected that (if they behave
|
||||
well) you can continue to work in U-Boot after return from
|
||||
the Standalone Program.
|
||||
provided by U-Boot; it is expected that (if they behave
|
||||
well) you can continue to work in U-Boot after return from
|
||||
the Standalone Program.
|
||||
"OS Kernel Images" are usually images of some Embedded OS which
|
||||
will take over control completely. Usually these programs
|
||||
will install their own set of exception handlers, device
|
||||
drivers, set up the MMU, etc. - this means, that you cannot
|
||||
expect to re-enter U-Boot except by resetting the CPU.
|
||||
will take over control completely. Usually these programs
|
||||
will install their own set of exception handlers, device
|
||||
drivers, set up the MMU, etc. - this means, that you cannot
|
||||
expect to re-enter U-Boot except by resetting the CPU.
|
||||
"RAMDisk Images" are more or less just data blocks, and their
|
||||
parameters (address, size) are passed to an OS kernel that is
|
||||
being started.
|
||||
parameters (address, size) are passed to an OS kernel that is
|
||||
being started.
|
||||
"Multi-File Images" contain several images, typically an OS
|
||||
(Linux) kernel image and one or more data images like
|
||||
RAMDisks. This construct is useful for instance when you want
|
||||
to boot over the network using BOOTP etc., where the boot
|
||||
server provides just a single image file, but you want to get
|
||||
for instance an OS kernel and a RAMDisk image.
|
||||
(Linux) kernel image and one or more data images like
|
||||
RAMDisks. This construct is useful for instance when you want
|
||||
to boot over the network using BOOTP etc., where the boot
|
||||
server provides just a single image file, but you want to get
|
||||
for instance an OS kernel and a RAMDisk image.
|
||||
|
||||
"Multi-File Images" start with a list of image sizes, each
|
||||
image size (in bytes) specified by an "uint32_t" in network
|
||||
byte order. This list is terminated by an "(uint32_t)0".
|
||||
Immediately after the terminating 0 follow the images, one by
|
||||
one, all aligned on "uint32_t" boundaries (size rounded up to
|
||||
a multiple of 4 bytes).
|
||||
"Multi-File Images" start with a list of image sizes, each
|
||||
image size (in bytes) specified by an "uint32_t" in network
|
||||
byte order. This list is terminated by an "(uint32_t)0".
|
||||
Immediately after the terminating 0 follow the images, one by
|
||||
one, all aligned on "uint32_t" boundaries (size rounded up to
|
||||
a multiple of 4 bytes).
|
||||
|
||||
"Firmware Images" are binary images containing firmware (like
|
||||
U-Boot or FPGA images) which usually will be programmed to
|
||||
flash memory.
|
||||
U-Boot or FPGA images) which usually will be programmed to
|
||||
flash memory.
|
||||
|
||||
"Script files" are command sequences that will be executed by
|
||||
U-Boot's command interpreter; this feature is especially
|
||||
useful when you configure U-Boot to use a real shell (hush)
|
||||
as command interpreter.
|
||||
U-Boot's command interpreter; this feature is especially
|
||||
useful when you configure U-Boot to use a real shell (hush)
|
||||
as command interpreter.
|
||||
|
||||
|
||||
Standalone HOWTO:
|
||||
|
@ -2641,7 +2635,6 @@ Hit 'q':
|
|||
[q, b, e, ?] ## Application terminated, rc = 0x0
|
||||
|
||||
|
||||
|
||||
Minicom warning:
|
||||
================
|
||||
|
||||
|
@ -2813,7 +2806,6 @@ On ARM, the following registers are used:
|
|||
==> U-Boot will use R8 to hold a pointer to the global data
|
||||
|
||||
|
||||
|
||||
Memory Management:
|
||||
------------------
|
||||
|
||||
|
@ -2959,7 +2951,6 @@ void no_more_time (int sig)
|
|||
}
|
||||
|
||||
|
||||
|
||||
Coding Standards:
|
||||
-----------------
|
||||
|
||||
|
@ -3016,7 +3007,7 @@ it:
|
|||
|
||||
* Changesets that contain different, unrelated modifications shall be
|
||||
submitted as SEPARATE patches, one patch per changeset.
|
||||
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
#######################################################################
|
||||
#
|
||||
# Copyright (C) 2000, 2001, 2002, 2003
|
||||
|
@ -35,7 +36,7 @@ LIB = lib$(BOARD).a
|
|||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $^
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
=============================================================================
|
||||
|
||||
U-Boot port on the LEOX's ELPT860 CPU board
|
||||
-------------------------------------------
|
||||
U-Boot port on the LEOX's ELPT860 CPU board
|
||||
-------------------------------------------
|
||||
|
||||
LEOX.org is about the development of free hardware and software resources
|
||||
for system on chip.
|
||||
for system on chip.
|
||||
|
||||
For more information, contact The LEOX team <team@leox.org>
|
||||
|
||||
References:
|
||||
~~~~~~~~~~
|
||||
1) Get the last stable release from denx.de:
|
||||
o ftp://ftp.denx.de/pub/u-boot/u-boot-0.2.0.tar.bz2
|
||||
o ftp://ftp.denx.de/pub/u-boot/u-boot-0.2.0.tar.bz2
|
||||
2) Get the current CVS snapshot:
|
||||
o cvs -d:pserver:anonymous@cvs.u-boot.sourceforge.net:/cvsroot/u-boot login
|
||||
o cvs -z6 -d:pserver:anonymous@cvs.u-boot.sourceforge.net:/cvsroot/u-boot co -P u-boot
|
||||
o cvs -d:pserver:anonymous@cvs.u-boot.sourceforge.net:/cvsroot/u-boot login
|
||||
o cvs -z6 -d:pserver:anonymous@cvs.u-boot.sourceforge.net:/cvsroot/u-boot co -P u-boot
|
||||
|
||||
=============================================================================
|
||||
|
||||
|
@ -42,7 +42,7 @@ U-Boot, at the address of 0x03000000.
|
|||
|
||||
=============================================================================
|
||||
|
||||
U-Boot test results
|
||||
U-Boot test results
|
||||
|
||||
=============================================================================
|
||||
|
||||
|
@ -54,7 +54,7 @@ U-Boot, at the address of 0x03000000.
|
|||
U-Boot 0.2.2 (Jan 19 2003 - 11:08:39)
|
||||
|
||||
CPU: XPC860xxZPnnB at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
Board: ### No HW ID - assuming ELPT860
|
||||
DRAM: 16 MB
|
||||
FLASH: 512 kB
|
||||
|
@ -101,7 +101,7 @@ saveenv - save environment variables to persistent storage
|
|||
setenv - set environment variables
|
||||
sleep - delay execution for some time
|
||||
tftpboot- boot image via network using TFTP protocol
|
||||
and env variables ipaddr and serverip
|
||||
and env variables ipaddr and serverip
|
||||
version - print monitor version
|
||||
? - alias for 'help'
|
||||
|
||||
|
@ -143,8 +143,8 @@ LEOX_elpt860: flinfo
|
|||
Bank # 1: AMD AM29F040 (4 Mbits)
|
||||
Size: 512 KB in 8 Sectors
|
||||
Sector Start Addresses:
|
||||
02000000 (RO) 02010000 (RO) 02020000 (RO) 02030000 (RO) 02040000
|
||||
02050000 02060000 02070000
|
||||
02000000 (RO) 02010000 (RO) 02020000 (RO) 02030000 (RO) 02040000
|
||||
02050000 02060000 02070000
|
||||
|
||||
##################################################
|
||||
# Board Information Structure
|
||||
|
@ -177,7 +177,7 @@ baudrate = 9600 bps
|
|||
U-Boot 0.2.2 (Jan 19 2003 - 11:08:39)
|
||||
|
||||
CPU: XPC860xxZPnnB at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
Board: ### No HW ID - assuming ELPT860
|
||||
DRAM: 16 MB
|
||||
FLASH: 512 kB
|
||||
|
@ -219,7 +219,7 @@ Hit any key to exit ...
|
|||
U-Boot 0.2.2 (Jan 19 2003 - 11:08:39)
|
||||
|
||||
CPU: XPC860xxZPnnB at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
Board: ### No HW ID - assuming ELPT860
|
||||
DRAM: 16 MB
|
||||
FLASH: 512 kB
|
||||
|
@ -237,7 +237,7 @@ TFTP from server 192.168.0.1; our IP address is 192.168.0.30
|
|||
Filename '/home/leox/uImage'.
|
||||
Load address: 0x400000
|
||||
Loading: #################################################################
|
||||
#############################
|
||||
#############################
|
||||
done
|
||||
Bytes transferred = 477294 (7486e hex)
|
||||
## Booting image at 00400000 ...
|
||||
|
@ -282,8 +282,8 @@ Looking up port of RPC 100005/2 on 192.168.0.1
|
|||
VFS: Mounted root (nfs filesystem).
|
||||
Freeing unused kernel memory: 44k init
|
||||
INIT: version 2.78 booting
|
||||
Welcome to DENX Embedded Linux Environment
|
||||
Press 'I' to enter interactive startup.
|
||||
Welcome to DENX Embedded Linux Environment
|
||||
Press 'I' to enter interactive startup.
|
||||
Mounting proc filesystem: [ OK ]
|
||||
Configuring kernel parameters: [ OK ]
|
||||
Cannot access the Hardware Clock via any known method.
|
||||
|
@ -316,7 +316,7 @@ bash-2.04#
|
|||
U-Boot 0.2.2 (Jan 19 2003 - 11:08:39)
|
||||
|
||||
CPU: XPC860xxZPnnB at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***
|
||||
Board: ### No HW ID - assuming ELPT860
|
||||
DRAM: 16 MB
|
||||
FLASH: 512 kB
|
||||
|
@ -334,11 +334,11 @@ TFTP from server 192.168.0.1; our IP address is 192.168.0.30
|
|||
Filename '/home/leox/pMulti'.
|
||||
Load address: 0x400000
|
||||
Loading: #################################################################
|
||||
#################################################################
|
||||
#################################################################
|
||||
#################################################################
|
||||
#################################################################
|
||||
########################################################
|
||||
#################################################################
|
||||
#################################################################
|
||||
#################################################################
|
||||
#################################################################
|
||||
########################################################
|
||||
done
|
||||
Bytes transferred = 1947816 (1db8a8 hex)
|
||||
## Booting image at 00400000 ...
|
||||
|
@ -398,22 +398,22 @@ ELPT860 login: root
|
|||
Password:
|
||||
Welcome to Linux-2.4.4 for ELPT CPU board (MPC860T @ 50MHz)
|
||||
|
||||
a8888b.
|
||||
d888888b.
|
||||
8P"YP"Y88
|
||||
a8888b.
|
||||
d888888b.
|
||||
8P"YP"Y88
|
||||
_ _ 8|o||o|88
|
||||
| | |_| 8' .88
|
||||
| | _ ____ _ _ _ _ 8`._.' Y8.
|
||||
| | | | _ \| | | |\ \/ / d/ `8b.
|
||||
| |___ | | | | | |_| |/ \ .dP . Y8b.
|
||||
|_____||_|_| |_|\____|\_/\_/ d8:' " `::88b.
|
||||
d8" `Y88b
|
||||
:8P ' :888
|
||||
8a. : _a88P
|
||||
._/"Yaa_ : .| 88P|
|
||||
\ YP" `| 8P `.
|
||||
/ \._____.d| .'
|
||||
`--..__)888888P`._.'
|
||||
d8" `Y88b
|
||||
:8P ' :888
|
||||
8a. : _a88P
|
||||
._/"Yaa_ : .| 88P|
|
||||
\ YP" `| 8P `.
|
||||
/ \._____.d| .'
|
||||
`--..__)888888P`._.'
|
||||
login[21]: root login on `ttyS0'
|
||||
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ const uint sdram_table[] =
|
|||
/*
|
||||
* Single Read. (Offset 0 in UPMA RAM)
|
||||
*/
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC04, 0x00AF3C04,
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC04, 0x00AF3C04,
|
||||
0xFF0FFC00, /* last */
|
||||
/*
|
||||
* SDRAM Initialization (offset 5 in UPMA RAM)
|
||||
|
@ -109,28 +109,28 @@ const uint sdram_table[] =
|
|||
/*
|
||||
* Burst Read. (Offset 8 in UPMA RAM)
|
||||
*/
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC04, 0x00AF3C04,
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC04, 0x00AF3C04,
|
||||
0xF00FFC00, 0xF00FFC00, 0xF00FFC00, 0xFF0FFC00,
|
||||
0x0FFCCC04, 0xFFAFFC05, 0xFFAFFC04, 0xFFAFFC04,
|
||||
0x0FFCCC04, 0xFFAFFC05, 0xFFAFFC04, 0xFFAFFC04,
|
||||
0xFFAFFC04, 0xFFAFFC04, 0xFFAFFC04, 0xFFAFFC04, /* last */
|
||||
/*
|
||||
* Single Write. (Offset 18 in UPMA RAM)
|
||||
*/
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC04, 0x00AF0C00,
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC04, 0x00AF0C00,
|
||||
0xFF0FFC04, 0x0FFCCC04, 0xFFAFFC05, /* last */
|
||||
_NOT_USED_,
|
||||
_NOT_USED_,
|
||||
/*
|
||||
* Burst Write. (Offset 20 in UPMA RAM)
|
||||
*/
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC00, 0x00AF0C00,
|
||||
0xF00FFC00, 0xF00FFC00, 0xF00FFC04, 0x0FFCCC04,
|
||||
0xFFAFFC04, 0xFFAFFC05, 0xFFAFFC04, 0xFFAFFC04,
|
||||
0x0F0FFC24, 0x0F0CFC04, 0xFF0FFC00, 0x00AF0C00,
|
||||
0xF00FFC00, 0xF00FFC00, 0xF00FFC04, 0x0FFCCC04,
|
||||
0xFFAFFC04, 0xFFAFFC05, 0xFFAFFC04, 0xFFAFFC04,
|
||||
0xFFAFFC04, 0xFFAFFC04, 0xFFAFFC04, 0xFFAFFC04, /* last */
|
||||
/*
|
||||
* Refresh (Offset 30 in UPMA RAM)
|
||||
*/
|
||||
0x0FFC3C04, 0xFFFFFC04, 0xFFFFFC04, 0xFFFFFC04,
|
||||
0xFFFFFC05, 0xFFFFFC04, 0xFFFFFC05, _NOT_USED_,
|
||||
0x0FFC3C04, 0xFFFFFC04, 0xFFFFFC04, 0xFFFFFC04,
|
||||
0xFFFFFC05, 0xFFFFFC04, 0xFFFFFC05, _NOT_USED_,
|
||||
0xFFAFFC04, 0xFFAFFC04, 0xFFAFFC04, 0xFFAFFC04, /* last */
|
||||
/*
|
||||
* Exception. (Offset 3c in UPMA RAM)
|
||||
|
@ -152,8 +152,8 @@ board_pre_init (void)
|
|||
{
|
||||
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
|
||||
/*
|
||||
* Light up the red led on ELPT860 pcb (DS1) (PCDAT)
|
||||
/*
|
||||
* Light up the red led on ELPT860 pcb (DS1) (PCDAT)
|
||||
*/
|
||||
immr->im_ioport.iop_pcdat &= ~CFG_DS1; /* PCDAT (DS1 = 0) */
|
||||
immr->im_ioport.iop_pcpar &= ~CFG_DS1; /* PCPAR (0=general purpose I/O) */
|
||||
|
@ -170,20 +170,20 @@ board_pre_init (void)
|
|||
* Return 1 if no second DRAM bank, otherwise returns 0
|
||||
*/
|
||||
|
||||
int
|
||||
int
|
||||
checkboard (void)
|
||||
{
|
||||
unsigned char *s = getenv("serial#");
|
||||
|
||||
if ( !s || strncmp(s, "ELPT860", 7) )
|
||||
printf ("### No HW ID - assuming ELPT860\n");
|
||||
|
||||
|
||||
return ( 0 ); /* success */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int
|
||||
long int
|
||||
initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
|
@ -194,7 +194,7 @@ initdram (int board_type)
|
|||
/*
|
||||
* This sequence initializes SDRAM chips on ELPT860 board
|
||||
*/
|
||||
upmconfig(UPMA, (uint *)init_sdram_table,
|
||||
upmconfig(UPMA, (uint *)init_sdram_table,
|
||||
sizeof(init_sdram_table)/sizeof(uint));
|
||||
|
||||
memctl->memc_mptpr = 0x0200;
|
||||
|
@ -203,7 +203,7 @@ initdram (int board_type)
|
|||
memctl->memc_mar = 0x00000088;
|
||||
memctl->memc_mcr = 0x80002000; /* CS1: SDRAM bank 0 */
|
||||
|
||||
upmconfig(UPMA, (uint *)sdram_table,
|
||||
upmconfig(UPMA, (uint *)sdram_table,
|
||||
sizeof(sdram_table)/sizeof(uint));
|
||||
|
||||
/*
|
||||
|
@ -257,8 +257,8 @@ initdram (int board_type)
|
|||
*
|
||||
* try 8 column mode
|
||||
*/
|
||||
size8 = dram_size (CFG_MAMR_8COL,
|
||||
(ulong *) SDRAM_BASE1_PRELIM,
|
||||
size8 = dram_size (CFG_MAMR_8COL,
|
||||
(ulong *) SDRAM_BASE1_PRELIM,
|
||||
SDRAM_MAX_SIZE);
|
||||
|
||||
udelay (1000);
|
||||
|
@ -266,15 +266,15 @@ initdram (int board_type)
|
|||
/*
|
||||
* try 9 column mode
|
||||
*/
|
||||
size9 = dram_size (CFG_MAMR_9COL,
|
||||
(ulong *) SDRAM_BASE1_PRELIM,
|
||||
size9 = dram_size (CFG_MAMR_9COL,
|
||||
(ulong *) SDRAM_BASE1_PRELIM,
|
||||
SDRAM_MAX_SIZE);
|
||||
|
||||
if ( size8 < size9 ) /* leave configuration at 9 columns */
|
||||
{
|
||||
size_b0 = size9;
|
||||
/* debug ("SDRAM Bank 0 in 9 column mode: %ld MB\n", size >> 20); */
|
||||
}
|
||||
}
|
||||
else /* back to 8 columns */
|
||||
{
|
||||
size_b0 = size8;
|
||||
|
@ -282,14 +282,14 @@ initdram (int board_type)
|
|||
udelay (500);
|
||||
/* debug ("SDRAM Bank 0 in 8 column mode: %ld MB\n", size >> 20); */
|
||||
}
|
||||
|
||||
|
||||
udelay (1000);
|
||||
|
||||
/*
|
||||
* Adjust refresh rate depending on SDRAM type, both banks
|
||||
* For types > 128 MBit leave it at the current (fast) rate
|
||||
*/
|
||||
if ( size_b0 < 0x02000000 )
|
||||
if ( size_b0 < 0x02000000 )
|
||||
{
|
||||
/* reduce to 15.6 us (62.4 us / quad) */
|
||||
memctl->memc_mptpr = CFG_MPTPR_2BK_4K;
|
||||
|
@ -304,7 +304,7 @@ initdram (int board_type)
|
|||
|
||||
{
|
||||
unsigned long reg;
|
||||
|
||||
|
||||
/* adjust refresh rate depending on SDRAM type, one bank */
|
||||
reg = memctl->memc_mptpr;
|
||||
reg >>= 1; /* reduce to CFG_MPTPR_1BK_8K / _4K */
|
||||
|
@ -312,7 +312,7 @@ initdram (int board_type)
|
|||
}
|
||||
|
||||
udelay(10000);
|
||||
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
|
@ -326,9 +326,9 @@ initdram (int board_type)
|
|||
* - short between data lines
|
||||
*/
|
||||
|
||||
static long int
|
||||
dram_size (long int mamr_value,
|
||||
long int *base,
|
||||
static long int
|
||||
dram_size (long int mamr_value,
|
||||
long int *base,
|
||||
long int maxsize)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
|
@ -337,38 +337,38 @@ dram_size (long int mamr_value,
|
|||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
|
||||
for (cnt = maxsize/sizeof(long); cnt > 0; cnt >>= 1)
|
||||
|
||||
for (cnt = maxsize/sizeof(long); cnt > 0; cnt >>= 1)
|
||||
{
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
|
||||
/* write 0 to base address */
|
||||
addr = base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
|
||||
/* check at base address */
|
||||
if ( (val = *addr) != 0 )
|
||||
if ( (val = *addr) != 0 )
|
||||
{
|
||||
*addr = save[i];
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt <= maxsize/sizeof(long); cnt <<= 1)
|
||||
|
||||
for (cnt = 1; cnt <= maxsize/sizeof(long); cnt <<= 1)
|
||||
{
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
|
||||
if ( val != (~cnt) )
|
||||
|
||||
if ( val != (~cnt) )
|
||||
{
|
||||
return (cnt * sizeof(long));
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ void
|
|||
reset_phy (void)
|
||||
{
|
||||
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
|
||||
|
||||
/*
|
||||
* Ensure LBK LXT901 ethernet 1 & 2 = 0 ... for normal loopback in effect
|
||||
* and no AUI loopback
|
||||
|
|
|
@ -79,41 +79,41 @@ static int write_byte (flash_info_t *info, ulong dest, uchar data);
|
|||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long
|
||||
unsigned long
|
||||
flash_init (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i)
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i)
|
||||
{
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
|
||||
size_b0 = flash_get_size ((volatile unsigned char *)FLASH_BASE0_PRELIM,
|
||||
|
||||
size_b0 = flash_get_size ((volatile unsigned char *)FLASH_BASE0_PRELIM,
|
||||
&flash_info[0]);
|
||||
|
||||
if ( flash_info[0].flash_id == FLASH_UNKNOWN )
|
||||
|
||||
if ( flash_info[0].flash_id == FLASH_UNKNOWN )
|
||||
{
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0<<20);
|
||||
}
|
||||
|
||||
|
||||
/* Remap FLASH according to real size */
|
||||
memctl->memc_or0 = CFG_OR_TIMING_FLASH | (-size_b0 & OR_AM_MSK);
|
||||
memctl->memc_br0 = (CFG_FLASH_BASE & BR_BA_MSK) | BR_MS_GPCM | BR_PS_8 | BR_V;
|
||||
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
size_b0 = flash_get_size ((volatile unsigned char *)CFG_FLASH_BASE,
|
||||
size_b0 = flash_get_size ((volatile unsigned char *)CFG_FLASH_BASE,
|
||||
&flash_info[0]);
|
||||
|
||||
|
||||
flash_get_offsets (CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
|
@ -121,7 +121,7 @@ flash_init (void)
|
|||
CFG_MONITOR_BASE + monitor_flash_len-1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
/* ENV protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
|
@ -131,14 +131,14 @@ flash_init (void)
|
|||
#endif
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
flash_get_offsets (ulong base,
|
||||
static void
|
||||
flash_get_offsets (ulong base,
|
||||
flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
@ -146,7 +146,7 @@ flash_get_offsets (ulong base,
|
|||
#define SECTOR_64KB 0x00010000
|
||||
|
||||
/* set up sector start adress table */
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
info->start[i] = base + (i * SECTOR_64KB);
|
||||
}
|
||||
|
@ -154,38 +154,38 @@ flash_get_offsets (ulong base,
|
|||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
void
|
||||
flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( info->flash_id == FLASH_UNKNOWN )
|
||||
|
||||
if ( info->flash_id == FLASH_UNKNOWN )
|
||||
{
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( info->flash_id & FLASH_VENDMASK )
|
||||
switch ( info->flash_id & FLASH_VENDMASK )
|
||||
{
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
case FLASH_MAN_STM: printf ("STM (Thomson) "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch ( info->flash_id & FLASH_TYPEMASK )
|
||||
|
||||
switch ( info->flash_id & FLASH_TYPEMASK )
|
||||
{
|
||||
case FLASH_AM040: printf ("AM29F040 (4 Mbits)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld KB in %d Sectors\n",
|
||||
|
||||
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)
|
||||
for (i=0; i<info->sector_count; ++i)
|
||||
{
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
|
@ -210,9 +210,9 @@ flash_print_info (flash_info_t *info)
|
|||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
|
||||
static ulong
|
||||
flash_get_size (volatile unsigned char *addr,
|
||||
flash_info_t *info)
|
||||
static ulong
|
||||
flash_get_size (volatile unsigned char *addr,
|
||||
flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
uchar value;
|
||||
|
@ -222,10 +222,10 @@ flash_get_size (volatile unsigned char *addr,
|
|||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
addr[0x0555] = 0x90;
|
||||
|
||||
|
||||
value = addr[0];
|
||||
|
||||
switch ( value )
|
||||
switch ( value )
|
||||
{
|
||||
/* case AMD_MANUFACT: */
|
||||
case 0x01:
|
||||
|
@ -246,10 +246,10 @@ flash_get_size (volatile unsigned char *addr,
|
|||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
|
||||
value = addr[1]; /* device ID */
|
||||
|
||||
switch ( value )
|
||||
|
||||
switch ( value )
|
||||
{
|
||||
case STM_ID_F040B:
|
||||
case AMD_ID_F040B:
|
||||
|
@ -264,13 +264,13 @@ flash_get_size (volatile unsigned char *addr,
|
|||
}
|
||||
|
||||
/* set up sector start adress table */
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
}
|
||||
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
|
@ -281,13 +281,13 @@ flash_get_size (volatile unsigned char *addr,
|
|||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if ( info->flash_id != FLASH_UNKNOWN )
|
||||
if ( info->flash_id != FLASH_UNKNOWN )
|
||||
{
|
||||
addr = (volatile unsigned char *)info->start[0];
|
||||
|
||||
|
||||
*addr = 0xF0; /* reset bank */
|
||||
}
|
||||
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
@ -296,21 +296,21 @@ flash_get_size (volatile unsigned char *addr,
|
|||
*/
|
||||
|
||||
int
|
||||
flash_erase (flash_info_t *info,
|
||||
int s_first,
|
||||
flash_erase (flash_info_t *info,
|
||||
int s_first,
|
||||
int s_last)
|
||||
{
|
||||
volatile unsigned char *addr = (volatile unsigned char *)(info->start[0]);
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
|
||||
if ( (s_first < 0) || (s_first > s_last) )
|
||||
|
||||
if ( (s_first < 0) || (s_first > s_last) )
|
||||
{
|
||||
if ( info->flash_id == FLASH_UNKNOWN )
|
||||
if ( info->flash_id == FLASH_UNKNOWN )
|
||||
{
|
||||
printf ("- missing\n");
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
|
@ -318,44 +318,44 @@ flash_erase (flash_info_t *info,
|
|||
}
|
||||
|
||||
if ( (info->flash_id == FLASH_UNKNOWN) ||
|
||||
(info->flash_id > FLASH_AMD_COMP) )
|
||||
(info->flash_id > FLASH_AMD_COMP) )
|
||||
{
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return ( 1 );
|
||||
}
|
||||
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect)
|
||||
for (sect=s_first; sect<=s_last; ++sect)
|
||||
{
|
||||
if ( info->protect[sect] )
|
||||
if ( info->protect[sect] )
|
||||
{
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( prot )
|
||||
|
||||
if ( prot )
|
||||
{
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n", prot);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
|
||||
l_sect = -1;
|
||||
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
|
||||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
addr[0x0555] = 0x80;
|
||||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++)
|
||||
for (sect = s_first; sect<=s_last; sect++)
|
||||
{
|
||||
if (info->protect[sect] == 0) /* not protected */
|
||||
{
|
||||
|
@ -364,26 +364,26 @@ flash_erase (flash_info_t *info,
|
|||
l_sect = sect;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if ( flag )
|
||||
enable_interrupts();
|
||||
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
|
||||
/*
|
||||
* We wait for the last triggered sector
|
||||
*/
|
||||
if ( l_sect < 0 )
|
||||
goto DONE;
|
||||
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
addr = (volatile unsigned char *)(info->start[l_sect]);
|
||||
while ( (addr[0] & 0x80) != 0x80 )
|
||||
while ( (addr[0] & 0x80) != 0x80 )
|
||||
{
|
||||
if ( (now = get_timer(start)) > CFG_FLASH_ERASE_TOUT )
|
||||
if ( (now = get_timer(start)) > CFG_FLASH_ERASE_TOUT )
|
||||
{
|
||||
printf ("Timeout\n");
|
||||
return ( 1 );
|
||||
|
@ -395,14 +395,14 @@ flash_erase (flash_info_t *info,
|
|||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
addr = (volatile unsigned char *)info->start[0];
|
||||
addr[0] = 0xF0; /* reset bank */
|
||||
|
||||
|
||||
printf (" done\n");
|
||||
|
||||
|
||||
return ( 0 );
|
||||
}
|
||||
|
||||
|
@ -413,10 +413,10 @@ DONE:
|
|||
* 2 - Flash not erased
|
||||
*/
|
||||
|
||||
int
|
||||
write_buff (flash_info_t *info,
|
||||
uchar *src,
|
||||
ulong addr,
|
||||
int
|
||||
write_buff (flash_info_t *info,
|
||||
uchar *src,
|
||||
ulong addr,
|
||||
ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
|
@ -428,16 +428,16 @@ write_buff (flash_info_t *info,
|
|||
/* Width of the data bus: 8 bits */
|
||||
|
||||
wp = addr;
|
||||
|
||||
|
||||
while ( cnt )
|
||||
{
|
||||
bdata = *src++;
|
||||
|
||||
|
||||
if ( (rc = write_byte(info, wp, bdata)) != 0 )
|
||||
{
|
||||
return (rc);
|
||||
}
|
||||
|
||||
|
||||
++wp;
|
||||
--cnt;
|
||||
}
|
||||
|
@ -449,72 +449,72 @@ write_buff (flash_info_t *info,
|
|||
/* Width of the data bus: 32 bits */
|
||||
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ( (l = addr - wp) != 0 )
|
||||
if ( (l = addr - wp) != 0 )
|
||||
{
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp)
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
for (; i<4 && cnt>0; ++i)
|
||||
for (; i<4 && cnt>0; ++i)
|
||||
{
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<4; ++i, ++cp)
|
||||
for (; cnt==0 && i<4; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
if ( (rc = write_word(info, wp, data)) != 0 )
|
||||
|
||||
if ( (rc = write_word(info, wp, data)) != 0 )
|
||||
{
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while ( cnt >= 4 )
|
||||
while ( cnt >= 4 )
|
||||
{
|
||||
data = 0;
|
||||
for (i=0; i<4; ++i)
|
||||
for (i=0; i<4; ++i)
|
||||
{
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ( (rc = write_word(info, wp, data)) != 0 )
|
||||
if ( (rc = write_word(info, wp, data)) != 0 )
|
||||
{
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if ( cnt == 0 )
|
||||
|
||||
if ( cnt == 0 )
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp)
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i<4; ++i, ++cp)
|
||||
for (; i<4; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
}
|
||||
}
|
||||
|
@ -525,38 +525,38 @@ write_buff (flash_info_t *info,
|
|||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int
|
||||
write_word (flash_info_t *info,
|
||||
ulong dest,
|
||||
static int
|
||||
write_word (flash_info_t *info,
|
||||
ulong dest,
|
||||
ulong data)
|
||||
{
|
||||
vu_long *addr = (vu_long*)(info->start[0]);
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ( (*((vu_long *)dest) & data) != data )
|
||||
if ( (*((vu_long *)dest) & data) != data )
|
||||
{
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
|
||||
addr[0x0555] = 0x00AA00AA;
|
||||
addr[0x02AA] = 0x00550055;
|
||||
addr[0x0555] = 0x00A000A0;
|
||||
|
||||
|
||||
*((vu_long *)dest) = data;
|
||||
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if ( flag )
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ( (*((vu_long *)dest) & 0x00800080) != (data & 0x00800080) )
|
||||
while ( (*((vu_long *)dest) & 0x00800080) != (data & 0x00800080) )
|
||||
{
|
||||
if ( get_timer(start) > CFG_FLASH_WRITE_TOUT )
|
||||
if ( get_timer(start) > CFG_FLASH_WRITE_TOUT )
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
@ -571,38 +571,38 @@ write_word (flash_info_t *info,
|
|||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int
|
||||
write_byte (flash_info_t *info,
|
||||
ulong dest,
|
||||
static int
|
||||