mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
72 Commits
LABEL_2003
...
U-Boot-1_0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b13fb01a62 | ||
|
|
5fa66df63a | ||
|
|
a0f2fe524c | ||
|
|
a57a496f4d | ||
|
|
8cb8143ef7 | ||
|
|
4654af27b8 | ||
|
|
a3ad8e26a4 | ||
|
|
d7281f4109 | ||
|
|
e7df029f1a | ||
|
|
3d1e8a9d4e | ||
|
|
42d1f0394b | ||
|
|
2d5b561e2b | ||
|
|
f72da3406b | ||
|
|
5da627a424 | ||
|
|
15647dc7fd | ||
|
|
a0ff7f2eda | ||
|
|
4a5517094d | ||
|
|
54387ac931 | ||
|
|
fc3e2165ef | ||
|
|
ef1464cc01 | ||
|
|
d9a405aaf6 | ||
|
|
147031aef1 | ||
|
|
887b372f5d | ||
|
|
fbe4b5cbde | ||
|
|
bb65a31267 | ||
|
|
88a1bfa8b8 | ||
|
|
cad07371fc | ||
|
|
ab209d5107 | ||
|
|
87970ebeb5 | ||
|
|
8a42eac744 | ||
|
|
91e940d9bc | ||
|
|
29127b6a23 | ||
|
|
1d70468b03 | ||
|
|
c3d98ed9ca | ||
|
|
80369866a4 | ||
|
|
65bd0e284b | ||
|
|
206c60cbea | ||
|
|
5f535fe170 | ||
|
|
b0639ca332 | ||
|
|
f54ebdfa28 | ||
|
|
34b3049a60 | ||
|
|
ef709e9230 | ||
|
|
a57106fcb3 | ||
|
|
373e6bec13 | ||
|
|
4aeb251f90 | ||
|
|
acf98e7f30 | ||
|
|
b56ddc636d | ||
|
|
78137c3c93 | ||
|
|
35656de729 | ||
|
|
200f8c7a4c | ||
|
|
531716e171 | ||
|
|
b70e7a00c8 | ||
|
|
f5300ab241 | ||
|
|
68ce8957e5 | ||
|
|
72cd5aa703 | ||
|
|
13fdf8a6ba | ||
|
|
2853d29b52 | ||
|
|
428c563938 | ||
|
|
342f551bc9 | ||
|
|
ef9e86854e | ||
|
|
09433a781b | ||
|
|
1b554406cc | ||
|
|
895af12a21 | ||
|
|
9a2dd74032 | ||
|
|
22a40b0a88 | ||
|
|
b318262a71 | ||
|
|
a65cb68237 | ||
|
|
5ce08eea97 | ||
|
|
4f7cb08ee7 | ||
|
|
a43278a43d | ||
|
|
7205e4075d | ||
|
|
149dded2b1 |
322
CHANGELOG
322
CHANGELOG
@@ -1,7 +1,321 @@
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.7:
|
||||
Changes for U-Boot 1.0.0:
|
||||
======================================================================
|
||||
|
||||
* Fix parameter passing to standalone images with bootm command
|
||||
|
||||
* Patch by Kyle Harris, 30 Oct 2003:
|
||||
Fix build errors for ixdp425 board
|
||||
|
||||
* Patch by David M. Horn, 29 Oct 2003:
|
||||
Fixes to build under CYGWIN
|
||||
|
||||
* Get IceCube MGT5100 working (again)
|
||||
|
||||
* Fix problems in memory test on some boards (which was not
|
||||
non-destructive as intended)
|
||||
|
||||
* Patch by Gary Jennejohn, 28 Oct 2003:
|
||||
Change fs/fat/fat.c to put I/O buffers in BSS instead on the stack
|
||||
to prevent stack overflow on ARM systems
|
||||
|
||||
* Patch by Stephan Linz, 28 Oct 2003:
|
||||
fix init sequence error for NIOS port
|
||||
|
||||
* Allow lowercase spelling for IceCube_5200; support MPC5200LITE name
|
||||
|
||||
* Add CONFIG_VERSION_VARIABLE to TRAB configuration
|
||||
|
||||
* Patch by Xiao Xianghua, 23 Oct 2003:
|
||||
small patch for mpc85xx
|
||||
|
||||
* Fix small problem in MPC5200 I2C driver
|
||||
|
||||
* Fix FCC3 support on ATC board
|
||||
|
||||
* Correct header printing for multi-image files in do_bootm()
|
||||
|
||||
* Make CONFIG_SILENT_CONSOLE work with CONFIG_AUTOBOOT_KEYED
|
||||
|
||||
* Fix PCI problems on PPChameleon board
|
||||
|
||||
* Patch by Steven Scholz, 18 Oct 2003:
|
||||
Fix AT91RM9200 ethernet driver
|
||||
|
||||
* Patch by Nye Liu, 17 Oct 2003:
|
||||
Fix typo in include/mpc8xx.h
|
||||
|
||||
* Patch by Richard Woodruff, 16 Oct 03:
|
||||
Fixes for cpu/arm925/interrupt.c
|
||||
- Initialize timestamp & lastdec vars.
|
||||
- fix timestamp overflows.
|
||||
- fix lastdec overflow.
|
||||
- smarter normalization to allow udelay() below 1ms to work.
|
||||
|
||||
* Patch by Scott McNutt, 16 Oct
|
||||
add networking support for the Altera Nios Development Kit,
|
||||
Cyclone Edition (DK-1C20)
|
||||
|
||||
* Patch by Jon Diekema, 14 Oct 2003:
|
||||
add hint about doc/README.silent to README file
|
||||
|
||||
* Add CompactFlash support for NSCU
|
||||
|
||||
* Fix PCI problems on PPChameleonEVB
|
||||
|
||||
* TRAB auto-update: Base decision if we have to strip the image
|
||||
header on image type as encoded in the header
|
||||
(include image type patch by Martin Krause, 17 Oct 2003)
|
||||
|
||||
* Patches by Xianghua Xiao, 15 Oct 2003:
|
||||
|
||||
- Added Motorola CPU 8540/8560 support (cpu/85xx)
|
||||
- Added Motorola MPC8540ADS board support (board/mpc8540ads)
|
||||
- Added Motorola MPC8560ADS board support (board/mpc8560ads)
|
||||
|
||||
* Fix flash timings on TRAB board
|
||||
|
||||
* Make sure HUSH is initialized for running auto-update scripts
|
||||
|
||||
* Make 5200 reset command _really_ reset the board, without running
|
||||
any other code after it
|
||||
|
||||
* Fix errors with flash erase when range spans across banks
|
||||
that are mapped in reverse order
|
||||
|
||||
* Fix flash mapping and display on P3G4 board
|
||||
|
||||
* Patch by Kyle Harris, 15 Jul 2003:
|
||||
- add support for Intel IXP425 CPU
|
||||
- add support for IXDP425 eval board
|
||||
|
||||
* Added config option CONFIG_SILENT_CONSOLE. See doc/README.silent
|
||||
for more information
|
||||
|
||||
* Patch by Steven Scholz, 10 Oct 2003
|
||||
- Add support for Altera FPGA ACEX1K
|
||||
|
||||
* Patches by Thomas Lange, 09 Oct 2003:
|
||||
- fix cmd_ide.c for non ppc boards (read/write functions did not
|
||||
add ATA base address)
|
||||
- fix for shannon board
|
||||
- #ifdef CONFIG_IDE_8xx_DIRECT some otherwise unused code
|
||||
- Endian swap ATA identity for all big endian CPUs, not just PPC
|
||||
- MIPS only: New option CONFIG_MEMSIZE_IN_BYTES for passing memsize
|
||||
args to linux
|
||||
- add support for dbau1x00 board (MIPS32)
|
||||
|
||||
* Patch by Sangmoon Kim, 07 Oct 2003:
|
||||
add support for debris board
|
||||
|
||||
* Patch by Martin Krause, 09 Oct 2003:
|
||||
Fixes for TRAB board
|
||||
- /board/trab/rs485.c: correct baudrate
|
||||
- /board/trab/cmd_trab.c: bug fix for problem with timer overflow in
|
||||
udelay(); fix some timing problems with adc controller
|
||||
- /board/trab/trab_fkt.c: add new commands: gain, eeprom and power;
|
||||
modify commands: touch and buzzer
|
||||
|
||||
* Disable CONFIG_SUPPORT_VFAT when used with CONFIG_AUTO_UPDATE
|
||||
(quick & dirty workaround for rogue pointer problem in get_vfatname());
|
||||
Use direct function calls for auto_update instead of hush commands
|
||||
|
||||
* Patch by Scott McNutt, 04 Oct 2003:
|
||||
- add support for Altera Nios-32 CPU
|
||||
- add support for Nios Cyclone Development Kit (DK-1C20)
|
||||
|
||||
* Patch by Steven Scholz, 29 Sep 2003:
|
||||
- A second parameter for bootm overwrites the load address for
|
||||
"Standalone Application" images.
|
||||
- bootm sets environment variable "filesize" to the resulting
|
||||
(uncompressed) data length for "Standalone Application" images
|
||||
when autostart is set to "no". Now you can do something like
|
||||
if bootm $fpgadata $some_free_ram ; then
|
||||
fpga load 0 $some_free_ram $filesize
|
||||
fi
|
||||
|
||||
* Patch by Denis Peter, 25 Sept 2003:
|
||||
add support for the MIP405 Rev. C board
|
||||
|
||||
* Patch by Yuli Barcohen, 25 Sep 2003:
|
||||
add support for Zephyr Engineering ZPC.1900 board
|
||||
|
||||
* Patch by Anders Larsen, 23 Sep 2003:
|
||||
add CMD_PORTIO to CFG_CMD_NONSTD (commands in question are only
|
||||
implemented for the x86 architecture)
|
||||
|
||||
* Patch by Sangmoon Kim, 23 Sep 2003:
|
||||
fix pll_pci_to_mem_multiplier table for MPC8245
|
||||
|
||||
* Patch by Anders Larsen, 22 Sep 2003:
|
||||
enable timed autoboot on PXA
|
||||
|
||||
* Patch by David Müller, 22 Sep 2003:
|
||||
- add $(CFLAGS) to "-print-libgcc-filename" so compiler driver
|
||||
returns correct libgcc file path
|
||||
- "latency" reduction of busy-loop waiting to improve "U-Boot" boot
|
||||
time on s3c24x0 systems
|
||||
|
||||
* Patch by Jon Diekema, 19 Sep 2003:
|
||||
- Add CFG_FAULT_ECHO_LINK_DOWN option to echo the inverted Ethernet
|
||||
link state to the fault LED.
|
||||
- In NetLoop, make the Fault LED reflect the link status. The link
|
||||
status gets updated on entry, and on timeouts.
|
||||
|
||||
* Patch by Anders Larsen, 18 Sep 2003:
|
||||
allow mkimage to build and run on Cygwin-hosted systems
|
||||
|
||||
* Patch by Frank Müller, 18 Sep 2003:
|
||||
use bi_intfreq instead of bi_busfreq to compute fec_mii_speed in
|
||||
cpu/mpc8xx/fec.c
|
||||
|
||||
* Patch by Pantelis Antoniou, 16 Sep 2003:
|
||||
add tool to compute fileds in the PLPRCR register for MPC86x
|
||||
|
||||
* Use IH_TYPE_FILESYSTEM for TRAB "disk" images.
|
||||
|
||||
* Fix build problems under FreeBSD
|
||||
|
||||
* Add generic filesystem image type
|
||||
|
||||
* Make fatload set filesize environment variable
|
||||
|
||||
* enable basic / medium / high-end configurations for PPChameleonEVB
|
||||
board; fix NAND code
|
||||
|
||||
* enable TFTP client code to specify to the server the desired
|
||||
timeout value (see RFC-2349)
|
||||
|
||||
* Improve SDRAM setup for TRAB board
|
||||
|
||||
* Suppress all output with splashscreen configured only if "splashimage"
|
||||
is set
|
||||
|
||||
* Fix problems with I2C support for mpc5200
|
||||
|
||||
* Adapt TRAB configuration and auto_update to new memory layout
|
||||
|
||||
* Add configuration for wtk board
|
||||
|
||||
* Add support for the Sharp LQ065T9DR51U LCD display
|
||||
|
||||
* Patch by Rune Torgersen, 17 Sep 2003:
|
||||
- Fixes for MPC8266 default config
|
||||
- Allow eth_loopback_test() on 8260 to use a subset of the FCC's
|
||||
|
||||
* Patches by Jon Diekema, 17 Sep 2003:
|
||||
- update README (SHOW_BOOT_PROGRESS values for cmd_nand.c and
|
||||
env_common.c)
|
||||
- sbc8260 tweaks
|
||||
- adjust "help" output
|
||||
|
||||
* Patches by Anders Larsen, 17 Sep 2003:
|
||||
- fix spelling errors
|
||||
- set GD_FLG_DEVINIT flag only after device function pointers
|
||||
are valid
|
||||
- Allow CFG_ALT_MEMTEST on systems where address zero isn't
|
||||
writeable
|
||||
- enable 3.rd UART (ST-UART) on PXA(XScale) CPUs
|
||||
- trigger watchdog while waiting in serial driver
|
||||
|
||||
* Add auto-update code for TRAB board using USB memory sticks,
|
||||
support new configuration with more memory
|
||||
|
||||
* disable MPC5200 bus pipelining as workaround for bus contention
|
||||
|
||||
* Modify XLB arbiter priorities on MPC5200 so all devices use same
|
||||
priority; configure critical interrupts to be handled like external
|
||||
interrupts
|
||||
|
||||
* Make IPB clock on MGT5100/MPC5200 configurable in board config file;
|
||||
go back to 66 MHz for stability
|
||||
|
||||
* Patches by Jon Diekema, 15 Sep 2003:
|
||||
- add description for missing CFG_CMD_* entries in the README file
|
||||
- sacsng tweaks
|
||||
|
||||
* Patch by Gleb Natapov, 14 Sep 2003:
|
||||
enable watchdog support for all MPC824x boards that have a watchdog
|
||||
|
||||
* On MPC5200, restrict FEC to a maximum of 10 Mbps to work around the
|
||||
"Non-octet Aligned Frame" errors we see at 100 Mbps
|
||||
|
||||
* Patch by Sharad Gupta, 14 Sep 2003:
|
||||
fix SPR numbers for upper BAT register ([ID]BAT[4-7][UL])
|
||||
|
||||
* Patch by llandre, 11 Sep 2003:
|
||||
update configuration for PPChameleonEVB board
|
||||
|
||||
* Patch by David Müller, 13 Sep 2003:
|
||||
various changes to VCMA9 board specific files
|
||||
|
||||
* Add I2C support for MGT5100 / MPC5200
|
||||
|
||||
* Patch by Rune Torgersen, 11 Sep 2003:
|
||||
Changed default memory option on MPC8266ADS to NOT be Page Based
|
||||
Interleave, since this doesn't work very well with the standard
|
||||
16MB DIMM
|
||||
|
||||
* Patch by George G. Davis, 12 Sep 2003:
|
||||
fix Makefile settings for sk98 driver
|
||||
|
||||
* Patch by Stefan Roese, 12 Sep 2003:
|
||||
- new boards added: DP405, HUB405, PLU405, VOH405
|
||||
- some esd boards updated
|
||||
- cpu/ppc4xx/sdram.c: disable memory controller before setting
|
||||
first values
|
||||
- cpu/ppc4xx/405_pci.c: set vendor id on PPC405EP systems
|
||||
|
||||
* Patch by Martin Krause, 11 Sep 2003:
|
||||
add burn-in tests for TRAB board
|
||||
|
||||
* Enable instruction cache on MPC5200 board
|
||||
|
||||
* Patch by Denis Peter, 11 Sep 2003:
|
||||
- fix USB data pointer assignment for bulk only transfer.
|
||||
- prevent to display erased directories in FAT filesystem.
|
||||
|
||||
* Change output format for NAND flash - make it look like for other
|
||||
memory, too
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.8:
|
||||
======================================================================
|
||||
|
||||
* Add I2C and RTC support for RMU board
|
||||
|
||||
* Patches by Denis Peter, 9 Sep 2003:
|
||||
add FAT support for IDE, SCSI and USB
|
||||
|
||||
* Patches by Gleb Natapov, 2 Sep 2003:
|
||||
- cleanup of POST code for unsupported architectures
|
||||
- MPC824x locks way0 of data cache for use as initial RAM;
|
||||
this patch unlocks it after relocation to RAM and invalidates
|
||||
the locked entries.
|
||||
|
||||
* Patch by Gleb Natapov, 30 Aug 2003:
|
||||
new I2C driver for mpc107 bridge. Now works from flash.
|
||||
|
||||
* Patch by Dave Ellis, 11 Aug 2003:
|
||||
- JFFS2: fix typo in common/cmd_jffs2.c
|
||||
- JFFS2: fix CFG_JFFS2_SORT_FRAGMENTS option
|
||||
- JFFS2: remove node version 0 warning
|
||||
- JFFS2: accept JFFS2 PADDING nodes
|
||||
- SXNI855T: add AM29LV800 support
|
||||
- SXNI855T: move environment from EEPROM to flash
|
||||
- SXNI855T: boot from JFFS2 in NOR or NAND flash
|
||||
|
||||
* Patch by Bill Hargen, 11 Aug 2003:
|
||||
fixes for I2C on MPC8240
|
||||
- fix i2c_write routine
|
||||
- fix iprobe command
|
||||
- eliminates use of global variables, plus dead code, cleanup.
|
||||
|
||||
* Add support for USB Mass Storage Devices (BBB)
|
||||
(tested with USB memory sticks only)
|
||||
|
||||
* Avoid flicker on TRAB's VFD
|
||||
|
||||
* Add support for SK98xx driver
|
||||
|
||||
* Add PCI support for SL8245 board
|
||||
@@ -27,6 +341,10 @@ Changes for U-Boot 0.4.7:
|
||||
* Patch by Yuli Barcohen, 7 Aug 2003:
|
||||
check BCSR to detect if the board is configured in PCI mode
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.7:
|
||||
======================================================================
|
||||
|
||||
* Patch by Raghu Krishnaprasad, 7 Aug 2003:
|
||||
add support for Adder II MPC852T module
|
||||
|
||||
@@ -263,7 +581,7 @@ Changes for U-Boot 0.4.1:
|
||||
- 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 EXBITGEN board (aka "genie")
|
||||
- Add support for SL8245 board
|
||||
|
||||
* Code cleanup:
|
||||
|
||||
33
CREDITS
33
CREDITS
@@ -18,14 +18,14 @@ N: Dr. Bruno Achauer
|
||||
E: bruno@exet-ag.de
|
||||
D: Support for NetBSD (both as host and target system)
|
||||
|
||||
N: Swen Anderson
|
||||
E: sand@peppercon.de
|
||||
D: ERIC Support
|
||||
|
||||
N: Guillaume Alexandre
|
||||
E: guillaume.alexandre@gespac.ch
|
||||
D: Add PCIPPC6 configuration
|
||||
|
||||
N: Swen Anderson
|
||||
E: sand@peppercon.de
|
||||
D: ERIC Support
|
||||
|
||||
N: Pantelis Antoniou
|
||||
E: panto@intracom.gr
|
||||
D: NETVIA board support, ARTOS support.
|
||||
@@ -75,7 +75,7 @@ E: clark@esteem.com
|
||||
D: ESTEEM192E support
|
||||
|
||||
N: Magnus Damm
|
||||
E: eramdam@kieray1.p.y.ki.era.ericsson.se
|
||||
E: damm@opensource.se
|
||||
D: 8xxrom
|
||||
|
||||
N: Arun Dharankar
|
||||
@@ -182,13 +182,22 @@ N: Brad Kemp
|
||||
E: Brad.Kemp@seranoa.com
|
||||
D: Port to Windriver ppmc8260 board
|
||||
|
||||
N: Sangmoon Kim
|
||||
E: dogoil@etinsys.com
|
||||
D: Support for debris board
|
||||
|
||||
N: Thomas Koeller
|
||||
E: tkoeller@gmx.net
|
||||
D: Port to Motorola Sandpoint 3 (MPC8240)
|
||||
|
||||
N: Raghu Krishnaprasad
|
||||
E: Raghu.Krishnaprasad@fci.com
|
||||
D: Support for Adder-II MPC852T evaluation board
|
||||
W: http://www.forcecomputers.com
|
||||
|
||||
N: Thomas Lange
|
||||
E: thomas@corelatus.com
|
||||
D: Support for GTH board; lots of PCMCIA fixes
|
||||
E: thomas@corelatus.se
|
||||
D: Support for GTH and dbau1x00 boards; lots of PCMCIA fixes
|
||||
|
||||
N: The LEOX team
|
||||
E: team@leox.org
|
||||
@@ -219,6 +228,10 @@ N: David M
|
||||
E: d.mueller@elsoft.ch
|
||||
D: Support for Samsung ARM920T SMDK2410 eval board
|
||||
|
||||
N: Scott McNutt
|
||||
E: smcnutt@psyent.com
|
||||
D: Support for Altera Nios-32 CPU, for Nios Cyclone Development Kit (DK-1C20)
|
||||
|
||||
N: Rolf Offermanns
|
||||
E: rof@sysgo.de
|
||||
D: Initial support for SSV-DNP1110, SMC91111 driver
|
||||
@@ -299,6 +312,6 @@ E: azu@sysgo.de
|
||||
D: Overall improvements on StrongARM, ARM720TDMI; Support for Tuxscreen; initial PCMCIA support for ARM
|
||||
W: www.elinos.com
|
||||
|
||||
N: Pantelis Antoniou
|
||||
E: panto@intracom.gr
|
||||
D: NETVIA board support, ARTOS support.
|
||||
N: Xianghua Xiao
|
||||
E: x.xiao@motorola.com
|
||||
D: Support for Motorola 85xx(PowerQUICC III) chip, MPC8540ADS and MPC8560ADS boards.
|
||||
|
||||
39
MAINTAINERS
39
MAINTAINERS
@@ -25,6 +25,10 @@ Pantelis Antoniou <panto@intracom.gr>
|
||||
|
||||
NETVIA MPC8xx
|
||||
|
||||
Yuli Barcohen <yuli@arabellasw.com>
|
||||
|
||||
ZPC1900 MPC8265
|
||||
|
||||
Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
|
||||
|
||||
sacsng MPC8260
|
||||
@@ -89,6 +93,7 @@ Wolfgang Denk <wd@denx.de>
|
||||
TQM8255 MPC8255
|
||||
|
||||
CPU86 MPC8260
|
||||
PM825 MPC8250
|
||||
PM826 MPC8260
|
||||
TQM8260 MPC8260
|
||||
|
||||
@@ -145,11 +150,19 @@ Brad Kemp <Brad.Kemp@seranoa.com>
|
||||
|
||||
ppmc8260 MPC8260
|
||||
|
||||
Sangmoon Kim <dogoil@etinsys.com>
|
||||
|
||||
debris MPC8245
|
||||
|
||||
Raghu Krishnaprasad <raghu.krishnaprasad@fci.com>
|
||||
|
||||
ADDERII MPC852T
|
||||
|
||||
Nye Liu <nyet@zumanetworks.com>
|
||||
|
||||
ZUMA MPC7xx_74xx
|
||||
|
||||
Thomas Lange <thomas@corelatus.com>
|
||||
Thomas Lange <thomas@corelatus.se>
|
||||
|
||||
GTH MPC860
|
||||
|
||||
@@ -195,11 +208,15 @@ Stefan Roese <stefan.roese@esd-electronics.com>
|
||||
CPCI440 PPC440GP
|
||||
CPCIISER4 PPC405GP
|
||||
DASA_SIM IOP480 (PPC401)
|
||||
DP405 PPC405EP
|
||||
DU405 PPC405GP
|
||||
HUB405 PPC405EP
|
||||
OCRTC PPC405GP
|
||||
ORSG PPC405GP
|
||||
PCI405 PPC405GP
|
||||
PLU405 PPC405EP
|
||||
PMC405 PPC405GP
|
||||
VOH405 PPC405EP
|
||||
|
||||
Peter De Schrijver <p2@mind.be>
|
||||
|
||||
@@ -223,6 +240,11 @@ John Zhan <zhanz@sinovee.com>
|
||||
|
||||
svm_sc8xx MPC8xx
|
||||
|
||||
Xianghua Xiao <x.xiao@motorola.com>
|
||||
|
||||
MPC8540ADS MPC8540
|
||||
MPC8560ADS MPC8560
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Unknown / orphaned boards:
|
||||
@@ -272,6 +294,7 @@ Kyle Harris <kharris@nexus-tech.net>
|
||||
|
||||
lubbock xscale
|
||||
cradle xscale
|
||||
ixdp425 xscale
|
||||
|
||||
Gary Jennejohn <gj@denx.de>
|
||||
|
||||
@@ -324,6 +347,20 @@ Wolfgang Denk <wd@denx.de>
|
||||
incaip MIPS32 4Kc
|
||||
purple MIPS64 5Kc
|
||||
|
||||
Thomas Lange <thomas@corelatus.se>
|
||||
dbau1x00 MIPS32 Au1000
|
||||
|
||||
#########################################################################
|
||||
# Nios-32 Systems: #
|
||||
# #
|
||||
# Maintainer Name, Email Address #
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
Scott McNutt <smcnutt@psyent.com>
|
||||
|
||||
DK1C20 Nios-32
|
||||
|
||||
#########################################################################
|
||||
# End of MAINTAINERS list #
|
||||
#########################################################################
|
||||
|
||||
40
MAKEALL
40
MAKEALL
@@ -56,10 +56,11 @@ LIST_4xx=" \
|
||||
ADCIOP AR405 ASH405 BUBINGA405EP \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 DASA_SIM \
|
||||
DU405 EBONY ERIC EXBITGEN \
|
||||
MIP405 MIP405T ML2 OCRTC \
|
||||
ORSG PCI405 PIP405 PMC405 \
|
||||
PPChameleonEVB W7OLMC W7OLMG WALNUT405 \
|
||||
DP405 DU405 EBONY ERIC \
|
||||
EXBITGEN HUB405 MIP405 MIP405T \
|
||||
ML2 OCRTC ORSG PCI405 \
|
||||
PIP405 PLU405 PMC405 PPChameleonEVB \
|
||||
VOH405 W7OLMC W7OLMG WALNUT405 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -68,8 +69,9 @@ LIST_4xx=" \
|
||||
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
MOUSSE MUSENKI OXC PN62 \
|
||||
Sandpoint8240 Sandpoint8245 SL8245 utx8245 \
|
||||
debris MOUSSE MUSENKI OXC \
|
||||
PN62 Sandpoint8240 Sandpoint8245 SL8245 \
|
||||
utx8245 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -81,7 +83,15 @@ LIST_8260=" \
|
||||
gw8260 hymod IPHASE4539 MPC8260ADS \
|
||||
MPC8266ADS PM826 ppmc8260 RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE ZPC1900 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MPC85xx Systems (includes 8540, 8560 etc.)
|
||||
#########################################################################
|
||||
|
||||
LIST_85xx=" \
|
||||
MPC8540ADS MPC8560ADS \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -100,6 +110,7 @@ LIST_7xx=" \
|
||||
LIST_ppc="${LIST_5xx} ${LIST_5xxx} \
|
||||
${LIST_8xx} \
|
||||
${LIST_824x} ${LIST_8260} \
|
||||
${LIST_85xx} \
|
||||
${LIST_4xx} \
|
||||
${LIST_74xx} ${LIST_7xx}"
|
||||
|
||||
@@ -131,18 +142,22 @@ LIST_ARM9=" \
|
||||
|
||||
LIST_pxa="cradle csb226 innokom lubbock wepep250"
|
||||
|
||||
LIST_ixp="ixdp425"
|
||||
|
||||
LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9} ${LIST_pxa}"
|
||||
|
||||
LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9} ${LIST_pxa} ${LIST_ixp}"
|
||||
|
||||
#########################################################################
|
||||
## MIPS 4Kc Systems
|
||||
## MIPS Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_mips4kc="incaip"
|
||||
|
||||
LIST_mips5kc="purple"
|
||||
|
||||
LIST_mips="${LIST_mips4kc} ${LIST_mips5kc}"
|
||||
LIST_au1x00="dbau1x00"
|
||||
|
||||
LIST_mips="${LIST_mips4kc} ${LIST_mips5kc} ${LIST_au1x00}"
|
||||
|
||||
#########################################################################
|
||||
## i386 Systems
|
||||
@@ -174,7 +189,10 @@ build_target() {
|
||||
for arg in $@
|
||||
do
|
||||
case "$arg" in
|
||||
5xx|5xxx|8xx|824x|8260|4xx|7xx|74xx|SA|ARM7|ARM9|ppc|arm|pxa|mips|I486|x86)
|
||||
ppc|5xx|5xxx|8xx|824x|8260|85xx|4xx|7xx|74xx| \
|
||||
arm|SA|ARM7|ARM9|pxa|ixp| \
|
||||
mips| \
|
||||
x86|I486)
|
||||
for target in `eval echo '$LIST_'${arg}`
|
||||
do
|
||||
build_target ${target}
|
||||
|
||||
133
Makefile
133
Makefile
@@ -69,6 +69,9 @@ endif
|
||||
ifeq ($(ARCH),mips)
|
||||
CROSS_COMPILE = mips_4KC-
|
||||
endif
|
||||
ifeq ($(ARCH),nios)
|
||||
CROSS_COMPILE = nios-elf-
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -76,6 +79,7 @@ export CROSS_COMPILE
|
||||
|
||||
# The "tools" are needed early, so put this first
|
||||
SUBDIRS = tools \
|
||||
examples \
|
||||
lib_generic \
|
||||
lib_$(ARCH) \
|
||||
cpu/$(CPU) \
|
||||
@@ -89,8 +93,7 @@ SUBDIRS = tools \
|
||||
drivers \
|
||||
drivers/sk98lin \
|
||||
post \
|
||||
post/cpu \
|
||||
examples
|
||||
post/cpu
|
||||
|
||||
#########################################################################
|
||||
# U-Boot objects....order is important (i.e. start must be first)
|
||||
@@ -103,6 +106,9 @@ endif
|
||||
ifeq ($(CPU),ppc4xx)
|
||||
OBJS += cpu/$(CPU)/resetvec.o
|
||||
endif
|
||||
ifeq ($(CPU),mpc85xx)
|
||||
OBJS += cpu/$(CPU)/resetvec.o
|
||||
endif
|
||||
|
||||
LIBS = board/$(BOARDDIR)/lib$(BOARD).a
|
||||
LIBS += cpu/$(CPU)/lib$(CPU).a
|
||||
@@ -117,6 +123,8 @@ LIBS += drivers/sk98lin/libsk98lin.a
|
||||
LIBS += post/libpost.a post/cpu/libcpu.a
|
||||
LIBS += common/libcommon.a
|
||||
LIBS += lib_generic/libgeneric.a
|
||||
# Add GCC lib
|
||||
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||
|
||||
#########################################################################
|
||||
#########################################################################
|
||||
@@ -195,14 +203,16 @@ cmi_mpc5xx_config: unconfig
|
||||
#########################################################################
|
||||
## MPC5xxx Systems
|
||||
#########################################################################
|
||||
MPC5200LITE \
|
||||
icecube_5200_config \
|
||||
IceCube_5200_config \
|
||||
IceCube_5100_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _5200,$@)" ] || \
|
||||
@[ -z "$(findstring 5200,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC5200" >>include/config.h ; \
|
||||
echo "... with MPC5200 processor" ; \
|
||||
}
|
||||
@[ -z "$(findstring _5100,$@)" ] || \
|
||||
@[ -z "$(findstring 5100,$@)" ] || \
|
||||
{ echo "#define CONFIG_MGT5100" >>include/config.h ; \
|
||||
echo "... with MGT5100 processor" ; \
|
||||
}
|
||||
@@ -468,9 +478,15 @@ v37_config: unconfig
|
||||
@echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx v37
|
||||
|
||||
wtk_config: unconfig
|
||||
@echo "#define CONFIG_LCD" >include/config.h
|
||||
@echo "#define CONFIG_SHARP_LQ065T9DR51U" >>include/config.h
|
||||
@./mkconfig -a TQM823L ppc mpc8xx tqm8xx
|
||||
|
||||
#########################################################################
|
||||
## PPC4xx Systems
|
||||
#########################################################################
|
||||
xtract_4xx = $(subst _MODEL_BA,,$(subst _MODEL_ME,,$(subst _MODEL_HI,,$(subst _config,,$1))))
|
||||
|
||||
ADCIOP_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx adciop esd
|
||||
@@ -505,6 +521,9 @@ CRAYL1_config:unconfig
|
||||
DASA_SIM_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
|
||||
|
||||
DP405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx dp405 esd
|
||||
|
||||
DU405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx du405 esd
|
||||
|
||||
@@ -517,6 +536,9 @@ ERIC_config:unconfig
|
||||
EXBITGEN_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx exbitgen
|
||||
|
||||
HUB405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx hub405 esd
|
||||
|
||||
MIP405_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
|
||||
|
||||
@@ -538,11 +560,33 @@ PCI405_config: unconfig
|
||||
PIP405_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
|
||||
|
||||
PLU405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx plu405 esd
|
||||
|
||||
PMC405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
|
||||
|
||||
PPChameleonEVB_MODEL_BA_config \
|
||||
PPChameleonEVB_MODEL_ME_config \
|
||||
PPChameleonEVB_MODEL_HI_config \
|
||||
PPChameleonEVB_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx PPChameleonEVB dave
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _MODEL_BA,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>include/config.h ; \
|
||||
echo "... BASIC model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _MODEL_ME,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>include/config.h ; \
|
||||
echo "... MEDIUM model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _MODEL_HI,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>include/config.h ; \
|
||||
echo "... HIGH-END model" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
VOH405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx voh405 esd
|
||||
|
||||
W7OLMC_config \
|
||||
W7OLMG_config: unconfig
|
||||
@@ -606,6 +650,9 @@ utx8245_config: unconfig
|
||||
## MPC8260 Systems
|
||||
#########################################################################
|
||||
|
||||
atc_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 atc
|
||||
|
||||
cogent_mpc8260_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 cogent
|
||||
|
||||
@@ -729,8 +776,18 @@ TQM8265_AA_config: unconfig
|
||||
fi
|
||||
@./mkconfig -a TQM8260 ppc mpc8260 tqm8260
|
||||
|
||||
atc_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 atc
|
||||
ZPC1900_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 zpc1900
|
||||
|
||||
#########################################################################
|
||||
## MPC85xx Systems
|
||||
#########################################################################
|
||||
|
||||
MPC8540ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8540ads
|
||||
|
||||
MPC8560ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8560ads
|
||||
|
||||
#########################################################################
|
||||
## 74xx/7xx Systems
|
||||
@@ -739,24 +796,27 @@ atc_config: unconfig
|
||||
AmigaOneG3SE_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
|
||||
|
||||
BAB7xx_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
|
||||
|
||||
debris_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x debris etin
|
||||
|
||||
ELPPC_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
|
||||
|
||||
EVB64260_config \
|
||||
EVB64260_750CX_config: unconfig
|
||||
@./mkconfig EVB64260 ppc 74xx_7xx evb64260
|
||||
|
||||
ZUMA_config: unconfig
|
||||
P3G4_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
|
||||
|
||||
PCIPPC2_config \
|
||||
PCIPPC6_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
|
||||
|
||||
BAB7xx_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
|
||||
|
||||
ELPPC_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
|
||||
|
||||
P3G4_config: unconfig
|
||||
ZUMA_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
|
||||
|
||||
#========================================================================
|
||||
@@ -782,7 +842,7 @@ shannon_config : unconfig
|
||||
## ARM92xT Systems
|
||||
#########################################################################
|
||||
|
||||
xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
|
||||
xtract_trab = $(subst _bigram,,$(subst _bigflash,,$(subst _old,,$(subst _config,,$1))))
|
||||
|
||||
omap1510inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t omap1510inn
|
||||
@@ -797,11 +857,23 @@ smdk2410_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2410
|
||||
|
||||
trab_config \
|
||||
trab_big_flash_config: unconfig
|
||||
trab_bigram_config \
|
||||
trab_bigflash_config \
|
||||
trab_old_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _big_flash,$@)" ] || \
|
||||
{ echo "#define CONFIG_BIG_FLASH" >>include/config.h ; \
|
||||
echo "... with big flash support" ; \
|
||||
@[ -z "$(findstring _bigram,$@)" ] || \
|
||||
{ echo "#define CONFIG_FLASH_8MB" >>include/config.h ; \
|
||||
echo "... with 8 MB Flash, 32 MB RAM" ; \
|
||||
}
|
||||
@[ -z "$(findstring _bigflash,$@)" ] || \
|
||||
{ echo "#define CONFIG_RAM_16MB" >>include/config.h ; \
|
||||
echo "... with 16 MB Flash, 16 MB RAM" ; \
|
||||
echo "TEXT_BASE = 0x0CF00000" >board/trab/config.tmp ; \
|
||||
}
|
||||
@[ -z "$(findstring _old,$@)" ] || \
|
||||
{ echo "#define CONFIG_OLD_VERSION" >>include/config.h ; \
|
||||
echo "... with small memory configuration" ; \
|
||||
echo "TEXT_BASE = 0x0CF00000" >board/trab/config.tmp ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_trab,$@) arm arm920t trab
|
||||
|
||||
@@ -831,6 +903,9 @@ csb226_config : unconfig
|
||||
innokom_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa innokom
|
||||
|
||||
ixdp425_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm ixp ixdp425
|
||||
|
||||
lubbock_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa lubbock
|
||||
|
||||
@@ -890,6 +965,23 @@ incaip_config: unconfig
|
||||
purple_config : unconfig
|
||||
@./mkconfig $(@:_config=) mips mips purple
|
||||
|
||||
#========================================================================
|
||||
# Nios
|
||||
#========================================================================
|
||||
#########################################################################
|
||||
## Nios32
|
||||
#########################################################################
|
||||
|
||||
DK1C20_config: unconfig
|
||||
@./mkconfig $(@:_config=) nios nios dk1c20
|
||||
|
||||
|
||||
#########################################################################
|
||||
## MIPS32 AU1000
|
||||
#########################################################################
|
||||
dbau1x00_config : unconfig
|
||||
@./mkconfig $(@:_config=) mips mips dbau1x00
|
||||
|
||||
#########################################################################
|
||||
#########################################################################
|
||||
|
||||
@@ -907,6 +999,7 @@ clean:
|
||||
rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
|
||||
rm -f tools/env/fw_printenv tools/env/fw_setenv
|
||||
rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
|
||||
rm -f board/trab/trab_fkt board/trab/config.tmp
|
||||
|
||||
clobber: clean
|
||||
find . -type f \
|
||||
|
||||
95
README
95
README
@@ -146,6 +146,7 @@ Directory Hierarchy:
|
||||
- cpu/mpc8xx Files specific to Motorola MPC8xx CPUs
|
||||
- cpu/mpc824x Files specific to Motorola MPC824x CPUs
|
||||
- cpu/mpc8260 Files specific to Motorola MPC8260 CPU
|
||||
- cpu/mpc85xx Files specific to Motorola MPC85xx CPUs
|
||||
- cpu/ppc4xx Files specific to IBM 4xx CPUs
|
||||
|
||||
|
||||
@@ -199,17 +200,22 @@ Directory Hierarchy:
|
||||
- board/mbx8xx Files specific to MBX boards
|
||||
- board/mpc8260ads
|
||||
Files specific to MPC8260ADS and PQ2FADS-ZU boards
|
||||
- board/mpc8540ads
|
||||
Files specific to MPC8540ADS boards
|
||||
- board/mpc8560ads
|
||||
Files specific to MPC8560ADS boards
|
||||
- board/mpl/ Files specific to boards manufactured by MPL
|
||||
- board/mpl/common Common files for MPL boards
|
||||
- board/mpl/pip405 Files specific to PIP405 boards
|
||||
- board/mpl/mip405 Files specific to MIP405 boards
|
||||
- board/mpl/vcma9 Files specific to VCMA9 boards
|
||||
- board/musenki Files specific to MUSEKNI boards
|
||||
- board/mvs1 Files specific to MVS1 boards
|
||||
- board/nx823 Files specific to NX823 boards
|
||||
- board/oxc Files specific to OXC boards
|
||||
- board/omap1510inn
|
||||
Files specific to OMAP 1510 Innovator boards
|
||||
- board/omap1610inn
|
||||
- board/omap1610inn
|
||||
Files specific to OMAP 1610 Innovator boards
|
||||
- board/pcippc2 Files specific to PCIPPC2/PCIPPC6 boards
|
||||
- board/pm826 Files specific to PM826 boards
|
||||
@@ -238,6 +244,7 @@ Directory Hierarchy:
|
||||
- board/westel/ Files specific to boards manufactured by Westel Wireless
|
||||
- board/westel/amx860 Files specific to AMX860 boards
|
||||
- board/utx8245 Files specific to UTX8245 boards
|
||||
- board/zpc1900 Files specific to Zephyr Engineering ZPC.1900 board
|
||||
|
||||
Software Configuration:
|
||||
=======================
|
||||
@@ -304,6 +311,7 @@ The following options need to be configured:
|
||||
CONFIG_MPC823, CONFIG_MPC850, CONFIG_MPC855, CONFIG_MPC860
|
||||
or CONFIG_MPC5xx
|
||||
or CONFIG_MPC824X, CONFIG_MPC8260
|
||||
or CONFIG_MPC85xx
|
||||
or CONFIG_IOP480
|
||||
or CONFIG_405GP
|
||||
or CONFIG_405EP
|
||||
@@ -354,7 +362,8 @@ The following options need to be configured:
|
||||
CONFIG_IAD210, CONFIG_RPXlite, CONFIG_sbc8260,
|
||||
CONFIG_EBONY, CONFIG_sacsng, CONFIG_FPS860L,
|
||||
CONFIG_V37, CONFIG_ELPT860, CONFIG_CMI,
|
||||
CONFIG_NETVIA, CONFIG_RBC823
|
||||
CONFIG_NETVIA, CONFIG_RBC823, CONFIG_ZPC1900,
|
||||
CONFIG_MPC8540ADS, CONFIG_MPC8560ADS
|
||||
|
||||
ARM based boards:
|
||||
-----------------
|
||||
@@ -363,7 +372,7 @@ The following options need to be configured:
|
||||
CONFIG_IMPA7, CONFIG_LART, CONFIG_LUBBOCK,
|
||||
CONFIG_INNOVATOROMAP1510, CONFIG_INNOVATOROMAP1610
|
||||
CONFIG_SHANNON, CONFIG_SMDK2400, CONFIG_SMDK2410,
|
||||
CONFIG_TRAB, CONFIG_AT91RM9200DK
|
||||
CONFIG_TRAB, CONFIG_VCMA9, CONFIG_AT91RM9200DK
|
||||
|
||||
|
||||
- CPU Module Type: (if CONFIG_COGENT is defined)
|
||||
@@ -392,19 +401,20 @@ The following options need to be configured:
|
||||
Possible values are:
|
||||
CFG_8260ADS - original MPC8260ADS
|
||||
CFG_8266ADS - MPC8266ADS (untested)
|
||||
CFG_PQ2FADS - PQ2FADS-ZU
|
||||
CFG_PQ2FADS - PQ2FADS-ZU or PQ2FADS-VR
|
||||
|
||||
|
||||
- MPC824X Family Member (if CONFIG_MPC824X is defined)
|
||||
Define exactly one of
|
||||
CONFIG_MPC8240, CONFIG_MPC8245
|
||||
Define exactly one of
|
||||
CONFIG_MPC8240, CONFIG_MPC8245
|
||||
|
||||
- 8xx CPU Options: (if using an 8xx cpu)
|
||||
Define one or more of
|
||||
CONFIG_8xx_GCLK_FREQ - if get_gclk_freq() can not work e.g.
|
||||
no 32KHz reference PIT/RTC clock
|
||||
CONFIG_8xx_GCLK_FREQ - if get_gclk_freq() cannot work
|
||||
e.g. if there is no 32KHz
|
||||
reference PIT/RTC clock
|
||||
|
||||
- Clock Interface:
|
||||
- Linux Kernel Interface:
|
||||
CONFIG_CLOCKS_IN_MHZ
|
||||
|
||||
U-Boot stores all clock information in Hz
|
||||
@@ -414,11 +424,16 @@ The following options need to be configured:
|
||||
"clocks_in_mhz" can be defined so that U-Boot
|
||||
converts clock data to MHZ before passing it to the
|
||||
Linux kernel.
|
||||
|
||||
When CONFIG_CLOCKS_IN_MHZ is defined, a definition of
|
||||
"clocks_in_mhz=1" is automatically included in the
|
||||
default environment.
|
||||
|
||||
CONFIG_MEMSIZE_IN_BYTES [relevant for MIPS only]
|
||||
|
||||
When transfering memsize parameter to linux, some versions
|
||||
expect it to be in bytes, others in MB.
|
||||
Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes.
|
||||
|
||||
- Console Interface:
|
||||
Depending on board, define exactly one serial port
|
||||
(like CONFIG_8xx_CONS_SMC1, CONFIG_8xx_CONS_SMC2,
|
||||
@@ -472,6 +487,11 @@ The following options need to be configured:
|
||||
default i/o. Serial console can be forced with
|
||||
environment 'console=serial'.
|
||||
|
||||
When CONFIG_SILENT_CONSOLE is defined, all console
|
||||
messages (by U-Boot and Linux!) can be silenced with
|
||||
the "silent" environment variable. See
|
||||
doc/README.silent for more information.
|
||||
|
||||
- Console Baudrate:
|
||||
CONFIG_BAUDRATE - in bps
|
||||
Select one of the baudrates listed in
|
||||
@@ -572,13 +592,18 @@ The following options need to be configured:
|
||||
#define enables commands:
|
||||
-------------------------
|
||||
CFG_CMD_ASKENV * ask for env variable
|
||||
CFG_CMD_AUTOSCRIPT Autoscript Support
|
||||
CFG_CMD_BDI bdinfo
|
||||
CFG_CMD_BEDBUG Include BedBug Debugger
|
||||
CFG_CMD_BMP * BMP support
|
||||
CFG_CMD_BOOTD bootd
|
||||
CFG_CMD_CACHE icache, dcache
|
||||
CFG_CMD_CONSOLE coninfo
|
||||
CFG_CMD_DATE * support for RTC, date/time...
|
||||
CFG_CMD_DHCP DHCP support
|
||||
CFG_CMD_DIAG * Diagnostics
|
||||
CFG_CMD_DOC * Disk-On-Chip Support
|
||||
CFG_CMD_DTT Digital Therm and Thermostat
|
||||
CFG_CMD_ECHO * echo arguments
|
||||
CFG_CMD_EEPROM * EEPROM read/write support
|
||||
CFG_CMD_ELF bootelf, bootvx
|
||||
@@ -588,27 +613,37 @@ The following options need to be configured:
|
||||
CFG_CMD_FDOS * Dos diskette Support
|
||||
CFG_CMD_FLASH flinfo, erase, protect
|
||||
CFG_CMD_FPGA FPGA device initialization support
|
||||
CFG_CMD_HWFLOW * RTS/CTS hw flow control
|
||||
CFG_CMD_I2C * I2C serial bus support
|
||||
CFG_CMD_IDE * IDE harddisk support
|
||||
CFG_CMD_IMI iminfo
|
||||
CFG_CMD_IMLS List all found images
|
||||
CFG_CMD_IMMAP * IMMR dump support
|
||||
CFG_CMD_IRQ * irqinfo
|
||||
CFG_CMD_JFFS2 * JFFS2 Support
|
||||
CFG_CMD_KGDB * kgdb
|
||||
CFG_CMD_LOADB loadb
|
||||
CFG_CMD_LOADS loads
|
||||
CFG_CMD_MEMORY md, mm, nm, mw, cp, cmp, crc, base,
|
||||
loop, mtest
|
||||
CFG_CMD_MISC Misc functions like sleep etc
|
||||
CFG_CMD_MMC MMC memory mapped support
|
||||
CFG_CMD_MII MII utility commands
|
||||
CFG_CMD_NAND * NAND support
|
||||
CFG_CMD_NET bootp, tftpboot, rarpboot
|
||||
CFG_CMD_PCI * pciinfo
|
||||
CFG_CMD_PCMCIA * PCMCIA support
|
||||
CFG_CMD_PING * send ICMP ECHO_REQUEST to network host
|
||||
CFG_CMD_PORTIO Port I/O
|
||||
CFG_CMD_REGINFO * Register dump
|
||||
CFG_CMD_RUN run command in env variable
|
||||
CFG_CMD_SAVES save S record dump
|
||||
CFG_CMD_SCSI * SCSI Support
|
||||
CFG_CMD_SDRAM * print SDRAM configuration information
|
||||
CFG_CMD_SETGETDCR Support for DCR Register access (4xx only)
|
||||
CFG_CMD_SPI * SPI serial bus support
|
||||
CFG_CMD_USB * USB support
|
||||
CFG_CMD_VFD * VFD support (TRAB)
|
||||
CFG_CMD_BSP * Board SPecific functions
|
||||
-----------------------------------------------
|
||||
CFG_CMD_ALL all
|
||||
@@ -870,9 +905,9 @@ The following options need to be configured:
|
||||
images is included. If not, only uncompressed and gzip
|
||||
compressed images are supported.
|
||||
|
||||
NOTE: the bzip2 algorithm requires a lot of RAM, so
|
||||
the malloc area (as defined by CFG_MALLOC_LEN) should
|
||||
be at least 4MB.
|
||||
NOTE: the bzip2 algorithm requires a lot of RAM, so
|
||||
the malloc area (as defined by CFG_MALLOC_LEN) should
|
||||
be at least 4MB.
|
||||
|
||||
- Ethernet address:
|
||||
CONFIG_ETHADDR
|
||||
@@ -1400,7 +1435,13 @@ The following options need to be configured:
|
||||
-1 common/cmd_ide.c Read Error on boot device
|
||||
-1 common/cmd_ide.c Image header has bad magic number
|
||||
|
||||
-1 common/cmd_nvedit.c Environment not changable, but has bad CRC
|
||||
-1 common/cmd_nand.c Bad usage of "nand" command
|
||||
-1 common/cmd_nand.c No boot device
|
||||
-1 common/cmd_nand.c Unknown Chip ID on boot device
|
||||
-1 common/cmd_nand.c Read Error on boot device
|
||||
-1 common/cmd_nand.c Image header has bad magic number
|
||||
|
||||
-1 common/env_common.c Environment has a bad CRC, using default
|
||||
|
||||
|
||||
Modem Support:
|
||||
@@ -1482,6 +1523,10 @@ Configuration Settings:
|
||||
- CFG_ALT_MEMTEST:
|
||||
Enable an alternate, more extensive memory test.
|
||||
|
||||
- CFG_MEMTEST_SCRATCH:
|
||||
Scratch address used by the alternate memory test
|
||||
You only need to set this if address zero isn't writeable
|
||||
|
||||
- CFG_TFTP_LOADADDR:
|
||||
Default load address for network file downloads
|
||||
|
||||
@@ -1723,6 +1768,14 @@ Note: once the monitor has been relocated, then it will complain if
|
||||
the default environment is used; a new CRC is computed as soon as you
|
||||
use the "saveenv" command to store a valid environment.
|
||||
|
||||
- CFG_FAULT_ECHO_LINK_DOWN:
|
||||
Echo the inverted Ethernet link state to the fault LED.
|
||||
|
||||
Note: If this option is active, then CFG_FAULT_MII_ADDR
|
||||
also needs to be defined.
|
||||
|
||||
- CFG_FAULT_MII_ADDR:
|
||||
MII address of the PHY to check for the Ethernet link state.
|
||||
|
||||
Low Level (hardware related) configuration options:
|
||||
---------------------------------------------------
|
||||
@@ -1733,9 +1786,9 @@ Low Level (hardware related) configuration options:
|
||||
- CFG_DEFAULT_IMMR:
|
||||
Default address of the IMMR after system reset.
|
||||
|
||||
Needed on some 8260 systems (MPC8260ADS, PQ2FADS-ZU,
|
||||
and RPXsuper) to be able to adjust the position of
|
||||
the IMMR register after a reset.
|
||||
Needed on some 8260 systems (MPC8260ADS, PQ2FADS-ZU,
|
||||
and RPXsuper) to be able to adjust the position of
|
||||
the IMMR register after a reset.
|
||||
|
||||
- Floppy Disk Support:
|
||||
CFG_FDC_DRIVE_NUMBER
|
||||
@@ -1909,7 +1962,9 @@ configurations; the following names are supported:
|
||||
GEN860T_config EBONY_config FPS860L_config
|
||||
ELPT860_config cmi_mpc5xx_config NETVIA_config
|
||||
at91rm9200dk_config omap1510inn_config MPC8260ADS_config
|
||||
omap1610inn_config
|
||||
omap1610inn_config ZPC1900_config MPC8540ADS_config
|
||||
MPC8560ADS_config
|
||||
|
||||
Note: for some board special configuration names may exist; check if
|
||||
additional information is available from the board vendor; for
|
||||
instance, the TQM8xxL systems run normally at 50 MHz and use a
|
||||
@@ -2275,8 +2330,8 @@ defines the following image properties:
|
||||
LynxOS, pSOS, QNX, RTEMS, ARTOS;
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
|
||||
* Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
|
||||
IA64, MIPS, MIPS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
|
||||
Currently supported: PowerPC).
|
||||
IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
|
||||
Currently supported: ARM, Intel x86, MIPS, NIOS, PowerPC).
|
||||
* Compression Type (uncompressed, gzip, bzip2)
|
||||
* Load Address
|
||||
* Entry Point
|
||||
|
||||
@@ -230,8 +230,8 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
volatile long int *addr;
|
||||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
ulong cnt, val, size;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
@@ -250,7 +250,13 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
/* Restore the original data before leaving the function.
|
||||
*/
|
||||
*addr = save[i];
|
||||
for (cnt = 1; cnt <= maxsize / sizeof(long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -261,7 +267,14 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
size = cnt * sizeof (long);
|
||||
/* Restore the original data before returning
|
||||
*/
|
||||
for (cnt <<= 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (size);
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
|
||||
@@ -41,5 +41,3 @@
|
||||
* | |
|
||||
* | ... |
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
@@ -26,4 +26,3 @@
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFE000000
|
||||
|
||||
|
||||
@@ -144,4 +144,3 @@ SECTIONS
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ int dram_init (void)
|
||||
* The NAND lives in the CS2* space
|
||||
*/
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
extern void nand_probe (ulong physadr);
|
||||
extern ulong nand_probe (ulong physadr);
|
||||
|
||||
#define AT91_SMARTMEDIA_BASE 0x40000000 /* physical address to access memory on NCS3 */
|
||||
void nand_init (void)
|
||||
@@ -103,10 +103,12 @@ void nand_init (void)
|
||||
*AT91C_PIOB_ODR = AT91C_PIO_PB1; /* disable output */
|
||||
|
||||
if (*AT91C_PIOB_PDSR & AT91C_PIO_PB1)
|
||||
printf ("No ");
|
||||
printf ("SmartMedia card inserted\n");
|
||||
printf (" No SmartMedia card inserted\n");
|
||||
#ifdef DEBUG
|
||||
printf (" SmartMedia card inserted\n");
|
||||
|
||||
printf ("Probing at 0x%.8x\n", AT91_SMARTMEDIA_BASE);
|
||||
nand_probe (AT91_SMARTMEDIA_BASE);
|
||||
#endif
|
||||
printf ("%4lu MB\n", nand_probe(AT91_SMARTMEDIA_BASE) >> 20);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -160,7 +160,7 @@ ulong flash_init (void)
|
||||
if (i == 0)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
else
|
||||
panic ("configured to many flash banks!\n");
|
||||
panic ("configured too many flash banks!\n");
|
||||
|
||||
sector = 0;
|
||||
start_address = flashbase;
|
||||
|
||||
@@ -92,20 +92,20 @@ const iop_conf_t iop_conf_tab[4][32] = {
|
||||
/* PB20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[1] */
|
||||
/* PB19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[2] */
|
||||
/* PB18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[3] */
|
||||
/* PB17 */ { 0, 0, 0, 0, 0, 0 }, /* PB17 */
|
||||
/* PB16 */ { 0, 0, 0, 0, 0, 0 }, /* PB16 */
|
||||
/* PB15 */ { 0, 0, 0, 0, 0, 0 }, /* PB15 */
|
||||
/* PB14 */ { 0, 0, 0, 0, 0, 0 }, /* PB14 */
|
||||
/* PB13 */ { 0, 0, 0, 0, 0, 0 }, /* PB13 */
|
||||
/* PB12 */ { 0, 0, 0, 0, 0, 0 }, /* PB12 */
|
||||
/* PB11 */ { 0, 0, 0, 0, 0, 0 }, /* PB11 */
|
||||
/* PB10 */ { 0, 0, 0, 0, 0, 0 }, /* PB10 */
|
||||
/* PB9 */ { 0, 0, 0, 0, 0, 0 }, /* PB9 */
|
||||
/* PB8 */ { 0, 0, 0, 0, 0, 0 }, /* PB8 */
|
||||
/* PB7 */ { 0, 0, 0, 0, 0, 0 }, /* PB7 */
|
||||
/* PB6 */ { 0, 0, 0, 0, 0, 0 }, /* PB6 */
|
||||
/* PB5 */ { 0, 0, 0, 0, 0, 0 }, /* PB5 */
|
||||
/* PB4 */ { 0, 0, 0, 0, 0, 0 }, /* PB4 */
|
||||
/* PB17 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RX_DV */
|
||||
/* PB16 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RX_ER */
|
||||
/* PB15 */ { 1, 1, 0, 1, 0, 0 }, /* FCC3 MII TX_ER */
|
||||
/* PB14 */ { 1, 1, 0, 1, 0, 0 }, /* FCC3 MII TX_EN */
|
||||
/* PB13 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII COL */
|
||||
/* PB12 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII CRS */
|
||||
/* PB11 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RxD */
|
||||
/* PB10 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RxD */
|
||||
/* PB9 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RxD */
|
||||
/* PB8 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RxD */
|
||||
/* PB7 */ { 1, 1, 0, 1, 0, 0 }, /* FCC3 MII TxD */
|
||||
/* PB6 */ { 1, 1, 0, 1, 0, 0 }, /* FCC3 MII TxD */
|
||||
/* PB5 */ { 1, 1, 0, 1, 0, 0 }, /* FCC3 MII TxD */
|
||||
/* PB4 */ { 1, 1, 0, 1, 0, 0 }, /* FCC3 MII TxD */
|
||||
/* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* PB3 */
|
||||
/* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* PB2 */
|
||||
/* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* PB1 */
|
||||
@@ -128,8 +128,8 @@ const iop_conf_t iop_conf_tab[4][32] = {
|
||||
/* PC20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII TX_CLK */
|
||||
/* PC19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_CLK */
|
||||
/* PC18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII TX_CLK */
|
||||
/* PC17 */ { 0, 0, 0, 0, 0, 0 }, /* PC17 */
|
||||
/* PC16 */ { 0, 0, 0, 0, 0, 0 }, /* PC16 */
|
||||
/* PC17 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII RX_CLK */
|
||||
/* PC16 */ { 1, 1, 0, 0, 0, 0 }, /* FCC3 MII TX_CLK */
|
||||
#if 0
|
||||
/* PC15 */ { 0, 0, 0, 0, 0, 0 }, /* PC15 */
|
||||
#else
|
||||
@@ -269,7 +269,7 @@ static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
|
||||
ulong orx, volatile uchar * base)
|
||||
{
|
||||
volatile uchar c = 0xff;
|
||||
ulong cnt, val;
|
||||
ulong cnt, val, size;
|
||||
volatile ulong *addr;
|
||||
volatile uint *sdmr_ptr;
|
||||
volatile uint *orx_ptr;
|
||||
@@ -344,7 +344,13 @@ static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
|
||||
*addr = 0;
|
||||
|
||||
if ((val = *addr) != 0) {
|
||||
/* Restore the original data before leaving the function.
|
||||
*/
|
||||
*addr = save[i];
|
||||
for (cnt = 1; cnt <= maxsize / sizeof(long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -353,10 +359,17 @@ static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
if (val != ~cnt) {
|
||||
size = cnt * sizeof (long);
|
||||
/* Restore the original data before returning
|
||||
*/
|
||||
for (cnt <<= 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
/* Write the actual size to ORx
|
||||
*/
|
||||
*orx_ptr = orx | ~(cnt * sizeof (long) - 1);
|
||||
return (cnt * sizeof (long));
|
||||
*orx_ptr = orx | ~(size - 1);
|
||||
return (size);
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
|
||||
@@ -228,8 +228,8 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
volatile long int *addr;
|
||||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
ulong cnt, val, size;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
@@ -248,7 +248,13 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
/* Restore the original data before leaving the function.
|
||||
*/
|
||||
*addr = save[i];
|
||||
for (cnt = 1; cnt <= maxsize / sizeof(long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -259,7 +265,14 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
size = cnt * sizeof (long);
|
||||
/* Restore the original data before returning
|
||||
*/
|
||||
for (cnt <<= 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (size);
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
|
||||
@@ -59,7 +59,7 @@ ulong flash_init(void)
|
||||
flashbase = PHYS_FLASH_2;
|
||||
break;
|
||||
default:
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++)
|
||||
|
||||
@@ -62,7 +62,7 @@ ulong flash_init(void)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
break;
|
||||
default:
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
|
||||
@@ -51,7 +51,7 @@ int gunzip(void *, int, unsigned char *, int *);
|
||||
int board_pre_init (void)
|
||||
{
|
||||
out32(GPIO0_OR, CFG_NAND0_CE); /* set initial outputs */
|
||||
out32(GPIO0_OR, CFG_NAND1_CE); /* set initial outputs */
|
||||
out32(GPIO0_OR, CFG_NAND1_CE); /* set initial outputs */
|
||||
|
||||
/*
|
||||
* IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
@@ -68,7 +68,7 @@ int board_pre_init (void)
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFF81); /* set int polarities */
|
||||
mtdcr(uicpr, 0xFFFFFF80); /* 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 */
|
||||
@@ -255,16 +255,23 @@ int testdram (void)
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
extern void
|
||||
extern ulong
|
||||
nand_probe(ulong physadr);
|
||||
|
||||
void
|
||||
nand_init(void)
|
||||
{
|
||||
ulong totlen = 0;
|
||||
|
||||
#if (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_ME) || \
|
||||
(CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_HI)
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND0_BASE);
|
||||
nand_probe (CFG_NAND0_BASE);
|
||||
totlen += nand_probe (CFG_NAND0_BASE);
|
||||
#endif /* CONFIG_PPCHAMELEON_MODULE_ME, CONFIG_PPCHAMELEON_MODULE_HI */
|
||||
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND1_BASE);
|
||||
nand_probe (CFG_NAND1_BASE);
|
||||
totlen += nand_probe (CFG_NAND1_BASE);
|
||||
|
||||
printf ("%4lu MB\n", totlen >>20);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -46,8 +46,8 @@ unsigned long flash_init (void)
|
||||
#else
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
@@ -64,14 +64,14 @@ unsigned long flash_init (void)
|
||||
size_b0, size_b0<<20);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
@@ -90,15 +90,15 @@ unsigned long flash_init (void)
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
#endif
|
||||
|
||||
@@ -40,11 +40,11 @@ static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
short n;
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM640U)) {
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322B) ||
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324B)) {
|
||||
@@ -58,7 +58,7 @@ static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
base += 64 << 10;
|
||||
++i;
|
||||
}
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322T) ||
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324T)) {
|
||||
@@ -75,7 +75,7 @@ static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
@@ -103,10 +103,10 @@ static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int size;
|
||||
int erased;
|
||||
volatile unsigned long *flash;
|
||||
int k;
|
||||
int size;
|
||||
int erased;
|
||||
volatile unsigned long *flash;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
@@ -164,28 +164,28 @@ void flash_print_info (flash_info_t *info)
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
#ifdef CFG_FLASH_EMPTY_INFO
|
||||
/*
|
||||
* Check if whole sector is erased
|
||||
*/
|
||||
if (i != (info->sector_count-1))
|
||||
size = info->start[i+1] - info->start[i];
|
||||
else
|
||||
size = info->start[0] + info->size - info->start[i];
|
||||
erased = 1;
|
||||
flash = (volatile unsigned long *)info->start[i];
|
||||
size = size >> 2; /* divide by 4 for longword access */
|
||||
for (k=0; k<size; k++)
|
||||
{
|
||||
if (*flash++ != 0xffffffff)
|
||||
{
|
||||
erased = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check if whole sector is erased
|
||||
*/
|
||||
if (i != (info->sector_count-1))
|
||||
size = info->start[i+1] - info->start[i];
|
||||
else
|
||||
size = info->start[0] + info->size - info->start[i];
|
||||
erased = 1;
|
||||
flash = (volatile unsigned long *)info->start[i];
|
||||
size = size >> 2; /* divide by 4 for longword access */
|
||||
for (k=0; k<size; k++)
|
||||
{
|
||||
if (*flash++ != 0xffffffff)
|
||||
{
|
||||
erased = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
/* print empty and read-only info */
|
||||
/* print empty and read-only info */
|
||||
printf (" %08lX%s%s",
|
||||
info->start[i],
|
||||
erased ? " E" : " ",
|
||||
@@ -219,7 +219,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
short n;
|
||||
CFG_FLASH_WORD_SIZE value;
|
||||
ulong base = (ulong)addr;
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)addr;
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
@@ -288,42 +288,42 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)STM_ID_29W320DT:
|
||||
info->flash_id += FLASH_STMW320DT;
|
||||
info->sector_count = 67;
|
||||
info->flash_id += FLASH_STMW320DT;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320T:
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 71;
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL322T:
|
||||
info->flash_id += FLASH_AMDL322T;
|
||||
info->sector_count = 71;
|
||||
info->flash_id += FLASH_AMDL322T;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL322B:
|
||||
info->flash_id += FLASH_AMDL322B;
|
||||
info->flash_id += FLASH_AMDL322B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL323T:
|
||||
info->flash_id += FLASH_AMDL323T;
|
||||
info->flash_id += FLASH_AMDL323T;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL323B:
|
||||
info->flash_id += FLASH_AMDL323B;
|
||||
info->flash_id += FLASH_AMDL323B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV640U:
|
||||
info->flash_id += FLASH_AM640U;
|
||||
info->flash_id += FLASH_AM640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000; break; /* => 8 MB */
|
||||
|
||||
@@ -346,11 +346,11 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM640U)) {
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322B) ||
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324B)) {
|
||||
@@ -364,7 +364,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
base += 64 << 10;
|
||||
++i;
|
||||
}
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322T) ||
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324T)) {
|
||||
@@ -381,13 +381,13 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
} else if ((info->flash_id & FLASH_TYPEMASK) == FLASH_STMW320DT) {
|
||||
} else if ((info->flash_id & FLASH_TYPEMASK) == FLASH_STMW320DT) {
|
||||
/* set sector offsets for top boot block type */
|
||||
base += info->size;
|
||||
i = info->sector_count;
|
||||
/* 1 x 16k boot sector */
|
||||
/* 1 x 16k boot sector */
|
||||
base -= 16 << 10;
|
||||
--i;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
/* 2 x 8k boot sectors */
|
||||
for (n=0; n<2; ++n) {
|
||||
@@ -395,9 +395,9 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
/* 1 x 32k boot sector */
|
||||
/* 1 x 32k boot sector */
|
||||
base -= 32 << 10;
|
||||
--i;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
|
||||
while (i > 0) { /* 64k regular sectors */
|
||||
@@ -405,7 +405,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
@@ -432,10 +432,10 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
addr2 = (volatile CFG_FLASH_WORD_SIZE *)(info->start[i]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)
|
||||
info->protect[i] = 0;
|
||||
else
|
||||
info->protect[i] = addr2[CFG_FLASH_READ2] & 1;
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)
|
||||
info->protect[i] = 0;
|
||||
else
|
||||
info->protect[i] = addr2[CFG_FLASH_READ2] & 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -459,7 +459,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2;
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
int i;
|
||||
int i;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
@@ -498,25 +498,25 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (CFG_FLASH_WORD_SIZE *)(info->start[sect]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) {
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00800080;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[0] = (CFG_FLASH_WORD_SIZE)0x00500050; /* block erase */
|
||||
for (i=0; i<50; i++)
|
||||
udelay(1000); /* wait 1 ms */
|
||||
} else {
|
||||
if (sect == s_first) {
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00800080;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
}
|
||||
addr2[0] = (CFG_FLASH_WORD_SIZE)0x00300030; /* sector erase */
|
||||
}
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) {
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00800080;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[0] = (CFG_FLASH_WORD_SIZE)0x00500050; /* block erase */
|
||||
for (i=0; i<50; i++)
|
||||
udelay(1000); /* wait 1 ms */
|
||||
} else {
|
||||
if (sect == s_first) {
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00800080;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
}
|
||||
addr2[0] = (CFG_FLASH_WORD_SIZE)0x00300030; /* sector erase */
|
||||
}
|
||||
l_sect = sect;
|
||||
}
|
||||
}
|
||||
@@ -637,42 +637,42 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
*/
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data)
|
||||
{
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile CFG_FLASH_WORD_SIZE *dest2 = (CFG_FLASH_WORD_SIZE *)dest;
|
||||
volatile CFG_FLASH_WORD_SIZE *data2 = (CFG_FLASH_WORD_SIZE *)&data;
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile CFG_FLASH_WORD_SIZE *dest2 = (CFG_FLASH_WORD_SIZE *)dest;
|
||||
volatile CFG_FLASH_WORD_SIZE *data2 = (CFG_FLASH_WORD_SIZE *)&data;
|
||||
ulong start;
|
||||
int flag;
|
||||
int i;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile CFG_FLASH_WORD_SIZE *)dest) &
|
||||
(CFG_FLASH_WORD_SIZE)data) != (CFG_FLASH_WORD_SIZE)data) {
|
||||
(CFG_FLASH_WORD_SIZE)data) != (CFG_FLASH_WORD_SIZE)data) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
for (i=0; i<4/sizeof(CFG_FLASH_WORD_SIZE); i++)
|
||||
{
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00A000A0;
|
||||
for (i=0; i<4/sizeof(CFG_FLASH_WORD_SIZE); i++)
|
||||
{
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00A000A0;
|
||||
|
||||
dest2[i] = data2[i];
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & (CFG_FLASH_WORD_SIZE)0x00800080) !=
|
||||
(data2[i] & (CFG_FLASH_WORD_SIZE)0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & (CFG_FLASH_WORD_SIZE)0x00800080) !=
|
||||
(data2[i] & (CFG_FLASH_WORD_SIZE)0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -57,16 +57,16 @@
|
||||
#define SET_FPGA(data) out32(GPIO0_OR, data)
|
||||
|
||||
#define FPGA_WRITE_1 { \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set clock to 0 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set data to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA); /* set clock to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);} /* set data to 1 */
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set clock to 0 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set data to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA); /* set clock to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);} /* set data to 1 */
|
||||
|
||||
#define FPGA_WRITE_0 { \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set clock to 0 */ \
|
||||
SET_FPGA(FPGA_PRG); /* set data to 0 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK); /* set clock to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);} /* set data to 1 */
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set clock to 0 */ \
|
||||
SET_FPGA(FPGA_PRG); /* set data to 0 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK); /* set clock to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);} /* set data to 1 */
|
||||
|
||||
#if 0
|
||||
static int fpga_boot (unsigned char *fpgadata, int size)
|
||||
|
||||
41
board/dbau1x00/Makefile
Normal file
41
board/dbau1x00/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# (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 $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
SOBJS = memsetup.o
|
||||
|
||||
$(LIB): .depend $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
53
board/dbau1x00/README
Normal file
53
board/dbau1x00/README
Normal file
@@ -0,0 +1,53 @@
|
||||
By Thomas.Lange@corelatus.se 2003-10-06
|
||||
----------------------------------------
|
||||
DbAu1000 is a development board from AMD containing
|
||||
an Alchemy AU1000 with mips32 core.
|
||||
|
||||
Limitations & comments
|
||||
----------------------
|
||||
I assume that you set board to BIG endian!
|
||||
Little endian not tested, most probably broken.
|
||||
|
||||
I named the board dbau1x00, to allow
|
||||
support for all three development boards
|
||||
some day ( dbau1000, dbau1100 and dbau1500 ).
|
||||
|
||||
I only have a dbau1000, so all testing is limited
|
||||
to this board!
|
||||
|
||||
The board has two different flash banks, that can
|
||||
be selected via dip switch. This makes it possible
|
||||
to test new bootloaders without thrashing the YAMON
|
||||
boot loader deliviered with board.
|
||||
|
||||
Ethernet only supported for mac0.
|
||||
|
||||
Pcmcia only supported for slot 0, only 3.3V.
|
||||
|
||||
Pcmcia IDE tested with Sandisk Compact Flash and
|
||||
IBM microdrive.
|
||||
|
||||
###################################
|
||||
######## NOTE!!!!!! #########
|
||||
###################################
|
||||
If you partition a disk on another system (e.g. laptop),
|
||||
all bytes will be swapped on 16bit level when using
|
||||
PCMCIA!!!!
|
||||
|
||||
This is probably due to an error in Au1000 chip.
|
||||
|
||||
Solution:
|
||||
|
||||
a) Boot via network and partition disk directly from
|
||||
dbau1x00. The endian will then be correct.
|
||||
|
||||
b) Partition disk on "laptop" and fill it with all files
|
||||
you need. Then write a simple program that endian swaps
|
||||
whole disk,
|
||||
|
||||
Example:
|
||||
Original "laptop" byte order:
|
||||
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9...
|
||||
|
||||
Dbau1000 byte order will then be:
|
||||
B1 B0 B3 B2 B5 B4 B7 B6 B9 B8...
|
||||
32
board/dbau1x00/config.mk
Normal file
32
board/dbau1x00/config.mk
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
#
|
||||
# AMD development board AMD Alchemy DbAu1x00, MIPS32 core
|
||||
#
|
||||
|
||||
# ROM version
|
||||
TEXT_BASE = 0xbfc00000
|
||||
|
||||
# RAM version
|
||||
#TEXT_BASE = 0x80100000
|
||||
110
board/dbau1x00/dbau1x00.c
Normal file
110
board/dbau1x00/dbau1x00.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Thomas.Lange@corelatus.se
|
||||
*
|
||||
* 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 <command.h>
|
||||
#include <asm/au1x00.h>
|
||||
#include <asm/mipsregs.h>
|
||||
|
||||
long int initdram(int board_type)
|
||||
{
|
||||
/* Sdram is setup by assembler code */
|
||||
/* If memory could be changed, we should return the true value here */
|
||||
return 64*1024*1024;
|
||||
}
|
||||
|
||||
#define BCSR_PCMCIA_PC0DRVEN 0x0010
|
||||
#define BCSR_PCMCIA_PC0RST 0x0080
|
||||
|
||||
/* In cpu/mips/cpu.c */
|
||||
void write_one_tlb( int index, u32 pagemask, u32 hi, u32 low0, u32 low1 );
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
u16 status;
|
||||
volatile u32 *pcmcia_bcsr = (u32*)(DB1000_BCSR_ADDR+0x10);
|
||||
volatile u32 *phy = (u32*)(DB1000_BCSR_ADDR+0xC);
|
||||
volatile u32 *sys_counter = (volatile u32*)SYS_COUNTER_CNTRL;
|
||||
u32 proc_id;
|
||||
|
||||
*sys_counter = 0x100; /* Enable 32 kHz oscillator for RTC/TOY */
|
||||
|
||||
proc_id = read_32bit_cp0_register(CP0_PRID);
|
||||
|
||||
switch(proc_id>>24){
|
||||
case 0:
|
||||
puts("Board: Merlot (DbAu1000)\n");
|
||||
printf("CPU: Au1000 396 MHz, id: 0x%02x, rev: 0x%02x\n",
|
||||
(proc_id>>8)&0xFF,proc_id&0xFF);
|
||||
break;
|
||||
default:
|
||||
printf("Unsupported cpu %d, proc_id=0x%x\n",proc_id>>24,proc_id);
|
||||
}
|
||||
#ifdef CONFIG_IDE_PCMCIA
|
||||
/* Enable 3.3 V on slot 0 ( VCC )
|
||||
No 5V */
|
||||
status = 4;
|
||||
*pcmcia_bcsr = status;
|
||||
|
||||
status |= BCSR_PCMCIA_PC0DRVEN;
|
||||
*pcmcia_bcsr = status;
|
||||
au_sync();
|
||||
|
||||
udelay(300*1000);
|
||||
|
||||
status |= BCSR_PCMCIA_PC0RST;
|
||||
*pcmcia_bcsr = status;
|
||||
au_sync();
|
||||
|
||||
udelay(100*1000);
|
||||
|
||||
/* PCMCIA is on a 36 bit physical address.
|
||||
We need to map it into a 32 bit addresses */
|
||||
|
||||
#if 0
|
||||
/* We dont need theese unless we run whole pcmcia package */
|
||||
write_one_tlb(20, /* index */
|
||||
0x01ffe000, /* Pagemask, 16 MB pages */
|
||||
CFG_PCMCIA_IO_BASE, /* Hi */
|
||||
0x3C000017, /* Lo0 */
|
||||
0x3C200017); /* Lo1 */
|
||||
|
||||
write_one_tlb(21, /* index */
|
||||
0x01ffe000, /* Pagemask, 16 MB pages */
|
||||
CFG_PCMCIA_ATTR_BASE, /* Hi */
|
||||
0x3D000017, /* Lo0 */
|
||||
0x3D200017); /* Lo1 */
|
||||
#endif
|
||||
write_one_tlb(22, /* index */
|
||||
0x01ffe000, /* Pagemask, 16 MB pages */
|
||||
CFG_PCMCIA_MEM_ADDR, /* Hi */
|
||||
0x3E000017, /* Lo0 */
|
||||
0x3E200017); /* Lo1 */
|
||||
|
||||
/* Release reset of ethernet PHY chips */
|
||||
/* Always do this, because linux does not know about it */
|
||||
*phy = 3;
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
43
board/dbau1x00/flash.c
Normal file
43
board/dbau1x00/flash.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* (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>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* flash_init()
|
||||
*
|
||||
* sets up flash_info and returns size of FLASH (bytes)
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
printf ("Skipping flash_init\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
printf ("write_buff not implemented\n");
|
||||
return (-1);
|
||||
}
|
||||
118
board/dbau1x00/memsetup.S
Normal file
118
board/dbau1x00/memsetup.S
Normal file
@@ -0,0 +1,118 @@
|
||||
/* Memory sub-system initialization code */
|
||||
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
#include <asm/regdef.h>
|
||||
#include <asm/au1x00.h>
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
/* First setup pll:s to make serial work ok */
|
||||
/* We have a 12 MHz crystal */
|
||||
li t0, SYS_CPUPLL
|
||||
li t1, 0x21 /* 396 MHz */
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
nop
|
||||
|
||||
/* Setup AUX PLL */
|
||||
li t0, SYS_AUXPLL
|
||||
li t1, 8 /* 96 MHz */
|
||||
sw t1, 0(t0) /* aux pll */
|
||||
sync
|
||||
|
||||
/* SDCS 0,1 SDRAM */
|
||||
li t0, MEM_SDMODE0
|
||||
li t1, 0x005522AA
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDMODE1
|
||||
li t1, 0x005522AA
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDADDR0
|
||||
li t1, 0x001003F8
|
||||
sw t1, 0(t0)
|
||||
|
||||
|
||||
li t0, MEM_SDADDR1
|
||||
li t1, 0x001023F8
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDREFCFG
|
||||
li t1, 0x64000C24 /* Disable */
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDPRECMD
|
||||
sw zero, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDAUTOREF
|
||||
sw zero, 0(t0)
|
||||
sync
|
||||
sw zero, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDREFCFG
|
||||
li t1, 0x66000C24 /* Enable */
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD0
|
||||
li t1, 0x00000033
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD1
|
||||
li t1, 0x00000033
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
/* Static memory controller */
|
||||
|
||||
/* RCE0 AMD 29LV640M MirrorBit Flash */
|
||||
li t0, MEM_STCFG0
|
||||
li t1, 0x00000003
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STTIME0
|
||||
li t1, 0x22080b20
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR0
|
||||
li t1, 0x11E03F80
|
||||
sw t1, 0(t0)
|
||||
|
||||
/* RCE1 CPLD Board Logic */
|
||||
li t0, MEM_STCFG1
|
||||
li t1, 0x00000080
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STTIME1
|
||||
li t1, 0x22080a20
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR1
|
||||
li t1, 0x10c03f00
|
||||
sw t1, 0(t0)
|
||||
|
||||
/* RCE3 PCMCIA 250ns */
|
||||
li t0, MEM_STCFG3
|
||||
li t1, 0x00000002
|
||||
sw t1, 0(t0)
|
||||
|
||||
|
||||
li t0, MEM_STTIME3
|
||||
li t1, 0x280E3E07
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR3
|
||||
li t1, 0x10000000
|
||||
sw t1, 0(t0)
|
||||
|
||||
sync
|
||||
|
||||
j ra
|
||||
nop
|
||||
68
board/dbau1x00/u-boot.lds
Normal file
68
board/dbau1x00/u-boot.lds
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk 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_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
|
||||
*/
|
||||
OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
|
||||
OUTPUT_ARCH(mips)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.sdata : { *(.sdata) }
|
||||
|
||||
_gp = ALIGN(16);
|
||||
|
||||
__got_start = .;
|
||||
.got : { *(.got) }
|
||||
__got_end = .;
|
||||
|
||||
.sdata : { *(.sdata) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
uboot_end_data = .;
|
||||
num_got_entries = (__got_end - __got_start) >> 2;
|
||||
|
||||
. = ALIGN(4);
|
||||
.sbss : { *(.sbss) }
|
||||
.bss : { *(.bss) }
|
||||
uboot_end = .;
|
||||
}
|
||||
48
board/dk1c20/Makefile
Normal file
48
board/dk1c20/Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := $(BOARD).o flash.o
|
||||
|
||||
SOBJS = vectors.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 $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
29
board/dk1c20/config.mk
Normal file
29
board/dk1c20/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (C) Copyright 2003
|
||||
# Psyent Corporation
|
||||
# Scott McNutt <smcnutt@psyent.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
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x018c0000
|
||||
|
||||
ifeq ($(debug),1)
|
||||
PLATFORM_CPPFLAGS += -DDEBUG
|
||||
endif
|
||||
45
board/dk1c20/dk1c20.c
Normal file
45
board/dk1c20/dk1c20.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
|
||||
* Scott McNutt <smcnutt@psyent.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
void _default_hdlr (void)
|
||||
{
|
||||
printf ("default_hdlr\n");
|
||||
}
|
||||
|
||||
int board_pre_init (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: Altera Nios 1C20 Development Kit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
226
board/dk1c20/flash.c
Normal file
226
board/dk1c20/flash.c
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* (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 <common.h>
|
||||
#include <nios.h>
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define BANKSZ (8 * 1024 * 1024)
|
||||
#define SECTSZ (64 * 1024)
|
||||
#define USERFLASH (2 * 1024 * 1024) /* bottom 2 MB for user */
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
#define FLASH_WORD_SIZE unsigned char
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i;
|
||||
unsigned long addr;
|
||||
flash_info_t *fli = &flash_info[0];
|
||||
|
||||
fli->size = BANKSZ;
|
||||
fli->sector_count = CFG_MAX_FLASH_SECT;
|
||||
fli->flash_id = FLASH_MAN_AMD;
|
||||
|
||||
addr = CFG_FLASH_BASE;
|
||||
for (i = 0; i < fli->sector_count; ++i) {
|
||||
fli->start[i] = addr;
|
||||
addr += SECTSZ;
|
||||
|
||||
/* Protect all but 2 MByte user area */
|
||||
if (addr < (CFG_FLASH_BASE + USERFLASH))
|
||||
fli->protect[i] = 0;
|
||||
else
|
||||
fli->protect[i] = 1;
|
||||
}
|
||||
|
||||
return (BANKSZ);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i, k;
|
||||
unsigned long size;
|
||||
int erased;
|
||||
volatile unsigned char *flash;
|
||||
|
||||
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) {
|
||||
|
||||
/* Check if whole sector is erased */
|
||||
if (i != (info->sector_count - 1))
|
||||
size = info->start[i + 1] - info->start[i];
|
||||
else
|
||||
size = info->start[0] + info->size - info->start[i];
|
||||
erased = 1;
|
||||
flash = (volatile unsigned char *) info->start[i];
|
||||
for (k = 0; k < size; k++) {
|
||||
if (*flash++ != 0xff) {
|
||||
erased = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print the info */
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s%s", info->start[i], erased ? " E" : " ",
|
||||
info->protect[i] ? "RO " : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
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 prot, sect;
|
||||
int any = 0;
|
||||
unsigned oldpri;
|
||||
ulong start;
|
||||
|
||||
/* Some sanity checking */
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
printf ("- no sectors to erase\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");
|
||||
}
|
||||
|
||||
/* NOTE: disabling interrupts on Nios can be very bad since it
|
||||
* also disables the LO_LIMIT exception. It's better here to
|
||||
* set the interrupt priority to 3 & restore it when we're done.
|
||||
*/
|
||||
oldpri = ipri (3);
|
||||
|
||||
/* It's ok to erase multiple sectors provided we don't delay more
|
||||
* than 50 usec between cmds ... at which point the erase time-out
|
||||
* occurs. So don't go and put printf() calls in the loop ... it
|
||||
* won't be very helpful ;-)
|
||||
*/
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
*addr = 0xaa;
|
||||
*addr = 0x55;
|
||||
*addr = 0x80;
|
||||
*addr = 0xaa;
|
||||
*addr = 0x55;
|
||||
*addr2 = 0x30;
|
||||
any = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now just wait for 0xff & provide some user feedback while
|
||||
* we wait.
|
||||
*/
|
||||
if (any) {
|
||||
addr2 = (FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
start = get_timer (0);
|
||||
while (*addr2 != 0xff) {
|
||||
udelay (1000 * 1000);
|
||||
putc ('.');
|
||||
if (get_timer (start) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("timeout\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/* Restore interrupt priority */
|
||||
ipri (oldpri);
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
vu_char *cmd = (vu_char *) info->start[0];
|
||||
vu_char *dst = (vu_char *) addr;
|
||||
unsigned char b;
|
||||
unsigned oldpri;
|
||||
ulong start;
|
||||
|
||||
while (cnt) {
|
||||
/* Check for sufficient erase */
|
||||
b = *src;
|
||||
if ((*dst & b) != b) {
|
||||
printf ("%02x : %02x\n", *dst, b);
|
||||
return (2);
|
||||
}
|
||||
|
||||
/* Disable interrupts other than window underflow
|
||||
* (interrupt priority 2)
|
||||
*/
|
||||
oldpri = ipri (3);
|
||||
*cmd = 0xaa;
|
||||
*cmd = 0x55;
|
||||
*cmd = 0xa0;
|
||||
*dst = b;
|
||||
|
||||
/* Verify write */
|
||||
start = get_timer (0);
|
||||
while (*dst != b) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
ipri (oldpri);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
dst++;
|
||||
src++;
|
||||
cnt--;
|
||||
ipri (oldpri);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
69
board/dk1c20/u-boot.lds
Normal file
69
board/dk1c20/u-boot.lds
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
|
||||
* Scott McNutt <smcnutt@psyent.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
|
||||
*/
|
||||
|
||||
|
||||
OUTPUT_FORMAT("elf32-nios")
|
||||
OUTPUT_ARCH(nios)
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
cpu/nios/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
__text_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
}
|
||||
__rodata_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
}
|
||||
. = ALIGN(4);
|
||||
__data_end = .;
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd :
|
||||
{
|
||||
*(.u_boot_cmd)
|
||||
}
|
||||
. = ALIGN(4);
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
. = ALIGN(4);
|
||||
.bss :
|
||||
{
|
||||
*(.bss)
|
||||
}
|
||||
. = ALIGN(4);
|
||||
__bss_end = .;
|
||||
}
|
||||
122
board/dk1c20/vectors.S
Normal file
122
board/dk1c20/vectors.S
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
|
||||
* Scott McNutt <smcnutt@psyent.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
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Exception Vector Table
|
||||
*
|
||||
* This could have gone in the cpu soure tree, but the whole point of
|
||||
* Nios is customization -- and polluting the cpu source tree with
|
||||
* board-specific ifdef's really defeats the purpose, no? With this in
|
||||
* the board-specific tree, each board has the freedom to organize
|
||||
* vectors/traps, etc anyway it wants. The init code copies this table
|
||||
* to the proper location.
|
||||
*
|
||||
* Each board can do what it likes here. But there are four "standard"
|
||||
* handlers availble:
|
||||
*
|
||||
* _cwp_lolimit -Handles register window underflows.
|
||||
* _cwp_hilimit -Handles register window overflows.
|
||||
* _timebase_int -Increments the timebase.
|
||||
* _def_xhandler -Default exception handler.
|
||||
*
|
||||
* _timebase_int handles a Nios Timer interrupt and increments the
|
||||
* timestamp used for the get_timer(), reset_timer(), etc. routines. It
|
||||
* expects the timer to be configured like the standard-32 low priority
|
||||
* timer.
|
||||
*
|
||||
* _def_xhandler dispatches exceptions/traps via the external_interrupt()
|
||||
* routine. This lets you use the irq_install_handler() and handle your
|
||||
* interrupts/traps with code written in C.
|
||||
************************************************************************/
|
||||
|
||||
.data
|
||||
.global _vectors
|
||||
.align 4
|
||||
_vectors:
|
||||
|
||||
.long _def_xhandler@h /* Vector 0 - NMI */
|
||||
.long _cwp_lolimit@h /* Vector 1 - underflow */
|
||||
.long _cwp_hilimit@h /* Vector 2 - overflow */
|
||||
|
||||
.long _def_xhandler@h /* Vector 3 - GNUPro debug */
|
||||
.long _def_xhandler@h /* Vector 4 - GNUPro debug */
|
||||
.long _def_xhandler@h /* Vector 5 - GNUPro debug */
|
||||
.long _def_xhandler@h /* Vector 6 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 7 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 8 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 9 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 10 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 11 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 12 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 13 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 14 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 15 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 16 */
|
||||
.long _def_xhandler@h /* Vector 17 */
|
||||
.long _def_xhandler@h /* Vector 18 */
|
||||
.long _def_xhandler@h /* Vector 19 */
|
||||
.long _def_xhandler@h /* Vector 20 */
|
||||
.long _def_xhandler@h /* Vector 21 */
|
||||
.long _def_xhandler@h /* Vector 22 */
|
||||
.long _def_xhandler@h /* Vector 23 */
|
||||
.long _def_xhandler@h /* Vector 24 */
|
||||
.long _def_xhandler@h /* Vector 25 */
|
||||
.long _def_xhandler@h /* Vector 26 */
|
||||
.long _def_xhandler@h /* Vector 27 */
|
||||
.long _def_xhandler@h /* Vector 28 */
|
||||
.long _def_xhandler@h /* Vector 29 */
|
||||
.long _def_xhandler@h /* Vector 30 */
|
||||
.long _def_xhandler@h /* Vector 31 */
|
||||
.long _def_xhandler@h /* Vector 32 */
|
||||
.long _def_xhandler@h /* Vector 33 */
|
||||
.long _def_xhandler@h /* Vector 34 */
|
||||
.long _def_xhandler@h /* Vector 35 */
|
||||
.long _def_xhandler@h /* Vector 36 */
|
||||
.long _def_xhandler@h /* Vector 37 */
|
||||
.long _def_xhandler@h /* Vector 38 */
|
||||
.long _def_xhandler@h /* Vector 39 */
|
||||
.long _def_xhandler@h /* Vector 40 */
|
||||
.long _def_xhandler@h /* Vector 41 */
|
||||
.long _def_xhandler@h /* Vector 42 */
|
||||
.long _def_xhandler@h /* Vector 43 */
|
||||
.long _def_xhandler@h /* Vector 44 */
|
||||
.long _def_xhandler@h /* Vector 45 */
|
||||
.long _def_xhandler@h /* Vector 46 */
|
||||
.long _def_xhandler@h /* Vector 47 */
|
||||
.long _def_xhandler@h /* Vector 48 */
|
||||
.long _def_xhandler@h /* Vector 49 */
|
||||
.long _timebase_int@h /* Vector 50 - lopri timer*/
|
||||
.long _def_xhandler@h /* Vector 51 */
|
||||
.long _def_xhandler@h /* Vector 52 */
|
||||
.long _def_xhandler@h /* Vector 53 */
|
||||
.long _def_xhandler@h /* Vector 54 */
|
||||
.long _def_xhandler@h /* Vector 55 */
|
||||
.long _def_xhandler@h /* Vector 56 */
|
||||
.long _def_xhandler@h /* Vector 57 */
|
||||
.long _def_xhandler@h /* Vector 58 */
|
||||
.long _def_xhandler@h /* Vector 59 */
|
||||
.long _def_xhandler@h /* Vector 60 */
|
||||
.long _def_xhandler@h /* Vector 61 */
|
||||
.long _def_xhandler@h /* Vector 62 */
|
||||
.long _def_xhandler@h /* Vector 63 */
|
||||
@@ -74,7 +74,7 @@ unsigned long flash_init (void)
|
||||
flash_get_offsets(PHYS_FLASH_1, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
|
||||
@@ -50,7 +50,7 @@ ulong flash_init (void)
|
||||
if (i == 0)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
else
|
||||
panic ("configured to many flash banks!\n");
|
||||
panic ("configured too many flash banks!\n");
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
flash_info[i].start[j] = flashbase + j * MAIN_SECT_SIZE;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,6 @@ void nand_init(void)
|
||||
{
|
||||
nand_probe(CFG_NAND_BASE);
|
||||
if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
|
||||
puts("NAND: ");
|
||||
print_size(nand_dev_desc[0].totlen, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
217
board/esd/common/xilinx_jtag/lenval.c
Normal file
217
board/esd/common/xilinx_jtag/lenval.c
Normal file
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
/*******************************************************/
|
||||
/* file: lenval.c */
|
||||
/* abstract: This file contains routines for using */
|
||||
/* the lenVal data structure. */
|
||||
/*******************************************************/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#include "lenval.h"
|
||||
#include "ports.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: value
|
||||
* Description: Extract the long value from the lenval array.
|
||||
* Parameters: plvValue - ptr to lenval.
|
||||
* Returns: long - the extracted value.
|
||||
*****************************************************************************/
|
||||
long value( lenVal* plvValue )
|
||||
{
|
||||
long lValue; /* result to hold the accumulated result */
|
||||
short sIndex;
|
||||
|
||||
lValue = 0;
|
||||
for ( sIndex = 0; sIndex < plvValue->len ; ++sIndex )
|
||||
{
|
||||
lValue <<= 8; /* shift the accumulated result */
|
||||
lValue |= plvValue->val[ sIndex]; /* get the last byte first */
|
||||
}
|
||||
|
||||
return( lValue );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: initLenVal
|
||||
* Description: Initialize the lenval array with the given value.
|
||||
* Assumes lValue is less than 256.
|
||||
* Parameters: plv - ptr to lenval.
|
||||
* lValue - the value to set.
|
||||
* Returns: void.
|
||||
*****************************************************************************/
|
||||
void initLenVal( lenVal* plv,
|
||||
long lValue )
|
||||
{
|
||||
plv->len = 1;
|
||||
plv->val[0] = (unsigned char)lValue;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: EqualLenVal
|
||||
* Description: Compare two lenval arrays with an optional mask.
|
||||
* Parameters: plvTdoExpected - ptr to lenval #1.
|
||||
* plvTdoCaptured - ptr to lenval #2.
|
||||
* plvTdoMask - optional ptr to mask (=0 if no mask).
|
||||
* Returns: short - 0 = mismatch; 1 = equal.
|
||||
*****************************************************************************/
|
||||
short EqualLenVal( lenVal* plvTdoExpected,
|
||||
lenVal* plvTdoCaptured,
|
||||
lenVal* plvTdoMask )
|
||||
{
|
||||
short sEqual;
|
||||
short sIndex;
|
||||
unsigned char ucByteVal1;
|
||||
unsigned char ucByteVal2;
|
||||
unsigned char ucByteMask;
|
||||
|
||||
sEqual = 1;
|
||||
sIndex = plvTdoExpected->len;
|
||||
|
||||
while ( sEqual && sIndex-- )
|
||||
{
|
||||
ucByteVal1 = plvTdoExpected->val[ sIndex ];
|
||||
ucByteVal2 = plvTdoCaptured->val[ sIndex ];
|
||||
if ( plvTdoMask )
|
||||
{
|
||||
ucByteMask = plvTdoMask->val[ sIndex ];
|
||||
ucByteVal1 &= ucByteMask;
|
||||
ucByteVal2 &= ucByteMask;
|
||||
}
|
||||
if ( ucByteVal1 != ucByteVal2 )
|
||||
{
|
||||
sEqual = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return( sEqual );
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: RetBit
|
||||
* Description: return the (byte, bit) of lv (reading from left to right).
|
||||
* Parameters: plv - ptr to lenval.
|
||||
* iByte - the byte to get the bit from.
|
||||
* iBit - the bit number (0=msb)
|
||||
* Returns: short - the bit value.
|
||||
*****************************************************************************/
|
||||
short RetBit( lenVal* plv,
|
||||
int iByte,
|
||||
int iBit )
|
||||
{
|
||||
/* assert( ( iByte >= 0 ) && ( iByte < plv->len ) ); */
|
||||
/* assert( ( iBit >= 0 ) && ( iBit < 8 ) ); */
|
||||
return( (short)( ( plv->val[ iByte ] >> ( 7 - iBit ) ) & 0x1 ) );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: SetBit
|
||||
* Description: set the (byte, bit) of lv equal to val
|
||||
* Example: SetBit("00000000",byte, 1) equals "01000000".
|
||||
* Parameters: plv - ptr to lenval.
|
||||
* iByte - the byte to get the bit from.
|
||||
* iBit - the bit number (0=msb).
|
||||
* sVal - the bit value to set.
|
||||
* Returns: void.
|
||||
*****************************************************************************/
|
||||
void SetBit( lenVal* plv,
|
||||
int iByte,
|
||||
int iBit,
|
||||
short sVal )
|
||||
{
|
||||
unsigned char ucByteVal;
|
||||
unsigned char ucBitMask;
|
||||
|
||||
ucBitMask = (unsigned char)(1 << ( 7 - iBit ));
|
||||
ucByteVal = (unsigned char)(plv->val[ iByte ] & (~ucBitMask));
|
||||
|
||||
if ( sVal )
|
||||
{
|
||||
ucByteVal |= ucBitMask;
|
||||
}
|
||||
plv->val[ iByte ] = ucByteVal;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: AddVal
|
||||
* Description: add val1 to val2 and store in resVal;
|
||||
* assumes val1 and val2 are of equal length.
|
||||
* Parameters: plvResVal - ptr to result.
|
||||
* plvVal1 - ptr of addendum.
|
||||
* plvVal2 - ptr of addendum.
|
||||
* Returns: void.
|
||||
*****************************************************************************/
|
||||
void addVal( lenVal* plvResVal,
|
||||
lenVal* plvVal1,
|
||||
lenVal* plvVal2 )
|
||||
{
|
||||
unsigned char ucCarry;
|
||||
unsigned short usSum;
|
||||
unsigned short usVal1;
|
||||
unsigned short usVal2;
|
||||
short sIndex;
|
||||
|
||||
plvResVal->len = plvVal1->len; /* set up length of result */
|
||||
|
||||
/* start at least significant bit and add bytes */
|
||||
ucCarry = 0;
|
||||
sIndex = plvVal1->len;
|
||||
while ( sIndex-- )
|
||||
{
|
||||
usVal1 = plvVal1->val[ sIndex ]; /* i'th byte of val1 */
|
||||
usVal2 = plvVal2->val[ sIndex ]; /* i'th byte of val2 */
|
||||
|
||||
/* add the two bytes plus carry from previous addition */
|
||||
usSum = (unsigned short)( usVal1 + usVal2 + ucCarry );
|
||||
|
||||
/* set up carry for next byte */
|
||||
ucCarry = (unsigned char)( ( usSum > 255 ) ? 1 : 0 );
|
||||
|
||||
/* set the i'th byte of the result */
|
||||
plvResVal->val[ sIndex ] = (unsigned char)usSum;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: readVal
|
||||
* Description: read from XSVF numBytes bytes of data into x.
|
||||
* Parameters: plv - ptr to lenval in which to put the bytes read.
|
||||
* sNumBytes - the number of bytes to read.
|
||||
* Returns: void.
|
||||
*****************************************************************************/
|
||||
void readVal( lenVal* plv,
|
||||
short sNumBytes )
|
||||
{
|
||||
unsigned char* pucVal;
|
||||
|
||||
plv->len = sNumBytes; /* set the length of the lenVal */
|
||||
for ( pucVal = plv->val; sNumBytes; --sNumBytes, ++pucVal )
|
||||
{
|
||||
/* read a byte of data into the lenVal */
|
||||
readByte( pucVal );
|
||||
}
|
||||
}
|
||||
79
board/esd/common/xilinx_jtag/lenval.h
Normal file
79
board/esd/common/xilinx_jtag/lenval.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
/*******************************************************/
|
||||
/* file: lenval.h */
|
||||
/* abstract: This file contains a description of the */
|
||||
/* data structure "lenval". */
|
||||
/*******************************************************/
|
||||
|
||||
#ifndef lenval_dot_h
|
||||
#define lenval_dot_h
|
||||
|
||||
/* the lenVal structure is a byte oriented type used to store an */
|
||||
/* arbitrary length binary value. As an example, the hex value */
|
||||
/* 0x0e3d is represented as a lenVal with len=2 (since 2 bytes */
|
||||
/* and val[0]=0e and val[1]=3d. val[2-MAX_LEN] are undefined */
|
||||
|
||||
/* maximum length (in bytes) of value to read in */
|
||||
/* this needs to be at least 4, and longer than the */
|
||||
/* length of the longest SDR instruction. If there is, */
|
||||
/* only 1 device in the chain, MAX_LEN must be at least */
|
||||
/* ceil(27/8) == 4. For 6 devices in a chain, MAX_LEN */
|
||||
/* must be 5, for 14 devices MAX_LEN must be 6, for 20 */
|
||||
/* devices MAX_LEN must be 7, etc.. */
|
||||
/* You can safely set MAX_LEN to a smaller number if you*/
|
||||
/* know how many devices will be in your chain. */
|
||||
#define MAX_LEN 7000
|
||||
|
||||
|
||||
typedef struct var_len_byte
|
||||
{
|
||||
short len; /* number of chars in this value */
|
||||
unsigned char val[MAX_LEN+1]; /* bytes of data */
|
||||
} lenVal;
|
||||
|
||||
|
||||
/* return the long representation of a lenVal */
|
||||
extern long value(lenVal *x);
|
||||
|
||||
/* set lenVal equal to value */
|
||||
extern void initLenVal(lenVal *x, long value);
|
||||
|
||||
/* check if expected equals actual (taking the mask into account) */
|
||||
extern short EqualLenVal(lenVal *expected, lenVal *actual, lenVal *mask);
|
||||
|
||||
/* add val1+val2 and put the result in resVal */
|
||||
extern void addVal(lenVal *resVal, lenVal *val1, lenVal *val2);
|
||||
|
||||
/* return the (byte, bit) of lv (reading from left to right) */
|
||||
extern short RetBit(lenVal *lv, int byte, int bit);
|
||||
|
||||
/* set the (byte, bit) of lv equal to val (e.g. SetBit("00000000",byte, 1)
|
||||
equals "01000000" */
|
||||
extern void SetBit(lenVal *lv, int byte, int bit, short val);
|
||||
|
||||
/* read from XSVF numBytes bytes of data into x */
|
||||
extern void readVal(lenVal *x, short numBytes);
|
||||
|
||||
#endif
|
||||
1864
board/esd/common/xilinx_jtag/micro.c
Normal file
1864
board/esd/common/xilinx_jtag/micro.c
Normal file
File diff suppressed because it is too large
Load Diff
64
board/esd/common/xilinx_jtag/micro.h
Normal file
64
board/esd/common/xilinx_jtag/micro.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
* File: micro.h
|
||||
* Description: This header file contains the function prototype to the
|
||||
* primary interface function for the XSVF player.
|
||||
* Usage: FIRST - PORTS.C
|
||||
* Customize the ports.c function implementations to establish
|
||||
* the correct protocol for communicating with your JTAG ports
|
||||
* (setPort() and readTDOBit()) and tune the waitTime() delay
|
||||
* function. Also, establish access to the XSVF data source
|
||||
* in the readByte() function.
|
||||
* FINALLY - Call xsvfExecute().
|
||||
*****************************************************************************/
|
||||
#ifndef XSVF_MICRO_H
|
||||
#define XSVF_MICRO_H
|
||||
|
||||
/* Legacy error codes for xsvfExecute from original XSVF player v2.0 */
|
||||
#define XSVF_LEGACY_SUCCESS 1
|
||||
#define XSVF_LEGACY_ERROR 0
|
||||
|
||||
/* 4.04 [NEW] Error codes for xsvfExecute. */
|
||||
/* Must #define XSVF_SUPPORT_ERRORCODES in micro.c to get these codes */
|
||||
#define XSVF_ERROR_NONE 0
|
||||
#define XSVF_ERROR_UNKNOWN 1
|
||||
#define XSVF_ERROR_TDOMISMATCH 2
|
||||
#define XSVF_ERROR_MAXRETRIES 3 /* TDO mismatch after max retries */
|
||||
#define XSVF_ERROR_ILLEGALCMD 4
|
||||
#define XSVF_ERROR_ILLEGALSTATE 5
|
||||
#define XSVF_ERROR_DATAOVERFLOW 6 /* Data > lenVal MAX_LEN buffer size*/
|
||||
/* Insert new errors here */
|
||||
#define XSVF_ERROR_LAST 7
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: xsvfExecute
|
||||
* Description: Process, interpret, and apply the XSVF commands.
|
||||
* See port.c:readByte for source of XSVF data.
|
||||
* Parameters: none.
|
||||
* Returns: int - For error codes see above.
|
||||
*****************************************************************************/
|
||||
int xsvfExecute(void);
|
||||
|
||||
#endif /* XSVF_MICRO_H */
|
||||
116
board/esd/common/xilinx_jtag/ports.c
Normal file
116
board/esd/common/xilinx_jtag/ports.c
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
/*******************************************************/
|
||||
/* file: ports.c */
|
||||
/* abstract: This file contains the routines to */
|
||||
/* output values on the JTAG ports, to read */
|
||||
/* the TDO bit, and to read a byte of data */
|
||||
/* from the prom */
|
||||
/* */
|
||||
/*******************************************************/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#include "ports.h"
|
||||
|
||||
static unsigned long output = 0;
|
||||
static int filepos = 0;
|
||||
static int oldstate = 0;
|
||||
static int newstate = 0;
|
||||
static int readptr = 0;
|
||||
|
||||
extern long filesize;
|
||||
extern const unsigned char fpgadata[];
|
||||
|
||||
|
||||
/* if in debugging mode, then just set the variables */
|
||||
void setPort(short p,short val)
|
||||
{
|
||||
if (p==TMS) {
|
||||
if (val) {
|
||||
output |= JTAG_TMS;
|
||||
} else {
|
||||
output &= ~JTAG_TMS;
|
||||
}
|
||||
}
|
||||
if (p==TDI) {
|
||||
if (val) {
|
||||
output |= JTAG_TDI;
|
||||
} else {
|
||||
output &= ~JTAG_TDI;
|
||||
}
|
||||
}
|
||||
if (p==TCK) {
|
||||
if (val) {
|
||||
output |= JTAG_TCK;
|
||||
} else {
|
||||
output &= ~JTAG_TCK;
|
||||
}
|
||||
out32(GPIO0_OR, output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* toggle tck LH */
|
||||
void pulseClock(void)
|
||||
{
|
||||
setPort(TCK,0); /* set the TCK port to low */
|
||||
setPort(TCK,1); /* set the TCK port to high */
|
||||
}
|
||||
|
||||
|
||||
/* read in a byte of data from the prom */
|
||||
void readByte(unsigned char *data)
|
||||
{
|
||||
/* pretend reading using a file */
|
||||
*data = fpgadata[readptr++];
|
||||
newstate = (100 * filepos++) / filesize;
|
||||
if (newstate != oldstate) {
|
||||
printf("%4d\r\r\r\r", newstate);
|
||||
oldstate = newstate;
|
||||
}
|
||||
}
|
||||
|
||||
/* read the TDO bit from port */
|
||||
unsigned char readTDOBit(void)
|
||||
{
|
||||
unsigned long inputs;
|
||||
|
||||
inputs = in32(GPIO0_IR);
|
||||
if (inputs & JTAG_TDO)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Wait at least the specified number of microsec. */
|
||||
/* Use a timer if possible; otherwise estimate the number of instructions */
|
||||
/* necessary to be run based on the microcontroller speed. For this example */
|
||||
/* we pulse the TCK port a number of times based on the processor speed. */
|
||||
void waitTime(long microsec)
|
||||
{
|
||||
udelay(microsec); /* esd */
|
||||
}
|
||||
62
board/esd/common/xilinx_jtag/ports.h
Normal file
62
board/esd/common/xilinx_jtag/ports.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
/*******************************************************/
|
||||
/* file: ports.h */
|
||||
/* abstract: This file contains extern declarations */
|
||||
/* for providing stimulus to the JTAG ports.*/
|
||||
/*******************************************************/
|
||||
|
||||
#ifndef ports_dot_h
|
||||
#define ports_dot_h
|
||||
|
||||
/* these constants are used to send the appropriate ports to setPort */
|
||||
/* they should be enumerated types, but some of the microcontroller */
|
||||
/* compilers don't like enumerated types */
|
||||
#define TCK (short) 0
|
||||
#define TMS (short) 1
|
||||
#define TDI (short) 2
|
||||
|
||||
/*
|
||||
* Use CFG_FPGA_xxx defines from board include file.
|
||||
*/
|
||||
#define JTAG_TMS CFG_FPGA_PRG /* output */
|
||||
#define JTAG_TCK CFG_FPGA_CLK /* output */
|
||||
#define JTAG_TDI CFG_FPGA_DATA /* output */
|
||||
#define JTAG_TDO CFG_FPGA_DONE /* input */
|
||||
|
||||
/* set the port "p" (TCK, TMS, or TDI) to val (0 or 1) */
|
||||
void setPort(short p, short val);
|
||||
|
||||
/* read the TDO bit and store it in val */
|
||||
unsigned char readTDOBit(void);
|
||||
|
||||
/* make clock go down->up->down*/
|
||||
void pulseClock(void);
|
||||
|
||||
/* read the next byte of data from the xsvf file */
|
||||
void readByte(unsigned char *data);
|
||||
|
||||
void waitTime(long microsec);
|
||||
|
||||
#endif
|
||||
@@ -433,7 +433,14 @@ int checkboard (void)
|
||||
#endif
|
||||
|
||||
if (ctermm2()) {
|
||||
printf("CTERM-M2 - Id=0x%02x)", *(unsigned char *)0xf0000400);
|
||||
unsigned char str[4];
|
||||
|
||||
/*
|
||||
* Read board-id and save in env-variable
|
||||
*/
|
||||
sprintf(str, "%d", *(unsigned char *)0xf0000400);
|
||||
setenv("boardid", str);
|
||||
printf("CTERM-M2 - Id=%s)", str);
|
||||
} else {
|
||||
if (cpci405_host()) {
|
||||
puts ("PCI Host Version)");
|
||||
@@ -508,44 +515,144 @@ void ide_set_reset(int on)
|
||||
#endif /* CONFIG_IDE_RESET */
|
||||
#endif /* CONFIG_CPCI405_VER2 */
|
||||
|
||||
#if 0 /* test-only */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
u8 *dhcp_vendorex_prep (u8 * e)
|
||||
#ifdef CONFIG_CPCI405AB
|
||||
|
||||
#define ONE_WIRE_CLEAR (*(volatile unsigned short *)0xf0400000 |= 0x0100)
|
||||
#define ONE_WIRE_SET (*(volatile unsigned short *)0xf0400000 &= ~0x0100)
|
||||
#define ONE_WIRE_GET (*(volatile unsigned short *)0xf0400002 & 0x1000)
|
||||
|
||||
/*
|
||||
* Generate a 1-wire reset, return 1 if no presence detect was found,
|
||||
* return 0 otherwise.
|
||||
* (NOTE: Does not handle alarm presence from DS2404/DS1994)
|
||||
*/
|
||||
int OWTouchReset(void)
|
||||
{
|
||||
char *ptr;
|
||||
int result;
|
||||
|
||||
/* DHCP vendor-class-identifier = 60 */
|
||||
if ((ptr = getenv ("dhcp_vendor-class-identifier"))) {
|
||||
*e++ = 60;
|
||||
*e++ = strlen (ptr);
|
||||
while (*ptr)
|
||||
*e++ = *ptr++;
|
||||
}
|
||||
/* my DHCP_CLIENT_IDENTIFIER = 61 */
|
||||
if ((ptr = getenv ("dhcp_client_id"))) {
|
||||
*e++ = 61;
|
||||
*e++ = strlen (ptr);
|
||||
while (*ptr)
|
||||
*e++ = *ptr++;
|
||||
}
|
||||
ONE_WIRE_CLEAR;
|
||||
udelay(480);
|
||||
ONE_WIRE_SET;
|
||||
udelay(70);
|
||||
|
||||
return e;
|
||||
result = ONE_WIRE_GET;
|
||||
|
||||
udelay(410);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
u8 *dhcp_vendorex_proc (u8 * popt)
|
||||
/*
|
||||
* Send 1 a 1-wire write bit.
|
||||
* Provide 10us recovery time.
|
||||
*/
|
||||
void OWWriteBit(int bit)
|
||||
{
|
||||
if (*popt == 61)
|
||||
return (u8 *)-1;
|
||||
if (*popt == 43) {
|
||||
printf("|%s|", popt+4); /* test-only */
|
||||
return (u8 *)-1;
|
||||
if (bit) {
|
||||
/*
|
||||
* write '1' bit
|
||||
*/
|
||||
ONE_WIRE_CLEAR;
|
||||
udelay(6);
|
||||
ONE_WIRE_SET;
|
||||
udelay(64);
|
||||
} else {
|
||||
/*
|
||||
* write '0' bit
|
||||
*/
|
||||
ONE_WIRE_CLEAR;
|
||||
udelay(60);
|
||||
ONE_WIRE_SET;
|
||||
udelay(10);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
#endif /* test-only */
|
||||
|
||||
/*
|
||||
* Read a bit from the 1-wire bus and return it.
|
||||
* Provide 10us recovery time.
|
||||
*/
|
||||
int OWReadBit(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
ONE_WIRE_CLEAR;
|
||||
udelay(6);
|
||||
ONE_WIRE_SET;
|
||||
udelay(9);
|
||||
|
||||
result = ONE_WIRE_GET;
|
||||
|
||||
udelay(55);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void OWWriteByte(int data)
|
||||
{
|
||||
int loop;
|
||||
|
||||
for (loop=0; loop<8; loop++) {
|
||||
OWWriteBit(data & 0x01);
|
||||
data >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int OWReadByte(void)
|
||||
{
|
||||
int loop, result = 0;
|
||||
|
||||
for (loop=0; loop<8; loop++) {
|
||||
result >>= 1;
|
||||
if (OWReadBit()) {
|
||||
result |= 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
volatile unsigned short val;
|
||||
int result;
|
||||
int i;
|
||||
unsigned char ow_id[6];
|
||||
unsigned char str[32];
|
||||
unsigned char ow_crc;
|
||||
|
||||
/*
|
||||
* Clear 1-wire bit (open drain with pull-up)
|
||||
*/
|
||||
val = *(volatile unsigned short *)0xf0400000;
|
||||
val &= ~0x1000; /* clear 1-wire bit */
|
||||
*(volatile unsigned short *)0xf0400000 = val;
|
||||
|
||||
result = OWTouchReset();
|
||||
if (result != 0) {
|
||||
puts("No 1-wire device detected!\n");
|
||||
}
|
||||
|
||||
OWWriteByte(0x33); /* send read rom command */
|
||||
OWReadByte(); /* skip family code ( == 0x01) */
|
||||
for (i=0; i<6; i++) {
|
||||
ow_id[i] = OWReadByte();
|
||||
}
|
||||
ow_crc = OWReadByte(); /* read crc */
|
||||
|
||||
sprintf(str, "%08X%04X", *(unsigned int *)&ow_id[0], *(unsigned short *)&ow_id[4]);
|
||||
printf("Setting environment variable 'ow_id' to %s\n", str);
|
||||
setenv("ow_id", str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
onewire, 1, 1, do_onewire,
|
||||
"onewire - Read 1-write ID\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
#endif /* CONFIG_CPCI405AB */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
51
board/esd/dp405/Makefile
Normal file
51
board/esd/dp405/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# (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
|
||||
|
||||
# Objects for Xilinx JTAG programming (CPLD)
|
||||
CPLD = ../common/xilinx_jtag/lenval.o \
|
||||
../common/xilinx_jtag/micro.o \
|
||||
../common/xilinx_jtag/ports.o
|
||||
|
||||
OBJS = $(BOARD).o flash.o $(CPLD)
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
29
board/esd/dp405/config.mk
Normal file
29
board/esd/dp405/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
#
|
||||
# esd VOH405 boards
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
#TEXT_BASE = 0x00FC0000
|
||||
143
board/esd/dp405/dp405.c
Normal file
143
board/esd/dp405/dp405.c
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
|
||||
/* fpga configuration data - not compressed, generated by bin2c */
|
||||
const unsigned char fpgadata[] =
|
||||
{
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
int filesize = sizeof(fpgadata);
|
||||
|
||||
|
||||
int board_pre_init (void)
|
||||
{
|
||||
/*
|
||||
* 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) CAN0; active low; level sensitive
|
||||
* IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
|
||||
* IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
|
||||
* IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
|
||||
* IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
|
||||
* IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
|
||||
* IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
|
||||
*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFF80); /* 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 */
|
||||
|
||||
/*
|
||||
* EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
|
||||
*/
|
||||
mtebc (epcr, 0xa8400000); /* ebc always driven */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
return 0; /* dummy implementation */
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/*
|
||||
* Reset CPLD via GPIO13 (CS4) pin
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~(0x80000000 >> 13));
|
||||
udelay(1000); /* wait 1ms */
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | (0x80000000 >> 13));
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
unsigned char str[64];
|
||||
int i = getenv_r ("serial#", str, sizeof(str));
|
||||
unsigned char trans[16] = {0x0,0x8,0x4,0xc,0x2,0xa,0x6,0xe,
|
||||
0x1,0x9,0x5,0xd,0x3,0xb,0x7,0xf};
|
||||
unsigned char id1, id2;
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming DP405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
id1 = trans[(~(in32(GPIO0_IR) >> 5)) & 0x0000000f];
|
||||
id2 = trans[(~(in32(GPIO0_IR) >> 9)) & 0x0000000f];
|
||||
printf(" (ID=0x%1X%1X)\n", id1, id2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
#if 0
|
||||
printf("\nmb0cf=%x\n", val); /* test-only */
|
||||
printf("strap=%x\n", mfdcr(strap)); /* test-only */
|
||||
#endif
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("test: 16 MB - ok\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
101
board/esd/dp405/flash.c
Normal file
101
board/esd/dp405/flash.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for esd boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
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((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
break;
|
||||
case 2 << 20:
|
||||
size_val = 1;
|
||||
break;
|
||||
case 4 << 20:
|
||||
size_val = 2;
|
||||
break;
|
||||
case 8 << 20:
|
||||
size_val = 3;
|
||||
break;
|
||||
case 16 << 20:
|
||||
size_val = 4;
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
1807
board/esd/dp405/fpgadata.c
Normal file
1807
board/esd/dp405/fpgadata.c
Normal file
File diff suppressed because it is too large
Load Diff
148
board/esd/dp405/u-boot.lds
Normal file
148
board/esd/dp405/u-boot.lds
Normal file
@@ -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)
|
||||
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)
|
||||
cpu/ppc4xx/405gp_enet.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)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
46
board/esd/hub405/Makefile
Normal file
46
board/esd/hub405/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# (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
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
28
board/esd/hub405/config.mk
Normal file
28
board/esd/hub405/config.mk
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
#
|
||||
# esd HUB405 boards
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
101
board/esd/hub405/flash.c
Normal file
101
board/esd/hub405/flash.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for esd boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
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((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
break;
|
||||
case 2 << 20:
|
||||
size_val = 1;
|
||||
break;
|
||||
case 4 << 20:
|
||||
size_val = 2;
|
||||
break;
|
||||
case 8 << 20:
|
||||
size_val = 3;
|
||||
break;
|
||||
case 16 << 20:
|
||||
size_val = 4;
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
166
board/esd/hub405/hub405.c
Normal file
166
board/esd/hub405/hub405.c
Normal file
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
int board_pre_init (void)
|
||||
{
|
||||
/*
|
||||
* 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) CAN0; active low; level sensitive
|
||||
* IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
|
||||
* IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
|
||||
* IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
|
||||
* IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
|
||||
* IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
|
||||
* IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
|
||||
*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFF9F); /* 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 */
|
||||
|
||||
/*
|
||||
* EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
|
||||
*/
|
||||
mtebc (epcr, 0xa8400000); /* ebc always driven */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
return 0; /* dummy implementation */
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
volatile unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
|
||||
volatile unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
|
||||
volatile unsigned char *duart2_mcr = (unsigned char *)((ulong)DUART2_BA + 4);
|
||||
volatile unsigned char *duart3_mcr = (unsigned char *)((ulong)DUART3_BA + 4);
|
||||
|
||||
/*
|
||||
* Reset external DUARTs
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | CFG_DUART_RST); /* set reset to high */
|
||||
udelay(10); /* wait 10us */
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_DUART_RST); /* set reset to low */
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Enable interrupts in exar duart mcr[3]
|
||||
*/
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
*duart2_mcr = 0x08;
|
||||
*duart3_mcr = 0x08;
|
||||
|
||||
/*
|
||||
* Set NAND-FLASH GPIO signals to default
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~(CFG_NAND_CLE | CFG_NAND_ALE));
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND_CE);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
unsigned char str[64];
|
||||
int i = getenv_r ("serial#", str, sizeof(str));
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming HUB405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
putc ('\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
#if 0
|
||||
printf("\nmb0cf=%x\n", val); /* test-only */
|
||||
printf("strap=%x\n", mfdcr(strap)); /* test-only */
|
||||
#endif
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("test: 16 MB - ok\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
#include <linux/mtd/nand.h>
|
||||
extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
|
||||
|
||||
void nand_init(void)
|
||||
{
|
||||
nand_probe(CFG_NAND_BASE);
|
||||
if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
|
||||
print_size(nand_dev_desc[0].totlen, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
147
board/esd/hub405/u-boot.lds
Normal file
147
board/esd/hub405/u-boot.lds
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* (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)
|
||||
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)
|
||||
cpu/ppc4xx/405gp_enet.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)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@@ -107,5 +107,10 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
loadpci, 1, 1, do_loadpci,
|
||||
"loadpci - Wait for pci-image and boot it\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
46
board/esd/plu405/Makefile
Normal file
46
board/esd/plu405/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# (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
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
29
board/esd/plu405/config.mk
Normal file
29
board/esd/plu405/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
#
|
||||
# esd PLU405 boards
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
#TEXT_BASE = 0x00FC0000
|
||||
101
board/esd/plu405/flash.c
Normal file
101
board/esd/plu405/flash.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for esd boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
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((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
break;
|
||||
case 2 << 20:
|
||||
size_val = 1;
|
||||
break;
|
||||
case 4 << 20:
|
||||
size_val = 2;
|
||||
break;
|
||||
case 8 << 20:
|
||||
size_val = 3;
|
||||
break;
|
||||
case 16 << 20:
|
||||
size_val = 4;
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
1160
board/esd/plu405/fpgadata.c
Normal file
1160
board/esd/plu405/fpgadata.c
Normal file
File diff suppressed because it is too large
Load Diff
268
board/esd/plu405/plu405.c
Normal file
268
board/esd/plu405/plu405.c
Normal file
@@ -0,0 +1,268 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if 0
|
||||
#define FPGA_DEBUG
|
||||
#endif
|
||||
|
||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
/* fpga configuration data - gzip compressed and generated by bin2c */
|
||||
const unsigned char fpgadata[] =
|
||||
{
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
|
||||
/*
|
||||
* include common fpga code (for esd boards)
|
||||
*/
|
||||
#include "../common/fpga.c"
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
|
||||
|
||||
int board_pre_init (void)
|
||||
{
|
||||
/*
|
||||
* 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) CAN0; active low; level sensitive
|
||||
* IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
|
||||
* IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
|
||||
* IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
|
||||
* IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
|
||||
* IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
|
||||
* IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
|
||||
*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFF99); /* 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 */
|
||||
|
||||
/*
|
||||
* EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
|
||||
*/
|
||||
mtebc (epcr, 0xa8400000); /* ebc always driven */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
return 0; /* dummy implementation */
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
volatile unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
|
||||
volatile unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
|
||||
unsigned char *dst;
|
||||
ulong len = sizeof(fpgadata);
|
||||
int status;
|
||||
int index;
|
||||
int i;
|
||||
|
||||
#if 1 /* test-only */
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
status = fpga_boot(dst, len);
|
||||
if (status != 0) {
|
||||
printf("\nFPGA: Booting failed ");
|
||||
switch (status) {
|
||||
case ERROR_FPGA_PRG_INIT_LOW:
|
||||
printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_INIT_HIGH:
|
||||
printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_DONE:
|
||||
printf("(Timeout: DONE not high after programming FPGA)\n ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("FPGA: %s\n", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
/* delayed reboot */
|
||||
for (i=20; i>0; i--) {
|
||||
printf("Rebooting in %2d seconds \r",i);
|
||||
for (index=0;index<1000;index++)
|
||||
udelay(1000);
|
||||
}
|
||||
putc ('\n');
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
puts("FPGA: ");
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("%s ", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
|
||||
free(dst);
|
||||
|
||||
/*
|
||||
* Reset FPGA via FPGA_DATA pin
|
||||
*/
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK);
|
||||
udelay(1000); /* wait 1ms */
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Reset external DUARTs
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | CFG_DUART_RST); /* set reset to high */
|
||||
udelay(10); /* wait 10us */
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_DUART_RST); /* set reset to low */
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Set NAND-FLASH GPIO signals to default
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~(CFG_NAND_CLE | CFG_NAND_ALE));
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND_CE);
|
||||
|
||||
/*
|
||||
* Enable interrupts in exar duart mcr[3]
|
||||
*/
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
unsigned char str[64];
|
||||
int i = getenv_r ("serial#", str, sizeof(str));
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming PLU405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
putc ('\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
#if 0
|
||||
printf("\nmb0cf=%x\n", val); /* test-only */
|
||||
printf("strap=%x\n", mfdcr(strap)); /* test-only */
|
||||
#endif
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("test: 16 MB - ok\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef CONFIG_IDE_RESET
|
||||
void ide_set_reset(int on)
|
||||
{
|
||||
volatile unsigned short *fpga_mode =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
|
||||
|
||||
/*
|
||||
* Assert or deassert CompactFlash Reset Pin
|
||||
*/
|
||||
if (on) { /* assert RESET */
|
||||
*fpga_mode &= ~(CFG_FPGA_CTRL_CF_RESET);
|
||||
} else { /* release RESET */
|
||||
*fpga_mode |= CFG_FPGA_CTRL_CF_RESET;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_IDE_RESET */
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
#include <linux/mtd/nand.h>
|
||||
extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
|
||||
|
||||
void nand_init(void)
|
||||
{
|
||||
nand_probe(CFG_NAND_BASE);
|
||||
if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
|
||||
print_size(nand_dev_desc[0].totlen, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
148
board/esd/plu405/u-boot.lds
Normal file
148
board/esd/plu405/u-boot.lds
Normal file
@@ -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)
|
||||
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)
|
||||
cpu/ppc4xx/405gp_enet.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)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@@ -25,7 +25,12 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o strataflash.o
|
||||
# Objects for Xilinx JTAG programming (CPLD)
|
||||
CPLD = ../common/xilinx_jtag/lenval.o \
|
||||
../common/xilinx_jtag/micro.o \
|
||||
../common/xilinx_jtag/ports.o
|
||||
|
||||
OBJS = $(BOARD).o strataflash.o $(CPLD)
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
1348
board/esd/pmc405/fpgadata.c
Normal file
1348
board/esd/pmc405/fpgadata.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -26,11 +26,13 @@
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
/* fpga configuration data - not compressed, generated by bin2c */
|
||||
const unsigned char fpgadata[] =
|
||||
{
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
int filesize = sizeof(fpgadata);
|
||||
|
||||
|
||||
int board_pre_init (void)
|
||||
@@ -74,104 +76,6 @@ int misc_init_f (void)
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
#if 0 /* test-only */
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
volatile unsigned short *fpga_mode =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
|
||||
volatile unsigned char *duart0_mcr =
|
||||
(unsigned char *)((ulong)DUART0_BA + 4);
|
||||
volatile unsigned char *duart1_mcr =
|
||||
(unsigned char *)((ulong)DUART1_BA + 4);
|
||||
bd_t *bd = gd->bd;
|
||||
char * tmp; /* Temporary char pointer */
|
||||
unsigned char *dst;
|
||||
ulong len = sizeof(fpgadata);
|
||||
int status;
|
||||
int index;
|
||||
int i;
|
||||
unsigned long cntrl0Reg;
|
||||
|
||||
/*
|
||||
* Setup GPIO pins (CS6+CS7 as GPIO)
|
||||
*/
|
||||
cntrl0Reg = mfdcr(cntrl0);
|
||||
mtdcr(cntrl0, cntrl0Reg | 0x00300000);
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
status = fpga_boot(dst, len);
|
||||
if (status != 0) {
|
||||
printf("\nFPGA: Booting failed ");
|
||||
switch (status) {
|
||||
case ERROR_FPGA_PRG_INIT_LOW:
|
||||
printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_INIT_HIGH:
|
||||
printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_DONE:
|
||||
printf("(Timeout: DONE not high after programming FPGA)\n ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("FPGA: %s\n", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
/* delayed reboot */
|
||||
for (i=20; i>0; i--) {
|
||||
printf("Rebooting in %2d seconds \r",i);
|
||||
for (index=0;index<1000;index++)
|
||||
udelay(1000);
|
||||
}
|
||||
putc ('\n');
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
/* restore gpio/cs settings */
|
||||
mtdcr(cntrl0, cntrl0Reg);
|
||||
|
||||
puts("FPGA: ");
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("%s ", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
|
||||
free(dst);
|
||||
|
||||
/*
|
||||
* Reset FPGA via FPGA_DATA pin
|
||||
*/
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK);
|
||||
udelay(1000); /* wait 1ms */
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Enable power on PS/2 interface
|
||||
*/
|
||||
*fpga_mode |= CFG_FPGA_CTRL_PS2_RESET;
|
||||
|
||||
/*
|
||||
* Enable interrupts in exar duart mcr[3]
|
||||
*/
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -188,7 +92,7 @@ int checkboard (void)
|
||||
puts ("Board: ");
|
||||
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming ABG405");
|
||||
puts ("### No HW ID - assuming PMC405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
46
board/esd/voh405/Makefile
Normal file
46
board/esd/voh405/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# (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
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
29
board/esd/voh405/config.mk
Normal file
29
board/esd/voh405/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
#
|
||||
# esd VOH405 boards
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
#TEXT_BASE = 0x00FC0000
|
||||
101
board/esd/voh405/flash.c
Normal file
101
board/esd/voh405/flash.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for esd boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
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((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
break;
|
||||
case 2 << 20:
|
||||
size_val = 1;
|
||||
break;
|
||||
case 4 << 20:
|
||||
size_val = 2;
|
||||
break;
|
||||
case 8 << 20:
|
||||
size_val = 3;
|
||||
break;
|
||||
case 16 << 20:
|
||||
size_val = 4;
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
1179
board/esd/voh405/fpgadata.c
Normal file
1179
board/esd/voh405/fpgadata.c
Normal file
File diff suppressed because it is too large
Load Diff
148
board/esd/voh405/u-boot.lds
Normal file
148
board/esd/voh405/u-boot.lds
Normal file
@@ -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)
|
||||
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)
|
||||
cpu/ppc4xx/405gp_enet.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)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
273
board/esd/voh405/voh405.c
Normal file
273
board/esd/voh405/voh405.c
Normal file
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if 0
|
||||
#define FPGA_DEBUG
|
||||
#endif
|
||||
|
||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
/* fpga configuration data - gzip compressed and generated by bin2c */
|
||||
const unsigned char fpgadata[] =
|
||||
{
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
|
||||
/*
|
||||
* include common fpga code (for esd boards)
|
||||
*/
|
||||
#include "../common/fpga.c"
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
|
||||
|
||||
int board_pre_init (void)
|
||||
{
|
||||
/*
|
||||
* 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) CAN0; active low; level sensitive
|
||||
* IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
|
||||
* IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
|
||||
* IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
|
||||
* IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
|
||||
* IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
|
||||
* IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
|
||||
*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFFB5); /* 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 */
|
||||
|
||||
/*
|
||||
* EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
|
||||
*/
|
||||
mtebc (epcr, 0xa8400000); /* ebc always driven */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
return 0; /* dummy implementation */
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
volatile unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
|
||||
volatile unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
|
||||
volatile unsigned short *lcd_reg =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL + 4);
|
||||
unsigned char *dst;
|
||||
ulong len = sizeof(fpgadata);
|
||||
int status;
|
||||
int index;
|
||||
int i;
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
status = fpga_boot(dst, len);
|
||||
if (status != 0) {
|
||||
printf("\nFPGA: Booting failed ");
|
||||
switch (status) {
|
||||
case ERROR_FPGA_PRG_INIT_LOW:
|
||||
printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_INIT_HIGH:
|
||||
printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_DONE:
|
||||
printf("(Timeout: DONE not high after programming FPGA)\n ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("FPGA: %s\n", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
/* delayed reboot */
|
||||
for (i=20; i>0; i--) {
|
||||
printf("Rebooting in %2d seconds \r",i);
|
||||
for (index=0;index<1000;index++)
|
||||
udelay(1000);
|
||||
}
|
||||
putc ('\n');
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
puts("FPGA: ");
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("%s ", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
|
||||
free(dst);
|
||||
|
||||
/*
|
||||
* Reset FPGA via FPGA_DATA pin
|
||||
*/
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK);
|
||||
udelay(1000); /* wait 1ms */
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Reset external DUARTs
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | CFG_DUART_RST); /* set reset to high */
|
||||
udelay(10); /* wait 10us */
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_DUART_RST); /* set reset to low */
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Set NAND-FLASH GPIO signals to default
|
||||
*/
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) & ~(CFG_NAND_CLE | CFG_NAND_ALE));
|
||||
out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND_CE);
|
||||
|
||||
/*
|
||||
* Enable interrupts in exar duart mcr[3]
|
||||
*/
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
|
||||
/*
|
||||
* Set default contrast voltage on epson vga controller
|
||||
*/
|
||||
*lcd_reg = 0x4848;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
unsigned char str[64];
|
||||
int i = getenv_r ("serial#", str, sizeof(str));
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming VOH405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
putc ('\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
#if 0
|
||||
printf("\nmb0cf=%x\n", val); /* test-only */
|
||||
printf("strap=%x\n", mfdcr(strap)); /* test-only */
|
||||
#endif
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("test: 16 MB - ok\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef CONFIG_IDE_RESET
|
||||
void ide_set_reset(int on)
|
||||
{
|
||||
volatile unsigned short *fpga_mode =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
|
||||
|
||||
/*
|
||||
* Assert or deassert CompactFlash Reset Pin
|
||||
*/
|
||||
if (on) { /* assert RESET */
|
||||
*fpga_mode &= ~(CFG_FPGA_CTRL_CF_RESET);
|
||||
} else { /* release RESET */
|
||||
*fpga_mode |= CFG_FPGA_CTRL_CF_RESET;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_IDE_RESET */
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
#include <linux/mtd/nand.h>
|
||||
extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
|
||||
|
||||
void nand_init(void)
|
||||
{
|
||||
nand_probe(CFG_NAND_BASE);
|
||||
if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
|
||||
print_size(nand_dev_desc[0].totlen, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
40
board/etin/debris/Makefile
Normal file
40
board/etin/debris/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (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 phantom.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
31
board/etin/debris/config.mk
Normal file
31
board/etin/debris/config.mk
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001
|
||||
# Sangmoon, Etin Systems, dogoil@etinsys.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
|
||||
#
|
||||
|
||||
#
|
||||
# Debris boards
|
||||
#
|
||||
|
||||
#TEXT_BASE = 0x00090000
|
||||
TEXT_BASE = 0xFFF00000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
|
||||
158
board/etin/debris/debris.c
Normal file
158
board/etin/debris/debris.c
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Sangmoon Kim, Etin Systems. dogoil@etinsys.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc824x.h>
|
||||
#include <pci.h>
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
/*TODO: Check processor type */
|
||||
|
||||
puts ( "Board: Debris "
|
||||
#ifdef CONFIG_MPC8240
|
||||
"8240"
|
||||
#endif
|
||||
#ifdef CONFIG_MPC8245
|
||||
"8245"
|
||||
#endif
|
||||
" ##Test not implemented yet##\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0 /* NOT USED */
|
||||
int checkflash (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("## Test not implemented yet ##\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize PCI Devices, report devices found.
|
||||
*/
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
static struct pci_config_table pci_debris_config_table[] = {
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0f, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x10, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET1_IOADDR,
|
||||
PCI_ENET1_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
struct pci_controller hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table: pci_debris_config_table,
|
||||
#endif
|
||||
};
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
pci_mpc824x_init(&hose);
|
||||
}
|
||||
|
||||
void *nvram_read(void *dest, const long src, size_t count)
|
||||
{
|
||||
volatile uchar *d = (volatile uchar*) dest;
|
||||
volatile uchar *s = (volatile uchar*) src;
|
||||
while(count--) {
|
||||
*d++ = *s++;
|
||||
asm volatile("sync");
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
void nvram_write(long dest, const void *src, size_t count)
|
||||
{
|
||||
volatile uchar *d = (volatile uchar*)dest;
|
||||
volatile uchar *s = (volatile uchar*)src;
|
||||
while(count--) {
|
||||
*d++ = *s++;
|
||||
asm volatile("sync");
|
||||
}
|
||||
}
|
||||
|
||||
int misc_init_r(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* Write ethernet addr in NVRAM for VxWorks */
|
||||
nvram_write(CFG_ENV_ADDR + CFG_NVRAM_VXWORKS_OFFS,
|
||||
(char*)&gd->bd->bi_enetaddr[0], 6);
|
||||
return 0;
|
||||
}
|
||||
720
board/etin/debris/flash.c
Normal file
720
board/etin/debris/flash.c
Normal file
@@ -0,0 +1,720 @@
|
||||
/*
|
||||
* board/eva/flash.c
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sangmoon Kim, Etin Systems, dogoil@etinsys.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/pci_io.h>
|
||||
#include <mpc824x.h>
|
||||
|
||||
int (*do_flash_erase)(flash_info_t*, uint32_t, uint32_t);
|
||||
int (*write_dword)(flash_info_t*, ulong, uint64_t);
|
||||
|
||||
typedef uint64_t cfi_word;
|
||||
|
||||
#define cfi_read(flash, addr) *((volatile cfi_word*)(flash->start[0] + addr))
|
||||
|
||||
#define cfi_write(flash, val, addr) \
|
||||
move64((cfi_word*)&val, \
|
||||
(cfi_word*)(flash->start[0] + addr))
|
||||
|
||||
#define CMD(x) ((((cfi_word)x)<<48)|(((cfi_word)x)<<32)|(((cfi_word)x)<<16)|(((cfi_word)x)))
|
||||
|
||||
static void write32(unsigned long addr, uint32_t value)
|
||||
{
|
||||
*(volatile uint32_t*)(addr) = value;
|
||||
asm volatile("sync");
|
||||
}
|
||||
|
||||
static uint32_t read32(unsigned long addr)
|
||||
{
|
||||
uint32_t value;
|
||||
value = *(volatile uint32_t*)addr;
|
||||
asm volatile("sync");
|
||||
return value;
|
||||
}
|
||||
|
||||
static cfi_word cfi_cmd(flash_info_t *flash, uint8_t cmd, uint32_t addr)
|
||||
{
|
||||
uint32_t base = flash->start[0];
|
||||
uint32_t val=(cmd << 16) | cmd;
|
||||
addr <<= 3;
|
||||
write32(base + addr, val);
|
||||
return addr;
|
||||
}
|
||||
|
||||
static uint16_t cfi_read_query(flash_info_t *flash, uint32_t addr)
|
||||
{
|
||||
uint32_t base = flash->start[0];
|
||||
addr <<= 3;
|
||||
return (uint16_t)read32(base + addr);
|
||||
}
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
static void move64(uint64_t *src, uint64_t *dest)
|
||||
{
|
||||
asm volatile("lfd 0, 0(3)\n\t" /* fpr0 = *scr */
|
||||
"stfd 0, 0(4)" /* *dest = fpr0 */
|
||||
: : : "fr0" ); /* Clobbers fr0 */
|
||||
return;
|
||||
}
|
||||
|
||||
static int cfi_write_dword(flash_info_t *flash, ulong dest, cfi_word data)
|
||||
{
|
||||
unsigned long start;
|
||||
cfi_word status = 0;
|
||||
|
||||
status = cfi_read(flash, dest);
|
||||
data &= status;
|
||||
|
||||
cfi_cmd(flash, 0x40, 0);
|
||||
cfi_write(flash, data, dest);
|
||||
|
||||
udelay(10);
|
||||
start = get_timer (0);
|
||||
for(;;) {
|
||||
status = cfi_read(flash, dest);
|
||||
status &= CMD(0x80);
|
||||
if(status == CMD(0x80))
|
||||
break;
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
return 1;
|
||||
}
|
||||
udelay(1);
|
||||
}
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int jedec_write_dword (flash_info_t *flash, ulong dest, cfi_word data)
|
||||
{
|
||||
ulong start;
|
||||
cfi_word status = 0;
|
||||
|
||||
status = cfi_read(flash, dest);
|
||||
if(status != CMD(0xffff)) return 2;
|
||||
|
||||
cfi_cmd(flash, 0xaa, 0x555);
|
||||
cfi_cmd(flash, 0x55, 0x2aa);
|
||||
cfi_cmd(flash, 0xa0, 0x555);
|
||||
|
||||
cfi_write(flash, data, dest);
|
||||
|
||||
udelay(10);
|
||||
start = get_timer (0);
|
||||
status = ~data;
|
||||
while(status != data) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT)
|
||||
return 1;
|
||||
status = cfi_read(flash, dest);
|
||||
udelay(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
int write_buff (flash_info_t *flash, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong wp;
|
||||
int i, s, l, rc;
|
||||
cfi_word data;
|
||||
uint8_t *t = (uint8_t*)&data;
|
||||
unsigned long base = flash->start[0];
|
||||
uint32_t msr;
|
||||
|
||||
if (flash->flash_id == FLASH_UNKNOWN)
|
||||
return 4;
|
||||
|
||||
if (cnt == 0)
|
||||
return 0;
|
||||
|
||||
addr -= base;
|
||||
|
||||
msr = get_msr();
|
||||
set_msr(msr|MSR_FP);
|
||||
|
||||
wp = (addr & ~7); /* get lower word aligned address */
|
||||
|
||||
if((addr-wp) != 0) {
|
||||
data = cfi_read(flash, wp);
|
||||
s = addr & 7;
|
||||
l = ( cnt < (8-s) ) ? cnt : (8-s);
|
||||
for(i = 0; i < l; i++)
|
||||
t[s+i] = *src++;
|
||||
if ((rc = write_dword(flash, wp, data)) != 0)
|
||||
goto DONE;
|
||||
wp += 8;
|
||||
cnt -= l;
|
||||
}
|
||||
|
||||
while (cnt >= 8) {
|
||||
for (i = 0; i < 8; i++)
|
||||
t[i] = *src++;
|
||||
if ((rc = write_dword(flash, wp, data)) != 0)
|
||||
goto DONE;
|
||||
wp += 8;
|
||||
cnt -= 8;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
rc = 0;
|
||||
goto DONE;
|
||||
}
|
||||
|
||||
data = cfi_read(flash, wp);
|
||||
for(i = 0; i < cnt; i++)
|
||||
t[i] = *src++;
|
||||
rc = write_dword(flash, wp, data);
|
||||
DONE:
|
||||
set_msr(msr);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int cfi_erase_oneblock(flash_info_t *flash, uint32_t sect)
|
||||
{
|
||||
int sa;
|
||||
int flag;
|
||||
ulong start, last, now;
|
||||
cfi_word status;
|
||||
|
||||
flag = disable_interrupts();
|
||||
|
||||
sa = (flash->start[sect] - flash->start[0]);
|
||||
write32(flash->start[sect], 0x00200020);
|
||||
write32(flash->start[sect], 0x00d000d0);
|
||||
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
udelay(1000);
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
for (;;) {
|
||||
status = cfi_read(flash, sa);
|
||||
status &= CMD(0x80);
|
||||
if (status == CMD(0x80))
|
||||
break;
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
printf ("Timeout\n");
|
||||
return ERR_TIMOUT;
|
||||
}
|
||||
|
||||
if ((now - last) > 1000) {
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
udelay(10);
|
||||
}
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
static int cfi_erase(flash_info_t *flash, uint32_t s_first, uint32_t s_last)
|
||||
{
|
||||
int sect;
|
||||
int rc = ERR_OK;
|
||||
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (flash->protect[sect] == 0) {
|
||||
rc = cfi_erase_oneblock(flash, sect);
|
||||
if (rc != ERR_OK) break;
|
||||
}
|
||||
}
|
||||
printf (" done\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int jedec_erase(flash_info_t *flash, uint32_t s_first, uint32_t s_last)
|
||||
{
|
||||
int sect;
|
||||
cfi_word status;
|
||||
int sa = -1;
|
||||
int flag;
|
||||
ulong start, last, now;
|
||||
|
||||
flag = disable_interrupts();
|
||||
|
||||
cfi_cmd(flash, 0xaa, 0x555);
|
||||
cfi_cmd(flash, 0x55, 0x2aa);
|
||||
cfi_cmd(flash, 0x80, 0x555);
|
||||
cfi_cmd(flash, 0xaa, 0x555);
|
||||
cfi_cmd(flash, 0x55, 0x2aa);
|
||||
for ( sect = s_first; sect <= s_last; sect++) {
|
||||
if (flash->protect[sect] == 0) {
|
||||
sa = flash->start[sect] - flash->start[0];
|
||||
write32(flash->start[sect], 0x00300030);
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
if (sa < 0)
|
||||
goto DONE;
|
||||
|
||||
udelay (1000);
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
for(;;) {
|
||||
status = cfi_read(flash, sa);
|
||||
if (status == CMD(0xffff))
|
||||
break;
|
||||
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return ERR_TIMOUT;
|
||||
}
|
||||
|
||||
if ((now - last) > 1000) {
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
udelay(10);
|
||||
}
|
||||
DONE:
|
||||
cfi_cmd(flash, 0xf0, 0);
|
||||
|
||||
printf (" done\n");
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
int flash_erase (flash_info_t *flash, int s_first, int s_last)
|
||||
{
|
||||
int sect;
|
||||
int prot;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (flash->flash_id == FLASH_UNKNOWN)
|
||||
printf ("- missing\n");
|
||||
else
|
||||
printf ("- no sectors to erase\n");
|
||||
return ERR_NOT_ERASED;
|
||||
}
|
||||
if (flash->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return ERR_NOT_ERASED;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; sect++)
|
||||
if (flash->protect[sect]) prot++;
|
||||
|
||||
if (prot)
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
else
|
||||
printf ("\n");
|
||||
|
||||
return do_flash_erase(flash, s_first, s_last);
|
||||
}
|
||||
|
||||
struct jedec_flash_info {
|
||||
const uint16_t mfr_id;
|
||||
const uint16_t dev_id;
|
||||
const char *name;
|
||||
const int DevSize;
|
||||
const int InterfaceDesc;
|
||||
const int NumEraseRegions;
|
||||
const ulong regions[4];
|
||||
};
|
||||
|
||||
#define ERASEINFO(size,blocks) (size<<8)|(blocks-1)
|
||||
|
||||
#define SIZE_1MiB 20
|
||||
#define SIZE_2MiB 21
|
||||
#define SIZE_4MiB 22
|
||||
|
||||
static const struct jedec_flash_info jedec_table[] = {
|
||||
{
|
||||
mfr_id: (uint16_t)AMD_MANUFACT,
|
||||
dev_id: (uint16_t)AMD_ID_LV800T,
|
||||
name: "AMD AM29LV800T",
|
||||
DevSize: SIZE_1MiB,
|
||||
NumEraseRegions: 4,
|
||||
regions: {ERASEINFO(0x10000,15),
|
||||
ERASEINFO(0x08000,1),
|
||||
ERASEINFO(0x02000,2),
|
||||
ERASEINFO(0x04000,1)
|
||||
}
|
||||
}, {
|
||||
mfr_id: (uint16_t)AMD_MANUFACT,
|
||||
dev_id: (uint16_t)AMD_ID_LV800B,
|
||||
name: "AMD AM29LV800B",
|
||||
DevSize: SIZE_1MiB,
|
||||
NumEraseRegions: 4,
|
||||
regions: {ERASEINFO(0x10000,15),
|
||||
ERASEINFO(0x08000,1),
|
||||
ERASEINFO(0x02000,2),
|
||||
ERASEINFO(0x04000,1)
|
||||
}
|
||||
}, {
|
||||
mfr_id: (uint16_t)AMD_MANUFACT,
|
||||
dev_id: (uint16_t)AMD_ID_LV160T,
|
||||
name: "AMD AM29LV160T",
|
||||
DevSize: SIZE_2MiB,
|
||||
NumEraseRegions: 4,
|
||||
regions: {ERASEINFO(0x10000,31),
|
||||
ERASEINFO(0x08000,1),
|
||||
ERASEINFO(0x02000,2),
|
||||
ERASEINFO(0x04000,1)
|
||||
}
|
||||
}, {
|
||||
mfr_id: (uint16_t)AMD_MANUFACT,
|
||||
dev_id: (uint16_t)AMD_ID_LV160B,
|
||||
name: "AMD AM29LV160B",
|
||||
DevSize: SIZE_2MiB,
|
||||
NumEraseRegions: 4,
|
||||
regions: {ERASEINFO(0x04000,1),
|
||||
ERASEINFO(0x02000,2),
|
||||
ERASEINFO(0x08000,1),
|
||||
ERASEINFO(0x10000,31)
|
||||
}
|
||||
}, {
|
||||
mfr_id: (uint16_t)AMD_MANUFACT,
|
||||
dev_id: (uint16_t)AMD_ID_LV320T,
|
||||
name: "AMD AM29LV320T",
|
||||
DevSize: SIZE_4MiB,
|
||||
NumEraseRegions: 2,
|
||||
regions: {ERASEINFO(0x10000,63),
|
||||
ERASEINFO(0x02000,8)
|
||||
}
|
||||
|
||||
}, {
|
||||
mfr_id: (uint16_t)AMD_MANUFACT,
|
||||
dev_id: (uint16_t)AMD_ID_LV320B,
|
||||
name: "AMD AM29LV320B",
|
||||
DevSize: SIZE_4MiB,
|
||||
NumEraseRegions: 2,
|
||||
regions: {ERASEINFO(0x02000,8),
|
||||
ERASEINFO(0x10000,63)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static ulong cfi_init(uint32_t base, flash_info_t *flash)
|
||||
{
|
||||
int sector;
|
||||
int block;
|
||||
int block_count;
|
||||
int offset = 0;
|
||||
int reverse = 0;
|
||||
int primary;
|
||||
int mfr_id;
|
||||
int dev_id;
|
||||
|
||||
flash->start[0] = base;
|
||||
cfi_cmd(flash, 0xF0, 0);
|
||||
cfi_cmd(flash, 0x98, 0);
|
||||
if ( !( cfi_read_query(flash, 0x10) == 'Q' &&
|
||||
cfi_read_query(flash, 0x11) == 'R' &&
|
||||
cfi_read_query(flash, 0x12) == 'Y' )) {
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
flash->size = 1 << cfi_read_query(flash, 0x27);
|
||||
flash->size *= 4;
|
||||
block_count = cfi_read_query(flash, 0x2c);
|
||||
primary = cfi_read_query(flash, 0x15);
|
||||
if ( cfi_read_query(flash, primary + 4) == 0x30)
|
||||
reverse = (cfi_read_query(flash, 0x1) & 0x01);
|
||||
else
|
||||
reverse = (cfi_read_query(flash, primary+15) == 3);
|
||||
|
||||
flash->sector_count = 0;
|
||||
|
||||
for ( block = reverse ? block_count - 1 : 0;
|
||||
reverse ? block >= 0 : block < block_count;
|
||||
reverse ? block-- : block ++) {
|
||||
int sector_size =
|
||||
(cfi_read_query(flash, 0x2d + block*4+2) |
|
||||
(cfi_read_query(flash, 0x2d + block*4+3) << 8)) << 8;
|
||||
int sector_count =
|
||||
(cfi_read_query(flash, 0x2d + block*4+0) |
|
||||
(cfi_read_query(flash, 0x2d + block*4+1) << 8)) + 1;
|
||||
for(sector = 0; sector < sector_count; sector++) {
|
||||
flash->start[flash->sector_count++] = base + offset;
|
||||
offset += sector_size * 4;
|
||||
}
|
||||
}
|
||||
mfr_id = cfi_read_query(flash, 0x00);
|
||||
dev_id = cfi_read_query(flash, 0x01);
|
||||
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
|
||||
flash->flash_id = (mfr_id << 16) | dev_id;
|
||||
|
||||
for (sector = 0; sector < flash->sector_count; sector++) {
|
||||
write32(flash->start[sector], 0x00600060);
|
||||
write32(flash->start[sector], 0x00d000d0);
|
||||
}
|
||||
cfi_cmd(flash, 0xff, 0);
|
||||
|
||||
for (sector = 0; sector < flash->sector_count; sector++)
|
||||
flash->protect[sector] = 0;
|
||||
|
||||
do_flash_erase = cfi_erase;
|
||||
write_dword = cfi_write_dword;
|
||||
|
||||
return flash->size;
|
||||
}
|
||||
|
||||
static ulong jedec_init(unsigned long base, flash_info_t *flash)
|
||||
{
|
||||
int i;
|
||||
int block, block_count;
|
||||
int sector, offset;
|
||||
int mfr_id, dev_id;
|
||||
flash->start[0] = base;
|
||||
cfi_cmd(flash, 0xF0, 0x000);
|
||||
cfi_cmd(flash, 0xAA, 0x555);
|
||||
cfi_cmd(flash, 0x55, 0x2AA);
|
||||
cfi_cmd(flash, 0x90, 0x555);
|
||||
mfr_id = cfi_read_query(flash, 0x000);
|
||||
dev_id = cfi_read_query(flash, 0x0001);
|
||||
cfi_cmd(flash, 0xf0, 0x000);
|
||||
|
||||
for(i=0; i<sizeof(jedec_table)/sizeof(struct jedec_flash_info); i++) {
|
||||
if((jedec_table[i].mfr_id == mfr_id) &&
|
||||
(jedec_table[i].dev_id == dev_id)) {
|
||||
|
||||
flash->flash_id = (mfr_id << 16) | dev_id;
|
||||
flash->size = 1 << jedec_table[0].DevSize;
|
||||
flash->size *= 4;
|
||||
block_count = jedec_table[i].NumEraseRegions;
|
||||
offset = 0;
|
||||
flash->sector_count = 0;
|
||||
for (block = 0; block < block_count; block++) {
|
||||
int sector_size = jedec_table[i].regions[block];
|
||||
int sector_count = (sector_size & 0xff) + 1;
|
||||
sector_size >>= 8;
|
||||
for (sector=0; sector<sector_count; sector++) {
|
||||
flash->start[flash->sector_count++] =
|
||||
base + offset;
|
||||
offset += sector_size * 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (sector = 0; sector < flash->sector_count; sector++)
|
||||
flash->protect[sector] = 0;
|
||||
|
||||
do_flash_erase = jedec_erase;
|
||||
write_dword = jedec_write_dword;
|
||||
|
||||
return flash->size;
|
||||
}
|
||||
|
||||
inline void mtibat1u(unsigned int x)
|
||||
{
|
||||
__asm__ __volatile__ ("mtspr 530, %0" :: "r" (x));
|
||||
}
|
||||
|
||||
inline void mtibat1l(unsigned int x)
|
||||
{
|
||||
__asm__ __volatile__ ("mtspr 531, %0" :: "r" (x));
|
||||
}
|
||||
|
||||
inline void mtdbat1u(unsigned int x)
|
||||
{
|
||||
__asm__ __volatile__ ("mtspr 538, %0" :: "r" (x));
|
||||
}
|
||||
|
||||
inline void mtdbat1l(unsigned int x)
|
||||
{
|
||||
__asm__ __volatile__ ("mtspr 539, %0" :: "r" (x));
|
||||
}
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size = 0;
|
||||
int i;
|
||||
unsigned int msr;
|
||||
|
||||
/* BAT1 */
|
||||
CONFIG_WRITE_WORD(ERCR3, 0x0C00000C);
|
||||
CONFIG_WRITE_WORD(ERCR4, 0x0800000C);
|
||||
msr = get_msr();
|
||||
set_msr(msr & ~(MSR_IR | MSR_DR));
|
||||
mtibat1l(0x70000000 | BATL_PP_10 | BATL_CACHEINHIBIT);
|
||||
mtibat1u(0x70000000 | BATU_BL_256M | BATU_VS | BATU_VP);
|
||||
mtdbat1l(0x70000000 | BATL_PP_10 | BATL_CACHEINHIBIT);
|
||||
mtdbat1u(0x70000000 | BATU_BL_256M | BATU_VS | BATU_VP);
|
||||
set_msr(msr);
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++)
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
size = cfi_init(FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
if (!size)
|
||||
size = jedec_init(FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN)
|
||||
printf ("# Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
|
||||
size, size<<20);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
void flash_print_info (flash_info_t *flash)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int size;
|
||||
int erased;
|
||||
volatile unsigned long *p;
|
||||
|
||||
if (flash->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
flash_init();
|
||||
}
|
||||
|
||||
if (flash->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (((flash->flash_id) >> 16) & 0xff) {
|
||||
case 0x01:
|
||||
printf ("AMD ");
|
||||
break;
|
||||
case 0x04:
|
||||
printf("FUJITSU ");
|
||||
break;
|
||||
case 0x20:
|
||||
printf("STM ");
|
||||
break;
|
||||
case 0xBF:
|
||||
printf("SST ");
|
||||
break;
|
||||
case 0x89:
|
||||
case 0xB0:
|
||||
printf("INTEL ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((flash->flash_id) & 0xffff) {
|
||||
case (uint16_t)AMD_ID_LV800T:
|
||||
printf ("AM29LV800T\n");
|
||||
break;
|
||||
case (uint16_t)AMD_ID_LV800B:
|
||||
printf ("AM29LV800B\n");
|
||||
break;
|
||||
case (uint16_t)AMD_ID_LV160T:
|
||||
printf ("AM29LV160T\n");
|
||||
break;
|
||||
case (uint16_t)AMD_ID_LV160B:
|
||||
printf ("AM29LV160B\n");
|
||||
break;
|
||||
case (uint16_t)AMD_ID_LV320T:
|
||||
printf ("AM29LV320T\n");
|
||||
break;
|
||||
case (uint16_t)AMD_ID_LV320B:
|
||||
printf ("AM29LV320B\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F800C3T:
|
||||
printf ("28F800C3T\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F800C3B:
|
||||
printf ("28F800C3B\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F160C3T:
|
||||
printf ("28F160C3T\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F160C3B:
|
||||
printf ("28F160C3B\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F320C3T:
|
||||
printf ("28F320C3T\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F320C3B:
|
||||
printf ("28F320C3B\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F640C3T:
|
||||
printf ("28F640C3T\n");
|
||||
break;
|
||||
case (uint16_t)INTEL_ID_28F640C3B:
|
||||
printf ("28F640C3B\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (flash->size >= (1 << 20)) {
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
flash->size >> 20, flash->sector_count);
|
||||
} else {
|
||||
printf (" Size: %ld kB in %d Sectors\n",
|
||||
flash->size >> 10, flash->sector_count);
|
||||
}
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < flash->sector_count; ++i) {
|
||||
/* Check if whole sector is erased*/
|
||||
if (i != (flash->sector_count-1))
|
||||
size = flash->start[i+1] - flash->start[i];
|
||||
else
|
||||
size = flash->start[0] + flash->size - flash->start[i];
|
||||
|
||||
erased = 1;
|
||||
p = (volatile unsigned long *)flash->start[i];
|
||||
size = size >> 2; /* divide by 4 for longword access */
|
||||
for (k=0; k<size; k++) {
|
||||
if (*p++ != 0xffffffff) {
|
||||
erased = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
|
||||
printf (" %08lX%s%s",
|
||||
flash->start[i],
|
||||
erased ? " E" : " ",
|
||||
flash->protect[i] ? "RO " : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
310
board/etin/debris/phantom.c
Normal file
310
board/etin/debris/phantom.c
Normal file
@@ -0,0 +1,310 @@
|
||||
/*
|
||||
* board/eva/phantom.c
|
||||
*
|
||||
* Phantom RTC device driver for EVA
|
||||
*
|
||||
* Author: Sangmoon Kim
|
||||
* dogoil@etinsys.com
|
||||
*
|
||||
* Copyright 2002 Etinsys Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <rtc.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_DATE)
|
||||
|
||||
#define RTC_BASE (CFG_NVRAM_BASE_ADDR + 0x7fff8)
|
||||
|
||||
#define RTC_YEAR ( RTC_BASE + 7 )
|
||||
#define RTC_MONTH ( RTC_BASE + 6 )
|
||||
#define RTC_DAY_OF_MONTH ( RTC_BASE + 5 )
|
||||
#define RTC_DAY_OF_WEEK ( RTC_BASE + 4 )
|
||||
#define RTC_HOURS ( RTC_BASE + 3 )
|
||||
#define RTC_MINUTES ( RTC_BASE + 2 )
|
||||
#define RTC_SECONDS ( RTC_BASE + 1 )
|
||||
#define RTC_CENTURY ( RTC_BASE + 0 )
|
||||
|
||||
#define RTC_CONTROLA RTC_CENTURY
|
||||
#define RTC_CONTROLB RTC_SECONDS
|
||||
#define RTC_CONTROLC RTC_DAY_OF_WEEK
|
||||
|
||||
#define RTC_CA_WRITE 0x80
|
||||
#define RTC_CA_READ 0x40
|
||||
|
||||
#define RTC_CB_OSC_DISABLE 0x80
|
||||
|
||||
#define RTC_CC_BATTERY_FLAG 0x80
|
||||
#define RTC_CC_FREQ_TEST 0x40
|
||||
|
||||
|
||||
static int phantom_flag = -1;
|
||||
static int century_flag = -1;
|
||||
|
||||
static uchar rtc_read(unsigned int addr)
|
||||
{
|
||||
return *(volatile unsigned char *)(addr);
|
||||
}
|
||||
|
||||
static void rtc_write(unsigned int addr, uchar val)
|
||||
{
|
||||
*(volatile unsigned char *)(addr) = val;
|
||||
}
|
||||
|
||||
static unsigned char phantom_rtc_sequence[] = {
|
||||
0xc5, 0x3a, 0xa3, 0x5c, 0xc5, 0x3a, 0xa3, 0x5c
|
||||
};
|
||||
|
||||
static unsigned char* phantom_rtc_read(int addr, unsigned char rtc[8])
|
||||
{
|
||||
int i, j;
|
||||
unsigned char v;
|
||||
unsigned char save = rtc_read(addr);
|
||||
|
||||
for (j = 0; j < 8; j++) {
|
||||
v = phantom_rtc_sequence[j];
|
||||
for (i = 0; i < 8; i++) {
|
||||
rtc_write(addr, v & 1);
|
||||
v >>= 1;
|
||||
}
|
||||
}
|
||||
for (j = 0; j < 8; j++) {
|
||||
v = 0;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if(rtc_read(addr) & 1)
|
||||
v |= 1 << i;
|
||||
}
|
||||
rtc[j] = v;
|
||||
}
|
||||
rtc_write(addr, save);
|
||||
return rtc;
|
||||
}
|
||||
|
||||
static void phantom_rtc_write(int addr, unsigned char rtc[8])
|
||||
{
|
||||
int i, j;
|
||||
unsigned char v;
|
||||
unsigned char save = rtc_read(addr);
|
||||
for (j = 0; j < 8; j++) {
|
||||
v = phantom_rtc_sequence[j];
|
||||
for (i = 0; i < 8; i++) {
|
||||
rtc_write(addr, v & 1);
|
||||
v >>= 1;
|
||||
}
|
||||
}
|
||||
for (j = 0; j < 8; j++) {
|
||||
v = rtc[j];
|
||||
for (i = 0; i < 8; i++) {
|
||||
rtc_write(addr, v & 1);
|
||||
v >>= 1;
|
||||
}
|
||||
}
|
||||
rtc_write(addr, save);
|
||||
}
|
||||
|
||||
static int get_phantom_flag(void)
|
||||
{
|
||||
int i;
|
||||
unsigned char rtc[8];
|
||||
|
||||
phantom_rtc_read(RTC_BASE, rtc);
|
||||
|
||||
for(i = 1; i < 8; i++) {
|
||||
if (rtc[i] != rtc[0])
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rtc_reset(void)
|
||||
{
|
||||
if (phantom_flag < 0)
|
||||
phantom_flag = get_phantom_flag();
|
||||
|
||||
if (phantom_flag) {
|
||||
unsigned char rtc[8];
|
||||
phantom_rtc_read(RTC_BASE, rtc);
|
||||
if(rtc[4] & 0x30) {
|
||||
printf( "real-time-clock was stopped. Now starting...\n" );
|
||||
rtc[4] &= 0x07;
|
||||
phantom_rtc_write(RTC_BASE, rtc);
|
||||
}
|
||||
} else {
|
||||
uchar reg_a, reg_b, reg_c;
|
||||
reg_a = rtc_read( RTC_CONTROLA );
|
||||
reg_b = rtc_read( RTC_CONTROLB );
|
||||
|
||||
if ( reg_b & RTC_CB_OSC_DISABLE )
|
||||
{
|
||||
printf( "real-time-clock was stopped. Now starting...\n" );
|
||||
reg_a |= RTC_CA_WRITE;
|
||||
reg_b &= ~RTC_CB_OSC_DISABLE;
|
||||
rtc_write( RTC_CONTROLA, reg_a );
|
||||
rtc_write( RTC_CONTROLB, reg_b );
|
||||
}
|
||||
|
||||
/* make sure read/write clock register bits are cleared */
|
||||
reg_a &= ~( RTC_CA_WRITE | RTC_CA_READ );
|
||||
rtc_write( RTC_CONTROLA, reg_a );
|
||||
|
||||
reg_c = rtc_read( RTC_CONTROLC );
|
||||
if (( reg_c & RTC_CC_BATTERY_FLAG ) == 0 )
|
||||
printf( "RTC battery low. Clock setting may not be reliable.\n");
|
||||
}
|
||||
}
|
||||
|
||||
inline unsigned bcd2bin (uchar n)
|
||||
{
|
||||
return ((((n >> 4) & 0x0F) * 10) + (n & 0x0F));
|
||||
}
|
||||
|
||||
inline unsigned char bin2bcd (unsigned int n)
|
||||
{
|
||||
return (((n / 10) << 4) | (n % 10));
|
||||
}
|
||||
|
||||
static int get_century_flag(void)
|
||||
{
|
||||
int flag = 0;
|
||||
int bcd, century;
|
||||
bcd = rtc_read( RTC_CENTURY );
|
||||
century = bcd2bin( bcd & 0x3F );
|
||||
rtc_write( RTC_CENTURY, bin2bcd(century+1));
|
||||
if (bcd == rtc_read( RTC_CENTURY ))
|
||||
flag = 1;
|
||||
rtc_write( RTC_CENTURY, bcd);
|
||||
return flag;
|
||||
}
|
||||
|
||||
void rtc_get( struct rtc_time *tmp)
|
||||
{
|
||||
if (phantom_flag < 0)
|
||||
phantom_flag = get_phantom_flag();
|
||||
|
||||
if (phantom_flag)
|
||||
{
|
||||
unsigned char rtc[8];
|
||||
|
||||
phantom_rtc_read(RTC_BASE, rtc);
|
||||
|
||||
tmp->tm_sec = bcd2bin(rtc[1] & 0x7f);
|
||||
tmp->tm_min = bcd2bin(rtc[2] & 0x7f);
|
||||
tmp->tm_hour = bcd2bin(rtc[3] & 0x1f);
|
||||
tmp->tm_wday = bcd2bin(rtc[4] & 0x7);
|
||||
tmp->tm_mday = bcd2bin(rtc[5] & 0x3f);
|
||||
tmp->tm_mon = bcd2bin(rtc[6] & 0x1f);
|
||||
tmp->tm_year = bcd2bin(rtc[7]) + 1900;
|
||||
tmp->tm_yday = 0;
|
||||
tmp->tm_isdst = 0;
|
||||
|
||||
if( (rtc[3] & 0x80) && (rtc[3] & 0x40) ) tmp->tm_hour += 12;
|
||||
if (tmp->tm_year < 1970) tmp->tm_year += 100;
|
||||
} else {
|
||||
uchar sec, min, hour;
|
||||
uchar mday, wday, mon, year;
|
||||
|
||||
int century;
|
||||
|
||||
uchar reg_a;
|
||||
|
||||
if (century_flag < 0)
|
||||
century_flag = get_century_flag();
|
||||
|
||||
reg_a = rtc_read( RTC_CONTROLA );
|
||||
/* lock clock registers for read */
|
||||
rtc_write( RTC_CONTROLA, ( reg_a | RTC_CA_READ ));
|
||||
|
||||
sec = rtc_read( RTC_SECONDS );
|
||||
min = rtc_read( RTC_MINUTES );
|
||||
hour = rtc_read( RTC_HOURS );
|
||||
mday = rtc_read( RTC_DAY_OF_MONTH );
|
||||
wday = rtc_read( RTC_DAY_OF_WEEK );
|
||||
mon = rtc_read( RTC_MONTH );
|
||||
year = rtc_read( RTC_YEAR );
|
||||
century = rtc_read( RTC_CENTURY );
|
||||
|
||||
/* unlock clock registers after read */
|
||||
rtc_write( RTC_CONTROLA, ( reg_a & ~RTC_CA_READ ));
|
||||
|
||||
tmp->tm_sec = bcd2bin( sec & 0x7F );
|
||||
tmp->tm_min = bcd2bin( min & 0x7F );
|
||||
tmp->tm_hour = bcd2bin( hour & 0x3F );
|
||||
tmp->tm_mday = bcd2bin( mday & 0x3F );
|
||||
tmp->tm_mon = bcd2bin( mon & 0x1F );
|
||||
tmp->tm_wday = bcd2bin( wday & 0x07 );
|
||||
|
||||
if (century_flag) {
|
||||
tmp->tm_year = bcd2bin( year ) +
|
||||
( bcd2bin( century & 0x3F ) * 100 );
|
||||
} else {
|
||||
tmp->tm_year = bcd2bin( year ) + 1900;
|
||||
if (tmp->tm_year < 1970) tmp->tm_year += 100;
|
||||
}
|
||||
|
||||
tmp->tm_yday = 0;
|
||||
tmp->tm_isdst= 0;
|
||||
}
|
||||
}
|
||||
|
||||
void rtc_set( struct rtc_time *tmp )
|
||||
{
|
||||
if (phantom_flag < 0)
|
||||
phantom_flag = get_phantom_flag();
|
||||
|
||||
if (phantom_flag) {
|
||||
uint year;
|
||||
unsigned char rtc[8];
|
||||
|
||||
year = tmp->tm_year;
|
||||
year -= (year < 2000) ? 1900 : 2000;
|
||||
|
||||
rtc[0] = bin2bcd(0);
|
||||
rtc[1] = bin2bcd(tmp->tm_sec);
|
||||
rtc[2] = bin2bcd(tmp->tm_min);
|
||||
rtc[3] = bin2bcd(tmp->tm_hour);
|
||||
rtc[4] = bin2bcd(tmp->tm_wday);
|
||||
rtc[5] = bin2bcd(tmp->tm_mday);
|
||||
rtc[6] = bin2bcd(tmp->tm_mon);
|
||||
rtc[7] = bin2bcd(year);
|
||||
|
||||
phantom_rtc_write(RTC_BASE, rtc);
|
||||
} else {
|
||||
uchar reg_a;
|
||||
if (century_flag < 0)
|
||||
century_flag = get_century_flag();
|
||||
|
||||
/* lock clock registers for write */
|
||||
reg_a = rtc_read( RTC_CONTROLA );
|
||||
rtc_write( RTC_CONTROLA, ( reg_a | RTC_CA_WRITE ));
|
||||
|
||||
rtc_write( RTC_MONTH, bin2bcd( tmp->tm_mon ));
|
||||
|
||||
rtc_write( RTC_DAY_OF_WEEK, bin2bcd( tmp->tm_wday ));
|
||||
rtc_write( RTC_DAY_OF_MONTH, bin2bcd( tmp->tm_mday ));
|
||||
rtc_write( RTC_HOURS, bin2bcd( tmp->tm_hour ));
|
||||
rtc_write( RTC_MINUTES, bin2bcd( tmp->tm_min ));
|
||||
rtc_write( RTC_SECONDS, bin2bcd( tmp->tm_sec ));
|
||||
|
||||
/* break year up into century and year in century */
|
||||
if (century_flag) {
|
||||
rtc_write( RTC_YEAR, bin2bcd( tmp->tm_year % 100 ));
|
||||
rtc_write( RTC_CENTURY, bin2bcd( tmp->tm_year / 100 ));
|
||||
reg_a &= 0xc0;
|
||||
reg_a |= bin2bcd( tmp->tm_year / 100 );
|
||||
} else {
|
||||
rtc_write(RTC_YEAR, bin2bcd(tmp->tm_year -
|
||||
((tmp->tm_year < 2000) ? 1900 : 2000)));
|
||||
}
|
||||
|
||||
/* unlock clock registers after read */
|
||||
rtc_write( RTC_CONTROLA, ( reg_a & ~RTC_CA_WRITE ));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
54
board/etin/debris/speed.h
Normal file
54
board/etin/debris/speed.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* (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
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Timer value for timer 2, ICLK = 10
|
||||
*
|
||||
* SPEED_FCOUNT2 = GCLK / (16 * (TIMER_TMR_PS + 1))
|
||||
* SPEED_TMR3_PS = (GCLK / (16 * SPEED_FCOUNT3)) - 1
|
||||
*
|
||||
* SPEED_FCOUNT2 timer 2 counting frequency
|
||||
* GCLK CPU clock
|
||||
* SPEED_TMR2_PS prescaler
|
||||
*/
|
||||
#define SPEED_TMR2_PS (250 - 1) /* divide by 250 */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Timer value for PIT
|
||||
*
|
||||
* PIT_TIME = SPEED_PITC / PITRTCLK
|
||||
* PITRTCLK = 8192
|
||||
*/
|
||||
#define SPEED_PITC (82 << 16) /* start counting from 82 */
|
||||
|
||||
/*
|
||||
* The new value for 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)
|
||||
* DFBRG For normal mode (no clock reduction) always 0
|
||||
* PTP Prescaler (already adjusted for no. of banks and 4K / 8K refresh)
|
||||
* NCS Number of SDRAM banks (chip selects) on this UPM.
|
||||
*/
|
||||
128
board/etin/debris/u-boot.lds
Normal file
128
board/etin/debris/u-boot.lds
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* (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)
|
||||
|
||||
. = 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 = .);
|
||||
}
|
||||
@@ -321,8 +321,8 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
volatile long int *addr;
|
||||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
ulong cnt, val, size;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
@@ -341,7 +341,13 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
/* Restore the original data before leaving the function.
|
||||
*/
|
||||
*addr = save[i];
|
||||
for (cnt = 1; cnt <= maxsize / sizeof(long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -352,7 +358,14 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
size = cnt * sizeof (long);
|
||||
/* Restore the original data before returning
|
||||
*/
|
||||
for (cnt <<= 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt;
|
||||
*addr = save[--i];
|
||||
}
|
||||
return (size);
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
|
||||
@@ -79,7 +79,11 @@ flash_init (void)
|
||||
size_b0 = flash_get_size(CFG_BOOT_FLASH_WIDTH, (vu_long *)base,
|
||||
&flash_info[0]);
|
||||
|
||||
printf("[%ldkB@%lx] ", size_b0/1024, base);
|
||||
#ifndef CONFIG_P3G4
|
||||
printf("[");
|
||||
print_size (size_b0, "");
|
||||
printf("@%08lX] ", base);
|
||||
#endif
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH at %08lx: Size = 0x%08lx = %ld MB\n",
|
||||
@@ -90,7 +94,11 @@ flash_init (void)
|
||||
for(i=1;i<CFG_MAX_FLASH_BANKS;i++) {
|
||||
unsigned long size = flash_get_size(CFG_EXTRA_FLASH_WIDTH, (vu_long *)base, &flash_info[i]);
|
||||
|
||||
printf("[%ldMB@%lx] ", size>>20, base);
|
||||
#ifndef CONFIG_P3G4
|
||||
printf("[");
|
||||
print_size (size, "");
|
||||
printf("@%08lX] ", base);
|
||||
#endif
|
||||
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
if(i==1) {
|
||||
|
||||
@@ -123,7 +123,7 @@ static flash_info_t *flash_get_info(ulong base)
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i ++) {
|
||||
info = & flash_info[i];
|
||||
if (info->size &&
|
||||
if (info->size &&
|
||||
info->start[0] <= base && base <= info->start[0] + info->size - 1)
|
||||
break;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
addr2 = (FPW *)((ulong)addr | 0x800000);
|
||||
if (addr2 != addr &&
|
||||
((addr2[0] & 0xff) == (addr[0] & 0xff)) && ((FPW)addr2[1] == (FPW)addr[1])) {
|
||||
/* Seems 2 banks are the same space (8Mb chip is installed,
|
||||
/* Seems 2 banks are the same space (8Mb chip is installed,
|
||||
* J24 in default position (CS0)). Disable this (first) bank.
|
||||
*/
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
|
||||
@@ -174,9 +174,9 @@ void flash_preinit(void)
|
||||
void flash_afterinit(ulong size)
|
||||
{
|
||||
if (size == 0x800000) { /* adjust mapping */
|
||||
*(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
|
||||
*(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
|
||||
START_REG(CFG_BOOTCS_START | size);
|
||||
*(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
|
||||
*(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
|
||||
STOP_REG(CFG_BOOTCS_START | size, size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ ulong flash_init(void)
|
||||
else if (i == 1)
|
||||
flashbase = PHYS_FLASH_2;
|
||||
else
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
for (j = 0; j < flash_info[i].sector_count; j++)
|
||||
{
|
||||
if (j <= 7)
|
||||
|
||||
@@ -276,7 +276,7 @@ ulong flash_init(void)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
break;
|
||||
default:
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
|
||||
46
board/ixdp425/Makefile
Normal file
46
board/ixdp425/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2002
|
||||
# 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 := ixdp425.o flash.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 $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
2
board/ixdp425/config.mk
Normal file
2
board/ixdp425/config.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
#TEXT_BASE = 0x00100000
|
||||
TEXT_BASE = 0x00f00000
|
||||
427
board/ixdp425/flash.c
Normal file
427
board/ixdp425/flash.c
Normal file
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* Board support for 1 or 2 flash devices */
|
||||
#undef FLASH_PORT_WIDTH32
|
||||
#define FLASH_PORT_WIDTH16
|
||||
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
#define FLASH_PORT_WIDTH ushort
|
||||
#define FLASH_PORT_WIDTHV vu_short
|
||||
#define SWAP(x) x
|
||||
#else
|
||||
#define FLASH_PORT_WIDTH ulong
|
||||
#define FLASH_PORT_WIDTHV vu_long
|
||||
#define SWAP(x) __swab32(x)
|
||||
#endif
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define mb() __asm__ __volatile__ ("" : : : "memory")
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info);
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
void inline spin_wheel (void);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i;
|
||||
ulong size = 0;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
|
||||
flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic ("configured to many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
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_INTEL:
|
||||
printf ("INTEL ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F128J3A:
|
||||
printf ("28F128J3A\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
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");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info)
|
||||
{
|
||||
volatile FPW value;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0x5555] = (FPW) 0x00AA00AA;
|
||||
addr[0x2AAA] = (FPW) 0x00550055;
|
||||
addr[0x5555] = (FPW) 0x00900090;
|
||||
|
||||
mb ();
|
||||
value = addr[0];
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
mb ();
|
||||
value = addr[1]; /* device ID */
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_ID_28F128J3A:
|
||||
info->flash_id += FLASH_28F128J3A;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 16 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (info->sector_count > CFG_MAX_FLASH_SECT) {
|
||||
printf ("** ERROR: sector count %d > max (%d) **\n",
|
||||
info->sector_count, CFG_MAX_FLASH_SECT);
|
||||
info->sector_count = CFG_MAX_FLASH_SECT;
|
||||
}
|
||||
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type;
|
||||
int rcode = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
type = (info->flash_id & FLASH_VENDMASK);
|
||||
if ((type != FLASH_MAN_INTEL)) {
|
||||
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) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n", prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
FPWV *addr = (FPWV *) (info->start[sect]);
|
||||
FPW status;
|
||||
|
||||
printf ("Erasing sector %2d ... ", sect);
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
*addr = (FPW) 0x00200020; /* erase setup */
|
||||
*addr = (FPW) 0x00D000D0; /* erase confirm */
|
||||
|
||||
while (((status =
|
||||
*addr) & (FPW) 0x00800080) !=
|
||||
(FPW) 0x00800080) {
|
||||
if (get_timer_masked () >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
*addr = (FPW) 0x00B000B0; /* suspend erase */
|
||||
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register cmd. */
|
||||
*addr = (FPW) 0x00FF00FF; /* resest to read mode */
|
||||
|
||||
printf (" done\n");
|
||||
}
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
* 4 - Flash not identified
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp;
|
||||
FPW data;
|
||||
int count, i, l, rc, port_width;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
/* get lower word aligned address */
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
wp = (addr & ~1);
|
||||
port_width = 2;
|
||||
#else
|
||||
wp = (addr & ~3);
|
||||
port_width = 4;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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 < port_width && cnt > 0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
count = 0;
|
||||
while (cnt >= port_width) {
|
||||
data = 0;
|
||||
for (i = 0; i < port_width; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
cnt -= port_width;
|
||||
if (count++ > 0x800) {
|
||||
spin_wheel ();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
return (write_data (info, wp, SWAP (data)));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word or halfword to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data)
|
||||
{
|
||||
FPWV *addr = (FPWV *) dest;
|
||||
ulong status;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
printf ("not erased at %08lx (%lx)\n", (ulong) addr,
|
||||
(ulong) * addr);
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
*addr = (FPW) 0x00400040; /* write setup */
|
||||
*addr = data;
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
/* wait while polling the status register */
|
||||
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void inline spin_wheel (void)
|
||||
{
|
||||
static int p = 0;
|
||||
static char w[] = "\\/-";
|
||||
|
||||
printf ("\010%c", w[p]);
|
||||
(++p == 3) ? (p = 0) : 0;
|
||||
}
|
||||
76
board/ixdp425/ixdp425.c
Normal file
76
board/ixdp425/ixdp425.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.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 <asm/arch/ixp425.h>
|
||||
#include <common.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/* local prototypes */
|
||||
|
||||
|
||||
/*
|
||||
* Miscelaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int
|
||||
/**********************************************************/
|
||||
board_post_init (void)
|
||||
/**********************************************************/
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
/**********************************************************/
|
||||
board_init (void)
|
||||
/**********************************************************/
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* arch number of IXDP */
|
||||
gd->bd->bi_arch_number = 245;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x00000100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
/**********************************************************/
|
||||
dram_init (void)
|
||||
/**********************************************************/
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
|
||||
return (0);
|
||||
}
|
||||
59
board/ixdp425/u-boot.lds
Normal file
59
board/ixdp425/u-boot.lds
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* (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_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-bigarm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/ixp/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
bss_end = .;
|
||||
|
||||
armboot_end = .;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ ulong flash_init(void)
|
||||
if (i == 0)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
else
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
for (j = 0; j < flash_info[i].sector_count; j++)
|
||||
{
|
||||
if (j <= 7)
|
||||
|
||||
@@ -91,7 +91,7 @@ ulong flash_init(void)
|
||||
flashbase = PHYS_FLASH_2;
|
||||
break;
|
||||
default:
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++)
|
||||
|
||||
@@ -76,7 +76,7 @@ unsigned long flash_init (void)
|
||||
flash_get_offsets (PHYS_FLASH_2, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic ("configured to many flash banks!\n");
|
||||
panic ("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
|
||||
@@ -72,7 +72,7 @@ ulong flash_init(void) {
|
||||
if (i==0)
|
||||
flashbase = CFG_FLASH_BASE;
|
||||
else
|
||||
panic("configured to many flash banks!\n");
|
||||
panic("configured too many flash banks!\n");
|
||||
for (j = 0; j < flash_info[i].sector_count; j++)
|
||||
flash_info[i].start[j]=flashbase + j * SECT_SIZE;
|
||||
|
||||
|
||||
@@ -238,7 +238,9 @@ int board_pre_init (void)
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
#endif
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
volatile uchar *ramaddr, c = 0xff;
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
* PSDMR_BUFCMD adds a clock
|
||||
* 0 no extra clock
|
||||
*/
|
||||
#define CONFIG_PBI PSDMR_PBI
|
||||
#define CONFIG_PBI 0
|
||||
#define PESSIMISTIC_SDRAM 0
|
||||
#define EAMUX 0 /* EST requires EAMUX */
|
||||
#define BUFCMD 0
|
||||
@@ -427,7 +427,7 @@ long int initdram(int board_type)
|
||||
bsma = ((31 - width) - 14) - ((rows > cols) ? rows : cols);
|
||||
sda10 = sdam + 2;
|
||||
#else
|
||||
sdam = cols - 6;
|
||||
sdam = cols + banks - 8;
|
||||
bsma = ((31 - width) - 14) - ((rows > cols) ? rows : cols);
|
||||
sda10 = sdam;
|
||||
#endif
|
||||
@@ -557,9 +557,18 @@ long int initdram(int board_type)
|
||||
printf("SDRAM configuration read from SPD\n");
|
||||
printf("\tSize per side = %dMB\n", sdram_size >> 20);
|
||||
printf("\tOrganization: %d sides, %d banks, %d Columns, %d Rows, Data width = %d bits\n", chipselects, 1<<(banks), cols, rows, data_width);
|
||||
printf("\tRefresh rate = %d, CAS latency = %d\n", psrt, caslatency);
|
||||
printf("\tRefresh rate = %d, CAS latency = %d", psrt, caslatency);
|
||||
#if(CONFIG_PBI == 0) /* bank-based interleaving */
|
||||
printf(", Using Bank Based Interleave\n");
|
||||
#else
|
||||
printf(", Using Page Based Interleave\n");
|
||||
#endif
|
||||
printf("\tTotal size: ");
|
||||
|
||||
/* this delay only needed for original 16MB DIMM...
|
||||
* Not needed for any other memory configuration */
|
||||
if ((sdram_size * chipselects) == (16 *1024 *1024))
|
||||
udelay (250000);
|
||||
return (sdram_size * chipselects);
|
||||
/*return (16 * 1024 * 1024);*/
|
||||
}
|
||||
|
||||
48
board/mpc8540ads/Makefile
Normal file
48
board/mpc8540ads/Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := $(BOARD).o flash.o
|
||||
SOBJS := init.o
|
||||
#SOBJS :=
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(SOBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
32
board/mpc8540ads/config.mk
Normal file
32
board/mpc8540ads/config.mk
Normal file
@@ -0,0 +1,32 @@
|
||||
# Modified by Xianghua Xiao, X.Xiao@motorola.com
|
||||
# (C) Copyright 2002,Motorola Inc.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# mpc8540ads board
|
||||
# default CCARBAR is at 0xff700000
|
||||
# assume U-Boot is less than 0.5MB
|
||||
#
|
||||
TEXT_BASE = 0xfff80000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx=1
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_MPC8540=1
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_E500=1
|
||||
539
board/mpc8540ads/flash.c
Normal file
539
board/mpc8540ads/flash.c
Normal file
@@ -0,0 +1,539 @@
|
||||
/*
|
||||
* (C) Copyright 2003 Motorola Inc.
|
||||
* Xianghua Xiao,(X.Xiao@motorola.com)
|
||||
*
|
||||
* (C) Copyright 2000, 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2001, Stuart Hughes, Lineo Inc, stuarth@lineo.com
|
||||
* Add support the Sharp chips on the mpc8260ads.
|
||||
* I started with board/ip860/flash.c and made changes I found in
|
||||
* the MTD project by David Schleef.
|
||||
*
|
||||
* 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>
|
||||
|
||||
#if !defined(CFG_NO_FLASH)
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
#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
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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);
|
||||
static int clear_block_lock_bit(vu_long * addr);
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size;
|
||||
int i;
|
||||
|
||||
/* Init: enable write,
|
||||
* or we cannot even write flash commands
|
||||
*/
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
|
||||
/* set the default sector offset */
|
||||
}
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
|
||||
size = flash_get_size((vu_long *)CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size, size<<20);
|
||||
}
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
size = flash_get_size((vu_long *)CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
flash_info[0].size = size;
|
||||
|
||||
#if !defined(CONFIG_RAM_AS_FLASH)
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
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,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR+CFG_ENV_SECT_SIZE-1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
#endif
|
||||
return (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_INTEL: printf ("Intel "); break;
|
||||
case FLASH_MAN_SHARP: printf ("Sharp "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F016SV: printf ("28F016SV (16 Mbit, 32 x 64k)\n");
|
||||
break;
|
||||
case FLASH_28F160S3: printf ("28F160S3 (16 Mbit, 32 x 512K)\n");
|
||||
break;
|
||||
case FLASH_28F320S3: printf ("28F320S3 (32 Mbit, 64 x 512K)\n");
|
||||
break;
|
||||
case FLASH_LH28F016SCT: printf ("28F016SC (16 Mbit, 32 x 64K)\n");
|
||||
break;
|
||||
case FLASH_28F640J3A: printf ("28F640J3A (64 Mbit, 64 x 128K)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
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");
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
ulong value;
|
||||
ulong base = (ulong)addr;
|
||||
ulong sector_offset;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("Check flash at 0x%08x\n",(uint)addr);
|
||||
#endif
|
||||
/* Write "Intelligent Identifier" command: read Manufacturer ID */
|
||||
*addr = 0x90909090;
|
||||
udelay(20);
|
||||
asm("sync");
|
||||
|
||||
value = addr[0] & 0x00FF00FF;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("manufacturer=0x%x\n",(uint)value);
|
||||
#endif
|
||||
switch (value) {
|
||||
case MT_MANUFACT: /* SHARP, MT or => Intel */
|
||||
case INTEL_ALT_MANU:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
default:
|
||||
printf("unknown manufacturer: %x\n", (unsigned int)value);
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr[1] & 0x00FF00FF; /* device ID */
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("deviceID=0x%x\n",(uint)value);
|
||||
#endif
|
||||
switch (value) {
|
||||
case (INTEL_ID_28F016S):
|
||||
info->flash_id += FLASH_28F016SV;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00400000;
|
||||
sector_offset = 0x20000;
|
||||
break; /* => 2x2 MB */
|
||||
|
||||
case (INTEL_ID_28F160S3):
|
||||
info->flash_id += FLASH_28F160S3;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00400000;
|
||||
sector_offset = 0x20000;
|
||||
break; /* => 2x2 MB */
|
||||
|
||||
case (INTEL_ID_28F320S3):
|
||||
info->flash_id += FLASH_28F320S3;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00800000;
|
||||
sector_offset = 0x20000;
|
||||
break; /* => 2x4 MB */
|
||||
|
||||
case (INTEL_ID_28F640J3A):
|
||||
info->flash_id += FLASH_28F640J3A;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x01000000;
|
||||
sector_offset = 0x40000;
|
||||
break; /* => 2x8 MB */
|
||||
|
||||
case SHARP_ID_28F016SCL:
|
||||
case SHARP_ID_28F016SCZ:
|
||||
info->flash_id = FLASH_MAN_SHARP | FLASH_LH28F016SCT;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00800000;
|
||||
sector_offset = 0x40000;
|
||||
break; /* => 4x2 MB */
|
||||
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base;
|
||||
base += sector_offset;
|
||||
/* don't know how to check sector protection */
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr = (vu_long *)info->start[0];
|
||||
*addr = 0xFFFFFF; /* reset bank to read array mode */
|
||||
asm("sync");
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
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_VENDMASK) != FLASH_MAN_INTEL)
|
||||
&& ((info->flash_id & FLASH_VENDMASK) != FLASH_MAN_SHARP) ) {
|
||||
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) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("\nFlash Erase:\n");
|
||||
#endif
|
||||
/* Make Sure Block Lock Bit is not set. */
|
||||
if(clear_block_lock_bit((vu_long *)(info->start[s_first]))){
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
#if defined(DEBUG)
|
||||
printf("Begin to erase now,s_first=0x%x s_last=0x%x...\n",s_first,s_last);
|
||||
#endif
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
vu_long *addr = (vu_long *)(info->start[sect]);
|
||||
asm("sync");
|
||||
|
||||
last = start = get_timer (0);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* Reset Array */
|
||||
*addr = 0xffffffff;
|
||||
asm("sync");
|
||||
/* Clear Status Register */
|
||||
*addr = 0x50505050;
|
||||
asm("sync");
|
||||
/* Single Block Erase Command */
|
||||
*addr = 0x20202020;
|
||||
asm("sync");
|
||||
/* Confirm */
|
||||
*addr = 0xD0D0D0D0;
|
||||
asm("sync");
|
||||
|
||||
if((info->flash_id & FLASH_TYPEMASK) != FLASH_LH28F016SCT) {
|
||||
/* Resume Command, as per errata update */
|
||||
*addr = 0xD0D0D0D0;
|
||||
asm("sync");
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
while ((*addr & 0x00800080) != 0x00800080) {
|
||||
if(*addr & 0x00200020){
|
||||
printf("Error in Block Erase - Lock Bit may be set!\n");
|
||||
printf("Status Register = 0x%X\n", (uint)*addr);
|
||||
*addr = 0xFFFFFFFF; /* reset bank */
|
||||
asm("sync");
|
||||
return 1;
|
||||
}
|
||||
if ((now=get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
*addr = 0xFFFFFFFF; /* reset bank */
|
||||
asm("sync");
|
||||
return 1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
/* reset to read mode */
|
||||
*addr = 0xFFFFFFFF;
|
||||
asm("sync");
|
||||
}
|
||||
}
|
||||
|
||||
printf ("flash erase 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)
|
||||
{
|
||||
vu_long *addr = (vu_long *)dest;
|
||||
ulong start, csr;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* Write Command */
|
||||
*addr = 0x10101010;
|
||||
asm("sync");
|
||||
|
||||
/* Write Data */
|
||||
*addr = data;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
flag = 0;
|
||||
|
||||
while (((csr = *addr) & 0x00800080) != 0x00800080) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
flag = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (csr & 0x40404040) {
|
||||
printf ("CSR indicates write error (%08lx) at %08lx\n", csr, (ulong)addr);
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
/* Clear Status Registers Command */
|
||||
*addr = 0x50505050;
|
||||
asm("sync");
|
||||
/* Reset to read array mode */
|
||||
*addr = 0xFFFFFFFF;
|
||||
asm("sync");
|
||||
|
||||
return (flag);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Clear Block Lock Bit, returns:
|
||||
* 0 - OK
|
||||
* 1 - Timeout
|
||||
*/
|
||||
|
||||
static int clear_block_lock_bit(vu_long * addr)
|
||||
{
|
||||
ulong start, now;
|
||||
|
||||
/* Reset Array */
|
||||
*addr = 0xffffffff;
|
||||
asm("sync");
|
||||
/* Clear Status Register */
|
||||
*addr = 0x50505050;
|
||||
asm("sync");
|
||||
|
||||
*addr = 0x60606060;
|
||||
asm("sync");
|
||||
*addr = 0xd0d0d0d0;
|
||||
asm("sync");
|
||||
|
||||
start = get_timer (0);
|
||||
while((*addr & 0x00800080) != 0x00800080){
|
||||
if ((now=get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout on clearing Block Lock Bit\n");
|
||||
*addr = 0xFFFFFFFF; /* reset bank */
|
||||
asm("sync");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !CFG_NO_FLASH */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user