mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
34 Commits
LABEL_2004
...
U-Boot-1_1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f525c8a147 | ||
|
|
17d704eb95 | ||
|
|
7e780369e4 | ||
|
|
0608e04da9 | ||
|
|
b79a11cc2b | ||
|
|
518e2e1ae3 | ||
|
|
6fb6af6dc9 | ||
|
|
eeb1b77b7d | ||
|
|
27aa818670 | ||
|
|
4b9206ed51 | ||
|
|
109c0e3ad3 | ||
|
|
efa329cb89 | ||
|
|
7d7ce4125f | ||
|
|
d9df1f4e66 | ||
|
|
42dfe7a184 | ||
|
|
855a496fe9 | ||
|
|
4b248f3f71 | ||
|
|
aaf224ab4e | ||
|
|
3d3befa754 | ||
|
|
4d13cbad1c | ||
|
|
c3f9d4939a | ||
|
|
0e6d798cb3 | ||
|
|
c40b295682 | ||
|
|
6629d2f22b | ||
|
|
bdda519d3c | ||
|
|
232c150a25 | ||
|
|
79d696fc55 | ||
|
|
f8d813e34f | ||
|
|
e7c85689bb | ||
|
|
132ba5fdc5 | ||
|
|
11dadd547c | ||
|
|
80885a9d52 | ||
|
|
0c852a2886 | ||
|
|
a084f7da88 |
286
CHANGELOG
286
CHANGELOG
@@ -1,7 +1,291 @@
|
||||
======================================================================
|
||||
Changes for U-Boot 1.0.2:
|
||||
Changes for U-Boot 1.1.0:
|
||||
======================================================================
|
||||
|
||||
* Patch by Mark Jonas: Remove config.tmp files only when
|
||||
unconfiguring the board
|
||||
|
||||
* Adapt RMU board for bigger flash memory
|
||||
|
||||
* Patch by Klaus Heydeck, 13 Mar 2003:
|
||||
Add support for KUP4X Board
|
||||
|
||||
* Patch by Pavel Bartusek, 21 Mar 2004
|
||||
Add Reiserfs support
|
||||
|
||||
* Patch by Hinko Kocevar, 20 Mar 2004
|
||||
- Add auto-release for SMSC LAN91c111 driver
|
||||
- Add save/restore of PTR and PNR regs as suggested in datasheet
|
||||
|
||||
* Patch by Stephen Williams, 19 March 2004
|
||||
Increase speed of sector reads from SystemACE,
|
||||
shorten poll timeout and remove a useless reset
|
||||
|
||||
* Patch by Tolunay Orkun, 19 Mar 2004:
|
||||
Make GigE PHY 1000Mbps Speed/Duplex detection conditional
|
||||
(CONFIG_PHY_GIGE)
|
||||
|
||||
* Patch by Brad Kemp, 18 Mar 2004:
|
||||
prevent machine checks during a PCI scan
|
||||
|
||||
* Patch by Pierre Aubert, 18 Mar 2004:
|
||||
Fix string cleaning in IDE identification
|
||||
|
||||
* Patch by Pierre Aubert, 18 Mar 2004:
|
||||
- Unify video mode handling for Chips & Technologies 69000 Video
|
||||
chip and Silicon Motion SMI 712/710/810 Video chip
|
||||
- Add selection of the video output (CRT or LCD) via 'videoout'
|
||||
environment variable for the Silicon Motion
|
||||
- README update
|
||||
|
||||
* Patch by Pierre Aubert, 18 Mar 2004:
|
||||
include/common.h typo fix
|
||||
|
||||
* Patches by Tolunay Orkun, 17 Mar 2004:
|
||||
- Add support for bd->bi_iic_fast[] initialization via environment
|
||||
variable "i2cfast" (CONFIG_I2CFAST)
|
||||
- Add "i2cfast" u-boot environment variable support for csb272
|
||||
|
||||
* Patch by Carl Riechers, 17 Mar 2004:
|
||||
Ignore '\0' characters in console input for use with telnet and
|
||||
telco pads.
|
||||
|
||||
* Patch by Leon Kukovec, 17 Mar 2004:
|
||||
typo fix for strswab prototype #ifdef
|
||||
|
||||
* Patches by Thomas Viehweger, 16 Mar 2004:
|
||||
- show PCI clock frequency on MPC8260 systems
|
||||
- add FCC_PSMR_RMII flag for HiP7 processors
|
||||
- in do_jffs2_fsload(), take load address from load_addr if not set
|
||||
explicit, update load_addr otherwise
|
||||
- replaced printf by putc/puts when no formatting is needed
|
||||
(smaller code size, faster execution)
|
||||
|
||||
* Patch by Phillippe Robin, 16 Mar 2004:
|
||||
avoid dereferencing NULL pointer in lib_arm/armlinux.c
|
||||
|
||||
* Patch by Stephen Williams, 15 Mar 2004:
|
||||
Fix CONFIG_SERIAL_SOFTWARE_FIFO documentation
|
||||
|
||||
* Patch by Tolunay Orkun, 15 Mar 2004:
|
||||
Initialize bi_opbfreq to real OPB frequency via get_OPB_freq()
|
||||
|
||||
* Patch by Travis Sawyer, 15 Mar 2004:
|
||||
Update CREDITS & MAINTAINERS files for PPC440GX & Ocotea port
|
||||
|
||||
* Add start-up delay to make sure power has stabilized before
|
||||
attempting to switch on USB on SX1 board.
|
||||
|
||||
* Patch by Josef Wagner, 18 Mar 2004:
|
||||
- Add support for MicroSys XM250 board (PXA255)
|
||||
- Add support for MicroSys PM828 board (MPC8280)
|
||||
- Add support for 32 MB Flash on PM825/826
|
||||
- new SDRAM refresh rate for PM825/PM826
|
||||
- added support for MicroSys PM520 (MPC5200)
|
||||
- replaced Query by Identify command in CPU86/flash.c
|
||||
to support 28F160F3B
|
||||
|
||||
* Fix wrap around problem with udelay() on ARM920T
|
||||
|
||||
* Add support for Macronix flash on TRAB board
|
||||
|
||||
* Patch by Pierre Aubert, 15 Mar 2004:
|
||||
Fix buffer overflow in IDE identification
|
||||
|
||||
* Fix power-off of LCD for out-of-band temperatures on LWMON board
|
||||
|
||||
* Remove redundand #define in IceCube.h
|
||||
|
||||
* Patch by Steven Scholz, 27 Feb 2004:
|
||||
- Adding get_ticks() and get_tbclk() for AT91RM9200
|
||||
- Many white space fixes in cpu/at91rm9200/interrupts.c
|
||||
|
||||
* Patches by Steven Scholz, 20 Feb 2004:
|
||||
some cleanup in AT91RM9200 related code
|
||||
|
||||
* Patches by Travis Sawyer, 12 Mar 2004:
|
||||
- Fix Gigabit Ethernet support for 440GX
|
||||
- Add Gigabit Ethernet Support to MII PHY utilities
|
||||
|
||||
* Patch by Brad Kemp, 12 Mar 2004:
|
||||
Fixes for drivers/cfi_flash.c:
|
||||
- Better support for x8/x16 implementations
|
||||
- Added failure for AMD chips attempting to use CFG_FLASH_USE_BUFFER_WRITE
|
||||
- Added defines for AMD command and address constants
|
||||
|
||||
* Patch by Leon Kukovec, 12 Mar 2004:
|
||||
Fix get_dentfromdir() to correctly handle deleted dentries
|
||||
|
||||
* Patch by George G. Davis, 11 Mar 2004:
|
||||
Remove hard coded network settings in TI OMAP1610 H2
|
||||
default board config
|
||||
|
||||
* Patch by George G. Davis, 11 Mar 2004:
|
||||
add support for ADS GraphicsClient+ board.
|
||||
|
||||
* Patch by Pierre Aubert, 11 Mar 2004:
|
||||
- add bitmap command and splash screen support in cfb console
|
||||
- add [optional] origin in the bitmap display command
|
||||
|
||||
* Patch by Travis Sawyer, 11 Mar 2004:
|
||||
Fix ocotea board early init interrupt setup.
|
||||
|
||||
* Patch by Thomas Viehweger, 11 Mar 2004:
|
||||
Remove redundand code; add PCI-specific bits to include/mpc8260.h
|
||||
|
||||
* Patch by Stephan Linz, 09 Mar 2004
|
||||
- Add support for the SSV ADNP/ESC1 (Nios Softcore)
|
||||
|
||||
* Patch by George G. Davis, 9 Mar 2004:
|
||||
fix recent build failure for SA1100 target
|
||||
|
||||
* Patch by Travis Sawyer, 09 Mar 2004:
|
||||
Support native interrupt mode for the IBM440GX.
|
||||
Previously it was running in 440GP compatibility mode.
|
||||
|
||||
* Patch by Philippe Robin, 09 Mar 2004:
|
||||
Added ARM Integrator AP, CP and Versatile PB926EJ-S Reference
|
||||
Platform support.
|
||||
|
||||
* Patch by Masami Komiya, 08 Mar 2004:
|
||||
Don't overwrite server IP address or boot file name
|
||||
when the boot server does not return values
|
||||
|
||||
* Patch by Tolunay Orkun, 5 Mar 2004:
|
||||
Removed compile time restriction on CFG_I2C_SPEED for DS1338 RTC
|
||||
|
||||
* Patch by Tolunay Orkun, 5 Mar 2004:
|
||||
Fix early board initialization for Cogent CSB272 board
|
||||
|
||||
* Patch by Ed Okerson, 3 Mar 2004:
|
||||
fix CFI flash writes for little endian systems
|
||||
|
||||
* Patch by Reinhard Meyer, 01 Mar 2004:
|
||||
generalize USB and IDE support for MPC5200 with according
|
||||
changes to IceCube.h and TOP5200.h
|
||||
add Am29LV256 256 MBit FLASH support for TOP5200 boards
|
||||
add info about USB and IDE to README
|
||||
|
||||
* Patch by Yuli Barcohen, 4 Mar 2004:
|
||||
Fix problems with GCC 3.3.x which changed handling of global
|
||||
variables explicitly initialized to zero (now in .bss instead of
|
||||
.data as before).
|
||||
|
||||
* Patch by Leon Kukovec, 02 Mar 2004:
|
||||
add strswab() to fix IDE LBA capacity, firmware and model numbers
|
||||
on little endian machines
|
||||
|
||||
* Patch by Masami Komiya, 02 Mar 2004:
|
||||
- Remove get_ticks() from NFS code
|
||||
- Add verification of RPC transaction ID
|
||||
|
||||
* Patch by Pierre Aubert, 02 Mar 2004:
|
||||
cleanup for IDE and USB drivers for MPC5200
|
||||
|
||||
* Patch by Travis Sawyer, 01 Mar 2004:
|
||||
Ocotea:
|
||||
- Add IBM PPC440GX Ref Platform support (Ocotea)
|
||||
Original code by Paul Reynolds <PaulReynolds@lhsolutions.com>
|
||||
Adapted to U-Boot and 440GX port
|
||||
440gx_enet.c:
|
||||
- Add gracious handling of all Ethernet Pin Selections for 440GX
|
||||
- Add RGMII selection for Cicada CIS8201 Gigabit PHY
|
||||
ppc440.h:
|
||||
- Add needed bit definitions
|
||||
- Fix formatting
|
||||
|
||||
* Patch by Carl Riechers, 1 Mar 2004:
|
||||
Add PPC440GX prbdv0 divider to fix memory clock calculation.
|
||||
|
||||
* Patch by Stephan Linz, 27 Feb 2004
|
||||
- avoid problems for targets without NFS download support
|
||||
|
||||
* Patch by Rune Torgersen, 27 Feb 2004:
|
||||
- Added LBA48 support (CONFIG_LBA48 & CFG_64BIT_LBA)
|
||||
- Added support for 64bit printing in vsprintf (CFG_64BIT_VSPRINTF)
|
||||
- Added support for 64bit strtoul (CFG_64BIT_STRTOUL)
|
||||
|
||||
* Patch by Masami Komiya, 27 Feb 2004:
|
||||
Fix rarpboot: add autoload by NFS
|
||||
|
||||
* Patch by Dan Eisenhut, 26 Feb 2004:
|
||||
fix flash_write return value in saveenv
|
||||
|
||||
* Patch by Stephan Linz, 11 Dec 2003
|
||||
expand config.mk to avoid trigraph warnings on NIOS
|
||||
|
||||
* Rename "BMS2003" board into "HMI10"
|
||||
|
||||
* SX1 patches: use "serial#" for USB serial #; use redundand environment
|
||||
storage; auto-set console on USB port (using preboot command)
|
||||
|
||||
* Add support for SX1 mobile phone; add support for USB-based console
|
||||
(enable with "setenv stdout usbtty; setenv stdin usbtty")
|
||||
|
||||
* Fix LOWBOOT configuration for MPC5200 with DDR memory
|
||||
|
||||
* Fix SDRAM timings for LITE5200 / IceCube board
|
||||
|
||||
* Handle Auti-MDIX / connection status for INCA-IP
|
||||
|
||||
* Fix USB problems when attempting to read 0 bytes
|
||||
|
||||
* Patch by Travis Sawyer, 26 Feb 2004:
|
||||
Fix broken compile for XPEDITE1K target.
|
||||
|
||||
* Patch by Stephan Linz, 26 Feb 2004:
|
||||
Bug fix for NFS code on NIOS targets
|
||||
|
||||
* Patch by Stephen Williams, 26 Feb 2004:
|
||||
Break up SystemACE reads of large block counts
|
||||
|
||||
* Patch by Pierre Aubert, 26 Feb 2004
|
||||
add IDE support for MPC5200
|
||||
|
||||
* Patch by Masami Komiya, 26 Feb 2004:
|
||||
add autoload via NFS
|
||||
|
||||
* Patch by Stephen Williams
|
||||
Use of CONFIG_SERIAL_SOFTWARE_FIFO in board.c consistent with uses
|
||||
elsewhere in the source.
|
||||
|
||||
* Patch by Steven Scholz, 25 Feb 2004:
|
||||
- Timeouts in FPGA code should be based on CFG_HZ
|
||||
- Minor cleanup in code for Altera FPGA ACEX1K
|
||||
|
||||
* Patch by Steven Scholz, 25 Feb 2004:
|
||||
Changed "Directory Hierarchy" section in README
|
||||
|
||||
* Patch by Masami Komiya, 25 Feb 2004:
|
||||
Reduce copy count in nfs_read_reply() of NFS code
|
||||
|
||||
* Patch by Markus Pietrek, 24 Feb 2004:
|
||||
NS9750 DevBoard added
|
||||
|
||||
* Patch by Pierre Aubert, 24 Feb 2004
|
||||
add USB support for MPC5200
|
||||
|
||||
* Patch by Steven Scholz, 24 Feb 2004:
|
||||
- fix MII commands to use values from last command
|
||||
|
||||
* Patch by Torsten Demke, 24 Feb 2004:
|
||||
Add support for the eXalion platform (SPSW-8240, F-30, F-300)
|
||||
|
||||
* Patch by Rahul Shanbhag, 19 Feb 2004:
|
||||
Fixes for for OMAP1610 board:
|
||||
- shift some IRQ specific code to platform.S file
|
||||
- remove duplicatewatchdog reset code from start.S
|
||||
|
||||
* Make Auto-MDIX Support configurable on INCA-IP board
|
||||
|
||||
* Fix license for mkimage tool
|
||||
|
||||
* Patch by Masami Komiya, 24 Feb 2004:
|
||||
Update NetBootFileXferSize in NFS code
|
||||
|
||||
* Patch by Scott McNutt, 24 Feb 2004:
|
||||
fix packet length in NFS code
|
||||
|
||||
* Patch by Masami Komiy, 22 Feb 2004:
|
||||
Add support for NFS for file download
|
||||
|
||||
|
||||
17
CREDITS
17
CREDITS
@@ -38,6 +38,11 @@ N: Jerry van Baren
|
||||
E: <vanbaren@cideas.com>
|
||||
D: BedBug port to 603e core (MPC82xx). Code for enhanced memory test.
|
||||
|
||||
N: Pavel Bartusek
|
||||
E: <pba@sysgo.com>
|
||||
D: Reiserfs support
|
||||
W: http://www.elinos.com
|
||||
|
||||
N: Andre Beaudin
|
||||
E: <andre.beaudin@colubris.com>
|
||||
D: PCMCIA, Ethernet, TFTP
|
||||
@@ -103,6 +108,11 @@ N: Dave Ellis
|
||||
E: DGE@sixnetio.com
|
||||
D: EEPROM Speedup, SXNI855T port
|
||||
|
||||
N: Thomas Elste
|
||||
E: info@elste.org
|
||||
D: Port for the ModNET50 Board, NET+50 CPU Port
|
||||
W: http://www.imms.de
|
||||
|
||||
N: Daniel Engström
|
||||
E: daniel@omicron.se
|
||||
D: x86 port, Support for sc520_cdp board
|
||||
@@ -211,6 +221,7 @@ W: http://www.leox.org
|
||||
N: Stephan Linz
|
||||
E: linz@li-pro.net
|
||||
D: Support for Nios Stratix Development Kit (DK-1S10)
|
||||
D: Support for SSV ADNP/ESC1 (Nios Cyclone)
|
||||
W: http://www.li-pro.net
|
||||
|
||||
N: Raymond Lo
|
||||
@@ -246,6 +257,10 @@ E: rof@sysgo.de
|
||||
D: Initial support for SSV-DNP1110, SMC91111 driver
|
||||
W: www.elinos.com
|
||||
|
||||
N: Tolunay Orkun
|
||||
E: torkun@nextio.com
|
||||
D: Support for Cogent CSB272 board
|
||||
|
||||
N: Keith Outwater
|
||||
E: keith_outwater@mvis.com
|
||||
D: Support for generic/custom MPC860T boards (GEN860T, GEN860T_SC)
|
||||
@@ -278,7 +293,7 @@ D: Author of LiMon-1.4.2, which contributed some ideas
|
||||
|
||||
N: Travis B. Sawyer
|
||||
E: travis.sawyer@sandburst.com
|
||||
D: Support for IBM PPC440GX, XES XPedite1000 440GX PrPMC board.
|
||||
D: Support for IBM PPC440GX, XES XPedite1000 440GX PrPMC board. IBM 440gx Ref Platform (Ocotea)
|
||||
|
||||
N: Paolo Scaffardi
|
||||
E: arsenio@tin.it
|
||||
|
||||
15
MAINTAINERS
15
MAINTAINERS
@@ -49,6 +49,10 @@ K
|
||||
|
||||
FLAGADM MPC823
|
||||
|
||||
Torsten Demke <torsten.demke@fci.com>
|
||||
|
||||
eXalion MPC824x
|
||||
|
||||
Wolfgang Denk <wd@denx.de>
|
||||
|
||||
AMX860 MPC860
|
||||
@@ -142,6 +146,7 @@ Bill Hargen <Bill_Hargen@Jabil.com>
|
||||
Klaus Heydeck <heydeck@kieback-peter.de>
|
||||
|
||||
KUP4K MPC855
|
||||
KUP4X MPC859
|
||||
|
||||
Murray Jensen <Murray.Jensen@cmst.csiro.au>
|
||||
|
||||
@@ -226,6 +231,11 @@ Stefan Roese <stefan.roese@esd-electronics.com>
|
||||
PMC405 PPC405GP
|
||||
VOH405 PPC405EP
|
||||
|
||||
Travis Sawyer (travis.sawyer@sandburst.com>
|
||||
|
||||
XPEDITE1K PPC440GX
|
||||
OCOTEA PPC440GX
|
||||
|
||||
Peter De Schrijver <p2@mind.be>
|
||||
|
||||
ML2 PPC4xx
|
||||
@@ -289,6 +299,10 @@ Unknown / orphaned boards:
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
Thomas Elste <info@elste.org>
|
||||
|
||||
modnet50 ARM720T (NET+50)
|
||||
|
||||
Peter Figuli <peposh@etc.sk>
|
||||
|
||||
wepep250 xscale
|
||||
@@ -373,6 +387,7 @@ Thomas Lange <thomas@corelatus.se>
|
||||
Stephan Linz <linz@li-pro.net>
|
||||
|
||||
DK1S10 Nios-32
|
||||
ADNPESC1 Nios-32
|
||||
|
||||
Scott McNutt <smcnutt@psyent.com>
|
||||
|
||||
|
||||
52
MAKEALL
52
MAKEALL
@@ -25,7 +25,7 @@ LIST_5xx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_5xxx=" \
|
||||
IceCube_5100 IceCube_5200 EVAL5200 \
|
||||
IceCube_5100 IceCube_5200 EVAL5200 PM520 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -40,15 +40,15 @@ LIST_8xx=" \
|
||||
GEN860T_SC GENIETV GTH hermes \
|
||||
IAD210 ICU862_100MHz IP860 IVML24 \
|
||||
IVML24_128 IVML24_256 IVMS8 IVMS8_128 \
|
||||
IVMS8_256 KUP4K LANTEC lwmon \
|
||||
MBX MBX860T MHPC MPC86xADS \
|
||||
MVS1 NETVIA NETVIA_V2 NX823 \
|
||||
pcu_e QS823 QS850 QS860T \
|
||||
R360MPI RBC823 rmu RPXClassic \
|
||||
RPXlite RRvision SM850 SPD823TS \
|
||||
svm_sc8xx SXNI855T TOP860 TQM823L \
|
||||
TQM823L_LCD TQM850L TQM855L TQM860L \
|
||||
v37 \
|
||||
IVMS8_256 KUP4K KUP4X LANTEC \
|
||||
lwmon MBX MBX860T MHPC \
|
||||
MPC86xADS MVS1 NETVIA NETVIA_V2 \
|
||||
NX823 pcu_e QS823 QS850 \
|
||||
QS860T R360MPI RBC823 rmu \
|
||||
RPXClassic RPXlite RRvision SM850 \
|
||||
SPD823TS svm_sc8xx SXNI855T TOP860 \
|
||||
TQM823L TQM823L_LCD TQM850L TQM855L \
|
||||
TQM860L v37 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -61,10 +61,10 @@ LIST_4xx=" \
|
||||
CPCI440 CPCIISER4 CRAYL1 csb272 \
|
||||
DASA_SIM DP405 DU405 EBONY \
|
||||
ERIC EXBITGEN HUB405 MIP405 \
|
||||
MIP405T ML2 ml300 OCRTC \
|
||||
ORSG PCI405 PIP405 PLU405 \
|
||||
PMC405 PPChameleonEVB VOH405 W7OLMC \
|
||||
W7OLMG WALNUT405 XPEDITE1K \
|
||||
MIP405T ML2 ml300 OCOTEA \
|
||||
OCRTC ORSG PCI405 PIP405 \
|
||||
PLU405 PMC405 PPChameleonEVB VOH405 \
|
||||
W7OLMC W7OLMG WALNUT405 XPEDITE1K \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -73,9 +73,9 @@ LIST_4xx=" \
|
||||
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
debris MOUSSE MUSENKI MVBLUE \
|
||||
OXC PN62 Sandpoint8240 Sandpoint8245 \
|
||||
SL8245 utx8245 \
|
||||
debris eXalion MOUSSE MUSENKI \
|
||||
MVBLUE OXC PN62 Sandpoint8240 \
|
||||
Sandpoint8245 SL8245 utx8245 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -85,9 +85,10 @@ LIST_824x=" \
|
||||
LIST_8260=" \
|
||||
atc cogent_mpc8260 CPU86 ep8260 \
|
||||
gw8260 hymod IPHASE4539 MPC8260ADS \
|
||||
MPC8266ADS PM826 ppmc8260 RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE ZPC1900 \
|
||||
MPC8266ADS PM826 PM828 ppmc8260 \
|
||||
RPXsuper rsdproto sacsng sbc8260 \
|
||||
SCM TQM8260_AC TQM8260_AD TQM8260_AE \
|
||||
ZPC1900 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -122,7 +123,7 @@ LIST_ppc="${LIST_5xx} ${LIST_5xxx} \
|
||||
## StrongARM Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_SA="dnp1110 lart shannon"
|
||||
LIST_SA="dnp1110 gcplus lart shannon"
|
||||
|
||||
#########################################################################
|
||||
## ARM7 Systems
|
||||
@@ -135,16 +136,17 @@ LIST_ARM7="B2 ep7312 impa7"
|
||||
#########################################################################
|
||||
|
||||
LIST_ARM9=" \
|
||||
at91rm9200dk omap1510inn omap1610h2 omap1610inn \
|
||||
at91rm9200dk integratorcp integratorap \
|
||||
omap1510inn omap1610h2 omap1610inn \
|
||||
smdk2400 smdk2410 trab \
|
||||
VCMA9 \
|
||||
VCMA9 versatile \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## Xscale Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_pxa="cradle csb226 innokom lubbock wepep250"
|
||||
LIST_pxa="cradle csb226 innokom lubbock wepep250 xm250"
|
||||
|
||||
LIST_ixp="ixdp425"
|
||||
|
||||
@@ -176,6 +178,8 @@ LIST_x86="${LIST_I486}"
|
||||
#########################################################################
|
||||
|
||||
LIST_nios=" \
|
||||
ADNPESC1 ADNPESC1_base_32 \
|
||||
ADNPESC1_DNPEVA2_base_32 \
|
||||
DK1C20 DK1C20_standard_32 \
|
||||
DK1S10 DK1S10_standard_32 DK1S10_mtx_ldk_20 \
|
||||
"
|
||||
|
||||
165
Makefile
165
Makefile
@@ -99,7 +99,8 @@ LIBS = lib_generic/libgeneric.a
|
||||
LIBS += board/$(BOARDDIR)/lib$(BOARD).a
|
||||
LIBS += cpu/$(CPU)/lib$(CPU).a
|
||||
LIBS += lib_$(ARCH)/lib$(ARCH).a
|
||||
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a
|
||||
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
|
||||
fs/reiserfs/libreiserfs.a
|
||||
LIBS += net/libnet.a
|
||||
LIBS += disk/libdisk.a
|
||||
LIBS += rtc/librtc.a
|
||||
@@ -111,7 +112,8 @@ LIBS += common/libcommon.a
|
||||
.PHONY : $(LIBS)
|
||||
|
||||
# Add GCC lib
|
||||
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||
|
||||
|
||||
# The "tools" are needed early, so put this first
|
||||
# Don't include stuff already done in $(LIBS)
|
||||
@@ -185,7 +187,7 @@ endif
|
||||
#########################################################################
|
||||
|
||||
unconfig:
|
||||
rm -f include/config.h include/config.mk
|
||||
@rm -f include/config.h include/config.mk board/*/config.tmp
|
||||
|
||||
#========================================================================
|
||||
# PowerPC
|
||||
@@ -207,20 +209,25 @@ PATI_config:unconfig
|
||||
MPC5200LITE_config \
|
||||
MPC5200LITE_LOWBOOT_config \
|
||||
MPC5200LITE_LOWBOOT08_config \
|
||||
icecube_5200_DDR_LOWBOOT_config \
|
||||
icecube_5200_DDR_config \
|
||||
IceCube_5200_DDR_config \
|
||||
icecube_5200_DDR_LOWBOOT_config \
|
||||
icecube_5200_DDR_LOWBOOT08_config \
|
||||
icecube_5200_config \
|
||||
IceCube_5200_config \
|
||||
IceCube_5100_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring LOWBOOT,$@)" ] || \
|
||||
{ echo "TEXT_BASE = 0xFF000000" >board/icecube/config.tmp ; \
|
||||
@[ -z "$(findstring LOWBOOT_,$@)" ] || \
|
||||
{ if [ "$(findstring DDR,$@)" ] ; \
|
||||
then echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \
|
||||
else echo "TEXT_BASE = 0xFF000000" >board/icecube/config.tmp ; \
|
||||
fi ; \
|
||||
echo "... with LOWBOOT configuration" ; \
|
||||
}
|
||||
@[ -z "$(findstring LOWBOOT08,$@)" ] || \
|
||||
{ echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \
|
||||
echo "... with 8 MB flash only" ; \
|
||||
echo "... with LOWBOOT configuration" ; \
|
||||
}
|
||||
@[ -z "$(findstring DDR,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC5200_DDR" >>include/config.h ; \
|
||||
@@ -242,6 +249,9 @@ TOP5200_config: unconfig
|
||||
@ echo "#define CONFIG_$(@:_config=) 1" >include/config.h
|
||||
@./mkconfig -a TOP5200 ppc mpc5xxx top5200 emk
|
||||
|
||||
PM520_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc5xxx pm520
|
||||
|
||||
#########################################################################
|
||||
## MPC8xx Systems
|
||||
#########################################################################
|
||||
@@ -260,9 +270,6 @@ FADS860T_config: unconfig
|
||||
AMX860_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
|
||||
|
||||
bms2003_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
|
||||
|
||||
c2mon_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx c2mon
|
||||
|
||||
@@ -304,6 +311,9 @@ GTH_config: unconfig
|
||||
hermes_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx hermes
|
||||
|
||||
HMI10_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
|
||||
|
||||
IAD210_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
|
||||
|
||||
@@ -352,7 +362,10 @@ IVMS8_config: unconfig
|
||||
@./mkconfig -a IVMS8 ppc mpc8xx ivm
|
||||
|
||||
KUP4K_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx kup4k
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx kup4k kup
|
||||
|
||||
KUP4X_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx kup4x kup
|
||||
|
||||
LANTEC_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx lantec
|
||||
@@ -596,6 +609,9 @@ ML2_config:unconfig
|
||||
ml300_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ml300 xilinx
|
||||
|
||||
OCOTEA_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ocotea
|
||||
|
||||
OCRTC_config \
|
||||
ORSG_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
|
||||
@@ -647,7 +663,7 @@ XPEDITE1K_config:unconfig
|
||||
#########################################################################
|
||||
## MPC824x Systems
|
||||
#########################################################################
|
||||
xtract_82xx = $(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))
|
||||
xtract_82xx = $(subst _BIGFLASH,,$(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1))))))
|
||||
|
||||
A3000_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x a3000
|
||||
@@ -671,6 +687,9 @@ CPC45_ROMBOOT_config: unconfig
|
||||
CU824_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x cu824
|
||||
|
||||
eXalion_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x eXalion
|
||||
|
||||
MOUSSE_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x mousse
|
||||
|
||||
@@ -739,32 +758,56 @@ MPC8260ADS_config: unconfig
|
||||
MPC8266ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 mpc8266ads
|
||||
|
||||
# PM825/PM826 default configuration: small (= 8 MB) Flash / boot from 64-bit flash
|
||||
PM825_config \
|
||||
PM825_ROMBOOT_config: unconfig
|
||||
@echo "#define CONFIG_PCI" >include/config.h
|
||||
@./mkconfig -a PM826 ppc mpc8260 pm826
|
||||
@cd ./include ; \
|
||||
if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
|
||||
echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
|
||||
echo "... booting from 8-bit flash" ; \
|
||||
else \
|
||||
echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
|
||||
echo "... booting from 64-bit flash" ; \
|
||||
fi; \
|
||||
echo "export CONFIG_BOOT_ROM" >> config.mk; \
|
||||
|
||||
PM825_ROMBOOT_config \
|
||||
PM825_BIGFLASH_config \
|
||||
PM825_ROMBOOT_BIGFLASH_config \
|
||||
PM826_config \
|
||||
PM826_ROMBOOT_config: unconfig
|
||||
@./mkconfig $(call xtract_82xx,$@) ppc mpc8260 pm826
|
||||
@cd ./include ; \
|
||||
if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
|
||||
echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
|
||||
echo "... booting from 8-bit flash" ; \
|
||||
PM826_ROMBOOT_config \
|
||||
PM826_BIGFLASH_config \
|
||||
PM826_ROMBOOT_BIGFLASH_config: unconfig
|
||||
@if [ "$(findstring PM825_,$@)" ] ; then \
|
||||
echo "#define CONFIG_PCI" >include/config.h ; \
|
||||
else \
|
||||
>include/config.h ; \
|
||||
fi
|
||||
@if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
|
||||
echo "... booting from 8-bit flash" ; \
|
||||
echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
|
||||
echo "TEXT_BASE = 0xFF800000" >board/pm826/config.tmp ; \
|
||||
if [ "$(findstring _BIGFLASH_,$@)" ] ; then \
|
||||
echo "... with 32 MB Flash" ; \
|
||||
echo "#define CONFIG_FLASH_32MB" >>include/config.h ; \
|
||||
fi; \
|
||||
else \
|
||||
echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
|
||||
echo "... booting from 64-bit flash" ; \
|
||||
fi; \
|
||||
echo "export CONFIG_BOOT_ROM" >> config.mk; \
|
||||
if [ "$(findstring _BIGFLASH_,$@)" ] ; then \
|
||||
echo "... with 32 MB Flash" ; \
|
||||
echo "#define CONFIG_FLASH_32MB" >>include/config.h ; \
|
||||
echo "TEXT_BASE = 0x40000000" >board/pm826/config.tmp ; \
|
||||
else \
|
||||
echo "TEXT_BASE = 0xFF000000" >board/pm826/config.tmp ; \
|
||||
fi; \
|
||||
fi
|
||||
@./mkconfig -a PM826 ppc mpc8260 pm826
|
||||
|
||||
PM828_config \
|
||||
PM828_PCI_config \
|
||||
PM828_ROMBOOT_config \
|
||||
PM828_ROMBOOT_PCI_config: unconfig
|
||||
@if [ -z "$(findstring _PCI_,$@)" ] ; then \
|
||||
echo "#define CONFIG_PCI" >>include/config.h ; \
|
||||
echo "... with PCI enabled" ; \
|
||||
else \
|
||||
>include/config.h ; \
|
||||
fi
|
||||
@if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
|
||||
echo "... booting from 8-bit flash" ; \
|
||||
echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
|
||||
echo "TEXT_BASE = 0xFF800000" >board/pm826/config.tmp ; \
|
||||
fi
|
||||
@./mkconfig -a PM828 ppc mpc8260 pm828
|
||||
|
||||
ppmc8260_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
|
||||
@@ -897,15 +940,15 @@ ZUMA_config: unconfig
|
||||
## StrongARM Systems
|
||||
#########################################################################
|
||||
|
||||
at91rm9200dk_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
|
||||
dnp1110_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 dnp1110
|
||||
|
||||
gcplus_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 gcplus
|
||||
|
||||
lart_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 lart
|
||||
|
||||
dnp1110_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 dnp1110
|
||||
|
||||
shannon_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 shannon
|
||||
|
||||
@@ -917,6 +960,18 @@ xtract_trab = $(subst _bigram,,$(subst _bigflash,,$(subst _old,,$(subst _config,
|
||||
|
||||
xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
|
||||
|
||||
SX1_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t sx1
|
||||
|
||||
integratorcp_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorcp
|
||||
|
||||
integratorap_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorap
|
||||
|
||||
versatile_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs versatile
|
||||
|
||||
omap1510inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t omap1510inn
|
||||
|
||||
@@ -928,10 +983,10 @@ omap1610h2_cs0boot_config \
|
||||
omap1610h2_cs3boot_config : unconfig
|
||||
@if [ "$(findstring _cs0boot_, $@)" ] ; then \
|
||||
echo "#define CONFIG_CS0_BOOT" >> ./include/config.h ; \
|
||||
echo "Configured for CS0 boot"; \
|
||||
echo "... configured for CS0 boot"; \
|
||||
else \
|
||||
echo "#define CONFIG_CS3_BOOT" >> ./include/config.h ; \
|
||||
echo "Configured for CS3 boot"; \
|
||||
echo "... configured for CS3 boot"; \
|
||||
fi;
|
||||
@./mkconfig -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn
|
||||
|
||||
@@ -990,6 +1045,13 @@ ep7312_config : unconfig
|
||||
modnet50_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm720t modnet50
|
||||
|
||||
#########################################################################
|
||||
## AT91RM9200 Systems
|
||||
#########################################################################
|
||||
|
||||
at91rm9200dk_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
|
||||
|
||||
#########################################################################
|
||||
## XScale Systems
|
||||
#########################################################################
|
||||
@@ -1015,6 +1077,9 @@ logodl_config : unconfig
|
||||
wepep250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa wepep250
|
||||
|
||||
xm250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa xm250
|
||||
|
||||
#========================================================================
|
||||
# i386
|
||||
#========================================================================
|
||||
@@ -1116,6 +1181,24 @@ DK1S10_config: unconfig
|
||||
}
|
||||
@./mkconfig -a DK1S10 nios nios dk1s10 altera
|
||||
|
||||
ADNPESC1_DNPEVA2_base_32_config \
|
||||
ADNPESC1_base_32_config \
|
||||
ADNPESC1_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _DNPEVA2,$@)" ] || \
|
||||
{ echo "#define CONFIG_DNPEVA2 1" >>include/config.h ; \
|
||||
echo "... DNP/EVA2 configuration" ; \
|
||||
}
|
||||
@[ -z "$(findstring _base_32,$@)" ] || \
|
||||
{ echo "#define CONFIG_NIOS_BASE_32 1" >>include/config.h ; \
|
||||
echo "... NIOS 'base_32' configuration" ; \
|
||||
}
|
||||
@[ -z "$(findstring ADNPESC1_config,$@)" ] || \
|
||||
{ echo "#define CONFIG_NIOS_BASE_32 1" >>include/config.h ; \
|
||||
echo "... NIOS 'base_32' configuration (DEFAULT)" ; \
|
||||
}
|
||||
@./mkconfig -a ADNPESC1 nios nios adnpesc1 ssv
|
||||
|
||||
|
||||
#########################################################################
|
||||
## MIPS32 AU1X00
|
||||
@@ -1152,7 +1235,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/*/config.tmp
|
||||
rm -f board/trab/trab_fkt
|
||||
|
||||
clobber: clean
|
||||
find . -type f \
|
||||
|
||||
222
README
222
README
@@ -122,135 +122,45 @@ Directory Hierarchy:
|
||||
- board Board dependent files
|
||||
- common Misc architecture independent functions
|
||||
- cpu CPU specific files
|
||||
- 74xx_7xx Files specific to Motorola MPC74xx and 7xx CPUs
|
||||
- arm720t Files specific to ARM 720 CPUs
|
||||
- arm920t Files specific to ARM 920 CPUs
|
||||
- arm925t Files specific to ARM 925 CPUs
|
||||
- arm926ejs Files specific to ARM 926 CPUs
|
||||
- at91rm9200 Files specific to Atmel AT91RM9200 CPUs
|
||||
- i386 Files specific to i386 CPUs
|
||||
- ixp Files specific to Intel XScale IXP CPUs
|
||||
- mcf52x2 Files specific to Motorola ColdFire MCF52x2 CPUs
|
||||
- mips Files specific to MIPS CPUs
|
||||
- mpc5xx Files specific to Motorola MPC5xx CPUs
|
||||
- mpc5xxx Files specific to Motorola MPC5xxx CPUs
|
||||
- mpc8xx Files specific to Motorola MPC8xx CPUs
|
||||
- mpc824x Files specific to Motorola MPC824x CPUs
|
||||
- mpc8260 Files specific to Motorola MPC8260 CPUs
|
||||
- mpc85xx Files specific to Motorola MPC85xx CPUs
|
||||
- nios Files specific to Altera NIOS CPUs
|
||||
- ppc4xx Files specific to IBM PowerPC 4xx CPUs
|
||||
- pxa Files specific to Intel XScale PXA CPUs
|
||||
- s3c44b0 Files specific to Samsung S3C44B0 CPUs
|
||||
- sa1100 Files specific to Intel StrongARM SA1100 CPUs
|
||||
- disk Code for disk drive partition handling
|
||||
- doc Documentation (don't expect too much)
|
||||
- drivers Commonly used device drivers
|
||||
- dtt Digital Thermometer and Thermostat drivers
|
||||
- examples Example code for standalone applications, etc.
|
||||
- include Header Files
|
||||
- disk Harddisk interface code
|
||||
- lib_arm Files generic to ARM architecture
|
||||
- lib_generic Files generic to all architectures
|
||||
- lib_i386 Files generic to i386 architecture
|
||||
- lib_m68k Files generic to m68k architecture
|
||||
- lib_mips Files generic to MIPS architecture
|
||||
- lib_nios Files generic to NIOS architecture
|
||||
- lib_ppc Files generic to PowerPC architecture
|
||||
- net Networking code
|
||||
- ppc Files generic to PowerPC architecture
|
||||
- post Power On Self Test
|
||||
- post/arch Symlink to architecture specific Power On Self Test
|
||||
- post/arch-ppc PowerPC architecture specific Power On Self Test
|
||||
- post/cpu/mpc8260 MPC8260 CPU specific Power On Self Test
|
||||
- post/cpu/mpc8xx MPC8xx CPU specific Power On Self Test
|
||||
- rtc Real Time Clock drivers
|
||||
- tools Tools to build S-Record or U-Boot images, etc.
|
||||
|
||||
- cpu/74xx_7xx Files specific to Motorola MPC74xx and 7xx CPUs
|
||||
- cpu/arm925t Files specific to ARM 925 CPUs
|
||||
- cpu/arm926ejs Files specific to ARM 926 CPUs
|
||||
- cpu/mpc5xx Files specific to Motorola MPC5xx CPUs
|
||||
- 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
|
||||
|
||||
|
||||
- board/LEOX/ Files specific to boards manufactured by The LEOX team
|
||||
- board/LEOX/elpt860 Files specific to ELPT860 boards
|
||||
- board/RPXClassic
|
||||
Files specific to RPXClassic boards
|
||||
- board/RPXlite Files specific to RPXlite boards
|
||||
- board/at91rm9200dk Files specific to AT91RM9200DK boards
|
||||
- board/c2mon Files specific to c2mon boards
|
||||
- board/cmi Files specific to cmi boards
|
||||
- board/cogent Files specific to Cogent boards
|
||||
(need further configuration)
|
||||
Files specific to CPCIISER4 boards
|
||||
- board/cpu86 Files specific to CPU86 boards
|
||||
- board/cray/ Files specific to boards manufactured by Cray
|
||||
- board/cray/L1 Files specific to L1 boards
|
||||
- board/cu824 Files specific to CU824 boards
|
||||
- board/ebony Files specific to IBM Ebony board
|
||||
- board/eric Files specific to ERIC boards
|
||||
- board/esd/ Files specific to boards manufactured by ESD
|
||||
- board/esd/adciop Files specific to ADCIOP boards
|
||||
- board/esd/ar405 Files specific to AR405 boards
|
||||
- board/esd/canbt Files specific to CANBT boards
|
||||
- board/esd/cpci405 Files specific to CPCI405 boards
|
||||
- board/esd/cpciiser4 Files specific to CPCIISER4 boards
|
||||
- board/esd/common Common files for ESD boards
|
||||
- board/esd/dasa_sim Files specific to DASA_SIM boards
|
||||
- board/esd/du405 Files specific to DU405 boards
|
||||
- board/esd/ocrtc Files specific to OCRTC boards
|
||||
- board/esd/pci405 Files specific to PCI405 boards
|
||||
- board/esteem192e
|
||||
Files specific to ESTEEM192E boards
|
||||
- board/etx094 Files specific to ETX_094 boards
|
||||
- board/evb64260
|
||||
Files specific to EVB64260 boards
|
||||
- board/fads Files specific to FADS boards
|
||||
- board/flagadm Files specific to FLAGADM boards
|
||||
- board/gen860t Files specific to GEN860T and GEN860T_SC boards
|
||||
- board/genietv Files specific to GENIETV boards
|
||||
- board/gth Files specific to GTH boards
|
||||
- board/hermes Files specific to HERMES boards
|
||||
- board/hymod Files specific to HYMOD boards
|
||||
- board/icu862 Files specific to ICU862 boards
|
||||
- board/ip860 Files specific to IP860 boards
|
||||
- board/iphase4539
|
||||
Files specific to Interphase4539 boards
|
||||
- board/ivm Files specific to IVMS8/IVML24 boards
|
||||
- board/lantec Files specific to LANTEC boards
|
||||
- board/lwmon Files specific to LWMON boards
|
||||
- board/Marvell Files specific to Marvell development boards
|
||||
- board/Marvell/db64360 Files specific to db64360 board
|
||||
- board/Marvell/db64460 Files specific to db64460 board
|
||||
- board/mbx8xx Files specific to MBX boards
|
||||
- board/mpc8260ads
|
||||
Files specific to MPC826xADS and PQ2FADS-ZU/VR 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
|
||||
Files specific to OMAP 1610 Innovator and H2 boards
|
||||
- board/pcippc2 Files specific to PCIPPC2/PCIPPC6 boards
|
||||
- board/pm826 Files specific to PM826 boards
|
||||
- board/ppmc8260
|
||||
Files specific to PPMC8260 boards
|
||||
- board/snmc/qs850 Files specific to QS850/823 boards
|
||||
- board/snmc/qs860t Files specific to QS860T boards
|
||||
- board/rpxsuper
|
||||
Files specific to RPXsuper boards
|
||||
- board/rsdproto
|
||||
Files specific to RSDproto boards
|
||||
- board/sandpoint
|
||||
Files specific to Sandpoint boards
|
||||
- board/sbc8260 Files specific to SBC8260 boards
|
||||
- board/sacsng Files specific to SACSng boards
|
||||
- board/siemens Files specific to boards manufactured by Siemens AG
|
||||
- board/siemens/CCM Files specific to CCM boards
|
||||
- board/siemens/IAD210 Files specific to IAD210 boards
|
||||
- board/siemens/SCM Files specific to SCM boards
|
||||
- board/siemens/pcu_e Files specific to PCU_E boards
|
||||
- board/sixnet Files specific to SIXNET boards
|
||||
- board/spd8xx Files specific to SPD8xxTS boards
|
||||
- board/tqm8260 Files specific to TQM8260 boards
|
||||
- board/tqm8xx Files specific to TQM8xxL boards
|
||||
- board/w7o Files specific to W7O boards
|
||||
- board/walnut405
|
||||
Files specific to Walnut405 boards
|
||||
- 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:
|
||||
=======================
|
||||
|
||||
@@ -531,8 +441,8 @@ The following options need to be configured:
|
||||
(RTS/CTS) and UART's built-in FIFO. Set the number of
|
||||
bytes the interrupt driven input buffer should have.
|
||||
|
||||
Set to 0 to disable this feature (this is the default).
|
||||
This will also disable hardware handshake.
|
||||
Leave undefined to disable this feature, including
|
||||
disable the buffer and hardware handshake.
|
||||
|
||||
- Console UART Number:
|
||||
CONFIG_UART1_CONSOLE
|
||||
@@ -750,16 +660,31 @@ The following options need to be configured:
|
||||
one partition type as well.
|
||||
|
||||
- IDE Reset method:
|
||||
CONFIG_IDE_RESET_ROUTINE
|
||||
CONFIG_IDE_RESET_ROUTINE - this is defined in several
|
||||
board configurations files but used nowhere!
|
||||
|
||||
Set this to define that instead of a reset Pin, the
|
||||
routine ide_set_reset(int idereset) will be used.
|
||||
CONFIG_IDE_RESET - is this is defined, IDE Reset will
|
||||
be performed by calling the function
|
||||
ide_set_reset(int reset)
|
||||
which has to be defined in a board specific file
|
||||
|
||||
- ATAPI Support:
|
||||
CONFIG_ATAPI
|
||||
|
||||
Set this to enable ATAPI support.
|
||||
|
||||
- LBA48 Support
|
||||
CONFIG_LBA48
|
||||
|
||||
Set this to enable support for disks larger than 137GB
|
||||
Also look at CFG_64BIT_LBA ,CFG_64BIT_VSPRINTF and CFG_64BIT_STRTOUL
|
||||
Whithout these , LBA48 support uses 32bit variables and will 'only'
|
||||
support disks up to 2.1TB.
|
||||
|
||||
CFG_64BIT_LBA:
|
||||
When enabled, makes the IDE subsystem use 64bit sector addresses.
|
||||
Default is 32bit.
|
||||
|
||||
- SCSI Support:
|
||||
At the moment only there is only support for the
|
||||
SYM53C8XX SCSI controller; define
|
||||
@@ -806,7 +731,7 @@ The following options need to be configured:
|
||||
|
||||
- USB Support:
|
||||
At the moment only the UHCI host controller is
|
||||
supported (PIP405, MIP405); define
|
||||
supported (PIP405, MIP405, MPC5200); define
|
||||
CONFIG_USB_UHCI to enable it.
|
||||
define CONFIG_USB_KEYBOARD to enable the USB Keyboard
|
||||
end define CONFIG_USB_STORAGE to enable the USB
|
||||
@@ -814,6 +739,13 @@ The following options need to be configured:
|
||||
Note:
|
||||
Supported are USB Keyboards and USB Floppy drives
|
||||
(TEAC FD-05PUB).
|
||||
MPC5200 USB requires additional defines:
|
||||
CONFIG_USB_CLOCK
|
||||
for 528 MHz Clock: 0x0001bbbb
|
||||
CONFIG_USB_CONFIG
|
||||
for differential drivers: 0x00001000
|
||||
for single ended drivers: 0x00005000
|
||||
|
||||
|
||||
- MMC Support:
|
||||
The MMC controller on the Intel PXA is supported. To
|
||||
@@ -846,17 +778,30 @@ The following options need to be configured:
|
||||
Enable Chips & Technologies 69000 Video chip
|
||||
|
||||
CONFIG_VIDEO_SMI_LYNXEM
|
||||
Enable Silicon Motion SMI 712/710/810 Video chip
|
||||
Videomode are selected via environment 'videomode' with
|
||||
standard LiLo mode numbers.
|
||||
Following modes are supported (* is default):
|
||||
Enable Silicon Motion SMI 712/710/810 Video chip. The
|
||||
video output is selected via environment 'videoout'
|
||||
(1 = LCD and 2 = CRT). If videoout is undefined, CRT is
|
||||
assumed.
|
||||
|
||||
800x600 1024x768 1280x1024
|
||||
256 (8bit) 303* 305 307
|
||||
65536 (16bit) 314 317 31a
|
||||
16,7 Mill (24bit) 315 318 31b
|
||||
For the CT69000 and SMI_LYNXEM drivers, videomode is
|
||||
selected via environment 'videomode'. Two diferent ways
|
||||
are possible:
|
||||
- "videomode=num" 'num' is a standard LiLo mode numbers.
|
||||
Following standard modes are supported (* is default):
|
||||
|
||||
Colors 640x480 800x600 1024x768 1152x864 1280x1024
|
||||
-------------+---------------------------------------------
|
||||
8 bits | 0x301* 0x303 0x305 0x161 0x307
|
||||
15 bits | 0x310 0x313 0x316 0x162 0x319
|
||||
16 bits | 0x311 0x314 0x317 0x163 0x31A
|
||||
24 bits | 0x312 0x315 0x318 ? 0x31B
|
||||
-------------+---------------------------------------------
|
||||
(i.e. setenv videomode 317; saveenv; reset;)
|
||||
|
||||
- "videomode=bootargs" all the video parameters are parsed
|
||||
from the bootargs. (See drivers/videomodes.c)
|
||||
|
||||
|
||||
CONFIG_VIDEO_SED13806
|
||||
Enable Epson SED13806 driver. This driver supports 8bpp
|
||||
and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP
|
||||
@@ -1412,9 +1357,9 @@ The following options need to be configured:
|
||||
14 common/cmd_bootm.c No initial ramdisk, no multifile, continue.
|
||||
15 common/cmd_bootm.c All preparation done, transferring control to OS
|
||||
|
||||
-30 lib_ppc/board.c Fatal error, hang the system
|
||||
-31 post/post.c POST test failed, detected by post_output_backlog()
|
||||
-32 post/post.c POST test failed, detected by post_run_single()
|
||||
-30 lib_ppc/board.c Fatal error, hang the system
|
||||
-31 post/post.c POST test failed, detected by post_output_backlog()
|
||||
-32 post/post.c POST test failed, detected by post_run_single()
|
||||
|
||||
-1 common/cmd_doc.c Bad usage of "doc" command
|
||||
-1 common/cmd_doc.c No boot device
|
||||
@@ -1803,6 +1748,13 @@ use the "saveenv" command to store a valid environment.
|
||||
- CFG_FAULT_MII_ADDR:
|
||||
MII address of the PHY to check for the Ethernet link state.
|
||||
|
||||
- CFG_64BIT_VSPRINTF:
|
||||
Makes vsprintf (and all *printf functions) support printing
|
||||
of 64bit values by using the L quantifier
|
||||
|
||||
- CFG_64BIT_STRTOUL:
|
||||
Adds simple_strtoull that returns a 64bit value
|
||||
|
||||
Low Level (hardware related) configuration options:
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ int misc_init_f (void)
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
#if CONFIG_CMA111
|
||||
#ifdef CONFIG_CMA111
|
||||
return (32L * 1024L * 1024L);
|
||||
#else
|
||||
unsigned char dipsw_val;
|
||||
|
||||
@@ -41,10 +41,10 @@ ulong flash_int_get_size (volatile unsigned long *baseaddr,
|
||||
info->sector_count = info->size = 0;
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
|
||||
/* Write query command sequence and test FLASH answer
|
||||
/* Write identify command sequence and test FLASH answer
|
||||
*/
|
||||
baseaddr[0] = 0x00980098;
|
||||
baseaddr[1] = 0x00980098;
|
||||
baseaddr[0] = 0x00900090;
|
||||
baseaddr[1] = 0x00900090;
|
||||
|
||||
flashtest_h = baseaddr[0]; /* manufacturer ID */
|
||||
flashtest_l = baseaddr[1];
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <asm/u-boot.h>
|
||||
#include <asm/processor.h>
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <i2c.h>
|
||||
#include <miiphy.h>
|
||||
#include <405gp_enet.h>
|
||||
@@ -57,10 +56,10 @@ int pll_init(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* board_pre_init: do any preliminary board initialization
|
||||
* board_early_init_f: do early board initialization
|
||||
*
|
||||
*/
|
||||
int board_pre_init(void)
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
/* initialize PLL so UART, LCD, Ethernet clocked at correctly */
|
||||
(void) get_clocks();
|
||||
|
||||
@@ -45,9 +45,6 @@ unsigned long flash_init (void)
|
||||
#else
|
||||
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) {
|
||||
|
||||
@@ -51,7 +51,7 @@ SECTIONS
|
||||
armboot_end_data = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
|
||||
armboot_end = .;
|
||||
_end = .;
|
||||
}
|
||||
|
||||
41
board/eXalion/Makefile
Normal file
41
board/eXalion/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# (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
|
||||
SOBJS =
|
||||
|
||||
$(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
|
||||
|
||||
#########################################################################
|
||||
31
board/eXalion/config.mk
Normal file
31
board/eXalion/config.mk
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# (C) Copyright 2000, 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
|
||||
#
|
||||
|
||||
#
|
||||
# Sandpoint boards
|
||||
#
|
||||
|
||||
#TEXT_BASE = 0x00090000
|
||||
TEXT_BASE = 0xFFF00000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
|
||||
292
board/eXalion/eXalion.c
Normal file
292
board/eXalion/eXalion.c
Normal file
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Torsten Demke, FORCE Computers GmbH. torsten.demke@fci.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 <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <pci.h>
|
||||
#include <ide.h>
|
||||
#include "piix_pci.h"
|
||||
#include "eXalion.h"
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
ulong busfreq = get_bus_freq (0);
|
||||
char buf[32];
|
||||
|
||||
printf ("Board: eXalion MPC824x - CHRP (MAP B)\n");
|
||||
printf ("Built: %s at %s\n", __DATE__, __TIME__);
|
||||
printf ("Local Bus: %s MHz\n", strmhz (buf, busfreq));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkflash (void)
|
||||
{
|
||||
printf ("checkflash\n");
|
||||
flash_init ();
|
||||
return (0);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
pci_dev_t bdf;
|
||||
u32 val32;
|
||||
u8 val8;
|
||||
|
||||
puts ("ISA: ");
|
||||
bdf = pci_find_device (PIIX4_VENDOR_ID, PIIX4_ISA_DEV_ID, 0);
|
||||
if (bdf == -1) {
|
||||
puts ("Unable to find PIIX4 ISA bridge !\n");
|
||||
hang ();
|
||||
}
|
||||
|
||||
/* set device for normal ISA instead EIO */
|
||||
pci_read_config_dword (bdf, PCI_CFG_PIIX4_GENCFG, &val32);
|
||||
val32 |= 0x00000001;
|
||||
pci_write_config_dword (bdf, PCI_CFG_PIIX4_GENCFG, val32);
|
||||
printf ("PIIX4 ISA bridge (%d,%d,%d)\n", PCI_BUS (bdf),
|
||||
PCI_DEV (bdf), PCI_FUNC (bdf));
|
||||
|
||||
puts ("ISA: ");
|
||||
bdf = pci_find_device (PIIX4_VENDOR_ID, PIIX4_IDE_DEV_ID, 0);
|
||||
if (bdf == -1) {
|
||||
puts ("Unable to find PIIX4 IDE controller !\n");
|
||||
hang ();
|
||||
}
|
||||
|
||||
/* Init BMIBA register */
|
||||
/* pci_read_config_dword(bdf, PCI_CFG_PIIX4_BMIBA, &val32); */
|
||||
/* val32 |= 0x1000; */
|
||||
/* pci_write_config_dword(bdf, PCI_CFG_PIIX4_BMIBA, val32); */
|
||||
|
||||
/* Enable BUS master and IO access */
|
||||
val32 = PCI_COMMAND_MASTER | PCI_COMMAND_IO;
|
||||
pci_write_config_dword (bdf, PCI_COMMAND, val32);
|
||||
|
||||
/* Set latency */
|
||||
pci_read_config_byte (bdf, PCI_LATENCY_TIMER, &val8);
|
||||
val8 = 0x40;
|
||||
pci_write_config_byte (bdf, PCI_LATENCY_TIMER, val8);
|
||||
|
||||
/* Enable Primary ATA/IDE */
|
||||
pci_read_config_dword (bdf, PCI_CFG_PIIX4_IDETIM, &val32);
|
||||
/* val32 = 0xa307a307; */
|
||||
val32 = 0x00008000;
|
||||
pci_write_config_dword (bdf, PCI_CFG_PIIX4_IDETIM, val32);
|
||||
|
||||
|
||||
printf ("PIIX4 IDE controller (%d,%d,%d)\n", PCI_BUS (bdf),
|
||||
PCI_DEV (bdf), PCI_FUNC (bdf));
|
||||
|
||||
/* Try to get FAT working... */
|
||||
/* fat_register_read(ide_read); */
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show/Init PCI devices on the specified bus number.
|
||||
*/
|
||||
|
||||
void pci_eXalion_fixup_irq (struct pci_controller *hose, pci_dev_t dev)
|
||||
{
|
||||
unsigned char line;
|
||||
|
||||
switch (PCI_DEV (dev)) {
|
||||
case 16:
|
||||
line = PCI_INT_A;
|
||||
break;
|
||||
case 17:
|
||||
line = PCI_INT_B;
|
||||
break;
|
||||
case 18:
|
||||
line = PCI_INT_C;
|
||||
break;
|
||||
case 19:
|
||||
line = PCI_INT_D;
|
||||
break;
|
||||
#if defined (CONFIG_MPC8245)
|
||||
case 20:
|
||||
line = PCI_INT_A;
|
||||
break;
|
||||
case 21:
|
||||
line = PCI_INT_B;
|
||||
break;
|
||||
case 22:
|
||||
line = PCI_INT_NA;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
line = PCI_INT_A;
|
||||
break;
|
||||
}
|
||||
pci_hose_write_config_byte (hose, dev, PCI_INTERRUPT_LINE, line);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize PCI Devices, report devices found.
|
||||
*/
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
#if defined (CONFIG_MPC8240)
|
||||
static struct pci_config_table pci_eXalion_config_table[] = {
|
||||
{
|
||||
/* Intel 82559ER ethernet controller */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 18, 0x00,
|
||||
pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Intel 82371AB PIIX4 PCI to ISA bridge */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 20, 0x00,
|
||||
pci_cfgfunc_config_device, {0,
|
||||
0,
|
||||
PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Intel 82371AB PIIX4 IDE controller */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 20, 0x01,
|
||||
pci_cfgfunc_config_device, {0,
|
||||
0,
|
||||
PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
|
||||
{}
|
||||
};
|
||||
#elif defined (CONFIG_MPC8245)
|
||||
static struct pci_config_table pci_eXalion_config_table[] = {
|
||||
{
|
||||
/* Intel 82559ER ethernet controller */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 17, 0x00,
|
||||
pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Intel 82559ER ethernet controller */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 18, 0x00,
|
||||
pci_cfgfunc_config_device, {PCI_ENET1_IOADDR,
|
||||
PCI_ENET1_MEMADDR,
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Broadcom BCM5690 Gigabit switch */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 20, 0x00,
|
||||
pci_cfgfunc_config_device, {PCI_ENET2_IOADDR,
|
||||
PCI_ENET2_MEMADDR,
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Broadcom BCM5690 Gigabit switch */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 21, 0x00,
|
||||
pci_cfgfunc_config_device, {PCI_ENET3_IOADDR,
|
||||
PCI_ENET3_MEMADDR,
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Intel 82371AB PIIX4 PCI to ISA bridge */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 22, 0x00,
|
||||
pci_cfgfunc_config_device, {0,
|
||||
0,
|
||||
PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
|
||||
{
|
||||
/* Intel 82371AB PIIX4 IDE controller */
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 22, 0x01,
|
||||
pci_cfgfunc_config_device, {0,
|
||||
0,
|
||||
PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
|
||||
{}
|
||||
};
|
||||
#else
|
||||
#error Specific type of MPC824x must be defined (i.e. CONFIG_MPC8240)
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef CONFIG_PCI_PNP */
|
||||
|
||||
struct pci_controller hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table:pci_eXalion_config_table,
|
||||
fixup_irq:pci_eXalion_fixup_irq,
|
||||
#endif
|
||||
};
|
||||
|
||||
void pci_init_board (void)
|
||||
{
|
||||
pci_mpc824x_init (&hose);
|
||||
}
|
||||
52
board/eXalion/eXalion.h
Normal file
52
board/eXalion/eXalion.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Torsten Demke, FORCE Computers GmbH. torsten.demke@fci.com
|
||||
*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* James Dougherty (jfd@broadcom.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
|
||||
*/
|
||||
|
||||
#ifndef __EXALION_H
|
||||
#define __EXALION_H
|
||||
|
||||
/* IRQ settings */
|
||||
#define PCI_INT_NA (0xff) /* PCI Intr. not used */
|
||||
#define PCI_INT_A (0x09) /* PCI Intr. A Interrupt Request Line Nr. */
|
||||
#define PCI_INT_B (0x0a) /* PCI Intr. B Interrupt Request Line Nr. */
|
||||
#define PCI_INT_C (0x0b) /* PCI Intr. C Interrupt Request Line Nr. */
|
||||
#define PCI_INT_D (0x0c) /* PCI Intr. D Interrupt Request Line Nr. */
|
||||
#if defined (CPU_MPC8245)
|
||||
#define LN_1_INT PCI_INT_B /* ethernet interrupt level */
|
||||
#define LN_2_INT PCI_INT_C /* ethernet interrupt level */
|
||||
#define BCM_1_INT PCI_INT_A /* BCM5690 interrupt level */
|
||||
#define BCM_2_INT PCI_INT_B /* BCM5690 interrupt level */
|
||||
#elif defined (CPU_MPC8240)
|
||||
#define BCM_INT PCI_INT_B /* BCM5600 interrupt level */
|
||||
#define LN_INT PCI_INT_C /* ethernet interrupt level */
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif /* __EXALION_H */
|
||||
172
board/eXalion/piix_pci.h
Normal file
172
board/eXalion/piix_pci.h
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Torsten Demke, FORCE Computers GmbH. torsten.demke@fci.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
|
||||
*/
|
||||
#ifndef _PIIX4_PCI_H
|
||||
#define _PIIX4_PCI_H
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc824x.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <pci.h>
|
||||
|
||||
#define PIIX4_VENDOR_ID 0x8086
|
||||
#define PIIX4_ISA_DEV_ID 0x7110
|
||||
#define PIIX4_IDE_DEV_ID 0x7111
|
||||
|
||||
/* Function 0 ISA Bridge */
|
||||
#define PCI_CFG_PIIX4_IORT 0x4C /* 8 bit ISA Recovery Timer Reg (default 0x4D) */
|
||||
#define PCI_CFG_PIIX4_XBCS 0x4E /* 16 bit XBus Chip select reg (default 0x0003) */
|
||||
#define PCI_CFG_PIIX4_PIRQC 0x60 /* PCI IRQ Route Register 4 x 8bit (default )*/
|
||||
#define PCI_CFG_PIIX4_SERIRQ 0x64
|
||||
#define PCI_CFG_PIIX4_TOM 0x69
|
||||
#define PCI_CFG_PIIX4_MSTAT 0x6A
|
||||
#define PCI_CFG_PIIX4_MBDMA 0x76
|
||||
#define PCI_CFG_PIIX4_APICBS 0x80
|
||||
#define PCI_CFG_PIIX4_DLC 0x82
|
||||
#define PCI_CFG_PIIX4_PDMACFG 0x90
|
||||
#define PCI_CFG_PIIX4_DDMABS 0x92
|
||||
#define PCI_CFG_PIIX4_GENCFG 0xB0
|
||||
#define PCI_CFG_PIIX4_RTCCFG 0xCB
|
||||
|
||||
/* IO Addresses */
|
||||
#define PIIX4_ISA_DMA1_CH0BA 0x00
|
||||
#define PIIX4_ISA_DMA1_CH0CA 0x01
|
||||
#define PIIX4_ISA_DMA1_CH1BA 0x02
|
||||
#define PIIX4_ISA_DMA1_CH1CA 0x03
|
||||
#define PIIX4_ISA_DMA1_CH2BA 0x04
|
||||
#define PIIX4_ISA_DMA1_CH2CA 0x05
|
||||
#define PIIX4_ISA_DMA1_CH3BA 0x06
|
||||
#define PIIX4_ISA_DMA1_CH3CA 0x07
|
||||
#define PIIX4_ISA_DMA1_CMDST 0x08
|
||||
#define PIIX4_ISA_DMA1_REQ 0x09
|
||||
#define PIIX4_ISA_DMA1_WSBM 0x0A
|
||||
#define PIIX4_ISA_DMA1_CH_MOD 0x0B
|
||||
#define PIIX4_ISA_DMA1_CLR_PT 0x0C
|
||||
#define PIIX4_ISA_DMA1_M_CLR 0x0D
|
||||
#define PIIX4_ISA_DMA1_CLR_M 0x0E
|
||||
#define PIIX4_ISA_DMA1_RWAMB 0x0F
|
||||
|
||||
#define PIIX4_ISA_DMA2_CH0BA 0xC0
|
||||
#define PIIX4_ISA_DMA2_CH0CA 0xC1
|
||||
#define PIIX4_ISA_DMA2_CH1BA 0xC2
|
||||
#define PIIX4_ISA_DMA2_CH1CA 0xC3
|
||||
#define PIIX4_ISA_DMA2_CH2BA 0xC4
|
||||
#define PIIX4_ISA_DMA2_CH2CA 0xC5
|
||||
#define PIIX4_ISA_DMA2_CH3BA 0xC6
|
||||
#define PIIX4_ISA_DMA2_CH3CA 0xC7
|
||||
#define PIIX4_ISA_DMA2_CMDST 0xD0
|
||||
#define PIIX4_ISA_DMA2_REQ 0xD2
|
||||
#define PIIX4_ISA_DMA2_WSBM 0xD4
|
||||
#define PIIX4_ISA_DMA2_CH_MOD 0xD6
|
||||
#define PIIX4_ISA_DMA2_CLR_PT 0xD8
|
||||
#define PIIX4_ISA_DMA2_M_CLR 0xDA
|
||||
#define PIIX4_ISA_DMA2_CLR_M 0xDC
|
||||
#define PIIX4_ISA_DMA2_RWAMB 0xDE
|
||||
|
||||
#define PIIX4_ISA_INT1_ICW1 0x20
|
||||
#define PIIX4_ISA_INT1_OCW2 0x20
|
||||
#define PIIX4_ISA_INT1_OCW3 0x20
|
||||
#define PIIX4_ISA_INT1_ICW2 0x21
|
||||
#define PIIX4_ISA_INT1_ICW3 0x21
|
||||
#define PIIX4_ISA_INT1_ICW4 0x21
|
||||
#define PIIX4_ISA_INT1_OCW1 0x21
|
||||
|
||||
#define PIIX4_ISA_INT1_ELCR 0x4D0
|
||||
|
||||
#define PIIX4_ISA_INT2_ICW1 0xA0
|
||||
#define PIIX4_ISA_INT2_OCW2 0xA0
|
||||
#define PIIX4_ISA_INT2_OCW3 0xA0
|
||||
#define PIIX4_ISA_INT2_ICW2 0xA1
|
||||
#define PIIX4_ISA_INT2_ICW3 0xA1
|
||||
#define PIIX4_ISA_INT2_ICW4 0xA1
|
||||
#define PIIX4_ISA_INT2_OCW1 0xA1
|
||||
#define PIIX4_ISA_INT2_IMR 0xA1 /* read only */
|
||||
|
||||
#define PIIX4_ISA_INT2_ELCR 0x4D1
|
||||
|
||||
#define PIIX4_ISA_TMR0_CNT_ST 0x40
|
||||
#define PIIX4_ISA_TMR1_CNT_ST 0x41
|
||||
#define PIIX4_ISA_TMR2_CNT_ST 0x42
|
||||
#define PIIX4_ISA_TMR_TCW 0x43
|
||||
|
||||
#define PIIX4_ISA_RST_XBUS 0x60
|
||||
|
||||
#define PIIX4_ISA_NMI_CNT_ST 0x61
|
||||
#define PIIX4_ISA_NMI_ENABLE 0x70
|
||||
|
||||
#define PIIX4_ISA_RTC_INDEX 0x70
|
||||
#define PIIX4_ISA_RTC_DATA 0x71
|
||||
#define PIIX4_ISA_RTCEXT_IND 0x70
|
||||
#define PIIX4_ISA_RTCEXT_DATA 0x71
|
||||
|
||||
#define PIIX4_ISA_DMA1_CH2LPG 0x81
|
||||
#define PIIX4_ISA_DMA1_CH3LPG 0x82
|
||||
#define PIIX4_ISA_DMA1_CH1LPG 0x83
|
||||
#define PIIX4_ISA_DMA1_CH0LPG 0x87
|
||||
#define PIIX4_ISA_DMA2_CH2LPG 0x89
|
||||
#define PIIX4_ISA_DMA2_CH3LPG 0x8A
|
||||
#define PIIX4_ISA_DMA2_CH1LPG 0x8B
|
||||
#define PIIX4_ISA_DMA2_LPGRFR 0x8F
|
||||
|
||||
#define PIIX4_ISA_PORT_92 0x92
|
||||
|
||||
#define PIIX4_ISA_APM_CONTRL 0xB2
|
||||
#define PIIX4_ISA_APM_STATUS 0xB3
|
||||
|
||||
#define PIIX4_ISA_COCPU_ERROR 0xF0
|
||||
|
||||
/* Function 1 IDE Controller */
|
||||
#define PCI_CFG_PIIX4_BMIBA 0x20
|
||||
#define PCI_CFG_PIIX4_IDETIM 0x40
|
||||
#define PCI_CFG_PIIX4_SIDETIM 0x44
|
||||
#define PCI_CFG_PIIX4_UDMACTL 0x48
|
||||
#define PCI_CFG_PIIX4_UDMATIM 0x4A
|
||||
|
||||
/* Function 2 USB Controller */
|
||||
#define PCI_CFG_PIIX4_SBRNUM 0x60
|
||||
#define PCI_CFG_PIIX4_LEGSUP 0xC0
|
||||
|
||||
/* Function 3 Power Management */
|
||||
#define PCI_CFG_PIIX4_PMAB 0x40
|
||||
#define PCI_CFG_PIIX4_CNTA 0x44
|
||||
#define PCI_CFG_PIIX4_CNTB 0x48
|
||||
#define PCI_CFG_PIIX4_GPICTL 0x4C
|
||||
#define PCI_CFG_PIIX4_DEVRESD 0x50
|
||||
#define PCI_CFG_PIIX4_DEVACTA 0x54
|
||||
#define PCI_CFG_PIIX4_DEVACTB 0x58
|
||||
#define PCI_CFG_PIIX4_DEVRESA 0x5C
|
||||
#define PCI_CFG_PIIX4_DEVRESB 0x60
|
||||
#define PCI_CFG_PIIX4_DEVRESC 0x64
|
||||
#define PCI_CFG_PIIX4_DEVRESE 0x68
|
||||
#define PCI_CFG_PIIX4_DEVRESF 0x6C
|
||||
#define PCI_CFG_PIIX4_DEVRESG 0x70
|
||||
#define PCI_CFG_PIIX4_DEVRESH 0x74
|
||||
#define PCI_CFG_PIIX4_DEVRESI 0x78
|
||||
#define PCI_CFG_PIIX4_PMMISC 0x80
|
||||
#define PCI_CFG_PIIX4_SMBBA 0x90
|
||||
|
||||
|
||||
#endif /* _PIIX4_PCI_H */
|
||||
133
board/eXalion/u-boot.lds
Normal file
133
board/eXalion/u-boot.lds
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc824x/start.o (.text)
|
||||
lib_ppc/board.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
. = DEFINED(env_offset) ? env_offset : .;
|
||||
common/environment.o (.text)
|
||||
|
||||
*(.text)
|
||||
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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 = .);
|
||||
}
|
||||
@@ -40,9 +40,11 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
#define FLASH_CYCLE2 0x02aa
|
||||
#define FLASH_ID1 0
|
||||
#define FLASH_ID2 1
|
||||
#define FLASH_ID3 0x0e
|
||||
#define FLASH_ID4 0x0F
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_TOP5200)
|
||||
#if defined (CONFIG_TOP5200) && !defined (CONFIG_LITE5200)
|
||||
typedef unsigned char FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned char FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFF
|
||||
@@ -54,6 +56,24 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
#define FLASH_CYCLE2 0x0555
|
||||
#define FLASH_ID1 0
|
||||
#define FLASH_ID2 2
|
||||
#define FLASH_ID3 0x1c
|
||||
#define FLASH_ID4 0x1E
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_TOP5200) && defined (CONFIG_LITE5200)
|
||||
typedef unsigned char FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned char FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFF
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define FLASH_CYCLE1 0x0555
|
||||
#define FLASH_CYCLE2 0x02aa
|
||||
#define FLASH_ID1 0
|
||||
#define FLASH_ID2 1
|
||||
#define FLASH_ID3 0x0E
|
||||
#define FLASH_ID4 0x0F
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
@@ -183,6 +203,15 @@ void flash_print_info (flash_info_t *info)
|
||||
case FLASH_AM160B:
|
||||
fmt = "29LV160%s (16 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_AMLV640U:
|
||||
fmt = "29LV640M (64 Mbit)\n";
|
||||
break;
|
||||
case FLASH_AMDLV065D:
|
||||
fmt = "29LV065D (64 Mbit)\n";
|
||||
break;
|
||||
case FLASH_AMLV256U:
|
||||
fmt = "29LV256M (256 Mbit)\n";
|
||||
break;
|
||||
default:
|
||||
fmt = "Unknown Chip Type\n";
|
||||
break;
|
||||
@@ -239,7 +268,6 @@ void flash_print_info (flash_info_t *info)
|
||||
ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
ulong offset;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
/* Write auto select command sequence and test FLASH answer */
|
||||
@@ -278,27 +306,64 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
#ifdef CFG_LOWBOOT
|
||||
offset = 0;
|
||||
#else
|
||||
offset = 0x00e00000;
|
||||
#endif
|
||||
info->start[0] = (ulong)addr + offset;
|
||||
info->start[1] = (ulong)addr + offset + 0x4000;
|
||||
info->start[2] = (ulong)addr + offset + 0x6000;
|
||||
info->start[3] = (ulong)addr + offset + 0x8000;
|
||||
info->start[0] = (ulong)addr;
|
||||
info->start[1] = (ulong)addr + 0x4000;
|
||||
info->start[2] = (ulong)addr + 0x6000;
|
||||
info->start[3] = (ulong)addr + 0x8000;
|
||||
for (i = 4; i < info->sector_count; i++)
|
||||
{
|
||||
info->start[i] = (ulong)addr + offset + 0x10000 * (i-3);
|
||||
info->start[i] = (ulong)addr + 0x10000 * (i-3);
|
||||
}
|
||||
break;
|
||||
|
||||
case (FPW)AMD_ID_LV065D:
|
||||
info->flash_id += FLASH_AMDLV065D;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000;
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
info->start[i] = (ulong)addr + 0x10000 * i;
|
||||
}
|
||||
break;
|
||||
|
||||
case (FPW)AMD_ID_MIRROR:
|
||||
/* MIRROR BIT FLASH, read more ID bytes */
|
||||
if ((FPW)addr[FLASH_ID3] == (FPW)AMD_ID_LV640U_2 &&
|
||||
(FPW)addr[FLASH_ID4] == (FPW)AMD_ID_LV640U_3)
|
||||
{
|
||||
info->flash_id += FLASH_AMLV640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000;
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
info->start[i] = (ulong)addr + 0x10000 * i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ((FPW)addr[FLASH_ID3] == (FPW)AMD_ID_LV256U_2 &&
|
||||
(FPW)addr[FLASH_ID4] == (FPW)AMD_ID_LV256U_3)
|
||||
{
|
||||
/* attention: only the first 16 MB will be used in u-boot */
|
||||
info->flash_id += FLASH_AMLV256U;
|
||||
info->sector_count = 256;
|
||||
info->size = 0x01000000;
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
info->start[i] = (ulong)addr + 0x10000 * i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* fall thru to here ! */
|
||||
default:
|
||||
printf ("unknown AMD device=%x ", (FPW)addr[FLASH_ID2]);
|
||||
printf ("unknown AMD device=%x %x %x",
|
||||
(FPW)addr[FLASH_ID2],
|
||||
(FPW)addr[FLASH_ID3],
|
||||
(FPW)addr[FLASH_ID4]);
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* => no or unknown flash */
|
||||
info->size = 0x800000;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Put FLASH back in read mode */
|
||||
@@ -329,6 +394,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM160B:
|
||||
case FLASH_AMLV640U:
|
||||
break;
|
||||
case FLASH_UNKNOWN:
|
||||
default:
|
||||
|
||||
@@ -57,7 +57,7 @@ long int initdram (int board_type)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = CFG_DRAM_CONTROL | MODE_EN;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = CFG_DRAM_CONTROL | MODE_EN | SOFT_PRE;
|
||||
#if CFG_DRAM_DDR
|
||||
#ifdef CFG_DRAM_DDR
|
||||
/* set extended mode register */
|
||||
*(vu_short *)MPC5XXX_SDRAM_MODE = CFG_DRAM_EMODE;
|
||||
#endif
|
||||
@@ -113,11 +113,15 @@ int checkboard (void)
|
||||
#if defined (CONFIG_EVAL5200)
|
||||
puts ("Board: EMK TOP5200 on EVAL5200\n");
|
||||
#else
|
||||
#if defined (CONFIG_LITE5200)
|
||||
puts ("Board: LITE5200\n");
|
||||
#else
|
||||
#if defined (CONFIG_MINI5200)
|
||||
puts ("Board: EMK TOP5200 on MINI5200\n");
|
||||
#else
|
||||
puts ("Board: EMK TOP5200\n");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -155,10 +159,11 @@ void flash_afterinit(uint bank, ulong start, ulong size)
|
||||
*****************************************************************************/
|
||||
int misc_init_r (void)
|
||||
{
|
||||
#if !defined (CONFIG_LITE5200)
|
||||
/* read 'factory' part of EEPROM */
|
||||
extern void read_factory_r (void);
|
||||
read_factory_r ();
|
||||
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -175,3 +180,23 @@ void pci_init_board(void)
|
||||
pci_mpc5xxx_init(&hose);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* provide the PCI Reset Function
|
||||
*****************************************************************************/
|
||||
#ifdef CFG_CMD_IDE
|
||||
#define GPIO_PSC1_4 0x01000000ul
|
||||
void ide_set_reset (int idereset)
|
||||
{
|
||||
if (idereset) {
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_DATA &= ~GPIO_PSC1_4;
|
||||
} else {
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
|
||||
}
|
||||
|
||||
/* Configure PSC1_4 as GPIO output for ATA reset */
|
||||
/* (it does not matter we do this every time) */
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
|
||||
}
|
||||
#endif
|
||||
|
||||
49
board/gcplus/Makefile
Normal file
49
board/gcplus/Makefile
Normal file
@@ -0,0 +1,49 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# 2003 (c) MontaVista Software, 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
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := gcplus.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
13
board/gcplus/config.mk
Normal file
13
board/gcplus/config.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# ADS GCPlus board with SA1110 cpu
|
||||
#
|
||||
# The ADS GCPlus has 2 banks of 16 MiB SDRAM
|
||||
#
|
||||
# We use the ADS GCPlus Linux boot ROM to load U-Boot into SDRAM
|
||||
# at c020'0000 and then move ourself to c8f0'0000. Basically, just
|
||||
# install the U-Boot binary as you would the Linux zImage and then
|
||||
# reap the benfits of more convenient Linux development cycles, i.e.
|
||||
# bootp;tftp;bootm, repeat, etc.,.
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xc8f00000
|
||||
440
board/gcplus/flash.c
Normal file
440
board/gcplus/flash.c
Normal file
@@ -0,0 +1,440 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* 2003 (c) MontaVista Software, 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
|
||||
*/
|
||||
|
||||
#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 */
|
||||
#define FLASH_PORT_WIDTH32
|
||||
#undef FLASH_PORT_WIDTH16
|
||||
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
#define FLASH_PORT_WIDTH ushort
|
||||
#define FLASH_PORT_WIDTHV vu_short
|
||||
#define SWAP(x) __swab16(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 too 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 + monitor_flash_len - 1, &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;
|
||||
case FLASH_28F640J5:
|
||||
printf("28F640J5\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 */
|
||||
case (FPW) INTEL_ID_28F640J5:
|
||||
info->flash_id += FLASH_28F640J5;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x01000000;
|
||||
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, start, last;
|
||||
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");
|
||||
}
|
||||
|
||||
start = get_timer(0);
|
||||
last = start;
|
||||
|
||||
/* 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, *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;
|
||||
}
|
||||
73
board/gcplus/gcplus.c
Normal file
73
board/gcplus/gcplus.c
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* 2003-2004 (c) MontaVista Software, 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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <SA-1100.h>
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Miscelaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int
|
||||
board_init(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_arch_number = 29; /* ADS GraphicsClientPlus Board */
|
||||
|
||||
gd->bd->bi_boot_params = 0xc000003c; /* Weird address? */
|
||||
|
||||
/* Most of the ADS GCPlus I/O is connected to Static nCS2.
|
||||
* So I'm brute forcing nCS2 timiming here for worst case.
|
||||
*/
|
||||
MSC1 &= ~0xFFFF;
|
||||
MSC1 |= 0x8649;
|
||||
|
||||
/* Nothing is connected to Static nCS4 or nCS5. But I'm using
|
||||
* nCS4 as a paranoia safe guard to force nCS2, nOE; nWE high
|
||||
* after accessing I/O via (non-VLIO) nCS2. What can I say, I'm
|
||||
* paranoid and lack decent tools to alleviate my fear. I sure
|
||||
* do wish I had a logic analyzer. : (
|
||||
*/
|
||||
|
||||
MSC2 = 0xfff9fff9;
|
||||
|
||||
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;
|
||||
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
|
||||
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
|
||||
|
||||
return (0);
|
||||
}
|
||||
77
board/gcplus/memsetup.S
Normal file
77
board/gcplus/memsetup.S
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Memory Setup stuff - taken from blob memsetup.S
|
||||
*
|
||||
* Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and
|
||||
* Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
|
||||
* 2003-2004 (c) MontaVista Software, 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
|
||||
*/
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
/* The ADS GC+ for Linux Boot Rom Ver. 1.73 does memory init for us.
|
||||
* However the darn thing leaves the MMU enabled before handing control
|
||||
* over to us. So we need to disable the MMU and we use memsetup
|
||||
* to do it.
|
||||
*/
|
||||
|
||||
@ The following code segment was borrowed with gratitude from:
|
||||
@ linux-2.4.19-rmk7/arch/arm/boot/compressed/head-sa1100.S
|
||||
|
||||
@ Data cache might be active.
|
||||
@ Be sure to flush kernel binary out of the cache,
|
||||
@ whatever state it is, before it is turned off.
|
||||
@ This is done by fetching through currently executed
|
||||
@ memory to be sure we hit the same cache.
|
||||
bic r2, pc, #0x1f
|
||||
add r3, r2, #0x4000 @ 16 kb is quite enough...
|
||||
1: ldr r0, [r2], #32
|
||||
teq r2, r3
|
||||
bne 1b
|
||||
mcr p15, 0, r0, c7, c10, 4 @ drain WB
|
||||
mcr p15, 0, r0, c7, c7, 0 @ flush I & D caches
|
||||
|
||||
@ disabling MMU and caches
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
||||
bic r0, r0, #0x0d @ clear WB, DC, MMU
|
||||
bic r0, r0, #0x1000 @ clear Icache
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
b 2f
|
||||
2:
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
|
||||
mov pc, lr
|
||||
57
board/gcplus/u-boot.lds
Normal file
57
board/gcplus/u-boot.lds
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
* 2003 (c) MontaVista Software, 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
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/sa1100/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 = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
_end = .;
|
||||
}
|
||||
@@ -54,16 +54,16 @@ static void sdram_start (int hi_addr)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x408d0000;
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x00cd0000;
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
#endif
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 | hi_addr_bit;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x00cd0000;
|
||||
/* normal operation */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0x504f0000 | hi_addr_bit;
|
||||
#endif
|
||||
@@ -93,8 +93,8 @@ long int initdram (int board_type)
|
||||
*(vu_long *)MPC5XXX_CDM_PORCFG = 0x10000000;
|
||||
#else
|
||||
/* setup config registers */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xc2233a00;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x88b70004;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xd2322800;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x8ad70000;
|
||||
#endif
|
||||
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
@@ -207,3 +207,28 @@ void pci_init_board(void)
|
||||
pci_mpc5xxx_init(&hose);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
|
||||
|
||||
#define GPIO_PSC1_4 0x01000000UL
|
||||
|
||||
void init_ide_reset (void)
|
||||
{
|
||||
debug ("init_ide_reset\n");
|
||||
|
||||
/* Configure PSC1_4 as GPIO output for ATA reset */
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
|
||||
}
|
||||
|
||||
void ide_set_reset (int idereset)
|
||||
{
|
||||
debug ("ide_reset(%d)\n", idereset);
|
||||
|
||||
if (idereset) {
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_DATA &= ~GPIO_PSC1_4;
|
||||
} else {
|
||||
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
|
||||
}
|
||||
}
|
||||
#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
|
||||
|
||||
51
board/integratorap/Makefile
Normal file
51
board/integratorap/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# ARM Ltd.
|
||||
# Philippe Robin, <philippe.robin@arm.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 $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := integratorap.o flash.o
|
||||
SOBJS := platform.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
|
||||
|
||||
#########################################################################
|
||||
5
board/integratorap/config.mk
Normal file
5
board/integratorap/config.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# image should be loaded at 0x01000000
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x01000000
|
||||
473
board/integratorap/flash.c
Normal file
473
board/integratorap/flash.c
Normal file
@@ -0,0 +1,473 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.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 <linux/byteorder/swab.h>
|
||||
|
||||
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */
|
||||
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) __swab16(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")
|
||||
|
||||
|
||||
/* Flash Organization Structure */
|
||||
typedef struct OrgDef {
|
||||
unsigned int sector_number;
|
||||
unsigned int sector_size;
|
||||
} OrgDef;
|
||||
|
||||
|
||||
/* Flash Organizations */
|
||||
OrgDef OrgIntel_28F256L18T[] = {
|
||||
{4, 32 * 1024}, /* 4 * 32kBytes sectors */
|
||||
{255, 128 * 1024}, /* 255 * 128kBytes sectors */
|
||||
};
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
unsigned long flash_init (void);
|
||||
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);
|
||||
void flash_print_info (flash_info_t * info);
|
||||
void flash_unprotect_sectors (FPWV * addr);
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last);
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
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 too 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 + monitor_flash_len - 1, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
OrgDef *pOrgDef;
|
||||
|
||||
pOrgDef = OrgIntel_28F256L18T;
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (i > 255) {
|
||||
info->start[i] = base + (i * 0x8000);
|
||||
info->protect[i] = 0;
|
||||
} else {
|
||||
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_28F256L18T:
|
||||
printf ("FLASH 28F256L18T\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_28F256L18T):
|
||||
info->flash_id += FLASH_28F256L18T;
|
||||
info->sector_count = 259;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 32 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);
|
||||
}
|
||||
|
||||
|
||||
/* unprotects a sector for write and erase
|
||||
* on some intel parts, this unprotects the entire chip, but it
|
||||
* wont hurt to call this additional times per sector...
|
||||
*/
|
||||
void flash_unprotect_sectors (FPWV * addr)
|
||||
{
|
||||
#define PD_FINTEL_WSMS_READY_MASK 0x0080
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
|
||||
/* this sends the clear lock bit command */
|
||||
*addr = (FPW) 0x00600060;
|
||||
*addr = (FPW) 0x00D000D0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type, start, last;
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* 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);
|
||||
|
||||
flash_unprotect_sectors (addr);
|
||||
|
||||
/* 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");
|
||||
/* suspend erase */
|
||||
*addr = (FPW) 0x00B000B0;
|
||||
/* reset to read mode */
|
||||
*addr = (FPW) 0x00FF00FF;
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear status register cmd. */
|
||||
*addr = (FPW) 0x00500050;
|
||||
*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 (%x)\n", (ulong) addr, *addr);
|
||||
return (2);
|
||||
}
|
||||
flash_unprotect_sectors (addr);
|
||||
/* 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;
|
||||
}
|
||||
477
board/integratorap/integratorap.c
Normal file
477
board/integratorap/integratorap.c
Normal file
@@ -0,0 +1,477 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* (C) Copyright 2004
|
||||
* ARM Ltd.
|
||||
* Philippe Robin, <philippe.robin@arm.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>
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
# include <pci.h>
|
||||
#endif
|
||||
|
||||
void flash__init (void);
|
||||
void ether__init (void);
|
||||
void peripheral_power_enable (void);
|
||||
|
||||
#if defined(CONFIG_SHOW_BOOT_PROGRESS)
|
||||
void show_boot_progress(int progress)
|
||||
{
|
||||
printf("Boot reached stage %d\n", progress);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
|
||||
|
||||
static inline void delay (unsigned long loops)
|
||||
{
|
||||
__asm__ volatile ("1:\n"
|
||||
"subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0" (loops));
|
||||
}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* arch number of Integrator Board */
|
||||
gd->bd->bi_arch_number = 21;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x00000100;
|
||||
|
||||
icache_enable ();
|
||||
|
||||
flash__init ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
pci_init();
|
||||
#endif
|
||||
setenv("verify", "n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize PCI Devices, report devices found.
|
||||
*/
|
||||
#ifdef CONFIG_PCI
|
||||
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
|
||||
static struct pci_config_table pci_integrator_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 }},
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* V3 access routines */
|
||||
#define _V3Write16(o,v) (*(volatile unsigned short *)(PCI_V3_BASE + (unsigned int)(o)) = (unsigned short)(v))
|
||||
#define _V3Read16(o) (*(volatile unsigned short *)(PCI_V3_BASE + (unsigned int)(o)))
|
||||
|
||||
#define _V3Write32(o,v) (*(volatile unsigned int *)(PCI_V3_BASE + (unsigned int)(o)) = (unsigned int)(v))
|
||||
#define _V3Read32(o) (*(volatile unsigned int *)(PCI_V3_BASE + (unsigned int)(o)))
|
||||
|
||||
/* Compute address necessary to access PCI config space for the given */
|
||||
/* bus and device. */
|
||||
#define PCI_CONFIG_ADDRESS( __bus, __devfn, __offset ) ({ \
|
||||
unsigned int __address, __devicebit; \
|
||||
unsigned short __mapaddress; \
|
||||
unsigned int __dev = PCI_DEV (__devfn); /* FIXME to check!! (slot?) */ \
|
||||
\
|
||||
if (__bus == 0) { \
|
||||
/* local bus segment so need a type 0 config cycle */ \
|
||||
/* build the PCI configuration "address" with one-hot in A31-A11 */ \
|
||||
__address = PCI_CONFIG_BASE; \
|
||||
__address |= ((__devfn & 0x07) << 8); \
|
||||
__address |= __offset & 0xFF; \
|
||||
__mapaddress = 0x000A; /* 101=>config cycle, 0=>A1=A0=0 */ \
|
||||
__devicebit = (1 << (__dev + 11)); \
|
||||
\
|
||||
if ((__devicebit & 0xFF000000) != 0) { \
|
||||
/* high order bits are handled by the MAP register */ \
|
||||
__mapaddress |= (__devicebit >> 16); \
|
||||
} else { \
|
||||
/* low order bits handled directly in the address */ \
|
||||
__address |= __devicebit; \
|
||||
} \
|
||||
} else { /* bus !=0 */ \
|
||||
/* not the local bus segment so need a type 1 config cycle */ \
|
||||
/* A31-A24 are don't care (so clear to 0) */ \
|
||||
__mapaddress = 0x000B; /* 101=>config cycle, 1=>A1&A0 from PCI_CFG */ \
|
||||
__address = PCI_CONFIG_BASE; \
|
||||
__address |= ((__bus & 0xFF) << 16); /* bits 23..16 = bus number */ \
|
||||
__address |= ((__dev & 0x1F) << 11); /* bits 15..11 = device number */ \
|
||||
__address |= ((__devfn & 0x07) << 8); /* bits 10..8 = function number */ \
|
||||
__address |= __offset & 0xFF; /* bits 7..0 = register number */ \
|
||||
} \
|
||||
_V3Write16 (V3_LB_MAP1, __mapaddress); \
|
||||
__address; \
|
||||
})
|
||||
|
||||
/* _V3OpenConfigWindow - open V3 configuration window */
|
||||
#define _V3OpenConfigWindow() { \
|
||||
/* Set up base0 to see all 512Mbytes of memory space (not */ \
|
||||
/* prefetchable), this frees up base1 for re-use by configuration*/ \
|
||||
/* memory */ \
|
||||
\
|
||||
_V3Write32 (V3_LB_BASE0, ((INTEGRATOR_PCI_BASE & 0xFFF00000) | \
|
||||
0x90 | V3_LB_BASE_M_ENABLE)); \
|
||||
/* Set up base1 to point into configuration space, note that MAP1 */ \
|
||||
/* register is set up by pciMakeConfigAddress(). */ \
|
||||
\
|
||||
_V3Write32 (V3_LB_BASE1, ((CPU_PCI_CNFG_ADRS & 0xFFF00000) | \
|
||||
0x40 | V3_LB_BASE_M_ENABLE)); \
|
||||
}
|
||||
|
||||
/* _V3CloseConfigWindow - close V3 configuration window */
|
||||
#define _V3CloseConfigWindow() { \
|
||||
/* Reassign base1 for use by prefetchable PCI memory */ \
|
||||
_V3Write32 (V3_LB_BASE1, (((INTEGRATOR_PCI_BASE + 0x10000000) & 0xFFF00000) \
|
||||
| 0x84 | V3_LB_BASE_M_ENABLE)); \
|
||||
_V3Write16 (V3_LB_MAP1, \
|
||||
(((INTEGRATOR_PCI_BASE + 0x10000000) & 0xFFF00000) >> 16) | 0x0006); \
|
||||
\
|
||||
/* And shrink base0 back to a 256M window (NOTE: MAP0 already correct) */ \
|
||||
\
|
||||
_V3Write32 (V3_LB_BASE0, ((INTEGRATOR_PCI_BASE & 0xFFF00000) | \
|
||||
0x80 | V3_LB_BASE_M_ENABLE)); \
|
||||
}
|
||||
|
||||
static int pci_integrator_read_byte (struct pci_controller *hose, pci_dev_t dev,
|
||||
int offset, unsigned char *val)
|
||||
{
|
||||
_V3OpenConfigWindow ();
|
||||
*val = *(volatile unsigned char *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
offset);
|
||||
_V3CloseConfigWindow ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pci_integrator_read__word (struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset,
|
||||
unsigned short *val)
|
||||
{
|
||||
_V3OpenConfigWindow ();
|
||||
*val = *(volatile unsigned short *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
offset);
|
||||
_V3CloseConfigWindow ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pci_integrator_read_dword (struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset,
|
||||
unsigned int *val)
|
||||
{
|
||||
_V3OpenConfigWindow ();
|
||||
*val = *(volatile unsigned short *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
offset);
|
||||
*val |= (*(volatile unsigned int *)
|
||||
PCI_CONFIG_ADDRESS (PCI_BUS (dev), PCI_FUNC (dev),
|
||||
(offset + 2))) << 16;
|
||||
_V3CloseConfigWindow ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pci_integrator_write_byte (struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset,
|
||||
unsigned char val)
|
||||
{
|
||||
_V3OpenConfigWindow ();
|
||||
*(volatile unsigned char *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
offset) = val;
|
||||
_V3CloseConfigWindow ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pci_integrator_write_word (struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset,
|
||||
unsigned short val)
|
||||
{
|
||||
_V3OpenConfigWindow ();
|
||||
*(volatile unsigned short *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
offset) = val;
|
||||
_V3CloseConfigWindow ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pci_integrator_write_dword (struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset,
|
||||
unsigned int val)
|
||||
{
|
||||
_V3OpenConfigWindow ();
|
||||
*(volatile unsigned short *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
offset) = (val & 0xFFFF);
|
||||
*(volatile unsigned short *) PCI_CONFIG_ADDRESS (PCI_BUS (dev),
|
||||
PCI_FUNC (dev),
|
||||
(offset + 2)) = ((val >> 16) & 0xFFFF);
|
||||
_V3CloseConfigWindow ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
/******************************
|
||||
* PCI initialisation
|
||||
******************************/
|
||||
|
||||
struct pci_controller integrator_hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table: pci_integrator_config_table,
|
||||
#endif
|
||||
};
|
||||
|
||||
void pci_init_board (void)
|
||||
{
|
||||
volatile int i, j;
|
||||
struct pci_controller *hose = &integrator_hose;
|
||||
|
||||
/* setting this register will take the V3 out of reset */
|
||||
|
||||
*(volatile unsigned int *) (INTEGRATOR_SC_PCIENABLE) = 1;
|
||||
|
||||
/* wait a few usecs to settle the device and the PCI bus */
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
j = i + 1;
|
||||
|
||||
/* Now write the Base I/O Address Word to V3_BASE + 0x6C */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_LB_IO_BASE) =
|
||||
(unsigned short) (V3_BASE >> 16);
|
||||
|
||||
do {
|
||||
*(volatile unsigned char *) (V3_BASE + V3_MAIL_DATA) = 0xAA;
|
||||
*(volatile unsigned char *) (V3_BASE + V3_MAIL_DATA + 4) =
|
||||
0x55;
|
||||
} while (*(volatile unsigned char *) (V3_BASE + V3_MAIL_DATA) != 0xAA
|
||||
|| *(volatile unsigned char *) (V3_BASE + V3_MAIL_DATA +
|
||||
4) != 0x55);
|
||||
|
||||
/* Make sure that V3 register access is not locked, if it is, unlock it */
|
||||
|
||||
if ((*(volatile unsigned short *) (V3_BASE + V3_SYSTEM) &
|
||||
V3_SYSTEM_M_LOCK)
|
||||
== V3_SYSTEM_M_LOCK)
|
||||
*(volatile unsigned short *) (V3_BASE + V3_SYSTEM) = 0xA05F;
|
||||
|
||||
/* Ensure that the slave accesses from PCI are disabled while we */
|
||||
/* setup windows */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_PCI_CMD) &=
|
||||
~(V3_COMMAND_M_MEM_EN | V3_COMMAND_M_IO_EN);
|
||||
|
||||
/* Clear RST_OUT to 0; keep the PCI bus in reset until we've finished */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_SYSTEM) &=
|
||||
~V3_SYSTEM_M_RST_OUT;
|
||||
|
||||
/* Make all accesses from PCI space retry until we're ready for them */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_PCI_CFG) |=
|
||||
V3_PCI_CFG_M_RETRY_EN;
|
||||
|
||||
/* Set up any V3 PCI Configuration Registers that we absolutely have to */
|
||||
/* LB_CFG controls Local Bus protocol. */
|
||||
/* Enable LocalBus byte strobes for READ accesses too. */
|
||||
/* set bit 7 BE_IMODE and bit 6 BE_OMODE */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_LB_CFG) |= 0x0C0;
|
||||
|
||||
/* PCI_CMD controls overall PCI operation. */
|
||||
/* Enable PCI bus master. */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_PCI_CMD) |= 0x04;
|
||||
|
||||
/* PCI_MAP0 controls where the PCI to CPU memory window is on Local Bus */
|
||||
|
||||
*(volatile unsigned int *) (V3_BASE + V3_PCI_MAP0) =
|
||||
(INTEGRATOR_BOOT_ROM_BASE) | (V3_PCI_MAP_M_ADR_SIZE_512M |
|
||||
V3_PCI_MAP_M_REG_EN |
|
||||
V3_PCI_MAP_M_ENABLE);
|
||||
|
||||
/* PCI_BASE0 is the PCI address of the start of the window */
|
||||
|
||||
*(volatile unsigned int *) (V3_BASE + V3_PCI_BASE0) =
|
||||
INTEGRATOR_BOOT_ROM_BASE;
|
||||
|
||||
/* PCI_MAP1 is LOCAL address of the start of the window */
|
||||
|
||||
*(volatile unsigned int *) (V3_BASE + V3_PCI_MAP1) =
|
||||
(INTEGRATOR_HDR0_SDRAM_BASE) | (V3_PCI_MAP_M_ADR_SIZE_1024M |
|
||||
V3_PCI_MAP_M_REG_EN |
|
||||
V3_PCI_MAP_M_ENABLE);
|
||||
|
||||
/* PCI_BASE1 is the PCI address of the start of the window */
|
||||
|
||||
*(volatile unsigned int *) (V3_BASE + V3_PCI_BASE1) =
|
||||
INTEGRATOR_HDR0_SDRAM_BASE;
|
||||
|
||||
/* Set up the windows from local bus memory into PCI configuration, */
|
||||
/* I/O and Memory. */
|
||||
/* PCI I/O, LB_BASE2 and LB_MAP2 are used exclusively for this. */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_LB_BASE2) =
|
||||
((CPU_PCI_IO_ADRS >> 24) << 8) | V3_LB_BASE_M_ENABLE;
|
||||
*(volatile unsigned short *) (V3_BASE + V3_LB_MAP2) = 0;
|
||||
|
||||
/* PCI Configuration, use LB_BASE1/LB_MAP1. */
|
||||
|
||||
/* PCI Memory use LB_BASE0/LB_MAP0 and LB_BASE1/LB_MAP1 */
|
||||
/* Map first 256Mbytes as non-prefetchable via BASE0/MAP0 */
|
||||
/* (INTEGRATOR_PCI_BASE == PCI_MEM_BASE) */
|
||||
|
||||
*(volatile unsigned int *) (V3_BASE + V3_LB_BASE0) =
|
||||
INTEGRATOR_PCI_BASE | (0x80 | V3_LB_BASE_M_ENABLE);
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_LB_MAP0) =
|
||||
((INTEGRATOR_PCI_BASE >> 20) << 0x4) | 0x0006;
|
||||
|
||||
/* Map second 256 Mbytes as prefetchable via BASE1/MAP1 */
|
||||
|
||||
*(volatile unsigned int *) (V3_BASE + V3_LB_BASE1) =
|
||||
INTEGRATOR_PCI_BASE | (0x84 | V3_LB_BASE_M_ENABLE);
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_LB_MAP1) =
|
||||
(((INTEGRATOR_PCI_BASE + 0x10000000) >> 20) << 4) | 0x0006;
|
||||
|
||||
/* Allow accesses to PCI Configuration space */
|
||||
/* and set up A1, A0 for type 1 config cycles */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_PCI_CFG) =
|
||||
((*(volatile unsigned short *) (V3_BASE + V3_PCI_CFG)) &
|
||||
~(V3_PCI_CFG_M_RETRY_EN | V3_PCI_CFG_M_AD_LOW1)) |
|
||||
V3_PCI_CFG_M_AD_LOW0;
|
||||
|
||||
/* now we can allow in PCI MEMORY accesses */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_PCI_CMD) =
|
||||
(*(volatile unsigned short *) (V3_BASE + V3_PCI_CMD)) |
|
||||
V3_COMMAND_M_MEM_EN;
|
||||
|
||||
/* Set RST_OUT to take the PCI bus is out of reset, PCI devices can */
|
||||
/* initialise and lock the V3 system register so that no one else */
|
||||
/* can play with it */
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_SYSTEM) =
|
||||
(*(volatile unsigned short *) (V3_BASE + V3_SYSTEM)) |
|
||||
V3_SYSTEM_M_RST_OUT;
|
||||
|
||||
*(volatile unsigned short *) (V3_BASE + V3_SYSTEM) =
|
||||
(*(volatile unsigned short *) (V3_BASE + V3_SYSTEM)) |
|
||||
V3_SYSTEM_M_LOCK;
|
||||
|
||||
/*
|
||||
* Register the hose
|
||||
*/
|
||||
hose->first_busno = 0;
|
||||
hose->last_busno = 0xff;
|
||||
|
||||
/* System memory space */
|
||||
pci_set_region (hose->regions + 0,
|
||||
0x00000000, 0x40000000, 0x01000000,
|
||||
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||
|
||||
/* PCI Memory - config space */
|
||||
pci_set_region (hose->regions + 1,
|
||||
0x00000000, 0x62000000, 0x01000000, PCI_REGION_MEM);
|
||||
|
||||
/* PCI V3 regs */
|
||||
pci_set_region (hose->regions + 2,
|
||||
0x00000000, 0x61000000, 0x00080000, PCI_REGION_MEM);
|
||||
|
||||
/* PCI I/O space */
|
||||
pci_set_region (hose->regions + 3,
|
||||
0x00000000, 0x60000000, 0x00010000, PCI_REGION_IO);
|
||||
|
||||
pci_set_ops (hose,
|
||||
pci_integrator_read_byte,
|
||||
pci_integrator_read__word,
|
||||
pci_integrator_read_dword,
|
||||
pci_integrator_write_byte,
|
||||
pci_integrator_write_word, pci_integrator_write_dword);
|
||||
|
||||
hose->region_count = 4;
|
||||
|
||||
pci_register_hose (hose);
|
||||
|
||||
pciauto_config_init (hose);
|
||||
pciauto_config_device (hose, 0);
|
||||
|
||||
hose->last_busno = pci_hose_scan (hose);
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
void flash__init (void)
|
||||
{
|
||||
}
|
||||
/*************************************************************
|
||||
Routine:ether__init
|
||||
Description: take the Ethernet controller out of reset and wait
|
||||
for the EEPROM load to complete.
|
||||
*************************************************************/
|
||||
void ether__init (void)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
int dram_init (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
33
board/integratorap/platform.S
Normal file
33
board/integratorap/platform.S
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Board specific setup info
|
||||
*
|
||||
* (C) Copyright 2004, ARM Ltd.
|
||||
* Philippe Robin, <philippe.robin@arm.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 <config.h>
|
||||
#include <version.h>
|
||||
|
||||
.globl platformsetup
|
||||
platformsetup:
|
||||
|
||||
/* All done by Integrator's boot monitor! */
|
||||
mov pc, lr
|
||||
50
board/integratorap/u-boot.lds
Normal file
50
board/integratorap/u-boot.lds
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@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-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/arm926ejs/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
.rodata : { *(.rodata) }
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
_end = .;
|
||||
}
|
||||
47
board/integratorcp/Makefile
Normal file
47
board/integratorcp/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# 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 := integratorcp.o flash.o
|
||||
SOBJS := platform.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
|
||||
|
||||
#########################################################################
|
||||
5
board/integratorcp/config.mk
Normal file
5
board/integratorcp/config.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# image should be loaded at 0x01000000
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x01000000
|
||||
473
board/integratorcp/flash.c
Normal file
473
board/integratorcp/flash.c
Normal file
@@ -0,0 +1,473 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.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 <linux/byteorder/swab.h>
|
||||
|
||||
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */
|
||||
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) __swab16(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")
|
||||
|
||||
|
||||
/* Flash Organization Structure */
|
||||
typedef struct OrgDef {
|
||||
unsigned int sector_number;
|
||||
unsigned int sector_size;
|
||||
} OrgDef;
|
||||
|
||||
|
||||
/* Flash Organizations */
|
||||
OrgDef OrgIntel_28F256L18T[] = {
|
||||
{4, 32 * 1024}, /* 4 * 32kBytes sectors */
|
||||
{255, 128 * 1024}, /* 255 * 128kBytes sectors */
|
||||
};
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
unsigned long flash_init (void);
|
||||
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);
|
||||
void flash_print_info (flash_info_t * info);
|
||||
void flash_unprotect_sectors (FPWV * addr);
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last);
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
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 too 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 + monitor_flash_len - 1, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
OrgDef *pOrgDef;
|
||||
|
||||
pOrgDef = OrgIntel_28F256L18T;
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (i > 255) {
|
||||
info->start[i] = base + (i * 0x8000);
|
||||
info->protect[i] = 0;
|
||||
} else {
|
||||
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_28F256L18T:
|
||||
printf ("FLASH 28F256L18T\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_28F256L18T):
|
||||
info->flash_id += FLASH_28F256L18T;
|
||||
info->sector_count = 259;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 32 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);
|
||||
}
|
||||
|
||||
|
||||
/* unprotects a sector for write and erase
|
||||
* on some intel parts, this unprotects the entire chip, but it
|
||||
* wont hurt to call this additional times per sector...
|
||||
*/
|
||||
void flash_unprotect_sectors (FPWV * addr)
|
||||
{
|
||||
#define PD_FINTEL_WSMS_READY_MASK 0x0080
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
|
||||
/* this sends the clear lock bit command */
|
||||
*addr = (FPW) 0x00600060;
|
||||
*addr = (FPW) 0x00D000D0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type, start, last;
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* 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);
|
||||
|
||||
flash_unprotect_sectors (addr);
|
||||
|
||||
/* 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");
|
||||
/* suspend erase */
|
||||
*addr = (FPW) 0x00B000B0;
|
||||
/* reset to read mode */
|
||||
*addr = (FPW) 0x00FF00FF;
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear status register cmd. */
|
||||
*addr = (FPW) 0x00500050;
|
||||
*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 (%x)\n", (ulong) addr, *addr);
|
||||
return (2);
|
||||
}
|
||||
flash_unprotect_sectors (addr);
|
||||
/* 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;
|
||||
}
|
||||
109
board/integratorcp/integratorcp.c
Normal file
109
board/integratorcp/integratorcp.c
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* (C) Copyright 2004
|
||||
* ARM Ltd.
|
||||
* Philippe Robin, <philippe.robin@arm.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 flash__init (void);
|
||||
void ether__init (void);
|
||||
void peripheral_power_enable (void);
|
||||
|
||||
#if defined(CONFIG_SHOW_BOOT_PROGRESS)
|
||||
void show_boot_progress(int progress)
|
||||
{
|
||||
printf("Boot reached stage %d\n", progress);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
|
||||
|
||||
static inline void delay (unsigned long loops)
|
||||
{
|
||||
__asm__ volatile ("1:\n"
|
||||
"subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0" (loops));
|
||||
}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* arch number of Integrator Board */
|
||||
gd->bd->bi_arch_number = 275;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x00000100;
|
||||
|
||||
icache_enable ();
|
||||
|
||||
flash__init ();
|
||||
ether__init ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
setenv("verify", "n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
void flash__init (void)
|
||||
{
|
||||
}
|
||||
/*************************************************************
|
||||
Routine:ether__init
|
||||
Description: take the Ethernet controller out of reset and wait
|
||||
for the EEPROM load to complete.
|
||||
*************************************************************/
|
||||
void ether__init (void)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
int dram_init (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
33
board/integratorcp/platform.S
Normal file
33
board/integratorcp/platform.S
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Board specific setup info
|
||||
*
|
||||
* (C) Copyright 2003, ARM Ltd.
|
||||
* Philippe Robin, <philippe.robin@arm.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 <config.h>
|
||||
#include <version.h>
|
||||
|
||||
.globl platformsetup
|
||||
platformsetup:
|
||||
|
||||
/* All done by IntegratorCP's boot monitor! */
|
||||
mov pc, lr
|
||||
50
board/integratorcp/u-boot.lds
Normal file
50
board/integratorcp/u-boot.lds
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@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-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/arm926ejs/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
.rodata : { *(.rodata) }
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
_end = .;
|
||||
}
|
||||
40
board/kup/Makefile
Normal file
40
board/kup/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# 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 kup.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2002
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -197,13 +197,13 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
case AMD_ID_LV800T:
|
||||
info->flash_id += FLASH_AM800T;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
case AMD_ID_LV800B:
|
||||
info->flash_id += FLASH_AM800B;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
72
board/kup/common/kup.c
Normal file
72
board/kup/common/kup.c
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.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 <mpc8xx.h>
|
||||
#include "kup.h"
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile sysconf8xx_t *siu = &immap->im_siu_conf;
|
||||
|
||||
while (siu->sc_sipend & 0x20000000) {
|
||||
/* printf("waiting for 5V VCC\n"); */
|
||||
;
|
||||
}
|
||||
|
||||
/* RS232 / RS485 default is RS232 */
|
||||
immap->im_ioport.iop_padat &= ~(PA_RS485);
|
||||
immap->im_ioport.iop_papar &= ~(PA_RS485);
|
||||
immap->im_ioport.iop_paodr &= ~(PA_RS485);
|
||||
immap->im_ioport.iop_padir |= (PA_RS485);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_IDE_LED
|
||||
void ide_led (uchar led, uchar status)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
|
||||
/* We have one led for both pcmcia slots */
|
||||
if (status) { /* led on */
|
||||
immap->im_ioport.iop_padat &= ~(PA_LED_YELLOW);
|
||||
} else {
|
||||
immap->im_ioport.iop_padat |= (PA_LED_YELLOW);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void poweron_key (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
|
||||
immap->im_ioport.iop_pcpar &= ~(PC_SWITCH1);
|
||||
immap->im_ioport.iop_pcdir &= ~(PC_SWITCH1);
|
||||
|
||||
if (immap->im_ioport.iop_pcdat & (PC_SWITCH1))
|
||||
setenv ("key1", "off");
|
||||
else
|
||||
setenv ("key1", "on");
|
||||
}
|
||||
44
board/kup/common/kup.h
Normal file
44
board/kup/common/kup.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.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
|
||||
*/
|
||||
|
||||
#ifndef __KUP_H
|
||||
#define __KUP_H
|
||||
|
||||
#define PA_8 0x0080
|
||||
#define PA_11 0x0010
|
||||
#define PA_12 0x0008
|
||||
|
||||
#define PB_14 0x00020000
|
||||
#define PB_17 0x00004000
|
||||
|
||||
#define PC_9 0x0040
|
||||
|
||||
#define PA_RS485 PA_11 /* SCC1: 0=RS232 1=RS485 */
|
||||
#define PA_LED_YELLOW PA_8
|
||||
#define BP_USB_VCC PB_14 /* VCC for USB devices 0=vcc on, 1=vcc off*/
|
||||
#define PB_LCD_PWM PB_17 /* PB 17 */
|
||||
#define PC_SWITCH1 PC_9 /* Reboot switch */
|
||||
|
||||
extern void poweron_key (void);
|
||||
|
||||
#endif /* __KUP_H */
|
||||
40
board/kup/kup4k/Makefile
Normal file
40
board/kup/kup4k/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# 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 ../common/flash.o ../common/kup.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# (C) Copyright 2000-2002
|
||||
# (C) Copyright 2000-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000, 2001, 2002
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
* Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.de
|
||||
*
|
||||
@@ -24,16 +24,23 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
#include "../common/kup.h"
|
||||
#ifdef CONFIG_KUP4K_LOGO
|
||||
#include "s1d13706.h"
|
||||
#endif
|
||||
|
||||
#undef DEBUG
|
||||
#ifdef DEBUG
|
||||
# define debugk(fmt,args...) printf(fmt ,##args)
|
||||
#else
|
||||
# define debugk(fmt,args...)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
volatile unsigned char *VmemAddr;
|
||||
volatile unsigned char *RegAddr;
|
||||
} FB_INFO_S1D13xxx;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile unsigned char *VmemAddr;
|
||||
volatile unsigned char *RegAddr;
|
||||
}FB_INFO_S1D13xxx;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -42,15 +49,15 @@ static long int dram_size (long int, long int *, long int);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KUP4K_LOGO
|
||||
void lcd_logo(bd_t *bd);
|
||||
void lcd_logo(bd_t *bd);
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#define _NOT_USED_ 0xFFFFFFFF
|
||||
|
||||
const uint sdram_table[] =
|
||||
{
|
||||
const uint sdram_table[] = {
|
||||
/*
|
||||
* Single Read. (Offset 0 in UPMA RAM)
|
||||
*/
|
||||
@@ -114,8 +121,19 @@ const uint sdram_table[] =
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
uchar *latch,rev,mod;
|
||||
|
||||
printf ("### No HW ID - assuming KUP4K-Color\n");
|
||||
/*
|
||||
* Init ChipSelect #4 (CAN + HW-Latch)
|
||||
*/
|
||||
immap->im_memctl.memc_or4 = 0xFFFF8926;
|
||||
immap->im_memctl.memc_br4 = 0x90000401;
|
||||
|
||||
latch=(uchar *)0x90000200;
|
||||
rev = (*latch & 0xF8) >> 3;
|
||||
mod=(*latch & 0x03);
|
||||
printf ("Board: KUP4K Rev %d.%d SN: %s\n",rev,mod,getenv("ethaddr"));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -230,10 +248,42 @@ 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 */
|
||||
unsigned char i = 0;
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
|
||||
return(get_ram_size(base, maxsize));
|
||||
for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
/* write 0 to base address */
|
||||
addr = base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -247,7 +297,6 @@ int misc_init_r (void)
|
||||
#ifdef CONFIG_KUP4K_LOGO
|
||||
bd_t *bd = gd->bd;
|
||||
|
||||
|
||||
lcd_logo (bd);
|
||||
#endif /* CONFIG_KUP4K_LOGO */
|
||||
#ifdef CONFIG_IDE_LED
|
||||
@@ -257,14 +306,14 @@ int misc_init_r (void)
|
||||
immap->im_ioport.iop_papar &= ~0x80;
|
||||
immap->im_ioport.iop_padat |= 0x80; /* turn it off */
|
||||
#endif
|
||||
setenv("hw","4k");
|
||||
poweron_key();
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KUP4K_LOGO
|
||||
|
||||
|
||||
#define PB_LCD_PWM ((uint)0x00004000) /* PB 17 */
|
||||
|
||||
void lcd_logo (bd_t * bd)
|
||||
{
|
||||
FB_INFO_S1D13xxx fb_info;
|
||||
@@ -277,104 +326,117 @@ void lcd_logo (bd_t * bd)
|
||||
int rs, gs, bs;
|
||||
int r = 8, g = 8, b = 4;
|
||||
int r1, g1, b1;
|
||||
int n;
|
||||
uchar tmp[64]; /* long enough for environment variables */
|
||||
int tft = 0;
|
||||
|
||||
immr->im_cpm.cp_pbpar &= ~PB_LCD_PWM;
|
||||
immr->im_cpm.cp_pbodr &= ~PB_LCD_PWM;
|
||||
immr->im_cpm.cp_pbdat &= ~PB_LCD_PWM; /* set to 0 = enabled */
|
||||
immr->im_cpm.cp_pbdir |= PB_LCD_PWM;
|
||||
|
||||
immr->im_cpm.cp_pbpar &= ~(PB_LCD_PWM);
|
||||
immr->im_cpm.cp_pbodr &= ~(PB_LCD_PWM);
|
||||
immr->im_cpm.cp_pbdat &= ~(PB_LCD_PWM); /* set to 0 = enabled */
|
||||
immr->im_cpm.cp_pbdir |= (PB_LCD_PWM);
|
||||
|
||||
/*----------------------------------------------------------------------------- */
|
||||
/**/
|
||||
/* Initialize the chip and the frame buffer driver. */
|
||||
/**/
|
||||
/*----------------------------------------------------------------------------- */
|
||||
memctl = &immr->im_memctl;
|
||||
/* memctl->memc_or5 = 0xFFC007F0; / * 4 MB 17 WS or externel TA */
|
||||
/* memctl->memc_br5 = 0x80000801; / * Start at 0x80000000 */
|
||||
memctl = &immr->im_memctl;
|
||||
|
||||
memctl->memc_or5 = 0xFFC00708; /* 4 MB 17 WS or externel TA */
|
||||
|
||||
/*
|
||||
* Init ChipSelect #5 (S1D13768)
|
||||
*/
|
||||
memctl->memc_or5 = 0xFFC007F0; /* 4 MB 17 WS or externel TA */
|
||||
memctl->memc_br5 = 0x80080801; /* Start at 0x80080000 */
|
||||
|
||||
|
||||
fb_info.VmemAddr = (unsigned char *) (S1D_PHYSICAL_VMEM_ADDR);
|
||||
fb_info.RegAddr = (unsigned char *) (S1D_PHYSICAL_REG_ADDR);
|
||||
|
||||
if ((((S1D_VALUE *) fb_info.RegAddr)[0] != 0x28)
|
||||
|| (((S1D_VALUE *) fb_info.RegAddr)[1] != 0x14)) {
|
||||
|| (((S1D_VALUE *) fb_info.RegAddr)[1] != 0x14)) {
|
||||
printf ("Warning:LCD Controller S1D13706 not found\n");
|
||||
setenv ("lcd", "none");
|
||||
return;
|
||||
}
|
||||
|
||||
/* init controller */
|
||||
for (i = 0; i < sizeof (aS1DRegs) / sizeof (aS1DRegs[0]); i++) {
|
||||
s1dReg = aS1DRegs[i].Index;
|
||||
s1dValue = aS1DRegs[i].Value;
|
||||
/* printf("sid1 Index: %02x Register: %02x Wert: %02x\n",i, aS1DRegs[i].Index, aS1DRegs[i].Value); */
|
||||
|
||||
for (i = 0; i < sizeof(aS1DRegs_prelimn) / sizeof(aS1DRegs_prelimn[0]); i++) {
|
||||
s1dReg = aS1DRegs_prelimn[i].Index;
|
||||
s1dValue = aS1DRegs_prelimn[i].Value;
|
||||
debugk ("s13768 reg: %02x value: %02x\n",
|
||||
aS1DRegs_prelimn[i].Index, aS1DRegs_prelimn[i].Value);
|
||||
((S1D_VALUE *) fb_info.RegAddr)[s1dReg / sizeof (S1D_VALUE)] =
|
||||
s1dValue;
|
||||
}
|
||||
|
||||
|
||||
n = getenv_r ("lcd", tmp, sizeof (tmp));
|
||||
if (n > 0) {
|
||||
if (!strcmp ("tft", tmp))
|
||||
tft = 1;
|
||||
else
|
||||
tft = 0;
|
||||
}
|
||||
#if 0
|
||||
if (((S1D_VALUE *) fb_info.RegAddr)[0xAC] & 0x04)
|
||||
tft = 0;
|
||||
else
|
||||
tft = 1;
|
||||
#endif
|
||||
|
||||
debugk ("Port=0x%02x -> TFT=%d\n", tft,
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0xAC]);
|
||||
|
||||
/* init controller */
|
||||
if (!tft) {
|
||||
for (i = 0; i < sizeof(aS1DRegs_stn) / sizeof(aS1DRegs_stn[0]); i++) {
|
||||
s1dReg = aS1DRegs_stn[i].Index;
|
||||
s1dValue = aS1DRegs_stn[i].Value;
|
||||
debugk ("s13768 reg: %02x value: %02x\n",
|
||||
aS1DRegs_stn[i].Index,
|
||||
aS1DRegs_stn[i].Value);
|
||||
((S1D_VALUE *) fb_info.RegAddr)[s1dReg / sizeof(S1D_VALUE)] =
|
||||
s1dValue;
|
||||
}
|
||||
}
|
||||
n = getenv_r ("contrast", tmp, sizeof (tmp));
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0xB3] =
|
||||
(n > 0) ? (uchar) simple_strtoul (tmp, NULL, 10) * 255 / 100 : 0xA0;
|
||||
switch (bd->bi_busfreq) {
|
||||
case 40000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x41;
|
||||
break;
|
||||
case 48000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x22;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x34;
|
||||
break;
|
||||
default:
|
||||
printf ("KUP4K S1D1: unknown busfrequency: %ld assuming 64 MHz\n", bd->bi_busfreq);
|
||||
case 64000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x66;
|
||||
break;
|
||||
}
|
||||
/* setenv("lcd","stn"); */
|
||||
} else {
|
||||
for (i = 0; i < sizeof(aS1DRegs_tft) / sizeof(aS1DRegs_tft[0]); i++) {
|
||||
s1dReg = aS1DRegs_tft[i].Index;
|
||||
s1dValue = aS1DRegs_tft[i].Value;
|
||||
debugk ("s13768 reg: %02x value: %02x\n",
|
||||
aS1DRegs_tft[i].Index,
|
||||
aS1DRegs_tft[i].Value);
|
||||
((S1D_VALUE *) fb_info.RegAddr)[s1dReg / sizeof (S1D_VALUE)] =
|
||||
s1dValue;
|
||||
}
|
||||
|
||||
#undef MONOCHROME
|
||||
#ifdef MONOCHROME
|
||||
switch (bd->bi_busfreq) {
|
||||
#if 0
|
||||
case 24000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x28;
|
||||
break;
|
||||
case 32000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x33;
|
||||
break;
|
||||
#endif
|
||||
case 40000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x40;
|
||||
break;
|
||||
case 48000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x4C;
|
||||
break;
|
||||
default:
|
||||
printf ("KUP4K S1D1: unknown busfrequency: %ld assuming 64 MHz\n",
|
||||
bd->bi_busfreq);
|
||||
case 64000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x69;
|
||||
break;
|
||||
switch (bd->bi_busfreq) {
|
||||
default:
|
||||
printf ("KUP4K S1D1: unknown busfrequency: %ld assuming 64 MHz\n", bd->bi_busfreq);
|
||||
case 40000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x42;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x30;
|
||||
break;
|
||||
}
|
||||
/* setenv("lcd","tft"); */
|
||||
}
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x10] = 0x00;
|
||||
#else
|
||||
switch (bd->bi_busfreq) {
|
||||
#if 0
|
||||
case 24000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x22;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x34;
|
||||
break;
|
||||
case 32000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x34;
|
||||
break;
|
||||
#endif
|
||||
case 40000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x41;
|
||||
break;
|
||||
case 48000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x22;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x34;
|
||||
break;
|
||||
default:
|
||||
printf ("KUP4K S1D1: unknown busfrequency: %ld assuming 64 MHz\n",
|
||||
bd->bi_busfreq);
|
||||
case 64000000:
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x05] = 0x32;
|
||||
((S1D_VALUE *) fb_info.RegAddr)[0x12] = 0x66;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* create and set colormap */
|
||||
rs = 256 / (r - 1);
|
||||
@@ -384,27 +446,13 @@ void lcd_logo (bd_t * bd)
|
||||
r1 = (rs * ((i / (g * b)) % r)) * 255;
|
||||
g1 = (gs * ((i / b) % g)) * 255;
|
||||
b1 = (bs * ((i) % b)) * 255;
|
||||
/* printf("%d %04x %04x %04x\n",i,r1>>4,g1>>4,b1>>4); */
|
||||
debugk ("%d %04x %04x %04x\n", i, r1 >> 4, g1 >> 4, b1 >> 4);
|
||||
S1D_WRITE_PALETTE (fb_info.RegAddr, i, (r1 >> 4), (g1 >> 4),
|
||||
(b1 >> 4));
|
||||
(b1 >> 4));
|
||||
}
|
||||
|
||||
/* copy bitmap */
|
||||
fb = (char *) (fb_info.VmemAddr);
|
||||
memcpy (fb, (uchar *) CONFIG_KUP4K_LOGO, 320 * 240);
|
||||
}
|
||||
#endif /* CONFIG_KUP4K_LOGO */
|
||||
|
||||
#ifdef CONFIG_IDE_LED
|
||||
void ide_led (uchar led, uchar status)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
|
||||
/* We have one led for both pcmcia slots */
|
||||
if (status) { /* led on */
|
||||
immap->im_ioport.iop_padat &= ~0x80;
|
||||
} else {
|
||||
immap->im_ioport.iop_padat |= 0x80;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_KUP4K_LOGO */
|
||||
174
board/kup/kup4k/s1d13706.h
Normal file
174
board/kup/kup4k/s1d13706.h
Normal file
@@ -0,0 +1,174 @@
|
||||
/*---------------------------------------------------------------------------- */
|
||||
/* */
|
||||
/* File generated by S1D13706CFG.EXE */
|
||||
/* */
|
||||
/* Copyright (c) 2000,2001 Epson Research and Development, Inc. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------- */
|
||||
|
||||
/* Panel: 320x240x8bpp 70Hz Color Single STN 8-bit (PCLK=6.250MHz) (Format 2) */
|
||||
|
||||
#define S1D_DISPLAY_WIDTH 320
|
||||
#define S1D_DISPLAY_HEIGHT 240
|
||||
#define S1D_DISPLAY_BPP 8
|
||||
#define S1D_DISPLAY_SCANLINE_BYTES 320
|
||||
#define S1D_PHYSICAL_VMEM_ADDR 0x800A0000L
|
||||
#define S1D_PHYSICAL_VMEM_SIZE 0x14000L
|
||||
#define S1D_PHYSICAL_REG_ADDR 0x80080000L
|
||||
#define S1D_PHYSICAL_REG_SIZE 0x100
|
||||
#define S1D_DISPLAY_PCLK 6250
|
||||
#define S1D_PALETTE_SIZE 256
|
||||
#define S1D_REGDELAYOFF 0xFFFE
|
||||
#define S1D_REGDELAYON 0xFFFF
|
||||
|
||||
#define S1D_WRITE_PALETTE(p,i,r,g,b) \
|
||||
{ \
|
||||
((volatile S1D_VALUE*)(p))[0x0A/sizeof(S1D_VALUE)] = (S1D_VALUE)((r)>>4); \
|
||||
((volatile S1D_VALUE*)(p))[0x09/sizeof(S1D_VALUE)] = (S1D_VALUE)((g)>>4); \
|
||||
((volatile S1D_VALUE*)(p))[0x08/sizeof(S1D_VALUE)] = (S1D_VALUE)((b)>>4); \
|
||||
((volatile S1D_VALUE*)(p))[0x0B/sizeof(S1D_VALUE)] = (S1D_VALUE)(i); \
|
||||
}
|
||||
|
||||
#define S1D_READ_PALETTE(p,i,r,g,b) \
|
||||
{ \
|
||||
((volatile S1D_VALUE*)(p))[0x0F/sizeof(S1D_VALUE)] = (S1D_VALUE)(i); \
|
||||
r = ((volatile S1D_VALUE*)(p))[0x0E/sizeof(S1D_VALUE)]; \
|
||||
g = ((volatile S1D_VALUE*)(p))[0x0D/sizeof(S1D_VALUE)]; \
|
||||
b = ((volatile S1D_VALUE*)(p))[0x0C/sizeof(S1D_VALUE)]; \
|
||||
}
|
||||
|
||||
typedef unsigned short S1D_INDEX;
|
||||
typedef unsigned char S1D_VALUE;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
S1D_INDEX Index;
|
||||
S1D_VALUE Value;
|
||||
} S1D_REGS;
|
||||
|
||||
|
||||
static S1D_REGS aS1DRegs_prelimn[] =
|
||||
{
|
||||
{0x10,0x00}, /* PANEL Type Register */
|
||||
{0xA8,0x00}, /* GPIO Config Register 0 */
|
||||
{0xA9,0x80}, /* GPIO Config Register 1 */
|
||||
|
||||
};
|
||||
|
||||
static S1D_REGS aS1DRegs_stn[] =
|
||||
{
|
||||
{0x04,0x10}, /* BUSCLK MEMCLK Config Register */
|
||||
{0x10,0xD0}, /* PANEL Type Register */
|
||||
{0x11,0x00}, /* MOD Rate Register */
|
||||
{0x14,0x27}, /* Horizontal Display Period Register */
|
||||
{0x16,0x00}, /* Horizontal Display Period Start Pos Register 0 */
|
||||
{0x17,0x00}, /* Horizontal Display Period Start Pos Register 1 */
|
||||
{0x18,0xF0}, /* Vertical Total Register 0 */
|
||||
{0x19,0x00}, /* Vertical Total Register 1 */
|
||||
{0x1C,0xEF}, /* Vertical Display Period Register 0 */
|
||||
{0x1D,0x00}, /* Vertical Display Period Register 1 */
|
||||
{0x1E,0x00}, /* Vertical Display Period Start Pos Register 0 */
|
||||
{0x1F,0x00}, /* Vertical Display Period Start Pos Register 1 */
|
||||
{0x20,0x87}, /* Horizontal Sync Pulse Width Register */
|
||||
{0x22,0x00}, /* Horizontal Sync Pulse Start Pos Register 0 */
|
||||
{0x23,0x00}, /* Horizontal Sync Pulse Start Pos Register 1 */
|
||||
{0x24,0x80}, /* Vertical Sync Pulse Width Register */
|
||||
{0x26,0x01}, /* Vertical Sync Pulse Start Pos Register 0 */
|
||||
{0x27,0x00}, /* Vertical Sync Pulse Start Pos Register 1 */
|
||||
{0x70,0x83}, /* Display Mode Register */
|
||||
{0x71,0x00}, /* Special Effects Register */
|
||||
{0x74,0x00}, /* Main Window Display Start Address Register 0 */
|
||||
{0x75,0x00}, /* Main Window Display Start Address Register 1 */
|
||||
{0x76,0x00}, /* Main Window Display Start Address Register 2 */
|
||||
{0x78,0x50}, /* Main Window Address Offset Register 0 */
|
||||
{0x79,0x00}, /* Main Window Address Offset Register 1 */
|
||||
{0x7C,0x00}, /* Sub Window Display Start Address Register 0 */
|
||||
{0x7D,0x00}, /* Sub Window Display Start Address Register 1 */
|
||||
{0x7E,0x00}, /* Sub Window Display Start Address Register 2 */
|
||||
{0x80,0x50}, /* Sub Window Address Offset Register 0 */
|
||||
{0x81,0x00}, /* Sub Window Address Offset Register 1 */
|
||||
{0x84,0x00}, /* Sub Window X Start Pos Register 0 */
|
||||
{0x85,0x00}, /* Sub Window X Start Pos Register 1 */
|
||||
{0x88,0x00}, /* Sub Window Y Start Pos Register 0 */
|
||||
{0x89,0x00}, /* Sub Window Y Start Pos Register 1 */
|
||||
{0x8C,0x4F}, /* Sub Window X End Pos Register 0 */
|
||||
{0x8D,0x00}, /* Sub Window X End Pos Register 1 */
|
||||
{0x90,0xEF}, /* Sub Window Y End Pos Register 0 */
|
||||
{0x91,0x00}, /* Sub Window Y End Pos Register 1 */
|
||||
{0xA0,0x00}, /* Power Save Config Register */
|
||||
{0xA1,0x00}, /* CPU Access Control Register */
|
||||
{0xA2,0x00}, /* Software Reset Register */
|
||||
{0xA3,0x00}, /* BIG Endian Support Register */
|
||||
{0xA4,0x00}, /* Scratch Pad Register 0 */
|
||||
{0xA5,0x00}, /* Scratch Pad Register 1 */
|
||||
{0xA8,0x01}, /* GPIO Config Register 0 */
|
||||
{0xA9,0x80}, /* GPIO Config Register 1 */
|
||||
{0xAC,0x01}, /* GPIO Status Control Register 0 */
|
||||
{0xAD,0x00}, /* GPIO Status Control Register 1 */
|
||||
{0xB0,0x10}, /* PWM CV Clock Control Register */
|
||||
{0xB1,0x80}, /* PWM CV Clock Config Register */
|
||||
{0xB2,0x00}, /* CV Clock Burst Length Register */
|
||||
{0xAD,0x80}, /* reset seq */
|
||||
{0x70,0x03},
|
||||
};
|
||||
|
||||
static S1D_REGS aS1DRegs_tft[] =
|
||||
{
|
||||
{0x04,0x10}, /* BUSCLK MEMCLK Config Register */
|
||||
{0x05,0x42}, /* PCLK Config Register */
|
||||
{0x10,0x61}, /* PANEL Type Register */
|
||||
{0x11,0x00}, /* MOD Rate Register */
|
||||
{0x12,0x30}, /* Horizontal Total Register */
|
||||
{0x14,0x27}, /* Horizontal Display Period Register */
|
||||
{0x16,0x11}, /* Horizontal Display Period Start Pos Register 0 */
|
||||
{0x17,0x00}, /* Horizontal Display Period Start Pos Register 1 */
|
||||
{0x18,0xFA}, /* Vertical Total Register 0 */
|
||||
{0x19,0x00}, /* Vertical Total Register 1 */
|
||||
{0x1C,0xEF}, /* Vertical Display Period Register 0 */
|
||||
{0x1D,0x00}, /* Vertical Display Period Register 1 */
|
||||
{0x1E,0x00}, /* Vertical Display Period Start Pos Register 0 */
|
||||
{0x1F,0x00}, /* Vertical Display Period Start Pos Register 1 */
|
||||
{0x20,0x07}, /* Horizontal Sync Pulse Width Register */
|
||||
{0x22,0x00}, /* Horizontal Sync Pulse Start Pos Register 0 */
|
||||
{0x23,0x00}, /* Horizontal Sync Pulse Start Pos Register 1 */
|
||||
{0x24,0x00}, /* Vertical Sync Pulse Width Register */
|
||||
{0x26,0x00}, /* Vertical Sync Pulse Start Pos Register 0 */
|
||||
{0x27,0x00}, /* Vertical Sync Pulse Start Pos Register 1 */
|
||||
{0x70,0x03}, /* Display Mode Register */
|
||||
{0x71,0x00}, /* Special Effects Register */
|
||||
{0x74,0x00}, /* Main Window Display Start Address Register 0 */
|
||||
{0x75,0x00}, /* Main Window Display Start Address Register 1 */
|
||||
{0x76,0x00}, /* Main Window Display Start Address Register 2 */
|
||||
{0x78,0x50}, /* Main Window Address Offset Register 0 */
|
||||
{0x79,0x00}, /* Main Window Address Offset Register 1 */
|
||||
{0x7C,0x00}, /* Sub Window Display Start Address Register 0 */
|
||||
{0x7D,0x00}, /* Sub Window Display Start Address Register 1 */
|
||||
{0x7E,0x00}, /* Sub Window Display Start Address Register 2 */
|
||||
{0x80,0x50}, /* Sub Window Address Offset Register 0 */
|
||||
{0x81,0x00}, /* Sub Window Address Offset Register 1 */
|
||||
{0x84,0x00}, /* Sub Window X Start Pos Register 0 */
|
||||
{0x85,0x00}, /* Sub Window X Start Pos Register 1 */
|
||||
{0x88,0x00}, /* Sub Window Y Start Pos Register 0 */
|
||||
{0x89,0x00}, /* Sub Window Y Start Pos Register 1 */
|
||||
{0x8C,0x4F}, /* Sub Window X End Pos Register 0 */
|
||||
{0x8D,0x00}, /* Sub Window X End Pos Register 1 */
|
||||
{0x90,0xEF}, /* Sub Window Y End Pos Register 0 */
|
||||
{0x91,0x00}, /* Sub Window Y End Pos Register 1 */
|
||||
{0xA0,0x00}, /* Power Save Config Register */
|
||||
{0xA1,0x00}, /* CPU Access Control Register */
|
||||
{0xA2,0x00}, /* Software Reset Register */
|
||||
{0xA3,0x00}, /* BIG Endian Support Register */
|
||||
{0xA4,0x00}, /* Scratch Pad Register 0 */
|
||||
{0xA5,0x00}, /* Scratch Pad Register 1 */
|
||||
{0xA8,0x01}, /* GPIO Config Register 0 */
|
||||
{0xA9,0x80}, /* GPIO Config Register 1 */
|
||||
{0xAC,0x01}, /* GPIO Status Control Register 0 */
|
||||
{0xAD,0x00}, /* GPIO Status Control Register 1 */
|
||||
{0xB0,0x10}, /* PWM CV Clock Control Register */
|
||||
{0xB1,0x80}, /* PWM CV Clock Config Register */
|
||||
{0xB2,0x00}, /* CV Clock Burst Length Register */
|
||||
{0xAD,0x80}, /* reset seq */
|
||||
{0x70,0x03},
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2002
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -57,17 +57,17 @@ SECTIONS
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
cpu/mpc8xx/traps.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
/*
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
lib_ppc/cache.o (.text)
|
||||
lib_ppc/time.o (.text)
|
||||
|
||||
. = env_offset;
|
||||
common/environment.o (.ppcenv)
|
||||
common/environment.o(.text)
|
||||
*/
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2002
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
40
board/kup/kup4x/Makefile
Normal file
40
board/kup/kup4x/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# 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 ../common/flash.o ../common/kup.o usb.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
28
board/kup/kup4x/config.mk
Normal file
28
board/kup/kup4x/config.mk
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# KUP4X board
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x40000000
|
||||
311
board/kup/kup4x/kup4x.c
Normal file
311
board/kup/kup4x/kup4x.c
Normal file
@@ -0,0 +1,311 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
* Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.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 <mpc8xx.h>
|
||||
#include "../common/kup.h"
|
||||
#ifdef CONFIG_KUP4K_LOGO
|
||||
/* #include "s1d13706.h" */
|
||||
#endif
|
||||
|
||||
#define KUP4X_USB
|
||||
|
||||
|
||||
typedef struct {
|
||||
volatile unsigned char *VmemAddr;
|
||||
volatile unsigned char *RegAddr;
|
||||
} FB_INFO_S1D13xxx;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int usb_init_kup4x (void);
|
||||
|
||||
|
||||
#ifdef CONFIG_KUP4K_LOGO
|
||||
void lcd_logo (bd_t * bd);
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#define _NOT_USED_ 0xFFFFFFFF
|
||||
|
||||
const uint sdram_table[] = {
|
||||
/*
|
||||
* Single Read. (Offset 0 in UPMA RAM)
|
||||
*/
|
||||
0x1F07FC04, 0xEEAEFC04, 0x11ADFC04, 0xEFBBBC00,
|
||||
0x1FF77C47, /* last */
|
||||
|
||||
/*
|
||||
* SDRAM Initialization (offset 5 in UPMA RAM)
|
||||
*
|
||||
* This is no UPM entry point. The following definition uses
|
||||
* the remaining space to establish an initialization
|
||||
* sequence, which is executed by a RUN command.
|
||||
*
|
||||
*/
|
||||
0x1FF77C35, 0xEFEABC34, 0x1FB57C35, /* last */
|
||||
|
||||
/*
|
||||
* Burst Read. (Offset 8 in UPMA RAM)
|
||||
*/
|
||||
0x1F07FC04, 0xEEAEFC04, 0x10ADFC04, 0xF0AFFC00,
|
||||
0xF0AFFC00, 0xF1AFFC00, 0xEFBBBC00, 0x1FF77C47, /* last */
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
|
||||
/*
|
||||
* Single Write. (Offset 18 in UPMA RAM)
|
||||
*/
|
||||
0x1F27FC04, 0xEEAEBC00, 0x01B93C04, 0x1FF77C47, /* last */
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
|
||||
/*
|
||||
* Burst Write. (Offset 20 in UPMA RAM)
|
||||
*/
|
||||
0x1F07FC04, 0xEEAEBC00, 0x10AD7C00, 0xF0AFFC00,
|
||||
0xF0AFFC00, 0xE1BBBC04, 0x1FF77C47, /* last */
|
||||
_NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
|
||||
/*
|
||||
* Refresh (Offset 30 in UPMA RAM)
|
||||
*/
|
||||
0x1FF5FC84, 0xFFFFFC04, 0xFFFFFC04, 0xFFFFFC04,
|
||||
0xFFFFFC84, 0xFFFFFC07, /* last */
|
||||
_NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
|
||||
/*
|
||||
* Exception. (Offset 3c in UPMA RAM)
|
||||
*/
|
||||
0x7FFFFC07, /* last */
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
uchar *latch, rev, mod;
|
||||
|
||||
/*
|
||||
* Init ChipSelect #4 (CAN + HW-Latch)
|
||||
*/
|
||||
memctl->memc_or4 = 0xFFFF8926;
|
||||
memctl->memc_br4 = 0x90000401;
|
||||
|
||||
latch = (uchar *) 0x90000200;
|
||||
rev = (*latch & 0xF8) >> 3;
|
||||
mod = (*latch & 0x03);
|
||||
printf ("Board: KUP4X Rev %d.%d SN: %s\n", rev, mod,
|
||||
getenv ("ethaddr"));
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
long int size_b0 = 0;
|
||||
long int size_b1 = 0;
|
||||
long int size_b2 = 0;
|
||||
long int size_b3 = 0;
|
||||
|
||||
upmconfig (UPMA, (uint *) sdram_table,
|
||||
sizeof (sdram_table) / sizeof (uint));
|
||||
/*
|
||||
* Preliminary prescaler for refresh (depends on number of
|
||||
* banks): This value is selected for four cycles every 62.4 us
|
||||
* with two SDRAM banks or four cycles every 31.2 us with one
|
||||
* bank. It will be adjusted after memory sizing.
|
||||
*/
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
|
||||
memctl->memc_mar = 0x00000088;
|
||||
|
||||
/*
|
||||
* Map controller banks 1 and 2 to the SDRAM banks 2 and 3 at
|
||||
* preliminary addresses - these have to be modified after the
|
||||
* SDRAM size has been determined.
|
||||
*/
|
||||
/* memctl->memc_or1 = CFG_OR1_PRELIM; */
|
||||
/* memctl->memc_br1 = CFG_BR1_PRELIM; */
|
||||
|
||||
/* memctl->memc_or2 = CFG_OR2_PRELIM; */
|
||||
/* memctl->memc_br2 = CFG_BR2_PRELIM; */
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
|
||||
udelay (200);
|
||||
|
||||
/* perform SDRAM initializsation sequence */
|
||||
|
||||
memctl->memc_mcr = 0x80002105; /* SDRAM bank 0 */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80002830; /* SDRAM bank 0 - execute twice */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80002106; /* SDRAM bank 0 - RUN MRS Pattern from loc 6 */
|
||||
udelay (1);
|
||||
|
||||
memctl->memc_mcr = 0x80004105; /* SDRAM bank 1 */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80004830; /* SDRAM bank 1 - execute twice */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80004106; /* SDRAM bank 1 - RUN MRS Pattern from loc 6 */
|
||||
udelay (1);
|
||||
|
||||
memctl->memc_mcr = 0x80006105; /* SDRAM bank 2 */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80006830; /* SDRAM bank 2 - execute twice */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80006106; /* SDRAM bank 2 - RUN MRS Pattern from loc 6 */
|
||||
udelay (1);
|
||||
|
||||
memctl->memc_mcr = 0x8000C105; /* SDRAM bank 2 */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x8000C830; /* SDRAM bank 2 - execute twice */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x8000C106; /* SDRAM bank 2 - RUN MRS Pattern from loc 6 */
|
||||
udelay (1);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* enable refresh */
|
||||
udelay (1000);
|
||||
#if 0 /* 4 x 8MB */
|
||||
size_b0 = 0x00800000;
|
||||
size_b1 = 0x00800000;
|
||||
size_b2 = 0x00800000;
|
||||
size_b3 = 0x00800000;
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
udelay (1000);
|
||||
memctl->memc_or1 = 0xFF800A00;
|
||||
memctl->memc_br1 = 0x00000081;
|
||||
memctl->memc_or2 = 0xFF000A00;
|
||||
memctl->memc_br2 = 0x00800081;
|
||||
memctl->memc_or3 = 0xFE000A00;
|
||||
memctl->memc_br3 = 0x01000081;
|
||||
memctl->memc_or6 = 0xFE000A00;
|
||||
memctl->memc_br6 = 0x01800081;
|
||||
#else /* 4 x 16 MB */
|
||||
size_b0 = 0x01000000;
|
||||
size_b1 = 0x01000000;
|
||||
size_b2 = 0x01000000;
|
||||
size_b3 = 0x01000000;
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
udelay (1000);
|
||||
memctl->memc_or1 = 0xFF000A00;
|
||||
memctl->memc_br1 = 0x00000081;
|
||||
memctl->memc_or2 = 0xFE000A00;
|
||||
memctl->memc_br2 = 0x01000081;
|
||||
memctl->memc_or3 = 0xFD000A00;
|
||||
memctl->memc_br3 = 0x02000081;
|
||||
memctl->memc_or6 = 0xFC000A00;
|
||||
memctl->memc_br6 = 0x03000081;
|
||||
#endif
|
||||
udelay (10000);
|
||||
|
||||
return (size_b0 + size_b1 + size_b2 + size_b3);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Check memory range for valid RAM. A simple memory test determines
|
||||
* the actually available RAM size between addresses `base' and
|
||||
* `base + maxsize'. Some (not all) hardware errors are detected:
|
||||
* - short between address lines
|
||||
* - short between data lines
|
||||
*/
|
||||
#if 0
|
||||
static long int dram_size (long int mamr_value, long int *base,
|
||||
long int maxsize)
|
||||
{
|
||||
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 */
|
||||
unsigned char i = 0;
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
|
||||
for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
/* write 0 to base address */
|
||||
addr = base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
#endif
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
|
||||
#ifdef CONFIG_IDE_LED
|
||||
/* Configure PA8 as output port */
|
||||
immap->im_ioport.iop_padir |= 0x80;
|
||||
immap->im_ioport.iop_paodr |= 0x80;
|
||||
immap->im_ioport.iop_papar &= ~0x80;
|
||||
immap->im_ioport.iop_padat |= 0x80; /* turn it off */
|
||||
#endif
|
||||
#ifdef KUP4X_USB
|
||||
usb_init_kup4x ();
|
||||
#endif
|
||||
setenv ("hw", "4x");
|
||||
poweron_key ();
|
||||
return (0);
|
||||
}
|
||||
141
board/kup/kup4x/u-boot.lds
Normal file
141
board/kup/kup4x/u-boot.lds
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* 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 :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
/*
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.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 = .);
|
||||
}
|
||||
135
board/kup/kup4x/u-boot.lds.debug
Normal file
135
board/kup/kup4x/u-boot.lds.debug
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* 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 :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
|
||||
. = env_offset;
|
||||
common/environment.o(.text)
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 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 = .);
|
||||
}
|
||||
81
board/kup/kup4x/usb.c
Normal file
81
board/kup/kup4x/usb.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.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 <mpc8xx.h>
|
||||
#include "../common/kup.h"
|
||||
|
||||
|
||||
#define SL811_ADR (0x50000000)
|
||||
#define SL811_DAT (0x50000001)
|
||||
|
||||
|
||||
static void sl811_write_index_data (__u8 index, __u8 data)
|
||||
{
|
||||
*(volatile unsigned char *) (SL811_ADR) = index;
|
||||
__asm__ ("eieio");
|
||||
*(volatile unsigned char *) (SL811_DAT) = data;
|
||||
__asm__ ("eieio");
|
||||
}
|
||||
|
||||
static __u8 sl811_read_index_data (__u8 index)
|
||||
{
|
||||
__u8 data;
|
||||
|
||||
*(volatile unsigned char *) (SL811_ADR) = index;
|
||||
__asm__ ("eieio");
|
||||
data = *(volatile unsigned char *) (SL811_DAT);
|
||||
__asm__ ("eieio");
|
||||
return (data);
|
||||
}
|
||||
|
||||
int usb_init_kup4x (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
int i;
|
||||
unsigned char tmp;
|
||||
|
||||
memctl = &immap->im_memctl;
|
||||
memctl->memc_or7 = 0xFFFF8726;
|
||||
memctl->memc_br7 = 0x50000401; /* start at 0x50000000 */
|
||||
/* BP 14 low = USB ON */
|
||||
immap->im_cpm.cp_pbdat &= ~(BP_USB_VCC);
|
||||
/* PB 14 nomal port */
|
||||
immap->im_cpm.cp_pbpar &= ~(BP_USB_VCC);
|
||||
/* output */
|
||||
immap->im_cpm.cp_pbdir |= (BP_USB_VCC);
|
||||
|
||||
puts ("USB: ");
|
||||
|
||||
for (i = 0x10; i < 0xff; i++) {
|
||||
sl811_write_index_data (i, i);
|
||||
tmp = (sl811_read_index_data (i));
|
||||
if (tmp != i) {
|
||||
printf ("SL811 compare error index=0x%02x read=0x%02x\n", i, tmp);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
printf ("SL811 ready\n");
|
||||
return (0);
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/*---------------------------------------------------------------------------- */
|
||||
/* */
|
||||
/* File generated by S1D13706CFG.EXE */
|
||||
/* */
|
||||
/* Copyright (c) 2000,2001 Epson Research and Development, Inc. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------- */
|
||||
|
||||
/* Panel: 320x240x8bpp 70Hz Color Single STN 8-bit (PCLK=6.250MHz) (Format 2) */
|
||||
|
||||
#define S1D_DISPLAY_WIDTH 320
|
||||
#define S1D_DISPLAY_HEIGHT 240
|
||||
#define S1D_DISPLAY_BPP 8
|
||||
#define S1D_DISPLAY_SCANLINE_BYTES 320
|
||||
#define S1D_PHYSICAL_VMEM_ADDR 0x800A0000L
|
||||
#define S1D_PHYSICAL_VMEM_SIZE 0x14000L
|
||||
#define S1D_PHYSICAL_REG_ADDR 0x80080000L
|
||||
#define S1D_PHYSICAL_REG_SIZE 0x100
|
||||
#define S1D_DISPLAY_PCLK 6250
|
||||
#define S1D_PALETTE_SIZE 256
|
||||
#define S1D_REGDELAYOFF 0xFFFE
|
||||
#define S1D_REGDELAYON 0xFFFF
|
||||
|
||||
#define S1D_WRITE_PALETTE(p,i,r,g,b) \
|
||||
{ \
|
||||
((volatile S1D_VALUE*)(p))[0x0A/sizeof(S1D_VALUE)] = (S1D_VALUE)((r)>>4); \
|
||||
((volatile S1D_VALUE*)(p))[0x09/sizeof(S1D_VALUE)] = (S1D_VALUE)((g)>>4); \
|
||||
((volatile S1D_VALUE*)(p))[0x08/sizeof(S1D_VALUE)] = (S1D_VALUE)((b)>>4); \
|
||||
((volatile S1D_VALUE*)(p))[0x0B/sizeof(S1D_VALUE)] = (S1D_VALUE)(i); \
|
||||
}
|
||||
|
||||
#define S1D_READ_PALETTE(p,i,r,g,b) \
|
||||
{ \
|
||||
((volatile S1D_VALUE*)(p))[0x0F/sizeof(S1D_VALUE)] = (S1D_VALUE)(i); \
|
||||
r = ((volatile S1D_VALUE*)(p))[0x0E/sizeof(S1D_VALUE)]; \
|
||||
g = ((volatile S1D_VALUE*)(p))[0x0D/sizeof(S1D_VALUE)]; \
|
||||
b = ((volatile S1D_VALUE*)(p))[0x0C/sizeof(S1D_VALUE)]; \
|
||||
}
|
||||
|
||||
typedef unsigned short S1D_INDEX;
|
||||
typedef unsigned char S1D_VALUE;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
S1D_INDEX Index;
|
||||
S1D_VALUE Value;
|
||||
} S1D_REGS;
|
||||
|
||||
static S1D_REGS aS1DRegs[] =
|
||||
{
|
||||
{0x04,0x10}, /* BUSCLK MEMCLK Config Register */
|
||||
#if 0
|
||||
{0x05,0x32}, /* PCLK Config Register */
|
||||
#endif
|
||||
{0x10,0xD0}, /* PANEL Type Register */
|
||||
{0x11,0x00}, /* MOD Rate Register */
|
||||
#if 0
|
||||
{0x12,0x34}, /* Horizontal Total Register */
|
||||
#endif
|
||||
{0x14,0x27}, /* Horizontal Display Period Register */
|
||||
{0x16,0x00}, /* Horizontal Display Period Start Pos Register 0 */
|
||||
{0x17,0x00}, /* Horizontal Display Period Start Pos Register 1 */
|
||||
{0x18,0xF0}, /* Vertical Total Register 0 */
|
||||
{0x19,0x00}, /* Vertical Total Register 1 */
|
||||
{0x1C,0xEF}, /* Vertical Display Period Register 0 */
|
||||
{0x1D,0x00}, /* Vertical Display Period Register 1 */
|
||||
{0x1E,0x00}, /* Vertical Display Period Start Pos Register 0 */
|
||||
{0x1F,0x00}, /* Vertical Display Period Start Pos Register 1 */
|
||||
{0x20,0x87}, /* Horizontal Sync Pulse Width Register */
|
||||
{0x22,0x00}, /* Horizontal Sync Pulse Start Pos Register 0 */
|
||||
{0x23,0x00}, /* Horizontal Sync Pulse Start Pos Register 1 */
|
||||
{0x24,0x80}, /* Vertical Sync Pulse Width Register */
|
||||
{0x26,0x01}, /* Vertical Sync Pulse Start Pos Register 0 */
|
||||
{0x27,0x00}, /* Vertical Sync Pulse Start Pos Register 1 */
|
||||
{0x70,0x83}, /* Display Mode Register */
|
||||
{0x71,0x00}, /* Special Effects Register */
|
||||
{0x74,0x00}, /* Main Window Display Start Address Register 0 */
|
||||
{0x75,0x00}, /* Main Window Display Start Address Register 1 */
|
||||
{0x76,0x00}, /* Main Window Display Start Address Register 2 */
|
||||
{0x78,0x50}, /* Main Window Address Offset Register 0 */
|
||||
{0x79,0x00}, /* Main Window Address Offset Register 1 */
|
||||
{0x7C,0x00}, /* Sub Window Display Start Address Register 0 */
|
||||
{0x7D,0x00}, /* Sub Window Display Start Address Register 1 */
|
||||
{0x7E,0x00}, /* Sub Window Display Start Address Register 2 */
|
||||
{0x80,0x50}, /* Sub Window Address Offset Register 0 */
|
||||
{0x81,0x00}, /* Sub Window Address Offset Register 1 */
|
||||
{0x84,0x00}, /* Sub Window X Start Pos Register 0 */
|
||||
{0x85,0x00}, /* Sub Window X Start Pos Register 1 */
|
||||
{0x88,0x00}, /* Sub Window Y Start Pos Register 0 */
|
||||
{0x89,0x00}, /* Sub Window Y Start Pos Register 1 */
|
||||
{0x8C,0x4F}, /* Sub Window X End Pos Register 0 */
|
||||
{0x8D,0x00}, /* Sub Window X End Pos Register 1 */
|
||||
{0x90,0xEF}, /* Sub Window Y End Pos Register 0 */
|
||||
{0x91,0x00}, /* Sub Window Y End Pos Register 1 */
|
||||
{0xA0,0x00}, /* Power Save Config Register */
|
||||
{0xA1,0x00}, /* CPU Access Control Register */
|
||||
{0xA2,0x00}, /* Software Reset Register */
|
||||
{0xA3,0x00}, /* BIG Endian Support Register */
|
||||
{0xA4,0x00}, /* Scratch Pad Register 0 */
|
||||
{0xA5,0x00}, /* Scratch Pad Register 1 */
|
||||
{0xA8,0x01}, /* GPIO Config Register 0 */
|
||||
{0xA9,0x80}, /* GPIO Config Register 1 */
|
||||
{0xAC,0x01}, /* GPIO Status Control Register 0 */
|
||||
{0xAD,0x00}, /* GPIO Status Control Register 1 */
|
||||
{0xB0,0x10}, /* PWM CV Clock Control Register */
|
||||
{0xB1,0x80}, /* PWM CV Clock Config Register */
|
||||
{0xB2,0x00}, /* CV Clock Burst Length Register */
|
||||
{0xB3,0xA0}, /* PWM Clock Duty Cycle Register */
|
||||
{0xAD,0x80}, /* reset seq */
|
||||
{0x70,0x03}, /* */
|
||||
};
|
||||
@@ -232,7 +232,7 @@ mpl_prg_image(uchar *ld_addr)
|
||||
}
|
||||
puts("OK\n");
|
||||
break;
|
||||
#if CONFIG_BZIP2
|
||||
#ifdef CONFIG_BZIP2
|
||||
case IH_COMP_BZIP2:
|
||||
puts("Uncompressing (BZIP2) ... ");
|
||||
{
|
||||
|
||||
47
board/ns9750dev/Makefile
Normal file
47
board/ns9750dev/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001, 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 := ns9750dev.o flash.o led.o
|
||||
SOBJS := platform.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
16
board/ns9750dev/config.mk
Normal file
16
board/ns9750dev/config.mk
Normal file
@@ -0,0 +1,16 @@
|
||||
#######################################################################
|
||||
#
|
||||
# Copyright (C) 2004 by FS Forth-Systeme GmbH.
|
||||
# Markus Pietrek <mpietrek@fsforth.de>
|
||||
#
|
||||
# @TODO
|
||||
# Linux-Kernel is expected to be at 0000'8000, entry 0000'8000
|
||||
# optionally with a ramdisk at 0080'0000
|
||||
#
|
||||
# we load ourself to 0078'0000
|
||||
#
|
||||
# download area is 0060'0000
|
||||
#
|
||||
|
||||
|
||||
TEXT_BASE = 0x00780000
|
||||
477
board/ns9750dev/flash.c
Normal file
477
board/ns9750dev/flash.c
Normal file
@@ -0,0 +1,477 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.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 <linux/byteorder/swab.h>
|
||||
|
||||
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */
|
||||
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) __swab16(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")
|
||||
|
||||
|
||||
/* Flash Organization Structure */
|
||||
typedef struct OrgDef {
|
||||
unsigned int sector_number;
|
||||
unsigned int sector_size;
|
||||
} OrgDef;
|
||||
|
||||
|
||||
/* Flash Organizations */
|
||||
OrgDef OrgIntel_28F256L18T[] = {
|
||||
{4, 32 * 1024}, /* 4 * 32kBytes sectors */
|
||||
{255, 128 * 1024}, /* 255 * 128kBytes sectors */
|
||||
};
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
unsigned long flash_init (void);
|
||||
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);
|
||||
void flash_print_info (flash_info_t * info);
|
||||
void flash_unprotect_sectors (FPWV * addr);
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last);
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
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 too 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 + monitor_flash_len - 1, &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;
|
||||
OrgDef *pOrgDef;
|
||||
|
||||
pOrgDef = OrgIntel_28F256L18T;
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (i > 255) {
|
||||
info->start[i] = base + (i * 0x8000);
|
||||
info->protect[i] = 0;
|
||||
} else {
|
||||
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_28F256L18T:
|
||||
printf ("FLASH 28F256L18T\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_28F256L18T):
|
||||
info->flash_id += FLASH_28F256L18T;
|
||||
info->sector_count = 259;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 32 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);
|
||||
}
|
||||
|
||||
|
||||
/* unprotects a sector for write and erase
|
||||
* on some intel parts, this unprotects the entire chip, but it
|
||||
* wont hurt to call this additional times per sector...
|
||||
*/
|
||||
void flash_unprotect_sectors (FPWV * addr)
|
||||
{
|
||||
#define PD_FINTEL_WSMS_READY_MASK 0x0080
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
|
||||
/* this sends the clear lock bit command */
|
||||
*addr = (FPW) 0x00600060;
|
||||
*addr = (FPW) 0x00D000D0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type, start, last;
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* 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);
|
||||
|
||||
flash_unprotect_sectors (addr);
|
||||
|
||||
/* 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");
|
||||
/* suspend erase */
|
||||
*addr = (FPW) 0x00B000B0;
|
||||
/* reset to read mode */
|
||||
*addr = (FPW) 0x00FF00FF;
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear status register cmd. */
|
||||
*addr = (FPW) 0x00500050;
|
||||
*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 (%x)\n", (ulong) addr, *addr);
|
||||
return (2);
|
||||
}
|
||||
flash_unprotect_sectors (addr);
|
||||
/* 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;
|
||||
}
|
||||
46
board/ns9750dev/led.c
Normal file
46
board/ns9750dev/led.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* Copyright (C) 2004 by FS Forth-Systeme GmbH.
|
||||
* All rights reserved.
|
||||
*
|
||||
* $Id: led.c,v 1.1 2004/02/16 10:37:20 mpietrek Exp $
|
||||
* @Author: Markus Pietrek
|
||||
* @Descr: Defines helper functions for toggeling LEDs
|
||||
* @Usage:
|
||||
* @References: [1]
|
||||
*
|
||||
* 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
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#ifdef CONFIG_STATUS_LED
|
||||
|
||||
#include <ns9750_bbus.h>
|
||||
|
||||
static inline void __led_init( led_id_t mask, int state )
|
||||
{
|
||||
XXXX;
|
||||
}
|
||||
|
||||
static inline void __led_toggle( led_id_t mask )
|
||||
{
|
||||
}
|
||||
|
||||
static inline void __led_set( led_id_t mask, int state )
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_STATUS_LED */
|
||||
127
board/ns9750dev/ns9750dev.c
Normal file
127
board/ns9750dev/ns9750dev.c
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* Copyright (C) 2004 by FS Forth-Systeme GmbH.
|
||||
* All rights reserved.
|
||||
* Markus Pietrek <mpietrek@fsforth.de>
|
||||
* derived from omap1610innovator.c
|
||||
* @References: [1] NS9750 Hardware Reference/December 2003
|
||||
*
|
||||
* 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(CONFIG_NS9750DEV)
|
||||
# include <./configs/ns9750dev.h>
|
||||
# include <./ns9750_bbus.h>
|
||||
#endif
|
||||
|
||||
void flash__init( void );
|
||||
void ether__init( void );
|
||||
|
||||
static inline void delay( unsigned long loops )
|
||||
{
|
||||
__asm__ volatile ("1:\n"
|
||||
"subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0" (loops));
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* @Function: board_init
|
||||
* @Return: 0
|
||||
* @Descr: Enables BBUS modules and other devices
|
||||
***********************************************************************/
|
||||
|
||||
int board_init( void )
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* Active BBUS modules */
|
||||
*get_bbus_reg_addr( NS9750_BBUS_MASTER_RESET ) = 0;
|
||||
|
||||
#warning TODO check numbers
|
||||
/* arch number of OMAP 1510-Board */
|
||||
/* to be changed for OMAP 1610 Board */
|
||||
gd->bd->bi_arch_number = 234;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x10000100;
|
||||
|
||||
|
||||
/* this speeds up your boot a quite a bit. However to make it
|
||||
* work, you need make sure your kernel startup flush bug is fixed.
|
||||
* ... rkw ...
|
||||
*/
|
||||
icache_enable();
|
||||
|
||||
flash__init();
|
||||
ether__init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/* currently empty */
|
||||
return (0);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
void flash__init (void)
|
||||
{
|
||||
}
|
||||
/*************************************************************
|
||||
Routine:ether__init
|
||||
Description: take the Ethernet controller out of reset and wait
|
||||
for the EEPROM load to complete.
|
||||
*************************************************************/
|
||||
void ether__init (void)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
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;
|
||||
|
||||
#if CONFIG_NR_DRAM_BANKS > 1
|
||||
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
|
||||
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
298
board/ns9750dev/platform.S
Normal file
298
board/ns9750dev/platform.S
Normal file
@@ -0,0 +1,298 @@
|
||||
/*
|
||||
* Board specific setup info
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* Modified for the NS9750 DevBoard by
|
||||
* (C) Copyright 2004 by FS Forth-Systeme GmbH.
|
||||
* Markus Pietrek <mpietrek@fsforth.de>
|
||||
* @References: [1] NS9750 Hardware Reference/December 2003
|
||||
* [2] ns9750_a.cmd from MAJIC configuration
|
||||
*
|
||||
* 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 <config.h>
|
||||
#include <version.h>
|
||||
|
||||
#if defined(CONFIG_NS9750DEV)
|
||||
# ifdef CONFIG_INIT_CRITICAL
|
||||
# include <./ns9750_sys.h>
|
||||
# include <./ns9750_mem.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* @Function: write_register_block
|
||||
* @Return: nothing
|
||||
* @Descr: Copies the register block of register_offset:register value to
|
||||
* the registers at base r0. The block is assumed to start in RAM at r1
|
||||
* and end at r2. The linked RAM base address of U-Boot is assumed to be
|
||||
* in r5 while the ROM base address we are running from is r6
|
||||
* Uses r3 and r4 as tempory registers
|
||||
***********************************************************************/
|
||||
|
||||
.macro write_register_block
|
||||
@@ map the addresses to high memory
|
||||
sub r1, r1, r5
|
||||
add r1, r1, r6
|
||||
sub r2, r2, r5
|
||||
add r2, r2, r6
|
||||
|
||||
@@ copy all
|
||||
1:
|
||||
@@ Write register/value pair starting at [r1] to register base r0
|
||||
ldr r3, [r1], #4
|
||||
ldr r4, [r1], #4
|
||||
str r4, [r0,r3]
|
||||
cmp r1, r2
|
||||
blt 1b
|
||||
.endm
|
||||
|
||||
_TEXT_BASE:
|
||||
.word TEXT_BASE @ sdram load addr from config.mk
|
||||
_PHYS_FLASH:
|
||||
.word PHYS_FLASH_1 @ real flash address (without mirroring)
|
||||
_CAS_LATENCY:
|
||||
.word 0x00022000 @ for CAS2 latency
|
||||
|
||||
#ifdef CONFIG_INIT_CRITICAL
|
||||
.globl platformsetup
|
||||
platformsetup:
|
||||
|
||||
/* U-Boot may be linked to RAM at 0x780000. But this code will run in
|
||||
flash from 0x0. But in order to enable RAM we have to disable the
|
||||
mirror bit, therefore we have to jump to our real flash address
|
||||
beginning at PHYS_FLASH_1 (CS4 Base). Therefore,
|
||||
_run_at_real_flash_address may be 0x500003b0 while be linked to
|
||||
0x7803b0. So we must modify our linked addresses */
|
||||
|
||||
@@ branch to high memory address, away from 0x0
|
||||
ldr r5, _TEXT_BASE
|
||||
ldr r6, _PHYS_FLASH
|
||||
ldr r0, =_run_at_real_flash_address
|
||||
sub r0, r0, r5
|
||||
add r0, r0, r6
|
||||
mov pc, r0
|
||||
nop @ for pipelining
|
||||
|
||||
_run_at_real_flash_address:
|
||||
@@ now we are running > PHYS_FLASH_1, safe to enable memory controller
|
||||
|
||||
@@ Write Memory Configuration Registers
|
||||
|
||||
ldr r0, _NS9750_MEM_MODULE_BASE
|
||||
ldr r1, =_MEM_CONFIG_START
|
||||
ldr r2, =_MEM_CONFIG_END
|
||||
|
||||
write_register_block
|
||||
|
||||
@@ Give SDRAM some time to settle
|
||||
@@ @TODO. According to [2] it should be 2 AHB cycles. Check
|
||||
|
||||
ldr r1, =0x50
|
||||
_sdram_settle:
|
||||
subs r1, r1, #1
|
||||
bne _sdram_settle
|
||||
|
||||
_enable_mappings:
|
||||
@@ Enable SDRAM Mode
|
||||
|
||||
ldr r1, =_MEM_MODE_START
|
||||
ldr r2, =_MEM_MODE_END
|
||||
|
||||
write_register_block
|
||||
|
||||
ldr r3, _CAS_LATENCY @ perform one read from SDRAM
|
||||
ldr r3, [r3]
|
||||
|
||||
@@ Enable SDRAM and memory mappings
|
||||
|
||||
ldr r1, =_MEM_ENABLE_START
|
||||
ldr r2, =_MEM_ENABLE_END
|
||||
|
||||
write_register_block
|
||||
|
||||
@@ Activate AHB monitor
|
||||
|
||||
ldr r0, =NS9750_SYS_MODULE_BASE
|
||||
ldr r1, =_AHB_MONITOR_START
|
||||
ldr r2, =_AHB_MONITOR_END
|
||||
|
||||
write_register_block
|
||||
_relocate_lr:
|
||||
/* lr and ip (from cpu_init_crit) are still based on 0x0, relocate it to
|
||||
PHYS_FLASH. */
|
||||
mov r1, ip
|
||||
add r1, r1, r6
|
||||
mov ip, r1
|
||||
|
||||
mov r1, lr
|
||||
add r1, r1, r6
|
||||
mov lr, r1
|
||||
|
||||
@@ back to arch calling code
|
||||
mov pc, lr
|
||||
|
||||
.ltorg
|
||||
|
||||
_NS9750_MEM_MODULE_BASE:
|
||||
.word NS9750_MEM_MODULE_BASE
|
||||
|
||||
_MEM_CONFIG_START:
|
||||
/* Table of 2 32bit entries. First word is register address offset
|
||||
relative to NS9750_MEM_MODULE_BASE, second one is value. They are
|
||||
written in order of appearance */
|
||||
|
||||
@@ Register values taken from [2]
|
||||
.word NS9750_MEM_CTRL
|
||||
.word NS9750_MEM_CTRL_E
|
||||
|
||||
.word NS9750_MEM_DYN_REFRESH
|
||||
.word (0x6 & NS9750_MEM_DYN_REFRESH_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_READ_CFG
|
||||
.word (0x1 & NS9750_MEM_DYN_READ_CFG_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TRP
|
||||
.word (0x1 & NS9750_MEM_DYN_TRP_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TRAS
|
||||
.word (0x4 & NS9750_MEM_DYN_TRAS_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TAPR
|
||||
.word (0x1 & NS9750_MEM_DYN_TRAS_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TDAL
|
||||
.word (0x5 & NS9750_MEM_DYN_TDAL_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TWR
|
||||
.word (0x1 & NS9750_MEM_DYN_TWR_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TRC
|
||||
.word (0x6 & NS9750_MEM_DYN_TRC_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TRFC
|
||||
.word (0x6 & NS9750_MEM_DYN_TRFC_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TRRD
|
||||
.word (0x1 & NS9750_MEM_DYN_TRRD_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_TMRD
|
||||
.word (0x1 & NS9750_MEM_DYN_TMRD_MA)
|
||||
|
||||
@@ CS 4
|
||||
.word NS9750_MEM_DYN_CFG(0)
|
||||
.word (NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
.word NS9750_MEM_DYN_RAS_CAS(0)
|
||||
.word ((0x200 & NS9750_MEM_DYN_RAS_CAS_CAS_MA) | \
|
||||
(0x03 & NS9750_MEM_DYN_RAS_CAS_RAS_MA))
|
||||
|
||||
@@ CS 5
|
||||
.word NS9750_MEM_DYN_CFG(1)
|
||||
.word (NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
.word NS9750_MEM_DYN_RAS_CAS(1)
|
||||
.word ((0x200 & NS9750_MEM_DYN_RAS_CAS_CAS_MA) | \
|
||||
(0x03 & NS9750_MEM_DYN_RAS_CAS_RAS_MA))
|
||||
|
||||
@@ CS 6
|
||||
.word NS9750_MEM_DYN_CFG(2)
|
||||
.word (NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
.word NS9750_MEM_DYN_RAS_CAS(2)
|
||||
.word ((0x200 & NS9750_MEM_DYN_RAS_CAS_CAS_MA) | \
|
||||
(0x03 & NS9750_MEM_DYN_RAS_CAS_RAS_MA))
|
||||
|
||||
@@ CS 7
|
||||
.word NS9750_MEM_DYN_CFG(3)
|
||||
.word (NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
.word NS9750_MEM_DYN_RAS_CAS(3)
|
||||
.word ((0x200 & NS9750_MEM_DYN_RAS_CAS_CAS_MA) | \
|
||||
(0x03 & NS9750_MEM_DYN_RAS_CAS_RAS_MA))
|
||||
|
||||
.word NS9750_MEM_DYN_CTRL
|
||||
.word (NS9750_MEM_DYN_CTRL_I_PALL | \
|
||||
NS9750_MEM_DYN_CTRL_SR | \
|
||||
NS9750_MEM_DYN_CTRL_CE )
|
||||
|
||||
.word NS9750_MEM_DYN_REFRESH
|
||||
.word (0x1 & NS9750_MEM_DYN_REFRESH_MA)
|
||||
@@ No further register settings after refresh
|
||||
_MEM_CONFIG_END:
|
||||
|
||||
_MEM_MODE_START:
|
||||
.word NS9750_MEM_DYN_REFRESH
|
||||
.word (0x30 & NS9750_MEM_DYN_REFRESH_MA)
|
||||
|
||||
.word NS9750_MEM_DYN_CTRL
|
||||
.word (NS9750_MEM_DYN_CTRL_I_MODE | \
|
||||
NS9750_MEM_DYN_CTRL_SR | \
|
||||
NS9750_MEM_DYN_CTRL_CE )
|
||||
_MEM_MODE_END:
|
||||
|
||||
_MEM_ENABLE_START:
|
||||
.word NS9750_MEM_DYN_CTRL
|
||||
.word (NS9750_MEM_DYN_CTRL_I_NORMAL | \
|
||||
NS9750_MEM_DYN_CTRL_SR | \
|
||||
NS9750_MEM_DYN_CTRL_CE )
|
||||
|
||||
@@ CS 4
|
||||
.word NS9750_MEM_DYN_CFG(0)
|
||||
.word (NS9750_MEM_DYN_CFG_BDMC | \
|
||||
NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
@@ CS 5
|
||||
.word NS9750_MEM_DYN_CFG(1)
|
||||
.word (NS9750_MEM_DYN_CFG_BDMC | \
|
||||
NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
@@ CS 6
|
||||
.word NS9750_MEM_DYN_CFG(2)
|
||||
.word (NS9750_MEM_DYN_CFG_BDMC | \
|
||||
NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
|
||||
@@ CS 7
|
||||
.word NS9750_MEM_DYN_CFG(3)
|
||||
.word (NS9750_MEM_DYN_CFG_BDMC | \
|
||||
NS9750_MEM_DYN_CFG_AM | \
|
||||
(0x280 & NS9750_MEM_DYN_CFG_AM_MA))
|
||||
_MEM_ENABLE_END:
|
||||
|
||||
_AHB_MONITOR_START:
|
||||
.word NS9750_SYS_AHB_TIMEOUT
|
||||
.word 0x01000100 @ @TODO not calculated yet
|
||||
|
||||
.word NS9750_SYS_AHB_MON
|
||||
.word (NS9750_SYS_AHB_MON_BMTC_GEN_IRQ | \
|
||||
NS9750_SYS_AHB_MON_BATC_GEN_IRQ)
|
||||
_AHB_MONITOR_END:
|
||||
|
||||
#endif /* CONFIG_INIT_CRITICAL */
|
||||
58
board/ns9750dev/u-boot.lds
Normal file
58
board/ns9750dev/u-boot.lds
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@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-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/arm926ejs/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 = .;
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
_end = . ;
|
||||
|
||||
}
|
||||
47
board/ocotea/Makefile
Normal file
47
board/ocotea/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 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 = $(BOARD).o flash.o
|
||||
SOBJS = init.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
|
||||
|
||||
#########################################################################
|
||||
44
board/ocotea/config.mk
Normal file
44
board/ocotea/config.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# IBM 440GX Reference Platform (Ocotea) board
|
||||
#
|
||||
|
||||
#TEXT_BASE = 0xFFFE0000
|
||||
|
||||
ifeq ($(ramsym),1)
|
||||
TEXT_BASE = 0x07FD0000
|
||||
else
|
||||
TEXT_BASE = 0xFFF80000
|
||||
endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_440=1
|
||||
|
||||
ifeq ($(debug),1)
|
||||
PLATFORM_CPPFLAGS += -DDEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(dbcr),1)
|
||||
PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8cff0000
|
||||
endif
|
||||
595
board/ocotea/flash.c
Normal file
595
board/ocotea/flash.c
Normal file
@@ -0,0 +1,595 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002 Jun Gu <jung@artesyncp.com>
|
||||
* Add support for Am29F016D and dynamic switch setting.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified 4/5/2001
|
||||
* Wait for completion of each sector erase command issued
|
||||
* 4/5/2001
|
||||
* Chris Hallinan - DS4.COM, Inc. - clh@net1plus.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DEBUGF(x...) printf(x)
|
||||
#else
|
||||
#define DEBUGF(x...)
|
||||
#endif /* DEBUG */
|
||||
|
||||
#define BOOT_SMALL_FLASH 32 /* 00100000 */
|
||||
#define FLASH_ONBD_N 2 /* 00000010 */
|
||||
#define FLASH_SRAM_SEL 1 /* 00000001 */
|
||||
|
||||
#define BOOT_SMALL_FLASH_VAL 4
|
||||
#define FLASH_ONBD_N_VAL 2
|
||||
#define FLASH_SRAM_SEL_VAL 1
|
||||
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
static unsigned long flash_addr_table[8][CFG_MAX_FLASH_BANKS] = {
|
||||
{0xFF800000, 0xFF900000, 0xFFC00000}, /* 0:000: configuraton 4 */
|
||||
{0xFF900000, 0xFF800000, 0xFFC00000}, /* 1:001: configuraton 3 */
|
||||
{0x00000000, 0x00000000, 0x00000000}, /* 2:010: configuraton 8 */
|
||||
{0x00000000, 0x00000000, 0x00000000}, /* 3:011: configuraton 7 */
|
||||
{0xFFE00000, 0xFFF00000, 0xFF800000}, /* 4:100: configuraton 2 */
|
||||
{0xFFF00000, 0xFFF80000, 0xFF800000}, /* 5:101: configuraton 1 */
|
||||
{0x00000000, 0x00000000, 0x00000000}, /* 6:110: configuraton 6 */
|
||||
{0x00000000, 0x00000000, 0x00000000} /* 7:111: configuraton 5 */
|
||||
};
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size(vu_long * addr, flash_info_t * info);
|
||||
static int write_word(flash_info_t * info, ulong dest, ulong data);
|
||||
|
||||
|
||||
#ifdef CONFIG_OCOTEA
|
||||
#define ADDR0 0x5555
|
||||
#define ADDR1 0x2aaa
|
||||
#define FLASH_WORD_SIZE unsigned char
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init(void)
|
||||
{
|
||||
unsigned long total_b = 0;
|
||||
unsigned long size_b[CFG_MAX_FLASH_BANKS];
|
||||
unsigned char *fpga_base = (unsigned char *) CFG_FPGA_BASE;
|
||||
unsigned char switch_status;
|
||||
unsigned short index = 0;
|
||||
int i;
|
||||
|
||||
/* read FPGA base register FPGA_REG0 */
|
||||
switch_status = *fpga_base;
|
||||
|
||||
/* check the bitmap of switch status */
|
||||
if (switch_status & BOOT_SMALL_FLASH) {
|
||||
index += BOOT_SMALL_FLASH_VAL;
|
||||
}
|
||||
if (switch_status & FLASH_ONBD_N) {
|
||||
index += FLASH_ONBD_N_VAL;
|
||||
}
|
||||
if (switch_status & FLASH_SRAM_SEL) {
|
||||
index += FLASH_SRAM_SEL_VAL;
|
||||
}
|
||||
|
||||
DEBUGF("\n");
|
||||
DEBUGF("FLASH: Index: %d\n", index);
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
flash_info[i].sector_count = -1;
|
||||
flash_info[i].size = 0;
|
||||
|
||||
/* check whether the address is 0 */
|
||||
if (flash_addr_table[index][i] == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* call flash_get_size() to initialize sector address */
|
||||
size_b[i] = flash_get_size((vu_long *) flash_addr_table[index][i], &flash_info[i]);
|
||||
flash_info[i].size = size_b[i];
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank %d - Size = 0x%08lx = %ld MB\n",
|
||||
i, size_b[i], size_b[i] << 20);
|
||||
flash_info[i].sector_count = -1;
|
||||
flash_info[i].size = 0;
|
||||
}
|
||||
|
||||
total_b += flash_info[i].size;
|
||||
}
|
||||
|
||||
return total_b;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info(flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int size;
|
||||
int erased;
|
||||
volatile unsigned long *flash;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD:
|
||||
printf("AMD ");
|
||||
break;
|
||||
case FLASH_MAN_FUJ:
|
||||
printf("FUJITSU ");
|
||||
break;
|
||||
case FLASH_MAN_SST:
|
||||
printf("SST ");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM040:
|
||||
printf("AM29F040 (512 Kbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AM400B:
|
||||
printf("AM29LV400B (4 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM400T:
|
||||
printf("AM29LV400T (4 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM800B:
|
||||
printf("AM29LV800B (8 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM800T:
|
||||
printf("AM29LV800T (8 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM160B:
|
||||
printf("AM29LV160B (16 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM160T:
|
||||
printf("AM29LV160T (16 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM320B:
|
||||
printf("AM29LV320B (32 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM320T:
|
||||
printf("AM29LV320T (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AMDLV033C:
|
||||
printf("AM29LV033C (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_SST800A:
|
||||
printf("SST39LF/VF800 (8 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST160A:
|
||||
printf("SST39LF/VF160 (16 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf(" Size: %ld KB in %d Sectors\n",
|
||||
info->size >> 10, info->sector_count);
|
||||
|
||||
printf(" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
/*
|
||||
* 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 ");
|
||||
printf(" %08lX%s%s",
|
||||
info->start[i],
|
||||
erased ? " E" : " ", info->protect[i] ? "RO " : " ");
|
||||
}
|
||||
printf("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size(vu_long * addr, flash_info_t * info)
|
||||
{
|
||||
short i;
|
||||
FLASH_WORD_SIZE value;
|
||||
ulong base = (ulong) addr;
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *) addr;
|
||||
|
||||
DEBUGF("FLASH ADDR: %08x\n", (unsigned) addr);
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
udelay(10000);
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
udelay(1000);
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
udelay(1000);
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00900090;
|
||||
udelay(1000);
|
||||
|
||||
value = addr2[0];
|
||||
DEBUGF("FLASH MANUFACT: %x\n", value);
|
||||
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE) AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE) FUJ_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_FUJ;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE) SST_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_SST;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE) STM_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_STM;
|
||||
break;
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr2[1]; /* device ID */
|
||||
|
||||
DEBUGF("\nFLASH DEVICEID: %x\n", value);
|
||||
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE) AMD_ID_LV040B:
|
||||
info->flash_id += FLASH_AM040;
|
||||
info->sector_count = 8;
|
||||
info->size = 0x0080000; /* => 512 ko */
|
||||
break;
|
||||
case (FLASH_WORD_SIZE) AMD_ID_F040B:
|
||||
info->flash_id += FLASH_AM040;
|
||||
info->sector_count = 8;
|
||||
info->size = 0x0080000; /* => 512 ko */
|
||||
break;
|
||||
case (FLASH_WORD_SIZE) AMD_ID_LV033C:
|
||||
info->flash_id += FLASH_AMDLV033C;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
(info->flash_id == FLASH_AM040) ||
|
||||
(info->flash_id == FLASH_AMD016)) {
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00004000;
|
||||
info->start[2] = base + 0x00006000;
|
||||
info->start[3] = base + 0x00008000;
|
||||
for (i = 4; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00030000;
|
||||
}
|
||||
} else {
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00004000;
|
||||
info->start[i--] = base + info->size - 0x00006000;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00010000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
addr2 = (volatile FLASH_WORD_SIZE *) (info->start[i]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)
|
||||
info->protect[i] = 0;
|
||||
else
|
||||
info->protect[i] = addr2[2] & 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
int wait_for_DQ7(flash_info_t * info, int sect)
|
||||
{
|
||||
ulong start, now, last;
|
||||
volatile FLASH_WORD_SIZE *addr =
|
||||
(FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
|
||||
start = get_timer(0);
|
||||
last = start;
|
||||
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
|
||||
(FLASH_WORD_SIZE) 0x00800080) {
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf("Timeout\n");
|
||||
return -1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase(flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *addr2;
|
||||
int flag, prot, sect, l_sect;
|
||||
int i;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf("- missing\n");
|
||||
} else {
|
||||
printf("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
l_sect = -1;
|
||||
|
||||
/* 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 */
|
||||
addr2 = (FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
printf("Erasing sector %p\n", addr2);
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) {
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE) 0x00500050; /* block erase */
|
||||
for (i = 0; i < 50; i++)
|
||||
udelay(1000); /* wait 1 ms */
|
||||
} else {
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE) 0x00300030; /* sector erase */
|
||||
}
|
||||
l_sect = sect;
|
||||
/*
|
||||
* Wait for each sector to complete, it's more
|
||||
* reliable. According to AMD Spec, you must
|
||||
* issue all erase commands within a specified
|
||||
* timeout. This has been seen to fail, especially
|
||||
* if printf()s are included (for debug)!!
|
||||
*/
|
||||
wait_for_DQ7(info, sect);
|
||||
}
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay(1000);
|
||||
|
||||
/* reset to read mode */
|
||||
addr = (FLASH_WORD_SIZE *) info->start[0];
|
||||
addr[0] = (FLASH_WORD_SIZE) 0x00F000F0; /* reset bank */
|
||||
|
||||
printf(" done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
int i, l, rc;
|
||||
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < 4 && cnt > 0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < 4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 4) {
|
||||
data = 0;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < 4 && cnt > 0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i < 4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word(flash_info_t * info, ulong dest, ulong data)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *) dest;
|
||||
volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *) & data;
|
||||
ulong start;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile FLASH_WORD_SIZE *) dest) &
|
||||
(FLASH_WORD_SIZE) data) != (FLASH_WORD_SIZE) data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4 / sizeof(FLASH_WORD_SIZE); i++) {
|
||||
int flag;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00A000A0;
|
||||
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer(0);
|
||||
while ((dest2[i] & (FLASH_WORD_SIZE) 0x00800080) !=
|
||||
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
|
||||
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
96
board/ocotea/init.S
Normal file
96
board/ocotea/init.S
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (C) 2002 Scott McNutt <smcnutt@artesyncp.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 <ppc_asm.tmpl>
|
||||
#include <config.h>
|
||||
|
||||
/* General */
|
||||
#define TLB_VALID 0x00000200
|
||||
|
||||
/* Supported page sizes */
|
||||
|
||||
#define SZ_1K 0x00000000
|
||||
#define SZ_4K 0x00000010
|
||||
#define SZ_16K 0x00000020
|
||||
#define SZ_64K 0x00000030
|
||||
#define SZ_256K 0x00000040
|
||||
#define SZ_1M 0x00000050
|
||||
#define SZ_16M 0x00000070
|
||||
#define SZ_256M 0x00000090
|
||||
|
||||
/* Storage attributes */
|
||||
#define SA_W 0x00000800 /* Write-through */
|
||||
#define SA_I 0x00000400 /* Caching inhibited */
|
||||
#define SA_M 0x00000200 /* Memory coherence */
|
||||
#define SA_G 0x00000100 /* Guarded */
|
||||
#define SA_E 0x00000080 /* Endian */
|
||||
|
||||
/* Access control */
|
||||
#define AC_X 0x00000024 /* Execute */
|
||||
#define AC_W 0x00000012 /* Write */
|
||||
#define AC_R 0x00000009 /* Read */
|
||||
|
||||
/* Some handy macros */
|
||||
|
||||
#define EPN(e) ((e) & 0xfffffc00)
|
||||
#define TLB0(epn,sz) ( (EPN((epn)) | (sz) | TLB_VALID ) )
|
||||
#define TLB1(rpn,erpn) ( ((rpn)&0xfffffc00) | (erpn) )
|
||||
#define TLB2(a) ( (a)&0x00000fbf )
|
||||
|
||||
#define tlbtab_start\
|
||||
mflr r1 ;\
|
||||
bl 0f ;
|
||||
|
||||
#define tlbtab_end\
|
||||
.long 0, 0, 0 ; \
|
||||
0: mflr r0 ; \
|
||||
mtlr r1 ; \
|
||||
blr ;
|
||||
|
||||
#define tlbentry(epn,sz,rpn,erpn,attr)\
|
||||
.long TLB0(epn,sz),TLB1(rpn,erpn),TLB2(attr)
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* TLB TABLE
|
||||
*
|
||||
* This table is used by the cpu boot code to setup the initial tlb
|
||||
* entries. Rather than make broad assumptions in the cpu source tree,
|
||||
* this table lets each board set things up however they like.
|
||||
*
|
||||
* Pointer to the table is returned in r1
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
.section .bootpg,"ax"
|
||||
.globl tlbtab
|
||||
|
||||
tlbtab:
|
||||
tlbtab_start
|
||||
tlbentry( 0xf0000000, SZ_256M, 0xf0000000, 1, AC_R|AC_W|AC_X|SA_G|SA_I)
|
||||
tlbentry( CFG_PERIPHERAL_BASE, SZ_256M, 0x40000000, 1, AC_R|AC_W|SA_G|SA_I)
|
||||
tlbentry( CFG_ISRAM_BASE, SZ_4K, 0x80000000, 0, AC_R|AC_W|AC_X )
|
||||
tlbentry( CFG_ISRAM_BASE + 0x1000, SZ_4K, 0x80001000, 0, AC_R|AC_W|AC_X )
|
||||
tlbentry( CFG_SDRAM_BASE, SZ_256M, 0x00000000, 0, AC_R|AC_W|AC_X|SA_G|SA_I )
|
||||
tlbentry( CFG_PCI_BASE, SZ_256M, 0x00000000, 2, AC_R|AC_W|SA_G|SA_I )
|
||||
tlbentry( CFG_PCI_MEMBASE, SZ_256M, 0x00000000, 3, AC_R|AC_W|SA_G|SA_I )
|
||||
tlbtab_end
|
||||
476
board/ocotea/ocotea.c
Normal file
476
board/ocotea/ocotea.c
Normal file
@@ -0,0 +1,476 @@
|
||||
/*
|
||||
* Copyright (C) 2004 PaulReynolds@lhsolutions.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 "ocotea.h"
|
||||
#include <asm/processor.h>
|
||||
#include <spd_sdram.h>
|
||||
#include <440gx_enet.h>
|
||||
|
||||
#define BOOT_SMALL_FLASH 32 /* 00100000 */
|
||||
#define FLASH_ONBD_N 2 /* 00000010 */
|
||||
#define FLASH_SRAM_SEL 1 /* 00000001 */
|
||||
|
||||
long int fixed_sdram (void);
|
||||
void fpga_init (void);
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
unsigned long mfr;
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Initialize EBC CONFIG
|
||||
+-------------------------------------------------------------------------*/
|
||||
mtebc(xbcfg, EBC_CFG_LE_UNLOCK |
|
||||
EBC_CFG_PTD_ENABLE | EBC_CFG_RTC_64PERCLK |
|
||||
EBC_CFG_ATC_PREVIOUS | EBC_CFG_DTC_PREVIOUS |
|
||||
EBC_CFG_CTC_PREVIOUS | EBC_CFG_EMC_NONDEFAULT |
|
||||
EBC_CFG_PME_DISABLE | EBC_CFG_PR_32);
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| 1 MB FLASH / 1 MB SRAM. Initialize bank 0 with default values.
|
||||
+-------------------------------------------------------------------------*/
|
||||
mtebc(pb0ap, EBC_BXAP_BME_DISABLED|EBC_BXAP_TWT_ENCODE(8)|
|
||||
EBC_BXAP_BCE_DISABLE|
|
||||
EBC_BXAP_CSN_ENCODE(1)|EBC_BXAP_OEN_ENCODE(1)|
|
||||
EBC_BXAP_WBN_ENCODE(1)|EBC_BXAP_WBF_ENCODE(1)|
|
||||
EBC_BXAP_TH_ENCODE(1)|EBC_BXAP_RE_DISABLED|
|
||||
EBC_BXAP_BEM_WRITEONLY|
|
||||
EBC_BXAP_PEN_DISABLED);
|
||||
mtebc(pb0cr, EBC_BXCR_BAS_ENCODE(0xFFE00000)|
|
||||
EBC_BXCR_BS_2MB|EBC_BXCR_BU_RW|EBC_BXCR_BW_8BIT);
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| 8KB NVRAM/RTC. Initialize bank 1 with default values.
|
||||
+-------------------------------------------------------------------------*/
|
||||
mtebc(pb1ap, EBC_BXAP_BME_DISABLED|EBC_BXAP_TWT_ENCODE(10)|
|
||||
EBC_BXAP_BCE_DISABLE|
|
||||
EBC_BXAP_CSN_ENCODE(1)|EBC_BXAP_OEN_ENCODE(1)|
|
||||
EBC_BXAP_WBN_ENCODE(1)|EBC_BXAP_WBF_ENCODE(1)|
|
||||
EBC_BXAP_TH_ENCODE(1)|EBC_BXAP_RE_DISABLED|
|
||||
EBC_BXAP_BEM_WRITEONLY|
|
||||
EBC_BXAP_PEN_DISABLED);
|
||||
mtebc(pb1cr, EBC_BXCR_BAS_ENCODE(0x48000000)|
|
||||
EBC_BXCR_BS_1MB|EBC_BXCR_BU_RW|EBC_BXCR_BW_8BIT);
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| 4 MB FLASH. Initialize bank 2 with default values.
|
||||
+-------------------------------------------------------------------------*/
|
||||
mtebc(pb2ap, EBC_BXAP_BME_DISABLED|EBC_BXAP_TWT_ENCODE(10)|
|
||||
EBC_BXAP_BCE_DISABLE|
|
||||
EBC_BXAP_CSN_ENCODE(1)|EBC_BXAP_OEN_ENCODE(1)|
|
||||
EBC_BXAP_WBN_ENCODE(1)|EBC_BXAP_WBF_ENCODE(1)|
|
||||
EBC_BXAP_TH_ENCODE(1)|EBC_BXAP_RE_DISABLED|
|
||||
EBC_BXAP_BEM_WRITEONLY|
|
||||
EBC_BXAP_PEN_DISABLED);
|
||||
mtebc(pb2cr, EBC_BXCR_BAS_ENCODE(0xFF800000)|
|
||||
EBC_BXCR_BS_4MB|EBC_BXCR_BU_RW|EBC_BXCR_BW_8BIT);
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| FPGA. Initialize bank 7 with default values.
|
||||
+-------------------------------------------------------------------------*/
|
||||
mtebc(pb7ap, EBC_BXAP_BME_DISABLED|EBC_BXAP_TWT_ENCODE(7)|
|
||||
EBC_BXAP_BCE_DISABLE|
|
||||
EBC_BXAP_CSN_ENCODE(1)|EBC_BXAP_OEN_ENCODE(1)|
|
||||
EBC_BXAP_WBN_ENCODE(1)|EBC_BXAP_WBF_ENCODE(1)|
|
||||
EBC_BXAP_TH_ENCODE(1)|EBC_BXAP_RE_DISABLED|
|
||||
EBC_BXAP_BEM_WRITEONLY|
|
||||
EBC_BXAP_PEN_DISABLED);
|
||||
mtebc(pb7cr, EBC_BXCR_BAS_ENCODE(0x48300000)|
|
||||
EBC_BXCR_BS_1MB|EBC_BXCR_BU_RW|EBC_BXCR_BW_8BIT);
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
* Setup the interrupt controller polarities, triggers, etc.
|
||||
*-------------------------------------------------------------------*/
|
||||
mtdcr (uic0sr, 0xffffffff); /* clear all */
|
||||
mtdcr (uic0er, 0x00000000); /* disable all */
|
||||
mtdcr (uic0cr, 0x00000009); /* SMI & UIC1 crit are critical */
|
||||
mtdcr (uic0pr, 0xfffffe13); /* per ref-board manual */
|
||||
mtdcr (uic0tr, 0x01c00008); /* per ref-board manual */
|
||||
mtdcr (uic0vr, 0x00000001); /* int31 highest, base=0x000 */
|
||||
mtdcr (uic0sr, 0xffffffff); /* clear all */
|
||||
|
||||
mtdcr (uic1sr, 0xffffffff); /* clear all */
|
||||
mtdcr (uic1er, 0x00000000); /* disable all */
|
||||
mtdcr (uic1cr, 0x00000000); /* all non-critical */
|
||||
mtdcr (uic1pr, 0xffffe0ff); /* per ref-board manual */
|
||||
mtdcr (uic1tr, 0x00ffc000); /* per ref-board manual */
|
||||
mtdcr (uic1vr, 0x00000001); /* int31 highest, base=0x000 */
|
||||
mtdcr (uic1sr, 0xffffffff); /* clear all */
|
||||
|
||||
mtdcr (uic2sr, 0xffffffff); /* clear all */
|
||||
mtdcr (uic2er, 0x00000000); /* disable all */
|
||||
mtdcr (uic2cr, 0x00000000); /* all non-critical */
|
||||
mtdcr (uic2pr, 0xffffffff); /* per ref-board manual */
|
||||
mtdcr (uic2tr, 0x00ff8c0f); /* per ref-board manual */
|
||||
mtdcr (uic2vr, 0x00000001); /* int31 highest, base=0x000 */
|
||||
mtdcr (uic2sr, 0xffffffff); /* clear all */
|
||||
|
||||
mtdcr (uicb0sr, 0xfc000000); /* clear all */
|
||||
mtdcr (uicb0er, 0x00000000); /* disable all */
|
||||
mtdcr (uicb0cr, 0x00000000); /* all non-critical */
|
||||
mtdcr (uicb0pr, 0xfc000000); /* */
|
||||
mtdcr (uicb0tr, 0x00000000); /* */
|
||||
mtdcr (uicb0vr, 0x00000001); /* */
|
||||
mfsdr (sdr_mfr, mfr);
|
||||
mfr &= ~SDR0_MFR_ECS_MASK;
|
||||
/* mtsdr(sdr_mfr, mfr); */
|
||||
fpga_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
sys_info_t sysinfo;
|
||||
|
||||
get_sys_info (&sysinfo);
|
||||
|
||||
printf ("Board: IBM 440GX Evaluation Board\n");
|
||||
printf ("\tVCO: %lu MHz\n", sysinfo.freqVCOMhz / 1000000);
|
||||
printf ("\tCPU: %lu MHz\n", sysinfo.freqProcessor / 1000000);
|
||||
printf ("\tPLB: %lu MHz\n", sysinfo.freqPLB / 1000000);
|
||||
printf ("\tOPB: %lu MHz\n", sysinfo.freqOPB / 1000000);
|
||||
printf ("\tEPB: %lu MHz\n", sysinfo.freqEPB / 1000000);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
long dram_size = 0;
|
||||
|
||||
#if defined(CONFIG_SPD_EEPROM)
|
||||
dram_size = spd_sdram (0);
|
||||
#else
|
||||
dram_size = fixed_sdram ();
|
||||
#endif
|
||||
return dram_size;
|
||||
}
|
||||
|
||||
|
||||
#if defined(CFG_DRAM_TEST)
|
||||
int testdram (void)
|
||||
{
|
||||
uint *pstart = (uint *) 0x00000000;
|
||||
uint *pend = (uint *) 0x08000000;
|
||||
uint *p;
|
||||
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0xaaaaaaaa;
|
||||
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0xaaaaaaaa) {
|
||||
printf ("SDRAM test fails at: %08x\n", (uint) p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0x55555555;
|
||||
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0x55555555) {
|
||||
printf ("SDRAM test fails at: %08x\n", (uint) p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SPD_EEPROM)
|
||||
/*************************************************************************
|
||||
* fixed sdram init -- doesn't use serial presence detect.
|
||||
*
|
||||
* Assumes: 128 MB, non-ECC, non-registered
|
||||
* PLB @ 133 MHz
|
||||
*
|
||||
************************************************************************/
|
||||
long int fixed_sdram (void)
|
||||
{
|
||||
uint reg;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
* Setup some default
|
||||
*------------------------------------------------------------------*/
|
||||
mtsdram (mem_uabba, 0x00000000); /* ubba=0 (default) */
|
||||
mtsdram (mem_slio, 0x00000000); /* rdre=0 wrre=0 rarw=0 */
|
||||
mtsdram (mem_devopt, 0x00000000); /* dll=0 ds=0 (normal) */
|
||||
mtsdram (mem_wddctr, 0x00000000); /* wrcp=0 dcd=0 */
|
||||
mtsdram (mem_clktr, 0x40000000); /* clkp=1 (90 deg wr) dcdt=0 */
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
* Setup for board-specific specific mem
|
||||
*------------------------------------------------------------------*/
|
||||
/*
|
||||
* Following for CAS Latency = 2.5 @ 133 MHz PLB
|
||||
*/
|
||||
mtsdram (mem_b0cr, 0x000a4001); /* SDBA=0x000 128MB, Mode 3, enabled */
|
||||
mtsdram (mem_tr0, 0x410a4012); /* WR=2 WD=1 CL=2.5 PA=3 CP=4 LD=2 */
|
||||
/* RA=10 RD=3 */
|
||||
mtsdram (mem_tr1, 0x8080082f); /* SS=T2 SL=STAGE 3 CD=1 CT=0x02f */
|
||||
mtsdram (mem_rtr, 0x08200000); /* Rate 15.625 ns @ 133 MHz PLB */
|
||||
mtsdram (mem_cfg1, 0x00000000); /* Self-refresh exit, disable PM */
|
||||
udelay (400); /* Delay 200 usecs (min) */
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
* Enable the controller, then wait for DCEN to complete
|
||||
*------------------------------------------------------------------*/
|
||||
mtsdram (mem_cfg0, 0x86000000); /* DCEN=1, PMUD=1, 64-bit */
|
||||
for (;;) {
|
||||
mfsdram (mem_mcsts, reg);
|
||||
if (reg & 0x80000000)
|
||||
break;
|
||||
}
|
||||
|
||||
return (128 * 1024 * 1024); /* 128 MB */
|
||||
}
|
||||
#endif /* !defined(CONFIG_SPD_EEPROM) */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* pci_pre_init
|
||||
*
|
||||
* This routine is called just prior to registering the hose and gives
|
||||
* the board the opportunity to check things. Returning a value of zero
|
||||
* indicates that things are bad & PCI initialization should be aborted.
|
||||
*
|
||||
* Different boards may wish to customize the pci controller structure
|
||||
* (add regions, override default access routines, etc) or perform
|
||||
* certain pre-initialization actions.
|
||||
*
|
||||
************************************************************************/
|
||||
#if defined(CONFIG_PCI) && defined(CFG_PCI_PRE_INIT)
|
||||
int pci_pre_init(struct pci_controller * hose )
|
||||
{
|
||||
unsigned long strap;
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* The ocotea board is always configured as the host & requires the
|
||||
* PCI arbiter to be enabled.
|
||||
*--------------------------------------------------------------------------*/
|
||||
mfsdr(sdr_sdstp1, strap);
|
||||
if( (strap & SDR0_SDSTP1_PAE_MASK) == 0 ){
|
||||
printf("PCI: SDR0_STRP1[%08lX] - PCI Arbiter disabled.\n",strap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_PRE_INIT) */
|
||||
|
||||
/*************************************************************************
|
||||
* pci_target_init
|
||||
*
|
||||
* The bootstrap configuration provides default settings for the pci
|
||||
* inbound map (PIM). But the bootstrap config choices are limited and
|
||||
* may not be sufficient for a given board.
|
||||
*
|
||||
************************************************************************/
|
||||
#if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
|
||||
void pci_target_init(struct pci_controller * hose )
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* Disable everything
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r( PCIX0_PIM0SA, 0 ); /* disable */
|
||||
out32r( PCIX0_PIM1SA, 0 ); /* disable */
|
||||
out32r( PCIX0_PIM2SA, 0 ); /* disable */
|
||||
out32r( PCIX0_EROMBA, 0 ); /* disable expansion rom */
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* Map all of SDRAM to PCI address 0x0000_0000. Note that the 440 strapping
|
||||
* options to not support sizes such as 128/256 MB.
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r( PCIX0_PIM0LAL, CFG_SDRAM_BASE );
|
||||
out32r( PCIX0_PIM0LAH, 0 );
|
||||
out32r( PCIX0_PIM0SA, ~(gd->ram_size - 1) | 1 );
|
||||
|
||||
out32r( PCIX0_BAR0, 0 );
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* Program the board's subsystem id/vendor id
|
||||
*--------------------------------------------------------------------------*/
|
||||
out16r( PCIX0_SBSYSVID, CFG_PCI_SUBSYS_VENDORID );
|
||||
out16r( PCIX0_SBSYSID, CFG_PCI_SUBSYS_DEVICEID );
|
||||
|
||||
out16r( PCIX0_CMD, in16r(PCIX0_CMD) | PCI_COMMAND_MEMORY );
|
||||
}
|
||||
#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT) */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* is_pci_host
|
||||
*
|
||||
* This routine is called to determine if a pci scan should be
|
||||
* performed. With various hardware environments (especially cPCI and
|
||||
* PPMC) it's insufficient to depend on the state of the arbiter enable
|
||||
* bit in the strap register, or generic host/adapter assumptions.
|
||||
*
|
||||
* Rather than hard-code a bad assumption in the general 440 code, the
|
||||
* 440 pci code requires the board to decide at runtime.
|
||||
*
|
||||
* Return 0 for adapter mode, non-zero for host (monarch) mode.
|
||||
*
|
||||
*
|
||||
************************************************************************/
|
||||
#if defined(CONFIG_PCI)
|
||||
int is_pci_host(struct pci_controller *hose)
|
||||
{
|
||||
/* The ocotea board is always configured as host. */
|
||||
return(1);
|
||||
}
|
||||
#endif /* defined(CONFIG_PCI) */
|
||||
|
||||
|
||||
void fpga_init(void)
|
||||
{
|
||||
unsigned long group;
|
||||
unsigned long sdr0_pfc0;
|
||||
unsigned long sdr0_pfc1;
|
||||
unsigned long sdr0_cust0;
|
||||
unsigned long pvr;
|
||||
|
||||
mfsdr (sdr_pfc0, sdr0_pfc0);
|
||||
mfsdr (sdr_pfc1, sdr0_pfc1);
|
||||
group = SDR0_PFC1_EPS_DECODE(sdr0_pfc1);
|
||||
pvr = get_pvr ();
|
||||
|
||||
sdr0_pfc0 = (sdr0_pfc0 & ~SDR0_PFC0_GEIE_MASK) | SDR0_PFC0_GEIE_TRE;
|
||||
if ( ((pvr == PVR_440GX_RA) || (pvr == PVR_440GX_RB)) && ((group == 4) || (group == 5))) {
|
||||
sdr0_pfc0 = (sdr0_pfc0 & ~SDR0_PFC0_TRE_MASK) | SDR0_PFC0_TRE_DISABLE;
|
||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_CTEMS_MASK) | SDR0_PFC1_CTEMS_EMS;
|
||||
out8(FPGA_REG2, (in8(FPGA_REG2) & ~FPGA_REG2_EXT_INTFACE_MASK) |
|
||||
FPGA_REG2_EXT_INTFACE_ENABLE);
|
||||
mtsdr (sdr_pfc0, sdr0_pfc0);
|
||||
mtsdr (sdr_pfc1, sdr0_pfc1);
|
||||
} else {
|
||||
sdr0_pfc0 = (sdr0_pfc0 & ~SDR0_PFC0_TRE_MASK) | SDR0_PFC0_TRE_ENABLE;
|
||||
switch (group)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
/* CPU trace A */
|
||||
out8(FPGA_REG2, (in8(FPGA_REG2) & ~FPGA_REG2_EXT_INTFACE_MASK) |
|
||||
FPGA_REG2_EXT_INTFACE_ENABLE);
|
||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_CTEMS_MASK) | SDR0_PFC1_CTEMS_EMS;
|
||||
mtsdr (sdr_pfc0, sdr0_pfc0);
|
||||
mtsdr (sdr_pfc1, sdr0_pfc1);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
/* CPU trace B - Over EBMI */
|
||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_CTEMS_MASK) | SDR0_PFC1_CTEMS_CPUTRACE;
|
||||
mtsdr (sdr_pfc0, sdr0_pfc0);
|
||||
mtsdr (sdr_pfc1, sdr0_pfc1);
|
||||
out8(FPGA_REG2, (in8(FPGA_REG2) & ~FPGA_REG2_EXT_INTFACE_MASK) |
|
||||
FPGA_REG2_EXT_INTFACE_DISABLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the ethernet specific functions in the fpga */
|
||||
mfsdr(sdr_pfc1, sdr0_pfc1);
|
||||
mfsdr(sdr_cust0, sdr0_cust0);
|
||||
if ( (SDR0_PFC1_EPS_DECODE(sdr0_pfc1) == 4) &&
|
||||
((SDR0_CUST0_RGMII2_DECODE(sdr0_cust0) == RGMII_FER_GMII) ||
|
||||
(SDR0_CUST0_RGMII2_DECODE(sdr0_cust0) == RGMII_FER_TBI)))
|
||||
{
|
||||
if ((in8(FPGA_REG0) & FPGA_REG0_ECLS_MASK) == FPGA_REG0_ECLS_VER1)
|
||||
{
|
||||
out8(FPGA_REG3, (in8(FPGA_REG3) & ~FPGA_REG3_ENET_MASK1) |
|
||||
FPGA_REG3_ENET_GROUP7);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SDR0_CUST0_RGMII2_DECODE(sdr0_cust0) == RGMII_FER_GMII)
|
||||
{
|
||||
out8(FPGA_REG3, (in8(FPGA_REG3) & ~FPGA_REG3_ENET_MASK2) |
|
||||
FPGA_REG3_ENET_GROUP7);
|
||||
}
|
||||
else
|
||||
{
|
||||
out8(FPGA_REG3, (in8(FPGA_REG3) & ~FPGA_REG3_ENET_MASK2) |
|
||||
FPGA_REG3_ENET_GROUP8);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((in8(FPGA_REG0) & FPGA_REG0_ECLS_MASK) == FPGA_REG0_ECLS_VER1)
|
||||
{
|
||||
out8(FPGA_REG3, (in8(FPGA_REG3) & ~FPGA_REG3_ENET_MASK1) |
|
||||
FPGA_REG3_ENET_ENCODE1(SDR0_PFC1_EPS_DECODE(sdr0_pfc1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
out8(FPGA_REG3, (in8(FPGA_REG3) & ~FPGA_REG3_ENET_MASK2) |
|
||||
FPGA_REG3_ENET_ENCODE2(SDR0_PFC1_EPS_DECODE(sdr0_pfc1)));
|
||||
}
|
||||
}
|
||||
out8(FPGA_REG4, FPGA_REG4_GPHY_MODE10 |
|
||||
FPGA_REG4_GPHY_MODE100 | FPGA_REG4_GPHY_MODE1000 |
|
||||
FPGA_REG4_GPHY_FRC_DPLX | FPGA_REG4_CONNECT_PHYS);
|
||||
|
||||
/* reset the gigabyte phy if necessary */
|
||||
if (SDR0_PFC1_EPS_DECODE(sdr0_pfc1) >= 3)
|
||||
{
|
||||
if ((in8(FPGA_REG0) & FPGA_REG0_ECLS_MASK) == FPGA_REG0_ECLS_VER1)
|
||||
{
|
||||
out8(FPGA_REG3, in8(FPGA_REG3) & ~FPGA_REG3_GIGABIT_RESET_DISABLE);
|
||||
udelay(10000);
|
||||
out8(FPGA_REG3, in8(FPGA_REG3) | FPGA_REG3_GIGABIT_RESET_DISABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
out8(FPGA_REG2, in8(FPGA_REG2) & ~FPGA_REG2_GIGABIT_RESET_DISABLE);
|
||||
udelay(10000);
|
||||
out8(FPGA_REG2, in8(FPGA_REG2) | FPGA_REG2_GIGABIT_RESET_DISABLE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Turn off the LED's */
|
||||
out8(FPGA_REG3, (in8(FPGA_REG3) & ~FPGA_REG3_STAT_MASK) |
|
||||
FPGA_REG3_STAT_LED8_DISAB | FPGA_REG3_STAT_LED4_DISAB |
|
||||
FPGA_REG3_STAT_LED2_DISAB | FPGA_REG3_STAT_LED1_DISAB);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
/*
|
||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||
* Called from board_init_f().
|
||||
*/
|
||||
int post_hotkeys_pressed(void)
|
||||
{
|
||||
|
||||
return (ctrlc());
|
||||
}
|
||||
#endif
|
||||
140
board/ocotea/ocotea.h
Normal file
140
board/ocotea/ocotea.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Board specific FPGA stuff ... */
|
||||
#define FPGA_REG0 (CFG_FPGA_BASE + 0x00)
|
||||
#define FPGA_REG0_SSCG_MASK 0x80
|
||||
#define FPGA_REG0_SSCG_DISABLE 0x00
|
||||
#define FPGA_REG0_SSCG_ENABLE 0x80
|
||||
#define FPGA_REG0_BOOT_MASK 0x40
|
||||
#define FPGA_REG0_BOOT_LARGE_FLASH 0x00
|
||||
#define FPGA_REG0_BOOT_SMALL_FLASH 0x40
|
||||
#define FPGA_REG0_ECLS_MASK 0x38 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_0 0x20 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_1 0x10 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_2 0x08 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER1 0x00 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER3 0x08 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER4 0x10 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER5 0x18 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER2 0x20 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER6 0x28 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER7 0x30 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ECLS_VER8 0x38 /* New for Ocotea Rev 2 */
|
||||
#define FPGA_REG0_ARBITER_MASK 0x04
|
||||
#define FPGA_REG0_ARBITER_EXT 0x00
|
||||
#define FPGA_REG0_ARBITER_INT 0x04
|
||||
#define FPGA_REG0_ONBOARD_FLASH_MASK 0x02
|
||||
#define FPGA_REG0_ONBOARD_FLASH_ENABLE 0x00
|
||||
#define FPGA_REG0_ONBOARD_FLASH_DISABLE 0x02
|
||||
#define FPGA_REG0_FLASH 0x01
|
||||
#define FPGA_REG1 (CFG_FPGA_BASE + 0x01)
|
||||
#define FPGA_REG1_9772_FSELFBX_MASK 0x80
|
||||
#define FPGA_REG1_9772_FSELFBX_6 0x00
|
||||
#define FPGA_REG1_9772_FSELFBX_10 0x80
|
||||
#define FPGA_REG1_9531_SX_MASK 0x60
|
||||
#define FPGA_REG1_9531_SX_33MHZ 0x00
|
||||
#define FPGA_REG1_9531_SX_100MHZ 0x20
|
||||
#define FPGA_REG1_9531_SX_66MHZ 0x40
|
||||
#define FPGA_REG1_9531_SX_133MHZ 0x60
|
||||
#define FPGA_REG1_9772_FSELBX_MASK 0x18
|
||||
#define FPGA_REG1_9772_FSELBX_4 0x00
|
||||
#define FPGA_REG1_9772_FSELBX_6 0x08
|
||||
#define FPGA_REG1_9772_FSELBX_8 0x10
|
||||
#define FPGA_REG1_9772_FSELBX_10 0x18
|
||||
#define FPGA_REG1_SOURCE_MASK 0x07
|
||||
#define FPGA_REG1_SOURCE_TC 0x00
|
||||
#define FPGA_REG1_SOURCE_66MHZ 0x01
|
||||
#define FPGA_REG1_SOURCE_50MHZ 0x02
|
||||
#define FPGA_REG1_SOURCE_33MHZ 0x03
|
||||
#define FPGA_REG1_SOURCE_25MHZ 0x04
|
||||
#define FPGA_REG1_SOURCE_SSDIV1 0x05
|
||||
#define FPGA_REG1_SOURCE_SSDIV2 0x06
|
||||
#define FPGA_REG1_SOURCE_SSDIV4 0x07
|
||||
#define FPGA_REG2 (CFG_FPGA_BASE + 0x02)
|
||||
#define FPGA_REG2_TC0 0x80
|
||||
#define FPGA_REG2_TC1 0x40
|
||||
#define FPGA_REG2_TC2 0x20
|
||||
#define FPGA_REG2_TC3 0x10
|
||||
#define FPGA_REG2_GIGABIT_RESET_DISABLE 0x08 /*Use on Ocotea pass 2 boards*/
|
||||
#define FPGA_REG2_EXT_INTFACE_MASK 0x04
|
||||
#define FPGA_REG2_EXT_INTFACE_ENABLE 0x00
|
||||
#define FPGA_REG2_EXT_INTFACE_DISABLE 0x04
|
||||
#define FPGA_REG2_DEFAULT_UART1_N 0x01
|
||||
#define FPGA_REG3 (CFG_FPGA_BASE + 0x03)
|
||||
#define FPGA_REG3_GIGABIT_RESET_DISABLE 0x80 /*Use on Ocotea pass 1 boards*/
|
||||
#define FPGA_REG3_ENET_MASK1 0x70 /*Use on Ocotea pass 1 boards*/
|
||||
#define FPGA_REG3_ENET_MASK2 0xF0 /*Use on Ocotea pass 2 boards*/
|
||||
#define FPGA_REG3_ENET_GROUP0 0x00
|
||||
#define FPGA_REG3_ENET_GROUP1 0x10
|
||||
#define FPGA_REG3_ENET_GROUP2 0x20
|
||||
#define FPGA_REG3_ENET_GROUP3 0x30
|
||||
#define FPGA_REG3_ENET_GROUP4 0x40
|
||||
#define FPGA_REG3_ENET_GROUP5 0x50
|
||||
#define FPGA_REG3_ENET_GROUP6 0x60
|
||||
#define FPGA_REG3_ENET_GROUP7 0x70
|
||||
#define FPGA_REG3_ENET_GROUP8 0x80 /*Use on Ocotea pass 2 boards*/
|
||||
#define FPGA_REG3_ENET_ENCODE1(n) ((((unsigned long)(n))&0x07)<<4) /*pass1*/
|
||||
#define FPGA_REG3_ENET_DECODE1(n) ((((unsigned long)(n))>>4)&0x07) /*pass1*/
|
||||
#define FPGA_REG3_ENET_ENCODE2(n) ((((unsigned long)(n))&0x0F)<<4) /*pass2*/
|
||||
#define FPGA_REG3_ENET_DECODE2(n) ((((unsigned long)(n))>>4)&0x0F) /*pass2*/
|
||||
#define FPGA_REG3_STAT_MASK 0x0F
|
||||
#define FPGA_REG3_STAT_LED8_ENAB 0x08
|
||||
#define FPGA_REG3_STAT_LED4_ENAB 0x04
|
||||
#define FPGA_REG3_STAT_LED2_ENAB 0x02
|
||||
#define FPGA_REG3_STAT_LED1_ENAB 0x01
|
||||
#define FPGA_REG3_STAT_LED8_DISAB 0x00
|
||||
#define FPGA_REG3_STAT_LED4_DISAB 0x00
|
||||
#define FPGA_REG3_STAT_LED2_DISAB 0x00
|
||||
#define FPGA_REG3_STAT_LED1_DISAB 0x00
|
||||
#define FPGA_REG4 (CFG_FPGA_BASE + 0x04)
|
||||
#define FPGA_REG4_GPHY_MODE10 0x80
|
||||
#define FPGA_REG4_GPHY_MODE100 0x40
|
||||
#define FPGA_REG4_GPHY_MODE1000 0x20
|
||||
#define FPGA_REG4_GPHY_FRC_DPLX 0x10
|
||||
#define FPGA_REG4_GPHY_ANEG_DIS 0x08
|
||||
#define FPGA_REG4_CONNECT_PHYS 0x04
|
||||
|
||||
|
||||
#define SDR0_CUST0_ENET3_MASK 0x00000080
|
||||
#define SDR0_CUST0_ENET3_COPPER 0x00000000
|
||||
#define SDR0_CUST0_ENET3_FIBER 0x00000080
|
||||
#define SDR0_CUST0_RGMII3_MASK 0x00000070
|
||||
#define SDR0_CUST0_RGMII3_ENCODE(n) ((((unsigned long)(n))&0x7)<<4)
|
||||
#define SDR0_CUST0_RGMII3_DECODE(n) ((((unsigned long)(n))>>4)&0x07)
|
||||
#define SDR0_CUST0_RGMII3_DISAB 0x00000000
|
||||
#define SDR0_CUST0_RGMII3_RTBI 0x00000040
|
||||
#define SDR0_CUST0_RGMII3_RGMII 0x00000050
|
||||
#define SDR0_CUST0_RGMII3_TBI 0x00000060
|
||||
#define SDR0_CUST0_RGMII3_GMII 0x00000070
|
||||
#define SDR0_CUST0_ENET2_MASK 0x00000008
|
||||
#define SDR0_CUST0_ENET2_COPPER 0x00000000
|
||||
#define SDR0_CUST0_ENET2_FIBER 0x00000008
|
||||
#define SDR0_CUST0_RGMII2_MASK 0x00000007
|
||||
#define SDR0_CUST0_RGMII2_ENCODE(n) ((((unsigned long)(n))&0x7)<<0)
|
||||
#define SDR0_CUST0_RGMII2_DECODE(n) ((((unsigned long)(n))>>0)&0x07)
|
||||
#define SDR0_CUST0_RGMII2_DISAB 0x00000000
|
||||
#define SDR0_CUST0_RGMII2_RTBI 0x00000004
|
||||
#define SDR0_CUST0_RGMII2_RGMII 0x00000005
|
||||
#define SDR0_CUST0_RGMII2_TBI 0x00000006
|
||||
#define SDR0_CUST0_RGMII2_GMII 0x00000007
|
||||
155
board/ocotea/u-boot.lds
Normal file
155
board/ocotea/u-boot.lds
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* 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
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/ppc4xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
board/ocotea/init.o (.text)
|
||||
cpu/ppc4xx/kgdb.o (.text)
|
||||
cpu/ppc4xx/traps.o (.text)
|
||||
cpu/ppc4xx/interrupts.o (.text)
|
||||
cpu/ppc4xx/serial.o (.text)
|
||||
cpu/ppc4xx/cpu_init.o (.text)
|
||||
cpu/ppc4xx/speed.o (.text)
|
||||
cpu/ppc4xx/440gx_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 = .);
|
||||
}
|
||||
144
board/ocotea/u-boot.lds.debug
Normal file
144
board/ocotea/u-boot.lds.debug
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* (C) Copyright 2002-2004
|
||||
* 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 :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
board/ocotea/init.o (.text)
|
||||
cpu/ppc4xx/kgdb.o (.text)
|
||||
cpu/ppc4xx/traps.o (.text)
|
||||
cpu/ppc4xx/interrupts.o (.text)
|
||||
cpu/ppc4xx/serial.o (.text)
|
||||
cpu/ppc4xx/cpu_init.o (.text)
|
||||
cpu/ppc4xx/speed.o (.text)
|
||||
cpu/ppc4xx/440gx_enet.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* 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: */
|
||||
. = (. + 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(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 = .);
|
||||
}
|
||||
@@ -41,6 +41,15 @@ _TEXT_BASE:
|
||||
platformsetup:
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
*mask all IRQs by setting all bits in the INTMR default*
|
||||
*------------------------------------------------------*/
|
||||
mov r1, #0xffffffff
|
||||
ldr r0, =REG_IHL1_MIR
|
||||
str r1, [r0]
|
||||
ldr r0, =REG_IHL2_MIR
|
||||
str r1, [r0]
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT1) *
|
||||
*------------------------------------------------------*/
|
||||
|
||||
47
board/pm520/Makefile
Normal file
47
board/pm520/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
#
|
||||
# (C) Copyright 2003-2004
|
||||
# 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 $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
31
board/pm520/config.mk
Normal file
31
board/pm520/config.mk
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# (C) Copyright 2003-2004
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# PM520 board
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xfff00000
|
||||
# TEXT_BASE = 0x00100000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
|
||||
545
board/pm520/flash.c
Normal file
545
board/pm520/flash.c
Normal file
@@ -0,0 +1,545 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001-2004
|
||||
* 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 */
|
||||
#define FLASH_PORT_WIDTH32
|
||||
#undef 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) (x)
|
||||
#endif
|
||||
|
||||
/* Intel-compatible flash ID */
|
||||
#define INTEL_COMPAT 0x00890089
|
||||
#define INTEL_ALT 0x00B000B0
|
||||
|
||||
/* Intel-compatible flash commands */
|
||||
#define INTEL_PROGRAM 0x00100010
|
||||
#define INTEL_ERASE 0x00200020
|
||||
#define INTEL_CLEAR 0x00500050
|
||||
#define INTEL_LOCKBIT 0x00600060
|
||||
#define INTEL_PROTECT 0x00010001
|
||||
#define INTEL_STATUS 0x00700070
|
||||
#define INTEL_READID 0x00900090
|
||||
#define INTEL_CONFIRM 0x00D000D0
|
||||
#define INTEL_RESET 0xFFFFFFFF
|
||||
|
||||
/* Intel-compatible flash status bits */
|
||||
#define INTEL_FINISHED 0x00800080
|
||||
#define INTEL_OK 0x00800080
|
||||
|
||||
#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 *) CFG_FLASH_BASE, &flash_info[i]);
|
||||
flash_get_offsets (CFG_FLASH_BASE, &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_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&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;
|
||||
|
||||
case FLASH_28F640J3A:
|
||||
printf ("28F640J3A\n");
|
||||
break;
|
||||
|
||||
case FLASH_28F320J3A:
|
||||
printf ("28F320J3A\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; /* => 32 MB */
|
||||
|
||||
case (FPW) INTEL_ID_28F640J3A:
|
||||
info->flash_id += FLASH_28F640J3A;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x01000000;
|
||||
break; /* => 16 MB */
|
||||
|
||||
case (FPW) INTEL_ID_28F320J3A:
|
||||
info->flash_id += FLASH_28F320J3A;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 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, start, last;
|
||||
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");
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* 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 */
|
||||
start = get_timer(0);
|
||||
|
||||
*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(start) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
*addr = (FPW) 0x00B000B0; /* suspend erase */
|
||||
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*addr = 0x00500050; /* clear status register cmd. */
|
||||
*addr = 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;
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
printf ("not erased at %08lx (%lx)\n", (ulong) addr, *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 */
|
||||
start = get_timer(0);
|
||||
|
||||
/* wait while polling the status register */
|
||||
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer(start) > 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;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Set/Clear sector's lock bit, returns:
|
||||
* 0 - OK
|
||||
* 1 - Error (timeout, voltage problems, etc.)
|
||||
*/
|
||||
int flash_real_protect(flash_info_t *info, long sector, int prot)
|
||||
{
|
||||
ulong start;
|
||||
int i;
|
||||
int rc = 0;
|
||||
vu_long *addr = (vu_long *)(info->start[sector]);
|
||||
int flag = disable_interrupts();
|
||||
|
||||
*addr = INTEL_CLEAR; /* Clear status register */
|
||||
if (prot) { /* Set sector lock bit */
|
||||
*addr = INTEL_LOCKBIT; /* Sector lock bit */
|
||||
*addr = INTEL_PROTECT; /* set */
|
||||
}
|
||||
else { /* Clear sector lock bit */
|
||||
*addr = INTEL_LOCKBIT; /* All sectors lock bits */
|
||||
*addr = INTEL_CONFIRM; /* clear */
|
||||
}
|
||||
|
||||
start = get_timer(0);
|
||||
|
||||
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
|
||||
if (get_timer(start) > CFG_FLASH_UNLOCK_TOUT) {
|
||||
printf("Flash lock bit operation timed out\n");
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*addr != INTEL_OK) {
|
||||
printf("Flash lock bit operation failed at %08X, CSR=%08X\n",
|
||||
(uint)addr, (uint)*addr);
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
if (!rc)
|
||||
info->protect[sector] = prot;
|
||||
|
||||
/*
|
||||
* Clear lock bit command clears all sectors lock bits, so
|
||||
* we have to restore lock bits of protected sectors.
|
||||
*/
|
||||
if (!prot)
|
||||
{
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
if (info->protect[i])
|
||||
{
|
||||
start = get_timer(0);
|
||||
addr = (vu_long *)(info->start[i]);
|
||||
*addr = INTEL_LOCKBIT; /* Sector lock bit */
|
||||
*addr = INTEL_PROTECT; /* set */
|
||||
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED)
|
||||
{
|
||||
if (get_timer(start) > CFG_FLASH_UNLOCK_TOUT)
|
||||
{
|
||||
printf("Flash lock bit operation timed out\n");
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
*addr = INTEL_RESET; /* Reset to read array mode */
|
||||
|
||||
return rc;
|
||||
}
|
||||
193
board/pm520/pm520.c
Normal file
193
board/pm520/pm520.c
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* (C) Copyright 2003-2004
|
||||
* 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 <mpc5xxx.h>
|
||||
#include <pci.h>
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
static long int dram_size(long int *base, long int maxsize)
|
||||
{
|
||||
volatile long int *addr;
|
||||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
/* write 0 to base address */
|
||||
addr = base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
|
||||
static void sdram_start (int hi_addr)
|
||||
{
|
||||
long hi_addr_bit = hi_addr ? 0x01000000 : 0;
|
||||
|
||||
/* unlock mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0000 | hi_addr_bit;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x408d0000;
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
#endif
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
/* normal operation */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0x504f0000 | hi_addr_bit;
|
||||
}
|
||||
#endif
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
ulong dramsize = 0;
|
||||
#ifndef CFG_RAMBOOT
|
||||
ulong test1, test2;
|
||||
|
||||
/* configure SDRAM start/end */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
|
||||
|
||||
/* setup config registers */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xc2233a00;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x88b70004;
|
||||
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_START = 0x00000000;
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = 0x0000ffff;/* 2G */
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
|
||||
|
||||
/* setup config registers */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xc2222600;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x88b70004;
|
||||
|
||||
/* address select register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_XLBSEL = 0x03000000;
|
||||
#endif
|
||||
sdram_start(0);
|
||||
test1 = dram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
|
||||
sdram_start(1);
|
||||
test2 = dram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
|
||||
if (test1 > test2) {
|
||||
sdram_start(0);
|
||||
dramsize = test1;
|
||||
} else {
|
||||
dramsize = test2;
|
||||
}
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG =
|
||||
(0x13 + __builtin_ffs(dramsize >> 20) - 1);
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = ((dramsize - 1) >> 15);
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef CONFIG_MGT5100
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
|
||||
dramsize = ((*(vu_long *)MPC5XXX_SDRAM_STOP + 1) << 15);
|
||||
#else
|
||||
dramsize = ((1 << (*(vu_long *)MPC5XXX_SDRAM_CS0CFG - 0x13)) << 20);
|
||||
#endif
|
||||
#endif /* CFG_RAMBOOT */
|
||||
/* return total ram size */
|
||||
return dramsize;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
#if defined(CONFIG_MPC5200)
|
||||
puts ("Board: MicroSys PM520 \n");
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
puts ("Board: MicroSys PM510 \n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flash_preinit(void)
|
||||
{
|
||||
/*
|
||||
* Now, when we are in RAM, enable flash write
|
||||
* access for detection process.
|
||||
* Note that CS_BOOT cannot be cleared when
|
||||
* executing in flash.
|
||||
*/
|
||||
#if defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_ADDECR &= ~(1 << 25); /* disable CS_BOOT */
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 16); /* enable CS0 */
|
||||
#endif
|
||||
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
|
||||
}
|
||||
|
||||
void flash_afterinit(ulong size)
|
||||
{
|
||||
if (size == 0x800000) { /* adjust mapping */
|
||||
*(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 =
|
||||
STOP_REG(CFG_BOOTCS_START | size, size);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static struct pci_controller hose;
|
||||
|
||||
extern void pci_mpc5xxx_init(struct pci_controller *);
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
pci_mpc5xxx_init(&hose);
|
||||
}
|
||||
#endif
|
||||
122
board/pm520/u-boot.lds
Normal file
122
board/pm520/u-boot.lds
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* (C) Copyright 2003-2004
|
||||
* 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/mpc5xxx/start.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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 = .);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# (C) Copyright 2001, 2002
|
||||
# (C) Copyright 2001-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
@@ -22,21 +22,16 @@
|
||||
#
|
||||
|
||||
#
|
||||
# PM826 boards
|
||||
# MicroSys PM826 board:
|
||||
#
|
||||
|
||||
# This should be equal to the CFG_FLASH_BASE or
|
||||
# CFG_BOOTROM_BASE define in config_PM826.h
|
||||
# for the "final" configuration, with U-Boot
|
||||
# in flash, or the address in RAM where
|
||||
# U-Boot is loaded at for debugging.
|
||||
#
|
||||
|
||||
ifeq ($(CONFIG_BOOT_ROM),y)
|
||||
TEXT_BASE := 0xFF800000
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_BOOT_ROM
|
||||
else
|
||||
TEXT_BASE := 0xFF000000
|
||||
sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
|
||||
|
||||
ifndef TEXT_BASE
|
||||
## Standard: boot 64-bit flash
|
||||
TEXT_BASE = 0xFF000000
|
||||
|
||||
endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)
|
||||
|
||||
@@ -69,6 +69,11 @@ ulong flash_get_size (volatile unsigned long *baseaddr,
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00800000; /* 4 * 2 MB = 8 MB */
|
||||
break;
|
||||
case INTEL_ID_28F640C3B:
|
||||
info->flash_id = FLASH_28F640C3B;
|
||||
info->sector_count = 135;
|
||||
info->size = 0x02000000; /* 16 * 2 MB = 32 MB */
|
||||
break;
|
||||
default:
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
@@ -79,10 +84,11 @@ ulong flash_get_size (volatile unsigned long *baseaddr,
|
||||
volatile unsigned long *tmp = baseaddr;
|
||||
|
||||
/* set up sector start adress table (bottom sector type)
|
||||
* AND unlock the sectors (if our chip is 160C3)
|
||||
* AND unlock the sectors (if our chip is 160C3 or 640C3)
|
||||
*/
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if ((info->flash_id & FLASH_TYPEMASK) == FLASH_28F160C3B) {
|
||||
if (((info->flash_id & FLASH_TYPEMASK) == FLASH_28F160C3B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_28F640C3B)) {
|
||||
tmp[0] = 0x00600060;
|
||||
tmp[1] = 0x00600060;
|
||||
tmp[0] = 0x00D000D0;
|
||||
@@ -177,6 +183,9 @@ void flash_print_info (flash_info_t * info)
|
||||
case FLASH_28F160F3B:
|
||||
printf ("28F160F3B (16 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_28F640C3B:
|
||||
printf ("28F640C3B (64 M, bottom sector)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# (C) Copyright 2000-2002
|
||||
# (C) Copyright 2001-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
37
board/pm828/config.mk
Normal file
37
board/pm828/config.mk
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# (C) Copyright 2003-2004
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# MicroSys PM828 board:
|
||||
#
|
||||
|
||||
|
||||
sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
|
||||
|
||||
ifndef TEXT_BASE
|
||||
## Standard: boot 64-bit flash
|
||||
TEXT_BASE = 0x40000000
|
||||
|
||||
endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)
|
||||
386
board/pm828/flash.c
Normal file
386
board/pm828/flash.c
Normal file
@@ -0,0 +1,386 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* Flash Routines for Intel devices
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
* 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 <mpc8xx.h>
|
||||
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
ulong flash_get_size (volatile unsigned long *baseaddr,
|
||||
flash_info_t * info)
|
||||
{
|
||||
short i;
|
||||
unsigned long flashtest_h, flashtest_l;
|
||||
|
||||
info->sector_count = info->size = 0;
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
|
||||
/* Write query command sequence and test FLASH answer
|
||||
*/
|
||||
baseaddr[0] = 0x00980098;
|
||||
baseaddr[1] = 0x00980098;
|
||||
|
||||
flashtest_h = baseaddr[0]; /* manufacturer ID */
|
||||
flashtest_l = baseaddr[1];
|
||||
|
||||
if (flashtest_h != INTEL_MANUFACT || flashtest_l != INTEL_MANUFACT)
|
||||
return (0); /* no or unknown flash */
|
||||
|
||||
flashtest_h = baseaddr[2]; /* device ID */
|
||||
flashtest_l = baseaddr[3];
|
||||
|
||||
if (flashtest_h != flashtest_l)
|
||||
return (0);
|
||||
|
||||
switch (flashtest_h) {
|
||||
case INTEL_ID_28F160C3B:
|
||||
info->flash_id = FLASH_28F160C3B;
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00800000; /* 4 * 2 MB = 8 MB */
|
||||
break;
|
||||
case INTEL_ID_28F160F3B:
|
||||
info->flash_id = FLASH_28F160F3B;
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00800000; /* 4 * 2 MB = 8 MB */
|
||||
break;
|
||||
case INTEL_ID_28F640C3B:
|
||||
info->flash_id = FLASH_28F640C3B;
|
||||
info->sector_count = 135;
|
||||
info->size = 0x02000000; /* 16 * 2 MB = 32 MB */
|
||||
break;
|
||||
default:
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
info->flash_id |= INTEL_MANUFACT << 16; /* set manufacturer offset */
|
||||
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
volatile unsigned long *tmp = baseaddr;
|
||||
|
||||
/* set up sector start adress table (bottom sector type)
|
||||
* AND unlock the sectors (if our chip is 160C3 or 640c3)
|
||||
*/
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (((info->flash_id & FLASH_TYPEMASK) == FLASH_28F160C3B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_28F640C3B)) {
|
||||
tmp[0] = 0x00600060;
|
||||
tmp[1] = 0x00600060;
|
||||
tmp[0] = 0x00D000D0;
|
||||
tmp[1] = 0x00D000D0;
|
||||
}
|
||||
info->start[i] = (uint) tmp;
|
||||
tmp += i < 8 ? 0x2000 : 0x10000; /* pointer arith */
|
||||
}
|
||||
}
|
||||
|
||||
memset (info->protect, 0, info->sector_count);
|
||||
|
||||
baseaddr[0] = 0x00FF00FF;
|
||||
baseaddr[1] = 0x00FF00FF;
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0 = 0;
|
||||
int i;
|
||||
|
||||
/* 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 (only one bank) */
|
||||
|
||||
size_b0 = flash_get_size ((ulong *) CFG_FLASH0_BASE, &flash_info[0]);
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0 >> 20);
|
||||
}
|
||||
|
||||
/* protect monitor and environment sectors
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_BOOT_ROM
|
||||
/* If U-Boot is booted from ROM the CFG_MONITOR_BASE > CFG_FLASH0_BASE
|
||||
* but we shouldn't protect it.
|
||||
*/
|
||||
|
||||
# if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]
|
||||
);
|
||||
# endif
|
||||
#endif /* CONFIG_BOOT_ROM */
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
#endif
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
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 >> 16) & 0xff) {
|
||||
case 0x89:
|
||||
printf ("INTEL ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F160C3B:
|
||||
printf ("28F160C3B (16 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_28F160F3B:
|
||||
printf ("28F160F3B (16 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_28F640C3B:
|
||||
printf ("28F640C3B (64 M, bottom sector)\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");
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect])
|
||||
prot++;
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/* Start erase on unprotected sectors
|
||||
*/
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
volatile ulong *addr =
|
||||
(volatile unsigned long *) info->start[sect];
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
if (info->protect[sect] == 0) {
|
||||
/* Disable interrupts which might cause a timeout here
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Erase the block
|
||||
*/
|
||||
addr[0] = 0x00200020;
|
||||
addr[1] = 0x00200020;
|
||||
addr[0] = 0x00D000D0;
|
||||
addr[1] = 0x00D000D0;
|
||||
|
||||
/* re-enable interrupts if necessary
|
||||
*/
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms
|
||||
*/
|
||||
udelay (1000);
|
||||
|
||||
last = start;
|
||||
while ((addr[0] & 0x00800080) != 0x00800080 ||
|
||||
(addr[1] & 0x00800080) != 0x00800080) {
|
||||
if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout (erase suspended!)\n");
|
||||
/* Suspend erase
|
||||
*/
|
||||
addr[0] = 0x00B000B0;
|
||||
addr[1] = 0x00B000B0;
|
||||
goto DONE;
|
||||
}
|
||||
/* show that we're waiting
|
||||
*/
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
if (addr[0] & 0x00220022 || addr[1] & 0x00220022) {
|
||||
printf ("*** ERROR: erase failed!\n");
|
||||
goto DONE;
|
||||
}
|
||||
}
|
||||
/* Clear status register and reset to read mode
|
||||
*/
|
||||
addr[0] = 0x00500050;
|
||||
addr[1] = 0x00500050;
|
||||
addr[0] = 0x00FF00FF;
|
||||
addr[1] = 0x00FF00FF;
|
||||
}
|
||||
|
||||
printf (" done\n");
|
||||
|
||||
DONE:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int write_word (flash_info_t *, volatile unsigned long *, ulong);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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 v;
|
||||
int i, l, cc = cnt, res = 0;
|
||||
|
||||
|
||||
for (v=0; cc > 0; addr += 4, cc -= 4 - l) {
|
||||
l = (addr & 3);
|
||||
addr &= ~3;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
v = (v << 8) + (i < l || i - l >= cc ?
|
||||
*((unsigned char *) addr + i) : *src++);
|
||||
}
|
||||
|
||||
if ((res = write_word (info, (volatile unsigned long *) addr, v)) != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word (flash_info_t * info, volatile unsigned long *addr,
|
||||
ulong data)
|
||||
{
|
||||
int flag, res = 0;
|
||||
ulong start;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased
|
||||
*/
|
||||
if ((*addr & data) != data)
|
||||
return (2);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
*addr = 0x00400040;
|
||||
*addr = data;
|
||||
|
||||
/* re-enable interrupts if necessary
|
||||
*/
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
start = get_timer (0);
|
||||
while ((*addr & 0x00800080) != 0x00800080) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
/* Suspend program
|
||||
*/
|
||||
*addr = 0x00B000B0;
|
||||
res = 1;
|
||||
goto OUT;
|
||||
}
|
||||
}
|
||||
|
||||
if (*addr & 0x00220022) {
|
||||
printf ("*** ERROR: program failed!\n");
|
||||
res = 1;
|
||||
}
|
||||
|
||||
OUT:
|
||||
/* Clear status register and reset to read mode
|
||||
*/
|
||||
*addr = 0x00500050;
|
||||
*addr = 0x00FF00FF;
|
||||
|
||||
return (res);
|
||||
}
|
||||
363
board/pm828/pm828.c
Normal file
363
board/pm828/pm828.c
Normal file
@@ -0,0 +1,363 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2004
|
||||
* 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 <ioports.h>
|
||||
#include <mpc8260.h>
|
||||
#include <pci.h>
|
||||
|
||||
/*
|
||||
* I/O Port configuration table
|
||||
*
|
||||
* if conf is 1, then that port pin will be configured at boot time
|
||||
* according to the five values podr/pdir/ppar/psor/pdat for that entry
|
||||
*/
|
||||
|
||||
const iop_conf_t iop_conf_tab[4][32] = {
|
||||
|
||||
/* Port A configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PA31 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 COL */
|
||||
/* PA30 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 CRS */
|
||||
/* PA29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC1 TXER */
|
||||
/* PA28 */ { 1, 1, 1, 1, 0, 0 }, /* FCC1 TXEN */
|
||||
/* PA27 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXDV */
|
||||
/* PA26 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXER */
|
||||
/* PA25 */ { 0, 0, 0, 1, 0, 0 }, /* PA25 */
|
||||
/* PA24 */ { 0, 0, 0, 1, 0, 0 }, /* PA24 */
|
||||
/* PA23 */ { 0, 0, 0, 1, 0, 0 }, /* PA23 */
|
||||
/* PA22 */ { 0, 0, 0, 1, 0, 0 }, /* PA22 */
|
||||
/* PA21 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD3 */
|
||||
/* PA20 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD2 */
|
||||
/* PA19 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD1 */
|
||||
/* PA18 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD0 */
|
||||
/* PA17 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD0 */
|
||||
/* PA16 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD1*/
|
||||
/* PA15 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD2 */
|
||||
/* PA14 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD3 */
|
||||
/* PA13 */ { 0, 0, 0, 1, 0, 0 }, /* PA13 */
|
||||
/* PA12 */ { 0, 0, 0, 1, 0, 0 }, /* PA12 */
|
||||
/* PA11 */ { 0, 0, 0, 1, 0, 0 }, /* PA11 */
|
||||
/* PA10 */ { 0, 0, 0, 1, 0, 0 }, /* PA10 */
|
||||
/* PA9 */ { 0, 1, 0, 1, 0, 0 }, /* PA9 */
|
||||
/* PA8 */ { 0, 1, 0, 0, 0, 0 }, /* PA8 */
|
||||
/* PA7 */ { 0, 0, 0, 1, 0, 0 }, /* PA7 */
|
||||
/* PA6 */ { 0, 0, 0, 1, 0, 0 }, /* PA6 */
|
||||
/* PA5 */ { 0, 0, 0, 1, 0, 0 }, /* PA5 */
|
||||
/* PA4 */ { 0, 0, 0, 1, 0, 0 }, /* PA4 */
|
||||
/* PA3 */ { 0, 0, 0, 1, 0, 0 }, /* PA3 */
|
||||
/* PA2 */ { 0, 0, 0, 1, 0, 0 }, /* PA2 */
|
||||
/* PA1 */ { 0, 0, 0, 1, 0, 0 }, /* PA1 */
|
||||
/* PA0 */ { 0, 0, 0, 1, 0, 0 } /* PA0 */
|
||||
},
|
||||
|
||||
/* Port B configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PB31 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 TX_ER */
|
||||
/* PB30 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RX_DV */
|
||||
/* PB29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC2 TX_EN */
|
||||
#if defined(CONFIG_ETHER_ON_SCC) && (CONFIG_ETHER_INDEX == 1)
|
||||
#ifdef CONFIG_ETHER_ON_FCC2
|
||||
#error "SCC1 conflicts with FCC2"
|
||||
#endif
|
||||
/* PB28 */ { 1, 1, 1, 1, 0, 0 }, /* SCC1 TXD */
|
||||
#else
|
||||
/* PB28 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RX_ER */
|
||||
#endif
|
||||
/* PB27 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 COL */
|
||||
/* PB26 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 CRS */
|
||||
/* PB25 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 TxD[3] */
|
||||
/* PB24 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 TxD[2] */
|
||||
/* PB23 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 TxD[1] */
|
||||
/* PB22 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 TxD[0] */
|
||||
/* PB21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RxD[0] */
|
||||
/* PB20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RxD[1] */
|
||||
/* PB19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RxD[2] */
|
||||
/* PB18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RxD[3] */
|
||||
/* PB17 */ { 0, 0, 0, 0, 0, 0 }, /* PB17 */
|
||||
/* PB16 */ { 0, 0, 0, 0, 0, 0 }, /* PB16 */
|
||||
/* PB15 */ { 1, 1, 0, 0, 0, 0 }, /* SCC2 RXD */
|
||||
/* PB14 */ { 1, 1, 0, 0, 0, 0 }, /* SCC3 RXD */
|
||||
/* 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 */ { 1, 1, 1, 1, 0, 0 }, /* SCC3 TXD */
|
||||
/* 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 */
|
||||
/* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
|
||||
/* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
|
||||
/* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
|
||||
/* PB0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
|
||||
},
|
||||
|
||||
/* Port C */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PC31 */ { 0, 0, 0, 1, 0, 0 }, /* PC31 */
|
||||
/* PC30 */ { 0, 0, 0, 1, 0, 0 }, /* PC30 */
|
||||
/* PC29 */ { 0, 1, 1, 0, 0, 0 }, /* SCC1 CTS */
|
||||
/* PC28 */ { 0, 0, 0, 1, 0, 0 }, /* SCC2 CTS */
|
||||
/* PC27 */ { 0, 0, 0, 1, 0, 0 }, /* PC27 */
|
||||
/* PC26 */ { 0, 0, 0, 1, 0, 0 }, /* PC26 */
|
||||
/* PC25 */ { 0, 0, 0, 1, 0, 0 }, /* PC25 */
|
||||
/* PC24 */ { 0, 0, 0, 1, 0, 0 }, /* PC24 */
|
||||
/* PC23 */ { 0, 1, 0, 1, 0, 0 }, /* PC23 */
|
||||
/* PC22 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 TXCK */
|
||||
/* PC21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXCK */
|
||||
/* PC20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 TXCK(2) */
|
||||
/* PC19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 RXCK */
|
||||
/* PC18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 TXCK */
|
||||
/* PC17 */ { 0, 0, 0, 1, 0, 0 }, /* PC17 */
|
||||
/* PC16 */ { 0, 0, 0, 1, 0, 0 }, /* PC16 */
|
||||
/* PC15 */ { 1, 1, 0, 1, 0, 0 }, /* SMC2 TXD */
|
||||
/* PC14 */ { 0, 1, 0, 0, 0, 0 }, /* SCC1 DCD */
|
||||
/* PC13 */ { 0, 0, 0, 1, 0, 0 }, /* PC13 */
|
||||
/* PC12 */ { 0, 0, 0, 1, 0, 0 }, /* SCC2 DCD */
|
||||
/* PC11 */ { 0, 0, 0, 1, 0, 0 }, /* SCC3 CTS */
|
||||
/* PC10 */ { 0, 0, 0, 1, 0, 0 }, /* SCC3 DCD */
|
||||
/* PC9 */ { 0, 0, 0, 1, 0, 0 }, /* SCC4 CTS */
|
||||
/* PC8 */ { 0, 0, 0, 1, 0, 0 }, /* SCC4 DCD */
|
||||
/* PC7 */ { 0, 0, 0, 1, 0, 0 }, /* PC7 */
|
||||
/* PC6 */ { 0, 0, 0, 1, 0, 0 }, /* PC6 */
|
||||
/* PC5 */ { 0, 0, 0, 1, 0, 0 }, /* PC5 */
|
||||
/* PC4 */ { 0, 0, 0, 1, 0, 0 }, /* PC4 */
|
||||
/* PC3 */ { 0, 0, 0, 1, 0, 0 }, /* PC3 */
|
||||
/* PC2 */ { 0, 0, 0, 1, 0, 1 }, /* PC2 */
|
||||
/* PC1 */ { 0, 0, 0, 1, 0, 0 }, /* PC1 */
|
||||
/* PC0 */ { 0, 0, 0, 1, 0, 0 }, /* PC0 */
|
||||
},
|
||||
|
||||
/* Port D */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PD31 */ { 1, 1, 0, 0, 0, 0 }, /* SCC1 RXD */
|
||||
/* PD30 */ { 0, 1, 1, 1, 0, 0 }, /* PD30 */
|
||||
/* PD29 */ { 0, 1, 0, 1, 0, 0 }, /* SCC1 RTS */
|
||||
/* PD28 */ { 0, 0, 0, 1, 0, 0 }, /* PD28 */
|
||||
/* PD27 */ { 0, 1, 0, 1, 0, 0 }, /* SCC2 RTS */
|
||||
/* PD26 */ { 0, 0, 0, 1, 0, 0 }, /* PD26 */
|
||||
/* PD25 */ { 0, 0, 0, 1, 0, 0 }, /* PD25 */
|
||||
/* PD24 */ { 0, 0, 0, 1, 0, 0 }, /* PD24 */
|
||||
/* PD23 */ { 0, 0, 0, 1, 0, 0 }, /* SCC3 RTS */
|
||||
/* PD22 */ { 1, 1, 0, 0, 0, 0 }, /* SCC4 RXD */
|
||||
/* PD21 */ { 1, 1, 0, 1, 0, 0 }, /* SCC4 TXD */
|
||||
/* PD20 */ { 0, 0, 1, 1, 0, 0 }, /* SCC4 RTS */
|
||||
/* PD19 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */
|
||||
/* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */
|
||||
/* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* PD17 */
|
||||
/* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* PD16 */
|
||||
#if defined(CONFIG_SOFT_I2C)
|
||||
/* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
|
||||
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
|
||||
#else
|
||||
#if defined(CONFIG_HARD_I2C)
|
||||
/* PD15 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SDA */
|
||||
/* PD14 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SCL */
|
||||
#else /* normal I/O port pins */
|
||||
/* PD15 */ { 0, 1, 1, 0, 1, 0 }, /* I2C SDA */
|
||||
/* PD14 */ { 0, 1, 1, 0, 1, 0 }, /* I2C SCL */
|
||||
#endif
|
||||
#endif
|
||||
/* PD13 */ { 0, 0, 0, 0, 0, 0 }, /* PD13 */
|
||||
/* PD12 */ { 0, 0, 0, 0, 0, 0 }, /* PD12 */
|
||||
/* PD11 */ { 0, 0, 0, 0, 0, 0 }, /* PD11 */
|
||||
/* PD10 */ { 0, 0, 0, 0, 0, 0 }, /* PD10 */
|
||||
/* PD9 */ { 0, 1, 0, 1, 0, 0 }, /* PD9 */
|
||||
/* PD8 */ { 0, 1, 0, 0, 0, 0 }, /* PD8 */
|
||||
/* PD7 */ { 0, 0, 0, 1, 0, 1 }, /* PD7 */
|
||||
/* PD6 */ { 0, 0, 0, 1, 0, 1 }, /* PD6 */
|
||||
/* PD5 */ { 0, 0, 0, 1, 0, 1 }, /* PD5 */
|
||||
/* PD4 */ { 1, 1, 1, 0, 0, 0 }, /* SMC2 RXD */
|
||||
/* PD3 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
|
||||
/* PD2 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
|
||||
/* PD1 */ { 0, 0, 0, 0, 0, 0 }, /* pin doesn't exist */
|
||||
/* PD0 */ { 0, 0, 0, 0, 0, 0 } /* pin doesn't exist */
|
||||
}
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Check Board Identity:
|
||||
*/
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: PM828\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/* Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx
|
||||
*
|
||||
* This routine performs standard 8260 initialization sequence
|
||||
* and calculates the available memory size. It may be called
|
||||
* several times to try different SDRAM configurations on both
|
||||
* 60x and local buses.
|
||||
*/
|
||||
static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
|
||||
ulong orx, volatile uchar * base)
|
||||
{
|
||||
volatile uchar c = 0xff;
|
||||
volatile ulong cnt, val;
|
||||
volatile ulong *addr;
|
||||
volatile uint *sdmr_ptr;
|
||||
volatile uint *orx_ptr;
|
||||
int i;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
ulong maxsize;
|
||||
|
||||
/* We must be able to test a location outsize the maximum legal size
|
||||
* to find out THAT we are outside; but this address still has to be
|
||||
* mapped by the controller. That means, that the initial mapping has
|
||||
* to be (at least) twice as large as the maximum expected size.
|
||||
*/
|
||||
maxsize = (1 + (~orx | 0x7fff)) / 2;
|
||||
|
||||
sdmr_ptr = &memctl->memc_psdmr;
|
||||
orx_ptr = &memctl->memc_or2;
|
||||
|
||||
*orx_ptr = orx;
|
||||
|
||||
/*
|
||||
* Quote from 8260 UM (10.4.2 SDRAM Power-On Initialization, 10-35):
|
||||
*
|
||||
* "At system reset, initialization software must set up the
|
||||
* programmable parameters in the memory controller banks registers
|
||||
* (ORx, BRx, P/LSDMR). After all memory parameters are configured,
|
||||
* system software should execute the following initialization sequence
|
||||
* for each SDRAM device.
|
||||
*
|
||||
* 1. Issue a PRECHARGE-ALL-BANKS command
|
||||
* 2. Issue eight CBR REFRESH commands
|
||||
* 3. Issue a MODE-SET command to initialize the mode register
|
||||
*
|
||||
* The initial commands are executed by setting P/LSDMR[OP] and
|
||||
* accessing the SDRAM with a single-byte transaction."
|
||||
*
|
||||
* The appropriate BRx/ORx registers have already been set when we
|
||||
* get here. The SDRAM can be accessed at the address CFG_SDRAM_BASE.
|
||||
*/
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_PREA;
|
||||
*base = c;
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_CBRR;
|
||||
for (i = 0; i < 8; i++)
|
||||
*base = c;
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_MRW;
|
||||
*(base + CFG_MRS_OFFS) = c; /* setting MR on address lines */
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
|
||||
*base = c;
|
||||
|
||||
/*
|
||||
* Check memory range for valid RAM. A simple memory test determines
|
||||
* the actually available RAM size between addresses `base' and
|
||||
* `base + maxsize'. Some (not all) hardware errors are detected:
|
||||
* - short between address lines
|
||||
* - short between data lines
|
||||
*/
|
||||
i = 0;
|
||||
for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
|
||||
addr = (volatile ulong *) base + cnt; /* pointer arith! */
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
addr = (volatile ulong *) base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt; /* pointer arith! */
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
if (val != ~cnt) {
|
||||
/* Write the actual size to ORx
|
||||
*/
|
||||
*orx_ptr = orx | ~(cnt * sizeof (long) - 1);
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
ulong size8, size9;
|
||||
#endif
|
||||
ulong psize = 32 * 1024 * 1024;
|
||||
|
||||
memctl->memc_psrt = CFG_PSRT;
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
size8 = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL,
|
||||
(uchar *) CFG_SDRAM_BASE);
|
||||
size9 = try_init (memctl, CFG_PSDMR_9COL, CFG_OR2_9COL,
|
||||
(uchar *) CFG_SDRAM_BASE);
|
||||
|
||||
if (size8 < size9) {
|
||||
psize = size9;
|
||||
printf ("(60x:9COL) ");
|
||||
} else {
|
||||
psize = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL,
|
||||
(uchar *) CFG_SDRAM_BASE);
|
||||
printf ("(60x:8COL) ");
|
||||
}
|
||||
#endif
|
||||
return (psize);
|
||||
}
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_DOC)
|
||||
extern void doc_probe (ulong physadr);
|
||||
void doc_init (void)
|
||||
{
|
||||
doc_probe (CFG_DOC_BASE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
struct pci_controller hose;
|
||||
|
||||
extern void pci_mpc8250_init(struct pci_controller *);
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
pci_mpc8250_init(&hose);
|
||||
}
|
||||
#endif
|
||||
123
board/pm828/u-boot.lds
Normal file
123
board/pm828/u-boot.lds
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2004
|
||||
* 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/mpc8260/start.o (.text)
|
||||
*(.text)
|
||||
common/environment.o(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.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 = .);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -21,6 +21,8 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* #define DEBUG */
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
@@ -49,28 +51,35 @@ unsigned long flash_init (void)
|
||||
}
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
|
||||
debug ("\n## Get flash bank size @ 0x%08x\n", FLASH_BASE_PRELIM);
|
||||
|
||||
size_b0 = flash_get_size((vu_long *)FLASH_BASE_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);
|
||||
}
|
||||
|
||||
debug ("## Before remap: BR0: 0x%08x OR0: 0x%08x\n",
|
||||
memctl->memc_br0, memctl->memc_or0);
|
||||
|
||||
/* Remap FLASH according to real size */
|
||||
memctl->memc_or0 = CFG_OR_TIMING_FLASH | (-size_b0 & 0xFFFF8000);
|
||||
memctl->memc_br0 = (CFG_FLASH_BASE & BR_BA_MSK) | BR_MS_GPCM | BR_V;
|
||||
|
||||
debug ("## BR0: 0x%08x OR0: 0x%08x\n",
|
||||
memctl->memc_br0, memctl->memc_or0);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
|
||||
size_b0 = flash_get_size((vu_long *)CFG_FLASH_BASE, &flash_info[0]);
|
||||
flash_get_offsets (CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
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 */
|
||||
@@ -80,8 +89,21 @@ unsigned long flash_init (void)
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
#if defined(CFG_ENV_ADDR_REDUND) || defined(CFG_ENV_OFFSET_REDUND)
|
||||
debug ("Protect redundand environment: %08lx ... %08lx\n",
|
||||
(ulong)CFG_ENV_ADDR_REDUND,
|
||||
(ulong)CFG_ENV_ADDR_REDUND + CFG_ENV_SIZE - 1);
|
||||
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR_REDUND,
|
||||
CFG_ENV_ADDR_REDUND + CFG_ENV_SIZE_REDUND - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
debug ("## Final Flash bank size: %08lx\n", size_b0);
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
@@ -192,6 +214,8 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
|
||||
value = addr[0] ;
|
||||
|
||||
debug ("Manuf. ID @ 0x%08lx: 0x%08lx\n", (ulong)addr, value);
|
||||
|
||||
switch (value & 0x00FF00FF) {
|
||||
case AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
@@ -208,6 +232,8 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
|
||||
value = addr[2] ; /* device ID */
|
||||
|
||||
debug ("Device ID @ 0x%08lx: 0x%08lx\n", (ulong)(&addr[1]), value);
|
||||
|
||||
switch (value & 0x00FF00FF) {
|
||||
case (AMD_ID_LV400T & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM400T;
|
||||
@@ -244,25 +270,22 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 MB */
|
||||
#if 0 /* enable when device IDs are available */
|
||||
case AMD_ID_LV320T:
|
||||
case (AMD_ID_LV320T & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 MB */
|
||||
|
||||
case AMD_ID_LV320B:
|
||||
case (AMD_ID_LV320B & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x01000000;
|
||||
break; /* => 16 MB */
|
||||
#endif
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
/*%%% sector start address modified */
|
||||
/* set up sector start address table */
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
@@ -314,6 +337,8 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
|
||||
debug ("flash_erase: first: %d last: %d\n", s_first, s_last);
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
|
||||
@@ -351,7 +351,7 @@ void reset_phy(void)
|
||||
ulong value;
|
||||
|
||||
/* Configure all needed port pins for GPIO */
|
||||
#if CFG_ETH_MDDIS_VALUE
|
||||
#ifdef CFG_ETH_MDDIS_VALUE
|
||||
immr->im_ioport.iop_padat |= CFG_PA_ETH_MDDIS;
|
||||
#else
|
||||
immr->im_ioport.iop_padat &= ~(CFG_PA_ETH_MDDIS | CFG_PA_ETH_RESET); /* Set low */
|
||||
@@ -369,17 +369,17 @@ void reset_phy(void)
|
||||
value |= CFG_PB_ETH_POWERDOWN;
|
||||
|
||||
/* PHY configuration includes MDDIS and CFG1 ... CFG3 */
|
||||
#if CFG_ETH_CFG1_VALUE
|
||||
#ifdef CFG_ETH_CFG1_VALUE
|
||||
value |= CFG_PB_ETH_CFG1;
|
||||
#else
|
||||
value &= ~(CFG_PB_ETH_CFG1);
|
||||
#endif
|
||||
#if CFG_ETH_CFG2_VALUE
|
||||
#ifdef CFG_ETH_CFG2_VALUE
|
||||
value |= CFG_PB_ETH_CFG2;
|
||||
#else
|
||||
value &= ~(CFG_PB_ETH_CFG2);
|
||||
#endif
|
||||
#if CFG_ETH_CFG3_VALUE
|
||||
#ifdef CFG_ETH_CFG3_VALUE
|
||||
value |= CFG_PB_ETH_CFG3;
|
||||
#else
|
||||
value &= ~(CFG_PB_ETH_CFG3);
|
||||
|
||||
@@ -309,7 +309,7 @@ void reset_phy (void)
|
||||
|
||||
/* Configure all needed port pins for GPIO */
|
||||
#if PCU_E_WITH_SWAPPED_CS /* XXX */
|
||||
# if CFG_ETH_MDDIS_VALUE
|
||||
# ifdef CFG_ETH_MDDIS_VALUE
|
||||
immr->im_ioport.iop_padat |= CFG_PA_ETH_MDDIS;
|
||||
# else
|
||||
immr->im_ioport.iop_padat &= ~(CFG_PA_ETH_MDDIS); /* Set low */
|
||||
@@ -329,23 +329,23 @@ void reset_phy (void)
|
||||
|
||||
/* PHY configuration includes MDDIS and CFG1 ... CFG3 */
|
||||
#if !PCU_E_WITH_SWAPPED_CS
|
||||
# if CFG_ETH_MDDIS_VALUE
|
||||
# ifdef CFG_ETH_MDDIS_VALUE
|
||||
value |= CFG_PB_ETH_MDDIS;
|
||||
# else
|
||||
value &= ~(CFG_PB_ETH_MDDIS);
|
||||
# endif
|
||||
#endif
|
||||
#if CFG_ETH_CFG1_VALUE
|
||||
#ifdef CFG_ETH_CFG1_VALUE
|
||||
value |= CFG_PB_ETH_CFG1;
|
||||
#else
|
||||
value &= ~(CFG_PB_ETH_CFG1);
|
||||
#endif
|
||||
#if CFG_ETH_CFG2_VALUE
|
||||
#ifdef CFG_ETH_CFG2_VALUE
|
||||
value |= CFG_PB_ETH_CFG2;
|
||||
#else
|
||||
value &= ~(CFG_PB_ETH_CFG2);
|
||||
#endif
|
||||
#if CFG_ETH_CFG3_VALUE
|
||||
#ifdef CFG_ETH_CFG3_VALUE
|
||||
value |= CFG_PB_ETH_CFG3;
|
||||
#else
|
||||
value &= ~(CFG_PB_ETH_CFG3);
|
||||
|
||||
48
board/ssv/adnpesc1/Makefile
Normal file
48
board/ssv/adnpesc1/Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# (C) Copyright 2001-2004
|
||||
# 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 misc.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
|
||||
|
||||
#########################################################################
|
||||
103
board/ssv/adnpesc1/adnpesc1.c
Normal file
103
board/ssv/adnpesc1/adnpesc1.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <nios-io.h>
|
||||
#include <spi.h>
|
||||
|
||||
#if defined(CONFIG_HW_WATCHDOG)
|
||||
extern void ssv_wd_pio_init(void); /* comes from ../common/wd_pio.c
|
||||
included by ./misc.c */
|
||||
#endif
|
||||
|
||||
void _default_hdlr (void)
|
||||
{
|
||||
printf ("default_hdlr\n");
|
||||
}
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
#if defined(CONFIG_HW_WATCHDOG)
|
||||
ssv_wd_pio_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ( "Board: SSV DilNetPC ADNP/ESC1"
|
||||
#if defined(CONFIG_DNPEVA2)
|
||||
" on DNP/EVA2"
|
||||
#endif
|
||||
"\n");
|
||||
#if defined(CONFIG_NIOS_BASE_32)
|
||||
puts ("Conf.: SSV Base 32 (nios_32)\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* The following are used to control the SPI chip selects for the SPI command.
|
||||
*/
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_SPI) && CONFIG_NIOS_SPI
|
||||
|
||||
#define SPI_RTC_CS_MASK 0x00000001
|
||||
|
||||
void spi_rtc_chipsel(int cs)
|
||||
{
|
||||
nios_spi_t *spi = (nios_spi_t *)CFG_NIOS_SPIBASE;
|
||||
|
||||
if (cs)
|
||||
spi->slaveselect = SPI_RTC_CS_MASK; /* activate (1) */
|
||||
else
|
||||
spi->slaveselect = 0; /* deactivate (0) */
|
||||
}
|
||||
|
||||
/*
|
||||
* The SPI command uses this table of functions for controlling the SPI
|
||||
* chip selects: it calls the appropriate function to control the SPI
|
||||
* chip selects.
|
||||
*/
|
||||
spi_chipsel_type spi_chipsel[] = {
|
||||
spi_rtc_chipsel
|
||||
};
|
||||
int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
|
||||
|
||||
#endif /* CFG_CMD_SPI */
|
||||
|
||||
#if defined(CONFIG_POST)
|
||||
/*
|
||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||
* Called from board_init_f().
|
||||
*/
|
||||
int post_hotkeys_pressed(void)
|
||||
{
|
||||
return 0; /* No hotkeys supported */
|
||||
}
|
||||
#endif /* CONFIG_POST */
|
||||
29
board/ssv/adnpesc1/config.mk
Normal file
29
board/ssv/adnpesc1/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# Li-Pro.Net <www.li-pro.net>
|
||||
# Stephan Linz <linz@li-pro.net>
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x02fc0000 # ATTENTION: notice your CFG_MONITOR_LEN setting
|
||||
|
||||
ifeq ($(debug),1)
|
||||
PLATFORM_CPPFLAGS += -DDEBUG
|
||||
endif
|
||||
66
board/ssv/adnpesc1/flash.c
Normal file
66
board/ssv/adnpesc1/flash.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include <common.h>
|
||||
#include <nios.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for ssv boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define BANKSZ (8 * 1024 * 1024)
|
||||
#define SECTSZ (64 * 1024)
|
||||
#define UBOOTSECS ((CFG_MONITOR_LEN + CFG_ENV_SIZE) / SECTSZ)
|
||||
#define UBOOTAREA (UBOOTSECS * 64 * 1024) /* monitor / env area */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
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 + FLASH_AMLV640U;
|
||||
|
||||
addr = CFG_FLASH_BASE;
|
||||
for (i = 0; i < fli->sector_count; ++i) {
|
||||
fli->start[i] = addr;
|
||||
addr += SECTSZ;
|
||||
|
||||
/* Protect monitor / environment area */
|
||||
if (addr <= (CFG_FLASH_BASE + UBOOTAREA))
|
||||
fli->protect[i] = 1;
|
||||
else
|
||||
fli->protect[i] = 0;
|
||||
}
|
||||
|
||||
return (BANKSZ);
|
||||
}
|
||||
40
board/ssv/adnpesc1/misc.c
Normal file
40
board/ssv/adnpesc1/misc.c
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* (C) Copyright 2003, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* board/ssv/adnpesc1/misc.c
|
||||
*
|
||||
* miscellaneous board interfaces / drivers
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if defined(CONFIG_STATUS_LED)
|
||||
#include "../common/cmd_sled.c"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HW_WATCHDOG)
|
||||
#include "../common/wd_pio.c"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
|
||||
#include "../common/post.c"
|
||||
#endif
|
||||
69
board/ssv/adnpesc1/u-boot.lds
Normal file
69
board/ssv/adnpesc1/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 = .;
|
||||
}
|
||||
138
board/ssv/adnpesc1/vectors.S
Normal file
138
board/ssv/adnpesc1/vectors.S
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* 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:
|
||||
|
||||
#if defined(CFG_NIOS_CPU_OCI_BASE)
|
||||
/* OCI does the reset job */
|
||||
.long _def_xhandler@h /* Vector 0 - NMI / Reset */
|
||||
#else
|
||||
/* there is no OCI, so we have to do a direct reset jump here */
|
||||
.long CFG_NIOS_CPU_RST_VECT /* Vector 0 - Reset to GERMS */
|
||||
#endif
|
||||
.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 */
|
||||
#if (CFG_NIOS_TMRIRQ == 16)
|
||||
.long _timebase_int@h /* Vector 16 - lopri timer*/
|
||||
#else
|
||||
.long _def_xhandler@h /* Vector 16 */
|
||||
#endif
|
||||
.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 */
|
||||
#if (CFG_NIOS_TMRIRQ == 50)
|
||||
.long _timebase_int@h /* Vector 50 - lopri timer*/
|
||||
#else
|
||||
.long _def_xhandler@h /* Vector 50 */
|
||||
#endif
|
||||
.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 */
|
||||
162
board/ssv/common/cmd_sled.c
Normal file
162
board/ssv/common/cmd_sled.c
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <status_led.h>
|
||||
|
||||
#if defined(CONFIG_STATUS_LED)
|
||||
|
||||
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* !!!!! Q u i c k & D i r t y H a c k !!!!!
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* !!!!! !!!!!
|
||||
* !!!!! Next type definition was coming from original !!!!!
|
||||
* !!!!! status LED driver drivers/status_led.c and !!!!!
|
||||
* !!!!! should exported for using here. !!!!!
|
||||
* !!!!! !!!!!
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
|
||||
|
||||
typedef struct {
|
||||
led_id_t mask;
|
||||
int state;
|
||||
int period;
|
||||
int cnt;
|
||||
} led_dev_t;
|
||||
|
||||
extern led_dev_t led_dev[];
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
int do_sled (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
int led_id = 0;
|
||||
|
||||
if (argc > 1) {
|
||||
#ifdef STATUS_LED_BOOT
|
||||
if (!strcmp (argv[1], "boot")) {
|
||||
led_id = STATUS_LED_BOOT + 1;
|
||||
}
|
||||
#endif
|
||||
#ifdef STATUS_LED_RED
|
||||
if (!strcmp (argv[1], "red")) {
|
||||
led_id = STATUS_LED_RED + 1;
|
||||
}
|
||||
#endif
|
||||
#ifdef STATUS_LED_YELLOW
|
||||
if (!strcmp (argv[1], "yellow")) {
|
||||
led_id = STATUS_LED_YELLOW + 1;
|
||||
}
|
||||
#endif
|
||||
#ifdef STATUS_LED_GREEN
|
||||
if (!strcmp (argv[1], "green")) {
|
||||
led_id = STATUS_LED_GREEN + 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (argc) {
|
||||
case 1:
|
||||
#if (STATUS_LED_BITS > 3)
|
||||
for (; led_id < 4; led_id++)
|
||||
#elif (STATUS_LED_BITS > 2)
|
||||
for (; led_id < 3; led_id++)
|
||||
#elif (STATUS_LED_BITS > 1)
|
||||
for (; led_id < 2; led_id++)
|
||||
#elif (STATUS_LED_BITS > 0)
|
||||
for (; led_id < 1; led_id++)
|
||||
#else
|
||||
#error "*** STATUS_LED_BITS not correct defined ***"
|
||||
#endif
|
||||
{
|
||||
printf ("Status LED '%s' is %s\n",
|
||||
led_id == STATUS_LED_BOOT ? "boot"
|
||||
: led_id == STATUS_LED_RED ? "red"
|
||||
: led_id == STATUS_LED_YELLOW ? "yellow"
|
||||
: led_id ==
|
||||
STATUS_LED_GREEN ? "green" : "unknown",
|
||||
led_dev[led_id].state ==
|
||||
STATUS_LED_ON ? "on" : led_dev[led_id].
|
||||
state ==
|
||||
STATUS_LED_OFF ? "off" : led_dev[led_id].
|
||||
state ==
|
||||
STATUS_LED_BLINKING ? "blinking" : "unknown");
|
||||
}
|
||||
return 0;
|
||||
case 2:
|
||||
if (led_id) {
|
||||
printf ("Status LED '%s' is %s\n", argv[1],
|
||||
led_dev[led_id - 1].state ==
|
||||
STATUS_LED_ON ? "on" : led_dev[led_id -
|
||||
1].state ==
|
||||
STATUS_LED_OFF ? "off" : led_dev[led_id -
|
||||
1].state ==
|
||||
STATUS_LED_BLINKING ? "blinking" : "unknown");
|
||||
return 0;
|
||||
} else
|
||||
break;
|
||||
case 3:
|
||||
if (led_id) {
|
||||
if (!strcmp (argv[2], "on")) {
|
||||
status_led_set (led_id - 1, STATUS_LED_ON);
|
||||
return 0;
|
||||
} else if (!strcmp (argv[2], "off")) {
|
||||
status_led_set (led_id - 1, STATUS_LED_OFF);
|
||||
return 0;
|
||||
} else if (!strcmp (argv[2], "blink")) {
|
||||
status_led_set (led_id - 1,
|
||||
STATUS_LED_BLINKING);
|
||||
return 0;
|
||||
} else
|
||||
break;
|
||||
} else
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef STATUS_LED_BOOT
|
||||
#ifdef STATUS_LED_RED
|
||||
#ifdef STATUS_LED_YELLOW
|
||||
#ifdef STATUS_LED_GREEN
|
||||
#define __NAME_STR " - name: boot|red|yellow|green\n"
|
||||
#else
|
||||
#define __NAME_STR " - name: boot|red|yellow\n"
|
||||
#endif
|
||||
#else
|
||||
#define __NAME_STR " - name: boot|red\n"
|
||||
#endif
|
||||
#else
|
||||
#define __NAME_STR " - name: boot\n"
|
||||
#endif
|
||||
#else
|
||||
#define __NAME_STR " - name: (no such defined)\n"
|
||||
#endif
|
||||
|
||||
U_BOOT_CMD (sled, 3, 0, do_sled,
|
||||
"sled - check and set status led\n",
|
||||
"sled [name [state]]\n" __NAME_STR " - state: on|off|blink\n");
|
||||
#endif /* CFG_CMD_BSP */
|
||||
#endif /* CONFIG_STATUS_LED */
|
||||
207
board/ssv/common/flash.c
Normal file
207
board/ssv/common/flash.c
Normal file
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <nios.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
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 CFG_FLASH_WORD_SIZE *addr = (CFG_FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2;
|
||||
int prot, sect, wait;
|
||||
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");
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
printf("- Erase: Sect: %i @ 0x%08x\n", sect, info->start[sect]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 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 = (CFG_FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
*addr = 0xf0;
|
||||
*(addr+0xAAA/2) = 0xaa;
|
||||
*(addr+0x554/2) = 0x55;
|
||||
*(addr+0xAAA/2) = 0x80;
|
||||
*(addr+0xAAA/2) = 0xaa;
|
||||
*(addr+0x554/2) = 0x55;
|
||||
*addr2 = 0x30;
|
||||
/* Now just wait for 0xffff & provide some user
|
||||
* feedback while we wait. Here we have to grant
|
||||
* timer interrupts. Otherwise get_timer() can't
|
||||
* work right. */
|
||||
ipri(oldpri);
|
||||
start = get_timer (0);
|
||||
while (*addr2 != 0xffff) {
|
||||
for (wait = 8; wait; wait--) {
|
||||
udelay (125 * 1000);
|
||||
}
|
||||
putc ('.');
|
||||
if (get_timer (start) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("timeout\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
oldpri = ipri (3); /* disallow non important irqs again */
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\n");
|
||||
*addr = 0xf0;
|
||||
|
||||
/* 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 * srcbuffer, ulong addr, ulong cnt)
|
||||
{
|
||||
|
||||
volatile CFG_FLASH_WORD_SIZE *cmd = (vu_short *) info->start[0];
|
||||
volatile CFG_FLASH_WORD_SIZE *dst = (vu_short *) addr;
|
||||
CFG_FLASH_WORD_SIZE *src = (void *) srcbuffer;
|
||||
CFG_FLASH_WORD_SIZE b;
|
||||
unsigned oldpri;
|
||||
ulong start;
|
||||
|
||||
cnt /= sizeof(CFG_FLASH_WORD_SIZE);
|
||||
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+0xAAA/2) = 0xaa;
|
||||
*(cmd+0x554/2) = 0x55;
|
||||
*(cmd+0xAAA/2) = 0xa0;
|
||||
ipri (oldpri);
|
||||
*dst = b;
|
||||
|
||||
/* Verify write */
|
||||
start = get_timer (0);
|
||||
while (*dst != b) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*cmd = 0xf0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
dst++;
|
||||
src++;
|
||||
cnt--;
|
||||
}
|
||||
|
||||
*cmd = 0xf0;
|
||||
return (0);
|
||||
}
|
||||
44
board/ssv/common/post.c
Normal file
44
board/ssv/common/post.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
|
||||
|
||||
#if !defined(CFG_NIOS_POST_WORD_ADDR)
|
||||
#error "*** CFG_NIOS_POST_WORD_ADDR not defined ***"
|
||||
#endif
|
||||
|
||||
void post_word_store (ulong a)
|
||||
{
|
||||
volatile void *save_addr = (void *)(CFG_NIOS_POST_WORD_ADDR);
|
||||
*(volatile ulong *) save_addr = a;
|
||||
}
|
||||
|
||||
ulong post_word_load (void)
|
||||
{
|
||||
volatile void *save_addr = (void *)(CFG_NIOS_POST_WORD_ADDR);
|
||||
return *(volatile ulong *) save_addr;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||
160
board/ssv/common/wd_pio.c
Normal file
160
board/ssv/common/wd_pio.c
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <nios.h>
|
||||
#include <nios-io.h>
|
||||
|
||||
#if defined(CONFIG_HW_WATCHDOG)
|
||||
|
||||
#if !defined(CONFIG_HW_WDENA_BASE)
|
||||
#error "*** CONFIG_HW_WDENA_BASE not defined ***"
|
||||
#if !defined(CONFIG_HW_WDENA_BIT)
|
||||
#error "*** CONFIG_HW_WDENA_BIT not defined ***"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_HW_WDTOG_BASE)
|
||||
#error "*** CONFIG_HW_WDTOG_BASE not defined ***"
|
||||
#if !defined(CONFIG_HW_WDTOG_BIT)
|
||||
#error "*** CONFIG_HW_WDTOG_BIT not defined ***"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HW_WDPORT_WRONLY /* emulate read access */
|
||||
static unsigned __wd_ena_pio_portval = 0;
|
||||
#endif
|
||||
|
||||
#define WD_PIO_INIT_DONE(V) ((V) & (1 << CONFIG_HW_WDENA_BIT))
|
||||
|
||||
void ssv_wd_pio_init(void)
|
||||
{
|
||||
nios_pio_t *ena_piop = (nios_pio_t*)CONFIG_HW_WDENA_BASE;
|
||||
nios_pio_t *trg_piop = (nios_pio_t*)CONFIG_HW_WDTOG_BASE;
|
||||
|
||||
trg_piop->data &= ~(1 << CONFIG_HW_WDTOG_BIT);
|
||||
|
||||
#ifdef CONFIG_HW_WDPORT_WRONLY /* emulate read access */
|
||||
|
||||
__wd_ena_pio_portval |= (1 << CONFIG_HW_WDENA_BIT);
|
||||
ena_piop->data = __wd_ena_pio_portval;
|
||||
|
||||
#else /* !CONFIG_HW_WDPORT_WRONLY */
|
||||
|
||||
trg_piop->direction |= (1 << CONFIG_HW_WDTOG_BIT);
|
||||
|
||||
ena_piop->data |= (1 << CONFIG_HW_WDENA_BIT);
|
||||
ena_piop->direction |= (1 << CONFIG_HW_WDENA_BIT);
|
||||
|
||||
#endif /* CONFIG_HW_WDPORT_WRONLY */
|
||||
}
|
||||
|
||||
void ssv_wd_pio_done(void)
|
||||
{
|
||||
nios_pio_t *piop = (nios_pio_t*)CONFIG_HW_WDENA_BASE;
|
||||
|
||||
#ifdef CONFIG_HW_WDPORT_WRONLY /* emulate read access */
|
||||
|
||||
__wd_ena_pio_portval &= ~(1 << CONFIG_HW_WDENA_BIT);
|
||||
piop->data = __wd_ena_pio_portval;
|
||||
|
||||
#else /* !CONFIG_HW_WDPORT_WRONLY */
|
||||
|
||||
piop->data &= ~(1 << CONFIG_HW_WDENA_BIT);
|
||||
|
||||
#endif /* CONFIG_HW_WDPORT_WRONLY */
|
||||
}
|
||||
|
||||
void ssv_wd_pio_reset(void)
|
||||
{
|
||||
nios_pio_t *trg_piop = (nios_pio_t*)CONFIG_HW_WDTOG_BASE;
|
||||
|
||||
#ifdef CONFIG_HW_WDPORT_WRONLY
|
||||
if (WD_PIO_INIT_DONE(__wd_ena_pio_portval))
|
||||
#else
|
||||
nios_pio_t *ena_piop = (nios_pio_t*)CONFIG_HW_WDENA_BASE;
|
||||
|
||||
if (WD_PIO_INIT_DONE(ena_piop->data))
|
||||
#endif
|
||||
{
|
||||
trg_piop->data |= (1 << CONFIG_HW_WDTOG_BIT);
|
||||
trg_piop->data &= ~(1 << CONFIG_HW_WDTOG_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
void hw_watchdog_reset(void)
|
||||
{
|
||||
int re_enable = disable_interrupts ();
|
||||
|
||||
ssv_wd_pio_reset();
|
||||
if (re_enable)
|
||||
enable_interrupts ();
|
||||
}
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
nios_pio_t *ena_piop = (nios_pio_t*)CONFIG_HW_WDENA_BASE;
|
||||
|
||||
switch (argc)
|
||||
{
|
||||
case 1:
|
||||
printf ("Watchdog timer status is %s\n",
|
||||
#ifdef CONFIG_HW_WDPORT_WRONLY
|
||||
WD_PIO_INIT_DONE(__wd_ena_pio_portval)
|
||||
#else
|
||||
WD_PIO_INIT_DONE(ena_piop->data)
|
||||
#endif
|
||||
? "on" : "off");
|
||||
return 0;
|
||||
case 2:
|
||||
if (!strcmp(argv[1],"on"))
|
||||
{
|
||||
ssv_wd_pio_init();
|
||||
printf("Watchdog timer now is on\n");
|
||||
return 0;
|
||||
}
|
||||
else if (!strcmp(argv[1],"off"))
|
||||
{
|
||||
ssv_wd_pio_done();
|
||||
printf("Watchdog timer now is off\n");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
wd, 2, 1, do_wd,
|
||||
"wd - check and set watchdog\n",
|
||||
"on - switch watchDog on\n"
|
||||
"wd off - switch watchdog off\n"
|
||||
"wd - print current status\n"
|
||||
);
|
||||
#endif /* CFG_CMD_BSP */
|
||||
#endif /* CONFIG_HW_WATCHDOG */
|
||||
47
board/sx1/Makefile
Normal file
47
board/sx1/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# 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 := sx1.o flash.o
|
||||
SOBJS := platform.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
|
||||
|
||||
#########################################################################
|
||||
19
board/sx1/config.mk
Normal file
19
board/sx1/config.mk
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
|
||||
#
|
||||
# SX1 board with OMAP1510 (ARM925T) cpu
|
||||
# see http://www.ti.com/ for more information on Texas Insturments
|
||||
#
|
||||
# SX1 has 1 bank of 256 MB SDRAM
|
||||
# Physical Address:
|
||||
# 1000'0000 to 2000'0000
|
||||
#
|
||||
#
|
||||
# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000 (mem base + reserved)
|
||||
#
|
||||
# we load ourself to 1108'0000
|
||||
#
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x11080000
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user