mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
49 Commits
LABEL_2003
...
U-Boot-0_4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7205e4075d | ||
|
|
149dded2b1 | ||
|
|
7152b1d0b3 | ||
|
|
4d816774f1 | ||
|
|
093ae273da | ||
|
|
12f34241cb | ||
|
|
326428cc8b | ||
|
|
0cb61d7ddd | ||
|
|
6f21347d49 | ||
|
|
c29fdfc1d8 | ||
|
|
ca75added1 | ||
|
|
437ce07b8a | ||
|
|
fe389a82c9 | ||
|
|
d94f92cbd7 | ||
|
|
e0ac62d798 | ||
|
|
ae3af05ec9 | ||
|
|
9374fa287b | ||
|
|
013dc8d9b9 | ||
|
|
d41e5e6994 | ||
|
|
8f713fdfeb | ||
|
|
96e48cf6c1 | ||
|
|
bdccc4fedc | ||
|
|
96dd9af4c7 | ||
|
|
1f4bb37d6b | ||
|
|
7784674852 | ||
|
|
27b207fd0a | ||
|
|
2535d60277 | ||
|
|
945af8d723 | ||
|
|
cb4dbb7bbc | ||
|
|
ad12965db5 | ||
|
|
667122af2d | ||
|
|
2960b65add | ||
|
|
2e5983d2ea | ||
|
|
6dff552972 | ||
|
|
8564acf936 | ||
|
|
5702923e23 | ||
|
|
5b8b652519 | ||
|
|
2e533c373d | ||
|
|
b762b9f4fc | ||
|
|
c5d2290642 | ||
|
|
155cb0104a | ||
|
|
f12e568ca4 | ||
|
|
0d4983930a | ||
|
|
b37c7e5e5c | ||
|
|
b0fce99bfc | ||
|
|
eeacb89cb3 | ||
|
|
3d96ede975 | ||
|
|
9d2b18a0f9 | ||
|
|
d1cbe85b08 |
302
CHANGELOG
302
CHANGELOG
@@ -1,7 +1,307 @@
|
||||
======================================================================
|
||||
Changes since U-Boot 0.4.0:
|
||||
Changes for U-Boot 0.4.8:
|
||||
======================================================================
|
||||
|
||||
* Patches by Denis Peter, 9 Sep 2003:
|
||||
add FAT support for IDE, SCSI and USB
|
||||
|
||||
* Patches by Gleb Natapov, 2 Sep 2003:
|
||||
- cleanup of POST code for unsupported architectures
|
||||
- MPC824x locks way0 of data cache for use as initial RAM;
|
||||
this patch unlocks it after relocation to RAM and invalidates
|
||||
the locked entries.
|
||||
|
||||
* Patch by Gleb Natapov, 30 Aug 2003:
|
||||
new I2C driver for mpc107 bridge. Now works from flash.
|
||||
|
||||
* Patch by Dave Ellis, 11 Aug 2003:
|
||||
- JFFS2: fix typo in common/cmd_jffs2.c
|
||||
- JFFS2: fix CFG_JFFS2_SORT_FRAGMENTS option
|
||||
- JFFS2: remove node version 0 warning
|
||||
- JFFS2: accept JFFS2 PADDING nodes
|
||||
- SXNI855T: add AM29LV800 support
|
||||
- SXNI855T: move environment from EEPROM to flash
|
||||
- SXNI855T: boot from JFFS2 in NOR or NAND flash
|
||||
|
||||
* Patch by Bill Hargen, 11 Aug 2003:
|
||||
fixes for I2C on MPC8240
|
||||
- fix i2c_write routine
|
||||
- fix iprobe command
|
||||
- eliminates use of global variables, plus dead code, cleanup.
|
||||
|
||||
* Add support for USB Mass Storage Devices (BBB)
|
||||
(tested with USB memory sticks only)
|
||||
|
||||
* Avoid flicker on TRAB's VFD
|
||||
|
||||
* Add support for SK98xx driver
|
||||
|
||||
* Add PCI support for SL8245 board
|
||||
|
||||
* Support IceCube board configurations with 1 x AMD AM29LV065 (8 MB)
|
||||
or 1 x AM29LV652 (two LV065 in one chip = 16 MB);
|
||||
Run IPB at 133 Mhz; adjust the MII clock frequency accordingly
|
||||
|
||||
* Set BRG_CLK on PM825/826 to 64MHz (VCO_OUT / 4, instead of 16 MHz)
|
||||
to allow for more accurate baudrate settings
|
||||
(error now 0.7% at 115 kbps, instead of 3.5% before)
|
||||
|
||||
* Patch by Andreas Mohr, 4 Sep 2003:
|
||||
Fix a lot of spelling errors
|
||||
|
||||
* Add support for PPChameleon Eval Board
|
||||
|
||||
* Add support for P3G4 board
|
||||
|
||||
* Fix problem with MGT5100 FEC driver: add "early" MAC address
|
||||
initialization
|
||||
|
||||
* Patch by Yuli Barcohen, 7 Aug 2003:
|
||||
check BCSR to detect if the board is configured in PCI mode
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.7:
|
||||
======================================================================
|
||||
|
||||
* Patch by Raghu Krishnaprasad, 7 Aug 2003:
|
||||
add support for Adder II MPC852T module
|
||||
|
||||
* Patch by George G. Davis, 19 Aug 2003:
|
||||
fix TI Innovator/OMAP1510 pin configs
|
||||
|
||||
* Patches by Kshitij, 18 Aug 2003
|
||||
- add support for arm926ejs cpu core
|
||||
- add support for TI OMAP 1610 Innovator Board
|
||||
|
||||
* Patch by Yuli Barcohen, 14 Aug 2003:
|
||||
add support for bzip2 uncompression
|
||||
|
||||
* Add GCC library to examples/Makefile so GCC utility functions will
|
||||
be resolved, too
|
||||
|
||||
* Add I2C and RTC support for RMU board using software I2C driver
|
||||
(because of better response to iprobe command); fix problem with
|
||||
"reset" command
|
||||
|
||||
* Patch by Matthias Fuchs, 28 Aug 2003:
|
||||
Added CONFIG_BOOTP_DNS2 and CONFIG_BOOTP_SEND_HOSTNAME to
|
||||
CONFIG_BOOTP_MAKS (see README).
|
||||
|
||||
* Fix ICU862 environment problem
|
||||
|
||||
* Fix RAM size detection for RMU board
|
||||
|
||||
* Implement "reset" for MGT5100/MPC5200 systems
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.6:
|
||||
======================================================================
|
||||
|
||||
* Make Ethernet autonegotiation on INCA-IP work for all clock rates;
|
||||
allow selection of clock frequency as "make" target
|
||||
|
||||
* Implement memory autosizing code for IceCube boards
|
||||
|
||||
* Configure network port on INCA-IP for autonegotiation
|
||||
|
||||
* Fix overflow problem in network timeout code
|
||||
|
||||
* Patch by Richard Woodruff, 8 Aug 2003:
|
||||
Allow crc32 to be used at address 0x000 (crc32_no_comp, too).
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.5:
|
||||
======================================================================
|
||||
|
||||
* Update for TQM board defaults:
|
||||
disable clocks_in_mhz, enable boot count limit
|
||||
|
||||
* Removed tools/gdb from "make all" target. Added make target "gdbtools"
|
||||
in toplevel directory instead. Removed astest.c from tools/gdb because
|
||||
it is no longer relevant.
|
||||
|
||||
* Fix PCI support for MPC5200 / IceCube Board
|
||||
|
||||
* Map ISP1362 USB OTG controller for NSCU board
|
||||
|
||||
* Patch by Brad Parker, 02 Aug 2003:
|
||||
fix sc520_cdp problems
|
||||
|
||||
* Implement Boot Cycle Detection (Req. 2.3 of OSDL CGL Reqirements)
|
||||
|
||||
* Allow erase command to cross flash bank boundaries
|
||||
|
||||
* Patch by Scott McNutt, 21 Jul 2003:
|
||||
Add support for LynuxWorks Kernel Downloadable Images (KDIs).
|
||||
Both LynxOS and BlueCat linux KDIs are supported.
|
||||
|
||||
* Patch by Richard Woodruff, 25 Jul 2003:
|
||||
use more reliable reset for OMAP/925T
|
||||
|
||||
* Patch by Nye Liu, 25 Jul 2003:
|
||||
fix typo in mpc8xx.h
|
||||
|
||||
* Patch by Richard Woodruff, 24 Jul 2003:
|
||||
Fixes for cmd_nand.c:
|
||||
- Fixed null dereferece which could result in incorrect ECC values.
|
||||
- Added support for devices with no Ready/Busy signal hooked up.
|
||||
- Added OMAP1510 read/write protect handling.
|
||||
- Fixed nand.h's ECCPOS. A conflict existed with POS5 and badblock
|
||||
for non-JFFS2.
|
||||
- Switched default ECC to be JFFS2.
|
||||
|
||||
* Allow crc32 to be used at address 0x000
|
||||
|
||||
* Provide consistent interface to standalone applications to access
|
||||
the 'global_data' structure
|
||||
Provide a doc/README.standalone more useful to users/developers.
|
||||
|
||||
* Make IceCube MGT5100 FEC driver work
|
||||
|
||||
* Implement new mechanism to export U-Boot's functions to standalone
|
||||
applications: instead of using (PPC-specific) system calls we now
|
||||
use a jump table; please see doc/README.standalone for details
|
||||
|
||||
* Patch by Dave Westwood, 24 Jul 2003:
|
||||
added support for Unity OS (a proprietary OS)
|
||||
|
||||
* Patch by Detlev Zundel, 23 Jul 2003:
|
||||
add "imls" command to print flash table of contents
|
||||
|
||||
* Fix cold boot detection for log buffer reset
|
||||
|
||||
* Return error for invalid length specifiers with "cp.X" etc.
|
||||
|
||||
* Fix startup problem on MIPS
|
||||
|
||||
* Allow for CONFIG_SPLASH_SCREEN even when no explicit
|
||||
bitmap support is configured
|
||||
|
||||
* Patch by Bill Hargen, 18 Jul 2003:
|
||||
- fix endinaness problem in cpu/mpc824x/drivers/i2c/i2c1.c
|
||||
|
||||
* Patch by Denis Peter, 18 Jul 2003:
|
||||
- fix memory configuration for MIP405T
|
||||
- fix printout of baudrate for "loadb <loadaddr> <baudrate>"
|
||||
|
||||
* Cleanup of TQM82xx configurations; use "official" board types
|
||||
to make selection easier.
|
||||
|
||||
* Patch by Martin Krause, 17 Jul 2003:
|
||||
add delay to get I2C working with "imm" command and s3c24x0_i2c.c
|
||||
|
||||
* Patch by Richard Woodruff, 17 July 03:
|
||||
- Fixed bug in OMAP1510 baud rate divisor settings.
|
||||
|
||||
* Patch by Nye Liu, 16 July 2003:
|
||||
MPC860FADS fixes:
|
||||
- add MPC86xADS support (uses MPC86xADS.h)
|
||||
- add 866P/T core support (also MPC859T/MPC859DSL/MPC852T)
|
||||
o PLPRCR changes
|
||||
o BRG changes (EXTAL/XTAL restricted to 10MHz)
|
||||
o don't trust gclk() software measurement by default, depend on
|
||||
CONFIG_8xx_GCLK_FREQ
|
||||
- add DRAM SIMM not installed detection
|
||||
- use more "correct" SDRAM initialization sequence
|
||||
- allow different SDRAM sizes (8xxADS has 8M)
|
||||
- default DER is 0
|
||||
- remove unused MAMR defines from FADS860T.h (all done in fads.c)
|
||||
- rename MAMR/MBMR defines to be more consistent. Should eventually
|
||||
be merged into MxMR to better reflect the PowerQUICC datasheet.
|
||||
|
||||
* Patch by Yuli Barcohen, 16 Jul 2003:
|
||||
support new Motorola PQ2FADS-ZU evaluation board which replaced
|
||||
MPC8260ADS and MPC8266ADS
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.4:
|
||||
======================================================================
|
||||
|
||||
* Add support for IceCube board (with MGT5100 and MPC5200 CPUs)
|
||||
|
||||
* Add support for MGT5100 and MPC5200 processors
|
||||
|
||||
* Patch by Lutz Dennig, 15 Jul 2003:
|
||||
update for R360MPI board
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.3:
|
||||
======================================================================
|
||||
|
||||
* Patches by Kshitij, 04 Jul 2003
|
||||
- added support for arm925t cpu core
|
||||
- added support for TI OMAP 1510 Innovator Board
|
||||
|
||||
* Patches by Martin Krause, 14 Jul 2003:
|
||||
- add I2C support for s3c2400 systems (trab board)
|
||||
- (re-) add "ping" to command table
|
||||
|
||||
* Fix handling of "slow" POST routines
|
||||
|
||||
* Patches by Yuli Barcohen, 13 Jul 2003:
|
||||
- Correct flash and JFFS2 support for MPC8260ADS
|
||||
- fix PVR values and clock generation for PowerQUICC II family
|
||||
(8270/8275/8280)
|
||||
|
||||
* Patch by Bernhard Kuhn, 08 Jul 2003:
|
||||
- add support for M68K targets
|
||||
|
||||
* Patch by Ken Chou, 3 Jul:
|
||||
- Fix PCI config table for A3000
|
||||
- Fix iobase for natsemi.c
|
||||
(PCI_BASE_ADDRESS_0 is the IO base register for DP83815)
|
||||
|
||||
* Allow to enable "slow" POST routines by key press on power-on
|
||||
* Fix temperature dependend switching of LCD backlight on LWMON
|
||||
* Tweak output format for LWMON
|
||||
|
||||
* Patch by Stefan Roese, 11 Jul 2003:
|
||||
- Fix bug in CONFIG_VERSION_VARIABLE.
|
||||
- AR405 config updated.
|
||||
- OCRTC/ORSG: bsp command added.
|
||||
- ASH405 bsp update.
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.2:
|
||||
======================================================================
|
||||
|
||||
* Add support for NSCU board
|
||||
|
||||
* Add support for TQM823M, TQM850M, TQM855M and TQM860M modules
|
||||
|
||||
* Add support for Am29LV160ML, Am29LV320ML, and Am29LV640ML
|
||||
mirror bit flash on TQM8xxM modules
|
||||
|
||||
* Patch by Kenneth Johansson, 30 Jun 2003:
|
||||
get rid of MK_CMD_ENTRY macro; update doc/README.command
|
||||
|
||||
* Patch by Seb James, 30 Jun 2003:
|
||||
Improve documentation of I2C configuration in README
|
||||
|
||||
* Fix problems with previous log buffer "fixes"
|
||||
|
||||
* Fix minor help text issues
|
||||
|
||||
* "log append" did not append a newline
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.1:
|
||||
======================================================================
|
||||
|
||||
* Fix some missing commands, cleanup header files
|
||||
(autoscript, bmp, bsp, fat, mmc, nand, portio, ...)
|
||||
|
||||
* Rewrite command lookup and help command (fix problems with bubble
|
||||
sort when sorting command name list). Minor cleanup here and there.
|
||||
|
||||
* Merge from "stable branch", tag LABEL_2003_06_28_1800-stable:
|
||||
- Allow to call sysmon function interactively
|
||||
- PIC on LWMON board needs delay after power-on
|
||||
- Add missing RSR definitions for MPC8xx
|
||||
- Improve log buffer handling: guarantee clean reset after power-on
|
||||
- Add support for EXBITGEN board (aka "genie")
|
||||
- Add support for SL8245 board
|
||||
|
||||
* Code cleanup:
|
||||
- remove trailing white space, trailing empty lines, C++ comments, etc.
|
||||
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
|
||||
|
||||
6
CREDITS
6
CREDITS
@@ -302,3 +302,9 @@ W: www.elinos.com
|
||||
N: Pantelis Antoniou
|
||||
E: panto@intracom.gr
|
||||
D: NETVIA board support, ARTOS support.
|
||||
|
||||
N: Raghu Krishnaprasad
|
||||
E: Raghu.Krishnaprasad@fci.com
|
||||
D: Support for Adder-II MPC852T evaluation board
|
||||
W: http://www.forcecomputers.com
|
||||
|
||||
|
||||
20
MAINTAINERS
20
MAINTAINERS
@@ -3,10 +3,7 @@
|
||||
# Regular Maintainers for U-Boot board support: #
|
||||
# #
|
||||
# For any board without permanent maintainer, please contact #
|
||||
# for PowerPC systems: #
|
||||
# Wolfgang Denk <wd@denx.de> #
|
||||
# for ARM systems: #
|
||||
# Marius Gröger <mag@sysgo.de> #
|
||||
# and Cc: the <U-Boot-Users@lists.sourceforge.net> mailing lists. #
|
||||
# #
|
||||
# Note: lists sorted by Maintainer Name #
|
||||
@@ -55,6 +52,8 @@ Wolfgang Denk <wd@denx.de>
|
||||
FPS850L MPC850
|
||||
FPS860L MPC860
|
||||
ICU862 MPC862
|
||||
IceCube_5100 MGT5100
|
||||
IceCube_5200 MPC5200
|
||||
IP860 MPC860
|
||||
IVML24 MPC860
|
||||
IVML24_128 MPC860
|
||||
@@ -75,7 +74,6 @@ Wolfgang Denk <wd@denx.de>
|
||||
TQM855L MPC855
|
||||
TQM860L MPC860
|
||||
TQM860L_FEC MPC860
|
||||
TTTech MPC823
|
||||
c2mon MPC855
|
||||
hermes MPC860
|
||||
lwmon MPC823
|
||||
@@ -83,6 +81,7 @@ Wolfgang Denk <wd@denx.de>
|
||||
|
||||
CU824 MPC8240
|
||||
Sandpoint8240 MPC8240
|
||||
SL8245 MPC8245
|
||||
|
||||
ATC MPC8250
|
||||
PM825 MPC8250
|
||||
@@ -90,12 +89,17 @@ Wolfgang Denk <wd@denx.de>
|
||||
TQM8255 MPC8255
|
||||
|
||||
CPU86 MPC8260
|
||||
PM825 MPC8250
|
||||
PM826 MPC8260
|
||||
TQM8260 MPC8260
|
||||
|
||||
P3G4 MPC7410
|
||||
|
||||
PCIPPC2 MPC750
|
||||
PCIPPC6 MPC750
|
||||
|
||||
EXBITGEN PPC405GP
|
||||
|
||||
Jon Diekema <jon.diekema@smiths-aerospace.com>
|
||||
|
||||
sbc8260 MPC8260
|
||||
@@ -104,6 +108,10 @@ Dave Ellis <DGE@sixnetio.com>
|
||||
|
||||
SXNI855T MPC8xx
|
||||
|
||||
Raghu Krishnaprasad <raghu.krishnaprasad@fci.com>
|
||||
|
||||
ADDERII MPC852T
|
||||
|
||||
Thomas Frieden <ThomasF@hyperion-entertainment.com>
|
||||
|
||||
AmigaOneG3SE MPC7xx
|
||||
@@ -275,6 +283,10 @@ Gary Jennejohn <gj@denx.de>
|
||||
smdk2400 ARM920T
|
||||
trab ARM920T
|
||||
|
||||
Kshitij Gupta <kshitij@ti.com>
|
||||
omap1510inn ARM925T
|
||||
omap1610inn ARM926EJS
|
||||
|
||||
David Müller <d.mueller@elsoft.ch>
|
||||
|
||||
smdk2410 ARM920T
|
||||
|
||||
63
MAKEALL
63
MAKEALL
@@ -18,25 +18,34 @@ LIST_5xx=" \
|
||||
cmi_mpc5xx \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MPC5xxx Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_5xxx=" \
|
||||
IceCube_5100 IceCube_5200 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MPC8xx Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_8xx=" \
|
||||
ADS860 AMX860 c2mon CCM \
|
||||
cogent_mpc8xx 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 MVS1 NETVIA NETVIA_V2 \
|
||||
NX823 pcu_e R360MPI RBC823 \
|
||||
rmu RPXClassic RPXlite RRvision \
|
||||
SM850 SPD823TS svm_sc8xx SXNI855T \
|
||||
TOP860 TQM823L TQM823L_LCD TQM850L \
|
||||
TQM855L TQM860L TTTech v37 \
|
||||
AdderII ADS860 AMX860 c2mon \
|
||||
CCM cogent_mpc8xx 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 \
|
||||
R360MPI RBC823 rmu RPXClassic \
|
||||
RPXlite RRvision SM850 SPD823TS \
|
||||
svm_sc8xx SXNI855T TOP860 TQM823L \
|
||||
TQM823L_LCD TQM850L TQM855L TQM860L \
|
||||
v37 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -47,10 +56,10 @@ LIST_4xx=" \
|
||||
ADCIOP AR405 ASH405 BUBINGA405EP \
|
||||
CANBT CPCI405 CPCI4052 CPCI405AB \
|
||||
CPCI440 CPCIISER4 CRAYL1 DASA_SIM \
|
||||
DU405 EBONY ERIC MIP405 \
|
||||
MIP405T ML2 OCRTC ORSG \
|
||||
PCI405 PIP405 PMC405 W7OLMC \
|
||||
W7OLMG WALNUT405 \
|
||||
DU405 EBONY ERIC EXBITGEN \
|
||||
MIP405 MIP405T ML2 OCRTC \
|
||||
ORSG PCI405 PIP405 PMC405 \
|
||||
PPChameleonEVB W7OLMC W7OLMG WALNUT405 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -60,7 +69,7 @@ LIST_4xx=" \
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
MOUSSE MUSENKI OXC PN62 \
|
||||
Sandpoint8240 Sandpoint8245 utx8245 \
|
||||
Sandpoint8240 Sandpoint8245 SL8245 utx8245 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -72,7 +81,7 @@ LIST_8260=" \
|
||||
gw8260 hymod IPHASE4539 MPC8260ADS \
|
||||
MPC8266ADS PM826 ppmc8260 RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260 \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -80,14 +89,16 @@ LIST_8260=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_74xx=" \
|
||||
EVB64260 PCIPPC2 PCIPPC6 ZUMA \
|
||||
EVB64260 P3G4 PCIPPC2 PCIPPC6 \
|
||||
ZUMA \
|
||||
"
|
||||
|
||||
LIST_7xx=" \
|
||||
BAB7xx ELPPC \
|
||||
"
|
||||
|
||||
LIST_ppc="${LIST_5xx} ${LIST_8xx} \
|
||||
LIST_ppc="${LIST_5xx} ${LIST_5xxx} \
|
||||
${LIST_8xx} \
|
||||
${LIST_824x} ${LIST_8260} \
|
||||
${LIST_4xx} \
|
||||
${LIST_74xx} ${LIST_7xx}"
|
||||
@@ -108,7 +119,11 @@ LIST_ARM7="ep7312 impa7"
|
||||
## ARM9 Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_ARM9="at91rm9200dk smdk2400 smdk2410 trab VCMA9"
|
||||
LIST_ARM9=" \
|
||||
at91rm9200dk omap1510inn omap1610inn \
|
||||
smdk2400 smdk2410 trab \
|
||||
VCMA9 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## Xscale Systems
|
||||
@@ -159,7 +174,7 @@ build_target() {
|
||||
for arg in $@
|
||||
do
|
||||
case "$arg" in
|
||||
5xx|8xx|824x|8260|4xx|7xx|74xx|SA|ARM7|ARM9|ppc|arm|pxa|mips|I486|x86)
|
||||
5xx|5xxx|8xx|824x|8260|4xx|7xx|74xx|SA|ARM7|ARM9|ppc|arm|pxa|mips|I486|x86)
|
||||
for target in `eval echo '$LIST_'${arg}`
|
||||
do
|
||||
build_target ${target}
|
||||
|
||||
163
Makefile
163
Makefile
@@ -87,6 +87,7 @@ SUBDIRS = tools \
|
||||
rtc \
|
||||
dtt \
|
||||
drivers \
|
||||
drivers/sk98lin \
|
||||
post \
|
||||
post/cpu \
|
||||
examples
|
||||
@@ -112,17 +113,17 @@ LIBS += disk/libdisk.a
|
||||
LIBS += rtc/librtc.a
|
||||
LIBS += dtt/libdtt.a
|
||||
LIBS += drivers/libdrivers.a
|
||||
LIBS += drivers/sk98lin/libsk98lin.a
|
||||
LIBS += post/libpost.a post/cpu/libcpu.a
|
||||
LIBS += common/libcommon.a
|
||||
LIBS += lib_generic/libgeneric.a
|
||||
|
||||
#########################################################################
|
||||
#########################################################################
|
||||
|
||||
all: u-boot.srec u-boot.bin System.map
|
||||
ALL = u-boot.srec u-boot.bin System.map
|
||||
|
||||
install: all
|
||||
-cp u-boot.bin /tftpboot/u-boot.bin
|
||||
-cp u-boot.bin /net/denx/tftpboot/u-boot.bin
|
||||
all: $(ALL)
|
||||
|
||||
u-boot.srec: u-boot
|
||||
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
||||
@@ -130,18 +131,28 @@ u-boot.srec: u-boot
|
||||
u-boot.bin: u-boot
|
||||
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
|
||||
|
||||
u-boot.img: u-boot.bin
|
||||
./tools/mkimage -A $(ARCH) -T firmware -C none \
|
||||
-a $(TEXT_BASE) -e 0 \
|
||||
-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' include/version.h | \
|
||||
sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
|
||||
-d $< $@
|
||||
|
||||
u-boot.dis: u-boot
|
||||
$(OBJDUMP) -d $< > $@
|
||||
|
||||
u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
|
||||
UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
|
||||
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
|
||||
--start-group $(LIBS) --end-group \
|
||||
--start-group $(LIBS) $(PLATFORM_LIBS) --end-group \
|
||||
-Map u-boot.map -o u-boot
|
||||
|
||||
subdirs:
|
||||
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
|
||||
|
||||
gdbtools:
|
||||
$(MAKE) -C tools/gdb || exit 1
|
||||
|
||||
depend dep:
|
||||
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
|
||||
|
||||
@@ -181,10 +192,29 @@ unconfig:
|
||||
cmi_mpc5xx_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc5xx cmi
|
||||
|
||||
#########################################################################
|
||||
## MPC5xxx Systems
|
||||
#########################################################################
|
||||
IceCube_5200_config \
|
||||
IceCube_5100_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _5200,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC5200" >>include/config.h ; \
|
||||
echo "... with MPC5200 processor" ; \
|
||||
}
|
||||
@[ -z "$(findstring _5100,$@)" ] || \
|
||||
{ echo "#define CONFIG_MGT5100" >>include/config.h ; \
|
||||
echo "... with MGT5100 processor" ; \
|
||||
}
|
||||
@./mkconfig -a IceCube ppc mpc5xxx icecube
|
||||
|
||||
#########################################################################
|
||||
## MPC8xx Systems
|
||||
#########################################################################
|
||||
|
||||
AdderII_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx adderII
|
||||
|
||||
ADS860_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx fads
|
||||
|
||||
@@ -211,6 +241,7 @@ ETX094_config : unconfig
|
||||
|
||||
FADS823_config \
|
||||
FADS850SAR_config \
|
||||
MPC86xADS_config \
|
||||
FADS860T_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx fads
|
||||
|
||||
@@ -372,6 +403,7 @@ xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _LCD,,$(su
|
||||
|
||||
FPS850L_config \
|
||||
FPS860L_config \
|
||||
NSCU_config \
|
||||
TQM823L_config \
|
||||
TQM823L_66MHz_config \
|
||||
TQM823L_80MHz_config \
|
||||
@@ -390,6 +422,21 @@ 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: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _66MHz,$@)" ] || \
|
||||
@@ -467,6 +514,9 @@ EBONY_config:unconfig
|
||||
ERIC_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx eric
|
||||
|
||||
EXBITGEN_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx exbitgen
|
||||
|
||||
MIP405_config:unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
|
||||
|
||||
@@ -491,6 +541,9 @@ PIP405_config:unconfig
|
||||
PMC405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
|
||||
|
||||
PPChameleonEVB_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
W7OLMC_config \
|
||||
W7OLMG_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx w7o
|
||||
@@ -543,6 +596,9 @@ Sandpoint8240_config: unconfig
|
||||
Sandpoint8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sandpoint
|
||||
|
||||
SL8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x sl8245
|
||||
|
||||
utx8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x utx8245
|
||||
|
||||
@@ -629,32 +685,48 @@ sbc8260_config: unconfig
|
||||
SCM_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
|
||||
|
||||
TQM8255_config \
|
||||
TQM8260_config \
|
||||
TQM8260_L2_config \
|
||||
TQM8255_266MHz_config \
|
||||
TQM8260_266MHz_config \
|
||||
TQM8260_L2_266MHz_config \
|
||||
TQM8255_300MHz_config \
|
||||
TQM8260_300MHz_config: unconfig
|
||||
@ >include/config.h
|
||||
@if [ "$(findstring _L2_,$@)" ] ; then \
|
||||
TQM8255_AA_config \
|
||||
TQM8260_AA_config \
|
||||
TQM8260_AB_config \
|
||||
TQM8260_AC_config \
|
||||
TQM8260_AD_config \
|
||||
TQM8260_AE_config \
|
||||
TQM8260_AF_config \
|
||||
TQM8260_AG_config \
|
||||
TQM8260_AH_config \
|
||||
TQM8265_AA_config: unconfig
|
||||
@case "$@" in \
|
||||
TQM8255_AA_config) CTYPE=MPC8255; CFREQ=300; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AA_config) CTYPE=MPC8260; CFREQ=200; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AB_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
|
||||
TQM8260_AC_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
|
||||
TQM8260_AD_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
|
||||
TQM8260_AE_config) CTYPE=MPC8260; CFREQ=266; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AF_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
|
||||
TQM8260_AG_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AH_config) CTYPE=MPC8260; CFREQ=300; CACHE=yes; BMODE=60x;; \
|
||||
TQM8265_AA_config) CTYPE=MPC8265; CFREQ=300; CACHE=no; BMODE=60x;; \
|
||||
esac; \
|
||||
>include/config.h ; \
|
||||
if [ "$${CTYPE}" != "MPC8260" ] ; then \
|
||||
echo "#define CONFIG_$${CTYPE}" >>include/config.h ; \
|
||||
fi; \
|
||||
echo "#define CONFIG_$${CFREQ}MHz" >>include/config.h ; \
|
||||
echo "... with $${CFREQ}MHz system clock" ; \
|
||||
if [ "$${CACHE}" == "yes" ] ; then \
|
||||
echo "#define CONFIG_L2_CACHE" >>include/config.h ; \
|
||||
echo "... with L2 Cache support (60x Bus Mode)" ; \
|
||||
echo "... with L2 Cache support" ; \
|
||||
else \
|
||||
echo "#undef CONFIG_L2_CACHE" >>include/config.h ; \
|
||||
echo "... without L2 Cache support" ; \
|
||||
fi; \
|
||||
if [ "$${BMODE}" == "60x" ] ; then \
|
||||
echo "#define CONFIG_BUSMODE_60x" >>include/config.h ; \
|
||||
echo "... with 60x Bus Mode" ; \
|
||||
else \
|
||||
echo "#undef CONFIG_BUSMODE_60x" >>include/config.h ; \
|
||||
echo "... without 60x Bus Mode" ; \
|
||||
fi
|
||||
@[ -z "$(findstring _266MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_266MHz" >>include/config.h ; \
|
||||
echo "... with 266MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _300MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_300MHz" >>include/config.h ; \
|
||||
echo "... with 300MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring TQM8255_,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC8255" >>include/config.h ; }
|
||||
@./mkconfig -a TQM8260 ppc mpc8260 tqm8260
|
||||
|
||||
atc_config: unconfig
|
||||
@@ -684,6 +756,9 @@ BAB7xx_config: unconfig
|
||||
ELPPC_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
|
||||
|
||||
P3G4_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
|
||||
|
||||
#========================================================================
|
||||
# ARM
|
||||
#========================================================================
|
||||
@@ -704,11 +779,17 @@ shannon_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm sa1100 shannon
|
||||
|
||||
#########################################################################
|
||||
## ARM920T Systems
|
||||
## ARM92xT Systems
|
||||
#########################################################################
|
||||
|
||||
xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
|
||||
|
||||
omap1510inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t omap1510inn
|
||||
|
||||
omap1610inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs omap1610inn
|
||||
|
||||
smdk2400_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2400
|
||||
|
||||
@@ -781,8 +862,30 @@ sc520_spunk_rel_config : unconfig
|
||||
## MIPS32 4Kc
|
||||
#########################################################################
|
||||
|
||||
incaip_config : unconfig
|
||||
@./mkconfig $(@:_config=) mips mips incaip
|
||||
xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1))))
|
||||
|
||||
incaip_100MHz_config \
|
||||
incaip_133MHz_config \
|
||||
incaip_150MHz_config \
|
||||
incaip_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _100MHz,$@)" ] || \
|
||||
{ echo "#define CPU_CLOCK_RATE 100000000" >>include/config.h ; \
|
||||
echo "... with 100MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _133MHz,$@)" ] || \
|
||||
{ echo "#define CPU_CLOCK_RATE 133000000" >>include/config.h ; \
|
||||
echo "... with 133MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _150MHz,$@)" ] || \
|
||||
{ echo "#define CPU_CLOCK_RATE 150000000" >>include/config.h ; \
|
||||
echo "... with 150MHz system clock" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_incaip,$@) mips mips incaip
|
||||
|
||||
#########################################################################
|
||||
## MIPS64 5Kc
|
||||
#########################################################################
|
||||
|
||||
purple_config : unconfig
|
||||
@./mkconfig $(@:_config=) mips mips purple
|
||||
@@ -812,7 +915,7 @@ clobber: clean
|
||||
| xargs rm -f
|
||||
rm -f $(OBJS) *.bak tags TAGS
|
||||
rm -fr *.*~
|
||||
rm -f u-boot u-boot.bin u-boot.srec u-boot.map System.map
|
||||
rm -f u-boot u-boot.map $(ALL)
|
||||
rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
|
||||
rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
|
||||
rm -f include/asm/proc include/asm/arch include/asm
|
||||
|
||||
205
README
205
README
@@ -119,12 +119,12 @@ U-Boot will always have a patchlevel of "0".
|
||||
Directory Hierarchy:
|
||||
====================
|
||||
|
||||
- board Board dependend files
|
||||
- common Misc architecture independend functions
|
||||
- board Board dependent files
|
||||
- common Misc architecture independent functions
|
||||
- cpu CPU specific files
|
||||
- disk Code for disk drive partition handling
|
||||
- doc Documentation (don't expect too much)
|
||||
- drivers Common used device drivers
|
||||
- drivers Commonly used device drivers
|
||||
- dtt Digital Thermometer and Thermostat drivers
|
||||
- examples Example code for standalone applications, etc.
|
||||
- include Header Files
|
||||
@@ -140,12 +140,15 @@ Directory Hierarchy:
|
||||
- tools Tools to build S-Record or U-Boot images, etc.
|
||||
|
||||
- cpu/74xx_7xx Files specific to Motorola MPC74xx and 7xx CPUs
|
||||
- cpu/arm925t Files specific to ARM 925 CPUs
|
||||
- cpu/arm926ejs Files specific to ARM 926 CPUs
|
||||
- cpu/mpc5xx Files specific to Motorola MPC5xx CPUs
|
||||
- cpu/mpc8xx Files specific to Motorola MPC8xx CPUs
|
||||
- cpu/mpc824x Files specific to Motorola MPC824x CPUs
|
||||
- cpu/mpc8260 Files specific to Motorola MPC8260 CPU
|
||||
- cpu/ppc4xx Files specific to IBM 4xx CPUs
|
||||
|
||||
|
||||
- board/LEOX/ Files specific to boards manufactured by The LEOX team
|
||||
- board/LEOX/elpt860 Files specific to ELPT860 boards
|
||||
- board/RPXClassic
|
||||
@@ -195,7 +198,7 @@ Directory Hierarchy:
|
||||
- board/lwmon Files specific to LWMON boards
|
||||
- board/mbx8xx Files specific to MBX boards
|
||||
- board/mpc8260ads
|
||||
Files specific to MMPC8260ADS boards
|
||||
Files specific to MPC8260ADS and PQ2FADS-ZU boards
|
||||
- board/mpl/ Files specific to boards manufactured by MPL
|
||||
- board/mpl/common Common files for MPL boards
|
||||
- board/mpl/pip405 Files specific to PIP405 boards
|
||||
@@ -204,6 +207,10 @@ Directory Hierarchy:
|
||||
- board/mvs1 Files specific to MVS1 boards
|
||||
- board/nx823 Files specific to NX823 boards
|
||||
- board/oxc Files specific to OXC boards
|
||||
- board/omap1510inn
|
||||
Files specific to OMAP 1510 Innovator boards
|
||||
- board/omap1610inn
|
||||
Files specific to OMAP 1610 Innovator boards
|
||||
- board/pcippc2 Files specific to PCIPPC2/PCIPPC6 boards
|
||||
- board/pm826 Files specific to PM826 boards
|
||||
- board/ppmc8260
|
||||
@@ -299,6 +306,7 @@ The following options need to be configured:
|
||||
or CONFIG_MPC824X, CONFIG_MPC8260
|
||||
or CONFIG_IOP480
|
||||
or CONFIG_405GP
|
||||
or CONFIG_405EP
|
||||
or CONFIG_440
|
||||
or CONFIG_MPC74xx
|
||||
or CONFIG_750FX
|
||||
@@ -353,6 +361,7 @@ The following options need to be configured:
|
||||
|
||||
CONFIG_HHP_CRADLE, CONFIG_DNP1110, CONFIG_EP7312,
|
||||
CONFIG_IMPA7, CONFIG_LART, CONFIG_LUBBOCK,
|
||||
CONFIG_INNOVATOROMAP1510, CONFIG_INNOVATOROMAP1610
|
||||
CONFIG_SHANNON, CONFIG_SMDK2400, CONFIG_SMDK2410,
|
||||
CONFIG_TRAB, CONFIG_AT91RM9200DK
|
||||
|
||||
@@ -378,6 +387,14 @@ The following options need to be configured:
|
||||
the lcd display every second with
|
||||
a "rotator" |\-/|\-/
|
||||
|
||||
- Board flavour: (if CONFIG_MPC8260ADS is defined)
|
||||
CONFIG_ADSTYPE
|
||||
Possible values are:
|
||||
CFG_8260ADS - original MPC8260ADS
|
||||
CFG_8266ADS - MPC8266ADS (untested)
|
||||
CFG_PQ2FADS - PQ2FADS-ZU
|
||||
|
||||
|
||||
- MPC824X Family Member (if CONFIG_MPC824X is defined)
|
||||
Define exactly one of
|
||||
CONFIG_MPC8240, CONFIG_MPC8245
|
||||
@@ -627,7 +644,7 @@ The following options need to be configured:
|
||||
- Watchdog:
|
||||
CONFIG_WATCHDOG
|
||||
If this variable is defined, it enables watchdog
|
||||
support. There must support in the platform specific
|
||||
support. There must be support in the platform specific
|
||||
code for a watchdog. For the 8xx and 8260 CPUs, the
|
||||
SIU Watchdog feature is enabled in the SYPCR
|
||||
register.
|
||||
@@ -653,6 +670,9 @@ The following options need to be configured:
|
||||
CONFIG_RTC_DS1338 - use Maxim, Inc. DS1338 RTC
|
||||
CONFIG_RTC_DS164x - use Dallas DS164x RTC
|
||||
|
||||
Note that if the RTC uses I2C, then the I2C interface
|
||||
must also be configured. See I2C Support, below.
|
||||
|
||||
- Timestamp Support:
|
||||
|
||||
When CONFIG_TIMESTAMP is selected, the timestamp
|
||||
@@ -832,7 +852,7 @@ The following options need to be configured:
|
||||
Normally display is black on white background; define
|
||||
CFG_WHITE_ON_BLACK to get it inverted.
|
||||
|
||||
- Spash Screen Support: CONFIG_SPLASH_SCREEN
|
||||
- Splash Screen Support: CONFIG_SPLASH_SCREEN
|
||||
|
||||
If this option is set, the environment is checked for
|
||||
a variable "splashimage". If found, the usual display
|
||||
@@ -843,6 +863,16 @@ The following options need to be configured:
|
||||
allows for a "silent" boot where a splash screen is
|
||||
loaded very quickly after power-on.
|
||||
|
||||
- Compression support:
|
||||
CONFIG_BZIP2
|
||||
|
||||
If this option is set, support for bzip2 compressed
|
||||
images is included. If not, only uncompressed and gzip
|
||||
compressed images are supported.
|
||||
|
||||
NOTE: the bzip2 algorithm requires a lot of RAM, so
|
||||
the malloc area (as defined by CFG_MALLOC_LEN) should
|
||||
be at least 4MB.
|
||||
|
||||
- Ethernet address:
|
||||
CONFIG_ETHADDR
|
||||
@@ -885,6 +915,29 @@ The following options need to be configured:
|
||||
4th and following
|
||||
BOOTP requests: delay 0 ... 8 sec
|
||||
|
||||
- DHCP Advanced Options:
|
||||
CONFIG_BOOTP_MASK
|
||||
|
||||
You can fine tune the DHCP functionality by adding
|
||||
these flags to the CONFIG_BOOTP_MASK define:
|
||||
|
||||
CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS
|
||||
serverip from a DHCP server, it is possible that more
|
||||
than one DNS serverip is offered to the client.
|
||||
If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS
|
||||
serverip will be stored in the additional environment
|
||||
variable "dnsip2". The first DNS serverip is always
|
||||
stored in the variable "dnsip", when CONFIG_BOOTP_DNS
|
||||
is added to the CONFIG_BOOTP_MASK.
|
||||
|
||||
CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable
|
||||
to do a dynamic update of a DNS server. To do this, they
|
||||
need the hostname of the DHCP requester.
|
||||
If CONFIG_BOOP_SEND_HOSTNAME is added to the
|
||||
CONFIG_BOOTP_MASK, the content of the "hostname"
|
||||
environment variable is passed as option 12 to
|
||||
the DHCP server.
|
||||
|
||||
- Status LED: CONFIG_STATUS_LED
|
||||
|
||||
Several configurations allow to display the current
|
||||
@@ -904,29 +957,48 @@ The following options need to be configured:
|
||||
|
||||
- I2C Support: CONFIG_HARD_I2C | CONFIG_SOFT_I2C
|
||||
|
||||
Enables I2C serial bus commands. If this is selected,
|
||||
either CONFIG_HARD_I2C or CONFIG_SOFT_I2C must be defined
|
||||
to include the appropriate I2C driver.
|
||||
These enable I2C serial bus commands. Defining either of
|
||||
(but not both of) CONFIG_HARD_I2C or CONFIG_SOFT_I2C will
|
||||
include the appropriate I2C driver for the selected cpu.
|
||||
|
||||
See also: common/cmd_i2c.c for a description of the
|
||||
This will allow you to use i2c commands at the u-boot
|
||||
command line (as long as you set CFG_CMD_I2C in
|
||||
CONFIG_COMMANDS) and communicate with i2c based realtime
|
||||
clock chips. See common/cmd_i2c.c for a description of the
|
||||
command line interface.
|
||||
|
||||
CONFIG_HARD_I2C selects the CPM hardware driver for I2C.
|
||||
|
||||
CONFIG_HARD_I2C
|
||||
CONFIG_SOFT_I2C configures u-boot to use a software (aka
|
||||
bit-banging) driver instead of CPM or similar hardware
|
||||
support for I2C.
|
||||
|
||||
Selects the CPM hardware driver for I2C.
|
||||
There are several other quantities that must also be
|
||||
defined when you define CONFIG_HARD_I2C or CONFIG_SOFT_I2C.
|
||||
|
||||
CONFIG_SOFT_I2C
|
||||
In both cases you will need to define CFG_I2C_SPEED
|
||||
to be the frequency (in Hz) at which you wish your i2c bus
|
||||
to run and CFG_I2C_SLAVE to be the address of this node (ie
|
||||
the cpu's i2c node address).
|
||||
|
||||
Use software (aka bit-banging) driver instead of CPM
|
||||
or similar hardware support for I2C. This is configured
|
||||
via the following defines.
|
||||
Now, the u-boot i2c code for the mpc8xx (cpu/mpc8xx/i2c.c)
|
||||
sets the cpu up as a master node and so its address should
|
||||
therefore be cleared to 0 (See, eg, MPC823e User's Manual
|
||||
p.16-473). So, set CFG_I2C_SLAVE to 0.
|
||||
|
||||
That's all that's required for CONFIG_HARD_I2C.
|
||||
|
||||
If you use the software i2c interface (CONFIG_SOFT_I2C)
|
||||
then the following macros need to be defined (examples are
|
||||
from include/configs/lwmon.h):
|
||||
|
||||
I2C_INIT
|
||||
|
||||
(Optional). Any commands necessary to enable I2C
|
||||
(Optional). Any commands necessary to enable the I2C
|
||||
controller or configure ports.
|
||||
|
||||
eg: #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
|
||||
|
||||
I2C_PORT
|
||||
|
||||
(Only for MPC8260 CPU). The I/O port to use (the code
|
||||
@@ -939,32 +1011,49 @@ The following options need to be configured:
|
||||
(driven). If the data line is open collector, this
|
||||
define can be null.
|
||||
|
||||
eg: #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
|
||||
|
||||
I2C_TRISTATE
|
||||
|
||||
The code necessary to make the I2C data line tri-stated
|
||||
(inactive). If the data line is open collector, this
|
||||
define can be null.
|
||||
|
||||
eg: #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
|
||||
|
||||
I2C_READ
|
||||
|
||||
Code that returns TRUE if the I2C data line is high,
|
||||
FALSE if it is low.
|
||||
|
||||
eg: #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
|
||||
|
||||
I2C_SDA(bit)
|
||||
|
||||
If <bit> is TRUE, sets the I2C data line high. If it
|
||||
is FALSE, it clears it (low).
|
||||
|
||||
eg: #define I2C_SDA(bit) \
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SDA
|
||||
|
||||
I2C_SCL(bit)
|
||||
|
||||
If <bit> is TRUE, sets the I2C clock line high. If it
|
||||
is FALSE, it clears it (low).
|
||||
|
||||
eg: #define I2C_SCL(bit) \
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SCL
|
||||
|
||||
I2C_DELAY
|
||||
|
||||
This delay is invoked four times per clock cycle so this
|
||||
controls the rate of data transfer. The data rate thus
|
||||
is 1 / (I2C_DELAY * 4).
|
||||
is 1 / (I2C_DELAY * 4). Often defined to be something
|
||||
like:
|
||||
|
||||
#define I2C_DELAY udelay(2)
|
||||
|
||||
CFG_I2C_INIT_BOARD
|
||||
|
||||
@@ -1114,7 +1203,7 @@ The following options need to be configured:
|
||||
|
||||
U-Boot considers the values of the environment
|
||||
variables "serial#" (Board Serial Number) and
|
||||
"ethaddr" (Ethernet Address) to bb parameters that
|
||||
"ethaddr" (Ethernet Address) to be parameters that
|
||||
are set once by the board vendor / manufacturer, and
|
||||
protects these variables from casual modification by
|
||||
the user. Once set, these variables are read-only,
|
||||
@@ -1229,7 +1318,7 @@ The following options need to be configured:
|
||||
|
||||
Define this to contain any number of null terminated
|
||||
strings (variable = value pairs) that will be part of
|
||||
the default enviroment compiled into the boot image.
|
||||
the default environment compiled into the boot image.
|
||||
|
||||
For example, place something like this in your
|
||||
board's config file:
|
||||
@@ -1242,7 +1331,7 @@ The following options need to be configured:
|
||||
internal format how the environment is stored by the
|
||||
U-Boot code. This is NOT an official, exported
|
||||
interface! Although it is unlikely that this format
|
||||
will change soon, but there is no guarantee either.
|
||||
will change soon, there is no guarantee either.
|
||||
You better know what you are doing here.
|
||||
|
||||
Note: overly (ab)use of the default environment is
|
||||
@@ -1442,6 +1531,16 @@ Configuration Settings:
|
||||
- CFG_FLASH_WRITE_TOUT:
|
||||
Timeout for Flash write operations (in ms)
|
||||
|
||||
- CFG_FLASH_LOCK_TOUT
|
||||
Timeout for Flash set sector lock bit operation (in ms)
|
||||
|
||||
- CFG_FLASH_UNLOCK_TOUT
|
||||
Timeout for Flash clear lock bits operation (in ms)
|
||||
|
||||
- CFG_FLASH_PROTECTION
|
||||
If defined, hardware flash sectors protection is used
|
||||
instead of U-Boot software protection.
|
||||
|
||||
- CFG_DIRECT_FLASH_TFTP:
|
||||
|
||||
Enable TFTP transfers directly to flash memory;
|
||||
@@ -1633,9 +1732,10 @@ Low Level (hardware related) configuration options:
|
||||
|
||||
- CFG_DEFAULT_IMMR:
|
||||
Default address of the IMMR after system reset.
|
||||
Needed on some 8260 systems (MPC8260ADS and RPXsuper)
|
||||
to be able to adjust the position of the IMMR
|
||||
register after a reset.
|
||||
|
||||
Needed on some 8260 systems (MPC8260ADS, PQ2FADS-ZU,
|
||||
and RPXsuper) to be able to adjust the position of
|
||||
the IMMR register after a reset.
|
||||
|
||||
- Floppy Disk Support:
|
||||
CFG_FDC_DRIVE_NUMBER
|
||||
@@ -1669,7 +1769,7 @@ Low Level (hardware related) configuration options:
|
||||
|
||||
- CFG_INIT_RAM_ADDR:
|
||||
|
||||
Start address of memory area tha can be used for
|
||||
Start address of memory area that can be used for
|
||||
initial data and stack; please note that this must be
|
||||
writable memory that is working WITHOUT special
|
||||
initialization, i. e. you CANNOT use normal RAM which
|
||||
@@ -1808,8 +1908,8 @@ configurations; the following names are supported:
|
||||
GENIETV_config TQM823L_config PIP405_config
|
||||
GEN860T_config EBONY_config FPS860L_config
|
||||
ELPT860_config cmi_mpc5xx_config NETVIA_config
|
||||
at91rm9200dk_config
|
||||
|
||||
at91rm9200dk_config omap1510inn_config MPC8260ADS_config
|
||||
omap1610inn_config
|
||||
Note: for some board special configuration names may exist; check if
|
||||
additional information is available from the board vendor; for
|
||||
instance, the TQM8xxL systems run normally at 50 MHz and use a
|
||||
@@ -1841,7 +1941,7 @@ Note: for some board special configuration names may exist; check if
|
||||
|
||||
|
||||
Finally, type "make all", and you should get some working U-Boot
|
||||
images ready for downlod to / installation on your system:
|
||||
images ready for download to / installation on your system:
|
||||
|
||||
- "u-boot.bin" is a raw binary image
|
||||
- "u-boot" is an image in ELF binary format
|
||||
@@ -1860,7 +1960,7 @@ steps:
|
||||
1. Add a new configuration option for your board to the toplevel
|
||||
"Makefile" and to the "MAKEALL" script, using the existing
|
||||
entries as examples. Note that here and at many other places
|
||||
boards and other names are listed alphabetically sorted. Please
|
||||
boards and other names are listed in alphabetical sort order. Please
|
||||
keep this order.
|
||||
2. Create a new directory to hold your board specific code. Add any
|
||||
files you need. In your board directory, you will need at least
|
||||
@@ -1890,7 +1990,7 @@ cation did not break existing code. At least make sure that *ALL* of
|
||||
the supported boards compile WITHOUT ANY compiler warnings. To do so,
|
||||
just run the "MAKEALL" script, which will configure and build U-Boot
|
||||
for ALL supported system. Be warned, this will take a while. You can
|
||||
select which (cross) compiler to use py passing a `CROSS_COMPILE'
|
||||
select which (cross) compiler to use by passing a `CROSS_COMPILE'
|
||||
environment variable to the script, i. e. to use the cross tools from
|
||||
MontaVista's Hard Hat Linux you can type
|
||||
|
||||
@@ -2017,10 +2117,10 @@ Some configuration options can be set using Environment Variables:
|
||||
does not overwrite the U-Boot stack and data).
|
||||
|
||||
For instance, when you have a system with 16 MB
|
||||
RAM, and want to reseve 4 MB from use by Linux,
|
||||
RAM, and want to reserve 4 MB from use by Linux,
|
||||
you can do this by adding "mem=12M" to the value of
|
||||
the "bootargs" variable. However, now you must make
|
||||
sure, that the initrd image is placed in the first
|
||||
sure that the initrd image is placed in the first
|
||||
12 MB as well - this can be done with
|
||||
|
||||
setenv initrd_high 00c00000
|
||||
@@ -2055,6 +2155,7 @@ depending the information provided by your boot server:
|
||||
|
||||
bootfile - see above
|
||||
dnsip - IP address of your Domain Name Server
|
||||
dnsip2 - IP address of your secondary Domain Name Server
|
||||
gatewayip - IP address of the Gateway (Router) to use
|
||||
hostname - Target hostname
|
||||
ipaddr - see above
|
||||
@@ -2088,8 +2189,8 @@ only effect after the next boot (yes, that's just like Windoze :-).
|
||||
Command Line Parsing:
|
||||
=====================
|
||||
|
||||
There are two different command line parsers available with U-Boot:
|
||||
the old "simple" one, and the much more pwerful "hush" shell:
|
||||
There are two different command line parsers available with U-Boot:
|
||||
the old "simple" one, and the much more powerful "hush" shell:
|
||||
|
||||
Old, simple command line parser:
|
||||
--------------------------------
|
||||
@@ -2130,9 +2231,9 @@ General rules:
|
||||
Note for Redundant Ethernet Interfaces:
|
||||
=======================================
|
||||
|
||||
Some boards come with redundand ethernet interfaces; U-Boot supports
|
||||
Some boards come with redundant ethernet interfaces; U-Boot supports
|
||||
such configurations and is capable of automatic selection of a
|
||||
"working" interface when needed. MAC assignemnt works as follows:
|
||||
"working" interface when needed. MAC assignment works as follows:
|
||||
|
||||
Network interfaces are numbered eth0, eth1, eth2, ... Corresponding
|
||||
MAC addresses can be stored in the environment as "ethaddr" (=>eth0),
|
||||
@@ -2172,12 +2273,11 @@ defines the following image properties:
|
||||
* Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
|
||||
4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
|
||||
LynxOS, pSOS, QNX, RTEMS, ARTOS;
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS).
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
|
||||
* Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
|
||||
IA64, MIPS, MIPS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
|
||||
Currently supported: PowerPC).
|
||||
* Compression Type (Provisions for uncompressed, gzip, bzip2;
|
||||
Currently supported: uncompressed, gzip).
|
||||
* Compression Type (uncompressed, gzip, bzip2)
|
||||
* Load Address
|
||||
* Entry Point
|
||||
* Image Name
|
||||
@@ -2192,21 +2292,21 @@ Linux Support:
|
||||
==============
|
||||
|
||||
Although U-Boot should support any OS or standalone application
|
||||
easily, Linux has always been in the focus during the design of
|
||||
easily, the main focus has always been on Linux during the design of
|
||||
U-Boot.
|
||||
|
||||
U-Boot includes many features that so far have been part of some
|
||||
special "boot loader" code within the Linux kernel. Also, any
|
||||
"initrd" images to be used are no longer part of one big Linux image;
|
||||
instead, kernel and "initrd" are separate images. This implementation
|
||||
serves serveral purposes:
|
||||
serves several purposes:
|
||||
|
||||
- the same features can be used for other OS or standalone
|
||||
applications (for instance: using compressed images to reduce the
|
||||
Flash memory footprint)
|
||||
|
||||
- it becomes much easier to port new Linux kernel versions because
|
||||
lots of low-level, hardware dependend stuff are done by U-Boot
|
||||
lots of low-level, hardware dependent stuff are done by U-Boot
|
||||
|
||||
- the same Linux kernel image can now be used with different "initrd"
|
||||
images; of course this also means that different kernel images can
|
||||
@@ -2458,7 +2558,7 @@ parameters. You can check and modify this variable using the
|
||||
...
|
||||
|
||||
If you want to boot a Linux kernel with initial ram disk, you pass
|
||||
the memory addreses of both the kernel and the initrd image (PPBCOOT
|
||||
the memory addresses of both the kernel and the initrd image (PPBCOOT
|
||||
format!) to the "bootm" command:
|
||||
|
||||
=> imi 40100000 40200000
|
||||
@@ -2638,7 +2738,7 @@ Hit 'q':
|
||||
Minicom warning:
|
||||
================
|
||||
|
||||
Over time, many people have reported problems when trying to used the
|
||||
Over time, many people have reported problems when trying to use the
|
||||
"minicom" terminal emulation program for serial download. I (wd)
|
||||
consider minicom to be broken, and recommend not to use it. Under
|
||||
Unix, I recommend to use C-Kermit for general purpose use (and
|
||||
@@ -2706,7 +2806,7 @@ models provide on-chip memory (like the IMMR area on MPC8xx and
|
||||
MPC826x processors), on others (parts of) the data cache can be
|
||||
locked as (mis-) used as memory, etc.
|
||||
|
||||
Chris Hallinan posted a good summy of these issues to the
|
||||
Chris Hallinan posted a good summary of these issues to the
|
||||
u-boot-users mailing list:
|
||||
|
||||
Subject: RE: [U-Boot-Users] RE: More On Memory Bank x (nothingness)?
|
||||
@@ -2752,9 +2852,9 @@ code for the initialization procedures:
|
||||
|
||||
* Do not use any unitialized global data (or implicitely initialized
|
||||
as zero data - BSS segment) at all - this is undefined, initiali-
|
||||
zation is performed later (when relocationg to RAM).
|
||||
zation is performed later (when relocating to RAM).
|
||||
|
||||
* Stack space is very limited. Avoid big data buffers or things like
|
||||
* Stack space is very limited. Avoid big data buffers or things like
|
||||
that.
|
||||
|
||||
Having only the stack as writable memory limits means we cannot use
|
||||
@@ -2767,7 +2867,7 @@ the GCC compiler (Global Register Variables) to share the data: we
|
||||
place a pointer (gd) to the global data into a register which we
|
||||
reserve for this purpose.
|
||||
|
||||
When chosing a register for such a purpose we are restricted by the
|
||||
When choosing a register for such a purpose we are restricted by the
|
||||
relevant (E)ABI specifications for the current architecture, and by
|
||||
GCC's implementation.
|
||||
|
||||
@@ -2857,7 +2957,7 @@ System Initialization:
|
||||
In the reset configuration, U-Boot starts at the reset entry point
|
||||
(on most PowerPC systens at address 0x00000100). Because of the reset
|
||||
configuration for CS0# this is a mirror of the onboard Flash memory.
|
||||
To be able to re-map memory U-Boot then jumps to it's link address.
|
||||
To be able to re-map memory U-Boot then jumps to its link address.
|
||||
To be able to implement the initialization code in C, a (small!)
|
||||
initial stack is set up in the internal Dual Ported RAM (in case CPUs
|
||||
which provide such a feature like MPC8xx or MPC8260), or in a locked
|
||||
@@ -2873,7 +2973,7 @@ simple memory test is run that determines the size of the SDRAM
|
||||
banks.
|
||||
|
||||
When there is more than one SDRAM bank, and the banks are of
|
||||
different size, the larger is mapped first. For equal size, the first
|
||||
different size, the largest is mapped first. For equal size, the first
|
||||
bank (CS2#) is mapped first. The first mapping is always for address
|
||||
0x00000000, with any additional banks following immediately to create
|
||||
contiguous memory starting from 0.
|
||||
@@ -2999,6 +3099,11 @@ it:
|
||||
version of diff does not support these options, then get the latest
|
||||
version of GNU diff.
|
||||
|
||||
The current directory when running this command shall be the top
|
||||
level directory of the U-Boot source tree, or it's parent directory
|
||||
(i. e. please make sure that your patch includes sufficient
|
||||
directory information for the affected files).
|
||||
|
||||
We accept patches as plain text, MIME attachments or as uuencoded
|
||||
gzipped text.
|
||||
|
||||
|
||||
@@ -121,8 +121,8 @@ int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
cmd_tbl_t U_BOOT_CMD(BOOTA) = MK_CMD_ENTRY(
|
||||
"boota", 3, 1, do_boota,
|
||||
U_BOOT_CMD(
|
||||
boota, 3, 1, do_boota,
|
||||
"boota - boot an Amiga kernel\n",
|
||||
"address disk"
|
||||
);
|
||||
|
||||
@@ -8,8 +8,8 @@ int do_menu( cmd_tbl_t *cmdtp, /*bd_t *bd,*/ int flag, int argc, char *argv[] )
|
||||
}
|
||||
|
||||
#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
cmd_tbl_t U_BOOT_CMD(MENU) = MK_CMD_ENTRY(
|
||||
"menu", 1, 1, do_menu,
|
||||
U_BOOT_CMD(
|
||||
menu, 1, 1, do_menu,
|
||||
"menu - display BIOS setup menu\n",
|
||||
""
|
||||
);
|
||||
|
||||
68
board/RRvision/video_ad7179.h
Normal file
68
board/RRvision/video_ad7179.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* (C) Copyright 2003 Wolfgang Grandegger <wg@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
|
||||
*/
|
||||
|
||||
#define VIDEO_ENCODER_NAME "Analog Devices AD7179"
|
||||
|
||||
#define VIDEO_ENCODER_I2C_RATE 100000 /* Max rate is 100Khz */
|
||||
#define VIDEO_ENCODER_CB_Y_CR_Y /* Use CB Y CR Y format... */
|
||||
|
||||
#define VIDEO_MODE_YUYV /* The only mode supported by this encoder */
|
||||
#undef VIDEO_MODE_RGB
|
||||
#define VIDEO_MODE_BPP 16
|
||||
|
||||
#ifdef VIDEO_MODE_PAL
|
||||
#define VIDEO_ACTIVE_COLS 720
|
||||
#define VIDEO_ACTIVE_ROWS 576
|
||||
#define VIDEO_VISIBLE_COLS 640
|
||||
#define VIDEO_VISIBLE_ROWS 480
|
||||
#else
|
||||
#error "NTSC mode is not supported"
|
||||
#endif
|
||||
|
||||
static unsigned char video_encoder_data[] = {
|
||||
0x05, /* Mode Register 0 */
|
||||
0x11, /* Mode Register 1 */
|
||||
0x20, /* Mode Register 2 */
|
||||
0x0C, /* Mode Register 3 */
|
||||
0x01, /* Mode Register 4 */
|
||||
0x00, /* Reserved */
|
||||
0x00, /* Reserved */
|
||||
0x04, /* Timing Register 0 */
|
||||
0x00, /* Timing Register 1 */
|
||||
0xCB, /* Subcarrier Frequency Register 0 */
|
||||
0x0A, /* Subcarrier Frequency Register 1 */
|
||||
0x09, /* Subcarrier Frequency Register 2 */
|
||||
0x2A, /* Subcarrier Frequency Register 3 */
|
||||
0x00, /* Subcarrier Phase */
|
||||
0x00, /* Closed Captioning Ext Reg 0 */
|
||||
0x00, /* Closed Captioning Ext Reg 1 */
|
||||
0x00, /* Closed Captioning Reg 0 */
|
||||
0x00, /* Closed Captioning Reg 1 */
|
||||
0x00, /* Pedestal Control Reg 0 */
|
||||
0x00, /* Pedestal Control Reg 1 */
|
||||
0x00, /* Pedestal Control Reg 2 */
|
||||
0x00, /* Pedestal Control Reg 3 */
|
||||
0x00, /* CGMS_WSS Reg 0 */
|
||||
0x00, /* CGMS_WSS Reg 0 */
|
||||
0x00, /* CGMS_WSS Reg 0 */
|
||||
0x00 /* Teletext Req. Control Reg */
|
||||
} ;
|
||||
@@ -2,6 +2,9 @@
|
||||
* (C) Copyright 2001
|
||||
* Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
|
||||
*
|
||||
* Modified during 2003 by
|
||||
* Ken Chou, kchou@ieee.org
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
@@ -86,52 +89,42 @@ Done:
|
||||
/*
|
||||
* Initialize PCI Devices
|
||||
*/
|
||||
#if 1
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
static struct pci_config_table pci_a3000_config_table[] = {
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
0x0, 0x0, 0x0, /* unknown eth0 divice */
|
||||
/* vendor, device, class */
|
||||
/* bus, dev, func */
|
||||
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_83815, PCI_ANY_ID,
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, /* dp83815 eth0 divice */
|
||||
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_IO |
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
0x0, 0x0, 0x0, /* unknown eth1 device */
|
||||
PCI_ANY_ID, 0x14, PCI_ANY_ID, /* PCI slot1 */
|
||||
pci_cfgfunc_config_device, { PCI_ENET1_IOADDR,
|
||||
PCI_ENET1_MEMADDR,
|
||||
PCI_COMMAND_IO |
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
0x0, 0x0, 0x0, /* unknown eth1 device */
|
||||
PCI_ANY_ID, 0x15, PCI_ANY_ID, /* PCI slot2 */
|
||||
pci_cfgfunc_config_device, { PCI_ENET2_IOADDR,
|
||||
PCI_ENET2_MEMADDR,
|
||||
PCI_COMMAND_IO |
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_ANY_ID, 0x16, PCI_ANY_ID, /* PCI slot3 */
|
||||
pci_cfgfunc_config_device, { PCI_ENET3_IOADDR,
|
||||
PCI_ENET3_MEMADDR,
|
||||
PCI_COMMAND_IO |
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER }},
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
static struct pci_config_table pci_a3000_config_table[] = {
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0f, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x10, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET1_IOADDR,
|
||||
PCI_ENET1_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
struct pci_controller hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table: pci_a3000_config_table,
|
||||
|
||||
40
board/adderII/Makefile
Normal file
40
board/adderII/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (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 $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
189
board/adderII/adderII.c
Normal file
189
board/adderII/adderII.c
Normal file
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* (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);
|
||||
}
|
||||
45
board/adderII/adderII.h
Normal file
45
board/adderII/adderII.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* (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
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* FLASH Memory Map as used by FADS Monitor:
|
||||
*
|
||||
* Start Address Length
|
||||
* +-----------------------+ 0xFE00_0000 Start of Flash -----------------
|
||||
* | MON8xx code | 0xFE00_0100 Reset Vector
|
||||
* +-----------------------+ 0xFE0?_????
|
||||
* | (unused) |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +=======================+
|
||||
* | |
|
||||
* | ... |
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
29
board/adderII/config.mk
Normal file
29
board/adderII/config.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#
|
||||
# AdderII board ( Analogue-Micro )
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFE000000
|
||||
|
||||
501
board/adderII/flash.c
Normal file
501
board/adderII/flash.c
Normal file
@@ -0,0 +1,501 @@
|
||||
/*
|
||||
* (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
|
||||
*/
|
||||
/******************************************************************************
|
||||
** Notes: AM29LV320DB - 90EI ( 32 Mbit device )
|
||||
** Sectors - Eight 8 Kb sector
|
||||
** - Sixty three 64 Kb sector
|
||||
** Bottom boot sector
|
||||
******************************************************************************/
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Defines
|
||||
******************************************************************************/
|
||||
#ifdef CONFIG_ADDERII
|
||||
|
||||
#define ADDR0 0x0555
|
||||
#define ADDR1 0x02AA
|
||||
#define FLASH_WORD_SIZE unsigned short
|
||||
|
||||
#endif
|
||||
|
||||
#if defined( CFG_ENV_IS_IN_FLASH )
|
||||
# ifndef CFG_ENV_ADDR
|
||||
# define CFG_ENV_ADDR ( CFG_FLASH_BASE + CFG_ENV_OFFSET )
|
||||
# endif
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
# ifndef CFG_ENV_SECT_SIZE
|
||||
# define CFG_ENV_SECT_SIZE CFG_ENV_SIZE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
** Global Parameters
|
||||
******************************************************************************/
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
/******************************************************************************
|
||||
** Function Prototypes
|
||||
******************************************************************************/
|
||||
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 );
|
||||
|
||||
int wait_for_DQ7( flash_info_t *info, int sect );
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_init
|
||||
** Param : void
|
||||
** Notes : Initializes the Flash Chip
|
||||
******************************************************************************/
|
||||
ulong flash_init (void)
|
||||
{
|
||||
ulong size_b0 = -1;
|
||||
int i;
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
/* Set Flash to unknown */
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Get the Flash Bank Size */
|
||||
|
||||
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 = %ldMB\n",
|
||||
size_b0, size_b0 >> 20);
|
||||
}
|
||||
|
||||
/* Remap Flash according to size detected */
|
||||
memctl->memc_or0 = 0xFF800774;
|
||||
memctl->memc_br0 = CFG_BR0_PRELIM;
|
||||
|
||||
/* Setup Flash Sector Offsets */
|
||||
|
||||
flash_get_offsets (CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
/* Monitor Protection ON - default */
|
||||
|
||||
#if ( CFG_MONITOR_BASE >= CFG_FLASH_BASE )
|
||||
flash_protect (FLAG_PROTECT_SET, CFG_MONITOR_BASE,
|
||||
(CFG_MONITOR_BASE + monitor_flash_len - 1),
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
/* Protect Environment Variables */
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
flash_protect (FLAG_PROTECT_SET, CFG_ENV_ADDR,
|
||||
(CFG_ENV_ADDR + CFG_ENV_SIZE - 1), &flash_info[0]);
|
||||
#endif
|
||||
|
||||
return size_b0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_get_offsets
|
||||
** Param : ulong base, flash_into_t *info
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_print_info
|
||||
** Param : flash_info_t
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Missing or unknown flash type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD:
|
||||
printf ("AMD ");
|
||||
break;
|
||||
case FLASH_MAN_FUJ:
|
||||
printf ("FUJITSU ");
|
||||
break;
|
||||
case FLASH_MAN_BM:
|
||||
printf ("BRIGHT MICRO ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM320B:
|
||||
printf ("AM29LV320B (32 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM320T:
|
||||
printf ("AM29LV320T (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n", info->size >> 20,
|
||||
info->sector_count);
|
||||
printf (" Sector Start Addresses:");
|
||||
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
if ((i % 5) == 0) {
|
||||
printf ("\n ");
|
||||
}
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_get_size
|
||||
** Param : vu_long *addr, flash_info_t *info
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info)
|
||||
{
|
||||
short i;
|
||||
FLASH_WORD_SIZE manu_id, dev_id;
|
||||
ulong base = (ulong) addr;
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *) addr;
|
||||
|
||||
/* Write Auto Select Command and read Manufacturer's ID and Dev ID */
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0xAAAAAAAA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE) 0x55555555;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x90909090;
|
||||
|
||||
manu_id = addr2[0];
|
||||
|
||||
switch (manu_id) {
|
||||
case (FLASH_WORD_SIZE) AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read Device Id */
|
||||
dev_id = addr2[1];
|
||||
|
||||
switch (dev_id) {
|
||||
case (FLASH_WORD_SIZE) AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 71; /* 8 - boot sec + 63 normal */
|
||||
info->size = 0x400000; /* 4MByte */
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set up sector start Addresses */
|
||||
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block
|
||||
** Eight 8 Kb Boot sectors
|
||||
** Sixty Three 64Kb sectors
|
||||
*/
|
||||
for (i = 0; i < 8; i++) {
|
||||
info->start[i] = base + (i * 0x00002000);
|
||||
}
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00070000;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset To read mode */
|
||||
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr = (ulong *) info->start[0];
|
||||
*addr = 0xF0F0F0F0;
|
||||
}
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** Function : flash_erase
|
||||
** Param : flash_info_t *info, int s_first, int s_last
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *addr2;
|
||||
int flag, prot, sect, l_sect;
|
||||
int i;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
l_sect = -1;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) ==
|
||||
FLASH_MAN_SST) {
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE) 0x00500050; /* block erase */
|
||||
for (i = 0; i < 50; i++)
|
||||
udelay (1000); /* wait 1 ms */
|
||||
} else {
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE) 0x00300030; /* sector erase */
|
||||
}
|
||||
l_sect = sect;
|
||||
/*
|
||||
* Wait for each sector to complete, it's more
|
||||
* reliable. According to AMD Spec, you must
|
||||
* issue all erase commands within a specified
|
||||
* timeout. This has been seen to fail, especially
|
||||
* if printf()s are included (for debug)!!
|
||||
*/
|
||||
wait_for_DQ7 (info, sect);
|
||||
}
|
||||
}
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/* reset to read mode */
|
||||
addr = (FLASH_WORD_SIZE *) info->start[0];
|
||||
addr[0] = (FLASH_WORD_SIZE) 0x00F000F0; /* reset bank */
|
||||
|
||||
printf (" done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wait_for_DQ7 (flash_info_t * info, int sect)
|
||||
{
|
||||
ulong start, now, last;
|
||||
volatile FLASH_WORD_SIZE *addr =
|
||||
(FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
|
||||
(FLASH_WORD_SIZE) 0x00800080) {
|
||||
if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return -1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) {
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Function : write_buff
|
||||
** Param : flash_info_t *info, uchar *src, ulong addr, ulong cnt
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
int i, l, rc;
|
||||
|
||||
/* get lower word aligned address */
|
||||
wp = (addr & ~3);
|
||||
|
||||
/*
|
||||
* 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));
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Function : write_word
|
||||
** Param : flash_info_t *info, ulong dest, ulong data
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
static int write_word (flash_info_t * info, ulong dest, ulong data)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr2 =
|
||||
(FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *) dest;
|
||||
volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *) & data;
|
||||
ulong start;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile FLASH_WORD_SIZE *) dest) &
|
||||
(FLASH_WORD_SIZE) data) != (FLASH_WORD_SIZE) data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4 / sizeof (FLASH_WORD_SIZE); i++) {
|
||||
int flag;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00A000A0;
|
||||
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & (FLASH_WORD_SIZE) 0x00800080) !=
|
||||
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
147
board/adderII/u-boot.lds
Normal file
147
board/adderII/u-boot.lds
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
/*
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
. = env_offset;
|
||||
common/environment.o(.text)
|
||||
*/
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
. = ALIGN(256 * 1024);
|
||||
.ppcenv :
|
||||
{
|
||||
common/environment.o (.ppcenv)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
#include <devices.h>
|
||||
#include <syscall.h>
|
||||
#include <net.h>
|
||||
#include <version.h>
|
||||
#include <dtt.h>
|
||||
|
||||
46
board/dave/PPChameleonEVB/Makefile
Normal file
46
board/dave/PPChameleonEVB/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
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
|
||||
|
||||
#########################################################################
|
||||
270
board/dave/PPChameleonEVB/PPChameleonEVB.c
Normal file
270
board/dave/PPChameleonEVB/PPChameleonEVB.c
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if 0
|
||||
#define FPGA_DEBUG
|
||||
#endif
|
||||
|
||||
/* fpga configuration data - gzip compressed and generated by bin2c */
|
||||
const unsigned char fpgadata[] =
|
||||
{
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
|
||||
/*
|
||||
* include common fpga code (for esd boards)
|
||||
*/
|
||||
#include "../common/fpga.c"
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
int gunzip(void *, int, unsigned char *, int *);
|
||||
|
||||
|
||||
int board_pre_init (void)
|
||||
{
|
||||
out32(GPIO0_OR, CFG_NAND0_CE); /* set initial outputs */
|
||||
out32(GPIO0_OR, CFG_NAND1_CE); /* set initial outputs */
|
||||
|
||||
/*
|
||||
* IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
* IRQ 16 405GP internally generated; active low; level sensitive
|
||||
* IRQ 17-24 RESERVED
|
||||
* IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
|
||||
* IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
|
||||
* IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
|
||||
* IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
|
||||
* IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
|
||||
* IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
|
||||
* IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
|
||||
*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFF81); /* set int polarities */
|
||||
mtdcr(uictr, 0x10000000); /* set int trigger levels */
|
||||
mtdcr(uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
/*
|
||||
* EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
|
||||
*/
|
||||
#if 1 /* test-only */
|
||||
mtebc (epcr, 0xa8400000); /* ebc always driven */
|
||||
#else
|
||||
mtebc (epcr, 0x28400000); /* ebc in high-z */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int misc_init_f (void)
|
||||
{
|
||||
return 0; /* dummy implementation */
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
#if 0 /* test-only */
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#if 0
|
||||
volatile unsigned short *fpga_mode =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
|
||||
volatile unsigned char *duart0_mcr =
|
||||
(unsigned char *)((ulong)DUART0_BA + 4);
|
||||
volatile unsigned char *duart1_mcr =
|
||||
(unsigned char *)((ulong)DUART1_BA + 4);
|
||||
|
||||
bd_t *bd = gd->bd;
|
||||
char * tmp; /* Temporary char pointer */
|
||||
unsigned char *dst;
|
||||
ulong len = sizeof(fpgadata);
|
||||
int status;
|
||||
int index;
|
||||
int i;
|
||||
unsigned long cntrl0Reg;
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, (int *)&len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
status = fpga_boot(dst, len);
|
||||
if (status != 0) {
|
||||
printf("\nFPGA: Booting failed ");
|
||||
switch (status) {
|
||||
case ERROR_FPGA_PRG_INIT_LOW:
|
||||
printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_INIT_HIGH:
|
||||
printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_DONE:
|
||||
printf("(Timeout: DONE not high after programming FPGA)\n ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("FPGA: %s\n", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
/* delayed reboot */
|
||||
for (i=20; i>0; i--) {
|
||||
printf("Rebooting in %2d seconds \r",i);
|
||||
for (index=0;index<1000;index++)
|
||||
udelay(1000);
|
||||
}
|
||||
putc ('\n');
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
puts("FPGA: ");
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("%s ", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
|
||||
free(dst);
|
||||
|
||||
/*
|
||||
* Reset FPGA via FPGA_DATA pin
|
||||
*/
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK);
|
||||
udelay(1000); /* wait 1ms */
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Enable power on PS/2 interface
|
||||
*/
|
||||
*fpga_mode |= CFG_FPGA_CTRL_PS2_RESET;
|
||||
|
||||
/*
|
||||
* Enable interrupts in exar duart mcr[3]
|
||||
*/
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
unsigned char str[64];
|
||||
int i = getenv_r ("serial#", str, sizeof(str));
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming PPChameleonEVB");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
putc ('\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
#if 0 /* test-only */
|
||||
for (;;) {
|
||||
NAND_DISABLE_CE(1);
|
||||
udelay(100);
|
||||
NAND_ENABLE_CE(1);
|
||||
udelay(100);
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
printf("\nmb0cf=%x\n", val); /* test-only */
|
||||
printf("strap=%x\n", mfdcr(strap)); /* test-only */
|
||||
#endif
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("test: 16 MB - ok\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
|
||||
extern void
|
||||
nand_probe(ulong physadr);
|
||||
|
||||
void
|
||||
nand_init(void)
|
||||
{
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND0_BASE);
|
||||
nand_probe (CFG_NAND0_BASE);
|
||||
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND1_BASE);
|
||||
nand_probe (CFG_NAND1_BASE);
|
||||
}
|
||||
#endif
|
||||
24
board/dave/PPChameleonEVB/config.mk
Normal file
24
board/dave/PPChameleonEVB/config.mk
Normal file
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
105
board/dave/PPChameleonEVB/flash.c
Normal file
105
board/dave/PPChameleonEVB/flash.c
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
/*
|
||||
* include common flash code (for esd boards)
|
||||
*/
|
||||
#include "../common/flash.c"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
#ifdef __DEBUG_START_FROM_SRAM__
|
||||
return CFG_DUMMY_FLASH_SIZE;
|
||||
#else
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
|
||||
size_b0 = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0<<20);
|
||||
}
|
||||
|
||||
/* Setup offsets */
|
||||
flash_get_offsets (-size_b0, &flash_info[0]);
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b0 = -size_b0;
|
||||
switch (size_b0) {
|
||||
case 1 << 20:
|
||||
size_val = 0;
|
||||
break;
|
||||
case 2 << 20:
|
||||
size_val = 1;
|
||||
break;
|
||||
case 4 << 20:
|
||||
size_val = 2;
|
||||
break;
|
||||
case 8 << 20:
|
||||
size_val = 3;
|
||||
break;
|
||||
case 16 << 20:
|
||||
size_val = 4;
|
||||
break;
|
||||
}
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (size_val << 17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
|
||||
return (size_b0);
|
||||
#endif
|
||||
}
|
||||
1139
board/dave/PPChameleonEVB/fpgadata.c
Normal file
1139
board/dave/PPChameleonEVB/fpgadata.c
Normal file
File diff suppressed because it is too large
Load Diff
147
board/dave/PPChameleonEVB/u-boot.lds
Normal file
147
board/dave/PPChameleonEVB/u-boot.lds
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
cpu/ppc4xx/traps.o (.text)
|
||||
cpu/ppc4xx/interrupts.o (.text)
|
||||
cpu/ppc4xx/serial.o (.text)
|
||||
cpu/ppc4xx/cpu_init.o (.text)
|
||||
cpu/ppc4xx/speed.o (.text)
|
||||
cpu/ppc4xx/405gp_enet.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* . = env_offset;*/
|
||||
/* common/environment.o(.text)*/
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.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 = .);
|
||||
}
|
||||
681
board/dave/common/flash.c
Normal file
681
board/dave/common/flash.c
Normal file
@@ -0,0 +1,681 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
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);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
short n;
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM640U)) {
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324B)) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
for (i=0; i<8; ++i) { /* 8 x 8k boot sectors */
|
||||
info->start[i] = base;
|
||||
base += 8 << 10;
|
||||
}
|
||||
while (i < info->sector_count) { /* 64k regular sectors */
|
||||
info->start[i] = base;
|
||||
base += 64 << 10;
|
||||
++i;
|
||||
}
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324T)) {
|
||||
/* set sector offsets for top boot block type */
|
||||
base += info->size;
|
||||
i = info->sector_count;
|
||||
for (n=0; n<8; ++n) { /* 8 x 8k boot sectors */
|
||||
base -= 8 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
while (i > 0) { /* 64k regular sectors */
|
||||
base -= 64 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00004000;
|
||||
info->start[2] = base + 0x00006000;
|
||||
info->start[3] = base + 0x00008000;
|
||||
for (i = 4; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00030000;
|
||||
}
|
||||
} else {
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00004000;
|
||||
info->start[i--] = base + info->size - 0x00006000;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00010000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int size;
|
||||
int erased;
|
||||
volatile unsigned long *flash;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
case FLASH_MAN_SST: printf ("SST "); break;
|
||||
case FLASH_MAN_STM: printf ("ST "); 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_AM320T: printf ("AM29LV320T (32 M, top sector)\n");
|
||||
break;
|
||||
case FLASH_AM320B: printf ("AM29LV320B (32 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_AMDL322T: printf ("AM29DL322T (32 M, top sector)\n");
|
||||
break;
|
||||
case FLASH_AMDL322B: printf ("AM29DL322B (32 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_AMDL323T: printf ("AM29DL323T (32 M, top sector)\n");
|
||||
break;
|
||||
case FLASH_AMDL323B: printf ("AM29DL323B (32 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_AM640U: printf ("AM29LV640D (64 M, uniform sector)\n");
|
||||
break;
|
||||
case FLASH_SST800A: printf ("SST39LF/VF800 (8 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST160A: printf ("SST39LF/VF160 (16 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_STMW320DT: printf ("M29W320DT (32 M, top sector)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
#ifdef CFG_FLASH_EMPTY_INFO
|
||||
/*
|
||||
* Check if whole sector is erased
|
||||
*/
|
||||
if (i != (info->sector_count-1))
|
||||
size = info->start[i+1] - info->start[i];
|
||||
else
|
||||
size = info->start[0] + info->size - info->start[i];
|
||||
erased = 1;
|
||||
flash = (volatile unsigned long *)info->start[i];
|
||||
size = size >> 2; /* divide by 4 for longword access */
|
||||
for (k=0; k<size; k++)
|
||||
{
|
||||
if (*flash++ != 0xffffffff)
|
||||
{
|
||||
erased = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
/* print empty and read-only info */
|
||||
printf (" %08lX%s%s",
|
||||
info->start[i],
|
||||
erased ? " E" : " ",
|
||||
info->protect[i] ? "RO " : " ");
|
||||
#else
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
#endif
|
||||
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
short n;
|
||||
CFG_FLASH_WORD_SIZE value;
|
||||
ulong base = (ulong)addr;
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00900090;
|
||||
|
||||
value = addr2[CFG_FLASH_READ0];
|
||||
|
||||
switch (value) {
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
case (CFG_FLASH_WORD_SIZE)FUJ_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_FUJ;
|
||||
break;
|
||||
case (CFG_FLASH_WORD_SIZE)SST_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_SST;
|
||||
break;
|
||||
case (CFG_FLASH_WORD_SIZE)STM_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_STM;
|
||||
break;
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr2[CFG_FLASH_READ1]; /* device ID */
|
||||
|
||||
switch (value) {
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV400T:
|
||||
info->flash_id += FLASH_AM400T;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 0.5 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV400B:
|
||||
info->flash_id += FLASH_AM400B;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 0.5 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV800T:
|
||||
info->flash_id += FLASH_AM800T;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV800B:
|
||||
info->flash_id += FLASH_AM800B;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV160T:
|
||||
info->flash_id += FLASH_AM160T;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV160B:
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)STM_ID_29W320DT:
|
||||
info->flash_id += FLASH_STMW320DT;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320T:
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL322T:
|
||||
info->flash_id += FLASH_AMDL322T;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL322B:
|
||||
info->flash_id += FLASH_AMDL322B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL323T:
|
||||
info->flash_id += FLASH_AMDL323T;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_DL323B:
|
||||
info->flash_id += FLASH_AMDL323B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000; break; /* => 4 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)AMD_ID_LV640U:
|
||||
info->flash_id += FLASH_AM640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000; break; /* => 8 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)SST_ID_xF800A:
|
||||
info->flash_id += FLASH_SST800A;
|
||||
info->sector_count = 16;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (CFG_FLASH_WORD_SIZE)SST_ID_xF160A:
|
||||
info->flash_id += FLASH_SST160A;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM640U)) {
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324B)) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
for (i=0; i<8; ++i) { /* 8 x 8k boot sectors */
|
||||
info->start[i] = base;
|
||||
base += 8 << 10;
|
||||
}
|
||||
while (i < info->sector_count) { /* 64k regular sectors */
|
||||
info->start[i] = base;
|
||||
base += 64 << 10;
|
||||
++i;
|
||||
}
|
||||
} else if (((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL322T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL323T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AM320T) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_AMDL324T)) {
|
||||
/* set sector offsets for top boot block type */
|
||||
base += info->size;
|
||||
i = info->sector_count;
|
||||
for (n=0; n<8; ++n) { /* 8 x 8k boot sectors */
|
||||
base -= 8 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
while (i > 0) { /* 64k regular sectors */
|
||||
base -= 64 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
} else if ((info->flash_id & FLASH_TYPEMASK) == FLASH_STMW320DT) {
|
||||
/* set sector offsets for top boot block type */
|
||||
base += info->size;
|
||||
i = info->sector_count;
|
||||
/* 1 x 16k boot sector */
|
||||
base -= 16 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
/* 2 x 8k boot sectors */
|
||||
for (n=0; n<2; ++n) {
|
||||
base -= 8 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
/* 1 x 32k boot sector */
|
||||
base -= 32 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
|
||||
while (i > 0) { /* 64k regular sectors */
|
||||
base -= 64 << 10;
|
||||
--i;
|
||||
info->start[i] = base;
|
||||
}
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00004000;
|
||||
info->start[2] = base + 0x00006000;
|
||||
info->start[3] = base + 0x00008000;
|
||||
for (i = 4; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00030000;
|
||||
}
|
||||
} else {
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00004000;
|
||||
info->start[i--] = base + info->size - 0x00006000;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00010000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
addr2 = (volatile CFG_FLASH_WORD_SIZE *)(info->start[i]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)
|
||||
info->protect[i] = 0;
|
||||
else
|
||||
info->protect[i] = addr2[CFG_FLASH_READ2] & 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr2 = (CFG_FLASH_WORD_SIZE *)info->start[0];
|
||||
*addr2 = (CFG_FLASH_WORD_SIZE)0x00F000F0; /* reset bank */
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
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 flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
int i;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
l_sect = -1;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (CFG_FLASH_WORD_SIZE *)(info->start[sect]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) {
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00800080;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[0] = (CFG_FLASH_WORD_SIZE)0x00500050; /* block erase */
|
||||
for (i=0; i<50; i++)
|
||||
udelay(1000); /* wait 1 ms */
|
||||
} else {
|
||||
if (sect == s_first) {
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00800080;
|
||||
addr[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
}
|
||||
addr2[0] = (CFG_FLASH_WORD_SIZE)0x00300030; /* sector erase */
|
||||
}
|
||||
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 = (CFG_FLASH_WORD_SIZE *)(info->start[l_sect]);
|
||||
while ((addr[0] & (CFG_FLASH_WORD_SIZE)0x00800080) != (CFG_FLASH_WORD_SIZE)0x00800080) {
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return 1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
addr = (CFG_FLASH_WORD_SIZE *)info->start[0];
|
||||
addr[0] = (CFG_FLASH_WORD_SIZE)0x00F000F0; /* reset bank */
|
||||
|
||||
printf (" done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
int i, l, rc;
|
||||
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
for (; i<4 && cnt>0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 4) {
|
||||
data = 0;
|
||||
for (i=0; i<4; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i<4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data)
|
||||
{
|
||||
volatile CFG_FLASH_WORD_SIZE *addr2 = (CFG_FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile CFG_FLASH_WORD_SIZE *dest2 = (CFG_FLASH_WORD_SIZE *)dest;
|
||||
volatile CFG_FLASH_WORD_SIZE *data2 = (CFG_FLASH_WORD_SIZE *)&data;
|
||||
ulong start;
|
||||
int flag;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile CFG_FLASH_WORD_SIZE *)dest) &
|
||||
(CFG_FLASH_WORD_SIZE)data) != (CFG_FLASH_WORD_SIZE)data) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
for (i=0; i<4/sizeof(CFG_FLASH_WORD_SIZE); i++)
|
||||
{
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[CFG_FLASH_ADDR1] = (CFG_FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[CFG_FLASH_ADDR0] = (CFG_FLASH_WORD_SIZE)0x00A000A0;
|
||||
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & (CFG_FLASH_WORD_SIZE)0x00800080) !=
|
||||
(data2[i] & (CFG_FLASH_WORD_SIZE)0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
256
board/dave/common/fpga.c
Normal file
256
board/dave/common/fpga.c
Normal file
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Matthias Fuchs, esd gmbh germany, matthias.fuchs@esd-electronics.com
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef FPGA_DEBUG
|
||||
#define DBG(x...) printf(x)
|
||||
#else
|
||||
#define DBG(x...)
|
||||
#endif /* DEBUG */
|
||||
|
||||
#define MAX_ONES 226
|
||||
|
||||
#ifdef CFG_FPGA_PRG
|
||||
# define FPGA_PRG CFG_FPGA_PRG /* FPGA program pin (ppc output)*/
|
||||
# define FPGA_CLK CFG_FPGA_CLK /* FPGA clk pin (ppc output) */
|
||||
# define FPGA_DATA CFG_FPGA_DATA /* FPGA data pin (ppc output) */
|
||||
# define FPGA_DONE CFG_FPGA_DONE /* FPGA done pin (ppc input) */
|
||||
# define FPGA_INIT CFG_FPGA_INIT /* FPGA init pin (ppc input) */
|
||||
#else
|
||||
# define FPGA_PRG 0x04000000 /* FPGA program pin (ppc output) */
|
||||
# define FPGA_CLK 0x02000000 /* FPGA clk pin (ppc output) */
|
||||
# define FPGA_DATA 0x01000000 /* FPGA data pin (ppc output) */
|
||||
# define FPGA_DONE 0x00800000 /* FPGA done pin (ppc input) */
|
||||
# define FPGA_INIT 0x00400000 /* FPGA init pin (ppc input) */
|
||||
#endif
|
||||
|
||||
#define ERROR_FPGA_PRG_INIT_LOW -1 /* Timeout after PRG* asserted */
|
||||
#define ERROR_FPGA_PRG_INIT_HIGH -2 /* Timeout after PRG* deasserted */
|
||||
#define ERROR_FPGA_PRG_DONE -3 /* Timeout after programming */
|
||||
|
||||
#define SET_FPGA(data) out32(GPIO0_OR, data)
|
||||
|
||||
#define FPGA_WRITE_1 { \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set clock to 0 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set data to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA); /* set clock to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);} /* set data to 1 */
|
||||
|
||||
#define FPGA_WRITE_0 { \
|
||||
SET_FPGA(FPGA_PRG | FPGA_DATA); /* set clock to 0 */ \
|
||||
SET_FPGA(FPGA_PRG); /* set data to 0 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK); /* set clock to 1 */ \
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);} /* set data to 1 */
|
||||
|
||||
#if 0
|
||||
static int fpga_boot (unsigned char *fpgadata, int size)
|
||||
{
|
||||
int i, index, len;
|
||||
int count;
|
||||
|
||||
#ifdef CFG_FPGA_SPARTAN2
|
||||
int j;
|
||||
#else
|
||||
unsigned char b;
|
||||
int bit;
|
||||
#endif
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i = 0; i < 4; i++) {
|
||||
len = fpgadata[index];
|
||||
DBG ("FPGA: %s\n", &(fpgadata[index + 1]));
|
||||
index += len + 3;
|
||||
}
|
||||
|
||||
#ifdef CFG_FPGA_SPARTAN2
|
||||
/* search for preamble 0xFFFFFFFF */
|
||||
while (1) {
|
||||
if ((fpgadata[index] == 0xff) && (fpgadata[index + 1] == 0xff)
|
||||
&& (fpgadata[index + 2] == 0xff)
|
||||
&& (fpgadata[index + 3] == 0xff))
|
||||
break; /* preamble found */
|
||||
else
|
||||
index++;
|
||||
}
|
||||
#else
|
||||
/* search for preamble 0xFF2X */
|
||||
for (index = 0; index < size - 1; index++) {
|
||||
if ((fpgadata[index] == 0xff)
|
||||
&& ((fpgadata[index + 1] & 0xf0) == 0x30))
|
||||
break;
|
||||
}
|
||||
index += 2;
|
||||
#endif
|
||||
|
||||
DBG ("FPGA: configdata starts at position 0x%x\n", index);
|
||||
DBG ("FPGA: length of fpga-data %d\n", size - index);
|
||||
|
||||
/*
|
||||
* Setup port pins for fpga programming
|
||||
*/
|
||||
out32 (GPIO0_ODR, 0x00000000); /* no open drain pins */
|
||||
out32 (GPIO0_TCR, in32 (GPIO0_TCR) | FPGA_PRG | FPGA_CLK | FPGA_DATA); /* setup for output */
|
||||
out32 (GPIO0_OR, in32 (GPIO0_OR) | FPGA_PRG | FPGA_CLK | FPGA_DATA); /* set pins to high */
|
||||
|
||||
DBG ("%s, ",
|
||||
((in32 (GPIO0_IR) & FPGA_DONE) == 0) ? "NOT DONE" : "DONE");
|
||||
DBG ("%s\n",
|
||||
((in32 (GPIO0_IR) & FPGA_INIT) == 0) ? "NOT INIT" : "INIT");
|
||||
|
||||
/*
|
||||
* Init fpga by asserting and deasserting PROGRAM*
|
||||
*/
|
||||
SET_FPGA (FPGA_CLK | FPGA_DATA);
|
||||
|
||||
/* Wait for FPGA init line low */
|
||||
count = 0;
|
||||
while (in32 (GPIO0_IR) & FPGA_INIT) {
|
||||
udelay (1000); /* wait 1ms */
|
||||
/* Check for timeout - 100us max, so use 3ms */
|
||||
if (count++ > 3) {
|
||||
DBG ("FPGA: Booting failed!\n");
|
||||
return ERROR_FPGA_PRG_INIT_LOW;
|
||||
}
|
||||
}
|
||||
|
||||
DBG ("%s, ",
|
||||
((in32 (GPIO0_IR) & FPGA_DONE) == 0) ? "NOT DONE" : "DONE");
|
||||
DBG ("%s\n",
|
||||
((in32 (GPIO0_IR) & FPGA_INIT) == 0) ? "NOT INIT" : "INIT");
|
||||
|
||||
/* deassert PROGRAM* */
|
||||
SET_FPGA (FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
|
||||
/* Wait for FPGA end of init period . */
|
||||
count = 0;
|
||||
while (!(in32 (GPIO0_IR) & FPGA_INIT)) {
|
||||
udelay (1000); /* wait 1ms */
|
||||
/* Check for timeout */
|
||||
if (count++ > 3) {
|
||||
DBG ("FPGA: Booting failed!\n");
|
||||
return ERROR_FPGA_PRG_INIT_HIGH;
|
||||
}
|
||||
}
|
||||
|
||||
DBG ("%s, ",
|
||||
((in32 (GPIO0_IR) & FPGA_DONE) == 0) ? "NOT DONE" : "DONE");
|
||||
DBG ("%s\n",
|
||||
((in32 (GPIO0_IR) & FPGA_INIT) == 0) ? "NOT INIT" : "INIT");
|
||||
|
||||
DBG ("write configuration data into fpga\n");
|
||||
/* write configuration-data into fpga... */
|
||||
|
||||
#ifdef CFG_FPGA_SPARTAN2
|
||||
/*
|
||||
* Load uncompressed image into fpga
|
||||
*/
|
||||
for (i = index; i < size; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if ((fpgadata[i] & 0x80) == 0x80) {
|
||||
FPGA_WRITE_1;
|
||||
} else {
|
||||
FPGA_WRITE_0;
|
||||
}
|
||||
fpgadata[i] <<= 1;
|
||||
}
|
||||
}
|
||||
#else /* ! CFG_FPGA_SPARTAN2 */
|
||||
/* send 0xff 0x20 */
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_0;
|
||||
FPGA_WRITE_0;
|
||||
FPGA_WRITE_1;
|
||||
FPGA_WRITE_0;
|
||||
FPGA_WRITE_0;
|
||||
FPGA_WRITE_0;
|
||||
FPGA_WRITE_0;
|
||||
FPGA_WRITE_0;
|
||||
|
||||
/*
|
||||
** Bit_DeCompression
|
||||
** Code 1 .. maxOnes : n '1's followed by '0'
|
||||
** maxOnes + 1 .. maxOnes + 1 : n - 1 '1's no '0'
|
||||
** maxOnes + 2 .. 254 : n - (maxOnes + 2) '0's followed by '1'
|
||||
** 255 : '1'
|
||||
*/
|
||||
|
||||
for (i = index; i < size; i++) {
|
||||
b = fpgadata[i];
|
||||
if ((b >= 1) && (b <= MAX_ONES)) {
|
||||
for (bit = 0; bit < b; bit++) {
|
||||
FPGA_WRITE_1;
|
||||
}
|
||||
FPGA_WRITE_0;
|
||||
} else if (b == (MAX_ONES + 1)) {
|
||||
for (bit = 1; bit < b; bit++) {
|
||||
FPGA_WRITE_1;
|
||||
}
|
||||
} else if ((b >= (MAX_ONES + 2)) && (b <= 254)) {
|
||||
for (bit = 0; bit < (b - (MAX_ONES + 2)); bit++) {
|
||||
FPGA_WRITE_0;
|
||||
}
|
||||
FPGA_WRITE_1;
|
||||
} else if (b == 255) {
|
||||
FPGA_WRITE_1;
|
||||
}
|
||||
}
|
||||
#endif /* CFG_FPGA_SPARTAN2 */
|
||||
|
||||
DBG ("%s, ",
|
||||
((in32 (GPIO0_IR) & FPGA_DONE) == 0) ? "NOT DONE" : "DONE");
|
||||
DBG ("%s\n",
|
||||
((in32 (GPIO0_IR) & FPGA_INIT) == 0) ? "NOT INIT" : "INIT");
|
||||
|
||||
/*
|
||||
* Check if fpga's DONE signal - correctly booted ?
|
||||
*/
|
||||
|
||||
/* Wait for FPGA end of programming period . */
|
||||
count = 0;
|
||||
while (!(in32 (GPIO0_IR) & FPGA_DONE)) {
|
||||
udelay (1000); /* wait 1ms */
|
||||
/* Check for timeout */
|
||||
if (count++ > 3) {
|
||||
DBG ("FPGA: Booting failed!\n");
|
||||
return ERROR_FPGA_PRG_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
DBG ("FPGA: Booting successful!\n");
|
||||
return 0;
|
||||
}
|
||||
#endif /* 0 */
|
||||
202
board/dave/common/pci.c
Normal file
202
board/dave/common/pci.c
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
#include <pci.h>
|
||||
|
||||
|
||||
u_long pci9054_iobase;
|
||||
|
||||
|
||||
#define PCI_PRIMARY_CAR (0x500000dc) /* PCI config address reg */
|
||||
#define PCI_PRIMARY_CDR (0x80000000) /* PCI config data reg */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Subroutine: pci9054_read_config_dword
|
||||
| Description: Read a PCI configuration register
|
||||
| Inputs:
|
||||
| hose PCI Controller
|
||||
| dev PCI Bus+Device+Function number
|
||||
| offset Configuration register number
|
||||
| value Address of the configuration register value
|
||||
| Return value:
|
||||
| 0 Successful
|
||||
+-----------------------------------------------------------------------------*/
|
||||
int pci9054_read_config_dword(struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset, u32* value)
|
||||
{
|
||||
unsigned long conAdrVal;
|
||||
unsigned long val;
|
||||
|
||||
/* generate coded value for CON_ADR register */
|
||||
conAdrVal = dev | (offset & 0xfc) | 0x80000000;
|
||||
|
||||
/* Load the CON_ADR (CAR) value first, then read from CON_DATA (CDR) */
|
||||
*(unsigned long *)PCI_PRIMARY_CAR = conAdrVal;
|
||||
|
||||
/* Note: *pResult comes back as -1 if machine check happened */
|
||||
val = in32r(PCI_PRIMARY_CDR);
|
||||
|
||||
*value = (unsigned long) val;
|
||||
|
||||
out32r(PCI_PRIMARY_CAR, 0);
|
||||
|
||||
if ((*(unsigned long *)0x50000304) & 0x60000000)
|
||||
{
|
||||
/* clear pci master/target abort bits */
|
||||
*(unsigned long *)0x50000304 = *(unsigned long *)0x50000304;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Subroutine: pci9054_write_config_dword
|
||||
| Description: Write a PCI configuration register.
|
||||
| Inputs:
|
||||
| hose PCI Controller
|
||||
| dev PCI Bus+Device+Function number
|
||||
| offset Configuration register number
|
||||
| Value Configuration register value
|
||||
| Return value:
|
||||
| 0 Successful
|
||||
| Updated for pass2 errata #6. Need to disable interrupts and clear the
|
||||
| PCICFGADR reg after writing the PCICFGDATA reg.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
int pci9054_write_config_dword(struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset, u32 value)
|
||||
{
|
||||
unsigned long conAdrVal;
|
||||
|
||||
conAdrVal = dev | (offset & 0xfc) | 0x80000000;
|
||||
|
||||
*(unsigned long *)PCI_PRIMARY_CAR = conAdrVal;
|
||||
|
||||
out32r(PCI_PRIMARY_CDR, value);
|
||||
|
||||
out32r(PCI_PRIMARY_CAR, 0);
|
||||
|
||||
/* clear pci master/target abort bits */
|
||||
*(unsigned long *)0x50000304 = *(unsigned long *)0x50000304;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DASA_SIM
|
||||
static void pci_dasa_sim_config_pci9054(struct pci_controller *hose, pci_dev_t dev,
|
||||
struct pci_config_table *_)
|
||||
{
|
||||
unsigned int iobase;
|
||||
unsigned short status = 0;
|
||||
unsigned char timer;
|
||||
|
||||
/*
|
||||
* Configure PLX PCI9054
|
||||
*/
|
||||
pci_read_config_word(CFG_PCI9054_DEV_FN, PCI_COMMAND, &status);
|
||||
status |= PCI_COMMAND_MASTER | PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
|
||||
pci_write_config_word(CFG_PCI9054_DEV_FN, PCI_COMMAND, status);
|
||||
|
||||
/* Check the latency timer for values >= 0x60.
|
||||
*/
|
||||
pci_read_config_byte(CFG_PCI9054_DEV_FN, PCI_LATENCY_TIMER, &timer);
|
||||
if (timer < 0x60)
|
||||
{
|
||||
pci_write_config_byte(CFG_PCI9054_DEV_FN, PCI_LATENCY_TIMER, 0x60);
|
||||
}
|
||||
|
||||
/* Set I/O base register.
|
||||
*/
|
||||
pci_write_config_dword(CFG_PCI9054_DEV_FN, PCI_BASE_ADDRESS_0, CFG_PCI9054_IOBASE);
|
||||
pci_read_config_dword(CFG_PCI9054_DEV_FN, PCI_BASE_ADDRESS_0, &iobase);
|
||||
|
||||
pci9054_iobase = pci_mem_to_phys(CFG_PCI9054_DEV_FN, iobase & PCI_BASE_ADDRESS_MEM_MASK);
|
||||
|
||||
if (pci9054_iobase == 0xffffffff)
|
||||
{
|
||||
printf("Error: Can not set I/O base register.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct pci_config_table pci9054_config_table[] = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_BUS(CFG_ETH_DEV_FN), PCI_DEV(CFG_ETH_DEV_FN), PCI_FUNC(CFG_ETH_DEV_FN),
|
||||
pci_cfgfunc_config_device, { CFG_ETH_IOBASE,
|
||||
CFG_ETH_IOBASE,
|
||||
PCI_COMMAND_IO | PCI_COMMAND_MASTER }},
|
||||
#ifdef CONFIG_DASA_SIM
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_BUS(CFG_PCI9054_DEV_FN), PCI_DEV(CFG_PCI9054_DEV_FN), PCI_FUNC(CFG_PCI9054_DEV_FN),
|
||||
pci_dasa_sim_config_pci9054 },
|
||||
#endif
|
||||
#endif
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct pci_controller pci9054_hose = {
|
||||
config_table: pci9054_config_table,
|
||||
};
|
||||
|
||||
void pci_init(void)
|
||||
{
|
||||
struct pci_controller *hose = &pci9054_hose;
|
||||
|
||||
/*
|
||||
* Register the hose
|
||||
*/
|
||||
hose->first_busno = 0;
|
||||
hose->last_busno = 0xff;
|
||||
|
||||
/* System memory space */
|
||||
pci_set_region(hose->regions + 0,
|
||||
0x00000000, 0x00000000, 0x01000000,
|
||||
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||
|
||||
/* PCI Memory space */
|
||||
pci_set_region(hose->regions + 1,
|
||||
0x00000000, 0xc0000000, 0x10000000,
|
||||
PCI_REGION_MEM);
|
||||
|
||||
pci_set_ops(hose,
|
||||
pci_hose_read_config_byte_via_dword,
|
||||
pci_hose_read_config_word_via_dword,
|
||||
pci9054_read_config_dword,
|
||||
pci_hose_write_config_byte_via_dword,
|
||||
pci_hose_write_config_word_via_dword,
|
||||
pci9054_write_config_dword);
|
||||
|
||||
hose->region_count = 2;
|
||||
|
||||
pci_register_hose(hose);
|
||||
|
||||
hose->last_busno = pci_hose_scan(hose);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ void after_reloc (ulong dest_addr)
|
||||
/*
|
||||
* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r(gd, dest_addr);
|
||||
board_init_r((gd_t *)gd, dest_addr);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -142,7 +142,7 @@ void after_reloc (ulong dest_addr)
|
||||
/*
|
||||
* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r (gd, dest_addr);
|
||||
board_init_r ((gd_t *)gd, dest_addr);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -254,7 +254,7 @@ long int initdram (int board_type)
|
||||
upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS;
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* should this be mamr? - NTL */
|
||||
memctl->memc_mptpr = MPTPR_PTP_DIV64;
|
||||
memctl->memc_mar = 0x00008800;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
0x03,0x07,0x02,0x09,0x04,0x04,0x04,0x04,0x0e,0x04,0x04,0x09,0x03,0x07,0x02,0x04,
|
||||
0x03,0x03,0x03,0x07,0xe5,0x01,0x0d,0x02,0x02,0x03,0x02,0x02,0x03,0x02,0x02,0x03,
|
||||
0x19,0x03,0x02,0x02,0x03,0x02,0x08,0x09,0x07,0x13,0x03,0x11,0x02,0x06,0x03,0x05,
|
||||
0x03,0x05,0x11,0x1d,0x1f,0x13,0x10,0x01,0x01,0xe2,0x4c,0xe5,0x01,0x0a,0x04,0x01,
|
||||
0x03,0x05,0x11,0x1d,0x1f,0x13,0x10,0x01,0x01,0xe3,0x4c,0xe5,0x01,0x0a,0x04,0x01,
|
||||
0xe5,0x05,0x01,0xe5,0x05,0x01,0xe5,0x05,0x09,0x04,0x04,0x02,0x06,0x01,0xe5,0x05,
|
||||
0x01,0x02,0x04,0x04,0x04,0x09,0x09,0x09,0x09,0x04,0x06,0x01,0x07,0x09,0x04,0x04,
|
||||
0x09,0x06,0x02,0x09,0x09,0x04,0x01,0xe7,0x03,0x04,0x07,0xe6,0x08,0x09,0x09,0x0e,
|
||||
@@ -16,7 +16,7 @@
|
||||
0x03,0x05,0xe5,0x07,0xe5,0x01,0x05,0x0b,0xe5,0x07,0xe5,0x07,0x09,0x03,0x05,0xe6,
|
||||
0xe5,0x04,0xe5,0x01,0x05,0xe5,0x01,0x05,0xe5,0xe6,0x04,0x03,0x05,0xe5,0xe6,0x04,
|
||||
0xe5,0x07,0x03,0x05,0xe5,0x07,0x0b,0x01,0x0e,0x05,0x03,0x05,0x03,0x05,0x1d,0x03,
|
||||
0x05,0x03,0x44,0xe5,0xe5,0x2e,0x1c,0x01,0x13,0x32,0x01,0xe2,0x4d,0xe5,0x0f,0x09,
|
||||
0x05,0x03,0x44,0xe5,0xe5,0x2e,0x1c,0x01,0x13,0x32,0x01,0xe3,0x4d,0xe5,0x0f,0x09,
|
||||
0x09,0x27,0x09,0x42,0x04,0x4a,0x44,0x01,0x01,0x01,0x12,0x09,0x09,0x01,0x06,0x01,
|
||||
0x12,0x09,0x0a,0x09,0x11,0x21,0x13,0x11,0x15,0x1d,0x1b,0x0c,0x0d,0x03,0x03,0x01,
|
||||
0x31,0x31,0x47,0x81,0xe5,0xe5,0xe5,0x77,0x3e,0xe5,0x19,0xe5,0x1b,0x3b,0xe5,0xe5,
|
||||
@@ -2727,10 +2727,10 @@
|
||||
0x01,0x03,0x03,0x05,0x03,0x09,0xe5,0x07,0x09,0x09,0x01,0x07,0x09,0x07,0x01,0x09,
|
||||
0x09,0x0d,0x01,0x01,0x04,0x27,0x39,0x25,0x09,0x0b,0x09,0x09,0x02,0xe5,0x0e,0x02,
|
||||
0x07,0x0b,0x1d,0x2e,0xe5,0xe6,0x50,0xe5,0x1b,0x13,0x04,0x04,0x04,0x06,0x04,0x09,
|
||||
0x04,0x04,0x13,0x0e,0x13,0x1d,0x27,0xe7,0x21,0xc6,0x40,0x03,0x03,0x07,0xe2,0x09,
|
||||
0x04,0x04,0x13,0x0e,0x13,0x1d,0x27,0xe7,0x21,0xc6,0x40,0x03,0x03,0x07,0xe3,0x09,
|
||||
0x3a,0x03,0x07,0x29,0x1f,0x25,0x0b,0x3b,0x15,0xe5,0x2d,0x01,0x27,0xe7,0x6e,0x16,
|
||||
0x05,0xe5,0x01,0x05,0x02,0x02,0x05,0x03,0x05,0xe5,0x01,0x05,0x0d,0x05,0x5c,0x06,
|
||||
0x01,0x01,0x05,0x93,0x59,0x34,0x05,0xe5,0x01,0x04,0xe5,0xe2,0x34,0x10,0x02,0xe5,
|
||||
0x01,0x01,0x05,0x93,0x59,0x34,0x05,0xe5,0x01,0x04,0xe5,0xe3,0x34,0x10,0x02,0xe5,
|
||||
0x13,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x0b,0x09,
|
||||
0x09,0x09,0x09,0x09,0x09,0x09,0x09,0xe6,0x06,0x09,0x09,0x09,0x03,0x05,0x0a,0xe5,
|
||||
0xe5,0x04,0x09,0x08,0xe5,0x07,0xe5,0x08,0x08,0xe5,0x07,0xe5,0x07,0xe5,0x07,0xe5,
|
||||
@@ -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,
|
||||
@@ -67,7 +67,7 @@ int board_pre_init (void)
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr(uiccr, 0x00000000); /* set all to be non-critical*/
|
||||
mtdcr(uicpr, 0xFFFFFF81); /* set int polarities */
|
||||
mtdcr(uicpr, 0xFFFFFF9F); /* set int polarities */
|
||||
mtdcr(uictr, 0x10000000); /* set int trigger levels */
|
||||
mtdcr(uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority*/
|
||||
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -225,8 +225,8 @@ int do_pci9054 (cmd_tbl_t * cmdtp, int flag, int argc,
|
||||
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD (pci9054) = MK_CMD_ENTRY(
|
||||
"pci9054", 3, 1, do_pci9054,
|
||||
U_BOOT_CMD(
|
||||
pci9054, 3, 1, do_pci9054,
|
||||
"pci9054 - PLX PCI9054 EEPROM access\n",
|
||||
"pci9054 info - print EEPROM values\n"
|
||||
"pci9054 update - updates EEPROM with default values\n"
|
||||
|
||||
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
OBJS = $(BOARD).o flash.o cmd_ocrtc.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
87
board/esd/ocrtc/cmd_ocrtc.c
Normal file
87
board/esd/ocrtc/cmd_ocrtc.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <pci.h>
|
||||
#include <405gp_pci.h>
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BSP)
|
||||
|
||||
#define IBM_VENDOR_ID 0x1014
|
||||
#define PPC405_DEVICE_ID 0x0156
|
||||
|
||||
|
||||
/*
|
||||
* Set device number on pci board
|
||||
*/
|
||||
int do_setdevice(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
int idx = 1; /* start at 1 (skip device 0) */
|
||||
pci_dev_t bdf = 0;
|
||||
u32 addr;
|
||||
|
||||
while (bdf >= 0) {
|
||||
if ((bdf = pci_find_device(IBM_VENDOR_ID, PPC405_DEVICE_ID, idx++)) < 0) {
|
||||
break;
|
||||
}
|
||||
printf("Found device nr %d at %x!\n", idx-1, bdf);
|
||||
pci_read_config_dword(bdf, PCI_BASE_ADDRESS_1, &addr);
|
||||
addr &= ~0xf;
|
||||
*(u32 *)addr = (bdf & 0x0000f800) >> 11;
|
||||
printf("Wrote %x at %x!\n", (bdf & 0x0000f800) >> 11, addr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
setdevice, 1, 1, do_setdevice,
|
||||
"setdevice - Set device number on pci adapter boards\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Get device number on pci board
|
||||
*/
|
||||
int do_getdevice(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
u32 device;
|
||||
char str[32];
|
||||
|
||||
device = *(u32 *)0x0;
|
||||
device = 0x16 - device; /* calculate vxworks bp slot id */
|
||||
sprintf(str, "%d", device);
|
||||
setenv("slot", str);
|
||||
printf("Variabel slot set to %x\n", device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
getdevice, 1, 1, do_getdevice,
|
||||
"getdevice - Get device number and set slot env variable\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,6 @@ Skeleton NIC driver for Etherboot
|
||||
|
||||
#include <common.h>
|
||||
#include <malloc.h>
|
||||
#include <cmd_bsp.h>
|
||||
#include <galileo/gt64260R.h>
|
||||
#include <galileo/core.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
@@ -237,7 +237,7 @@ int board_pre_init (void)
|
||||
* on-board sram on the eval board, and updates the correct
|
||||
* registers to boot from the sram. (device0)
|
||||
*/
|
||||
#ifdef CONFIG_ZUMA_V2
|
||||
#if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4)
|
||||
/* Zuma has no SRAM */
|
||||
sram_boot = 0;
|
||||
#else
|
||||
@@ -265,6 +265,7 @@ int board_pre_init (void)
|
||||
GT_REG_WRITE(DEVICE_BANK2PARAMETERS, CFG_DEV2_PAR);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EVB64260
|
||||
#ifdef CFG_32BIT_BOOT_PAR
|
||||
/* detect if we are booting from the 32 bit flash */
|
||||
if (GTREGREAD(DEVICE_BOOT_BANK_PARAMETERS) & (0x3 << 20)) {
|
||||
@@ -280,6 +281,11 @@ int board_pre_init (void)
|
||||
/* 8 bit boot flash only */
|
||||
GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CFG_8BIT_BOOT_PAR);
|
||||
#endif
|
||||
#else /* CONFIG_EVB64260 not defined */
|
||||
/* We are booting from 16-bit flash.
|
||||
*/
|
||||
GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CFG_16BIT_BOOT_PAR);
|
||||
#endif
|
||||
|
||||
gt_cpu_config();
|
||||
|
||||
@@ -329,7 +335,7 @@ after_reloc(ulong dest_addr)
|
||||
}
|
||||
|
||||
/* now, jump to the main U-Boot board init code */
|
||||
board_init_r (gd, dest_addr);
|
||||
board_init_r ((gd_t *)gd, dest_addr);
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
@@ -351,7 +357,7 @@ checkboard (void)
|
||||
void
|
||||
debug_led(int led, int mode)
|
||||
{
|
||||
#ifndef CONFIG_ZUMA_V2
|
||||
#if !defined(CONFIG_ZUMA_V2) && !defined(CONFIG_P3G4)
|
||||
volatile int *addr = NULL;
|
||||
int dummy;
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
static ulong flash_get_size (int portwidth, 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);
|
||||
static flash_info_t *flash_get_info(ulong base);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -72,7 +73,11 @@ flash_init (void)
|
||||
|
||||
/* the boot flash */
|
||||
base = CFG_FLASH_BASE;
|
||||
size_b0 = flash_get_size(1, (vu_long *)base, &flash_info[0]);
|
||||
#ifndef CFG_BOOT_FLASH_WIDTH
|
||||
#define CFG_BOOT_FLASH_WIDTH 1
|
||||
#endif
|
||||
size_b0 = flash_get_size(CFG_BOOT_FLASH_WIDTH, (vu_long *)base,
|
||||
&flash_info[0]);
|
||||
|
||||
printf("[%ldkB@%lx] ", size_b0/1024, base);
|
||||
|
||||
@@ -98,6 +103,22 @@ flash_init (void)
|
||||
base+=size;
|
||||
}
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
flash_get_info(CFG_MONITOR_BASE));
|
||||
#endif
|
||||
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
/* ENV protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
flash_get_info(CFG_ENV_ADDR));
|
||||
#endif
|
||||
|
||||
flash_size = size_b0 + size_b1;
|
||||
return flash_size;
|
||||
}
|
||||
@@ -146,6 +167,23 @@ flash_get_offsets (ulong base, flash_info_t *info)
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static flash_info_t *flash_get_info(ulong base)
|
||||
{
|
||||
int i;
|
||||
flash_info_t * info;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i ++) {
|
||||
info = & flash_info[i];
|
||||
if (info->start[0] <= base && base <= info->start[0] + info->size - 1)
|
||||
break;
|
||||
}
|
||||
|
||||
return i == CFG_MAX_FLASH_BANKS ? 0 : info;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
@@ -247,8 +285,11 @@ static inline void flash_cmd(int width, volatile unsigned char *addr, int offset
|
||||
/* 2x16 */
|
||||
unsigned long cmd32=(cmd<<16)|cmd;
|
||||
*(volatile unsigned long *)(addr+offset*2)=cmd32;
|
||||
} else if (width == 2) {
|
||||
/* 1x16 */
|
||||
*(volatile unsigned short *)((unsigned short*)addr+offset)=cmd;
|
||||
} else {
|
||||
/* 1x16 or 1x8 */
|
||||
/* 1x8 */
|
||||
*(volatile unsigned char *)(addr+offset)=cmd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ mpsc_init(int baud)
|
||||
|
||||
/* BRG CONFIG */
|
||||
galbrg_set_baudrate(CHANNEL, baud);
|
||||
#ifdef CONFIG_ZUMA_V2
|
||||
#if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4)
|
||||
galbrg_set_clksrc(CHANNEL,0x8); /* connect TCLK -> BRG */
|
||||
#else
|
||||
galbrg_set_clksrc(CHANNEL,0);
|
||||
@@ -387,7 +387,7 @@ galbrg_set_baudrate(int channel, int rate)
|
||||
|
||||
galbrg_disable(channel);
|
||||
|
||||
#ifdef CONFIG_ZUMA_V2
|
||||
#if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4)
|
||||
/* from tclk */
|
||||
clock = (CFG_BUS_HZ/(16*rate)) - 1;
|
||||
#else
|
||||
@@ -803,6 +803,7 @@ static int
|
||||
galmpsc_shutdown(int mpsc)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#if 0
|
||||
unsigned int temp;
|
||||
|
||||
/* cause RX abort (clears RX) */
|
||||
@@ -810,9 +811,11 @@ galmpsc_shutdown(int mpsc)
|
||||
temp |= MPSC_RX_ABORT | MPSC_TX_ABORT;
|
||||
temp &= ~MPSC_ENTER_HUNT;
|
||||
GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP,temp);
|
||||
#endif
|
||||
|
||||
GT_REG_WRITE(GALSDMA_0_COM_REG, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_COM_REG, SDMA_TX_ABORT | SDMA_RX_ABORT);
|
||||
GT_REG_WRITE(GALSDMA_0_COM_REG + CHANNEL * GALSDMA_REG_DIFF, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_COM_REG + CHANNEL * GALSDMA_REG_DIFF,
|
||||
SDMA_TX_ABORT | SDMA_RX_ABORT);
|
||||
|
||||
/* shut down the MPSC */
|
||||
GT_REG_WRITE(GALMPSC_MCONF_LOW, 0);
|
||||
@@ -823,14 +826,15 @@ galmpsc_shutdown(int mpsc)
|
||||
|
||||
/* shut down the sdma engines. */
|
||||
/* reset config to default */
|
||||
GT_REG_WRITE(GALSDMA_0_CONF_REG, 0x000000fc);
|
||||
GT_REG_WRITE(GALSDMA_0_CONF_REG + CHANNEL * GALSDMA_REG_DIFF,
|
||||
0x000000fc);
|
||||
|
||||
udelay(100);
|
||||
|
||||
/* clear the SDMA current and first TX and RX pointers */
|
||||
GT_REG_WRITE(GALSDMA_0_CUR_RX_PTR, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_CUR_TX_PTR, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_FIR_TX_PTR, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_CUR_RX_PTR + CHANNEL * GALSDMA_REG_DIFF, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_CUR_TX_PTR + CHANNEL * GALSDMA_REG_DIFF, 0);
|
||||
GT_REG_WRITE(GALSDMA_0_FIR_TX_PTR + CHANNEL * GALSDMA_REG_DIFF, 0);
|
||||
|
||||
udelay(100);
|
||||
|
||||
|
||||
@@ -175,7 +175,30 @@ check_dimm(uchar slot, sdram_info_t *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* ! CONFIG_ZUMA_V2 */
|
||||
#elif defined(CONFIG_P3G4)
|
||||
|
||||
static int
|
||||
check_dimm(uchar slot, sdram_info_t *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
||||
if (slot)
|
||||
return 0;
|
||||
|
||||
info->slot = slot;
|
||||
info->banks = 1;
|
||||
info->registered = 0;
|
||||
info->drb_size = 4;
|
||||
info->tpar = 3;
|
||||
info->tras_clocks = 6;
|
||||
info->burst_len = 4;
|
||||
#ifdef CONFIG_ECC
|
||||
info->ecc = 2;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* ! CONFIG_ZUMA_V2 && ! CONFIG_P3G4*/
|
||||
|
||||
/* This code reads the SPD chip on the sdram and populates
|
||||
* the array which is passed in with the relevant information */
|
||||
|
||||
@@ -198,20 +198,20 @@ do_zuma_init_mbox (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(zuma_init_pbb) = MK_CMD_ENTRY(
|
||||
"zinit", 1, 0, do_zuma_init_pbb,
|
||||
U_BOOT_CMD(
|
||||
zinit, 1, 0, do_zuma_init_pbb,
|
||||
"zinit - init zuma pbb\n",
|
||||
"\n"
|
||||
" - init zuma pbb\n"
|
||||
);
|
||||
cmd_tbl_t U_BOOT_CMD(zuma_test_dma) = MK_CMD_ENTRY(
|
||||
"zdtest", 3, 1, do_zuma_test_dma,
|
||||
U_BOOT_CMD(
|
||||
zdtest, 3, 1, do_zuma_test_dma,
|
||||
"zdtest - run dma test\n",
|
||||
"[cmd [count]]\n"
|
||||
" - run dma cmd (w=0,v=1,cp=2,cmp=3,wi=4,vi=5), count bytes\n"
|
||||
);
|
||||
cmd_tbl_t U_BOOT_CMD(zuma_init_mbox) = MK_CMD_ENTRY(
|
||||
"zminit", 1, 0, do_zuma_init_mbox,
|
||||
U_BOOT_CMD(
|
||||
zminit, 1, 0, do_zuma_init_mbox,
|
||||
"zminit - init zuma mbox\n",
|
||||
"\n"
|
||||
" - init zuma mbox\n"
|
||||
|
||||
49
board/exbitgen/Makefile
Normal file
49
board/exbitgen/Makefile
Normal file
@@ -0,0 +1,49 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
SOBJS = init.o
|
||||
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
33
board/exbitgen/config.mk
Normal file
33
board/exbitgen/config.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#
|
||||
# ExbitGen board
|
||||
#
|
||||
|
||||
LDFLAGS += $(LINKER_UNDEFS)
|
||||
|
||||
TEXT_BASE := 0xFFF80000
|
||||
#TEXT_BASE := 0x00100000
|
||||
|
||||
PLATFORM_RELFLAGS := $(PLATFORM_RELFLAGS)
|
||||
117
board/exbitgen/exbitgen.c
Normal file
117
board/exbitgen/exbitgen.c
Normal file
@@ -0,0 +1,117 @@
|
||||
#include <asm/u-boot.h>
|
||||
#include <asm/processor.h>
|
||||
#include <common.h>
|
||||
#include "exbitgen.h"
|
||||
|
||||
/* ************************************************************************ */
|
||||
int board_pre_init (void)
|
||||
/* ------------------------------------------------------------------------ --
|
||||
* Purpose :
|
||||
* Remarks :
|
||||
* Restrictions:
|
||||
* See also :
|
||||
* Example :
|
||||
* ************************************************************************ */
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Interrupt controller setup for the Walnut board.
|
||||
| Note: IRQ 0-15 405GP internally generated; active high; level sensitive
|
||||
| IRQ 16 405GP internally generated; active low; level sensitive
|
||||
| IRQ 17-24 RESERVED
|
||||
| IRQ 25 (EXT IRQ 0) FPGA; active high; level sensitive
|
||||
| IRQ 26 (EXT IRQ 1) SMI; active high; level sensitive
|
||||
| IRQ 27 (EXT IRQ 2) Not Used
|
||||
| IRQ 28 (EXT IRQ 3) PCI SLOT 3; active low; level sensitive
|
||||
| IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
|
||||
| IRQ 30 (EXT IRQ 5) PCI SLOT 1; active low; level sensitive
|
||||
| IRQ 31 (EXT IRQ 6) PCI SLOT 0; active low; level sensitive
|
||||
| Note for Walnut board:
|
||||
| An interrupt taken for the FPGA (IRQ 25) indicates that either
|
||||
| the Mouse, Keyboard, IRDA, or External Expansion caused the
|
||||
| interrupt. The FPGA must be read to determine which device
|
||||
| caused the interrupt. The default setting of the FPGA clears
|
||||
|
|
||||
+-------------------------------------------------------------------------*/
|
||||
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr (uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr (uiccr, 0x00000020); /* set all but FPGA SMI to be non-critical */
|
||||
mtdcr (uicpr, 0xFFFFFF90); /* set int polarities */
|
||||
mtdcr (uictr, 0x10000000); /* set int trigger levels */
|
||||
mtdcr (uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority */
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
/* Perform reset of PHY connected to PPC via register in CPLD */
|
||||
out8 (PHY_CTRL_ADDR, 0x2e); /* activate nRESET,FDX,F100,ANEN, enable output */
|
||||
for (i = 0; i < 10000000; i++) {
|
||||
;
|
||||
}
|
||||
out8 (PHY_CTRL_ADDR, 0x2f); /* deactivate nRESET */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************ */
|
||||
int checkboard (void)
|
||||
/* ------------------------------------------------------------------------ --
|
||||
* Purpose :
|
||||
* Remarks :
|
||||
* Restrictions:
|
||||
* See also :
|
||||
* Example :
|
||||
* ************************************************************************ */
|
||||
{
|
||||
printf ("Exbit H/W id: %d\n", in8 (HW_ID_ADDR));
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
long int initdram (int board_type)
|
||||
/* ------------------------------------------------------------------------ --
|
||||
* Purpose : Determines size of mounted DRAM.
|
||||
* Remarks : Size is determined by reading SDRAM configuration registers as
|
||||
* set up by sdram_init.
|
||||
* Restrictions:
|
||||
* See also :
|
||||
* Example :
|
||||
* ************************************************************************ */
|
||||
{
|
||||
ulong tot_size;
|
||||
ulong bank_size;
|
||||
ulong tmp;
|
||||
|
||||
tot_size = 0;
|
||||
|
||||
mtdcr (memcfga, mem_mb0cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb1cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb2cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
mtdcr (memcfga, mem_mb3cf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
if (tmp & 0x00000001) {
|
||||
bank_size = 0x00400000 << ((tmp >> 17) & 0x7);
|
||||
tot_size += bank_size;
|
||||
}
|
||||
|
||||
return tot_size;
|
||||
}
|
||||
52
board/exbitgen/exbitgen.h
Normal file
52
board/exbitgen/exbitgen.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define GPIO_CPU_LED GPIO_3
|
||||
|
||||
|
||||
#define CPLD_BASE 0x10000000 /* t.b.m. */
|
||||
#define DEBUG_LEDS_ADDR CPLD_BASE + 0x01
|
||||
#define HW_ID_ADDR CPLD_BASE + 0x02
|
||||
#define DIP_SWITCH_ADDR CPLD_BASE + 0x04
|
||||
#define PHY_CTRL_ADDR CPLD_BASE + 0x05
|
||||
#define SPI_OUT_ADDR CPLD_BASE + 0x07
|
||||
#define SPI_IN_ADDR CPLD_BASE + 0x08
|
||||
#define MDIO_OUT_ADDR CPLD_BASE + 0x09
|
||||
#define MDIO_IN_ADDR CPLD_BASE + 0x0A
|
||||
#define MISC_OUT_ADDR CPLD_BASE + 0x0B
|
||||
|
||||
/* Addresses used on I2C bus */
|
||||
#define LM75_CHIP_ADDR 0x9C
|
||||
#define LM75_CPU_ADDR 0x9E
|
||||
#define SDRAM_SPD_ADDR 0xA0
|
||||
|
||||
#define SDRAM_SPD_WRITE_ADDRESS (SDRAM_SPD_ADDR)
|
||||
#define SDRAM_SPD_READ_ADDRESS (SDRAM_SPD_ADDR+1)
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
597
board/exbitgen/flash.c
Normal file
597
board/exbitgen/flash.c
Normal file
@@ -0,0 +1,597 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified 4/5/2001
|
||||
* Wait for completion of each sector erase command issued
|
||||
* 4/5/2001
|
||||
* Chris Hallinan - DS4.COM, Inc. - clh@net1plus.com
|
||||
*/
|
||||
|
||||
#include <asm/u-boot.h>
|
||||
#include <asm/processor.h>
|
||||
#include <ppc4xx.h>
|
||||
#include <common.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info);
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data);
|
||||
|
||||
#ifdef MEIGSBOARD_ONBOARD_FLASH /* onboard = 2MB */
|
||||
# ifdef CONFIG_EXBITGEN
|
||||
# define FLASH_WORD_SIZE unsigned long
|
||||
# endif
|
||||
#else /* Meigsboard socket flash = 512KB */
|
||||
# ifdef CONFIG_EXBITGEN
|
||||
# define FLASH_WORD_SIZE unsigned char
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXBITGEN
|
||||
#define ADDR0 0x5555
|
||||
#define ADDR1 0x2aaa
|
||||
#define FLASH_WORD_SIZE unsigned char
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long bank_size;
|
||||
unsigned long tot_size;
|
||||
unsigned long bank_addr;
|
||||
int i;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
flash_info[i].size = 0;
|
||||
}
|
||||
|
||||
tot_size = 0;
|
||||
|
||||
/* Detect Boot Flash */
|
||||
bank_addr = CFG_FLASH0_BASE;
|
||||
bank_size = flash_get_size((vu_long *)bank_addr, &flash_info[0]);
|
||||
if (bank_size > 0) {
|
||||
(void)flash_protect(FLAG_PROTECT_CLEAR,
|
||||
bank_addr,
|
||||
bank_addr + bank_size - 1,
|
||||
&flash_info[0]);
|
||||
}
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Boot Flash Bank\n");
|
||||
}
|
||||
flash_info[0].size = bank_size;
|
||||
tot_size += bank_size;
|
||||
|
||||
/* Detect Application Flash */
|
||||
bank_addr = CFG_FLASH1_BASE;
|
||||
for (i = 1; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
bank_size = flash_get_size((vu_long *)bank_addr, &flash_info[i]);
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
break;
|
||||
}
|
||||
if (bank_size > 0) {
|
||||
(void)flash_protect(FLAG_PROTECT_CLEAR,
|
||||
bank_addr,
|
||||
bank_addr + bank_size - 1,
|
||||
&flash_info[i]);
|
||||
}
|
||||
flash_info[i].size = bank_size;
|
||||
tot_size += bank_size;
|
||||
bank_addr += bank_size;
|
||||
}
|
||||
if (flash_info[1].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Application Flash Bank\n");
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors */
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
#if 0xfffffffc >= CFG_FLASH0_BASE
|
||||
#if 0xfffffffc <= CFG_FLASH0_BASE + CFG_FLASH0_SIZE - 1
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
0xfffffffc, 0xffffffff,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
return tot_size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
case FLASH_MAN_SST: printf ("SST "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM040: printf ("AM29F040 (512 Kbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AM400B: printf ("AM29LV400B (4 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM400T: printf ("AM29LV400T (4 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM800B: printf ("AM29LV800B (8 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM800T: printf ("AM29LV800T (8 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM160B: printf ("AM29LV160B (16 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM160T: printf ("AM29LV160T (16 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AM320B: printf ("AM29LV320B (32 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM320T: printf ("AM29LV320T (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
case FLASH_AMDLV033C: printf ("AM29LV033C (32 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_AMDLV065D: printf ("AM29LV065D (64 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST800A: printf ("SST39LF/VF800 (8 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST160A: printf ("SST39LF/VF160 (16 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
case FLASH_SST040: printf ("SST39LF/VF040 (4 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld KB in %d Sectors\n",
|
||||
info->size >> 10, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " "
|
||||
);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
FLASH_WORD_SIZE value;
|
||||
ulong base = (ulong)addr;
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00900090;
|
||||
|
||||
value = addr2[0];
|
||||
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE)AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE)FUJ_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_FUJ;
|
||||
break;
|
||||
case (FLASH_WORD_SIZE)SST_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_SST;
|
||||
break;
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr2[1]; /* device ID */
|
||||
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE)AMD_ID_F040B:
|
||||
info->flash_id += FLASH_AM040;
|
||||
info->sector_count = 8;
|
||||
info->size = 0x0080000; /* => 512 ko */
|
||||
break;
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV400T:
|
||||
info->flash_id += FLASH_AM400T;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 0.5 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV400B:
|
||||
info->flash_id += FLASH_AM400B;
|
||||
info->sector_count = 11;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 0.5 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV800T:
|
||||
info->flash_id += FLASH_AM800T;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV800B:
|
||||
info->flash_id += FLASH_AM800B;
|
||||
info->sector_count = 19;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV160T:
|
||||
info->flash_id += FLASH_AM160T;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV160B:
|
||||
info->flash_id += FLASH_AM160B;
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV033C:
|
||||
info->flash_id += FLASH_AMDLV033C;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV065D:
|
||||
info->flash_id += FLASH_AMDLV065D;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV320T:
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)SST_ID_xF800A:
|
||||
info->flash_id += FLASH_SST800A;
|
||||
info->sector_count = 16;
|
||||
info->size = 0x00100000;
|
||||
break; /* => 1 MB */
|
||||
|
||||
case (FLASH_WORD_SIZE)SST_ID_xF160A:
|
||||
info->flash_id += FLASH_SST160A;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
case (FLASH_WORD_SIZE)SST_ID_xF040:
|
||||
info->flash_id += FLASH_SST040;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00080000;
|
||||
break; /* => 512KB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
(info->flash_id == FLASH_AM040) ||
|
||||
(info->flash_id == FLASH_AMDLV033C) ||
|
||||
(info->flash_id == FLASH_AMDLV065D)) {
|
||||
ulong sectsize = info->size / info->sector_count;
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * sectsize);
|
||||
} else {
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block type */
|
||||
info->start[0] = base + 0x00000000;
|
||||
info->start[1] = base + 0x00004000;
|
||||
info->start[2] = base + 0x00006000;
|
||||
info->start[3] = base + 0x00008000;
|
||||
for (i = 4; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00030000;
|
||||
}
|
||||
} else {
|
||||
/* set sector offsets for top boot block type */
|
||||
i = info->sector_count - 1;
|
||||
info->start[i--] = base + info->size - 0x00004000;
|
||||
info->start[i--] = base + info->size - 0x00006000;
|
||||
info->start[i--] = base + info->size - 0x00008000;
|
||||
for (; i >= 0; i--) {
|
||||
info->start[i] = base + i * 0x00010000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
|
||||
addr2 = (volatile FLASH_WORD_SIZE *)(info->start[i]);
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST)
|
||||
info->protect[i] = 0;
|
||||
else
|
||||
info->protect[i] = addr2[2] & 1;
|
||||
}
|
||||
|
||||
/* switch to the read mode */
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr2 = (FLASH_WORD_SIZE *)info->start[0];
|
||||
*addr2 = (FLASH_WORD_SIZE)0x00F000F0; /* reset bank */
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *addr2;
|
||||
int flag, prot, sect;
|
||||
ulong start, now, last;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (FLASH_WORD_SIZE *)(info->start[sect]);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE)0x00300030;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
while ((addr2[0] & 0x00800080) !=
|
||||
(FLASH_WORD_SIZE) 0x00800080) {
|
||||
if ((now=get_timer(start)) >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
addr[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
addr[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
}
|
||||
}
|
||||
|
||||
printf (" done\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
int i, l, rc;
|
||||
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
for (; i<4 && cnt>0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 4) {
|
||||
data = 0;
|
||||
for (i=0; i<4; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i<4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
|
||||
volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
|
||||
ulong start;
|
||||
int flag;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile ulong *)dest) & data) != data) {
|
||||
printf("dest = %08lx, *dest = %08lx, data = %08lx\n",
|
||||
dest, *(volatile ulong *)dest, data);
|
||||
return 2;
|
||||
}
|
||||
|
||||
for (i=0; i < 4/sizeof(FLASH_WORD_SIZE); i++) {
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & 0x00800080) != (data2[i] & 0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
addr2[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addr2[0] = (FLASH_WORD_SIZE)0x00F000F0;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
1009
board/exbitgen/init.S
Normal file
1009
board/exbitgen/init.S
Normal file
File diff suppressed because it is too large
Load Diff
148
board/exbitgen/u-boot.lds
Normal file
148
board/exbitgen/u-boot.lds
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
board/exbitgen/init.o (.text)
|
||||
cpu/ppc4xx/kgdb.o (.text)
|
||||
cpu/ppc4xx/traps.o (.text)
|
||||
cpu/ppc4xx/interrupts.o (.text)
|
||||
cpu/ppc4xx/serial.o (.text)
|
||||
cpu/ppc4xx/cpu_init.o (.text)
|
||||
cpu/ppc4xx/speed.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* . = env_offset;*/
|
||||
common/environment.o(.text)
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
. = ALIGN(4);
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -128,7 +128,7 @@ long int initdram (int board_type)
|
||||
|
||||
/* That should do it, just enable the periodic refresh in burst of 4*/
|
||||
memctl->memc_mamr = CFG_MAMR_48_SDR | MAMR_TLFA_4X;
|
||||
memctl->memc_mamr |= (MAMR_PTAE | MAMR_GPL_B4DIS);
|
||||
memctl->memc_mamr |= (MAMR_PTAE | MAMR_GPL_A4DIS);
|
||||
|
||||
size_b0 = 16*1024*1024;
|
||||
|
||||
@@ -141,7 +141,7 @@ long int initdram (int board_type)
|
||||
|
||||
upmconfig(UPMB, (uint *)dsp_disp_table, sizeof(dsp_disp_table)/sizeof(uint));
|
||||
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS;
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS;
|
||||
|
||||
memctl->memc_or4 = CFG_OR4;
|
||||
memctl->memc_br4 = CFG_BR4;
|
||||
|
||||
@@ -302,4 +302,15 @@ board_poweroff(void)
|
||||
while (1);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
/*
|
||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||
* Called from board_init_f().
|
||||
*/
|
||||
int post_hotkeys_pressed(void)
|
||||
{
|
||||
return 0; /* No hotkeys supported */
|
||||
}
|
||||
#endif
|
||||
|
||||
/* vim: set ts=4 sw=4 tw=78 : */
|
||||
|
||||
@@ -163,7 +163,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_mcr = 0x80804105; /* SDRAM bank 1 */
|
||||
|
||||
/* Execute refresh 8 times */
|
||||
memctl->memc_mbmr = (CFG_MBMR_8COL & ~MAMR_TLFB_MSK) | MAMR_TLFB_8X ;
|
||||
memctl->memc_mbmr = (CFG_MBMR_8COL & ~MBMR_TLFB_MSK) | MBMR_TLFB_8X ;
|
||||
|
||||
memctl->memc_mcr = 0x80802130; /* SDRAM bank 0 - execute twice */
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ int _initsdram (uint base, uint * noMbytes)
|
||||
sizeof (fpga_table) / sizeof (uint));
|
||||
|
||||
/* Enable UPWAITB */
|
||||
mc->memc_mbmr = MAMR_GPL_B4DIS; /* (16-13) */
|
||||
mc->memc_mbmr = MBMR_GPL_B4DIS; /* (16-13) */
|
||||
|
||||
/* CS2, base FPGA_2_BASE - 4 MByte, use UPM B 32 Bit */
|
||||
mc->memc_or2 = 0xffc00000 | OR_BI;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <command.h>
|
||||
#include <net.h>
|
||||
#include <asm/iopin_8260.h>
|
||||
#include <cmd_bsp.h>
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Board Special Commands: FPGA load/store, EEPROM erase
|
||||
@@ -276,8 +275,8 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(fpga) = MK_CMD_ENTRY(
|
||||
"fpga", 6, 1, do_fpga,
|
||||
U_BOOT_CMD(
|
||||
fpga, 6, 1, do_fpga,
|
||||
"fpga - FPGA sub-system\n",
|
||||
"load [type] addr size\n"
|
||||
" - write the configuration data at memory address `addr',\n"
|
||||
@@ -335,8 +334,8 @@ do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(eec) = MK_CMD_ENTRY(
|
||||
"eeclear", 1, 0, do_eecl,
|
||||
U_BOOT_CMD(
|
||||
eeclear, 1, 0, do_eecl,
|
||||
"eeclear - Clear the eeprom on a Hymod board \n",
|
||||
"[type]\n"
|
||||
" - write zeroes into the EEPROM on the board of type `type'\n"
|
||||
|
||||
47
board/icecube/Makefile
Normal file
47
board/icecube/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
#
|
||||
# (C) Copyright 2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := $(BOARD).o flash.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
31
board/icecube/config.mk
Normal file
31
board/icecube/config.mk
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# (C) Copyright 2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#
|
||||
# IceCube board
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xfff00000
|
||||
# TEXT_BASE = 0x00100000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
|
||||
491
board/icecube/flash.c
Normal file
491
board/icecube/flash.c
Normal file
@@ -0,0 +1,491 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* NOTE - CONFIG_FLASH_16BIT means the CPU interface is 16-bit, it
|
||||
* has nothing to do with the flash chip being 8-bit or 16-bit.
|
||||
*/
|
||||
#ifdef CONFIG_FLASH_16BIT
|
||||
typedef unsigned short FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned short FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFFFF
|
||||
#else
|
||||
typedef unsigned char FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned char FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFF
|
||||
#endif
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define ORMASK(size) ((-size) & OR_AM_MSK)
|
||||
|
||||
#define FLASH_CYCLE1 0x0555
|
||||
#define FLASH_CYCLE2 0x02aa
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size(FPWV *addr, flash_info_t *info);
|
||||
static void flash_reset(flash_info_t *info);
|
||||
static int write_word_amd(flash_info_t *info, FPWV *dest, FPW data);
|
||||
static flash_info_t *flash_get_info(ulong base);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* flash_init()
|
||||
*
|
||||
* sets up flash_info and returns size of FLASH (bytes)
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size = 0;
|
||||
int i;
|
||||
extern void flash_preinit(void);
|
||||
extern void flash_afterinit(ulong);
|
||||
ulong flashbase = CFG_FLASH_BASE;
|
||||
|
||||
flash_preinit();
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
memset(&flash_info[i], 0, sizeof(flash_info_t));
|
||||
|
||||
flash_info[i].size =
|
||||
flash_get_size((FPW *)flashbase, &flash_info[i]);
|
||||
|
||||
size += flash_info[i].size;
|
||||
flashbase += 0x800000;
|
||||
}
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE+monitor_flash_len-1,
|
||||
flash_get_info(CFG_MONITOR_BASE));
|
||||
#endif
|
||||
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
/* ENV protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR+CFG_ENV_SIZE-1,
|
||||
flash_get_info(CFG_ENV_ADDR));
|
||||
#endif
|
||||
|
||||
|
||||
flash_afterinit(size);
|
||||
return size ? size : 1;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_reset(flash_info_t *info)
|
||||
{
|
||||
FPWV *base = (FPWV *)(info->start[0]);
|
||||
|
||||
/* Put FLASH back in read mode */
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL)
|
||||
*base = (FPW)0x00FF00FF; /* Intel Read Mode */
|
||||
else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD)
|
||||
*base = (FPW)0x00F000F0; /* AMD Read Mode */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static flash_info_t *flash_get_info(ulong base)
|
||||
{
|
||||
int i;
|
||||
flash_info_t * info;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i ++) {
|
||||
info = & flash_info[i];
|
||||
if (info->size &&
|
||||
info->start[0] <= base && base <= info->start[0] + info->size - 1)
|
||||
break;
|
||||
}
|
||||
|
||||
return i == CFG_MAX_FLASH_BANKS ? 0 : info;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
uchar *boottype;
|
||||
uchar *bootletter;
|
||||
uchar *fmt;
|
||||
uchar botbootletter[] = "B";
|
||||
uchar topbootletter[] = "T";
|
||||
uchar botboottype[] = "bottom boot sector";
|
||||
uchar topboottype[] = "top boot sector";
|
||||
|
||||
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_BM: printf ("BRIGHT MICRO "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
case FLASH_MAN_SST: printf ("SST "); break;
|
||||
case FLASH_MAN_STM: printf ("STM "); break;
|
||||
case FLASH_MAN_INTEL: printf ("INTEL "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
/* check for top or bottom boot, if it applies */
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
boottype = botboottype;
|
||||
bootletter = botbootletter;
|
||||
}
|
||||
else {
|
||||
boottype = topboottype;
|
||||
bootletter = topbootletter;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AMDLV065D:
|
||||
fmt = "29LV065 (64 Mbit, uniform sectors)\n";
|
||||
break;
|
||||
default:
|
||||
fmt = "Unknown Chip Type\n";
|
||||
break;
|
||||
}
|
||||
|
||||
printf (fmt, bootletter, boottype);
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20,
|
||||
info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
if ((i % 5) == 0) {
|
||||
printf ("\n ");
|
||||
}
|
||||
|
||||
printf (" %08lX%s", info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
|
||||
ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
FPWV* addr2;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
/* Write auto select command sequence and test FLASH answer */
|
||||
addr[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* for AMD, Intel ignores this */
|
||||
addr[FLASH_CYCLE2] = (FPW)0x00550055; /* for AMD, Intel ignores this */
|
||||
addr[FLASH_CYCLE1] = (FPW)0x00900090; /* selects Intel or AMD */
|
||||
|
||||
/* The manufacturer codes are only 1 byte, so just use 1 byte.
|
||||
* This works for any bus width and any FLASH device width.
|
||||
*/
|
||||
udelay(100);
|
||||
switch (addr[0] & 0xff) {
|
||||
|
||||
case (uchar)AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
|
||||
case (uchar)INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* 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[1]) {
|
||||
|
||||
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 + (i * 0x10000);
|
||||
break; /* => 8 or 16 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* => no or unknown flash */
|
||||
}
|
||||
|
||||
/* test for real flash at bank 1 */
|
||||
addr2 = (FPW *)((ulong)addr | 0x800000);
|
||||
if (addr2 != addr &&
|
||||
((addr2[0] & 0xff) == (addr[0] & 0xff)) && ((FPW)addr2[1] == (FPW)addr[1])) {
|
||||
/* Seems 2 banks are the same space (8Mb chip is installed,
|
||||
* J24 in default position (CS0)). Disable this (first) bank.
|
||||
*/
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
}
|
||||
/* Put FLASH back in read mode */
|
||||
flash_reset(info);
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
FPWV *addr;
|
||||
int flag, prot, sect;
|
||||
int intel = (info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL;
|
||||
ulong start, now, 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;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AMDLV065D:
|
||||
break;
|
||||
case FLASH_UNKNOWN:
|
||||
default:
|
||||
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");
|
||||
}
|
||||
|
||||
last = get_timer(0);
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
|
||||
|
||||
if (info->protect[sect] != 0) /* protected, skip it */
|
||||
continue;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr = (FPWV *)(info->start[sect]);
|
||||
if (intel) {
|
||||
*addr = (FPW)0x00500050; /* clear status register */
|
||||
*addr = (FPW)0x00200020; /* erase setup */
|
||||
*addr = (FPW)0x00D000D0; /* erase confirm */
|
||||
}
|
||||
else {
|
||||
/* must be AMD style if not Intel */
|
||||
FPWV *base; /* first address in bank */
|
||||
|
||||
base = (FPWV *)(info->start[0]);
|
||||
base[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = (FPW)0x00550055; /* unlock */
|
||||
base[FLASH_CYCLE1] = (FPW)0x00800080; /* erase mode */
|
||||
base[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = (FPW)0x00550055; /* unlock */
|
||||
*addr = (FPW)0x00300030; /* erase sector */
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
start = get_timer(0);
|
||||
|
||||
/* wait at least 50us for AMD, 80us for Intel.
|
||||
* Let's wait 1 ms.
|
||||
*/
|
||||
udelay (1000);
|
||||
|
||||
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
|
||||
if (intel) {
|
||||
/* suspend erase */
|
||||
*addr = (FPW)0x00B000B0;
|
||||
}
|
||||
|
||||
flash_reset(info); /* reset to read mode */
|
||||
rcode = 1; /* failed */
|
||||
break;
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((get_timer(last)) > CFG_HZ) {/* every second */
|
||||
putc ('.');
|
||||
last = get_timer(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((get_timer(last)) > CFG_HZ) { /* every second */
|
||||
putc ('.');
|
||||
last = get_timer(0);
|
||||
}
|
||||
|
||||
flash_reset(info); /* reset to read mode */
|
||||
}
|
||||
|
||||
printf (" done\n");
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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)
|
||||
{
|
||||
FPW data = 0; /* 16 or 32 bit word, matches flash bus width on MPC8XX */
|
||||
int bytes; /* number of bytes to program in current word */
|
||||
int left; /* number of bytes left to program */
|
||||
int i, res;
|
||||
|
||||
for (left = cnt, res = 0;
|
||||
left > 0 && res == 0;
|
||||
addr += sizeof(data), left -= sizeof(data) - bytes) {
|
||||
|
||||
bytes = addr & (sizeof(data) - 1);
|
||||
addr &= ~(sizeof(data) - 1);
|
||||
|
||||
/* combine source and destination data so can program
|
||||
* an entire word of 16 or 32 bits
|
||||
*/
|
||||
for (i = 0; i < sizeof(data); i++) {
|
||||
data <<= 8;
|
||||
if (i < bytes || i - bytes >= left )
|
||||
data += *((uchar *)addr + i);
|
||||
else
|
||||
data += *src++;
|
||||
}
|
||||
|
||||
/* write one word to the flash */
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD:
|
||||
res = write_word_amd(info, (FPWV *)addr, data);
|
||||
break;
|
||||
default:
|
||||
/* unknown flash type, error! */
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
res = 1; /* not really a timeout, but gives error */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash for AMD FLASH
|
||||
* A word is 16 or 32 bits, whichever the bus width of the flash bank
|
||||
* (not an individual chip) is.
|
||||
*
|
||||
* returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
|
||||
{
|
||||
ulong start;
|
||||
int flag;
|
||||
int res = 0; /* result, assume success */
|
||||
FPWV *base; /* first address in flash bank */
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*dest & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
|
||||
base = (FPWV *)(info->start[0]);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
base[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = (FPW)0x00550055; /* unlock */
|
||||
base[FLASH_CYCLE1] = (FPW)0x00A000A0; /* selects program mode */
|
||||
|
||||
*dest = data; /* start programming the data */
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
start = get_timer (0);
|
||||
|
||||
/* data polling for D7 */
|
||||
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*dest = (FPW)0x00F000F0; /* reset bank */
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
193
board/icecube/icecube.c
Normal file
193
board/icecube/icecube.c
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc5xxx.h>
|
||||
#include <pci.h>
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
static long int dram_size(long int *base, long int maxsize)
|
||||
{
|
||||
volatile long int *addr;
|
||||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
/* write 0 to base address */
|
||||
addr = base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
|
||||
static void sdram_start (int hi_addr)
|
||||
{
|
||||
long hi_addr_bit = hi_addr ? 0x01000000 : 0;
|
||||
|
||||
/* unlock mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0000 | hi_addr_bit;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x408d0000;
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
#endif
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
/* normal operation */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0x504f0000 | hi_addr_bit;
|
||||
}
|
||||
#endif
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
ulong dramsize = 0;
|
||||
#ifndef CFG_RAMBOOT
|
||||
ulong test1, test2;
|
||||
|
||||
/* configure SDRAM start/end */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
|
||||
|
||||
/* setup config registers */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xc2233a00;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x88b70004;
|
||||
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_START = 0x00000000;
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = 0x0000ffff;/* 2G */
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
|
||||
|
||||
/* setup config registers */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xc2222600;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x88b70004;
|
||||
|
||||
/* address select register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_XLBSEL = 0x03000000;
|
||||
#endif
|
||||
sdram_start(0);
|
||||
test1 = dram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
|
||||
sdram_start(1);
|
||||
test2 = dram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
|
||||
if (test1 > test2) {
|
||||
sdram_start(0);
|
||||
dramsize = test1;
|
||||
} else {
|
||||
dramsize = test2;
|
||||
}
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG =
|
||||
(0x13 + __builtin_ffs(dramsize >> 20) - 1);
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = ((dramsize - 1) >> 15);
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef CONFIG_MGT5100
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
|
||||
dramsize = ((*(vu_long *)MPC5XXX_SDRAM_STOP + 1) << 15);
|
||||
#else
|
||||
dramsize = ((1 << (*(vu_long *)MPC5XXX_SDRAM_CS0CFG - 0x13)) << 20);
|
||||
#endif
|
||||
#endif /* CFG_RAMBOOT */
|
||||
/* return total ram size */
|
||||
return dramsize;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
#if defined(CONFIG_MPC5200)
|
||||
puts ("Board: Motorola MPC5200 (IceCube)\n");
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
puts ("Board: Motorola MGT5100 (IceCube)\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flash_preinit(void)
|
||||
{
|
||||
/*
|
||||
* Now, when we are in RAM, enable flash write
|
||||
* access for detection process.
|
||||
* Note that CS_BOOT cannot be cleared when
|
||||
* executing in flash.
|
||||
*/
|
||||
#if defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_ADDECR &= ~(1 << 25); /* disable CS_BOOT */
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 16); /* enable CS0 */
|
||||
#endif
|
||||
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
|
||||
}
|
||||
|
||||
void flash_afterinit(ulong size)
|
||||
{
|
||||
if (size == 0x800000) { /* adjust mapping */
|
||||
*(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
|
||||
START_REG(CFG_BOOTCS_START | size);
|
||||
*(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
|
||||
STOP_REG(CFG_BOOTCS_START | size, size);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static struct pci_controller hose;
|
||||
|
||||
extern void pci_mpc5xxx_init(struct pci_controller *);
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
pci_mpc5xxx_init(&hose);
|
||||
}
|
||||
#endif
|
||||
122
board/icecube/u-boot.lds
Normal file
122
board/icecube/u-boot.lds
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc5xxx/start.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(4096);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(4096);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@@ -136,11 +136,6 @@ SECTIONS
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
. = ALIGN(256 * 1024);
|
||||
.ppcenv :
|
||||
{
|
||||
common/environment.o (.ppcenv)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -246,14 +246,14 @@ initdram (int board_type)
|
||||
udelay(1);
|
||||
memctl->memc_mcr = 0x80806130; /* autorefresh */
|
||||
|
||||
memctl->memc_mbmr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mbmr |= MBMR_PTBE; /* refresh enabled */
|
||||
|
||||
/*
|
||||
* Check Bank 0 Memory Size for re-configuration
|
||||
*/
|
||||
size_b0 = dram_size (CFG_MBMR_8COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
|
||||
|
||||
memctl->memc_mbmr = CFG_MBMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mbmr = CFG_MBMR_8COL | MBMR_PTBE;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ long int initdram (int board_type)
|
||||
udelay(1); /* 0x80006106 */
|
||||
memctl->memc_mcr = MCR_OP_RUN | MCR_MB_CS3 | MCR_MLCF(1) | MCR_MAD(0x06);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* refresh enabled */
|
||||
|
||||
udelay(200);
|
||||
|
||||
@@ -170,7 +170,7 @@ long int initdram (int board_type)
|
||||
(ulong *)SDRAM_BASE3_PRELIM,
|
||||
SDRAM_MAX_SIZE);
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;
|
||||
|
||||
/*
|
||||
* Final mapping:
|
||||
|
||||
@@ -184,7 +184,7 @@ V* Verification: dzu@denx.de
|
||||
***********************************************************************/
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: Litronic Monitor IV\n");
|
||||
puts ("Board: LICCON Konsole LCD2\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ long int initdram (int board_type)
|
||||
udelay (1); /* 0x80006106 */
|
||||
memctl->memc_mcr = MCR_OP_RUN | MCR_MB_CS3 | MCR_MLCF (1) | MCR_MAD (0x06);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* refresh enabled */
|
||||
|
||||
udelay (200);
|
||||
|
||||
@@ -276,11 +276,11 @@ long int initdram (int board_type)
|
||||
|
||||
if (size8 < size9) { /* leave configuration at 9 columns */
|
||||
size_b0 = size9;
|
||||
memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTAE;
|
||||
udelay (500);
|
||||
} else { /* back to 8 columns */
|
||||
size_b0 = size8;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;
|
||||
udelay (500);
|
||||
}
|
||||
|
||||
@@ -513,6 +513,9 @@ static void kbd_init (void)
|
||||
|
||||
gd->kbd_status = 0;
|
||||
|
||||
/* Forced by PIC. Delays <= 175us loose */
|
||||
udelay(1000);
|
||||
|
||||
/* Read initial keyboard error code */
|
||||
val = KEYBD_CMD_READ_STATUS;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
@@ -848,8 +851,8 @@ int do_pic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(pic) = MK_CMD_ENTRY(
|
||||
"pic", 4, 1, do_pic,
|
||||
U_BOOT_CMD(
|
||||
pic, 4, 1, do_pic,
|
||||
"pic - read and write PIC registers\n",
|
||||
"read reg - read PIC register `reg'\n"
|
||||
"pic write reg val - write value `val' to PIC register `reg'\n"
|
||||
@@ -907,8 +910,8 @@ int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(kdb) = MK_CMD_ENTRY(
|
||||
"kbd", 1, 1, do_kbd,
|
||||
U_BOOT_CMD(
|
||||
kbd, 1, 1, do_kbd,
|
||||
"kbd - read keyboard status\n",
|
||||
NULL
|
||||
);
|
||||
@@ -979,8 +982,8 @@ int do_lsb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(lsb) = MK_CMD_ENTRY(
|
||||
"lsb", 2, 1, do_lsb,
|
||||
U_BOOT_CMD(
|
||||
lsb, 2, 1, do_lsb,
|
||||
"lsb - check and set LSB switch\n",
|
||||
"on - switch LSB on\n"
|
||||
"lsb off - switch LSB off\n"
|
||||
@@ -1068,3 +1071,22 @@ static int key_pressed(void)
|
||||
return (compare_magic(kbd_data, CONFIG_MODEM_KEY_MAGIC) == 0);
|
||||
}
|
||||
#endif /* CONFIG_MODEM_SUPPORT */
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
/*
|
||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||
* Called from board_init_f().
|
||||
*/
|
||||
int post_hotkeys_pressed(void)
|
||||
{
|
||||
uchar kbd_data[KEYBD_DATALEN];
|
||||
uchar val;
|
||||
|
||||
/* Read keys */
|
||||
val = KEYBD_CMD_READ_KEYS;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
|
||||
return (compare_magic(kbd_data, CONFIG_POST_KEY_MAGIC) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
* I started with board/ip860/flash.c and made changes I found in
|
||||
* the MTD project by David Schleef.
|
||||
*
|
||||
* (C) Copyright 2003 Arabella Software Ltd.
|
||||
* Yuli Barcohen <yuli@arabellasw.com>
|
||||
* Re-written to support multi-bank flash SIMMs.
|
||||
* Added support for real protection and JFFS2.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
@@ -28,73 +33,119 @@
|
||||
|
||||
#include <common.h>
|
||||
|
||||
/* Intel-compatible flash ID */
|
||||
#define INTEL_COMPAT 0x89898989
|
||||
#define INTEL_ALT 0xB0B0B0B0
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
/* Intel-compatible flash commands */
|
||||
#define INTEL_PROGRAM 0x10101010
|
||||
#define INTEL_ERASE 0x20202020
|
||||
#define INTEL_CLEAR 0x50505050
|
||||
#define INTEL_LOCKBIT 0x60606060
|
||||
#define INTEL_PROTECT 0x01010101
|
||||
#define INTEL_STATUS 0x70707070
|
||||
#define INTEL_READID 0x90909090
|
||||
#define INTEL_CONFIRM 0xD0D0D0D0
|
||||
#define INTEL_RESET 0xFFFFFFFF
|
||||
|
||||
#if defined(CFG_ENV_IS_IN_FLASH)
|
||||
# ifndef CFG_ENV_ADDR
|
||||
# define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET)
|
||||
# endif
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
# ifndef CFG_ENV_SECT_SIZE
|
||||
# define CFG_ENV_SECT_SIZE CFG_ENV_SIZE
|
||||
# endif
|
||||
#endif
|
||||
/* Intel-compatible flash status bits */
|
||||
#define INTEL_FINISHED 0x80808080
|
||||
#define INTEL_OK 0x80808080
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
* This board supports 32-bit wide flash SIMMs (4x8-bit configuration.)
|
||||
* Up to 32MB of flash supported (up to 4 banks.)
|
||||
* BCSR is used for flash presence detect (page 4-65 of the User's Manual)
|
||||
*
|
||||
* The following code can not run from flash!
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info);
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data);
|
||||
static int clear_block_lock_bit(vu_long * addr);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
#ifndef CONFIG_MPC8260ADS
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
volatile ip860_bcsr_t *bcsr = (ip860_bcsr_t *)BCSR_BASE;
|
||||
#endif
|
||||
unsigned long size;
|
||||
int i;
|
||||
ulong size = 0, sect_start, sect_size = 0, bank_size;
|
||||
ushort sect_count = 0;
|
||||
int i, j, nbanks;
|
||||
vu_long *addr = (vu_long *)CFG_FLASH_BASE;
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
|
||||
/* Init: enable write,
|
||||
* or we cannot even write flash commands
|
||||
*/
|
||||
#ifndef CONFIG_MPC8260ADS
|
||||
bcsr->bd_ctrl |= BD_CTRL_FLWE;
|
||||
#endif
|
||||
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
|
||||
/* set the default sector offset */
|
||||
switch (bcsr[2] & 0xF) {
|
||||
case 0:
|
||||
nbanks = 4;
|
||||
break;
|
||||
case 1:
|
||||
nbanks = 2;
|
||||
break;
|
||||
case 2:
|
||||
nbanks = 1;
|
||||
break;
|
||||
default: /* Unsupported configurations */
|
||||
nbanks = CFG_MAX_FLASH_BANKS;
|
||||
}
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
if (nbanks > CFG_MAX_FLASH_BANKS)
|
||||
nbanks = CFG_MAX_FLASH_BANKS;
|
||||
|
||||
size = flash_get_size((vu_long *)FLASH_BASE, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size, size<<20);
|
||||
for (i = 0; i < nbanks; i++) {
|
||||
*addr = INTEL_READID; /* Read Intelligent Identifier */
|
||||
if ((addr[0] == INTEL_COMPAT) || (addr[0] == INTEL_ALT)) {
|
||||
switch (addr[1]) {
|
||||
case SHARP_ID_28F016SCL:
|
||||
case SHARP_ID_28F016SCZ:
|
||||
flash_info[i].flash_id = FLASH_MAN_SHARP | FLASH_LH28F016SCT;
|
||||
sect_count = 32;
|
||||
sect_size = 0x40000;
|
||||
break;
|
||||
default:
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
sect_count = CFG_MAX_FLASH_SECT;
|
||||
sect_size =
|
||||
CFG_FLASH_SIZE / CFG_MAX_FLASH_BANKS / CFG_MAX_FLASH_SECT;
|
||||
}
|
||||
}
|
||||
else
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
printf("### Unknown flash ID %08lX %08lX at address %08lX ###\n",
|
||||
addr[0], addr[1], (ulong)addr);
|
||||
size = 0;
|
||||
*addr = INTEL_RESET; /* Reset bank to Read Array mode */
|
||||
break;
|
||||
}
|
||||
flash_info[i].sector_count = sect_count;
|
||||
flash_info[i].size = bank_size = sect_size * sect_count;
|
||||
size += bank_size;
|
||||
sect_start = (ulong)addr;
|
||||
for (j = 0; j < sect_count; j++) {
|
||||
addr = (vu_long *)sect_start;
|
||||
flash_info[i].start[j] = sect_start;
|
||||
flash_info[i].protect[j] = (addr[2] == 0x01010101);
|
||||
sect_start += sect_size;
|
||||
}
|
||||
*addr = INTEL_RESET; /* Reset bank to Read Array mode */
|
||||
addr = (vu_long *)sect_start;
|
||||
}
|
||||
#ifndef CONFIG_MPC8260ADS
|
||||
/* Remap FLASH according to real size */
|
||||
memctl->memc_or1 = CFG_OR_TIMING_FLASH | (-size & 0xFFFF8000);
|
||||
memctl->memc_br1 = (CFG_FLASH_BASE & BR_BA_MSK) |
|
||||
(memctl->memc_br1 & ~(BR_BA_MSK));
|
||||
#endif
|
||||
|
||||
/* Re-do sizing to get full correct info */
|
||||
size = flash_get_size((vu_long *)CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
flash_info[0].size = size;
|
||||
if (size == 0) { /* Unknown flash, fill with hard-coded values */
|
||||
sect_start = CFG_FLASH_BASE;
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
flash_info[i].size = CFG_FLASH_SIZE / CFG_MAX_FLASH_BANKS;
|
||||
flash_info[i].sector_count = sect_count;
|
||||
for (j = 0; j < sect_count; j++) {
|
||||
flash_info[i].start[j] = sect_start;
|
||||
flash_info[i].protect[j] = 0;
|
||||
sect_start += sect_size;
|
||||
}
|
||||
}
|
||||
size = CFG_FLASH_SIZE;
|
||||
}
|
||||
else
|
||||
for (i = nbanks; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
flash_info[i].size = 0;
|
||||
flash_info[i].sector_count = 0;
|
||||
}
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
@@ -161,102 +212,6 @@ void flash_print_info (flash_info_t *info)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
ulong value;
|
||||
ulong base = (ulong)addr;
|
||||
ulong sector_offset;
|
||||
|
||||
/* Write "Intelligent Identifier" command: read Manufacturer ID */
|
||||
*addr = 0x90909090;
|
||||
|
||||
value = addr[0] & 0x00FF00FF;
|
||||
switch (value) {
|
||||
case MT_MANUFACT: /* SHARP, MT or => Intel */
|
||||
case INTEL_ALT_MANU:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
default:
|
||||
printf("unknown manufacturer: %x\n", (unsigned int)value);
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
value = addr[1]; /* device ID */
|
||||
|
||||
switch (value) {
|
||||
case (INTEL_ID_28F016S):
|
||||
info->flash_id += FLASH_28F016SV;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00400000;
|
||||
sector_offset = 0x20000;
|
||||
break; /* => 2x2 MB */
|
||||
|
||||
case (INTEL_ID_28F160S3):
|
||||
info->flash_id += FLASH_28F160S3;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00400000;
|
||||
sector_offset = 0x20000;
|
||||
break; /* => 2x2 MB */
|
||||
|
||||
case (INTEL_ID_28F320S3):
|
||||
info->flash_id += FLASH_28F320S3;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00800000;
|
||||
sector_offset = 0x20000;
|
||||
break; /* => 2x4 MB */
|
||||
|
||||
case SHARP_ID_28F016SCL:
|
||||
case SHARP_ID_28F016SCZ:
|
||||
info->flash_id = FLASH_MAN_SHARP | FLASH_LH28F016SCT;
|
||||
info->sector_count = 32;
|
||||
info->size = 0x00800000;
|
||||
sector_offset = 0x40000;
|
||||
break; /* => 4x2 MB */
|
||||
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
|
||||
/* set up sector start address table */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base;
|
||||
base += sector_offset;
|
||||
/* don't know how to check sector protection */
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr = (vu_long *)info->start[0];
|
||||
|
||||
*addr = 0xFFFFFF; /* reset bank to read array mode */
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
@@ -292,12 +247,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/* Make Sure Block Lock Bit is not set. */
|
||||
if(clear_block_lock_bit((vu_long *)(info->start[s_first]))){
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
@@ -308,36 +257,26 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* Reset Array */
|
||||
*addr = 0xffffffff;
|
||||
/* Clear Status Register */
|
||||
*addr = 0x50505050;
|
||||
*addr = INTEL_CLEAR;
|
||||
/* Single Block Erase Command */
|
||||
*addr = 0x20202020;
|
||||
*addr = INTEL_ERASE;
|
||||
/* Confirm */
|
||||
*addr = 0xD0D0D0D0;
|
||||
*addr = INTEL_CONFIRM;
|
||||
|
||||
if((info->flash_id & FLASH_TYPEMASK) != FLASH_LH28F016SCT) {
|
||||
/* Resume Command, as per errata update */
|
||||
*addr = 0xD0D0D0D0;
|
||||
*addr = INTEL_CONFIRM;
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
while ((*addr & 0x80808080) != 0x80808080) {
|
||||
if(*addr & 0x20202020){
|
||||
printf("Error in Block Erase - Lock Bit may be set!\n");
|
||||
printf("Status Register = 0x%X\n", (uint)*addr);
|
||||
*addr = 0xFFFFFFFF; /* reset bank */
|
||||
return 1;
|
||||
}
|
||||
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
|
||||
if ((now=get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
*addr = 0xFFFFFFFF; /* reset bank */
|
||||
*addr = INTEL_RESET; /* reset bank */
|
||||
return 1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
@@ -347,8 +286,15 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
}
|
||||
}
|
||||
|
||||
if (*addr != INTEL_OK) {
|
||||
printf("Block erase failed at %08X, CSR=%08X\n",
|
||||
(uint)addr, (uint)*addr);
|
||||
*addr = INTEL_RESET; /* reset bank */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* reset to read mode */
|
||||
*addr = 0xFFFFFFFF;
|
||||
*addr = INTEL_RESET;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,6 +302,58 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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)
|
||||
{
|
||||
ulong start;
|
||||
int rc = 0;
|
||||
int flag;
|
||||
vu_long *addr = (vu_long *)dest;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
*addr = INTEL_CLEAR; /* Clear status register */
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* Write Command */
|
||||
*addr = INTEL_PROGRAM;
|
||||
|
||||
/* Write Data */
|
||||
*addr = data;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
printf("Write timed out\n");
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*addr != INTEL_OK) {
|
||||
printf ("Write failed at %08X, CSR=%08X\n", (uint)addr, (uint)*addr);
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
*addr = INTEL_RESET; /* Reset to read array mode */
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
@@ -370,6 +368,8 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
|
||||
wp = (addr & ~3); /* get lower word aligned address */
|
||||
|
||||
*(vu_long *)wp = INTEL_RESET; /* Reset to read array mode */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
@@ -424,85 +424,125 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
data = (data << 8) | (*(uchar *)cp);
|
||||
}
|
||||
|
||||
return (write_word(info, wp, data));
|
||||
rc = write_word(info, wp, data);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* Set/Clear sector's lock bit, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
* 1 - Error (timeout, voltage problems, etc.)
|
||||
*/
|
||||
static int write_word (flash_info_t *info, ulong dest, ulong data)
|
||||
int flash_real_protect(flash_info_t *info, long sector, int prot)
|
||||
{
|
||||
vu_long *addr = (vu_long *)dest;
|
||||
ulong start, csr;
|
||||
int flag;
|
||||
ulong start;
|
||||
int i;
|
||||
int rc = 0;
|
||||
vu_long *addr = (vu_long *)(info->start[sector]);
|
||||
int flag = disable_interrupts();
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
return (2);
|
||||
*addr = INTEL_CLEAR; /* Clear status register */
|
||||
if (prot) { /* Set sector lock bit */
|
||||
*addr = INTEL_LOCKBIT; /* Sector lock bit */
|
||||
*addr = INTEL_PROTECT; /* set */
|
||||
}
|
||||
else { /* Clear sector lock bit */
|
||||
*addr = INTEL_LOCKBIT; /* All sectors lock bits */
|
||||
*addr = INTEL_CONFIRM; /* clear */
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/* Write Command */
|
||||
*addr = 0x10101010;
|
||||
|
||||
/* Write Data */
|
||||
*addr = data;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
flag = 0;
|
||||
while (((csr = *addr) & 0x80808080) != 0x80808080) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
flag = 1;
|
||||
start = get_timer(0);
|
||||
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
|
||||
if (get_timer(start) > CFG_FLASH_UNLOCK_TOUT) {
|
||||
printf("Flash lock bit operation timed out\n");
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (csr & 0x40404040) {
|
||||
printf ("CSR indicates write error (%08lx) at %08lx\n", csr, (ulong)addr);
|
||||
flag = 1;
|
||||
|
||||
if (*addr != INTEL_OK) {
|
||||
printf("Flash lock bit operation failed at %08X, CSR=%08X\n",
|
||||
(uint)addr, (uint)*addr);
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
/* Clear Status Registers Command */
|
||||
*addr = 0x50505050;
|
||||
/* Reset to read array mode */
|
||||
*addr = 0xFFFFFFFF;
|
||||
if (!rc)
|
||||
info->protect[sector] = prot;
|
||||
|
||||
return (flag);
|
||||
/*
|
||||
* Clear lock bit command clears all sectors lock bits, so
|
||||
* we have to restore lock bits of protected sectors.
|
||||
*/
|
||||
if (!prot)
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
if (info->protect[i]) {
|
||||
addr = (vu_long *)(info->start[i]);
|
||||
*addr = INTEL_LOCKBIT; /* Sector lock bit */
|
||||
*addr = INTEL_PROTECT; /* set */
|
||||
udelay(CFG_FLASH_LOCK_TOUT * 1000);
|
||||
}
|
||||
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
*addr = INTEL_RESET; /* Reset to read array mode */
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Clear Block Lock Bit, returns:
|
||||
* 0 - OK
|
||||
* 1 - Timeout
|
||||
* Support for flash file system (JFFS2)
|
||||
*
|
||||
* We use custom partition info function because we have to fit the
|
||||
* file system image between first sector (containing hard reset
|
||||
* configuration word) and the sector containing U-Boot image. Standard
|
||||
* partition info function does not allow for last sector specification
|
||||
* and assumes that the file system occupies flash bank up to and
|
||||
* including bank's last sector.
|
||||
*/
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CFG_JFFS_CUSTOM_PART)
|
||||
|
||||
static int clear_block_lock_bit(vu_long * addr)
|
||||
#ifndef CFG_JFFS2_FIRST_SECTOR
|
||||
#define CFG_JFFS2_FIRST_SECTOR 0
|
||||
#endif
|
||||
#ifndef CFG_JFFS2_FIRST_BANK
|
||||
#define CFG_JFFS2_FIRST_BANK 0
|
||||
#endif
|
||||
#ifndef CFG_JFFS2_NUM_BANKS
|
||||
#define CFG_JFFS2_NUM_BANKS 1
|
||||
#endif
|
||||
#define CFG_JFFS2_LAST_BANK (CFG_JFFS2_FIRST_BANK + CFG_JFFS2_NUM_BANKS - 1)
|
||||
|
||||
#include <jffs2/jffs2.h>
|
||||
|
||||
static struct part_info partition;
|
||||
|
||||
struct part_info *jffs2_part_info(int part_num)
|
||||
{
|
||||
ulong start, now;
|
||||
int i;
|
||||
|
||||
/* Reset Array */
|
||||
*addr = 0xffffffff;
|
||||
/* Clear Status Register */
|
||||
*addr = 0x50505050;
|
||||
if (part_num == 0) {
|
||||
if (partition.usr_priv == 0) {
|
||||
partition.offset =
|
||||
(unsigned char *) flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR];
|
||||
for (i = CFG_JFFS2_FIRST_BANK; i <= CFG_JFFS2_LAST_BANK; i++)
|
||||
partition.size += flash_info[i].size;
|
||||
partition.size -=
|
||||
flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR] -
|
||||
flash_info[CFG_JFFS2_FIRST_BANK].start[0];
|
||||
#ifdef CFG_JFFS2_LAST_SECTOR
|
||||
i = flash_info[CFG_JFFS2_LAST_BANK].sector_count - 1;
|
||||
partition.size -=
|
||||
flash_info[CFG_JFFS2_LAST_BANK].start[i] -
|
||||
flash_info[CFG_JFFS2_LAST_BANK].start[CFG_JFFS2_LAST_SECTOR];
|
||||
#endif
|
||||
|
||||
*addr = 0x60606060;
|
||||
*addr = 0xd0d0d0d0;
|
||||
|
||||
start = get_timer (0);
|
||||
while(*addr != 0x80808080){
|
||||
if ((now=get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout on clearing Block Lock Bit\n");
|
||||
*addr = 0xFFFFFFFF; /* reset bank */
|
||||
return 1;
|
||||
partition.usr_priv = (void *)1;
|
||||
}
|
||||
return &partition;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* JFFS2 */
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <common.h>
|
||||
#include <ioports.h>
|
||||
#include <mpc8260.h>
|
||||
#include <asm/m8260_pci.h>
|
||||
#include <i2c.h>
|
||||
#include <spd.h>
|
||||
#include <miiphy.h>
|
||||
@@ -198,11 +199,19 @@ void reset_phy (void)
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
|
||||
/* reset the FEC port */
|
||||
bcsr[1] &= ~FETH_RST;
|
||||
bcsr[1] &= ~FETH1_RST;
|
||||
udelay(2);
|
||||
bcsr[1] |= FETH_RST;
|
||||
bcsr[1] |= FETH1_RST;
|
||||
udelay(1000);
|
||||
#ifdef CONFIG_MII
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
/*
|
||||
* Do not bypass Rx/Tx (de)scrambler (fix configuration error)
|
||||
* Enable autonegotiation.
|
||||
*/
|
||||
miiphy_write(0, 16, 0x610);
|
||||
miiphy_write(0, PHY_BMCR, PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
|
||||
#else
|
||||
/*
|
||||
* Ethernet PHY is configured (by means of configuration pins)
|
||||
* to work at 10Mb/s only. We reconfigure it using MII
|
||||
@@ -212,6 +221,7 @@ void reset_phy (void)
|
||||
miiphy_write(0, PHY_ANAR, 0x01E1); /* Advertise all capabilities */
|
||||
miiphy_write(0, PHY_DCR, 0x0000); /* Do not bypass Rx/Tx (de)scrambler */
|
||||
miiphy_write(0, PHY_BMCR, PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
#endif /* CONFIG_MII */
|
||||
}
|
||||
|
||||
@@ -219,7 +229,7 @@ int board_pre_init (void)
|
||||
{
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
|
||||
bcsr[1] = ~FETHIEN & ~RS232EN_1;
|
||||
bcsr[1] = ~FETHIEN1 & ~RS232EN_1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -228,15 +238,16 @@ int board_pre_init (void)
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
#endif
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
volatile uchar *ramaddr, c = 0xff;
|
||||
|
||||
/* Initialisation is for 16MB DIMM the board is shipped with */
|
||||
long int msize = 16;
|
||||
uint or = 0xFF000CA0;
|
||||
uint psdmr = CFG_PSDMR;
|
||||
uint psrt = CFG_PSRT;
|
||||
long int msize;
|
||||
uint or;
|
||||
uint psdmr;
|
||||
uint psrt;
|
||||
|
||||
int i;
|
||||
|
||||
@@ -245,23 +256,44 @@ long int initdram (int board_type)
|
||||
immap->im_siu_conf.sc_ppc_alrh = 0x01267893;
|
||||
immap->im_siu_conf.sc_tescr1 = 0x00004000;
|
||||
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
/* init local sdram, bank 4 */
|
||||
memctl->memc_lsrt = 0x00000010;
|
||||
memctl->memc_or4 = 0xFFC01480;
|
||||
memctl->memc_br4 = 0x04001861;
|
||||
memctl->memc_lsdmr = 0x2886A522;
|
||||
ramaddr = (uchar *) CFG_LSDRAM_BASE;
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = 0x0886A522;
|
||||
for (i = 0; i < 8; i++) {
|
||||
*ramaddr = c;
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
if ((bcsr[3] & BCSR_PCI_MODE) == 0) { /* PCI mode selected by JP9 */
|
||||
immap->im_clkrst.car_sccr |= M826X_SCCR_PCI_MODE_EN;
|
||||
immap->im_siu_conf.sc_siumcr =
|
||||
(immap->im_siu_conf.sc_siumcr & ~SIUMCR_LBPC11)
|
||||
| SIUMCR_LBPC01;
|
||||
}
|
||||
memctl->memc_lsdmr = 0x1886A522;
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = 0x4086A522;
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
|
||||
/* init sdram dimm */
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
#ifdef CFG_LSDRAM_BASE
|
||||
/*
|
||||
Initialise local bus SDRAM only if the pins
|
||||
are configured as local bus pins and not as PCI.
|
||||
The configuration is determined by the HRCW.
|
||||
*/
|
||||
if ((immap->im_siu_conf.sc_siumcr & SIUMCR_LBPC11) == SIUMCR_LBPC00) {
|
||||
memctl->memc_lsrt = CFG_LSRT;
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS /* CS3 */
|
||||
memctl->memc_or3 = 0xFF803280;
|
||||
memctl->memc_br3 = CFG_LSDRAM_BASE | 0x00001861;
|
||||
#else /* CS4 */
|
||||
memctl->memc_or4 = 0xFFC01480;
|
||||
memctl->memc_br4 = CFG_LSDRAM_BASE | 0x00001861;
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x28000000;
|
||||
ramaddr = (uchar *) CFG_LSDRAM_BASE;
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x08000000;
|
||||
for (i = 0; i < 8; i++)
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x18000000;
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x40000000;
|
||||
}
|
||||
#endif /* CFG_LSDRAM_BASE */
|
||||
|
||||
/* Init 60x bus SDRAM */
|
||||
#ifdef CONFIG_SPD_EEPROM
|
||||
{
|
||||
spd_eeprom_t spd;
|
||||
@@ -398,6 +430,16 @@ long int initdram (int board_type)
|
||||
printf ("OR=%X, PSDMR=%08X, PSRT=%0X\n", or, psdmr, psrt);
|
||||
#endif /* SPD_DEBUG */
|
||||
}
|
||||
#else /* !CONFIG_SPD_EEPROM */
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
msize = 32;
|
||||
or = 0xFE002EC0;
|
||||
#else
|
||||
msize = 16;
|
||||
or = 0xFF000CA0;
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
psdmr = CFG_PSDMR;
|
||||
psrt = CFG_PSRT;
|
||||
#endif /* CONFIG_SPD_EEPROM */
|
||||
memctl->memc_psrt = psrt;
|
||||
memctl->memc_or2 = or;
|
||||
@@ -415,12 +457,20 @@ long int initdram (int board_type)
|
||||
*ramaddr = c;
|
||||
#endif
|
||||
|
||||
/* return total ram size of DIMM */
|
||||
/* return total 60x bus SDRAM size */
|
||||
return (msize * 1024 * 1024);
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
#if CONFIG_ADSTYPE == CFG_8260ADS
|
||||
puts ("Board: Motorola MPC8260ADS\n");
|
||||
#elif CONFIG_ADSTYPE == CFG_8266ADS
|
||||
puts ("Board: Motorola MPC8266ADS\n");
|
||||
#elif CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
puts ("Board: Motorola PQ2FADS-ZU\n");
|
||||
#else
|
||||
puts ("Board: unknown\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -375,138 +375,6 @@ void show_stdio_dev(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* switches the cs0 and the cs1 to the locations.
|
||||
When boot is TRUE, the the mapping is switched
|
||||
to the boot configuration, If it is FALSE, the
|
||||
flash will be switched in the boot area */
|
||||
|
||||
#undef SW_CS_DBG
|
||||
#ifdef SW_CS_DBG
|
||||
#define SW_CS_PRINTF(fmt,args...) printf (fmt ,##args)
|
||||
#else
|
||||
#define SW_CS_PRINTF(fmt,args...)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PIP405) || defined(CONFIG_MIP405)
|
||||
int switch_cs(unsigned char boot)
|
||||
{
|
||||
unsigned long pbcr;
|
||||
int mode;
|
||||
|
||||
mode=get_boot_mode();
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr (ebccfgd);
|
||||
if (mode & BOOT_MPS) {
|
||||
/* Boot width = 8 bit MPS Boot, set up MPS on CS0 */
|
||||
/* we need only to switch if boot from MPS */
|
||||
/* printf(" MPS boot mode detected. ");*/
|
||||
/* printf("cs0 cfg: %lx\n",pbcr); */
|
||||
if(boot) {
|
||||
/* switch to boot configuration */
|
||||
/* this is a 8bit boot, switch cs0 to flash location */
|
||||
SW_CS_PRINTF("switch to boot mode (MPS on High address\n");
|
||||
pbcr&=0x000FFFFF; /*mask base address of the cs0 */
|
||||
pbcr|=(FLASH_BASE0_PRELIM & 0xFFF00000);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
SW_CS_PRINTF(" new cs0 cfg: %lx\n",pbcr);
|
||||
mtdcr(ebccfga, pb1cr); /* get cs1 config reg (flash) */
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
SW_CS_PRINTF(" old cs1 cfg: %lx\n",pbcr);
|
||||
pbcr&=0x000FFFFF; /*mask base address of the cs1 */
|
||||
pbcr|=(MULTI_PURPOSE_SOCKET_ADDR & 0xFFF00000);
|
||||
mtdcr(ebccfga, pb1cr);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
SW_CS_PRINTF(" new cs1 cfg: %lx, MPS is on High Address\n",pbcr);
|
||||
}
|
||||
else {
|
||||
/* map flash to boot area, */
|
||||
SW_CS_PRINTF("map Flash to boot area\n");
|
||||
pbcr&=0x000FFFFF; /*mask base address of the cs0 */
|
||||
pbcr|=(MULTI_PURPOSE_SOCKET_ADDR & 0xFFF00000);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
SW_CS_PRINTF(" new cs0 cfg: %lx\n",pbcr);
|
||||
mtdcr(ebccfga, pb1cr); /* get cs1 config reg (flash) */
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
SW_CS_PRINTF(" cs1 cfg: %lx\n",pbcr);
|
||||
pbcr&=0x000FFFFF; /*mask base address of the cs1 */
|
||||
pbcr|=(FLASH_BASE0_PRELIM & 0xFFF00000);
|
||||
mtdcr(ebccfga, pb1cr);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
SW_CS_PRINTF(" new cs1 cfg: %lx Flash is on High Address\n",pbcr);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
SW_CS_PRINTF("Normal boot, no switching necessary\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int get_boot_mode(void)
|
||||
{
|
||||
unsigned long pbcr;
|
||||
int res = 0;
|
||||
pbcr = mfdcr (strap);
|
||||
if ((pbcr & PSR_ROM_WIDTH_MASK) == 0)
|
||||
/* boot via MPS or MPS mapping */
|
||||
res = BOOT_MPS;
|
||||
if(pbcr & PSR_ROM_LOC)
|
||||
/* boot via PCI.. */
|
||||
res |= BOOT_PCI;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Setup cs0 parameter finally.
|
||||
Map the flash high (in boot area)
|
||||
This code can only be executed from SDRAM (after relocation).
|
||||
*/
|
||||
void setup_cs_reloc(void)
|
||||
{
|
||||
unsigned long pbcr;
|
||||
/* Since we are relocated, we can set-up the CS finaly
|
||||
* but first of all, switch off PCI mapping (in case it was a PCI boot) */
|
||||
out32r(PMM0MA,0L);
|
||||
icache_enable (); /* we are relocated */
|
||||
/* for PCI Boot, we have to set-up the remaining CS correctly */
|
||||
pbcr = mfdcr (strap);
|
||||
if(pbcr & PSR_ROM_LOC) {
|
||||
/* boot via PCI.. */
|
||||
if ((pbcr & PSR_ROM_WIDTH_MASK) == 0) {
|
||||
/* Boot width = 8 bit MPS Boot, set up MPS on CS0 */
|
||||
#ifdef DEBUG
|
||||
printf("Mapping MPS to CS0 @ 0x%lx\n",(MPS_CR_B & 0xfff00000));
|
||||
#endif
|
||||
mtdcr (ebccfga, pb0ap);
|
||||
mtdcr (ebccfgd, MPS_AP);
|
||||
mtdcr (ebccfga, pb0cr);
|
||||
mtdcr (ebccfgd, MPS_CR_B);
|
||||
}
|
||||
else {
|
||||
/* Flash boot, set up the Flash on CS0 */
|
||||
#ifdef DEBUG
|
||||
printf("Mapping Flash to CS0 @ 0x%lx\n",(FLASH_CR_B & 0xfff00000));
|
||||
#endif
|
||||
mtdcr (ebccfga, pb0ap);
|
||||
mtdcr (ebccfgd, FLASH_AP);
|
||||
mtdcr (ebccfga, pb0cr);
|
||||
mtdcr (ebccfgd, FLASH_CR_B);
|
||||
}
|
||||
}
|
||||
switch_cs(0); /* map Flash High */
|
||||
}
|
||||
|
||||
|
||||
#elif defined(CONFIG_VCMA9)
|
||||
int switch_cs(unsigned char boot)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_VCMA9 */
|
||||
|
||||
int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
@@ -625,6 +493,7 @@ void doc_init (void)
|
||||
|
||||
#ifdef CONFIG_CONSOLE_EXTRA_INFO
|
||||
extern GraphicDevice ctfb;
|
||||
extern int get_boot_mode(void);
|
||||
|
||||
void video_get_info_str (int line_number, char *info)
|
||||
{
|
||||
|
||||
@@ -31,10 +31,8 @@ typedef struct {
|
||||
} backup_t;
|
||||
|
||||
void get_backup_values(backup_t *buf);
|
||||
int switch_cs(unsigned char boot);
|
||||
|
||||
#if defined(CONFIG_PIP405) || defined(CONFIG_MIP405)
|
||||
int get_boot_mode(void);
|
||||
void setup_cs_reloc(void);
|
||||
#define BOOT_MPS 0x01
|
||||
#define BOOT_PCI 0x02
|
||||
#endif
|
||||
|
||||
@@ -39,6 +39,13 @@
|
||||
#include <ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
#include "common_util.h"
|
||||
#if defined(CONFIG_MIP405)
|
||||
#include "../mip405/mip405.h"
|
||||
#endif
|
||||
#if defined(CONFIG_PIP405)
|
||||
#include "../pip405/pip405.h"
|
||||
#endif
|
||||
#include <405gp_pci.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
/*-----------------------------------------------------------------------
|
||||
@@ -66,23 +73,102 @@ void unlock_intel_sectors(flash_info_t *info,ulong addr,ulong cnt);
|
||||
#define TRUE 1
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Some CS switching routines:
|
||||
*
|
||||
* On PIP/MIP405 we have 3 (4) possible boot mode
|
||||
*
|
||||
* - Boot from Flash (Flash CS = CS0, MPS CS = CS1)
|
||||
* - Boot from MPS (Flash CS = CS1, MPS CS = CS0)
|
||||
* - Boot from PCI with Flash map (Flash CS = CS0, MPS CS = CS1)
|
||||
* - Boot from PCI with MPS map (Flash CS = CS1, MPS CS = CS0)
|
||||
* The flash init is the first board specific routine which is called
|
||||
* after code relocation (running from SDRAM)
|
||||
* The first thing we do is to map the Flash CS to the Flash area and
|
||||
* the MPS CS to the MPS area. Since the flash size is unknown at this
|
||||
* point, we use the max flash size and the lowest flash address as base.
|
||||
*
|
||||
* After flash detection we adjust the size of the CS area accordingly.
|
||||
* The board_init_r will fill in wrong values in the board init structure,
|
||||
* but this will be fixed in the misc_init_r routine:
|
||||
* bd->bi_flashstart=0-flash_info[0].size
|
||||
* bd->bi_flashsize=flash_info[0].size-CFG_MONITOR_LEN
|
||||
* bd->bi_flashoffset=0
|
||||
*
|
||||
*/
|
||||
int get_boot_mode(void)
|
||||
{
|
||||
unsigned long pbcr;
|
||||
int res = 0;
|
||||
pbcr = mfdcr (strap);
|
||||
if ((pbcr & PSR_ROM_WIDTH_MASK) == 0)
|
||||
/* boot via MPS or MPS mapping */
|
||||
res = BOOT_MPS;
|
||||
if(pbcr & PSR_ROM_LOC)
|
||||
/* boot via PCI.. */
|
||||
res |= BOOT_PCI;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Map the flash high (in boot area)
|
||||
This code can only be executed from SDRAM (after relocation).
|
||||
*/
|
||||
void setup_cs_reloc(void)
|
||||
{
|
||||
int mode;
|
||||
/* Since we are relocated, we can set-up the CS finaly
|
||||
* but first of all, switch off PCI mapping (in case it was a PCI boot) */
|
||||
out32r(PMM0MA,0L);
|
||||
icache_enable (); /* we are relocated */
|
||||
/* get boot mode */
|
||||
mode=get_boot_mode();
|
||||
/* we map the flash high in every case */
|
||||
/* first findout on which cs the flash is */
|
||||
if(mode & BOOT_MPS) {
|
||||
/* map flash high on CS1 and MPS on CS0 */
|
||||
mtdcr (ebccfga, pb0ap);
|
||||
mtdcr (ebccfgd, MPS_AP);
|
||||
mtdcr (ebccfga, pb0cr);
|
||||
mtdcr (ebccfgd, MPS_CR);
|
||||
/* we use the default values (max values) for the flash
|
||||
* because its real size is not yet known */
|
||||
mtdcr (ebccfga, pb1ap);
|
||||
mtdcr (ebccfgd, FLASH_AP);
|
||||
mtdcr (ebccfga, pb1cr);
|
||||
mtdcr (ebccfgd, FLASH_CR_B);
|
||||
}
|
||||
else {
|
||||
/* map flash high on CS0 and MPS on CS1 */
|
||||
mtdcr (ebccfga, pb1ap);
|
||||
mtdcr (ebccfgd, MPS_AP);
|
||||
mtdcr (ebccfga, pb1cr);
|
||||
mtdcr (ebccfgd, MPS_CR);
|
||||
/* we use the default values (max values) for the flash
|
||||
* because its real size is not yet known */
|
||||
mtdcr (ebccfga, pb0ap);
|
||||
mtdcr (ebccfgd, FLASH_AP);
|
||||
mtdcr (ebccfga, pb0cr);
|
||||
mtdcr (ebccfgd, FLASH_CR_B);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0, size_b1;
|
||||
int i;
|
||||
unsigned long size_b0, size_b1,flashcr;
|
||||
int mode, i;
|
||||
extern char version_string;
|
||||
char *p=&version_string;
|
||||
|
||||
/* Since we are relocated, we can set-up the CS finally */
|
||||
setup_cs_reloc();
|
||||
/* get and display boot mode */
|
||||
i=get_boot_mode();
|
||||
if(i & BOOT_PCI)
|
||||
printf("(PCI Boot %s Map) ",(i & BOOT_MPS) ?
|
||||
mode=get_boot_mode();
|
||||
if(mode & BOOT_PCI)
|
||||
printf("(PCI Boot %s Map) ",(mode & BOOT_MPS) ?
|
||||
"MPS" : "Flash");
|
||||
else
|
||||
printf("(%s Boot) ",(i & BOOT_MPS) ?
|
||||
printf("(%s Boot) ",(mode & BOOT_MPS) ?
|
||||
"MPS" : "Flash");
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
@@ -91,7 +177,7 @@ 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]);
|
||||
size_b0 = flash_get_size((vu_long *)CFG_MONITOR_BASE, &flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
@@ -105,10 +191,35 @@ unsigned long flash_init (void)
|
||||
CFG_MONITOR_BASE+monitor_flash_len-1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
/* protect reset vector */
|
||||
flash_info[0].protect[flash_info[0].sector_count-1] = 1;
|
||||
size_b1 = 0 ;
|
||||
flash_info[0].size = size_b0;
|
||||
/* set up flash cs according to the size */
|
||||
if(mode & BOOT_MPS) {
|
||||
/* flash is on CS1 */
|
||||
mtdcr(ebccfga, pb1cr);
|
||||
flashcr = mfdcr (ebccfgd);
|
||||
/* we map the flash high in every case */
|
||||
flashcr&=0x0001FFFF; /* mask out address bits */
|
||||
flashcr|= ((0-flash_info[0].size) & 0xFFF00000); /* start addr */
|
||||
flashcr|= (((flash_info[0].size >>21) & 0x07) << 17); /* size addr */
|
||||
mtdcr(ebccfga, pb1cr);
|
||||
mtdcr(ebccfgd, flashcr);
|
||||
}
|
||||
else {
|
||||
/* flash is on CS0 */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
flashcr = mfdcr (ebccfgd);
|
||||
/* we map the flash high in every case */
|
||||
flashcr&=0x0001FFFF; /* mask out address bits */
|
||||
flashcr|= ((0-flash_info[0].size) & 0xFFF00000); /* start addr */
|
||||
flashcr|= (((flash_info[0].size >>21) & 0x07) << 17); /* size addr */
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
mtdcr(ebccfgd, flashcr);
|
||||
}
|
||||
#if 0
|
||||
/* include this if you want to test if
|
||||
/* enable this if you want to test if
|
||||
the relocation has be done ok.
|
||||
This will disable both Chipselects */
|
||||
mtdcr (ebccfga, pb0cr);
|
||||
@@ -117,6 +228,14 @@ unsigned long flash_init (void)
|
||||
mtdcr (ebccfgd, 0L);
|
||||
printf("CS0 & CS1 switched off for test\n");
|
||||
#endif
|
||||
/* patch version_string */
|
||||
for(i=0;i<0x100;i++) {
|
||||
if(*p=='\n') {
|
||||
*p=0;
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
@@ -169,6 +288,8 @@ void flash_print_info (flash_info_t *info)
|
||||
break;
|
||||
case FLASH_INTEL320T: printf ("TE28F320C3 (32 Mbit, top sector size)\n");
|
||||
break;
|
||||
case FLASH_AM640U: printf ("AM29LV640U (64 Mbit, uniform sector size)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
@@ -209,7 +330,8 @@ void flash_print_info (flash_info_t *info)
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
@@ -218,7 +340,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
FLASH_WORD_SIZE value;
|
||||
ulong base = (ulong)addr;
|
||||
ulong base;
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
@@ -248,7 +370,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
value = addr2[1]; /* device ID */
|
||||
/* printf("Device value %x\n",value); */
|
||||
/* printf("Device value %x\n",value); */
|
||||
switch (value) {
|
||||
case (FLASH_WORD_SIZE)AMD_ID_F040B:
|
||||
info->flash_id += FLASH_AM040;
|
||||
@@ -290,12 +412,17 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
info->sector_count = 35;
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
#if 0 /* enable when device IDs are available */
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV320T:
|
||||
info->flash_id += FLASH_AM320T;
|
||||
info->sector_count = 67;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV640U:
|
||||
info->flash_id += FLASH_AM640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000;
|
||||
break; /* => 8 MB */
|
||||
#if 0 /* enable when device IDs are available */
|
||||
|
||||
case (FLASH_WORD_SIZE)AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
@@ -326,10 +453,12 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
return (0); /* => no or unknown flash */
|
||||
|
||||
}
|
||||
|
||||
/* base address calculation */
|
||||
base=0-info->size;
|
||||
/* set up sector start address table */
|
||||
if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) ||
|
||||
(info->flash_id == FLASH_AM040)){
|
||||
(info->flash_id == FLASH_AM040) ||
|
||||
(info->flash_id == FLASH_AM640U)){
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = base + (i * 0x00010000);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "kbd.h"
|
||||
#include "video.h"
|
||||
|
||||
extern int drv_isa_kbd_init (void);
|
||||
|
||||
#undef ISA_DEBUG
|
||||
|
||||
@@ -49,6 +48,9 @@ extern int drv_isa_kbd_init (void);
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PIP405)
|
||||
|
||||
extern int drv_isa_kbd_init (void);
|
||||
|
||||
/* fdc (logical device 0) */
|
||||
const SIO_LOGDEV_TABLE sio_fdc[] = {
|
||||
@@ -183,7 +185,7 @@ void isa_sio_setup(void)
|
||||
close_cfg_super_IO(0x3F0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* IRQ Controller
|
||||
@@ -202,7 +204,7 @@ static struct isa_irq_action isa_irqs[16];
|
||||
/*
|
||||
* This contains the irq mask for both 8259A irq controllers,
|
||||
*/
|
||||
static unsigned int cached_irq_mask = 0xffff;
|
||||
static unsigned int cached_irq_mask = 0xfff9;
|
||||
|
||||
#define cached_imr1 (unsigned char)cached_irq_mask
|
||||
#define cached_imr2 (unsigned char)(cached_irq_mask>>8)
|
||||
@@ -387,19 +389,22 @@ int handle_isa_int(void)
|
||||
isr2=in8(ISR_2);
|
||||
isr1=in8(ISR_1);
|
||||
irq=(unsigned char)irqack;
|
||||
if((irq==7)&&((isr1&0x80)==0)) {
|
||||
irq-=32;
|
||||
/* if((irq==7)&&((isr1&0x80)==0)) {
|
||||
PRINTF("IRQ7 detected but not in ISR\n");
|
||||
}
|
||||
else {
|
||||
/* we should handle cascaded interrupts here also */
|
||||
/* printf("ISA Irq %d\n",irq); */
|
||||
isa_irqs[irq].count++;
|
||||
if (isa_irqs[irq].handler != NULL)
|
||||
(*isa_irqs[irq].handler)(isa_irqs[irq].arg); /* call isr */
|
||||
else
|
||||
*/ /* we should handle cascaded interrupts here also */
|
||||
{
|
||||
PRINTF ("bogus interrupt vector 0x%x\n", irq);
|
||||
}
|
||||
/* printf("ISA Irq %d\n",irq); */
|
||||
isa_irqs[irq].count++;
|
||||
if(irq!=2) { /* just swallow the cascade irq 2 */
|
||||
if (isa_irqs[irq].handler != NULL)
|
||||
(*isa_irqs[irq].handler)(isa_irqs[irq].arg); /* call isr */
|
||||
else {
|
||||
PRINTF ("bogus interrupt vector 0x%x\n", irq);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* issue EOI instruction to clear the IRQ */
|
||||
mask_and_ack_8259A(irq);
|
||||
@@ -413,13 +418,13 @@ int handle_isa_int(void)
|
||||
|
||||
void isa_irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
|
||||
{
|
||||
if (isa_irqs[vec].handler != NULL) {
|
||||
printf ("ISA Interrupt vector %d: handler 0x%x replacing 0x%x\n",
|
||||
vec, (uint)handler, (uint)isa_irqs[vec].handler);
|
||||
}
|
||||
isa_irqs[vec].handler = handler;
|
||||
isa_irqs[vec].arg = arg;
|
||||
enable_8259A_irq(vec);
|
||||
if (isa_irqs[vec].handler != NULL) {
|
||||
printf ("ISA Interrupt vector %d: handler 0x%x replacing 0x%x\n",
|
||||
vec, (uint)handler, (uint)isa_irqs[vec].handler);
|
||||
}
|
||||
isa_irqs[vec].handler = handler;
|
||||
isa_irqs[vec].arg = arg;
|
||||
enable_8259A_irq(vec);
|
||||
PRINTF ("Install ISA IRQ %d ==> %p, @ %p mask=%04x\n", vec, handler, &isa_irqs[vec].handler,cached_irq_mask);
|
||||
|
||||
}
|
||||
@@ -427,9 +432,9 @@ void isa_irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
|
||||
void isa_irq_free_handler(int vec)
|
||||
{
|
||||
disable_8259A_irq(vec);
|
||||
isa_irqs[vec].handler = NULL;
|
||||
isa_irqs[vec].arg = NULL;
|
||||
printf ("Free ISA IRQ %d mask=%04x\n", vec, cached_irq_mask);
|
||||
isa_irqs[vec].handler = NULL;
|
||||
isa_irqs[vec].arg = NULL;
|
||||
PRINTF ("Free ISA IRQ %d mask=%04x\n", vec, cached_irq_mask);
|
||||
|
||||
}
|
||||
|
||||
@@ -448,16 +453,42 @@ void isa_init_irq_contr(void)
|
||||
init_8259A();
|
||||
out8(IMR_2,0xFF);
|
||||
}
|
||||
/*************************************************************************/
|
||||
|
||||
void isa_show_irq(void)
|
||||
{
|
||||
int vec;
|
||||
|
||||
printf ("\nISA Interrupt-Information:\n");
|
||||
printf ("Nr Routine Arg Count\n");
|
||||
|
||||
for (vec=0; vec<16; vec++) {
|
||||
if (isa_irqs[vec].handler != NULL) {
|
||||
printf ("%02d %08lx %08lx %d\n",
|
||||
vec,
|
||||
(ulong)isa_irqs[vec].handler,
|
||||
(ulong)isa_irqs[vec].arg,
|
||||
isa_irqs[vec].count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int isa_irq_get_count(int vec)
|
||||
{
|
||||
return(isa_irqs[vec].count);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* Init the ISA bus and devices.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_PIP405)
|
||||
|
||||
int isa_init(void)
|
||||
{
|
||||
isa_sio_setup();
|
||||
isa_init_irq_contr();
|
||||
drv_isa_kbd_init();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _PIP405_ISA_H_
|
||||
#define _PIP405_ISA_H_
|
||||
#ifndef _ISA_H_
|
||||
#define _ISA_H_
|
||||
/* Super IO */
|
||||
#define SIO_CFG_PORT 0x3F0 /* Config Port Address */
|
||||
|
||||
|
||||
#if defined(CONFIG_PIP405)
|
||||
/* table fore SIO initialization */
|
||||
typedef struct {
|
||||
const uchar index;
|
||||
@@ -44,10 +44,14 @@ unsigned char read_cfg_super_IO(int address, unsigned char function, unsigned ch
|
||||
void write_cfg_super_IO(int address, unsigned char function, unsigned char regaddr, unsigned char data);
|
||||
void close_cfg_super_IO(int address);
|
||||
void isa_sio_setup(void);
|
||||
void isa_sio_setup(void);
|
||||
#endif
|
||||
|
||||
void isa_irq_install_handler(int vec, interrupt_handler_t *handler, void *arg);
|
||||
void isa_irq_free_handler(int vec);
|
||||
int handle_isa_int(void);
|
||||
void isa_init_irq_contr(void);
|
||||
void isa_show_irq(void);
|
||||
int isa_irq_get_count(int vec);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -494,7 +494,7 @@ void mem_test_reloc(void)
|
||||
}
|
||||
|
||||
|
||||
int mem_test (unsigned long start, unsigned long ramsize, int quiet, int reloc)
|
||||
int mem_test (unsigned long start, unsigned long ramsize, int quiet)
|
||||
{
|
||||
unsigned long errors, stage;
|
||||
unsigned long startaddr, size, i;
|
||||
|
||||
@@ -92,7 +92,7 @@ extern void pci_pip405_write_regs(struct pci_controller *,
|
||||
/* PIIX4 ISA Bridge Function 0 */
|
||||
static struct pci_pip405_config_entry piix4_isa_bridge_f0[] = {
|
||||
{PCI_CFG_PIIX4_SERIRQ, 0xD0, 1}, /* enable Continous SERIRQ Pin */
|
||||
{PCI_CFG_PIIX4_GENCFG, 0x00010041, 4}, /* enable SERIRQs, ISA, PNP */
|
||||
{PCI_CFG_PIIX4_GENCFG, 0x00018041, 4}, /* enable SERIRQs, ISA, PNP, GPI11 */
|
||||
{PCI_CFG_PIIX4_TOM, 0xFE, 1}, /* Top of Memory */
|
||||
{PCI_CFG_PIIX4_XBCS, 0x02C4, 2}, /* disable all peri CS */
|
||||
{PCI_CFG_PIIX4_RTCCFG, 0x21, 1}, /* enable RTC */
|
||||
@@ -106,11 +106,12 @@ static struct pci_pip405_config_entry piix4_isa_bridge_f0[] = {
|
||||
|
||||
/* PIIX4 IDE Controller Function 1 */
|
||||
static struct pci_pip405_config_entry piix4_ide_cntrl_f1[] = {
|
||||
{PCI_CFG_PIIX4_BMIBA, 0x0001000, 4}, /* set BMI to a valid address */
|
||||
{PCI_COMMAND, 0x0001, 2}, /* enable IO access */
|
||||
#if !defined(CONFIG_MIP405T)
|
||||
{PCI_CFG_PIIX4_IDETIM, 0x80008000, 4}, /* enable Both IDE channels */
|
||||
#else
|
||||
{PCI_CFG_PIIX4_IDETIM, 0x80000000, 4}, /* enable IDE channel0 */
|
||||
{PCI_CFG_PIIX4_IDETIM, 0x00008000, 4}, /* enable IDE channel0 */
|
||||
#endif
|
||||
{ } /* end of device table */
|
||||
};
|
||||
@@ -129,10 +130,10 @@ static struct pci_pip405_config_entry piix4_usb_cntrl_f2[] = {
|
||||
|
||||
/* PIIX4 Power Management Function 3 */
|
||||
static struct pci_pip405_config_entry piix4_pmm_cntrl_f3[] = {
|
||||
{PCI_COMMAND, 0x0001, 2}, /* enable IO access */
|
||||
{PCI_CFG_PIIX4_PMAB, 0x00004000, 4}, /* set PMBA to "valid" value */
|
||||
{PCI_CFG_PIIX4_PMMISC, 0x01, 1}, /* enable PMBA IO access */
|
||||
{PCI_CFG_PIIX4_PMBA, 0x00004000, 4}, /* set PMBA to "valid" value */
|
||||
{PCI_CFG_PIIX4_SMBBA, 0x00005000, 4}, /* set SMBBA to "valid" value */
|
||||
{PCI_CFG_PIIX4_PMMISC, 0x01, 1}, /* enable PMBA IO access */
|
||||
{PCI_COMMAND, 0x0001, 2}, /* enable IO access */
|
||||
{ } /* end of device table */
|
||||
};
|
||||
/* PPC405 Dummy only used to prevent autosetup on this host bridge */
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
#define PCI_CFG_PIIX4_LEGSUP 0xC0
|
||||
|
||||
/* Function 3 Power Management */
|
||||
#define PCI_CFG_PIIX4_PMAB 0x40
|
||||
#define PCI_CFG_PIIX4_PMBA 0x40
|
||||
#define PCI_CFG_PIIX4_CNTA 0x44
|
||||
#define PCI_CFG_PIIX4_CNTB 0x48
|
||||
#define PCI_CFG_PIIX4_GPICTL 0x4C
|
||||
|
||||
@@ -53,11 +53,14 @@ int do_mip405(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
return (do_mplcommon(cmdtp, flag, argc, argv));
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(mip405) = MK_CMD_ENTRY(
|
||||
"mip405", 6, 1, do_mip405,
|
||||
U_BOOT_CMD(
|
||||
mip405, 8, 1, do_mip405,
|
||||
"mip405 - MIP405 specific Cmds\n",
|
||||
"flash mem [SrcAddr] - updates U-Boot with image in memory\n"
|
||||
"mip405 flash mps - updates U-Boot with image from MPS\n"
|
||||
"mip405 info - displays board information\n"
|
||||
"mip405 led <on> - switches LED on (on=1) or off (on=0)\n"
|
||||
"mip405 mem [cnt] - Memory Test <cnt>-times, <cnt> = -1 loop forever\n"
|
||||
);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -87,19 +87,15 @@ ext_bus_cntlr_init:
|
||||
mfdcr r4,ebccfgd
|
||||
|
||||
andi. r0, r4, 0x2000 /* mask out irrelevant bits */
|
||||
beq 0f /* jump if 8 bit bus width */
|
||||
beq 0f /* jump if 8 bit bus width */
|
||||
|
||||
/* setup 16 bit things (Flash Boot)
|
||||
/* setup 16 bit things
|
||||
*-----------------------------------------------------------------------
|
||||
* Memory Bank 0 (16 Bit Flash) initialization
|
||||
*---------------------------------------------------------------------- */
|
||||
|
||||
addi r4,0,pb0ap
|
||||
mtdcr ebccfga,r4
|
||||
/* addis r4,0,0xFF8F */
|
||||
/* ori r4,r4,0xFE80 */
|
||||
/* addis r4,0,0x9B01 */
|
||||
/* ori r4,r4,0x5480 */
|
||||
addis r4,0,(FLASH_AP_B)@h
|
||||
ori r4,r4,(FLASH_AP_B)@l
|
||||
mtdcr ebccfgd,r4
|
||||
@@ -107,8 +103,6 @@ ext_bus_cntlr_init:
|
||||
addi r4,0,pb0cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x010(4MB),BU=0x3(R/W), */
|
||||
/* addis r4,0,((FLASH_BASE0_PRELIM & 0xFFF00000) | 0x00050000)@h */
|
||||
/* ori r4,r4,0xA000 / * BW=0x01(16 bits) */
|
||||
addis r4,0,(FLASH_CR_B)@h
|
||||
ori r4,r4,(FLASH_CR_B)@l
|
||||
mtdcr ebccfgd,r4
|
||||
@@ -123,21 +117,13 @@ ext_bus_cntlr_init:
|
||||
/* 0x7F8FFE80 slowest boot */
|
||||
addi r4,0,pb0ap
|
||||
mtdcr ebccfga,r4
|
||||
#if 0
|
||||
addis r4,0,0x9B01
|
||||
ori r4,r4,0x5480
|
||||
#else
|
||||
addis r4,0,(MPS_AP_B)@h
|
||||
ori r4,r4,(MPS_AP_B)@l
|
||||
#endif
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb0cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x010(4MB),BU=0x3(R/W), */
|
||||
/* addis r4,0,((FLASH_BASE0_PRELIM & 0xFFF00000) | 0x00050000)@h */
|
||||
/* ori r4,r4,0x8000 / * BW=0x0( 8 bits) */
|
||||
|
||||
addis r4,0,(MPS_CR_B)@h
|
||||
ori r4,r4,(MPS_CR_B)@l
|
||||
|
||||
@@ -178,18 +164,18 @@ ext_bus_cntlr_init:
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb6cr
|
||||
addi r4,0,pb6cr
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0000
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb7cr
|
||||
addi r4,0,pb7cr
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0000
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
nop /* pass2 DCR errata #8 */
|
||||
nop /* pass2 DCR errata #8 */
|
||||
blr
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
#include <miiphy.h>
|
||||
#include "../common/common_util.h"
|
||||
#include <i2c.h>
|
||||
#include <rtc.h>
|
||||
extern block_dev_desc_t * scsi_get_dev(int dev);
|
||||
extern block_dev_desc_t * ide_get_dev(int dev);
|
||||
|
||||
@@ -110,14 +111,14 @@ typedef struct {
|
||||
} sdram_t;
|
||||
#if defined(CONFIG_MIP405T)
|
||||
const sdram_t sdram_table[] = {
|
||||
{ 0x01, /* MIP405T Rev A, 64MByte -1 Board */
|
||||
{ 0x0F, /* MIP405T Rev A, 64MByte -1 Board */
|
||||
3, /* Case Latenty = 3 */
|
||||
3, /* trp 20ns / 7.5 ns datain[27] */
|
||||
3, /* trcd 20ns /7.5 ns (datain[29]) */
|
||||
6, /* tras 44ns /7.5 ns (datain[30]) */
|
||||
4, /* tcpt 44 - 20ns = 24ns */
|
||||
3, /* Address Mode = 3 (13x9x4) */
|
||||
4, /* size value (64MByte) */
|
||||
2, /* Address Mode = 2 (12x9x4) */
|
||||
3, /* size value (32MByte) */
|
||||
0}, /* ECC disabled */
|
||||
{ 0xff, /* terminator */
|
||||
0xff,
|
||||
@@ -281,11 +282,6 @@ int init_sdram (void)
|
||||
if((bc & 0x80)==0x80)
|
||||
SDRAM_err ("U-Boot configured for a MIP405 not for a MIP405T!!!\n");
|
||||
#endif
|
||||
#if !defined(CONFIG_MIP405T)
|
||||
/* since the ECC initialisation needs some time,
|
||||
* we show that we're alive
|
||||
*/
|
||||
serial_puts ("\nInitializing SDRAM, Please stand by");
|
||||
/* set-up the chipselect machine */
|
||||
mtdcr (ebccfga, pb0cr); /* get cs0 config reg */
|
||||
tmp = mfdcr (ebccfgd);
|
||||
@@ -311,7 +307,6 @@ int init_sdram (void)
|
||||
mtdcr (ebccfgd, UART1_AP);
|
||||
mtdcr (ebccfga, pb3cr);
|
||||
mtdcr (ebccfgd, UART1_CR);
|
||||
#endif
|
||||
bc = in8 (PLD_BOARD_CFG_REG);
|
||||
#ifdef SDRAM_DEBUG
|
||||
serial_puts ("\nstart SDRAM Setup\n");
|
||||
@@ -333,6 +328,11 @@ int init_sdram (void)
|
||||
write_hex (i);
|
||||
serial_puts (" \n");
|
||||
#endif
|
||||
/* since the ECC initialisation needs some time,
|
||||
* we show that we're alive
|
||||
*/
|
||||
if (sdram_table[i].ecc)
|
||||
serial_puts ("\nInitializing SDRAM, Please stand by");
|
||||
cal_val = sdram_table[i].cal - 1; /* Cas Latency */
|
||||
trp_clocks = sdram_table[i].trp; /* 20ns / 7.5 ns datain[27] */
|
||||
trcd_clocks = sdram_table[i].trcd; /* 20ns /7.5 ns (datain[29]) */
|
||||
@@ -559,7 +559,7 @@ void get_pcbrev_var(unsigned char *pcbrev, unsigned char *var)
|
||||
unsigned char bc;
|
||||
bc = in8 (PLD_BOARD_CFG_REG);
|
||||
*pcbrev=(bc >> 4) & 0xf;
|
||||
*var=bc & 0xf ;
|
||||
*var=16-(bc & 0xf);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -654,8 +654,6 @@ long int initdram (int board_type)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
extern int mem_test (unsigned long start, unsigned long ramsize,
|
||||
int quiet);
|
||||
|
||||
static int test_dram (unsigned long ramsize)
|
||||
{
|
||||
@@ -666,8 +664,22 @@ static int test_dram (unsigned long ramsize)
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* used to check if the time in RTC is valid */
|
||||
static unsigned long start;
|
||||
static struct rtc_time tm;
|
||||
extern flash_info_t flash_info[]; /* info for FLASH chips */
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
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_flashsize=flash_info[0].size-CFG_MONITOR_LEN;
|
||||
gd->bd->bi_flashoffset=0;
|
||||
|
||||
/* check, if RTC is running */
|
||||
rtc_get (&tm);
|
||||
start=get_timer(0);
|
||||
/* if MIP405 has booted from PCI, reset CCR0[24] as described in errata PCI_18 */
|
||||
if (mfdcr(strap) & PSR_ROM_LOC)
|
||||
mtspr(ccr0, (mfspr(ccr0) & ~0x80));
|
||||
@@ -688,9 +700,13 @@ void print_mip405_rev (void)
|
||||
}
|
||||
|
||||
extern void mem_test_reloc(void);
|
||||
extern int mk_date (char *, struct rtc_time *);
|
||||
|
||||
int last_stage_init (void)
|
||||
{
|
||||
unsigned long stop;
|
||||
struct rtc_time newtm;
|
||||
unsigned char *s;
|
||||
mem_test_reloc();
|
||||
/* write correct LED configuration */
|
||||
if (miiphy_write (0x1, 0x14, 0x2402) != 0) {
|
||||
@@ -704,6 +720,25 @@ int last_stage_init (void)
|
||||
print_mip405_rev ();
|
||||
show_stdio_dev ();
|
||||
check_env ();
|
||||
/* check if RTC time is valid */
|
||||
stop=get_timer(start);
|
||||
while(stop<1200) { /* we wait 1.2 sec to check if the RTC is running */
|
||||
udelay(1000);
|
||||
stop=get_timer(start);
|
||||
}
|
||||
rtc_get (&newtm);
|
||||
if(tm.tm_sec==newtm.tm_sec) {
|
||||
s=getenv("defaultdate");
|
||||
if(!s)
|
||||
mk_date ("010112001970", &newtm);
|
||||
else
|
||||
if(mk_date (s, &newtm)!=0) {
|
||||
printf("RTC: Bad date format in defaultdate\n");
|
||||
return 0;
|
||||
}
|
||||
rtc_reset ();
|
||||
rtc_set(&newtm);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -745,10 +780,10 @@ void print_mip405_info (void)
|
||||
printf ("SER1 uses handshakes %s\n",
|
||||
(ext & 0x80) ? "DTR/DSR" : "RTS/CTS");
|
||||
#else
|
||||
printf ("User Config Switch %d %d %d %d %d %d %d %d %d\n",
|
||||
printf ("User Config Switch %d %d %d %d %d %d %d %d\n",
|
||||
(ext) & 0x1, (ext >> 1) & 0x1, (ext >> 2) & 0x1,
|
||||
(ext >> 3) & 0x1, (ext >> 4) & 0x1, (ext >> 5) & 0x1,
|
||||
(ext >> 6) & 0x1,(ext >> 7) & 0x1,(ext >> 8) & 0x1);
|
||||
(ext >> 6) & 0x1,(ext >> 7) & 0x1);
|
||||
#endif
|
||||
printf ("IDE Reset %s\n", (ext & 0x01) ? "asserted" : "not asserted");
|
||||
printf ("IRQs:\n");
|
||||
|
||||
@@ -137,13 +137,13 @@ void user_led0(unsigned char on);
|
||||
(FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define FLASH_BS 2 /* 4 MByte */
|
||||
#define FLASH_BS FLASH_SIZE_PRELIM /* 4 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define FLASH_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define FLASH_BW 1 /* 16Bit */
|
||||
/* CR register for Boot */
|
||||
#define FLASH_CR_B ((FLASH_BASE0_PRELIM & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
|
||||
#define FLASH_CR_B ((FLASH_BASE_PRELIM & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
|
||||
/* CR register for non Boot */
|
||||
#define FLASH_CR ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
|
||||
|
||||
@@ -172,11 +172,12 @@ void user_led0(unsigned char on);
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define MPS_BS 2 /* 4 MByte */
|
||||
#define MPS_BS_B FLASH_SIZE_PRELIM /* 1 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define MPS_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define MPS_BW 0 /* 8Bit */
|
||||
/* CR register for Boot */
|
||||
#define MPS_CR_B ((FLASH_BASE0_PRELIM & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
|
||||
#define MPS_CR_B ((FLASH_BASE_PRELIM & 0xfff00000) + (MPS_BS_B << 17) + (MPS_BU << 15) + (MPS_BW << 13))
|
||||
/* CR register for non Boot */
|
||||
#define MPS_CR ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
|
||||
|
||||
@@ -58,8 +58,8 @@ int do_pip405(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
return (do_mplcommon(cmdtp, flag, argc, argv));
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(pip405) = MK_CMD_ENTRY(
|
||||
"pip405", 6, 1, do_pip405,
|
||||
U_BOOT_CMD(
|
||||
pip405, 6, 1, do_pip405,
|
||||
"pip405 - PIP405 specific Cmds\n",
|
||||
"flash mem [SrcAddr] - updates U-Boot with image in memory\n"
|
||||
"pip405 flash floppy [SrcAddr] - updates U-Boot with image from floppy\n"
|
||||
|
||||
@@ -41,17 +41,21 @@
|
||||
|
||||
#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
|
||||
|
||||
#include "configs/PIP405.h"
|
||||
#include <configs/PIP405.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
#include "pip405.h"
|
||||
|
||||
.globl ext_bus_cntlr_init
|
||||
ext_bus_cntlr_init:
|
||||
mflr r4 /* save link register */
|
||||
mfdcr r3,strap /* get strapping reg */
|
||||
andi. r0, r3, PSR_ROM_LOC /* mask out irrelevant bits */
|
||||
bnelr /* jump back if PCI boot */
|
||||
|
||||
.globl ext_bus_cntlr_init
|
||||
ext_bus_cntlr_init:
|
||||
mflr r4 /* save link register */
|
||||
bl ..getAddr
|
||||
..getAddr:
|
||||
mflr r3 /* get address of ..getAddr */
|
||||
@@ -82,7 +86,7 @@ ext_bus_cntlr_init:
|
||||
mfdcr r4,ebccfgd
|
||||
|
||||
andi. r0, r4, 0x2000 /* mask out irrelevant bits */
|
||||
beq 0f /* jump if 8 bit bus width */
|
||||
beq 0f /* jump if 8 bit bus width */
|
||||
|
||||
/* setup 16 bit things
|
||||
*-----------------------------------------------------------------------
|
||||
@@ -90,74 +94,49 @@ ext_bus_cntlr_init:
|
||||
*---------------------------------------------------------------------- */
|
||||
|
||||
addi r4,0,pb0ap
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x9B01
|
||||
ori r4,r4,0x5480
|
||||
mtdcr ebccfgd,r4
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,(FLASH_AP_B)@h
|
||||
ori r4,r4,(FLASH_AP_B)@l
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb0cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x011(8MB),BU=0x3(R/W), */
|
||||
addis r4,0,((FLASH_BASE0_PRELIM & 0xFFF00000) | 0x00050000)@h
|
||||
ori r4,r4,0xA000 /* BW=0x01(16 bits) */
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Memory Bank 1 (Multi Purpose Socket) initialization
|
||||
*----------------------------------------------------------------------*/
|
||||
addi r4,0,pb1ap
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0281
|
||||
ori r4,r4,0x5480
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb1cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x011(8MB),BU=0x3(R/W), */
|
||||
addis r4,0,((MULTI_PURPOSE_SOCKET_ADDR & 0xFFF00000) | 0x00050000)@h
|
||||
ori r4,r4,0x8000 /* BW=0x0( 8 bits) */
|
||||
mtdcr ebccfgd,r4
|
||||
addi r4,0,pb0cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x010(4MB),BU=0x3(R/W), */
|
||||
addis r4,0,(FLASH_CR_B)@h
|
||||
ori r4,r4,(FLASH_CR_B)@l
|
||||
mtdcr ebccfgd,r4
|
||||
b 1f
|
||||
|
||||
0:
|
||||
/* 8Bit boot mode: */
|
||||
/* 8Bit boot mode: */
|
||||
/*-----------------------------------------------------------------------
|
||||
* Memory Bank 0 Multi Purpose Socket initialization
|
||||
*----------------------------------------------------------------------- */
|
||||
|
||||
* Memory Bank 0 Multi Purpose Socket initialization
|
||||
*----------------------------------------------------------------------- */
|
||||
/* 0x7F8FFE80 slowest boot */
|
||||
addi r4,0,pb0ap
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x9B01
|
||||
ori r4,r4,0x5480
|
||||
mtdcr ebccfgd,r4
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,(MPS_AP_B)@h
|
||||
ori r4,r4,(MPS_AP_B)@l
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb0cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x011(4MB),BU=0x3(R/W), */
|
||||
addis r4,0,((FLASH_BASE0_PRELIM & 0xFFF00000) | 0x00050000)@h
|
||||
ori r4,r4,0x8000 /* BW=0x0( 8 bits) */
|
||||
mtdcr ebccfgd,r4
|
||||
addi r4,0,pb0cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x010(4MB),BU=0x3(R/W), */
|
||||
addis r4,0,(MPS_CR_B)@h
|
||||
ori r4,r4,(MPS_CR_B)@l
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Memory Bank 1 (Flash) initialization
|
||||
*-----------------------------------------------------------------------*/
|
||||
addi r4,0,pb1ap
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0281
|
||||
ori r4,r4,0x5480
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb1cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x011(8MB),BU=0x3(R/W), */
|
||||
addis r4,0,((MULTI_PURPOSE_SOCKET_ADDR & 0xFFF00000) | 0x00050000)@h
|
||||
ori r4,r4,0xA000 /* BW=0x0( 8 bits) */
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
1:
|
||||
/*-----------------------------------------------------------------------
|
||||
* Memory Bank 2-3-4-5-6 (not used) initialization
|
||||
*-----------------------------------------------------------------------*/
|
||||
addi r4,0,pb1cr
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0000
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb2cr
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0000
|
||||
@@ -182,28 +161,18 @@ ext_bus_cntlr_init:
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb6cr
|
||||
addi r4,0,pb6cr
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0000
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Memory Bank 7 (Config Register) initialization
|
||||
*----------------------------------------------------------------------- */
|
||||
addi r4,0,pb7ap
|
||||
mtdcr ebccfga,r4
|
||||
addis r4,0,0x0181 /* Doc says TWT=3 and Openios TWT=3!! */
|
||||
ori r4,r4,0x5280 /* disable Ready, BEM=0 */
|
||||
mtdcr ebccfgd,r4
|
||||
|
||||
addi r4,0,pb7cr
|
||||
mtdcr ebccfga,r4
|
||||
/* BS=0x0(1MB),BU=0x3(R/W), */
|
||||
addis r4,0,((CONFIG_PORT_ADDR & 0xFFF00000) | 0x00010000)@h
|
||||
ori r4,r4,0x8000 /* BW=0x0(8 bits) */
|
||||
addis r4,0,0x0000
|
||||
ori r4,r4,0x0000
|
||||
mtdcr ebccfgd,r4
|
||||
nop /* pass2 DCR errata #8 */
|
||||
nop /* pass2 DCR errata #8 */
|
||||
blr
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
@@ -217,3 +186,45 @@ sdram_init:
|
||||
|
||||
|
||||
blr
|
||||
|
||||
|
||||
#if defined(CONFIG_BOOT_PCI)
|
||||
.section .bootpg,"ax"
|
||||
.globl _start_pci
|
||||
/*******************************************
|
||||
*/
|
||||
|
||||
_start_pci:
|
||||
/* first handle errata #68 / PCI_18 */
|
||||
iccci r0, r0 /* invalidate I-cache */
|
||||
lis r31, 0
|
||||
mticcr r31 /* ICCR = 0 (all uncachable) */
|
||||
isync
|
||||
|
||||
mfccr0 r28 /* set CCR0[24] = 1 */
|
||||
ori r28, r28, 0x0080
|
||||
mtccr0 r28
|
||||
|
||||
/* setup PMM0MA (0xEF400004) and PMM0PCIHA (0xEF40000C) */
|
||||
lis r28, 0xEF40
|
||||
addi r28, r28, 0x0004
|
||||
stw r31, 0x0C(r28) /* clear PMM0PCIHA */
|
||||
lis r29, 0xFFF8 /* open 512 kByte */
|
||||
addi r29, r29, 0x0001/* and enable this region */
|
||||
stwbrx r29, r0, r28 /* write PMM0MA */
|
||||
|
||||
lis r28, 0xEEC0 /* address of PCIC0_CFGADDR */
|
||||
addi r29, r28, 4 /* add 4 to r29 -> PCIC0_CFGDATA */
|
||||
|
||||
lis r31, 0x8000 /* set en bit bus 0 */
|
||||
ori r31, r31, 0x304C/* device 6 func 0 reg 4C (XBCS register) */
|
||||
stwbrx r31, r0, r28 /* write it */
|
||||
|
||||
lwbrx r31, r0, r29 /* load XBCS register */
|
||||
oris r31, r31, 0x02C4/* clear BIOSCS WPE, set lower, extended and 1M extended BIOS enable */
|
||||
stwbrx r31, r0, r29 /* write back XBCS register */
|
||||
|
||||
nop
|
||||
nop
|
||||
b _start /* normal start */
|
||||
#endif
|
||||
|
||||
@@ -194,6 +194,11 @@ int board_pre_init (void)
|
||||
#ifdef SDRAM_DEBUG
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#endif
|
||||
/* set up the config port */
|
||||
mtdcr (ebccfga, pb7ap);
|
||||
mtdcr (ebccfgd, CONFIG_PORT_AP);
|
||||
mtdcr (ebccfga, pb7cr);
|
||||
mtdcr (ebccfgd, CONFIG_PORT_CR);
|
||||
|
||||
memclk = get_bus_freq (tmemclk);
|
||||
tmemclk = 1000000000 / (memclk / 100); /* in 10 ps units */
|
||||
@@ -657,8 +662,20 @@ static int test_dram (unsigned long ramsize)
|
||||
}
|
||||
|
||||
|
||||
extern flash_info_t flash_info[]; /* info for FLASH chips */
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
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_flashsize=flash_info[0].size-CFG_MONITOR_LEN;
|
||||
gd->bd->bi_flashoffset=0;
|
||||
|
||||
/* if PIP405 has booted from PCI, reset CCR0[24] as described in errata PCI_18 */
|
||||
if (mfdcr(strap) & PSR_ROM_LOC)
|
||||
mtspr(ccr0, (mfspr(ccr0) & ~0x80));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* Global routines used for PIP405
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
extern int mem_test(unsigned long start, unsigned long ramsize,int mode);
|
||||
|
||||
@@ -35,13 +36,13 @@ void user_led1(unsigned char on);
|
||||
|
||||
|
||||
#define PLD_BASE_ADDRESS CFG_ISA_IO_BASE_ADDRESS + 0x800
|
||||
#define PLD_PART_REG PLD_BASE_ADDRESS + 0
|
||||
#define PLD_VERS_REG PLD_BASE_ADDRESS + 1
|
||||
#define PLD_PART_REG PLD_BASE_ADDRESS + 0
|
||||
#define PLD_VERS_REG PLD_BASE_ADDRESS + 1
|
||||
#define PLD_BOARD_CFG_REG PLD_BASE_ADDRESS + 2
|
||||
#define PLD_LED_USER_REG PLD_BASE_ADDRESS + 3
|
||||
#define PLD_SYS_MAN_REG PLD_BASE_ADDRESS + 4
|
||||
#define PLD_FLASH_COM_REG PLD_BASE_ADDRESS + 5
|
||||
#define PLD_CAN_REG PLD_BASE_ADDRESS + 6
|
||||
#define PLD_CAN_REG PLD_BASE_ADDRESS + 6
|
||||
#define PLD_SER_PWR_REG PLD_BASE_ADDRESS + 7
|
||||
#define PLD_COM_PWR_REG PLD_BASE_ADDRESS + 8
|
||||
#define PLD_NIC_VGA_REG PLD_BASE_ADDRESS + 9
|
||||
@@ -50,86 +51,32 @@ void user_led1(unsigned char on);
|
||||
#define PIIX4_VENDOR_ID 0x8086
|
||||
#define PIIX4_IDE_DEV_ID 0x7111
|
||||
|
||||
|
||||
/* timings */
|
||||
/* PLD (CS7) */
|
||||
#define PLD_BME 0 /* Burst disable */
|
||||
#define PLD_TWE 5 /* 5 * 30ns 120ns Waitstates (access=TWT+1+TH) */
|
||||
#define PLD_CSN 1 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
|
||||
#define PLD_OEN 1 /* Cycles from CS low to OE low */
|
||||
#define PLD_WBN 1 /* Cycles from CS low to WE low */
|
||||
#define PLD_WBF 1 /* Cycles from WE high to CS high */
|
||||
#define PLD_TH 2 /* Number of hold cycles after transfer */
|
||||
#define PLD_RE 0 /* Ready disabled */
|
||||
#define PLD_SOR 1 /* Sample on Ready disabled */
|
||||
#define PLD_BEM 0 /* Byte Write only active on Write cycles */
|
||||
#define PLD_PEN 0 /* Parity disable */
|
||||
#define PLD_AP ((PLD_BME << 31) + (PLD_TWE << 23) + (PLD_CSN << 18) + (PLD_OEN << 16) + (PLD_WBN << 14) + \
|
||||
(PLD_WBF << 12) + (PLD_TH << 9) + (PLD_RE << 8) + (PLD_SOR << 7) + (PLD_BEM << 6) + (PLD_PEN << 5))
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define PLD_BS 0 /* 1 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define PLD_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define PLD_BW 0 /* 16Bit */
|
||||
#define PLD_CR ((PER_PLD_ADDR & 0xfff00000) + (PLD_BS << 17) + (PLD_BU << 15) + (PLD_BW << 13))
|
||||
|
||||
#endif
|
||||
|
||||
/* timings */
|
||||
|
||||
#define PER_BOARD_ADDR (PER_UART1_ADDR+(1024*1024))
|
||||
/* Dummy CS to get the board revision */
|
||||
#define BOARD_BME 0 /* Burst disable */
|
||||
#define BOARD_TWE 255 /* 255 * 30ns 120ns Waitstates (access=TWT+1+TH) */
|
||||
#define BOARD_CSN 1 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
|
||||
#define BOARD_OEN 1 /* Cycles from CS low to OE low */
|
||||
#define BOARD_WBN 1 /* Cycles from CS low to WE low */
|
||||
#define BOARD_WBF 1 /* Cycles from WE high to CS high */
|
||||
#define BOARD_TH 2 /* Number of hold cycles after transfer */
|
||||
#define BOARD_RE 0 /* Ready disabled */
|
||||
#define BOARD_SOR 1 /* Sample on Ready disabled */
|
||||
#define BOARD_BEM 0 /* Byte Write only active on Write cycles */
|
||||
#define BOARD_PEN 0 /* Parity disable */
|
||||
#define BOARD_AP ((BOARD_BME << 31) + (BOARD_TWE << 23) + (BOARD_CSN << 18) + (BOARD_OEN << 16) + (BOARD_WBN << 14) + \
|
||||
(BOARD_WBF << 12) + (BOARD_TH << 9) + (BOARD_RE << 8) + (BOARD_SOR << 7) + (BOARD_BEM << 6) + (BOARD_PEN << 5))
|
||||
/* CS Config register (CS7) */
|
||||
#define CONFIG_PORT_BME 0 /* Burst disable */
|
||||
#define CONFIG_PORT_TWE 255 /* 255 * 30ns 120ns Waitstates (access=TWT+1+TH) */
|
||||
#define CONFIG_PORT_CSN 1 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
|
||||
#define CONFIG_PORT_OEN 1 /* Cycles from CS low to OE low */
|
||||
#define CONFIG_PORT_WBN 1 /* Cycles from CS low to WE low */
|
||||
#define CONFIG_PORT_WBF 1 /* Cycles from WE high to CS high */
|
||||
#define CONFIG_PORT_TH 2 /* Number of hold cycles after transfer */
|
||||
#define CONFIG_PORT_RE 0 /* Ready disabled */
|
||||
#define CONFIG_PORT_SOR 1 /* Sample on Ready disabled */
|
||||
#define CONFIG_PORT_BEM 0 /* Byte Write only active on Write cycles */
|
||||
#define CONFIG_PORT_PEN 0 /* Parity disable */
|
||||
#define CONFIG_PORT_AP ((CONFIG_PORT_BME << 31) + (CONFIG_PORT_TWE << 23) + (CONFIG_PORT_CSN << 18) + (CONFIG_PORT_OEN << 16) + (CONFIG_PORT_WBN << 14) + \
|
||||
(CONFIG_PORT_WBF << 12) + (CONFIG_PORT_TH << 9) + (CONFIG_PORT_RE << 8) + (CONFIG_PORT_SOR << 7) + (CONFIG_PORT_BEM << 6) + (CONFIG_PORT_PEN << 5))
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define BOARD_BS 0 /* 1 MByte */
|
||||
#define CONFIG_PORT_BS 0 /* 1 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define BOARD_BU 3 /* R/W */
|
||||
#define CONFIG_PORT_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define BOARD_BW 0 /* 16Bit */
|
||||
#define BOARD_CR ((PER_BOARD_ADDR & 0xfff00000) + (BOARD_BS << 17) + (BOARD_BU << 15) + (BOARD_BW << 13))
|
||||
|
||||
|
||||
/* UART0 CS2 */
|
||||
#define UART0_BME 0 /* Burst disable */
|
||||
#define UART0_TWE 7 /* 7 * 30ns 210ns Waitstates (access=TWT+1+TH) */
|
||||
#define UART0_CSN 1 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
|
||||
#define UART0_OEN 1 /* Cycles from CS low to OE low */
|
||||
#define UART0_WBN 1 /* Cycles from CS low to WE low */
|
||||
#define UART0_WBF 1 /* Cycles from WE high to CS high */
|
||||
#define UART0_TH 2 /* Number of hold cycles after transfer */
|
||||
#define UART0_RE 0 /* Ready disabled */
|
||||
#define UART0_SOR 1 /* Sample on Ready disabled */
|
||||
#define UART0_BEM 0 /* Byte Write only active on Write cycles */
|
||||
#define UART0_PEN 0 /* Parity disable */
|
||||
#define UART0_AP ((UART0_BME << 31) + (UART0_TWE << 23) + (UART0_CSN << 18) + (UART0_OEN << 16) + (UART0_WBN << 14) + \
|
||||
(UART0_WBF << 12) + (UART0_TH << 9) + (UART0_RE << 8) + (UART0_SOR << 7) + (UART0_BEM << 6) + (UART0_PEN << 5))
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define UART0_BS 0 /* 1 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define UART0_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define UART0_BW 0 /* 8Bit */
|
||||
#define UART0_CR ((PER_UART0_ADDR & 0xfff00000) + (UART0_BS << 17) + (UART0_BU << 15) + (UART0_BW << 13))
|
||||
|
||||
/* UART1 CS3 */
|
||||
#define UART1_AP UART0_AP /* same timing as UART0 */
|
||||
#define UART1_CR ((PER_UART1_ADDR & 0xfff00000) + (UART0_BS << 17) + (UART0_BU << 15) + (UART0_BW << 13))
|
||||
|
||||
#define CONFIG_PORT_BW 0 /* 16Bit */
|
||||
#define CONFIG_PORT_CR ((CONFIG_PORT_ADDR & 0xfff00000) + (CONFIG_PORT_BS << 17) + (CONFIG_PORT_BU << 15) + (CONFIG_PORT_BW << 13))
|
||||
|
||||
/* Flash CS0 or CS 1 */
|
||||
/* 0x7F8FFE80 slowest timing at all... */
|
||||
@@ -149,19 +96,19 @@ void user_led1(unsigned char on);
|
||||
#define FLASH_PEN 0 /* Parity disable */
|
||||
/* Access Parameter Register for non Boot */
|
||||
#define FLASH_AP ((FLASH_BME << 31) + (FLASH_TWE << 23) + (FLASH_CSN << 18) + (FLASH_OEN << 16) + (FLASH_WBN << 14) + \
|
||||
(FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
|
||||
(FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
|
||||
/* Access Parameter Register for Boot */
|
||||
#define FLASH_AP_B ((FLASH_BME_B << 31) + (FLASH_FWT_B << 26) + (FLASH_BWT_B << 23) + (FLASH_CSN << 18) + (FLASH_OEN << 16) + (FLASH_WBN << 14) + \
|
||||
(FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
|
||||
(FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define FLASH_BS 2 /* 4 MByte */
|
||||
#define FLASH_BS FLASH_SIZE_PRELIM /* 4 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define FLASH_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define FLASH_BW 1 /* 16Bit */
|
||||
/* CR register for Boot */
|
||||
#define FLASH_CR_B ((FLASH_BASE0_PRELIM & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
|
||||
#define FLASH_CR_B ((FLASH_BASE_PRELIM & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
|
||||
/* CR register for non Boot */
|
||||
#define FLASH_CR ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
|
||||
|
||||
@@ -183,18 +130,19 @@ void user_led1(unsigned char on);
|
||||
#define MPS_PEN 0 /* Parity disable */
|
||||
/* Access Parameter Register for non Boot */
|
||||
#define MPS_AP ((MPS_BME << 31) + (MPS_TWE << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
|
||||
(MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
|
||||
(MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
|
||||
/* Access Parameter Register for Boot */
|
||||
#define MPS_AP_B ((MPS_BME_B << 31) + (MPS_FWT_B << 26) + (MPS_BWT_B << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
|
||||
(MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
|
||||
#define MPS_AP_B ((MPS_BME_B << 31) + (MPS_FWT_B << 26) + (MPS_BWT_B << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
|
||||
(MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
|
||||
|
||||
/* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
|
||||
#define MPS_BS 2 /* 4 MByte */
|
||||
#define MPS_BS_B FLASH_SIZE_PRELIM /* 1 MByte */
|
||||
/* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
|
||||
#define MPS_BU 3 /* R/W */
|
||||
/* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
|
||||
#define MPS_BW 0 /* 8Bit */
|
||||
/* CR register for Boot */
|
||||
#define MPS_CR_B ((FLASH_BASE0_PRELIM & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
|
||||
#define MPS_CR_B ((FLASH_BASE_PRELIM & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
|
||||
/* CR register for non Boot */
|
||||
#define MPS_CR ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
|
||||
|
||||
@@ -57,7 +57,6 @@ SECTIONS
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
cpu/mpc8xx/speed.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
@@ -67,7 +66,6 @@ SECTIONS
|
||||
lib_generic/string.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_ppc/kgdb.o (.text)
|
||||
/* lib_ppc/ticks.o (.text) */
|
||||
|
||||
. = env_offset;
|
||||
common/environment.o(.text)
|
||||
|
||||
47
board/omap1510inn/Makefile
Normal file
47
board/omap1510inn/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001, 2002
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := omap1510innovator.o flash.o
|
||||
SOBJS := platform.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
25
board/omap1510inn/config.mk
Normal file
25
board/omap1510inn/config.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# (C) Copyright 2002
|
||||
# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
#
|
||||
# (C) Copyright 2003
|
||||
# Texas Instruments, <www.ti.com>
|
||||
# Kshitij Gupta <Kshitij@ti.com>
|
||||
#
|
||||
# TI Innovator board with OMAP1510 (ARM925T) cpu
|
||||
# see http://www.ti.com/ for more information on Texas Insturments
|
||||
#
|
||||
# Innovator has 1 bank of 256 MB SDRAM
|
||||
# Physical Address:
|
||||
# 1000'0000 to 2000'0000
|
||||
#
|
||||
#
|
||||
# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000 (mem base + reserved)
|
||||
#
|
||||
# we load ourself to 1100'0000
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
TEXT_BASE = 0x11000000
|
||||
428
board/omap1510inn/flash.c
Normal file
428
board/omap1510inn/flash.c
Normal file
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
* (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>
|
||||
|
||||
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* Board support for 1 or 2 flash devices */
|
||||
#undef FLASH_PORT_WIDTH32
|
||||
#define FLASH_PORT_WIDTH16
|
||||
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
#define FLASH_PORT_WIDTH ushort
|
||||
#define FLASH_PORT_WIDTHV vu_short
|
||||
#define SWAP(x) __swab16(x)
|
||||
#else
|
||||
#define FLASH_PORT_WIDTH ulong
|
||||
#define FLASH_PORT_WIDTHV vu_long
|
||||
#define SWAP(x) __swab32(x)
|
||||
#endif
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define mb() __asm__ __volatile__ ("" : : : "memory")
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info);
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
void inline spin_wheel (void);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i;
|
||||
ulong size = 0;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
|
||||
flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic ("configured to many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
flash_protect ( FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + 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 = (FPW) 0x00500050; /* clear status register cmd. */
|
||||
*addr = (FPW) 0x00FF00FF; /* resest to read mode */
|
||||
|
||||
printf (" done\n");
|
||||
}
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
* 4 - Flash not identified
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp;
|
||||
FPW data;
|
||||
int count, i, l, rc, port_width;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
/* get lower word aligned address */
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
wp = (addr & ~1);
|
||||
port_width = 2;
|
||||
#else
|
||||
wp = (addr & ~3);
|
||||
port_width = 4;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < port_width && cnt > 0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
count = 0;
|
||||
while (cnt >= port_width) {
|
||||
data = 0;
|
||||
for (i = 0; i < port_width; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
cnt -= port_width;
|
||||
if (count++ > 0x800) {
|
||||
spin_wheel ();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
return (write_data (info, wp, SWAP (data)));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word or halfword to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data)
|
||||
{
|
||||
FPWV *addr = (FPWV *) dest;
|
||||
ulong status;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
printf ("not erased at %08lx (%x)\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;
|
||||
}
|
||||
131
board/omap1510inn/omap1510innovator.c
Normal file
131
board/omap1510inn/omap1510innovator.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* 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>
|
||||
|
||||
static void flash__init (void);
|
||||
static void ether__init (void);
|
||||
|
||||
static inline void delay (unsigned long loops)
|
||||
{
|
||||
__asm__ volatile ("1:\n"
|
||||
"subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0" (loops));
|
||||
}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* arch number of OMAP 1510-Board */
|
||||
gd->bd->bi_arch_number = 234;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x10000100;
|
||||
|
||||
/* kk - this speeds up your boot a quite a bit. However to make it
|
||||
* work, you need make sure your kernel startup flush bug is fixed.
|
||||
* ... rkw ...
|
||||
*/
|
||||
icache_enable ();
|
||||
|
||||
flash__init ();
|
||||
ether__init ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/* volatile ushort *gdir = (ushort *) (GPIO_DIR_CONTROL_REG); */
|
||||
/* volatile ushort *mdir = (ushort *) (MPUIO_DIR_CONTROL_REG); */
|
||||
|
||||
/* setup gpio direction to match board (no floats!) */
|
||||
/**gdir = 0xCFF9; */
|
||||
/**mdir = 0x103F; */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
static void flash__init (void)
|
||||
{
|
||||
#define CS0_CHIP_SELECT_REG 0xfffecc10
|
||||
#define CS3_CHIP_SELECT_REG 0xfffecc1c
|
||||
#define EMIFS_GlB_Config_REG 0xfffecc0c
|
||||
|
||||
{
|
||||
unsigned int regval;
|
||||
|
||||
regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG);
|
||||
regval = regval | 0x0001; /* Turn off write protection for flash devices. */
|
||||
if (regval & 0x0002) {
|
||||
regval = regval & 0xfffd; /* Swap CS0 and CS3 so that flash is visible at 0x0 and eeprom at 0x0c000000. */
|
||||
/* If, instead, you want to reference flash at 0x0c000000, then it seemed the following were necessary. */
|
||||
/* *((volatile unsigned int *)CS0_CHIP_SELECT_REG) = 0x202090; / * Overrides head.S setting of 0x212090 */
|
||||
/* *((volatile unsigned int *)CS3_CHIP_SELECT_REG) = 0x202090; / * Let's flash chips be fully functional. */
|
||||
}
|
||||
*((volatile unsigned int *) EMIFS_GlB_Config_REG) = regval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
static void ether__init (void)
|
||||
{
|
||||
#define ETH_CONTROL_REG 0x0800000b
|
||||
/* take the Ethernet controller out of reset and wait
|
||||
* for the EEPROM load to complete.
|
||||
*/
|
||||
*((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
|
||||
udelay (3);
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
389
board/omap1510inn/platform.S
Normal file
389
board/omap1510inn/platform.S
Normal file
@@ -0,0 +1,389 @@
|
||||
/*
|
||||
* Board specific setup info
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
*
|
||||
* -- Some bits of code used from rrload's head_OMAP1510.s --
|
||||
* Copyright (C) 2002 RidgeRun, 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>
|
||||
|
||||
#if defined(CONFIG_OMAP1510)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
#define OMAP1510_CLKS ((1<<EN_XORPCK)|(1<<EN_PERCK)|(1<<EN_TIMCK)|(1<<EN_GPIOCK))
|
||||
|
||||
|
||||
_TEXT_BASE:
|
||||
.word TEXT_BASE /* sdram load addr from config.mk */
|
||||
|
||||
.globl platformsetup
|
||||
platformsetup:
|
||||
|
||||
/*
|
||||
* Configure 1510 pins functions to match our board.
|
||||
*/
|
||||
ldr r0, REG_PULL_DWN_CTRL_0
|
||||
ldr r1, VAL_PULL_DWN_CTRL_0
|
||||
str r1, [r0]
|
||||
ldr r0, REG_PULL_DWN_CTRL_1
|
||||
ldr r1, VAL_PULL_DWN_CTRL_1
|
||||
str r1, [r0]
|
||||
ldr r0, REG_PULL_DWN_CTRL_2
|
||||
ldr r1, VAL_PULL_DWN_CTRL_2
|
||||
str r1, [r0]
|
||||
ldr r0, REG_PULL_DWN_CTRL_3
|
||||
ldr r1, VAL_PULL_DWN_CTRL_3
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_4
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_4
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_5
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_5
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_6
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_6
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_7
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_7
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_8
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_8
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_9
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_9
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_A
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_A
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_B
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_B
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_C
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_C
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_D
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_D
|
||||
str r1, [r0]
|
||||
ldr r0, REG_VOLTAGE_CTRL_0
|
||||
ldr r1, VAL_VOLTAGE_CTRL_0
|
||||
str r1, [r0]
|
||||
ldr r0, REG_TEST_DBG_CTRL_0
|
||||
ldr r1, VAL_TEST_DBG_CTRL_0
|
||||
str r1, [r0]
|
||||
ldr r0, REG_MOD_CONF_CTRL_0
|
||||
ldr r1, VAL_MOD_CONF_CTRL_0
|
||||
str r1, [r0]
|
||||
|
||||
/* Move to 1510 mode */
|
||||
ldr r0, REG_COMP_MODE_CTRL_0
|
||||
ldr r1, VAL_COMP_MODE_CTRL_0
|
||||
str r1, [r0]
|
||||
|
||||
/* Set up Traffic Ctlr*/
|
||||
ldr r0, REG_TC_IMIF_PRIO
|
||||
mov r1, #0x0
|
||||
str r1, [r0]
|
||||
ldr r0, REG_TC_EMIFS_PRIO
|
||||
str r1, [r0]
|
||||
ldr r0, REG_TC_EMIFF_PRIO
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_TC_EMIFS_CONFIG
|
||||
ldr r1, [r0]
|
||||
bic r1, r1, #0x08 /* clear the global power-down enable PDE bit */
|
||||
bic r1, r1, #0x01 /* write protect flash by clearing the WP bit */
|
||||
str r1, [r0] /* EMIFS GlB Configuration. (value 0x12 most likely) */
|
||||
|
||||
/* Setup some clock domains */
|
||||
ldr r1, =OMAP1510_CLKS
|
||||
ldr r0, REG_ARM_IDLECT2
|
||||
strh r1, [r0] /* CLKM, Clock domain control. */
|
||||
|
||||
mov r1, #0x01 /* PER_EN bit */
|
||||
ldr r0, REG_ARM_RSTCT2
|
||||
strh r1, [r0] /* CLKM; Peripheral reset. */
|
||||
|
||||
/* Set CLKM to Sync-Scalable */
|
||||
/* I supposidly need to enable the dsp clock before switching */
|
||||
mov r1, #0x1000
|
||||
ldr r0, REG_ARM_SYSST
|
||||
strh r1, [r0]
|
||||
mov r0, #0x400
|
||||
1:
|
||||
subs r0, r0, #0x1 /* wait for any bubbles to finish */
|
||||
bne 1b
|
||||
|
||||
ldr r1, VAL_ARM_CKCTL /* use 12Mhz ref, PER must be <= 50Mhz so /2 */
|
||||
ldr r0, REG_ARM_CKCTL
|
||||
strh r1, [r0]
|
||||
|
||||
/* setup DPLL 1 */
|
||||
ldr r1, VAL_DPLL1_CTL
|
||||
ldr r0, REG_DPLL1_CTL
|
||||
strh r1, [r0]
|
||||
ands r1, r1, #0x10 /* Check if PLL is enabled. */
|
||||
beq lock_end /* Do not look for lock if BYPASS selected */
|
||||
2:
|
||||
ldrh r1, [r0]
|
||||
ands r1, r1, #0x01 /* Check the LOCK bit. */
|
||||
beq 2b /* ...loop until bit goes hi. */
|
||||
lock_end:
|
||||
|
||||
/* Set memory timings corresponding to the new clock speed */
|
||||
|
||||
/* Check execution location to determine current execution location
|
||||
* and branch to appropriate initialization code.
|
||||
*/
|
||||
mov r0, #0x10000000 /* Load physical SDRAM base. */
|
||||
mov r1, pc /* Get current execution location. */
|
||||
cmp r1, r0 /* Compare. */
|
||||
bge skip_sdram /* Skip over EMIF-fast initialization if running from SDRAM. */
|
||||
|
||||
/*
|
||||
* Delay for SDRAM initialization.
|
||||
*/
|
||||
mov r3, #0x1800 /* value should be checked */
|
||||
3:
|
||||
subs r3, r3, #0x1 /* Decrement count */
|
||||
bne 3b
|
||||
|
||||
/*
|
||||
* Set SDRAM control values. Disable refresh before MRS command.
|
||||
*/
|
||||
ldr r0, VAL_TC_EMIFF_SDRAM_CONFIG /* get good value */
|
||||
bic r3, r0, #0xC /* (BIT3|BIT2) ulConfig with auto-refresh disabled. */
|
||||
orr r3, r3, #0x8000000 /* (BIT27) Disable CLK when Power down or Self-Refresh */
|
||||
orr r3, r3, #0x4000000 /* BIT26 Power Down Enable */
|
||||
ldr r2, REG_TC_EMIFF_SDRAM_CONFIG /* Point to configuration register. */
|
||||
str r3, [r2] /* Store the passed value with AR disabled. */
|
||||
|
||||
ldr r1, VAL_TC_EMIFF_MRS /* get MRS value */
|
||||
ldr r2, REG_TC_EMIFF_MRS /* Point to MRS register. */
|
||||
str r1, [r2] /* Store the passed value.*/
|
||||
|
||||
ldr r2, REG_TC_EMIFF_SDRAM_CONFIG /* Point to configuration register. */
|
||||
str r0, [r2] /* Store the passed value. */
|
||||
|
||||
/*
|
||||
* Delay for SDRAM initialization.
|
||||
*/
|
||||
mov r3, #0x1800
|
||||
4:
|
||||
subs r3, r3, #1 /* Decrement count. */
|
||||
bne 4b
|
||||
|
||||
skip_sdram:
|
||||
|
||||
/* slow interface */
|
||||
ldr r1, VAL_TC_EMIFS_CS0_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS0_CONFIG
|
||||
str r1, [r0] /* Chip Select 0 */
|
||||
ldr r1, VAL_TC_EMIFS_CS1_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS1_CONFIG
|
||||
str r1, [r0] /* Chip Select 1 */
|
||||
ldr r1, VAL_TC_EMIFS_CS2_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS2_CONFIG
|
||||
str r1, [r0] /* Chip Select 2 */
|
||||
ldr r1, VAL_TC_EMIFS_CS3_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS3_CONFIG
|
||||
str r1, [r0] /* Chip Select 3 */
|
||||
|
||||
/* Next, Enable the RS232 Line Drivers in the FPGA. */
|
||||
/* Also, power on the audio CODEC's amplifier here, */
|
||||
/* which will make a noise on the audio output. */
|
||||
/* This is done here instead of in the kernel so there */
|
||||
/* isn't a loud popping noise at the start of each */
|
||||
/* song. */
|
||||
/* Also, disable the CODEC's clocks. */
|
||||
/* omap1510-HelenP1 [specific] */
|
||||
|
||||
ldr r0, REG_FPGA_POWER
|
||||
mov r1, #0
|
||||
ldr r2, REG_FPGA_DIP_SWITCH
|
||||
ldrb r3, [r2]
|
||||
cmp r3, #0x8
|
||||
movne r1, #0x62 /* Enable the RS232 Line Drivers in the EPLD */
|
||||
strb r1, [r0]
|
||||
ldr r0, REG_FPGA_AUDIO
|
||||
mov r1, #0x0 /* Disable sound driver (CODEC clocks) */
|
||||
strb r1, [r0]
|
||||
|
||||
/* back to arch calling code */
|
||||
mov pc, lr
|
||||
|
||||
/* the literal pools origin */
|
||||
.ltorg
|
||||
|
||||
/* OMAP configuration registers */
|
||||
REG_FUNC_MUX_CTRL_0: /* 32 bits */
|
||||
.word 0xfffe1000
|
||||
REG_FUNC_MUX_CTRL_1: /* 32 bits */
|
||||
.word 0xfffe1004
|
||||
REG_FUNC_MUX_CTRL_2: /* 32 bits */
|
||||
.word 0xfffe1008
|
||||
REG_COMP_MODE_CTRL_0: /* 32 bits */
|
||||
.word 0xfffe100c
|
||||
REG_FUNC_MUX_CTRL_3: /* 32 bits */
|
||||
.word 0xfffe1010
|
||||
REG_FUNC_MUX_CTRL_4: /* 32 bits */
|
||||
.word 0xfffe1014
|
||||
REG_FUNC_MUX_CTRL_5: /* 32 bits */
|
||||
.word 0xfffe1018
|
||||
REG_FUNC_MUX_CTRL_6: /* 32 bits */
|
||||
.word 0xfffe101c
|
||||
REG_FUNC_MUX_CTRL_7: /* 32 bits */
|
||||
.word 0xfffe1020
|
||||
REG_FUNC_MUX_CTRL_8: /* 32 bits */
|
||||
.word 0xfffe1024
|
||||
REG_FUNC_MUX_CTRL_9: /* 32 bits */
|
||||
.word 0xfffe1028
|
||||
REG_FUNC_MUX_CTRL_A: /* 32 bits */
|
||||
.word 0xfffe102C
|
||||
REG_FUNC_MUX_CTRL_B: /* 32 bits */
|
||||
.word 0xfffe1030
|
||||
REG_FUNC_MUX_CTRL_C: /* 32 bits */
|
||||
.word 0xfffe1034
|
||||
REG_FUNC_MUX_CTRL_D: /* 32 bits */
|
||||
.word 0xfffe1038
|
||||
REG_PULL_DWN_CTRL_0: /* 32 bits */
|
||||
.word 0xfffe1040
|
||||
REG_PULL_DWN_CTRL_1: /* 32 bits */
|
||||
.word 0xfffe1044
|
||||
REG_PULL_DWN_CTRL_2: /* 32 bits */
|
||||
.word 0xfffe1048
|
||||
REG_PULL_DWN_CTRL_3: /* 32 bits */
|
||||
.word 0xfffe104c
|
||||
REG_VOLTAGE_CTRL_0: /* 32 bits */
|
||||
.word 0xfffe1060
|
||||
REG_TEST_DBG_CTRL_0: /* 32 bits */
|
||||
.word 0xfffe1070
|
||||
REG_MOD_CONF_CTRL_0: /* 32 bits */
|
||||
.word 0xfffe1080
|
||||
REG_TC_IMIF_PRIO: /* 32 bits */
|
||||
.word 0xfffecc00
|
||||
REG_TC_EMIFS_PRIO: /* 32 bits */
|
||||
.word 0xfffecc04
|
||||
REG_TC_EMIFF_PRIO: /* 32 bits */
|
||||
.word 0xfffecc08
|
||||
REG_TC_EMIFS_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc0c
|
||||
REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc10
|
||||
REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc14
|
||||
REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc18
|
||||
REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc1c
|
||||
REG_TC_EMIFF_SDRAM_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc20
|
||||
REG_TC_EMIFF_MRS: /* 32 bits */
|
||||
.word 0xfffecc24
|
||||
/* MPU clock/reset/power mode control registers */
|
||||
REG_ARM_CKCTL: /* 16 bits */
|
||||
.word 0xfffece00
|
||||
REG_ARM_IDLECT2: /* 16 bits */
|
||||
.word 0xfffece08
|
||||
REG_ARM_RSTCT2: /* 16 bits */
|
||||
.word 0xfffece14
|
||||
REG_ARM_SYSST: /* 16 bits */
|
||||
.word 0xfffece18
|
||||
/* DPLL control registers */
|
||||
REG_DPLL1_CTL: /* 16 bits */
|
||||
.word 0xfffecf00
|
||||
/* identification code register */
|
||||
REG_IDCODE: /* 32 bits */
|
||||
.word 0xfffed404
|
||||
|
||||
/* Innovator specific */
|
||||
REG_FPGA_LED_DIGIT: /* 8 bits (not used on Innovator) */
|
||||
.word 0x08000003
|
||||
REG_FPGA_POWER: /* 8 bits */
|
||||
.word 0x08000005
|
||||
REG_FPGA_AUDIO: /* 8 bits (not used on Innovator) */
|
||||
.word 0x0800000c
|
||||
REG_FPGA_DIP_SWITCH: /* 8 bits (not used on Innovator) */
|
||||
.word 0x0800000e
|
||||
|
||||
VAL_COMP_MODE_CTRL_0:
|
||||
.word 0x0000eaef
|
||||
VAL_FUNC_MUX_CTRL_4:
|
||||
.word 0x00000000
|
||||
VAL_FUNC_MUX_CTRL_5:
|
||||
.word 0x00000000
|
||||
VAL_FUNC_MUX_CTRL_6:
|
||||
.word 0x00000001
|
||||
VAL_FUNC_MUX_CTRL_7:
|
||||
.word 0x00000000
|
||||
VAL_FUNC_MUX_CTRL_8:
|
||||
.word 0x10001200
|
||||
VAL_FUNC_MUX_CTRL_9:
|
||||
.word 0x01201012
|
||||
VAL_FUNC_MUX_CTRL_A:
|
||||
.word 0x00000248
|
||||
VAL_FUNC_MUX_CTRL_B:
|
||||
.word 0x00000248
|
||||
VAL_FUNC_MUX_CTRL_C:
|
||||
.word 0x09000000
|
||||
VAL_FUNC_MUX_CTRL_D:
|
||||
.word 0x00000000
|
||||
VAL_PULL_DWN_CTRL_0:
|
||||
.word 0x11a10000
|
||||
VAL_PULL_DWN_CTRL_1:
|
||||
.word 0x2e047fff
|
||||
VAL_PULL_DWN_CTRL_2:
|
||||
.word 0xffd603a6
|
||||
VAL_PULL_DWN_CTRL_3:
|
||||
.word 0x00003e03
|
||||
VAL_VOLTAGE_CTRL_0:
|
||||
.word 0x00000007
|
||||
VAL_TEST_DBG_CTRL_0:
|
||||
/* See Errata 4.13, This works around a SRAM bug, for chips below ES2.5 .
|
||||
* This slows down internal SRAM accesses.
|
||||
*/
|
||||
.word 0x00000007
|
||||
VAL_MOD_CONF_CTRL_0:
|
||||
.word 0x0b000008
|
||||
VAL_ARM_CKCTL:
|
||||
.word 0x010f
|
||||
VAL_DPLL1_CTL:
|
||||
.word 0x2710
|
||||
VAL_TC_EMIFS_CS1_CONFIG_PRELIM:
|
||||
.word 0x00001149
|
||||
VAL_TC_EMIFS_CS2_CONFIG_PRELIM:
|
||||
.word 0x00004158
|
||||
VAL_TC_EMIFS_CS0_CONFIG:
|
||||
.word 0x002130b0
|
||||
VAL_TC_EMIFS_CS1_CONFIG:
|
||||
.word 0x0000f559
|
||||
VAL_TC_EMIFS_CS2_CONFIG:
|
||||
.word 0x000055f0
|
||||
VAL_TC_EMIFS_CS3_CONFIG:
|
||||
.word 0x00003331
|
||||
VAL_TC_EMIFF_SDRAM_CONFIG:
|
||||
.word 0x010290fc
|
||||
VAL_TC_EMIFF_MRS:
|
||||
.word 0x00000027
|
||||
58
board/omap1510inn/u-boot.lds
Normal file
58
board/omap1510inn/u-boot.lds
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/arm925t/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 : { *(.bss) }
|
||||
|
||||
armboot_end = .;
|
||||
}
|
||||
47
board/omap1610inn/Makefile
Normal file
47
board/omap1610inn/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001, 2002
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := omap1610innovator.o flash.o
|
||||
SOBJS := platform.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
26
board/omap1610inn/config.mk
Normal file
26
board/omap1610inn/config.mk
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# (C) Copyright 2002
|
||||
# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
#
|
||||
# (C) Copyright 2003
|
||||
# Texas Instruments, <www.ti.com>
|
||||
# Kshitij Gupta <Kshitij@ti.com>
|
||||
#
|
||||
# TI Innovator board with OMAP1610 (ARM925EJS) cpu
|
||||
# see http://www.ti.com/ for more information on Texas Instruments
|
||||
#
|
||||
# Innovator has 1 bank of 256 MB SDRAM
|
||||
# Physical Address:
|
||||
# 1000'0000 to 2000'0000
|
||||
#
|
||||
#
|
||||
# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000
|
||||
# (mem base + reserved)
|
||||
#
|
||||
# we load ourself to 1100'0000
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
TEXT_BASE = 0x11000000
|
||||
482
board/omap1610inn/flash.c
Normal file
482
board/omap1610inn/flash.c
Normal file
@@ -0,0 +1,482 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* Board support for 1 or 2 flash devices */
|
||||
#undef FLASH_PORT_WIDTH32
|
||||
#define FLASH_PORT_WIDTH16
|
||||
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
#define FLASH_PORT_WIDTH ushort
|
||||
#define FLASH_PORT_WIDTHV vu_short
|
||||
#define SWAP(x) __swab16(x)
|
||||
#else
|
||||
#define FLASH_PORT_WIDTH ulong
|
||||
#define FLASH_PORT_WIDTHV vu_long
|
||||
#define SWAP(x) __swab32(x)
|
||||
#endif
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define mb() __asm__ __volatile__ ("" : : : "memory")
|
||||
|
||||
|
||||
|
||||
/* Flash Organization Structure */
|
||||
typedef struct OrgDef {
|
||||
unsigned int sector_number;
|
||||
unsigned int sector_size;
|
||||
} OrgDef;
|
||||
|
||||
|
||||
/* Flash Organizations */
|
||||
OrgDef OrgIntel_28F256L18T[] = {
|
||||
{4, 32 * 1024}, /* 4 * 32kBytes sectors */
|
||||
{255, 128 * 1024}, /* 255 * 128kBytes sectors */
|
||||
};
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
unsigned long flash_init (void);
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info);
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
void inline spin_wheel (void);
|
||||
void flash_print_info (flash_info_t * info);
|
||||
void flash_unprotect_sectors (FPWV * addr);
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last);
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i;
|
||||
ulong size = 0;
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
|
||||
flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic ("configured to many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + monitor_flash_len - 1, &flash_info[0]);
|
||||
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
OrgDef *pOrgDef;
|
||||
|
||||
pOrgDef = OrgIntel_28F256L18T;
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (i > 255) {
|
||||
info->start[i] = base + (i * 0x8000);
|
||||
info->protect[i] = 0;
|
||||
} else {
|
||||
info->start[i] = base +
|
||||
(i * PHYS_FLASH_SECT_SIZE);
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_INTEL:
|
||||
printf ("INTEL ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F256L18T:
|
||||
printf ("FLASH 28F256L18T\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i], info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info)
|
||||
{
|
||||
volatile FPW value;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0x5555] = (FPW) 0x00AA00AA;
|
||||
addr[0x2AAA] = (FPW) 0x00550055;
|
||||
addr[0x5555] = (FPW) 0x00900090;
|
||||
|
||||
mb ();
|
||||
value = addr[0];
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
mb ();
|
||||
value = addr[1]; /* device ID */
|
||||
switch (value) {
|
||||
|
||||
case (FPW) (INTEL_ID_28F256L18T):
|
||||
info->flash_id += FLASH_28F256L18T;
|
||||
info->sector_count = 259;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 32 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (info->sector_count > CFG_MAX_FLASH_SECT) {
|
||||
printf ("** ERROR: sector count %d > max (%d) **\n",
|
||||
info->sector_count, CFG_MAX_FLASH_SECT);
|
||||
info->sector_count = CFG_MAX_FLASH_SECT;
|
||||
}
|
||||
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* unprotects a sector for write and erase
|
||||
* on some intel parts, this unprotects the entire chip, but it
|
||||
* wont hurt to call this additional times per sector...
|
||||
*/
|
||||
void flash_unprotect_sectors (FPWV * addr)
|
||||
{
|
||||
#define PD_FINTEL_WSMS_READY_MASK 0x0080
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
|
||||
/* this sends the clear lock bit command */
|
||||
*addr = (FPW) 0x00600060;
|
||||
*addr = (FPW) 0x00D000D0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type, start, last;
|
||||
int rcode = 0;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
type = (info->flash_id & FLASH_VENDMASK);
|
||||
if ((type != FLASH_MAN_INTEL)) {
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
FPWV *addr = (FPWV *) (info->start[sect]);
|
||||
FPW status;
|
||||
|
||||
printf ("Erasing sector %2d ... ", sect);
|
||||
|
||||
flash_unprotect_sectors (addr);
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
*addr = (FPW) 0x00500050;/* clear status register */
|
||||
*addr = (FPW) 0x00200020;/* erase setup */
|
||||
*addr = (FPW) 0x00D000D0;/* erase confirm */
|
||||
|
||||
while (((status =
|
||||
*addr) & (FPW) 0x00800080) !=
|
||||
(FPW) 0x00800080) {
|
||||
if (get_timer_masked () >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
/* suspend erase */
|
||||
*addr = (FPW) 0x00B000B0;
|
||||
/* reset to read mode */
|
||||
*addr = (FPW) 0x00FF00FF;
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear status register cmd. */
|
||||
*addr = (FPW) 0x00500050;
|
||||
*addr = (FPW) 0x00FF00FF;/* resest to read mode */
|
||||
printf (" done\n");
|
||||
}
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
* 4 - Flash not identified
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp;
|
||||
FPW data;
|
||||
int count, i, l, rc, port_width;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
/* get lower word aligned address */
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
wp = (addr & ~1);
|
||||
port_width = 2;
|
||||
#else
|
||||
wp = (addr & ~3);
|
||||
port_width = 4;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < port_width && cnt > 0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
count = 0;
|
||||
while (cnt >= port_width) {
|
||||
data = 0;
|
||||
for (i = 0; i < port_width; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
cnt -= port_width;
|
||||
if (count++ > 0x800) {
|
||||
spin_wheel ();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
return (write_data (info, wp, SWAP (data)));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word or halfword to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data)
|
||||
{
|
||||
FPWV *addr = (FPWV *) dest;
|
||||
ulong status;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr);
|
||||
return (2);
|
||||
}
|
||||
flash_unprotect_sectors (addr);
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
*addr = (FPW) 0x00400040; /* write setup */
|
||||
*addr = data;
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
/* wait while polling the status register */
|
||||
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (0);
|
||||
}
|
||||
|
||||
void inline spin_wheel (void)
|
||||
{
|
||||
static int p = 0;
|
||||
static char w[] = "\\/-";
|
||||
|
||||
printf ("\010%c", w[p]);
|
||||
(++p == 3) ? (p = 0) : 0;
|
||||
}
|
||||
270
board/omap1610inn/omap1610innovator.c
Normal file
270
board/omap1610inn/omap1610innovator.c
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#if defined(CONFIG_OMAP1610)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
void flash__init (void);
|
||||
void ether__init (void);
|
||||
void set_muxconf_regs (void);
|
||||
void peripheral_power_enable (void);
|
||||
|
||||
#define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
|
||||
|
||||
static inline void delay (unsigned long loops)
|
||||
{
|
||||
__asm__ volatile ("1:\n"
|
||||
"subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0" (loops));
|
||||
}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* arch number of OMAP 1510-Board */
|
||||
/* to be changed for OMAP 1610 Board */
|
||||
gd->bd->bi_arch_number = 234;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x10000100;
|
||||
|
||||
/* Configure MUX settings */
|
||||
set_muxconf_regs ();
|
||||
peripheral_power_enable ();
|
||||
|
||||
/* this speeds up your boot a quite a bit. However to make it
|
||||
* work, you need make sure your kernel startup flush bug is fixed.
|
||||
* ... rkw ...
|
||||
*/
|
||||
icache_enable ();
|
||||
|
||||
flash__init ();
|
||||
ether__init ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/* currently empty */
|
||||
return (0);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
void flash__init (void)
|
||||
{
|
||||
#define EMIFS_GlB_Config_REG 0xfffecc0c
|
||||
unsigned int regval;
|
||||
regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG);
|
||||
/* Turn off write protection for flash devices. */
|
||||
regval = regval | 0x0001;
|
||||
*((volatile unsigned int *) EMIFS_GlB_Config_REG) = regval;
|
||||
}
|
||||
/*************************************************************
|
||||
Routine:ether__init
|
||||
Description: take the Ethernet controller out of reset and wait
|
||||
for the EEPROM load to complete.
|
||||
*************************************************************/
|
||||
void ether__init (void)
|
||||
{
|
||||
#define ETH_CONTROL_REG 0x0400000b
|
||||
|
||||
*((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
|
||||
udelay (3);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
int dram_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************
|
||||
Routine: set_muxconf_regs
|
||||
Description: Setting up the configuration Mux registers
|
||||
specific to the hardware
|
||||
*******************************************************/
|
||||
void set_muxconf_regs (void)
|
||||
{
|
||||
volatile unsigned int *MuxConfReg;
|
||||
/* set each registers to its reset value; */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0);
|
||||
/* setup for UART1 */
|
||||
*MuxConfReg &= ~(0x02000000); /* bit 25 */
|
||||
/* setup for UART2 */
|
||||
*MuxConfReg &= ~(0x01000000); /* bit 24 */
|
||||
/* Disable Uwire CS Hi-Z */
|
||||
*MuxConfReg |= 0x08000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_3);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_4);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_5);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_6);
|
||||
/*setup mux for UART3 */
|
||||
*MuxConfReg |= 0x00000001; /* bit3, 1, 0 (mux0 5,5,26) */
|
||||
*MuxConfReg &= ~0x0000003e;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_7);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_8);
|
||||
/* Disable Uwire CS Hi-Z */
|
||||
*MuxConfReg |= 0x00001200; /*bit 9 for CS0 12 for CS3 */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_9);
|
||||
/* Need to turn on bits 21 and 12 in FUNC_MUX_CTRL_9 so the */
|
||||
/* hardware will actually use TX and RTS based on bit 25 in */
|
||||
/* FUNC_MUX_CTRL_0. I told you this thing was screwy! */
|
||||
*MuxConfReg |= 0x00201000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_A);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_B);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_C);
|
||||
/* setup for UART2 */
|
||||
/* Need to turn on bits 27 and 24 in FUNC_MUX_CTRL_C so the */
|
||||
/* hardware will actually use TX and RTS based on bit 24 in */
|
||||
/* FUNC_MUX_CTRL_0. */
|
||||
*MuxConfReg |= 0x09000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_0);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_1);
|
||||
*MuxConfReg = 0x00000000;
|
||||
/* mux setup for SD/MMC driver */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_2);
|
||||
*MuxConfReg &= 0xFFFE0FFF;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_3);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
|
||||
/* bit 13 for MMC2 XOR_CLK */
|
||||
*MuxConfReg &= ~(0x00002000);
|
||||
/* bit 29 for UART 1 */
|
||||
*MuxConfReg &= ~(0x00002000);
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0);
|
||||
/* Configure for USB. Turn on VBUS_CTRL and VBUS_MODE. */
|
||||
*MuxConfReg |= 0x000C0000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int)USB_TRANSCEIVER_CTRL);
|
||||
*MuxConfReg &= ~(0x00000070);
|
||||
*MuxConfReg &= ~(0x00000008);
|
||||
*MuxConfReg |= 0x00000003;
|
||||
*MuxConfReg |= 0x00000180;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
|
||||
/* bit 17, software controls VBUS */
|
||||
*MuxConfReg &= ~(0x00020000);
|
||||
/* Enable USB 48 and 12M clocks */
|
||||
*MuxConfReg |= 0x00000200;
|
||||
*MuxConfReg &= ~(0x00000180);
|
||||
/*2.75V for MMCSDIO1 */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) VOLTAGE_CTRL_0);
|
||||
*MuxConfReg = 0x00001FE7;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_0);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_1);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_2);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_3);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_4);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_4);
|
||||
*MuxConfReg = 0x00000000;
|
||||
/* Turn on UART2 48 MHZ clock */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
|
||||
*MuxConfReg |= 0x40000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) USB_OTG_CTRL);
|
||||
/* setup for USB VBus detection OMAP161x */
|
||||
*MuxConfReg |= 0x00040000; /* bit 18 */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_2);
|
||||
/* PullUps for SD/MMC driver */
|
||||
*MuxConfReg |= ~(0xFFFE0FFF);
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int)COMP_MODE_CTRL_0);
|
||||
*MuxConfReg = COMP_MODE_ENABLE;
|
||||
}
|
||||
|
||||
/******************************************************
|
||||
Routine: peripheral_power_enable
|
||||
Description: Enable the power for UART1
|
||||
*******************************************************/
|
||||
void peripheral_power_enable (void)
|
||||
{
|
||||
#define UART1_48MHZ_ENABLE ((unsigned short)0x0200)
|
||||
#define SW_CLOCK_REQUEST ((volatile unsigned short *)0xFFFE0834)
|
||||
|
||||
*SW_CLOCK_REQUEST |= UART1_48MHZ_ENABLE;
|
||||
}
|
||||
385
board/omap1610inn/platform.S
Normal file
385
board/omap1610inn/platform.S
Normal file
@@ -0,0 +1,385 @@
|
||||
/*
|
||||
* Board specific setup info
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
#if defined(CONFIG_OMAP1610)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
|
||||
_TEXT_BASE:
|
||||
.word TEXT_BASE /* sdram load addr from config.mk */
|
||||
|
||||
.globl platformsetup
|
||||
platformsetup:
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT1) *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_ARM_IDLECT1
|
||||
ldr r1, VAL_ARM_IDLECT1
|
||||
str r1, [r0]
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT2) *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_ARM_IDLECT2
|
||||
ldr r1, VAL_ARM_IDLECT2
|
||||
str r1, [r0]
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT3) *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_ARM_IDLECT3
|
||||
ldr r1, VAL_ARM_IDLECT3
|
||||
str r1, [r0]
|
||||
|
||||
|
||||
mov r1, #0x01 /* PER_EN bit */
|
||||
ldr r0, REG_ARM_RSTCT2
|
||||
strh r1, [r0] /* CLKM; Peripheral reset. */
|
||||
|
||||
/* Set CLKM to Sync-Scalable */
|
||||
/* I supposedly need to enable the dsp clock before switching */
|
||||
mov r1, #0x0000
|
||||
ldr r0, REG_ARM_SYSST
|
||||
strh r1, [r0]
|
||||
mov r0, #0x400
|
||||
1:
|
||||
subs r0, r0, #0x1 /* wait for any bubbles to finish */
|
||||
bne 1b
|
||||
ldr r1, VAL_ARM_CKCTL
|
||||
ldr r0, REG_ARM_CKCTL
|
||||
strh r1, [r0]
|
||||
|
||||
/* a few nops to let settle */
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* setup DPLL 1 */
|
||||
/* Ramp up the clock to 96Mhz */
|
||||
ldr r1, VAL_DPLL1_CTL
|
||||
ldr r0, REG_DPLL1_CTL
|
||||
strh r1, [r0]
|
||||
ands r1, r1, #0x10 /* Check if PLL is enabled. */
|
||||
beq lock_end /* Do not look for lock if BYPASS selected */
|
||||
2:
|
||||
ldrh r1, [r0]
|
||||
ands r1, r1, #0x01 /* Check the LOCK bit.*/
|
||||
beq 2b /* loop until bit goes hi. */
|
||||
lock_end:
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Turn off the watchdog during init... *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_WATCHDOG
|
||||
ldr r1, WATCHDOG_VAL1
|
||||
str r1, [r0]
|
||||
ldr r1, WATCHDOG_VAL2
|
||||
str r1, [r0]
|
||||
ldr r0, REG_WSPRDOG
|
||||
ldr r1, WSPRDOG_VAL1
|
||||
str r1, [r0]
|
||||
ldr r0, REG_WWPSDOG
|
||||
|
||||
watch1Wait:
|
||||
ldr r1, [r0]
|
||||
tst r1, #0x10
|
||||
bne watch1Wait
|
||||
|
||||
ldr r0, REG_WSPRDOG
|
||||
ldr r1, WSPRDOG_VAL2
|
||||
str r1, [r0]
|
||||
ldr r0, REG_WWPSDOG
|
||||
watch2Wait:
|
||||
ldr r1, [r0]
|
||||
tst r1, #0x10
|
||||
bne watch2Wait
|
||||
|
||||
|
||||
|
||||
|
||||
/* Set memory timings corresponding to the new clock speed */
|
||||
|
||||
/* Check execution location to determine current execution location
|
||||
* and branch to appropriate initialization code.
|
||||
*/
|
||||
/* Load physical SDRAM base. */
|
||||
mov r0, #0x10000000
|
||||
/* Get current execution location. */
|
||||
mov r1, pc
|
||||
/* Compare. */
|
||||
cmp r1, r0
|
||||
/* Skip over EMIF-fast initialization if running from SDRAM. */
|
||||
bge skip_sdram
|
||||
|
||||
/*
|
||||
* Delay for SDRAM initialization.
|
||||
*/
|
||||
mov r3, #0x1800 /* value should be checked */
|
||||
3:
|
||||
subs r3, r3, #0x1 /* Decrement count */
|
||||
bne 3b
|
||||
|
||||
|
||||
/*
|
||||
* Set SDRAM control values. Disable refresh before MRS command.
|
||||
*/
|
||||
|
||||
/* mobile ddr operation */
|
||||
ldr r0, REG_SDRAM_OPERATION
|
||||
mov r2, #07
|
||||
str r2, [r0]
|
||||
|
||||
/* config register */
|
||||
ldr r0, REG_SDRAM_CONFIG
|
||||
ldr r1, SDRAM_CONFIG_VAL
|
||||
str r1, [r0]
|
||||
|
||||
/* manual command register */
|
||||
ldr r0, REG_SDRAM_MANUAL_CMD
|
||||
/* issue set cke high */
|
||||
mov r1, #CMD_SDRAM_CKE_SET_HIGH
|
||||
str r1, [r0]
|
||||
/* issue nop */
|
||||
mov r1, #CMD_SDRAM_NOP
|
||||
str r1, [r0]
|
||||
|
||||
mov r2, #0x0100
|
||||
waitMDDR1:
|
||||
subs r2, r2, #1
|
||||
bne waitMDDR1 /* delay loop */
|
||||
|
||||
/* issue precharge */
|
||||
mov r1, #CMD_SDRAM_PRECHARGE
|
||||
str r1, [r0]
|
||||
|
||||
/* issue autorefresh x 2 */
|
||||
mov r1, #CMD_SDRAM_AUTOREFRESH
|
||||
str r1, [r0]
|
||||
str r1, [r0]
|
||||
|
||||
/* mrs register ddr mobile */
|
||||
ldr r0, REG_SDRAM_MRS
|
||||
mov r1, #0x33
|
||||
str r1, [r0]
|
||||
|
||||
/* emrs1 low-power register */
|
||||
ldr r0, REG_SDRAM_EMRS1
|
||||
/* self refresh on all banks */
|
||||
mov r1, #0
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_DLL_URD_CONTROL
|
||||
ldr r1, DLL_URD_CONTROL_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_DLL_LRD_CONTROL
|
||||
ldr r1, DLL_LRD_CONTROL_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_DLL_WRT_CONTROL
|
||||
ldr r1, DLL_WRT_CONTROL_VAL
|
||||
str r1, [r0]
|
||||
|
||||
/* delay loop */
|
||||
mov r2, #0x0100
|
||||
waitMDDR2:
|
||||
subs r2, r2, #1
|
||||
bne waitMDDR2
|
||||
|
||||
/*
|
||||
* Delay for SDRAM initialization.
|
||||
*/
|
||||
mov r3, #0x1800
|
||||
4:
|
||||
subs r3, r3, #1 /* Decrement count. */
|
||||
bne 4b
|
||||
b common_tc
|
||||
|
||||
skip_sdram:
|
||||
|
||||
ldr r0, REG_SDRAM_CONFIG
|
||||
ldr r1, SDRAM_CONFIG_VAL
|
||||
str r1, [r0]
|
||||
|
||||
common_tc:
|
||||
/* slow interface */
|
||||
ldr r1, VAL_TC_EMIFS_CS0_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS0_CONFIG
|
||||
str r1, [r0] /* Chip Select 0 */
|
||||
|
||||
ldr r1, VAL_TC_EMIFS_CS1_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS1_CONFIG
|
||||
str r1, [r0] /* Chip Select 1 */
|
||||
ldr r1, VAL_TC_EMIFS_CS3_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS3_CONFIG
|
||||
str r1, [r0] /* Chip Select 3 */
|
||||
/* back to arch calling code */
|
||||
mov pc, lr
|
||||
|
||||
/* the literal pools origin */
|
||||
.ltorg
|
||||
|
||||
|
||||
REG_TC_EMIFS_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc0c
|
||||
REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc10
|
||||
REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc14
|
||||
REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc18
|
||||
REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc1c
|
||||
|
||||
/* MPU clock/reset/power mode control registers */
|
||||
REG_ARM_CKCTL: /* 16 bits */
|
||||
.word 0xfffece00
|
||||
|
||||
REG_ARM_IDLECT3: /* 16 bits */
|
||||
.word 0xfffece24
|
||||
REG_ARM_IDLECT2: /* 16 bits */
|
||||
.word 0xfffece08
|
||||
REG_ARM_IDLECT1: /* 16 bits */
|
||||
.word 0xfffece04
|
||||
|
||||
REG_ARM_RSTCT2: /* 16 bits */
|
||||
.word 0xfffece14
|
||||
REG_ARM_SYSST: /* 16 bits */
|
||||
.word 0xfffece18
|
||||
/* DPLL control registers */
|
||||
REG_DPLL1_CTL: /* 16 bits */
|
||||
.word 0xfffecf00
|
||||
|
||||
/* Watch Dog register */
|
||||
/* secure watchdog stop */
|
||||
REG_WSPRDOG:
|
||||
.word 0xfffeb048
|
||||
/* watchdog write pending */
|
||||
REG_WWPSDOG:
|
||||
.word 0xfffeb034
|
||||
|
||||
WSPRDOG_VAL1:
|
||||
.word 0x0000aaaa
|
||||
WSPRDOG_VAL2:
|
||||
.word 0x00005555
|
||||
|
||||
/* SDRAM config is: auto refresh enabled, 16 bit 4 bank,
|
||||
counter @8192 rows, 10 ns, 8 burst */
|
||||
REG_SDRAM_CONFIG:
|
||||
.word 0xfffecc20
|
||||
|
||||
/* Operation register */
|
||||
REG_SDRAM_OPERATION:
|
||||
.word 0xfffecc80
|
||||
|
||||
/* Manual command register */
|
||||
REG_SDRAM_MANUAL_CMD:
|
||||
.word 0xfffecc84
|
||||
|
||||
/* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */
|
||||
REG_SDRAM_MRS:
|
||||
.word 0xfffecc70
|
||||
|
||||
/* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */
|
||||
REG_SDRAM_EMRS1:
|
||||
.word 0xfffecc78
|
||||
|
||||
/* WRT DLL register */
|
||||
REG_DLL_WRT_CONTROL:
|
||||
.word 0xfffecc68
|
||||
DLL_WRT_CONTROL_VAL:
|
||||
.word 0x03f00002
|
||||
|
||||
/* URD DLL register */
|
||||
REG_DLL_URD_CONTROL:
|
||||
.word 0xfffeccc0
|
||||
DLL_URD_CONTROL_VAL:
|
||||
.word 0x00800002
|
||||
|
||||
/* LRD DLL register */
|
||||
REG_DLL_LRD_CONTROL:
|
||||
.word 0xfffecccc
|
||||
|
||||
REG_WATCHDOG:
|
||||
.word 0xfffec808
|
||||
|
||||
/* 96 MHz Samsung Mobile DDR */
|
||||
SDRAM_CONFIG_VAL:
|
||||
.word 0x001200f4
|
||||
|
||||
DLL_LRD_CONTROL_VAL:
|
||||
.word 0x00800002
|
||||
|
||||
VAL_ARM_CKCTL:
|
||||
.word 0x3000
|
||||
VAL_DPLL1_CTL:
|
||||
.word 0x2830
|
||||
|
||||
VAL_TC_EMIFS_CS0_CONFIG:
|
||||
.word 0x002130b0
|
||||
VAL_TC_EMIFS_CS1_CONFIG:
|
||||
.word 0x00001131
|
||||
VAL_TC_EMIFS_CS2_CONFIG:
|
||||
.word 0x000055f0
|
||||
VAL_TC_EMIFS_CS3_CONFIG:
|
||||
.word 0x88011131
|
||||
VAL_TC_EMIFF_SDRAM_CONFIG:
|
||||
.word 0x010290fc
|
||||
VAL_TC_EMIFF_MRS:
|
||||
.word 0x00000027
|
||||
|
||||
VAL_ARM_IDLECT1:
|
||||
.word 0x00000400
|
||||
|
||||
VAL_ARM_IDLECT2:
|
||||
.word 0x00000886
|
||||
VAL_ARM_IDLECT3:
|
||||
.word 0x00000015
|
||||
|
||||
WATCHDOG_VAL1:
|
||||
.word 0x000000f5
|
||||
WATCHDOG_VAL2:
|
||||
.word 0x000000a0
|
||||
|
||||
/* command values */
|
||||
.equ CMD_SDRAM_NOP, 0x00000000
|
||||
.equ CMD_SDRAM_PRECHARGE, 0x00000001
|
||||
.equ CMD_SDRAM_AUTOREFRESH, 0x00000002
|
||||
.equ CMD_SDRAM_CKE_SET_HIGH, 0x00000007
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* (C) Copyright 2001, 2002
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -21,9 +21,31 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _CMD_BSP_H_
|
||||
#define _CMD_BSP_H_
|
||||
|
||||
/* do not edit this file */
|
||||
|
||||
#endif /* _CMD_BSP_H_ */
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/arm926ejs/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
. = ALIGN(4);
|
||||
.bss : { *(.bss) }
|
||||
armboot_end = .;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void after_reloc (ulong dest_addr)
|
||||
|
||||
/* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r (gd, dest_addr);
|
||||
board_init_r ((gd_t *)gd, dest_addr);
|
||||
}
|
||||
|
||||
int misc_init_r (void)
|
||||
@@ -233,8 +233,8 @@ int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(wd) = MK_CMD_ENTRY(
|
||||
"wd", 2, 1, do_wd,
|
||||
U_BOOT_CMD(
|
||||
wd, 2, 1, do_wd,
|
||||
"wd - check and set watchdog\n",
|
||||
"on - switch watchDog on\n"
|
||||
"wd off - switch watchdog off\n"
|
||||
|
||||
@@ -51,8 +51,8 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
set_led (number, function);
|
||||
return 0;
|
||||
}
|
||||
cmd_tbl_t U_BOOT_CMD(led) = MK_CMD_ENTRY(
|
||||
"led" , 3, 1, do_led,
|
||||
U_BOOT_CMD(
|
||||
led , 3, 1, do_led,
|
||||
"led - set LED 0..11 on the PN62 board\n",
|
||||
"i fun\n"
|
||||
" - set 'i'th LED to function 'fun'\n"
|
||||
@@ -165,8 +165,8 @@ int do_loadpci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return rcode;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(loadpci) = MK_CMD_ENTRY(
|
||||
"loadpci", 2, 1, do_loadpci,
|
||||
U_BOOT_CMD(
|
||||
loadpci, 2, 1, do_loadpci,
|
||||
"loadpci - load binary file over PCI\n",
|
||||
"[addr]\n"
|
||||
" - load binary file over PCI to address 'addr'\n"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* (C) Copyright 2001-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -37,9 +37,9 @@
|
||||
/*
|
||||
* Memory Controller Using
|
||||
*
|
||||
* CS0 - Flash memory (0x40000000)
|
||||
* CS1 - SDRAM (0x00000000}
|
||||
* CS2 -
|
||||
* CS0 - Flash memory (0x40000000)
|
||||
* CS1 - FLASH memory (0x????????)
|
||||
* CS2 - SDRAM (0x00000000)
|
||||
* CS3 -
|
||||
* CS4 -
|
||||
* CS5 -
|
||||
@@ -148,7 +148,7 @@ long int initdram (int board_type)
|
||||
udelay (1000);
|
||||
|
||||
/*
|
||||
* Check Bank 0 Memory Size for re-configuration
|
||||
* Check Bank 2 Memory Size for re-configuration
|
||||
*
|
||||
* try 8 column mode
|
||||
*/
|
||||
@@ -205,7 +205,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_br3 = CFG_BR3_CAN;
|
||||
|
||||
/* Initialize MBMR */
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS; /* GPL_B4 works as UPWAITB */
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* GPL_B4 works as UPWAITB */
|
||||
|
||||
/* Initialize UPMB for CAN: single read */
|
||||
memctl->memc_mdr = 0xFFFFC004;
|
||||
@@ -443,8 +443,8 @@ int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd_tbl_t U_BOOT_CMD(kbd) = MK_CMD_ENTRY(
|
||||
"kbd", 1, 1, do_kbd,
|
||||
U_BOOT_CMD(
|
||||
kbd, 1, 1, do_kbd,
|
||||
"kbd - read keyboard status\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
@@ -96,7 +96,7 @@ long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
long int size10 ;
|
||||
long int size9 ;
|
||||
|
||||
upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
|
||||
|
||||
@@ -109,7 +109,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_or1 = CFG_OR1_PRELIM;
|
||||
memctl->memc_br1 = CFG_BR1_PRELIM;
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR_10COL & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
memctl->memc_mamr = CFG_MAMR_9COL & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
|
||||
udelay(200);
|
||||
|
||||
@@ -122,13 +122,20 @@ long int initdram (int board_type)
|
||||
|
||||
udelay (1000);
|
||||
|
||||
/* Check Bank 0 Memory Size
|
||||
* try 10 column mode
|
||||
/* Check Bank 0 Memory Size,
|
||||
* 9 column mode
|
||||
*/
|
||||
|
||||
size10 = dram_size (CFG_MAMR_10COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE) ;
|
||||
size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE) ;
|
||||
|
||||
return (size10);
|
||||
/*
|
||||
* Final mapping:
|
||||
*/
|
||||
|
||||
memctl->memc_or1 = ((-size9) & 0xFFFF0000) | CFG_OR_TIMING_SDRAM;
|
||||
udelay (1000);
|
||||
|
||||
return (size9);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -816,3 +816,15 @@ int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
|
||||
#endif /* CFG_CMD_SPI */
|
||||
|
||||
#endif /* CONFIG_MISC_INIT_R */
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
/*
|
||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||
* Called from board_init_f().
|
||||
*/
|
||||
int post_hotkeys_pressed(void)
|
||||
{
|
||||
return 0; /* No hotkeys supported */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@ OBJS := sc520_cdp.o flash.o
|
||||
SOBJS := sc520_cdp_asm.o sc520_cdp_asm16.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user