Compare commits
180 Commits
LABEL_2004
...
LABEL_2005
| Author | SHA1 | Date | |
|---|---|---|---|
| 12b43d515c | |||
| f5c5ef4a1f | |||
| 3dd7f0f0ca | |||
| 8aa1a2d115 | |||
| 986ef4340e | |||
| ba83a30765 | |||
| 101e8dfa2a | |||
| 50712ba16e | |||
| 901787d6e8 | |||
| 8b0bfc6804 | |||
| 384cc68744 | |||
| c1a11c19ec | |||
| 6315349202 | |||
| 3ec924a3cb | |||
| 756f586a73 | |||
| b1bf6f2c9b | |||
| 86c9888207 | |||
| 59acc296d9 | |||
| 400558b561 | |||
| 414eec35e3 | |||
| be6b6e4e2d | |||
| e6ba3c92ce | |||
| f50cc09b61 | |||
| ea287debe1 | |||
| ef2807c667 | |||
| 83e40ba75d | |||
| 0c1c117cf1 | |||
| 8f0b7cbe80 | |||
| 256d31c046 | |||
| e632515387 | |||
| 4d00eb0290 | |||
| acdcd10c9a | |||
| 89c02e2c57 | |||
| 6c9e789e9e | |||
| 911d08f6ae | |||
| bf7019c570 | |||
| 9d46ea4a55 | |||
| c3fafecff1 | |||
| a0bdf49e39 | |||
| e9684a536a | |||
| f4733a0764 | |||
| b05dcb58fe | |||
| 47b1e3d77f | |||
| e58cf2a0cf | |||
| 1968e615d4 | |||
| 151ab83a93 | |||
| b9649854f6 | |||
| e799d3755e | |||
| 2f916943c9 | |||
| f8883cb101 | |||
| 20a80418f9 | |||
| 1a344f298d | |||
| 436be29cad | |||
| cd172b7108 | |||
| c3d2b4b48a | |||
| 5a95f6fbd2 | |||
| 289f932c5f | |||
| 082acfd484 | |||
| 652a10c096 | |||
| 6225c5db6c | |||
| 8ed9604613 | |||
| ff36fd8591 | |||
| 6310eb9da7 | |||
| a562e1bd9d | |||
| 30ce5ab043 | |||
| 9dd611b8c1 | |||
| a1191902ca | |||
| 15c7a8efd2 | |||
| e2ffd59b4d | |||
| 400ab719c6 | |||
| 08f272787a | |||
| bff96b0e6b | |||
| ec0aee7b68 | |||
| f7d1572bf5 | |||
| 8e6b47a89b | |||
| efe2a4d5cf | |||
| bea8e84b52 | |||
| 917b8cc41c | |||
| 8cba1907b8 | |||
| 7b46664147 | |||
| c419d1d6d0 | |||
| 0621f6f9d3 | |||
| cd5396fa12 | |||
| 4510a7b736 | |||
| 12537cc5a9 | |||
| c2642d14c9 | |||
| 25215ee2b0 | |||
| 31193c2cca | |||
| ab379df353 | |||
| f2dfe44fd6 | |||
| 20aacbf018 | |||
| 7acd6c2168 | |||
| c491b442cc | |||
| 86cf82e07f | |||
| 8d3efe4e9a | |||
| e399e4c670 | |||
| 87663b1cbc | |||
| 6cfb1f0da6 | |||
| 809ac5e7b0 | |||
| 8d8f894b51 | |||
| 1f54ce6df8 | |||
| 771e05be07 | |||
| 1bc0f14143 | |||
| aee2fa27d9 | |||
| 5e746fce05 | |||
| b39392a98b | |||
| 0912e483eb | |||
| 8c725b9364 | |||
| a20b27a36b | |||
| 44acc8d334 | |||
| 4d535b51e1 | |||
| 3d936fd992 | |||
| 20cc00ddac | |||
| cd42deebd2 | |||
| e2c22d780e | |||
| b7eaad8134 | |||
| 946c2185dd | |||
| 6bb992ba9d | |||
| a842a6d23c | |||
| 4aaf29b2f5 | |||
| fa838874cf | |||
| 1cdf5d92cf | |||
| 1740618202 | |||
| 256e4be814 | |||
| bcd0be5cf1 | |||
| 2b9187127f | |||
| 138ff60c1e | |||
| 45ea3fca4a | |||
| 96085e347d | |||
| 689aec1b05 | |||
| 7e6bf358d8 | |||
| 25d6712a81 | |||
| ed54e62125 | |||
| bb310d462b | |||
| 9d5028c2f7 | |||
| cacfab588a | |||
| 1f6d4258c2 | |||
| 983fda8391 | |||
| e3c9b9f928 | |||
| 14699a22cf | |||
| e86e5a0748 | |||
| 8b74bf31fe | |||
| 4cfaf55e5c | |||
| d407bf52b5 | |||
| 2ee665339b | |||
| 9455b7f39c | |||
| e1599e83d6 | |||
| c15f3120ec | |||
| 656658dd15 | |||
| 5c952cf024 | |||
| 03f5c55021 | |||
| cf33678e51 | |||
| 08b6aa6154 | |||
| 731215ebde | |||
| b65085130a | |||
| 2cbe571a56 | |||
| 659883c298 | |||
| f325e18beb | |||
| 8655b6f860 | |||
| 30d56fae23 | |||
| 63cfcbb4e2 | |||
| 1d9f410500 | |||
| 3e01d75ff2 | |||
| a5bbcc3c53 | |||
| a06752e36b | |||
| da93ed8147 | |||
| a5725fabc0 | |||
| e1a3f6b39b | |||
| c65fdc74aa | |||
| 64f70bede3 | |||
| cce625e557 | |||
| 66ca92a5ba | |||
| 4ec3a7f0fd | |||
| 79536a6eb0 | |||
| 4734cb78d8 | |||
| a9c37d561d | |||
| c354839349 | |||
| 8b1ccd8693 | |||
| e623a1a394 | |||
| 1d6f97209e |
585
CHANGELOG
585
CHANGELOG
@ -1,7 +1,590 @@
|
||||
======================================================================
|
||||
Changes since U-Boot 1.1.1:
|
||||
Changes for U-Boot 1.1.3:
|
||||
======================================================================
|
||||
|
||||
* Add support for MPC8220 based "sorcery" board.
|
||||
|
||||
* Add support for TQM8560 board.
|
||||
|
||||
* Add FEC support for TQM8540 board.
|
||||
Interfaces are named as follows: "ENET1" - TSEC2, "ENET2" - FEC
|
||||
|
||||
* Patch by Martin Krause, 04 Apr 2005:
|
||||
Update default configuration for CMC_PU2 board.
|
||||
|
||||
* Patch by Steven Scholz, 04 Apr 2005:
|
||||
- remove all references to CONFIG_INIT_CRITICAL for ARM based boards
|
||||
- introduce two new configuration options instead:
|
||||
CONFIG_SKIP_LOWLEVEL_INIT and CONFIG_SKIP_RELOCATE_UBOOT
|
||||
|
||||
* Patch by Steven Scholz, 04 Apr 2005:
|
||||
Make sure that MDIO clock does not exceed 2.5 MHz on AT91
|
||||
|
||||
* Fix timer code for ARM systems: make sure that udelay() does not
|
||||
reset timers so it's save to use udelay() in timeout code.
|
||||
|
||||
* Patch by Mathias K<>ster, 23 Nov 2004:
|
||||
add udelay support for the mcf5282 cpu
|
||||
|
||||
* Patch by Tolunay Orkun, 16 November 2004:
|
||||
fix incorrect onboard Xilinx CPLD base address
|
||||
|
||||
* Patch by Jerry Van Baren, 08 Nov 2004:
|
||||
- Add low-boot option for MPC8260ADS board (if lowboot is selected,
|
||||
the jumper for the HRCW source should select flash. If lowboot is
|
||||
not selected, the jumper for the HRCW source should select the
|
||||
BCSR.
|
||||
- change default load base address to 0x00400000
|
||||
|
||||
* Patch by Yuli Barcohen, 08 Nov 2004:
|
||||
Add support for Analogue & Micro Rattler boards.
|
||||
Tested on Rattler8248.
|
||||
|
||||
* Patch by Andre Renaud, 08 Nov 2004:
|
||||
Fix watchdog support in common/lcd.c
|
||||
|
||||
* Patch by Marc Leeman, 05 Nov 2003:
|
||||
Enable all 4 PCMBRW buffers for the MPC8245 processor since the CPU
|
||||
bug only affects the XPC8245 processors
|
||||
|
||||
* Patches by Josef Wagner, 29 Oct 2004:
|
||||
- Add support for MicroSys CPU87 board
|
||||
- Add support for MicroSys PM854 board
|
||||
|
||||
* Patch by Jian Zhang, 02 Nov 2004:
|
||||
Add 16-bit NAND support
|
||||
|
||||
* Patch by Scott McNutt, 01 Nov 2004:
|
||||
Add missing NIOS/NIOS2 support for "iminfo" command
|
||||
|
||||
* Patch by Detlev Zundel, 29 Oct 2004:
|
||||
Add missing NIOS/NIOS2 support for "mkimage" tool.
|
||||
|
||||
* Patch by David Adair, 27 Oct 2004:
|
||||
Add missing 440GX SDRAM Controller reset
|
||||
|
||||
* Patch by Steven Scholz, 25 Oct 2004:
|
||||
Declare reset_cpu() in include/common.h instead locally
|
||||
|
||||
* Patch by Yusdi Santoso, 22 Oct 2004:
|
||||
- Add support for HIDDEN_DRAGON board
|
||||
- fix endianess problem in driver/rtl1839.c
|
||||
|
||||
* Patch by Allen Curtis, 21 Oct 2004:
|
||||
support multiple serial ports
|
||||
|
||||
* Patch by Richard Klingler, 03 Apr 2005:
|
||||
Add call to eth_halt() in net/net.c when called functions fail
|
||||
after eth_init() has been called.
|
||||
|
||||
* Patch by Sam Song, 3 April 2005:
|
||||
- Update README.Netconsole
|
||||
- Update README
|
||||
|
||||
* Prepare for SoC rework of ARM code:
|
||||
- rename CONFIG_BOOTBINFUNC into CONFIG_INIT_CRITICAL
|
||||
- rename memsetup into lowlevel_init (function name and source files)
|
||||
Patch by Steven Scholz, 03 Apr 2005:
|
||||
- create SoC specific directories include/asm-arm/arch-imx and
|
||||
include/asm-arm/arch-s3c24x0
|
||||
|
||||
* Fix problems with SNTP support;
|
||||
enable SNTP support in some boards.
|
||||
|
||||
* Patches by Martin Krause, 01 Apr 2005:
|
||||
- Fix flash erase timeout on CMC_PU2
|
||||
- Add automatic HW detection for CMC_PU2 and CMC_BASIC
|
||||
|
||||
* Patch by Steven Scholz, 13 March 2005:
|
||||
fix cache enabling for AT91RM9200
|
||||
|
||||
* Patch by Masami Komiya, 30 Mar 2005:
|
||||
add SNTP support and expand time server and time offset fields of
|
||||
DHCP support. See doc/README.SNTP
|
||||
|
||||
* Patch by Steven Scholz, 13 Dec 2004:
|
||||
Fix bug in at91rm920 ethernet driver
|
||||
|
||||
* Patch by Steven Scholz, 13 Dec 2004:
|
||||
Remove duplicated code by merging memsetup.S files for
|
||||
at91rm9200 boards into one cpu/at91rm9200/lowlevel.S
|
||||
|
||||
* Patch by Detlev Zundel, 31 Mar 2005:
|
||||
Cleanup duplicate definition of overwrite_console()
|
||||
|
||||
* Update TQM5200 configuration;
|
||||
prepare for Rev. 200 starter kit boards
|
||||
|
||||
* Patch by Scott McNutt, 21 Oct 2004:
|
||||
Add support for Nios-II EPCS Controller core.
|
||||
|
||||
* Patch by Scott McNutt, 20 Oct 2004:
|
||||
Nios-II cleanups:
|
||||
- Add sysid command (Nios-II only).
|
||||
- Locate default exception trampoline at proper offset.
|
||||
- Implement I/O routines (readb, writeb, etc)
|
||||
- Implement do_bootm_linux
|
||||
|
||||
* Patches by Martin Krause, 22 Mar 2005:
|
||||
- use TQM5200_auto as MAKEALL target for TQM5200 systems
|
||||
- add support for SM501 graphics controller
|
||||
- add support for graphic console on TQM5200
|
||||
- add support for TQM5200 Rev 200
|
||||
- cleanup, fix typo in include/configs/TQM5200.h
|
||||
|
||||
* Patch by Manfred Baral, 17 Mar 2005:
|
||||
Fix typo
|
||||
|
||||
* Fix RTC configuration for PPChameleon board
|
||||
|
||||
* Cleanup, fix typo in include/configs/TQM5200.h
|
||||
|
||||
* Patch by Stefan Roese, 16 Mar 2005:
|
||||
Update for esd auto_update and hh405 board
|
||||
|
||||
* Adapt for U-Boot image size (new features enabled) on TQM5200
|
||||
|
||||
* Update code for TQM8540 board (and 85xx in general):
|
||||
- Change the name of the Ethernet driver: MOTO ENET -> ENET
|
||||
- Reformat boot messages
|
||||
- Enable redundant environment
|
||||
- Replace the -O2 optimization flag with -mno-string
|
||||
|
||||
* Patch by David Brownell, 10 Mar 2005:
|
||||
Restore copyright statements in OHCI drivers.
|
||||
|
||||
* Add support for TQM8540 board
|
||||
|
||||
* Patch by Detlev Zundel, 14 Mar 2005:
|
||||
NC650: changed NAND flash addressing to using UPMB
|
||||
|
||||
* Patch by Stefan Roese, 14 Mar 2005:
|
||||
Update for esd voh405 fpga image
|
||||
|
||||
* INKA4x0: Allow initialization of LCD backlight dimming from
|
||||
"brightness" environment variable.
|
||||
|
||||
* Add port initialization for digital I/O on INKA4x0
|
||||
|
||||
* Patch by Stefan Roese, 01 Mar 2005:
|
||||
Update for esd boards dp405 and hub405
|
||||
|
||||
* Fix get_partition_info() parameter error in all other calls
|
||||
(common/cmd_ide.c, common/cmd_reiser.c, common/cmd_scsi.c).
|
||||
|
||||
* Enable USB and IDE support for INKA4x0 board
|
||||
|
||||
* Patch by Andrew Dyer, 28 Feb 2005:
|
||||
fix ext2load passing an incorrect pointer to get_partition_info()
|
||||
resulting in load failure for devices other than 0
|
||||
|
||||
* Add support for SRAM and 2 x Quad UARTs on INKA4x0 board
|
||||
|
||||
* Cleanup USB and partition defines
|
||||
|
||||
* Add support for ext2 filesystems and image timestamps to TQM5200 board
|
||||
|
||||
* Add reset code for Coral-P on INKA4x0 board
|
||||
|
||||
* Patch by Martin Krause, 28 Jun 2004:
|
||||
Update for TRAB board.
|
||||
|
||||
* Fix some missing "volatile"s in MPC5xxx FEC driver
|
||||
|
||||
* Fix cirrus voltage detection (for CPC45)
|
||||
|
||||
* Fix byteorder problem in usbboot and scsiboot commands.
|
||||
|
||||
* Patch by Cajus Hahn, 04 Feb 2005:
|
||||
- don't insist on leading '/' for filename in ext2load
|
||||
- set default partition to useful value (1) in ext2load
|
||||
|
||||
* Patch by Andrew Dyer, 08 Jan 2005:
|
||||
fix wrong return codes in ext2 code
|
||||
|
||||
* Removed '--no-warn-mismatch' option from Makefile. This option
|
||||
makes 'ld' to overlook binary objects compatibility.
|
||||
|
||||
* Moved $(PLATFORM_LIBS) from the library group (--start-group ...
|
||||
--end-group) outside of the group. This will make 'ld' to do
|
||||
_multiple_ search in the library group when resolving symbol
|
||||
references and do only a _single_ seach in libgcc.a after the group
|
||||
search.
|
||||
|
||||
* Fix stability problems on CPC45 board again.
|
||||
|
||||
* Make image detection for diskboot / usbboot / scsiboot more robust
|
||||
(also check header checksum)
|
||||
|
||||
* Update CPC45 board configuration.
|
||||
|
||||
* Add USB and PCI support for INKA4x0 board
|
||||
|
||||
* Fix IDE stability problems on CPC45 board (needs 2 x EIEIO).
|
||||
|
||||
* Code cleanup
|
||||
|
||||
* Patch by Robin Getz, 13 Oct 2004:
|
||||
Add standalone application to change SMC91C111 MAC addresses,
|
||||
see examples/README.smc91111_eeprom
|
||||
|
||||
* Patch by Xiaogeng (Shawn) Jin, 12 Oct 2004:
|
||||
Fix Flash support for ARM Integrator CP.
|
||||
|
||||
* Patch by Richard Woodruff, 10 Jan 2005:
|
||||
Update support for OMAP2420 (ARM11) and H4 board:
|
||||
o clean up and add new types to H4 memory probe code.
|
||||
o fix to work with internal boot.
|
||||
o added PRCM config III operation.
|
||||
o fix marginal flash timings.
|
||||
o add revison ATAG usage.
|
||||
o enable voltage scaling at power chip.
|
||||
o fix compile error for i2c.
|
||||
|
||||
* Fix network problem (error when receiving multiple ARP packets)
|
||||
|
||||
* Patch by Daniel Poirot, 12 Oct 2004:
|
||||
Add support for Wind River sbc405 board
|
||||
|
||||
* Patch by Rainer Brestan, 12 Oct 2004:
|
||||
Make examples/Makefile more robust
|
||||
|
||||
* Patch by Sam Song, 11 October 2004:
|
||||
- Add RESET/PREBOOT/AUTOBOOT support for RPXlite_DW board
|
||||
- Adjust CPU:BUS frequency ratio 1:1 when core frequency
|
||||
less than 50MHz
|
||||
|
||||
* Patch by Sam Song, 10 Oct 2004:
|
||||
Fix a parameter error in run_command() in main.c
|
||||
|
||||
* Patch by Richard Woodruff, 01 Oct 2004:
|
||||
add support for the TI OMAP2420 processor and its H4 reference
|
||||
board
|
||||
|
||||
* Patch by Christian Pellegrin, 24 Sep 2004:
|
||||
Added support for NE2000 compatible (DP8390, DP83902) NICs.
|
||||
|
||||
* Patch by Leif Lindholm, 23 Sep 2004:
|
||||
add support for the AMD db1550 board
|
||||
|
||||
* Patch by Travis Sawyer, 15 Sep 2004:
|
||||
Add CONFIG_SERIAL_MULTI support for ppc4xx,
|
||||
update README.serial_multi
|
||||
|
||||
* Patches by David Snowdon, 07 Sep 2004:
|
||||
- add u-boot.hex target in the top level Makefile
|
||||
- add support for the UNSW/NICTA PLEB 2 board (pleb2)
|
||||
- use -mtune=xscale and -march=armv5 options for PXA
|
||||
|
||||
* Patch by Florian Schlote, 08 Sep 2004:
|
||||
Add support for SenTec-COBRA5272-board (Coldfire).
|
||||
|
||||
* Patch by Gleb Natapov, 07 Sep 2004:
|
||||
mpc824x: set PCI latency timer to a sane value
|
||||
(is 0 after reset).
|
||||
|
||||
* Patch by Kurt Stremerch, 03 Sep 2004:
|
||||
Add bitstream configuration option for fpga command (Xilinx only).
|
||||
|
||||
* Patch by Kurt Stremerch, 03 Sep 2004:
|
||||
Add Xilinx Spartan2E family FPGA support
|
||||
|
||||
* Patch by Jeff Angielski, 02 Sep 2004:
|
||||
Add Added support for H2 revision of the EP8260 board.
|
||||
Fixed formatting for some of the EP8260 related source files.
|
||||
|
||||
* Patch by Jon Loeliger, 02 Sep 2004:
|
||||
Reset monitor size back to 256 so environment can be written
|
||||
to flash on MPC85xx ADS and CDS releases.
|
||||
|
||||
* Patch by Paolo Broggini, 02 Sep 2004:
|
||||
Make BSS clearing on ARM systems more robust
|
||||
|
||||
* Patch by Yue Hu and Joe, 01 Sep 2004:
|
||||
- add PCI support for ixp425;
|
||||
- add EEPRO100 suppor tfor ixdp425 board.
|
||||
|
||||
* Fix problem with protected sector detection in driver/cfi_flash.c
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 1.1.2:
|
||||
======================================================================
|
||||
|
||||
* Code cleanup, mostly for GCC-3.3.x
|
||||
|
||||
* Cleanup confusing use of CONFIG_ETH*ADDR - ust his only to
|
||||
pre-define a MAC address; use CONFIG_HAS_ETH* to enable support for
|
||||
additional ethernet addresses.
|
||||
|
||||
* Cleanup drivers/i82365.c - avoid duplication of code
|
||||
|
||||
* Fix bogus "cannot span across banks" flash error message
|
||||
|
||||
* Code cleanup
|
||||
|
||||
* Add support for CompactFlash for the CPC45 Board.
|
||||
|
||||
* Fix problems with CMC_PU2 flash driver.
|
||||
|
||||
* Cleanup:
|
||||
- avoid trigraph warning in fs/ext2/ext2fs.c
|
||||
- rename UC100 -> uc100
|
||||
|
||||
* Add support for UC100 board
|
||||
|
||||
* Patch by Stefan Roese, 16 Dez 2004:
|
||||
- ext2fs support added
|
||||
- Tundra universe support added
|
||||
- Coldfire MCF5249 support added (no preloader needed!)
|
||||
- MCF5249 board TASREG added
|
||||
- PPC boards added: APC405, CPCI405DT, CPCI750, G2000, HH405,
|
||||
VOM405, WUH405
|
||||
- some esd boards updated
|
||||
- memory commands "mdc" and "mwc" added for cyclic read/write
|
||||
(CONFIG_MX_CYCLIC, see README for further description)
|
||||
|
||||
* Add support for INKA4X0 board
|
||||
|
||||
* Patch by Steven Scholz, 12 Dec 2004:
|
||||
Fix typo in AT91 memory setup.
|
||||
|
||||
* Patch by Martin Krause, 27 Oct 2004:
|
||||
- add support for "STK52xx" board (including PS/2 multiplexer)
|
||||
- add hardware detection for TQM5200
|
||||
|
||||
* Clean up CMC PU2 flash driver
|
||||
|
||||
* Update MAINTAINERS file
|
||||
|
||||
* Fix bug in MPC823 LCD driver
|
||||
|
||||
* Fix udelay() on AT91RM9200 for delays < 1 ms.
|
||||
|
||||
* Enable long help on CMC PU2 board;
|
||||
fix reset issue;
|
||||
increase CPU speed from 179 to 207 MHz.
|
||||
|
||||
* Fix smc91111 ethernet driver for Xaeniax board (need to handle
|
||||
unaligned tail part specially).
|
||||
|
||||
* Update for AT91RM9200DK and CMC_PU2 boards:
|
||||
- Enable booting directly from flash
|
||||
- fix CMC_PU2 flash driver
|
||||
|
||||
* Fix mkimage usage message
|
||||
|
||||
* Map SRAM on NC650 board
|
||||
|
||||
* Work around for Ethernet problems on Xaeniax board
|
||||
|
||||
* Patch by TsiChung Liew, 23 Sep 2004:
|
||||
- add support for MPC8220 CPU
|
||||
- Add support for Alaska and Yukon boards
|
||||
|
||||
* Fix configuration for ERIC board (needs more room)
|
||||
|
||||
* Adjust MIPS compiler options at run-time depending on tools version
|
||||
("-march=4kc -mtune=4kc -Wa,-mips_allow_branch_to_undefined" for new,
|
||||
"-mcpu=4kc" for old tools)
|
||||
|
||||
* Add passing of the command line and memory size information to the
|
||||
kernel on xaeniax board.
|
||||
|
||||
* Enable NAND flash support for NC650 board.
|
||||
|
||||
* Patch by Thomas Lange 07 Oct 2004:
|
||||
Updated README for DBAu1x00 boards to match current status
|
||||
|
||||
* Patch by Philippe Robin, 28 Sept 2004:
|
||||
Fix Flash support for Versatile.
|
||||
|
||||
* Patch by Roger Blofeld, 16 Sep 2004:
|
||||
Fix timeout for DHCP command retry
|
||||
|
||||
* Patch by Pantelis Antoniou, 14 Sep 2004:
|
||||
Fix early serial hang when CONFIG_SERIAL_MULTI is defined.
|
||||
|
||||
* Patch by Pantelis Antoniou, 14 Sep 2004:
|
||||
Kick watchdog when bz-decompressing
|
||||
|
||||
* Fix CFG_HZ problems on AT91RM9200 systems
|
||||
[Remember: CFG_HZ should be 1000 on ALL systems!]
|
||||
|
||||
* Patch by Gridish Shlomi, 30 Aug 2004:
|
||||
- Add support to revA version of PQ27 and PQ27E.
|
||||
- Reverted MPC8260ADS baudrate back to original 115200
|
||||
|
||||
* Patch by Hojin, 17 Sep 2004:
|
||||
Fix typo in cfi_flash.c
|
||||
|
||||
* Patch by Mark Jonas, 09 September 2004:
|
||||
mtest's data line test (with CFG_ALT_MEMTEST set) returned a wrong
|
||||
error message
|
||||
|
||||
* Patch by Mark Jonas, 31 August 2004:
|
||||
Added option CFG_XLB_PIPELINING to enable XLB pipelining. This
|
||||
improves FTP performance for MPC5200 systems. Enabled for IceCube
|
||||
by default.
|
||||
|
||||
* Patch by Michael Bendzick, 30 Aug 2004:
|
||||
- Improve platform.S code for omap1510inn that detects whether code
|
||||
is running from SDRAM or not. Patch allows SDRAM to be configured
|
||||
if code is running out of SRAM at 0x20000000.
|
||||
|
||||
* Patch by Frederick Klatt, 30 Aug 2004:
|
||||
Add support for the Wind River SBC8540/SBC8560 boards
|
||||
|
||||
* Configure SX1 board to use drivers/cfi_flash.c
|
||||
|
||||
* Patches by Michael Bendzick, 30 Aug 2004:
|
||||
- Configure omap1510inn board to use drivers/cfi_flash.c
|
||||
- Make drivers/cfi_flash.c protect environment and redundant
|
||||
environment.
|
||||
|
||||
* Patch by Steven Scholz, 23 Jun 2004:
|
||||
- Add script (tools/img2brec.sh) to programm U-Boot into
|
||||
(Synch)Flash using the Bootstrap Mode of the MC9328MX1/L
|
||||
|
||||
* Patches by Scott McNutt, 24 Aug 2004:
|
||||
- Add support for Altera Nios-II processors.
|
||||
- Add support for Psyent PCI-5441 board.
|
||||
- Add support for Psyent PK1C20 board.
|
||||
|
||||
* Patches by Jon Loeliger, 24 Aug 2004:
|
||||
- Add support for the MPC8541 and MPC8555 CDS boards
|
||||
- Cleanup eth?addr handling: make dependent on CONFIG_ETH?ADDR
|
||||
- Convert MPC85xxADS to use common CFI flash driver
|
||||
- Fix PCI window on MPC85xx; remove unneeded PCI initialization
|
||||
from board_early_init_f()
|
||||
- Provide SW workaround for PCI initialization on 85xx CDS
|
||||
|
||||
* Patches by George G. Davis, 24 Aug 2004:
|
||||
- Enable ramdisk/initrd tagged param support for omap1610h2_config
|
||||
- Remove static network setup defaults from mx1ads_config
|
||||
- update ARM boards to use constants from mach-types.h
|
||||
|
||||
* Patch by Gary Jennejohn, 04 Oct 2004:
|
||||
- fix I2C on at91rm9200
|
||||
- add support for Ricoh RS5C372A RTC
|
||||
|
||||
* Patch by Gary Jennejohn, 01 Oct 2004:
|
||||
- add support for CMC PU2 board
|
||||
- add support for I2C on at91rm9200
|
||||
|
||||
* Patch by Gary Jennejohn, 28 Sep 2004:
|
||||
fix baudrate handling on at91rm9200
|
||||
|
||||
* Patch by Yuli Barcohen, 22 Aug 2004:
|
||||
- remove ZPC.1900 board-specific flash driver;
|
||||
switch the port to generic CFI driver;
|
||||
- port clean-up
|
||||
|
||||
* Patch by Hinko Kocevar, 21 Aug 2004:
|
||||
Add calc_fbsize() function used with VIDEOLFB_TAG on TRAB
|
||||
|
||||
* Clean up tools/bmp_logo.c to not add trailing white space
|
||||
|
||||
* Patch by Hinko Kocevar, 21 Aug 2004:
|
||||
- Group common framebuffer functions in common/lcd.c
|
||||
- Group common framebuffer macros and #defines in include/lcd.h
|
||||
- Provide calc_fbsize() for video ATAG
|
||||
|
||||
* Patch by Sam Song, 21 August 2004:
|
||||
- Fix a typo in README
|
||||
- Align "(RO)" output for "flinfo" after "protect on"
|
||||
- Add RESET support for RPXlite_DW board; adjust CPU:BUS frequency
|
||||
ratio 1:1 when core frequency less than 50MHz
|
||||
|
||||
* Patches by Hinko Kocevar, 21 Aug 2004:
|
||||
- fix some "use of label at end of compound statement" warnings
|
||||
- Define type of LCD panel on lubbock board if CONFIG_LCD is used
|
||||
|
||||
* Patch by Steven Scholz, 16 Aug 2004:
|
||||
- Introducing the concept of SoCs "./cpu/$(CPU)/$(SOC)"
|
||||
- creating subdirs for SoCs ./cpu/arm920t/imx and ./cpu/arm920t/s3c24x0
|
||||
- moving SoC specific code out of cpu/arm920t/ into cpu/arm920t/$(SOC)/
|
||||
- moving drivers/s3c24x0_i2c.c and drivers/serial_imx.c out of drivers/
|
||||
into cpu/arm920t/$(SOC)/
|
||||
|
||||
* Patches by Sean Chang, 09 Aug 2004:
|
||||
- Added support for both 8 and 16 bit mode access to System ACE CF
|
||||
through MPU.
|
||||
- Fixed missing System ACE CF device during get FAT partition info
|
||||
in fat_register_device function.
|
||||
- Enabled System ACE CF support on ML300.
|
||||
|
||||
* Patch by Sean Chang, 09 Aug 2004:
|
||||
Synch defines for saveenv and do_saveenv functions so they get
|
||||
compiled under the same statement.
|
||||
|
||||
* Patch by Sean Chang, 09 Aug 2004:
|
||||
- Added I2C support for ML300.
|
||||
- Added support for ML300 to read out its environment information
|
||||
stored on the EEPROM.
|
||||
- Added support to use board specific parameters as part of
|
||||
U-Boot's environment information.
|
||||
- Updated MLD files to support configuration for new features
|
||||
above.
|
||||
|
||||
* Patches by Travis Sawyer, 05 Aug 2004:
|
||||
- Remove incorrect bridge settings for eth group 6
|
||||
- Add call to setup bridge in ppc_440x_eth_initialize
|
||||
- Fix ppc_440x_eth_init to reset the phy only if its the
|
||||
first time through, otherwise, just check the phy for the
|
||||
autonegotiated speed/duplex. This allows the use of netconsole
|
||||
- only print the speed/duplex the first time the phy is reset.
|
||||
|
||||
* Patch by Shlomo Kut, 29 Mar 2004:
|
||||
Add support for MKS Instruments "Quantum" board
|
||||
|
||||
* Fix build problem with Cogent boards;
|
||||
avoid using <asm/byteorder.h> when using the host compiler
|
||||
|
||||
* Patch by Ganapathi C, 04 Aug 2004:
|
||||
Fix NFS timeout issue
|
||||
|
||||
* Patch by Yuli Barcohen, 19 Jul 2004:
|
||||
- Fix host tools building in Cygwin environment
|
||||
- Fix header files search order for host tools
|
||||
|
||||
* Patch by Tom Armistead, 19 Jul 2004:
|
||||
Fix kgdb.S support for 74xx_75x cpu
|
||||
|
||||
* Patch by Jon Loeliger, 15 Jul 2004:
|
||||
Fix MPC85xx I2C driver
|
||||
|
||||
* Fix problems with CDROM drive as slave device on Lite5200 IDE bus.
|
||||
|
||||
* Patch by Stephen Williams, 15 July 2004
|
||||
Set the PCI class code for JSE board as part of PCI interface setup
|
||||
|
||||
* Patch by Michael Bendzick, 15 Jul 2004:
|
||||
Fix problem with writes with odd sizes in drivers/cfi_flash.c when
|
||||
CFG_FLASH_USE_BUFFER_WRITE is set
|
||||
|
||||
* Patch by Yuli Barcohen, 13 Jul 2004:
|
||||
Allow clock setting on MPC866/MPC885 series chips according to
|
||||
environment variable `cpuclk'
|
||||
|
||||
* Patch by Yuli Barcohen, 20 Apr 2004:
|
||||
Remove unnecessary redefine of CPM_DATAONLY_SIZE for MPC826x
|
||||
|
||||
* Patch by Vincent Dubey, 24 Sep 2004:
|
||||
Add support for xaeniax board
|
||||
|
||||
* Add comment about non-GPL character of standalone applications to
|
||||
COPYING file
|
||||
|
||||
* Fix FEC ethernet problem on NSCU board.
|
||||
|
||||
* Patch by Gary Jennejohn, 09 Sep 2004:
|
||||
allow to use USART1 as console port on at91rm9200dk boards
|
||||
|
||||
* Patch by Stefan Roese, 16 Sep 2004:
|
||||
Update AR405 board.
|
||||
|
||||
* Fix SysClk handling for PPChameleon and CATcenter boards
|
||||
|
||||
* Patch by Detlev Zundel, 08 Sep 2004:
|
||||
Update etags build target
|
||||
|
||||
|
||||
11
COPYING
11
COPYING
@ -1,3 +1,14 @@
|
||||
NOTE! This copyright does *not* cover the so-called "standalone"
|
||||
applications that use U-Boot services by means of the jump table
|
||||
provided by U-Boot exactly for this purpose - this is merely
|
||||
considered normal use of U-Boot, and does *not* fall under the
|
||||
heading of "derived work". Also note that the GPL below is
|
||||
copyrighted by the Free Software Foundation, but the instance of code
|
||||
that it refers to (the U-Boot source code) is copyrighted by me and
|
||||
others who actually wrote it. -- Wolfgang Denk
|
||||
|
||||
=======================================================================
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
||||
16
CREDITS
16
CREDITS
@ -40,6 +40,7 @@ D: Unified support for Motorola MPC826xADS/MPC8272ADS/PQ2FADS boards.
|
||||
D: Support for Zephyr Engineering ZPC.1900 board.
|
||||
D: Support for Interphase iSPAN boards.
|
||||
D: Support for Analogue&Micro Adder boards.
|
||||
D: Support for Analogue&Micro Rattler boards.
|
||||
W: http://www.arabellasw.com
|
||||
|
||||
N: Jerry van Baren
|
||||
@ -223,6 +224,10 @@ N: Sangmoon Kim
|
||||
E: dogoil@etinsys.com
|
||||
D: Support for debris board
|
||||
|
||||
N: Frederick W. Klatt
|
||||
E: fred.klatt@windriver.com
|
||||
D: Support for Wind River SBC8540/SBC8560 boards
|
||||
|
||||
N: Thomas Koeller
|
||||
E: tkoeller@gmx.net
|
||||
D: Port to Motorola Sandpoint 3 (MPC8240)
|
||||
@ -249,6 +254,10 @@ E: team@leox.org
|
||||
D: Support for LEOX boards, DS164x RTC
|
||||
W: http://www.leox.org
|
||||
|
||||
N: Leif Lindholm
|
||||
E: leif.lindholm@i3micro.com
|
||||
D: Support for AMD dbau1550 board.
|
||||
|
||||
N: Stephan Linz
|
||||
E: linz@li-pro.net
|
||||
D: Support for Nios Stratix Development Kit (DK-1S10)
|
||||
@ -286,7 +295,10 @@ D: Support for Samsung ARM920T SMDK2410 eval board
|
||||
|
||||
N: Scott McNutt
|
||||
E: smcnutt@psyent.com
|
||||
D: Support for Altera Nios-32 CPU, for Nios Cyclone Development Kit (DK-1C20)
|
||||
D: Support for Altera Nios-32 CPU
|
||||
D: Support for Altera Nios-II CPU
|
||||
D: Support for Nios Cyclone Development Kit (DK-1C20)
|
||||
W: http://www.psyent.com
|
||||
|
||||
N: Rolf Offermanns
|
||||
E: rof@sysgo.de
|
||||
@ -322,7 +334,7 @@ D: BedBug embedded debugger code
|
||||
|
||||
N: Daniel Poirot
|
||||
E: dan.poirot@windriver.com
|
||||
D: Support for the sbc8240 board
|
||||
D: Support for the Wind River sbc405, sbc8240 board
|
||||
W: http://www.windriver.com
|
||||
|
||||
N: Stefan Roese
|
||||
|
||||
53
MAINTAINERS
53
MAINTAINERS
@ -25,11 +25,16 @@ Pantelis Antoniou <panto@intracom.gr>
|
||||
|
||||
NETVIA MPC8xx
|
||||
|
||||
Reinhard Arlt <reinhard.arlt@esd-electronics.com>
|
||||
|
||||
CPCI750 PPC750FX/GX
|
||||
|
||||
Yuli Barcohen <yuli@arabellasw.com>
|
||||
|
||||
Adder MPC87x/MPC852T
|
||||
ISPAN MPC8260
|
||||
MPC8260ADS MPC826x/MPC827x/MPC8280
|
||||
Rattler MPC8248
|
||||
ZPC1900 MPC8265
|
||||
|
||||
Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
|
||||
@ -209,25 +214,40 @@ Frank Panno <fpanno@delphintech.com>
|
||||
|
||||
ep8260 MPC8260
|
||||
|
||||
Peter Pearse <peter.pearse@arm.com>
|
||||
|
||||
Integrator/AP CM 926EJ-S, CM7x0T, CM9x0T
|
||||
Integrator/CP CM 926EJ-S CM920T, CM940T, CM922T-XA10
|
||||
Versatile/AB ARM926EJ-S
|
||||
Versatile/PB ARM926EJ-S
|
||||
|
||||
Denis Peter <d.peter@mpl.ch>
|
||||
|
||||
MIP405 PPC4xx
|
||||
PIP405 PPC4xx
|
||||
|
||||
Daniel Poirot <dan.poirot@windriver.com>
|
||||
sbc8240 MPC8240
|
||||
sbc405 PPC405GP
|
||||
|
||||
Stefan Roese <stefan.roese@esd-electronics.com>
|
||||
|
||||
ADCIOP IOP480 (PPC401)
|
||||
APC405 PPC405GP
|
||||
AR405 PPC405GP
|
||||
ASH405 PPC405EP
|
||||
CANBT PPC405CR
|
||||
CPCI405 PPC405GP
|
||||
CPCI4052 PPC405GP
|
||||
CPCI405AB PPC405GP
|
||||
CPCI405DT PPC405GP
|
||||
CPCI440 PPC440GP
|
||||
CPCIISER4 PPC405GP
|
||||
DASA_SIM IOP480 (PPC401)
|
||||
DP405 PPC405EP
|
||||
DU405 PPC405GP
|
||||
G2000 PPC405EP
|
||||
HH405 PPC405EP
|
||||
HUB405 PPC405EP
|
||||
OCRTC PPC405GP
|
||||
ORSG PPC405GP
|
||||
@ -235,6 +255,8 @@ Stefan Roese <stefan.roese@esd-electronics.com>
|
||||
PLU405 PPC405EP
|
||||
PMC405 PPC405GP
|
||||
VOH405 PPC405EP
|
||||
VOM405 PPC405EP
|
||||
WUH405 PPC405EP
|
||||
|
||||
Travis Sawyer (travis.sawyer@sandburst.com>
|
||||
|
||||
@ -281,6 +303,10 @@ Dan Malek <dan@embeddededge.com>
|
||||
|
||||
STxGP3 MPC85xx
|
||||
|
||||
Yusdi Santoso <yusdi_santoso@adaptec.com>
|
||||
|
||||
HIDDEN_DRAGON MPC8241/MPC8245
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Unknown / orphaned boards:
|
||||
@ -365,6 +391,10 @@ Rishi Bhattacharya <rishi@ti.com>
|
||||
|
||||
omap5912osk ARM926EJS
|
||||
|
||||
Richard Woodruff <r-woodruff2@ti.com>
|
||||
|
||||
omap2420h4 ARM1136EJS
|
||||
|
||||
David M<>ller <d.mueller@elsoft.ch>
|
||||
|
||||
smdk2410 ARM920T
|
||||
@ -430,6 +460,18 @@ Scott McNutt <smcnutt@psyent.com>
|
||||
|
||||
DK1C20 Nios-32
|
||||
|
||||
#########################################################################
|
||||
# Nios-II Systems: #
|
||||
# #
|
||||
# Maintainer Name, Email Address #
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
Scott McNutt <smcnutt@psyent.com>
|
||||
|
||||
PCI5441 Nios-II
|
||||
PK1C20 Nios-II
|
||||
|
||||
#########################################################################
|
||||
# MicroBlaze Systems: #
|
||||
# #
|
||||
@ -441,6 +483,17 @@ Yasushi Shoji <yashi@atmark-techno.com>
|
||||
|
||||
SUZAKU MicroBlaze
|
||||
|
||||
#########################################################################
|
||||
# Coldfire Systems: #
|
||||
# #
|
||||
# Maintainer Name, Email Address #
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
Stefan Roese <stefan.roese@esd-electronics.com>
|
||||
|
||||
TASREG MCF5249
|
||||
|
||||
#########################################################################
|
||||
# End of MAINTAINERS list #
|
||||
#########################################################################
|
||||
|
||||
116
MAKEALL
116
MAKEALL
@ -26,7 +26,7 @@ LIST_5xx=" \
|
||||
|
||||
LIST_5xxx=" \
|
||||
icecube_5100 icecube_5200 EVAL5200 PM520 \
|
||||
Total5100 Total5200 Total5200_Rev2 TQM5200_AA \
|
||||
Total5100 Total5200 Total5200_Rev2 TQM5200_auto \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@ -34,23 +34,25 @@ LIST_5xxx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_8xx=" \
|
||||
Adder87x GENIETV MBX860T RBC823 \
|
||||
AdderII GTH MHPC rmu \
|
||||
ADS860 hermes MPC86xADS RPXClassic \
|
||||
AMX860 IAD210 MPC885ADS RPXlite \
|
||||
c2mon ICU862_100MHz MVS1 RPXlite_DW \
|
||||
CCM IP860 NETPHONE RRvision \
|
||||
cogent_mpc8xx IVML24 NETTA SM850 \
|
||||
ELPT860 IVML24_128 NETTA2 SPD823TS \
|
||||
ESTEEM192E IVML24_256 NETTA_ISDN svm_sc8xx \
|
||||
ETX094 IVMS8 NETVIA SXNI855T \
|
||||
FADS823 IVMS8_128 NETVIA_V2 TOP860 \
|
||||
FADS850SAR IVMS8_256 NX823 TQM823L \
|
||||
FADS860T KUP4K pcu_e TQM823L_LCD \
|
||||
FLAGADM KUP4X QS823 TQM850L \
|
||||
FPS850L LANTEC QS850 TQM855L \
|
||||
GEN860T lwmon QS860T TQM860L \
|
||||
GEN860T_SC MBX R360MPI v37 \
|
||||
Adder87x GENIETV MBX860T R360MPI \
|
||||
AdderII GTH MHPC RBC823 \
|
||||
ADS860 hermes MPC86xADS rmu \
|
||||
AMX860 IAD210 MPC885ADS RPXClassic \
|
||||
c2mon ICU862_100MHz MVS1 RPXlite \
|
||||
CCM IP860 NETPHONE RPXlite_DW \
|
||||
cogent_mpc8xx IVML24 NETTA RRvision \
|
||||
ELPT860 IVML24_128 NETTA2 SM850 \
|
||||
ESTEEM192E IVML24_256 NETTA_ISDN SPD823TS \
|
||||
ETX094 IVMS8 NETVIA svm_sc8xx \
|
||||
FADS823 IVMS8_128 NETVIA_V2 SXNI855T \
|
||||
FADS850SAR IVMS8_256 NX823 TOP860 \
|
||||
FADS860T KUP4K pcu_e TQM823L \
|
||||
FLAGADM KUP4X QS823 TQM823L_LCD \
|
||||
FPS850L LANTEC QS850 TQM850L \
|
||||
GEN860T lwmon QS860T TQM855L \
|
||||
GEN860T_SC MBX quantum TQM860L \
|
||||
uc100 \
|
||||
v37 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@ -67,7 +69,15 @@ LIST_4xx=" \
|
||||
ml300 OCOTEA OCRTC ORSG \
|
||||
PCI405 PIP405 PLU405 PMC405 \
|
||||
PPChameleonEVB VOH405 W7OLMC W7OLMG \
|
||||
WALNUT405 XPEDITE1K \
|
||||
WALNUT405 WUH405 XPEDITE1K \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MPC8220 Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_8220=" \
|
||||
Alaska8220 Yukon8220 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@ -76,9 +86,10 @@ LIST_4xx=" \
|
||||
|
||||
LIST_824x=" \
|
||||
A3000 BMW CPC45 CU824 \
|
||||
debris eXalion MOUSSE MUSENKI \
|
||||
MVBLUE OXC PN62 Sandpoint8240 \
|
||||
Sandpoint8245 SL8245 utx8245 sbc8240 \
|
||||
debris eXalion HIDDEN_DRAGON MOUSSE \
|
||||
MUSENKI MVBLUE OXC PN62 \
|
||||
Sandpoint8240 Sandpoint8245 SL8245 utx8245 \
|
||||
sbc8240 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@ -86,12 +97,13 @@ LIST_824x=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_8260=" \
|
||||
atc cogent_mpc8260 CPU86 ep8260 \
|
||||
gw8260 hymod IPHASE4539 ISPAN \
|
||||
MPC8260ADS MPC8266ADS MPC8272ADS PM826 \
|
||||
PM828 ppmc8260 PQ2FADS RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE ZPC1900 \
|
||||
atc cogent_mpc8260 CPU86 CPU87 \
|
||||
ep8260 gw8260 hymod IPHASE4539 \
|
||||
ISPAN MPC8260ADS MPC8266ADS MPC8272ADS \
|
||||
PM826 PM828 ppmc8260 Rattler8248 \
|
||||
RPXsuper rsdproto sacsng sbc8260 \
|
||||
SCM TQM8260_AC TQM8260_AD TQM8260_AE \
|
||||
ZPC1900 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@ -99,7 +111,9 @@ LIST_8260=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_85xx=" \
|
||||
MPC8540ADS MPC8560ADS sbc8560 stxgp3 \
|
||||
MPC8540ADS MPC8541CDS MPC8555CDS MPC8560ADS \
|
||||
PM854 sbc8540 sbc8560 stxgp3 \
|
||||
TQM8540 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@ -112,7 +126,7 @@ LIST_74xx=" \
|
||||
"
|
||||
|
||||
LIST_7xx=" \
|
||||
BAB7xx ELPPC \
|
||||
BAB7xx CPCI750 ELPPC \
|
||||
"
|
||||
|
||||
LIST_ppc="${LIST_5xx} ${LIST_5xxx} \
|
||||
@ -139,22 +153,36 @@ LIST_ARM7="B2 ep7312 evb4510 impa7 modnet50"
|
||||
#########################################################################
|
||||
|
||||
LIST_ARM9=" \
|
||||
at91rm9200dk integratorcp integratorap lpd7a400 \
|
||||
mx1ads mx1fs2 omap1510inn omap1610h2 \
|
||||
omap1610inn omap730p2 scb9328 smdk2400 \
|
||||
smdk2410 trab VCMA9 versatile \
|
||||
at91rm9200dk cmc_pu2 integratorcp integratorap \
|
||||
lpd7a400 mx1ads mx1fs2 omap1510inn \
|
||||
omap1610h2 omap1610inn omap730p2 scb9328 \
|
||||
smdk2400 smdk2410 trab VCMA9 \
|
||||
versatile \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## ARM11 Systems
|
||||
#########################################################################
|
||||
LIST_ARM11="omap2420h4"
|
||||
|
||||
#########################################################################
|
||||
## Xscale Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_pxa="cerf250 cradle csb226 innokom lubbock wepep250 xm250 xsengine"
|
||||
LIST_pxa=" \
|
||||
cerf250 cradle csb226 innokom \
|
||||
lubbock wepep250 xaeniax xm250 \
|
||||
xsengine \
|
||||
"
|
||||
|
||||
LIST_ixp="ixdp425"
|
||||
|
||||
|
||||
LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9} ${LIST_pxa} ${LIST_ixp}"
|
||||
LIST_arm=" \
|
||||
${LIST_SA} \
|
||||
${LIST_ARM7} ${LIST_ARM9} ${LIST_ARM11} \
|
||||
${LIST_pxa} ${LIST_ixp} \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MIPS Systems
|
||||
@ -164,9 +192,9 @@ LIST_mips4kc="incaip"
|
||||
|
||||
LIST_mips5kc="purple"
|
||||
|
||||
LIST_au1x00="dbau1000 dbau1100 dbau1500"
|
||||
LIST_au1xx0="dbau1000 dbau1100 dbau1500 dbau1550 dbau1550_el"
|
||||
|
||||
LIST_mips="${LIST_mips4kc} ${LIST_mips5kc} ${LIST_au1x00}"
|
||||
LIST_mips="${LIST_mips4kc} ${LIST_mips5kc} ${LIST_au1xx0}"
|
||||
|
||||
#########################################################################
|
||||
## i386 Systems
|
||||
@ -187,6 +215,12 @@ LIST_nios=" \
|
||||
DK1S10 DK1S10_standard_32 DK1S10_mtx_ldk_20 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## Nios-II Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_nios2="PCI5441 PK1C20"
|
||||
|
||||
#########################################################################
|
||||
## MicroBlaze Systems
|
||||
#########################################################################
|
||||
@ -215,11 +249,11 @@ build_target() {
|
||||
for arg in $@
|
||||
do
|
||||
case "$arg" in
|
||||
ppc|5xx|5xxx|8xx|824x|8260|85xx|4xx|7xx|74xx| \
|
||||
arm|SA|ARM7|ARM9|pxa|ixp| \
|
||||
ppc|5xx|5xxx|8xx|8220|824x|8260|85xx|4xx|7xx|74xx| \
|
||||
arm|SA|ARM7|ARM9|ARM11|pxa|ixp| \
|
||||
microblaze| \
|
||||
mips| \
|
||||
nios| \
|
||||
nios|nios2| \
|
||||
x86|I486)
|
||||
for target in `eval echo '$LIST_'${arg}`
|
||||
do
|
||||
|
||||
213
Makefile
213
Makefile
@ -45,7 +45,7 @@ export TOPDIR
|
||||
ifeq (include/config.mk,$(wildcard include/config.mk))
|
||||
# load ARCH, BOARD, and CPU configuration
|
||||
include include/config.mk
|
||||
export ARCH CPU BOARD VENDOR
|
||||
export ARCH CPU BOARD VENDOR SOC
|
||||
# load other configuration
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
@ -72,6 +72,9 @@ endif
|
||||
ifeq ($(ARCH),nios)
|
||||
CROSS_COMPILE = nios-elf-
|
||||
endif
|
||||
ifeq ($(ARCH),nios2)
|
||||
CROSS_COMPILE = nios2-elf-
|
||||
endif
|
||||
ifeq ($(ARCH),m68k)
|
||||
CROSS_COMPILE = m68k-elf-
|
||||
endif
|
||||
@ -101,9 +104,12 @@ endif
|
||||
LIBS = lib_generic/libgeneric.a
|
||||
LIBS += board/$(BOARDDIR)/lib$(BOARD).a
|
||||
LIBS += cpu/$(CPU)/lib$(CPU).a
|
||||
ifdef SOC
|
||||
LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
|
||||
endif
|
||||
LIBS += lib_$(ARCH)/lib$(ARCH).a
|
||||
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
|
||||
fs/reiserfs/libreiserfs.a
|
||||
fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a
|
||||
LIBS += net/libnet.a
|
||||
LIBS += disk/libdisk.a
|
||||
LIBS += rtc/librtc.a
|
||||
@ -115,7 +121,7 @@ LIBS += common/libcommon.a
|
||||
.PHONY : $(LIBS)
|
||||
|
||||
# Add GCC lib
|
||||
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||
|
||||
|
||||
# The "tools" are needed early, so put this first
|
||||
@ -133,6 +139,9 @@ ALL = u-boot.srec u-boot.bin System.map
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
u-boot.hex: u-boot
|
||||
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
|
||||
|
||||
u-boot.srec: u-boot
|
||||
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
||||
|
||||
@ -152,7 +161,7 @@ u-boot.dis: u-boot
|
||||
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) $(PLATFORM_LIBS) --end-group \
|
||||
--start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
|
||||
-Map u-boot.map -o u-boot
|
||||
|
||||
$(LIBS):
|
||||
@ -252,6 +261,9 @@ icecube_5100_config: unconfig
|
||||
}
|
||||
@./mkconfig -a IceCube ppc mpc5xxx icecube
|
||||
|
||||
inka4x0_config: unconfig
|
||||
@./mkconfig inka4x0 ppc mpc5xxx inka4x0
|
||||
|
||||
PM520_config \
|
||||
PM520_DDR_config \
|
||||
PM520_ROMBOOT_config \
|
||||
@ -301,6 +313,7 @@ Total5200_Rev2_lowboot_config: unconfig
|
||||
}
|
||||
@./mkconfig -a Total5200 ppc mpc5xxx total5200
|
||||
|
||||
TQM5200_auto_config \
|
||||
TQM5200_AA_config \
|
||||
TQM5200_AB_config \
|
||||
TQM5200_AC_config \
|
||||
@ -325,6 +338,10 @@ MiniFAP_config: unconfig
|
||||
echo "... with 4 MB Flash, 128 MB SDRAM" ; \
|
||||
echo "... with Graphics Controller"; \
|
||||
}
|
||||
@[ -z "$(findstring auto,$@)" ] || \
|
||||
{ echo "#define CONFIG_CS_AUTOCONF" >>include/config.h ; \
|
||||
echo "... with automatic CS configuration" ; \
|
||||
}
|
||||
@./mkconfig -a TQM5200 ppc mpc5xxx tqm5200
|
||||
|
||||
#########################################################################
|
||||
@ -553,6 +570,9 @@ QS823_config: unconfig
|
||||
QS860T_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx qs860t snmc
|
||||
|
||||
quantum_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx quantum
|
||||
|
||||
R360MPI_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx r360mpi
|
||||
|
||||
@ -650,6 +670,9 @@ TTTech_config: unconfig
|
||||
@echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
|
||||
@./mkconfig -a TQM823L ppc mpc8xx tqm8xx
|
||||
|
||||
uc100_config : unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx uc100
|
||||
|
||||
v37_config: unconfig
|
||||
@echo "#define CONFIG_LCD" >include/config.h
|
||||
@echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
|
||||
@ -668,6 +691,9 @@ xtract_4xx = $(subst _25,,$(subst _33,,$(subst _BA,,$(subst _ME,,$(subst _HI,,$(
|
||||
ADCIOP_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx adciop esd
|
||||
|
||||
APC405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx apc405 esd
|
||||
|
||||
AR405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
|
||||
|
||||
@ -680,13 +706,24 @@ BUBINGA405EP_config: unconfig
|
||||
CANBT_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx canbt esd
|
||||
|
||||
CATcenter_config: unconfig
|
||||
CATcenter_config \
|
||||
CATcenter_25_config \
|
||||
CATcenter_33_config: unconfig
|
||||
@ echo "/* CATcenter uses PPChameleon Model ME */" > include/config.h
|
||||
@ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >> include/config.h
|
||||
@[ -z "$(findstring _25,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_CLK_25" >>include/config.h ; \
|
||||
echo "SysClk = 25MHz" ; \
|
||||
}
|
||||
@[ -z "$(findstring _33,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_CLK_33" >>include/config.h ; \
|
||||
echo "SysClk = 33MHz" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
CPCI405_config \
|
||||
CPCI4052_config \
|
||||
CPCI405DT_config \
|
||||
CPCI405AB_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
|
||||
@echo "BOARD_REVISION = $(@:_config=)" >>include/config.mk
|
||||
@ -724,6 +761,12 @@ ERIC_config: unconfig
|
||||
EXBITGEN_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx exbitgen
|
||||
|
||||
G2000_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx g2000
|
||||
|
||||
HH405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx hh405 esd
|
||||
|
||||
HUB405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx hub405 esd
|
||||
|
||||
@ -771,31 +814,37 @@ PPChameleonEVB_BA_33_config \
|
||||
PPChameleonEVB_ME_33_config \
|
||||
PPChameleonEVB_HI_33_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _MODEL_BA,$@)" ] || \
|
||||
@[ -z "$(findstring EVB_BA,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>include/config.h ; \
|
||||
echo "... BASIC model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _MODEL_ME,$@)" ] || \
|
||||
@[ -z "$(findstring EVB_ME,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>include/config.h ; \
|
||||
echo "... MEDIUM model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _MODEL_HI,$@)" ] || \
|
||||
@[ -z "$(findstring EVB_HI,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>include/config.h ; \
|
||||
echo "... HIGH-END model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _25,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_CLK_25" >>include/config.h ; \
|
||||
echo " SysClk = 25MHz" ; \
|
||||
echo "SysClk = 25MHz" ; \
|
||||
}
|
||||
@[ -z "$(findstring _33,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_CLK_33" >>include/config.h ; \
|
||||
echo " SysClk = 33MHz" ; \
|
||||
echo "SysClk = 33MHz" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
sbc405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx sbc405
|
||||
|
||||
VOH405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx voh405 esd
|
||||
|
||||
VOM405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx vom405 esd
|
||||
|
||||
W7OLMC_config \
|
||||
W7OLMG_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx w7o
|
||||
@ -803,9 +852,24 @@ W7OLMG_config: unconfig
|
||||
WALNUT405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx walnut405
|
||||
|
||||
WUH405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx wuh405 esd
|
||||
|
||||
XPEDITE1K_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx xpedite1k
|
||||
|
||||
#########################################################################
|
||||
## MPC8220 Systems
|
||||
#########################################################################
|
||||
Alaska8220_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8220 alaska
|
||||
|
||||
sorcery_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8220 sorcery
|
||||
|
||||
Yukon8220_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8220 yukon
|
||||
|
||||
#########################################################################
|
||||
## MPC824x Systems
|
||||
#########################################################################
|
||||
@ -839,6 +903,9 @@ debris_config: unconfig
|
||||
eXalion_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x eXalion
|
||||
|
||||
HIDDEN_DRAGON_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x hidden_dragon
|
||||
|
||||
MOUSSE_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x mousse
|
||||
|
||||
@ -869,6 +936,9 @@ SL8245_config: unconfig
|
||||
utx8245_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc824x utx8245
|
||||
|
||||
cobra5272_config : unconfig
|
||||
@./mkconfig $(@:_config=) m68k mcf52x2 cobra5272
|
||||
|
||||
#########################################################################
|
||||
## MPC8260 Systems
|
||||
#########################################################################
|
||||
@ -892,6 +962,19 @@ CPU86_ROMBOOT_config: unconfig
|
||||
fi; \
|
||||
echo "export CONFIG_BOOT_ROM" >> config.mk;
|
||||
|
||||
CPU87_config \
|
||||
CPU87_ROMBOOT_config: unconfig
|
||||
@./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu87
|
||||
@cd ./include ; \
|
||||
if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
|
||||
echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
|
||||
echo "... booting from 8-bit flash" ; \
|
||||
else \
|
||||
echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
|
||||
echo "... booting from 64-bit flash" ; \
|
||||
fi; \
|
||||
echo "export CONFIG_BOOT_ROM" >> config.mk;
|
||||
|
||||
ep8260_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 ep8260
|
||||
|
||||
@ -912,13 +995,21 @@ ISPAN_REVB_config: unconfig
|
||||
@./mkconfig -a ISPAN ppc mpc8260 ispan
|
||||
|
||||
MPC8260ADS_config \
|
||||
MPC8260ADS_lowboot_config \
|
||||
MPC8260ADS_33MHz_config \
|
||||
MPC8260ADS_33MHz_lowboot_config \
|
||||
MPC8260ADS_40MHz_config \
|
||||
MPC8260ADS_40MHz_lowboot_config \
|
||||
MPC8272ADS_config \
|
||||
MPC8272ADS_lowboot_config \
|
||||
PQ2FADS_config \
|
||||
PQ2FADS_lowboot_config \
|
||||
PQ2FADS-VR_config \
|
||||
PQ2FADS-VR_lowboot_config \
|
||||
PQ2FADS-ZU_config \
|
||||
PQ2FADS-ZU_lowboot_config \
|
||||
PQ2FADS-ZU_66MHz_config \
|
||||
PQ2FADS-ZU_66MHz_lowboot_config \
|
||||
: unconfig
|
||||
$(if $(findstring PQ2FADS,$@), \
|
||||
@echo "#define CONFIG_ADSTYPE CFG_PQ2FADS" > include/config.h, \
|
||||
@ -927,6 +1018,10 @@ PQ2FADS-ZU_66MHz_config \
|
||||
@echo "#define CONFIG_8260_CLKIN" $(subst MHz,,$(word 2,$(subst _, ,$@)))"000000" >> include/config.h, \
|
||||
$(if $(findstring VR,$@), \
|
||||
@echo "#define CONFIG_8260_CLKIN 66000000" >> include/config.h))
|
||||
@[ -z "$(findstring lowboot_,$@)" ] || \
|
||||
{ echo "TEXT_BASE = 0xFF800000" >board/mpc8260ads/config.tmp ; \
|
||||
echo "... with lowboot configuration" ; \
|
||||
}
|
||||
@./mkconfig -a MPC8260ADS ppc mpc8260 mpc8260ads
|
||||
|
||||
MPC8266ADS_config: unconfig
|
||||
@ -986,6 +1081,12 @@ PM828_ROMBOOT_PCI_config: unconfig
|
||||
ppmc8260_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
|
||||
|
||||
Rattler8248_config \
|
||||
Rattler_config: unconfig
|
||||
$(if $(findstring 8248,$@), \
|
||||
@echo "#define CONFIG_MPC8248" > include/config.h)
|
||||
@./mkconfig -a Rattler ppc mpc8260 rattler
|
||||
|
||||
RPXsuper_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
|
||||
|
||||
@ -1061,6 +1162,9 @@ M5272C3_config : unconfig
|
||||
M5282EVB_config : unconfig
|
||||
@./mkconfig $(@:_config=) m68k mcf52x2 m5282evb
|
||||
|
||||
TASREG_config : unconfig
|
||||
@./mkconfig $(@:_config=) m68k mcf52x2 tasreg esd
|
||||
|
||||
#########################################################################
|
||||
## MPC85xx Systems
|
||||
#########################################################################
|
||||
@ -1071,14 +1175,32 @@ MPC8540ADS_config: unconfig
|
||||
MPC8560ADS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8560ads
|
||||
|
||||
stxgp3_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx stxgp3
|
||||
MPC8541CDS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8541cds cds
|
||||
|
||||
MPC8555CDS_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx mpc8555cds cds
|
||||
|
||||
PM854_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx pm854
|
||||
|
||||
sbc8540_config \
|
||||
sbc8540_33_config \
|
||||
sbc8540_66_config: unconfig
|
||||
@if [ "$(findstring _66_,$@)" ] ; then \
|
||||
echo "#define CONFIG_PCI_66" >>include/config.h ; \
|
||||
echo "... 66 MHz PCI" ; \
|
||||
else \
|
||||
>include/config.h ; \
|
||||
echo "... 33 MHz PCI" ; \
|
||||
fi
|
||||
@./mkconfig -a SBC8540 ppc mpc85xx sbc8560
|
||||
|
||||
sbc8560_config \
|
||||
sbc8560_33_config \
|
||||
sbc8560_66_config: unconfig
|
||||
@if [ "$(findstring _66_,$@)" ] ; then \
|
||||
echo "#define CONFIG_PCI_66" >>include/config.h ; \
|
||||
echo "#define CONFIG_PCI_66" >>include/config.h ; \
|
||||
echo "... 66 MHz PCI" ; \
|
||||
else \
|
||||
>include/config.h ; \
|
||||
@ -1086,6 +1208,15 @@ sbc8560_66_config: unconfig
|
||||
fi
|
||||
@./mkconfig -a sbc8560 ppc mpc85xx sbc8560
|
||||
|
||||
stxgp3_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx stxgp3
|
||||
|
||||
TQM8540_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx tqm8540
|
||||
|
||||
TQM8560_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc85xx tqm8560
|
||||
|
||||
#########################################################################
|
||||
## 74xx/7xx Systems
|
||||
#########################################################################
|
||||
@ -1096,6 +1227,9 @@ AmigaOneG3SE_config: unconfig
|
||||
BAB7xx_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
|
||||
|
||||
CPCI750_config: unconfig
|
||||
@./mkconfig CPCI750 ppc 74xx_7xx cpci750 esd
|
||||
|
||||
DB64360_config: unconfig
|
||||
@./mkconfig DB64360 ppc 74xx_7xx db64360 Marvell
|
||||
|
||||
@ -1151,21 +1285,21 @@ xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$
|
||||
|
||||
xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
|
||||
|
||||
integratorcp_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorcp
|
||||
|
||||
integratorap_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorap
|
||||
|
||||
integratorcp_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs integratorcp
|
||||
|
||||
lpd7a400_config \
|
||||
lpd7a404_config: unconfig
|
||||
@./mkconfig $(@:_config=) arm lh7a40x lpd7a40x
|
||||
|
||||
mx1ads_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t mx1ads
|
||||
@./mkconfig $(@:_config=) arm arm920t mx1ads NULL imx
|
||||
|
||||
mx1fs2_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t mx1fs2
|
||||
@./mkconfig $(@:_config=) arm arm920t mx1fs2 NULL imx
|
||||
|
||||
omap1510inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t omap1510inn
|
||||
@ -1206,13 +1340,13 @@ omap730p2_cs3boot_config : unconfig
|
||||
@./mkconfig -a $(call xtract_omap730p2,$@) arm arm926ejs omap730p2
|
||||
|
||||
scb9328_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t scb9328
|
||||
@./mkconfig $(@:_config=) arm arm920t scb9328 NULL imx
|
||||
|
||||
smdk2400_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2400
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2400 NULL s3c24x0
|
||||
|
||||
smdk2410_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2410
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2410 NULL s3c24x0
|
||||
|
||||
SX1_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t sx1
|
||||
@ -1240,10 +1374,10 @@ trab_old_config: unconfig
|
||||
echo "... with 8 MB Flash, 16 MB RAM" ; \
|
||||
echo "TEXT_BASE = 0x0CF40000" >board/trab/config.tmp ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_trab,$@) arm arm920t trab
|
||||
@./mkconfig -a $(call xtract_trab,$@) arm arm920t trab NULL s3c24x0
|
||||
|
||||
VCMA9_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t vcma9 mpl
|
||||
@./mkconfig $(@:_config=) arm arm920t vcma9 mpl s3c24x0
|
||||
|
||||
versatile_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs versatile
|
||||
@ -1278,6 +1412,9 @@ evb4510_config : unconfig
|
||||
at91rm9200dk_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
|
||||
|
||||
cmc_pu2_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm at91rm9200 cmc_pu2
|
||||
|
||||
#########################################################################
|
||||
## XScale Systems
|
||||
#########################################################################
|
||||
@ -1306,12 +1443,21 @@ logodl_config : unconfig
|
||||
wepep250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa wepep250
|
||||
|
||||
xaeniax_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa xaeniax
|
||||
|
||||
xm250_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa xm250
|
||||
|
||||
xsengine_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm pxa xsengine
|
||||
|
||||
#########################################################################
|
||||
## ARM1136 Systems
|
||||
#########################################################################
|
||||
omap2420h4_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm1136 omap2420h4
|
||||
|
||||
#========================================================================
|
||||
# i386
|
||||
#========================================================================
|
||||
@ -1376,6 +1522,16 @@ dbau1500_config : unconfig
|
||||
@echo "#define CONFIG_DBAU1500 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
dbau1550_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1550 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00
|
||||
|
||||
dbau1550_el_config : unconfig
|
||||
@ >include/config.h
|
||||
@echo "#define CONFIG_DBAU1550 1" >>include/config.h
|
||||
@./mkconfig -a dbau1x00 mips mips dbau1x00 "" little
|
||||
|
||||
#########################################################################
|
||||
## MIPS64 5Kc
|
||||
#########################################################################
|
||||
@ -1449,6 +1605,15 @@ ADNPESC1_config: unconfig
|
||||
}
|
||||
@./mkconfig -a ADNPESC1 nios nios adnpesc1 ssv
|
||||
|
||||
#########################################################################
|
||||
## Nios-II
|
||||
#########################################################################
|
||||
|
||||
PK1C20_config : unconfig
|
||||
@./mkconfig PK1C20 nios2 nios2 pk1c20 psyent
|
||||
|
||||
PCI5441_config : unconfig
|
||||
@./mkconfig PCI5441 nios2 nios2 pci5441 psyent
|
||||
|
||||
#========================================================================
|
||||
# MicroBlaze
|
||||
@ -1487,7 +1652,7 @@ clobber: clean
|
||||
| xargs -0 rm -f
|
||||
rm -f $(OBJS) *.bak tags TAGS
|
||||
rm -fr *.*~
|
||||
rm -f u-boot u-boot.map $(ALL)
|
||||
rm -f u-boot u-boot.map u-boot.hex $(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
|
||||
|
||||
113
README
113
README
@ -1,5 +1,5 @@
|
||||
#
|
||||
# (C) Copyright 2000 - 2004
|
||||
# (C) Copyright 2000 - 2005
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
@ -25,9 +25,10 @@ Summary:
|
||||
========
|
||||
|
||||
This directory contains the source code for U-Boot, a boot loader for
|
||||
Embedded boards based on PowerPC and ARM processors, which can be
|
||||
installed in a boot ROM and used to initialize and test the hardware
|
||||
or to download and run application code.
|
||||
Embedded boards based on PowerPC, ARM, MIPS and several other
|
||||
processors, which can be installed in a boot ROM and used to
|
||||
initialize and test the hardware or to download and run application
|
||||
code.
|
||||
|
||||
The development of U-Boot is closely related to Linux: some parts of
|
||||
the source code originate in the Linux source tree, we have some
|
||||
@ -122,23 +123,28 @@ Directory Hierarchy:
|
||||
- board Board dependent files
|
||||
- common Misc architecture independent functions
|
||||
- cpu CPU specific files
|
||||
- 74xx_7xx Files specific to Motorola MPC74xx and 7xx CPUs
|
||||
- 74xx_7xx Files specific to Freescale MPC74xx and 7xx CPUs
|
||||
- arm720t Files specific to ARM 720 CPUs
|
||||
- arm920t Files specific to ARM 920 CPUs
|
||||
- imx Files specific to Freescale MC9328 i.MX CPUs
|
||||
- s3c24x0 Files specific to Samsung S3C24X0 CPUs
|
||||
- arm925t Files specific to ARM 925 CPUs
|
||||
- arm926ejs Files specific to ARM 926 CPUs
|
||||
- arm1136 Files specific to ARM 1136 CPUs
|
||||
- at91rm9200 Files specific to Atmel AT91RM9200 CPUs
|
||||
- i386 Files specific to i386 CPUs
|
||||
- ixp Files specific to Intel XScale IXP CPUs
|
||||
- mcf52x2 Files specific to Motorola ColdFire MCF52x2 CPUs
|
||||
- mcf52x2 Files specific to Freescale ColdFire MCF52x2 CPUs
|
||||
- mips Files specific to MIPS CPUs
|
||||
- mpc5xx Files specific to Motorola MPC5xx CPUs
|
||||
- mpc5xxx Files specific to Motorola MPC5xxx CPUs
|
||||
- mpc8xx Files specific to Motorola MPC8xx CPUs
|
||||
- mpc824x Files specific to Motorola MPC824x CPUs
|
||||
- mpc8260 Files specific to Motorola MPC8260 CPUs
|
||||
- mpc85xx Files specific to Motorola MPC85xx CPUs
|
||||
- mpc5xx Files specific to Freescale MPC5xx CPUs
|
||||
- mpc5xxx Files specific to Freescale MPC5xxx CPUs
|
||||
- mpc8xx Files specific to Freescale MPC8xx CPUs
|
||||
- mpc8220 Files specific to Freescale MPC8220 CPUs
|
||||
- mpc824x Files specific to Freescale MPC824x CPUs
|
||||
- mpc8260 Files specific to Freescale MPC8260 CPUs
|
||||
- mpc85xx Files specific to Freescale MPC85xx CPUs
|
||||
- nios Files specific to Altera NIOS CPUs
|
||||
- nios2 Files specific to Altera Nios-II CPUs
|
||||
- ppc4xx Files specific to IBM PowerPC 4xx CPUs
|
||||
- pxa Files specific to Intel XScale PXA CPUs
|
||||
- s3c44b0 Files specific to Samsung S3C44B0 CPUs
|
||||
@ -225,6 +231,7 @@ The following options need to be configured:
|
||||
-------------------
|
||||
CONFIG_MPC823, CONFIG_MPC850, CONFIG_MPC855, CONFIG_MPC860
|
||||
or CONFIG_MPC5xx
|
||||
or CONFIG_MPC8220
|
||||
or CONFIG_MPC824X, CONFIG_MPC8260
|
||||
or CONFIG_MPC85xx
|
||||
or CONFIG_IOP480
|
||||
@ -244,6 +251,10 @@ The following options need to be configured:
|
||||
----------------------
|
||||
CONFIG_MICROBLAZE
|
||||
|
||||
Nios-2 based CPUs:
|
||||
----------------------
|
||||
CONFIG_NIOS2
|
||||
|
||||
|
||||
- Board Type: Define exactly one of
|
||||
|
||||
@ -291,19 +302,24 @@ The following options need to be configured:
|
||||
ARM based boards:
|
||||
-----------------
|
||||
|
||||
CONFIG_AT91RM9200DK, CONFIG_CERF250, CONFIG_DNP1110,
|
||||
CONFIG_EP7312, CONFIG_H2_OMAP1610, CONFIG_HHP_CRADLE,
|
||||
CONFIG_IMPA7, CONFIG_INNOVATOROMAP1510, CONFIG_INNOVATOROMAP1610,
|
||||
CONFIG_LART, CONFIG_LPD7A400 CONFIG_LUBBOCK,
|
||||
CONFIG_OSK_OMAP5912, CONFIG_SHANNON, CONFIG_P2_OMAP730,
|
||||
CONFIG_SMDK2400, CONFIG_SMDK2410, CONFIG_TRAB,
|
||||
CONFIG_VCMA9
|
||||
CONFIG_AT91RM9200DK, CONFIG_CERF250, CONFIG_DNP1110,
|
||||
CONFIG_EP7312, CONFIG_H2_OMAP1610, CONFIG_HHP_CRADLE,
|
||||
CONFIG_IMPA7, CONFIG_INNOVATOROMAP1510, CONFIG_INNOVATOROMAP1610,
|
||||
CONFIG_LART, CONFIG_LPD7A400 CONFIG_LUBBOCK,
|
||||
CONFIG_OSK_OMAP5912, CONFIG_OMAP2420H4, CONFIG_SHANNON,
|
||||
CONFIG_P2_OMAP730, CONFIG_SMDK2400, CONFIG_SMDK2410,
|
||||
CONFIG_TRAB, CONFIG_VCMA9
|
||||
|
||||
MicroBlaze based boards:
|
||||
------------------------
|
||||
|
||||
CONFIG_SUZAKU
|
||||
|
||||
Nios-2 based boards:
|
||||
------------------------
|
||||
|
||||
CONFIG_PCI5441 CONFIG_PK1C20
|
||||
|
||||
|
||||
- CPU Module Type: (if CONFIG_COGENT is defined)
|
||||
Define exactly one of
|
||||
@ -339,16 +355,17 @@ The following options need to be configured:
|
||||
CONFIG_MPC8240, CONFIG_MPC8245
|
||||
|
||||
- 8xx CPU Options: (if using an MPC8xx cpu)
|
||||
Define one or more of
|
||||
CONFIG_8xx_GCLK_FREQ - if get_gclk_freq() cannot work
|
||||
CONFIG_8xx_GCLK_FREQ - deprecated: CPU clock if
|
||||
get_gclk_freq() cannot work
|
||||
e.g. if there is no 32KHz
|
||||
reference PIT/RTC clock
|
||||
CONFIG_8xx_OSCLK - PLL input clock (either EXTCLK
|
||||
or XTAL/EXTAL)
|
||||
|
||||
- 859/866 CPU options: (if using a MPC859 or MPC866 CPU):
|
||||
CFG_866_OSCCLK
|
||||
CFG_866_CPUCLK_MIN
|
||||
CFG_866_CPUCLK_MAX
|
||||
CFG_866_CPUCLK_DEFAULT
|
||||
- 859/866/885 CPU options: (if using a MPC859 or MPC866 or MPC885 CPU):
|
||||
CFG_8xx_CPUCLK_MIN
|
||||
CFG_8xx_CPUCLK_MAX
|
||||
CONFIG_8xx_CPUCLK_DEFAULT
|
||||
See doc/README.MPC866
|
||||
|
||||
CFG_MEASURE_CPUCLK
|
||||
@ -358,7 +375,7 @@ The following options need to be configured:
|
||||
values. Mostly useful for board bringup to make sure
|
||||
the PLL is locked at the intended frequency. Note
|
||||
that this requires a (stable) reference clock (32 kHz
|
||||
RTC clock),
|
||||
RTC clock or CFG_8XX_XIN)
|
||||
|
||||
- Linux Kernel Interface:
|
||||
CONFIG_CLOCKS_IN_MHZ
|
||||
@ -610,6 +627,7 @@ The following options need to be configured:
|
||||
CFG_CMD_SAVES * save S record dump
|
||||
CFG_CMD_SCSI * SCSI Support
|
||||
CFG_CMD_SDRAM * print SDRAM configuration information
|
||||
(requires CFG_CMD_I2C)
|
||||
CFG_CMD_SETGETDCR Support for DCR Register access (4xx only)
|
||||
CFG_CMD_SPI * SPI serial bus support
|
||||
CFG_CMD_USB * USB support
|
||||
@ -784,7 +802,7 @@ The following options need to be configured:
|
||||
supported (PIP405, MIP405, MPC5200); define
|
||||
CONFIG_USB_UHCI to enable it.
|
||||
define CONFIG_USB_KEYBOARD to enable the USB Keyboard
|
||||
end define CONFIG_USB_STORAGE to enable the USB
|
||||
and define CONFIG_USB_STORAGE to enable the USB
|
||||
storage devices.
|
||||
Note:
|
||||
Supported are USB Keyboards and USB Floppy drives
|
||||
@ -819,7 +837,7 @@ The following options need to be configured:
|
||||
function struct part_info* jffs2_part_info(int part_num)
|
||||
|
||||
If you define only one JFFS2 partition you may also want to
|
||||
#define CFG_JFFS_SINGLE_PART 1
|
||||
#define CFG_JFFS_SINGLE_PART 1
|
||||
to disable the command chpart. This is the default when you
|
||||
have not defined a custom partition
|
||||
|
||||
@ -1961,9 +1979,9 @@ Low Level (hardware related) configuration options:
|
||||
source code. It is used to make hardware dependant
|
||||
initializations.
|
||||
|
||||
- CFG_IMMR: Physical address of the Internal Memory Mapped
|
||||
Register; DO NOT CHANGE! (11-4)
|
||||
[MPC8xx systems only]
|
||||
- CFG_IMMR: Physical address of the Internal Memory.
|
||||
DO NOT CHANGE unless you know exactly what you're
|
||||
doing! (11-4) [MPC8xx/82xx systems only]
|
||||
|
||||
- CFG_INIT_RAM_ADDR:
|
||||
|
||||
@ -2097,6 +2115,33 @@ Low Level (hardware related) configuration options:
|
||||
Add the "loopw" memory command. This only takes effect if
|
||||
the memory commands are activated globally (CFG_CMD_MEM).
|
||||
|
||||
- CONFIG_MX_CYCLIC
|
||||
Add the "mdc" and "mwc" memory commands. These are cyclic
|
||||
"md/mw" commands.
|
||||
Examples:
|
||||
|
||||
=> mdc.b 10 4 500
|
||||
This command will print 4 bytes (10,11,12,13) each 500 ms.
|
||||
|
||||
=> mwc.l 100 12345678 10
|
||||
This command will write 12345678 to address 100 all 10 ms.
|
||||
|
||||
This only takes effect if the memory commands are activated
|
||||
globally (CFG_CMD_MEM).
|
||||
|
||||
- CONFIG_SKIP_LOWLEVEL_INIT
|
||||
- CONFIG_SKIP_RELOCATE_UBOOT
|
||||
|
||||
[ARM only] If these variables are defined, then
|
||||
certain low level initializations (like setting up
|
||||
the memory controller) are omitted and/or U-Boot does
|
||||
not relocate itself into RAM.
|
||||
Normally these variables MUST NOT be defined. The
|
||||
only exception is when U-Boot is loaded (to RAM) by
|
||||
some other boot loader or by a debugger which
|
||||
performs these intializations itself.
|
||||
|
||||
|
||||
Building the Software:
|
||||
======================
|
||||
|
||||
@ -2126,6 +2171,7 @@ configurations; the following names are supported:
|
||||
|
||||
ADCIOP_config FPS860L_config omap730p2_config
|
||||
ADS860_config GEN860T_config pcu_e_config
|
||||
Alaska8220_config
|
||||
AR405_config GENIETV_config PIP405_config
|
||||
at91rm9200dk_config GTH_config QS823_config
|
||||
CANBT_config hermes_config QS850_config
|
||||
@ -2146,7 +2192,8 @@ configurations; the following names are supported:
|
||||
FADS850SAR_config omap1610h2_config TQM850L_config
|
||||
FADS860T_config omap1610inn_config TQM855L_config
|
||||
FPS850L_config omap5912osk_config TQM860L_config
|
||||
WALNUT405_config
|
||||
omap2420h4_config WALNUT405_config
|
||||
Yukon8220_config
|
||||
ZPC1900_config
|
||||
|
||||
Note: for some board special configuration names may exist; check if
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
indent: Standard input:49: Warning:old style assignment ambiguity in "=*". Assuming "= *"
|
||||
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
*
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
After following the step of Yoo. Jonghoon and Wolfgang Denk,
|
||||
I ported u-boot on RPXlite DW version board: RPXlite_DW or LITE_DW.
|
||||
|
||||
There are three differences between the Yoo-ported RPXlite and the RPXlite_DW.
|
||||
There are at least three differences between the Yoo-ported RPXlite and the RPXlite_DW.
|
||||
|
||||
Board(in U-BOOT) version(in EmbeddedPlanet) CPU SDRAM FLASH
|
||||
Board(in U-Boot) version(in EmbeddedPlanet) CPU SDRAM FLASH
|
||||
RPXlite RPXlite CW 850 16MB 4MB
|
||||
RPXlite_DW RPXlite DW 823e 64MB 16MB
|
||||
RPXlite_DW RPXlite DW(EP 823 H1 DW) 823e 64MB 16MB
|
||||
|
||||
This fireware is specially coded for EmbeddedPlanet Co. Software Development
|
||||
Platform(RPXlite DW),which has a NEC NL6448BC20-08 LCD panel.
|
||||
@ -17,6 +17,7 @@ It has the following three features:
|
||||
The default setting is 48MHz.To get a 64MHz u-boot,just add
|
||||
'64' in make command,like
|
||||
|
||||
make distclean
|
||||
make RPXlite_DW_64_config
|
||||
make all
|
||||
|
||||
@ -28,19 +29,21 @@ didn't use EEPROM for ENV is that PlanetCore V2.0 use EEPROM as environment para
|
||||
home.Because of the possibility of using two firewares on this board,I didn't
|
||||
'disturb' EEPROM.To get NVRAM support,you may use the following build command:
|
||||
|
||||
make distclean
|
||||
make RPXlite_DW_NVRAM_config
|
||||
make all
|
||||
|
||||
3. LCD panel support
|
||||
|
||||
To support the Platform better,I added LCD panel(NL6448BC20-08) function.But bewear of
|
||||
the fact that once you build this support and program it to FLASH,you should make sure
|
||||
you put workable kernel and ramdisk at the right place in FLASH or through NFS.
|
||||
Otherwise, you must erase this fireware manually via BDI2000 or ICE tools.So this
|
||||
function is used for deployment and demo only.Pls look before you leap.
|
||||
To support the Platform better,I added LCD panel(NL6448BC20-08) function.
|
||||
For the convenience of debug, CONFIG_PERBOOT was supported. So you just
|
||||
perss ENTER if you want to get a serial console in boot downcounting.
|
||||
Then you can switch to LCD and serial console freely just typing
|
||||
'run lcd' or 'run ser'. They are only vaild when CONFIG_LCD was enabled.
|
||||
|
||||
To get a LCD support u-boot,you can do the following:
|
||||
|
||||
make distclean
|
||||
make RPXlite_DW_LCD_config
|
||||
make all
|
||||
|
||||
@ -68,7 +71,7 @@ make RPXlite_DW_64_LCD_config
|
||||
|
||||
The boot process by "make RPXlite_DW_config" could be:
|
||||
|
||||
U-Boot 1.1.1 (Jun 8 2004 - 11:16:30)
|
||||
U-Boot 1.1.2 (Aug 29 2004 - 15:11:27)
|
||||
|
||||
CPU: PPC823EZTnnB2 at 48 MHz: 16 kB I-Cache 8 kB D-Cache
|
||||
Board: RPXlite_DW
|
||||
@ -84,6 +87,68 @@ u-boot>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A word on the U-Boot enviroment variable setting and usage :
|
||||
|
||||
In the beginning, you could just need very simple defult environment variable setting,
|
||||
like[include/configs/RPXlite.h] :
|
||||
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"bootp; " \
|
||||
"setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; " \
|
||||
"bootm"
|
||||
|
||||
This is enough for kernel NFS test. But as debug process goes on, you would expect
|
||||
to save some time on environment variable setting and u-boot/kernel updating.
|
||||
So the default environment variable setting would become more complicated. Just like
|
||||
the one I did in include/configs/RPXlite_DW.h.
|
||||
|
||||
Two u-boot commands, ku and uu, should be careful to use. They were designed to update
|
||||
kernel and u-boot image file respectively. You must tftp your image to default address
|
||||
'100000' and then use them correctly. Yeah, you can create your own command to do this
|
||||
job. :-) The example u-boot image updating process could be :
|
||||
|
||||
u-boot>t 100000 RPXlite_DW_LCD.bin
|
||||
Using SCC ETHERNET device
|
||||
TFTP from server 172.16.115.6; our IP address is 172.16.115.7
|
||||
Filename 'RPXlite_DW_LCD.bin'.
|
||||
Load address: 0x100000
|
||||
Loading: #############################
|
||||
done
|
||||
Bytes transferred = 144700 (2353c hex)
|
||||
u-boot>run uu
|
||||
Un-Protect Flash Sectors 0-4 in Bank # 1
|
||||
Erase Flash Sectors 0-4 in Bank # 1
|
||||
.... done
|
||||
Copy to Flash... done
|
||||
ff000000: 27051956 552d426f 6f742031 2e312e32 '..VU-Boot 1.1.2
|
||||
ff000010: 20284175 67203239 20323030 34202d20 (Aug 29 2004 -
|
||||
ff000020: 31353a32 303a3238 29000000 00000000 15:20:28).......
|
||||
ff000030: 00000000 00000000 00000000 00000000 ................
|
||||
ff000040: 00000000 00000000 00000000 00000000 ................
|
||||
ff000050: 00000000 00000000 00000000 00000000 ................
|
||||
ff000060: 00000000 00000000 00000000 00000000 ................
|
||||
ff000070: 00000000 00000000 00000000 00000000 ................
|
||||
ff000080: 00000000 00000000 00000000 00000000 ................
|
||||
ff000090: 00000000 00000000 00000000 00000000 ................
|
||||
ff0000a0: 00000000 00000000 00000000 00000000 ................
|
||||
ff0000b0: 00000000 00000000 00000000 00000000 ................
|
||||
ff0000c0: 00000000 00000000 00000000 00000000 ................
|
||||
ff0000d0: 00000000 00000000 00000000 00000000 ................
|
||||
ff0000e0: 00000000 00000000 00000000 00000000 ................
|
||||
ff0000f0: 00000000 00000000 00000000 00000000 ................
|
||||
u-boot updating finished
|
||||
u-boot>
|
||||
|
||||
Also for environment updating, 'run eu' could let you erase OLD default environment variable
|
||||
and then use the working u-boot environment setting.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Finally, if you want to keep the serial port to possible debug on spot for deployment, you
|
||||
just need to enable 'DEPLOYMENT' in RPXlite_DW.h as 'DEBUG' does. Only the special string
|
||||
defined by CONFIG_AUTOBOOT_STOP_STR like 'st' can stop the autoboot.
|
||||
|
||||
I'd like to extend my heartfelt gratitute to kind people for helping me work it out.
|
||||
I would particually thank Wolfgang Denk for his nice help.
|
||||
|
||||
@ -93,4 +158,4 @@ Sam Song, samsongshu@yahoo.com.cn
|
||||
Institute of Electrical Machinery and Controls
|
||||
Shanghai University
|
||||
|
||||
June 8,2004
|
||||
Oct. 11, 2004
|
||||
|
||||
45
board/alaska/Makefile
Normal file
45
board/alaska/Makefile
Normal file
@ -0,0 +1,45 @@
|
||||
# (C) Copyright 2003-2005
|
||||
# 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 extserial.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
|
||||
|
||||
#########################################################################
|
||||
153
board/alaska/alaska.c
Normal file
153
board/alaska/alaska.c
Normal file
@ -0,0 +1,153 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Freescale Inc.
|
||||
* TsiChung Liew, Tsi-Chung.Liew@freescale.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 <mpc8220.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
void setupBat (ulong size)
|
||||
{
|
||||
ulong batu, batl;
|
||||
int blocksize = 0;
|
||||
|
||||
/* Flash 0 */
|
||||
#if defined (CFG_AMD_BOOT)
|
||||
batu = CFG_FLASH0_BASE | (BL_512K << 2) | BPP_RW | BPP_RX;
|
||||
#else
|
||||
batu = CFG_FLASH0_BASE | (BL_16M << 2) | BPP_RW | BPP_RX;
|
||||
#endif
|
||||
batl = CFG_FLASH0_BASE | 0x22;
|
||||
write_bat (IBAT0, batu, batl);
|
||||
write_bat (DBAT0, batu, batl);
|
||||
|
||||
/* Flash 1 */
|
||||
#if defined (CFG_AMD_BOOT)
|
||||
batu = CFG_FLASH1_BASE | (BL_16M << 2) | BPP_RW | BPP_RX;
|
||||
#else
|
||||
batu = CFG_FLASH1_BASE | (BL_512K << 2) | BPP_RW | BPP_RX;
|
||||
#endif
|
||||
batl = CFG_FLASH1_BASE | 0x22;
|
||||
write_bat (IBAT1, batu, batl);
|
||||
write_bat (DBAT1, batu, batl);
|
||||
|
||||
/* CPLD */
|
||||
batu = CFG_CPLD_BASE | (BL_512K << 2) | BPP_RW | BPP_RX;
|
||||
batl = CFG_CPLD_BASE | 0x22;
|
||||
write_bat (IBAT2, 0, 0);
|
||||
write_bat (DBAT2, batu, batl);
|
||||
|
||||
/* FPGA */
|
||||
batu = CFG_FPGA_BASE | (BL_512K << 2) | BPP_RW | BPP_RX;
|
||||
batl = CFG_FPGA_BASE | 0x22;
|
||||
write_bat (IBAT3, 0, 0);
|
||||
write_bat (DBAT3, batu, batl);
|
||||
|
||||
/* MBAR - Data only */
|
||||
batu = CFG_MBAR | BPP_RW | BPP_RX;
|
||||
batl = CFG_MBAR | 0x22;
|
||||
mtspr (IBAT4L, 0);
|
||||
mtspr (IBAT4U, 0);
|
||||
mtspr (DBAT4L, batl);
|
||||
mtspr (DBAT4U, batu);
|
||||
|
||||
/* MBAR - SRAM */
|
||||
batu = CFG_SRAM_BASE | BPP_RW | BPP_RX;
|
||||
batl = CFG_SRAM_BASE | 0x42;
|
||||
mtspr (IBAT5L, batl);
|
||||
mtspr (IBAT5U, batu);
|
||||
mtspr (DBAT5L, batl);
|
||||
mtspr (DBAT5U, batu);
|
||||
|
||||
if (size <= 0x800000) /* 8MB */
|
||||
blocksize = BL_8M << 2;
|
||||
else if (size <= 0x1000000) /* 16MB */
|
||||
blocksize = BL_16M << 2;
|
||||
else if (size <= 0x2000000) /* 32MB */
|
||||
blocksize = BL_32M << 2;
|
||||
else if (size <= 0x4000000) /* 64MB */
|
||||
blocksize = BL_64M << 2;
|
||||
else if (size <= 0x8000000) /* 128MB */
|
||||
blocksize = BL_128M << 2;
|
||||
else if (size <= 0x10000000) /* 256MB */
|
||||
blocksize = BL_256M << 2;
|
||||
|
||||
/* Memory */
|
||||
batu = CFG_SDRAM_BASE | blocksize | BPP_RW | BPP_RX;
|
||||
batl = CFG_SDRAM_BASE | 0x42;
|
||||
mtspr (IBAT6L, batl);
|
||||
mtspr (IBAT6U, batu);
|
||||
mtspr (DBAT6L, batl);
|
||||
mtspr (DBAT6U, batu);
|
||||
|
||||
/* memory size is less than 256MB */
|
||||
if (size <= 0x10000000) {
|
||||
/* Nothing */
|
||||
batu = 0;
|
||||
batl = 0;
|
||||
} else {
|
||||
size -= 0x10000000;
|
||||
if (size <= 0x800000) /* 8MB */
|
||||
blocksize = BL_8M << 2;
|
||||
else if (size <= 0x1000000) /* 16MB */
|
||||
blocksize = BL_16M << 2;
|
||||
else if (size <= 0x2000000) /* 32MB */
|
||||
blocksize = BL_32M << 2;
|
||||
else if (size <= 0x4000000) /* 64MB */
|
||||
blocksize = BL_64M << 2;
|
||||
else if (size <= 0x8000000) /* 128MB */
|
||||
blocksize = BL_128M << 2;
|
||||
else if (size <= 0x10000000) /* 256MB */
|
||||
blocksize = BL_256M << 2;
|
||||
|
||||
batu = (CFG_SDRAM_BASE +
|
||||
0x10000000) | blocksize | BPP_RW | BPP_RX;
|
||||
batl = (CFG_SDRAM_BASE + 0x10000000) | 0x42;
|
||||
}
|
||||
|
||||
mtspr (IBAT7L, batl);
|
||||
mtspr (IBAT7U, batu);
|
||||
mtspr (DBAT7L, batl);
|
||||
mtspr (DBAT7U, batu);
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
ulong size;
|
||||
|
||||
size = dramSetup ();
|
||||
|
||||
/* if iCache ad dCache is defined */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_CACHE)
|
||||
/* setupBat(size);*/
|
||||
#endif
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: Alaska MPC8220 Evaluation Board\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
31
board/alaska/config.mk
Normal file
31
board/alaska/config.mk
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# (C) Copyright 2003-2004
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#
|
||||
# alaska board
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xfff00000
|
||||
# TEXT_BASE = 0x00100000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
|
||||
110
board/alaska/extserial.c
Normal file
110
board/alaska/extserial.c
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* (C) Copyright 2004, Freescale, Inc
|
||||
* TsiChung Liew, Tsi-Chung.Liew@freescale.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
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Minimal serial functions needed to use one of the PSC ports
|
||||
* as serial console interface.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8220.h>
|
||||
|
||||
#if defined (CONFIG_EXTUART_CONSOLE)
|
||||
# include <ns16550.h>
|
||||
|
||||
# define PADSERIAL_BAUD_115200 0x40
|
||||
# define PADSERIAL_BAUD_57600 0x20
|
||||
# define PADSERIAL_BAUD_9600 0
|
||||
# define PADCARD_FREQ 18432000
|
||||
|
||||
const NS16550_t com_port = (NS16550_t) CFG_NS16550_COM1;
|
||||
|
||||
int ext_serial_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
volatile u8 *dipswitch = (volatile u8 *) (CFG_CPLD_BASE + 0x1002);
|
||||
int baud_divisor;
|
||||
|
||||
/* Find out the baud rate speed on debug card dip switches */
|
||||
if (*dipswitch & PADSERIAL_BAUD_115200)
|
||||
gd->baudrate = 115200;
|
||||
else if (*dipswitch & PADSERIAL_BAUD_57600)
|
||||
gd->baudrate = 57600;
|
||||
else
|
||||
gd->baudrate = 9600;
|
||||
|
||||
/* Debug card frequency */
|
||||
baud_divisor = PADCARD_FREQ / (16 * gd->baudrate);
|
||||
|
||||
NS16550_init (com_port, baud_divisor);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void ext_serial_putc (const char c)
|
||||
{
|
||||
if (c == '\n')
|
||||
NS16550_putc (com_port, '\r');
|
||||
|
||||
NS16550_putc (com_port, c);
|
||||
}
|
||||
|
||||
void ext_serial_puts (const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
int ext_serial_getc (void)
|
||||
{
|
||||
return NS16550_getc (com_port);
|
||||
}
|
||||
|
||||
int ext_serial_tstc (void)
|
||||
{
|
||||
return NS16550_tstc (com_port);
|
||||
}
|
||||
|
||||
void ext_serial_setbrg (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
volatile u8 *dipswitch = (volatile u8 *) (CFG_CPLD_BASE + 0x1002);
|
||||
int baud_divisor;
|
||||
|
||||
/* Find out the baud rate speed on debug card dip switches */
|
||||
if (*dipswitch & PADSERIAL_BAUD_115200)
|
||||
gd->baudrate = 115200;
|
||||
else if (*dipswitch & PADSERIAL_BAUD_57600)
|
||||
gd->baudrate = 57600;
|
||||
else
|
||||
gd->baudrate = 9600;
|
||||
|
||||
/* Debug card frequency */
|
||||
baud_divisor = PADCARD_FREQ / (16 * gd->baudrate);
|
||||
|
||||
NS16550_reinit (com_port, baud_divisor);
|
||||
}
|
||||
#endif /* CONFIG_EXTUART_CONSOLE */
|
||||
807
board/alaska/flash.c
Normal file
807
board/alaska/flash.c
Normal file
@ -0,0 +1,807 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* Board support for 1 or 2 flash devices */
|
||||
#define FLASH_PORT_WIDTH8
|
||||
|
||||
typedef unsigned char FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned char FLASH_PORT_WIDTHV;
|
||||
|
||||
#define SWAP(x) (x)
|
||||
|
||||
/* Intel-compatible flash ID */
|
||||
#define INTEL_COMPAT 0x89
|
||||
#define INTEL_ALT 0xB0
|
||||
|
||||
/* Intel-compatible flash commands */
|
||||
#define INTEL_PROGRAM 0x10
|
||||
#define INTEL_ERASE 0x20
|
||||
#define INTEL_CLEAR 0x50
|
||||
#define INTEL_LOCKBIT 0x60
|
||||
#define INTEL_PROTECT 0x01
|
||||
#define INTEL_STATUS 0x70
|
||||
#define INTEL_READID 0x90
|
||||
#define INTEL_CONFIRM 0xD0
|
||||
#define INTEL_RESET 0xFF
|
||||
|
||||
/* Intel-compatible flash status bits */
|
||||
#define INTEL_FINISHED 0x80
|
||||
#define INTEL_OK 0x80
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define FLASH_CYCLE1 0x0555
|
||||
#define FLASH_CYCLE2 0x02aa
|
||||
|
||||
#define WR_BLOCK 0x20
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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 int write_data_block (flash_info_t * info, ulong src, ulong dest);
|
||||
static int write_word_amd (flash_info_t * info, FPWV * 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;
|
||||
ulong fsize = 0;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
memset (&flash_info[i], 0, sizeof (flash_info_t));
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
flash_get_size ((FPW *) CFG_FLASH1_BASE,
|
||||
&flash_info[i]);
|
||||
flash_get_offsets (CFG_FLASH1_BASE, &flash_info[i]);
|
||||
break;
|
||||
case 1:
|
||||
flash_get_size ((FPW *) CFG_FLASH1_BASE,
|
||||
&flash_info[i]);
|
||||
fsize = CFG_FLASH1_BASE + flash_info[i - 1].size;
|
||||
flash_get_offsets (fsize, &flash_info[i]);
|
||||
break;
|
||||
case 2:
|
||||
flash_get_size ((FPW *) CFG_FLASH0_BASE,
|
||||
&flash_info[i]);
|
||||
flash_get_offsets (CFG_FLASH0_BASE, &flash_info[i]);
|
||||
break;
|
||||
case 3:
|
||||
flash_get_size ((FPW *) CFG_FLASH0_BASE,
|
||||
&flash_info[i]);
|
||||
fsize = CFG_FLASH0_BASE + flash_info[i - 1].size;
|
||||
flash_get_offsets (fsize, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic ("configured to many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
#if defined (CFG_AMD_BOOT)
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[2]);
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_INTEL_BASE,
|
||||
CFG_INTEL_BASE + monitor_flash_len - 1,
|
||||
&flash_info[1]);
|
||||
#else
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1,
|
||||
&flash_info[3]);
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_AMD_BASE,
|
||||
CFG_AMD_BASE + monitor_flash_len - 1, &flash_info[0]);
|
||||
#endif
|
||||
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV1_ADDR,
|
||||
CFG_ENV1_ADDR + CFG_ENV1_SIZE - 1, &flash_info[1]);
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[3]);
|
||||
|
||||
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_AMD) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * PHYS_AMD_SECT_SIZE);
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * PHYS_INTEL_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;
|
||||
case FLASH_MAN_AMD:
|
||||
printf ("AMD ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F128J3A:
|
||||
printf ("28F128J3A\n");
|
||||
break;
|
||||
|
||||
case FLASH_AM040:
|
||||
printf ("AMD29F040B\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)
|
||||
{
|
||||
FPWV value;
|
||||
static int amd = 0;
|
||||
|
||||
/* 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 */
|
||||
__asm__ ("sync");
|
||||
addr[FLASH_CYCLE2] = (FPW) 0x00550055; /* for AMD, Intel ignores this */
|
||||
__asm__ ("sync");
|
||||
addr[FLASH_CYCLE1] = (FPW) 0x00900090; /* selects Intel or AMD */
|
||||
__asm__ ("sync");
|
||||
|
||||
udelay (100);
|
||||
|
||||
switch (addr[0] & 0xff) {
|
||||
|
||||
case (uchar) AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
value = addr[1];
|
||||
break;
|
||||
|
||||
case (uchar) INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
value = addr[2];
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("unknown\n");
|
||||
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 */
|
||||
}
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_ID_28F128J3A:
|
||||
info->flash_id += FLASH_28F128J3A;
|
||||
info->sector_count = 64;
|
||||
info->size = 0x00800000; /* => 16 MB */
|
||||
break;
|
||||
|
||||
case (FPW) AMD_ID_LV040B:
|
||||
info->flash_id += FLASH_AM040;
|
||||
if (amd == 0) {
|
||||
info->sector_count = 7;
|
||||
info->size = 0x00070000; /* => 448 KB */
|
||||
amd = 1;
|
||||
} else {
|
||||
/* for Environment settings */
|
||||
info->sector_count = 1;
|
||||
info->size = PHYS_AMD_SECT_SIZE; /* => 64 KB */
|
||||
amd = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (value == (FPW) INTEL_ID_28F128J3A)
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
else
|
||||
addr[0] = (FPW) 0x00F000F0; /* 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, intel = 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)) {
|
||||
type = (info->flash_id & FLASH_VENDMASK);
|
||||
if ((type != FLASH_MAN_AMD)) {
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == FLASH_MAN_INTEL)
|
||||
intel = 1;
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n", prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
FPWV *addr = (FPWV *) (info->start[sect]);
|
||||
FPW status;
|
||||
|
||||
printf ("Erasing sector %2d ... ", sect);
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
start = get_timer (0);
|
||||
|
||||
if (intel) {
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
*addr = (FPW) 0x00200020; /* erase setup */
|
||||
*addr = (FPW) 0x00D000D0; /* erase confirm */
|
||||
} else {
|
||||
FPWV *base; /* first address in bank */
|
||||
|
||||
base = (FPWV *) (CFG_AMD_BASE);
|
||||
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 */
|
||||
}
|
||||
|
||||
while (((status =
|
||||
*addr) & (FPW) 0x00800080) !=
|
||||
(FPW) 0x00800080) {
|
||||
if (get_timer (start) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
if (intel) {
|
||||
*addr = (FPW) 0x00B000B0; /* suspend erase */
|
||||
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
|
||||
} else
|
||||
*addr = (FPW) 0x00F000F0; /* reset to read mode */
|
||||
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (intel) {
|
||||
*addr = (FPW) 0x00500050; /* clear status register cmd. */
|
||||
*addr = (FPW) 0x00FF00FF; /* resest to read mode */
|
||||
} else
|
||||
*addr = (FPW) 0x00F000F0; /* reset 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)
|
||||
{
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD:
|
||||
{
|
||||
FPW data = 0; /* 16 or 32 bit word, matches flash bus width */
|
||||
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++;
|
||||
}
|
||||
|
||||
res = write_word_amd (info, (FPWV *) addr,
|
||||
data);
|
||||
}
|
||||
return res;
|
||||
} /* case FLASH_MAN_AMD */
|
||||
|
||||
case FLASH_MAN_INTEL:
|
||||
{
|
||||
ulong cp, wp;
|
||||
FPW data;
|
||||
int count, i, l, rc, port_width;
|
||||
|
||||
/* get lower word aligned address */
|
||||
wp = addr;
|
||||
port_width = 1;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
if (cnt > WR_BLOCK) {
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
count = 0;
|
||||
while (cnt >= WR_BLOCK) {
|
||||
|
||||
if ((rc =
|
||||
write_data_block (info,
|
||||
(ulong) src,
|
||||
wp)) != 0)
|
||||
return (rc);
|
||||
|
||||
wp += WR_BLOCK;
|
||||
src += WR_BLOCK;
|
||||
cnt -= WR_BLOCK;
|
||||
|
||||
if (count++ > 0x800) {
|
||||
spin_wheel ();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt < WR_BLOCK) {
|
||||
/*
|
||||
* 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)));
|
||||
} /* case FLASH_MAN_INTEL */
|
||||
|
||||
} /* switch */
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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 start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
printf ("not erased at %08lx (%lx)\n", (ulong) addr, *addr);
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
*addr = (FPW) 0x00400040; /* write setup */
|
||||
*addr = data;
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
start = get_timer (0);
|
||||
|
||||
/* wait while polling the status register */
|
||||
while ((*addr & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word or halfword to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data_block (flash_info_t * info, ulong src, ulong dest)
|
||||
{
|
||||
FPWV *srcaddr = (FPWV *) src;
|
||||
FPWV *dstaddr = (FPWV *) dest;
|
||||
ulong start;
|
||||
int flag, i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
for (i = 0; i < WR_BLOCK; i++)
|
||||
if ((*dstaddr++ & 0xff) != 0xff) {
|
||||
printf ("not erased at %08lx (%lx)\n",
|
||||
(ulong) dstaddr, *dstaddr);
|
||||
return (2);
|
||||
}
|
||||
|
||||
dstaddr = (FPWV *) dest;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
*dstaddr = (FPW) 0x00e800e8; /* write block setup */
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
start = get_timer (0);
|
||||
|
||||
/* wait while polling the status register */
|
||||
while ((*dstaddr & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*dstaddr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
*dstaddr = (FPW) 0x001f001f; /* write 32 to buffer */
|
||||
for (i = 0; i < WR_BLOCK; i++)
|
||||
*dstaddr++ = *srcaddr++;
|
||||
|
||||
dstaddr -= 1;
|
||||
*dstaddr = (FPW) 0x00d000d0; /* write 32 to buffer */
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
start = get_timer (0);
|
||||
|
||||
/* wait while polling the status register */
|
||||
while ((*dstaddr & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*dstaddr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
*dstaddr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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 *) (CFG_AMD_BASE);
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
void inline spin_wheel (void)
|
||||
{
|
||||
static int p = 0;
|
||||
static char w[] = "\\/-";
|
||||
|
||||
printf ("\010%c", w[p]);
|
||||
(++p == 3) ? (p = 0) : 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Set/Clear sector's lock bit, returns:
|
||||
* 0 - OK
|
||||
* 1 - Error (timeout, voltage problems, etc.)
|
||||
*/
|
||||
int flash_real_protect (flash_info_t * info, long sector, int prot)
|
||||
{
|
||||
ulong start;
|
||||
int i;
|
||||
int rc = 0;
|
||||
FPWV *addr = (FPWV *) (info->start[sector]);
|
||||
int flag = disable_interrupts ();
|
||||
|
||||
/*
|
||||
* 29F040B AMD flash does not support software protection/unprotection,
|
||||
* the only way to protect the AMD flash is marked it as prot bit.
|
||||
* This flash only support hardware protection, by supply or not supply
|
||||
* 12vpp to the flash
|
||||
*/
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD) {
|
||||
info->protect[sector] = prot;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
*addr = INTEL_CLEAR; /* Clear status register */
|
||||
if (prot) { /* Set sector lock bit */
|
||||
*addr = INTEL_LOCKBIT; /* Sector lock bit */
|
||||
*addr = INTEL_PROTECT; /* set */
|
||||
} else { /* Clear sector lock bit */
|
||||
*addr = INTEL_LOCKBIT; /* All sectors lock bits */
|
||||
*addr = INTEL_CONFIRM; /* clear */
|
||||
}
|
||||
|
||||
start = get_timer (0);
|
||||
|
||||
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
|
||||
if (get_timer (start) > CFG_FLASH_UNLOCK_TOUT) {
|
||||
printf ("Flash lock bit operation timed out\n");
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*addr != INTEL_OK) {
|
||||
printf ("Flash lock bit operation failed at %08X, CSR=%08X\n",
|
||||
(uint) addr, (uint) * addr);
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
if (!rc)
|
||||
info->protect[sector] = prot;
|
||||
|
||||
/*
|
||||
* Clear lock bit command clears all sectors lock bits, so
|
||||
* we have to restore lock bits of protected sectors.
|
||||
*/
|
||||
if (!prot) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (info->protect[i]) {
|
||||
start = get_timer (0);
|
||||
addr = (FPWV *) (info->start[i]);
|
||||
*addr = INTEL_LOCKBIT; /* Sector lock bit */
|
||||
*addr = INTEL_PROTECT; /* set */
|
||||
while ((*addr & INTEL_FINISHED) !=
|
||||
INTEL_FINISHED) {
|
||||
if (get_timer (start) >
|
||||
CFG_FLASH_UNLOCK_TOUT) {
|
||||
printf ("Flash lock bit operation timed out\n");
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
*addr = INTEL_RESET; /* Reset to read array mode */
|
||||
|
||||
return rc;
|
||||
}
|
||||
122
board/alaska/u-boot.lds
Normal file
122
board/alaska/u-boot.lds
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* (C) Copyright 2003-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc8220/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 = .);
|
||||
}
|
||||
@ -101,7 +101,7 @@ board_init(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_arch_number = 25; /* Intel Assabet Board */
|
||||
gd->bd->bi_arch_number = MACH_TYPE_ASSABET;
|
||||
gd->bd->bi_boot_params = 0xc0000100;
|
||||
|
||||
neponset_init();
|
||||
|
||||
@ -80,8 +80,8 @@ BCR_DB1110: .long ASSABET_BCR_DB1110
|
||||
LEDS: .long NEPONSET_LEDS
|
||||
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
/* Setting up the memory and stuff */
|
||||
|
||||
|
||||
@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := at91rm9200dk.o at45.o dm9161.o flash.o
|
||||
SOBJS :=
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -45,7 +45,7 @@ int board_init (void)
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* arch number of AT91RM9200DK-Board */
|
||||
gd->bd->bi_arch_number = 251;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200;
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
TEXT_BASE = 0x21f80000
|
||||
TEXT_BASE = 0x21f00000
|
||||
|
||||
95
board/cds/common/cadmus.c
Normal file
95
board/cds/common/cadmus.c
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* 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>
|
||||
|
||||
|
||||
/*
|
||||
* CADMUS Board System Registers
|
||||
*/
|
||||
#ifndef CFG_CADMUS_BASE_REG
|
||||
#define CFG_CADMUS_BASE_REG (CADMUS_BASE_ADDR + 0x4000)
|
||||
#endif
|
||||
|
||||
typedef struct cadmus_reg {
|
||||
u_char cm_ver; /* Board version */
|
||||
u_char cm_csr; /* General control/status */
|
||||
u_char cm_rst; /* Reset control */
|
||||
u_char cm_hsclk; /* High speed clock */
|
||||
u_char cm_hsxclk; /* High speed clock extended */
|
||||
u_char cm_led; /* LED data */
|
||||
u_char cm_pci; /* PCI control/status */
|
||||
u_char cm_dma; /* DMA control */
|
||||
u_char cm_reserved[248]; /* Total 256 bytes */
|
||||
} cadmus_reg_t;
|
||||
|
||||
|
||||
unsigned int
|
||||
get_board_version(void)
|
||||
{
|
||||
volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
|
||||
|
||||
return cadmus->cm_ver;
|
||||
}
|
||||
|
||||
|
||||
unsigned long
|
||||
get_clock_freq(void)
|
||||
{
|
||||
volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
|
||||
|
||||
uint pci1_speed = (cadmus->cm_pci >> 2) & 0x3; /* PSPEED in [4:5] */
|
||||
|
||||
if (pci1_speed == 0) {
|
||||
return 33000000;
|
||||
} else if (pci1_speed == 1) {
|
||||
return 66000000;
|
||||
} else {
|
||||
/* Really, unknown. Be safe? */
|
||||
return 33000000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned int
|
||||
get_pci_slot(void)
|
||||
{
|
||||
volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
|
||||
|
||||
/*
|
||||
* PCI slot in USER bits CSR[6:7] by convention.
|
||||
*/
|
||||
return ((cadmus->cm_csr >> 6) & 0x3) + 1;
|
||||
}
|
||||
|
||||
|
||||
unsigned int
|
||||
get_pci_dual(void)
|
||||
{
|
||||
volatile cadmus_reg_t *cadmus = (cadmus_reg_t *)CFG_CADMUS_BASE_REG;
|
||||
|
||||
/*
|
||||
* PCI DUAL in CM_PCI[3]
|
||||
*/
|
||||
return cadmus->cm_pci & 0x10;
|
||||
}
|
||||
54
board/cds/common/cadmus.h
Normal file
54
board/cds/common/cadmus.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __CADMUS_H_
|
||||
#define __CADMUS_H_
|
||||
|
||||
|
||||
/*
|
||||
* CADMUS Board System Register interface.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Returns board version register.
|
||||
*/
|
||||
extern unsigned int get_board_version(void);
|
||||
|
||||
/*
|
||||
* Returns either 33000000 or 66000000 as the SYS_CLK_FREQ.
|
||||
*/
|
||||
extern unsigned long get_clock_freq(void);
|
||||
|
||||
|
||||
/*
|
||||
* Returns 1 - 4, as found in the USER CSR[6:7] bits.
|
||||
*/
|
||||
extern unsigned int get_pci_slot(void);
|
||||
|
||||
|
||||
/*
|
||||
* Returns PCI DUAL as found in CM_PCI[3].
|
||||
*/
|
||||
extern unsigned int get_pci_dual(void);
|
||||
|
||||
|
||||
#endif /* __CADMUS_H_ */
|
||||
60
board/cds/common/eeprom.c
Normal file
60
board/cds/common/eeprom.c
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* 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 <i2c.h>
|
||||
|
||||
#include "eeprom.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
char idee_pcbid[4]; /* "CCID" for CDC v1.X */
|
||||
u8 idee_major;
|
||||
u8 idee_minor;
|
||||
char idee_serial[10];
|
||||
char idee_errata[2];
|
||||
char idee_date[8]; /* yyyymmdd */
|
||||
/* The rest of the EEPROM space is reserved */
|
||||
} id_eeprom_t;
|
||||
|
||||
|
||||
unsigned int
|
||||
get_cpu_board_revision(void)
|
||||
{
|
||||
uint major = 0;
|
||||
uint minor = 0;
|
||||
|
||||
id_eeprom_t id_eeprom;
|
||||
|
||||
i2c_read(CFG_I2C_EEPROM_ADDR, 0, 2,
|
||||
(uchar *) &id_eeprom, sizeof(id_eeprom));
|
||||
|
||||
major = id_eeprom.idee_major;
|
||||
minor = id_eeprom.idee_minor;
|
||||
|
||||
if (major == 0xff && minor == 0xff) {
|
||||
major = minor = 0;
|
||||
}
|
||||
|
||||
return MPC85XX_CPU_BOARD_REV(major,minor);
|
||||
}
|
||||
50
board/cds/common/eeprom.h
Normal file
50
board/cds/common/eeprom.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __EEPROM_H_
|
||||
#define __EEPROM_H_
|
||||
|
||||
|
||||
/*
|
||||
* EEPROM Board System Register interface.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* CPU Board Revision
|
||||
*/
|
||||
#define MPC85XX_CPU_BOARD_REV(maj, min) ((((maj)&0xff) << 8) | ((min) & 0xff))
|
||||
#define MPC85XX_CPU_BOARD_MAJOR(rev) (((rev) >> 8) & 0xff)
|
||||
#define MPC85XX_CPU_BOARD_MINOR(rev) ((rev) & 0xff)
|
||||
|
||||
#define MPC85XX_CPU_BOARD_REV_UNKNOWN MPC85XX_CPU_BOARD_REV(0,0)
|
||||
#define MPC85XX_CPU_BOARD_REV_1_0 MPC85XX_CPU_BOARD_REV(1,0)
|
||||
#define MPC85XX_CPU_BOARD_REV_1_1 MPC85XX_CPU_BOARD_REV(1,1)
|
||||
|
||||
/*
|
||||
* Returns CPU board revision register as a 16-bit value with
|
||||
* the Major in the high byte, and Minor in the low byte.
|
||||
*/
|
||||
extern unsigned int get_cpu_board_revision(void);
|
||||
|
||||
|
||||
#endif /* __CADMUS_H_ */
|
||||
51
board/cds/mpc8541cds/Makefile
Normal file
51
board/cds/mpc8541cds/Makefile
Normal file
@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright 2004 Freescale Semiconductor.
|
||||
# (C) Copyright 2001
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := $(BOARD).o \
|
||||
../common/cadmus.o \
|
||||
../common/eeprom.o
|
||||
|
||||
SOBJS := init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(SOBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
30
board/cds/mpc8541cds/config.mk
Normal file
30
board/cds/mpc8541cds/config.mk
Normal file
@ -0,0 +1,30 @@
|
||||
#
|
||||
# Copyright 2004 Freescale Semiconductor.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# mpc8541cds board
|
||||
#
|
||||
TEXT_BASE = 0xfff80000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_E500=1
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx=1
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_MPC8541=1
|
||||
255
board/cds/mpc8541cds/init.S
Normal file
255
board/cds/mpc8541cds/init.S
Normal file
@ -0,0 +1,255 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
* Copyright 2002,2003, Motorola Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <config.h>
|
||||
#include <mpc85xx.h>
|
||||
|
||||
|
||||
/*
|
||||
* TLB0 and TLB1 Entries
|
||||
*
|
||||
* Out of reset, TLB1's Entry 0 maps the highest 4K for CCSRBAR.
|
||||
* However, CCSRBAR is then relocated to CFG_CCSRBAR right after
|
||||
* these TLB entries are established.
|
||||
*
|
||||
* The TLB entries for DDR are dynamically setup in spd_sdram()
|
||||
* and use TLB1 Entries 8 through 15 as needed according to the
|
||||
* size of DDR memory.
|
||||
*
|
||||
* MAS0: tlbsel, esel, nv
|
||||
* MAS1: valid, iprot, tid, ts, tsize
|
||||
* MAS2: epn, sharen, x0, x1, w, i, m, g, e
|
||||
* MAS3: rpn, u0-u3, ux, sx, uw, sw, ur, sr
|
||||
*/
|
||||
|
||||
#define entry_start \
|
||||
mflr r1 ; \
|
||||
bl 0f ;
|
||||
|
||||
#define entry_end \
|
||||
0: mflr r0 ; \
|
||||
mtlr r1 ; \
|
||||
blr ;
|
||||
|
||||
|
||||
.section .bootpg, "ax"
|
||||
.globl tlb1_entry
|
||||
tlb1_entry:
|
||||
entry_start
|
||||
|
||||
/*
|
||||
* Number of TLB0 and TLB1 entries in the following table
|
||||
*/
|
||||
.long 13
|
||||
|
||||
#if (CFG_CCSRBAR_DEFAULT != CFG_CCSRBAR)
|
||||
/*
|
||||
* TLB0 4K Non-cacheable, guarded
|
||||
* 0xff700000 4K Initial CCSRBAR mapping
|
||||
*
|
||||
* This ends up at a TLB0 Index==0 entry, and must not collide
|
||||
* with other TLB0 Entries.
|
||||
*/
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_CCSRBAR_DEFAULT), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_CCSRBAR_DEFAULT), 0,0,0,0,0,1,0,1,0,1)
|
||||
#else
|
||||
#error("Update the number of table entries in tlb1_entry")
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TLB0 16K Cacheable, non-guarded
|
||||
* 0xd001_0000 16K Temporary Global data for initialization
|
||||
*
|
||||
* Use four 4K TLB0 entries. These entries must be cacheable
|
||||
* as they provide the bootstrap memory before the memory
|
||||
* controler and real memory have been configured.
|
||||
*
|
||||
* These entries end up at TLB0 Indicies 0x10, 0x14, 0x18 and 0x1c,
|
||||
* and must not collide with other TLB0 entries.
|
||||
*/
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR + 4 * 1024),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR + 4 * 1024),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR + 8 * 1024),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR + 8 * 1024),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR + 12 * 1024),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR + 12 * 1024),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
|
||||
/*
|
||||
* TLB 0: 16M Non-cacheable, guarded
|
||||
* 0xff000000 16M FLASH
|
||||
* Out of reset this entry is only 4K.
|
||||
*/
|
||||
.long TLB1_MAS0(1, 0, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_16M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_FLASH_BASE), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_FLASH_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 1: 256M Non-cacheable, guarded
|
||||
* 0x80000000 256M PCI1 MEM First half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 1, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI1_MEM_BASE), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI1_MEM_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 2: 256M Non-cacheable, guarded
|
||||
* 0x90000000 256M PCI1 MEM Second half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 2, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI1_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI1_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 3: 256M Non-cacheable, guarded
|
||||
* 0xa0000000 256M PCI2 MEM First half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 3, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI2_MEM_BASE), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI2_MEM_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 4: 256M Non-cacheable, guarded
|
||||
* 0xb0000000 256M PCI2 MEM Second half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 4, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI2_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI2_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 5: 64M Non-cacheable, guarded
|
||||
* 0xe000_0000 1M CCSRBAR
|
||||
* 0xe200_0000 16M PCI1 IO
|
||||
* 0xe300_0000 16M PCI2 IO
|
||||
*/
|
||||
.long TLB1_MAS0(1, 5, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_CCSRBAR), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_CCSRBAR), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 6: 64M Cacheable, non-guarded
|
||||
* 0xf000_0000 64M LBC SDRAM
|
||||
*/
|
||||
.long TLB1_MAS0(1, 6, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_LBC_SDRAM_BASE), 0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_LBC_SDRAM_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 7: 1M Non-cacheable, guarded
|
||||
* 0xf8000000 1M CADMUS registers
|
||||
*/
|
||||
.long TLB1_MAS0(1, 7, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_1M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CADMUS_BASE_ADDR), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CADMUS_BASE_ADDR), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
entry_end
|
||||
|
||||
/*
|
||||
* LAW(Local Access Window) configuration:
|
||||
*
|
||||
* 0x0000_0000 0x7fff_ffff DDR 2G
|
||||
* 0x8000_0000 0x9fff_ffff PCI1 MEM 512M
|
||||
* 0xa000_0000 0xbfff_ffff PCI2 MEM 512M
|
||||
* 0xe000_0000 0xe000_ffff CCSR 1M
|
||||
* 0xe200_0000 0xe2ff_ffff PCI1 IO 16M
|
||||
* 0xe300_0000 0xe3ff_ffff PCI2 IO 16M
|
||||
* 0xf000_0000 0xf7ff_ffff SDRAM 128M
|
||||
* 0xf800_0000 0xf80f_ffff NVRAM/CADMUS (*) 1M
|
||||
* 0xff00_0000 0xff7f_ffff FLASH (2nd bank) 8M
|
||||
* 0xff80_0000 0xffff_ffff FLASH (boot bank) 8M
|
||||
*
|
||||
* Notes:
|
||||
* CCSRBAR and L2-as-SRAM don't need a configured Local Access Window.
|
||||
* If flash is 8M at default position (last 8M), no LAW needed.
|
||||
*
|
||||
* The defines below are 1-off of the actual LAWAR0 usage.
|
||||
* So LAWAR3 define uses the LAWAR4 register in the ECM.
|
||||
*/
|
||||
|
||||
#define LAWBAR0 0
|
||||
#define LAWAR0 ((LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & LAWAR_SIZE_128M)) & ~LAWAR_EN)
|
||||
|
||||
#define LAWBAR1 ((CFG_PCI1_MEM_BASE>>12) & 0xfffff)
|
||||
#define LAWAR1 (LAWAR_EN | LAWAR_TRGT_IF_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_512M))
|
||||
|
||||
#define LAWBAR2 ((CFG_PCI2_MEM_BASE>>12) & 0xfffff)
|
||||
#define LAWAR2 (LAWAR_EN | LAWAR_TRGT_IF_PCI2 | (LAWAR_SIZE & LAWAR_SIZE_512M))
|
||||
|
||||
#define LAWBAR3 ((CFG_PCI1_IO_BASE>>12) & 0xfffff)
|
||||
#define LAWAR3 (LAWAR_EN | LAWAR_TRGT_IF_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_16M))
|
||||
|
||||
#define LAWBAR4 ((CFG_PCI2_IO_BASE>>12) & 0xfffff)
|
||||
#define LAWAR4 (LAWAR_EN | LAWAR_TRGT_IF_PCI2 | (LAWAR_SIZE & LAWAR_SIZE_16M))
|
||||
|
||||
/* LBC window - maps 256M 0xf0000000 -> 0xffffffff */
|
||||
#define LAWBAR5 ((CFG_LBC_SDRAM_BASE>>12) & 0xfffff)
|
||||
#define LAWAR5 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_256M))
|
||||
|
||||
.section .bootpg, "ax"
|
||||
.globl law_entry
|
||||
|
||||
law_entry:
|
||||
entry_start
|
||||
.long 6
|
||||
.long LAWBAR0,LAWAR0,LAWBAR1,LAWAR1,LAWBAR2,LAWAR2,LAWBAR3,LAWAR3
|
||||
.long LAWBAR4,LAWAR4,LAWBAR5,LAWAR5
|
||||
entry_end
|
||||
349
board/cds/mpc8541cds/mpc8541cds.c
Normal file
349
board/cds/mpc8541cds/mpc8541cds.c
Normal file
@ -0,0 +1,349 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* (C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <pci.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/immap_85xx.h>
|
||||
#include <spd.h>
|
||||
|
||||
#include "../common/cadmus.h"
|
||||
#include "../common/eeprom.h"
|
||||
|
||||
#if defined(CONFIG_DDR_ECC)
|
||||
extern void ddr_enable_ecc(unsigned int dram_size);
|
||||
#endif
|
||||
|
||||
extern long int spd_sdram(void);
|
||||
|
||||
void local_bus_init(void);
|
||||
void sdram_init(void);
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||
|
||||
/* PCI slot in USER bits CSR[6:7] by convention. */
|
||||
uint pci_slot = get_pci_slot ();
|
||||
|
||||
uint pci_dual = get_pci_dual (); /* PCI DUAL in CM_PCI[3] */
|
||||
uint pci1_32 = gur->pordevsr & 0x10000; /* PORDEVSR[15] */
|
||||
uint pci1_clk_sel = gur->porpllsr & 0x8000; /* PORPLLSR[16] */
|
||||
uint pci2_clk_sel = gur->porpllsr & 0x4000; /* PORPLLSR[17] */
|
||||
|
||||
uint pci1_speed = get_clock_freq (); /* PCI PSPEED in [4:5] */
|
||||
|
||||
uint cpu_board_rev = get_cpu_board_revision ();
|
||||
|
||||
printf ("Board: CDS Version 0x%02x, PCI Slot %d\n",
|
||||
get_board_version (), pci_slot);
|
||||
|
||||
printf ("CPU Board Revision %d.%d (0x%04x)\n",
|
||||
MPC85XX_CPU_BOARD_MAJOR (cpu_board_rev),
|
||||
MPC85XX_CPU_BOARD_MINOR (cpu_board_rev), cpu_board_rev);
|
||||
|
||||
printf (" PCI1: %d bit, %s MHz, %s\n",
|
||||
(pci1_32) ? 32 : 64,
|
||||
(pci1_speed == 33000000) ? "33" :
|
||||
(pci1_speed == 66000000) ? "66" : "unknown",
|
||||
pci1_clk_sel ? "sync" : "async");
|
||||
|
||||
if (pci_dual) {
|
||||
printf (" PCI2: 32 bit, 66 MHz, %s\n",
|
||||
pci2_clk_sel ? "sync" : "async");
|
||||
} else {
|
||||
printf (" PCI2: disabled\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize local bus.
|
||||
*/
|
||||
local_bus_init ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int
|
||||
initdram(int board_type)
|
||||
{
|
||||
long dram_size = 0;
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
|
||||
puts("Initializing\n");
|
||||
|
||||
#if defined(CONFIG_DDR_DLL)
|
||||
{
|
||||
/*
|
||||
* Work around to stabilize DDR DLL MSYNC_IN.
|
||||
* Errata DDR9 seems to have been fixed.
|
||||
* This is now the workaround for Errata DDR11:
|
||||
* Override DLL = 1, Course Adj = 1, Tap Select = 0
|
||||
*/
|
||||
|
||||
volatile ccsr_gur_t *gur= &immap->im_gur;
|
||||
|
||||
gur->ddrdllcr = 0x81000000;
|
||||
asm("sync;isync;msync");
|
||||
udelay(200);
|
||||
}
|
||||
#endif
|
||||
dram_size = spd_sdram();
|
||||
|
||||
#if defined(CONFIG_DDR_ECC)
|
||||
/*
|
||||
* Initialize and enable DDR ECC.
|
||||
*/
|
||||
ddr_enable_ecc(dram_size);
|
||||
#endif
|
||||
/*
|
||||
* SDRAM Initialization
|
||||
*/
|
||||
sdram_init();
|
||||
|
||||
puts(" DDR: ");
|
||||
return dram_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize Local Bus
|
||||
*/
|
||||
void
|
||||
local_bus_init(void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||
volatile ccsr_lbc_t *lbc = &immap->im_lbc;
|
||||
|
||||
uint clkdiv;
|
||||
uint lbc_hz;
|
||||
sys_info_t sysinfo;
|
||||
uint temp_lbcdll;
|
||||
|
||||
/*
|
||||
* Errata LBC11.
|
||||
* Fix Local Bus clock glitch when DLL is enabled.
|
||||
*
|
||||
* If localbus freq is < 66Mhz, DLL bypass mode must be used.
|
||||
* If localbus freq is > 133Mhz, DLL can be safely enabled.
|
||||
* Between 66 and 133, the DLL is enabled with an override workaround.
|
||||
*/
|
||||
|
||||
get_sys_info(&sysinfo);
|
||||
clkdiv = lbc->lcrr & 0x0f;
|
||||
lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv;
|
||||
|
||||
if (lbc_hz < 66) {
|
||||
lbc->lcrr |= 0x80000000; /* DLL Bypass */
|
||||
|
||||
} else if (lbc_hz >= 133) {
|
||||
lbc->lcrr &= (~0x80000000); /* DLL Enabled */
|
||||
|
||||
} else {
|
||||
lbc->lcrr &= (~0x8000000); /* DLL Enabled */
|
||||
udelay(200);
|
||||
|
||||
/*
|
||||
* Sample LBC DLL ctrl reg, upshift it to set the
|
||||
* override bits.
|
||||
*/
|
||||
temp_lbcdll = gur->lbcdllcr;
|
||||
gur->lbcdllcr = (((temp_lbcdll & 0xff) << 16) | 0x80000000);
|
||||
asm("sync;isync;msync");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize SDRAM memory on the Local Bus.
|
||||
*/
|
||||
void
|
||||
sdram_init(void)
|
||||
{
|
||||
#if defined(CFG_OR2_PRELIM) && defined(CFG_BR2_PRELIM)
|
||||
|
||||
uint idx;
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile ccsr_lbc_t *lbc = &immap->im_lbc;
|
||||
uint *sdram_addr = (uint *)CFG_LBC_SDRAM_BASE;
|
||||
uint cpu_board_rev;
|
||||
uint lsdmr_common;
|
||||
|
||||
puts(" SDRAM: ");
|
||||
|
||||
print_size (CFG_LBC_SDRAM_SIZE * 1024 * 1024, "\n");
|
||||
|
||||
/*
|
||||
* Setup SDRAM Base and Option Registers
|
||||
*/
|
||||
lbc->or2 = CFG_OR2_PRELIM;
|
||||
asm("msync");
|
||||
|
||||
lbc->br2 = CFG_BR2_PRELIM;
|
||||
asm("msync");
|
||||
|
||||
lbc->lbcr = CFG_LBC_LBCR;
|
||||
asm("msync");
|
||||
|
||||
|
||||
lbc->lsrt = CFG_LBC_LSRT;
|
||||
lbc->mrtpr = CFG_LBC_MRTPR;
|
||||
asm("msync");
|
||||
|
||||
/*
|
||||
* Determine which address lines to use baed on CPU board rev.
|
||||
*/
|
||||
cpu_board_rev = get_cpu_board_revision();
|
||||
lsdmr_common = CFG_LBC_LSDMR_COMMON;
|
||||
if (cpu_board_rev == MPC85XX_CPU_BOARD_REV_1_0) {
|
||||
lsdmr_common |= CFG_LBC_LSDMR_BSMA1617;
|
||||
} else if (cpu_board_rev == MPC85XX_CPU_BOARD_REV_1_1) {
|
||||
lsdmr_common |= CFG_LBC_LSDMR_BSMA1516;
|
||||
} else {
|
||||
/*
|
||||
* Assume something unable to identify itself is
|
||||
* really old, and likely has lines 16/17 mapped.
|
||||
*/
|
||||
lsdmr_common |= CFG_LBC_LSDMR_BSMA1617;
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue PRECHARGE ALL command.
|
||||
*/
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_PCHALL;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(100);
|
||||
|
||||
/*
|
||||
* Issue 8 AUTO REFRESH commands.
|
||||
*/
|
||||
for (idx = 0; idx < 8; idx++) {
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_ARFRSH;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue 8 MODE-set command.
|
||||
*/
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_MRW;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(100);
|
||||
|
||||
/*
|
||||
* Issue NORMAL OP command.
|
||||
*/
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_NORMAL;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(200); /* Overkill. Must wait > 200 bus cycles */
|
||||
|
||||
#endif /* enable SDRAM init */
|
||||
}
|
||||
|
||||
#if defined(CFG_DRAM_TEST)
|
||||
int
|
||||
testdram(void)
|
||||
{
|
||||
uint *pstart = (uint *) CFG_MEMTEST_START;
|
||||
uint *pend = (uint *) CFG_MEMTEST_END;
|
||||
uint *p;
|
||||
|
||||
printf("Testing DRAM from 0x%08x to 0x%08x\n",
|
||||
CFG_MEMTEST_START,
|
||||
CFG_MEMTEST_END);
|
||||
|
||||
printf("DRAM test phase 1:\n");
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0xaaaaaaaa;
|
||||
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0xaaaaaaaa) {
|
||||
printf ("DRAM test fails at: %08x\n", (uint) p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("DRAM test phase 2:\n");
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0x55555555;
|
||||
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0x55555555) {
|
||||
printf ("DRAM test fails at: %08x\n", (uint) p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("DRAM test passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
|
||||
/*
|
||||
* Initialize PCI Devices, report devices found.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
static struct pci_config_table pci_mpc85xxcds_config_table[] = {
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_IDSEL_NUMBER, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
|
||||
} },
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct pci_controller hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table: pci_mpc85xxcds_config_table,
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
void
|
||||
pci_init_board(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
extern void pci_mpc85xx_init(struct pci_controller *hose);
|
||||
|
||||
pci_mpc85xx_init(&hose);
|
||||
#endif
|
||||
}
|
||||
147
board/cds/mpc8541cds/u-boot.lds
Normal file
147
board/cds/mpc8541cds/u-boot.lds
Normal file
@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
board/cds/mpc8541cds/init.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
board/cds/mpc8541cds/init.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
cpu/mpc85xx/tsec.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/pci.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
51
board/cds/mpc8555cds/Makefile
Normal file
51
board/cds/mpc8555cds/Makefile
Normal file
@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright 2004 Freescale Semiconductor.
|
||||
# (C) Copyright 2001
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := $(BOARD).o \
|
||||
../common/cadmus.o \
|
||||
../common/eeprom.o
|
||||
|
||||
SOBJS := init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(SOBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
30
board/cds/mpc8555cds/config.mk
Normal file
30
board/cds/mpc8555cds/config.mk
Normal file
@ -0,0 +1,30 @@
|
||||
#
|
||||
# Copyright 2004 Freescale Semiconductor.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# mpc8555cds board
|
||||
#
|
||||
TEXT_BASE = 0xfff80000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_E500=1
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx=1
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_MPC8555=1
|
||||
255
board/cds/mpc8555cds/init.S
Normal file
255
board/cds/mpc8555cds/init.S
Normal file
@ -0,0 +1,255 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
* Copyright 2002,2003, Motorola Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <config.h>
|
||||
#include <mpc85xx.h>
|
||||
|
||||
|
||||
/*
|
||||
* TLB0 and TLB1 Entries
|
||||
*
|
||||
* Out of reset, TLB1's Entry 0 maps the highest 4K for CCSRBAR.
|
||||
* However, CCSRBAR is then relocated to CFG_CCSRBAR right after
|
||||
* these TLB entries are established.
|
||||
*
|
||||
* The TLB entries for DDR are dynamically setup in spd_sdram()
|
||||
* and use TLB1 Entries 8 through 15 as needed according to the
|
||||
* size of DDR memory.
|
||||
*
|
||||
* MAS0: tlbsel, esel, nv
|
||||
* MAS1: valid, iprot, tid, ts, tsize
|
||||
* MAS2: epn, sharen, x0, x1, w, i, m, g, e
|
||||
* MAS3: rpn, u0-u3, ux, sx, uw, sw, ur, sr
|
||||
*/
|
||||
|
||||
#define entry_start \
|
||||
mflr r1 ; \
|
||||
bl 0f ;
|
||||
|
||||
#define entry_end \
|
||||
0: mflr r0 ; \
|
||||
mtlr r1 ; \
|
||||
blr ;
|
||||
|
||||
|
||||
.section .bootpg, "ax"
|
||||
.globl tlb1_entry
|
||||
tlb1_entry:
|
||||
entry_start
|
||||
|
||||
/*
|
||||
* Number of TLB0 and TLB1 entries in the following table
|
||||
*/
|
||||
.long 13
|
||||
|
||||
#if (CFG_CCSRBAR_DEFAULT != CFG_CCSRBAR)
|
||||
/*
|
||||
* TLB0 4K Non-cacheable, guarded
|
||||
* 0xff700000 4K Initial CCSRBAR mapping
|
||||
*
|
||||
* This ends up at a TLB0 Index==0 entry, and must not collide
|
||||
* with other TLB0 Entries.
|
||||
*/
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_CCSRBAR_DEFAULT), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_CCSRBAR_DEFAULT), 0,0,0,0,0,1,0,1,0,1)
|
||||
#else
|
||||
#error("Update the number of table entries in tlb1_entry")
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TLB0 16K Cacheable, non-guarded
|
||||
* 0xd001_0000 16K Temporary Global data for initialization
|
||||
*
|
||||
* Use four 4K TLB0 entries. These entries must be cacheable
|
||||
* as they provide the bootstrap memory before the memory
|
||||
* controler and real memory have been configured.
|
||||
*
|
||||
* These entries end up at TLB0 Indicies 0x10, 0x14, 0x18 and 0x1c,
|
||||
* and must not collide with other TLB0 entries.
|
||||
*/
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR + 4 * 1024),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR + 4 * 1024),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR + 8 * 1024),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR + 8 * 1024),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
.long TLB1_MAS0(0, 0, 0)
|
||||
.long TLB1_MAS1(1, 0, 0, 0, 0)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_INIT_RAM_ADDR + 12 * 1024),
|
||||
0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_INIT_RAM_ADDR + 12 * 1024),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
|
||||
/*
|
||||
* TLB 0: 16M Non-cacheable, guarded
|
||||
* 0xff000000 16M FLASH
|
||||
* Out of reset this entry is only 4K.
|
||||
*/
|
||||
.long TLB1_MAS0(1, 0, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_16M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_FLASH_BASE), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_FLASH_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 1: 256M Non-cacheable, guarded
|
||||
* 0x80000000 256M PCI1 MEM First half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 1, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI1_MEM_BASE), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI1_MEM_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 2: 256M Non-cacheable, guarded
|
||||
* 0x90000000 256M PCI1 MEM Second half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 2, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI1_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI1_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 3: 256M Non-cacheable, guarded
|
||||
* 0xa0000000 256M PCI2 MEM First half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 3, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI2_MEM_BASE), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI2_MEM_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 4: 256M Non-cacheable, guarded
|
||||
* 0xb0000000 256M PCI2 MEM Second half
|
||||
*/
|
||||
.long TLB1_MAS0(1, 4, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_256M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_PCI2_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_PCI2_MEM_BASE + 0x10000000),
|
||||
0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 5: 64M Non-cacheable, guarded
|
||||
* 0xe000_0000 1M CCSRBAR
|
||||
* 0xe200_0000 16M PCI1 IO
|
||||
* 0xe300_0000 16M PCI2 IO
|
||||
*/
|
||||
.long TLB1_MAS0(1, 5, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_CCSRBAR), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_CCSRBAR), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 6: 64M Cacheable, non-guarded
|
||||
* 0xf000_0000 64M LBC SDRAM
|
||||
*/
|
||||
.long TLB1_MAS0(1, 6, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CFG_LBC_SDRAM_BASE), 0,0,0,0,0,0,0,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CFG_LBC_SDRAM_BASE), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
/*
|
||||
* TLB 7: 1M Non-cacheable, guarded
|
||||
* 0xf8000000 1M CADMUS registers
|
||||
*/
|
||||
.long TLB1_MAS0(1, 7, 0)
|
||||
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_1M)
|
||||
.long TLB1_MAS2(E500_TLB_EPN(CADMUS_BASE_ADDR), 0,0,0,0,1,0,1,0)
|
||||
.long TLB1_MAS3(E500_TLB_RPN(CADMUS_BASE_ADDR), 0,0,0,0,0,1,0,1,0,1)
|
||||
|
||||
entry_end
|
||||
|
||||
/*
|
||||
* LAW(Local Access Window) configuration:
|
||||
*
|
||||
* 0x0000_0000 0x7fff_ffff DDR 2G
|
||||
* 0x8000_0000 0x9fff_ffff PCI1 MEM 512M
|
||||
* 0xa000_0000 0xbfff_ffff PCI2 MEM 512M
|
||||
* 0xe000_0000 0xe000_ffff CCSR 1M
|
||||
* 0xe200_0000 0xe2ff_ffff PCI1 IO 16M
|
||||
* 0xe300_0000 0xe3ff_ffff PCI2 IO 16M
|
||||
* 0xf000_0000 0xf7ff_ffff SDRAM 128M
|
||||
* 0xf800_0000 0xf80f_ffff NVRAM/CADMUS (*) 1M
|
||||
* 0xff00_0000 0xff7f_ffff FLASH (2nd bank) 8M
|
||||
* 0xff80_0000 0xffff_ffff FLASH (boot bank) 8M
|
||||
*
|
||||
* Notes:
|
||||
* CCSRBAR and L2-as-SRAM don't need a configured Local Access Window.
|
||||
* If flash is 8M at default position (last 8M), no LAW needed.
|
||||
*
|
||||
* The defines below are 1-off of the actual LAWAR0 usage.
|
||||
* So LAWAR3 define uses the LAWAR4 register in the ECM.
|
||||
*/
|
||||
|
||||
#define LAWBAR0 0
|
||||
#define LAWAR0 ((LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & LAWAR_SIZE_128M)) & ~LAWAR_EN)
|
||||
|
||||
#define LAWBAR1 ((CFG_PCI1_MEM_BASE>>12) & 0xfffff)
|
||||
#define LAWAR1 (LAWAR_EN | LAWAR_TRGT_IF_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_512M))
|
||||
|
||||
#define LAWBAR2 ((CFG_PCI2_MEM_BASE>>12) & 0xfffff)
|
||||
#define LAWAR2 (LAWAR_EN | LAWAR_TRGT_IF_PCI2 | (LAWAR_SIZE & LAWAR_SIZE_512M))
|
||||
|
||||
#define LAWBAR3 ((CFG_PCI1_IO_BASE>>12) & 0xfffff)
|
||||
#define LAWAR3 (LAWAR_EN | LAWAR_TRGT_IF_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_16M))
|
||||
|
||||
#define LAWBAR4 ((CFG_PCI2_IO_BASE>>12) & 0xfffff)
|
||||
#define LAWAR4 (LAWAR_EN | LAWAR_TRGT_IF_PCI2 | (LAWAR_SIZE & LAWAR_SIZE_16M))
|
||||
|
||||
/* LBC window - maps 256M 0xf0000000 -> 0xffffffff */
|
||||
#define LAWBAR5 ((CFG_LBC_SDRAM_BASE>>12) & 0xfffff)
|
||||
#define LAWAR5 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_256M))
|
||||
|
||||
.section .bootpg, "ax"
|
||||
.globl law_entry
|
||||
|
||||
law_entry:
|
||||
entry_start
|
||||
.long 6
|
||||
.long LAWBAR0,LAWAR0,LAWBAR1,LAWAR1,LAWBAR2,LAWAR2,LAWBAR3,LAWAR3
|
||||
.long LAWBAR4,LAWAR4,LAWBAR5,LAWAR5
|
||||
entry_end
|
||||
346
board/cds/mpc8555cds/mpc8555cds.c
Normal file
346
board/cds/mpc8555cds/mpc8555cds.c
Normal file
@ -0,0 +1,346 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* 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 <pci.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/immap_85xx.h>
|
||||
#include <spd.h>
|
||||
|
||||
#include "../common/cadmus.h"
|
||||
#include "../common/eeprom.h"
|
||||
|
||||
#if defined(CONFIG_DDR_ECC)
|
||||
extern void ddr_enable_ecc(unsigned int dram_size);
|
||||
#endif
|
||||
|
||||
extern long int spd_sdram(void);
|
||||
|
||||
void local_bus_init(void);
|
||||
void sdram_init(void);
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||
|
||||
/* PCI slot in USER bits CSR[6:7] by convention. */
|
||||
uint pci_slot = get_pci_slot ();
|
||||
|
||||
uint pci_dual = get_pci_dual (); /* PCI DUAL in CM_PCI[3] */
|
||||
uint pci1_32 = gur->pordevsr & 0x10000; /* PORDEVSR[15] */
|
||||
uint pci1_clk_sel = gur->porpllsr & 0x8000; /* PORPLLSR[16] */
|
||||
uint pci2_clk_sel = gur->porpllsr & 0x4000; /* PORPLLSR[17] */
|
||||
|
||||
uint pci1_speed = get_clock_freq (); /* PCI PSPEED in [4:5] */
|
||||
|
||||
uint cpu_board_rev = get_cpu_board_revision ();
|
||||
|
||||
printf ("Board: CDS Version 0x%02x, PCI Slot %d\n",
|
||||
get_board_version (), pci_slot);
|
||||
|
||||
printf ("CPU Board Revision %d.%d (0x%04x)\n",
|
||||
MPC85XX_CPU_BOARD_MAJOR (cpu_board_rev),
|
||||
MPC85XX_CPU_BOARD_MINOR (cpu_board_rev), cpu_board_rev);
|
||||
|
||||
printf (" PCI1: %d bit, %s MHz, %s\n",
|
||||
(pci1_32) ? 32 : 64,
|
||||
(pci1_speed == 33000000) ? "33" :
|
||||
(pci1_speed == 66000000) ? "66" : "unknown",
|
||||
pci1_clk_sel ? "sync" : "async");
|
||||
|
||||
if (pci_dual) {
|
||||
printf (" PCI2: 32 bit, 66 MHz, %s\n",
|
||||
pci2_clk_sel ? "sync" : "async");
|
||||
} else {
|
||||
printf (" PCI2: disabled\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize local bus.
|
||||
*/
|
||||
local_bus_init ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int
|
||||
initdram(int board_type)
|
||||
{
|
||||
long dram_size = 0;
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
|
||||
puts("Initializing\n");
|
||||
|
||||
#if defined(CONFIG_DDR_DLL)
|
||||
{
|
||||
/*
|
||||
* Work around to stabilize DDR DLL MSYNC_IN.
|
||||
* Errata DDR9 seems to have been fixed.
|
||||
* This is now the workaround for Errata DDR11:
|
||||
* Override DLL = 1, Course Adj = 1, Tap Select = 0
|
||||
*/
|
||||
|
||||
volatile ccsr_gur_t *gur= &immap->im_gur;
|
||||
|
||||
gur->ddrdllcr = 0x81000000;
|
||||
asm("sync;isync;msync");
|
||||
udelay(200);
|
||||
}
|
||||
#endif
|
||||
dram_size = spd_sdram();
|
||||
|
||||
#if defined(CONFIG_DDR_ECC)
|
||||
/*
|
||||
* Initialize and enable DDR ECC.
|
||||
*/
|
||||
ddr_enable_ecc(dram_size);
|
||||
#endif
|
||||
/*
|
||||
* SDRAM Initialization
|
||||
*/
|
||||
sdram_init();
|
||||
|
||||
puts(" DDR: ");
|
||||
return dram_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize Local Bus
|
||||
*/
|
||||
void
|
||||
local_bus_init(void)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||
volatile ccsr_lbc_t *lbc = &immap->im_lbc;
|
||||
|
||||
uint clkdiv;
|
||||
uint lbc_hz;
|
||||
sys_info_t sysinfo;
|
||||
uint temp_lbcdll;
|
||||
|
||||
/*
|
||||
* Errata LBC11.
|
||||
* Fix Local Bus clock glitch when DLL is enabled.
|
||||
*
|
||||
* If localbus freq is < 66Mhz, DLL bypass mode must be used.
|
||||
* If localbus freq is > 133Mhz, DLL can be safely enabled.
|
||||
* Between 66 and 133, the DLL is enabled with an override workaround.
|
||||
*/
|
||||
|
||||
get_sys_info(&sysinfo);
|
||||
clkdiv = lbc->lcrr & 0x0f;
|
||||
lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv;
|
||||
|
||||
if (lbc_hz < 66) {
|
||||
lbc->lcrr |= 0x80000000; /* DLL Bypass */
|
||||
|
||||
} else if (lbc_hz >= 133) {
|
||||
lbc->lcrr &= (~0x80000000); /* DLL Enabled */
|
||||
|
||||
} else {
|
||||
lbc->lcrr &= (~0x8000000); /* DLL Enabled */
|
||||
udelay(200);
|
||||
|
||||
/*
|
||||
* Sample LBC DLL ctrl reg, upshift it to set the
|
||||
* override bits.
|
||||
*/
|
||||
temp_lbcdll = gur->lbcdllcr;
|
||||
gur->lbcdllcr = (((temp_lbcdll & 0xff) << 16) | 0x80000000);
|
||||
asm("sync;isync;msync");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize SDRAM memory on the Local Bus.
|
||||
*/
|
||||
void
|
||||
sdram_init(void)
|
||||
{
|
||||
#if defined(CFG_OR2_PRELIM) && defined(CFG_BR2_PRELIM)
|
||||
|
||||
uint idx;
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile ccsr_lbc_t *lbc = &immap->im_lbc;
|
||||
uint *sdram_addr = (uint *)CFG_LBC_SDRAM_BASE;
|
||||
uint cpu_board_rev;
|
||||
uint lsdmr_common;
|
||||
|
||||
puts(" SDRAM: ");
|
||||
|
||||
print_size (CFG_LBC_SDRAM_SIZE * 1024 * 1024, "\n");
|
||||
|
||||
/*
|
||||
* Setup SDRAM Base and Option Registers
|
||||
*/
|
||||
lbc->or2 = CFG_OR2_PRELIM;
|
||||
asm("msync");
|
||||
|
||||
lbc->br2 = CFG_BR2_PRELIM;
|
||||
asm("msync");
|
||||
|
||||
lbc->lbcr = CFG_LBC_LBCR;
|
||||
asm("msync");
|
||||
|
||||
lbc->lsrt = CFG_LBC_LSRT;
|
||||
lbc->mrtpr = CFG_LBC_MRTPR;
|
||||
asm("msync");
|
||||
|
||||
/*
|
||||
* Determine which address lines to use baed on CPU board rev.
|
||||
*/
|
||||
cpu_board_rev = get_cpu_board_revision();
|
||||
lsdmr_common = CFG_LBC_LSDMR_COMMON;
|
||||
if (cpu_board_rev == MPC85XX_CPU_BOARD_REV_1_0) {
|
||||
lsdmr_common |= CFG_LBC_LSDMR_BSMA1617;
|
||||
} else if (cpu_board_rev == MPC85XX_CPU_BOARD_REV_1_1) {
|
||||
lsdmr_common |= CFG_LBC_LSDMR_BSMA1516;
|
||||
} else {
|
||||
/*
|
||||
* Assume something unable to identify itself is
|
||||
* really old, and likely has lines 16/17 mapped.
|
||||
*/
|
||||
lsdmr_common |= CFG_LBC_LSDMR_BSMA1617;
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue PRECHARGE ALL command.
|
||||
*/
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_PCHALL;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(100);
|
||||
|
||||
/*
|
||||
* Issue 8 AUTO REFRESH commands.
|
||||
*/
|
||||
for (idx = 0; idx < 8; idx++) {
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_ARFRSH;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue 8 MODE-set command.
|
||||
*/
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_MRW;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(100);
|
||||
|
||||
/*
|
||||
* Issue NORMAL OP command.
|
||||
*/
|
||||
lbc->lsdmr = lsdmr_common | CFG_LBC_LSDMR_OP_NORMAL;
|
||||
asm("sync;msync");
|
||||
*sdram_addr = 0xff;
|
||||
ppcDcbf((unsigned long) sdram_addr);
|
||||
udelay(200); /* Overkill. Must wait > 200 bus cycles */
|
||||
|
||||
#endif /* enable SDRAM init */
|
||||
}
|
||||
|
||||
#if defined(CFG_DRAM_TEST)
|
||||
int
|
||||
testdram(void)
|
||||
{
|
||||
uint *pstart = (uint *) CFG_MEMTEST_START;
|
||||
uint *pend = (uint *) CFG_MEMTEST_END;
|
||||
uint *p;
|
||||
|
||||
printf("Testing DRAM from 0x%08x to 0x%08x\n",
|
||||
CFG_MEMTEST_START,
|
||||
CFG_MEMTEST_END);
|
||||
|
||||
printf("DRAM test phase 1:\n");
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0xaaaaaaaa;
|
||||
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0xaaaaaaaa) {
|
||||
printf ("DRAM test fails at: %08x\n", (uint) p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("DRAM test phase 2:\n");
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0x55555555;
|
||||
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0x55555555) {
|
||||
printf ("DRAM test fails at: %08x\n", (uint) p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("DRAM test passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
|
||||
/*
|
||||
* Initialize PCI Devices, report devices found.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
static struct pci_config_table pci_mpc85xxcds_config_table[] = {
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_IDSEL_NUMBER, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
|
||||
PCI_ENET0_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
|
||||
} },
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct pci_controller hose = {
|
||||
#ifndef CONFIG_PCI_PNP
|
||||
config_table: pci_mpc85xxcds_config_table,
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
void
|
||||
pci_init_board(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
extern void pci_mpc85xx_init(struct pci_controller *hose);
|
||||
|
||||
pci_mpc85xx_init(&hose);
|
||||
#endif
|
||||
}
|
||||
147
board/cds/mpc8555cds/u-boot.lds
Normal file
147
board/cds/mpc8555cds/u-boot.lds
Normal file
@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
board/cds/mpc8555cds/init.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
board/cds/mpc8555cds/init.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
cpu/mpc85xx/tsec.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/pci.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := cerf250.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
SOBJS := lowlevel_init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -42,7 +42,7 @@ int board_init (void)
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* arch number of cerf PXA Board */
|
||||
gd->bd->bi_arch_number = 139;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_PXA_CERF;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0xa0000100;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
*
|
||||
* NOTE: I haven't clean this up considerably, just enough to get it
|
||||
* running. See hal_platform_setup.h for the source. See
|
||||
* board/cradle/memsetup.S for another PXA250 setup that is
|
||||
* board/cradle/lowlevel_init.S for another PXA250 setup that is
|
||||
* much cleaner.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@ -43,8 +43,8 @@ DRAM_SIZE: .long CFG_DRAM_SIZE
|
||||
* Memory setup
|
||||
*/
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
/* Set up GPIO pins first ----------------------------------------- */
|
||||
|
||||
@ -403,9 +403,9 @@ initclks:
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* End memsetup */
|
||||
/* End lowlevel_init */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
endmemsetup:
|
||||
endlowlevel_init:
|
||||
|
||||
mov pc, lr
|
||||
46
board/cmc_pu2/Makefile
Normal file
46
board/cmc_pu2/Makefile
Normal file
@ -0,0 +1,46 @@
|
||||
#
|
||||
# (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 := cmc_pu2.o at45.o dm9161.o flash.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
621
board/cmc_pu2/at45.c
Normal file
621
board/cmc_pu2/at45.c
Normal file
@ -0,0 +1,621 @@
|
||||
/* Driver for ATMEL DataFlash support
|
||||
* Author : Hamid Ikdoumi (Atmel)
|
||||
*
|
||||
* 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 <common.h>
|
||||
#include <asm/hardware.h>
|
||||
|
||||
#ifdef CONFIG_HAS_DATAFLASH
|
||||
#include <dataflash.h>
|
||||
|
||||
#define AT91C_SPI_CLK 10000000 /* Max Value = 10MHz to be compliant to
|
||||
the Continuous Array Read function */
|
||||
|
||||
/* AC Characteristics */
|
||||
/* DLYBS = tCSS = 250ns min and DLYBCT = tCSH = 250ns */
|
||||
#define DATAFLASH_TCSS (0xC << 16)
|
||||
#define DATAFLASH_TCHS (0x1 << 24)
|
||||
|
||||
#define AT91C_TIMEOUT_WRDY 200000
|
||||
#define AT91C_SPI_PCS0_SERIAL_DATAFLASH 0xE /* Chip Select 0 : NPCS0 %1110 */
|
||||
#define AT91C_SPI_PCS3_DATAFLASH_CARD 0x7 /* Chip Select 3 : NPCS3 %0111 */
|
||||
|
||||
void AT91F_SpiInit(void) {
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
/* SPI DataFlash Init */
|
||||
/*-------------------------------------------------------------------*/
|
||||
/* Configure PIOs */
|
||||
AT91C_BASE_PIOA->PIO_ASR = AT91C_PA3_NPCS0 | AT91C_PA4_NPCS1 | AT91C_PA1_MOSI | AT91C_PA5_NPCS2 |
|
||||
AT91C_PA6_NPCS3 | AT91C_PA0_MISO | AT91C_PA2_SPCK;
|
||||
AT91C_BASE_PIOA->PIO_PDR = AT91C_PA3_NPCS0 | AT91C_PA4_NPCS1 | AT91C_PA1_MOSI | AT91C_PA5_NPCS2 |
|
||||
AT91C_PA6_NPCS3 | AT91C_PA0_MISO | AT91C_PA2_SPCK;
|
||||
/* Enable CLock */
|
||||
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SPI;
|
||||
|
||||
/* Reset the SPI */
|
||||
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SWRST;
|
||||
|
||||
/* Configure SPI in Master Mode with No CS selected !!! */
|
||||
AT91C_BASE_SPI->SPI_MR = AT91C_SPI_MSTR | AT91C_SPI_MODFDIS | AT91C_SPI_PCS;
|
||||
|
||||
/* Configure CS0 and CS3 */
|
||||
*(AT91C_SPI_CSR + 0) = AT91C_SPI_CPOL | (AT91C_SPI_DLYBS & DATAFLASH_TCSS) | (AT91C_SPI_DLYBCT &
|
||||
DATAFLASH_TCHS) | ((AT91C_MASTER_CLOCK / (2*AT91C_SPI_CLK)) << 8);
|
||||
|
||||
*(AT91C_SPI_CSR + 3) = AT91C_SPI_CPOL | (AT91C_SPI_DLYBS & DATAFLASH_TCSS) | (AT91C_SPI_DLYBCT &
|
||||
DATAFLASH_TCHS) | ((AT91C_MASTER_CLOCK / (2*AT91C_SPI_CLK)) << 8);
|
||||
|
||||
}
|
||||
|
||||
void AT91F_SpiEnable(int cs) {
|
||||
switch(cs) {
|
||||
case 0: /* Configure SPI CS0 for Serial DataFlash AT45DBxx */
|
||||
AT91C_BASE_SPI->SPI_MR &= 0xFFF0FFFF;
|
||||
AT91C_BASE_SPI->SPI_MR |= ((AT91C_SPI_PCS0_SERIAL_DATAFLASH<<16) & AT91C_SPI_PCS);
|
||||
break;
|
||||
case 3: /* Configure SPI CS3 for Serial DataFlash Card */
|
||||
/* Set up PIO SDC_TYPE to switch on DataFlash Card and not MMC/SDCard */
|
||||
AT91C_BASE_PIOB->PIO_PER = AT91C_PIO_PB7; /* Set in PIO mode */
|
||||
AT91C_BASE_PIOB->PIO_OER = AT91C_PIO_PB7; /* Configure in output */
|
||||
/* Clear Output */
|
||||
AT91C_BASE_PIOB->PIO_CODR = AT91C_PIO_PB7;
|
||||
/* Configure PCS */
|
||||
AT91C_BASE_SPI->SPI_MR &= 0xFFF0FFFF;
|
||||
AT91C_BASE_SPI->SPI_MR |= ((AT91C_SPI_PCS3_DATAFLASH_CARD<<16) & AT91C_SPI_PCS);
|
||||
break;
|
||||
}
|
||||
|
||||
/* SPI_Enable */
|
||||
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SPIEN;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* \fn AT91F_SpiWrite */
|
||||
/* \brief Set the PDC registers for a transfert */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
unsigned int AT91F_SpiWrite ( AT91PS_DataflashDesc pDesc )
|
||||
{
|
||||
unsigned int timeout;
|
||||
|
||||
pDesc->state = BUSY;
|
||||
|
||||
AT91C_BASE_SPI->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
|
||||
|
||||
/* Initialize the Transmit and Receive Pointer */
|
||||
AT91C_BASE_SPI->SPI_RPR = (unsigned int)pDesc->rx_cmd_pt ;
|
||||
AT91C_BASE_SPI->SPI_TPR = (unsigned int)pDesc->tx_cmd_pt ;
|
||||
|
||||
/* Intialize the Transmit and Receive Counters */
|
||||
AT91C_BASE_SPI->SPI_RCR = pDesc->rx_cmd_size;
|
||||
AT91C_BASE_SPI->SPI_TCR = pDesc->tx_cmd_size;
|
||||
|
||||
if ( pDesc->tx_data_size != 0 ) {
|
||||
/* Initialize the Next Transmit and Next Receive Pointer */
|
||||
AT91C_BASE_SPI->SPI_RNPR = (unsigned int)pDesc->rx_data_pt ;
|
||||
AT91C_BASE_SPI->SPI_TNPR = (unsigned int)pDesc->tx_data_pt ;
|
||||
|
||||
/* Intialize the Next Transmit and Next Receive Counters */
|
||||
AT91C_BASE_SPI->SPI_RNCR = pDesc->rx_data_size ;
|
||||
AT91C_BASE_SPI->SPI_TNCR = pDesc->tx_data_size ;
|
||||
}
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked();
|
||||
timeout = 0;
|
||||
|
||||
AT91C_BASE_SPI->SPI_PTCR = AT91C_PDC_TXTEN + AT91C_PDC_RXTEN;
|
||||
while(!(AT91C_BASE_SPI->SPI_SR & AT91C_SPI_RXBUFF) && ((timeout = get_timer_masked() ) < CFG_SPI_WRITE_TOUT));
|
||||
AT91C_BASE_SPI->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
|
||||
pDesc->state = IDLE;
|
||||
|
||||
if (timeout >= CFG_SPI_WRITE_TOUT){
|
||||
printf("Error Timeout\n\r");
|
||||
return DATAFLASH_ERROR;
|
||||
}
|
||||
|
||||
return DATAFLASH_OK;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* \fn AT91F_DataFlashSendCommand */
|
||||
/* \brief Generic function to send a command to the dataflash */
|
||||
/*----------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashSendCommand(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char OpCode,
|
||||
unsigned int CmdSize,
|
||||
unsigned int DataflashAddress)
|
||||
{
|
||||
unsigned int adr;
|
||||
|
||||
if ( (pDataFlash->pDataFlashDesc->state) != IDLE)
|
||||
return DATAFLASH_BUSY;
|
||||
|
||||
/* process the address to obtain page address and byte address */
|
||||
adr = ((DataflashAddress / (pDataFlash->pDevice->pages_size)) << pDataFlash->pDevice->page_offset) + (DataflashAddress % (pDataFlash->pDevice->pages_size));
|
||||
|
||||
/* fill the command buffer */
|
||||
pDataFlash->pDataFlashDesc->command[0] = OpCode;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384) {
|
||||
pDataFlash->pDataFlashDesc->command[1] = (unsigned char)((adr & 0x0F000000) >> 24);
|
||||
pDataFlash->pDataFlashDesc->command[2] = (unsigned char)((adr & 0x00FF0000) >> 16);
|
||||
pDataFlash->pDataFlashDesc->command[3] = (unsigned char)((adr & 0x0000FF00) >> 8);
|
||||
pDataFlash->pDataFlashDesc->command[4] = (unsigned char)(adr & 0x000000FF);
|
||||
} else {
|
||||
pDataFlash->pDataFlashDesc->command[1] = (unsigned char)((adr & 0x00FF0000) >> 16);
|
||||
pDataFlash->pDataFlashDesc->command[2] = (unsigned char)((adr & 0x0000FF00) >> 8);
|
||||
pDataFlash->pDataFlashDesc->command[3] = (unsigned char)(adr & 0x000000FF) ;
|
||||
pDataFlash->pDataFlashDesc->command[4] = 0;
|
||||
}
|
||||
pDataFlash->pDataFlashDesc->command[5] = 0;
|
||||
pDataFlash->pDataFlashDesc->command[6] = 0;
|
||||
pDataFlash->pDataFlashDesc->command[7] = 0;
|
||||
|
||||
/* Initialize the SpiData structure for the spi write fuction */
|
||||
pDataFlash->pDataFlashDesc->tx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
pDataFlash->pDataFlashDesc->tx_cmd_size = CmdSize ;
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_size = CmdSize ;
|
||||
|
||||
/* send the command and read the data */
|
||||
return AT91F_SpiWrite (pDataFlash->pDataFlashDesc);
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* \fn AT91F_DataFlashGetStatus */
|
||||
/* \brief Read the status register of the dataflash */
|
||||
/*----------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashGetStatus(AT91PS_DataflashDesc pDesc)
|
||||
{
|
||||
AT91S_DataFlashStatus status;
|
||||
|
||||
/* if a transfert is in progress ==> return 0 */
|
||||
if( (pDesc->state) != IDLE)
|
||||
return DATAFLASH_BUSY;
|
||||
|
||||
/* first send the read status command (D7H) */
|
||||
pDesc->command[0] = DB_STATUS;
|
||||
pDesc->command[1] = 0;
|
||||
|
||||
pDesc->DataFlash_state = GET_STATUS;
|
||||
pDesc->tx_data_size = 0 ; /* Transmit the command and receive response */
|
||||
pDesc->tx_cmd_pt = pDesc->command ;
|
||||
pDesc->rx_cmd_pt = pDesc->command ;
|
||||
pDesc->rx_cmd_size = 2 ;
|
||||
pDesc->tx_cmd_size = 2 ;
|
||||
status = AT91F_SpiWrite (pDesc);
|
||||
|
||||
pDesc->DataFlash_state = *( (unsigned char *) (pDesc->rx_cmd_pt) +1);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* \fn AT91F_DataFlashWaitReady */
|
||||
/* \brief wait for dataflash ready (bit7 of the status register == 1) */
|
||||
/*----------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashWaitReady(AT91PS_DataflashDesc pDataFlashDesc, unsigned int timeout)
|
||||
{
|
||||
pDataFlashDesc->DataFlash_state = IDLE;
|
||||
|
||||
do {
|
||||
AT91F_DataFlashGetStatus(pDataFlashDesc);
|
||||
timeout--;
|
||||
} while( ((pDataFlashDesc->DataFlash_state & 0x80) != 0x80) && (timeout > 0) );
|
||||
|
||||
if((pDataFlashDesc->DataFlash_state & 0x80) != 0x80)
|
||||
return DATAFLASH_ERROR;
|
||||
|
||||
return DATAFLASH_OK;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_DataFlashContinuousRead */
|
||||
/* Object : Continuous stream Read */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : <src> = dataflash address */
|
||||
/* : <*dataBuffer> = data buffer pointer */
|
||||
/* : <sizeToRead> = data buffer size */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashContinuousRead (
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
int src,
|
||||
unsigned char *dataBuffer,
|
||||
int sizeToRead )
|
||||
{
|
||||
AT91S_DataFlashStatus status;
|
||||
/* Test the size to read in the device */
|
||||
if ( (src + sizeToRead) > (pDataFlash->pDevice->pages_size * (pDataFlash->pDevice->pages_number)))
|
||||
return DATAFLASH_MEMORY_OVERFLOW;
|
||||
|
||||
pDataFlash->pDataFlashDesc->rx_data_pt = dataBuffer;
|
||||
pDataFlash->pDataFlashDesc->rx_data_size = sizeToRead;
|
||||
pDataFlash->pDataFlashDesc->tx_data_pt = dataBuffer;
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = sizeToRead;
|
||||
|
||||
status = AT91F_DataFlashSendCommand (pDataFlash, DB_CONTINUOUS_ARRAY_READ, 8, src);
|
||||
/* Send the command to the dataflash */
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_DataFlashPagePgmBuf */
|
||||
/* Object : Main memory page program through buffer 1 or buffer 2 */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : <*src> = Source buffer */
|
||||
/* : <dest> = dataflash destination address */
|
||||
/* : <SizeToWrite> = data buffer size */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashPagePgmBuf(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char *src,
|
||||
unsigned int dest,
|
||||
unsigned int SizeToWrite)
|
||||
{
|
||||
int cmdsize;
|
||||
pDataFlash->pDataFlashDesc->tx_data_pt = src ;
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = SizeToWrite ;
|
||||
pDataFlash->pDataFlashDesc->rx_data_pt = src;
|
||||
pDataFlash->pDataFlashDesc->rx_data_size = SizeToWrite;
|
||||
|
||||
cmdsize = 4;
|
||||
/* Send the command to the dataflash */
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
cmdsize = 5;
|
||||
return(AT91F_DataFlashSendCommand (pDataFlash, DB_PAGE_PGM_BUF1, cmdsize, dest));
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_MainMemoryToBufferTransfert */
|
||||
/* Object : Read a page in the SRAM Buffer 1 or 2 */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : Page concerned */
|
||||
/* : */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_MainMemoryToBufferTransfert(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char BufferCommand,
|
||||
unsigned int page)
|
||||
{
|
||||
int cmdsize;
|
||||
/* Test if the buffer command is legal */
|
||||
if ((BufferCommand != DB_PAGE_2_BUF1_TRF) && (BufferCommand != DB_PAGE_2_BUF2_TRF))
|
||||
return DATAFLASH_BAD_COMMAND;
|
||||
|
||||
/* no data to transmit or receive */
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = 0;
|
||||
cmdsize = 4;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
cmdsize = 5;
|
||||
return(AT91F_DataFlashSendCommand (pDataFlash, BufferCommand, cmdsize, page*pDataFlash->pDevice->pages_size));
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------- */
|
||||
/* Function Name : AT91F_DataFlashWriteBuffer */
|
||||
/* Object : Write data to the internal sram buffer 1 or 2 */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : <BufferCommand> = command to write buffer1 or buffer2 */
|
||||
/* : <*dataBuffer> = data buffer to write */
|
||||
/* : <bufferAddress> = address in the internal buffer */
|
||||
/* : <SizeToWrite> = data buffer size */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashWriteBuffer (
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char BufferCommand,
|
||||
unsigned char *dataBuffer,
|
||||
unsigned int bufferAddress,
|
||||
int SizeToWrite )
|
||||
{
|
||||
int cmdsize;
|
||||
/* Test if the buffer command is legal */
|
||||
if ((BufferCommand != DB_BUF1_WRITE) && (BufferCommand != DB_BUF2_WRITE))
|
||||
return DATAFLASH_BAD_COMMAND;
|
||||
|
||||
/* buffer address must be lower than page size */
|
||||
if (bufferAddress > pDataFlash->pDevice->pages_size)
|
||||
return DATAFLASH_BAD_ADDRESS;
|
||||
|
||||
if ( (pDataFlash->pDataFlashDesc->state) != IDLE)
|
||||
return DATAFLASH_BUSY;
|
||||
|
||||
/* Send first Write Command */
|
||||
pDataFlash->pDataFlashDesc->command[0] = BufferCommand;
|
||||
pDataFlash->pDataFlashDesc->command[1] = 0;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384) {
|
||||
pDataFlash->pDataFlashDesc->command[2] = 0;
|
||||
pDataFlash->pDataFlashDesc->command[3] = (unsigned char)(((unsigned int)(bufferAddress & pDataFlash->pDevice->byte_mask)) >> 8) ;
|
||||
pDataFlash->pDataFlashDesc->command[4] = (unsigned char)((unsigned int)bufferAddress & 0x00FF) ;
|
||||
cmdsize = 5;
|
||||
} else {
|
||||
pDataFlash->pDataFlashDesc->command[2] = (unsigned char)(((unsigned int)(bufferAddress & pDataFlash->pDevice->byte_mask)) >> 8) ;
|
||||
pDataFlash->pDataFlashDesc->command[3] = (unsigned char)((unsigned int)bufferAddress & 0x00FF) ;
|
||||
pDataFlash->pDataFlashDesc->command[4] = 0;
|
||||
cmdsize = 4;
|
||||
}
|
||||
|
||||
pDataFlash->pDataFlashDesc->tx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
pDataFlash->pDataFlashDesc->tx_cmd_size = cmdsize ;
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_size = cmdsize ;
|
||||
|
||||
pDataFlash->pDataFlashDesc->rx_data_pt = dataBuffer ;
|
||||
pDataFlash->pDataFlashDesc->tx_data_pt = dataBuffer ;
|
||||
pDataFlash->pDataFlashDesc->rx_data_size = SizeToWrite ;
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = SizeToWrite ;
|
||||
|
||||
return AT91F_SpiWrite(pDataFlash->pDataFlashDesc);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_PageErase */
|
||||
/* Object : Erase a page */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : Page concerned */
|
||||
/* : */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_PageErase(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned int page)
|
||||
{
|
||||
int cmdsize;
|
||||
/* Test if the buffer command is legal */
|
||||
/* no data to transmit or receive */
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = 0;
|
||||
|
||||
cmdsize = 4;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
cmdsize = 5;
|
||||
return(AT91F_DataFlashSendCommand (pDataFlash, DB_PAGE_ERASE, cmdsize, page*pDataFlash->pDevice->pages_size));
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_BlockErase */
|
||||
/* Object : Erase a Block */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : Page concerned */
|
||||
/* : */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_BlockErase(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned int block)
|
||||
{
|
||||
int cmdsize;
|
||||
/* Test if the buffer command is legal */
|
||||
/* no data to transmit or receive */
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = 0;
|
||||
cmdsize = 4;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
cmdsize = 5;
|
||||
return(AT91F_DataFlashSendCommand (pDataFlash, DB_BLOCK_ERASE,cmdsize, block*8*pDataFlash->pDevice->pages_size));
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_WriteBufferToMain */
|
||||
/* Object : Write buffer to the main memory */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : <BufferCommand> = command to send to buffer1 or buffer2 */
|
||||
/* : <dest> = main memory address */
|
||||
/* Return value : State of the dataflash */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_WriteBufferToMain (
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char BufferCommand,
|
||||
unsigned int dest )
|
||||
{
|
||||
int cmdsize;
|
||||
/* Test if the buffer command is correct */
|
||||
if ((BufferCommand != DB_BUF1_PAGE_PGM) &&
|
||||
(BufferCommand != DB_BUF1_PAGE_ERASE_PGM) &&
|
||||
(BufferCommand != DB_BUF2_PAGE_PGM) &&
|
||||
(BufferCommand != DB_BUF2_PAGE_ERASE_PGM) )
|
||||
return DATAFLASH_BAD_COMMAND;
|
||||
|
||||
/* no data to transmit or receive */
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = 0;
|
||||
|
||||
cmdsize = 4;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
cmdsize = 5;
|
||||
/* Send the command to the dataflash */
|
||||
return(AT91F_DataFlashSendCommand (pDataFlash, BufferCommand, cmdsize, dest));
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_PartialPageWrite */
|
||||
/* Object : Erase partielly a page */
|
||||
/* Input Parameters : <page> = page number */
|
||||
/* : <AdrInpage> = adr to begin the fading */
|
||||
/* : <length> = Number of bytes to erase */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_PartialPageWrite (
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char *src,
|
||||
unsigned int dest,
|
||||
unsigned int size)
|
||||
{
|
||||
unsigned int page;
|
||||
unsigned int AdrInPage;
|
||||
|
||||
page = dest / (pDataFlash->pDevice->pages_size);
|
||||
AdrInPage = dest % (pDataFlash->pDevice->pages_size);
|
||||
|
||||
/* Read the contents of the page in the Sram Buffer */
|
||||
AT91F_MainMemoryToBufferTransfert(pDataFlash, DB_PAGE_2_BUF1_TRF, page);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
/*Update the SRAM buffer */
|
||||
AT91F_DataFlashWriteBuffer(pDataFlash, DB_BUF1_WRITE, src, AdrInPage, size);
|
||||
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
|
||||
/* Erase page if a 128 Mbits device */
|
||||
if (pDataFlash->pDevice->pages_number >= 16384) {
|
||||
AT91F_PageErase(pDataFlash, page);
|
||||
/* Rewrite the modified Sram Buffer in the main memory */
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
}
|
||||
|
||||
/* Rewrite the modified Sram Buffer in the main memory */
|
||||
return(AT91F_WriteBufferToMain(pDataFlash, DB_BUF1_PAGE_ERASE_PGM, (page*pDataFlash->pDevice->pages_size)));
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_DataFlashWrite */
|
||||
/* Object : */
|
||||
/* Input Parameters : <*src> = Source buffer */
|
||||
/* : <dest> = dataflash adress */
|
||||
/* : <size> = data buffer size */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
AT91S_DataFlashStatus AT91F_DataFlashWrite(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned char *src,
|
||||
int dest,
|
||||
int size )
|
||||
{
|
||||
unsigned int length;
|
||||
unsigned int page;
|
||||
unsigned int status;
|
||||
|
||||
AT91F_SpiEnable(pDataFlash->pDevice->cs);
|
||||
|
||||
if ( (dest + size) > (pDataFlash->pDevice->pages_size * (pDataFlash->pDevice->pages_number)))
|
||||
return DATAFLASH_MEMORY_OVERFLOW;
|
||||
|
||||
/* If destination does not fit a page start address */
|
||||
if ((dest % ((unsigned int)(pDataFlash->pDevice->pages_size))) != 0 ) {
|
||||
length = pDataFlash->pDevice->pages_size - (dest % ((unsigned int)(pDataFlash->pDevice->pages_size)));
|
||||
|
||||
if (size < length)
|
||||
length = size;
|
||||
|
||||
if(!AT91F_PartialPageWrite(pDataFlash,src, dest, length))
|
||||
return DATAFLASH_ERROR;
|
||||
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
|
||||
/* Update size, source and destination pointers */
|
||||
size -= length;
|
||||
dest += length;
|
||||
src += length;
|
||||
}
|
||||
|
||||
while (( size - pDataFlash->pDevice->pages_size ) >= 0 ) {
|
||||
/* program dataflash page */
|
||||
page = (unsigned int)dest / (pDataFlash->pDevice->pages_size);
|
||||
|
||||
status = AT91F_DataFlashWriteBuffer(pDataFlash, DB_BUF1_WRITE, src, 0, pDataFlash->pDevice->pages_size);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
|
||||
status = AT91F_PageErase(pDataFlash, page);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
if (!status)
|
||||
return DATAFLASH_ERROR;
|
||||
|
||||
status = AT91F_WriteBufferToMain (pDataFlash, DB_BUF1_PAGE_PGM, dest);
|
||||
if(!status)
|
||||
return DATAFLASH_ERROR;
|
||||
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
|
||||
/* Update size, source and destination pointers */
|
||||
size -= pDataFlash->pDevice->pages_size ;
|
||||
dest += pDataFlash->pDevice->pages_size ;
|
||||
src += pDataFlash->pDevice->pages_size ;
|
||||
}
|
||||
|
||||
/* If still some bytes to read */
|
||||
if ( size > 0 ) {
|
||||
/* program dataflash page */
|
||||
if(!AT91F_PartialPageWrite(pDataFlash, src, dest, size) )
|
||||
return DATAFLASH_ERROR;
|
||||
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY);
|
||||
}
|
||||
return DATAFLASH_OK;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_DataFlashRead */
|
||||
/* Object : Read a block in dataflash */
|
||||
/* Input Parameters : */
|
||||
/* Return value : */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int AT91F_DataFlashRead(
|
||||
AT91PS_DataFlash pDataFlash,
|
||||
unsigned long addr,
|
||||
unsigned long size,
|
||||
char *buffer)
|
||||
{
|
||||
unsigned long SizeToRead;
|
||||
|
||||
AT91F_SpiEnable(pDataFlash->pDevice->cs);
|
||||
|
||||
if(AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY) != DATAFLASH_OK)
|
||||
return -1;
|
||||
|
||||
while (size) {
|
||||
SizeToRead = (size < 0x8000)? size:0x8000;
|
||||
|
||||
if (AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_TIMEOUT_WRDY) != DATAFLASH_OK)
|
||||
return -1;
|
||||
|
||||
if (AT91F_DataFlashContinuousRead (pDataFlash, addr, buffer, SizeToRead) != DATAFLASH_OK)
|
||||
return -1;
|
||||
|
||||
size -= SizeToRead;
|
||||
addr += SizeToRead;
|
||||
buffer += SizeToRead;
|
||||
}
|
||||
|
||||
return DATAFLASH_OK;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_DataflashProbe */
|
||||
/* Object : */
|
||||
/* Input Parameters : */
|
||||
/* Return value : Dataflash status register */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int AT91F_DataflashProbe(int cs, AT91PS_DataflashDesc pDesc)
|
||||
{
|
||||
AT91F_SpiEnable(cs);
|
||||
AT91F_DataFlashGetStatus(pDesc);
|
||||
return((pDesc->command[1] == 0xFF)? 0: pDesc->command[1] & 0x3C);
|
||||
}
|
||||
|
||||
#endif
|
||||
141
board/cmc_pu2/cmc_pu2.c
Normal file
141
board/cmc_pu2/cmc_pu2.c
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* Modified for CMC_PU2 (removed Smart Media support) by Gary Jennejohn
|
||||
* (2004) garyj@denx.de
|
||||
*
|
||||
* Modified for CMC_BASIC by Martin Krause (2005), TQ-Systems GmbH
|
||||
*
|
||||
* 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/mach-types.h>
|
||||
#include <asm/arch/AT91RM9200.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/*
|
||||
* Miscelaneous platform dependent initialisations
|
||||
*/
|
||||
#define CMC_BASIC 1
|
||||
#define CMC_PU2 2
|
||||
|
||||
int hw_detect (void);
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
AT91PS_PIO piob = AT91C_BASE_PIOB;
|
||||
AT91PS_PIO pioc = AT91C_BASE_PIOC;
|
||||
|
||||
/* Enable Ctrlc */
|
||||
console_init_f ();
|
||||
|
||||
/* Correct IRDA resistor problem */
|
||||
/* Set PA23_TXD in Output */
|
||||
/* (AT91PS_PIO) AT91C_BASE_PIOA->PIO_OER = AT91C_PA23_TXD2; */
|
||||
|
||||
/* memory and cpu-speed are setup before relocation */
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* PIOB and PIOC clock enabling */
|
||||
*AT91C_PMC_PCER = 1 << AT91C_ID_PIOB;
|
||||
*AT91C_PMC_PCER = 1 << AT91C_ID_PIOC;
|
||||
|
||||
/*
|
||||
* configure PC0-PC3 as input without pull ups, so RS485 driver enable
|
||||
* (CMC-PU2) and digital outputs (CMC-BASIC) are deactivated.
|
||||
*/
|
||||
pioc->PIO_ODR = AT91C_PIO_PC0 | AT91C_PIO_PC1 |
|
||||
AT91C_PIO_PC2 | AT91C_PIO_PC3;
|
||||
pioc->PIO_PPUDR = AT91C_PIO_PC0 | AT91C_PIO_PC1 |
|
||||
AT91C_PIO_PC2 | AT91C_PIO_PC3;
|
||||
pioc->PIO_PER = AT91C_PIO_PC0 | AT91C_PIO_PC1 |
|
||||
AT91C_PIO_PC2 | AT91C_PIO_PC3;
|
||||
|
||||
/*
|
||||
* On CMC-PU2 board configure PB3-PB6 to input without pull ups to
|
||||
* clear the duo LEDs (the external pull downs assure a proper
|
||||
* signal). On CMC-BASIC set PB3-PB6 to output and drive it
|
||||
* high, to configure current meassurement on AINx.
|
||||
*/
|
||||
if (hw_detect() & CMC_PU2) {
|
||||
piob->PIO_ODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
||||
}
|
||||
else if (hw_detect() & CMC_BASIC) {
|
||||
piob->PIO_SODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
||||
piob->PIO_OER = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
||||
}
|
||||
piob->PIO_PPUDR = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
||||
piob->PIO_PER = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
||||
|
||||
/*
|
||||
* arch number of CMC_PU2-Board. MACH_TYPE_CMC_PU2 is not supported in
|
||||
* the linuxarm kernel, yet.
|
||||
*/
|
||||
/* gd->bd->bi_arch_number = MACH_TYPE_CMC_PU2; */
|
||||
gd->bd->bi_arch_number = 251;
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dram_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
if (hw_detect() & CMC_PU2)
|
||||
puts ("Board: CMC-PU2 (Rittal GmbH)\n");
|
||||
else if (hw_detect() & CMC_BASIC)
|
||||
puts ("Board: CMC-BASIC (Rittal GmbH)\n");
|
||||
else
|
||||
puts ("Board: unknown\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hw_detect (void)
|
||||
{
|
||||
AT91PS_PIO pio = AT91C_BASE_PIOB;
|
||||
|
||||
/* PIOB clock enabling */
|
||||
*AT91C_PMC_PCER = 1 << AT91C_ID_PIOB;
|
||||
|
||||
/* configure PB12 as input without pull up */
|
||||
pio->PIO_ODR = AT91C_PIO_PB12;
|
||||
pio->PIO_PPUDR = AT91C_PIO_PB12;
|
||||
pio->PIO_PER = AT91C_PIO_PB12;
|
||||
|
||||
/* read board identification pin */
|
||||
return ((pio->PIO_PDSR & AT91C_PIO_PB12) ? CMC_PU2 : CMC_BASIC);
|
||||
}
|
||||
3
board/cmc_pu2/config.mk
Normal file
3
board/cmc_pu2/config.mk
Normal file
@ -0,0 +1,3 @@
|
||||
TEXT_BASE = 0x20F00000
|
||||
## For testing: load at 0x20100000 and "go" at 0x201000A4
|
||||
#TEXT_BASE = 0x20100000
|
||||
243
board/cmc_pu2/dm9161.c
Normal file
243
board/cmc_pu2/dm9161.c
Normal file
@ -0,0 +1,243 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Author : Hamid Ikdoumi (Atmel)
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <at91rm9200_net.h>
|
||||
#include <net.h>
|
||||
#include <dm9161.h>
|
||||
|
||||
#ifdef CONFIG_DRIVER_ETHER
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_IsPhyConnected
|
||||
* Description:
|
||||
* Reads the 2 PHY ID registers
|
||||
* Arguments:
|
||||
* p_mac - pointer to AT91S_EMAC struct
|
||||
* Return value:
|
||||
* TRUE - if id read successfully
|
||||
* FALSE- if error
|
||||
*/
|
||||
static unsigned int dm9161_IsPhyConnected (AT91PS_EMAC p_mac)
|
||||
{
|
||||
unsigned short Id1, Id2;
|
||||
|
||||
at91rm9200_EmacEnableMDIO (p_mac);
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_PHYID1, &Id1);
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_PHYID2, &Id2);
|
||||
at91rm9200_EmacDisableMDIO (p_mac);
|
||||
|
||||
if ((Id1 == (DM9161_PHYID1_OUI >> 6)) &&
|
||||
((Id2 >> 10) == (DM9161_PHYID1_OUI & DM9161_LSB_MASK)))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_GetLinkSpeed
|
||||
* Description:
|
||||
* Link parallel detection status of MAC is checked and set in the
|
||||
* MAC configuration registers
|
||||
* Arguments:
|
||||
* p_mac - pointer to MAC
|
||||
* Return value:
|
||||
* TRUE - if link status set succesfully
|
||||
* FALSE - if link status not set
|
||||
*/
|
||||
static UCHAR dm9161_GetLinkSpeed (AT91PS_EMAC p_mac)
|
||||
{
|
||||
unsigned short stat1, stat2;
|
||||
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_BMSR, &stat1))
|
||||
return FALSE;
|
||||
|
||||
if (!(stat1 & DM9161_LINK_STATUS)) /* link status up? */
|
||||
return FALSE;
|
||||
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_DSCSR, &stat2))
|
||||
return FALSE;
|
||||
|
||||
if ((stat1 & DM9161_100BASE_TX_FD) && (stat2 & DM9161_100FDX)) {
|
||||
/*set Emac for 100BaseTX and Full Duplex */
|
||||
p_mac->EMAC_CFG |= AT91C_EMAC_SPD | AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((stat1 & DM9161_10BASE_T_FD) && (stat2 & DM9161_10FDX)) {
|
||||
/*set MII for 10BaseT and Full Duplex */
|
||||
p_mac->EMAC_CFG = (p_mac->EMAC_CFG &
|
||||
~(AT91C_EMAC_SPD | AT91C_EMAC_FD))
|
||||
| AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((stat1 & DM9161_100BASE_T4_HD) && (stat2 & DM9161_100HDX)) {
|
||||
/*set MII for 100BaseTX and Half Duplex */
|
||||
p_mac->EMAC_CFG = (p_mac->EMAC_CFG &
|
||||
~(AT91C_EMAC_SPD | AT91C_EMAC_FD))
|
||||
| AT91C_EMAC_SPD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((stat1 & DM9161_10BASE_T_HD) && (stat2 & DM9161_10HDX)) {
|
||||
/*set MII for 10BaseT and Half Duplex */
|
||||
p_mac->EMAC_CFG &= ~(AT91C_EMAC_SPD | AT91C_EMAC_FD);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_InitPhy
|
||||
* Description:
|
||||
* MAC starts checking its link by using parallel detection and
|
||||
* Autonegotiation and the same is set in the MAC configuration registers
|
||||
* Arguments:
|
||||
* p_mac - pointer to struct AT91S_EMAC
|
||||
* Return value:
|
||||
* TRUE - if link status set succesfully
|
||||
* FALSE - if link status not set
|
||||
*/
|
||||
static UCHAR dm9161_InitPhy (AT91PS_EMAC p_mac)
|
||||
{
|
||||
UCHAR ret = TRUE;
|
||||
unsigned short IntValue;
|
||||
|
||||
at91rm9200_EmacEnableMDIO (p_mac);
|
||||
|
||||
if (!dm9161_GetLinkSpeed (p_mac)) {
|
||||
/* Try another time */
|
||||
ret = dm9161_GetLinkSpeed (p_mac);
|
||||
}
|
||||
|
||||
/* Disable PHY Interrupts */
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_MDINTR, &IntValue);
|
||||
/* clear FDX, SPD, Link, INTR masks */
|
||||
IntValue &= ~(DM9161_FDX_MASK | DM9161_SPD_MASK |
|
||||
DM9161_LINK_MASK | DM9161_INTR_MASK);
|
||||
at91rm9200_EmacWritePhy (p_mac, DM9161_MDINTR, &IntValue);
|
||||
at91rm9200_EmacDisableMDIO (p_mac);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* dm9161_AutoNegotiate
|
||||
* Description:
|
||||
* MAC Autonegotiates with the partner status of same is set in the
|
||||
* MAC configuration registers
|
||||
* Arguments:
|
||||
* dev - pointer to struct net_device
|
||||
* Return value:
|
||||
* TRUE - if link status set successfully
|
||||
* FALSE - if link status not set
|
||||
*/
|
||||
static UCHAR dm9161_AutoNegotiate (AT91PS_EMAC p_mac, int *status)
|
||||
{
|
||||
unsigned short value;
|
||||
unsigned short PhyAnar;
|
||||
unsigned short PhyAnalpar;
|
||||
|
||||
/* Set dm9161 control register */
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
value &= ~DM9161_AUTONEG; /* remove autonegotiation enable */
|
||||
value |= DM9161_ISOLATE; /* Electrically isolate PHY */
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
|
||||
/* Set the Auto_negotiation Advertisement Register */
|
||||
/* MII advertising for Next page, 100BaseTxFD and HD, 10BaseTFD and HD, IEEE 802.3 */
|
||||
PhyAnar = DM9161_NP | DM9161_TX_FDX | DM9161_TX_HDX |
|
||||
DM9161_10_FDX | DM9161_10_HDX | DM9161_AN_IEEE_802_3;
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_ANAR, &PhyAnar))
|
||||
return FALSE;
|
||||
|
||||
/* Read the Control Register */
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
|
||||
value |= DM9161_SPEED_SELECT | DM9161_AUTONEG | DM9161_DUPLEX_MODE;
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
/* Restart Auto_negotiation */
|
||||
value |= DM9161_RESTART_AUTONEG;
|
||||
if (!at91rm9200_EmacWritePhy (p_mac, DM9161_BMCR, &value))
|
||||
return FALSE;
|
||||
|
||||
/*check AutoNegotiate complete */
|
||||
udelay (10000);
|
||||
at91rm9200_EmacReadPhy (p_mac, DM9161_BMSR, &value);
|
||||
if (!(value & DM9161_AUTONEG_COMP))
|
||||
return FALSE;
|
||||
|
||||
/* Get the AutoNeg Link partner base page */
|
||||
if (!at91rm9200_EmacReadPhy (p_mac, DM9161_ANLPAR, &PhyAnalpar))
|
||||
return FALSE;
|
||||
|
||||
if ((PhyAnar & DM9161_TX_FDX) && (PhyAnalpar & DM9161_TX_FDX)) {
|
||||
/*set MII for 100BaseTX and Full Duplex */
|
||||
p_mac->EMAC_CFG |= AT91C_EMAC_SPD | AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((PhyAnar & DM9161_10_FDX) && (PhyAnalpar & DM9161_10_FDX)) {
|
||||
/*set MII for 10BaseT and Full Duplex */
|
||||
p_mac->EMAC_CFG = (p_mac->EMAC_CFG &
|
||||
~(AT91C_EMAC_SPD | AT91C_EMAC_FD))
|
||||
| AT91C_EMAC_FD;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Name:
|
||||
* at91rm92000_GetPhyInterface
|
||||
* Description:
|
||||
* Initialise the interface functions to the PHY
|
||||
* Arguments:
|
||||
* None
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
void at91rm92000_GetPhyInterface(AT91PS_PhyOps p_phyops)
|
||||
{
|
||||
p_phyops->Init = dm9161_InitPhy;
|
||||
p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
|
||||
p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
|
||||
p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
|
||||
|
||||
#endif /* CONFIG_DRIVER_ETHER */
|
||||
468
board/cmc_pu2/flash.c
Normal file
468
board/cmc_pu2/flash.c
Normal file
@ -0,0 +1,468 @@
|
||||
/*
|
||||
* (C) Copyright 2003-2004
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2004
|
||||
* Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de
|
||||
*
|
||||
* Modified for the CMC PU2 by (C) Copyright 2004 Gary Jennejohn
|
||||
* garyj@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>
|
||||
|
||||
#ifndef CFG_ENV_ADDR
|
||||
#define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET)
|
||||
#endif
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
#define FLASH_CYCLE1 0x0555
|
||||
#define FLASH_CYCLE2 0x02AA
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size(vu_short *addr, flash_info_t *info);
|
||||
static void flash_reset(flash_info_t *info);
|
||||
static int write_word_amd(flash_info_t *info, vu_short *dest, ushort 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;
|
||||
ulong flashbase = CFG_FLASH_BASE;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
memset(&flash_info[0], 0, sizeof(flash_info_t));
|
||||
|
||||
flash_info[0].size = flash_get_size((vu_short *)flashbase, &flash_info[0]);
|
||||
|
||||
size = flash_info[0].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
|
||||
|
||||
return size ? size : 1;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_reset(flash_info_t *info)
|
||||
{
|
||||
vu_short *base = (vu_short *)(info->start[0]);
|
||||
|
||||
/* Put FLASH back in read mode */
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL)
|
||||
*base = 0x00FF; /* Intel Read Mode */
|
||||
else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD)
|
||||
*base = 0x00F0; /* AMD Read Mode */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static flash_info_t *flash_get_info(ulong base)
|
||||
{
|
||||
int i;
|
||||
flash_info_t * info;
|
||||
|
||||
info = NULL;
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_S29GL064M:
|
||||
printf ("S29GL064M-R6 (64Mbit, uniform sector size)\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!
|
||||
*/
|
||||
|
||||
ulong flash_get_size (vu_short *addr, flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
ushort value;
|
||||
ulong base = (ulong)addr;
|
||||
|
||||
/* Write auto select command sequence */
|
||||
addr[FLASH_CYCLE1] = 0x00AA; /* for AMD, Intel ignores this */
|
||||
addr[FLASH_CYCLE2] = 0x0055; /* for AMD, Intel ignores this */
|
||||
addr[FLASH_CYCLE1] = 0x0090; /* selects Intel or AMD */
|
||||
|
||||
/* read Manufacturer ID */
|
||||
udelay(100);
|
||||
value = addr[0];
|
||||
debug ("Manufacturer ID: %04X\n", value);
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (AMD_MANUFACT & 0xFFFF):
|
||||
debug ("Manufacturer: AMD (Spansion)\n");
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
|
||||
case (INTEL_MANUFACT & 0xFFFF):
|
||||
debug ("Manufacturer: Intel (not supported yet)\n");
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Unknown Manufacturer ID: %04X\n", value);
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
value = addr[1];
|
||||
debug ("Device ID: %04X\n", value);
|
||||
|
||||
switch (addr[1]) {
|
||||
|
||||
case (AMD_ID_MIRROR & 0xFFFF):
|
||||
debug ("Mirror Bit flash: addr[14] = %08X addr[15] = %08X\n",
|
||||
addr[14], addr[15]);
|
||||
|
||||
switch(addr[14]) {
|
||||
case (AMD_ID_GL064M_2 & 0xFFFF):
|
||||
if (addr[15] != (AMD_ID_GL064M_3 & 0xffff)) {
|
||||
printf ("Chip: S29GLxxxM -> unknown\n");
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
} else {
|
||||
debug ("Chip: S29GL064M-R6\n");
|
||||
info->flash_id += FLASH_S29GL064M;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000;
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base;
|
||||
base += 0x10000;
|
||||
}
|
||||
}
|
||||
break; /* => 16 MB */
|
||||
default:
|
||||
printf ("Chip: *** unknown ***\n");
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Unknown Device ID: %04X\n", value);
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
/* 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)
|
||||
{
|
||||
vu_short *addr = (vu_short *)(info->start[0]);
|
||||
int flag, prot, sect, ssect, l_sect;
|
||||
ulong now, last;
|
||||
|
||||
debug ("flash_erase: first: %d last: %d\n", s_first, s_last);
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((info->flash_id == FLASH_UNKNOWN) ||
|
||||
(info->flash_id > FLASH_AMD_COMP)) {
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
/*
|
||||
* Start erase on unprotected sectors.
|
||||
* Since the flash can erase multiple sectors with one command
|
||||
* we take advantage of that by doing the erase in chunks of
|
||||
* 3 sectors.
|
||||
*/
|
||||
for (sect = s_first; sect <= s_last; ) {
|
||||
l_sect = -1;
|
||||
|
||||
addr[FLASH_CYCLE1] = 0x00AA;
|
||||
addr[FLASH_CYCLE2] = 0x0055;
|
||||
addr[FLASH_CYCLE1] = 0x0080;
|
||||
addr[FLASH_CYCLE1] = 0x00AA;
|
||||
addr[FLASH_CYCLE2] = 0x0055;
|
||||
|
||||
/* do the erase in chunks of at most 3 sectors */
|
||||
for (ssect = 0; ssect < 3; ssect++) {
|
||||
if ((sect + ssect) > s_last)
|
||||
break;
|
||||
if (info->protect[sect + ssect] == 0) { /* not protected */
|
||||
addr = (vu_short *)(info->start[sect + ssect]);
|
||||
addr[0] = 0x0030;
|
||||
l_sect = sect + ssect;
|
||||
}
|
||||
}
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/*
|
||||
* We wait for the last triggered sector
|
||||
*/
|
||||
if (l_sect < 0)
|
||||
goto DONE;
|
||||
|
||||
reset_timer_masked ();
|
||||
last = 0;
|
||||
addr = (vu_short *)(info->start[l_sect]);
|
||||
while ((addr[0] & 0x0080) != 0x0080) {
|
||||
if ((now = get_timer_masked ()) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return 1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
addr = (vu_short *)info->start[0];
|
||||
addr[0] = 0x00F0; /* reset bank */
|
||||
sect += ssect;
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
addr = (vu_short *)info->start[0];
|
||||
addr[0] = 0x00F0; /* 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 wp, data;
|
||||
int rc;
|
||||
|
||||
if (addr & 1) {
|
||||
printf ("unaligned destination not supported\n");
|
||||
return ERR_ALIGN;
|
||||
};
|
||||
|
||||
if ((int) src & 1) {
|
||||
printf ("unaligned source not supported\n");
|
||||
return ERR_ALIGN;
|
||||
};
|
||||
|
||||
wp = addr;
|
||||
|
||||
while (cnt >= 2) {
|
||||
data = *((vu_short *)src);
|
||||
if ((rc = write_word_amd(info, (vu_short *)wp, data)) != 0) {
|
||||
printf ("write_buff 1: write_word_amd() rc=%d\n", rc);
|
||||
return (rc);
|
||||
}
|
||||
src += 2;
|
||||
wp += 2;
|
||||
cnt -= 2;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (ERR_OK);
|
||||
}
|
||||
|
||||
if (cnt == 1) {
|
||||
data = (*((volatile u8 *) src)) | (*((volatile u8 *) (wp + 1)) << 8);
|
||||
if ((rc = write_word_amd(info, (vu_short *)wp, data)) != 0) {
|
||||
printf ("write_buff 1: write_word_amd() rc=%d\n", rc);
|
||||
return (rc);
|
||||
}
|
||||
src += 1;
|
||||
wp += 1;
|
||||
cnt -= 1;
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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, vu_short *dest, ushort data)
|
||||
{
|
||||
int flag;
|
||||
vu_short *base; /* first address in flash bank */
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*dest & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
base = (vu_short *)(info->start[0]);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
base[FLASH_CYCLE1] = 0x00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = 0x0055; /* unlock */
|
||||
base[FLASH_CYCLE1] = 0x00A0; /* selects program mode */
|
||||
|
||||
*dest = data; /* start programming the data */
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
reset_timer_masked ();
|
||||
|
||||
/* data polling for D7 */
|
||||
while ((*dest & 0x0080) != (data & 0x0080)) {
|
||||
if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
|
||||
*dest = 0x00F0; /* reset bank */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
56
board/cmc_pu2/u-boot.lds
Normal file
56
board/cmc_pu2/u-boot.lds
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* (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/at91rm9200/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
_end = .;
|
||||
}
|
||||
40
board/cobra5272/Makefile
Normal file
40
board/cobra5272/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
|
||||
|
||||
#########################################################################
|
||||
169
board/cobra5272/bdm/cobra5272_uboot.gdb
Normal file
169
board/cobra5272/bdm/cobra5272_uboot.gdb
Normal file
@ -0,0 +1,169 @@
|
||||
#
|
||||
# GDB Init script for the Coldfire 5272 processor.
|
||||
#
|
||||
# The main purpose of this script is to configure the
|
||||
# DRAM controller so code can be loaded.
|
||||
#
|
||||
# This file was changed to suite the senTec COBRA5272 board.
|
||||
#
|
||||
|
||||
define addresses
|
||||
|
||||
set $mbar = 0x10000001
|
||||
set $scr = $mbar - 1 + 0x004
|
||||
set $spr = $mbar - 1 + 0x006
|
||||
set $pmr = $mbar - 1 + 0x008
|
||||
set $apmr = $mbar - 1 + 0x00e
|
||||
set $dir = $mbar - 1 + 0x010
|
||||
set $icr1 = $mbar - 1 + 0x020
|
||||
set $icr2 = $mbar - 1 + 0x024
|
||||
set $icr3 = $mbar - 1 + 0x028
|
||||
set $icr4 = $mbar - 1 + 0x02c
|
||||
set $isr = $mbar - 1 + 0x030
|
||||
set $pitr = $mbar - 1 + 0x034
|
||||
set $piwr = $mbar - 1 + 0x038
|
||||
set $pivr = $mbar - 1 + 0x03f
|
||||
set $csbr0 = $mbar - 1 + 0x040
|
||||
set $csor0 = $mbar - 1 + 0x044
|
||||
set $csbr1 = $mbar - 1 + 0x048
|
||||
set $csor1 = $mbar - 1 + 0x04c
|
||||
set $csbr2 = $mbar - 1 + 0x050
|
||||
set $csor2 = $mbar - 1 + 0x054
|
||||
set $csbr3 = $mbar - 1 + 0x058
|
||||
set $csor3 = $mbar - 1 + 0x05c
|
||||
set $csbr4 = $mbar - 1 + 0x060
|
||||
set $csor4 = $mbar - 1 + 0x064
|
||||
set $csbr5 = $mbar - 1 + 0x068
|
||||
set $csor5 = $mbar - 1 + 0x06c
|
||||
set $csbr6 = $mbar - 1 + 0x070
|
||||
set $csor6 = $mbar - 1 + 0x074
|
||||
set $csbr7 = $mbar - 1 + 0x078
|
||||
set $csor7 = $mbar - 1 + 0x07c
|
||||
set $pacnt = $mbar - 1 + 0x080
|
||||
set $paddr = $mbar - 1 + 0x084
|
||||
set $padat = $mbar - 1 + 0x086
|
||||
set $pbcnt = $mbar - 1 + 0x088
|
||||
set $pbddr = $mbar - 1 + 0x08c
|
||||
set $pbdat = $mbar - 1 + 0x08e
|
||||
set $pcddr = $mbar - 1 + 0x094
|
||||
set $pcdat = $mbar - 1 + 0x096
|
||||
set $pdcnt = $mbar - 1 + 0x098
|
||||
set $sdcr = $mbar - 1 + 0x180
|
||||
set $sdtr = $mbar - 1 + 0x184
|
||||
set $wrrr = $mbar - 1 + 0x280
|
||||
set $wirr = $mbar - 1 + 0x283
|
||||
set $wcr = $mbar - 1 + 0x288
|
||||
set $wer = $mbar - 1 + 0x28c
|
||||
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Setup system configuration
|
||||
#
|
||||
define setup-sys
|
||||
set *((unsigned short *) $scr) = 0x0003
|
||||
set *((unsigned short *) $spr) = 0xffff
|
||||
set *((unsigned char *) $pivr) = 0x4f
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Setup Chip Selects (as per Motorola M5272C3 board)
|
||||
#
|
||||
define setup-cs
|
||||
|
||||
# CS0 -- FLASH
|
||||
set *((unsigned long *) $csbr0) = 0xffe00201
|
||||
set *((unsigned long *) $csor0) = 0xffe00014
|
||||
|
||||
# CS1 -- external bus test
|
||||
set *((unsigned long *) $csbr1) = 0x0
|
||||
set *((unsigned long *) $csor1) = 0x0
|
||||
|
||||
# CS2 -- Optional FSRAM
|
||||
set *((unsigned long *) $csbr2) = 0x30000001
|
||||
set *((unsigned long *) $csor2) = 0xfff80000
|
||||
|
||||
# CS3 -- not used
|
||||
set *((unsigned long *) $csbr3) = 0x0
|
||||
set *((unsigned long *) $csor3) = 0x0
|
||||
|
||||
# CS4 -- not used
|
||||
set *((unsigned long *) $csbr4) = 0x0
|
||||
set *((unsigned long *) $csor4) = 0x0
|
||||
|
||||
# CS5 -- PLI socket0
|
||||
set *((unsigned long *) $csbr5) = 0x0
|
||||
set *((unsigned long *) $csor5) = 0x0
|
||||
|
||||
# CS6 -- PLI socket1
|
||||
set *((unsigned long *) $csbr6) = 0x0
|
||||
set *((unsigned long *) $csor6) = 0x0
|
||||
|
||||
# CS7 -- SDRAM
|
||||
set *((unsigned long *) $csbr7) = 0x00000701
|
||||
set *((unsigned long *) $csor7) = 0xff00007c
|
||||
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Setup the DRAM controller.
|
||||
#
|
||||
|
||||
define setup-dram
|
||||
set *((unsigned long *) $sdtr) = 0x0000f539
|
||||
set *((unsigned long *) $sdcr) = 0x00004211
|
||||
|
||||
# Dummy write to start SDRAM
|
||||
set *((unsigned long *) 0) = 0
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Setup for GPIO pins
|
||||
#
|
||||
define setup-ppio
|
||||
|
||||
# PORT A -- the LED's
|
||||
set *((unsigned long *) $pacnt) = 0x00000000
|
||||
# lower 8 bits for output:
|
||||
set *((unsigned short *) $paddr) = 0xff
|
||||
# LED's off:
|
||||
set *((unsigned short *) $padat) = 0xff
|
||||
|
||||
# PORT B
|
||||
set *((unsigned long *) $pbcnt) = 0x55554155
|
||||
set *((unsigned short *) $pbddr) = 0x0000
|
||||
set *((unsigned short *) $pbdat) = 0x17ea
|
||||
|
||||
# PORT C
|
||||
#set *((unsigned short *) $pcddr) = 0x0000
|
||||
#set *((unsigned short *) $pcdat) = 0x1898
|
||||
|
||||
# PORT D
|
||||
set *((unsigned long *) $pdcnt) = 0x00000000
|
||||
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Added for uClinux-coldfire target...
|
||||
#
|
||||
target bdm /dev/bdm
|
||||
|
||||
addresses
|
||||
setup-sys
|
||||
setup-cs
|
||||
setup-dram
|
||||
setup-ppio
|
||||
set print pretty
|
||||
set print asm-demangle
|
||||
display/i $pc
|
||||
|
||||
|
||||
#
|
||||
load u-boot
|
||||
set $pc=0x20000
|
||||
c
|
||||
2
board/cobra5272/bdm/gdbinit.reset
Normal file
2
board/cobra5272/bdm/gdbinit.reset
Normal file
@ -0,0 +1,2 @@
|
||||
target bdm /dev/bdmcf0
|
||||
q
|
||||
2
board/cobra5272/bdm/load-cobra_uboot
Normal file
2
board/cobra5272/bdm/load-cobra_uboot
Normal file
@ -0,0 +1,2 @@
|
||||
m68k-bdm-elf-gdb -n -x board/cobra5272/bdm/cobra5272_uboot.gdb u-boot
|
||||
|
||||
2
board/cobra5272/bdm/reset
Normal file
2
board/cobra5272/bdm/reset
Normal file
@ -0,0 +1,2 @@
|
||||
m68k-bdm-elf-gdb -n -x bdm/gdbinit.reset
|
||||
|
||||
55
board/cobra5272/cobra5272.c
Normal file
55
board/cobra5272/cobra5272.c
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* (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 <asm/m5272.h>
|
||||
#include <asm/immap_5272.h>
|
||||
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
puts ("Board: ");
|
||||
puts ("senTec COBRA5272 Board\n");
|
||||
return 0;
|
||||
};
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile sdramctrl_t *sdp = (sdramctrl_t *) (CFG_MBAR + MCFSIM_SDCR);
|
||||
|
||||
sdp->sdram_sdtr = 0xf539;
|
||||
sdp->sdram_sdcr = 0x4211;
|
||||
|
||||
/* Dummy write to start SDRAM */
|
||||
*((volatile unsigned long *) 0) = 0;
|
||||
|
||||
return CFG_SDRAM_SIZE * 1024 * 1024;
|
||||
};
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("DRAM test not implemented!\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
25
board/cobra5272/config.mk
Normal file
25
board/cobra5272/config.mk
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
# Coldfire contribution by Bernhard Kuhn <bkuhn@metrowerks.com>
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xffe00000
|
||||
378
board/cobra5272/flash.c
Normal file
378
board/cobra5272/flash.c
Normal file
@ -0,0 +1,378 @@
|
||||
/*
|
||||
* (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>
|
||||
|
||||
#define PHYS_FLASH_1 CFG_FLASH_BASE
|
||||
#define FLASH_BANK_SIZE 0x200000
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case (AMD_MANUFACT & FLASH_VENDMASK):
|
||||
printf ("AMD: ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case (AMD_ID_PL160CB & FLASH_TYPEMASK):
|
||||
printf ("AM29PL160CB (16Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
goto Done;
|
||||
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");
|
||||
|
||||
Done:
|
||||
}
|
||||
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i, j;
|
||||
ulong size = 0;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
ulong flashbase = 0;
|
||||
|
||||
flash_info[i].flash_id =
|
||||
(AMD_MANUFACT & FLASH_VENDMASK) |
|
||||
(AMD_ID_PL160CB & FLASH_TYPEMASK);
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
if (i == 0)
|
||||
flashbase = PHYS_FLASH_1;
|
||||
else
|
||||
panic ("configured to many flash banks!\n");
|
||||
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
if (j == 0) {
|
||||
/* 1st is 16 KiB */
|
||||
flash_info[i].start[j] = flashbase;
|
||||
}
|
||||
if ((j >= 1) && (j <= 2)) {
|
||||
/* 2nd and 3rd are 8 KiB */
|
||||
flash_info[i].start[j] =
|
||||
flashbase + 0x4000 + 0x2000 * (j - 1);
|
||||
}
|
||||
if (j == 3) {
|
||||
/* 4th is 224 KiB */
|
||||
flash_info[i].start[j] = flashbase + 0x8000;
|
||||
}
|
||||
if ((j >= 4) && (j <= 10)) {
|
||||
/* rest is 256 KiB */
|
||||
flash_info[i].start[j] =
|
||||
flashbase + 0x40000 + 0x40000 * (j -
|
||||
4);
|
||||
}
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + 0x3ffff, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
#define CMD_READ_ARRAY 0x00F0
|
||||
#define CMD_UNLOCK1 0x00AA
|
||||
#define CMD_UNLOCK2 0x0055
|
||||
#define CMD_ERASE_SETUP 0x0080
|
||||
#define CMD_ERASE_CONFIRM 0x0030
|
||||
#define CMD_PROGRAM 0x00A0
|
||||
#define CMD_UNLOCK_BYPASS 0x0020
|
||||
|
||||
#define MEM_FLASH_ADDR1 (*(volatile u16 *)(CFG_FLASH_BASE + (0x00000555<<1)))
|
||||
#define MEM_FLASH_ADDR2 (*(volatile u16 *)(CFG_FLASH_BASE + (0x000002AA<<1)))
|
||||
|
||||
#define BIT_ERASE_DONE 0x0080
|
||||
#define BIT_RDY_MASK 0x0080
|
||||
#define BIT_PROGRAM_ERROR 0x0020
|
||||
#define BIT_TIMEOUT 0x80000000 /* our flag */
|
||||
|
||||
#define READY 1
|
||||
#define ERR 2
|
||||
#define TMO 4
|
||||
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
ulong result;
|
||||
int iflag, cflag, prot, sect;
|
||||
int rc = ERR_OK;
|
||||
int chip1;
|
||||
|
||||
/* first look for protection bits */
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN)
|
||||
return ERR_UNKNOWN_FLASH_TYPE;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
return ERR_INVAL;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) !=
|
||||
(AMD_MANUFACT & FLASH_VENDMASK)) {
|
||||
return ERR_UNKNOWN_FLASH_VENDOR;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
if (prot)
|
||||
return ERR_PROTECTED;
|
||||
|
||||
/*
|
||||
* Disable interrupts which might cause a timeout
|
||||
* here. Remember that our exception vectors are
|
||||
* at address 0 in the flash, and we don't want a
|
||||
* (ticker) exception to happen while the flash
|
||||
* chip is in programming mode.
|
||||
*/
|
||||
|
||||
cflag = icache_status ();
|
||||
icache_disable ();
|
||||
iflag = disable_interrupts ();
|
||||
|
||||
printf ("\n");
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last && !ctrlc (); sect++) {
|
||||
printf ("Erasing sector %2d ... ", sect);
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
set_timer (0);
|
||||
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
volatile u16 *addr =
|
||||
(volatile u16 *) (info->start[sect]);
|
||||
|
||||
MEM_FLASH_ADDR1 = CMD_UNLOCK1;
|
||||
MEM_FLASH_ADDR2 = CMD_UNLOCK2;
|
||||
MEM_FLASH_ADDR1 = CMD_ERASE_SETUP;
|
||||
|
||||
MEM_FLASH_ADDR1 = CMD_UNLOCK1;
|
||||
MEM_FLASH_ADDR2 = CMD_UNLOCK2;
|
||||
*addr = CMD_ERASE_CONFIRM;
|
||||
|
||||
/* wait until flash is ready */
|
||||
chip1 = 0;
|
||||
|
||||
do {
|
||||
result = *addr;
|
||||
|
||||
/* check timeout */
|
||||
if (get_timer (0) > CFG_FLASH_ERASE_TOUT) {
|
||||
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
|
||||
chip1 = TMO;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!chip1
|
||||
&& (result & 0xFFFF) & BIT_ERASE_DONE)
|
||||
chip1 = READY;
|
||||
|
||||
} while (!chip1);
|
||||
|
||||
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
|
||||
|
||||
if (chip1 == ERR) {
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
if (chip1 == TMO) {
|
||||
rc = ERR_TIMOUT;
|
||||
goto outahere;
|
||||
}
|
||||
|
||||
printf ("ok.\n");
|
||||
} else { /* it was protected */
|
||||
|
||||
printf ("protected!\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (ctrlc ())
|
||||
printf ("User Interrupt!\n");
|
||||
|
||||
outahere:
|
||||
/* allow flash to settle - wait 10 ms */
|
||||
udelay (10000);
|
||||
|
||||
if (iflag)
|
||||
enable_interrupts ();
|
||||
|
||||
if (cflag)
|
||||
icache_enable ();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
volatile static int write_word (flash_info_t * info, ulong dest, ulong data)
|
||||
{
|
||||
volatile u16 *addr = (volatile u16 *) dest;
|
||||
ulong result;
|
||||
int rc = ERR_OK;
|
||||
int cflag, iflag;
|
||||
int chip1;
|
||||
|
||||
/*
|
||||
* Check if Flash is (sufficiently) erased
|
||||
*/
|
||||
result = *addr;
|
||||
if ((result & data) != data)
|
||||
return ERR_NOT_ERASED;
|
||||
|
||||
|
||||
/*
|
||||
* Disable interrupts which might cause a timeout
|
||||
* here. Remember that our exception vectors are
|
||||
* at address 0 in the flash, and we don't want a
|
||||
* (ticker) exception to happen while the flash
|
||||
* chip is in programming mode.
|
||||
*/
|
||||
|
||||
cflag = icache_status ();
|
||||
icache_disable ();
|
||||
iflag = disable_interrupts ();
|
||||
|
||||
MEM_FLASH_ADDR1 = CMD_UNLOCK1;
|
||||
MEM_FLASH_ADDR2 = CMD_UNLOCK2;
|
||||
MEM_FLASH_ADDR1 = CMD_PROGRAM;
|
||||
*addr = data;
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
set_timer (0);
|
||||
|
||||
/* wait until flash is ready */
|
||||
chip1 = 0;
|
||||
do {
|
||||
result = *addr;
|
||||
|
||||
/* check timeout */
|
||||
if (get_timer (0) > CFG_FLASH_ERASE_TOUT) {
|
||||
chip1 = ERR | TMO;
|
||||
break;
|
||||
}
|
||||
if (!chip1 && ((result & 0x80) == (data & 0x80)))
|
||||
chip1 = READY;
|
||||
|
||||
} while (!chip1);
|
||||
|
||||
*addr = CMD_READ_ARRAY;
|
||||
|
||||
if (chip1 == ERR || *addr != data)
|
||||
rc = ERR_PROG_ERROR;
|
||||
|
||||
if (iflag)
|
||||
enable_interrupts ();
|
||||
|
||||
if (cflag)
|
||||
icache_enable ();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong wp, data;
|
||||
int rc;
|
||||
|
||||
if (addr & 1) {
|
||||
printf ("unaligned destination not supported\n");
|
||||
return ERR_ALIGN;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (cnt & 1) {
|
||||
printf ("odd transfer sizes not supported\n");
|
||||
return ERR_ALIGN;
|
||||
}
|
||||
#endif
|
||||
|
||||
wp = addr;
|
||||
|
||||
if (addr & 1) {
|
||||
data = (*((volatile u8 *) addr) << 8) | *((volatile u8 *)
|
||||
src);
|
||||
if ((rc = write_word (info, wp - 1, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
src += 1;
|
||||
wp += 1;
|
||||
cnt -= 1;
|
||||
}
|
||||
|
||||
while (cnt >= 2) {
|
||||
data = *((volatile u16 *) src);
|
||||
if ((rc = write_word (info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
src += 2;
|
||||
wp += 2;
|
||||
cnt -= 2;
|
||||
}
|
||||
|
||||
if (cnt == 1) {
|
||||
data = (*((volatile u8 *) src) << 8) |
|
||||
*((volatile u8 *) (wp + 1));
|
||||
if ((rc = write_word (info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
src += 1;
|
||||
wp += 1;
|
||||
cnt -= 1;
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
142
board/cobra5272/u-boot.lds
Normal file
142
board/cobra5272/u-boot.lds
Normal file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
* (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(m68k)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/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/mcf52x2/start.o (.text)
|
||||
cpu/mcf52x2/cpu_init.o (.text)
|
||||
lib_m68k/traps.o (.text)
|
||||
cpu/mcf52x2/interrupts.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
. = DEFINED(env_offset) ? 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_start = .;
|
||||
*(.got)
|
||||
__got_end = .;
|
||||
_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 = .;
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = .;
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@ -54,7 +54,7 @@
|
||||
* i.e. they are 8 bytes apart. For big endian addressing, the 8 bit register
|
||||
* will be at byte 7 (the address + 7). For little endian addressing, the
|
||||
* register will be at byte 0 (the address + 0). To learn the endianess
|
||||
* we must include <asm/byteorder.h>
|
||||
* we must include <endian.h>
|
||||
*
|
||||
* Take the CMA102 and CMA111 motherboards as examples...
|
||||
*
|
||||
@ -230,16 +230,20 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#ifdef USE_HOSTCC
|
||||
#include <endian.h> /* avoid using private kernel header files */
|
||||
#else
|
||||
#include <asm/byteorder.h> /* use U-Boot provided headers */
|
||||
#endif
|
||||
|
||||
/* a single CMA10x motherboard i/o register */
|
||||
typedef
|
||||
struct {
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
unsigned char value;
|
||||
#endif
|
||||
unsigned char filler[7];
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
unsigned char value;
|
||||
#endif
|
||||
}
|
||||
@ -357,7 +361,7 @@ cma_mb_dipsw;
|
||||
/* V360EPC PCI Bridge */
|
||||
typedef
|
||||
struct {
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
unsigned short v3_pci_vendor; /* 0x00 */
|
||||
unsigned short v3_pci_device;
|
||||
unsigned short v3_pci_cmd; /* 0x04 */
|
||||
@ -436,7 +440,7 @@ typedef
|
||||
unsigned long reserved8:24;
|
||||
unsigned long reserved9[7]; /* 0xe4 */
|
||||
#endif
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
unsigned short v3_pci_device; /* 0x00 */
|
||||
unsigned short v3_pci_vendor;
|
||||
unsigned short v3_pci_stat; /* 0x04 */
|
||||
|
||||
@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o plx9030.o
|
||||
OBJS = $(BOARD).o flash.o plx9030.o pd67290.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
@ -24,11 +24,13 @@
|
||||
#include <common.h>
|
||||
#include <mpc824x.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <pci.h>
|
||||
#include <i2c.h>
|
||||
|
||||
int sysControlDisplay(int digit, uchar ascii_code);
|
||||
extern void Plx9030Init(void);
|
||||
extern void SPD67290Init(void);
|
||||
|
||||
/* We have to clear the initial data area here. Couldn't have done it
|
||||
* earlier because DRAM had not been initialized.
|
||||
@ -180,6 +182,10 @@ static struct pci_config_table pci_cpc45_config_table[] = {
|
||||
pci_cfgfunc_config_device, { PCI_PLX9030_IOADDR,
|
||||
PCI_PLX9030_MEMADDR,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0E, PCI_ANY_ID,
|
||||
pci_cfgfunc_config_device, { PCMCIA_IO_BASE,
|
||||
PCMCIA_IO_BASE,
|
||||
PCI_COMMAND_MEMORY | PCI_COMMAND_IO }},
|
||||
#endif /*CONFIG_PCI_PNP*/
|
||||
{ }
|
||||
};
|
||||
@ -233,3 +239,37 @@ int sysControlDisplay (int digit, /* number of digit 0..7 */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
|
||||
|
||||
#ifdef CFG_PCMCIA_MEM_ADDR
|
||||
volatile unsigned char *pcmcia_mem = (unsigned char*)CFG_PCMCIA_MEM_ADDR;
|
||||
#endif
|
||||
|
||||
int pcmcia_init(void)
|
||||
{
|
||||
u_int rc;
|
||||
|
||||
debug ("Enable PCMCIA " PCMCIA_SLOT_MSG "\n");
|
||||
|
||||
rc = i82365_init();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* CFG_CMD_PCMCIA */
|
||||
|
||||
# ifdef CONFIG_IDE_LED
|
||||
void ide_led (uchar led, uchar status)
|
||||
{
|
||||
u_char val;
|
||||
/* We have one PCMCIA slot and use LED H4 for the IDE Interface */
|
||||
val = readb(BCSR_BASE + 0x04);
|
||||
if (status) { /* led on */
|
||||
val |= B_CTRL_LED0;
|
||||
} else {
|
||||
val &= ~B_CTRL_LED0;
|
||||
}
|
||||
writeb(val, BCSR_BASE + 0x04);
|
||||
}
|
||||
# endif
|
||||
|
||||
68
board/cpc45/pd67290.c
Normal file
68
board/cpc45/pd67290.c
Normal file
@ -0,0 +1,68 @@
|
||||
/* pd67290.c - system configuration module for SPD67290
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* (C) 2004 DENX Software Engineering, Heiko Schocher <hs@denx.de>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <malloc.h>
|
||||
#include <net.h>
|
||||
#include <asm/io.h>
|
||||
#include <pci.h>
|
||||
|
||||
/* imports */
|
||||
#include <mpc824x.h>
|
||||
|
||||
static struct pci_device_id supported[] = {
|
||||
{PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6729},
|
||||
{}
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* SPD67290Init -
|
||||
*
|
||||
* RETURNS: -1 on error, 0 if OK
|
||||
*/
|
||||
|
||||
int SPD67290Init (void)
|
||||
{
|
||||
pci_dev_t devno;
|
||||
int idx = 0; /* general index */
|
||||
ulong membaseCsr; /* base address of device memory space */
|
||||
|
||||
/* find PD67290 device */
|
||||
if ((devno = pci_find_devices (supported, idx++)) < 0) {
|
||||
printf ("No PD67290 device found !!\n");
|
||||
return -1;
|
||||
}
|
||||
/* - 0xfe000000 see MPC 8245 Users Manual Adress Map B */
|
||||
membaseCsr = PCMCIA_IO_BASE - 0xfe000000;
|
||||
|
||||
/* set base address */
|
||||
pci_write_config_dword (devno, PCI_BASE_ADDRESS_0, membaseCsr);
|
||||
|
||||
/* enable mapped memory and IO addresses */
|
||||
pci_write_config_dword (devno,
|
||||
PCI_COMMAND,
|
||||
PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_IO | PCI_COMMAND_WAIT);
|
||||
return 0;
|
||||
}
|
||||
40
board/cpu87/Makefile
Normal file
40
board/cpu87/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2001-2005
|
||||
# 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
|
||||
|
||||
#########################################################################
|
||||
40
board/cpu87/config.mk
Normal file
40
board/cpu87/config.mk
Normal file
@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2001-2005
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# CPU87 board
|
||||
#
|
||||
|
||||
# This should be equal to the CFG_FLASH_BASE define in configs/cpu87.h
|
||||
# for the "final" configuration, with U-Boot in flash, or the address
|
||||
# in RAM where U-Boot is loaded at for debugging.
|
||||
#
|
||||
|
||||
ifeq ($(CONFIG_BOOT_ROM),y)
|
||||
TEXT_BASE := 0xFF800000
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_BOOT_ROM
|
||||
else
|
||||
TEXT_BASE := 0xFF000000
|
||||
endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)
|
||||
333
board/cpu87/cpu87.c
Normal file
333
board/cpu87/cpu87.c
Normal file
@ -0,0 +1,333 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2005
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ioports.h>
|
||||
#include <mpc8260.h>
|
||||
#include "cpu87.h"
|
||||
#include <pci.h>
|
||||
|
||||
/*
|
||||
* I/O Port configuration table
|
||||
*
|
||||
* if conf is 1, then that port pin will be configured at boot time
|
||||
* according to the five values podr/pdir/ppar/psor/pdat for that entry
|
||||
*/
|
||||
|
||||
const iop_conf_t iop_conf_tab[4][32] = {
|
||||
|
||||
/* Port A configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PA31 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 MII COL */
|
||||
/* PA30 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 MII CRS */
|
||||
/* PA29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC1 MII TX_ER */
|
||||
/* PA28 */ { 1, 1, 1, 1, 0, 0 }, /* FCC1 MII TX_EN */
|
||||
/* PA27 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 MII RX_DV */
|
||||
/* PA26 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 MII RX_ER */
|
||||
/* PA25 */ { 1, 0, 0, 1, 0, 0 }, /* FCC2 MII MDIO */
|
||||
/* PA24 */ { 1, 0, 0, 1, 0, 0 }, /* FCC2 MII MDC */
|
||||
/* PA23 */ { 1, 0, 0, 1, 0, 0 }, /* FCC1 MII MDIO */
|
||||
/* PA22 */ { 1, 0, 0, 1, 0, 0 }, /* FCC1 MII MDC */
|
||||
/* PA21 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 MII TxD[3] */
|
||||
/* PA20 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 MII TxD[2] */
|
||||
/* PA19 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 MII TxD[1] */
|
||||
/* PA18 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 MII TxD[0] */
|
||||
/* PA17 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII RxD[0] */
|
||||
/* PA16 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII RxD[1] */
|
||||
/* PA15 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII RxD[2] */
|
||||
/* PA14 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII RxD[3] */
|
||||
/* PA13 */ { 1, 0, 0, 1, 0, 0 }, /* FCC2 MII TXSL1 */
|
||||
/* PA12 */ { 1, 0, 0, 1, 0, 1 }, /* FCC2 MII TXSL0 */
|
||||
/* PA11 */ { 1, 0, 0, 1, 0, 0 }, /* FCC1 MII TXSL1 */
|
||||
/* PA10 */ { 1, 0, 0, 1, 0, 1 }, /* FCC1 MII TXSL0 */
|
||||
/* PA9 */ { 0, 1, 0, 1, 0, 0 }, /* SMC2 TXD */
|
||||
/* PA8 */ { 0, 1, 0, 0, 0, 0 }, /* SMC2 RXD */
|
||||
/* PA7 */ { 0, 0, 0, 0, 0, 0 }, /* PA7 */
|
||||
/* PA6 */ { 1, 0, 0, 1, 0, 1 }, /* FCC2 MII PAUSE */
|
||||
/* PA5 */ { 1, 0, 0, 1, 0, 1 }, /* FCC1 MII PAUSE */
|
||||
/* PA4 */ { 1, 0, 0, 1, 0, 0 }, /* FCC2 MII PWRDN */
|
||||
/* PA3 */ { 1, 0, 0, 1, 0, 0 }, /* FCC1 MII PWRDN */
|
||||
/* PA2 */ { 0, 0, 0, 0, 0, 0 }, /* PA2 */
|
||||
/* PA1 */ { 1, 0, 0, 0, 0, 0 }, /* FCC2 MII MDINT */
|
||||
/* PA0 */ { 1, 0, 0, 1, 0, 0 } /* FCC1 MII MDINT */
|
||||
},
|
||||
|
||||
/* Port B configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PB31 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TX_ER */
|
||||
/* PB30 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_DV */
|
||||
/* PB29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC2 MII TX_EN */
|
||||
/* PB28 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_ER */
|
||||
/* PB27 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII COL */
|
||||
/* PB26 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII CRS */
|
||||
/* PB25 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[3] */
|
||||
/* PB24 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[2] */
|
||||
/* PB23 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[1] */
|
||||
/* PB22 */ { 1, 1, 0, 1, 0, 0 }, /* FCC2 MII TxD[0] */
|
||||
/* PB21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[0] */
|
||||
/* PB20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[1] */
|
||||
/* PB19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[2] */
|
||||
/* PB18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RxD[3] */
|
||||
/* PB17 */ { 0, 0, 0, 0, 0, 0 }, /* PB17 */
|
||||
/* PB16 */ { 0, 0, 0, 0, 0, 0 }, /* PB16 */
|
||||
/* PB15 */ { 0, 0, 0, 0, 0, 0 }, /* PB15 */
|
||||
/* PB14 */ { 0, 0, 0, 0, 0, 0 }, /* PB14 */
|
||||
/* PB13 */ { 0, 0, 0, 0, 0, 0 }, /* PB13 */
|
||||
/* PB12 */ { 0, 0, 0, 0, 0, 0 }, /* PB12 */
|
||||
/* PB11 */ { 0, 0, 0, 0, 0, 0 }, /* PB11 */
|
||||
/* PB10 */ { 0, 0, 0, 0, 0, 0 }, /* PB10 */
|
||||
/* PB9 */ { 0, 0, 0, 0, 0, 0 }, /* PB9 */
|
||||
/* PB8 */ { 0, 0, 0, 0, 0, 0 }, /* PB8 */
|
||||
/* PB7 */ { 0, 0, 0, 0, 0, 0 }, /* PB7 */
|
||||
/* PB6 */ { 0, 0, 0, 0, 0, 0 }, /* PB6 */
|
||||
/* PB5 */ { 0, 0, 0, 0, 0, 0 }, /* PB5 */
|
||||
/* PB4 */ { 0, 0, 0, 0, 0, 0 }, /* PB4 */
|
||||
/* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* PB3 */
|
||||
/* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* PB2 */
|
||||
/* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* PB1 */
|
||||
/* PB0 */ { 0, 0, 0, 0, 0, 0 } /* PB0 */
|
||||
},
|
||||
|
||||
/* Port C */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PC31 */ { 0, 0, 0, 0, 0, 0 }, /* PC31 */
|
||||
/* PC30 */ { 0, 0, 0, 0, 0, 0 }, /* PC30 */
|
||||
/* PC29 */ { 1, 0, 0, 0, 0, 0 }, /* SCC1 CTS */
|
||||
/* PC28 */ { 1, 0, 0, 0, 0, 0 }, /* SCC2 CTS */
|
||||
/* PC27 */ { 0, 0, 0, 0, 0, 0 }, /* PC27 */
|
||||
/* PC26 */ { 0, 0, 0, 0, 0, 0 }, /* PC26 */
|
||||
/* PC25 */ { 0, 0, 0, 0, 0, 0 }, /* PC25 */
|
||||
/* PC24 */ { 0, 0, 0, 0, 0, 0 }, /* PC24 */
|
||||
/* PC23 */ { 0, 0, 0, 0, 0, 0 }, /* FDC37C78 DACFD */
|
||||
/* PC22 */ { 0, 0, 0, 0, 0, 0 }, /* FDC37C78 DNFD */
|
||||
/* PC21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII RX_CLK */
|
||||
/* PC20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 MII TX_CLK */
|
||||
/* PC19 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII RX_CLK */
|
||||
/* PC18 */ { 1, 1, 0, 0, 0, 0 }, /* FCC2 MII TX_CLK */
|
||||
/* PC17 */ { 0, 0, 0, 0, 0, 0 }, /* PC17 */
|
||||
/* PC16 */ { 0, 0, 0, 0, 0, 0 }, /* PC16 */
|
||||
/* PC15 */ { 0, 0, 0, 0, 0, 0 }, /* PC15 */
|
||||
/* PC14 */ { 0, 0, 0, 0, 0, 0 }, /* PC14 */
|
||||
/* PC13 */ { 0, 0, 0, 0, 0, 0 }, /* PC13 */
|
||||
/* PC12 */ { 0, 0, 0, 0, 0, 0 }, /* PC12 */
|
||||
/* PC11 */ { 0, 0, 0, 0, 0, 0 }, /* PC11 */
|
||||
/* PC10 */ { 0, 0, 0, 0, 0, 0 }, /* PC10 */
|
||||
/* PC9 */ { 0, 0, 0, 0, 0, 0 }, /* FC9 */
|
||||
/* PC8 */ { 0, 0, 0, 0, 0, 0 }, /* PC8 */
|
||||
/* PC7 */ { 0, 0, 0, 0, 0, 0 }, /* PC7 */
|
||||
/* PC6 */ { 0, 0, 0, 0, 0, 0 }, /* PC6 */
|
||||
/* PC5 */ { 0, 0, 0, 0, 0, 0 }, /* PC5 */
|
||||
/* PC4 */ { 0, 0, 0, 0, 0, 0 }, /* PC4 */
|
||||
/* PC3 */ { 0, 0, 0, 0, 0, 0 }, /* PC3 */
|
||||
/* PC2 */ { 0, 0, 0, 0, 0, 0 }, /* PC2 */
|
||||
/* PC1 */ { 0, 0, 0, 0, 0, 0 }, /* PC1 */
|
||||
/* PC0 */ { 0, 0, 0, 0, 0, 0 }, /* FDC37C78 DRQFD */
|
||||
},
|
||||
|
||||
/* Port D */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PD31 */ { 1, 1, 0, 0, 0, 0 }, /* SCC1 RXD */
|
||||
/* PD30 */ { 1, 1, 1, 1, 0, 0 }, /* SCC1 TXD */
|
||||
/* PD29 */ { 1, 0, 0, 1, 0, 0 }, /* SCC1 RTS */
|
||||
/* PD28 */ { 1, 1, 0, 0, 0, 0 }, /* SCC2 RXD */
|
||||
/* PD27 */ { 1, 1, 0, 1, 0, 0 }, /* SCC2 TXD */
|
||||
/* PD26 */ { 1, 0, 0, 1, 0, 0 }, /* SCC2 RTS */
|
||||
/* PD25 */ { 0, 0, 0, 0, 0, 0 }, /* PD25 */
|
||||
/* PD24 */ { 0, 0, 0, 0, 0, 0 }, /* PD24 */
|
||||
/* PD23 */ { 0, 0, 0, 0, 0, 0 }, /* PD23 */
|
||||
/* PD22 */ { 0, 0, 0, 0, 0, 0 }, /* PD22 */
|
||||
/* PD21 */ { 0, 0, 0, 0, 0, 0 }, /* PD21 */
|
||||
/* PD20 */ { 0, 0, 0, 0, 0, 0 }, /* PD20 */
|
||||
/* PD19 */ { 0, 0, 0, 0, 0, 0 }, /* PD19 */
|
||||
/* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */
|
||||
/* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */
|
||||
/* PD16 */ { 0, 0, 0, 0, 0, 0 }, /* PD16 */
|
||||
#if defined(CONFIG_SOFT_I2C)
|
||||
/* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
|
||||
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
|
||||
#else
|
||||
#if defined(CONFIG_HARD_I2C)
|
||||
/* PD15 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SDA */
|
||||
/* PD14 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SCL */
|
||||
#else /* normal I/O port pins */
|
||||
/* PD15 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SDA */
|
||||
/* PD14 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SCL */
|
||||
#endif
|
||||
#endif
|
||||
/* PD13 */ { 0, 0, 0, 0, 0, 0 }, /* PD13 */
|
||||
/* PD12 */ { 0, 0, 0, 0, 0, 0 }, /* PD12 */
|
||||
/* PD11 */ { 0, 0, 0, 0, 0, 0 }, /* PD11 */
|
||||
/* PD10 */ { 0, 0, 0, 0, 0, 0 }, /* PD10 */
|
||||
/* PD9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC1 TXD */
|
||||
/* PD8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC1 RXD */
|
||||
/* PD7 */ { 0, 0, 0, 0, 0, 0 }, /* PD7 */
|
||||
/* PD6 */ { 0, 0, 0, 0, 0, 0 }, /* PD6 */
|
||||
/* PD5 */ { 0, 0, 0, 0, 0, 0 }, /* PD5 */
|
||||
/* PD4 */ { 0, 0, 0, 0, 0, 0 }, /* PD4 */
|
||||
/* PD3 */ { 0, 0, 0, 0, 0, 0 }, /* PD3 */
|
||||
/* PD2 */ { 0, 0, 0, 0, 0, 0 }, /* PD2 */
|
||||
/* PD1 */ { 0, 0, 0, 0, 0, 0 }, /* PD1 */
|
||||
/* PD0 */ { 0, 0, 0, 0, 0, 0 } /* PD0 */
|
||||
}
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Check Board Identity:
|
||||
*/
|
||||
int checkboard (void)
|
||||
{
|
||||
printf ("Board: CPU87 (Rev %02x)\n", CPU86_REV);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx
|
||||
*
|
||||
* This routine performs standard 8260 initialization sequence
|
||||
* and calculates the available memory size. It may be called
|
||||
* several times to try different SDRAM configurations on both
|
||||
* 60x and local buses.
|
||||
*/
|
||||
static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
|
||||
ulong orx, volatile uchar * base)
|
||||
{
|
||||
volatile uchar c = 0xff;
|
||||
volatile uint *sdmr_ptr;
|
||||
volatile uint *orx_ptr;
|
||||
ulong maxsize, size;
|
||||
int i;
|
||||
|
||||
/* We must be able to test a location outsize the maximum legal size
|
||||
* to find out THAT we are outside; but this address still has to be
|
||||
* mapped by the controller. That means, that the initial mapping has
|
||||
* to be (at least) twice as large as the maximum expected size.
|
||||
*/
|
||||
maxsize = (1 + (~orx | 0x7fff)) / 2;
|
||||
|
||||
/* Since CFG_SDRAM_BASE is always 0 (??), we assume that
|
||||
* we are configuring CS1 if base != 0
|
||||
*/
|
||||
sdmr_ptr = &memctl->memc_psdmr;
|
||||
orx_ptr = &memctl->memc_or2;
|
||||
|
||||
*orx_ptr = orx;
|
||||
|
||||
/*
|
||||
* Quote from 8260 UM (10.4.2 SDRAM Power-On Initialization, 10-35):
|
||||
*
|
||||
* "At system reset, initialization software must set up the
|
||||
* programmable parameters in the memory controller banks registers
|
||||
* (ORx, BRx, P/LSDMR). After all memory parameters are configured,
|
||||
* system software should execute the following initialization sequence
|
||||
* for each SDRAM device.
|
||||
*
|
||||
* 1. Issue a PRECHARGE-ALL-BANKS command
|
||||
* 2. Issue eight CBR REFRESH commands
|
||||
* 3. Issue a MODE-SET command to initialize the mode register
|
||||
*
|
||||
* The initial commands are executed by setting P/LSDMR[OP] and
|
||||
* accessing the SDRAM with a single-byte transaction."
|
||||
*
|
||||
* The appropriate BRx/ORx registers have already been set when we
|
||||
* get here. The SDRAM can be accessed at the address CFG_SDRAM_BASE.
|
||||
*/
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_PREA;
|
||||
*base = c;
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_CBRR;
|
||||
for (i = 0; i < 8; i++)
|
||||
*base = c;
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_MRW;
|
||||
*(base + CFG_MRS_OFFS) = c; /* setting MR on address lines */
|
||||
|
||||
*sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
|
||||
*base = c;
|
||||
|
||||
size = get_ram_size((long *)base, maxsize);
|
||||
|
||||
*orx_ptr = orx | ~(size - 1);
|
||||
|
||||
return (size);
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
ulong size8, size9;
|
||||
#endif
|
||||
long psize;
|
||||
|
||||
psize = 32 * 1024 * 1024;
|
||||
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
memctl->memc_psrt = CFG_PSRT;
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
/* 60x SDRAM setup:
|
||||
*/
|
||||
size8 = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL,
|
||||
(uchar *) CFG_SDRAM_BASE);
|
||||
size9 = try_init (memctl, CFG_PSDMR_9COL, CFG_OR2_9COL,
|
||||
(uchar *) CFG_SDRAM_BASE);
|
||||
|
||||
if (size8 < size9) {
|
||||
psize = size9;
|
||||
printf ("(60x:9COL) ");
|
||||
} else {
|
||||
psize = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL,
|
||||
(uchar *) CFG_SDRAM_BASE);
|
||||
printf ("(60x:8COL) ");
|
||||
}
|
||||
|
||||
#endif /* CFG_RAMBOOT */
|
||||
|
||||
icache_enable ();
|
||||
|
||||
return (psize);
|
||||
}
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_DOC)
|
||||
extern void doc_probe (ulong physadr);
|
||||
void doc_init (void)
|
||||
{
|
||||
doc_probe (CFG_DOC_BASE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
struct pci_controller hose;
|
||||
|
||||
extern void pci_mpc8250_init(struct pci_controller *);
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
pci_mpc8250_init(&hose);
|
||||
}
|
||||
#endif
|
||||
27
board/cpu87/cpu87.h
Normal file
27
board/cpu87/cpu87.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef __BOARD_CPU87__
|
||||
#define __BOARD_CPU87__
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define REG8(x) (*(volatile unsigned char *)(x))
|
||||
|
||||
/* CPU86 register definitions */
|
||||
#define CPU86_VME_EAC REG8(CFG_BCRS_BASE + 0x00)
|
||||
#define CPU86_VME_SAC REG8(CFG_BCRS_BASE + 0x01)
|
||||
#define CPU86_VME_MAC REG8(CFG_BCRS_BASE + 0x02)
|
||||
#define CPU86_BCR REG8(CFG_BCRS_BASE + 0x03)
|
||||
#define CPU86_BSR REG8(CFG_BCRS_BASE + 0x04)
|
||||
#define CPU86_WDOG_RPORT REG8(CFG_BCRS_BASE + 0x05)
|
||||
#define CPU86_MBOX_IRQ REG8(CFG_BCRS_BASE + 0x04)
|
||||
#define CPU86_REV REG8(CFG_BCRS_BASE + 0x07)
|
||||
#define CPU86_VME_IRQMASK REG8(CFG_BCRS_BASE + 0x80)
|
||||
#define CPU86_VME_IRQSTATUS REG8(CFG_BCRS_BASE + 0x81)
|
||||
#define CPU86_LOCAL_IRQMASK REG8(CFG_BCRS_BASE + 0x82)
|
||||
#define CPU86_LOCAL_IRQSTATUS REG8(CFG_BCRS_BASE + 0x83)
|
||||
#define CPU86_PMCL_IRQSTATUS REG8(CFG_BCRS_BASE + 0x84)
|
||||
|
||||
/* Board Control Register bits */
|
||||
#define CPU86_BCR_FWPT 0x01
|
||||
#define CPU86_BCR_FWRE 0x02
|
||||
|
||||
#endif /* __BOARD_CPU87__ */
|
||||
624
board/cpu87/flash.c
Normal file
624
board/cpu87/flash.c
Normal file
@ -0,0 +1,624 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2005
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* Flash Routines for Intel devices
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
#include "cpu87.h"
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
ulong flash_int_get_size (volatile unsigned long *baseaddr,
|
||||
flash_info_t * info)
|
||||
{
|
||||
short i;
|
||||
unsigned long flashtest_h, flashtest_l;
|
||||
|
||||
info->sector_count = info->size = 0;
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
|
||||
/* Write identify command sequence and test FLASH answer
|
||||
*/
|
||||
baseaddr[0] = 0x00900090;
|
||||
baseaddr[1] = 0x00900090;
|
||||
|
||||
flashtest_h = baseaddr[0]; /* manufacturer ID */
|
||||
flashtest_l = baseaddr[1];
|
||||
|
||||
if (flashtest_h != INTEL_MANUFACT || flashtest_l != INTEL_MANUFACT)
|
||||
return (0); /* no or unknown flash */
|
||||
|
||||
flashtest_h = baseaddr[2]; /* device ID */
|
||||
flashtest_l = baseaddr[3];
|
||||
|
||||
if (flashtest_h != flashtest_l)
|
||||
return (0);
|
||||
|
||||
switch (flashtest_h) {
|
||||
case INTEL_ID_28F160C3B:
|
||||
info->flash_id = FLASH_28F160C3B;
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00800000; /* 4 * 2 MB = 8 MB */
|
||||
break;
|
||||
case INTEL_ID_28F160F3B:
|
||||
info->flash_id = FLASH_28F160F3B;
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00800000; /* 4 * 2 MB = 8 MB */
|
||||
break;
|
||||
case INTEL_ID_28F640C3B:
|
||||
info->flash_id = FLASH_28F640C3B;
|
||||
info->sector_count = 135;
|
||||
info->size = 0x02000000; /* 16 * 2 MB = 32 MB */
|
||||
break;
|
||||
default:
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
info->flash_id |= INTEL_MANUFACT << 16; /* set manufacturer offset */
|
||||
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
volatile unsigned long *tmp = baseaddr;
|
||||
|
||||
/* set up sector start adress table (bottom sector type)
|
||||
* AND unlock the sectors (if our chip is 160C3)
|
||||
*/
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (((info->flash_id & FLASH_TYPEMASK) == FLASH_28F160C3B) ||
|
||||
((info->flash_id & FLASH_TYPEMASK) == FLASH_28F640C3B)) {
|
||||
tmp[0] = 0x00600060;
|
||||
tmp[1] = 0x00600060;
|
||||
tmp[0] = 0x00D000D0;
|
||||
tmp[1] = 0x00D000D0;
|
||||
}
|
||||
info->start[i] = (uint) tmp;
|
||||
tmp += i < 8 ? 0x2000 : 0x10000; /* pointer arith */
|
||||
}
|
||||
}
|
||||
|
||||
memset (info->protect, 0, info->sector_count);
|
||||
|
||||
baseaddr[0] = 0x00FF00FF;
|
||||
baseaddr[1] = 0x00FF00FF;
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
static ulong flash_amd_get_size (vu_char *addr, flash_info_t *info)
|
||||
{
|
||||
short i;
|
||||
uchar vendor, devid;
|
||||
ulong base = (ulong)addr;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
addr[0x0555] = 0x90;
|
||||
|
||||
udelay(1000);
|
||||
|
||||
vendor = addr[0];
|
||||
devid = addr[1] & 0xff;
|
||||
|
||||
/* only support AMD */
|
||||
if (vendor != 0x01) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
vendor &= 0xf;
|
||||
devid &= 0xff;
|
||||
|
||||
if (devid == AMD_ID_F040B) {
|
||||
info->flash_id = vendor << 16 | devid;
|
||||
info->sector_count = 8;
|
||||
info->size = info->sector_count * 0x10000;
|
||||
}
|
||||
else if (devid == AMD_ID_F080B) {
|
||||
info->flash_id = vendor << 16 | devid;
|
||||
info->sector_count = 16;
|
||||
info->size = 4 * info->sector_count * 0x10000;
|
||||
}
|
||||
else if (devid == AMD_ID_F016D) {
|
||||
info->flash_id = vendor << 16 | devid;
|
||||
info->sector_count = 32;
|
||||
info->size = 4 * info->sector_count * 0x10000;
|
||||
}
|
||||
else {
|
||||
printf ("## Unknown Flash Type: %02x\n", devid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* sector base address */
|
||||
info->start[i] = base + i * (info->size / info->sector_count);
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
/* D0 = 1 if protected */
|
||||
addr = (volatile unsigned char *)(info->start[i]);
|
||||
info->protect[i] = addr[2] & 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent writes to uninitialized FLASH.
|
||||
*/
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr = (vu_char *)info->start[0];
|
||||
addr[0] = 0xF0; /* reset bank */
|
||||
}
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0 = 0;
|
||||
unsigned long size_b1 = 0;
|
||||
int i;
|
||||
|
||||
/* Init: no FLASHes known
|
||||
*/
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Disable flash protection */
|
||||
CPU86_BCR |= (CPU86_BCR_FWPT | CPU86_BCR_FWRE);
|
||||
|
||||
/* Static FLASH Bank configuration here (only one bank) */
|
||||
|
||||
size_b0 = flash_int_get_size ((ulong *) CFG_FLASH_BASE, &flash_info[0]);
|
||||
size_b1 = flash_amd_get_size ((uchar *) CFG_BOOTROM_BASE, &flash_info[1]);
|
||||
|
||||
if (size_b0 > 0 || size_b1 > 0) {
|
||||
|
||||
printf("(");
|
||||
|
||||
if (size_b0 > 0) {
|
||||
puts ("Bank#1 - ");
|
||||
print_size (size_b0, (size_b1 > 0) ? ", " : ") ");
|
||||
}
|
||||
|
||||
if (size_b1 > 0) {
|
||||
puts ("Bank#2 - ");
|
||||
print_size (size_b1, ") ");
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf ("## No FLASH found.\n");
|
||||
return 0;
|
||||
}
|
||||
/* protect monitor and environment sectors
|
||||
*/
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_BOOTROM_BASE
|
||||
if (size_b1) {
|
||||
/* If U-Boot is booted from ROM the CFG_MONITOR_BASE > CFG_FLASH_BASE
|
||||
* but we shouldn't protect it.
|
||||
*/
|
||||
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[1]
|
||||
);
|
||||
}
|
||||
#else
|
||||
#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
|
||||
#endif
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
# if CFG_ENV_ADDR >= CFG_BOOTROM_BASE
|
||||
if (size_b1) {
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[1]);
|
||||
}
|
||||
# else
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
return (size_b0 + size_b1);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch ((info->flash_id >> 16) & 0xff) {
|
||||
case 0x89:
|
||||
printf ("INTEL ");
|
||||
break;
|
||||
case 0x1:
|
||||
printf ("AMD ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F160C3B:
|
||||
printf ("28F160C3B (16 Mbit, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_28F160F3B:
|
||||
printf ("28F160F3B (16 Mbit, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_28F640C3B:
|
||||
printf ("28F640C3B (64 M, bottom sector)\n");
|
||||
break;
|
||||
case AMD_ID_F040B:
|
||||
printf ("AM29F040B (4 Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (info->size < 0x100000)
|
||||
printf (" Size: %ld KB in %d Sectors\n",
|
||||
info->size >> 10, info->sector_count);
|
||||
else
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " "
|
||||
);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
vu_char *addr = (vu_char *)(info->start[0]);
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
/* Check the type of erased flash
|
||||
*/
|
||||
if (info->flash_id >> 16 == 0x1) {
|
||||
/* Erase AMD flash
|
||||
*/
|
||||
l_sect = -1;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
addr[0x0555] = 0x80;
|
||||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr = (vu_char *)(info->start[sect]);
|
||||
addr[0] = 0x30;
|
||||
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 AMD_DONE;
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
addr = (vu_char *)(info->start[l_sect]);
|
||||
while ((addr[0] & 0x80) != 0x80) {
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return 1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
AMD_DONE:
|
||||
/* reset to read mode */
|
||||
addr = (volatile unsigned char *)info->start[0];
|
||||
addr[0] = 0xF0; /* reset bank */
|
||||
|
||||
} else {
|
||||
/* Erase Intel flash
|
||||
*/
|
||||
|
||||
/* Start erase on unprotected sectors
|
||||
*/
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
volatile ulong *addr =
|
||||
(volatile unsigned long *) info->start[sect];
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
if (info->protect[sect] == 0) {
|
||||
/* Disable interrupts which might cause a timeout here
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Erase the block
|
||||
*/
|
||||
addr[0] = 0x00200020;
|
||||
addr[1] = 0x00200020;
|
||||
addr[0] = 0x00D000D0;
|
||||
addr[1] = 0x00D000D0;
|
||||
|
||||
/* re-enable interrupts if necessary
|
||||
*/
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms
|
||||
*/
|
||||
udelay (1000);
|
||||
|
||||
last = start;
|
||||
while ((addr[0] & 0x00800080) != 0x00800080 ||
|
||||
(addr[1] & 0x00800080) != 0x00800080) {
|
||||
if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout (erase suspended!)\n");
|
||||
/* Suspend erase
|
||||
*/
|
||||
addr[0] = 0x00B000B0;
|
||||
addr[1] = 0x00B000B0;
|
||||
goto DONE;
|
||||
}
|
||||
/* show that we're waiting
|
||||
*/
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
if (addr[0] & 0x00220022 || addr[1] & 0x00220022) {
|
||||
printf ("*** ERROR: erase failed!\n");
|
||||
goto DONE;
|
||||
}
|
||||
}
|
||||
/* Clear status register and reset to read mode
|
||||
*/
|
||||
addr[0] = 0x00500050;
|
||||
addr[1] = 0x00500050;
|
||||
addr[0] = 0x00FF00FF;
|
||||
addr[1] = 0x00FF00FF;
|
||||
}
|
||||
}
|
||||
|
||||
printf (" done\n");
|
||||
|
||||
DONE:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int write_word (flash_info_t *, volatile unsigned long *, ulong);
|
||||
static int write_byte (flash_info_t *info, ulong dest, uchar data);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong v;
|
||||
int i, l, rc, cc = cnt, res = 0;
|
||||
|
||||
if (info->flash_id >> 16 == 0x1) {
|
||||
|
||||
/* Write to AMD 8-bit flash
|
||||
*/
|
||||
while (cnt > 0) {
|
||||
if ((rc = write_byte(info, addr, *src)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
addr++;
|
||||
src++;
|
||||
cnt--;
|
||||
}
|
||||
|
||||
return (0);
|
||||
} else {
|
||||
|
||||
/* Write to Intel 64-bit flash
|
||||
*/
|
||||
for (v=0; cc > 0; addr += 4, cc -= 4 - l) {
|
||||
l = (addr & 3);
|
||||
addr &= ~3;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
v = (v << 8) + (i < l || i - l >= cc ?
|
||||
*((unsigned char *) addr + i) : *src++);
|
||||
}
|
||||
|
||||
if ((res = write_word (info, (volatile unsigned long *) addr, v)) != 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word (flash_info_t * info, volatile unsigned long *addr,
|
||||
ulong data)
|
||||
{
|
||||
int flag, res = 0;
|
||||
ulong start;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased
|
||||
*/
|
||||
if ((*addr & data) != data)
|
||||
return (2);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
*addr = 0x00400040;
|
||||
*addr = data;
|
||||
|
||||
/* re-enable interrupts if necessary
|
||||
*/
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
start = get_timer (0);
|
||||
while ((*addr & 0x00800080) != 0x00800080) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
/* Suspend program
|
||||
*/
|
||||
*addr = 0x00B000B0;
|
||||
res = 1;
|
||||
goto OUT;
|
||||
}
|
||||
}
|
||||
|
||||
if (*addr & 0x00220022) {
|
||||
printf ("*** ERROR: program failed!\n");
|
||||
res = 1;
|
||||
}
|
||||
|
||||
OUT:
|
||||
/* Clear status register and reset to read mode
|
||||
*/
|
||||
*addr = 0x00500050;
|
||||
*addr = 0x00FF00FF;
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a byte to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_byte (flash_info_t *info, ulong dest, uchar data)
|
||||
{
|
||||
vu_char *addr = (vu_char *)(info->start[0]);
|
||||
ulong start;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((vu_char *)dest) & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr[0x0555] = 0xAA;
|
||||
addr[0x02AA] = 0x55;
|
||||
addr[0x0555] = 0xA0;
|
||||
|
||||
*((vu_char *)dest) = data;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((*((vu_char *)dest) & 0x80) != (data & 0x80)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
123
board/cpu87/u-boot.lds
Normal file
123
board/cpu87/u-boot.lds
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2005
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc8260/start.o (.text)
|
||||
*(.text)
|
||||
common/environment.o(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(4096);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(4096);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := cradle.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
SOBJS := lowlevel_init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -186,7 +186,7 @@ board_init (void)
|
||||
led_code (0xf, YELLOW);
|
||||
|
||||
/* arch number of HHP Cradle */
|
||||
gd->bd->bi_arch_number = 174;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_HHP_CRADLE;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0xa0000100;
|
||||
|
||||
@ -30,338 +30,330 @@
|
||||
#define FLASH_BANK_SIZE 0x400000
|
||||
#define MAIN_SECT_SIZE 0x20000
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
ulong flash_init(void)
|
||||
ulong flash_init (void)
|
||||
{
|
||||
int i, j;
|
||||
ulong size = 0;
|
||||
int i, j;
|
||||
ulong size = 0;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++)
|
||||
{
|
||||
ulong flashbase = 0;
|
||||
flash_info[i].flash_id =
|
||||
(INTEL_MANUFACT & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F128J3 & FLASH_TYPEMASK);
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset(flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
flashbase = PHYS_FLASH_1;
|
||||
break;
|
||||
case 1:
|
||||
flashbase = PHYS_FLASH_2;
|
||||
break;
|
||||
default:
|
||||
panic("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++)
|
||||
{
|
||||
flash_info[i].start[j] = flashbase + j*MAIN_SECT_SIZE;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
ulong flashbase = 0;
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
flash_info[i].flash_id =
|
||||
(INTEL_MANUFACT & FLASH_VENDMASK) |
|
||||
(INTEL_ID_28F128J3 & FLASH_TYPEMASK);
|
||||
flash_info[i].size = FLASH_BANK_SIZE;
|
||||
flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
|
||||
memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
|
||||
switch (i) {
|
||||
case 0:
|
||||
flashbase = PHYS_FLASH_1;
|
||||
break;
|
||||
case 1:
|
||||
flashbase = PHYS_FLASH_2;
|
||||
break;
|
||||
default:
|
||||
panic ("configured too many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < flash_info[i].sector_count; j++) {
|
||||
flash_info[i].start[j] =
|
||||
flashbase + j * MAIN_SECT_SIZE;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[0]);
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + monitor_flash_len - 1,
|
||||
&flash_info[0]);
|
||||
|
||||
return size;
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i, j;
|
||||
int i, j;
|
||||
|
||||
for (j=0; j<CFG_MAX_FLASH_BANKS; j++)
|
||||
{
|
||||
switch (info->flash_id & FLASH_VENDMASK)
|
||||
{
|
||||
case (INTEL_MANUFACT & FLASH_VENDMASK):
|
||||
printf("Intel: ");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < CFG_MAX_FLASH_BANKS; j++) {
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case (INTEL_MANUFACT & FLASH_VENDMASK):
|
||||
printf ("Intel: ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK)
|
||||
{
|
||||
case (INTEL_ID_28F320J3A & FLASH_TYPEMASK):
|
||||
printf("28F320J3A (32Mbit)\n");
|
||||
break;
|
||||
case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
|
||||
printf("28F128J3 (128Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Chip Type\n");
|
||||
goto Done;
|
||||
break;
|
||||
}
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case (INTEL_ID_28F320J3A & FLASH_TYPEMASK):
|
||||
printf ("28F320J3A (32Mbit)\n");
|
||||
break;
|
||||
case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
|
||||
printf ("28F128J3 (128Mbit)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
goto Done;
|
||||
break;
|
||||
}
|
||||
|
||||
printf(" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
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");
|
||||
info++;
|
||||
}
|
||||
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");
|
||||
info++;
|
||||
}
|
||||
|
||||
Done:
|
||||
Done: ;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
int rc = ERR_OK;
|
||||
int flag, prot, sect;
|
||||
int rc = ERR_OK;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN)
|
||||
return ERR_UNKNOWN_FLASH_TYPE;
|
||||
if (info->flash_id == FLASH_UNKNOWN)
|
||||
return ERR_UNKNOWN_FLASH_TYPE;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
return ERR_INVAL;
|
||||
}
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
return ERR_INVAL;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) !=
|
||||
(INTEL_MANUFACT & FLASH_VENDMASK)) {
|
||||
return ERR_UNKNOWN_FLASH_VENDOR;
|
||||
}
|
||||
if ((info->flash_id & FLASH_VENDMASK) !=
|
||||
(INTEL_MANUFACT & FLASH_VENDMASK)) {
|
||||
return ERR_UNKNOWN_FLASH_VENDOR;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
if (prot)
|
||||
return ERR_PROTECTED;
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
if (prot)
|
||||
return ERR_PROTECTED;
|
||||
|
||||
/*
|
||||
* Disable interrupts which might cause a timeout
|
||||
* here. Remember that our exception vectors are
|
||||
* at address 0 in the flash, and we don't want a
|
||||
* (ticker) exception to happen while the flash
|
||||
* chip is in programming mode.
|
||||
*/
|
||||
flag = disable_interrupts();
|
||||
/*
|
||||
* Disable interrupts which might cause a timeout
|
||||
* here. Remember that our exception vectors are
|
||||
* at address 0 in the flash, and we don't want a
|
||||
* (ticker) exception to happen while the flash
|
||||
* chip is in programming mode.
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last && !ctrlc(); sect++) {
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last && !ctrlc (); sect++) {
|
||||
|
||||
printf("Erasing sector %2d ... ", sect);
|
||||
printf ("Erasing sector %2d ... ", sect);
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked();
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
vu_short *addr = (vu_short *)(info->start[sect]);
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
vu_short *addr = (vu_short *) (info->start[sect]);
|
||||
|
||||
*addr = 0x20; /* erase setup */
|
||||
*addr = 0xD0; /* erase confirm */
|
||||
*addr = 0x20; /* erase setup */
|
||||
*addr = 0xD0; /* erase confirm */
|
||||
|
||||
while ((*addr & 0x80) != 0x80) {
|
||||
if (get_timer_masked() > CFG_FLASH_ERASE_TOUT) {
|
||||
*addr = 0xB0; /* suspend erase */
|
||||
*addr = 0xFF; /* reset to read mode */
|
||||
rc = ERR_TIMOUT;
|
||||
goto outahere;
|
||||
}
|
||||
}
|
||||
while ((*addr & 0x80) != 0x80) {
|
||||
if (get_timer_masked () >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
*addr = 0xB0; /* suspend erase */
|
||||
*addr = 0xFF; /* reset to read mode */
|
||||
rc = ERR_TIMOUT;
|
||||
goto outahere;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear status register command */
|
||||
*addr = 0x50;
|
||||
/* reset to read mode */
|
||||
*addr = 0xFF;
|
||||
}
|
||||
printf("ok.\n");
|
||||
}
|
||||
if (ctrlc())
|
||||
printf("User Interrupt!\n");
|
||||
/* clear status register command */
|
||||
*addr = 0x50;
|
||||
/* reset to read mode */
|
||||
*addr = 0xFF;
|
||||
}
|
||||
printf ("ok.\n");
|
||||
}
|
||||
if (ctrlc ())
|
||||
printf ("User Interrupt!\n");
|
||||
|
||||
outahere:
|
||||
|
||||
/* allow flash to settle - wait 10 ms */
|
||||
udelay_masked(10000);
|
||||
/* allow flash to settle - wait 10 ms */
|
||||
udelay_masked (10000);
|
||||
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash
|
||||
*/
|
||||
|
||||
static int write_word (flash_info_t *info, ulong dest, ushort data)
|
||||
static int write_word (flash_info_t * info, ulong dest, ushort data)
|
||||
{
|
||||
vu_short *addr = (vu_short *)dest, val;
|
||||
int rc = ERR_OK;
|
||||
int flag;
|
||||
vu_short *addr = (vu_short *) dest, val;
|
||||
int rc = ERR_OK;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased
|
||||
*/
|
||||
if ((*addr & data) != data)
|
||||
return ERR_NOT_ERASED;
|
||||
/* Check if Flash is (sufficiently) erased
|
||||
*/
|
||||
if ((*addr & data) != data)
|
||||
return ERR_NOT_ERASED;
|
||||
|
||||
/*
|
||||
* Disable interrupts which might cause a timeout
|
||||
* here. Remember that our exception vectors are
|
||||
* at address 0 in the flash, and we don't want a
|
||||
* (ticker) exception to happen while the flash
|
||||
* chip is in programming mode.
|
||||
*/
|
||||
flag = disable_interrupts();
|
||||
/*
|
||||
* Disable interrupts which might cause a timeout
|
||||
* here. Remember that our exception vectors are
|
||||
* at address 0 in the flash, and we don't want a
|
||||
* (ticker) exception to happen while the flash
|
||||
* chip is in programming mode.
|
||||
*/
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* clear status register command */
|
||||
*addr = 0x50;
|
||||
/* clear status register command */
|
||||
*addr = 0x50;
|
||||
|
||||
/* program set-up command */
|
||||
*addr = 0x40;
|
||||
/* program set-up command */
|
||||
*addr = 0x40;
|
||||
|
||||
/* latch address/data */
|
||||
*addr = data;
|
||||
/* latch address/data */
|
||||
*addr = data;
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked();
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
/* wait while polling the status register */
|
||||
while(((val = *addr) & 0x80) != 0x80)
|
||||
{
|
||||
if (get_timer_masked() > CFG_FLASH_WRITE_TOUT) {
|
||||
rc = ERR_TIMOUT;
|
||||
/* suspend program command */
|
||||
*addr = 0xB0;
|
||||
goto outahere;
|
||||
}
|
||||
}
|
||||
/* wait while polling the status register */
|
||||
while (((val = *addr) & 0x80) != 0x80) {
|
||||
if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
|
||||
rc = ERR_TIMOUT;
|
||||
/* suspend program command */
|
||||
*addr = 0xB0;
|
||||
goto outahere;
|
||||
}
|
||||
}
|
||||
|
||||
if(val & 0x1A) { /* check for error */
|
||||
printf("\nFlash write error %02x at address %08lx\n",
|
||||
(int)val, (unsigned long)dest);
|
||||
if(val & (1<<3)) {
|
||||
printf("Voltage range error.\n");
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
if(val & (1<<1)) {
|
||||
printf("Device protect error.\n");
|
||||
rc = ERR_PROTECTED;
|
||||
goto outahere;
|
||||
}
|
||||
if(val & (1<<4)) {
|
||||
printf("Programming error.\n");
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
if (val & 0x1A) { /* check for error */
|
||||
printf ("\nFlash write error %02x at address %08lx\n",
|
||||
(int) val, (unsigned long) dest);
|
||||
if (val & (1 << 3)) {
|
||||
printf ("Voltage range error.\n");
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
if (val & (1 << 1)) {
|
||||
printf ("Device protect error.\n");
|
||||
rc = ERR_PROTECTED;
|
||||
goto outahere;
|
||||
}
|
||||
if (val & (1 << 4)) {
|
||||
printf ("Programming error.\n");
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
rc = ERR_PROG_ERROR;
|
||||
goto outahere;
|
||||
}
|
||||
|
||||
outahere:
|
||||
/* read array command */
|
||||
*addr = 0xFF;
|
||||
/* read array command */
|
||||
*addr = 0xFF;
|
||||
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
return rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash.
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp;
|
||||
ushort data;
|
||||
int l;
|
||||
int i, rc;
|
||||
ulong cp, wp;
|
||||
ushort data;
|
||||
int l;
|
||||
int i, rc;
|
||||
|
||||
wp = (addr & ~1); /* get lower word aligned address */
|
||||
wp = (addr & ~1); /* 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 << 8);
|
||||
}
|
||||
for (; i<2 && cnt>0; ++i) {
|
||||
data = (data >> 8) | (*src++ << 8);
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt==0 && i<2; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 8);
|
||||
}
|
||||
/*
|
||||
* 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 << 8);
|
||||
}
|
||||
for (; i < 2 && cnt > 0; ++i) {
|
||||
data = (data >> 8) | (*src++ << 8);
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < 2; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *) cp << 8);
|
||||
}
|
||||
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 2;
|
||||
}
|
||||
if ((rc = write_word (info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 2) {
|
||||
data = *((vu_short*)src);
|
||||
if ((rc = write_word(info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
src += 2;
|
||||
wp += 2;
|
||||
cnt -= 2;
|
||||
}
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 2) {
|
||||
data = *((vu_short *) src);
|
||||
if ((rc = write_word (info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
src += 2;
|
||||
wp += 2;
|
||||
cnt -= 2;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return ERR_OK;
|
||||
}
|
||||
if (cnt == 0) {
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i=0, cp=wp; i<2 && cnt>0; ++i, ++cp) {
|
||||
data = (data >> 8) | (*src++ << 8);
|
||||
--cnt;
|
||||
}
|
||||
for (; i<2; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *)cp << 8);
|
||||
}
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < 2 && cnt > 0; ++i, ++cp) {
|
||||
data = (data >> 8) | (*src++ << 8);
|
||||
--cnt;
|
||||
}
|
||||
for (; i < 2; ++i, ++cp) {
|
||||
data = (data >> 8) | (*(uchar *) cp << 8);
|
||||
}
|
||||
|
||||
return write_word(info, wp, data);
|
||||
return write_word (info, wp, data);
|
||||
}
|
||||
|
||||
@ -43,8 +43,8 @@ DRAM_SIZE: .long CFG_DRAM_SIZE
|
||||
.endm
|
||||
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
mov r10, lr
|
||||
|
||||
@ -512,4 +512,4 @@ mem_init:
|
||||
|
||||
mov pc, r10
|
||||
|
||||
@ End memsetup
|
||||
@ End lowlevel_init
|
||||
@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := csb226.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
SOBJS := lowlevel_init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -71,7 +71,7 @@ int board_init (void)
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* arch number of CSB226 board */
|
||||
gd->bd->bi_arch_number = 216;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_CSB226;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0xa0000100;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
*
|
||||
* NOTE: I haven't clean this up considerably, just enough to get it
|
||||
* running. See hal_platform_setup.h for the source. See
|
||||
* board/cradle/memsetup.S for another PXA250 setup that is
|
||||
* board/cradle/lowlevel_init.S for another PXA250 setup that is
|
||||
* much cleaner.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@ -46,8 +46,8 @@ _TEXT_BASE:
|
||||
* Memory setup
|
||||
*/
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
mov r10, lr
|
||||
|
||||
@ -429,9 +429,9 @@ initclks:
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* End memsetup */
|
||||
/* End lowlevel_init */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
endmemsetup:
|
||||
endlowlevel_init:
|
||||
|
||||
mov pc, lr
|
||||
@ -129,7 +129,7 @@ ext_bus_cntlr_init:
|
||||
*******************************************************************/
|
||||
/*WDCR_EBC(pb3ap, 0x07869200)*/
|
||||
WDCR_EBC(pb3ap, 0x04055200)
|
||||
WDCR_EBC(pb3cr, 0xff01c000)
|
||||
WDCR_EBC(pb3cr, 0xf081c000)
|
||||
/********************************************************************
|
||||
* Memory Bank 1,2,4-7 (Unused) initialization
|
||||
*******************************************************************/
|
||||
|
||||
@ -109,7 +109,7 @@ int board_init (void)
|
||||
PDATF = temp;
|
||||
|
||||
/* arch number MACH_TYPE_MBA44B0 */
|
||||
gd->bd->bi_arch_number = 178;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_S3C44B0;
|
||||
|
||||
/* location of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x0c000100;
|
||||
|
||||
@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := B2.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
SOBJS := lowlevel_init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -149,8 +149,8 @@ MEMORY_CONFIG:
|
||||
.word 0x20 /*MRSR7*/
|
||||
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
/*
|
||||
the next instruction fail due memory relocation...
|
||||
@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
SOBJS = memsetup.o
|
||||
SOBJS = lowlevel_init.o
|
||||
|
||||
$(LIB): .depend $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -1,30 +1,40 @@
|
||||
By Thomas.Lange@corelatus.se 2003-10-06
|
||||
By Thomas.Lange@corelatus.se 2004-Oct-05
|
||||
----------------------------------------
|
||||
DbAu1000 is a development board from AMD containing
|
||||
an Alchemy AU1000 with mips32 core.
|
||||
DbAu1xx0 are development boards from AMD containing
|
||||
an Alchemy AU1xx0 series cpu with mips32 core.
|
||||
Existing cpu:s are Au1000, Au1100, Au1500 and Au1550
|
||||
|
||||
Limitations & comments
|
||||
----------------------
|
||||
I assume that you set board to BIG endian!
|
||||
Little endian not tested, most probably broken.
|
||||
Support was originally big endian only.
|
||||
I have not tested, but several u-boot users report working
|
||||
configurations in little endian mode.
|
||||
|
||||
I named the board dbau1x00, to allow
|
||||
support for all three development boards
|
||||
some day ( dbau1000, dbau1100 and dbau1500 ).
|
||||
( dbau1000, dbau1100 and dbau1500 ).
|
||||
Now there is a new board called dbau1550 also, which
|
||||
should be supported RSN.
|
||||
|
||||
I only have a dbau1000, so all testing is limited
|
||||
to this board!
|
||||
I only have a dbau1000, so my testing is limited
|
||||
to this board.
|
||||
|
||||
The board has two different flash banks, that can
|
||||
be selected via dip switch. This makes it possible
|
||||
to test new bootloaders without thrashing the YAMON
|
||||
boot loader deliviered with board.
|
||||
boot loader delivered with board.
|
||||
|
||||
NOTE! When you switch between the two boot flashes, the
|
||||
base addresses will be swapped.
|
||||
Have this in mind when you compile u-boot. TEXT_BASE has
|
||||
to match the address where u-boot is located when you
|
||||
actually launch.
|
||||
|
||||
Ethernet only supported for mac0.
|
||||
|
||||
Pcmcia only supported for slot 0, only 3.3V.
|
||||
PCMCIA only supported for slot 0, only 3.3V.
|
||||
|
||||
Pcmcia IDE tested with Sandisk Compact Flash and
|
||||
PCMCIA IDE tested with Sandisk Compact Flash and
|
||||
IBM microdrive.
|
||||
|
||||
###################################
|
||||
@ -32,7 +42,7 @@ IBM microdrive.
|
||||
###################################
|
||||
If you partition a disk on another system (e.g. laptop),
|
||||
all bytes will be swapped on 16bit level when using
|
||||
PCMCIA!!!!
|
||||
PCMCIA and running cpu in big endian mode!!!!
|
||||
|
||||
This is probably due to an error in Au1000 chip.
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ long int initdram(int board_type)
|
||||
{
|
||||
/* Sdram is setup by assembler code */
|
||||
/* If memory could be changed, we should return the true value here */
|
||||
return 64*1024*1024;
|
||||
return MEM_SIZE*1024*1024;
|
||||
}
|
||||
|
||||
#define BCSR_PCMCIA_PC0DRVEN 0x0010
|
||||
@ -41,9 +41,11 @@ void write_one_tlb( int index, u32 pagemask, u32 hi, u32 low0, u32 low1 );
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
#ifdef CONFIG_IDE_PCMCIA
|
||||
u16 status;
|
||||
volatile u32 *pcmcia_bcsr = (u32*)(DB1000_BCSR_ADDR+0x10);
|
||||
volatile u32 *phy = (u32*)(DB1000_BCSR_ADDR+0xC);
|
||||
volatile u32 *pcmcia_bcsr = (u32*)(DB1XX0_BCSR_ADDR+0x10);
|
||||
#endif /* CONFIG_IDE_PCMCIA */
|
||||
volatile u32 *phy = (u32*)(DB1XX0_BCSR_ADDR+0xC);
|
||||
volatile u32 *sys_counter = (volatile u32*)SYS_COUNTER_CNTRL;
|
||||
u32 proc_id;
|
||||
|
||||
@ -67,6 +69,11 @@ int checkboard (void)
|
||||
printf ("CPU: Au1100, id: 0x%02x, rev: 0x%02x\n",
|
||||
(proc_id >> 8) & 0xFF, proc_id & 0xFF);
|
||||
break;
|
||||
case 3:
|
||||
puts ("Board: DbAu1550\n");
|
||||
printf ("CPU: Au1550, id: 0x%02x, rev: 0x%02x\n",
|
||||
(proc_id >> 8) & 0xFF, proc_id & 0xFF);
|
||||
break;
|
||||
default:
|
||||
printf ("Unsupported cpu %d, proc_id=0x%x\n", proc_id >> 24, proc_id);
|
||||
}
|
||||
|
||||
@ -9,20 +9,34 @@
|
||||
#define AU1500_SYS_ADDR 0xB1900000
|
||||
#define sys_endian 0x0038
|
||||
#define CP0_Config0 $16
|
||||
#define MEM_1MS ((396000000/1000000) * 1000)
|
||||
#define CPU_SCALE ((CFG_MHZ) / 12) /* CPU clock is a multiple of 12 MHz */
|
||||
#define MEM_1MS ((CFG_MHZ) * 1000)
|
||||
|
||||
.text
|
||||
.set noreorder
|
||||
.set mips32
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
/*
|
||||
* Step 1) Establish CPU endian mode.
|
||||
* Db1500-specific:
|
||||
* Switch S1.1 Off(bit7 reads 1) is Little Endian
|
||||
* Switch S1.1 On (bit7 reads 0) is Big Endian
|
||||
*/
|
||||
#ifdef CONFIG_DBAU1550
|
||||
li t0, MEM_STCFG2
|
||||
li t1, 0x00000040
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STTIME2
|
||||
li t1, 0x22080a20
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR2
|
||||
li t1, 0x10c03f00
|
||||
sw t1, 0(t0)
|
||||
#else
|
||||
li t0, MEM_STCFG1
|
||||
li t1, 0x00000080
|
||||
sw t1, 0(t0)
|
||||
@ -34,9 +48,10 @@ memsetup:
|
||||
li t0, MEM_STADDR1
|
||||
li t1, 0x10c03f00
|
||||
sw t1, 0(t0)
|
||||
#endif
|
||||
|
||||
li t0, 0xAE000008
|
||||
lw t1,0(t0)
|
||||
li t0, DB1XX0_BCSR_ADDR
|
||||
lw t1,8(t0)
|
||||
andi t1,t1,0x80
|
||||
beq zero,t1,big_endian
|
||||
nop
|
||||
@ -98,10 +113,82 @@ big_endian:
|
||||
mtc0 zero, CP0_WIRED
|
||||
nop
|
||||
|
||||
#ifdef CONFIG_DBAU1550
|
||||
/* No workaround if running from ram */
|
||||
lui t0, 0xffc0
|
||||
lui t3, 0xbfc0
|
||||
and t1, ra, t0
|
||||
bne t1, t3, noCacheJump
|
||||
nop
|
||||
|
||||
/*** From AMD YAMON ***/
|
||||
/*
|
||||
* Step 8) Initialize the caches
|
||||
*/
|
||||
li t0, (16*1024)
|
||||
li t1, 32
|
||||
li t2, 0x80000000
|
||||
addu t3, t0, t2
|
||||
cacheloop:
|
||||
cache 0, 0(t2)
|
||||
cache 1, 0(t2)
|
||||
addu t2, t1
|
||||
bne t2, t3, cacheloop
|
||||
nop
|
||||
|
||||
/* Save return address */
|
||||
move t3, ra
|
||||
|
||||
/* Run from cacheable space now */
|
||||
bal cachehere
|
||||
nop
|
||||
cachehere:
|
||||
li t1, ~0x20000000 /* convert to KSEG0 */
|
||||
and t0, ra, t1
|
||||
addi t0, 5*4 /* 5 insns beyond cachehere */
|
||||
jr t0
|
||||
nop
|
||||
|
||||
/* Restore return address */
|
||||
move ra, t3
|
||||
|
||||
/*
|
||||
* Step 9) Initialize the TLB
|
||||
*/
|
||||
li t0, 0 # index value
|
||||
li t1, 0x00000000 # entryhi value
|
||||
li t2, 32 # 32 entries
|
||||
|
||||
tlbloop:
|
||||
/* Probe TLB for matching EntryHi */
|
||||
mtc0 t1, CP0_ENTRYHI
|
||||
tlbp
|
||||
nop
|
||||
|
||||
/* Examine Index[P], 1=no matching entry */
|
||||
mfc0 t3, CP0_INDEX
|
||||
li t4, 0x80000000
|
||||
and t3, t4, t3
|
||||
addiu t1, t1, 1 # increment t1 (asid)
|
||||
beq zero, t3, tlbloop
|
||||
nop
|
||||
|
||||
/* Initialize the TLB entry */
|
||||
mtc0 t0, CP0_INDEX
|
||||
mtc0 zero, CP0_ENTRYLO0
|
||||
mtc0 zero, CP0_ENTRYLO1
|
||||
mtc0 zero, CP0_PAGEMASK
|
||||
tlbwi
|
||||
|
||||
/* Do it again */
|
||||
addiu t0, t0, 1
|
||||
bne t0, t2, tlbloop
|
||||
nop
|
||||
|
||||
/* First setup pll:s to make serial work ok */
|
||||
/* We have a 12 MHz crystal */
|
||||
li t0, SYS_CPUPLL
|
||||
li t1, 0x21 /* 396 MHz */
|
||||
li t1, CPU_SCALE /* CPU clock */
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
nop
|
||||
@ -119,19 +206,49 @@ big_endian:
|
||||
sync
|
||||
|
||||
/* Static memory controller */
|
||||
/* RCE0 - can not change while fetching, do so from icache */
|
||||
move t2, ra /* Store return address */
|
||||
bal getAddr
|
||||
nop
|
||||
|
||||
getAddr:
|
||||
move t1, ra
|
||||
move ra, t2 /* Move return addess back */
|
||||
|
||||
cache 0x14,0(t1)
|
||||
cache 0x14,32(t1)
|
||||
/*** /From YAMON ***/
|
||||
|
||||
noCacheJump:
|
||||
#endif /* CONFIG_DBAU1550 */
|
||||
|
||||
#ifdef CONFIG_DBAU1550
|
||||
li t0, MEM_STTIME0
|
||||
li t1, 0x040181D7
|
||||
sw t1, 0(t0)
|
||||
|
||||
/* RCE0 AMD MirrorBit Flash (?) */
|
||||
li t0, MEM_STCFG0
|
||||
li t1, 0x00000003
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR0
|
||||
li t1, 0x11803E00
|
||||
sw t1, 0(t0)
|
||||
#else /* CONFIG_DBAU1550 */
|
||||
li t0, MEM_STTIME0
|
||||
li t1, 0x00014C0F
|
||||
sw t1, 0(t0)
|
||||
|
||||
/* RCE0 AMD 29LV640M MirrorBit Flash */
|
||||
li t0, MEM_STCFG0
|
||||
li t1, 0x00000013
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STTIME0
|
||||
li t1, 0x040181D7
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR0
|
||||
li t1, 0x11E03F80
|
||||
sw t1, 0(t0)
|
||||
#endif /* CONFIG_DBAU1550 */
|
||||
|
||||
/* RCE1 CPLD Board Logic */
|
||||
li t0, MEM_STCFG1
|
||||
@ -146,7 +263,20 @@ big_endian:
|
||||
li t1, 0x10c03f00
|
||||
sw t1, 0(t0)
|
||||
|
||||
#ifdef CONFIG_DBAU1550
|
||||
/* RCE2 CPLD Board Logic */
|
||||
li t0, MEM_STCFG2
|
||||
li t1, 0x00000040
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STTIME2
|
||||
li t1, 0x22080a20
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_STADDR2
|
||||
li t1, 0x10c03f00
|
||||
sw t1, 0(t0)
|
||||
#else
|
||||
li t0, MEM_STCFG2
|
||||
li t1, 0x00000000
|
||||
sw t1, 0(t0)
|
||||
@ -158,6 +288,7 @@ big_endian:
|
||||
li t0, MEM_STADDR2
|
||||
li t1, 0x00000000
|
||||
sw t1, 0(t0)
|
||||
#endif
|
||||
|
||||
/* RCE3 PCMCIA 250ns */
|
||||
li t0, MEM_STCFG3
|
||||
@ -281,6 +412,99 @@ big_endian:
|
||||
bne t1, zero, 1b
|
||||
nop
|
||||
|
||||
#ifdef CONFIG_DBAU1550
|
||||
/* SDCS 0,1,2 DDR SDRAM */
|
||||
li t0, MEM_SDMODE0
|
||||
li t1, 0x04276221
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDMODE1
|
||||
li t1, 0x04276221
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDMODE2
|
||||
li t1, 0x04276221
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDADDR0
|
||||
li t1, 0xe21003f0
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDADDR1
|
||||
li t1, 0xe21043f0
|
||||
sw t1, 0(t0)
|
||||
|
||||
li t0, MEM_SDADDR2
|
||||
li t1, 0xe21083f0
|
||||
sw t1, 0(t0)
|
||||
|
||||
sync
|
||||
|
||||
li t0, MEM_SDCONFIGA
|
||||
li t1, 0x9030060a /* Program refresh - disabled */
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDCONFIGB
|
||||
li t1, 0x00028000
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDPRECMD /* Precharge all */
|
||||
li t1, 0
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD0
|
||||
li t1, 0x40000000
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD1
|
||||
li t1, 0x40000000
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD2
|
||||
li t1, 0x40000000
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD0
|
||||
li t1, 0x00000063
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD1
|
||||
li t1, 0x00000063
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDWRMD2
|
||||
li t1, 0x00000063
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDPRECMD /* Precharge all */
|
||||
sw zero, 0(t0)
|
||||
sync
|
||||
|
||||
/* Issue 2 autoref */
|
||||
li t0, MEM_SDAUTOREF
|
||||
sw zero, 0(t0)
|
||||
sync
|
||||
|
||||
li t0, MEM_SDAUTOREF
|
||||
sw zero, 0(t0)
|
||||
sync
|
||||
|
||||
/* Enable refresh */
|
||||
li t0, MEM_SDCONFIGA
|
||||
li t1, 0x9830060a /* Program refresh - enabled */
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
#else /* CONFIG_DBAU1550 */
|
||||
/* SDCS 0,1 SDRAM */
|
||||
li t0, MEM_SDMODE0
|
||||
li t1, 0x005522AA
|
||||
@ -339,6 +563,7 @@ big_endian:
|
||||
sw t1, 0(t0)
|
||||
sync
|
||||
|
||||
#endif /* CONFIG_DBAU1550 */
|
||||
/* wait 1mS after setup */
|
||||
li t1, MEM_1MS
|
||||
1: add t1, -1
|
||||
@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := dnp1110.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
SOBJS := lowlevel_init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -39,7 +39,7 @@ int board_init (void)
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* arch number of DNP1110-Board */
|
||||
gd->bd->bi_arch_number = 255;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_DNP1110;
|
||||
|
||||
/* flash vpp on */
|
||||
PPDR |= 0x80; /* assumes LCD controller is off */
|
||||
|
||||
@ -63,8 +63,8 @@ smcnfg: .long 0x00000000
|
||||
|
||||
/* setting up the memory */
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
ldr r0, MEM_BASE
|
||||
|
||||
@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := ep7312.o flash.o
|
||||
SOBJS := memsetup.o
|
||||
SOBJS := lowlevel_init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
@ -40,7 +40,7 @@ int board_init (void)
|
||||
IO_LEDFLSH = 0x40;
|
||||
|
||||
/* arch number MACH_TYPE_EDB7312 */
|
||||
gd->bd->bi_arch_number = 131;
|
||||
gd->bd->bi_arch_number = MACH_TYPE_EDB7312;
|
||||
|
||||
/* location of boot parameters */
|
||||
gd->bd->bi_boot_params = 0xc0020100;
|
||||
|
||||
@ -109,7 +109,7 @@ void flash_print_info (flash_info_t * info)
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
Done:
|
||||
Done: ;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
|
||||
@ -45,8 +45,8 @@ sdrfpr_val: .long 0x00000240
|
||||
sdconf_val: .long 0x00000522
|
||||
/* setting up the memory */
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
/*
|
||||
* SYSCON1-3
|
||||
*/
|
||||
@ -227,6 +227,10 @@ int checkboard (void)
|
||||
major = 1;
|
||||
minor = 1;
|
||||
break;
|
||||
case 0x06:
|
||||
major = 1;
|
||||
minor = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -42,250 +42,265 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
*/
|
||||
void flash_reset(void)
|
||||
{
|
||||
if( flash_info[0].flash_id != FLASH_UNKNOWN ) {
|
||||
V_ULONG( flash_info[0].start[0] ) = 0x00F000F0;
|
||||
V_ULONG( flash_info[0].start[0] + 4 ) = 0x00F000F0;
|
||||
}
|
||||
if( flash_info[0].flash_id != FLASH_UNKNOWN ) {
|
||||
V_ULONG( flash_info[0].start[0] ) = 0x00F000F0;
|
||||
V_ULONG( flash_info[0].start[0] + 4 ) = 0x00F000F0;
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
ulong flash_get_size( ulong baseaddr, flash_info_t *info )
|
||||
{
|
||||
short i;
|
||||
unsigned long flashtest_h, flashtest_l;
|
||||
short i;
|
||||
unsigned long flashtest_h, flashtest_l;
|
||||
|
||||
/* Write auto select command sequence and test FLASH answer */
|
||||
V_ULONG(baseaddr + ((ulong)0x0555 << 3)) = 0x00AA00AA;
|
||||
V_ULONG(baseaddr + ((ulong)0x02AA << 3)) = 0x00550055;
|
||||
V_ULONG(baseaddr + ((ulong)0x0555 << 3)) = 0x00900090;
|
||||
V_ULONG(baseaddr + 4 + ((ulong)0x0555 << 3)) = 0x00AA00AA;
|
||||
V_ULONG(baseaddr + 4 + ((ulong)0x02AA << 3)) = 0x00550055;
|
||||
V_ULONG(baseaddr + 4 + ((ulong)0x0555 << 3)) = 0x00900090;
|
||||
/* Write auto select command sequence and test FLASH answer */
|
||||
V_ULONG(baseaddr + ((ulong)0x0555 << 3)) = 0x00AA00AA;
|
||||
V_ULONG(baseaddr + ((ulong)0x02AA << 3)) = 0x00550055;
|
||||
V_ULONG(baseaddr + ((ulong)0x0555 << 3)) = 0x00900090;
|
||||
V_ULONG(baseaddr + 4 + ((ulong)0x0555 << 3)) = 0x00AA00AA;
|
||||
V_ULONG(baseaddr + 4 + ((ulong)0x02AA << 3)) = 0x00550055;
|
||||
V_ULONG(baseaddr + 4 + ((ulong)0x0555 << 3)) = 0x00900090;
|
||||
|
||||
flashtest_h = V_ULONG(baseaddr); /* manufacturer ID */
|
||||
flashtest_l = V_ULONG(baseaddr + 4);
|
||||
flashtest_h = V_ULONG(baseaddr); /* manufacturer ID */
|
||||
flashtest_l = V_ULONG(baseaddr + 4);
|
||||
|
||||
if ((int)flashtest_h == AMD_MANUFACT) {
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
} else {
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
if ((int)flashtest_h == AMD_MANUFACT) {
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
} else {
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
flashtest_h = V_ULONG(baseaddr + 8); /* device ID */
|
||||
flashtest_l = V_ULONG(baseaddr + 12);
|
||||
if (flashtest_h != flashtest_l) {
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return(0);
|
||||
}
|
||||
if (flashtest_h == AMD_ID_DL323B) {
|
||||
info->flash_id += FLASH_AMDL323B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x01000000; /* 4 * 4 MB = 16 MB */
|
||||
} else {
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return(0); /* no or unknown flash */
|
||||
}
|
||||
flashtest_h = V_ULONG(baseaddr + 8); /* device ID */
|
||||
flashtest_l = V_ULONG(baseaddr + 12);
|
||||
if (flashtest_h != flashtest_l) {
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* set up sector start adress table (bottom sector type) */
|
||||
for (i = 0; i < 8; i++) {
|
||||
info->start[i] = baseaddr + (i * 0x00008000);
|
||||
}
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = baseaddr + (i * 0x00040000) - 0x001C0000;
|
||||
}
|
||||
switch((int)flashtest_h) {
|
||||
case AMD_ID_DL323B:
|
||||
info->flash_id += FLASH_AMDL323B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x01000000; /* 4 * 4 MB = 16 MB */
|
||||
break;
|
||||
case AMD_ID_LV640U: /* AMDLV640 and AMDLV641 have same ID */
|
||||
info->flash_id += FLASH_AMLV640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x02000000; /* 4 * 8 MB = 32 MB */
|
||||
break;
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
return(0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
if ((V_ULONG( info->start[i] + 16 ) & 0x00010001) ||
|
||||
(V_ULONG( info->start[i] + 20 ) & 0x00010001)) {
|
||||
info->protect[i] = 1; /* D0 = 1 if protected */
|
||||
} else {
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
}
|
||||
if(flashtest_h == AMD_ID_LV640U) {
|
||||
/* set up sector start adress table (uniform sector type) */
|
||||
for (i = 0; i < info->sector_count; i++)
|
||||
info->start[i] = baseaddr + (i * 0x00040000);
|
||||
} else {
|
||||
/* set up sector start adress table (bottom sector type) */
|
||||
for (i = 0; i < 8; i++) {
|
||||
info->start[i] = baseaddr + (i * 0x00008000);
|
||||
}
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = baseaddr + (i * 0x00040000) - 0x001C0000;
|
||||
}
|
||||
}
|
||||
/* check for protected sectors */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
/* read sector protection at sector address, (A7 .. A0) = 0x02 */
|
||||
if ((V_ULONG( info->start[i] + 16 ) & 0x00010001) ||
|
||||
(V_ULONG( info->start[i] + 20 ) & 0x00010001)) {
|
||||
info->protect[i] = 1; /* D0 = 1 if protected */
|
||||
} else {
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
flash_reset();
|
||||
return(info->size);
|
||||
flash_reset();
|
||||
return(info->size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0 = 0;
|
||||
int i;
|
||||
unsigned long size_b0 = 0;
|
||||
int i;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Static FLASH Bank configuration here (only one bank) */
|
||||
/* Static FLASH Bank configuration here (only one bank) */
|
||||
|
||||
size_b0 = flash_get_size(CFG_FLASH0_BASE, &flash_info[0]);
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0>>20);
|
||||
}
|
||||
size_b0 = flash_get_size(CFG_FLASH0_BASE, &flash_info[0]);
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0) {
|
||||
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
|
||||
size_b0, size_b0>>20);
|
||||
}
|
||||
|
||||
/*
|
||||
* protect monitor and environment sectors
|
||||
*/
|
||||
/*
|
||||
* 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]);
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE+monitor_flash_len-1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[0]);
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
return (size_b0);
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch ((info->flash_id >> 16) & 0xff) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AMDL323B: printf ("29DL323B (32 M, bottom sector)\n");
|
||||
break;
|
||||
case FLASH_AMLV640U: printf ("29LV640U (64 M, uniform 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;
|
||||
}
|
||||
|
||||
switch ((info->flash_id >> 16) & 0xff) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AMDL323B: printf ("29DL323B (32 M, bottom sector)\n");
|
||||
break;
|
||||
default: printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " "
|
||||
);
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
int flag, prot, sect, l_sect;
|
||||
ulong start, now, last;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect])
|
||||
prot++;
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
printf ("\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect])
|
||||
prot++;
|
||||
}
|
||||
l_sect = -1;
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
l_sect = -1;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00800080;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + 4 + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00800080;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + 4 + (0x02AA << 3) ) = 0x00550055;
|
||||
udelay (1000);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00800080;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + 4 + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00800080;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + 4 + (0x02AA << 3) ) = 0x00550055;
|
||||
udelay (1000);
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
V_ULONG( info->start[sect] ) = 0x00300030;
|
||||
V_ULONG( info->start[sect] + 4 ) = 0x00300030;
|
||||
l_sect = sect;
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
V_ULONG( info->start[sect] ) = 0x00300030;
|
||||
V_ULONG( info->start[sect] + 4 ) = 0x00300030;
|
||||
l_sect = sect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/*
|
||||
* We wait for the last triggered sector
|
||||
*/
|
||||
if (l_sect < 0)
|
||||
goto DONE;
|
||||
/*
|
||||
* We wait for the last triggered sector
|
||||
*/
|
||||
if (l_sect < 0)
|
||||
goto DONE;
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
while ((V_ULONG( info->start[l_sect] ) & 0x00800080) != 0x00800080 ||
|
||||
(V_ULONG( info->start[l_sect] + 4 ) & 0x00800080) != 0x00800080)
|
||||
{
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return 1;
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
while ((V_ULONG( info->start[l_sect] ) & 0x00800080) != 0x00800080 ||
|
||||
(V_ULONG( info->start[l_sect] + 4 ) & 0x00800080) != 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 */
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) { /* every second */
|
||||
serial_putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
flash_reset ();
|
||||
DONE:
|
||||
/* reset to read mode */
|
||||
flash_reset ();
|
||||
|
||||
printf (" done\n");
|
||||
return 0;
|
||||
printf (" done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int write_dword (flash_info_t *, ulong, unsigned char *);
|
||||
@ -299,49 +314,49 @@ static int write_dword (flash_info_t *, ulong, unsigned char *);
|
||||
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong dp;
|
||||
static unsigned char bb[8];
|
||||
int i, l, rc, cc = cnt;
|
||||
ulong dp;
|
||||
static unsigned char bb[8];
|
||||
int i, l, rc, cc = cnt;
|
||||
|
||||
dp = (addr & ~7); /* get lower dword aligned address */
|
||||
dp = (addr & ~7); /* get lower dword aligned address */
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - dp) != 0) {
|
||||
for (i = 0; i < 8; i++)
|
||||
bb[i] = (i < l || (i-l) >= cc) ? V_BYTE(dp+i) : *src++;
|
||||
if ((rc = write_dword(info, dp, bb)) != 0)
|
||||
{
|
||||
return (rc);
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - dp) != 0) {
|
||||
for (i = 0; i < 8; i++)
|
||||
bb[i] = (i < l || (i-l) >= cc) ? V_BYTE(dp+i) : *src++;
|
||||
if ((rc = write_dword(info, dp, bb)) != 0)
|
||||
{
|
||||
return (rc);
|
||||
}
|
||||
dp += 8;
|
||||
cc -= 8 - l;
|
||||
}
|
||||
dp += 8;
|
||||
cc -= 8 - l;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cc >= 8) {
|
||||
if ((rc = write_dword(info, dp, src)) != 0) {
|
||||
return (rc);
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cc >= 8) {
|
||||
if ((rc = write_dword(info, dp, src)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
dp += 8;
|
||||
src += 8;
|
||||
cc -= 8;
|
||||
}
|
||||
dp += 8;
|
||||
src += 8;
|
||||
cc -= 8;
|
||||
}
|
||||
|
||||
if (cc <= 0) {
|
||||
return (0);
|
||||
}
|
||||
if (cc <= 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
for (i = 0; i < 8; i++) {
|
||||
bb[i] = (i < cc) ? *src++ : V_BYTE(dp+i);
|
||||
}
|
||||
return (write_dword(info, dp, bb));
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
for (i = 0; i < 8; i++) {
|
||||
bb[i] = (i < cc) ? *src++ : V_BYTE(dp+i);
|
||||
}
|
||||
return (write_dword(info, dp, bb));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
@ -352,45 +367,45 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
*/
|
||||
static int write_dword (flash_info_t *info, ulong dest, unsigned char * pdata)
|
||||
{
|
||||
ulong start;
|
||||
ulong cl = 0, ch =0;
|
||||
int flag, i;
|
||||
ulong start;
|
||||
ulong cl = 0, ch =0;
|
||||
int flag, i;
|
||||
|
||||
for (ch=0, i=0; i < 4; i++)
|
||||
ch = (ch << 8) + *pdata++; /* high word */
|
||||
for (cl=0, i=0; i < 4; i++)
|
||||
cl = (cl << 8) + *pdata++; /* low word */
|
||||
for (ch=0, i=0; i < 4; i++)
|
||||
ch = (ch << 8) + *pdata++; /* high word */
|
||||
for (cl=0, i=0; i < 4; i++)
|
||||
cl = (cl << 8) + *pdata++; /* low word */
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((vu_long *)dest) & ch) != ch
|
||||
||(*((vu_long *)(dest + 4)) & cl) != cl)
|
||||
{
|
||||
return (2);
|
||||
}
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00A000A0;
|
||||
V_ULONG( dest ) = ch;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + 4 + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00A000A0;
|
||||
V_ULONG( dest + 4 ) = cl;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while (((V_ULONG( dest ) & 0x00800080) != (ch & 0x00800080)) ||
|
||||
((V_ULONG( dest + 4 ) & 0x00800080) != (cl & 0x00800080))) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((vu_long *)dest) & ch) != ch
|
||||
||(*((vu_long *)(dest + 4)) & cl) != cl)
|
||||
{
|
||||
return (2);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + (0x0555 << 3) ) = 0x00A000A0;
|
||||
V_ULONG( dest ) = ch;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00AA00AA;
|
||||
V_ULONG( info->start[0] + 4 + (0x02AA << 3) ) = 0x00550055;
|
||||
V_ULONG( info->start[0] + 4 + (0x0555 << 3) ) = 0x00A000A0;
|
||||
V_ULONG( dest + 4 ) = cl;
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while (((V_ULONG( dest ) & 0x00800080) != (ch & 0x00800080)) ||
|
||||
((V_ULONG( dest + 4 ) & 0x00800080) != (cl & 0x00800080))) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -26,5 +26,4 @@
|
||||
#
|
||||
|
||||
#TEXT_BASE = 0xFFF80000
|
||||
#TEXT_BASE = 0xFFFC0000
|
||||
TEXT_BASE = 0xFFFE0000
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
|
||||
@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o ../common/pci.o
|
||||
OBJS = $(BOARD).o flash.o ../common/misc.o ../common/pci.o
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
46
board/esd/apc405/Makefile
Normal file
46
board/esd/apc405/Makefile
Normal file
@ -0,0 +1,46 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o strataflash.o ../common/misc.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
|
||||
|
||||
#########################################################################
|
||||
315
board/esd/apc405/apc405.c
Normal file
315
board/esd/apc405/apc405.c
Normal file
@ -0,0 +1,315 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if 0
|
||||
#define FPGA_DEBUG
|
||||
#endif
|
||||
|
||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
extern void lxt971_no_sleep(void);
|
||||
|
||||
/* 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 *, unsigned long *);
|
||||
|
||||
|
||||
#ifdef CONFIG_LCD_USED
|
||||
/* logo bitmap data - gzip compressed and generated by bin2c */
|
||||
unsigned char logo_bmp[] =
|
||||
{
|
||||
#include CFG_LCD_LOGO_NAME
|
||||
};
|
||||
|
||||
/*
|
||||
* include common lcd code (for esd boards)
|
||||
*/
|
||||
#include "../common/lcd.c"
|
||||
|
||||
#include "../common/"CFG_LCD_HEADER_NAME
|
||||
#endif /* CONFIG_LCD_USED */
|
||||
|
||||
|
||||
int board_early_init_f (void)
|
||||
{
|
||||
/*
|
||||
* First pull fpga-prg pin low, to disable fpga logic (on version 2 board)
|
||||
*/
|
||||
out32(GPIO0_ODR, 0x00000000); /* no open drain pins */
|
||||
out32(GPIO0_TCR, CFG_FPGA_PRG); /* setup for output */
|
||||
out32(GPIO0_OR, CFG_FPGA_PRG); /* set output pins to high */
|
||||
out32(GPIO0_OR, 0); /* pull prg low */
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
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);
|
||||
volatile unsigned short *fuji_lcdbl_pwm =
|
||||
(unsigned short *)((ulong)0xf0100200 + 0xa0);
|
||||
unsigned char *dst;
|
||||
ulong len = sizeof(fpgadata);
|
||||
int status;
|
||||
int index;
|
||||
int i;
|
||||
unsigned long cntrl0Reg;
|
||||
|
||||
/*
|
||||
* Setup GPIO pins (CS6+CS7 as GPIO)
|
||||
*/
|
||||
cntrl0Reg = mfdcr(cntrl0);
|
||||
mtdcr(cntrl0, cntrl0Reg | 0x00300000);
|
||||
|
||||
dst = malloc(CFG_FPGA_MAX_SIZE);
|
||||
if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
do_reset (NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
status = fpga_boot(dst, len);
|
||||
if (status != 0) {
|
||||
printf("\nFPGA: Booting failed ");
|
||||
switch (status) {
|
||||
case ERROR_FPGA_PRG_INIT_LOW:
|
||||
printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_INIT_HIGH:
|
||||
printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
|
||||
break;
|
||||
case ERROR_FPGA_PRG_DONE:
|
||||
printf("(Timeout: DONE not high after programming FPGA)\n ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("FPGA: %s\n", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
/* delayed reboot */
|
||||
for (i=20; i>0; i--) {
|
||||
printf("Rebooting in %2d seconds \r",i);
|
||||
for (index=0;index<1000;index++)
|
||||
udelay(1000);
|
||||
}
|
||||
putc ('\n');
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
|
||||
/* restore gpio/cs settings */
|
||||
mtdcr(cntrl0, cntrl0Reg);
|
||||
|
||||
puts("FPGA: ");
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i=0; i<4; i++) {
|
||||
len = dst[index];
|
||||
printf("%s ", &(dst[index+1]));
|
||||
index += len+3;
|
||||
}
|
||||
putc ('\n');
|
||||
|
||||
free(dst);
|
||||
|
||||
/*
|
||||
* Reset FPGA via FPGA_DATA pin
|
||||
*/
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK);
|
||||
udelay(1000); /* wait 1ms */
|
||||
SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
|
||||
udelay(1000); /* wait 1ms */
|
||||
|
||||
/*
|
||||
* Enable power on PS/2 interface (with reset)
|
||||
*/
|
||||
*fpga_mode |= CFG_FPGA_CTRL_PS2_RESET;
|
||||
for (i=0;i<100;i++)
|
||||
udelay(1000);
|
||||
udelay(1000);
|
||||
*fpga_mode &= ~CFG_FPGA_CTRL_PS2_RESET;
|
||||
|
||||
/*
|
||||
* Enable interrupts in exar duart mcr[3]
|
||||
*/
|
||||
*duart0_mcr = 0x08;
|
||||
*duart1_mcr = 0x08;
|
||||
|
||||
/*
|
||||
* Init lcd interface and display logo
|
||||
*/
|
||||
lcd_init((uchar *)CFG_LCD_BIG_REG, (uchar *)CFG_LCD_BIG_MEM,
|
||||
regs_13806_640_480_16bpp,
|
||||
sizeof(regs_13806_640_480_16bpp)/sizeof(regs_13806_640_480_16bpp[0]),
|
||||
logo_bmp, sizeof(logo_bmp));
|
||||
|
||||
/*
|
||||
* Enable microcontroller and setup backlight PWM controller
|
||||
*/
|
||||
*fpga_mode |= 0x001c;
|
||||
*fuji_lcdbl_pwm = 0x00ff;
|
||||
|
||||
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 APC405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
putc ('\n');
|
||||
|
||||
/*
|
||||
* Disable sleep mode in LXT971
|
||||
*/
|
||||
lxt971_no_sleep();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
#if 0
|
||||
printf("\nmb0cf=%x\n", val); /* test-only */
|
||||
printf("strap=%x\n", mfdcr(strap)); /* test-only */
|
||||
#endif
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf ("test: 16 MB - ok\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef CONFIG_IDE_RESET
|
||||
|
||||
void ide_set_reset(int on)
|
||||
{
|
||||
volatile unsigned short *fpga_mode =
|
||||
(unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
|
||||
|
||||
/*
|
||||
* Assert or deassert CompactFlash Reset Pin
|
||||
*/
|
||||
if (on) { /* assert RESET */
|
||||
*fpga_mode &= ~(CFG_FPGA_CTRL_CF_RESET);
|
||||
} else { /* release RESET */
|
||||
*fpga_mode |= CFG_FPGA_CTRL_CF_RESET;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IDE_RESET */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
28
board/esd/apc405/config.mk
Normal file
28
board/esd/apc405/config.mk
Normal file
@ -0,0 +1,28 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#
|
||||
# esd ABG405 boards
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFFF80000
|
||||
2295
board/esd/apc405/fpgadata.c
Normal file
2295
board/esd/apc405/fpgadata.c
Normal file
File diff suppressed because it is too large
Load Diff
235
board/esd/apc405/logo_640_480_24bpp.c
Normal file
235
board/esd/apc405/logo_640_480_24bpp.c
Normal file
@ -0,0 +1,235 @@
|
||||
0x1f,0x8b,0x08,0x08,0x85,0xd1,0x0f,0x40,0x00,0x03,0x61,0x62,0x67,0x5f,0x6c,0x6f,
|
||||
0x67,0x6f,0x5f,0x36,0x34,0x30,0x5f,0x34,0x38,0x30,0x2e,0x62,0x6d,0x70,0x00,0xed,
|
||||
0xd9,0xcb,0x91,0x25,0x3b,0x15,0x05,0xd0,0x02,0x03,0x08,0x86,0x98,0x80,0x05,0x18,
|
||||
0xc0,0x1c,0x9f,0x30,0x05,0x53,0x18,0x60,0x08,0x9e,0x14,0x8f,0xe6,0x17,0x74,0xd5,
|
||||
0xad,0xca,0x94,0xce,0x2f,0x33,0xd7,0x8a,0x7c,0x13,0x78,0x71,0xb4,0x25,0xdd,0xd6,
|
||||
0x8e,0x86,0x3f,0xfe,0xe9,0x0f,0xbf,0xfd,0xcd,0xdb,0x3f,0xfd,0xe1,0x97,0x7f,0x7e,
|
||||
0xff,0xcb,0x3f,0x7f,0xfe,0xf5,0xdb,0xdb,0xdf,0x7f,0xf5,0xf6,0xf6,0xab,0xb7,0xdf,
|
||||
0xfd,0xf8,0xcf,0xdf,0x7e,0xf9,0xef,0xff,0xf6,0xcb,0xbf,0xf2,0xb7,0x7f,0xfd,0x6b,
|
||||
0x3f,0xfc,0xf9,0x2f,0x7f,0xf9,0x2b,0x00,0x50,0xeb,0x0d,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x62,0xbc,0xbf,0xf8,0x00,0x80,0x35,0xaf,0xba,0x35,0xf0,
|
||||
0x03,0x80,0x67,0x2a,0x28,0x59,0xed,0x0c,0x00,0x6f,0xdd,0xad,0xaa,0x94,0x01,0x78,
|
||||
0x82,0xf6,0xc6,0xd4,0xc8,0x00,0x3c,0xca,0x25,0x4a,0x70,0x48,0x0c,0x00,0xd8,0x34,
|
||||
0xad,0x61,0x5b,0x76,0x04,0x00,0x35,0xee,0x57,0xbb,0x9f,0xba,0x7a,0x7e,0x00,0x6e,
|
||||
0xe3,0xf6,0x9d,0xfb,0xb5,0x5b,0x6e,0x0a,0x80,0xc9,0x1e,0xde,0xbc,0x1f,0x3d,0x64,
|
||||
0x9b,0x00,0xb4,0x50,0xb8,0x07,0x3d,0x7c,0xfb,0x00,0x84,0xf0,0x57,0xdd,0x05,0x4e,
|
||||
0x03,0x80,0x1d,0x9a,0x77,0x93,0x93,0x01,0xe0,0x2c,0xe5,0x1b,0xcb,0x11,0x01,0xf0,
|
||||
0x35,0xb5,0x9b,0xca,0xa1,0x01,0xf0,0x13,0x7f,0xe7,0x2d,0xe6,0x00,0x01,0xd0,0xbc,
|
||||
0x5d,0x1c,0x26,0xc0,0x63,0x29,0xdf,0x5e,0x4e,0x15,0xe0,0x81,0x34,0xef,0x10,0x4e,
|
||||
0x18,0xe0,0x39,0x34,0xef,0x34,0x4e,0x1b,0xe0,0xde,0xfc,0x6f,0xce,0xf3,0x39,0x76,
|
||||
0x80,0xfb,0x51,0xbe,0x57,0xe1,0xfc,0x01,0x6e,0x43,0xf9,0x5e,0x8b,0x5b,0x00,0xb8,
|
||||
0x01,0xcd,0x0b,0x00,0xc5,0xfc,0xcd,0x17,0x00,0x8a,0x29,0x5f,0x00,0x28,0xa6,0x7c,
|
||||
0x81,0x73,0xde,0x3f,0xe8,0x4e,0x04,0x97,0xa3,0x79,0x81,0xa3,0x3e,0xd6,0xee,0xa7,
|
||||
0xba,0x63,0xc2,0x25,0x3c,0xa7,0x7f,0x43,0xfe,0x9a,0x7f,0xbf,0x63,0xb9,0xb3,0x83,
|
||||
0x65,0xa1,0x3b,0x0e,0xda,0x39,0x4c,0xb7,0x00,0x1f,0xa4,0x16,0xcd,0xb4,0xca,0x1b,
|
||||
0x15,0xe6,0xa2,0x09,0xaf,0x64,0xa1,0x2f,0x8e,0xbf,0xfc,0x6b,0xc3,0xdf,0x37,0x2a,
|
||||
0x69,0x73,0xb9,0x96,0xc3,0xfc,0x6f,0x80,0xae,0xd8,0x30,0x55,0xf6,0x1b,0x5e,0xd9,
|
||||
0x26,0x47,0xfe,0xc0,0x8e,0x0a,0x73,0xd1,0x84,0x57,0xb2,0xd3,0x17,0x49,0xc3,0xdf,
|
||||
0xcb,0xfb,0xf7,0xe3,0xba,0x35,0xc7,0xf8,0xd3,0xd2,0x65,0x69,0xe1,0x0a,0x6e,0xd6,
|
||||
0x77,0xd3,0xf2,0x74,0x5d,0x4a,0x76,0xc2,0x2b,0x59,0x2e,0x8b,0xbc,0xe1,0xef,0x7d,
|
||||
0xfd,0xfb,0xbe,0x54,0x6a,0xf5,0x21,0x97,0xa3,0xc2,0x75,0xdc,0xac,0xef,0x0e,0xfe,
|
||||
0x81,0x1d,0x15,0xa6,0xfd,0xd0,0x7e,0x5a,0xf7,0x6e,0x52,0x5f,0xfe,0xfd,0x66,0x59,
|
||||
0x9e,0xb0,0x29,0xfb,0x00,0x8b,0x43,0xc2,0x05,0x15,0x54,0x4c,0x65,0x95,0x0c,0x8c,
|
||||
0xd4,0x75,0x2f,0x6b,0x09,0x77,0x32,0xcf,0x95,0xf7,0xf2,0xef,0x37,0xcb,0xf2,0x84,
|
||||
0x4d,0xd9,0x1b,0xac,0x0c,0x09,0x17,0x54,0x56,0x2e,0x95,0x6d,0x72,0x24,0xd5,0xa8,
|
||||
0x30,0xa3,0x12,0x86,0x84,0x1f,0x27,0xef,0xf1,0xdf,0x9f,0xbc,0x36,0x21,0x4a,0xd2,
|
||||
0x06,0xcb,0xe2,0xc1,0x65,0x95,0x35,0x4b,0x65,0x9b,0x1c,0x09,0x36,0x2a,0x4c,0x7b,
|
||||
0xc8,0x6f,0x17,0xbd,0xbc,0xbc,0xc7,0x7f,0x7f,0xf2,0xda,0x84,0x40,0xe1,0xbb,0xab,
|
||||
0xc9,0x06,0x57,0x56,0xd9,0x2c,0x95,0x7d,0x77,0x24,0xd8,0xa8,0x30,0xd3,0x42,0xc6,
|
||||
0xee,0x62,0x84,0xbc,0xc7,0x7f,0x7f,0xf2,0xda,0x84,0x40,0xe1,0xbb,0xab,0xc9,0x06,
|
||||
0x57,0x56,0x59,0x2b,0x95,0x55,0x72,0x30,0xde,0x9c,0x24,0xed,0x09,0xdf,0x8f,0xad,
|
||||
0x7b,0x61,0x79,0x8f,0xff,0xfe,0xe4,0xb5,0x09,0xb1,0x62,0x77,0x57,0x10,0x0c,0x2e,
|
||||
0xae,0xb2,0x56,0x2a,0xab,0xe4,0x60,0xbc,0x39,0x49,0xda,0x13,0xbe,0x1f,0x5e,0xf7,
|
||||
0xc2,0x92,0x1e,0xff,0xfd,0x5a,0x59,0x9b,0x10,0x2b,0x70,0x6b,0xb1,0x02,0x2e,0x1e,
|
||||
0x26,0x2a,0xee,0x94,0xca,0x36,0x39,0x92,0x70,0x54,0x98,0x69,0x09,0xc3,0xf7,0xd2,
|
||||
0x2f,0xe9,0xf1,0xdf,0x1f,0xbb,0x30,0x21,0x5c,0xc8,0xbe,0x32,0x04,0x5c,0x3c,0x8c,
|
||||
0x53,0x5f,0x28,0x95,0x6d,0x72,0x24,0xe1,0xa8,0x30,0xed,0x21,0x4f,0xad,0x7b,0x49,
|
||||
0x19,0x8f,0x7f,0x48,0xa7,0xac,0x0d,0xc9,0x30,0x30,0x55,0xe4,0x2f,0x00,0xa6,0xa8,
|
||||
0x2f,0x94,0xca,0xbe,0x3b,0x92,0x70,0x54,0x98,0x69,0x21,0xb3,0xf7,0xd5,0xa0,0xbb,
|
||||
0x49,0xfe,0xe7,0x12,0xc1,0xba,0xb3,0xfc,0x5b,0xe1,0x0f,0x04,0xca,0xd4,0x17,0x4a,
|
||||
0x65,0x95,0x1c,0x0c,0x39,0x27,0x49,0x7b,0xc2,0x8f,0x21,0xb3,0xb7,0x56,0xad,0xbb,
|
||||
0x49,0xfe,0x27,0x24,0x58,0xc6,0x06,0xa3,0xa6,0x05,0x66,0x0b,0xfc,0x01,0xc0,0x18,
|
||||
0xf5,0x85,0x52,0x59,0x25,0x07,0x43,0xce,0x49,0xd2,0x9e,0xf0,0x55,0xc8,0xd4,0xdd,
|
||||
0x95,0xda,0x29,0x94,0x58,0x21,0xc1,0x32,0xf6,0x18,0x32,0x2a,0xf6,0xfc,0xf7,0xef,
|
||||
0x1d,0xe6,0xb9,0x7d,0x9b,0x1c,0xc9,0x39,0x27,0x49,0x7b,0xc2,0x2f,0x42,0xa6,0x6e,
|
||||
0xb0,0xd4,0x72,0xa7,0x04,0x8a,0x4a,0x95,0xb1,0xc7,0x90,0x39,0xb1,0xc1,0x76,0xae,
|
||||
0x1b,0xa6,0xba,0x7d,0x9b,0x1c,0xc9,0x39,0x2a,0xcc,0xd8,0x84,0xd9,0xbf,0x8a,0x3a,
|
||||
0xcb,0x9d,0x12,0x28,0x2a,0x55,0xc6,0x1e,0x43,0xe6,0xc4,0x06,0xdb,0xb9,0x6e,0x98,
|
||||
0xaa,0xbe,0x4a,0x36,0x17,0xcd,0x88,0x3a,0x27,0xc9,0x84,0x84,0x5f,0x87,0x4c,0xfd,
|
||||
0x61,0x14,0x59,0xee,0x94,0x40,0x51,0xa9,0x32,0xb6,0x19,0x3e,0x24,0x75,0x9b,0x70,
|
||||
0x59,0xc5,0x3d,0xb2,0xb9,0x68,0x5e,0xda,0x39,0x49,0x26,0x9c,0xd8,0x7e,0x98,0xd1,
|
||||
0x96,0x3b,0x25,0x50,0x54,0xaa,0x8c,0x6d,0x86,0x0f,0x49,0xdd,0x26,0x5c,0x56,0x71,
|
||||
0x8f,0x6c,0x2e,0x9a,0x97,0x76,0x4e,0x92,0xf6,0x84,0x51,0xc7,0x35,0xd7,0x72,0xa7,
|
||||
0x04,0x8a,0x4a,0x95,0xb1,0xcd,0xf0,0x21,0xa9,0xdb,0x84,0xcb,0xaa,0xef,0x91,0xcd,
|
||||
0x75,0x1b,0x0b,0xa5,0x2c,0xcc,0xfc,0x84,0x35,0x3f,0x92,0x44,0xcb,0xb5,0x12,0x25,
|
||||
0x2a,0x52,0xc6,0x36,0x43,0x0e,0x2a,0x2f,0x12,0xdc,0x45,0x71,0x89,0xec,0xaf,0xdb,
|
||||
0x5b,0x28,0x35,0x61,0xae,0x12,0xb2,0xe0,0x77,0x92,0x65,0xb9,0x56,0x42,0x04,0x46,
|
||||
0xca,0xd8,0x66,0xc8,0x41,0xe5,0x45,0x82,0xbb,0xa8,0x2f,0x91,0xcd,0x75,0x93,0x02,
|
||||
0xcf,0x49,0x72,0xad,0x90,0x05,0x3f,0x95,0x14,0xcb,0xb5,0x12,0x22,0x30,0x52,0xc6,
|
||||
0x36,0x43,0x0e,0x2a,0x2f,0x12,0xdc,0x45,0x7d,0x89,0x6c,0xae,0x9b,0x17,0x78,0x4e,
|
||||
0x92,0xf6,0x84,0xa7,0x42,0x16,0xfc,0x5a,0xe2,0x2d,0xd7,0x4a,0x88,0xc0,0x48,0x19,
|
||||
0xdb,0x0c,0x39,0xa8,0xbc,0x48,0x70,0x17,0xf5,0x25,0xb2,0xb9,0x6e,0x5e,0xe0,0x51,
|
||||
0x61,0x2e,0x94,0xb0,0xe6,0x07,0x13,0x6c,0xb9,0x56,0x42,0x04,0x46,0xca,0xd8,0x66,
|
||||
0xc8,0x41,0xe5,0x45,0x82,0x1b,0xa9,0x6c,0x90,0xfd,0x75,0xf3,0x0a,0x65,0x54,0x98,
|
||||
0x6b,0x25,0x2c,0xfb,0xcd,0x84,0x59,0xae,0x95,0x10,0x81,0x91,0x32,0xf6,0x18,0x3e,
|
||||
0x24,0x75,0x9b,0x70,0x65,0x95,0x0d,0xb2,0xbf,0x6e,0x5e,0xa1,0x8c,0x0a,0x73,0xb9,
|
||||
0x84,0x65,0x3f,0x9b,0x30,0xcb,0xcd,0xb2,0x29,0x36,0x4f,0xc6,0x06,0xc3,0x87,0xa4,
|
||||
0x6e,0x13,0xae,0xac,0xb2,0x41,0xf6,0xd7,0xcd,0xeb,0x94,0x39,0x49,0xae,0x98,0xb0,
|
||||
0xf2,0x97,0x13,0x23,0xa4,0x02,0x02,0xab,0x64,0x61,0xd4,0x17,0xd3,0x96,0x07,0xbe,
|
||||
0x27,0xf4,0xef,0xf2,0x90,0x4f,0xa7,0xc1,0x8d,0x54,0x36,0xc8,0xfe,0xba,0xa9,0x9d,
|
||||
0x32,0x2a,0xcc,0x8d,0xe3,0x8d,0x10,0x52,0x01,0x81,0x55,0xb2,0x30,0x2a,0x7c,0xda,
|
||||
0xc7,0x99,0xbd,0x43,0x3e,0x9d,0x06,0x37,0x52,0xf6,0x3e,0x87,0xac,0x9b,0xda,0x29,
|
||||
0xa3,0xc2,0x5c,0x2e,0xde,0xa9,0x84,0xfd,0x42,0x2a,0x20,0xb0,0x4a,0x16,0x46,0x85,
|
||||
0x4f,0xfb,0x38,0xb3,0x77,0xc8,0xa7,0xd3,0xe0,0x46,0x2a,0xdf,0xe7,0xfd,0x75,0x53,
|
||||
0x3b,0x65,0x54,0x98,0xcb,0xc5,0x3b,0x9b,0xb0,0x59,0x48,0x05,0x04,0x56,0xc9,0xc2,
|
||||
0xa8,0xc0,0x54,0xaf,0x06,0x86,0xcc,0xd9,0xc9,0xf3,0x69,0x2a,0xb8,0x8b,0xca,0xf7,
|
||||
0x39,0x64,0xe9,0xbc,0x4e,0x19,0x15,0xa6,0xf1,0xa0,0x76,0xee,0xb7,0xfe,0x57,0xb4,
|
||||
0x91,0x75,0xbb,0x02,0x02,0x7b,0xe4,0xec,0xa8,0x57,0x03,0xd7,0xe6,0x84,0x4f,0x8b,
|
||||
0x8a,0xf4,0x2a,0x18,0xdc,0x45,0xe5,0xfb,0xbc,0xb9,0x6e,0x6a,0xad,0xcc,0x49,0x32,
|
||||
0xfc,0xa0,0xa2,0xd2,0x36,0xdb,0xaf,0x80,0xc0,0x1e,0x39,0x3b,0x2a,0x43,0x60,0xaa,
|
||||
0xd8,0xad,0xed,0xdc,0x32,0xcc,0x56,0xff,0x44,0xef,0xac,0x9b,0x5a,0x2b,0xf5,0x91,
|
||||
0x66,0x7e,0x65,0xd7,0xda,0x69,0xbf,0x02,0x02,0x7b,0xe4,0xec,0xa8,0x0c,0x81,0xa9,
|
||||
0x62,0xb7,0xb6,0x73,0xcb,0x30,0x5b,0xfd,0x13,0xbd,0xb3,0x6e,0x6a,0xad,0xb4,0x17,
|
||||
0xdf,0x90,0xaf,0xf2,0x66,0xdb,0xec,0x57,0x40,0x60,0x8f,0x9c,0x1d,0x15,0x2e,0x36,
|
||||
0x55,0xec,0xd6,0x96,0xaf,0x18,0xae,0xa0,0xfe,0x89,0x5e,0x5e,0x37,0xb5,0x56,0xda,
|
||||
0x8b,0x6f,0xc8,0x57,0x7c,0xb3,0x3d,0x36,0x5b,0x20,0xb6,0x47,0x16,0xa6,0x05,0x0a,
|
||||
0x4f,0x15,0xbb,0xb5,0x9d,0x5b,0x86,0xf1,0x5a,0x9e,0xe8,0xb5,0x75,0x53,0x6b,0xa5,
|
||||
0xbd,0xf8,0x26,0x7c,0xf5,0x37,0xdb,0x63,0xb3,0x05,0x62,0x4b,0xe4,0xec,0xb4,0x40,
|
||||
0x19,0xa9,0x62,0xb7,0xb6,0x76,0xbf,0x70,0x11,0x5d,0x0f,0xf5,0xb4,0x72,0x69,0xef,
|
||||
0xbe,0x09,0x5f,0x94,0x96,0x45,0x4f,0x46,0xdc,0x68,0x81,0xd8,0x12,0x39,0x3b,0x2d,
|
||||
0x4a,0x52,0xaa,0xd8,0xad,0x2d,0xdc,0x2c,0x5c,0x4a,0xcb,0x43,0x3d,0xb0,0x5c,0xda,
|
||||
0xeb,0xaf,0xf7,0x0b,0xd4,0xb8,0xf4,0xe1,0x88,0x1b,0x2d,0x10,0x5b,0x22,0x67,0xa7,
|
||||
0xed,0x0b,0x3f,0x9f,0x57,0xc3,0x6b,0xa2,0xc2,0xc5,0xd5,0x3f,0x98,0x03,0xfb,0xa5,
|
||||
0xbd,0x01,0x1b,0xbf,0x58,0xed,0x01,0x0e,0x44,0xdc,0x68,0x81,0xd8,0x12,0x39,0x3b,
|
||||
0x6d,0x53,0xc6,0xf9,0xbc,0x9a,0x5f,0x96,0x16,0xae,0xac,0xe5,0xb5,0x9c,0x56,0x31,
|
||||
0xed,0x25,0xd8,0xf8,0x85,0x6b,0x0f,0xf0,0x5d,0xbe,0x8d,0x16,0x88,0x2d,0x91,0xb3,
|
||||
0xd3,0xf6,0x85,0x9f,0xcf,0xab,0xe1,0x35,0x51,0xe1,0xe2,0x5a,0x5e,0xcb,0x69,0x15,
|
||||
0xd3,0x5e,0x82,0x2d,0x5f,0x92,0x21,0x31,0x5e,0xe7,0xdb,0x68,0x81,0xd8,0x12,0x39,
|
||||
0x3b,0x2d,0x4a,0x52,0xaa,0xd8,0xad,0x2d,0xdc,0x2c,0x5c,0x4d,0xcb,0xbb,0x3d,0xad,
|
||||
0x6b,0xda,0xab,0x70,0xda,0x81,0x14,0xdf,0x6f,0xa9,0x9d,0x16,0x88,0x6d,0x90,0x53,
|
||||
0xd3,0x62,0x65,0xa4,0xda,0xba,0x15,0x78,0xa8,0xfa,0xd7,0x7b,0x60,0xdd,0xb4,0x17,
|
||||
0xe2,0x9c,0xa3,0xd8,0x37,0x30,0xd2,0xff,0xe7,0x5b,0xea,0x94,0xf0,0x3e,0x3a,0x3b,
|
||||
0x30,0x56,0x78,0xaa,0x80,0x8b,0x81,0x27,0x2a,0x7e,0x30,0x07,0x96,0x4e,0x7b,0x2d,
|
||||
0x4e,0x38,0x84,0x28,0x93,0xb3,0xfd,0xc8,0xb7,0x54,0x2b,0xe1,0x7d,0x74,0x76,0x60,
|
||||
0xac,0xf0,0x54,0x31,0x77,0x03,0x4f,0x54,0xfc,0x5a,0x4e,0xab,0x9e,0xf6,0x72,0x6c,
|
||||
0x3f,0x81,0x58,0xa3,0x13,0xae,0xd5,0x4a,0x78,0x1f,0x9d,0x1d,0xf8,0xe9,0xd8,0xb5,
|
||||
0x21,0x5f,0x24,0x8c,0x9d,0x06,0x1c,0x50,0xfc,0x54,0x4e,0x2b,0xa0,0xf6,0x7e,0x1c,
|
||||
0x72,0x0e,0x51,0xc6,0x06,0xfb,0x11,0x6e,0xa9,0x56,0xc2,0xfb,0xe8,0xec,0xc0,0x57,
|
||||
0x63,0xd7,0xe6,0xbc,0x4a,0x18,0x3b,0x0d,0x38,0xa6,0xf2,0xb5,0x9c,0xd6,0x3b,0xed,
|
||||
0xb5,0x38,0xed,0x40,0xea,0xef,0xb7,0xce,0x5a,0xad,0x84,0x97,0xd1,0xa9,0x81,0xdf,
|
||||
0x4e,0x8e,0x9a,0xb6,0x36,0xe7,0x8b,0x60,0xc0,0x01,0x95,0x0f,0xe6,0xc0,0xba,0x69,
|
||||
0x2f,0xc4,0x81,0x67,0x52,0x7c,0xbf,0x45,0xd6,0x6a,0x25,0xbc,0x8c,0x4e,0x0d,0xfc,
|
||||
0x76,0x72,0xd4,0xb4,0xb5,0x39,0x05,0xc1,0xe0,0xee,0xca,0x5e,0xcb,0x81,0x5d,0xd3,
|
||||
0xde,0x86,0x5d,0x5f,0x92,0x51,0x61,0x3e,0x84,0x3b,0x5f,0x04,0xe1,0xf5,0x71,0xb2,
|
||||
0x91,0xbe,0x99,0x1c,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,0x80,0xb2,0xd7,0x72,0x5a,
|
||||
0xcb,0xb4,0xf7,0x60,0xe3,0x97,0x61,0x4e,0x92,0xcf,0xc2,0x9d,0x2f,0x82,0xf0,0xfa,
|
||||
0x38,0xd9,0x48,0xdf,0x4c,0x8e,0x9a,0xb6,0x36,0xa7,0x20,0x18,0x3c,0x43,0xcd,0x83,
|
||||
0x39,0xad,0x65,0xda,0x4b,0xb0,0xfd,0x8b,0x35,0x21,0xc3,0xeb,0x70,0xe7,0x8b,0x20,
|
||||
0xbc,0x3e,0x4e,0x36,0xd2,0x37,0x93,0xa3,0xa6,0xad,0xcd,0x29,0x08,0x06,0x8f,0x51,
|
||||
0xf0,0x60,0x4e,0xeb,0x97,0x51,0x61,0x66,0x1e,0xd1,0x29,0x13,0x32,0xbc,0x0e,0x77,
|
||||
0xb2,0x0b,0x32,0xba,0xe3,0xd4,0xcc,0x6f,0x87,0x47,0x4d,0x5b,0x9b,0x53,0x10,0x0c,
|
||||
0x1e,0xa3,0xe0,0xb5,0x1c,0x58,0x2e,0xa3,0xc2,0x74,0x1d,0x54,0x94,0xf6,0x00,0x5f,
|
||||
0x86,0x3b,0xd9,0x05,0x19,0xdd,0x71,0x6a,0xe6,0xb7,0xc3,0xa3,0xa6,0xad,0xcd,0x29,
|
||||
0x08,0x06,0x4f,0x92,0xfd,0x60,0x16,0xd7,0xca,0x91,0x9c,0xa3,0xc2,0x5c,0x28,0x5b,
|
||||
0x6c,0xe6,0x0a,0x67,0xbb,0x20,0xa3,0x3b,0x4e,0xcd,0xfc,0x76,0x78,0xd4,0xb4,0xb5,
|
||||
0x39,0x05,0xc1,0xe0,0x49,0x0a,0xde,0xcc,0xca,0x4e,0x39,0x12,0x72,0x54,0x98,0xc6,
|
||||
0x78,0x51,0xda,0x03,0x7c,0x19,0xee,0x4c,0x17,0x64,0x74,0xc7,0xc9,0x46,0xfa,0x66,
|
||||
0x78,0xd4,0xb4,0xb5,0x39,0x05,0xc1,0xe0,0x61,0x6e,0x53,0x28,0x07,0x43,0xce,0x49,
|
||||
0xd2,0x9e,0x30,0x44,0xef,0xea,0xdf,0x85,0x3b,0xd3,0x05,0x19,0xdd,0x71,0xb2,0x91,
|
||||
0xbe,0x19,0x1e,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,0x9e,0xd4,0x37,0xb3,0xb2,0xef,
|
||||
0x8e,0x84,0x1c,0x15,0xa6,0x3d,0xe1,0xbe,0xc6,0xa5,0x0f,0x84,0x3b,0xd3,0x05,0x19,
|
||||
0xdd,0x71,0xb2,0x91,0xbe,0x19,0x1e,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,0xa4,0xbc,
|
||||
0x67,0xb3,0xb8,0xef,0x8e,0x24,0x1c,0x15,0xe6,0x72,0xf1,0xa2,0xd2,0x56,0x38,0xd5,
|
||||
0x05,0x19,0xc5,0x71,0xbe,0x94,0xbe,0x9a,0x1f,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,
|
||||
0xa4,0xbc,0x97,0xb3,0xb2,0x4d,0x0e,0xc6,0x1b,0x15,0xa6,0x37,0xe1,0xbe,0xc6,0xa5,
|
||||
0x0f,0x84,0x3b,0xd3,0x05,0x19,0xc5,0x71,0xbe,0x94,0x5e,0xce,0x5f,0x1b,0xf5,0xe9,
|
||||
0xb4,0xc0,0x51,0xe1,0xd3,0xe0,0x91,0xf2,0x1e,0xcf,0xca,0xbe,0x3b,0x12,0x6f,0x4e,
|
||||
0x92,0x09,0x21,0x37,0x75,0xad,0x7b,0x2c,0x5c,0x8e,0xec,0x00,0xb1,0x5b,0x08,0x3f,
|
||||
0x99,0x8c,0x39,0xf0,0x78,0x49,0x8f,0x67,0x65,0xdf,0x1d,0x89,0x37,0x27,0xc9,0x84,
|
||||
0x90,0x9b,0xba,0xd6,0x3d,0x9c,0x2f,0x41,0xef,0xea,0x67,0x5d,0x2b,0x18,0x3c,0x5b,
|
||||
0xf8,0xfb,0x59,0xd9,0x77,0x47,0xb2,0x8d,0x0a,0x33,0x21,0xe4,0x8e,0xae,0x75,0x0f,
|
||||
0xe7,0x6b,0x2d,0x8e,0x8c,0xd5,0xcf,0x1a,0x9b,0x2d,0xe2,0x7a,0xe1,0x7e,0x62,0xdf,
|
||||
0xcf,0xe2,0xbe,0x3b,0x12,0x6c,0x54,0x98,0x8b,0x26,0xdc,0xcf,0x59,0xa1,0xb7,0x35,
|
||||
0xc2,0x57,0x5f,0x30,0x36,0xdb,0xf6,0xdd,0xc2,0x5d,0xc5,0x3e,0xa1,0x95,0x6d,0x72,
|
||||
0x24,0xd5,0xa8,0x30,0x17,0x4d,0xb8,0x9f,0xb3,0x42,0x6f,0x6b,0x84,0xaf,0x1e,0x9b,
|
||||
0x76,0x6c,0x30,0x78,0xbc,0xc0,0x57,0xb4,0xb2,0x4d,0x8e,0xa4,0x9a,0x93,0xe4,0xba,
|
||||
0x09,0xf7,0x73,0x56,0xe8,0x2d,0x8e,0xf0,0xd5,0x63,0xa3,0x4e,0xce,0x06,0x8f,0x17,
|
||||
0xf5,0x90,0x56,0xb6,0xc9,0x91,0x48,0x73,0x92,0xb4,0xc7,0xdb,0x7c,0x09,0xbb,0xd6,
|
||||
0x3d,0x9c,0xaf,0xb5,0x38,0xc2,0x57,0x0f,0x8f,0x3a,0x36,0x18,0x70,0xc1,0xbe,0x9b,
|
||||
0x96,0x27,0xef,0xcc,0x1b,0x13,0x86,0x44,0x2d,0xd2,0xd8,0x1d,0xb1,0x4b,0x27,0x45,
|
||||
0x1d,0x1b,0x0c,0x88,0x78,0x4e,0x8b,0x0b,0xe5,0xc8,0x1f,0xf0,0x39,0x49,0xe6,0x9f,
|
||||
0x55,0x52,0xda,0x22,0x8d,0xc5,0x11,0xb8,0xf4,0x6d,0x72,0x9e,0xcd,0x06,0x6c,0x3f,
|
||||
0xa7,0xd3,0x6a,0x65,0x4e,0x92,0xe1,0x07,0x95,0x17,0xb5,0x48,0x63,0x77,0x04,0x2e,
|
||||
0x9d,0x9a,0xb3,0x2c,0xea,0x42,0x30,0xe0,0x87,0x9d,0x17,0x75,0x5a,0xad,0xcc,0x49,
|
||||
0xd2,0x78,0x44,0x9b,0x3d,0xd8,0xb5,0xee,0xc9,0x94,0x7d,0xf5,0x11,0xb8,0x74,0x52,
|
||||
0xc2,0xca,0xb4,0x3b,0xd9,0x80,0x8d,0x77,0x75,0x5a,0xad,0x74,0x95,0xdd,0xc0,0x2f,
|
||||
0xf5,0xc7,0x90,0xb1,0xee,0xc9,0x94,0x7d,0x0d,0x12,0xb8,0x74,0x52,0xc2,0x9a,0xc0,
|
||||
0x9b,0xa9,0x80,0xff,0x58,0x7b,0x5a,0xa7,0xd5,0x4a,0x7b,0xeb,0xcd,0xf9,0x52,0x7f,
|
||||
0x09,0x19,0xeb,0x9e,0x4c,0xd9,0xd7,0x23,0x81,0x4b,0x87,0x67,0x2b,0x8b,0x1d,0x18,
|
||||
0x0c,0x58,0x7a,0x5d,0xa7,0xd5,0x4a,0x7b,0xeb,0xcd,0xf9,0x52,0x7f,0x06,0x19,0xeb,
|
||||
0x9e,0x4c,0xd9,0xd7,0x23,0x51,0x4b,0x87,0x07,0xab,0x49,0x9e,0x11,0x0c,0x58,0x7a,
|
||||
0x5d,0xa7,0x35,0x4b,0x7b,0xf1,0x4d,0xf8,0x52,0x7f,0x03,0x49,0xeb,0x52,0x4a,0xe7,
|
||||
0xc2,0x3c,0x67,0x1f,0xd8,0x69,0xe5,0xd2,0xde,0x7d,0x13,0xbe,0xa4,0xdb,0xcf,0x5b,
|
||||
0x97,0x1e,0x9a,0x17,0xe6,0x39,0xfe,0xc0,0x4e,0x2b,0x97,0xf6,0xee,0x6b,0xff,0x32,
|
||||
0xee,0xbd,0x60,0x69,0x00,0xfe,0xeb,0xc8,0x03,0x3b,0xad,0x5f,0xda,0xeb,0xaf,0xfd,
|
||||
0x0b,0xbc,0xee,0xb2,0xa5,0x01,0xf8,0xc9,0x91,0x37,0x76,0x5a,0xc5,0xb4,0x37,0x60,
|
||||
0xe3,0x17,0x7b,0xd7,0x95,0xab,0x03,0xf0,0xd1,0xd7,0x6f,0xec,0xb4,0x96,0x69,0x2f,
|
||||
0xc1,0xae,0x2f,0xf0,0x96,0x5b,0x02,0x00,0xf0,0xd1,0x17,0x6f,0xec,0xb4,0xa2,0x69,
|
||||
0xef,0xc1,0x96,0x2f,0xea,0x7e,0xbb,0x02,0x00,0xf0,0xca,0xab,0x67,0x76,0x5a,0xd7,
|
||||
0xb4,0x57,0xe1,0xb4,0x03,0x39,0x78,0xb3,0x8d,0x01,0x00,0x58,0x30,0xb0,0x6e,0xda,
|
||||
0x0b,0x71,0xd4,0x69,0x14,0x1c,0x17,0x00,0x2d,0xa6,0x95,0x4e,0x7b,0x27,0x4e,0x38,
|
||||
0x84,0xca,0xbb,0x03,0xa0,0xc5,0xb4,0xea,0x69,0x6f,0xc6,0xc6,0xbd,0xb7,0xdc,0x1d,
|
||||
0x00,0x2d,0xa6,0x75,0x50,0x7b,0x45,0xb6,0xec,0xba,0xeb,0xe2,0x00,0xe8,0x32,0xad,
|
||||
0x89,0xda,0x8b,0xf2,0x12,0x8d,0x76,0xad,0xb4,0x00,0x7c,0x74,0xd7,0x86,0xba,0x31,
|
||||
0x17,0x01,0x00,0xc5,0x94,0x2f,0x00,0x14,0x53,0xbe,0x00,0x50,0xcc,0xff,0x05,0x00,
|
||||
0x00,0xc5,0x94,0x2f,0xc0,0xa3,0x78,0xcc,0x27,0x08,0x2c,0x5f,0x57,0x06,0x70,0x15,
|
||||
0xde,0xf3,0x5e,0xca,0x17,0xe0,0xc9,0x3c,0xec,0x2d,0x94,0x2f,0x00,0xff,0xe2,0x79,
|
||||
0xaf,0x11,0xdb,0xbc,0x6e,0x07,0xe0,0x1e,0xbc,0xf3,0xa9,0x94,0x2f,0x00,0x5f,0xf3,
|
||||
0xe0,0x87,0x53,0xbe,0x00,0x1c,0xe4,0xf1,0x0f,0xa1,0x79,0x01,0x58,0xa0,0x0b,0x96,
|
||||
0x85,0x37,0xaf,0x33,0x07,0x78,0x1a,0x8d,0x70,0x8a,0xda,0x05,0x20,0x8a,0x82,0x38,
|
||||
0xc2,0xdf,0x79,0x01,0x48,0xa5,0x32,0x7e,0xa2,0x79,0x01,0x28,0xa3,0x3b,0xde,0xd2,
|
||||
0x9a,0xf7,0x39,0x07,0x08,0xc0,0xb2,0xa7,0xb5,0x49,0x5e,0xe7,0xde,0xef,0xac,0x00,
|
||||
0x28,0x70,0xfb,0x5a,0xd1,0xbc,0x00,0x8c,0x75,0xcb,0xc6,0x51,0xbb,0x00,0x5c,0xc5,
|
||||
0x0d,0x3a,0xc8,0x5f,0x78,0x01,0xb8,0x81,0xc9,0xdd,0x94,0x5d,0xb5,0x3a,0x17,0x80,
|
||||
0x76,0xed,0xcd,0x55,0xd6,0xb6,0x6a,0x17,0x80,0xb1,0xea,0xdb,0x50,0xf3,0x02,0xc0,
|
||||
0x47,0xed,0xa5,0xa9,0x73,0x01,0x78,0xb2,0xf6,0x26,0x55,0xb5,0x00,0xd0,0xde,0xb6,
|
||||
0x3a,0x17,0x00,0x3e,0xa5,0x5e,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xea,0xfc,0x03,0x26,
|
||||
0x84,0x0a,0xd6,0x36,0x10,0x0e,0x00,
|
||||
789
board/esd/apc405/strataflash.c
Normal file
789
board/esd/apc405/strataflash.c
Normal file
@ -0,0 +1,789 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Brad Kemp, Seranoa Networks, Brad.Kemp@seranoa.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>
|
||||
|
||||
#undef DEBUG_FLASH
|
||||
/*
|
||||
* This file implements a Common Flash Interface (CFI) driver for ppcboot.
|
||||
* The width of the port and the width of the chips are determined at initialization.
|
||||
* These widths are used to calculate the address for access CFI data structures.
|
||||
* It has been tested on an Intel Strataflash implementation.
|
||||
*
|
||||
* References
|
||||
* JEDEC Standard JESD68 - Common Flash Interface (CFI)
|
||||
* JEDEC Standard JEP137-A Common Flash Interface (CFI) ID Codes
|
||||
* Intel Application Note 646 Common Flash Interface (CFI) and Command Sets
|
||||
* Intel 290667-008 3 Volt Intel StrataFlash Memory datasheet
|
||||
*
|
||||
* TODO
|
||||
* Use Primary Extended Query table (PRI) and Alternate Algorithm Query Table (ALT) to determine if protection is available
|
||||
* Add support for other command sets Use the PRI and ALT to determine command set
|
||||
* Verify erase and program timeouts.
|
||||
*/
|
||||
|
||||
#define FLASH_CMD_CFI 0x98
|
||||
#define FLASH_CMD_READ_ID 0x90
|
||||
#define FLASH_CMD_RESET 0xff
|
||||
#define FLASH_CMD_BLOCK_ERASE 0x20
|
||||
#define FLASH_CMD_ERASE_CONFIRM 0xD0
|
||||
#define FLASH_CMD_WRITE 0x40
|
||||
#define FLASH_CMD_PROTECT 0x60
|
||||
#define FLASH_CMD_PROTECT_SET 0x01
|
||||
#define FLASH_CMD_PROTECT_CLEAR 0xD0
|
||||
#define FLASH_CMD_CLEAR_STATUS 0x50
|
||||
#define FLASH_CMD_WRITE_TO_BUFFER 0xE8
|
||||
#define FLASH_CMD_WRITE_BUFFER_CONFIRM 0xD0
|
||||
|
||||
#define FLASH_STATUS_DONE 0x80
|
||||
#define FLASH_STATUS_ESS 0x40
|
||||
#define FLASH_STATUS_ECLBS 0x20
|
||||
#define FLASH_STATUS_PSLBS 0x10
|
||||
#define FLASH_STATUS_VPENS 0x08
|
||||
#define FLASH_STATUS_PSS 0x04
|
||||
#define FLASH_STATUS_DPS 0x02
|
||||
#define FLASH_STATUS_R 0x01
|
||||
#define FLASH_STATUS_PROTECT 0x01
|
||||
|
||||
#define FLASH_OFFSET_CFI 0x55
|
||||
#define FLASH_OFFSET_CFI_RESP 0x10
|
||||
#define FLASH_OFFSET_WTOUT 0x1F
|
||||
#define FLASH_OFFSET_WBTOUT 0x20
|
||||
#define FLASH_OFFSET_ETOUT 0x21
|
||||
#define FLASH_OFFSET_CETOUT 0x22
|
||||
#define FLASH_OFFSET_WMAX_TOUT 0x23
|
||||
#define FLASH_OFFSET_WBMAX_TOUT 0x24
|
||||
#define FLASH_OFFSET_EMAX_TOUT 0x25
|
||||
#define FLASH_OFFSET_CEMAX_TOUT 0x26
|
||||
#define FLASH_OFFSET_SIZE 0x27
|
||||
#define FLASH_OFFSET_INTERFACE 0x28
|
||||
#define FLASH_OFFSET_BUFFER_SIZE 0x2A
|
||||
#define FLASH_OFFSET_NUM_ERASE_REGIONS 0x2C
|
||||
#define FLASH_OFFSET_ERASE_REGIONS 0x2D
|
||||
#define FLASH_OFFSET_PROTECT 0x02
|
||||
#define FLASH_OFFSET_USER_PROTECTION 0x85
|
||||
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
|
||||
|
||||
#define FLASH_MAN_CFI 0x01000000
|
||||
|
||||
typedef union {
|
||||
unsigned char c;
|
||||
unsigned short w;
|
||||
unsigned long l;
|
||||
} cfiword_t;
|
||||
|
||||
typedef union {
|
||||
unsigned char * cp;
|
||||
unsigned short *wp;
|
||||
unsigned long *lp;
|
||||
} cfiptr_t;
|
||||
|
||||
#define NUM_ERASE_REGIONS 4
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
|
||||
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
|
||||
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
|
||||
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);
|
||||
static int flash_isequal(flash_info_t * info, int sect, uchar offset, uchar cmd);
|
||||
static int flash_isset(flash_info_t * info, int sect, uchar offset, uchar cmd);
|
||||
static int flash_detect_cfi(flash_info_t * info);
|
||||
static ulong flash_get_size (ulong base, int banknum);
|
||||
static int flash_write_cfiword (flash_info_t *info, ulong dest, cfiword_t cword);
|
||||
static int flash_full_status_check(flash_info_t * info, ulong sector, ulong tout, char * prompt);
|
||||
#ifdef CFG_FLASH_USE_BUFFER_WRITE
|
||||
static int flash_write_cfibuffer(flash_info_t * info, ulong dest, uchar * cp, int len);
|
||||
#endif
|
||||
/*-----------------------------------------------------------------------
|
||||
* create an address based on the offset and the port width
|
||||
*/
|
||||
inline uchar * flash_make_addr(flash_info_t * info, int sect, int offset)
|
||||
{
|
||||
return ((uchar *)(info->start[sect] + (offset * info->portwidth)));
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
* read a character at a port width address
|
||||
*/
|
||||
inline uchar flash_read_uchar(flash_info_t * info, uchar offset)
|
||||
{
|
||||
uchar *cp;
|
||||
cp = flash_make_addr(info, 0, offset);
|
||||
return (cp[info->portwidth - 1]);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* read a short word by swapping for ppc format.
|
||||
*/
|
||||
ushort flash_read_ushort(flash_info_t * info, int sect, uchar offset)
|
||||
{
|
||||
uchar * addr;
|
||||
|
||||
addr = flash_make_addr(info, sect, offset);
|
||||
return ((addr[(2*info->portwidth) - 1] << 8) | addr[info->portwidth - 1]);
|
||||
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* read a long word by picking the least significant byte of each maiximum
|
||||
* port size word. Swap for ppc format.
|
||||
*/
|
||||
ulong flash_read_long(flash_info_t * info, int sect, uchar offset)
|
||||
{
|
||||
uchar * addr;
|
||||
|
||||
addr = flash_make_addr(info, sect, offset);
|
||||
return ( (addr[(2*info->portwidth) - 1] << 24 ) | (addr[(info->portwidth) -1] << 16) |
|
||||
(addr[(4*info->portwidth) - 1] << 8) | addr[(3*info->portwidth) - 1]);
|
||||
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size;
|
||||
int i;
|
||||
unsigned long address;
|
||||
|
||||
|
||||
/* The flash is positioned back to back, with the demultiplexing of the chip
|
||||
* based on the A24 address line.
|
||||
*
|
||||
*/
|
||||
|
||||
address = CFG_FLASH_BASE;
|
||||
size = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
size += flash_info[i].size = flash_get_size(address, i);
|
||||
address += CFG_FLASH_INCREMENT;
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank %d - Size = 0x%08lx = %ld MB\n",i,
|
||||
flash_info[0].size, flash_info[i].size<<20);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0 /* test-only */
|
||||
/* Monitor protection ON by default */
|
||||
#if (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
|
||||
for(i=0; flash_info[0].start[i] < CFG_MONITOR_BASE+CFG_MONITOR_LEN-1; i++)
|
||||
(void)flash_real_protect(&flash_info[0], i, 1);
|
||||
#endif
|
||||
#else
|
||||
/* monitor protection ON by default */
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
- CFG_MONITOR_LEN,
|
||||
- 1, &flash_info[1]);
|
||||
#endif
|
||||
|
||||
return (size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
int rcode = 0;
|
||||
int prot;
|
||||
int sect;
|
||||
|
||||
if( info->flash_id != FLASH_MAN_CFI) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
printf ("- no sectors to erase\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
|
||||
for (sect = s_first; sect<=s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
flash_write_cmd(info, sect, 0, FLASH_CMD_CLEAR_STATUS);
|
||||
flash_write_cmd(info, sect, 0, FLASH_CMD_BLOCK_ERASE);
|
||||
flash_write_cmd(info, sect, 0, FLASH_CMD_ERASE_CONFIRM);
|
||||
|
||||
if(flash_full_status_check(info, sect, info->erase_blk_tout, "erase")) {
|
||||
rcode = 1;
|
||||
} else
|
||||
printf(".");
|
||||
}
|
||||
}
|
||||
printf (" done\n");
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id != FLASH_MAN_CFI) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("CFI conformant FLASH (%d x %d)",
|
||||
(info->portwidth << 3 ), (info->chipwidth << 3 ));
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
printf(" Erase timeout %ld ms, write timeout %ld ms, buffer write timeout %ld ms, buffer size %d\n",
|
||||
info->erase_blk_tout, info->write_tout, info->buffer_write_tout, info->buffer_size);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
#ifdef CFG_FLASH_EMPTY_INFO
|
||||
int k;
|
||||
int size;
|
||||
int erased;
|
||||
volatile unsigned long *flash;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* 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 wp;
|
||||
ulong cp;
|
||||
int aln;
|
||||
cfiword_t cword;
|
||||
int i, rc;
|
||||
|
||||
/* get lower aligned address */
|
||||
wp = (addr & ~(info->portwidth - 1));
|
||||
|
||||
/* handle unaligned start */
|
||||
if((aln = addr - wp) != 0) {
|
||||
cword.l = 0;
|
||||
cp = wp;
|
||||
for(i=0;i<aln; ++i, ++cp)
|
||||
flash_add_byte(info, &cword, (*(uchar *)cp));
|
||||
|
||||
for(; (i< info->portwidth) && (cnt > 0) ; i++) {
|
||||
flash_add_byte(info, &cword, *src++);
|
||||
cnt--;
|
||||
cp++;
|
||||
}
|
||||
for(; (cnt == 0) && (i < info->portwidth); ++i, ++cp)
|
||||
flash_add_byte(info, &cword, (*(uchar *)cp));
|
||||
if((rc = flash_write_cfiword(info, wp, cword)) != 0)
|
||||
return rc;
|
||||
wp = cp;
|
||||
}
|
||||
|
||||
#ifdef CFG_FLASH_USE_BUFFER_WRITE
|
||||
while(cnt >= info->portwidth) {
|
||||
i = info->buffer_size > cnt? cnt: info->buffer_size;
|
||||
if((rc = flash_write_cfibuffer(info, wp, src,i)) != ERR_OK)
|
||||
return rc;
|
||||
wp += i;
|
||||
src += i;
|
||||
cnt -=i;
|
||||
}
|
||||
#else
|
||||
/* handle the aligned part */
|
||||
while(cnt >= info->portwidth) {
|
||||
cword.l = 0;
|
||||
for(i = 0; i < info->portwidth; i++) {
|
||||
flash_add_byte(info, &cword, *src++);
|
||||
}
|
||||
if((rc = flash_write_cfiword(info, wp, cword)) != 0)
|
||||
return rc;
|
||||
wp += info->portwidth;
|
||||
cnt -= info->portwidth;
|
||||
}
|
||||
#endif /* CFG_FLASH_USE_BUFFER_WRITE */
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
cword.l = 0;
|
||||
for (i=0, cp=wp; (i<info->portwidth) && (cnt>0); ++i, ++cp) {
|
||||
flash_add_byte(info, &cword, *src++);
|
||||
--cnt;
|
||||
}
|
||||
for (; i<info->portwidth; ++i, ++cp) {
|
||||
flash_add_byte(info, & cword, (*(uchar *)cp));
|
||||
}
|
||||
|
||||
return flash_write_cfiword(info, wp, cword);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
int flash_real_protect(flash_info_t *info, long sector, int prot)
|
||||
{
|
||||
int retcode = 0;
|
||||
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
|
||||
if(prot)
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_SET);
|
||||
else
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
|
||||
|
||||
if((retcode = flash_full_status_check(info, sector, info->erase_blk_tout,
|
||||
prot?"protect":"unprotect")) == 0) {
|
||||
|
||||
info->protect[sector] = prot;
|
||||
/* Intel's unprotect unprotects all locking */
|
||||
if(prot == 0) {
|
||||
int i;
|
||||
for(i = 0 ; i<info->sector_count; i++) {
|
||||
if(info->protect[i])
|
||||
flash_real_protect(info, i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retcode;
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
* wait for XSR.7 to be set. Time out with an error if it does not.
|
||||
* This routine does not set the flash to read-array mode.
|
||||
*/
|
||||
static int flash_status_check(flash_info_t * info, ulong sector, ulong tout, char * prompt)
|
||||
{
|
||||
ulong start;
|
||||
|
||||
/* Wait for command completion */
|
||||
start = get_timer (0);
|
||||
while(!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
|
||||
if (get_timer(start) > info->erase_blk_tout) {
|
||||
printf("Flash %s timeout at address %lx\n", prompt, info->start[sector]);
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
|
||||
return ERR_TIMOUT;
|
||||
}
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
* Wait for XSR.7 to be set, if it times out print an error, otherwise do a full status check.
|
||||
* This routine sets the flash to read-array mode.
|
||||
*/
|
||||
static int flash_full_status_check(flash_info_t * info, ulong sector, ulong tout, char * prompt)
|
||||
{
|
||||
int retcode;
|
||||
retcode = flash_status_check(info, sector, tout, prompt);
|
||||
if((retcode == ERR_OK) && !flash_isequal(info,sector, 0, FLASH_STATUS_DONE)) {
|
||||
retcode = ERR_INVAL;
|
||||
printf("Flash %s error at address %lx\n", prompt,info->start[sector]);
|
||||
if(flash_isset(info, sector, 0, FLASH_STATUS_ECLBS | FLASH_STATUS_PSLBS)){
|
||||
printf("Command Sequence Error.\n");
|
||||
} else if(flash_isset(info, sector, 0, FLASH_STATUS_ECLBS)){
|
||||
printf("Block Erase Error.\n");
|
||||
retcode = ERR_NOT_ERASED;
|
||||
} else if (flash_isset(info, sector, 0, FLASH_STATUS_PSLBS)) {
|
||||
printf("Locking Error\n");
|
||||
}
|
||||
if(flash_isset(info, sector, 0, FLASH_STATUS_DPS)){
|
||||
printf("Block locked.\n");
|
||||
retcode = ERR_PROTECTED;
|
||||
}
|
||||
if(flash_isset(info, sector, 0, FLASH_STATUS_VPENS))
|
||||
printf("Vpp Low Error.\n");
|
||||
}
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
|
||||
return retcode;
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c)
|
||||
{
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
cword->c = c;
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
cword->w = (cword->w << 8) | c;
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
cword->l = (cword->l << 8) | c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* make a proper sized command based on the port and chip widths
|
||||
*/
|
||||
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf)
|
||||
{
|
||||
int i;
|
||||
uchar *cp = (uchar *)cmdbuf;
|
||||
for(i=0; i< info->portwidth; i++)
|
||||
*cp++ = ((i+1) % info->chipwidth) ? '\0':cmd;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a proper sized command to the correct address
|
||||
*/
|
||||
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd)
|
||||
{
|
||||
|
||||
volatile cfiptr_t addr;
|
||||
cfiword_t cword;
|
||||
addr.cp = flash_make_addr(info, sect, offset);
|
||||
flash_make_cmd(info, cmd, &cword);
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
*addr.cp = cword.c;
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
*addr.wp = cword.w;
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
*addr.lp = cword.l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static int flash_isequal(flash_info_t * info, int sect, uchar offset, uchar cmd)
|
||||
{
|
||||
cfiptr_t cptr;
|
||||
cfiword_t cword;
|
||||
int retval;
|
||||
cptr.cp = flash_make_addr(info, sect, offset);
|
||||
flash_make_cmd(info, cmd, &cword);
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
retval = (cptr.cp[0] == cword.c);
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
retval = (cptr.wp[0] == cword.w);
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
retval = (cptr.lp[0] == cword.l);
|
||||
break;
|
||||
default:
|
||||
retval = 0;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static int flash_isset(flash_info_t * info, int sect, uchar offset, uchar cmd)
|
||||
{
|
||||
cfiptr_t cptr;
|
||||
cfiword_t cword;
|
||||
int retval;
|
||||
cptr.cp = flash_make_addr(info, sect, offset);
|
||||
flash_make_cmd(info, cmd, &cword);
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
retval = ((cptr.cp[0] & cword.c) == cword.c);
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
retval = ((cptr.wp[0] & cword.w) == cword.w);
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
retval = ((cptr.lp[0] & cword.l) == cword.l);
|
||||
break;
|
||||
default:
|
||||
retval = 0;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* detect if flash is compatible with the Common Flash Interface (CFI)
|
||||
* http://www.jedec.org/download/search/jesd68.pdf
|
||||
*
|
||||
*/
|
||||
static int flash_detect_cfi(flash_info_t * info)
|
||||
{
|
||||
|
||||
for(info->portwidth=FLASH_CFI_8BIT; info->portwidth <= FLASH_CFI_32BIT;
|
||||
info->portwidth <<= 1) {
|
||||
for(info->chipwidth =FLASH_CFI_BY8;
|
||||
info->chipwidth <= info->portwidth;
|
||||
info->chipwidth <<= 1) {
|
||||
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
|
||||
flash_write_cmd(info, 0, FLASH_OFFSET_CFI, FLASH_CMD_CFI);
|
||||
if(flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP,'Q') &&
|
||||
flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP + 1, 'R') &&
|
||||
flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP + 2, 'Y'))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*
|
||||
*/
|
||||
static ulong flash_get_size (ulong base, int banknum)
|
||||
{
|
||||
flash_info_t * info = &flash_info[banknum];
|
||||
int i, j;
|
||||
int sect_cnt;
|
||||
unsigned long sector;
|
||||
unsigned long tmp;
|
||||
int size_ratio;
|
||||
uchar num_erase_regions;
|
||||
int erase_region_size;
|
||||
int erase_region_count;
|
||||
|
||||
info->start[0] = base;
|
||||
|
||||
if(flash_detect_cfi(info)){
|
||||
#ifdef DEBUG_FLASH
|
||||
printf("portwidth=%d chipwidth=%d\n", info->portwidth, info->chipwidth); /* test-only */
|
||||
#endif
|
||||
size_ratio = info->portwidth / info->chipwidth;
|
||||
num_erase_regions = flash_read_uchar(info, FLASH_OFFSET_NUM_ERASE_REGIONS);
|
||||
#ifdef DEBUG_FLASH
|
||||
printf("found %d erase regions\n", num_erase_regions);
|
||||
#endif
|
||||
sect_cnt = 0;
|
||||
sector = base;
|
||||
for(i = 0 ; i < num_erase_regions; i++) {
|
||||
if(i > NUM_ERASE_REGIONS) {
|
||||
printf("%d erase regions found, only %d used\n",
|
||||
num_erase_regions, NUM_ERASE_REGIONS);
|
||||
break;
|
||||
}
|
||||
tmp = flash_read_long(info, 0, FLASH_OFFSET_ERASE_REGIONS);
|
||||
erase_region_size = (tmp & 0xffff)? ((tmp & 0xffff) * 256): 128;
|
||||
tmp >>= 16;
|
||||
erase_region_count = (tmp & 0xffff) +1;
|
||||
for(j = 0; j< erase_region_count; j++) {
|
||||
info->start[sect_cnt] = sector;
|
||||
sector += (erase_region_size * size_ratio);
|
||||
info->protect[sect_cnt] = flash_isset(info, sect_cnt, FLASH_OFFSET_PROTECT, FLASH_STATUS_PROTECT);
|
||||
sect_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
info->sector_count = sect_cnt;
|
||||
/* multiply the size by the number of chips */
|
||||
info->size = (1 << flash_read_uchar(info, FLASH_OFFSET_SIZE)) * size_ratio;
|
||||
info->buffer_size = (1 << flash_read_ushort(info, 0, FLASH_OFFSET_BUFFER_SIZE));
|
||||
tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_ETOUT);
|
||||
info->erase_blk_tout = (tmp * (1 << flash_read_uchar(info, FLASH_OFFSET_EMAX_TOUT)));
|
||||
tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_WBTOUT);
|
||||
info->buffer_write_tout = (tmp * (1 << flash_read_uchar(info, FLASH_OFFSET_WBMAX_TOUT)));
|
||||
tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_WTOUT);
|
||||
info->write_tout = (tmp * (1 << flash_read_uchar(info, FLASH_OFFSET_WMAX_TOUT)))/ 1000;
|
||||
info->flash_id = FLASH_MAN_CFI;
|
||||
}
|
||||
|
||||
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
|
||||
return(info->size);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static int flash_write_cfiword (flash_info_t *info, ulong dest, cfiword_t cword)
|
||||
{
|
||||
|
||||
cfiptr_t ctladdr;
|
||||
cfiptr_t cptr;
|
||||
int flag;
|
||||
|
||||
ctladdr.cp = flash_make_addr(info, 0, 0);
|
||||
cptr.cp = (uchar *)dest;
|
||||
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
flag = ((cptr.cp[0] & cword.c) == cword.c);
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
flag = ((cptr.wp[0] & cword.w) == cword.w);
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
flag = ((cptr.lp[0] & cword.l) == cword.l);
|
||||
break;
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
if(!flag)
|
||||
return 2;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
flash_write_cmd(info, 0, 0, FLASH_CMD_CLEAR_STATUS);
|
||||
flash_write_cmd(info, 0, 0, FLASH_CMD_WRITE);
|
||||
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
cptr.cp[0] = cword.c;
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
cptr.wp[0] = cword.w;
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
cptr.lp[0] = cword.l;
|
||||
break;
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if(flag)
|
||||
enable_interrupts();
|
||||
|
||||
return flash_full_status_check(info, 0, info->write_tout, "write");
|
||||
}
|
||||
|
||||
#ifdef CFG_FLASH_USE_BUFFER_WRITE
|
||||
|
||||
/* loop through the sectors from the highest address
|
||||
* when the passed address is greater or equal to the sector address
|
||||
* we have a match
|
||||
*/
|
||||
static int find_sector(flash_info_t *info, ulong addr)
|
||||
{
|
||||
int sector;
|
||||
for(sector = info->sector_count - 1; sector >= 0; sector--) {
|
||||
if(addr >= info->start[sector])
|
||||
break;
|
||||
}
|
||||
return sector;
|
||||
}
|
||||
|
||||
static int flash_write_cfibuffer(flash_info_t * info, ulong dest, uchar * cp, int len)
|
||||
{
|
||||
|
||||
int sector;
|
||||
int cnt;
|
||||
int retcode;
|
||||
volatile cfiptr_t src;
|
||||
volatile cfiptr_t dst;
|
||||
|
||||
src.cp = cp;
|
||||
dst.cp = (uchar *)dest;
|
||||
sector = find_sector(info, dest);
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_WRITE_TO_BUFFER);
|
||||
if((retcode = flash_status_check(info, sector, info->buffer_write_tout,
|
||||
"write to buffer")) == ERR_OK) {
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
cnt = len;
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
cnt = len >> 1;
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
cnt = len >> 2;
|
||||
break;
|
||||
default:
|
||||
return ERR_INVAL;
|
||||
break;
|
||||
}
|
||||
flash_write_cmd(info, sector, 0, (uchar)cnt-1);
|
||||
while(cnt-- > 0) {
|
||||
switch(info->portwidth) {
|
||||
case FLASH_CFI_8BIT:
|
||||
*dst.cp++ = *src.cp++;
|
||||
break;
|
||||
case FLASH_CFI_16BIT:
|
||||
*dst.wp++ = *src.wp++;
|
||||
break;
|
||||
case FLASH_CFI_32BIT:
|
||||
*dst.lp++ = *src.lp++;
|
||||
break;
|
||||
default:
|
||||
return ERR_INVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_WRITE_BUFFER_CONFIRM);
|
||||
retcode = flash_full_status_check(info, sector, info->buffer_write_tout,
|
||||
"buffer write");
|
||||
}
|
||||
flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
|
||||
return retcode;
|
||||
}
|
||||
#endif /* CFG_USE_FLASH_BUFFER_WRITE */
|
||||
148
board/esd/apc405/u-boot.lds
Normal file
148
board/esd/apc405/u-boot.lds
Normal file
@ -0,0 +1,148 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/ppc4xx/start.o (.text)
|
||||
cpu/ppc4xx/traps.o (.text)
|
||||
cpu/ppc4xx/interrupts.o (.text)
|
||||
cpu/ppc4xx/serial.o (.text)
|
||||
cpu/ppc4xx/cpu_init.o (.text)
|
||||
cpu/ppc4xx/speed.o (.text)
|
||||
cpu/ppc4xx/405gp_enet.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* . = env_offset;*/
|
||||
/* common/environment.o(.text)*/
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
OBJS = $(BOARD).o flash.o ../common/misc.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* (C) Copyright 2001-2004
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@ -28,6 +28,7 @@
|
||||
|
||||
/*cmd_boot.c*/
|
||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
extern void lxt971_no_sleep(void);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@ -40,6 +41,10 @@ const unsigned char fpgadata[] = {
|
||||
#include "fpgadata.c"
|
||||
};
|
||||
|
||||
const unsigned char fpgadata_xl30[] = {
|
||||
#include "fpgadata_xl30.c"
|
||||
};
|
||||
|
||||
/*
|
||||
* include common fpga code (for esd boards)
|
||||
*/
|
||||
@ -64,45 +69,52 @@ int board_early_init_f (void)
|
||||
/*
|
||||
* Boot onboard FPGA
|
||||
*/
|
||||
/* first try 40er image */
|
||||
gd->board_type = 40;
|
||||
status = fpga_boot ((unsigned char *) fpgadata, sizeof (fpgadata));
|
||||
if (status != 0) {
|
||||
/* booting FPGA failed */
|
||||
/* try xl30er image */
|
||||
gd->board_type = 30;
|
||||
status = fpga_boot ((unsigned char *) fpgadata_xl30, sizeof (fpgadata_xl30));
|
||||
if (status != 0) {
|
||||
/* booting FPGA failed */
|
||||
#ifndef FPGA_DEBUG
|
||||
/* set up serial port with default baudrate */
|
||||
(void) get_clocks ();
|
||||
gd->baudrate = CONFIG_BAUDRATE;
|
||||
serial_init ();
|
||||
console_init_f ();
|
||||
/* set up serial port with default baudrate */
|
||||
(void) get_clocks ();
|
||||
gd->baudrate = CONFIG_BAUDRATE;
|
||||
serial_init ();
|
||||
console_init_f ();
|
||||
#endif
|
||||
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;
|
||||
}
|
||||
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 = fpgadata[index];
|
||||
printf ("FPGA: %s\n", &(fpgadata[index + 1]));
|
||||
index += len + 3;
|
||||
/* display infos on fpgaimage */
|
||||
index = 15;
|
||||
for (i = 0; i < 4; i++) {
|
||||
len = fpgadata[index];
|
||||
printf ("FPGA: %s\n", &(fpgadata[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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -139,32 +151,44 @@ int board_early_init_f (void)
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int index;
|
||||
int len;
|
||||
unsigned char str[64];
|
||||
int i = getenv_r ("serial#", str, sizeof (str));
|
||||
const unsigned char *fpga;
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (!i || strncmp (str, "AR405", 5)) {
|
||||
puts ("### No HW ID - assuming AR405\n");
|
||||
return (0);
|
||||
if (i == -1) {
|
||||
puts ("### No HW ID - assuming AR405");
|
||||
} else {
|
||||
puts(str);
|
||||
}
|
||||
|
||||
puts (str);
|
||||
|
||||
puts ("\nFPGA: ");
|
||||
|
||||
/* display infos on fpgaimage */
|
||||
if (gd->board_type == 30) {
|
||||
fpga = fpgadata_xl30;
|
||||
} else {
|
||||
fpga = fpgadata;
|
||||
}
|
||||
index = 15;
|
||||
for (i = 0; i < 4; i++) {
|
||||
len = fpgadata[index];
|
||||
printf ("%s ", &(fpgadata[index + 1]));
|
||||
len = fpga[index];
|
||||
printf ("%s ", &(fpga[index + 1]));
|
||||
index += len + 3;
|
||||
}
|
||||
|
||||
putc ('\n');
|
||||
|
||||
/*
|
||||
* Disable sleep mode in LXT971
|
||||
*/
|
||||
lxt971_no_sleep();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -172,7 +196,12 @@ int checkboard (void)
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
return (16 * 1024 * 1024);
|
||||
unsigned long val;
|
||||
|
||||
mtdcr(memcfga, mem_mb0cf);
|
||||
val = mfdcr(memcfgd);
|
||||
|
||||
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -185,4 +214,225 @@ int testdram (void)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if 1 /* test-only: some internal test routines... */
|
||||
/*
|
||||
* Some test routines
|
||||
*/
|
||||
int do_digtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
volatile uchar *digen = (volatile uchar *)0xf03000b4;
|
||||
volatile ushort *digout = (volatile ushort *)0xf03000b0;
|
||||
volatile ushort *digin = (volatile ushort *)0xf03000a0;
|
||||
int i;
|
||||
int k;
|
||||
int start;
|
||||
int end;
|
||||
|
||||
if (argc != 3) {
|
||||
puts("Usage: digtest n_start n_end (digtest 0 7)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
start = simple_strtol (argv[1], NULL, 10);
|
||||
end = simple_strtol (argv[2], NULL, 10);
|
||||
|
||||
/*
|
||||
* Enable digital outputs
|
||||
*/
|
||||
*digen = 0x08;
|
||||
|
||||
printf("\nStarting digital In-/Out Test from I/O %d to %d (Cntrl-C to abort)...\n",
|
||||
start, end);
|
||||
|
||||
/*
|
||||
* Set outputs one by one
|
||||
*/
|
||||
for (;;) {
|
||||
for (i=start; i<=end; i++) {
|
||||
*digout = 0x0001 << i;
|
||||
for (k=0; k<200; k++)
|
||||
udelay(1000);
|
||||
|
||||
if (*digin != (0x0001 << i)) {
|
||||
printf("ERROR: OUT=0x%04X, IN=0x%04X\n", 0x0001 << i, *digin);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Abort if ctrl-c was pressed */
|
||||
if (ctrlc()) {
|
||||
puts("\nAbort\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
digtest, 3, 1, do_digtest,
|
||||
"digtest - Test digital in-/output\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
#define ERROR_DELTA 256
|
||||
|
||||
struct io {
|
||||
volatile short val;
|
||||
short dummy;
|
||||
};
|
||||
|
||||
int do_anatest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
volatile short val;
|
||||
int i;
|
||||
int volt;
|
||||
struct io *out;
|
||||
struct io *in;
|
||||
|
||||
out = (struct io *)0xf0300090;
|
||||
in = (struct io *)0xf0300000;
|
||||
|
||||
i = simple_strtol (argv[1], NULL, 10);
|
||||
|
||||
volt = 0;
|
||||
printf("Setting Channel %d to %dV...\n", i, volt);
|
||||
out[i].val = (volt * 0x7fff) / 10;
|
||||
udelay(10000);
|
||||
val = in[i*2].val;
|
||||
printf("-> InChannel %d: 0x%04x=%dV\n", i*2, val, (val * 4000) / 0x7fff);
|
||||
if ((val < ((volt * 0x7fff) / 40) - ERROR_DELTA) ||
|
||||
(val > ((volt * 0x7fff) / 40) + ERROR_DELTA)) {
|
||||
printf("ERROR! (min=0x%04x max=0x%04x)\n", ((volt * 0x7fff) / 40) - ERROR_DELTA,
|
||||
((volt * 0x7fff) / 40) + ERROR_DELTA);
|
||||
return -1;
|
||||
}
|
||||
val = in[i*2+1].val;
|
||||
printf("-> InChannel %d: 0x%04x=%dV\n", i*2+1, val, (val * 4000) / 0x7fff);
|
||||
if ((val < ((volt * 0x7fff) / 40) - ERROR_DELTA) ||
|
||||
(val > ((volt * 0x7fff) / 40) + ERROR_DELTA)) {
|
||||
printf("ERROR! (min=0x%04x max=0x%04x)\n", ((volt * 0x7fff) / 40) - ERROR_DELTA,
|
||||
((volt * 0x7fff) / 40) + ERROR_DELTA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
volt = 5;
|
||||
printf("Setting Channel %d to %dV...\n", i, volt);
|
||||
out[i].val = (volt * 0x7fff) / 10;
|
||||
udelay(10000);
|
||||
val = in[i*2].val;
|
||||
printf("-> InChannel %d: 0x%04x=%dV\n", i*2, val, (val * 4000) / 0x7fff);
|
||||
if ((val < ((volt * 0x7fff) / 40) - ERROR_DELTA) ||
|
||||
(val > ((volt * 0x7fff) / 40) + ERROR_DELTA)) {
|
||||
printf("ERROR! (min=0x%04x max=0x%04x)\n", ((volt * 0x7fff) / 40) - ERROR_DELTA,
|
||||
((volt * 0x7fff) / 40) + ERROR_DELTA);
|
||||
return -1;
|
||||
}
|
||||
val = in[i*2+1].val;
|
||||
printf("-> InChannel %d: 0x%04x=%dV\n", i*2+1, val, (val * 4000) / 0x7fff);
|
||||
if ((val < ((volt * 0x7fff) / 40) - ERROR_DELTA) ||
|
||||
(val > ((volt * 0x7fff) / 40) + ERROR_DELTA)) {
|
||||
printf("ERROR! (min=0x%04x max=0x%04x)\n", ((volt * 0x7fff) / 40) - ERROR_DELTA,
|
||||
((volt * 0x7fff) / 40) + ERROR_DELTA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
volt = 10;
|
||||
printf("Setting Channel %d to %dV...\n", i, volt);
|
||||
out[i].val = (volt * 0x7fff) / 10;
|
||||
udelay(10000);
|
||||
val = in[i*2].val;
|
||||
printf("-> InChannel %d: 0x%04x=%dV\n", i*2, val, (val * 4000) / 0x7fff);
|
||||
if ((val < ((volt * 0x7fff) / 40) - ERROR_DELTA) ||
|
||||
(val > ((volt * 0x7fff) / 40) + ERROR_DELTA)) {
|
||||
printf("ERROR! (min=0x%04x max=0x%04x)\n", ((volt * 0x7fff) / 40) - ERROR_DELTA,
|
||||
((volt * 0x7fff) / 40) + ERROR_DELTA);
|
||||
return -1;
|
||||
}
|
||||
val = in[i*2+1].val;
|
||||
printf("-> InChannel %d: 0x%04x=%dV\n", i*2+1, val, (val * 4000) / 0x7fff);
|
||||
if ((val < ((volt * 0x7fff) / 40) - ERROR_DELTA) ||
|
||||
(val > ((volt * 0x7fff) / 40) + ERROR_DELTA)) {
|
||||
printf("ERROR! (min=0x%04x max=0x%04x)\n", ((volt * 0x7fff) / 40) - ERROR_DELTA,
|
||||
((volt * 0x7fff) / 40) + ERROR_DELTA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Channel %d OK!\n", i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
anatest, 2, 1, do_anatest,
|
||||
"anatest - Test analog in-/output\n",
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
int counter = 0;
|
||||
|
||||
void cyclicInt(void *ptr)
|
||||
{
|
||||
*(ushort *)0xf03000e8 = 0x0800; /* ack int */
|
||||
counter++;
|
||||
}
|
||||
|
||||
|
||||
int do_inctest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
volatile uchar *digout = (volatile uchar *)0xf03000b4;
|
||||
volatile ulong *incin;
|
||||
int i;
|
||||
|
||||
incin = (volatile ulong *)0xf0300040;
|
||||
|
||||
/*
|
||||
* Clear inc counter
|
||||
*/
|
||||
incin[0] = 0;
|
||||
incin[1] = 0;
|
||||
incin[2] = 0;
|
||||
incin[3] = 0;
|
||||
|
||||
incin = (volatile ulong *)0xf0300050;
|
||||
|
||||
/*
|
||||
* Inc a little
|
||||
*/
|
||||
for (i=0; i<10000; i++) {
|
||||
switch (i & 0x03) {
|
||||
case 0:
|
||||
*digout = 0x02;
|
||||
break;
|
||||
case 1:
|
||||
*digout = 0x03;
|
||||
break;
|
||||
case 2:
|
||||
*digout = 0x01;
|
||||
break;
|
||||
case 3:
|
||||
*digout = 0x00;
|
||||
break;
|
||||
}
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
printf("Inc 0 = %ld\n", incin[0]);
|
||||
printf("Inc 1 = %ld\n", incin[1]);
|
||||
printf("Inc 2 = %ld\n", incin[2]);
|
||||
printf("Inc 3 = %ld\n", incin[3]);
|
||||
|
||||
*(ushort *)0xf03000e0 = 0x0c80-1; /* set counter */
|
||||
*(ushort *)0xf03000ec |= 0x0800; /* enable int */
|
||||
irq_install_handler (30, (interrupt_handler_t *) cyclicInt, NULL);
|
||||
printf("counter=%d\n", counter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_CMD(
|
||||
inctest, 3, 1, do_inctest,
|
||||
"inctest - Test incremental encoder inputs\n",
|
||||
NULL
|
||||
);
|
||||
#endif
|
||||
|
||||
@ -26,4 +26,5 @@
|
||||
#
|
||||
|
||||
#TEXT_BASE = 0xFFFE0000
|
||||
TEXT_BASE = 0xFFFD0000
|
||||
#TEXT_BASE = 0xFFFD0000
|
||||
TEXT_BASE = 0xFFFC0000
|
||||
|
||||
@ -33,18 +33,19 @@
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size (vu_long *addr, flash_info_t *info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t *info);
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size_b0, size_b1;
|
||||
unsigned long size_b0;
|
||||
int i;
|
||||
uint pbcr;
|
||||
unsigned long base_b0, base_b1;
|
||||
unsigned long base_b0;
|
||||
int size_val = 0;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
|
||||
@ -53,74 +54,48 @@ unsigned long flash_init (void)
|
||||
|
||||
/* Static FLASH Bank configuration here - FIXME XXX */
|
||||
|
||||
base_b0 = FLASH_BASE0_PRELIM;
|
||||
size_b0 = flash_get_size((vu_long *)base_b0, &flash_info[0]);
|
||||
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);
|
||||
}
|
||||
|
||||
base_b1 = FLASH_BASE1_PRELIM;
|
||||
size_b1 = flash_get_size((vu_long *)base_b1, &flash_info[1]);
|
||||
/* 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);
|
||||
|
||||
if (size_b1)
|
||||
{
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb0cr);
|
||||
base_b1 = -size_b1;
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b1 | (((size_b1/1024/1024)-1)<<17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
/* printf("pb1cr = %x\n", pbcr); */
|
||||
}
|
||||
|
||||
if (size_b0)
|
||||
{
|
||||
mtdcr(ebccfga, pb1cr);
|
||||
pbcr = mfdcr(ebccfgd);
|
||||
mtdcr(ebccfga, pb1cr);
|
||||
base_b0 = base_b1 - size_b0;
|
||||
pbcr = (pbcr & 0x0001ffff) | base_b0 | (((size_b0/1024/1024)-1)<<17);
|
||||
mtdcr(ebccfgd, pbcr);
|
||||
/* printf("pb0cr = %x\n", pbcr); */
|
||||
}
|
||||
|
||||
size_b0 = flash_get_size((vu_long *)base_b0, &flash_info[0]);
|
||||
|
||||
flash_get_offsets (base_b0, &flash_info[0]);
|
||||
|
||||
/* monitor protection ON by default */
|
||||
/* Monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
base_b0+size_b0-monitor_flash_len,
|
||||
base_b0+size_b0-1,
|
||||
-CFG_MONITOR_LEN,
|
||||
0xffffffff,
|
||||
&flash_info[0]);
|
||||
|
||||
if (size_b1) {
|
||||
/* Re-do sizing to get full correct info */
|
||||
size_b1 = flash_get_size((vu_long *)base_b1, &flash_info[1]);
|
||||
|
||||
flash_get_offsets (base_b1, &flash_info[1]);
|
||||
|
||||
/* monitor protection ON by default */
|
||||
(void)flash_protect(FLAG_PROTECT_SET,
|
||||
base_b1+size_b1-monitor_flash_len,
|
||||
base_b1+size_b1-1,
|
||||
&flash_info[1]);
|
||||
/* monitor protection OFF by default (one is enough) */
|
||||
(void)flash_protect(FLAG_PROTECT_CLEAR,
|
||||
base_b0+size_b0-monitor_flash_len,
|
||||
base_b0+size_b0-1,
|
||||
&flash_info[0]);
|
||||
} else {
|
||||
flash_info[1].flash_id = FLASH_UNKNOWN;
|
||||
flash_info[1].sector_count = -1;
|
||||
}
|
||||
|
||||
flash_info[0].size = size_b0;
|
||||
flash_info[1].size = size_b1;
|
||||
|
||||
return (size_b0 + size_b1);
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user