mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-09 13:16:40 +03:00
Compare commits
164 Commits
LABEL_2004
...
LABEL_2004
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eedcd078fe | ||
|
|
7ca202f566 | ||
|
|
31a649234e | ||
|
|
89394047ba | ||
|
|
429168ea88 | ||
|
|
6705d81e90 | ||
|
|
68ceb29e71 | ||
|
|
9aea95307f | ||
|
|
281e00a3be | ||
|
|
cfca5e604d | ||
|
|
45eeb8983c | ||
|
|
de8d5a3600 | ||
|
|
75b1fa7864 | ||
|
|
07cba3514b | ||
|
|
b8c8318160 | ||
|
|
cdc7fea173 | ||
|
|
a1f4a3dd05 | ||
|
|
b9283e2dbe | ||
|
|
810509266f | ||
|
|
6c7a14084a | ||
|
|
bc54f309a1 | ||
|
|
56523f1283 | ||
|
|
857cad37a4 | ||
|
|
fabd46acff | ||
|
|
10a36a98c4 | ||
|
|
466b74108f | ||
|
|
8b07a1103d | ||
|
|
0ac6f8b749 | ||
|
|
262381329b | ||
|
|
ede130229c | ||
|
|
2c96baa2a4 | ||
|
|
18f71f27ae | ||
|
|
78953f2f93 | ||
|
|
e55ca7e262 | ||
|
|
93f6a6771b | ||
|
|
39539887ea | ||
|
|
e94d2cd9d1 | ||
|
|
c3f4d17e05 | ||
|
|
021bfcd3c6 | ||
|
|
49822e23a0 | ||
|
|
46a414dc12 | ||
|
|
f832d8a143 | ||
|
|
b54d32b40d | ||
|
|
681334540d | ||
|
|
99edcfb29e | ||
|
|
2d24a3a787 | ||
|
|
e63c8ee3dc | ||
|
|
36c728774e | ||
|
|
4c0d4c3b78 | ||
|
|
ca0e774894 | ||
|
|
697037fe9b | ||
|
|
3ff02c27d5 | ||
|
|
70f05ac34e | ||
|
|
13a5695b7c | ||
|
|
c3c7f861ae | ||
|
|
f39748ae8e | ||
|
|
aa24509041 | ||
|
|
aa5590b66f | ||
|
|
48abe7bfab | ||
|
|
547b4cb25e | ||
|
|
97d80fc391 | ||
|
|
6bdd1377af | ||
|
|
356a0d9f31 | ||
|
|
1eaeb58e3c | ||
|
|
79fa88f3ed | ||
|
|
cea655a224 | ||
|
|
a56bd92289 | ||
|
|
5ca2679933 | ||
|
|
17ea117743 | ||
|
|
1114257c9d | ||
|
|
d7a04603ae | ||
|
|
979bdbc70e | ||
|
|
6945979126 | ||
|
|
e4cc71aa44 | ||
|
|
10767ccb86 | ||
|
|
02b11f8e09 | ||
|
|
6c1362cf63 | ||
|
|
953e2062c0 | ||
|
|
9d9e283790 | ||
|
|
baac607c13 | ||
|
|
32877d66aa | ||
|
|
62b4ac98a4 | ||
|
|
2729af9d54 | ||
|
|
08f1080c9c | ||
|
|
fc1cfcdb12 | ||
|
|
0b8fa03b6d | ||
|
|
b9711de102 | ||
|
|
e9132ea94c | ||
|
|
5cf91d6bdc | ||
|
|
e35745bb64 | ||
|
|
2471111d35 | ||
|
|
498b8db7f5 | ||
|
|
a8bd82de46 | ||
|
|
7abf0c5886 | ||
|
|
d4326aca18 | ||
|
|
507bbe3e80 | ||
|
|
998eaaecd4 | ||
|
|
6e5923851e | ||
|
|
c26e454dfc | ||
|
|
ea66bc8804 | ||
|
|
db01a2ea99 | ||
|
|
bda6c8aece | ||
|
|
a3d991bd0d | ||
|
|
a6ab4bf978 | ||
|
|
5a8c51cd5e | ||
|
|
04a85b3b36 | ||
|
|
d716b12671 | ||
|
|
56b86bf0cd | ||
|
|
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 | ||
|
|
5cfbab3d82 | ||
|
|
cbd8a35c6d | ||
|
|
074cff0d28 | ||
|
|
028ab6b598 | ||
|
|
63e73c9a8e | ||
|
|
cd0a9de68b | ||
|
|
2d1a537d87 | ||
|
|
3f85ce2785 | ||
|
|
3c74e32a98 | ||
|
|
cf56e11019 | ||
|
|
198ea9e294 | ||
|
|
b2daeb8e0f | ||
|
|
bf9e3b38f7 | ||
|
|
a2d18bb7d3 | ||
|
|
cd37d9e6e5 | ||
|
|
ec4c544bed | ||
|
|
b98fff1d6a | ||
|
|
5653fc335a | ||
|
|
f6e20fc6ca | ||
|
|
f4863a7aec | ||
|
|
ba56f62576 | ||
|
|
a6cccaea5a |
103
CREDITS
103
CREDITS
@@ -28,16 +28,29 @@ D: ERIC Support
|
||||
|
||||
N: Pantelis Antoniou
|
||||
E: panto@intracom.gr
|
||||
D: NETVIA board support, ARTOS support.
|
||||
D: NETVIA & NETPHONE board support, ARTOS support.
|
||||
|
||||
N: Pierre Aubert
|
||||
E: <p.aubert@staubli.com>
|
||||
D: Support for RPXClassic board
|
||||
|
||||
N: Yuli Barcohen
|
||||
E: yuli@arabellasw.com
|
||||
D: Unified support for Motorola MPC826xADS/MPC8272ADS/PQ2FADS boards.
|
||||
D: Support for Zephyr Engineering ZPC.1900 board.
|
||||
D: Support for Interphase iSPAN boards.
|
||||
D: Support for Analogue&Micro Adder boards.
|
||||
W: http://www.arabellasw.com
|
||||
|
||||
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
|
||||
@@ -62,6 +75,12 @@ N: Oliver Brown
|
||||
E: obrown@adventnetworks.com
|
||||
D: Port to the gw8260 board
|
||||
|
||||
N: Curt Brune
|
||||
E: curt@cucy.com
|
||||
D: Added support for Samsung S3C4510B CPU (ARM7tdmi based SoC)
|
||||
D: Added support for ESPD-Inc. EVB4510 Board
|
||||
W: http://www.cucy.com
|
||||
|
||||
N: Jonathan De Bruyne
|
||||
E: jonathan.debruyne@siemens.atea.be
|
||||
D: Port to Siemens IAD210 board
|
||||
@@ -78,6 +97,10 @@ N: Magnus Damm
|
||||
E: damm@opensource.se
|
||||
D: 8xxrom
|
||||
|
||||
N: George G. Davis
|
||||
E: gdavis@mvista.com
|
||||
D: Board ports for ADS GraphicsClient+ and Intel Assabet
|
||||
|
||||
N: Arun Dharankar
|
||||
E: ADharankar@ATTBI.Com
|
||||
D: threads / scheduler example code
|
||||
@@ -103,6 +126,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
|
||||
@@ -178,6 +206,15 @@ N: Yoo. Jonghoon
|
||||
E: yooth@ipone.co.kr
|
||||
D: Added port to the RPXlite board
|
||||
|
||||
N: Mark Jonas
|
||||
E: mark.jonas@freescale.com
|
||||
D: Support for Freescale Total5200 platform
|
||||
W: http://www.mobilegt.com/
|
||||
|
||||
N: Sam Song
|
||||
E: samsongshu@yahoo.com.cn
|
||||
D: Port to the RPXlite_DW board
|
||||
|
||||
N: Brad Kemp
|
||||
E: Brad.Kemp@seranoa.com
|
||||
D: Port to Windriver ppmc8260 board
|
||||
@@ -199,6 +236,10 @@ N: Bernhard Kuhn
|
||||
E: bkuhn@metrowerks.com
|
||||
D Support for Coldfire CPU; Support for Motorola M5272C3 and M5282EVB boards
|
||||
|
||||
N: Prakash Kumar
|
||||
E: prakash@embedx.com
|
||||
D Support for Intrinsyc CERF PXA250 board.
|
||||
|
||||
N: Thomas Lange
|
||||
E: thomas@corelatus.se
|
||||
D: Support for GTH and dbau1x00 boards; lots of PCMCIA fixes
|
||||
@@ -211,6 +252,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
|
||||
@@ -221,6 +263,11 @@ N: Dan Malek
|
||||
E: dan@netx4.com
|
||||
D: FADSROM, the grandfather of all of this
|
||||
|
||||
N: Andrea "llandre" Marson
|
||||
E: andrea.marson@dave-tech.it
|
||||
D: Port to PPChameleonEVB board
|
||||
W: www.dave-tech.it
|
||||
|
||||
N: Reinhard Meyer
|
||||
E: r.meyer@emk-elektronik.de
|
||||
D: Port to EMK TOP860 Module
|
||||
@@ -246,6 +293,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 & CSB472 boards
|
||||
|
||||
N: Keith Outwater
|
||||
E: keith_outwater@mvis.com
|
||||
D: Support for generic/custom MPC860T boards (GEN860T, GEN860T_SC)
|
||||
@@ -260,10 +311,20 @@ D: Support for 4xx SCSI, floppy, CDROM, CT69000 video, ...
|
||||
D: Support for PIP405 board
|
||||
D: Support for MIP405 board
|
||||
|
||||
N: Dave Peverley
|
||||
E: dpeverley@mpc-data.co.uk
|
||||
W: http://www.mpc-data.co.uk
|
||||
D: OMAP730 P2 board support
|
||||
|
||||
N: Bill Pitts
|
||||
E: wlp@mindspring.com
|
||||
D: BedBug embedded debugger code
|
||||
|
||||
N: Daniel Poirot
|
||||
E: dan.poirot@windriver.com
|
||||
D: Support for the sbc8240 board
|
||||
W: http://www.windriver.com
|
||||
|
||||
N: Stefan Roese
|
||||
E: stefan.roese@esd-electronics.com
|
||||
D: IBM PPC401/403/405GP Support; Windows environment support
|
||||
@@ -272,10 +333,18 @@ N: Erwin Rol
|
||||
E: erwin@muffin.org
|
||||
D: boot support for RTEMS
|
||||
|
||||
N: Paul Ruhland
|
||||
E: pruhland@rochester.rr.com
|
||||
D: Port to Logic Zoom LH7A40x SDK board(s)
|
||||
|
||||
N: Neil Russell
|
||||
E: caret@c-side.com
|
||||
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. IBM 440gx Ref Platform (Ocotea)
|
||||
|
||||
N: Paolo Scaffardi
|
||||
E: arsenio@tin.it
|
||||
D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots more
|
||||
@@ -284,6 +353,19 @@ N: Robert Schwebel
|
||||
E: r.schwebel@pengutronix.de
|
||||
D: Support for csb226, logodl and innokom boards (PXA2xx)
|
||||
|
||||
N: Yasushi Shoji
|
||||
E: yashi@atmark-techno.com
|
||||
D: Support for Xilinx MicroBlaze, for Atmark Techno SUZAKU FPGA board
|
||||
|
||||
N: Kurt Stremerch
|
||||
E: kurt@exys.be
|
||||
D: Support for Exys XSEngine board
|
||||
|
||||
N: Andrea Scian
|
||||
E: andrea.scian@dave-tech.it
|
||||
D: Port to B2 board
|
||||
W: www.dave-tech.it
|
||||
|
||||
N: Rob Taylor
|
||||
E: robt@flyingpig.com
|
||||
D: Port to MBX860T and Sandpoint8240
|
||||
@@ -304,13 +386,22 @@ N: David Updegraff
|
||||
E: dave@cray.com
|
||||
D: Port to Cray L1 board; DHCP vendor extensions
|
||||
|
||||
N: Christian Vejlbo
|
||||
E: christian.vejlbo@tellabs.com
|
||||
D: FADS860T ethernet support
|
||||
|
||||
N: Martin Winistoerfer
|
||||
E: martinwinistoerfer@gmx.ch
|
||||
D: Port to MPC555/556 microcontrollers and support for cmi board
|
||||
|
||||
N: Christian Vejlbo
|
||||
E: christian.vejlbo@tellabs.com
|
||||
D: FADS860T ethernet support
|
||||
N: Ming-Len Wu
|
||||
E: minglen_wu@techware.com.tw
|
||||
D: Motorola MX1ADS board support
|
||||
W: http://www.techware.com.tw/
|
||||
|
||||
N: Xianghua Xiao
|
||||
E: x.xiao@motorola.com
|
||||
D: Support for Motorola 85xx(PowerQUICC III) chip, MPC8540ADS and MPC8560ADS boards.
|
||||
|
||||
N: John Zhan
|
||||
E: zhanz@sinovee.com
|
||||
@@ -320,7 +411,3 @@ N: Alex Zuepke
|
||||
E: azu@sysgo.de
|
||||
D: Overall improvements on StrongARM, ARM720TDMI; Support for Tuxscreen; initial PCMCIA support for ARM
|
||||
W: www.elinos.com
|
||||
|
||||
N: Xianghua Xiao
|
||||
E: x.xiao@motorola.com
|
||||
D: Support for Motorola 85xx(PowerQUICC III) chip, MPC8540ADS and MPC8560ADS boards.
|
||||
|
||||
89
MAINTAINERS
89
MAINTAINERS
@@ -27,6 +27,9 @@ Pantelis Antoniou <panto@intracom.gr>
|
||||
|
||||
Yuli Barcohen <yuli@arabellasw.com>
|
||||
|
||||
Adder MPC87x/MPC852T
|
||||
ISPAN MPC8260
|
||||
MPC8260ADS MPC826x/MPC827x/MPC8280
|
||||
ZPC1900 MPC8265
|
||||
|
||||
Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
|
||||
@@ -49,15 +52,20 @@ K
|
||||
|
||||
FLAGADM MPC823
|
||||
|
||||
Torsten Demke <torsten.demke@fci.com>
|
||||
|
||||
eXalion MPC824x
|
||||
|
||||
Wolfgang Denk <wd@denx.de>
|
||||
|
||||
IceCube_5100 MGT5100
|
||||
IceCube_5200 MPC5200
|
||||
|
||||
AMX860 MPC860
|
||||
ETX094 MPC850
|
||||
FPS850L MPC850
|
||||
FPS860L MPC860
|
||||
ICU862 MPC862
|
||||
IceCube_5100 MGT5100
|
||||
IceCube_5200 MPC5200
|
||||
IP860 MPC860
|
||||
IVML24 MPC860
|
||||
IVML24_128 MPC860
|
||||
@@ -67,6 +75,7 @@ Wolfgang Denk <wd@denx.de>
|
||||
IVMS8_256 MPC860
|
||||
LANTEC MPC850
|
||||
LWMON MPC823
|
||||
NC650 MPC852
|
||||
R360MPI MPC823
|
||||
RMU MPC850
|
||||
RRvision MPC823
|
||||
@@ -93,7 +102,6 @@ Wolfgang Denk <wd@denx.de>
|
||||
TQM8255 MPC8255
|
||||
|
||||
CPU86 MPC8260
|
||||
PM825 MPC8250
|
||||
PM826 MPC8260
|
||||
TQM8260 MPC8260
|
||||
|
||||
@@ -142,6 +150,7 @@ Bill Hargen <Bill_Hargen@Jabil.com>
|
||||
Klaus Heydeck <heydeck@kieback-peter.de>
|
||||
|
||||
KUP4K MPC855
|
||||
KUP4X MPC859
|
||||
|
||||
Murray Jensen <Murray.Jensen@cmst.csiro.au>
|
||||
|
||||
@@ -158,10 +167,6 @@ Sangmoon Kim <dogoil@etinsys.com>
|
||||
|
||||
debris MPC8245
|
||||
|
||||
Raghu Krishnaprasad <raghu.krishnaprasad@fci.com>
|
||||
|
||||
ADDERII MPC852T
|
||||
|
||||
Nye Liu <nyet@zumanetworks.com>
|
||||
|
||||
ZUMA MPC7xx_74xx
|
||||
@@ -178,6 +183,10 @@ Eran Man <eran@nbase.co.il>
|
||||
|
||||
EVB64260_750CX MPC750CX
|
||||
|
||||
Andrea "llandre" Marson <andrea.marson@dave-tech.it>
|
||||
|
||||
PPChameleonEVB PPC405EP
|
||||
|
||||
Reinhard Meyer <r.meyer@emk-elektronik.de>
|
||||
|
||||
TOP860 MPC860T
|
||||
@@ -187,6 +196,10 @@ Scott McNutt <smcnutt@artesyncp.com>
|
||||
|
||||
EBONY PPC440GP
|
||||
|
||||
Tolunay Orkun <torkun@nextio.com>
|
||||
csb272 PPC405GP
|
||||
csb472 PPC405GP
|
||||
|
||||
Keith Outwater <Keith_Outwater@mvis.com>
|
||||
|
||||
GEN860T MPC860T
|
||||
@@ -223,6 +236,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
|
||||
@@ -241,15 +259,28 @@ Rune Torgersen <runet@innovsys.com>
|
||||
|
||||
MPC8266ADS MPC8266
|
||||
|
||||
Josef Wagner <Wagner@Microsys.de>
|
||||
|
||||
CPC45 MPC8245
|
||||
PM520 MPC5200
|
||||
|
||||
Stephen Williams <steve@icarus.com>
|
||||
|
||||
JSE PPC405GPr
|
||||
|
||||
John Zhan <zhanz@sinovee.com>
|
||||
|
||||
svm_sc8xx MPC8xx
|
||||
|
||||
Xianghua Xiao <x.xiao@motorola.com>
|
||||
Jon Loeliger <jdl@freescale.com>
|
||||
|
||||
MPC8540ADS MPC8540
|
||||
MPC8560ADS MPC8560
|
||||
|
||||
Dan Malek <dan@embeddededge.com>
|
||||
|
||||
STxGP3 MPC85xx
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Unknown / orphaned boards:
|
||||
@@ -272,7 +303,6 @@ Unknown / orphaned boards:
|
||||
|
||||
MOUSSE MPC824x
|
||||
|
||||
MPC8260ADS MPC8260
|
||||
RPXsuper MPC8260
|
||||
rsdproto MPC8260
|
||||
|
||||
@@ -286,6 +316,15 @@ Unknown / orphaned boards:
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
George G. Davis <gdavis@mvista.com>
|
||||
|
||||
assabet SA1100
|
||||
gcplus SA1100
|
||||
|
||||
Thomas Elste <info@elste.org>
|
||||
|
||||
modnet50 ARM720T (NET+50)
|
||||
|
||||
Peter Figuli <peposh@etc.sk>
|
||||
|
||||
wepep250 xscale
|
||||
@@ -306,10 +345,26 @@ Gary Jennejohn <gj@denx.de>
|
||||
smdk2400 ARM920T
|
||||
trab ARM920T
|
||||
|
||||
Prakash Kumar <prakash@embedx.com>
|
||||
|
||||
cerf250 xscale
|
||||
|
||||
Kshitij Gupta <kshitij@ti.com>
|
||||
|
||||
omap1510inn ARM925T
|
||||
omap1610inn ARM926EJS
|
||||
|
||||
Dave Peverley <dpeverley@mpc-data.co.uk>
|
||||
omap730p2 ARM926EJS
|
||||
|
||||
Nishant Kamat <nskamat@ti.com>
|
||||
|
||||
omap1610h2 ARM926EJS
|
||||
|
||||
Rishi Bhattacharya <rishi@ti.com>
|
||||
|
||||
omap5912osk ARM926EJS
|
||||
|
||||
David Müller <d.mueller@elsoft.ch>
|
||||
|
||||
smdk2410 ARM920T
|
||||
@@ -324,6 +379,10 @@ Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
csb226 xscale
|
||||
innokom xscale
|
||||
|
||||
Andrea Scian <andrea.scian@dave-tech.it>
|
||||
|
||||
B2 ARM7TDMI (S3C44B0X)
|
||||
|
||||
Alex Züpke <azu@sysgo.de>
|
||||
|
||||
lart SA1100
|
||||
@@ -365,11 +424,23 @@ Thomas Lange <thomas@corelatus.se>
|
||||
Stephan Linz <linz@li-pro.net>
|
||||
|
||||
DK1S10 Nios-32
|
||||
ADNPESC1 Nios-32
|
||||
|
||||
Scott McNutt <smcnutt@psyent.com>
|
||||
|
||||
DK1C20 Nios-32
|
||||
|
||||
#########################################################################
|
||||
# MicroBlaze Systems: #
|
||||
# #
|
||||
# Maintainer Name, Email Address #
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
Yasushi Shoji <yashi@atmark-techno.com>
|
||||
|
||||
SUZAKU MicroBlaze
|
||||
|
||||
#########################################################################
|
||||
# End of MAINTAINERS list #
|
||||
#########################################################################
|
||||
|
||||
93
MAKEALL
93
MAKEALL
@@ -25,7 +25,8 @@ LIST_5xx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_5xxx=" \
|
||||
IceCube_5100 IceCube_5200 EVAL5200 \
|
||||
icecube_5100 icecube_5200 EVAL5200 PM520 \
|
||||
Total5100 Total5200 Total5200_Rev2 TQM5200_AA \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -33,22 +34,23 @@ LIST_5xxx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_8xx=" \
|
||||
AdderII ADS860 AMX860 c2mon \
|
||||
CCM cogent_mpc8xx DUET_ADS ESTEEM192E \
|
||||
ETX094 ELPT860 FADS823 FADS850SAR \
|
||||
FADS860T FLAGADM FPS850L GEN860T \
|
||||
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 \
|
||||
Adder87x GENIETV MBX860T RBC823 \
|
||||
AdderII GTH MHPC rmu \
|
||||
ADS860 hermes MPC86xADS RPXClassic \
|
||||
AMX860 IAD210 MPC885ADS RPXlite \
|
||||
c2mon ICU862_100MHz MVS1 RPXlite_DW \
|
||||
CCM IP860 NETPHONE RRvision \
|
||||
cogent_mpc8xx IVML24 NETTA SM850 \
|
||||
ELPT860 IVML24_128 NETTA2 SPD823TS \
|
||||
ESTEEM192E IVML24_256 NETTA_ISDN svm_sc8xx \
|
||||
ETX094 IVMS8 NETVIA SXNI855T \
|
||||
FADS823 IVMS8_128 NETVIA_V2 TOP860 \
|
||||
FADS850SAR IVMS8_256 NX823 TQM823L \
|
||||
FADS860T KUP4K pcu_e TQM823L_LCD \
|
||||
FLAGADM KUP4X QS823 TQM850L \
|
||||
FPS850L LANTEC QS850 TQM855L \
|
||||
GEN860T lwmon QS860T TQM860L \
|
||||
GEN860T_SC MBX R360MPI v37 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -56,14 +58,16 @@ LIST_8xx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_4xx=" \
|
||||
ADCIOP AR405 ASH405 BUBINGA405EP \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 DASA_SIM \
|
||||
DP405 DU405 EBONY ERIC \
|
||||
EXBITGEN HUB405 MIP405 MIP405T \
|
||||
ML2 OCRTC ORSG PCI405 \
|
||||
PIP405 PLU405 PMC405 PPChameleonEVB \
|
||||
VOH405 W7OLMC W7OLMG WALNUT405 \
|
||||
ADCIOP AR405 ASH405 BUBINGA405EP \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 csb272 \
|
||||
csb472 DASA_SIM DP405 DU405 \
|
||||
EBONY ERIC EXBITGEN HUB405 \
|
||||
JSE MIP405 MIP405T ML2 \
|
||||
ml300 OCOTEA OCRTC ORSG \
|
||||
PCI405 PIP405 PLU405 PMC405 \
|
||||
PPChameleonEVB VOH405 W7OLMC W7OLMG \
|
||||
WALNUT405 XPEDITE1K \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -71,10 +75,10 @@ LIST_4xx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
debris MOUSSE MUSENKI MVBLUE \
|
||||
OXC PN62 Sandpoint8240 Sandpoint8245 \
|
||||
SL8245 utx8245 \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
debris eXalion MOUSSE MUSENKI \
|
||||
MVBLUE OXC PN62 Sandpoint8240 \
|
||||
Sandpoint8245 SL8245 utx8245 sbc8240 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -83,8 +87,9 @@ LIST_824x=" \
|
||||
|
||||
LIST_8260=" \
|
||||
atc cogent_mpc8260 CPU86 ep8260 \
|
||||
gw8260 hymod IPHASE4539 MPC8260ADS \
|
||||
MPC8266ADS PM826 ppmc8260 RPXsuper \
|
||||
gw8260 hymod IPHASE4539 ISPAN \
|
||||
MPC8260ADS MPC8266ADS MPC8272ADS PM826 \
|
||||
PM828 ppmc8260 PQ2FADS RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE ZPC1900 \
|
||||
"
|
||||
@@ -94,7 +99,7 @@ LIST_8260=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_85xx=" \
|
||||
MPC8540ADS MPC8560ADS \
|
||||
MPC8540ADS MPC8560ADS sbc8560 stxgp3 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -121,29 +126,30 @@ LIST_ppc="${LIST_5xx} ${LIST_5xxx} \
|
||||
## StrongARM Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_SA="dnp1110 lart shannon"
|
||||
LIST_SA="assabet dnp1110 gcplus lart shannon"
|
||||
|
||||
#########################################################################
|
||||
## ARM7 Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_ARM7="ep7312 impa7"
|
||||
LIST_ARM7="B2 ep7312 evb4510 impa7 modnet50"
|
||||
|
||||
#########################################################################
|
||||
## ARM9 Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_ARM9=" \
|
||||
at91rm9200dk omap1510inn omap1610inn \
|
||||
smdk2400 smdk2410 trab \
|
||||
VCMA9 \
|
||||
at91rm9200dk integratorcp integratorap lpd7a400 \
|
||||
mx1ads mx1fs2 omap1510inn omap1610h2 \
|
||||
omap1610inn omap730p2 scb9328 smdk2400 \
|
||||
smdk2410 trab VCMA9 versatile \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## Xscale Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_pxa="cradle csb226 innokom lubbock wepep250"
|
||||
LIST_pxa="cerf250 cradle csb226 innokom lubbock wepep250 xm250 xsengine"
|
||||
|
||||
LIST_ixp="ixdp425"
|
||||
|
||||
@@ -175,10 +181,18 @@ LIST_x86="${LIST_I486}"
|
||||
#########################################################################
|
||||
|
||||
LIST_nios=" \
|
||||
ADNPESC1 ADNPESC1_base_32 \
|
||||
ADNPESC1_DNPEVA2_base_32 \
|
||||
DK1C20 DK1C20_standard_32 \
|
||||
DK1S10 DK1S10_standard_32 \
|
||||
DK1S10 DK1S10_standard_32 DK1S10_mtx_ldk_20 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MicroBlaze Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_microblaze="suzaku"
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
#----- for now, just run PPC by default -----
|
||||
@@ -203,6 +217,7 @@ do
|
||||
case "$arg" in
|
||||
ppc|5xx|5xxx|8xx|824x|8260|85xx|4xx|7xx|74xx| \
|
||||
arm|SA|ARM7|ARM9|pxa|ixp| \
|
||||
microblaze| \
|
||||
mips| \
|
||||
nios| \
|
||||
x86|I486)
|
||||
|
||||
650
Makefile
650
Makefile
@@ -75,6 +75,9 @@ endif
|
||||
ifeq ($(ARCH),m68k)
|
||||
CROSS_COMPILE = m68k-elf-
|
||||
endif
|
||||
ifeq ($(ARCH),microblaze)
|
||||
CROSS_COMPILE = mb-
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -99,7 +102,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 +115,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)
|
||||
@@ -164,10 +169,16 @@ depend dep:
|
||||
|
||||
tags:
|
||||
ctags -w `find $(SUBDIRS) include \
|
||||
lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
|
||||
fs/cramfs fs/fat fs/fdos fs/jffs2 \
|
||||
net disk rtc dtt drivers drivers/sk98lin common \
|
||||
\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
|
||||
|
||||
etags:
|
||||
etags -a `find $(SUBDIRS) include \
|
||||
lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
|
||||
fs/cramfs fs/fat fs/fdos fs/jffs2 \
|
||||
net disk rtc dtt drivers drivers/sk98lin common \
|
||||
\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
|
||||
|
||||
System.map: u-boot
|
||||
@@ -185,7 +196,7 @@ endif
|
||||
#########################################################################
|
||||
|
||||
unconfig:
|
||||
rm -f include/config.h include/config.mk
|
||||
@rm -f include/config.h include/config.mk board/*/config.tmp
|
||||
|
||||
#========================================================================
|
||||
# PowerPC
|
||||
@@ -198,29 +209,34 @@ unconfig:
|
||||
cmi_mpc5xx_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc5xx cmi
|
||||
|
||||
PATI_config:unconfig
|
||||
PATI_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc5xx pati mpl
|
||||
|
||||
#########################################################################
|
||||
## MPC5xxx Systems
|
||||
#########################################################################
|
||||
MPC5200LITE_config \
|
||||
MPC5200LITE_LOWBOOT_config \
|
||||
MPC5200LITE_LOWBOOT08_config \
|
||||
icecube_5200_DDR_LOWBOOT_config \
|
||||
icecube_5200_DDR_config \
|
||||
IceCube_5200_DDR_config \
|
||||
icecube_5200_config \
|
||||
IceCube_5200_config \
|
||||
IceCube_5100_config: unconfig
|
||||
Lite5200_config \
|
||||
Lite5200_LOWBOOT_config \
|
||||
Lite5200_LOWBOOT08_config \
|
||||
icecube_5200_config \
|
||||
icecube_5200_LOWBOOT_config \
|
||||
icecube_5200_LOWBOOT08_config \
|
||||
icecube_5200_DDR_config \
|
||||
icecube_5200_DDR_LOWBOOT_config \
|
||||
icecube_5200_DDR_LOWBOOT08_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 ; \
|
||||
@@ -236,33 +252,104 @@ IceCube_5100_config: unconfig
|
||||
}
|
||||
@./mkconfig -a IceCube ppc mpc5xxx icecube
|
||||
|
||||
PM520_config \
|
||||
PM520_DDR_config \
|
||||
PM520_ROMBOOT_config \
|
||||
PM520_ROMBOOT_DDR_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring DDR,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC5200_DDR" >>include/config.h ; \
|
||||
echo "... DDR memory revision" ; \
|
||||
}
|
||||
@[ -z "$(findstring ROMBOOT,$@)" ] || \
|
||||
{ echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
|
||||
echo "... booting from 8-bit flash" ; \
|
||||
}
|
||||
@./mkconfig -a PM520 ppc mpc5xxx pm520
|
||||
|
||||
MINI5200_config \
|
||||
EVAL5200_config \
|
||||
TOP5200_config: unconfig
|
||||
@ echo "#define CONFIG_$(@:_config=) 1" >include/config.h
|
||||
@./mkconfig -a TOP5200 ppc mpc5xxx top5200 emk
|
||||
|
||||
Total5100_config \
|
||||
Total5200_config \
|
||||
Total5200_lowboot_config \
|
||||
Total5200_Rev2_config \
|
||||
Total5200_Rev2_lowboot_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring 5100,$@)" ] || \
|
||||
{ echo "#define CONFIG_MGT5100" >>include/config.h ; \
|
||||
echo "... with MGT5100 processor" ; \
|
||||
}
|
||||
@[ -z "$(findstring 5200,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC5200" >>include/config.h ; \
|
||||
echo "... with MPC5200 processor" ; \
|
||||
}
|
||||
@[ -n "$(findstring Rev,$@)" ] || \
|
||||
{ echo "#define CONFIG_TOTAL5200_REV 1" >>include/config.h ; \
|
||||
echo "... revision 1 board" ; \
|
||||
}
|
||||
@[ -z "$(findstring Rev2_,$@)" ] || \
|
||||
{ echo "#define CONFIG_TOTAL5200_REV 2" >>include/config.h ; \
|
||||
echo "... revision 2 board" ; \
|
||||
}
|
||||
@[ -z "$(findstring lowboot_,$@)" ] || \
|
||||
{ echo "TEXT_BASE = 0xFE000000" >board/total5200/config.tmp ; \
|
||||
echo "... with lowboot configuration" ; \
|
||||
}
|
||||
@./mkconfig -a Total5200 ppc mpc5xxx total5200
|
||||
|
||||
TQM5200_AA_config \
|
||||
TQM5200_AB_config \
|
||||
TQM5200_AC_config \
|
||||
MiniFAP_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring MiniFAP,$@)" ] || \
|
||||
{ echo "#define CONFIG_MINIFAP" >>include/config.h ; \
|
||||
echo "#define CONFIG_TQM5200_AC" >>include/config.h ; \
|
||||
echo "... TQM5200_AC on MiniFAP" ; \
|
||||
}
|
||||
@[ -z "$(findstring AA,$@)" ] || \
|
||||
{ echo "#define CONFIG_TQM5200_AA" >>include/config.h ; \
|
||||
echo "... with 4 MB Flash, 16 MB SDRAM, 32 kB EEPROM" ; \
|
||||
}
|
||||
@[ -z "$(findstring AB,$@)" ] || \
|
||||
{ echo "#define CONFIG_TQM5200_AB" >>include/config.h ; \
|
||||
echo "... with 64 MB Flash, 64 MB SDRAM, 32 kB EEPROM, 512 kB SRAM" ; \
|
||||
echo "... with Graphics Controller"; \
|
||||
}
|
||||
@[ -z "$(findstring AC,$@)" ] || \
|
||||
{ echo "#define CONFIG_TQM5200_AC" >>include/config.h ; \
|
||||
echo "... with 4 MB Flash, 128 MB SDRAM" ; \
|
||||
echo "... with Graphics Controller"; \
|
||||
}
|
||||
@./mkconfig -a TQM5200 ppc mpc5xxx tqm5200
|
||||
|
||||
#########################################################################
|
||||
## MPC8xx Systems
|
||||
#########################################################################
|
||||
|
||||
AdderII_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx adderII
|
||||
Adder_config \
|
||||
Adder87x_config \
|
||||
AdderII_config \
|
||||
: unconfig
|
||||
$(if $(findstring AdderII,$@), \
|
||||
@echo "#define CONFIG_MPC852T" > include/config.h)
|
||||
@./mkconfig -a Adder ppc mpc8xx adder
|
||||
|
||||
ADS860_config \
|
||||
DUET_ADS_config \
|
||||
FADS823_config \
|
||||
FADS850SAR_config \
|
||||
MPC86xADS_config \
|
||||
MPC885ADS_config \
|
||||
FADS860T_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx fads
|
||||
|
||||
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 +391,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 +442,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
|
||||
@@ -385,6 +478,66 @@ NETVIA_config: unconfig
|
||||
}
|
||||
@./mkconfig -a $(call xtract_NETVIA,$@) ppc mpc8xx netvia
|
||||
|
||||
xtract_NETPHONE = $(subst _V2,,$(subst _config,,$1))
|
||||
|
||||
NETPHONE_V2_config \
|
||||
NETPHONE_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring NETPHONE_config,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETPHONE_VERSION 1" >>include/config.h ; \
|
||||
}
|
||||
@[ -z "$(findstring NETPHONE_V2_config,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETPHONE_VERSION 2" >>include/config.h ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_NETPHONE,$@) ppc mpc8xx netphone
|
||||
|
||||
xtract_NETTA = $(subst _SWAPHOOK,,$(subst _6412,,$(subst _ISDN,,$(subst _config,,$1))))
|
||||
|
||||
NETTA_ISDN_6412_SWAPHOOK_config \
|
||||
NETTA_ISDN_SWAPHOOK_config \
|
||||
NETTA_6412_SWAPHOOK_config \
|
||||
NETTA_SWAPHOOK_config \
|
||||
NETTA_ISDN_6412_config \
|
||||
NETTA_ISDN_config \
|
||||
NETTA_6412_config \
|
||||
NETTA_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring ISDN_,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETTA_ISDN 1" >>include/config.h ; \
|
||||
}
|
||||
@[ -n "$(findstring ISDN_,$@)" ] || \
|
||||
{ echo "#undef CONFIG_NETTA_ISDN" >>include/config.h ; \
|
||||
}
|
||||
@[ -z "$(findstring 6412_,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETTA_6412 1" >>include/config.h ; \
|
||||
}
|
||||
@[ -n "$(findstring 6412_,$@)" ] || \
|
||||
{ echo "#undef CONFIG_NETTA_6412" >>include/config.h ; \
|
||||
}
|
||||
@[ -z "$(findstring SWAPHOOK_,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETTA_SWAPHOOK 1" >>include/config.h ; \
|
||||
}
|
||||
@[ -n "$(findstring SWAPHOOK_,$@)" ] || \
|
||||
{ echo "#undef CONFIG_NETTA_SWAPHOOK" >>include/config.h ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_NETTA,$@) ppc mpc8xx netta
|
||||
|
||||
xtract_NETTA2 = $(subst _V2,,$(subst _config,,$1))
|
||||
|
||||
NETTA2_V2_config \
|
||||
NETTA2_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring NETTA2_config,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETTA2_VERSION 1" >>include/config.h ; \
|
||||
}
|
||||
@[ -z "$(findstring NETTA2_V2_config,$@)" ] || \
|
||||
{ echo "#define CONFIG_NETTA2_VERSION 2" >>include/config.h ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_NETTA2,$@) ppc mpc8xx netta2
|
||||
|
||||
NC650_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx nc650
|
||||
|
||||
NX823_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx nx823
|
||||
|
||||
@@ -412,6 +565,30 @@ RPXClassic_config: unconfig
|
||||
RPXlite_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx RPXlite
|
||||
|
||||
RPXlite_DW_64_config \
|
||||
RPXlite_DW_LCD_config \
|
||||
RPXlite_DW_64_LCD_config \
|
||||
RPXlite_DW_NVRAM_config \
|
||||
RPXlite_DW_NVRAM_64_config \
|
||||
RPXlite_DW_NVRAM_LCD_config \
|
||||
RPXlite_DW_NVRAM_64_LCD_config \
|
||||
RPXlite_DW_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _64,$@)" ] || \
|
||||
{ echo "#define RPXlite_64MHz" >>include/config.h ; \
|
||||
echo "... with 64MHz system clock ..."; \
|
||||
}
|
||||
@[ -z "$(findstring _LCD,$@)" ] || \
|
||||
{ echo "#define CONFIG_LCD" >>include/config.h ; \
|
||||
echo "#define CONFIG_NEC_NL6448BC20" >>include/config.h ; \
|
||||
echo "... with LCD display ..."; \
|
||||
}
|
||||
@[ -z "$(findstring _NVRAM,$@)" ] || \
|
||||
{ echo "#define CFG_ENV_IS_IN_NVRAM" >>include/config.h ; \
|
||||
echo "... with ENV in NVRAM ..."; \
|
||||
}
|
||||
@./mkconfig -a RPXlite_DW ppc mpc8xx RPXlite_dw
|
||||
|
||||
rmu_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx rmu
|
||||
|
||||
@@ -441,66 +618,26 @@ TOP860_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx top860 emk
|
||||
|
||||
# Play some tricks for configuration selection
|
||||
# All boards can come with 50 MHz (default), 66MHz, 80MHz or 100 MHz clock,
|
||||
# but only 855 and 860 boards may come with FEC
|
||||
# and 823 boards may have LCD support
|
||||
xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _133MHz,,$(subst _LCD,,$(subst _config,,$1))))))
|
||||
# Only 855 and 860 boards may come with FEC
|
||||
# and only 823 boards may have LCD support
|
||||
xtract_8xx = $(subst _LCD,,$(subst _config,,$1))
|
||||
|
||||
FPS850L_config \
|
||||
FPS860L_config \
|
||||
NSCU_config \
|
||||
TQM823L_config \
|
||||
TQM823L_66MHz_config \
|
||||
TQM823L_80MHz_config \
|
||||
TQM823L_LCD_config \
|
||||
TQM823L_LCD_66MHz_config \
|
||||
TQM823L_LCD_80MHz_config \
|
||||
TQM850L_config \
|
||||
TQM850L_66MHz_config \
|
||||
TQM850L_80MHz_config \
|
||||
TQM855L_config \
|
||||
TQM855L_66MHz_config \
|
||||
TQM855L_80MHz_config \
|
||||
TQM860L_config \
|
||||
TQM860L_66MHz_config \
|
||||
TQM860L_80MHz_config \
|
||||
TQM862L_config \
|
||||
TQM862L_66MHz_config \
|
||||
TQM862L_80MHz_config \
|
||||
TQM823M_config \
|
||||
TQM823M_66MHz_config \
|
||||
TQM823M_80MHz_config \
|
||||
TQM850M_config \
|
||||
TQM850M_66MHz_config \
|
||||
TQM850M_80MHz_config \
|
||||
TQM855M_config \
|
||||
TQM855M_66MHz_config \
|
||||
TQM855M_80MHz_config \
|
||||
TQM860M_config \
|
||||
TQM860M_66MHz_config \
|
||||
TQM860M_80MHz_config \
|
||||
TQM862M_config \
|
||||
TQM862M_66MHz_config \
|
||||
TQM862M_80MHz_config \
|
||||
TQM862M_100MHz_config \
|
||||
TQM866M_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _66MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_66MHz" >>include/config.h ; \
|
||||
echo "... with 66MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _80MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_80MHz" >>include/config.h ; \
|
||||
echo "... with 80MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _100MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_100MHz" >>include/config.h ; \
|
||||
echo "... with 100MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _133MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_133MHz" >>include/config.h ; \
|
||||
echo "... with 133MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _LCD,$@)" ] || \
|
||||
{ echo "#define CONFIG_LCD" >>include/config.h ; \
|
||||
echo "#define CONFIG_NEC_NL6448BC20" >>include/config.h ; \
|
||||
@@ -526,7 +663,7 @@ wtk_config: unconfig
|
||||
#########################################################################
|
||||
## PPC4xx Systems
|
||||
#########################################################################
|
||||
xtract_4xx = $(subst _MODEL_BA,,$(subst _MODEL_ME,,$(subst _MODEL_HI,,$(subst _config,,$1))))
|
||||
xtract_4xx = $(subst _25,,$(subst _33,,$(subst _BA,,$(subst _ME,,$(subst _HI,,$(subst _config,,$1))))))
|
||||
|
||||
ADCIOP_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx adciop esd
|
||||
@@ -537,12 +674,17 @@ AR405_config: unconfig
|
||||
ASH405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ash405 esd
|
||||
|
||||
BUBINGA405EP_config:unconfig
|
||||
BUBINGA405EP_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx bubinga405ep
|
||||
|
||||
CANBT_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx canbt esd
|
||||
|
||||
CATcenter_config: unconfig
|
||||
@ echo "/* CATcenter uses PPChameleon Model ME */" > include/config.h
|
||||
@ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >> include/config.h
|
||||
@./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
CPCI405_config \
|
||||
CPCI4052_config \
|
||||
CPCI405AB_config: unconfig
|
||||
@@ -555,9 +697,15 @@ CPCI440_config: unconfig
|
||||
CPCIISER4_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
|
||||
|
||||
CRAYL1_config:unconfig
|
||||
CRAYL1_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx L1 cray
|
||||
|
||||
csb272_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx csb272
|
||||
|
||||
csb472_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx csb472
|
||||
|
||||
DASA_SIM_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
|
||||
|
||||
@@ -567,29 +715,38 @@ DP405_config: unconfig
|
||||
DU405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx du405 esd
|
||||
|
||||
EBONY_config:unconfig
|
||||
EBONY_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ebony
|
||||
|
||||
ERIC_config:unconfig
|
||||
ERIC_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx eric
|
||||
|
||||
EXBITGEN_config:unconfig
|
||||
EXBITGEN_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx exbitgen
|
||||
|
||||
HUB405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx hub405 esd
|
||||
|
||||
MIP405_config:unconfig
|
||||
JSE_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx jse
|
||||
|
||||
MIP405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
|
||||
|
||||
MIP405T_config:unconfig
|
||||
MIP405T_config: unconfig
|
||||
@echo "#define CONFIG_MIP405T" >include/config.h
|
||||
@echo "Enable subset config for MIP405T"
|
||||
@./mkconfig -a MIP405 ppc ppc4xx mip405 mpl
|
||||
|
||||
ML2_config:unconfig
|
||||
ML2_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ml2
|
||||
|
||||
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
|
||||
@@ -597,7 +754,7 @@ ORSG_config: unconfig
|
||||
PCI405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
|
||||
|
||||
PIP405_config:unconfig
|
||||
PIP405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
|
||||
|
||||
PLU405_config: unconfig
|
||||
@@ -606,10 +763,13 @@ PLU405_config: unconfig
|
||||
PMC405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
|
||||
|
||||
PPChameleonEVB_MODEL_BA_config \
|
||||
PPChameleonEVB_MODEL_ME_config \
|
||||
PPChameleonEVB_MODEL_HI_config \
|
||||
PPChameleonEVB_config: unconfig
|
||||
PPChameleonEVB_config \
|
||||
PPChameleonEVB_BA_25_config \
|
||||
PPChameleonEVB_ME_25_config \
|
||||
PPChameleonEVB_HI_25_config \
|
||||
PPChameleonEVB_BA_33_config \
|
||||
PPChameleonEVB_ME_33_config \
|
||||
PPChameleonEVB_HI_33_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _MODEL_BA,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>include/config.h ; \
|
||||
@@ -623,6 +783,14 @@ PPChameleonEVB_config: unconfig
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>include/config.h ; \
|
||||
echo "... HIGH-END model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _25,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_CLK_25" >>include/config.h ; \
|
||||
echo " SysClk = 25MHz" ; \
|
||||
}
|
||||
@[ -z "$(findstring _33,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_CLK_33" >>include/config.h ; \
|
||||
echo " SysClk = 33MHz" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
VOH405_config: unconfig
|
||||
@@ -632,13 +800,16 @@ W7OLMC_config \
|
||||
W7OLMG_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx w7o
|
||||
|
||||
WALNUT405_config:unconfig
|
||||
WALNUT405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx walnut405
|
||||
|
||||
XPEDITE1K_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx xpedite1k
|
||||
|
||||
#########################################################################
|
||||
## 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
|
||||
@@ -662,6 +833,12 @@ CPC45_ROMBOOT_config: unconfig
|
||||
CU824_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x cu824
|
||||
|
||||
debris_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x debris etin
|
||||
|
||||
eXalion_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x eXalion
|
||||
|
||||
MOUSSE_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x mousse
|
||||
|
||||
@@ -683,6 +860,9 @@ Sandpoint8240_config: unconfig
|
||||
Sandpoint8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sandpoint
|
||||
|
||||
sbc8240_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sbc8240
|
||||
|
||||
SL8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sl8245
|
||||
|
||||
@@ -724,38 +904,84 @@ hymod_config: unconfig
|
||||
IPHASE4539_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 iphase4539
|
||||
|
||||
MPC8260ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 mpc8260ads
|
||||
ISPAN_config \
|
||||
ISPAN_REVB_config: unconfig
|
||||
@if [ "$(findstring _REVB_,$@)" ] ; then \
|
||||
echo "#define CFG_REV_B" > include/config.h ; \
|
||||
fi
|
||||
@./mkconfig -a ISPAN ppc mpc8260 ispan
|
||||
|
||||
MPC8260ADS_config \
|
||||
MPC8260ADS_33MHz_config \
|
||||
MPC8260ADS_40MHz_config \
|
||||
MPC8272ADS_config \
|
||||
PQ2FADS_config \
|
||||
PQ2FADS-VR_config \
|
||||
PQ2FADS-ZU_config \
|
||||
PQ2FADS-ZU_66MHz_config \
|
||||
: unconfig
|
||||
$(if $(findstring PQ2FADS,$@), \
|
||||
@echo "#define CONFIG_ADSTYPE CFG_PQ2FADS" > include/config.h, \
|
||||
@echo "#define CONFIG_ADSTYPE CFG_"$(subst MPC,,$(word 1,$(subst _, ,$@))) > include/config.h)
|
||||
$(if $(findstring MHz,$@), \
|
||||
@echo "#define CONFIG_8260_CLKIN" $(subst MHz,,$(word 2,$(subst _, ,$@)))"000000" >> include/config.h, \
|
||||
$(if $(findstring VR,$@), \
|
||||
@echo "#define CONFIG_8260_CLKIN 66000000" >> include/config.h))
|
||||
@./mkconfig -a MPC8260ADS ppc mpc8260 mpc8260ads
|
||||
|
||||
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
|
||||
@@ -830,21 +1056,36 @@ ZPC1900_config: unconfig
|
||||
#########################################################################
|
||||
|
||||
M5272C3_config : unconfig
|
||||
@./mkconfig $(@:_config=) m68k coldfire m5272c3
|
||||
@./mkconfig $(@:_config=) m68k mcf52x2 m5272c3
|
||||
|
||||
M5282EVB_config : unconfig
|
||||
@./mkconfig $(@:_config=) m68k coldfire m5282evb
|
||||
@./mkconfig $(@:_config=) m68k mcf52x2 m5282evb
|
||||
|
||||
#########################################################################
|
||||
## MPC85xx Systems
|
||||
#########################################################################
|
||||
|
||||
MPC8540ADS_config: unconfig
|
||||
MPC8540ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8540ads
|
||||
|
||||
MPC8560ADS_config: unconfig
|
||||
MPC8560ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8560ads
|
||||
|
||||
stxgp3_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx stxgp3
|
||||
|
||||
sbc8560_config \
|
||||
sbc8560_33_config \
|
||||
sbc8560_66_config: unconfig
|
||||
@if [ "$(findstring _66_,$@)" ] ; then \
|
||||
echo "#define CONFIG_PCI_66" >>include/config.h ; \
|
||||
echo "... 66 MHz PCI" ; \
|
||||
else \
|
||||
>include/config.h ; \
|
||||
echo "... 33 MHz PCI" ; \
|
||||
fi
|
||||
@./mkconfig -a sbc8560 ppc mpc85xx sbc8560
|
||||
|
||||
#########################################################################
|
||||
## 74xx/7xx Systems
|
||||
#########################################################################
|
||||
@@ -861,9 +1102,6 @@ DB64360_config: unconfig
|
||||
DB64460_config: unconfig
|
||||
@./mkconfig DB64460 ppc 74xx_7xx db64460 Marvell
|
||||
|
||||
debris_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x debris etin
|
||||
|
||||
ELPPC_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
|
||||
|
||||
@@ -888,15 +1126,18 @@ ZUMA_config: unconfig
|
||||
## StrongARM Systems
|
||||
#########################################################################
|
||||
|
||||
at91rm9200dk_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
|
||||
|
||||
lart_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 lart
|
||||
assabet_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 assabet
|
||||
|
||||
dnp1110_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 dnp1110
|
||||
|
||||
gcplus_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 gcplus
|
||||
|
||||
lart_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 lart
|
||||
|
||||
shannon_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 shannon
|
||||
|
||||
@@ -906,11 +1147,66 @@ shannon_config : unconfig
|
||||
|
||||
xtract_trab = $(subst _bigram,,$(subst _bigflash,,$(subst _old,,$(subst _config,,$1))))
|
||||
|
||||
xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
|
||||
|
||||
xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
|
||||
|
||||
integratorcp_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorcp
|
||||
|
||||
integratorap_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorap
|
||||
|
||||
lpd7a400_config \
|
||||
lpd7a404_config: unconfig
|
||||
@./mkconfig $(@:_config=) arm lh7a40x lpd7a40x
|
||||
|
||||
mx1ads_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t mx1ads
|
||||
|
||||
mx1fs2_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t mx1fs2
|
||||
|
||||
omap1510inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t omap1510inn
|
||||
|
||||
omap1610inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs omap1610inn
|
||||
omap5912osk_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs omap5912osk
|
||||
|
||||
omap1610inn_config \
|
||||
omap1610inn_cs0boot_config \
|
||||
omap1610inn_cs3boot_config \
|
||||
omap1610inn_cs_autoboot_config \
|
||||
omap1610h2_config \
|
||||
omap1610h2_cs0boot_config \
|
||||
omap1610h2_cs3boot_config \
|
||||
omap1610h2_cs_autoboot_config: unconfig
|
||||
@if [ "$(findstring _cs0boot_, $@)" ] ; then \
|
||||
echo "#define CONFIG_CS0_BOOT" >> ./include/config.h ; \
|
||||
echo "... configured for CS0 boot"; \
|
||||
elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
|
||||
echo "#define CONFIG_CS_AUTOBOOT" >> ./include/config.h ; \
|
||||
echo "... configured for CS_AUTO boot"; \
|
||||
else \
|
||||
echo "#define CONFIG_CS3_BOOT" >> ./include/config.h ; \
|
||||
echo "... configured for CS3 boot"; \
|
||||
fi;
|
||||
@./mkconfig -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn
|
||||
|
||||
omap730p2_config \
|
||||
omap730p2_cs0boot_config \
|
||||
omap730p2_cs3boot_config : unconfig
|
||||
@if [ "$(findstring _cs0boot_, $@)" ] ; then \
|
||||
echo "#define CONFIG_CS0_BOOT" >> ./include/config.h ; \
|
||||
echo "... configured for CS0 boot"; \
|
||||
else \
|
||||
echo "#define CONFIG_CS3_BOOT" >> ./include/config.h ; \
|
||||
echo "... configured for CS3 boot"; \
|
||||
fi;
|
||||
@./mkconfig -a $(call xtract_omap730p2,$@) arm arm926ejs omap730p2
|
||||
|
||||
scb9328_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t scb9328
|
||||
|
||||
smdk2400_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2400
|
||||
@@ -918,6 +1214,9 @@ smdk2400_config : unconfig
|
||||
smdk2410_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2410
|
||||
|
||||
SX1_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t sx1
|
||||
|
||||
# TRAB default configuration: 8 MB Flash, 32 MB RAM
|
||||
trab_config \
|
||||
trab_bigram_config \
|
||||
@@ -946,20 +1245,46 @@ trab_old_config: unconfig
|
||||
VCMA9_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t vcma9 mpl
|
||||
|
||||
versatile_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs versatile
|
||||
|
||||
#########################################################################
|
||||
## S3C44B0 Systems
|
||||
#########################################################################
|
||||
|
||||
B2_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm s3c44b0 B2 dave
|
||||
|
||||
#########################################################################
|
||||
## ARM720T Systems
|
||||
#########################################################################
|
||||
|
||||
ep7312_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm720t ep7312
|
||||
|
||||
impa7_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm720t impa7
|
||||
|
||||
ep7312_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm720t ep7312
|
||||
modnet50_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm720t modnet50
|
||||
|
||||
evb4510_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm720t evb4510
|
||||
|
||||
#########################################################################
|
||||
## AT91RM9200 Systems
|
||||
#########################################################################
|
||||
|
||||
at91rm9200dk_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
|
||||
|
||||
#########################################################################
|
||||
## XScale Systems
|
||||
#########################################################################
|
||||
|
||||
cerf250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa cerf250
|
||||
|
||||
cradle_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa cradle
|
||||
|
||||
@@ -981,6 +1306,12 @@ logodl_config : unconfig
|
||||
wepep250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa wepep250
|
||||
|
||||
xm250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa xm250
|
||||
|
||||
xsengine_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa xsengine
|
||||
|
||||
#========================================================================
|
||||
# i386
|
||||
#========================================================================
|
||||
@@ -1024,6 +1355,27 @@ incaip_config: unconfig
|
||||
}
|
||||
@./mkconfig -a $(call xtract_incaip,$@) mips mips incaip
|
||||
|
||||
tb0229_config: unconfig
|
||||
@./mkconfig $(@:_config=) mips mips tb0229
|
||||
|
||||
#########################################################################
|
||||
## MIPS32 AU1X00
|
||||
#########################################################################
|
||||
dbau1000_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1000 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
dbau1100_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1100 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
dbau1500_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1500 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
#########################################################################
|
||||
## MIPS64 5Kc
|
||||
#########################################################################
|
||||
@@ -1058,6 +1410,7 @@ DK1C20_config: unconfig
|
||||
|
||||
DK1S10_safe_32_config \
|
||||
DK1S10_standard_32_config \
|
||||
DK1S10_mtx_ldk_20_config \
|
||||
DK1S10_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _safe_32,$@)" ] || \
|
||||
@@ -1068,30 +1421,45 @@ DK1S10_config: unconfig
|
||||
{ echo "#define CONFIG_NIOS_STANDARD_32 1" >>include/config.h ; \
|
||||
echo "... NIOS 'standard_32' configuration" ; \
|
||||
}
|
||||
@[ -z "$(findstring _mtx_ldk_20,$@)" ] || \
|
||||
{ echo "#define CONFIG_NIOS_MTX_LDK_20 1" >>include/config.h ; \
|
||||
echo "... NIOS 'mtx_ldk_20' configuration" ; \
|
||||
}
|
||||
@[ -z "$(findstring DK1S10_config,$@)" ] || \
|
||||
{ echo "#define CONFIG_NIOS_STANDARD_32 1" >>include/config.h ; \
|
||||
echo "... NIOS 'standard_32' configuration (DEFAULT)" ; \
|
||||
}
|
||||
@./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
|
||||
|
||||
|
||||
#========================================================================
|
||||
# MicroBlaze
|
||||
#========================================================================
|
||||
#########################################################################
|
||||
## MIPS32 AU1X00
|
||||
## Microblaze
|
||||
#########################################################################
|
||||
dbau1000_config : unconfig
|
||||
suzaku_config: unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1000 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
dbau1100_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1100 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
dbau1500_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1500 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
@echo "#define CONFIG_SUZAKU 1" >> include/config.h
|
||||
@./mkconfig -a $(@:_config=) microblaze microblaze suzaku AtmarkTechno
|
||||
|
||||
#########################################################################
|
||||
#########################################################################
|
||||
@@ -1104,19 +1472,19 @@ clean:
|
||||
rm -f examples/hello_world examples/timer \
|
||||
examples/eepro100_eeprom examples/sched \
|
||||
examples/mem_to_mem_idma2intr examples/82559_eeprom
|
||||
|
||||
rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
|
||||
rm -f tools/mpc86x_clk tools/ncb
|
||||
rm -f tools/easylogo/easylogo tools/bmp_logo
|
||||
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 \
|
||||
\( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
|
||||
-print \
|
||||
| xargs rm -f
|
||||
find . -type f \( -name .depend \
|
||||
-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
|
||||
-print0 \
|
||||
| xargs -0 rm -f
|
||||
rm -f $(OBJS) *.bak tags TAGS
|
||||
rm -fr *.*~
|
||||
rm -f u-boot u-boot.map $(ALL)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# (C) Copyright 2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
29
board/AtmarkTechno/suzaku/config.mk
Normal file
29
board/AtmarkTechno/suzaku/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (C) Copyright 2004 Atmark Techno, Inc.
|
||||
#
|
||||
# Yasushi SHOJI <yashi@atmark-techno.com>
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x80F00000
|
||||
|
||||
PLATFORM_CPPFLAGS += -mno-xl-soft-mul
|
||||
PLATFORM_CPPFLAGS += -mno-xl-soft-div
|
||||
PLATFORM_CPPFLAGS += -mxl-barrel-shift
|
||||
46
board/AtmarkTechno/suzaku/flash.c
Normal file
46
board/AtmarkTechno/suzaku/flash.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* (C) Copyright 2004 Atmark Techno, Inc.
|
||||
*
|
||||
* Yasushi SHOJI <yashi@atmark-techno.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>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
unsigned long flash_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flash_print_info(flash_info_t *info)
|
||||
{
|
||||
}
|
||||
|
||||
int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
32
board/AtmarkTechno/suzaku/suzaku.c
Normal file
32
board/AtmarkTechno/suzaku/suzaku.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* (C) Copyright 2004 Atmark Techno, Inc.
|
||||
*
|
||||
* Yasushi SHOJI <yashi@atmark-techno.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
|
||||
*/
|
||||
|
||||
/* This is a board specific file. It's OK to include board specific
|
||||
* header files */
|
||||
#include <asm/suzaku.h>
|
||||
|
||||
void do_reset(void)
|
||||
{
|
||||
*((unsigned long *)(MICROBLAZE_SYSREG_BASE_ADDR)) = MICROBLAZE_SYSREG_RECONFIGURE;
|
||||
}
|
||||
65
board/AtmarkTechno/suzaku/u-boot.lds
Normal file
65
board/AtmarkTechno/suzaku/u-boot.lds
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* (C) Copyright 2004 Atmark Techno, Inc.
|
||||
*
|
||||
* Yasushi SHOJI <yashi@atmark-techno.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_ARCH(microblaze)
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text ALIGN(0x4):
|
||||
{
|
||||
__text_start = .;
|
||||
cpu/microblaze/start.o (.text)
|
||||
*(.text)
|
||||
__text_end = .;
|
||||
}
|
||||
|
||||
.rodata ALIGN(0x4):
|
||||
{
|
||||
__rodata_start = .;
|
||||
*(.rodata)
|
||||
__rodata_end = .;
|
||||
}
|
||||
|
||||
.data ALIGN(0x4):
|
||||
{
|
||||
__data_start = .;
|
||||
*(.data)
|
||||
__data_end = .;
|
||||
}
|
||||
|
||||
.u_boot_cmd ALIGN(0x4):
|
||||
{
|
||||
__u_boot_cmd_start = .;
|
||||
*(.u_boot_cmd)
|
||||
__u_boot_cmd_end = .;
|
||||
}
|
||||
|
||||
.bss ALIGN(0x4):
|
||||
{
|
||||
__bss_start = .;
|
||||
*(.bss)
|
||||
__bss_start = .;
|
||||
}
|
||||
}
|
||||
@@ -549,18 +549,18 @@ static void move64 (unsigned long long *src, unsigned long long *dest)
|
||||
#if defined (CFG_DRAM_TEST_DATA)
|
||||
|
||||
unsigned long long pattern[] = {
|
||||
0xaaaaaaaaaaaaaaaa,
|
||||
0xcccccccccccccccc,
|
||||
0xf0f0f0f0f0f0f0f0,
|
||||
0xff00ff00ff00ff00,
|
||||
0xffff0000ffff0000,
|
||||
0xffffffff00000000,
|
||||
0x00000000ffffffff,
|
||||
0x0000ffff0000ffff,
|
||||
0x00ff00ff00ff00ff,
|
||||
0x0f0f0f0f0f0f0f0f,
|
||||
0x3333333333333333,
|
||||
0x5555555555555555
|
||||
0xaaaaaaaaaaaaaaaaULL,
|
||||
0xccccccccccccccccULL,
|
||||
0xf0f0f0f0f0f0f0f0ULL,
|
||||
0xff00ff00ff00ff00ULL,
|
||||
0xffff0000ffff0000ULL,
|
||||
0xffffffff00000000ULL,
|
||||
0x00000000ffffffffULL,
|
||||
0x0000ffff0000ffffULL,
|
||||
0x00ff00ff00ff00ffULL,
|
||||
0x0f0f0f0f0f0f0f0fULL,
|
||||
0x3333333333333333ULL,
|
||||
0x5555555555555555ULL,
|
||||
};
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
@@ -549,18 +549,18 @@ static void move64 (unsigned long long *src, unsigned long long *dest)
|
||||
#if defined (CFG_DRAM_TEST_DATA)
|
||||
|
||||
unsigned long long pattern[] = {
|
||||
0xaaaaaaaaaaaaaaaa,
|
||||
0xcccccccccccccccc,
|
||||
0xf0f0f0f0f0f0f0f0,
|
||||
0xff00ff00ff00ff00,
|
||||
0xffff0000ffff0000,
|
||||
0xffffffff00000000,
|
||||
0x00000000ffffffff,
|
||||
0x0000ffff0000ffff,
|
||||
0x00ff00ff00ff00ff,
|
||||
0x0f0f0f0f0f0f0f0f,
|
||||
0x3333333333333333,
|
||||
0x5555555555555555
|
||||
0xaaaaaaaaaaaaaaaaULL,
|
||||
0xccccccccccccccccULL,
|
||||
0xf0f0f0f0f0f0f0f0ULL,
|
||||
0xff00ff00ff00ff00ULL,
|
||||
0xffff0000ffff0000ULL,
|
||||
0xffffffff00000000ULL,
|
||||
0x00000000ffffffffULL,
|
||||
0x0000ffff0000ffffULL,
|
||||
0x00ff00ff00ff00ffULL,
|
||||
0x0f0f0f0f0f0f0f0fULL,
|
||||
0x3333333333333333ULL,
|
||||
0x5555555555555555ULL,
|
||||
};
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
@@ -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
|
||||
96
board/RPXlite_dw/README
Normal file
96
board/RPXlite_dw/README
Normal file
@@ -0,0 +1,96 @@
|
||||
|
||||
After following the step of Yoo. Jonghoon and Wolfgang Denk,
|
||||
I ported u-boot on RPXlite DW version board: RPXlite_DW or LITE_DW.
|
||||
|
||||
There are three differences between the Yoo-ported RPXlite and the RPXlite_DW.
|
||||
|
||||
Board(in U-BOOT) version(in EmbeddedPlanet) CPU SDRAM FLASH
|
||||
RPXlite RPXlite CW 850 16MB 4MB
|
||||
RPXlite_DW RPXlite DW 823e 64MB 16MB
|
||||
|
||||
This fireware is specially coded for EmbeddedPlanet Co. Software Development
|
||||
Platform(RPXlite DW),which has a NEC NL6448BC20-08 LCD panel.
|
||||
|
||||
It has the following three features:
|
||||
|
||||
1. 64MHz/48MHz system frequence setting options.
|
||||
The default setting is 48MHz.To get a 64MHz u-boot,just add
|
||||
'64' in make command,like
|
||||
|
||||
make RPXlite_DW_64_config
|
||||
make all
|
||||
|
||||
2. CFG_ENV_IS_IN_FLASH/CFG_ENV_IS_IN_NVRAM
|
||||
|
||||
The default environment parameter is stored in FLASH because it is a common choice for
|
||||
environment parameter.So I make NVRAM as backup parameter storeage.The reason why I
|
||||
didn't use EEPROM for ENV is that PlanetCore V2.0 use EEPROM as environment parameter
|
||||
home.Because of the possibility of using two firewares on this board,I didn't
|
||||
'disturb' EEPROM.To get NVRAM support,you may use the following build command:
|
||||
|
||||
make RPXlite_DW_NVRAM_config
|
||||
make all
|
||||
|
||||
3. LCD panel support
|
||||
|
||||
To support the Platform better,I added LCD panel(NL6448BC20-08) function.But bewear of
|
||||
the fact that once you build this support and program it to FLASH,you should make sure
|
||||
you put workable kernel and ramdisk at the right place in FLASH or through NFS.
|
||||
Otherwise, you must erase this fireware manually via BDI2000 or ICE tools.So this
|
||||
function is used for deployment and demo only.Pls look before you leap.
|
||||
|
||||
To get a LCD support u-boot,you can do the following:
|
||||
|
||||
make RPXlite_DW_LCD_config
|
||||
make all
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The basic make commands could be:
|
||||
|
||||
make RPXlite_DW_config
|
||||
make RPXlite_DW_64_config
|
||||
make RPXlite_DW_LCD_config
|
||||
make RPXlite_DW_NVRAM_config
|
||||
|
||||
BTW,you can combine the above features together and get a workable u-boot to meet your need.
|
||||
For example,to get a 64MHZ && ENV_IS_IN_FLASH && LCD panel support u-boot,you can type:
|
||||
|
||||
make RPXlite_DW_NVRAM_64_LCD_config
|
||||
make all
|
||||
|
||||
So other combining make commands could be:
|
||||
|
||||
make RPXlite_DW_NVRAM_64_config
|
||||
make RPXlite_DW_NVRAM_LCD_config
|
||||
make RPXlite_DW_64_LCD_config
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The boot process by "make RPXlite_DW_config" could be:
|
||||
|
||||
U-Boot 1.1.1 (Jun 8 2004 - 11:16:30)
|
||||
|
||||
CPU: PPC823EZTnnB2 at 48 MHz: 16 kB I-Cache 8 kB D-Cache
|
||||
Board: RPXlite_DW
|
||||
DRAM: 64 MB
|
||||
FLASH: 16 MB
|
||||
*** Warning - bad CRC, using default environment
|
||||
|
||||
In: serial
|
||||
Out: serial
|
||||
Err: serial
|
||||
Net: SCC ETHERNET
|
||||
u-boot>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
I'd like to extend my heartfelt gratitute to kind people for helping me work it out.
|
||||
I would particually thank Wolfgang Denk for his nice help.
|
||||
|
||||
Enjoy,
|
||||
|
||||
Sam Song, samsongshu@yahoo.com.cn
|
||||
Institute of Electrical Machinery and Controls
|
||||
Shanghai University
|
||||
|
||||
June 8,2004
|
||||
180
board/RPXlite_dw/RPXlite_dw.c
Normal file
180
board/RPXlite_dw/RPXlite_dw.c
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Sam Song, IEMC. SHU, samsongshu@yahoo.com.cn
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Sam Song
|
||||
* U-Boot port on RPXlite DW board : RPXlite_DW or LITE_DW
|
||||
* Tested on working at 64MHz(CPU)/32MHz(BUS),48MHz/24MHz
|
||||
* with 64MB, 2 SDRAM Micron chips,MT48LC16M16A2-75.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
static long int dram_size (long int, long int *, long int);
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#define _NOT_USED_ 0xFFFFCC25
|
||||
|
||||
const uint sdram_table[] =
|
||||
{
|
||||
/*
|
||||
* Single Read. (Offset 00h in UPMA RAM)
|
||||
*/
|
||||
0x0F03CC04, 0x00ACCC24, 0x1FF74C20, /* last */
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_,
|
||||
|
||||
/*
|
||||
* Burst Read. (Offset 08h in UPMA RAM)
|
||||
*/
|
||||
0x0F03CC04, 0x00ACCC24, 0x00FFCC20, 0x00FFCC20,
|
||||
0x01FFCC20, 0x1FF74C20, /* last */
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_,
|
||||
|
||||
/*
|
||||
* Single Write. (Offset 18h in UPMA RAM)
|
||||
*/
|
||||
0x0F03CC02, 0x00AC0C24, 0x1FF74C25, /* last */
|
||||
_NOT_USED_, _NOT_USED_, 0x0FA00C34,0x0FFFCC35,
|
||||
_NOT_USED_,
|
||||
|
||||
/*
|
||||
* Burst Write. (Offset 20h in UPMA RAM)
|
||||
*/
|
||||
0x0F03CC00, 0x00AC0C20, 0x00FFFC20, 0x00FFFC22,
|
||||
0x01FFFC24, 0x1FF74C25, /* last */
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_,
|
||||
|
||||
/*
|
||||
* Refresh. (Offset 30h in UPMA RAM)
|
||||
*/
|
||||
0x0FF0CC24, 0xFFFFCC24, _NOT_USED_, _NOT_USED_,
|
||||
_NOT_USED_, _NOT_USED_, 0xEFFB8C34, 0x0FF74C34,
|
||||
0x0FFACCB4, 0x0FF5CC34, 0x0FFFCC34, 0x0FFFCCB4,
|
||||
/* INIT sequence RAM WORDS
|
||||
* SDRAM Initialization (offset 0x36 in UPMA RAM)
|
||||
* The above definition uses the remaining space
|
||||
* to establish an initialization sequence,
|
||||
* which is executed by a RUN command.
|
||||
* The sequence is COMMAND INHIBIT(NOP),Precharge,
|
||||
* Load Mode Register,NOP,Auto Refresh.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Exception. (Offset 3Ch in UPMA RAM)
|
||||
*/
|
||||
0x0FEA8C34, 0x1FB54C34, 0xFFFFCC34, _NOT_USED_
|
||||
};
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: RPXlite_DW\n") ;
|
||||
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 size9;
|
||||
|
||||
upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
|
||||
|
||||
/* Refresh clock prescalar */
|
||||
memctl->memc_mptpr = CFG_MPTPR ;
|
||||
|
||||
memctl->memc_mar = 0x00000088;
|
||||
|
||||
/* Map controller banks 1 to the SDRAM bank */
|
||||
memctl->memc_or1 = CFG_OR1_PRELIM;
|
||||
memctl->memc_br1 = CFG_BR1_PRELIM;
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR_9COL & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
/*Disable Periodic timer A. */
|
||||
|
||||
udelay(200);
|
||||
|
||||
/* perform SDRAM initializsation sequence */
|
||||
|
||||
memctl->memc_mcr = 0x80002236; /* SDRAM bank 0 - refresh twice */
|
||||
|
||||
udelay(1);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* enable refresh */
|
||||
|
||||
/*Enable Periodic timer A */
|
||||
|
||||
udelay (1000);
|
||||
|
||||
/* Check Bank 0 Memory Size
|
||||
* try 9 column mode
|
||||
*/
|
||||
|
||||
size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE);
|
||||
|
||||
/*
|
||||
* Final mapping:
|
||||
*/
|
||||
|
||||
memctl->memc_or1 = ((-size9) & 0xFFFF0000) | CFG_OR_TIMING_SDRAM;
|
||||
|
||||
udelay (1000);
|
||||
|
||||
return (size9);
|
||||
}
|
||||
|
||||
void rpxlite_init (void)
|
||||
{
|
||||
/* Enable NVRAM */
|
||||
*((uchar *) BCSR0) |= BCSR0_ENNVRAM;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
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;
|
||||
|
||||
memctl->memc_mamr = mamr_value;
|
||||
|
||||
return (get_ram_size (base, maxsize));
|
||||
}
|
||||
29
board/RPXlite_dw/config.mk
Normal file
29
board/RPXlite_dw/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
# Sam Song, IEMC. SHU, samsongshu@yahoo.com.cn
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# RPXlite dw boards : lite_dw
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xff000000
|
||||
490
board/RPXlite_dw/flash.c
Normal file
490
board/RPXlite_dw/flash.c
Normal file
@@ -0,0 +1,490 @@
|
||||
/*
|
||||
* (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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Yoo. Jonghoon, IPone, yooth@ipone.co.kr
|
||||
* U-Boot port on RPXlite board
|
||||
*
|
||||
* Some of flash control words are modified. (from 2x16bit device
|
||||
* to 4x8bit device)
|
||||
* RPXLite board I tested has only 4 AM29LV800BB devices. Other devices
|
||||
* are not tested.
|
||||
*
|
||||
* (?) Does an RPXLite board which
|
||||
* does not use AM29LV800 flash memory exist ?
|
||||
* I don't know...
|
||||
*/
|
||||
|
||||
/* Yes,Yoo.They do use other FLASH for the board.
|
||||
*
|
||||
* Sam Song, IEMC. SHU, samsongshu@yahoo.com.cn
|
||||
* U-Boot port on RPXlite DW version board
|
||||
*
|
||||
* By now,it uses 4 AM29DL323DB90VI devices(4x8bit).
|
||||
* The total FLASH has 16MB(4x4MB).
|
||||
* I just made some necessary changes on the basis of Wolfgang and Yoo's job.
|
||||
*
|
||||
* June 8, 2004 */
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions vu_long : volatile unsigned long IN include/common.h
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info);
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data);
|
||||
static void flash_get_offsets (ulong base, flash_info_t *info);
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0 ;
|
||||
int i;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
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
|
||||
/* If Monitor is in the cope of FLASH,then
|
||||
* protect this area by default in case for
|
||||
* other occupation. [SAM] */
|
||||
|
||||
/* monitor protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
flash_info[0].size = size_b0;
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* set up sector start address table */
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00008000;
|
||||
info->start[2] = base + 0x00010000;
|
||||
info->start[3] = base + 0x00018000;
|
||||
info->start[4] = base + 0x00020000;
|
||||
info->start[5] = base + 0x00028000;
|
||||
info->start[6] = base + 0x00030000;
|
||||
info->start[7] = base + 0x00038000;
|
||||
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = base + ((i-7) * 0x00040000);
|
||||
}
|
||||
} else {
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00010000;
|
||||
info->start[i--] = base + info->size - 0x00018000;
|
||||
info->start[i--] = base + info->size - 0x00020000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00040000;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
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_AMDL323B: printf ("AM29DL323B (32 Mbit, bottom boot sector)\n");
|
||||
break;
|
||||
/* I just add the FLASH_AMDL323B for RPXlite_DW BOARD. [SAM] */
|
||||
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;
|
||||
}
|
||||
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
ulong value;
|
||||
ulong base = (ulong)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0xAAA] = 0x00AA00AA ;
|
||||
addr[0x555] = 0x00550055 ;
|
||||
addr[0xAAA] = 0x00900090 ;
|
||||
|
||||
value = addr[0] ;
|
||||
switch (value & 0x00FF00FF) {
|
||||
case AMD_MANUFACT: /* AMD_MANUFACT=0x00010001 in flash.h. */
|
||||
info->flash_id = FLASH_MAN_AMD; /* FLASH_MAN_AMD=0x00000000 in flash.h.*/
|
||||
break;
|
||||
case FUJ_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_FUJ;
|
||||
break;
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr[2] ; /* device ID */
|
||||
switch (value & 0x00FF00FF) {
|
||||
case (AMD_ID_LV400T & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM400T;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
case (AMD_ID_LV400B & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM400B;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
case (AMD_ID_LV800T & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM800T;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
case (AMD_ID_LV800B & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM800B;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00400000; /* Size doubled by yooth */
|
||||
break; /* => 4 MB */
|
||||
case (AMD_ID_LV160T & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM160T;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
case (AMD_ID_LV160B & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
case (AMD_ID_DL323B & 0x00FF00FF):
|
||||
info->flash_id += FLASH_AMDL323B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x01000000;
|
||||
break; /* => 16 MB(4x4MB) */
|
||||
/* AMD_ID_DL323B= 0x22532253 FLASH_AMDL323B= 0x0013
|
||||
* AMD_ID_DL323B could be found in <flash.h>.[SAM]
|
||||
* So we could get : flash_id = 0x00000013.
|
||||
* The first four-bit represents VEDOR ID,leaving others for FLASH ID. */
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
/* set up sector start address table */
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* FLASH_BTYPE=0x0001 mask for bottom boot sector type.If the last bit equals 1,
|
||||
* it means bottom boot flash. GOOD IDEA! [SAM]
|
||||
*/
|
||||
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00008000;
|
||||
info->start[2] = base + 0x00010000;
|
||||
info->start[3] = base + 0x00018000;
|
||||
info->start[4] = base + 0x00020000;
|
||||
info->start[5] = base + 0x00028000;
|
||||
info->start[6] = base + 0x00030000;
|
||||
info->start[7] = base + 0x00038000;
|
||||
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = base + ((i-7) * 0x00040000) ;
|
||||
}
|
||||
} else {
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00010000;
|
||||
info->start[i--] = base + info->size - 0x00018000;
|
||||
info->start[i--] = base + info->size - 0x00020000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00040000;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
addr = (volatile unsigned long *)(info->start[i]);
|
||||
/* info->protect[i] = addr[4] & 1 ; */
|
||||
/* Mask it for disorder FLASH protection **[Sam]** */
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr = (volatile unsigned long *)info->start[0];
|
||||
|
||||
*addr = 0xF0F0F0F0; /* reset bank */
|
||||
}
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
vu_long *addr = (vu_long*)(info->start[0]);
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((info->flash_id == FLASH_UNKNOWN) ||
|
||||
(info->flash_id > FLASH_AMD_COMP)) {
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
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();
|
||||
|
||||
addr[0xAAA] = 0xAAAAAAAA;
|
||||
addr[0x555] = 0x55555555;
|
||||
addr[0xAAA] = 0x80808080;
|
||||
addr[0xAAA] = 0xAAAAAAAA;
|
||||
addr[0x555] = 0x55555555;
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr = (vu_long *)(info->start[sect]) ;
|
||||
addr[0] = 0x30303030 ;
|
||||
l_sect = sect;
|
||||
}
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/*
|
||||
* We wait for the last triggered sector
|
||||
*/
|
||||
if (l_sect < 0)
|
||||
goto DONE;
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
addr = (vu_long *)(info->start[l_sect]);
|
||||
while ((addr[0] & 0x80808080) != 0x80808080) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
addr = (vu_long *)info->start[0];
|
||||
addr[0] = 0xF0F0F0F0; /* 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)
|
||||
{
|
||||
vu_long *addr = (vu_long *)(info->start[0]);
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((vu_long *)dest) & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr[0xAAA] = 0xAAAAAAAA;
|
||||
addr[0x555] = 0x55555555;
|
||||
addr[0xAAA] = 0xA0A0A0A0;
|
||||
|
||||
*((vu_long *)dest) = data;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
@@ -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
|
||||
@@ -57,17 +57,15 @@ SECTIONS
|
||||
/* 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)
|
||||
|
||||
/* XXX ?
|
||||
. = env_offset;
|
||||
common/environment.o(.text)
|
||||
*/
|
||||
common/environment.o(.text)
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
@@ -86,7 +84,7 @@ SECTIONS
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
@@ -136,11 +134,6 @@ SECTIONS
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
. = ALIGN(256 * 1024);
|
||||
.ppcenv :
|
||||
{
|
||||
common/environment.o (.ppcenv)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@@ -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
|
||||
46
board/adder/Makefile
Normal file
46
board/adder/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Copyright (C) 2004 Arabella Software Ltd.
|
||||
# Yuli Barcohen <yuli@arabellasw.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 := $(BOARD).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
|
||||
|
||||
#########################################################################
|
||||
107
board/adder/adder.c
Normal file
107
board/adder/adder.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (C) 2004 Arabella Software Ltd.
|
||||
* Yuli Barcohen <yuli@arabellasw.com>
|
||||
*
|
||||
* Support for Analogue&Micro Adder boards family.
|
||||
* Tested on AdderII and Adder87x.
|
||||
*
|
||||
* 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>
|
||||
|
||||
/*
|
||||
* SDRAM is single Samsung K4S643232F-T70 chip.
|
||||
* Minimal CPU frequency is 40MHz.
|
||||
*/
|
||||
static uint sdram_table[] = {
|
||||
/* Single read (offset 0x00 in UPM RAM) */
|
||||
0x1f07fc24, 0xe0aefc04, 0x10adfc04, 0xe0bbbc00,
|
||||
0x10f77c44, 0xf3fffc07, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* Burst read (offset 0x08 in UPM RAM) */
|
||||
0x1f07fc24, 0xe0aefc04, 0x10adfc04, 0xf0affc00,
|
||||
0xf0affc00, 0xf0affc00, 0xf0affc00, 0x10a77c44,
|
||||
0xf7bffc47, 0xfffffc35, 0xfffffc34, 0xfffffc35,
|
||||
0xfffffc35, 0x1ff77c35, 0xfffffc34, 0x1fb57c35,
|
||||
|
||||
/* Single write (offset 0x18 in UPM RAM) */
|
||||
0x1f27fc24, 0xe0aebc04, 0x00b93c00, 0x13f77c47,
|
||||
0xfffdfc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* Burst write (offset 0x20 in UPM RAM) */
|
||||
0x1f07fc24, 0xeeaebc00, 0x10ad7c00, 0xf0affc00,
|
||||
0xf0affc00, 0xe0abbc00, 0x1fb77c47, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* Refresh (offset 0x30 in UPM RAM) */
|
||||
0x1ff5fca4, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc84, 0xfffffc07, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* Exception (offset 0x3C in UPM RAM) */
|
||||
0xfffffc27, 0xfffffc04, 0xfffffc04, 0xfffffc04
|
||||
};
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
long int msize = CFG_SDRAM_SIZE;
|
||||
volatile immap_t *immap = (volatile immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
upmconfig(UPMA, sdram_table, sizeof(sdram_table) / sizeof(uint));
|
||||
|
||||
/* Configure SDRAM refresh */
|
||||
memctl->memc_mptpr = MPTPR_PTP_DIV32; /* BRGCLK/32 */
|
||||
|
||||
memctl->memc_mamr = (94 << 24) | CFG_MAMR;
|
||||
memctl->memc_mar = 0x0;
|
||||
udelay(200);
|
||||
|
||||
/* Run precharge from location 0x15 */
|
||||
memctl->memc_mcr = 0x80002115;
|
||||
udelay(200);
|
||||
|
||||
/* Run 8 refresh cycles */
|
||||
memctl->memc_mcr = 0x80002830;
|
||||
udelay(200);
|
||||
|
||||
memctl->memc_mar = 0x88;
|
||||
udelay(200);
|
||||
|
||||
/* Run MRS pattern from location 0x16 */
|
||||
memctl->memc_mcr = 0x80002116;
|
||||
udelay(200);
|
||||
|
||||
return msize;
|
||||
}
|
||||
|
||||
int checkboard( void )
|
||||
{
|
||||
puts("Board: Adder");
|
||||
#if defined(CONFIG_MPC885_FAMILY)
|
||||
puts("87x\n");
|
||||
#elif defined(CONFIG_MPC866_FAMILY)
|
||||
puts("II\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
27
board/adder/config.mk
Normal file
27
board/adder/config.mk
Normal file
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# Copyright (C) 2004 Arabella Software Ltd.
|
||||
# Yuli Barcohen <yuli@arabellasw.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
|
||||
#
|
||||
|
||||
#
|
||||
# Analogue&Micro Adder boards family
|
||||
#
|
||||
TEXT_BASE = 0xFE000000
|
||||
122
board/adder/u-boot.lds
Normal file
122
board/adder/u-boot.lds
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* Modified by Yuli Barcohen <yuli@arabellasw.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_ARCH(powerpc)
|
||||
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/mpc8xx/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 = .);
|
||||
}
|
||||
ENTRY(_start)
|
||||
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard( void )
|
||||
{
|
||||
puts("Board: ");
|
||||
puts("AdderII(MPC852T)\n" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined( CONFIG_SDRAM_50MHZ )
|
||||
|
||||
/******************************************************************************
|
||||
** for chip Samsung K4S643232F - T70
|
||||
** this table is for 32-50MHz operation
|
||||
*******************************************************************************/
|
||||
|
||||
#define SDRAM_MPTPRVALUE 0x0200
|
||||
|
||||
#define SDRAM_MAMRVALUE0 0x00802114 /* refresh at 32MHz */
|
||||
#define SDRAM_MAMRVALUE1 0x00802118
|
||||
|
||||
#define SDRAM_OR1VALUE 0xff800e00
|
||||
#define SDRAM_BR1VALUE 0x00000081
|
||||
|
||||
#define SDRAM_MARVALUE 94
|
||||
|
||||
#define SDRAM_MCRVALUE0 0x80808105
|
||||
#define SDRAM_MCRVALUE1 0x80808130
|
||||
|
||||
const uint sdram_table[] = {
|
||||
|
||||
/* single read (offset 0x00 in upm ram) */
|
||||
0x1f07fc24, 0xe0aefc04, 0x10adfc04, 0xe0bbbc00,
|
||||
0x10f77c44, 0xf3fffc07, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* burst read (offset 0x08 in upm ram) */
|
||||
0x1f07fc24, 0xe0aefc04, 0x10adfc04, 0xf0affc00,
|
||||
0xf0affc00, 0xf0affc00, 0xf0affc00, 0x10a77c44,
|
||||
0xf7bffc47, 0xfffffc35, 0xfffffc34, 0xfffffc35,
|
||||
0xfffffc35, 0x1ff77c35, 0xfffffc34, 0x1fb57c35,
|
||||
|
||||
/* single write (offset 0x18 in upm ram) */
|
||||
0x1f27fc24, 0xe0aebc04, 0x00b93c00, 0x13f77c47,
|
||||
0xfffdfc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* burst write (offset 0x20 in upm ram) */
|
||||
0x1f07fc24, 0xeeaebc00, 0x10ad7c00, 0xf0affc00,
|
||||
0xf0affc00, 0xe0abbc00, 0x1fb77c47, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* refresh (offset 0x30 in upm ram) */
|
||||
0x1ff5fca4, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc84, 0xfffffc07, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* exception (offset 0x3C in upm ram) */
|
||||
0xfffffc27, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
};
|
||||
|
||||
#else
|
||||
#error SDRAM not correctly configured
|
||||
#endif
|
||||
|
||||
int _initsdram (uint base, uint noMbytes)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
if (noMbytes != 8) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
upmconfig (UPMA, (uint *) sdram_table,
|
||||
sizeof (sdram_table) / sizeof (uint));
|
||||
|
||||
memctl->memc_mptpr = SDRAM_MPTPRVALUE;
|
||||
|
||||
/* Configure the refresh (mostly). This needs to be
|
||||
* based upon processor clock speed and optimized to provide
|
||||
* the highest level of performance. For multiple banks,
|
||||
* this time has to be divided by the number of banks.
|
||||
* Although it is not clear anywhere, it appears the
|
||||
* refresh steps through the chip selects for this UPM
|
||||
* on each refresh cycle.
|
||||
* We have to be careful changing
|
||||
* UPM registers after we ask it to run these commands.
|
||||
*/
|
||||
|
||||
memctl->memc_mamr = (SDRAM_MAMRVALUE0 | (SDRAM_MARVALUE << 24));
|
||||
memctl->memc_mar = 0x0;
|
||||
udelay (200);
|
||||
|
||||
/* Now run the precharge/nop/mrs commands.
|
||||
*/
|
||||
memctl->memc_mcr = 0x80002115;
|
||||
udelay (200);
|
||||
|
||||
/* Run 8 refresh cycles */
|
||||
memctl->memc_mcr = 0x80002380;
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_mar = 0x88;
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_mcr = 0x80002116;
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_or1 = SDRAM_OR1VALUE;
|
||||
memctl->memc_br1 = SDRAM_BR1VALUE | base;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _sdramdisable( void )
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
memctl->memc_br1 = 0x00000000;
|
||||
|
||||
/* maybe we should turn off upma here or something */
|
||||
}
|
||||
|
||||
int initsdram (uint base, uint * noMbytes)
|
||||
{
|
||||
uint m = 8;
|
||||
|
||||
*noMbytes = m;
|
||||
|
||||
if (!_initsdram (base, m)) {
|
||||
return 0;
|
||||
} else {
|
||||
_sdramdisable ();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
/* AdderII: has 8MB SDRAM */
|
||||
uint sdramsz;
|
||||
uint m = 0;
|
||||
|
||||
if (!initsdram (0x00000000, &sdramsz)) {
|
||||
m += sdramsz;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return (m << 20);
|
||||
}
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX not an actual SDRAM test */
|
||||
printf ("Test: 8MB SDRAM\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -71,7 +71,6 @@ 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;
|
||||
int any = 0;
|
||||
unsigned oldpri;
|
||||
ulong start;
|
||||
|
||||
@@ -94,6 +93,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
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.
|
||||
@@ -114,26 +119,25 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
*addr = 0xaa;
|
||||
*addr = 0x55;
|
||||
*addr2 = 0x30;
|
||||
any = 1;
|
||||
/* Now just wait for 0xff & 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 != 0xff) {
|
||||
udelay (1000 * 1000);
|
||||
putc ('.');
|
||||
if (get_timer (start) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("timeout\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
oldpri = ipri (3); /* disallow non important irqs again */
|
||||
}
|
||||
}
|
||||
|
||||
/* Now just wait for 0xff & provide some user feedback while
|
||||
* we wait.
|
||||
*/
|
||||
if (any) {
|
||||
addr2 = (CFG_FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
start = get_timer (0);
|
||||
while (*addr2 != 0xff) {
|
||||
udelay (1000 * 1000);
|
||||
putc ('.');
|
||||
if (get_timer (start) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("timeout\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
/* Restore interrupt priority */
|
||||
ipri (oldpri);
|
||||
|
||||
@@ -44,7 +44,7 @@ static int sevenseg_init_done = 0;
|
||||
|
||||
static inline void __sevenseg_set_masked (unsigned int mask, int value)
|
||||
{
|
||||
nios_pio_t *piop = (nios_pio_t*)SEVENSEG_BASE;
|
||||
nios_pio_t *piop __attribute__((unused)) = (nios_pio_t*)SEVENSEG_BASE;
|
||||
|
||||
#ifdef SEVENSEG_WRONLY /* emulate read access */
|
||||
|
||||
@@ -97,7 +97,7 @@ static inline void __sevenseg_toggle_masked (unsigned int mask)
|
||||
|
||||
static inline void __sevenseg_set (unsigned int value)
|
||||
{
|
||||
nios_pio_t *piop = (nios_pio_t*)SEVENSEG_BASE;
|
||||
nios_pio_t *piop __attribute__((unused)) = (nios_pio_t*)SEVENSEG_BASE;
|
||||
|
||||
#ifdef SEVENSEG_WRONLY /* emulate read access */
|
||||
|
||||
@@ -126,7 +126,7 @@ static inline void __sevenseg_set (unsigned int value)
|
||||
|
||||
static inline void __sevenseg_init (void)
|
||||
{
|
||||
nios_pio_t *piop = (nios_pio_t*)SEVENSEG_BASE;
|
||||
nios_pio_t *piop __attribute__((unused)) = (nios_pio_t*)SEVENSEG_BASE;
|
||||
|
||||
__sevenseg_set(0);
|
||||
|
||||
|
||||
@@ -33,8 +33,10 @@ void _default_hdlr (void)
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
#if defined(CONFIG_SEVENSEG)
|
||||
/* init seven segment led display and switch off */
|
||||
sevenseg_set(SEVENSEG_OFF);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
* _cwp_lolimit -Handles register window underflows.
|
||||
* _cwp_hilimit -Handles register window overflows.
|
||||
* _timebase_int -Increments the timebase.
|
||||
* _brkpt_hw_int -Hardware breakpoint handler.
|
||||
* _brkpt_sw_int -Software breakpoint handler.
|
||||
* _def_xhandler -Default exception handler.
|
||||
*
|
||||
* _timebase_int handles a Nios Timer interrupt and increments the
|
||||
@@ -58,9 +60,8 @@ _vectors:
|
||||
.long _def_xhandler@h /* Vector 0 - NMI */
|
||||
.long _cwp_lolimit@h /* Vector 1 - underflow */
|
||||
.long _cwp_hilimit@h /* Vector 2 - overflow */
|
||||
|
||||
.long _def_xhandler@h /* Vector 3 - GNUPro debug */
|
||||
.long _def_xhandler@h /* Vector 4 - GNUPro debug */
|
||||
.long _brkpt_hw_int@h /* Vector 3 - Breakpoint */
|
||||
.long _brkpt_sw_int@h /* Vector 4 - Single step*/
|
||||
.long _def_xhandler@h /* Vector 5 - GNUPro debug */
|
||||
.long _def_xhandler@h /* Vector 6 - future reserved */
|
||||
.long _def_xhandler@h /* Vector 7 - future reserved */
|
||||
|
||||
@@ -33,14 +33,24 @@ void _default_hdlr (void)
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
#if defined(CONFIG_SEVENSEG)
|
||||
/* init seven segment led display and switch off */
|
||||
sevenseg_set(SEVENSEG_OFF);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: Altera Nios 1S10 Development Kit\n");
|
||||
#if defined(CONFIG_NIOS_SAFE_32)
|
||||
puts ("Conf.: Altera Safe 32 (safe_32)\n");
|
||||
#elif defined(CONFIG_NIOS_STANDARD_32)
|
||||
puts ("Conf.: Altera Standard 32 (standard_32)\n");
|
||||
#elif defined(CONFIG_NIOS_MTX_LDK_20)
|
||||
puts ("Conf.: Microtronix LDK 2.0 (LDK2)\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
|
||||
* Scott McNutt <smcnutt@psyent.com>
|
||||
* Stephan Linz <linz@li-pro.net>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -21,6 +22,8 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Exception Vector Table
|
||||
@@ -55,8 +58,14 @@
|
||||
.align 4
|
||||
_vectors:
|
||||
|
||||
.long _def_xhandler@h /* Vector 0 - NMI */
|
||||
.long _cwp_lolimit@h /* Vector 1 - underflow */
|
||||
#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 */
|
||||
@@ -72,7 +81,11 @@ _vectors:
|
||||
.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 */
|
||||
@@ -106,7 +119,11 @@ _vectors:
|
||||
.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 */
|
||||
|
||||
49
board/assabet/Makefile
Normal file
49
board/assabet/Makefile
Normal file
@@ -0,0 +1,49 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# 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 $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := assabet.o
|
||||
SOBJS := setup.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
|
||||
|
||||
#########################################################################
|
||||
121
board/assabet/assabet.c
Normal file
121
board/assabet/assabet.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* 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>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Board dependent initialisation
|
||||
*/
|
||||
|
||||
#define ECOR 0x8000
|
||||
#define ECOR_RESET 0x80
|
||||
#define ECOR_LEVEL_IRQ 0x40
|
||||
#define ECOR_WR_ATTRIB 0x04
|
||||
#define ECOR_ENABLE 0x01
|
||||
|
||||
#define ECSR 0x8002
|
||||
#define ECSR_IOIS8 0x20
|
||||
#define ECSR_PWRDWN 0x04
|
||||
#define ECSR_INT 0x02
|
||||
#define SMC_IO_SHIFT 2
|
||||
#define NCR_0 (*((volatile u_char *)(0x100000a0)))
|
||||
#define NCR_ENET_OSC_EN (1<<3)
|
||||
|
||||
static inline u8
|
||||
readb(volatile u8 * p)
|
||||
{
|
||||
return *p;
|
||||
}
|
||||
|
||||
static inline void
|
||||
writeb(u8 v, volatile u8 * p)
|
||||
{
|
||||
*p = v;
|
||||
}
|
||||
|
||||
static void
|
||||
smc_init(void)
|
||||
{
|
||||
u8 ecor;
|
||||
u8 ecsr;
|
||||
volatile u8 *addr = (volatile u8 *)(0x18000000 + (1 << 25));
|
||||
|
||||
NCR_0 |= NCR_ENET_OSC_EN;
|
||||
udelay(100);
|
||||
|
||||
ecor = readb(addr + (ECOR << SMC_IO_SHIFT)) & ~ECOR_RESET;
|
||||
writeb(ecor | ECOR_RESET, addr + (ECOR << SMC_IO_SHIFT));
|
||||
udelay(100);
|
||||
|
||||
/*
|
||||
* The device will ignore all writes to the enable bit while
|
||||
* reset is asserted, even if the reset bit is cleared in the
|
||||
* same write. Must clear reset first, then enable the device.
|
||||
*/
|
||||
writeb(ecor, addr + (ECOR << SMC_IO_SHIFT));
|
||||
writeb(ecor | ECOR_ENABLE, addr + (ECOR << SMC_IO_SHIFT));
|
||||
|
||||
/*
|
||||
* Set the appropriate byte/word mode.
|
||||
*/
|
||||
ecsr = readb(addr + (ECSR << SMC_IO_SHIFT)) & ~ECSR_IOIS8;
|
||||
ecsr |= ECSR_IOIS8;
|
||||
writeb(ecsr, addr + (ECSR << SMC_IO_SHIFT));
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
static void
|
||||
neponset_init(void)
|
||||
{
|
||||
smc_init();
|
||||
}
|
||||
|
||||
int
|
||||
board_init(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_arch_number = 25; /* Intel Assabet Board */
|
||||
gd->bd->bi_boot_params = 0xc0000100;
|
||||
|
||||
neponset_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
dram_init(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
|
||||
return (0);
|
||||
}
|
||||
7
board/assabet/config.mk
Normal file
7
board/assabet/config.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# SA-1110 based Intel Assabet board
|
||||
#
|
||||
# The Intel Assabet 1 bank of 32 MiB SDRAM
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xc1f00000
|
||||
136
board/assabet/setup.S
Normal file
136
board/assabet/setup.S
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* 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)
|
||||
* 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"
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Board defines:
|
||||
*/
|
||||
|
||||
#define MDCNFG 0x00
|
||||
#define MDCAS00 0x04
|
||||
#define MDCAS01 0x08
|
||||
#define MDCAS02 0x0C
|
||||
#define MSC0 0x10
|
||||
#define MSC1 0x14
|
||||
#define MECR 0x18
|
||||
#define MDREFR 0x1C
|
||||
#define MDCAS20 0x20
|
||||
#define MDCAS21 0x24
|
||||
#define MDCAS22 0x28
|
||||
#define MSC2 0x2C
|
||||
#define SMCNFG 0x30
|
||||
|
||||
#define ASSABET_BCR (0x12000000)
|
||||
#define ASSABET_BCR_DB1110 (0x00a07490 | (0<<16) | (0<<17))
|
||||
#define ASSABET_SCR_nNEPONSET (1 << 9)
|
||||
#define NEPONSET_LEDS (0x10000010)
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Setup parameters for the board:
|
||||
*/
|
||||
|
||||
|
||||
MEM_BASE: .long 0xa0000000
|
||||
MEM_START: .long 0xc0000000
|
||||
|
||||
mdcnfg: .long 0x72547254
|
||||
mdcas00: .long 0xaaaaaa7f
|
||||
mdcas01: .long 0xaaaaaaaa
|
||||
mdcas02: .long 0xaaaaaaaa
|
||||
msc0: .long 0x4b384370
|
||||
msc1: .long 0x22212419
|
||||
mecr: .long 0x994a994a
|
||||
mdrefr: .long 0x04340327
|
||||
mdcas20: .long 0xaaaaaa7f
|
||||
mdcas21: .long 0xaaaaaaaa
|
||||
mdcas22: .long 0xaaaaaaaa
|
||||
msc2: .long 0x42196669
|
||||
smcnfg: .long 0x00000000
|
||||
|
||||
BCR: .long ASSABET_BCR
|
||||
BCR_DB1110: .long ASSABET_BCR_DB1110
|
||||
LEDS: .long NEPONSET_LEDS
|
||||
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
|
||||
/* Setting up the memory and stuff */
|
||||
|
||||
ldr r0, MEM_BASE
|
||||
ldr r1, mdcas00
|
||||
str r1, [r0, #MDCAS00]
|
||||
ldr r1, mdcas01
|
||||
str r1, [r0, #MDCAS01]
|
||||
ldr r1, mdcas02
|
||||
str r1, [r0, #MDCAS02]
|
||||
ldr r1, mdcas20
|
||||
str r1, [r0, #MDCAS20]
|
||||
ldr r1, mdcas21
|
||||
str r1, [r0, #MDCAS21]
|
||||
ldr r1, mdcas22
|
||||
str r1, [r0, #MDCAS22]
|
||||
ldr r1, mdrefr
|
||||
str r1, [r0, #MDREFR]
|
||||
ldr r1, mecr
|
||||
str r1, [r0, #MECR]
|
||||
ldr r1, msc0
|
||||
str r1, [r0, #MSC0]
|
||||
ldr r1, msc1
|
||||
str r1, [r0, #MSC1]
|
||||
ldr r1, msc2
|
||||
str r1, [r0, #MSC2]
|
||||
ldr r1, smcnfg
|
||||
str r1, [r0, #SMCNFG]
|
||||
|
||||
ldr r1, mdcnfg
|
||||
str r1, [r0, #MDCNFG]
|
||||
|
||||
/* Load something to activate bank */
|
||||
ldr r2, MEM_START
|
||||
.rept 8
|
||||
ldr r3, [r2]
|
||||
.endr
|
||||
|
||||
/* Enable SDRAM */
|
||||
orr r1, r1, #0x00000001
|
||||
str r1, [r0, #MDCNFG]
|
||||
|
||||
ldr r1, BCR
|
||||
ldr r2, BCR_DB1110
|
||||
str r2, [r1]
|
||||
|
||||
ldr r1, LEDS
|
||||
mov r0, #0x3
|
||||
str r0, [r1]
|
||||
|
||||
/* All done... */
|
||||
mov pc, lr
|
||||
57
board/assabet/u-boot.lds
Normal file
57
board/assabet/u-boot.lds
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
* 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
|
||||
*/
|
||||
|
||||
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 = .;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := at91rm9200dk.o flash.o
|
||||
OBJS := at91rm9200dk.o at45.o dm9161.o flash.o
|
||||
SOBJS :=
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
|
||||
@@ -25,7 +25,14 @@
|
||||
#ifdef CONFIG_HAS_DATAFLASH
|
||||
#include <dataflash.h>
|
||||
|
||||
#define SPI_CLK 5000000
|
||||
#define AT91C_SPI_CLK 10000000 /* Max Value = 10MHz to be compliant to
|
||||
the Continuous Array Read function */
|
||||
|
||||
/* AC Characteristics */
|
||||
/* DLYBS = tCSS = 250ns min and DLYBCT = tCSH = 250ns */
|
||||
#define DATAFLASH_TCSS (0xC << 16)
|
||||
#define DATAFLASH_TCHS (0x1 << 24)
|
||||
|
||||
#define AT91C_TIMEOUT_WRDY 200000
|
||||
#define AT91C_SPI_PCS0_SERIAL_DATAFLASH 0xE /* Chip Select 0 : NPCS0 %1110 */
|
||||
#define AT91C_SPI_PCS3_DATAFLASH_CARD 0x7 /* Chip Select 3 : NPCS3 %0111 */
|
||||
@@ -50,9 +57,11 @@ void AT91F_SpiInit(void) {
|
||||
AT91C_BASE_SPI->SPI_MR = AT91C_SPI_MSTR | AT91C_SPI_MODFDIS | AT91C_SPI_PCS;
|
||||
|
||||
/* Configure CS0 and CS3 */
|
||||
*(AT91C_SPI_CSR + 0) = AT91C_SPI_CPOL | (AT91C_SPI_DLYBS & 0x100000) | ((AT91C_MASTER_CLOCK / (2*SPI_CLK)) << 8);
|
||||
*(AT91C_SPI_CSR + 0) = AT91C_SPI_CPOL | (AT91C_SPI_DLYBS & DATAFLASH_TCSS) | (AT91C_SPI_DLYBCT &
|
||||
DATAFLASH_TCHS) | ((AT91C_MASTER_CLOCK / (2*AT91C_SPI_CLK)) << 8);
|
||||
|
||||
*(AT91C_SPI_CSR + 3) = AT91C_SPI_CPOL | (AT91C_SPI_DLYBS & 0x100000) | ((AT91C_MASTER_CLOCK / (2*SPI_CLK)) << 8);
|
||||
*(AT91C_SPI_CSR + 3) = AT91C_SPI_CPOL | (AT91C_SPI_DLYBS & DATAFLASH_TCSS) | (AT91C_SPI_DLYBCT &
|
||||
DATAFLASH_TCHS) | ((AT91C_MASTER_CLOCK / (2*AT91C_SPI_CLK)) << 8);
|
||||
|
||||
}
|
||||
|
||||
@@ -102,6 +102,10 @@ void nand_init (void)
|
||||
*AT91C_PIOB_PER = AT91C_PIO_PB1; /* enable direct output enable */
|
||||
*AT91C_PIOB_ODR = AT91C_PIO_PB1; /* disable output */
|
||||
|
||||
/* PIOB and PIOC clock enabling */
|
||||
*AT91C_PMC_PCER = 1 << AT91C_ID_PIOB;
|
||||
*AT91C_PMC_PCER = 1 << AT91C_ID_PIOC;
|
||||
|
||||
if (*AT91C_PIOB_PDSR & AT91C_PIO_PB1)
|
||||
printf (" No SmartMedia card inserted\n");
|
||||
#ifdef DEBUG
|
||||
|
||||
243
board/at91rm9200dk/dm9161.c
Normal file
243
board/at91rm9200dk/dm9161.c
Normal file
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Author : Hamid Ikdoumi (Atmel)
|
||||
*
|
||||
* 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 <at91rm9200_net.h>
|
||||
#include <net.h>
|
||||
#include <dm9161.h>
|
||||
|
||||
#ifdef CONFIG_DRIVER_ETHER
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_IsPhyConnected
|
||||
* Description:
|
||||
* Reads the 2 PHY ID registers
|
||||
* Arguments:
|
||||
* p_mac - pointer to AT91S_EMAC struct
|
||||
* Return value:
|
||||
* TRUE - if id read successfully
|
||||
* FALSE- if error
|
||||
*/
|
||||
static unsigned int dm9161_IsPhyConnected (AT91PS_EMAC p_mac)
|
||||
{
|
||||
unsigned short Id1, Id2;
|
||||
|
||||
at91rm9200_EmacEnableMDIO (p_mac);
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_PHYID1, &Id1);
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_PHYID2, &Id2);
|
||||
at91rm9200_EmacDisableMDIO (p_mac);
|
||||
|
||||
if ((Id1 == (DM9161_PHYID1_OUI >> 6)) &&
|
||||
((Id2 >> 10) == (DM9161_PHYID1_OUI & DM9161_LSB_MASK)))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_GetLinkSpeed
|
||||
* Description:
|
||||
* Link parallel detection status of MAC is checked and set in the
|
||||
* MAC configuration registers
|
||||
* Arguments:
|
||||
* p_mac - pointer to MAC
|
||||
* Return value:
|
||||
* TRUE - if link status set succesfully
|
||||
* FALSE - if link status not set
|
||||
*/
|
||||
static UCHAR dm9161_GetLinkSpeed (AT91PS_EMAC p_mac)
|
||||
{
|
||||
unsigned short stat1, stat2;
|
||||
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_BMSR, &stat1))
|
||||
return FALSE;
|
||||
|
||||
if (!(stat1 & DM9161_LINK_STATUS)) /* link status up? */
|
||||
return FALSE;
|
||||
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_DSCSR, &stat2))
|
||||
return FALSE;
|
||||
|
||||
if ((stat1 & DM9161_100BASE_TX_FD) && (stat2 & DM9161_100FDX)) {
|
||||
/*set Emac for 100BaseTX and Full Duplex */
|
||||
p_mac->EMAC_CFG |= AT91C_EMAC_SPD | AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((stat1 & DM9161_10BASE_T_FD) && (stat2 & DM9161_10FDX)) {
|
||||
/*set MII for 10BaseT and Full Duplex */
|
||||
p_mac->EMAC_CFG = (p_mac->EMAC_CFG &
|
||||
~(AT91C_EMAC_SPD | AT91C_EMAC_FD))
|
||||
| AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((stat1 & DM9161_100BASE_T4_HD) && (stat2 & DM9161_100HDX)) {
|
||||
/*set MII for 100BaseTX and Half Duplex */
|
||||
p_mac->EMAC_CFG = (p_mac->EMAC_CFG &
|
||||
~(AT91C_EMAC_SPD | AT91C_EMAC_FD))
|
||||
| AT91C_EMAC_SPD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((stat1 & DM9161_10BASE_T_HD) && (stat2 & DM9161_10HDX)) {
|
||||
/*set MII for 10BaseT and Half Duplex */
|
||||
p_mac->EMAC_CFG &= ~(AT91C_EMAC_SPD | AT91C_EMAC_FD);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_InitPhy
|
||||
* Description:
|
||||
* MAC starts checking its link by using parallel detection and
|
||||
* Autonegotiation and the same is set in the MAC configuration registers
|
||||
* Arguments:
|
||||
* p_mac - pointer to struct AT91S_EMAC
|
||||
* Return value:
|
||||
* TRUE - if link status set succesfully
|
||||
* FALSE - if link status not set
|
||||
*/
|
||||
static UCHAR dm9161_InitPhy (AT91PS_EMAC p_mac)
|
||||
{
|
||||
UCHAR ret = TRUE;
|
||||
unsigned short IntValue;
|
||||
|
||||
at91rm9200_EmacEnableMDIO (p_mac);
|
||||
|
||||
if (!dm9161_GetLinkSpeed (p_mac)) {
|
||||
/* Try another time */
|
||||
ret = dm9161_GetLinkSpeed (p_mac);
|
||||
}
|
||||
|
||||
/* Disable PHY Interrupts */
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_MDINTR, &IntValue);
|
||||
/* clear FDX, SPD, Link, INTR masks */
|
||||
IntValue &= ~(DM9161_FDX_MASK | DM9161_SPD_MASK |
|
||||
DM9161_LINK_MASK | DM9161_INTR_MASK);
|
||||
at91rm9200_EmacWritePhy (p_mac, DM9161_MDINTR, &IntValue);
|
||||
at91rm9200_EmacDisableMDIO (p_mac);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_AutoNegotiate
|
||||
* Description:
|
||||
* MAC Autonegotiates with the partner status of same is set in the
|
||||
* MAC configuration registers
|
||||
* Arguments:
|
||||
* dev - pointer to struct net_device
|
||||
* Return value:
|
||||
* TRUE - if link status set successfully
|
||||
* FALSE - if link status not set
|
||||
*/
|
||||
static UCHAR dm9161_AutoNegotiate (AT91PS_EMAC p_mac, int *status)
|
||||
{
|
||||
unsigned short value;
|
||||
unsigned short PhyAnar;
|
||||
unsigned short PhyAnalpar;
|
||||
|
||||
/* Set dm9161 control register */
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
value &= ~DM9161_AUTONEG; /* remove autonegotiation enable */
|
||||
value |= DM9161_ISOLATE; /* Electrically isolate PHY */
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
|
||||
/* Set the Auto_negotiation Advertisement Register */
|
||||
/* MII advertising for Next page, 100BaseTxFD and HD, 10BaseTFD and HD, IEEE 802.3 */
|
||||
PhyAnar = DM9161_NP | DM9161_TX_FDX | DM9161_TX_HDX |
|
||||
DM9161_10_FDX | DM9161_10_HDX | DM9161_AN_IEEE_802_3;
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_ANAR, &PhyAnar))
|
||||
return FALSE;
|
||||
|
||||
/* Read the Control Register */
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
|
||||
value |= DM9161_SPEED_SELECT | DM9161_AUTONEG | DM9161_DUPLEX_MODE;
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
/* Restart Auto_negotiation */
|
||||
value |= DM9161_RESTART_AUTONEG;
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
|
||||
/*check AutoNegotiate complete */
|
||||
udelay (10000);
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_BMSR, &value);
|
||||
if (!(value & DM9161_AUTONEG_COMP))
|
||||
return FALSE;
|
||||
|
||||
/* Get the AutoNeg Link partner base page */
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_ANLPAR, &PhyAnalpar))
|
||||
return FALSE;
|
||||
|
||||
if ((PhyAnar & DM9161_TX_FDX) && (PhyAnalpar & DM9161_TX_FDX)) {
|
||||
/*set MII for 100BaseTX and Full Duplex */
|
||||
p_mac->EMAC_CFG |= AT91C_EMAC_SPD | AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((PhyAnar & DM9161_10_FDX) && (PhyAnalpar & DM9161_10_FDX)) {
|
||||
/*set MII for 10BaseT and Full Duplex */
|
||||
p_mac->EMAC_CFG = (p_mac->EMAC_CFG &
|
||||
~(AT91C_EMAC_SPD | AT91C_EMAC_FD))
|
||||
| AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* at91rm92000_GetPhyInterface
|
||||
* Description:
|
||||
* Initialise the interface functions to the PHY
|
||||
* Arguments:
|
||||
* None
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
void at91rm92000_GetPhyInterface(AT91PS_PhyOps p_phyops)
|
||||
{
|
||||
p_phyops->Init = dm9161_InitPhy;
|
||||
p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
|
||||
p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
|
||||
p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
|
||||
|
||||
#endif /* CONFIG_DRIVER_ETHER */
|
||||
@@ -42,20 +42,22 @@ typedef struct OrgDef
|
||||
/* Flash Organizations */
|
||||
OrgDef OrgAT49BV16x4[] =
|
||||
{
|
||||
{ 8, 8*1024 }, /* 8 * 8kBytes sectors */
|
||||
{ 2, 32*1024 }, /* 2 * 32kBytes sectors */
|
||||
{ 30, 64*1024 } /* 30 * 64kBytes sectors */
|
||||
{ 8, 8*1024 }, /* 8 * 8 kBytes sectors */
|
||||
{ 2, 32*1024 }, /* 2 * 32 kBytes sectors */
|
||||
{ 30, 64*1024 }, /* 30 * 64 kBytes sectors */
|
||||
};
|
||||
|
||||
OrgDef OrgAT49BV16x4A[] =
|
||||
{
|
||||
{ 8, 8*1024 }, /* 8 * 8kBytes sectors */
|
||||
{ 31, 64*1024 } /* 31 * 64kBytes sectors */
|
||||
{ 8, 8*1024 }, /* 8 * 8 kBytes sectors */
|
||||
{ 31, 64*1024 }, /* 31 * 64 kBytes sectors */
|
||||
};
|
||||
|
||||
|
||||
#define FLASH_BANK_SIZE 0x200000 /* 2 MB */
|
||||
#define MAIN_SECT_SIZE 0x10000 /* 64 KB */
|
||||
OrgDef OrgAT49BV6416[] =
|
||||
{
|
||||
{ 8, 8*1024 }, /* 8 * 8 kBytes sectors */
|
||||
{ 127, 64*1024 }, /* 127 * 64 kBytes sectors */
|
||||
};
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
@@ -73,13 +75,11 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
#define CMD_ERASE_CONFIRM 0x0030
|
||||
#define CMD_PROGRAM 0x00A0
|
||||
#define CMD_UNLOCK_BYPASS 0x0020
|
||||
#define CMD_SECTOR_UNLOCK 0x0070
|
||||
|
||||
#define MEM_FLASH_ADDR1 (*(volatile u16 *)(CFG_FLASH_BASE + (0x00005555<<1)))
|
||||
#define MEM_FLASH_ADDR2 (*(volatile u16 *)(CFG_FLASH_BASE + (0x00002AAA<<1)))
|
||||
|
||||
#define IDENT_FLASH_ADDR1 (*(volatile u16 *)(CFG_FLASH_BASE + (0x0000555<<1)))
|
||||
#define IDENT_FLASH_ADDR2 (*(volatile u16 *)(CFG_FLASH_BASE + (0x0000AAA<<1)))
|
||||
|
||||
#define BIT_ERASE_DONE 0x0080
|
||||
#define BIT_RDY_MASK 0x0080
|
||||
#define BIT_PROGRAM_ERROR 0x0020
|
||||
@@ -95,17 +95,17 @@ void flash_identification (flash_info_t * info)
|
||||
{
|
||||
volatile u16 manuf_code, device_code, add_device_code;
|
||||
|
||||
IDENT_FLASH_ADDR1 = FLASH_CODE1;
|
||||
IDENT_FLASH_ADDR2 = FLASH_CODE2;
|
||||
IDENT_FLASH_ADDR1 = ID_IN_CODE;
|
||||
MEM_FLASH_ADDR1 = FLASH_CODE1;
|
||||
MEM_FLASH_ADDR2 = FLASH_CODE2;
|
||||
MEM_FLASH_ADDR1 = ID_IN_CODE;
|
||||
|
||||
manuf_code = *(volatile u16 *) CFG_FLASH_BASE;
|
||||
device_code = *(volatile u16 *) (CFG_FLASH_BASE + 2);
|
||||
add_device_code = *(volatile u16 *) (CFG_FLASH_BASE + (3 << 1));
|
||||
|
||||
IDENT_FLASH_ADDR1 = FLASH_CODE1;
|
||||
IDENT_FLASH_ADDR2 = FLASH_CODE2;
|
||||
IDENT_FLASH_ADDR1 = ID_OUT_CODE;
|
||||
MEM_FLASH_ADDR1 = FLASH_CODE1;
|
||||
MEM_FLASH_ADDR2 = FLASH_CODE2;
|
||||
MEM_FLASH_ADDR1 = ID_OUT_CODE;
|
||||
|
||||
/* Vendor type */
|
||||
info->flash_id = ATM_MANUFACT & FLASH_VENDMASK;
|
||||
@@ -117,14 +117,36 @@ void flash_identification (flash_info_t * info)
|
||||
(ATM_ID_BV1614A & FLASH_TYPEMASK)) {
|
||||
info->flash_id |= ATM_ID_BV1614A & FLASH_TYPEMASK;
|
||||
printf ("AT49BV1614A (16Mbit)\n");
|
||||
} else { /* AT49BV1614 Flash */
|
||||
info->flash_id |= ATM_ID_BV1614 & FLASH_TYPEMASK;
|
||||
printf ("AT49BV1614 (16Mbit)\n");
|
||||
}
|
||||
|
||||
} else { /* AT49BV1614 Flash */
|
||||
info->flash_id |= ATM_ID_BV1614 & FLASH_TYPEMASK;
|
||||
printf ("AT49BV1614 (16Mbit)\n");
|
||||
} else if ((device_code & FLASH_TYPEMASK) == (ATM_ID_BV6416 & FLASH_TYPEMASK)) {
|
||||
info->flash_id |= ATM_ID_BV6416 & FLASH_TYPEMASK;
|
||||
printf ("AT49BV6416 (64Mbit)\n");
|
||||
}
|
||||
}
|
||||
|
||||
ushort flash_number_sector(OrgDef *pOrgDef, unsigned int nb_blocks)
|
||||
{
|
||||
int i, nb_sectors = 0;
|
||||
|
||||
for (i=0; i<nb_blocks; i++){
|
||||
nb_sectors += pOrgDef[i].sector_number;
|
||||
}
|
||||
|
||||
return nb_sectors;
|
||||
}
|
||||
|
||||
void flash_unlock_sector(flash_info_t * info, unsigned int sector)
|
||||
{
|
||||
volatile u16 *addr = (volatile u16 *) (info->start[sector]);
|
||||
|
||||
MEM_FLASH_ADDR1 = CMD_UNLOCK1;
|
||||
*addr = CMD_SECTOR_UNLOCK;
|
||||
}
|
||||
|
||||
|
||||
ulong flash_init (void)
|
||||
{
|
||||
@@ -140,23 +162,29 @@ ulong flash_init (void)
|
||||
|
||||
flash_identification (&flash_info[i]);
|
||||
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
|
||||
if ((flash_info[i].flash_id & FLASH_TYPEMASK) ==
|
||||
(ATM_ID_BV1614 & FLASH_TYPEMASK)) {
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
|
||||
pOrgDef = OrgAT49BV16x4;
|
||||
flash_nb_blocks = sizeof (OrgAT49BV16x4) / sizeof (OrgDef);
|
||||
} else { /* AT49BV1614A Flash */
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT - 1;
|
||||
memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT - 1);
|
||||
} else if ((flash_info[i].flash_id & FLASH_TYPEMASK) ==
|
||||
(ATM_ID_BV1614A & FLASH_TYPEMASK)){ /* AT49BV1614A Flash */
|
||||
|
||||
pOrgDef = OrgAT49BV16x4A;
|
||||
flash_nb_blocks = sizeof (OrgAT49BV16x4A) / sizeof (OrgDef);
|
||||
} else if ((flash_info[i].flash_id & FLASH_TYPEMASK) ==
|
||||
(ATM_ID_BV6416 & FLASH_TYPEMASK)){ /* AT49BV6416 Flash */
|
||||
|
||||
pOrgDef = OrgAT49BV6416;
|
||||
flash_nb_blocks = sizeof (OrgAT49BV6416) / sizeof (OrgDef);
|
||||
} else {
|
||||
flash_nb_blocks = 0;
|
||||
pOrgDef = OrgAT49BV16x4;
|
||||
}
|
||||
|
||||
flash_info[i].sector_count = flash_number_sector(pOrgDef, flash_nb_blocks);
|
||||
memset (flash_info[i].protect, 0, flash_info[i].sector_count);
|
||||
|
||||
if (i == 0)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
else
|
||||
@@ -164,15 +192,26 @@ ulong flash_init (void)
|
||||
|
||||
sector = 0;
|
||||
start_address = flashbase;
|
||||
flash_info[i].size = 0;
|
||||
|
||||
for (j = 0; j < flash_nb_blocks; j++) {
|
||||
for (k = 0; k < pOrgDef[j].sector_number; k++) {
|
||||
flash_info[i].start[sector++] = start_address;
|
||||
start_address += pOrgDef[j].sector_size;
|
||||
flash_info[i].size += pOrgDef[j].sector_size;
|
||||
}
|
||||
}
|
||||
|
||||
size += flash_info[i].size;
|
||||
|
||||
if ((flash_info[i].flash_id & FLASH_TYPEMASK) ==
|
||||
(ATM_ID_BV6416 & FLASH_TYPEMASK)){ /* AT49BV6416 Flash */
|
||||
|
||||
/* Unlock all sectors at reset */
|
||||
for (j=0; j<flash_info[i].sector_count; j++){
|
||||
flash_unlock_sector(&flash_info[i], j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Protect binary boot image */
|
||||
@@ -215,6 +254,9 @@ void flash_print_info (flash_info_t * info)
|
||||
case (ATM_ID_BV1614A & FLASH_TYPEMASK):
|
||||
printf ("AT49BV1614A (16Mbit)\n");
|
||||
break;
|
||||
case (ATM_ID_BV6416 & FLASH_TYPEMASK):
|
||||
printf ("AT49BV6416 (64Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
goto Done;
|
||||
@@ -234,7 +276,7 @@ void flash_print_info (flash_info_t * info)
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
Done:
|
||||
Done: ;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
|
||||
@@ -45,14 +45,12 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
|
||||
armboot_end = .;
|
||||
_end = .;
|
||||
}
|
||||
|
||||
1098
board/bmw/flash.c
1098
board/bmw/flash.c
File diff suppressed because it is too large
Load Diff
@@ -9,49 +9,49 @@
|
||||
|
||||
typedef struct NS16550 *NS16550_t;
|
||||
|
||||
const NS16550_t COM_PORTS[] = { (NS16550_t) ((CFG_EUMB_ADDR) + 0x4500), (NS16550_t) ((CFG_EUMB_ADDR) + 0x4600)};
|
||||
const NS16550_t COM_PORTS[] =
|
||||
{ (NS16550_t) ((CFG_EUMB_ADDR) + 0x4500),
|
||||
(NS16550_t) ((CFG_EUMB_ADDR) + 0x4600) };
|
||||
|
||||
volatile struct NS16550 *
|
||||
NS16550_init(int chan, int baud_divisor)
|
||||
volatile struct NS16550 *NS16550_init (int chan, int baud_divisor)
|
||||
{
|
||||
volatile struct NS16550 *com_port;
|
||||
com_port = (struct NS16550 *) COM_PORTS[chan];
|
||||
com_port->ier = 0x00;
|
||||
com_port->lcr = LCR_BKSE; /* Access baud rate */
|
||||
com_port->dll = baud_divisor & 0xff; /* 9600 baud */
|
||||
com_port->dlm = (baud_divisor >> 8) & 0xff;
|
||||
com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */
|
||||
com_port->mcr = MCR_RTS; /* RTS/DTR */
|
||||
com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */
|
||||
return (com_port);
|
||||
volatile struct NS16550 *com_port;
|
||||
|
||||
com_port = (struct NS16550 *) COM_PORTS[chan];
|
||||
com_port->ier = 0x00;
|
||||
com_port->lcr = LCR_BKSE; /* Access baud rate */
|
||||
com_port->dll = baud_divisor & 0xff; /* 9600 baud */
|
||||
com_port->dlm = (baud_divisor >> 8) & 0xff;
|
||||
com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */
|
||||
com_port->mcr = MCR_RTS; /* RTS/DTR */
|
||||
com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */
|
||||
return (com_port);
|
||||
}
|
||||
|
||||
void
|
||||
NS16550_reinit(volatile struct NS16550 *com_port, int baud_divisor)
|
||||
void NS16550_reinit (volatile struct NS16550 *com_port, int baud_divisor)
|
||||
{
|
||||
com_port->ier = 0x00;
|
||||
com_port->lcr = LCR_BKSE; /* Access baud rate */
|
||||
com_port->dll = baud_divisor & 0xff; /* 9600 baud */
|
||||
com_port->dlm = (baud_divisor >> 8) & 0xff;
|
||||
com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */
|
||||
com_port->mcr = MCR_RTS; /* RTS/DTR */
|
||||
com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */
|
||||
com_port->ier = 0x00;
|
||||
com_port->lcr = LCR_BKSE; /* Access baud rate */
|
||||
com_port->dll = baud_divisor & 0xff; /* 9600 baud */
|
||||
com_port->dlm = (baud_divisor >> 8) & 0xff;
|
||||
com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */
|
||||
com_port->mcr = MCR_RTS; /* RTS/DTR */
|
||||
com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */
|
||||
}
|
||||
|
||||
void NS16550_putc(volatile struct NS16550 *com_port, unsigned char c)
|
||||
void NS16550_putc (volatile struct NS16550 *com_port, unsigned char c)
|
||||
{
|
||||
while ((com_port->lsr & LSR_THRE) == 0) ;
|
||||
com_port->thr = c;
|
||||
while ((com_port->lsr & LSR_THRE) == 0);
|
||||
com_port->thr = c;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
NS16550_getc(volatile struct NS16550 *com_port)
|
||||
unsigned char NS16550_getc (volatile struct NS16550 *com_port)
|
||||
{
|
||||
while ((com_port->lsr & LSR_DR) == 0) ;
|
||||
return (com_port->rbr);
|
||||
while ((com_port->lsr & LSR_DR) == 0);
|
||||
return (com_port->rbr);
|
||||
}
|
||||
|
||||
int NS16550_tstc(volatile struct NS16550 *com_port)
|
||||
int NS16550_tstc (volatile struct NS16550 *com_port)
|
||||
{
|
||||
return ((com_port->lsr & LSR_DR) != 0);
|
||||
return ((com_port->lsr & LSR_DR) != 0);
|
||||
}
|
||||
|
||||
@@ -12,20 +12,19 @@
|
||||
*/
|
||||
|
||||
|
||||
struct NS16550
|
||||
{
|
||||
unsigned char rbrthrdlb; /* 0 */
|
||||
unsigned char ierdmb; /* 1 */
|
||||
unsigned char iirfcrafr; /* 2 */
|
||||
unsigned char lcr; /* 3 */
|
||||
unsigned char mcr; /* 4 */
|
||||
unsigned char lsr; /* 5 */
|
||||
unsigned char msr; /* 6 */
|
||||
unsigned char scr; /* 7 */
|
||||
unsigned char reserved[2]; /* 8 & 9 */
|
||||
unsigned char dsr; /* 10 */
|
||||
unsigned char dcr; /* 11 */
|
||||
};
|
||||
struct NS16550 {
|
||||
unsigned char rbrthrdlb; /* 0 */
|
||||
unsigned char ierdmb; /* 1 */
|
||||
unsigned char iirfcrafr; /* 2 */
|
||||
unsigned char lcr; /* 3 */
|
||||
unsigned char mcr; /* 4 */
|
||||
unsigned char lsr; /* 5 */
|
||||
unsigned char msr; /* 6 */
|
||||
unsigned char scr; /* 7 */
|
||||
unsigned char reserved[2]; /* 8 & 9 */
|
||||
unsigned char dsr; /* 10 */
|
||||
unsigned char dcr; /* 11 */
|
||||
};
|
||||
|
||||
|
||||
#define rbr rbrthrdlb
|
||||
@@ -37,44 +36,44 @@ struct NS16550
|
||||
#define fcr iirfcrafr
|
||||
#define afr iirfcrafr
|
||||
|
||||
#define FCR_FIFO_EN 0x01 /*fifo enable*/
|
||||
#define FCR_RXSR 0x02 /*reciever soft reset*/
|
||||
#define FCR_TXSR 0x04 /*transmitter soft reset*/
|
||||
#define FCR_DMS 0x08 /* DMA Mode Select */
|
||||
#define FCR_FIFO_EN 0x01 /*fifo enable */
|
||||
#define FCR_RXSR 0x02 /*reciever soft reset */
|
||||
#define FCR_TXSR 0x04 /*transmitter soft reset */
|
||||
#define FCR_DMS 0x08 /* DMA Mode Select */
|
||||
|
||||
#define MCR_RTS 0x02 /* Readyu to Send */
|
||||
#define MCR_RTS 0x02 /* Readyu to Send */
|
||||
#define MCR_LOOP 0x10 /* Local loopback mode enable */
|
||||
/* #define MCR_DTR 0x01 noton 8245 duart */
|
||||
/* #define MCR_DMA_EN 0x04 noton 8245 duart */
|
||||
/* #define MCR_TX_DFR 0x08 noton 8245 duart */
|
||||
|
||||
#define LCR_WLS_MSK 0x03 /* character length slect mask*/
|
||||
#define LCR_WLS_5 0x00 /* 5 bit character length */
|
||||
#define LCR_WLS_6 0x01 /* 6 bit character length */
|
||||
#define LCR_WLS_7 0x02 /* 7 bit character length */
|
||||
#define LCR_WLS_8 0x03 /* 8 bit character length */
|
||||
#define LCR_STB 0x04 /* Number of stop Bits, off = 1, on = 1.5 or 2) */
|
||||
#define LCR_PEN 0x08 /* Parity eneble*/
|
||||
#define LCR_EPS 0x10 /* Even Parity Select*/
|
||||
#define LCR_STKP 0x20 /* Stick Parity*/
|
||||
#define LCR_SBRK 0x40 /* Set Break*/
|
||||
#define LCR_BKSE 0x80 /* Bank select enable - aka DLAB on 8245 */
|
||||
#define LCR_WLS_MSK 0x03 /* character length slect mask */
|
||||
#define LCR_WLS_5 0x00 /* 5 bit character length */
|
||||
#define LCR_WLS_6 0x01 /* 6 bit character length */
|
||||
#define LCR_WLS_7 0x02 /* 7 bit character length */
|
||||
#define LCR_WLS_8 0x03 /* 8 bit character length */
|
||||
#define LCR_STB 0x04 /* Number of stop Bits, off = 1, on = 1.5 or 2) */
|
||||
#define LCR_PEN 0x08 /* Parity eneble */
|
||||
#define LCR_EPS 0x10 /* Even Parity Select */
|
||||
#define LCR_STKP 0x20 /* Stick Parity */
|
||||
#define LCR_SBRK 0x40 /* Set Break */
|
||||
#define LCR_BKSE 0x80 /* Bank select enable - aka DLAB on 8245 */
|
||||
|
||||
#define LSR_DR 0x01 /* Data ready */
|
||||
#define LSR_OE 0x02 /* Overrun */
|
||||
#define LSR_PE 0x04 /* Parity error */
|
||||
#define LSR_FE 0x08 /* Framing error */
|
||||
#define LSR_BI 0x10 /* Break */
|
||||
#define LSR_THRE 0x20 /* Xmit holding register empty */
|
||||
#define LSR_TEMT 0x40 /* Xmitter empty */
|
||||
#define LSR_ERR 0x80 /* Error */
|
||||
#define LSR_DR 0x01 /* Data ready */
|
||||
#define LSR_OE 0x02 /* Overrun */
|
||||
#define LSR_PE 0x04 /* Parity error */
|
||||
#define LSR_FE 0x08 /* Framing error */
|
||||
#define LSR_BI 0x10 /* Break */
|
||||
#define LSR_THRE 0x20 /* Xmit holding register empty */
|
||||
#define LSR_TEMT 0x40 /* Xmitter empty */
|
||||
#define LSR_ERR 0x80 /* Error */
|
||||
|
||||
/* useful defaults for LCR*/
|
||||
#define LCR_8N1 0x03
|
||||
|
||||
|
||||
volatile struct NS16550 * NS16550_init(int chan, int baud_divisor);
|
||||
void NS16550_putc(volatile struct NS16550 *com_port, unsigned char c);
|
||||
unsigned char NS16550_getc(volatile struct NS16550 *com_port);
|
||||
int NS16550_tstc(volatile struct NS16550 *com_port);
|
||||
void NS16550_reinit(volatile struct NS16550 *com_port, int baud_divisor);
|
||||
volatile struct NS16550 *NS16550_init (int chan, int baud_divisor);
|
||||
void NS16550_putc (volatile struct NS16550 *com_port, unsigned char c);
|
||||
unsigned char NS16550_getc (volatile struct NS16550 *com_port);
|
||||
int NS16550_tstc (volatile struct NS16550 *com_port);
|
||||
void NS16550_reinit (volatile struct NS16550 *com_port, int baud_divisor);
|
||||
|
||||
47
board/cerf250/Makefile
Normal file
47
board/cerf250/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := cerf250.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
|
||||
|
||||
#########################################################################
|
||||
75
board/cerf250/cerf250.c
Normal file
75
board/cerf250/cerf250.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/*
|
||||
* Miscelaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* memory and cpu-speed are setup before relocation */
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* arch number of cerf PXA Board */
|
||||
gd->bd->bi_arch_number = 139;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0xa0000100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
setenv("stdout", "serial");
|
||||
setenv("stderr", "serial");
|
||||
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;
|
||||
gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
|
||||
gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
|
||||
gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
|
||||
gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
5
board/cerf250/config.mk
Normal file
5
board/cerf250/config.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Cerf board with PXA250 cpu
|
||||
#
|
||||
#
|
||||
TEXT_BASE = 0xa3080000
|
||||
431
board/cerf250/flash.c
Normal file
431
board/cerf250/flash.c
Normal file
@@ -0,0 +1,431 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* Board support for 1 or 2 flash devices */
|
||||
#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;
|
||||
case 1:
|
||||
flash_get_size ((FPW *) PHYS_FLASH_2, &flash_info[i]);
|
||||
flash_get_offsets (PHYS_FLASH_2, &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;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (FPW *addr, flash_info_t *info)
|
||||
{
|
||||
volatile FPW value;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0x5555] = (FPW) 0x00AA00AA;
|
||||
addr[0x2AAA] = (FPW) 0x00550055;
|
||||
addr[0x5555] = (FPW) 0x00900090;
|
||||
|
||||
mb ();
|
||||
value = addr[0];
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
mb ();
|
||||
value = addr[1]; /* device ID */
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_ID_28F128J3A:
|
||||
info->flash_id += FLASH_28F128J3A;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 16 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (info->sector_count > CFG_MAX_FLASH_SECT) {
|
||||
printf ("** ERROR: sector count %d > max (%d) **\n",
|
||||
info->sector_count, CFG_MAX_FLASH_SECT);
|
||||
info->sector_count = CFG_MAX_FLASH_SECT;
|
||||
}
|
||||
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type, 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 = 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;
|
||||
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;
|
||||
}
|
||||
411
board/cerf250/memsetup.S
Normal file
411
board/cerf250/memsetup.S
Normal file
@@ -0,0 +1,411 @@
|
||||
/*
|
||||
* Most of this taken from Redboot hal_platform_setup.h with cleanup
|
||||
*
|
||||
* NOTE: I haven't clean this up considerably, just enough to get it
|
||||
* running. See hal_platform_setup.h for the source. See
|
||||
* board/cradle/memsetup.S for another PXA250 setup that is
|
||||
* much cleaner.
|
||||
*
|
||||
* 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>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
|
||||
DRAM_SIZE: .long CFG_DRAM_SIZE
|
||||
|
||||
/* wait for coprocessor write complete */
|
||||
.macro CPWAIT reg
|
||||
mrc p15,0,\reg,c2,c0,0
|
||||
mov \reg,\reg
|
||||
sub pc,pc,#4
|
||||
.endm
|
||||
|
||||
|
||||
/*
|
||||
* Memory setup
|
||||
*/
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
|
||||
/* Set up GPIO pins first ----------------------------------------- */
|
||||
|
||||
ldr r0, =GPSR0
|
||||
ldr r1, =CFG_GPSR0_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPSR1
|
||||
ldr r1, =CFG_GPSR1_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPSR2
|
||||
ldr r1, =CFG_GPSR2_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR0
|
||||
ldr r1, =CFG_GPCR0_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR1
|
||||
ldr r1, =CFG_GPCR1_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR2
|
||||
ldr r1, =CFG_GPCR2_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR0
|
||||
ldr r1, =CFG_GPDR0_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR1
|
||||
ldr r1, =CFG_GPDR1_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR2
|
||||
ldr r1, =CFG_GPDR2_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR0_L
|
||||
ldr r1, =CFG_GAFR0_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR0_U
|
||||
ldr r1, =CFG_GAFR0_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR1_L
|
||||
ldr r1, =CFG_GAFR1_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR1_U
|
||||
ldr r1, =CFG_GAFR1_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR2_L
|
||||
ldr r1, =CFG_GAFR2_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR2_U
|
||||
ldr r1, =CFG_GAFR2_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =PSSR /* enable GPIO pins */
|
||||
ldr r1, =CFG_PSSR_VAL
|
||||
str r1, [r0]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Enable memory interface */
|
||||
/* */
|
||||
/* The sequence below is based on the recommended init steps */
|
||||
/* detailed in the Intel PXA250 Operating Systems Developers Guide, */
|
||||
/* Chapter 10. */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 1: Wait for at least 200 microsedonds to allow internal */
|
||||
/* clocks to settle. Only necessary after hard reset... */
|
||||
/* FIXME: can be optimized later */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
ldr r3, =OSCR /* reset the OS Timer Count to zero */
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r4, =0x300 /* really 0x2E1 is about 200usec, */
|
||||
/* so 0x300 should be plenty */
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r4, r2
|
||||
bgt 1b
|
||||
|
||||
mem_init:
|
||||
|
||||
ldr r1, =MEMC_BASE /* get memory controller base addr. */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2a: Initialize Asynchronous static memory controller */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* MSC registers: timing, bus width, mem type */
|
||||
|
||||
/* MSC0: nCS(0,1) */
|
||||
ldr r2, =CFG_MSC0_VAL
|
||||
str r2, [r1, #MSC0_OFFSET]
|
||||
ldr r2, [r1, #MSC0_OFFSET] /* read back to ensure */
|
||||
/* that data latches */
|
||||
/* MSC1: nCS(2,3) */
|
||||
ldr r2, =CFG_MSC1_VAL
|
||||
str r2, [r1, #MSC1_OFFSET]
|
||||
ldr r2, [r1, #MSC1_OFFSET]
|
||||
|
||||
/* MSC2: nCS(4,5) */
|
||||
ldr r2, =CFG_MSC2_VAL
|
||||
str r2, [r1, #MSC2_OFFSET]
|
||||
ldr r2, [r1, #MSC2_OFFSET]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2b: Initialize Card Interface */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* MECR: Memory Expansion Card Register */
|
||||
ldr r2, =CFG_MECR_VAL
|
||||
str r2, [r1, #MECR_OFFSET]
|
||||
ldr r2, [r1, #MECR_OFFSET]
|
||||
|
||||
/* MCMEM0: Card Interface slot 0 timing */
|
||||
ldr r2, =CFG_MCMEM0_VAL
|
||||
str r2, [r1, #MCMEM0_OFFSET]
|
||||
ldr r2, [r1, #MCMEM0_OFFSET]
|
||||
|
||||
/* MCMEM1: Card Interface slot 1 timing */
|
||||
ldr r2, =CFG_MCMEM1_VAL
|
||||
str r2, [r1, #MCMEM1_OFFSET]
|
||||
ldr r2, [r1, #MCMEM1_OFFSET]
|
||||
|
||||
/* MCATT0: Card Interface Attribute Space Timing, slot 0 */
|
||||
ldr r2, =CFG_MCATT0_VAL
|
||||
str r2, [r1, #MCATT0_OFFSET]
|
||||
ldr r2, [r1, #MCATT0_OFFSET]
|
||||
|
||||
/* MCATT1: Card Interface Attribute Space Timing, slot 1 */
|
||||
ldr r2, =CFG_MCATT1_VAL
|
||||
str r2, [r1, #MCATT1_OFFSET]
|
||||
ldr r2, [r1, #MCATT1_OFFSET]
|
||||
|
||||
/* MCIO0: Card Interface I/O Space Timing, slot 0 */
|
||||
ldr r2, =CFG_MCIO0_VAL
|
||||
str r2, [r1, #MCIO0_OFFSET]
|
||||
ldr r2, [r1, #MCIO0_OFFSET]
|
||||
|
||||
/* MCIO1: Card Interface I/O Space Timing, slot 1 */
|
||||
ldr r2, =CFG_MCIO1_VAL
|
||||
str r2, [r1, #MCIO1_OFFSET]
|
||||
ldr r2, [r1, #MCIO1_OFFSET]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2c: Write FLYCNFG FIXME: what's that??? */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2d: Initialize Timing for Sync Memory (SDCLK0) */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Before accessing MDREFR we need a valid DRI field, so we set */
|
||||
/* this to power on defaults + DRI field, set SDRAM clocks free running */
|
||||
|
||||
ldr r3, =CFG_MDREFR_VAL
|
||||
ldr r2, =0xFFF
|
||||
and r3, r3, r2
|
||||
|
||||
ldr r0, [r1, #MDREFR_OFFSET]
|
||||
bic r0, r0, r2
|
||||
bic r0, r0, #(MDREFR_K0FREE|MDREFR_K1FREE|MDREFR_K2FREE)
|
||||
orr r0, r0, r3
|
||||
|
||||
str r0, [r1, #MDREFR_OFFSET] /* write back MDREFR */
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 3: Initialize Synchronous Static Memory (Flash/Peripherals) */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Initialize SXCNFG register. Assert the enable bits */
|
||||
|
||||
/* Write SXMRS to cause an MRS command to all enabled banks of */
|
||||
/* synchronous static memory. Note that SXLCR need not be written */
|
||||
/* at this time. */
|
||||
|
||||
/* FIXME: we use async mode for now */
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 4: Initialize SDRAM */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* set MDREFR according to user define with exception of a few bits */
|
||||
|
||||
ldr r4, =CFG_MDREFR_VAL
|
||||
ldr r2, =(MDREFR_K0RUN|MDREFR_K0DB2|MDREFR_K1RUN|MDREFR_K1DB2|\
|
||||
MDREFR_K2RUN |MDREFR_K2DB2)
|
||||
and r4, r4, r2
|
||||
bic r0, r0, r2
|
||||
orr r0, r0, r4
|
||||
|
||||
str r0, [r1, #MDREFR_OFFSET] /* write back MDREFR */
|
||||
ldr r0, [r1, #MDREFR_OFFSET]
|
||||
|
||||
/* Step 4b: de-assert MDREFR:SLFRSH. */
|
||||
|
||||
bic r0, r0, #(MDREFR_SLFRSH)
|
||||
str r0, [r1, #MDREFR_OFFSET] /* write back MDREFR */
|
||||
ldr r0, [r1, #MDREFR_OFFSET]
|
||||
|
||||
|
||||
/* Step 4c: assert MDREFR:E1PIN and E0PIO as desired, set KXFREE */
|
||||
|
||||
ldr r4, =CFG_MDREFR_VAL
|
||||
ldr r2, =(MDREFR_E0PIN|MDREFR_E1PIN|MDREFR_K0FREE| \
|
||||
MDREFR_K1FREE | MDREFR_K2FREE)
|
||||
and r4, r4, r2
|
||||
orr r0, r0, r4
|
||||
str r0, [r1, #MDREFR_OFFSET] /* write back MDREFR */
|
||||
ldr r0, [r1, #MDREFR_OFFSET]
|
||||
|
||||
|
||||
/* Step 4d: write MDCNFG with MDCNFG:DEx deasserted (set to 0), to */
|
||||
/* configure but not enable each SDRAM partition pair. */
|
||||
|
||||
ldr r4, =CFG_MDCNFG_VAL
|
||||
bic r4, r4, #(MDCNFG_DE0|MDCNFG_DE1)
|
||||
bic r4, r4, #(MDCNFG_DE2|MDCNFG_DE3)
|
||||
str r4, [r1, #MDCNFG_OFFSET] /* write back MDCNFG */
|
||||
ldr r4, [r1, #MDCNFG_OFFSET]
|
||||
|
||||
|
||||
/* Step 4e: Wait for the clock to the SDRAMs to stabilize, */
|
||||
/* 100..200 µsec. */
|
||||
|
||||
ldr r3, =OSCR /* reset the OS Timer Count to zero */
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r4, =0x300 /* really 0x2E1 is about 200usec, */
|
||||
/* so 0x300 should be plenty */
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r4, r2
|
||||
bgt 1b
|
||||
|
||||
|
||||
/* Step 4f: Trigger a number (usually 8) refresh cycles by */
|
||||
/* attempting non-burst read or write accesses to disabled */
|
||||
/* SDRAM, as commonly specified in the power up sequence */
|
||||
/* documented in SDRAM data sheets. The address(es) used */
|
||||
/* for this purpose must not be cacheable. */
|
||||
|
||||
ldr r3, =CFG_DRAM_BASE
|
||||
.rept 8
|
||||
str r2, [r3]
|
||||
.endr
|
||||
|
||||
/* Step 4g: Write MDCNFG with enable bits asserted */
|
||||
/* (MDCNFG:DEx set to 1). */
|
||||
|
||||
ldr r3, [r1, #MDCNFG_OFFSET]
|
||||
orr r3, r3, #(MDCNFG_DE0|MDCNFG_DE1)
|
||||
str r3, [r1, #MDCNFG_OFFSET]
|
||||
|
||||
/* Step 4h: Write MDMRS. */
|
||||
|
||||
ldr r2, =CFG_MDMRS_VAL
|
||||
str r2, [r1, #MDMRS_OFFSET]
|
||||
|
||||
|
||||
/* We are finished with Intel's memory controller initialisation */
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Disable (mask) all interrupts at interrupt controller */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
initirqs:
|
||||
|
||||
mov r1, #0 /* clear int. level register (IRQ, not FIQ) */
|
||||
ldr r2, =ICLR
|
||||
str r1, [r2]
|
||||
|
||||
ldr r2, =ICMR /* mask all interrupts at the controller */
|
||||
str r1, [r2]
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Clock initialisation */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
initclks:
|
||||
|
||||
/* Disable the peripheral clocks, and set the core clock frequency */
|
||||
|
||||
/* Turn Off ALL on-chip peripheral clocks for re-configuration */
|
||||
/* Note: See label 'ENABLECLKS' for the re-enabling */
|
||||
ldr r1, =CKEN
|
||||
mov r2, #0
|
||||
str r2, [r1]
|
||||
|
||||
|
||||
/* default value in case no valid rotary switch setting is found */
|
||||
ldr r2, =(CCCR_L27|CCCR_M2|CCCR_N10) /* DEFAULT: {200/200/100} */
|
||||
|
||||
/* ... and write the core clock config register */
|
||||
ldr r1, =CCCR
|
||||
str r2, [r1]
|
||||
|
||||
#ifdef RTC
|
||||
/* enable the 32Khz oscillator for RTC and PowerManager */
|
||||
|
||||
ldr r1, =OSCC
|
||||
mov r2, #OSCC_OON
|
||||
str r2, [r1]
|
||||
|
||||
/* NOTE: spin here until OSCC.OOK get set, meaning the PLL */
|
||||
/* has settled. */
|
||||
60:
|
||||
ldr r2, [r1]
|
||||
ands r2, r2, #1
|
||||
beq 60b
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Save SDRAM size */
|
||||
ldr r1, =DRAM_SIZE
|
||||
str r8, [r1]
|
||||
|
||||
/* Interrupt init: Mask all interrupts */
|
||||
ldr r0, =ICMR /* enable no sources */
|
||||
mov r1, #0
|
||||
str r1, [r0]
|
||||
|
||||
/* FIXME */
|
||||
|
||||
#define NODEBUG
|
||||
#ifdef NODEBUG
|
||||
/*Disable software and data breakpoints */
|
||||
mov r0,#0
|
||||
mcr p15,0,r0,c14,c8,0 /* ibcr0 */
|
||||
mcr p15,0,r0,c14,c9,0 /* ibcr1 */
|
||||
mcr p15,0,r0,c14,c4,0 /* dbcon */
|
||||
|
||||
/*Enable all debug functionality */
|
||||
mov r0,#0x80000000
|
||||
mcr p14,0,r0,c10,c0,0 /* dcsr */
|
||||
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* End memsetup */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
endmemsetup:
|
||||
|
||||
mov pc, lr
|
||||
@@ -21,23 +21,35 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* FLASH Memory Map as used by FADS Monitor:
|
||||
*
|
||||
* Start Address Length
|
||||
* +-----------------------+ 0xFE00_0000 Start of Flash -----------------
|
||||
* | MON8xx code | 0xFE00_0100 Reset Vector
|
||||
* +-----------------------+ 0xFE0?_????
|
||||
* | (unused) |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +=======================+
|
||||
* | |
|
||||
* | ... |
|
||||
*****************************************************************************/
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/pxa/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 = .;
|
||||
}
|
||||
@@ -43,152 +43,166 @@
|
||||
|
||||
const iop_conf_t iop_conf_tab[4][32] = {
|
||||
|
||||
/* Port A configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PA31 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA30 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA29 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA28 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA27 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA26 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA25 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA24 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA23 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA22 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA21 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA20 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA19 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA18 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA17 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA16 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA15 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA14 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA13 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA12 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA11 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA10 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC2 TXD */
|
||||
/* PA8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC2 RXD */
|
||||
/* PA7 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA6 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA5 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA4 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA3 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA2 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA1 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PA0 */ { 0, 0, 0, 0, 0, 0 }
|
||||
},
|
||||
/* Port A configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PA31 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA30 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA29 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA28 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA27 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA26 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA25 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA24 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA23 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA22 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA21 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA20 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA19 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA18 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA17 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA16 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA15 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA14 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA13 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA12 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA11 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA10 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA9 */ {1, 1, 0, 1, 0, 0},
|
||||
/* SMC2 TXD */
|
||||
/* PA8 */ {1, 1, 0, 0, 0, 0},
|
||||
/* SMC2 RXD */
|
||||
/* PA7 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA6 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA5 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA4 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA3 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA2 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA1 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PA0 */ {0, 0, 0, 0, 0, 0}
|
||||
},
|
||||
|
||||
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PB31 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB30 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB29 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB28 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB27 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB26 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB25 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB24 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB23 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB22 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB21 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB20 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB19 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB18 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB17 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB16 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB15 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB14 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB13 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB12 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB11 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB10 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB9 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB8 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB7 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB6 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB5 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PB4 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* 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 */
|
||||
},
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PB31 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB30 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB29 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB28 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB27 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB26 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB25 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB24 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB23 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB22 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB21 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB20 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB19 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB18 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB17 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB16 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB15 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB14 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB13 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB12 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB11 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB10 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB9 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB8 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB7 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB6 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB5 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PB4 */ {0, 0, 0, 0, 0, 0},
|
||||
/* 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 */
|
||||
},
|
||||
|
||||
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PC31 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC30 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC29 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC28 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC27 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC26 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC25 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC24 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC23 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC22 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC21 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC20 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC19 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC18 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC17 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC16 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC15 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC14 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC13 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC12 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC11 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC10 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC9 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC8 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC7 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC6 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC5 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC4 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC3 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC2 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC1 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PC0 */ { 0, 0, 0, 0, 0, 0 }
|
||||
},
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PC31 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC30 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC29 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC28 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC27 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC26 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC25 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC24 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC23 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC22 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC21 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC20 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC19 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC18 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC17 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC16 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC15 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC14 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC13 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC12 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC11 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC10 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC9 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC8 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC7 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC6 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC5 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC4 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC3 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC2 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC1 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PC0 */ {0, 0, 0, 0, 0, 0}
|
||||
},
|
||||
|
||||
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PD31 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD30 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD29 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD28 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD27 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD26 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD25 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD24 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD23 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD22 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD21 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD20 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD19 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD18 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD17 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD16 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD15 */ { 1, 1, 1, 0, 0, 0 }, /* I2C SDA */
|
||||
/* PD14 */ { 1, 1, 1, 0, 0, 0 }, /* I2C SCL */
|
||||
/* PD13 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD12 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD11 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD10 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC1 TXD */
|
||||
/* PD8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC1 RXD */
|
||||
/* PD7 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD6 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD5 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* PD4 */ { 0, 0, 0, 0, 0, 0 },
|
||||
/* 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 */
|
||||
}
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PD31 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD30 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD29 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD28 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD27 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD26 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD25 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD24 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD23 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD22 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD21 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD20 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD19 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD18 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD17 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD16 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD15 */ {1, 1, 1, 0, 0, 0},
|
||||
/* I2C SDA */
|
||||
/* PD14 */ {1, 1, 1, 0, 0, 0},
|
||||
/* I2C SCL */
|
||||
/* PD13 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD12 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD11 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD10 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD9 */ {1, 1, 0, 1, 0, 0},
|
||||
/* SMC1 TXD */
|
||||
/* PD8 */ {1, 1, 0, 0, 0, 0},
|
||||
/* SMC1 RXD */
|
||||
/* PD7 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD6 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD5 */ {0, 0, 0, 0, 0, 0},
|
||||
/* PD4 */ {0, 0, 0, 0, 0, 0},
|
||||
/* 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 */
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* CONFIG_8260 */
|
||||
#endif /* CONFIG_8260 */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -196,12 +210,11 @@ const iop_conf_t iop_conf_tab[4][32] = {
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int
|
||||
checkboard(void)
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: Cogent " COGENT_MOTHERBOARD " motherboard with a "
|
||||
COGENT_CPU_MODULE " CPU Module\n");
|
||||
return (0);
|
||||
puts ("Board: Cogent " COGENT_MOTHERBOARD " motherboard with a "
|
||||
COGENT_CPU_MODULE " CPU Module\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -213,46 +226,44 @@ checkboard(void)
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
printf ("DIPSW: ");
|
||||
dipsw_init();
|
||||
return (0);
|
||||
printf ("DIPSW: ");
|
||||
dipsw_init ();
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int
|
||||
initdram(int board_type)
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
#if CONFIG_CMA111
|
||||
return (32L * 1024L * 1024L);
|
||||
#ifdef CONFIG_CMA111
|
||||
return (32L * 1024L * 1024L);
|
||||
#else
|
||||
unsigned char dipsw_val;
|
||||
int dual, size0, size1;
|
||||
long int memsize;
|
||||
unsigned char dipsw_val;
|
||||
int dual, size0, size1;
|
||||
long int memsize;
|
||||
|
||||
dipsw_val = dipsw_cooked();
|
||||
dipsw_val = dipsw_cooked ();
|
||||
|
||||
dual = dipsw_val & 0x01;
|
||||
size0 = (dipsw_val & 0x08) >> 3;
|
||||
size1 = (dipsw_val & 0x04) >> 2;
|
||||
dual = dipsw_val & 0x01;
|
||||
size0 = (dipsw_val & 0x08) >> 3;
|
||||
size1 = (dipsw_val & 0x04) >> 2;
|
||||
|
||||
if (size0)
|
||||
if (size1)
|
||||
memsize = 16L * 1024L * 1024L;
|
||||
else
|
||||
memsize = 1L * 1024L * 1024L;
|
||||
else
|
||||
if (size1)
|
||||
memsize = 4L * 1024L * 1024L;
|
||||
if (size0)
|
||||
if (size1)
|
||||
memsize = 16L * 1024L * 1024L;
|
||||
else
|
||||
memsize = 1L * 1024L * 1024L;
|
||||
else if (size1)
|
||||
memsize = 4L * 1024L * 1024L;
|
||||
else {
|
||||
printf("[Illegal dip switch settings - assuming 16Mbyte SIMMs] ");
|
||||
memsize = 16L * 1024L * 1024L; /* shouldn't happen - guess 16M */
|
||||
printf ("[Illegal dip switch settings - assuming 16Mbyte SIMMs] ");
|
||||
memsize = 16L * 1024L * 1024L; /* shouldn't happen - guess 16M */
|
||||
}
|
||||
|
||||
if (dual)
|
||||
memsize *= 2L;
|
||||
if (dual)
|
||||
memsize *= 2L;
|
||||
|
||||
return (memsize);
|
||||
return (memsize);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -265,21 +276,21 @@ initdram(int board_type)
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
printf ("LCD: ");
|
||||
lcd_init();
|
||||
printf ("LCD: ");
|
||||
lcd_init ();
|
||||
|
||||
#if 0
|
||||
printf ("RTC: ");
|
||||
rtc_init();
|
||||
printf ("RTC: ");
|
||||
rtc_init ();
|
||||
|
||||
printf ("PAR: ");
|
||||
par_init();
|
||||
printf ("PAR: ");
|
||||
par_init ();
|
||||
|
||||
printf ("KBM: ");
|
||||
kbm_init();
|
||||
printf ("KBM: ");
|
||||
kbm_init ();
|
||||
|
||||
printf ("PCI: ");
|
||||
pci_init();
|
||||
printf ("PCI: ");
|
||||
pci_init ();
|
||||
#endif
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <mpc824x.h>
|
||||
#include <asm/processor.h>
|
||||
#include <pci.h>
|
||||
#include <i2c.h>
|
||||
|
||||
int sysControlDisplay(int digit, uchar ascii_code);
|
||||
extern void Plx9030Init(void);
|
||||
@@ -49,7 +50,7 @@ int checkboard(void)
|
||||
ulong busfreq = get_bus_freq(0);
|
||||
char buf[32];
|
||||
|
||||
printf("CPC45 ");
|
||||
puts ("CPC45 ");
|
||||
/*
|
||||
printf("Revision %d ", revision);
|
||||
*/
|
||||
@@ -58,46 +59,134 @@ int checkboard(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int initdram(int board_type)
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
long size;
|
||||
long new_bank0_end;
|
||||
long mear1;
|
||||
long emear1;
|
||||
int m, row, col, bank, i, ref;
|
||||
unsigned long start, end;
|
||||
uint32_t mccr1, mccr2;
|
||||
uint32_t mear1 = 0, emear1 = 0, msar1 = 0, emsar1 = 0;
|
||||
uint32_t mear2 = 0, emear2 = 0, msar2 = 0, emsar2 = 0;
|
||||
uint8_t mber = 0;
|
||||
unsigned int tmp;
|
||||
|
||||
size = get_ram_size(CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE);
|
||||
i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||
|
||||
new_bank0_end = size - 1;
|
||||
mear1 = mpc824x_mpc107_getreg(MEAR1);
|
||||
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);
|
||||
if (i2c_reg_read (0x50, 2) != 0x04)
|
||||
return 0; /* Memory type */
|
||||
|
||||
return (size);
|
||||
m = i2c_reg_read (0x50, 5); /* # of physical banks */
|
||||
row = i2c_reg_read (0x50, 3); /* # of rows */
|
||||
col = i2c_reg_read (0x50, 4); /* # of columns */
|
||||
bank = i2c_reg_read (0x50, 17); /* # of logical banks */
|
||||
ref = i2c_reg_read (0x50, 12); /* refresh rate / type */
|
||||
|
||||
CONFIG_READ_WORD(MCCR1, mccr1);
|
||||
mccr1 &= 0xffff0000;
|
||||
|
||||
CONFIG_READ_WORD(MCCR2, mccr2);
|
||||
mccr2 &= 0xffff0000;
|
||||
|
||||
start = CFG_SDRAM_BASE;
|
||||
end = start + (1 << (col + row + 3) ) * bank - 1;
|
||||
|
||||
for (i = 0; i < m; i++) {
|
||||
mccr1 |= ((row == 13)? 2 : (bank == 4)? 0 : 3) << i * 2;
|
||||
if (i < 4) {
|
||||
msar1 |= ((start >> 20) & 0xff) << i * 8;
|
||||
emsar1 |= ((start >> 28) & 0xff) << i * 8;
|
||||
mear1 |= ((end >> 20) & 0xff) << i * 8;
|
||||
emear1 |= ((end >> 28) & 0xff) << i * 8;
|
||||
} else {
|
||||
msar2 |= ((start >> 20) & 0xff) << (i-4) * 8;
|
||||
emsar2 |= ((start >> 28) & 0xff) << (i-4) * 8;
|
||||
mear2 |= ((end >> 20) & 0xff) << (i-4) * 8;
|
||||
emear2 |= ((end >> 28) & 0xff) << (i-4) * 8;
|
||||
}
|
||||
mber |= 1 << i;
|
||||
start += (1 << (col + row + 3) ) * bank;
|
||||
end += (1 << (col + row + 3) ) * bank;
|
||||
}
|
||||
for (; i < 8; i++) {
|
||||
if (i < 4) {
|
||||
msar1 |= 0xff << i * 8;
|
||||
emsar1 |= 0x30 << i * 8;
|
||||
mear1 |= 0xff << i * 8;
|
||||
emear1 |= 0x30 << i * 8;
|
||||
} else {
|
||||
msar2 |= 0xff << (i-4) * 8;
|
||||
emsar2 |= 0x30 << (i-4) * 8;
|
||||
mear2 |= 0xff << (i-4) * 8;
|
||||
emear2 |= 0x30 << (i-4) * 8;
|
||||
}
|
||||
}
|
||||
|
||||
switch(ref) {
|
||||
case 0x00:
|
||||
case 0x80:
|
||||
tmp = get_bus_freq(0) / 1000000 * 15625 / 1000 - 22;
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x81:
|
||||
tmp = get_bus_freq(0) / 1000000 * 3900 / 1000 - 22;
|
||||
break;
|
||||
case 0x02:
|
||||
case 0x82:
|
||||
tmp = get_bus_freq(0) / 1000000 * 7800 / 1000 - 22;
|
||||
break;
|
||||
case 0x03:
|
||||
case 0x83:
|
||||
tmp = get_bus_freq(0) / 1000000 * 31300 / 1000 - 22;
|
||||
break;
|
||||
case 0x04:
|
||||
case 0x84:
|
||||
tmp = get_bus_freq(0) / 1000000 * 62500 / 1000 - 22;
|
||||
break;
|
||||
case 0x05:
|
||||
case 0x85:
|
||||
tmp = get_bus_freq(0) / 1000000 * 125000 / 1000 - 22;
|
||||
break;
|
||||
default:
|
||||
tmp = 0x512;
|
||||
break;
|
||||
}
|
||||
|
||||
CONFIG_WRITE_WORD(MCCR1, mccr1);
|
||||
CONFIG_WRITE_WORD(MCCR2, tmp << MCCR2_REFINT_SHIFT);
|
||||
CONFIG_WRITE_WORD(MSAR1, msar1);
|
||||
CONFIG_WRITE_WORD(EMSAR1, emsar1);
|
||||
CONFIG_WRITE_WORD(MEAR1, mear1);
|
||||
CONFIG_WRITE_WORD(EMEAR1, emear1);
|
||||
CONFIG_WRITE_WORD(MSAR2, msar2);
|
||||
CONFIG_WRITE_WORD(EMSAR2, emsar2);
|
||||
CONFIG_WRITE_WORD(MEAR2, mear2);
|
||||
CONFIG_WRITE_WORD(EMEAR2, emear2);
|
||||
CONFIG_WRITE_BYTE(MBER, mber);
|
||||
|
||||
return (1 << (col + row + 3) ) * bank * m;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize PCI Devices, report devices found.
|
||||
*/
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
|
||||
static struct pci_config_table pci_sandpoint_config_table[] = {
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0f, PCI_ANY_ID,
|
||||
static struct pci_config_table pci_cpc45_config_table[] = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0F, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0D, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_PLX9030_IOADDR,
|
||||
PCI_PLX9030_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
#endif /*CONFIG_PCI_PNP*/
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
struct pci_controller hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table: pci_sandpoint_config_table,
|
||||
config_table: pci_cpc45_config_table,
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -108,6 +197,9 @@ void pci_init_board(void)
|
||||
/* init PCI_to_LOCAL Bus BRIDGE */
|
||||
Plx9030Init();
|
||||
|
||||
/* Clear Display */
|
||||
DISP_CWORD = 0x0;
|
||||
|
||||
sysControlDisplay(0,' ');
|
||||
sysControlDisplay(1,'C');
|
||||
sysControlDisplay(2,'P');
|
||||
@@ -130,16 +222,14 @@ void pci_init_board(void)
|
||||
* RETURNS: NA
|
||||
*/
|
||||
|
||||
int sysControlDisplay
|
||||
(
|
||||
int digit, /* number of digit 0..7 */
|
||||
uchar ascii_code /* ASCII code */
|
||||
)
|
||||
int sysControlDisplay (int digit, /* number of digit 0..7 */
|
||||
uchar ascii_code /* ASCII code */
|
||||
)
|
||||
{
|
||||
if ((digit < 0) || (digit > 7))
|
||||
return (-1);
|
||||
|
||||
*((volatile uchar*)(DISP_CHR_RAM + digit)) = ascii_code;
|
||||
*((volatile uchar *) (DISP_CHR_RAM + digit)) = ascii_code;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
#define MAIN_SECT_SIZE 0x40000
|
||||
#define PARAM_SECT_SIZE 0x8000
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
static int write_data (flash_info_t *info, ulong dest, ulong *data);
|
||||
static void write_via_fpu(vu_long *addr, ulong *data);
|
||||
static __inline__ unsigned long get_msr(void);
|
||||
static __inline__ void set_msr(unsigned long msr);
|
||||
static int write_data (flash_info_t * info, ulong dest, ulong * data);
|
||||
static void write_via_fpu (vu_long * addr, ulong * data);
|
||||
static __inline__ unsigned long get_msr (void);
|
||||
static __inline__ void set_msr (unsigned long msr);
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
#undef DEBUG_FLASH
|
||||
@@ -62,102 +62,132 @@ static __inline__ void set_msr(unsigned long msr);
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init(void)
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i, j;
|
||||
ulong size = 0;
|
||||
uchar tempChar;
|
||||
int i, j;
|
||||
ulong size = 0;
|
||||
uchar tempChar;
|
||||
vu_long *tmpaddr;
|
||||
|
||||
/* Enable flash writes on CPC45 */
|
||||
/* Enable flash writes on CPC45 */
|
||||
|
||||
tempChar = BOARD_CTRL;
|
||||
tempChar = BOARD_CTRL;
|
||||
|
||||
tempChar |= (B_CTRL_FWPT_1 | B_CTRL_FWRE_1);
|
||||
tempChar |= (B_CTRL_FWPT_1 | B_CTRL_FWRE_1);
|
||||
|
||||
tempChar &= ~(B_CTRL_FWPT_0 | B_CTRL_FWRE_0);
|
||||
tempChar &= ~(B_CTRL_FWPT_0 | B_CTRL_FWRE_0);
|
||||
|
||||
BOARD_CTRL = tempChar;
|
||||
BOARD_CTRL = tempChar;
|
||||
|
||||
__asm__ volatile ("sync\n eieio");
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
vu_long *addr = (vu_long *) (CFG_FLASH_BASE + i * FLASH_BANK_SIZE);
|
||||
|
||||
addr[0] = 0x00900090;
|
||||
|
||||
__asm__ volatile ("sync\n eieio");
|
||||
|
||||
udelay (100);
|
||||
|
||||
DEBUGF ("Flash bank # %d:\n"
|
||||
"\tManuf. ID @ 0x%08lX: 0x%08lX\n"
|
||||
"\tDevice ID @ 0x%08lX: 0x%08lX\n",
|
||||
i,
|
||||
(ulong) (&addr[0]), addr[0],
|
||||
(ulong) (&addr[2]), addr[2]);
|
||||
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
vu_long *addr = (vu_long *)(CFG_FLASH_BASE + i * FLASH_BANK_SIZE);
|
||||
if ((addr[0] == addr[1]) && (addr[0] == INTEL_MANUFACT) &&
|
||||
(addr[2] == addr[3]) && (addr[2] == INTEL_ID_28F160F3T)) {
|
||||
|
||||
addr[0] = 0x00900090;
|
||||
flash_info[i].flash_id =
|
||||
(FLASH_MAN_INTEL & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F160F3T & FLASH_TYPEMASK);
|
||||
|
||||
DEBUGF ("Flash bank # %d:\n"
|
||||
"\tManuf. ID @ 0x%08lX: 0x%08lX\n"
|
||||
"\tDevice ID @ 0x%08lX: 0x%08lX\n",
|
||||
i,
|
||||
(ulong)(&addr[0]), addr[0],
|
||||
(ulong)(&addr[2]), addr[2]);
|
||||
} else if ((addr[0] == addr[1]) && (addr[0] == INTEL_MANUFACT)
|
||||
&& (addr[2] == addr[3])
|
||||
&& (addr[2] == INTEL_ID_28F160C3T)) {
|
||||
|
||||
flash_info[i].flash_id =
|
||||
(FLASH_MAN_INTEL & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F160C3T & FLASH_TYPEMASK);
|
||||
|
||||
if ((addr[0] == addr[1]) && (addr[0] == INTEL_MANUFACT) &&
|
||||
(addr[2] == addr[3]) && (addr[2] == INTEL_ID_28F160F3T))
|
||||
{
|
||||
|
||||
flash_info[i].flash_id = (FLASH_MAN_INTEL & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F160F3T & FLASH_TYPEMASK);
|
||||
|
||||
} else {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
addr[0] = 0xFFFFFFFF;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
DEBUGF ("flash_id = 0x%08lX\n", flash_info[i].flash_id);
|
||||
|
||||
addr[0] = 0xFFFFFFFF;
|
||||
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset(flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
if (j > 30) {
|
||||
flash_info[i].start[j] = CFG_FLASH_BASE +
|
||||
i * FLASH_BANK_SIZE +
|
||||
(MAIN_SECT_SIZE * 31) + (j - 31) * PARAM_SECT_SIZE;
|
||||
} else {
|
||||
flash_info[i].start[j] = CFG_FLASH_BASE +
|
||||
i * FLASH_BANK_SIZE +
|
||||
j * MAIN_SECT_SIZE;
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
addr[0] = 0xFFFFFFFF;
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
DEBUGF ("flash_id = 0x%08lX\n", flash_info[i].flash_id);
|
||||
|
||||
addr[0] = 0xFFFFFFFF;
|
||||
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
if (j > 30) {
|
||||
flash_info[i].start[j] = CFG_FLASH_BASE +
|
||||
i * FLASH_BANK_SIZE +
|
||||
(MAIN_SECT_SIZE * 31) + (j -
|
||||
31) *
|
||||
PARAM_SECT_SIZE;
|
||||
} else {
|
||||
flash_info[i].start[j] = CFG_FLASH_BASE +
|
||||
i * FLASH_BANK_SIZE +
|
||||
j * MAIN_SECT_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
/* unlock sectors, if 160C3T */
|
||||
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
tmpaddr = (vu_long *) flash_info[i].start[j];
|
||||
|
||||
if ((flash_info[i].flash_id & FLASH_TYPEMASK) ==
|
||||
(INTEL_ID_28F160C3T & FLASH_TYPEMASK)) {
|
||||
tmpaddr[0] = 0x00600060;
|
||||
tmpaddr[0] = 0x00D000D0;
|
||||
tmpaddr[1] = 0x00600060;
|
||||
tmpaddr[1] = 0x00D000D0;
|
||||
}
|
||||
}
|
||||
|
||||
size += flash_info[i].size;
|
||||
|
||||
addr[0] = 0x00FF00FF;
|
||||
addr[1] = 0x00FF00FF;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE + FLASH_BANK_SIZE
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[1]);
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[1]);
|
||||
#else
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
#if CFG_ENV_ADDR >= CFG_FLASH_BASE + FLASH_BANK_SIZE
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[1]);
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[1]);
|
||||
#else
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[0]);
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Done:
|
||||
return size;
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
@@ -179,6 +209,11 @@ void flash_print_info (flash_info_t * info)
|
||||
case (INTEL_ID_28F160F3T & FLASH_TYPEMASK):
|
||||
printf ("28F160F3T (16Mbit)\n");
|
||||
break;
|
||||
|
||||
case (INTEL_ID_28F160C3T & FLASH_TYPEMASK):
|
||||
printf ("28F160C3T (16Mbit)\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Unknown Chip Type 0x%04x\n", i);
|
||||
goto Done;
|
||||
@@ -186,7 +221,7 @@ void flash_print_info (flash_info_t * info)
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
@@ -194,7 +229,7 @@ void flash_print_info (flash_info_t * info)
|
||||
printf ("\n ");
|
||||
}
|
||||
printf (" %08lX%s", info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
@@ -205,7 +240,7 @@ Done:
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong start, now, last;
|
||||
@@ -229,33 +264,32 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
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);
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n", prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
last = start;
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
vu_long *addr = (vu_long *)(info->start[sect]);
|
||||
vu_long *addr = (vu_long *) (info->start[sect]);
|
||||
|
||||
DEBUGF ("Erase sect %d @ 0x%08lX\n",
|
||||
sect, (ulong)addr);
|
||||
sect, (ulong) addr);
|
||||
|
||||
/* Disable interrupts which might cause a timeout
|
||||
* here.
|
||||
*/
|
||||
flag = disable_interrupts();
|
||||
flag = disable_interrupts ();
|
||||
|
||||
addr[0] = 0x00500050; /* clear status register */
|
||||
addr[0] = 0x00200020; /* erase setup */
|
||||
@@ -267,23 +301,23 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
enable_interrupts ();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
while (((addr[0] & 0x00800080) != 0x00800080) ||
|
||||
((addr[1] & 0x00800080) != 0x00800080) ) {
|
||||
if ((now=get_timer(start)) >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
((addr[1] & 0x00800080) != 0x00800080)) {
|
||||
if ((now = get_timer (start)) >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
addr[0] = 0x00B000B0; /* suspend erase */
|
||||
addr[0] = 0x00FF00FF; /* to read mode */
|
||||
addr[0] = 0x00B000B0; /* suspend erase */
|
||||
addr[0] = 0x00FF00FF; /* to read mode */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
@@ -306,7 +340,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
|
||||
#define FLASH_WIDTH 8 /* flash bus width in bytes */
|
||||
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong wp, cp, msr;
|
||||
int l, rc, i;
|
||||
@@ -315,16 +349,16 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
ulong *datal = &data[1];
|
||||
|
||||
DEBUGF ("Flash write_buff: @ 0x%08lx, src 0x%08lx len %ld\n",
|
||||
addr, (ulong)src, cnt);
|
||||
addr, (ulong) src, cnt);
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
msr = get_msr();
|
||||
set_msr(msr | MSR_FP);
|
||||
msr = get_msr ();
|
||||
set_msr (msr | MSR_FP);
|
||||
|
||||
wp = (addr & ~(FLASH_WIDTH-1)); /* get lower aligned address */
|
||||
wp = (addr & ~(FLASH_WIDTH - 1)); /* get lower aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
@@ -335,39 +369,35 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
for (i = 0, cp = wp; i < l; i++, cp++) {
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) |
|
||||
((*datal & 0xFF000000) >> 24);
|
||||
((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | (*(uchar *)cp);
|
||||
*datal = (*datal << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < FLASH_WIDTH && cnt > 0; ++i) {
|
||||
char tmp;
|
||||
|
||||
tmp = *src;
|
||||
|
||||
src++;
|
||||
char tmp = *src++;
|
||||
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) |
|
||||
((*datal & 0xFF000000) >> 24);
|
||||
((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | tmp;
|
||||
|
||||
--cnt; ++cp;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
|
||||
for (; cnt == 0 && i < FLASH_WIDTH; ++i, ++cp) {
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) |
|
||||
((*datal & 0xFF000000) >> 24);
|
||||
((*datal & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
*datal = (*datah << 8) | (*(uchar *)cp);
|
||||
*datal = (*datah << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_data(info, wp, data)) != 0) {
|
||||
set_msr(msr);
|
||||
if ((rc = write_data (info, wp, data)) != 0) {
|
||||
set_msr (msr);
|
||||
return (rc);
|
||||
}
|
||||
|
||||
@@ -378,19 +408,19 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
* handle FLASH_WIDTH aligned part
|
||||
*/
|
||||
while (cnt >= FLASH_WIDTH) {
|
||||
*datah = *(ulong *)src;
|
||||
*datal = *(ulong *)(src + 4);
|
||||
if ((rc = write_data(info, wp, data)) != 0) {
|
||||
set_msr(msr);
|
||||
*datah = *(ulong *) src;
|
||||
*datal = *(ulong *) (src + 4);
|
||||
if ((rc = write_data (info, wp, data)) != 0) {
|
||||
set_msr (msr);
|
||||
return (rc);
|
||||
}
|
||||
wp += FLASH_WIDTH;
|
||||
wp += FLASH_WIDTH;
|
||||
cnt -= FLASH_WIDTH;
|
||||
src += FLASH_WIDTH;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
set_msr(msr);
|
||||
set_msr (msr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -399,31 +429,28 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
*/
|
||||
*datah = *datal = 0;
|
||||
for (i = 0, cp = wp; i < FLASH_WIDTH && cnt > 0; ++i, ++cp) {
|
||||
char tmp;
|
||||
|
||||
tmp = *src;
|
||||
|
||||
src++;
|
||||
char tmp = *src++;
|
||||
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >>
|
||||
24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | tmp;
|
||||
|
||||
--cnt;
|
||||
}
|
||||
|
||||
for (; i < FLASH_WIDTH; ++i, ++cp) {
|
||||
if (i >= 4) {
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >> 24);
|
||||
*datah = (*datah << 8) | ((*datal & 0xFF000000) >>
|
||||
24);
|
||||
}
|
||||
|
||||
*datal = (*datal << 8) | (*(uchar *)cp);
|
||||
*datal = (*datal << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
rc = write_data(info, wp, data);
|
||||
set_msr(msr);
|
||||
rc = write_data (info, wp, data);
|
||||
set_msr (msr);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
@@ -434,32 +461,32 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data (flash_info_t *info, ulong dest, ulong *data)
|
||||
static int write_data (flash_info_t * info, ulong dest, ulong * data)
|
||||
{
|
||||
vu_long *addr = (vu_long *)dest;
|
||||
vu_long *addr = (vu_long *) dest;
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if (((addr[0] & data[0]) != data[0]) ||
|
||||
((addr[1] & data[1]) != data[1]) ) {
|
||||
((addr[1] & data[1]) != data[1])) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
flag = disable_interrupts ();
|
||||
|
||||
addr[0] = 0x00400040; /* write setup */
|
||||
write_via_fpu(addr, data);
|
||||
addr[0] = 0x00400040; /* write setup */
|
||||
write_via_fpu (addr, data);
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
enable_interrupts ();
|
||||
|
||||
start = get_timer (0);
|
||||
|
||||
while (((addr[0] & 0x00800080) != 0x00800080) ||
|
||||
((addr[1] & 0x00800080) != 0x00800080) ) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
((addr[1] & 0x00800080) != 0x00800080)) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
addr[0] = 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
@@ -472,22 +499,24 @@ static int write_data (flash_info_t *info, ulong dest, ulong *data)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void write_via_fpu(vu_long *addr, ulong *data)
|
||||
static void write_via_fpu (vu_long * addr, ulong * data)
|
||||
{
|
||||
__asm__ __volatile__ ("lfd 1, 0(%0)" : : "r" (data));
|
||||
__asm__ __volatile__ ("stfd 1, 0(%0)" : : "r" (addr));
|
||||
__asm__ __volatile__ ("lfd 1, 0(%0)"::"r" (data));
|
||||
__asm__ __volatile__ ("stfd 1, 0(%0)"::"r" (addr));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static __inline__ unsigned long get_msr(void)
|
||||
static __inline__ unsigned long get_msr (void)
|
||||
{
|
||||
unsigned long msr;
|
||||
unsigned long msr;
|
||||
|
||||
__asm__ __volatile__ ("mfmsr %0" : "=r" (msr) :);
|
||||
return msr;
|
||||
__asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
|
||||
|
||||
return msr;
|
||||
}
|
||||
|
||||
static __inline__ void set_msr(unsigned long msr)
|
||||
static __inline__ void set_msr (unsigned long msr)
|
||||
{
|
||||
__asm__ __volatile__ ("mtmsr %0" : : "r" (msr));
|
||||
__asm__ __volatile__ ("mtmsr %0"::"r" (msr));
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -44,17 +44,12 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
bss_start = .;
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
bss_end = .;
|
||||
|
||||
armboot_end = .;
|
||||
|
||||
_end = .;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
* (C) Copyright 2002
|
||||
* Robert Schwebel, Pengutronix, <r.schwebel@pengutronix.de>
|
||||
*
|
||||
* (C) Copyright 2003 (2 x 16 bit Flash bank patches)
|
||||
* Rolf Peukert, IMMS gGmbH, <rolf.peukert@imms.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
@@ -19,7 +22,7 @@
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
@@ -32,9 +35,9 @@
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
|
||||
#define FLASH_BANK_SIZE 0x02000000
|
||||
#define MAIN_SECT_SIZE 0x40000 /* 2x16 = 256k per sector */
|
||||
#define MAIN_SECT_SIZE 0x40000 /* 2x16 = 256k per sector */
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
|
||||
/**
|
||||
@@ -51,19 +54,19 @@ ulong flash_init(void)
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
ulong flashbase = 0;
|
||||
flash_info[i].flash_id =
|
||||
(INTEL_MANUFACT & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F128J3 & FLASH_TYPEMASK);
|
||||
(INTEL_MANUFACT & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F128J3 & FLASH_TYPEMASK);
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset(flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
flashbase = PHYS_FLASH_1;
|
||||
break;
|
||||
default:
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
case 0:
|
||||
flashbase = PHYS_FLASH_1;
|
||||
break;
|
||||
default:
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
flash_info[i].start[j] = flashbase + j*MAIN_SECT_SIZE;
|
||||
@@ -88,8 +91,6 @@ ulong flash_init(void)
|
||||
|
||||
/**
|
||||
* flash_print_info: - print information about the flash situation
|
||||
*
|
||||
* @param info:
|
||||
*/
|
||||
|
||||
void flash_print_info (flash_info_t *info)
|
||||
@@ -99,23 +100,21 @@ void flash_print_info (flash_info_t *info)
|
||||
for (j=0; j<CFG_MAX_FLASH_BANKS; j++) {
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
|
||||
case (INTEL_MANUFACT & FLASH_VENDMASK):
|
||||
printf("Intel: ");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Vendor ");
|
||||
break;
|
||||
case (INTEL_MANUFACT & FLASH_VENDMASK):
|
||||
printf ("Intel: ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
|
||||
case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
|
||||
printf("28F128J3 (128Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Chip Type\n");
|
||||
return;
|
||||
case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
|
||||
printf("28F128J3 (128Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Chip Type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf(" Size: %ld MB in %d Sectors\n",
|
||||
@@ -123,10 +122,10 @@ void flash_print_info (flash_info_t *info)
|
||||
|
||||
printf(" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if ((i % 5) == 0) printf ("\n ");
|
||||
if ((i % 5) == 0) printf ("\n ");
|
||||
|
||||
printf (" %08lX%s", info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
info++;
|
||||
@@ -136,7 +135,6 @@ void flash_print_info (flash_info_t *info)
|
||||
|
||||
/**
|
||||
* flash_erase: - erase flash sectors
|
||||
*
|
||||
*/
|
||||
|
||||
int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||
@@ -179,13 +177,13 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked();
|
||||
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
u32 * volatile addr = (u32 * volatile)(info->start[sect]);
|
||||
|
||||
/* erase sector: */
|
||||
/* erase sector: */
|
||||
/* The strata flashs are aligned side by side on */
|
||||
/* the data bus, so we have to write the commands */
|
||||
/* to both chips here: */
|
||||
/* to both chips here: */
|
||||
|
||||
*addr = 0x00200020; /* erase setup */
|
||||
*addr = 0x00D000D0; /* erase confirm */
|
||||
@@ -198,19 +196,14 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||
goto outahere;
|
||||
}
|
||||
}
|
||||
|
||||
*addr = 0x00500050; /* clear status register cmd. */
|
||||
*addr = 0x00FF00FF; /* resest to read mode */
|
||||
|
||||
*addr = 0x00FF00FF; /* reset to read mode */
|
||||
}
|
||||
|
||||
printf("ok.\n");
|
||||
}
|
||||
|
||||
if (ctrlc()) printf("User Interrupt!\n");
|
||||
|
||||
outahere:
|
||||
|
||||
outahere:
|
||||
/* allow flash to settle - wait 10 ms */
|
||||
udelay_masked(10000);
|
||||
|
||||
@@ -219,22 +212,19 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* write_word: - copy memory to flash
|
||||
*
|
||||
* @param info:
|
||||
* @param dest:
|
||||
* @param data:
|
||||
* @return:
|
||||
* write_long: - copy memory to flash, assume a bank of 2 devices with 16bit each
|
||||
*/
|
||||
|
||||
static int write_word (flash_info_t *info, ulong dest, ushort data)
|
||||
static int write_long (flash_info_t *info, ulong dest, ulong data)
|
||||
{
|
||||
u32 * volatile addr = (u32 * volatile)dest, val;
|
||||
int rc = ERR_OK;
|
||||
int flag;
|
||||
|
||||
/* read array command - just for the case... */
|
||||
*addr = 0x00FF00FF;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) return ERR_NOT_ERASED;
|
||||
|
||||
@@ -248,10 +238,10 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* clear status register command */
|
||||
*addr = 0x50;
|
||||
*addr = 0x00500050;
|
||||
|
||||
/* program set-up command */
|
||||
*addr = 0x40;
|
||||
*addr = 0x00400040;
|
||||
|
||||
/* latch address/data */
|
||||
*addr = data;
|
||||
@@ -260,28 +250,30 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
|
||||
reset_timer_masked();
|
||||
|
||||
/* wait while polling the status register */
|
||||
while(((val = *addr) & 0x80) != 0x80) {
|
||||
while(((val = *addr) & 0x00800080) != 0x00800080) {
|
||||
if (get_timer_masked() > CFG_FLASH_WRITE_TOUT) {
|
||||
rc = ERR_TIMOUT;
|
||||
*addr = 0xB0; /* suspend program command */
|
||||
/* suspend program command */
|
||||
*addr = 0x00B000B0;
|
||||
goto outahere;
|
||||
}
|
||||
}
|
||||
|
||||
if(val & 0x1A) { /* check for error */
|
||||
/* check for errors */
|
||||
if(val & 0x001A001A) {
|
||||
printf("\nFlash write error %02x at address %08lx\n",
|
||||
(int)val, (unsigned long)dest);
|
||||
if(val & (1<<3)) {
|
||||
if(val & 0x00080008) {
|
||||
printf("Voltage range error.\n");
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
if(val & (1<<1)) {
|
||||
if(val & 0x00020002) {
|
||||
printf("Device protect error.\n");
|
||||
rc = ERR_PROTECTED;
|
||||
goto outahere;
|
||||
}
|
||||
if(val & (1<<4)) {
|
||||
if(val & 0x00100010) {
|
||||
printf("Programming error.\n");
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
@@ -290,9 +282,9 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
|
||||
goto outahere;
|
||||
}
|
||||
|
||||
outahere:
|
||||
|
||||
*addr = 0xFF; /* read array command */
|
||||
outahere:
|
||||
/* read array command */
|
||||
*addr = 0x00FF00FF;
|
||||
if (flag) enable_interrupts();
|
||||
|
||||
return rc;
|
||||
@@ -304,20 +296,21 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
|
||||
*
|
||||
* @param info:
|
||||
* @param src: source of copy transaction
|
||||
* @param addr: where to copy to
|
||||
* @param cnt: number of bytes to copy
|
||||
* @param addr: where to copy to
|
||||
* @param cnt: number of bytes to copy
|
||||
*
|
||||
* @return error code
|
||||
*/
|
||||
|
||||
/* "long" version, uses 32bit words */
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp;
|
||||
ushort data;
|
||||
ulong data;
|
||||
int l;
|
||||
int i, rc;
|
||||
|
||||
wp = (addr & ~1); /* get lower word aligned address */
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
@@ -325,35 +318,34 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 8);
|
||||
data = (data >> 8) | (*(uchar *)cp << 24);
|
||||
}
|
||||
for (; i<2 && cnt>0; ++i) {
|
||||
data = (data >> 8) | (*src++ << 8);
|
||||
for (; i<4 && cnt>0; ++i) {
|
||||
data = (data >> 8) | (*src++ << 24);
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<2; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 8);
|
||||
for (; cnt==0 && i<4; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 24);
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
if ((rc = write_long(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 2;
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 2) {
|
||||
/* data = *((vushort*)src); */
|
||||
data = *((ushort*)src);
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
while (cnt >= 4) {
|
||||
data = *((ulong*)src);
|
||||
if ((rc = write_long(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
src += 2;
|
||||
wp += 2;
|
||||
cnt -= 2;
|
||||
src += 4;
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if (cnt == 0) return ERR_OK;
|
||||
@@ -362,13 +354,13 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<2 && cnt>0; ++i, ++cp) {
|
||||
data = (data >> 8) | (*src++ << 8);
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
|
||||
data = (data >> 8) | (*src++ << 24);
|
||||
--cnt;
|
||||
}
|
||||
for (; i<2; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 8);
|
||||
for (; i<4; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 24);
|
||||
}
|
||||
|
||||
return write_word(info, wp, data);
|
||||
return write_long(info, wp, data);
|
||||
}
|
||||
|
||||
@@ -44,16 +44,12 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
bss_start = .;
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
bss_end = .;
|
||||
|
||||
armboot_end = .;
|
||||
_end = .;
|
||||
}
|
||||
|
||||
51
board/csb272/Makefile
Normal file
51
board/csb272/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# (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
|
||||
#OBJS = $(BOARD).o strataflash.o
|
||||
OBJS = $(BOARD).o
|
||||
|
||||
SOBJS = init.o
|
||||
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
36
board/csb272/config.mk
Normal file
36
board/csb272/config.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# Tolunay Orkun, NextIO Inc., torkun@nextio.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
|
||||
#
|
||||
|
||||
#
|
||||
# Cogent CSB272 board
|
||||
#
|
||||
|
||||
LDFLAGS += $(LINKER_UNDEFS)
|
||||
|
||||
TEXT_BASE := 0xFFFC0000
|
||||
#TEXT_BASE := 0x00100000
|
||||
|
||||
PLATFORM_RELFLAGS := $(PLATFORM_RELFLAGS)
|
||||
173
board/csb272/csb272.c
Normal file
173
board/csb272/csb272.c
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Tolunay Orkun, Nextio Inc., torkun@nextio.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <i2c.h>
|
||||
#include <miiphy.h>
|
||||
#include <405gp_enet.h>
|
||||
|
||||
/*
|
||||
* Configuration data for AMIS FS6377-01 Programmable 3-PLL Clock Generator
|
||||
*
|
||||
* CLKA output => Epson LCD Controller
|
||||
* CLKB output => Not Connected
|
||||
* CLKC output => Ethernet
|
||||
* CLKD output => UART external clock
|
||||
*
|
||||
* Note: these values are obtained from device after init by micromonitor
|
||||
*/
|
||||
uchar pll_fs6377_regs[16] = {
|
||||
0x28, 0xef, 0x53, 0x03, 0x4b, 0x80, 0x32, 0x80,
|
||||
0x94, 0x32, 0x80, 0xd4, 0x56, 0xf6, 0xf6, 0xe0 };
|
||||
|
||||
/*
|
||||
* pll_init: Initialize AMIS IC FS6377-01 PLL
|
||||
*
|
||||
* PLL supplies Epson LCD Clock, Ethernet Clock and UART external clock
|
||||
*
|
||||
*/
|
||||
int pll_init(void)
|
||||
{
|
||||
i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||
|
||||
return i2c_write(CFG_I2C_PLL_ADDR, 0, 1,
|
||||
(uchar *) pll_fs6377_regs, sizeof(pll_fs6377_regs));
|
||||
}
|
||||
|
||||
/*
|
||||
* board_early_init_f: do early board initialization
|
||||
*
|
||||
*/
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
/* initialize PLL so UART, LCD, Ethernet clocked at correctly */
|
||||
(void) get_clocks();
|
||||
pll_init();
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Interrupt controller setup for the Walnut board.
|
||||
| Note: IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
| IRQ 16 405GP internally generated; active low; level sensitive
|
||||
| IRQ 17-24 RESERVED
|
||||
| IRQ 25 (EXT IRQ 0) FPGA; active high; level sensitive
|
||||
| IRQ 26 (EXT IRQ 1) SMI; active high; level sensitive
|
||||
| IRQ 27 (EXT IRQ 2) Not Used
|
||||
| IRQ 28 (EXT IRQ 3) PCI SLOT 3; active low; level sensitive
|
||||
| IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
|
||||
| IRQ 30 (EXT IRQ 5) PCI SLOT 1; active low; level sensitive
|
||||
| IRQ 31 (EXT IRQ 6) PCI SLOT 0; active low; level sensitive
|
||||
| Note for Walnut board:
|
||||
| An interrupt taken for the FPGA (IRQ 25) indicates that either
|
||||
| the Mouse, Keyboard, IRDA, or External Expansion caused the
|
||||
| interrupt. The FPGA must be read to determine which device
|
||||
| caused the interrupt. The default setting of the FPGA clears
|
||||
|
|
||||
+-------------------------------------------------------------------------*/
|
||||
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr (uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr (uiccr, 0x00000000); /* set all to be non-critical */
|
||||
mtdcr (uicpr, 0xFFFFFF83); /* set int polarities */
|
||||
mtdcr (uictr, 0x10000000); /* set int trigger levels */
|
||||
mtdcr (uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority */
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
mtebc (epcr, 0xa8400000); /* EBC always driven */
|
||||
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
/*
|
||||
* checkboard: identify/verify the board we are running
|
||||
*
|
||||
* Remark: we just assume it is correct board here!
|
||||
*
|
||||
*/
|
||||
int checkboard(void)
|
||||
{
|
||||
printf("BOARD: Cogent CSB272\n");
|
||||
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
/*
|
||||
* initram: Determine the size of mounted DRAM
|
||||
*
|
||||
* Size is determined by reading SDRAM configuration registers as
|
||||
* configured by initialization code
|
||||
*
|
||||
*/
|
||||
long initdram (int board_type)
|
||||
{
|
||||
ulong tot_size;
|
||||
ulong bank_size;
|
||||
ulong tmp;
|
||||
|
||||
tot_size = 0;
|
||||
|
||||
mtdcr (memcfga, mem_mb0cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb1cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb2cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb3cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
return tot_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* last_stage_init: final configurations (such as PHY etc)
|
||||
*
|
||||
*/
|
||||
int last_stage_init(void)
|
||||
{
|
||||
/* initialize the PHY */
|
||||
miiphy_reset(CONFIG_PHY_ADDR);
|
||||
miiphy_write(CONFIG_PHY_ADDR, PHY_BMCR,
|
||||
PHY_BMCR_AUTON | PHY_BMCR_RST_NEG); /* AUTO neg */
|
||||
miiphy_write(CONFIG_PHY_ADDR, PHY_FCSCR, 0x0d08); /* LEDs */
|
||||
|
||||
return 0; /* success */
|
||||
}
|
||||
216
board/csb272/init.S
Normal file
216
board/csb272/init.S
Normal file
@@ -0,0 +1,216 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* This source code has been made available to you by IBM on an AS-IS
|
||||
* basis. Anyone receiving this source is licensed under IBM
|
||||
* copyrights to use it in any way he or she deems fit, including
|
||||
* copying it, modifying it, compiling it, and redistributing it either
|
||||
* with or without modifications. No license under IBM patents or
|
||||
* patent applications is to be implied by the copyright license.
|
||||
*
|
||||
* Any user of this software should understand that IBM cannot provide
|
||||
* technical support for this software and will not be responsible for
|
||||
* any consequences resulting from the use of this software.
|
||||
*
|
||||
* Any person who transfers this source code or any derivative work
|
||||
* must include the IBM copyright notice, this paragraph, and the
|
||||
* preceding two paragraphs in the transferred software.
|
||||
*
|
||||
* COPYRIGHT I B M CORPORATION 1995
|
||||
* LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <config.h>
|
||||
#include <ppc4xx.h>
|
||||
|
||||
#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#define LI32(reg,val) \
|
||||
addis reg,0,val@h;\
|
||||
ori reg,reg,val@l
|
||||
|
||||
#define WDCR_EBC(reg,val) \
|
||||
addi r4,0,reg;\
|
||||
mtdcr ebccfga,r4;\
|
||||
addis r4,0,val@h;\
|
||||
ori r4,r4,val@l;\
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
#define WDCR_SDRAM(reg,val) \
|
||||
addi r4,0,reg;\
|
||||
mtdcr memcfga,r4;\
|
||||
addis r4,0,val@h;\
|
||||
ori r4,r4,val@l;\
|
||||
mtdcr memcfgd,r4
|
||||
|
||||
/******************************************************************************
|
||||
* Function: ext_bus_cntlr_init
|
||||
*
|
||||
* Description: Configures EBC Controller and a few basic chip selects.
|
||||
*
|
||||
* CS0 is setup to get the Boot Flash out of the addresss range
|
||||
* so that we may setup a stack. CS7 is setup so that we can
|
||||
* access and reset the hardware watchdog.
|
||||
*
|
||||
* IMPORTANT: For pass1 this code must run from
|
||||
* cache since you can not reliably change a peripheral banks
|
||||
* timing register (pbxap) while running code from that bank.
|
||||
* For ex., since we are running from ROM on bank 0, we can NOT
|
||||
* execute the code that modifies bank 0 timings from ROM, so
|
||||
* we run it from cache.
|
||||
*
|
||||
* Notes: Does NOT use the stack.
|
||||
*****************************************************************************/
|
||||
.section ".text"
|
||||
.align 2
|
||||
.globl ext_bus_cntlr_init
|
||||
.type ext_bus_cntlr_init, @function
|
||||
ext_bus_cntlr_init:
|
||||
mflr r0
|
||||
/********************************************************************
|
||||
* Prefetch entire ext_bus_cntrl_init function into the icache.
|
||||
* This is necessary because we are going to change the same CS we
|
||||
* are executing from. Otherwise a CPU lockup may occur.
|
||||
*******************************************************************/
|
||||
bl ..getAddr
|
||||
..getAddr:
|
||||
mflr r3 /* get address of ..getAddr */
|
||||
|
||||
/* Calculate number of cache lines for this function */
|
||||
addi r4, 0, (((.Lfe0 - ..getAddr) / CFG_CACHELINE_SIZE) + 2)
|
||||
mtctr r4
|
||||
..ebcloop:
|
||||
icbt r0, r3 /* prefetch cache line for addr in r3*/
|
||||
addi r3, r3, CFG_CACHELINE_SIZE /* move to next cache line */
|
||||
bdnz ..ebcloop /* continue for $CTR cache lines */
|
||||
|
||||
/********************************************************************
|
||||
* Delay to ensure all accesses to ROM are complete before changing
|
||||
* bank 0 timings. 200usec should be enough.
|
||||
* 200,000,000 (cycles/sec) X .000200 (sec) = 0x9C40 cycles.
|
||||
*******************************************************************/
|
||||
addis r3, 0, 0x0
|
||||
ori r3, r3, 0xA000 /* wait 200us from reset */
|
||||
mtctr r3
|
||||
..spinlp:
|
||||
bdnz ..spinlp /* spin loop */
|
||||
|
||||
/********************************************************************
|
||||
* SETUP CPC0_CR0
|
||||
*******************************************************************/
|
||||
LI32(r4, 0x007000c0)
|
||||
mtdcr cntrl0, r4
|
||||
|
||||
/********************************************************************
|
||||
* Setup CPC0_CR1: Change PCIINT signal to PerWE
|
||||
*******************************************************************/
|
||||
mfdcr r4, cntrl1
|
||||
ori r4, r4, 0x4000
|
||||
mtdcr cntrl1, r4
|
||||
|
||||
/********************************************************************
|
||||
* Setup External Bus Controller (EBC).
|
||||
*******************************************************************/
|
||||
WDCR_EBC(epcr, 0xd84c0000)
|
||||
/********************************************************************
|
||||
* Memory Bank 0 (Intel 28F128J3 Flash) initialization
|
||||
*******************************************************************/
|
||||
/*WDCR_EBC(pb0ap, 0x02869200)*/
|
||||
WDCR_EBC(pb0ap, 0x07869200)
|
||||
WDCR_EBC(pb0cr, 0xfe0bc000)
|
||||
/********************************************************************
|
||||
* Memory Bank 1 (Holtek HT6542B PS/2) initialization
|
||||
*******************************************************************/
|
||||
WDCR_EBC(pb1ap, 0x1f869200)
|
||||
WDCR_EBC(pb1cr, 0xf0818000)
|
||||
/********************************************************************
|
||||
* Memory Bank 2 (Epson S1D13506) initialization
|
||||
*******************************************************************/
|
||||
WDCR_EBC(pb2ap, 0x05860300)
|
||||
WDCR_EBC(pb2cr, 0xf045a000)
|
||||
/********************************************************************
|
||||
* Memory Bank 3 (Philips SJA1000 CAN Controllers) initialization
|
||||
*******************************************************************/
|
||||
WDCR_EBC(pb3ap, 0x0387d200)
|
||||
WDCR_EBC(pb3cr, 0xf021c000)
|
||||
/********************************************************************
|
||||
* Memory Bank 4-7 (Unused) initialization
|
||||
*******************************************************************/
|
||||
WDCR_EBC(pb4ap, 0)
|
||||
WDCR_EBC(pb4cr, 0)
|
||||
WDCR_EBC(pb5ap, 0)
|
||||
WDCR_EBC(pb5cr, 0)
|
||||
WDCR_EBC(pb6ap, 0)
|
||||
WDCR_EBC(pb6cr, 0)
|
||||
WDCR_EBC(pb7ap, 0)
|
||||
WDCR_EBC(pb7cr, 0)
|
||||
|
||||
/* We are all done */
|
||||
mtlr r0 /* Restore link register */
|
||||
blr /* Return to calling function */
|
||||
.Lfe0: .size ext_bus_cntlr_init,.Lfe0-ext_bus_cntlr_init
|
||||
/* end ext_bus_cntlr_init() */
|
||||
|
||||
/******************************************************************************
|
||||
* Function: sdram_init
|
||||
*
|
||||
* Description: Configures SDRAM memory banks.
|
||||
*
|
||||
* Notes: Does NOT use the stack.
|
||||
*****************************************************************************/
|
||||
.section ".text"
|
||||
.align 2
|
||||
.globl sdram_init
|
||||
.type sdram_init, @function
|
||||
sdram_init:
|
||||
|
||||
/*
|
||||
* Disable memory controller to allow
|
||||
* values to be changed.
|
||||
*/
|
||||
WDCR_SDRAM(mem_mcopt1, 0x00000000)
|
||||
|
||||
/*
|
||||
* Configure Memory Banks
|
||||
*/
|
||||
WDCR_SDRAM(mem_mb0cf, 0x00084001)
|
||||
WDCR_SDRAM(mem_mb1cf, 0x00000000)
|
||||
WDCR_SDRAM(mem_mb2cf, 0x00000000)
|
||||
WDCR_SDRAM(mem_mb3cf, 0x00000000)
|
||||
|
||||
/*
|
||||
* Set up SDTR1 (SDRAM Timing Register)
|
||||
*/
|
||||
WDCR_SDRAM(mem_sdtr1, 0x00854009)
|
||||
|
||||
/*
|
||||
* Set RTR (Refresh Timing Register)
|
||||
*/
|
||||
WDCR_SDRAM(mem_rtr, 0x10000000)
|
||||
/* WDCR_SDRAM(mem_rtr, 0x05f00000) */
|
||||
|
||||
/********************************************************************
|
||||
* Delay to ensure 200usec have elapsed since reset. Assume worst
|
||||
* case that the core is running 200Mhz:
|
||||
* 200,000,000 (cycles/sec) X .000200 (sec) = 0x9C40 cycles
|
||||
*******************************************************************/
|
||||
addis r3, 0, 0x0000
|
||||
ori r3, r3, 0xA000 /* Wait >200us from reset */
|
||||
mtctr r3
|
||||
..spinlp2:
|
||||
bdnz ..spinlp2 /* spin loop */
|
||||
|
||||
/********************************************************************
|
||||
* Set memory controller options reg, MCOPT1.
|
||||
*******************************************************************/
|
||||
WDCR_SDRAM(mem_mcopt1,0x80800000)
|
||||
|
||||
..sdri_done:
|
||||
blr /* Return to calling function */
|
||||
.Lfe1: .size sdram_init,.Lfe1-sdram_init
|
||||
/* end sdram_init() */
|
||||
151
board/csb272/u-boot.lds
Normal file
151
board/csb272/u-boot.lds
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* (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
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
board/csb272/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/405gp_enet.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_ppc/board.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 = .);
|
||||
}
|
||||
51
board/csb472/Makefile
Normal file
51
board/csb472/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# (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
|
||||
#OBJS = $(BOARD).o strataflash.o
|
||||
OBJS = $(BOARD).o
|
||||
|
||||
SOBJS = init.o
|
||||
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
36
board/csb472/config.mk
Normal file
36
board/csb472/config.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# (C) Copyright 2000-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# (C) Copyright 2004
|
||||
# Tolunay Orkun, NextIO Inc., torkun@nextio.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
|
||||
#
|
||||
|
||||
#
|
||||
# Cogent CSB472 board
|
||||
#
|
||||
|
||||
LDFLAGS += $(LINKER_UNDEFS)
|
||||
|
||||
TEXT_BASE := 0xFFFC0000
|
||||
#TEXT_BASE := 0x00100000
|
||||
|
||||
PLATFORM_RELFLAGS := $(PLATFORM_RELFLAGS)
|
||||
141
board/csb472/csb472.c
Normal file
141
board/csb472/csb472.c
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Tolunay Orkun, Nextio Inc., torkun@nextio.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <i2c.h>
|
||||
#include <miiphy.h>
|
||||
#include <405gp_enet.h>
|
||||
|
||||
/*
|
||||
* board_early_init_f: do early board initialization
|
||||
*
|
||||
*/
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Interrupt controller setup for the Walnut board.
|
||||
| Note: IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
| IRQ 16 405GP internally generated; active low; level sensitive
|
||||
| IRQ 17-24 RESERVED
|
||||
| IRQ 25 (EXT IRQ 0) FPGA; active high; level sensitive
|
||||
| IRQ 26 (EXT IRQ 1) SMI; active high; level sensitive
|
||||
| IRQ 27 (EXT IRQ 2) Not Used
|
||||
| IRQ 28 (EXT IRQ 3) PCI SLOT 3; active low; level sensitive
|
||||
| IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
|
||||
| IRQ 30 (EXT IRQ 5) PCI SLOT 1; active low; level sensitive
|
||||
| IRQ 31 (EXT IRQ 6) PCI SLOT 0; active low; level sensitive
|
||||
| Note for Walnut board:
|
||||
| An interrupt taken for the FPGA (IRQ 25) indicates that either
|
||||
| the Mouse, Keyboard, IRDA, or External Expansion caused the
|
||||
| interrupt. The FPGA must be read to determine which device
|
||||
| caused the interrupt. The default setting of the FPGA clears
|
||||
|
|
||||
+-------------------------------------------------------------------------*/
|
||||
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr (uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr (uiccr, 0x00000000); /* set all to be non-critical */
|
||||
mtdcr (uicpr, 0xFFFFFF83); /* set int polarities */
|
||||
mtdcr (uictr, 0x10000000); /* set int trigger levels */
|
||||
mtdcr (uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority */
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
mtebc (epcr, 0xa8400000); /* EBC always driven */
|
||||
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
/*
|
||||
* checkboard: identify/verify the board we are running
|
||||
*
|
||||
* Remark: we just assume it is correct board here!
|
||||
*
|
||||
*/
|
||||
int checkboard(void)
|
||||
{
|
||||
printf("BOARD: Cogent CSB472\n");
|
||||
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
/*
|
||||
* initram: Determine the size of mounted DRAM
|
||||
*
|
||||
* Size is determined by reading SDRAM configuration registers as
|
||||
* configured by initialization code
|
||||
*
|
||||
*/
|
||||
long initdram (int board_type)
|
||||
{
|
||||
ulong tot_size;
|
||||
ulong bank_size;
|
||||
ulong tmp;
|
||||
|
||||
tot_size = 0;
|
||||
|
||||
mtdcr (memcfga, mem_mb0cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb1cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb2cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb3cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
return tot_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* last_stage_init: final configurations (such as PHY etc)
|
||||
*
|
||||
*/
|
||||
int last_stage_init(void)
|
||||
{
|
||||
/* initialize the PHY */
|
||||
miiphy_reset(CONFIG_PHY_ADDR);
|
||||
miiphy_write(CONFIG_PHY_ADDR, PHY_BMCR,
|
||||
PHY_BMCR_AUTON | PHY_BMCR_RST_NEG); /* AUTO neg */
|
||||
miiphy_write(CONFIG_PHY_ADDR, PHY_FCSCR, 0x0d08); /* LEDs */
|
||||
|
||||
return 0; /* success */
|
||||
}
|
||||
212
board/csb472/init.S
Normal file
212
board/csb472/init.S
Normal file
@@ -0,0 +1,212 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* This source code has been made available to you by IBM on an AS-IS
|
||||
* basis. Anyone receiving this source is licensed under IBM
|
||||
* copyrights to use it in any way he or she deems fit, including
|
||||
* copying it, modifying it, compiling it, and redistributing it either
|
||||
* with or without modifications. No license under IBM patents or
|
||||
* patent applications is to be implied by the copyright license.
|
||||
*
|
||||
* Any user of this software should understand that IBM cannot provide
|
||||
* technical support for this software and will not be responsible for
|
||||
* any consequences resulting from the use of this software.
|
||||
*
|
||||
* Any person who transfers this source code or any derivative work
|
||||
* must include the IBM copyright notice, this paragraph, and the
|
||||
* preceding two paragraphs in the transferred software.
|
||||
*
|
||||
* COPYRIGHT I B M CORPORATION 1995
|
||||
* LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <config.h>
|
||||
#include <ppc4xx.h>
|
||||
|
||||
#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#define LI32(reg,val) \
|
||||
addis reg,0,val@h;\
|
||||
ori reg,reg,val@l
|
||||
|
||||
#define WDCR_EBC(reg,val) \
|
||||
addi r4,0,reg;\
|
||||
mtdcr ebccfga,r4;\
|
||||
addis r4,0,val@h;\
|
||||
ori r4,r4,val@l;\
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
#define WDCR_SDRAM(reg,val) \
|
||||
addi r4,0,reg;\
|
||||
mtdcr memcfga,r4;\
|
||||
addis r4,0,val@h;\
|
||||
ori r4,r4,val@l;\
|
||||
mtdcr memcfgd,r4
|
||||
|
||||
/******************************************************************************
|
||||
* Function: ext_bus_cntlr_init
|
||||
*
|
||||
* Description: Configures EBC Controller and a few basic chip selects.
|
||||
*
|
||||
* CS0 is setup to get the Boot Flash out of the addresss range
|
||||
* so that we may setup a stack. CS7 is setup so that we can
|
||||
* access and reset the hardware watchdog.
|
||||
*
|
||||
* IMPORTANT: For pass1 this code must run from
|
||||
* cache since you can not reliably change a peripheral banks
|
||||
* timing register (pbxap) while running code from that bank.
|
||||
* For ex., since we are running from ROM on bank 0, we can NOT
|
||||
* execute the code that modifies bank 0 timings from ROM, so
|
||||
* we run it from cache.
|
||||
*
|
||||
* Notes: Does NOT use the stack.
|
||||
*****************************************************************************/
|
||||
.section ".text"
|
||||
.align 2
|
||||
.globl ext_bus_cntlr_init
|
||||
.type ext_bus_cntlr_init, @function
|
||||
ext_bus_cntlr_init:
|
||||
mflr r0
|
||||
/********************************************************************
|
||||
* Prefetch entire ext_bus_cntrl_init function into the icache.
|
||||
* This is necessary because we are going to change the same CS we
|
||||
* are executing from. Otherwise a CPU lockup may occur.
|
||||
*******************************************************************/
|
||||
bl ..getAddr
|
||||
..getAddr:
|
||||
mflr r3 /* get address of ..getAddr */
|
||||
|
||||
/* Calculate number of cache lines for this function */
|
||||
addi r4, 0, (((.Lfe0 - ..getAddr) / CFG_CACHELINE_SIZE) + 2)
|
||||
mtctr r4
|
||||
..ebcloop:
|
||||
icbt r0, r3 /* prefetch cache line for addr in r3*/
|
||||
addi r3, r3, CFG_CACHELINE_SIZE /* move to next cache line */
|
||||
bdnz ..ebcloop /* continue for $CTR cache lines */
|
||||
|
||||
/********************************************************************
|
||||
* Delay to ensure all accesses to ROM are complete before changing
|
||||
* bank 0 timings. 200usec should be enough.
|
||||
* 200,000,000 (cycles/sec) X .000200 (sec) = 0x9C40 cycles.
|
||||
*******************************************************************/
|
||||
addis r3, 0, 0x0
|
||||
ori r3, r3, 0xA000 /* wait 200us from reset */
|
||||
mtctr r3
|
||||
..spinlp:
|
||||
bdnz ..spinlp /* spin loop */
|
||||
|
||||
/********************************************************************
|
||||
* SETUP CPC0_CR0
|
||||
*******************************************************************/
|
||||
LI32(r4, 0x00c01030)
|
||||
mtdcr cntrl0, r4
|
||||
|
||||
/********************************************************************
|
||||
* Setup CPC0_CR1: Change PCIINT signal to PerWE
|
||||
*******************************************************************/
|
||||
mfdcr r4, cntrl1
|
||||
ori r4, r4, 0x4000
|
||||
mtdcr cntrl1, r4
|
||||
|
||||
/********************************************************************
|
||||
* Setup External Bus Controller (EBC).
|
||||
*******************************************************************/
|
||||
WDCR_EBC(epcr, 0xd84c0000)
|
||||
/********************************************************************
|
||||
* Memory Bank 0 (Intel 28F640J3 Flash) initialization
|
||||
*******************************************************************/
|
||||
/*WDCR_EBC(pb0ap, 0x03055200)*/
|
||||
/*WDCR_EBC(pb0ap, 0x04055200)*/
|
||||
WDCR_EBC(pb0ap, 0x08055200)
|
||||
WDCR_EBC(pb0cr, 0xff87a000)
|
||||
/********************************************************************
|
||||
* Memory Bank 3 (Xilinx XC95144 CPLD) initialization
|
||||
*******************************************************************/
|
||||
/*WDCR_EBC(pb3ap, 0x07869200)*/
|
||||
WDCR_EBC(pb3ap, 0x04055200)
|
||||
WDCR_EBC(pb3cr, 0xff01c000)
|
||||
/********************************************************************
|
||||
* Memory Bank 1,2,4-7 (Unused) initialization
|
||||
*******************************************************************/
|
||||
WDCR_EBC(pb1ap, 0)
|
||||
WDCR_EBC(pb1cr, 0)
|
||||
WDCR_EBC(pb2ap, 0)
|
||||
WDCR_EBC(pb2cr, 0)
|
||||
WDCR_EBC(pb4ap, 0)
|
||||
WDCR_EBC(pb4cr, 0)
|
||||
WDCR_EBC(pb5ap, 0)
|
||||
WDCR_EBC(pb5cr, 0)
|
||||
WDCR_EBC(pb6ap, 0)
|
||||
WDCR_EBC(pb6cr, 0)
|
||||
WDCR_EBC(pb7ap, 0)
|
||||
WDCR_EBC(pb7cr, 0)
|
||||
|
||||
/* We are all done */
|
||||
mtlr r0 /* Restore link register */
|
||||
blr /* Return to calling function */
|
||||
.Lfe0: .size ext_bus_cntlr_init,.Lfe0-ext_bus_cntlr_init
|
||||
/* end ext_bus_cntlr_init() */
|
||||
|
||||
/******************************************************************************
|
||||
* Function: sdram_init
|
||||
*
|
||||
* Description: Configures SDRAM memory banks.
|
||||
*
|
||||
* Notes: Does NOT use the stack.
|
||||
*****************************************************************************/
|
||||
.section ".text"
|
||||
.align 2
|
||||
.globl sdram_init
|
||||
.type sdram_init, @function
|
||||
sdram_init:
|
||||
|
||||
/*
|
||||
* Disable memory controller to allow
|
||||
* values to be changed.
|
||||
*/
|
||||
WDCR_SDRAM(mem_mcopt1, 0x00000000)
|
||||
|
||||
/*
|
||||
* Configure Memory Banks
|
||||
*/
|
||||
WDCR_SDRAM(mem_mb0cf, 0x00062001)
|
||||
WDCR_SDRAM(mem_mb1cf, 0x00000000)
|
||||
WDCR_SDRAM(mem_mb2cf, 0x00000000)
|
||||
WDCR_SDRAM(mem_mb3cf, 0x00000000)
|
||||
|
||||
/*
|
||||
* Set up SDTR1 (SDRAM Timing Register)
|
||||
*/
|
||||
WDCR_SDRAM(mem_sdtr1, 0x00854009)
|
||||
|
||||
/*
|
||||
* Set RTR (Refresh Timing Register)
|
||||
*/
|
||||
WDCR_SDRAM(mem_rtr, 0x10000000)
|
||||
/* WDCR_SDRAM(mem_rtr, 0x05f00000) */
|
||||
|
||||
/********************************************************************
|
||||
* Delay to ensure 200usec have elapsed since reset. Assume worst
|
||||
* case that the core is running 200Mhz:
|
||||
* 200,000,000 (cycles/sec) X .000200 (sec) = 0x9C40 cycles
|
||||
*******************************************************************/
|
||||
addis r3, 0, 0x0000
|
||||
ori r3, r3, 0xA000 /* Wait >200us from reset */
|
||||
mtctr r3
|
||||
..spinlp2:
|
||||
bdnz ..spinlp2 /* spin loop */
|
||||
|
||||
/********************************************************************
|
||||
* Set memory controller options reg, MCOPT1.
|
||||
*******************************************************************/
|
||||
WDCR_SDRAM(mem_mcopt1,0x80800000)
|
||||
|
||||
..sdri_done:
|
||||
blr /* Return to calling function */
|
||||
.Lfe1: .size sdram_init,.Lfe1-sdram_init
|
||||
/* end sdram_init() */
|
||||
151
board/csb472/u-boot.lds
Normal file
151
board/csb472/u-boot.lds
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* (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
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
board/csb472/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/405gp_enet.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_ppc/board.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 = .);
|
||||
}
|
||||
128
board/dave/B2/B2.c
Normal file
128
board/dave/B2/B2.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* DAVE Srl
|
||||
* http://www.dave-tech.it
|
||||
* http://www.wawnet.biz
|
||||
* mailto:info@wawnet.biz
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/hardware.h>
|
||||
|
||||
/*
|
||||
* Miscelaneous platform dependent initialization
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
u32 temp;
|
||||
|
||||
/* Configuration Port Control Register*/
|
||||
/* Port A */
|
||||
PCONA = 0x3ff;
|
||||
|
||||
/* Port B */
|
||||
PCONB = 0xff;
|
||||
PDATB = 0xFFFF;
|
||||
|
||||
/* Port C */
|
||||
/*
|
||||
PCONC = 0xff55ff15;
|
||||
PDATC = 0x0;
|
||||
PUPC = 0xffff;
|
||||
*/
|
||||
|
||||
/* Port D */
|
||||
/*
|
||||
PCOND = 0xaaaa;
|
||||
PUPD = 0xff;
|
||||
*/
|
||||
|
||||
/* Port E */
|
||||
PCONE = 0x0001aaa9;
|
||||
PDATE = 0x0;
|
||||
PUPE = 0xff;
|
||||
|
||||
/* Port F */
|
||||
PCONF = 0x124955;
|
||||
PDATF = 0xff; /* B2-eth_reset tied high level */
|
||||
/*
|
||||
PUPF = 0x1e3;
|
||||
*/
|
||||
|
||||
/* Port G */
|
||||
PUPG = 0x1;
|
||||
PCONG = 0x3; /*PG0= EINT0= ETH_INT prepared for linux kernel*/
|
||||
|
||||
INTMSK = 0x03fffeff;
|
||||
INTCON = 0x05;
|
||||
|
||||
/*
|
||||
Configure chip ethernet interrupt as High level
|
||||
Port G EINT 0-7 EINT0 -> CHIP ETHERNET
|
||||
*/
|
||||
temp = EXTINT;
|
||||
temp &= ~0x7;
|
||||
temp |= 0x1; /*LEVEL_HIGH*/
|
||||
EXTINT = temp;
|
||||
|
||||
/*
|
||||
Reset SMSC LAN91C96 chip
|
||||
*/
|
||||
temp= PCONF;
|
||||
temp |= 0x00000040;
|
||||
PCONF = temp;
|
||||
|
||||
/* Reset high */
|
||||
temp = PDATF;
|
||||
temp |= (1 << 3);
|
||||
PDATF = temp;
|
||||
|
||||
/* Short delay */
|
||||
for (temp=0;temp<10;temp++)
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
/* Reset low */
|
||||
temp = PDATF;
|
||||
temp &= ~(1 << 3);
|
||||
PDATF = temp;
|
||||
|
||||
/* arch number MACH_TYPE_MBA44B0 */
|
||||
gd->bd->bi_arch_number = 178;
|
||||
|
||||
/* location of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x0c000100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dram_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
|
||||
return (0);
|
||||
}
|
||||
48
board/dave/B2/Makefile
Normal file
48
board/dave/B2/Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# (C) Copyright 2002
|
||||
# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
# Marius Groeger <mgroeger@sysgo.de>
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := B2.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
|
||||
|
||||
#########################################################################
|
||||
30
board/dave/B2/config.mk
Normal file
30
board/dave/B2/config.mk
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
# Marius Groeger <mgroeger@sysgo.de>
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
TEXT_BASE = 0x0C100000
|
||||
|
||||
PLATFORM_CPPFLAGS += -Uarm
|
||||
76
board/dave/B2/flash.c
Normal file
76
board/dave/B2/flash.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/hardware.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for esd boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
#ifdef __DEBUG_START_FROM_SRAM__
|
||||
return CFG_DUMMY_FLASH_SIZE;
|
||||
#else
|
||||
unsigned long size_b0;
|
||||
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 - FIXME XXX */
|
||||
|
||||
size_b0 = flash_get_size((vu_long *)CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0<<20);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (0, &flash_info[0]);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
#endif
|
||||
}
|
||||
167
board/dave/B2/memsetup.S
Normal file
167
board/dave/B2/memsetup.S
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* DAVE Srl
|
||||
*
|
||||
* http://www.dave-tech.it
|
||||
* http://www.wawnet.biz
|
||||
* mailto:info@wawnet.biz
|
||||
*
|
||||
* memsetup-sa1110.S (blob): memory setup for various SA1110 architectures
|
||||
* Modified By MATTO
|
||||
*
|
||||
* Copyright (C) 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Documentation:
|
||||
* Intel Corporation, "Intel StrongARM SA-1110 Microprocessor
|
||||
* Advanced Developer's manual, December 1999
|
||||
*
|
||||
* Intel has a very hard to find SDRAM configurator on their web site:
|
||||
* http://appzone.intel.com/hcd/sa1110/memory/index.asp
|
||||
*
|
||||
* NOTE: This code assumes that an SA1110 CPU *always* uses SDRAM. This
|
||||
* appears to be true, but it might be possible that somebody designs a
|
||||
* board with mixed EDODRAM/SDRAM memory (which is a bad idea). -- Erik
|
||||
*
|
||||
* 04-10-2001: SELETZ
|
||||
* - separated memory config for multiple platform support
|
||||
* - perform SA1110 Hardware Reset Procedure
|
||||
*
|
||||
*/
|
||||
|
||||
.equ B0_Tacs, 0x0 /* 0clk */
|
||||
.equ B0_Tcos, 0x0 /* 0clk */
|
||||
.equ B0_Tacc, 0x4 /* 6clk */
|
||||
.equ B0_Tcoh, 0x0 /* 0clk */
|
||||
.equ B0_Tah, 0x0 /* 0clk */
|
||||
.equ B0_Tacp, 0x0 /* 0clk */
|
||||
.equ B0_PMC, 0x0 /* normal(1data) */
|
||||
/* Bank 1 parameter */
|
||||
.equ B1_Tacs, 0x3 /* 4clk */
|
||||
.equ B1_Tcos, 0x3 /* 4clk */
|
||||
.equ B1_Tacc, 0x7 /* 14clkv */
|
||||
.equ B1_Tcoh, 0x3 /* 4clk */
|
||||
.equ B1_Tah, 0x3 /* 4clk */
|
||||
.equ B1_Tacp, 0x3 /* 6clk */
|
||||
.equ B1_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 2 parameter - LAN91C96 */
|
||||
.equ B2_Tacs, 0x3 /* 4clk */
|
||||
.equ B2_Tcos, 0x3 /* 4clk */
|
||||
.equ B2_Tacc, 0x7 /* 14clk */
|
||||
.equ B2_Tcoh, 0x3 /* 4clk */
|
||||
.equ B2_Tah, 0x3 /* 4clk */
|
||||
.equ B2_Tacp, 0x3 /* 6clk */
|
||||
.equ B2_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 3 parameter */
|
||||
.equ B3_Tacs, 0x3 /* 4clk */
|
||||
.equ B3_Tcos, 0x3 /* 4clk */
|
||||
.equ B3_Tacc, 0x7 /* 14clk */
|
||||
.equ B3_Tcoh, 0x3 /* 4clk */
|
||||
.equ B3_Tah, 0x3 /* 4clk */
|
||||
.equ B3_Tacp, 0x3 /* 6clk */
|
||||
.equ B3_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 4 parameter */
|
||||
.equ B4_Tacs, 0x3 /* 4clk */
|
||||
.equ B4_Tcos, 0x3 /* 4clk */
|
||||
.equ B4_Tacc, 0x7 /* 14clk */
|
||||
.equ B4_Tcoh, 0x3 /* 4clk */
|
||||
.equ B4_Tah, 0x3 /* 4clk */
|
||||
.equ B4_Tacp, 0x3 /* 6clk */
|
||||
.equ B4_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 5 parameter */
|
||||
.equ B5_Tacs, 0x3 /* 4clk */
|
||||
.equ B5_Tcos, 0x3 /* 4clk */
|
||||
.equ B5_Tacc, 0x7 /* 14clk */
|
||||
.equ B5_Tcoh, 0x3 /* 4clk */
|
||||
.equ B5_Tah, 0x3 /* 4clk */
|
||||
.equ B5_Tacp, 0x3 /* 6clk */
|
||||
.equ B5_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 6(if SROM) parameter */
|
||||
.equ B6_Tacs, 0x3 /* 4clk */
|
||||
.equ B6_Tcos, 0x3 /* 4clk */
|
||||
.equ B6_Tacc, 0x7 /* 14clk */
|
||||
.equ B6_Tcoh, 0x3 /* 4clk */
|
||||
.equ B6_Tah, 0x3 /* 4clk */
|
||||
.equ B6_Tacp, 0x3 /* 6clk */
|
||||
.equ B6_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 7(if SROM) parameter */
|
||||
.equ B7_Tacs, 0x3 /* 4clk */
|
||||
.equ B7_Tcos, 0x3 /* 4clk */
|
||||
.equ B7_Tacc, 0x7 /* 14clk */
|
||||
.equ B7_Tcoh, 0x3 /* 4clk */
|
||||
.equ B7_Tah, 0x3 /* 4clk */
|
||||
.equ B7_Tacp, 0x3 /* 6clk */
|
||||
.equ B7_PMC, 0x0 /* normal(1data) */
|
||||
|
||||
/* Bank 6 parameter */
|
||||
.equ B6_MT, 0x3 /* SDRAM */
|
||||
.equ B6_Trcd, 0x0 /* 2clk */
|
||||
.equ B6_SCAN, 0x0 /* 10bit */
|
||||
|
||||
.equ B7_MT, 0x3 /* SDRAM */
|
||||
.equ B7_Trcd, 0x0 /* 2clk */
|
||||
.equ B7_SCAN, 0x0 /* 10bit */
|
||||
|
||||
|
||||
/* REFRESH parameter */
|
||||
.equ REFEN, 0x1 /* Refresh enable */
|
||||
.equ TREFMD, 0x0 /* CBR(CAS before RAS)/Auto refresh */
|
||||
.equ Trp, 0x0 /* 2clk */
|
||||
.equ Trc, 0x3 /* 0x1=5clk 0x3=11clk*/
|
||||
.equ Tchr, 0x0 /* 0x2=3clk 0x0=0clks */
|
||||
.equ REFCNT, 879
|
||||
|
||||
MEMORY_CONFIG:
|
||||
.long 0x12111900 /* Bank0 = OM[1:0] , Bank1-7 16bit, Bank2=Nowait,UB/LB*/
|
||||
.word ((B0_Tacs<<13)+(B0_Tcos<<11)+(B0_Tacc<<8)+(B0_Tcoh<<6)+(B0_Tah<<4)+(B0_Tacp<<2)+(B0_PMC)) /*GCS0*/
|
||||
.word ((B1_Tacs<<13)+(B1_Tcos<<11)+(B1_Tacc<<8)+(B1_Tcoh<<6)+(B1_Tah<<4)+(B1_Tacp<<2)+(B1_PMC)) /*GCS1*/
|
||||
.word ((B2_Tacs<<13)+(B2_Tcos<<11)+(B2_Tacc<<8)+(B2_Tcoh<<6)+(B2_Tah<<4)+(B2_Tacp<<2)+(B2_PMC)) /*GCS2*/
|
||||
.word ((B3_Tacs<<13)+(B3_Tcos<<11)+(B3_Tacc<<8)+(B3_Tcoh<<6)+(B3_Tah<<4)+(B3_Tacp<<2)+(B3_PMC)) /*GCS3*/
|
||||
.word ((B4_Tacs<<13)+(B4_Tcos<<11)+(B4_Tacc<<8)+(B4_Tcoh<<6)+(B4_Tah<<4)+(B4_Tacp<<2)+(B4_PMC)) /*GCS4*/
|
||||
.word ((B5_Tacs<<13)+(B5_Tcos<<11)+(B5_Tacc<<8)+(B5_Tcoh<<6)+(B5_Tah<<4)+(B5_Tacp<<2)+(B5_PMC)) /*GCS5*/
|
||||
.word ((B6_MT<<15)+(B6_Trcd<<2)+(B6_SCAN)) /*GCS6*/
|
||||
.word ((B7_MT<<15)+(B7_Trcd<<2)+(B7_SCAN)) /*GCS7*/
|
||||
.word ((REFEN<<23)+(TREFMD<<22)+(Trp<<20)+(Trc<<18)+(Tchr<<16)+REFCNT) /*REFRESH RFEN=1, TREFMD=0, trp=3clk, trc=5clk, tchr=3clk,count=1019*/
|
||||
.word 0x17 /*SCLK power down mode, BANKSIZE 16M/16M*/
|
||||
.word 0x20 /*MRSR6 CL=2clk*/
|
||||
.word 0x20 /*MRSR7*/
|
||||
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
|
||||
/*
|
||||
the next instruction fail due memory relocation...
|
||||
we'll find the right MEMORY_CONFIG address with the next 3 lines...
|
||||
*/
|
||||
/*ldr r0, =MEMORY_CONFIG*/
|
||||
mov r0, pc
|
||||
ldr r1, =(0x38+4)
|
||||
sub r0, r0, r1
|
||||
|
||||
ldmia r0, {r1-r13}
|
||||
ldr r0, =0x01c80000
|
||||
stmia r0, {r1-r13}
|
||||
mov pc, lr
|
||||
57
board/dave/B2/u-boot.lds
Normal file
57
board/dave/B2/u-boot.lds
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* (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_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/s3c44b0/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
_end = .;
|
||||
}
|
||||
@@ -31,25 +31,8 @@
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if 0
|
||||
#define FPGA_DEBUG
|
||||
#endif
|
||||
|
||||
/* fpga configuration data - gzip compressed and generated by bin2c */
|
||||
const unsigned char fpgadata[] =
|
||||
{
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
|
||||
/*
|
||||
* include common fpga code (for esd boards)
|
||||
*/
|
||||
#include "../common/fpga.c"
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
|
||||
int gunzip(void *, int, unsigned char *, unsigned long *);
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
@@ -60,13 +43,13 @@ int board_early_init_f (void)
|
||||
* IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
* IRQ 16 405GP internally generated; active low; level sensitive
|
||||
* IRQ 17-24 RESERVED
|
||||
* IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
|
||||
* IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
|
||||
* IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
|
||||
* IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
|
||||
* IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
|
||||
* IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
|
||||
* IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
|
||||
* IRQ 25 (EXT IRQ 0)
|
||||
* IRQ 26 (EXT IRQ 1)
|
||||
* IRQ 27 (EXT IRQ 2)
|
||||
* IRQ 28 (EXT IRQ 3)
|
||||
* IRQ 29 (EXT IRQ 4)
|
||||
* IRQ 30 (EXT IRQ 5)
|
||||
* IRQ 31 (EXT IRQ 6)
|
||||
*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
@@ -84,11 +67,9 @@ int board_early_init_f (void)
|
||||
#else
|
||||
mtebc (epcr, 0x28400000); /* ebc in high-z */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_f (void)
|
||||
@@ -96,11 +77,15 @@ int misc_init_f (void)
|
||||
return 0; /* dummy implementation */
|
||||
}
|
||||
|
||||
extern flash_info_t flash_info[]; /* info for FLASH chips */
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
#if 0 /* test-only */
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* adjust flash start and size as well as the offset */
|
||||
gd->bd->bi_flashstart = 0 - flash_info[0].size;
|
||||
gd->bd->bi_flashoffset= flash_info[0].size - CFG_MONITOR_LEN;
|
||||
#if 0
|
||||
volatile unsigned short *fpga_mode =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
|
||||
@@ -119,7 +104,7 @@ int misc_init_r (void)
|
||||
unsigned long cntrl0Reg;
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
@@ -177,7 +162,6 @@ int misc_init_r (void)
|
||||
udelay(1000); /* wait 1ms */
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@@ -192,12 +176,9 @@ int misc_init_r (void)
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
@@ -266,8 +247,13 @@ nand_init(void)
|
||||
{
|
||||
ulong totlen = 0;
|
||||
|
||||
#if (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_ME) || \
|
||||
/*
|
||||
The HI model is equipped with a large block NAND chip not supported yet
|
||||
by U-Boot
|
||||
(CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_HI)
|
||||
*/
|
||||
|
||||
#if (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_ME)
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND0_BASE);
|
||||
totlen += nand_probe (CFG_NAND0_BASE);
|
||||
#endif /* CONFIG_PPCHAMELEON_MODULE_ME, CONFIG_PPCHAMELEON_MODULE_HI */
|
||||
@@ -278,3 +264,39 @@ nand_init(void)
|
||||
printf ("%4lu MB\n", totlen >>20);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CFB_CONSOLE
|
||||
# ifdef CONFIG_CONSOLE_EXTRA_INFO
|
||||
# include <video_fb.h>
|
||||
extern GraphicDevice smi;
|
||||
|
||||
void video_get_info_str (int line_number, char *info)
|
||||
{
|
||||
uint pvr = get_pvr ();
|
||||
|
||||
/* init video info strings for graphic console */
|
||||
switch (line_number) {
|
||||
case 1:
|
||||
switch (pvr) {
|
||||
case PVR_405EP_RB:
|
||||
sprintf (info, " IBM PowerPC 405EP Rev. B");
|
||||
break;
|
||||
default:
|
||||
sprintf (info, " IBM PowerPC 405EP Rev. <unknown>");
|
||||
break;
|
||||
}
|
||||
return;
|
||||
case 2:
|
||||
sprintf (info, " DAVE Srl PPChameleonEVB - www.dave-tech.it");
|
||||
return;
|
||||
case 3:
|
||||
sprintf (info, " %s", smi.modeIdent);
|
||||
return;
|
||||
}
|
||||
|
||||
/* no more info lines */
|
||||
*info = 0;
|
||||
return;
|
||||
}
|
||||
# endif /* CONFIG_CONSOLE_EXTRA_INFO */
|
||||
#endif /* CONFIG_CFB_CONSOLE */
|
||||
|
||||
@@ -44,12 +44,15 @@ unsigned long flash_init (void)
|
||||
#ifdef __DEBUG_START_FROM_SRAM__
|
||||
return CFG_DUMMY_FLASH_SIZE;
|
||||
#else
|
||||
unsigned long size_b0;
|
||||
unsigned long size;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
unsigned long base;
|
||||
int size_val = 0;
|
||||
|
||||
debug("[%s, %d] Entering ...\n", __FUNCTION__, __LINE__);
|
||||
debug("[%s, %d] flash_info = 0x%08X ...\n", __FUNCTION__, __LINE__, flash_info);
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
@@ -57,22 +60,26 @@ unsigned long flash_init (void)
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
|
||||
size_b0 = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
debug("[%s, %d] Calling flash_get_size ...\n", __FUNCTION__, __LINE__);
|
||||
size = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0<<20);
|
||||
size, size<<20);
|
||||
}
|
||||
|
||||
debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
flash_get_offsets (-size, &flash_info[0]);
|
||||
debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
base = -size;
|
||||
switch (size) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
break;
|
||||
@@ -89,8 +96,9 @@ unsigned long flash_init (void)
|
||||
size_val = 4;
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
pbcr = (pbcr & 0x0001ffff) | base | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
@@ -98,8 +106,9 @@ unsigned long flash_init (void)
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
|
||||
flash_info[0].size = size;
|
||||
|
||||
return (size_b0);
|
||||
return (size);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -73,9 +73,6 @@ SECTIONS
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* . = env_offset;*/
|
||||
/* common/environment.o(.text)*/
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
@@ -142,6 +139,13 @@ SECTIONS
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
|
||||
. = 0xFFFF8000;
|
||||
.ppcenv :
|
||||
{
|
||||
common/environment.o(.ppcenv);
|
||||
}
|
||||
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
@@ -221,6 +220,8 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
ulong base = (ulong)addr;
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)addr;
|
||||
|
||||
debug("[%s, %d] Entering ...\n", __FUNCTION__, __LINE__);
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
@@ -578,15 +579,27 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp) {
|
||||
#ifdef CONFIG_B2
|
||||
data = data | ((*(uchar *)cp)<<(8*i));
|
||||
#else
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
#endif
|
||||
}
|
||||
for (; i<4 && cnt>0; ++i) {
|
||||
#ifdef CONFIG_B2
|
||||
data = data | ((*src++)<<(8*i));
|
||||
#else
|
||||
data = (data << 8) | *src++;
|
||||
#endif
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<4; ++i, ++cp) {
|
||||
#ifdef CONFIG_B2
|
||||
data = data | ((*(uchar *)cp)<<(8*i));
|
||||
#else
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
@@ -600,9 +613,14 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
*/
|
||||
while (cnt >= 4) {
|
||||
data = 0;
|
||||
#ifdef CONFIG_B2
|
||||
data = (*(ulong*)src);
|
||||
src += 4;
|
||||
#else
|
||||
for (i=0; i<4; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
#endif
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
@@ -619,11 +637,19 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
|
||||
#ifdef CONFIG_B2
|
||||
data = data | ((*src++)<<(8*i));
|
||||
#else
|
||||
data = (data << 8) | *src++;
|
||||
#endif
|
||||
--cnt;
|
||||
}
|
||||
for (; i<4; ++i, ++cp) {
|
||||
#ifdef CONFIG_B2
|
||||
data = data | ((*(uchar *)cp)<<(8*i));
|
||||
#else
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
#endif
|
||||
}
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
@@ -645,8 +671,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile CFG_FLASH_WORD_SIZE *)dest) &
|
||||
(CFG_FLASH_WORD_SIZE)data) != (CFG_FLASH_WORD_SIZE)data) {
|
||||
if ((*((volatile ulong *)dest) & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
|
||||
@@ -104,17 +104,17 @@ int checkboard (void)
|
||||
CFG_PCMCIA_ATTR_BASE, /* Hi */
|
||||
0x3D000017, /* Lo0 */
|
||||
0x3D200017); /* Lo1 */
|
||||
#endif
|
||||
#endif /* 0 */
|
||||
write_one_tlb(22, /* index */
|
||||
0x01ffe000, /* Pagemask, 16 MB pages */
|
||||
CFG_PCMCIA_MEM_ADDR, /* Hi */
|
||||
0x3E000017, /* Lo0 */
|
||||
0x3E200017); /* Lo1 */
|
||||
#endif /* CONFIG_IDE_PCMCIA */
|
||||
|
||||
/* Release reset of ethernet PHY chips */
|
||||
/* Always do this, because linux does not know about it */
|
||||
*phy = 3;
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -44,16 +44,12 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
|
||||
armboot_end_data = .;
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = 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 = .);
|
||||
}
|
||||
@@ -37,17 +37,18 @@
|
||||
*/
|
||||
ulong bab7xx_get_bus_freq (void)
|
||||
{
|
||||
/*
|
||||
* The GPIO Port 1 on BAB7xx reflects the bus speed.
|
||||
*/
|
||||
volatile struct GPIO *gpio = (struct GPIO *)(CFG_ISA_IO + CFG_NS87308_GPIO_BASE);
|
||||
/*
|
||||
* The GPIO Port 1 on BAB7xx reflects the bus speed.
|
||||
*/
|
||||
volatile struct GPIO *gpio =
|
||||
(struct GPIO *) (CFG_ISA_IO + CFG_NS87308_GPIO_BASE);
|
||||
|
||||
unsigned char data = gpio->dta1;
|
||||
unsigned char data = gpio->dta1;
|
||||
|
||||
if (data & 0x02)
|
||||
return 66666666;
|
||||
if (data & 0x02)
|
||||
return 66666666;
|
||||
|
||||
return 83333333;
|
||||
return 83333333;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -57,24 +58,26 @@ ulong bab7xx_get_bus_freq (void)
|
||||
*/
|
||||
ulong bab7xx_get_gclk_freq (void)
|
||||
{
|
||||
static const int pllratio_to_factor[] = {
|
||||
00, 75, 70, 00, 20, 65, 100, 45, 30, 55, 40, 50, 80, 60, 35, 00,
|
||||
};
|
||||
static const int pllratio_to_factor[] = {
|
||||
00, 75, 70, 00, 20, 65, 100, 45, 30, 55, 40, 50, 80, 60, 35,
|
||||
00,
|
||||
};
|
||||
|
||||
return pllratio_to_factor[get_hid1 () >> 28] * (bab7xx_get_bus_freq() / 10);
|
||||
return pllratio_to_factor[get_hid1 () >> 28] *
|
||||
(bab7xx_get_bus_freq () / 10);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
int checkcpu (void)
|
||||
{
|
||||
uint pvr = get_pvr();
|
||||
uint pvr = get_pvr ();
|
||||
|
||||
printf ("MPC7xx V%d.%d",(pvr >> 8) & 0xFF, pvr & 0xFF);
|
||||
printf (" at %ld / %ld MHz\n", bab7xx_get_gclk_freq()/1000000,
|
||||
bab7xx_get_bus_freq()/1000000);
|
||||
printf ("MPC7xx V%d.%d", (pvr >> 8) & 0xFF, pvr & 0xFF);
|
||||
printf (" at %ld / %ld MHz\n", bab7xx_get_gclk_freq () / 1000000,
|
||||
bab7xx_get_bus_freq () / 1000000);
|
||||
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -82,20 +85,20 @@ int checkcpu (void)
|
||||
int checkboard (void)
|
||||
{
|
||||
#ifdef CFG_ADDRESS_MAP_A
|
||||
puts ("Board: ELTEC BAB7xx PReP\n");
|
||||
puts ("Board: ELTEC BAB7xx PReP\n");
|
||||
#else
|
||||
puts ("Board: ELTEC BAB7xx CHRP\n");
|
||||
puts ("Board: ELTEC BAB7xx CHRP\n");
|
||||
#endif
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int checkflash (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("2 MB ## Test not implemented yet ##\n");
|
||||
return (0);
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("2 MB ## Test not implemented yet ##\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -103,77 +106,75 @@ int checkflash (void)
|
||||
|
||||
static unsigned int mpc106_read_cfg_dword (unsigned int reg)
|
||||
{
|
||||
unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
|
||||
unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
|
||||
|
||||
out32r(MPC106_REG_ADDR, reg_addr);
|
||||
out32r (MPC106_REG_ADDR, reg_addr);
|
||||
|
||||
return (in32r(MPC106_REG_DATA | (reg & 0x3)));
|
||||
return (in32r (MPC106_REG_DATA | (reg & 0x3)));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int dram_size (int board_type)
|
||||
{
|
||||
/* No actual initialisation to do - done when setting up
|
||||
* PICRs MCCRs ME/SARs etc in ram_init.S.
|
||||
*/
|
||||
/* No actual initialisation to do - done when setting up
|
||||
* PICRs MCCRs ME/SARs etc in ram_init.S.
|
||||
*/
|
||||
|
||||
register unsigned long i, msar1, mear1, memSize;
|
||||
register unsigned long i, msar1, mear1, memSize;
|
||||
|
||||
#if defined(CFG_MEMTEST)
|
||||
register unsigned long reg;
|
||||
register unsigned long reg;
|
||||
|
||||
printf("Testing DRAM\n");
|
||||
printf ("Testing DRAM\n");
|
||||
|
||||
/* write each mem addr with it's address */
|
||||
for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
|
||||
*reg = reg;
|
||||
/* write each mem addr with it's address */
|
||||
for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg += 4)
|
||||
*reg = reg;
|
||||
|
||||
for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
|
||||
{
|
||||
if (*reg != reg)
|
||||
return -1;
|
||||
}
|
||||
for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg += 4) {
|
||||
if (*reg != reg)
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Since MPC106 memory controller chip has already been set to
|
||||
* control all memory, just read and interpret its memory boundery register.
|
||||
*/
|
||||
memSize = 0;
|
||||
msar1 = mpc106_read_cfg_dword(MPC106_MSAR1);
|
||||
mear1 = mpc106_read_cfg_dword(MPC106_MEAR1);
|
||||
i = mpc106_read_cfg_dword(MPC106_MBER) & 0xf;
|
||||
/*
|
||||
* Since MPC106 memory controller chip has already been set to
|
||||
* control all memory, just read and interpret its memory boundery register.
|
||||
*/
|
||||
memSize = 0;
|
||||
msar1 = mpc106_read_cfg_dword (MPC106_MSAR1);
|
||||
mear1 = mpc106_read_cfg_dword (MPC106_MEAR1);
|
||||
i = mpc106_read_cfg_dword (MPC106_MBER) & 0xf;
|
||||
|
||||
do
|
||||
{
|
||||
if (i & 0x01) /* is bank enabled ? */
|
||||
memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
|
||||
msar1 >>= 8;
|
||||
mear1 >>= 8;
|
||||
i >>= 1;
|
||||
} while (i);
|
||||
do {
|
||||
if (i & 0x01) /* is bank enabled ? */
|
||||
memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
|
||||
msar1 >>= 8;
|
||||
mear1 >>= 8;
|
||||
i >>= 1;
|
||||
} while (i);
|
||||
|
||||
return (memSize * 0x100000);
|
||||
return (memSize * 0x100000);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram(int board_type)
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
return dram_size(board_type);
|
||||
return dram_size (board_type);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
void after_reloc (ulong dest_addr)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*
|
||||
* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r((gd_t *)gd, dest_addr);
|
||||
/*
|
||||
* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r ((gd_t *) gd, dest_addr);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -182,14 +183,13 @@ void after_reloc (ulong dest_addr)
|
||||
* do_reset is done here because in this case it is board specific, since the
|
||||
* 7xx CPUs can only be reset by external HW (the RTC in this case).
|
||||
*/
|
||||
void
|
||||
do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
|
||||
void do_reset (cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
|
||||
{
|
||||
#if defined(CONFIG_RTC_MK48T59)
|
||||
/* trigger watchdog immediately */
|
||||
rtc_set_watchdog(1, RTC_WD_RB_16TH);
|
||||
/* trigger watchdog immediately */
|
||||
rtc_set_watchdog (1, RTC_WD_RB_16TH);
|
||||
#else
|
||||
#error "You must define the macro CONFIG_RTC_MK48T59."
|
||||
#error "You must define the macro CONFIG_RTC_MK48T59."
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -200,16 +200,16 @@ do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
|
||||
* Since the 7xx CPUs don't have an internal watchdog, this function is
|
||||
* board specific. We use the RTC here.
|
||||
*/
|
||||
void watchdog_reset(void)
|
||||
void watchdog_reset (void)
|
||||
{
|
||||
#if defined(CONFIG_RTC_MK48T59)
|
||||
/* we use a 32 sec watchdog timer */
|
||||
rtc_set_watchdog(8, RTC_WD_RB_4);
|
||||
/* we use a 32 sec watchdog timer */
|
||||
rtc_set_watchdog (8, RTC_WD_RB_4);
|
||||
#else
|
||||
#error "You must define the macro CONFIG_RTC_MK48T59."
|
||||
#error "You must define the macro CONFIG_RTC_MK48T59."
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_WATCHDOG */
|
||||
#endif /* CONFIG_WATCHDOG */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -218,29 +218,28 @@ extern GraphicDevice smi;
|
||||
|
||||
void video_get_info_str (int line_number, char *info)
|
||||
{
|
||||
/* init video info strings for graphic console */
|
||||
switch (line_number)
|
||||
{
|
||||
case 1:
|
||||
sprintf (info," MPC7xx V%d.%d at %ld / %ld MHz",
|
||||
(get_pvr() >> 8) & 0xFF,
|
||||
get_pvr() & 0xFF,
|
||||
bab7xx_get_gclk_freq()/1000000,
|
||||
bab7xx_get_bus_freq()/1000000);
|
||||
return;
|
||||
case 2:
|
||||
sprintf (info, " ELTEC BAB7xx with %ld MB DRAM and %ld MB FLASH",
|
||||
dram_size(0)/0x100000,
|
||||
flash_init()/0x100000);
|
||||
return;
|
||||
case 3:
|
||||
sprintf (info, " %s", smi.modeIdent);
|
||||
return;
|
||||
}
|
||||
/* init video info strings for graphic console */
|
||||
switch (line_number) {
|
||||
case 1:
|
||||
sprintf (info, " MPC7xx V%d.%d at %ld / %ld MHz",
|
||||
(get_pvr () >> 8) & 0xFF,
|
||||
get_pvr () & 0xFF,
|
||||
bab7xx_get_gclk_freq () / 1000000,
|
||||
bab7xx_get_bus_freq () / 1000000);
|
||||
return;
|
||||
case 2:
|
||||
sprintf (info,
|
||||
" ELTEC BAB7xx with %ld MB DRAM and %ld MB FLASH",
|
||||
dram_size (0) / 0x100000, flash_init () / 0x100000);
|
||||
return;
|
||||
case 3:
|
||||
sprintf (info, " %s", smi.modeIdent);
|
||||
return;
|
||||
}
|
||||
|
||||
/* no more info lines */
|
||||
*info = 0;
|
||||
return;
|
||||
/* no more info lines */
|
||||
*info = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,32 +31,32 @@
|
||||
/* imports */
|
||||
extern char console_buffer[CFG_CBSIZE];
|
||||
extern int l2_cache_enable (int l2control);
|
||||
extern int eepro100_write_eeprom (struct eth_device* dev, int location,
|
||||
int addr_len, unsigned short data);
|
||||
extern int read_eeprom (struct eth_device* dev, int location, int addr_len);
|
||||
extern int eepro100_write_eeprom (struct eth_device *dev, int location,
|
||||
int addr_len, unsigned short data);
|
||||
extern int read_eeprom (struct eth_device *dev, int location, int addr_len);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*
|
||||
* read/write to nvram is only byte access
|
||||
*/
|
||||
void *nvram_read(void *dest, const long src, size_t count)
|
||||
void *nvram_read (void *dest, const long src, size_t count)
|
||||
{
|
||||
uchar *d = (uchar *) dest;
|
||||
uchar *s = (uchar *) (CFG_ENV_MAP_ADRS + src);
|
||||
uchar *d = (uchar *) dest;
|
||||
uchar *s = (uchar *) (CFG_ENV_MAP_ADRS + src);
|
||||
|
||||
while (count--)
|
||||
*d++ = *s++;
|
||||
while (count--)
|
||||
*d++ = *s++;
|
||||
|
||||
return dest;
|
||||
return dest;
|
||||
}
|
||||
|
||||
void nvram_write(long dest, const void *src, size_t count)
|
||||
void nvram_write (long dest, const void *src, size_t count)
|
||||
{
|
||||
uchar *d = (uchar *) (CFG_ENV_MAP_ADRS + dest);
|
||||
uchar *s = (uchar *) src;
|
||||
uchar *d = (uchar *) (CFG_ENV_MAP_ADRS + dest);
|
||||
uchar *s = (uchar *) src;
|
||||
|
||||
while (count--)
|
||||
*d++ = *s++;
|
||||
while (count--)
|
||||
*d++ = *s++;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
@@ -67,192 +67,195 @@ void nvram_write(long dest, const void *src, size_t count)
|
||||
*/
|
||||
int misc_init_r (void)
|
||||
{
|
||||
revinfo eerev;
|
||||
u_char *ptr;
|
||||
u_int i, l, initSrom, copyNv;
|
||||
char buf[256];
|
||||
char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
|
||||
revinfo eerev;
|
||||
u_char *ptr;
|
||||
u_int i, l, initSrom, copyNv;
|
||||
char buf[256];
|
||||
char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 10, 11, 12, 13, 14, 15
|
||||
};
|
||||
|
||||
/* Clock setting for MPC107 i2c */
|
||||
mpc107_i2c_init (MPC107_EUMB_ADDR, 0x2b);
|
||||
/* Clock setting for MPC107 i2c */
|
||||
mpc107_i2c_init (MPC107_EUMB_ADDR, 0x2b);
|
||||
|
||||
/* Reset the EPIC */
|
||||
out32r (MPC107_EUMB_GCR, 0xa0000000);
|
||||
while (in32r (MPC107_EUMB_GCR) & 0x80000000); /* Wait for reset to complete */
|
||||
out32r (MPC107_EUMB_GCR, 0x20000000); /* Put into into mixed mode */
|
||||
while (in32r (MPC107_EUMB_IACKR) != 0xff); /* Clear all pending interrupts */
|
||||
/* Reset the EPIC */
|
||||
out32r (MPC107_EUMB_GCR, 0xa0000000);
|
||||
while (in32r (MPC107_EUMB_GCR) & 0x80000000); /* Wait for reset to complete */
|
||||
out32r (MPC107_EUMB_GCR, 0x20000000); /* Put into into mixed mode */
|
||||
while (in32r (MPC107_EUMB_IACKR) != 0xff); /* Clear all pending interrupts */
|
||||
|
||||
/*
|
||||
* Check/Remake revision info
|
||||
*/
|
||||
initSrom = 0;
|
||||
copyNv = 0;
|
||||
/*
|
||||
* Check/Remake revision info
|
||||
*/
|
||||
initSrom = 0;
|
||||
copyNv = 0;
|
||||
|
||||
/* read out current revision srom contens */
|
||||
mpc107_srom_load (0x0000, (u_char*)&eerev, sizeof(revinfo),
|
||||
SECOND_DEVICE, FIRST_BLOCK);
|
||||
/* read out current revision srom contens */
|
||||
mpc107_srom_load (0x0000, (u_char *) & eerev, sizeof (revinfo),
|
||||
SECOND_DEVICE, FIRST_BLOCK);
|
||||
|
||||
/* read out current nvram shadow image */
|
||||
nvram_read (buf, CFG_NV_SROM_COPY_ADDR, CFG_SROM_SIZE);
|
||||
/* read out current nvram shadow image */
|
||||
nvram_read (buf, CFG_NV_SROM_COPY_ADDR, CFG_SROM_SIZE);
|
||||
|
||||
if (strcmp (eerev.magic, "ELTEC") != 0)
|
||||
{
|
||||
/* srom is not initialized -> create a default revision info */
|
||||
for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
|
||||
*ptr++ = 0x00;
|
||||
strcpy(eerev.magic, "ELTEC");
|
||||
eerev.revrev[0] = 1;
|
||||
eerev.revrev[1] = 0;
|
||||
eerev.size = 0x00E0;
|
||||
eerev.category[0] = 0x01;
|
||||
if (strcmp (eerev.magic, "ELTEC") != 0) {
|
||||
/* srom is not initialized -> create a default revision info */
|
||||
for (i = 0, ptr = (u_char *) & eerev; i < sizeof (revinfo);
|
||||
i++)
|
||||
*ptr++ = 0x00;
|
||||
strcpy (eerev.magic, "ELTEC");
|
||||
eerev.revrev[0] = 1;
|
||||
eerev.revrev[1] = 0;
|
||||
eerev.size = 0x00E0;
|
||||
eerev.category[0] = 0x01;
|
||||
|
||||
/* node id from dead e128 as default */
|
||||
eerev.etheraddr[0] = 0x00;
|
||||
eerev.etheraddr[1] = 0x00;
|
||||
eerev.etheraddr[2] = 0x5B;
|
||||
eerev.etheraddr[3] = 0x00;
|
||||
eerev.etheraddr[4] = 0x2E;
|
||||
eerev.etheraddr[5] = 0x4D;
|
||||
/* node id from dead e128 as default */
|
||||
eerev.etheraddr[0] = 0x00;
|
||||
eerev.etheraddr[1] = 0x00;
|
||||
eerev.etheraddr[2] = 0x5B;
|
||||
eerev.etheraddr[3] = 0x00;
|
||||
eerev.etheraddr[4] = 0x2E;
|
||||
eerev.etheraddr[5] = 0x4D;
|
||||
|
||||
/* cache config word for ELPPC */
|
||||
*(int*)&eerev.res[0] = 0;
|
||||
/* cache config word for ELPPC */
|
||||
*(int *) &eerev.res[0] = 0;
|
||||
|
||||
initSrom = 1; /* force dialog */
|
||||
copyNv = 1; /* copy to nvram */
|
||||
}
|
||||
|
||||
if ((copyNv == 0) && (el_srom_checksum((u_char*)&eerev, CFG_SROM_SIZE) !=
|
||||
el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
|
||||
{
|
||||
printf ("Invalid revision info copy in nvram !\n");
|
||||
printf ("Press key:\n <c> to copy current revision info to nvram.\n");
|
||||
printf (" <r> to reenter revision info.\n");
|
||||
printf ("=> ");
|
||||
if (0 != readline (NULL))
|
||||
{
|
||||
switch ((char)toupper(console_buffer[0]))
|
||||
{
|
||||
case 'C':
|
||||
copyNv = 1;
|
||||
break;
|
||||
case 'R':
|
||||
copyNv = 1;
|
||||
initSrom = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (initSrom)
|
||||
{
|
||||
memcpy (buf, &eerev.revision[0][0], 14); /* save all revision info */
|
||||
printf ("Enter revision number (0-9): %c ", eerev.revision[0][0]);
|
||||
if (0 != readline (NULL))
|
||||
{
|
||||
eerev.revision[0][0] = (char)toupper(console_buffer[0]);
|
||||
memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
|
||||
initSrom = 1; /* force dialog */
|
||||
copyNv = 1; /* copy to nvram */
|
||||
}
|
||||
|
||||
printf ("Enter revision character (A-Z): %c ", eerev.revision[0][1]);
|
||||
if (1 == readline (NULL))
|
||||
{
|
||||
eerev.revision[0][1] = (char)toupper(console_buffer[0]);
|
||||
if ((copyNv == 0)
|
||||
&& (el_srom_checksum ((u_char *) & eerev, CFG_SROM_SIZE) !=
|
||||
el_srom_checksum ((u_char *) buf, CFG_SROM_SIZE))) {
|
||||
printf ("Invalid revision info copy in nvram !\n");
|
||||
printf ("Press key:\n <c> to copy current revision info to nvram.\n");
|
||||
printf (" <r> to reenter revision info.\n");
|
||||
printf ("=> ");
|
||||
if (0 != readline (NULL)) {
|
||||
switch ((char) toupper (console_buffer[0])) {
|
||||
case 'C':
|
||||
copyNv = 1;
|
||||
break;
|
||||
case 'R':
|
||||
copyNv = 1;
|
||||
initSrom = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf ("Enter board name (V-XXXX-XXXX): %s ", (char *)&eerev.board);
|
||||
if (11 == readline (NULL))
|
||||
{
|
||||
for (i=0; i<11; i++)
|
||||
eerev.board[i] = (char)toupper(console_buffer[i]);
|
||||
eerev.board[11] = '\0';
|
||||
if (initSrom) {
|
||||
memcpy (buf, &eerev.revision[0][0], 14); /* save all revision info */
|
||||
printf ("Enter revision number (0-9): %c ",
|
||||
eerev.revision[0][0]);
|
||||
if (0 != readline (NULL)) {
|
||||
eerev.revision[0][0] =
|
||||
(char) toupper (console_buffer[0]);
|
||||
memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
|
||||
}
|
||||
|
||||
printf ("Enter revision character (A-Z): %c ",
|
||||
eerev.revision[0][1]);
|
||||
if (1 == readline (NULL)) {
|
||||
eerev.revision[0][1] =
|
||||
(char) toupper (console_buffer[0]);
|
||||
}
|
||||
|
||||
printf ("Enter board name (V-XXXX-XXXX): %s ",
|
||||
(char *) &eerev.board);
|
||||
if (11 == readline (NULL)) {
|
||||
for (i = 0; i < 11; i++)
|
||||
eerev.board[i] =
|
||||
(char) toupper (console_buffer[i]);
|
||||
eerev.board[11] = '\0';
|
||||
}
|
||||
|
||||
printf ("Enter serial number: %s ", (char *) &eerev.serial);
|
||||
if (6 == readline (NULL)) {
|
||||
for (i = 0; i < 6; i++)
|
||||
eerev.serial[i] = console_buffer[i];
|
||||
eerev.serial[6] = '\0';
|
||||
}
|
||||
|
||||
printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x ", eerev.etheraddr[0], eerev.etheraddr[1], eerev.etheraddr[2], eerev.etheraddr[3], eerev.etheraddr[4], eerev.etheraddr[5]);
|
||||
if (12 == readline (NULL)) {
|
||||
for (i = 0; i < 12; i += 2)
|
||||
eerev.etheraddr[i >> 1] =
|
||||
(char) (16 *
|
||||
hex[toupper
|
||||
(console_buffer[i]) -
|
||||
'0'] +
|
||||
hex[toupper
|
||||
(console_buffer[i + 1]) -
|
||||
'0']);
|
||||
}
|
||||
|
||||
l = strlen ((char *) &eerev.text);
|
||||
printf ("Add to text section (max 64 chr): %s ",
|
||||
(char *) &eerev.text);
|
||||
if (0 != readline (NULL)) {
|
||||
for (i = l; i < 63; i++)
|
||||
eerev.text[i] = console_buffer[i - l];
|
||||
eerev.text[63] = '\0';
|
||||
}
|
||||
|
||||
/* prepare network eeprom */
|
||||
memset (buf, 0, 128);
|
||||
|
||||
buf[0] = eerev.etheraddr[1];
|
||||
buf[1] = eerev.etheraddr[0];
|
||||
buf[2] = eerev.etheraddr[3];
|
||||
buf[3] = eerev.etheraddr[2];
|
||||
buf[4] = eerev.etheraddr[5];
|
||||
buf[5] = eerev.etheraddr[4];
|
||||
|
||||
*(unsigned short *) &buf[20] = 0x48B2;
|
||||
*(unsigned short *) &buf[22] = 0x0004;
|
||||
*(unsigned short *) &buf[24] = 0x1433;
|
||||
|
||||
printf ("\nSRom: Writing i82559 info ........ ");
|
||||
if (eepro100_srom_store ((unsigned short *) buf) == -1)
|
||||
printf ("FAILED\n");
|
||||
else
|
||||
printf ("OK\n");
|
||||
|
||||
/* update CRC */
|
||||
eerev.crc =
|
||||
el_srom_checksum ((u_char *) eerev.board, eerev.size);
|
||||
|
||||
/* write new values */
|
||||
printf ("\nSRom: Writing revision info ...... ");
|
||||
if (mpc107_srom_store
|
||||
((BLOCK_SIZE - sizeof (revinfo)), (u_char *) & eerev,
|
||||
sizeof (revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
|
||||
printf ("FAILED\n\n");
|
||||
else
|
||||
printf ("OK\n\n");
|
||||
|
||||
/* write new values as shadow image to nvram */
|
||||
nvram_write (CFG_NV_SROM_COPY_ADDR, (void *) &eerev,
|
||||
CFG_SROM_SIZE);
|
||||
|
||||
}
|
||||
|
||||
printf ("Enter serial number: %s ", (char *)&eerev.serial );
|
||||
if (6 == readline (NULL))
|
||||
{
|
||||
for (i=0; i<6; i++)
|
||||
eerev.serial[i] = console_buffer[i];
|
||||
eerev.serial[6] = '\0';
|
||||
}
|
||||
/*if (initSrom) */
|
||||
/* copy current values as shadow image to nvram */
|
||||
if (initSrom == 0 && copyNv == 1)
|
||||
nvram_write (CFG_NV_SROM_COPY_ADDR, (void *) &eerev,
|
||||
CFG_SROM_SIZE);
|
||||
|
||||
printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x ",
|
||||
eerev.etheraddr[0], eerev.etheraddr[1],
|
||||
eerev.etheraddr[2], eerev.etheraddr[3],
|
||||
eerev.etheraddr[4], eerev.etheraddr[5]);
|
||||
if (12 == readline (NULL))
|
||||
{
|
||||
for (i=0; i<12; i+=2)
|
||||
eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
|
||||
hex[toupper(console_buffer[i+1])-'0']);
|
||||
}
|
||||
/* update environment */
|
||||
sprintf (buf, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
eerev.etheraddr[0], eerev.etheraddr[1],
|
||||
eerev.etheraddr[2], eerev.etheraddr[3],
|
||||
eerev.etheraddr[4], eerev.etheraddr[5]);
|
||||
setenv ("ethaddr", buf);
|
||||
|
||||
l = strlen ((char *)&eerev.text);
|
||||
printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
|
||||
if (0 != readline (NULL))
|
||||
{
|
||||
for (i = l; i<63; i++)
|
||||
eerev.text[i] = console_buffer[i-l];
|
||||
eerev.text[63] = '\0';
|
||||
}
|
||||
/* print actual board identification */
|
||||
printf ("Ident: %s Ser %s Rev %c%c\n",
|
||||
eerev.board, (char *) &eerev.serial,
|
||||
eerev.revision[0][0], eerev.revision[0][1]);
|
||||
|
||||
/* prepare network eeprom */
|
||||
memset (buf, 0, 128);
|
||||
|
||||
buf[0] = eerev.etheraddr[1];
|
||||
buf[1] = eerev.etheraddr[0];
|
||||
buf[2] = eerev.etheraddr[3];
|
||||
buf[3] = eerev.etheraddr[2];
|
||||
buf[4] = eerev.etheraddr[5];
|
||||
buf[5] = eerev.etheraddr[4];
|
||||
|
||||
*(unsigned short *)&buf[20] = 0x48B2;
|
||||
*(unsigned short *)&buf[22] = 0x0004;
|
||||
*(unsigned short *)&buf[24] = 0x1433;
|
||||
|
||||
printf("\nSRom: Writing i82559 info ........ ");
|
||||
if (eepro100_srom_store ((unsigned short *)buf) == -1)
|
||||
printf("FAILED\n");
|
||||
else
|
||||
printf("OK\n");
|
||||
|
||||
/* update CRC */
|
||||
eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
|
||||
|
||||
/* write new values */
|
||||
printf("\nSRom: Writing revision info ...... ");
|
||||
if (mpc107_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
|
||||
sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
|
||||
printf("FAILED\n\n");
|
||||
else
|
||||
printf("OK\n\n");
|
||||
|
||||
/* write new values as shadow image to nvram */
|
||||
nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
|
||||
|
||||
} /*if (initSrom) */
|
||||
|
||||
/* copy current values as shadow image to nvram */
|
||||
if (initSrom == 0 && copyNv == 1)
|
||||
nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
|
||||
|
||||
/* update environment */
|
||||
sprintf (buf, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
eerev.etheraddr[0], eerev.etheraddr[1],
|
||||
eerev.etheraddr[2], eerev.etheraddr[3],
|
||||
eerev.etheraddr[4], eerev.etheraddr[5]);
|
||||
setenv ("ethaddr", buf);
|
||||
|
||||
/* set serial console as default */
|
||||
if ((ptr = getenv ("console")) == NULL)
|
||||
setenv ("console", "serial");
|
||||
|
||||
/* print actual board identification */
|
||||
printf("Ident: %s Ser %s Rev %c%c\n",
|
||||
eerev.board, (char *)&eerev.serial,
|
||||
eerev.revision[0][0], eerev.revision[0][1]);
|
||||
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
@@ -38,19 +38,19 @@
|
||||
/* imports from common/main.c */
|
||||
extern char console_buffer[CFG_CBSIZE];
|
||||
|
||||
extern void eeprom_init (void);
|
||||
extern int eeprom_read (unsigned dev_addr, unsigned offset,
|
||||
unsigned char *buffer, unsigned cnt);
|
||||
extern int eeprom_write (unsigned dev_addr, unsigned offset,
|
||||
unsigned char *buffer, unsigned cnt);
|
||||
extern void eeprom_init (void);
|
||||
extern int eeprom_read (unsigned dev_addr, unsigned offset,
|
||||
unsigned char *buffer, unsigned cnt);
|
||||
extern int eeprom_write (unsigned dev_addr, unsigned offset,
|
||||
unsigned char *buffer, unsigned cnt);
|
||||
|
||||
/* globals */
|
||||
void *video_hw_init(void);
|
||||
void video_set_lut (unsigned int index, /* color number */
|
||||
unsigned char r, /* red */
|
||||
unsigned char g, /* green */
|
||||
unsigned char b /* blue */
|
||||
);
|
||||
void *video_hw_init (void);
|
||||
void video_set_lut (unsigned int index, /* color number */
|
||||
unsigned char r, /* red */
|
||||
unsigned char g, /* green */
|
||||
unsigned char b /* blue */
|
||||
);
|
||||
|
||||
GraphicDevice gdev;
|
||||
|
||||
@@ -60,79 +60,78 @@ static void video_test_image (void);
|
||||
static void video_default_lut (unsigned int clut_type);
|
||||
|
||||
/* revision info foer MHPC EEPROM offset 480 */
|
||||
typedef struct {
|
||||
char board[12]; /* 000 - Board Revision information */
|
||||
char sensor; /* 012 - Sensor Type information */
|
||||
char serial[8]; /* 013 - Board serial number */
|
||||
char etheraddr[6]; /* 021 - Ethernet node addresse */
|
||||
char revision[2]; /* 027 - Revision code */
|
||||
char option[3]; /* 029 - resevered for options */
|
||||
typedef struct {
|
||||
char board[12]; /* 000 - Board Revision information */
|
||||
char sensor; /* 012 - Sensor Type information */
|
||||
char serial[8]; /* 013 - Board serial number */
|
||||
char etheraddr[6]; /* 021 - Ethernet node addresse */
|
||||
char revision[2]; /* 027 - Revision code */
|
||||
char option[3]; /* 029 - resevered for options */
|
||||
} revinfo;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const unsigned int sdram_table[] =
|
||||
{
|
||||
/* read single beat cycle */
|
||||
0xef0efc04, 0x0e2dac04, 0x01ba5c04, 0x1ff5fc00,
|
||||
0xfffffc05, 0xeffafc34, 0x0ff0bc34, 0x1ff57c35,
|
||||
static const unsigned int sdram_table[] = {
|
||||
/* read single beat cycle */
|
||||
0xef0efc04, 0x0e2dac04, 0x01ba5c04, 0x1ff5fc00,
|
||||
0xfffffc05, 0xeffafc34, 0x0ff0bc34, 0x1ff57c35,
|
||||
|
||||
/* read burst cycle */
|
||||
0xef0efc04, 0x0e3dac04, 0x10ff5c04, 0xf0fffc00,
|
||||
0xf0fffc00, 0xf1fffc00, 0xfffffc00, 0xfffffc05,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
/* read burst cycle */
|
||||
0xef0efc04, 0x0e3dac04, 0x10ff5c04, 0xf0fffc00,
|
||||
0xf0fffc00, 0xf1fffc00, 0xfffffc00, 0xfffffc05,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* write single beat cycle */
|
||||
0xef0efc04, 0x0e29ac00, 0x01b25c04, 0x1ff5fc05,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
/* write single beat cycle */
|
||||
0xef0efc04, 0x0e29ac00, 0x01b25c04, 0x1ff5fc05,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* write burst cycle */
|
||||
0xef0ef804, 0x0e39a000, 0x10f75000, 0xf0fff440,
|
||||
0xf0fffc40, 0xf1fffc04, 0xfffffc05, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
/* write burst cycle */
|
||||
0xef0ef804, 0x0e39a000, 0x10f75000, 0xf0fff440,
|
||||
0xf0fffc40, 0xf1fffc04, 0xfffffc05, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* periodic timer expired */
|
||||
0xeffebc84, 0x1ffd7c04, 0xfffffc04, 0xfffffc84,
|
||||
0xeffebc04, 0x1ffd7c04, 0xfffffc04, 0xfffffc05,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
/* periodic timer expired */
|
||||
0xeffebc84, 0x1ffd7c04, 0xfffffc04, 0xfffffc84,
|
||||
0xeffebc04, 0x1ffd7c04, 0xfffffc04, 0xfffffc05,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* exception */
|
||||
0xfffffc04, 0xfffffc05, 0xfffffc04, 0xfffffc04
|
||||
/* exception */
|
||||
0xfffffc04, 0xfffffc05, 0xfffffc04, 0xfffffc04
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
volatile immap_t *im = (immap_t *)CFG_IMMR;
|
||||
volatile cpm8xx_t *cp = &(im->im_cpm);
|
||||
volatile iop8xx_t *ip = (iop8xx_t *)&(im->im_ioport);
|
||||
volatile immap_t *im = (immap_t *) CFG_IMMR;
|
||||
volatile cpm8xx_t *cp = &(im->im_cpm);
|
||||
volatile iop8xx_t *ip = (iop8xx_t *) & (im->im_ioport);
|
||||
|
||||
/* reset the port A s.a. cpm-routines */
|
||||
ip->iop_padat = 0x0000;
|
||||
ip->iop_papar = 0x0000;
|
||||
ip->iop_padir = 0x0800;
|
||||
ip->iop_paodr = 0x0000;
|
||||
/* reset the port A s.a. cpm-routines */
|
||||
ip->iop_padat = 0x0000;
|
||||
ip->iop_papar = 0x0000;
|
||||
ip->iop_padir = 0x0800;
|
||||
ip->iop_paodr = 0x0000;
|
||||
|
||||
/* reset the port B for digital and LCD output */
|
||||
cp->cp_pbdat = 0x0300;
|
||||
cp->cp_pbpar = 0x5001;
|
||||
cp->cp_pbdir = 0x5301;
|
||||
cp->cp_pbodr = 0x0000;
|
||||
/* reset the port B for digital and LCD output */
|
||||
cp->cp_pbdat = 0x0300;
|
||||
cp->cp_pbpar = 0x5001;
|
||||
cp->cp_pbdir = 0x5301;
|
||||
cp->cp_pbodr = 0x0000;
|
||||
|
||||
/* reset the port C configured for SMC1 serial port and aqc. control */
|
||||
ip->iop_pcdat = 0x0800;
|
||||
ip->iop_pcpar = 0x0000;
|
||||
ip->iop_pcdir = 0x0e30;
|
||||
ip->iop_pcso = 0x0000;
|
||||
/* reset the port C configured for SMC1 serial port and aqc. control */
|
||||
ip->iop_pcdat = 0x0800;
|
||||
ip->iop_pcpar = 0x0000;
|
||||
ip->iop_pcdir = 0x0e30;
|
||||
ip->iop_pcso = 0x0000;
|
||||
|
||||
/* Config port D for LCD output */
|
||||
ip->iop_pdpar = 0x1fff;
|
||||
ip->iop_pddir = 0x1fff;
|
||||
/* Config port D for LCD output */
|
||||
ip->iop_pdpar = 0x1fff;
|
||||
ip->iop_pddir = 0x1fff;
|
||||
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -142,322 +141,327 @@ int board_early_init_f (void)
|
||||
*/
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: ELTEC miniHiperCam\n");
|
||||
return(0);
|
||||
puts ("Board: ELTEC miniHiperCam\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_r(void)
|
||||
int misc_init_r (void)
|
||||
{
|
||||
revinfo mhpcRevInfo;
|
||||
char nid[32];
|
||||
char *mhpcSensorTypes[] = { "OMNIVISON OV7610/7620 color",
|
||||
"OMNIVISON OV7110 b&w", NULL };
|
||||
char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
|
||||
int i;
|
||||
revinfo mhpcRevInfo;
|
||||
char nid[32];
|
||||
char *mhpcSensorTypes[] = { "OMNIVISON OV7610/7620 color",
|
||||
"OMNIVISON OV7110 b&w", NULL
|
||||
};
|
||||
char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 10, 11, 12, 13, 14, 15
|
||||
};
|
||||
int i;
|
||||
|
||||
/* check revision data */
|
||||
eeprom_read (CFG_I2C_EEPROM_ADDR, 480, (char*)&mhpcRevInfo, 32);
|
||||
/* check revision data */
|
||||
eeprom_read (CFG_I2C_EEPROM_ADDR, 480, (char *) &mhpcRevInfo, 32);
|
||||
|
||||
if (strncmp((char *)&mhpcRevInfo.board[2], "MHPC", 4) != 0)
|
||||
{
|
||||
printf ("Enter revision number (0-9): %c ", mhpcRevInfo.revision[0]);
|
||||
if (0 != readline (NULL))
|
||||
{
|
||||
mhpcRevInfo.revision[0] = (char)toupper(console_buffer[0]);
|
||||
}
|
||||
if (strncmp ((char *) &mhpcRevInfo.board[2], "MHPC", 4) != 0) {
|
||||
printf ("Enter revision number (0-9): %c ",
|
||||
mhpcRevInfo.revision[0]);
|
||||
if (0 != readline (NULL)) {
|
||||
mhpcRevInfo.revision[0] =
|
||||
(char) toupper (console_buffer[0]);
|
||||
}
|
||||
|
||||
printf ("Enter revision character (A-Z): %c ", mhpcRevInfo.revision[1]);
|
||||
if (1 == readline (NULL))
|
||||
{
|
||||
mhpcRevInfo.revision[1] = (char)toupper(console_buffer[0]);
|
||||
}
|
||||
printf ("Enter revision character (A-Z): %c ",
|
||||
mhpcRevInfo.revision[1]);
|
||||
if (1 == readline (NULL)) {
|
||||
mhpcRevInfo.revision[1] =
|
||||
(char) toupper (console_buffer[0]);
|
||||
}
|
||||
|
||||
printf("Enter board name (V-XXXX-XXXX): %s ", (char *)&mhpcRevInfo.board);
|
||||
if (11 == readline (NULL))
|
||||
{
|
||||
for (i=0; i<11; i++)
|
||||
{
|
||||
mhpcRevInfo.board[i] = (char)toupper(console_buffer[i]);
|
||||
mhpcRevInfo.board[11] = '\0';
|
||||
printf ("Enter board name (V-XXXX-XXXX): %s ",
|
||||
(char *) &mhpcRevInfo.board);
|
||||
if (11 == readline (NULL)) {
|
||||
for (i = 0; i < 11; i++) {
|
||||
mhpcRevInfo.board[i] =
|
||||
(char) toupper (console_buffer[i]);
|
||||
mhpcRevInfo.board[11] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
printf ("Supported sensor types:\n");
|
||||
i = 0;
|
||||
do {
|
||||
printf ("\n \'%d\' : %s\n", i, mhpcSensorTypes[i]);
|
||||
} while (mhpcSensorTypes[++i] != NULL);
|
||||
|
||||
do {
|
||||
printf ("\nEnter sensor number (0-255): %d ",
|
||||
(int) mhpcRevInfo.sensor);
|
||||
if (0 != readline (NULL)) {
|
||||
mhpcRevInfo.sensor =
|
||||
(unsigned char)
|
||||
simple_strtoul (console_buffer, NULL,
|
||||
10);
|
||||
}
|
||||
} while (mhpcRevInfo.sensor >= i);
|
||||
|
||||
printf ("Enter serial number: %s ",
|
||||
(char *) &mhpcRevInfo.serial);
|
||||
if (6 == readline (NULL)) {
|
||||
for (i = 0; i < 6; i++) {
|
||||
mhpcRevInfo.serial[i] = console_buffer[i];
|
||||
}
|
||||
mhpcRevInfo.serial[6] = '\0';
|
||||
}
|
||||
|
||||
printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x ", mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1], mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3], mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]);
|
||||
if (12 == readline (NULL)) {
|
||||
for (i = 0; i < 12; i += 2) {
|
||||
mhpcRevInfo.etheraddr[i >> 1] =
|
||||
(char) (16 *
|
||||
hex[toupper
|
||||
(console_buffer[i]) -
|
||||
'0'] +
|
||||
hex[toupper
|
||||
(console_buffer[i + 1]) -
|
||||
'0']);
|
||||
}
|
||||
}
|
||||
|
||||
/* setup new revision data */
|
||||
eeprom_write (CFG_I2C_EEPROM_ADDR, 480, (char *) &mhpcRevInfo,
|
||||
32);
|
||||
}
|
||||
}
|
||||
|
||||
printf("Supported sensor types:\n");
|
||||
i=0;
|
||||
do
|
||||
{
|
||||
printf("\n \'%d\' : %s\n", i, mhpcSensorTypes[i]);
|
||||
} while ( mhpcSensorTypes[++i] != NULL );
|
||||
/* set environment */
|
||||
sprintf (nid, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
|
||||
mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
|
||||
mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]);
|
||||
setenv ("ethaddr", nid);
|
||||
|
||||
do
|
||||
{
|
||||
printf("\nEnter sensor number (0-255): %d ", (int)mhpcRevInfo.sensor );
|
||||
if (0 != readline (NULL))
|
||||
{
|
||||
mhpcRevInfo.sensor = (unsigned char)simple_strtoul(console_buffer, NULL, 10);
|
||||
}
|
||||
} while ( mhpcRevInfo.sensor >= i );
|
||||
/* print actual board identification */
|
||||
printf ("Ident: %s %s Ser %s Rev %c%c\n",
|
||||
mhpcRevInfo.board,
|
||||
(mhpcRevInfo.sensor == 0 ? "color" : "b&w"),
|
||||
(char *) &mhpcRevInfo.serial, mhpcRevInfo.revision[0],
|
||||
mhpcRevInfo.revision[1]);
|
||||
|
||||
printf("Enter serial number: %s ", (char *)&mhpcRevInfo.serial );
|
||||
if (6 == readline (NULL))
|
||||
{
|
||||
for (i=0; i<6; i++)
|
||||
{
|
||||
mhpcRevInfo.serial[i] = console_buffer[i];
|
||||
}
|
||||
mhpcRevInfo.serial[6] = '\0';
|
||||
}
|
||||
|
||||
printf("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x ",
|
||||
mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
|
||||
mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
|
||||
mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5] );
|
||||
if (12 == readline (NULL))
|
||||
{
|
||||
for (i=0; i<12; i+=2)
|
||||
{
|
||||
mhpcRevInfo.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
|
||||
hex[toupper(console_buffer[i+1])-'0']);
|
||||
}
|
||||
}
|
||||
|
||||
/* setup new revision data */
|
||||
eeprom_write (CFG_I2C_EEPROM_ADDR, 480, (char*)&mhpcRevInfo, 32);
|
||||
}
|
||||
|
||||
/* set environment */
|
||||
sprintf( nid, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
|
||||
mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
|
||||
mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]);
|
||||
setenv("ethaddr", nid);
|
||||
|
||||
/* print actual board identification */
|
||||
printf("Ident: %s %s Ser %s Rev %c%c\n",
|
||||
mhpcRevInfo.board, (mhpcRevInfo.sensor==0?"color":"b&w"),
|
||||
(char *)&mhpcRevInfo.serial,
|
||||
mhpcRevInfo.revision[0], mhpcRevInfo.revision[1]);
|
||||
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
|
||||
upmconfig (UPMA, (uint *) sdram_table,
|
||||
sizeof (sdram_table) / sizeof (uint));
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* should this be mamr? - NTL */
|
||||
memctl->memc_mptpr = MPTPR_PTP_DIV64;
|
||||
memctl->memc_mar = 0x00008800;
|
||||
memctl->memc_mamr = CFG_MAMR & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* should this be mamr? - NTL */
|
||||
memctl->memc_mptpr = MPTPR_PTP_DIV64;
|
||||
memctl->memc_mar = 0x00008800;
|
||||
|
||||
/*
|
||||
* Map controller SDRAM bank 0
|
||||
*/
|
||||
memctl->memc_or1 = CFG_OR1_PRELIM;
|
||||
memctl->memc_br1 = CFG_BR1_PRELIM;
|
||||
udelay(200);
|
||||
/*
|
||||
* Map controller SDRAM bank 0
|
||||
*/
|
||||
memctl->memc_or1 = CFG_OR1_PRELIM;
|
||||
memctl->memc_br1 = CFG_BR1_PRELIM;
|
||||
udelay (200);
|
||||
|
||||
/*
|
||||
* Map controller SDRAM bank 1
|
||||
*/
|
||||
memctl->memc_or2 = CFG_OR2;
|
||||
memctl->memc_br2 = CFG_BR2;
|
||||
/*
|
||||
* Map controller SDRAM bank 1
|
||||
*/
|
||||
memctl->memc_or2 = CFG_OR2;
|
||||
memctl->memc_br2 = CFG_BR2;
|
||||
|
||||
/*
|
||||
* Perform SDRAM initializsation sequence
|
||||
*/
|
||||
memctl->memc_mcr = 0x80002105; /* SDRAM bank 0 */
|
||||
udelay(1);
|
||||
memctl->memc_mcr = 0x80002730; /* SDRAM bank 0 - execute twice */
|
||||
udelay(1);
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* enable refresh */
|
||||
/*
|
||||
* Perform SDRAM initializsation sequence
|
||||
*/
|
||||
memctl->memc_mcr = 0x80002105; /* SDRAM bank 0 */
|
||||
udelay (1);
|
||||
memctl->memc_mcr = 0x80002730; /* SDRAM bank 0 - execute twice */
|
||||
udelay (1);
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* enable refresh */
|
||||
|
||||
udelay(10000);
|
||||
udelay (10000);
|
||||
|
||||
/* leave place for framebuffers */
|
||||
return (SDRAM_MAX_SIZE-SDRAM_RES_SIZE);
|
||||
/* leave place for framebuffers */
|
||||
return (SDRAM_MAX_SIZE - SDRAM_RES_SIZE);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static void video_circle (char *center, int radius, int color, int pitch)
|
||||
{
|
||||
int x,y,d,dE,dSE;
|
||||
int x, y, d, dE, dSE;
|
||||
|
||||
x = 0;
|
||||
y = radius;
|
||||
d = 1-radius;
|
||||
dE = 3;
|
||||
dSE = -2*radius+5;
|
||||
x = 0;
|
||||
y = radius;
|
||||
d = 1 - radius;
|
||||
dE = 3;
|
||||
dSE = -2 * radius + 5;
|
||||
|
||||
*(center+x+y*pitch) = color;
|
||||
*(center+y+x*pitch) = color;
|
||||
*(center+y-x*pitch) = color;
|
||||
*(center+x-y*pitch) = color;
|
||||
*(center-x-y*pitch) = color;
|
||||
*(center-y-x*pitch) = color;
|
||||
*(center-y+x*pitch) = color;
|
||||
*(center-x+y*pitch) = color;
|
||||
while(y>x)
|
||||
{
|
||||
if (d<0)
|
||||
{
|
||||
d += dE;
|
||||
dE += 2;
|
||||
dSE += 2;
|
||||
x++;
|
||||
*(center + x + y * pitch) = color;
|
||||
*(center + y + x * pitch) = color;
|
||||
*(center + y - x * pitch) = color;
|
||||
*(center + x - y * pitch) = color;
|
||||
*(center - x - y * pitch) = color;
|
||||
*(center - y - x * pitch) = color;
|
||||
*(center - y + x * pitch) = color;
|
||||
*(center - x + y * pitch) = color;
|
||||
while (y > x) {
|
||||
if (d < 0) {
|
||||
d += dE;
|
||||
dE += 2;
|
||||
dSE += 2;
|
||||
x++;
|
||||
} else {
|
||||
d += dSE;
|
||||
dE += 2;
|
||||
dSE += 4;
|
||||
x++;
|
||||
y--;
|
||||
}
|
||||
*(center + x + y * pitch) = color;
|
||||
*(center + y + x * pitch) = color;
|
||||
*(center + y - x * pitch) = color;
|
||||
*(center + x - y * pitch) = color;
|
||||
*(center - x - y * pitch) = color;
|
||||
*(center - y - x * pitch) = color;
|
||||
*(center - y + x * pitch) = color;
|
||||
*(center - x + y * pitch) = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
d += dSE;
|
||||
dE += 2;
|
||||
dSE += 4;
|
||||
x++;
|
||||
y--;
|
||||
}
|
||||
*(center+x+y*pitch) = color;
|
||||
*(center+y+x*pitch) = color;
|
||||
*(center+y-x*pitch) = color;
|
||||
*(center+x-y*pitch) = color;
|
||||
*(center-x-y*pitch) = color;
|
||||
*(center-y-x*pitch) = color;
|
||||
*(center-y+x*pitch) = color;
|
||||
*(center-x+y*pitch) = color;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static void video_test_image(void)
|
||||
static void video_test_image (void)
|
||||
{
|
||||
char *di;
|
||||
int i, n;
|
||||
char *di;
|
||||
int i, n;
|
||||
|
||||
/* draw raster */
|
||||
for (i=0; i<LCD_VIDEO_ROWS; i+=32)
|
||||
{
|
||||
memset((char*)(LCD_VIDEO_ADDR+i*LCD_VIDEO_COLS), LCD_VIDEO_FG, LCD_VIDEO_COLS);
|
||||
for (n=i+1;n<i+32;n++)
|
||||
memset((char*)(LCD_VIDEO_ADDR+n*LCD_VIDEO_COLS), LCD_VIDEO_BG, LCD_VIDEO_COLS);
|
||||
}
|
||||
|
||||
for (i=0; i<LCD_VIDEO_COLS; i+=32)
|
||||
{
|
||||
for (n=0; n<LCD_VIDEO_ROWS; n++)
|
||||
*(char*)(LCD_VIDEO_ADDR+n*LCD_VIDEO_COLS+i) = LCD_VIDEO_FG;
|
||||
}
|
||||
|
||||
/* draw gray bar */
|
||||
di = (char *)(LCD_VIDEO_ADDR + (LCD_VIDEO_COLS-256)/64*32 + 97*LCD_VIDEO_COLS);
|
||||
for (n=0; n<63; n++)
|
||||
{
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
*di++ = (char)i;
|
||||
*(di+LCD_VIDEO_COLS*64) = (i&1)*255;
|
||||
/* draw raster */
|
||||
for (i = 0; i < LCD_VIDEO_ROWS; i += 32) {
|
||||
memset ((char *) (LCD_VIDEO_ADDR + i * LCD_VIDEO_COLS),
|
||||
LCD_VIDEO_FG, LCD_VIDEO_COLS);
|
||||
for (n = i + 1; n < i + 32; n++)
|
||||
memset ((char *) (LCD_VIDEO_ADDR +
|
||||
n * LCD_VIDEO_COLS), LCD_VIDEO_BG,
|
||||
LCD_VIDEO_COLS);
|
||||
}
|
||||
di += LCD_VIDEO_COLS-256;
|
||||
}
|
||||
|
||||
video_circle ((char*)LCD_VIDEO_ADDR+LCD_VIDEO_COLS/2+LCD_VIDEO_ROWS/2*LCD_VIDEO_COLS,
|
||||
LCD_VIDEO_ROWS/2,LCD_VIDEO_FG, LCD_VIDEO_COLS);
|
||||
for (i = 0; i < LCD_VIDEO_COLS; i += 32) {
|
||||
for (n = 0; n < LCD_VIDEO_ROWS; n++)
|
||||
*(char *) (LCD_VIDEO_ADDR + n * LCD_VIDEO_COLS + i) =
|
||||
LCD_VIDEO_FG;
|
||||
}
|
||||
|
||||
/* draw gray bar */
|
||||
di = (char *) (LCD_VIDEO_ADDR + (LCD_VIDEO_COLS - 256) / 64 * 32 +
|
||||
97 * LCD_VIDEO_COLS);
|
||||
for (n = 0; n < 63; n++) {
|
||||
for (i = 0; i < 256; i++) {
|
||||
*di++ = (char) i;
|
||||
*(di + LCD_VIDEO_COLS * 64) = (i & 1) * 255;
|
||||
}
|
||||
di += LCD_VIDEO_COLS - 256;
|
||||
}
|
||||
|
||||
video_circle ((char *) LCD_VIDEO_ADDR + LCD_VIDEO_COLS / 2 +
|
||||
LCD_VIDEO_ROWS / 2 * LCD_VIDEO_COLS, LCD_VIDEO_ROWS / 2,
|
||||
LCD_VIDEO_FG, LCD_VIDEO_COLS);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static void video_default_lut (unsigned int clut_type)
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned char RGB[] =
|
||||
{
|
||||
0x00, 0x00, 0x00, /* black */
|
||||
0x80, 0x80, 0x80, /* gray */
|
||||
0xff, 0x00, 0x00, /* red */
|
||||
0x00, 0xff, 0x00, /* green */
|
||||
0x00, 0x00, 0xff, /* blue */
|
||||
0x00, 0xff, 0xff, /* cyan */
|
||||
0xff, 0x00, 0xff, /* magenta */
|
||||
0xff, 0xff, 0x00, /* yellow */
|
||||
0x80, 0x00, 0x00, /* dark red */
|
||||
0x00, 0x80, 0x00, /* dark green */
|
||||
0x00, 0x00, 0x80, /* dark blue */
|
||||
0x00, 0x80, 0x80, /* dark cyan */
|
||||
0x80, 0x00, 0x80, /* dark magenta */
|
||||
0x80, 0x80, 0x00, /* dark yellow */
|
||||
0xc0, 0xc0, 0xc0, /* light gray */
|
||||
0xff, 0xff, 0xff, /* white */
|
||||
unsigned int i;
|
||||
unsigned char RGB[] = {
|
||||
0x00, 0x00, 0x00, /* black */
|
||||
0x80, 0x80, 0x80, /* gray */
|
||||
0xff, 0x00, 0x00, /* red */
|
||||
0x00, 0xff, 0x00, /* green */
|
||||
0x00, 0x00, 0xff, /* blue */
|
||||
0x00, 0xff, 0xff, /* cyan */
|
||||
0xff, 0x00, 0xff, /* magenta */
|
||||
0xff, 0xff, 0x00, /* yellow */
|
||||
0x80, 0x00, 0x00, /* dark red */
|
||||
0x00, 0x80, 0x00, /* dark green */
|
||||
0x00, 0x00, 0x80, /* dark blue */
|
||||
0x00, 0x80, 0x80, /* dark cyan */
|
||||
0x80, 0x00, 0x80, /* dark magenta */
|
||||
0x80, 0x80, 0x00, /* dark yellow */
|
||||
0xc0, 0xc0, 0xc0, /* light gray */
|
||||
0xff, 0xff, 0xff, /* white */
|
||||
};
|
||||
|
||||
switch (clut_type)
|
||||
{
|
||||
case 1:
|
||||
for (i=0; i<240; i++)
|
||||
video_set_lut (i, i, i, i);
|
||||
for (i=0; i<16; i++)
|
||||
video_set_lut (i+240, RGB[i*3], RGB[i*3+1], RGB[i*3+2]);
|
||||
break;
|
||||
default:
|
||||
for (i=0; i<256; i++)
|
||||
video_set_lut (i, i, i, i);
|
||||
}
|
||||
switch (clut_type) {
|
||||
case 1:
|
||||
for (i = 0; i < 240; i++)
|
||||
video_set_lut (i, i, i, i);
|
||||
for (i = 0; i < 16; i++)
|
||||
video_set_lut (i + 240, RGB[i * 3], RGB[i * 3 + 1],
|
||||
RGB[i * 3 + 2]);
|
||||
break;
|
||||
default:
|
||||
for (i = 0; i < 256; i++)
|
||||
video_set_lut (i, i, i, i);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
void *video_hw_init (void)
|
||||
{
|
||||
unsigned int clut = 0;
|
||||
unsigned char *penv;
|
||||
immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
unsigned int clut = 0;
|
||||
unsigned char *penv;
|
||||
immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
|
||||
/* enable video only on CLUT value */
|
||||
if ((penv = getenv ("clut")) != NULL)
|
||||
clut = (u_int)simple_strtoul (penv, NULL, 10);
|
||||
else
|
||||
return NULL;
|
||||
/* enable video only on CLUT value */
|
||||
if ((penv = getenv ("clut")) != NULL)
|
||||
clut = (u_int) simple_strtoul (penv, NULL, 10);
|
||||
else
|
||||
return NULL;
|
||||
|
||||
/* disable graphic before write LCD regs. */
|
||||
immr->im_lcd.lcd_lccr = 0x96000866;
|
||||
/* disable graphic before write LCD regs. */
|
||||
immr->im_lcd.lcd_lccr = 0x96000866;
|
||||
|
||||
/* config LCD regs. */
|
||||
immr->im_lcd.lcd_lcfaa = LCD_VIDEO_ADDR;
|
||||
immr->im_lcd.lcd_lchcr = 0x010a0093;
|
||||
immr->im_lcd.lcd_lcvcr = 0x900f0024;
|
||||
/* config LCD regs. */
|
||||
immr->im_lcd.lcd_lcfaa = LCD_VIDEO_ADDR;
|
||||
immr->im_lcd.lcd_lchcr = 0x010a0093;
|
||||
immr->im_lcd.lcd_lcvcr = 0x900f0024;
|
||||
|
||||
printf ("Video: 640x480 8Bit Index Lut %s\n",
|
||||
(clut==1?"240/16 (gray/vga)":"256(gray)"));
|
||||
printf ("Video: 640x480 8Bit Index Lut %s\n",
|
||||
(clut == 1 ? "240/16 (gray/vga)" : "256(gray)"));
|
||||
|
||||
video_default_lut (clut);
|
||||
video_default_lut (clut);
|
||||
|
||||
/* clear framebuffer */
|
||||
memset ( (char*)(LCD_VIDEO_ADDR), LCD_VIDEO_BG, LCD_VIDEO_ROWS*LCD_VIDEO_COLS );
|
||||
/* clear framebuffer */
|
||||
memset ((char *) (LCD_VIDEO_ADDR), LCD_VIDEO_BG,
|
||||
LCD_VIDEO_ROWS * LCD_VIDEO_COLS);
|
||||
|
||||
/* enable graphic */
|
||||
immr->im_lcd.lcd_lccr = 0x96000867;
|
||||
/* enable graphic */
|
||||
immr->im_lcd.lcd_lccr = 0x96000867;
|
||||
|
||||
/* fill in Graphic Device */
|
||||
gdev.frameAdrs = LCD_VIDEO_ADDR;
|
||||
gdev.winSizeX = LCD_VIDEO_COLS;
|
||||
gdev.winSizeY = LCD_VIDEO_ROWS;
|
||||
gdev.gdfBytesPP = 1;
|
||||
gdev.gdfIndex = GDF__8BIT_INDEX;
|
||||
/* fill in Graphic Device */
|
||||
gdev.frameAdrs = LCD_VIDEO_ADDR;
|
||||
gdev.winSizeX = LCD_VIDEO_COLS;
|
||||
gdev.winSizeY = LCD_VIDEO_ROWS;
|
||||
gdev.gdfBytesPP = 1;
|
||||
gdev.gdfIndex = GDF__8BIT_INDEX;
|
||||
|
||||
if (clut > 1)
|
||||
/* return Graphic Device for console */
|
||||
return (void *)&gdev;
|
||||
else
|
||||
/* just graphic enabled - draw something beautiful */
|
||||
video_test_image();
|
||||
if (clut > 1)
|
||||
/* return Graphic Device for console */
|
||||
return (void *) &gdev;
|
||||
else
|
||||
/* just graphic enabled - draw something beautiful */
|
||||
video_test_image ();
|
||||
|
||||
return NULL; /* this disabels cfb - console */
|
||||
return NULL; /* this disabels cfb - console */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -465,13 +469,15 @@ void *video_hw_init (void)
|
||||
void video_set_lut (unsigned int index,
|
||||
unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
unsigned int lum;
|
||||
unsigned short *pLut = (unsigned short *)(CFG_IMMR + 0x0e00);
|
||||
unsigned int lum;
|
||||
unsigned short *pLut = (unsigned short *) (CFG_IMMR + 0x0e00);
|
||||
|
||||
/* 16 bit lut values, 12 bit used, xxxx BBGG RRii iiii */
|
||||
/* y = 0.299*R + 0.587*G + 0.114*B */
|
||||
lum = (2990*r + 5870*g + 1140*b)/10000;
|
||||
pLut[index] = ((b & 0xc0)<<4) | ((g & 0xc0)<<2) | (r & 0xc0) | (lum & 0x3f);
|
||||
/* 16 bit lut values, 12 bit used, xxxx BBGG RRii iiii */
|
||||
/* y = 0.299*R + 0.587*G + 0.114*B */
|
||||
lum = (2990 * r + 5870 * g + 1140 * b) / 10000;
|
||||
pLut[index] =
|
||||
((b & 0xc0) << 4) | ((g & 0xc0) << 2) | (r & 0xc0) | (lum &
|
||||
0x3f);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -28,15 +28,53 @@
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
typedef unsigned char FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned char FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFF
|
||||
#if defined (CONFIG_TOP860)
|
||||
typedef unsigned short FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned short FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFF
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define FLASH_CYCLE1 0x0aaa
|
||||
#define FLASH_CYCLE2 0x0555
|
||||
#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
|
||||
|
||||
#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 0x0aaa
|
||||
#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
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
@@ -165,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;
|
||||
@@ -179,12 +226,33 @@ void flash_print_info (flash_info_t *info)
|
||||
printf (" Sector Start Addresses:");
|
||||
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
ulong size;
|
||||
int erased;
|
||||
ulong *flash = (unsigned long *) info->start[i];
|
||||
|
||||
if ((i % 5) == 0) {
|
||||
printf ("\n ");
|
||||
}
|
||||
|
||||
printf (" %08lX%s", info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
/*
|
||||
* Check if whole sector is erased
|
||||
*/
|
||||
size =
|
||||
(i != (info->sector_count - 1)) ?
|
||||
(info->start[i + 1] - info->start[i]) >> 2 :
|
||||
(info->start[0] + info->size - info->start[i]) >> 2;
|
||||
|
||||
for (
|
||||
flash = (unsigned long *) info->start[i], erased = 1;
|
||||
(flash != (unsigned long *) info->start[i] + size) && erased;
|
||||
flash++
|
||||
)
|
||||
erased = *flash == ~0x0UL;
|
||||
|
||||
printf (" %08lX %s %s",
|
||||
info->start[i],
|
||||
erased ? "E": " ",
|
||||
info->protect[i] ? "(RO)" : " ");
|
||||
}
|
||||
|
||||
printf ("\n");
|
||||
@@ -200,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 */
|
||||
@@ -212,7 +279,7 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
* This works for any bus width and any FLASH device width.
|
||||
*/
|
||||
udelay(100);
|
||||
switch (addr[0] & 0xff) {
|
||||
switch (addr[FLASH_ID1] & 0xff) {
|
||||
|
||||
case (uchar)AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
@@ -225,7 +292,7 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
#endif
|
||||
|
||||
default:
|
||||
printf ("unknown vendor=%x ", addr[0] & 0xff);
|
||||
printf ("unknown vendor=%x ", addr[FLASH_ID1] & 0xff);
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
@@ -233,33 +300,70 @@ ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
}
|
||||
|
||||
/* Check 16 bits or 32 bits of ID so work on 32 or 16 bit bus. */
|
||||
if (info->flash_id != FLASH_UNKNOWN) switch ((FPW)addr[2]) {
|
||||
if (info->flash_id != FLASH_UNKNOWN) switch ((FPW)addr[FLASH_ID2]) {
|
||||
|
||||
case (FPW)AMD_ID_LV160B:
|
||||
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[2]);
|
||||
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 */
|
||||
@@ -290,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:
|
||||
|
||||
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := $(BOARD).o flash.o
|
||||
OBJS := $(BOARD).o ../common/flash.o ../common/vpd.o ../common/am79c874.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
@@ -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,54 +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 */
|
||||
uchar buf[81];
|
||||
uchar *p;
|
||||
uint length;
|
||||
uint addr;
|
||||
uint len;
|
||||
|
||||
/* get length first */
|
||||
addr = CFG_FACT_OFFSET;
|
||||
if (eeprom_read (CFG_I2C_FACT_ADDR, addr, buf, 2)) {
|
||||
bailout:
|
||||
printf ("cannot read factory configuration\n");
|
||||
printf ("be sure to set ethaddr yourself!\n");
|
||||
return 0;
|
||||
}
|
||||
length = buf[0] + (buf[1] << 8);
|
||||
addr += 2;
|
||||
|
||||
/* sanity check */
|
||||
if (length < 20 || length > CFG_FACT_SIZE - 2)
|
||||
goto bailout;
|
||||
|
||||
/* read lines */
|
||||
while (length > 0) {
|
||||
/* read one line */
|
||||
len = length > 80 ? 80 : length;
|
||||
if (eeprom_read (CFG_I2C_FACT_ADDR, addr, buf, len))
|
||||
goto bailout;
|
||||
/* mark end of buffer */
|
||||
buf[len] = 0;
|
||||
/* search end of line */
|
||||
for (p = buf; *p && *p != 0x0a; p++);
|
||||
if (!*p)
|
||||
goto bailout;
|
||||
*p++ = 0;
|
||||
/* advance to next line start */
|
||||
length -= p - buf;
|
||||
addr += p - buf;
|
||||
/*printf ("%s\n", buf); */
|
||||
/* search for our specific entry */
|
||||
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
|
||||
setenv ("ethaddr", buf + 19);
|
||||
} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
|
||||
setenv ("serial#", buf + 15);
|
||||
} else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
|
||||
setenv ("board_id", buf + 13);
|
||||
}
|
||||
}
|
||||
extern void read_factory_r (void);
|
||||
read_factory_r ();
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -219,3 +180,31 @@ void pci_init_board(void)
|
||||
pci_mpc5xxx_init(&hose);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* provide the IDE Reset Function
|
||||
*****************************************************************************/
|
||||
#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) */
|
||||
|
||||
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
OBJS = $(BOARD).o ../common/flash.o ../common/vpd.o ../common/am79c874.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
@@ -1,489 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* EMK Elektronik GmbH <www.emk-elektronik.de>
|
||||
* Reinhard Meyer <r.meyer@emk-elektronik.de>
|
||||
*
|
||||
* copied from the BMW Port - seems that its similiar enough
|
||||
* to be easily adaped ;) --- Well, it turned out to become a
|
||||
* merger between parts of the EMKstax Flash routines and the
|
||||
* BMW funtion frames...
|
||||
*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
#define FLASH_WORD_SIZE unsigned short
|
||||
#define FLASH_WORD_WIDTH (sizeof (FLASH_WORD_SIZE))
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* software product ID entry/exit
|
||||
*****************************************************************************/
|
||||
static void FlashProductIdMode (
|
||||
volatile FLASH_WORD_SIZE *b,
|
||||
int on_off)
|
||||
{
|
||||
b[0x5555] = 0xaa;
|
||||
b[0x2aaa] = 0x55;
|
||||
b[0x5555] = on_off ? 0x90 : 0xf0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* sector erase start
|
||||
*****************************************************************************/
|
||||
static void FlashSectorErase (
|
||||
volatile FLASH_WORD_SIZE *b,
|
||||
volatile FLASH_WORD_SIZE *a)
|
||||
{
|
||||
b[0x5555] = 0xaa;
|
||||
b[0x2aaa] = 0x55;
|
||||
b[0x5555] = 0x80;
|
||||
b[0x5555] = 0xaa;
|
||||
b[0x2aaa] = 0x55;
|
||||
a[0] = 0x30;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* program a word
|
||||
*****************************************************************************/
|
||||
static void FlashProgWord (
|
||||
volatile FLASH_WORD_SIZE *b,
|
||||
volatile FLASH_WORD_SIZE *a,
|
||||
FLASH_WORD_SIZE v)
|
||||
{
|
||||
b[0x5555] = 0xaa;
|
||||
b[0x2aaa] = 0x55;
|
||||
b[0x5555] = 0xa0;
|
||||
a[0] = v;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* reset bank, back to read mode
|
||||
*****************************************************************************/
|
||||
static void FlashReset (volatile FLASH_WORD_SIZE *b)
|
||||
{
|
||||
b[0] = 0xf0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* identify FLASH chip
|
||||
* this code is a stripped version of the FlashGetType() function in EMKstax
|
||||
*****************************************************************************/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE * const flash = (volatile FLASH_WORD_SIZE *) CFG_FLASH_BASE;
|
||||
FLASH_WORD_SIZE manu, dev;
|
||||
flash_info_t * const pflinfo = &flash_info[0];
|
||||
int j;
|
||||
|
||||
/* get Id Bytes */
|
||||
FlashProductIdMode (flash, 1);
|
||||
manu = flash[0];
|
||||
dev = flash[1];
|
||||
FlashProductIdMode (flash, 0);
|
||||
|
||||
pflinfo->size = 0;
|
||||
pflinfo->sector_count = 0;
|
||||
pflinfo->flash_id = 0xffffffff;
|
||||
pflinfo->portwidth = FLASH_CFI_16BIT;
|
||||
pflinfo->chipwidth = FLASH_CFI_BY16;
|
||||
|
||||
switch (manu&0xff)
|
||||
{
|
||||
case 0x01: /* AMD */
|
||||
pflinfo->flash_id = FLASH_MAN_AMD;
|
||||
switch (dev&0xff)
|
||||
{
|
||||
case 0x49:
|
||||
pflinfo->size = 0x00200000;
|
||||
pflinfo->sector_count = 35;
|
||||
pflinfo->flash_id |= FLASH_AM160B;
|
||||
pflinfo->start[0] = CFG_FLASH_BASE;
|
||||
pflinfo->start[1] = CFG_FLASH_BASE + 0x4000;
|
||||
pflinfo->start[2] = CFG_FLASH_BASE + 0x6000;
|
||||
pflinfo->start[3] = CFG_FLASH_BASE + 0x8000;
|
||||
for (j = 4; j < 35; j++)
|
||||
{
|
||||
pflinfo->start[j] = CFG_FLASH_BASE + 0x00010000 * (j-3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xf9:
|
||||
pflinfo->size = 0x00400000;
|
||||
pflinfo->sector_count = 71;
|
||||
pflinfo->flash_id |= FLASH_AM320B;
|
||||
pflinfo->start[0] = CFG_FLASH_BASE;
|
||||
pflinfo->start[1] = CFG_FLASH_BASE + 0x4000;
|
||||
pflinfo->start[2] = CFG_FLASH_BASE + 0x6000;
|
||||
pflinfo->start[3] = CFG_FLASH_BASE + 0x8000;
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
pflinfo->start[j] = CFG_FLASH_BASE + 0x00002000 * (j);
|
||||
}
|
||||
for (j = 8; j < 71; j++)
|
||||
{
|
||||
pflinfo->start[j] = CFG_FLASH_BASE + 0x00010000 * (j-7);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("unknown AMD dev=%x ", dev);
|
||||
pflinfo->flash_id |= FLASH_UNKNOWN;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("unknown manu=%x ", manu);
|
||||
}
|
||||
return pflinfo->size;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* print info about a FLASH
|
||||
*****************************************************************************/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
static const char unk[] = "Unknown";
|
||||
unsigned int i;
|
||||
const char *mfct=unk,
|
||||
*type=unk;
|
||||
|
||||
if(info->flash_id != FLASH_UNKNOWN)
|
||||
{
|
||||
switch (info->flash_id & FLASH_VENDMASK)
|
||||
{
|
||||
case FLASH_MAN_AMD:
|
||||
mfct = "AMD";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK)
|
||||
{
|
||||
case FLASH_AM160B:
|
||||
type = "AM29LV160B (16 Mbit, bottom boot sect)";
|
||||
break;
|
||||
case FLASH_AM320B:
|
||||
type = "AM29LV320B (32 Mbit, bottom boot sect)";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
printf (
|
||||
"\n Brand: %s Type: %s\n"
|
||||
" Size: %lu KB in %d Sectors\n",
|
||||
mfct,
|
||||
type,
|
||||
info->size >> 10,
|
||||
info->sector_count
|
||||
);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
{
|
||||
unsigned long size;
|
||||
unsigned int erased;
|
||||
unsigned long *flash = (unsigned long *) info->start[i];
|
||||
|
||||
/*
|
||||
* Check if whole sector is erased
|
||||
*/
|
||||
size =
|
||||
(i != (info->sector_count - 1)) ?
|
||||
(info->start[i + 1] - info->start[i]) >> 2 :
|
||||
(info->start[0] + info->size - info->start[i]) >> 2;
|
||||
|
||||
for (
|
||||
flash = (unsigned long *) info->start[i], erased = 1;
|
||||
(flash != (unsigned long *) info->start[i] + size) && erased;
|
||||
flash++
|
||||
)
|
||||
erased = *flash == ~0x0UL;
|
||||
|
||||
printf (
|
||||
"%s %08lX %s %s",
|
||||
(i % 5) ? "" : "\n ",
|
||||
info->start[i],
|
||||
erased ? "E" : " ",
|
||||
info->protect[i] ? "RO" : " "
|
||||
);
|
||||
}
|
||||
|
||||
puts ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* erase one or more sectors
|
||||
*****************************************************************************/
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[0]);
|
||||
int flag,
|
||||
prot,
|
||||
sect,
|
||||
l_sect;
|
||||
ulong start,
|
||||
now,
|
||||
last;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last))
|
||||
{
|
||||
if (info->flash_id == FLASH_UNKNOWN)
|
||||
{
|
||||
printf ("- missing\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((info->flash_id == FLASH_UNKNOWN) ||
|
||||
(info->flash_id > (FLASH_MAN_STM | FLASH_AMD_COMP)))
|
||||
{
|
||||
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 */
|
||||
FlashSectorErase ((FLASH_WORD_SIZE *)info->start[0], (FLASH_WORD_SIZE *)info->start[sect]);
|
||||
l_sect = sect;
|
||||
}
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/*
|
||||
* We wait for the last triggered sector
|
||||
*/
|
||||
if (l_sect < 0)
|
||||
goto DONE;
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
addr = (FLASH_WORD_SIZE *)info->start[l_sect];
|
||||
while ((addr[0] & 0x0080) != 0x0080)
|
||||
{
|
||||
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 */
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
FlashReset ((FLASH_WORD_SIZE *)info->start[0]);
|
||||
|
||||
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 & ~(FLASH_WORD_WIDTH-1)); /* get lower word aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes, if there are...
|
||||
*/
|
||||
if ((l = addr - wp) != 0)
|
||||
{
|
||||
data = 0;
|
||||
|
||||
/* get the current before the new data into our data word */
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
/* now merge the to be programmed values */
|
||||
for (; i<4 && cnt>0; ++i, ++cp, --cnt)
|
||||
{
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
|
||||
/* get the current after the new data into our data word */
|
||||
for (; cnt==0 && i<FLASH_WORD_WIDTH; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
/* now write the combined word */
|
||||
if ((rc = write_word (info, wp, data)) != 0)
|
||||
{
|
||||
return (rc);
|
||||
}
|
||||
wp += FLASH_WORD_WIDTH;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= FLASH_WORD_WIDTH)
|
||||
{
|
||||
data = 0;
|
||||
for (i=0; i<FLASH_WORD_WIDTH; ++i)
|
||||
{
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_word (info, wp, data)) != 0)
|
||||
{
|
||||
return (rc);
|
||||
}
|
||||
wp += FLASH_WORD_WIDTH;
|
||||
cnt -= FLASH_WORD_WIDTH;
|
||||
}
|
||||
|
||||
if (cnt == 0)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes, if there are...
|
||||
*/
|
||||
data = 0;
|
||||
|
||||
/* now merge the to be programmed values */
|
||||
for (i=0, cp=wp; i<FLASH_WORD_WIDTH && cnt>0; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
|
||||
/* get the current after the new data into our data word */
|
||||
for (; i<FLASH_WORD_WIDTH; ++i, ++cp)
|
||||
{
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
/* now write the combined word */
|
||||
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;
|
||||
FLASH_WORD_SIZE data2 = data;
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*dest2 & data2) != data2)
|
||||
{
|
||||
return (2);
|
||||
}
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
FlashProgWord (addr2, dest2, data2);
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((*dest2 & 0x0080) != (data2 & 0x0080))
|
||||
{
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -119,6 +119,20 @@ long int initdram (int board_type)
|
||||
return -(memctl->memc_or2 & 0xffff0000);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* prepare for FLASH detection
|
||||
*****************************************************************************/
|
||||
void flash_preinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* finalize FLASH setup
|
||||
*****************************************************************************/
|
||||
void flash_afterinit(uint bank, ulong start, ulong size)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* otherinits after RAM is there and we are relocated to RAM
|
||||
* note: though this is an int function, nobody cares for the result!
|
||||
@@ -126,52 +140,8 @@ long int initdram (int board_type)
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/* read 'factory' part of EEPROM */
|
||||
uchar buf[81];
|
||||
uchar *p;
|
||||
uint length;
|
||||
uint addr;
|
||||
uint len;
|
||||
extern void read_factory_r (void);
|
||||
read_factory_r ();
|
||||
|
||||
/* get length first */
|
||||
addr = CFG_FACT_OFFSET;
|
||||
if (eeprom_read (CFG_I2C_FACT_ADDR, addr, buf, 2)) {
|
||||
bailout:
|
||||
printf ("cannot read factory configuration\n");
|
||||
printf ("be sure to set ethaddr yourself!\n");
|
||||
return 0;
|
||||
}
|
||||
length = buf[0] + (buf[1] << 8);
|
||||
addr += 2;
|
||||
|
||||
/* sanity check */
|
||||
if (length < 20 || length > CFG_FACT_SIZE - 2)
|
||||
goto bailout;
|
||||
|
||||
/* read lines */
|
||||
while (length > 0) {
|
||||
/* read one line */
|
||||
len = length > 80 ? 80 : length;
|
||||
if (eeprom_read (CFG_I2C_FACT_ADDR, addr, buf, len))
|
||||
goto bailout;
|
||||
/* mark end of buffer */
|
||||
buf[len] = 0;
|
||||
/* search end of line */
|
||||
for (p = buf; *p && *p != 0x0a; p++);
|
||||
if (!*p)
|
||||
goto bailout;
|
||||
*p++ = 0;
|
||||
/* advance to next line start */
|
||||
length -= p - buf;
|
||||
addr += p - buf;
|
||||
/*printf ("%s\n", buf); */
|
||||
/* search for our specific entry */
|
||||
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
|
||||
setenv ("ethaddr", buf + 19);
|
||||
} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
|
||||
setenv ("serial#", buf + 15);
|
||||
} else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
|
||||
setenv ("board_id", buf + 13);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -44,14 +44,12 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
|
||||
armboot_end = .;
|
||||
_end = .;
|
||||
}
|
||||
|
||||
@@ -190,21 +190,22 @@ const iop_conf_t iop_conf_tab[4][32] = {
|
||||
*/
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
volatile t_ep_regs *regs = (t_ep_regs*)CFG_REGS_BASE;
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
memctl->memc_br4 = CFG_BR4_PRELIM;
|
||||
memctl->memc_or4 = CFG_OR4_PRELIM;
|
||||
regs->bcsr1 = 0x62; /* to enable terminal on SMC1 */
|
||||
regs->bcsr2 = 0x30; /* enable NVRAM and writing FLASH */
|
||||
return 0;
|
||||
volatile t_ep_regs *regs = (t_ep_regs *) CFG_REGS_BASE;
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
|
||||
memctl->memc_br4 = CFG_BR4_PRELIM;
|
||||
memctl->memc_or4 = CFG_OR4_PRELIM;
|
||||
regs->bcsr1 = 0x62; /* to enable terminal on SMC1 */
|
||||
regs->bcsr2 = 0x30; /* enable NVRAM and writing FLASH */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
reset_phy(void)
|
||||
void reset_phy (void)
|
||||
{
|
||||
volatile t_ep_regs *regs = (t_ep_regs*)CFG_REGS_BASE;
|
||||
regs->bcsr4 = 0xC0;
|
||||
volatile t_ep_regs *regs = (t_ep_regs *) CFG_REGS_BASE;
|
||||
|
||||
regs->bcsr4 = 0xC0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -213,15 +214,21 @@ reset_phy(void)
|
||||
* Thats why its a static interpretation ...
|
||||
*/
|
||||
|
||||
int
|
||||
checkboard(void)
|
||||
int checkboard (void)
|
||||
{
|
||||
volatile t_ep_regs *regs = (t_ep_regs*)CFG_REGS_BASE;
|
||||
uint major=0, minor=0;
|
||||
volatile t_ep_regs *regs = (t_ep_regs *) CFG_REGS_BASE;
|
||||
uint major = 0, minor = 0;
|
||||
|
||||
switch (regs->bcsr0) {
|
||||
case 0x02: major = 1; break;
|
||||
case 0x03: major = 1; minor = 1; break;
|
||||
default: break;
|
||||
case 0x02:
|
||||
major = 1;
|
||||
break;
|
||||
case 0x03:
|
||||
major = 1;
|
||||
minor = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
printf ("Board: Embedded Planet EP8260, Revision %d.%d\n",
|
||||
major, minor);
|
||||
@@ -232,13 +239,13 @@ checkboard(void)
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
long int
|
||||
initdram(int board_type)
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
volatile uchar c = 0;
|
||||
volatile uchar *ramaddr = (uchar *)(CFG_SDRAM_BASE) + 0x110;
|
||||
volatile uchar *ramaddr = (uchar *) (CFG_SDRAM_BASE) + 0x110;
|
||||
|
||||
/*
|
||||
ulong psdmr = CFG_PSDMR;
|
||||
#ifdef CFG_LSDRAM
|
||||
@@ -288,7 +295,7 @@ initdram(int board_type)
|
||||
#ifndef CFG_RAMBOOT
|
||||
#ifdef CFG_LSDRAM
|
||||
size += CFG_SDRAM1_SIZE;
|
||||
ramaddr = (uchar *)(CFG_SDRAM1_BASE) + 0x8c;
|
||||
ramaddr = (uchar *) (CFG_SDRAM1_BASE) + 0x8c;
|
||||
memctl->memc_lsrt = CFG_LSRT;
|
||||
|
||||
memctl->memc_lsdmr = (ulong) CFG_LSDMR | PSDMR_OP_PREA;
|
||||
|
||||
@@ -2747,4 +2747,4 @@
|
||||
0x05,0x02,0x02,0x03,0x02,0x02,0x03,0x02,0x02,0x01,0x07,0x03,0x02,0x02,0x02,0x04,
|
||||
0x02,0x01,0x04,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0xe5,0x05,0x04,0x03,0x07,0xe5,
|
||||
0xe5,0x03,0x04,0x04,0x0b,0x02,0xe5,0x01,0xe5,0x01,0xe5,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
|
||||
@@ -47,7 +47,7 @@ const unsigned char fpgadata[] =
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
int gunzip(void *, int, unsigned char *, unsigned long *);
|
||||
|
||||
|
||||
int board_early_init_f (void)
|
||||
@@ -102,7 +102,7 @@ int misc_init_r (void)
|
||||
int i;
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ const unsigned char fpgadata[] =
|
||||
|
||||
/* Prototypes */
|
||||
int cpci405_version(void);
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
int gunzip(void *, int, unsigned char *, unsigned long *);
|
||||
|
||||
|
||||
int board_early_init_f (void)
|
||||
@@ -259,7 +259,7 @@ int misc_init_r (void)
|
||||
mtdcr(cntrl0, cntrl0Reg | 0x00300000);
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user