mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
23 Commits
U-Boot-0_3
...
LABEL_2003
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d232d0e7e | ||
|
|
c8c3a8be2d | ||
|
|
82226bf4d2 | ||
|
|
7f70e85309 | ||
|
|
59de2ed6b5 | ||
|
|
86d82762f6 | ||
|
|
66fd3d1ce7 | ||
|
|
45219c4660 | ||
|
|
f7de16ae25 | ||
|
|
d6815435c0 | ||
|
|
e600962991 | ||
|
|
9c62cc58b8 | ||
|
|
7aa7861471 | ||
|
|
4532cb696e | ||
|
|
02c9bed451 | ||
|
|
53cad435bb | ||
|
|
059ae173e9 | ||
|
|
824a1ebffe | ||
|
|
d791b1dc3e | ||
|
|
4a6fd34b26 | ||
|
|
69f8f827d5 | ||
|
|
759a51b4f3 | ||
|
|
d126bfbdbd |
112
CHANGELOG
112
CHANGELOG
@@ -1,3 +1,115 @@
|
||||
======================================================================
|
||||
Changes since U-Boot 0.3.1:
|
||||
======================================================================
|
||||
|
||||
* Patch by Dave Ellis, 22 May 2003:
|
||||
Fix problem with only partially cleared .bss segment
|
||||
|
||||
* Patch by Rune Torgersen, 12 May 2003:
|
||||
get PCI to work on a MPC8266ADS board; incorporate change to
|
||||
cpu/mpc8260/pci.c to enable overrides of PCI memory parameters
|
||||
|
||||
* Patch by Nye Liu, 1 May 2003:
|
||||
minor patches for the FADS8xx
|
||||
|
||||
* Patch by Thomas Schäfer, 28 Apr 2003:
|
||||
Fix SPD handling for 256 ECC DIMM on Walnut
|
||||
|
||||
* Add support for arbitrary bitmaps for TRAB's VFD command;
|
||||
allow to pass boot bitmap addresses in environment variables;
|
||||
allow for zero boot delay
|
||||
|
||||
* Patch by Christian Geißinger, 19 May 2002:
|
||||
On TRAB: wait until the dummy byte has been completely sent
|
||||
|
||||
* Patch by David Updegraff, 22 Apr 2003:
|
||||
update for CrayL1 board
|
||||
|
||||
* Patch by Pantelis Antoniou, 21 Apr 2003:
|
||||
add boot support for ARTOS (a proprietary OS)
|
||||
|
||||
* Patch by Steven Scholz, 11 Apr 2003:
|
||||
Add support for RTC DS1338
|
||||
|
||||
* Patch by Rod Boyce, 24 Jan 2003:
|
||||
Fix counting of extended partitions in diskboot command
|
||||
|
||||
* Patch by Christophe Lindheimer, 20 May 2003:
|
||||
allow the use of CFG_LOADS when CFG_NO_FLASH is set
|
||||
|
||||
* Fix SDRAM timing on Purple board
|
||||
|
||||
* Add support for CompactFlash on ATC board
|
||||
(includes support for Intel 82365 and compatible PC Card controllers,
|
||||
and Yenta-compatible PCI-to-CardBus controllers)
|
||||
|
||||
* Patch by Mathijs Haarman, 08 May 2003:
|
||||
Add lan91c96 driver (tested on Lubbock and custom PXA250 board only)
|
||||
|
||||
* Fix problem with usage of "true" (undefined in current versions of bfd.h)
|
||||
|
||||
* Add support for Promess ATC board
|
||||
|
||||
* Patch by Keith Outwater, 28 Apr 2003:
|
||||
- Miscellaneous corrections and additions to GEN860T board specific code.
|
||||
- Added GEN860_SC variant to GEN860T.
|
||||
- Miscellaneous corrections to GEN860T documentation.
|
||||
- Correct duplicate entry in U-Boot CREDITS file.
|
||||
- Add GEN860T_SC entry in MAINTAINERS file.
|
||||
- Update CREDITS file with GEN860T_SC info.
|
||||
|
||||
* Update Smiths Aerospace addresses in MAINTAINERS file
|
||||
|
||||
* Fix error handling in hush's version of "run" command
|
||||
|
||||
* LWMON extensions:
|
||||
- Splashscreen support
|
||||
- modem support
|
||||
- sysmon support
|
||||
- temperature dependend enabling of LCD
|
||||
|
||||
* Allow booting from old "PPCBoot" disk partitions
|
||||
|
||||
* Add support for TQM8255 Board / MPC8255 CPU
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.3.1:
|
||||
======================================================================
|
||||
|
||||
* Make sure Block Lock Bits get cleared in R360MPI flash driver
|
||||
|
||||
* MPC823 LCD driver: Fill color map backwards, to allow for steady
|
||||
display when Linux takes over
|
||||
|
||||
* Patch by Erwin Rol, 27 Feb 2003:
|
||||
Add support for RTEMS (this time for real).
|
||||
|
||||
* Add support for "bmp info" and "bmp display" commands to load
|
||||
bitmap images; this can be used (for example in a "preboot"
|
||||
command) to display a splash screen very quickly after poweron.
|
||||
|
||||
* Add support for 133 MHz clock on INCA-IP board
|
||||
|
||||
* Patch by Lutz Dennig, 10 Apr 2003:
|
||||
Update for R360MPI board
|
||||
|
||||
* Add new meaning to "autostart" environment variable:
|
||||
If set to "no", a standalone image passed to the
|
||||
"bootm" command will be copied to the load address
|
||||
(and eventually uncompressed), but NOT be started.
|
||||
This can be used to load and uncompress arbitrary
|
||||
data.
|
||||
|
||||
* Patch by Stefan Roese, 10 Apr 2003:
|
||||
Changed DHCP client to use IP address from server option field #54
|
||||
from the OFFER packet in the server option field #54 in the REQUEST
|
||||
packet. This fixes a problem using a Windows 2000 DHCP server,
|
||||
where the DHCP-server is not the TFTP-server.
|
||||
|
||||
* Set max brightness for MN11236 displays on TRAB board
|
||||
|
||||
* Add support for TQM862L modules
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.3.0:
|
||||
======================================================================
|
||||
|
||||
14
CREDITS
14
CREDITS
@@ -26,6 +26,10 @@ N: Guillaume Alexandre
|
||||
E: guillaume.alexandre@gespac.ch
|
||||
D: Add PCIPPC6 configuration
|
||||
|
||||
N: Pantelis Antoniou
|
||||
E: panto@intracom.gr
|
||||
D: NETVIA board support, ARTOS support.
|
||||
|
||||
N: Pierre Aubert
|
||||
E: <p.aubert@staubli.com>
|
||||
D: Support for RPXClassic board
|
||||
@@ -212,13 +216,9 @@ E: rof@sysgo.de
|
||||
D: Initial support for SSV-DNP1110, SMC91111 driver
|
||||
W: www.elinos.com
|
||||
|
||||
N: Keith Outwater
|
||||
E: Keith_Outwater@mvis.com
|
||||
D: Support for GEN860T board
|
||||
|
||||
N: Keith Outwater
|
||||
E: keith_outwater@mvis.com
|
||||
D: Support for generic/custom MPC860T board (GEN860T)
|
||||
D: Support for generic/custom MPC860T boards (GEN860T, GEN860T_SC)
|
||||
|
||||
N: Frank Panno
|
||||
E: fpanno@delphintech.com
|
||||
@@ -238,6 +238,10 @@ N: Stefan Roese
|
||||
E: stefan.roese@esd-electronics.com
|
||||
D: IBM PPC401/403/405GP Support; Windows environment support
|
||||
|
||||
N: Erwin Rol
|
||||
E: erwin@muffin.org
|
||||
D: boot support for RTEMS
|
||||
|
||||
N: Neil Russell
|
||||
E: caret@c-side.com
|
||||
D: Author of LiMon-1.4.2, which contributed some ideas
|
||||
|
||||
10
MAINTAINERS
10
MAINTAINERS
@@ -28,7 +28,7 @@ Pantelis Antoniou <panto@intracom.gr>
|
||||
|
||||
NETVIA MPC8xx
|
||||
|
||||
Jerry Van Baren <vanbaren_gerald@si.com>
|
||||
Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
|
||||
|
||||
sacsng MPC8260
|
||||
|
||||
@@ -80,6 +80,11 @@ Wolfgang Denk <wd@denx.de>
|
||||
CU824 MPC8240
|
||||
Sandpoint8240 MPC8240
|
||||
|
||||
ATC MPC8250
|
||||
PM825 MPC8250
|
||||
|
||||
TQM8255 MPC8255
|
||||
|
||||
CPU86 MPC8260
|
||||
PM826 MPC8260
|
||||
TQM8260 MPC8260
|
||||
@@ -87,7 +92,7 @@ Wolfgang Denk <wd@denx.de>
|
||||
PCIPPC2 MPC750
|
||||
PCIPPC6 MPC750
|
||||
|
||||
Jon Diekema <diekema_jon@si.com>
|
||||
Jon Diekema <jon.diekema@smiths-aerospace.com>
|
||||
|
||||
sbc8260 MPC8260
|
||||
|
||||
@@ -160,6 +165,7 @@ Scott McNutt <smcnutt@artesyncp.com>
|
||||
Keith Outwater <Keith_Outwater@mvis.com>
|
||||
|
||||
GEN860T MPC860T
|
||||
GEN860T_SC MPC860T
|
||||
|
||||
Frank Panno <fpanno@delphintech.com>
|
||||
|
||||
|
||||
31
MAKEALL
31
MAKEALL
@@ -26,16 +26,16 @@ LIST_8xx=" \
|
||||
ADS860 AMX860 c2mon CCM \
|
||||
cogent_mpc8xx ESTEEM192E ETX094 ELPT860 \
|
||||
FADS823 FADS850SAR FADS860T FLAGADM \
|
||||
FPS850L GEN860T GENIETV GTH \
|
||||
hermes IAD210 ICU862_100MHz IP860 \
|
||||
IVML24 IVML24_128 IVML24_256 IVMS8 \
|
||||
IVMS8_128 IVMS8_256 KUP4K LANTEC \
|
||||
lwmon MBX MBX860T MHPC \
|
||||
MVS1 NETVIA NX823 pcu_e \
|
||||
R360MPI RPXClassic RPXlite RRvision \
|
||||
SM850 SPD823TS svm_sc8xx SXNI855T \
|
||||
TOP860 TQM823L TQM823L_LCD TQM850L \
|
||||
TQM855L TQM860L TQM860L_FEC TTTech \
|
||||
FPS850L GEN860T GEN860T_SC GENIETV \
|
||||
GTH hermes IAD210 ICU862_100MHz \
|
||||
IP860 IVML24 IVML24_128 IVML24_256 \
|
||||
IVMS8 IVMS8_128 IVMS8_256 KUP4K \
|
||||
LANTEC lwmon MBX MBX860T \
|
||||
MHPC MVS1 NETVIA NX823 \
|
||||
pcu_e R360MPI RPXClassic RPXlite \
|
||||
RRvision SM850 SPD823TS svm_sc8xx \
|
||||
SXNI855T TOP860 TQM823L TQM823L_LCD \
|
||||
TQM850L TQM855L TQM860L TTTech \
|
||||
v37 \
|
||||
"
|
||||
|
||||
@@ -63,14 +63,15 @@ LIST_824x=" \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MPC8260 Systems
|
||||
## MPC8260 Systems (includes 8250, 8255 etc.)
|
||||
#########################################################################
|
||||
|
||||
LIST_8260=" \
|
||||
cogent_mpc8260 CPU86 ep8260 gw8260 \
|
||||
hymod IPHASE4539 MPC8260ADS MPC8266ADS \
|
||||
PM826 ppmc8260 RPXsuper rsdproto \
|
||||
sacsng sbc8260 SCM TQM8260 \
|
||||
atc cogent_mpc8260 CPU86 ep8260 \
|
||||
gw8260 hymod IPHASE4539 MPC8260ADS \
|
||||
MPC8266ADS PM826 ppmc8260 RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
|
||||
38
Makefile
38
Makefile
@@ -212,8 +212,16 @@ FADS860T_config: unconfig
|
||||
FLAGADM_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx flagadm
|
||||
|
||||
xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))
|
||||
|
||||
GEN860T_SC_config \
|
||||
GEN860T_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx gen860t
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _SC,$@)" ] || \
|
||||
{ echo "#define CONFIG_SC" >>include/config.h ; \
|
||||
echo "With reduced H/W feature set (SC)..." ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
|
||||
|
||||
GENIETV_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx genietv
|
||||
@@ -337,7 +345,7 @@ TOP860_config: unconfig
|
||||
# All boards can come with 50 MHz (default), 66MHz or 80MHz clock,
|
||||
# but only 855 and 860 boards may come with FEC
|
||||
# and 823 boards may have LCD support
|
||||
xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _LCD,,$(subst _FEC,,$(subst _config,,$1)))))
|
||||
xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _LCD,,$(subst _config,,$1))))
|
||||
|
||||
FPS850L_config \
|
||||
FPS860L_config \
|
||||
@@ -353,20 +361,13 @@ TQM850L_80MHz_config \
|
||||
TQM855L_config \
|
||||
TQM855L_66MHz_config \
|
||||
TQM855L_80MHz_config \
|
||||
TQM855L_FEC_config \
|
||||
TQM855L_FEC_66MHz_config \
|
||||
TQM855L_FEC_80MHz_config \
|
||||
TQM860L_config \
|
||||
TQM860L_66MHz_config \
|
||||
TQM860L_80MHz_config \
|
||||
TQM860L_FEC_config \
|
||||
TQM860L_FEC_66MHz_config \
|
||||
TQM860L_FEC_80MHz_config: unconfig
|
||||
TQM862L_config \
|
||||
TQM862L_66MHz_config \
|
||||
TQM862L_80MHz_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _FEC,$@)" ] || \
|
||||
{ echo "#define CONFIG_FEC_ENET" >>include/config.h ; \
|
||||
echo "... with FEC support" ; \
|
||||
}
|
||||
@[ -z "$(findstring _66MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_66MHz" >>include/config.h ; \
|
||||
echo "... with 66MHz system clock" ; \
|
||||
@@ -582,10 +583,13 @@ sbc8260_config: unconfig
|
||||
SCM_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
|
||||
|
||||
TQM8255_config \
|
||||
TQM8260_config \
|
||||
TQM8260_L2_config \
|
||||
TQM8255_266MHz_config \
|
||||
TQM8260_266MHz_config \
|
||||
TQM8260_L2_266MHz_config \
|
||||
TQM8255_300MHz_config \
|
||||
TQM8260_300MHz_config: unconfig
|
||||
@ >include/config.h
|
||||
@if [ "$(findstring _L2_,$@)" ] ; then \
|
||||
@@ -603,7 +607,12 @@ TQM8260_300MHz_config: unconfig
|
||||
{ echo "#define CONFIG_300MHz" >>include/config.h ; \
|
||||
echo "... with 300MHz system clock" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_82xx,$@) ppc mpc8260 tqm8260
|
||||
@[ -z "$(findstring TQM8255_,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC8255" >>include/config.h ; }
|
||||
@./mkconfig -a TQM8260 ppc mpc8260 tqm8260
|
||||
|
||||
atc_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 atc
|
||||
|
||||
#########################################################################
|
||||
## 74xx/7xx Systems
|
||||
@@ -738,6 +747,7 @@ clean:
|
||||
rm -f tools/easylogo/easylogo tools/bmp_logo
|
||||
rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
|
||||
rm -f tools/env/fw_printenv tools/env/fw_setenv
|
||||
rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
|
||||
|
||||
clobber: clean
|
||||
find . -type f \
|
||||
@@ -746,7 +756,7 @@ clobber: clean
|
||||
| xargs rm -f
|
||||
rm -f $(OBJS) *.bak tags TAGS
|
||||
rm -fr *.*~
|
||||
rm -f u-boot u-boot.bin u-boot.elf u-boot.srec u-boot.map System.map
|
||||
rm -f u-boot u-boot.bin u-boot.srec u-boot.map System.map
|
||||
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/arch include/asm
|
||||
|
||||
52
README
52
README
@@ -180,7 +180,7 @@ Directory Hierarchy:
|
||||
Files specific to EVB64260 boards
|
||||
- board/fads Files specific to FADS boards
|
||||
- board/flagadm Files specific to FLAGADM boards
|
||||
- board/gen860t Files specific to GEN860T boards
|
||||
- board/gen860t Files specific to GEN860T and GEN860T_SC boards
|
||||
- board/genietv Files specific to GENIETV boards
|
||||
- board/gth Files specific to GTH boards
|
||||
- board/hermes Files specific to HERMES boards
|
||||
@@ -343,7 +343,8 @@ The following options need to be configured:
|
||||
CONFIG_GTH, CONFIG_RPXClassic, CONFIG_rsdproto,
|
||||
CONFIG_IAD210, CONFIG_RPXlite, CONFIG_sbc8260,
|
||||
CONFIG_EBONY, CONFIG_sacsng, CONFIG_FPS860L,
|
||||
CONFIG_V37, CONFIG_ELPT860, CONFIG_CMI
|
||||
CONFIG_V37, CONFIG_ELPT860, CONFIG_CMI,
|
||||
CONFIG_NETVIA
|
||||
|
||||
ARM based boards:
|
||||
-----------------
|
||||
@@ -638,6 +639,7 @@ The following options need to be configured:
|
||||
CONFIG_RTC_MC146818 - use MC146818 RTC
|
||||
CONFIG_RTC_DS1307 - use Maxim, Inc. DS1307 RTC
|
||||
CONFIG_RTC_DS1337 - use Maxim, Inc. DS1337 RTC
|
||||
CONFIG_RTC_DS1338 - use Maxim, Inc. DS1338 RTC
|
||||
CONFIG_RTC_DS164x - use Dallas DS164x RTC
|
||||
|
||||
- Timestamp Support:
|
||||
@@ -695,6 +697,18 @@ The following options need to be configured:
|
||||
CONFIG_NS8382X
|
||||
Support for National dp8382[01] gigabit chips.
|
||||
|
||||
- NETWORK Support (other):
|
||||
|
||||
CONFIG_DRIVER_LAN91C96
|
||||
Support for SMSC's LAN91C96 chips.
|
||||
|
||||
CONFIG_LAN91C96_BASE
|
||||
Define this to hold the physical address
|
||||
of the LAN91C96's I/O space
|
||||
|
||||
CONFIG_LAN91C96_USE_32_BIT
|
||||
Define this to enable 32 bit addressing
|
||||
|
||||
- USB Support:
|
||||
At the moment only the UHCI host controller is
|
||||
supported (PIP405, MIP405); define
|
||||
@@ -789,6 +803,18 @@ The following options need to be configured:
|
||||
Normally display is black on white background; define
|
||||
CFG_WHITE_ON_BLACK to get it inverted.
|
||||
|
||||
- Spash Screen Support: CONFIG_SPLASH_SCREEN
|
||||
|
||||
If this option is set, the environment is checked for
|
||||
a variable "splashimage". If found, the usual display
|
||||
of logo, copyright and system information on the LCD
|
||||
is supressed and the BMP image at the address
|
||||
specified in "splashimage" is loaded instead. The
|
||||
console is redirected to the "nulldev", too. This
|
||||
allows for a "silent" boot where a splash screen is
|
||||
loaded very quickly after power-on.
|
||||
|
||||
|
||||
- Ethernet address:
|
||||
CONFIG_ETHADDR
|
||||
CONFIG_ETH2ADDR
|
||||
@@ -1684,6 +1710,16 @@ Low Level (hardware related) configuration options:
|
||||
#define'd default value in commproc.h resp.
|
||||
cpm_8260.h.
|
||||
|
||||
- CFG_PCI_SLV_MEM_LOCAL, CFG_PCI_SLV_MEM_BUS, CFG_PICMR0_MASK_ATTRIB,
|
||||
CFG_PCI_MSTR0_LOCAL, CFG_PCIMSK0_MASK, CFG_PCI_MSTR1_LOCAL,
|
||||
CFG_PCIMSK1_MASK, CFG_PCI_MSTR_MEM_LOCAL, CFG_PCI_MSTR_MEM_BUS,
|
||||
CFG_CPU_PCI_MEM_START, CFG_PCI_MSTR_MEM_SIZE, CFG_POCMR0_MASK_ATTRIB,
|
||||
CFG_PCI_MSTR_MEMIO_LOCAL, CFG_PCI_MSTR_MEMIO_BUS, CPU_PCI_MEMIO_START,
|
||||
CFG_PCI_MSTR_MEMIO_SIZE, CFG_POCMR1_MASK_ATTRIB, CFG_PCI_MSTR_IO_LOCAL,
|
||||
CFG_PCI_MSTR_IO_BUS, CFG_CPU_PCI_IO_START, CFG_PCI_MSTR_IO_SIZE,
|
||||
CFG_POCMR2_MASK_ATTRIB: (MPC826x only)
|
||||
Overrides the default PCI memory map in cpu/mpc8260/pci.c if set.
|
||||
|
||||
Building the Software:
|
||||
======================
|
||||
|
||||
@@ -1726,7 +1762,7 @@ configurations; the following names are supported:
|
||||
FPS850L_config Sandpoint8240_config sbc8260_config
|
||||
GENIETV_config TQM823L_config PIP405_config
|
||||
GEN860T_config EBONY_config FPS860L_config
|
||||
ELPT860_config cmi_mpc5xx_config
|
||||
ELPT860_config cmi_mpc5xx_config NETVIA_config
|
||||
|
||||
Note: for some board special configuration names may exist; check if
|
||||
additional information is available from the board vendor; for
|
||||
@@ -1918,6 +1954,12 @@ Some configuration options can be set using Environment Variables:
|
||||
be automatically started (by internally calling
|
||||
"bootm")
|
||||
|
||||
If set to "no", a standalone image passed to the
|
||||
"bootm" command will be copied to the load address
|
||||
(and eventually uncompressed), but NOT be started.
|
||||
This can be used to load and uncompress arbitrary
|
||||
data.
|
||||
|
||||
initrd_high - restrict positioning of initrd images:
|
||||
If this variable is not set, initrd images will be
|
||||
copied to the highest possible address in RAM; this
|
||||
@@ -2036,8 +2078,8 @@ defines the following image properties:
|
||||
|
||||
* Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
|
||||
4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
|
||||
LynxOS, pSOS, QNX;
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX).
|
||||
LynxOS, pSOS, QNX, RTEMS, ARTOS;
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS).
|
||||
* Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
|
||||
IA64, MIPS, MIPS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
|
||||
Currently supported: PowerPC).
|
||||
|
||||
40
board/atc/Makefile
Normal file
40
board/atc/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2001
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
378
board/atc/atc.c
Normal file
378
board/atc/atc.c
Normal file
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <ioports.h>
|
||||
#include <mpc8260.h>
|
||||
#include <pci.h>
|
||||
|
||||
/*
|
||||
* I/O Port configuration table
|
||||
*
|
||||
* if conf is 1, then that port pin will be configured at boot time
|
||||
* according to the five values podr/pdir/ppar/psor/pdat for that entry
|
||||
*/
|
||||
|
||||
const iop_conf_t iop_conf_tab[4][32] = {
|
||||
|
||||
/* Port A configuration */
|
||||
{ /* conf ppar psor pdir podr pdat */
|
||||
/* PA31 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 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 */
|
||||
#if 1
|
||||
/* PA9 */ { 0, 1, 0, 1, 0, 0 }, /* SMC2 TXD */
|
||||
/* PA8 */ { 0, 1, 0, 0, 0, 0 }, /* SMC2 RXD */
|
||||
#else
|
||||
/* PA9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC2 TXD */
|
||||
/* PA8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC2 RXD */
|
||||
#endif
|
||||
/* 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 */
|
||||
#if 0
|
||||
/* PC15 */ { 0, 0, 0, 0, 0, 0 }, /* PC15 */
|
||||
#else
|
||||
/* PC15 */ { 1, 1, 0, 1, 0, 0 }, /* PC15 */
|
||||
#endif
|
||||
/* 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 */
|
||||
#if 0
|
||||
/* PD4 */ { 0, 0, 0, 0, 0, 0 }, /* PD4 */
|
||||
#else
|
||||
/* PD4 */ { 1, 1, 1, 0, 0, 0 }, /* PD4 */
|
||||
#endif
|
||||
/* 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: ATC\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx
|
||||
*
|
||||
* This routine performs standard 8260 initialization sequence
|
||||
* and calculates the available memory size. It may be called
|
||||
* several times to try different SDRAM configurations on both
|
||||
* 60x and local buses.
|
||||
*/
|
||||
static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
|
||||
ulong orx, volatile uchar * base)
|
||||
{
|
||||
volatile uchar c = 0xff;
|
||||
ulong cnt, val;
|
||||
volatile ulong *addr;
|
||||
volatile uint *sdmr_ptr;
|
||||
volatile uint *orx_ptr;
|
||||
int i;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
ulong maxsize;
|
||||
|
||||
/* We must be able to test a location outsize the maximum legal size
|
||||
* to find out THAT we are outside; but this address still has to be
|
||||
* mapped by the controller. That means, that the initial mapping has
|
||||
* to be (at least) twice as large as the maximum expected size.
|
||||
*/
|
||||
maxsize = (1 + (~orx | 0x7fff)) / 2;
|
||||
|
||||
/* 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;
|
||||
|
||||
/*
|
||||
* Check memory range for valid RAM. A simple memory test determines
|
||||
* the actually available RAM size between addresses `base' and
|
||||
* `base + maxsize'. Some (not all) hardware errors are detected:
|
||||
* - short between address lines
|
||||
* - short between data lines
|
||||
*/
|
||||
i = 0;
|
||||
for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
|
||||
addr = (volatile ulong *) base + cnt; /* pointer arith! */
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
addr = (volatile ulong *) base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = (volatile ulong *) base + cnt; /* pointer arith! */
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
if (val != ~cnt) {
|
||||
/* Write the actual size to ORx
|
||||
*/
|
||||
*orx_ptr = orx | ~(cnt * sizeof (long) - 1);
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
ulong size8, size9;
|
||||
#endif
|
||||
long psize;
|
||||
|
||||
psize = 8 * 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
|
||||
43
board/atc/config.mk
Normal file
43
board/atc/config.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# (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
|
||||
#
|
||||
|
||||
#
|
||||
# ATC boards
|
||||
#
|
||||
|
||||
# This should be equal to the CFG_FLASH_BASE define in config_atc.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
|
||||
|
||||
# RAM version
|
||||
#TEXT_BASE := 0x100000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)
|
||||
663
board/atc/flash.c
Normal file
663
board/atc/flash.c
Normal file
@@ -0,0 +1,663 @@
|
||||
/*
|
||||
* (C) Copyright 2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* NOTE - CONFIG_FLASH_16BIT means the CPU interface is 16-bit, it
|
||||
* has nothing to do with the flash chip being 8-bit or 16-bit.
|
||||
*/
|
||||
#ifdef CONFIG_FLASH_16BIT
|
||||
typedef unsigned short FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned short FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFFFF
|
||||
#else
|
||||
typedef unsigned long FLASH_PORT_WIDTH;
|
||||
typedef volatile unsigned long FLASH_PORT_WIDTHV;
|
||||
#define FLASH_ID_MASK 0xFFFFFFFF
|
||||
#endif
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define ORMASK(size) ((-size) & OR_AM_MSK)
|
||||
|
||||
#define FLASH_CYCLE1 0x0555
|
||||
#define FLASH_CYCLE2 0x02aa
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
static ulong flash_get_size(FPWV *addr, flash_info_t *info);
|
||||
static void flash_reset(flash_info_t *info);
|
||||
static int write_word_intel(flash_info_t *info, FPWV *dest, FPW data);
|
||||
static int write_word_amd(flash_info_t *info, FPWV *dest, FPW data);
|
||||
static void flash_get_offsets(ulong base, flash_info_t *info);
|
||||
static flash_info_t *flash_get_info(ulong base);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* flash_init()
|
||||
*
|
||||
* sets up flash_info and returns size of FLASH (bytes)
|
||||
*/
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
unsigned long size = 0;
|
||||
int i;
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i=0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
#if 0
|
||||
ulong flashbase = (i == 0) ? PHYS_FLASH_1 : PHYS_FLASH_2;
|
||||
#else
|
||||
ulong flashbase = CFG_FLASH_BASE;
|
||||
#endif
|
||||
|
||||
memset(&flash_info[i], 0, sizeof(flash_info_t));
|
||||
|
||||
flash_info[i].size =
|
||||
flash_get_size((FPW *)flashbase, &flash_info[i]);
|
||||
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## Unknown FLASH on Bank %d - Size = 0x%08lx\n",
|
||||
i, flash_info[i].size);
|
||||
}
|
||||
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
#if CFG_MONITOR_BASE >= CFG_FLASH_BASE
|
||||
/* monitor protection ON by default */
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_MONITOR_BASE,
|
||||
CFG_MONITOR_BASE+CFG_MONITOR_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)
|
||||
{
|
||||
FPWV *base = (FPWV *)(info->start[0]);
|
||||
|
||||
/* Put FLASH back in read mode */
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL)
|
||||
*base = (FPW)0x00FF00FF; /* Intel Read Mode */
|
||||
else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD)
|
||||
*base = (FPW)0x00F000F0; /* AMD Read Mode */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* set up sector start address table */
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL
|
||||
&& (info->flash_id & FLASH_BTYPE)) {
|
||||
int bootsect_size; /* number of bytes/boot sector */
|
||||
int sect_size; /* number of bytes/regular sector */
|
||||
|
||||
bootsect_size = 0x00002000 * (sizeof(FPW)/2);
|
||||
sect_size = 0x00010000 * (sizeof(FPW)/2);
|
||||
|
||||
/* set sector offsets for bottom boot block type */
|
||||
for (i = 0; i < 8; ++i) {
|
||||
info->start[i] = base + (i * bootsect_size);
|
||||
}
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = base + ((i - 7) * sect_size);
|
||||
}
|
||||
}
|
||||
else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD
|
||||
&& (info->flash_id & FLASH_TYPEMASK) == FLASH_AM640U) {
|
||||
|
||||
int sect_size; /* number of bytes/sector */
|
||||
|
||||
sect_size = 0x00010000 * (sizeof(FPW)/2);
|
||||
|
||||
/* set up sector start address table (uniform sector type) */
|
||||
for( i = 0; i < info->sector_count; i++ )
|
||||
info->start[i] = base + (i * sect_size);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static flash_info_t *flash_get_info(ulong base)
|
||||
{
|
||||
int i;
|
||||
flash_info_t * info;
|
||||
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i ++) {
|
||||
info = & flash_info[i];
|
||||
if (info->start[0] <= base && base < info->start[0] + info->size)
|
||||
break;
|
||||
}
|
||||
|
||||
return i == CFG_MAX_FLASH_BANKS ? 0 : info;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
int i;
|
||||
uchar *boottype;
|
||||
uchar *bootletter;
|
||||
uchar *fmt;
|
||||
uchar botbootletter[] = "B";
|
||||
uchar topbootletter[] = "T";
|
||||
uchar botboottype[] = "bottom boot sector";
|
||||
uchar topboottype[] = "top boot sector";
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD: printf ("AMD "); break;
|
||||
case FLASH_MAN_BM: printf ("BRIGHT MICRO "); break;
|
||||
case FLASH_MAN_FUJ: printf ("FUJITSU "); break;
|
||||
case FLASH_MAN_SST: printf ("SST "); break;
|
||||
case FLASH_MAN_STM: printf ("STM "); break;
|
||||
case FLASH_MAN_INTEL: printf ("INTEL "); break;
|
||||
default: printf ("Unknown Vendor "); break;
|
||||
}
|
||||
|
||||
/* check for top or bottom boot, if it applies */
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
boottype = botboottype;
|
||||
bootletter = botbootletter;
|
||||
}
|
||||
else {
|
||||
boottype = topboottype;
|
||||
bootletter = topbootletter;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM640U:
|
||||
fmt = "29LV641D (64 Mbit, uniform sectors)\n";
|
||||
break;
|
||||
case FLASH_28F800C3B:
|
||||
case FLASH_28F800C3T:
|
||||
fmt = "28F800C3%s (8 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_INTEL800B:
|
||||
case FLASH_INTEL800T:
|
||||
fmt = "28F800B3%s (8 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_28F160C3B:
|
||||
case FLASH_28F160C3T:
|
||||
fmt = "28F160C3%s (16 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_INTEL160B:
|
||||
case FLASH_INTEL160T:
|
||||
fmt = "28F160B3%s (16 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_28F320C3B:
|
||||
case FLASH_28F320C3T:
|
||||
fmt = "28F320C3%s (32 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_INTEL320B:
|
||||
case FLASH_INTEL320T:
|
||||
fmt = "28F320B3%s (32 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_28F640C3B:
|
||||
case FLASH_28F640C3T:
|
||||
fmt = "28F640C3%s (64 Mbit, %s)\n";
|
||||
break;
|
||||
case FLASH_INTEL640B:
|
||||
case FLASH_INTEL640T:
|
||||
fmt = "28F640B3%s (64 Mbit, %s)\n";
|
||||
break;
|
||||
default:
|
||||
fmt = "Unknown Chip Type\n";
|
||||
break;
|
||||
}
|
||||
|
||||
printf (fmt, bootletter, boottype);
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20,
|
||||
info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
|
||||
for (i=0; i<info->sector_count; ++i) {
|
||||
if ((i % 5) == 0) {
|
||||
printf ("\n ");
|
||||
}
|
||||
|
||||
printf (" %08lX%s", info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
|
||||
ulong flash_get_size (FPWV *addr, flash_info_t *info)
|
||||
{
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
|
||||
/* Write auto select command sequence and test FLASH answer */
|
||||
addr[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* for AMD, Intel ignores this */
|
||||
addr[FLASH_CYCLE2] = (FPW)0x00550055; /* for AMD, Intel ignores this */
|
||||
addr[FLASH_CYCLE1] = (FPW)0x00900090; /* selects Intel or AMD */
|
||||
|
||||
/* The manufacturer codes are only 1 byte, so just use 1 byte.
|
||||
* This works for any bus width and any FLASH device width.
|
||||
*/
|
||||
udelay(100);
|
||||
switch (addr[0] & 0xff) {
|
||||
|
||||
case (uchar)AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
|
||||
case (uchar)INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check 16 bits or 32 bits of ID so work on 32 or 16 bit bus. */
|
||||
if (info->flash_id != FLASH_UNKNOWN) switch (addr[1]) {
|
||||
|
||||
case (FPW)AMD_ID_LV640U: /* 29LV640 and 29LV641 have same ID */
|
||||
info->flash_id += FLASH_AM640U;
|
||||
info->sector_count = 128;
|
||||
info->size = 0x00800000 * (sizeof(FPW)/2);
|
||||
break; /* => 8 or 16 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F800C3B:
|
||||
info->flash_id += FLASH_28F800C3B;
|
||||
info->sector_count = 23;
|
||||
info->size = 0x00100000 * (sizeof(FPW)/2);
|
||||
break; /* => 1 or 2 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F800B3B:
|
||||
info->flash_id += FLASH_INTEL800B;
|
||||
info->sector_count = 23;
|
||||
info->size = 0x00100000 * (sizeof(FPW)/2);
|
||||
break; /* => 1 or 2 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F160C3B:
|
||||
info->flash_id += FLASH_28F160C3B;
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00200000 * (sizeof(FPW)/2);
|
||||
break; /* => 2 or 4 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F160B3B:
|
||||
info->flash_id += FLASH_INTEL160B;
|
||||
info->sector_count = 39;
|
||||
info->size = 0x00200000 * (sizeof(FPW)/2);
|
||||
break; /* => 2 or 4 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F320C3B:
|
||||
info->flash_id += FLASH_28F320C3B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000 * (sizeof(FPW)/2);
|
||||
break; /* => 4 or 8 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F320B3B:
|
||||
info->flash_id += FLASH_INTEL320B;
|
||||
info->sector_count = 71;
|
||||
info->size = 0x00400000 * (sizeof(FPW)/2);
|
||||
break; /* => 4 or 8 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F640C3B:
|
||||
info->flash_id += FLASH_28F640C3B;
|
||||
info->sector_count = 135;
|
||||
info->size = 0x00800000 * (sizeof(FPW)/2);
|
||||
break; /* => 8 or 16 MB */
|
||||
|
||||
case (FPW)INTEL_ID_28F640B3B:
|
||||
info->flash_id += FLASH_INTEL640B;
|
||||
info->sector_count = 135;
|
||||
info->size = 0x00800000 * (sizeof(FPW)/2);
|
||||
break; /* => 8 or 16 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
return (0); /* => no or unknown flash */
|
||||
}
|
||||
|
||||
flash_get_offsets((ulong)addr, info);
|
||||
|
||||
/* Put FLASH back in read mode */
|
||||
flash_reset(info);
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t *info, int s_first, int s_last)
|
||||
{
|
||||
FPWV *addr;
|
||||
int flag, prot, sect;
|
||||
int intel = (info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL;
|
||||
ulong start, now, last;
|
||||
int rcode = 0;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_INTEL800B:
|
||||
case FLASH_INTEL160B:
|
||||
case FLASH_INTEL320B:
|
||||
case FLASH_INTEL640B:
|
||||
case FLASH_28F800C3B:
|
||||
case FLASH_28F160C3B:
|
||||
case FLASH_28F320C3B:
|
||||
case FLASH_28F640C3B:
|
||||
case FLASH_AM640U:
|
||||
break;
|
||||
case FLASH_UNKNOWN:
|
||||
default:
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect=s_first; sect<=s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
last = get_timer(0);
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
|
||||
|
||||
if (info->protect[sect] != 0) /* protected, skip it */
|
||||
continue;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
addr = (FPWV *)(info->start[sect]);
|
||||
if (intel) {
|
||||
*addr = (FPW)0x00500050; /* clear status register */
|
||||
*addr = (FPW)0x00200020; /* erase setup */
|
||||
*addr = (FPW)0x00D000D0; /* erase confirm */
|
||||
}
|
||||
else {
|
||||
/* must be AMD style if not Intel */
|
||||
FPWV *base; /* first address in bank */
|
||||
|
||||
base = (FPWV *)(info->start[0]);
|
||||
base[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = (FPW)0x00550055; /* unlock */
|
||||
base[FLASH_CYCLE1] = (FPW)0x00800080; /* erase mode */
|
||||
base[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = (FPW)0x00550055; /* unlock */
|
||||
*addr = (FPW)0x00300030; /* erase sector */
|
||||
}
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
start = get_timer(0);
|
||||
|
||||
/* wait at least 50us for AMD, 80us for Intel.
|
||||
* Let's wait 1 ms.
|
||||
*/
|
||||
udelay (1000);
|
||||
|
||||
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
|
||||
if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
|
||||
if (intel) {
|
||||
/* suspend erase */
|
||||
*addr = (FPW)0x00B000B0;
|
||||
}
|
||||
|
||||
flash_reset(info); /* reset to read mode */
|
||||
rcode = 1; /* failed */
|
||||
break;
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((get_timer(last)) > CFG_HZ) {/* every second */
|
||||
putc ('.');
|
||||
last = get_timer(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* show that we're waiting */
|
||||
if ((get_timer(last)) > CFG_HZ) { /* every second */
|
||||
putc ('.');
|
||||
last = get_timer(0);
|
||||
}
|
||||
|
||||
flash_reset(info); /* reset to read mode */
|
||||
}
|
||||
|
||||
printf (" done\n");
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||
{
|
||||
FPW data = 0; /* 16 or 32 bit word, matches flash bus width on MPC8XX */
|
||||
int bytes; /* number of bytes to program in current word */
|
||||
int left; /* number of bytes left to program */
|
||||
int i, res;
|
||||
|
||||
for (left = cnt, res = 0;
|
||||
left > 0 && res == 0;
|
||||
addr += sizeof(data), left -= sizeof(data) - bytes) {
|
||||
|
||||
bytes = addr & (sizeof(data) - 1);
|
||||
addr &= ~(sizeof(data) - 1);
|
||||
|
||||
/* combine source and destination data so can program
|
||||
* an entire word of 16 or 32 bits
|
||||
*/
|
||||
for (i = 0; i < sizeof(data); i++) {
|
||||
data <<= 8;
|
||||
if (i < bytes || i - bytes >= left )
|
||||
data += *((uchar *)addr + i);
|
||||
else
|
||||
data += *src++;
|
||||
}
|
||||
|
||||
/* write one word to the flash */
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD:
|
||||
res = write_word_amd(info, (FPWV *)addr, data);
|
||||
break;
|
||||
case FLASH_MAN_INTEL:
|
||||
res = write_word_intel(info, (FPWV *)addr, data);
|
||||
break;
|
||||
default:
|
||||
/* unknown flash type, error! */
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
res = 1; /* not really a timeout, but gives error */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash for AMD FLASH
|
||||
* A word is 16 or 32 bits, whichever the bus width of the flash bank
|
||||
* (not an individual chip) is.
|
||||
*
|
||||
* returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
|
||||
{
|
||||
ulong start;
|
||||
int flag;
|
||||
int res = 0; /* result, assume success */
|
||||
FPWV *base; /* first address in flash bank */
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*dest & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
|
||||
base = (FPWV *)(info->start[0]);
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
base[FLASH_CYCLE1] = (FPW)0x00AA00AA; /* unlock */
|
||||
base[FLASH_CYCLE2] = (FPW)0x00550055; /* unlock */
|
||||
base[FLASH_CYCLE1] = (FPW)0x00A000A0; /* selects program mode */
|
||||
|
||||
*dest = data; /* start programming the data */
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
start = get_timer (0);
|
||||
|
||||
/* data polling for D7 */
|
||||
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*dest = (FPW)0x00F000F0; /* reset bank */
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word to Flash for Intel 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_intel (flash_info_t *info, FPWV *dest, FPW data)
|
||||
{
|
||||
ulong start;
|
||||
int flag;
|
||||
int res = 0; /* result, assume success */
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*dest & data) != data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts();
|
||||
|
||||
*dest = (FPW)0x00500050; /* clear status register */
|
||||
*dest = (FPW)0x00FF00FF; /* make sure in read mode */
|
||||
*dest = (FPW)0x00400040; /* program setup */
|
||||
|
||||
*dest = data; /* start programming the data */
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts();
|
||||
|
||||
start = get_timer (0);
|
||||
|
||||
while (res == 0 && (*dest & (FPW)0x00800080) != (FPW)0x00800080) {
|
||||
if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
|
||||
*dest = (FPW)0x00B000B0; /* Suspend program */
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (res == 0 && (*dest & (FPW)0x00100010))
|
||||
res = 1; /* write failed, time out error is close enough */
|
||||
|
||||
*dest = (FPW)0x00500050; /* clear status register */
|
||||
*dest = (FPW)0x00FF00FF; /* make sure in read mode */
|
||||
|
||||
return (res);
|
||||
}
|
||||
118
board/atc/u-boot.lds
Normal file
118
board/atc/u-boot.lds
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc8260/start.o (.text)
|
||||
*(.text)
|
||||
common/environment.o(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
. = ALIGN(16);
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__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 = .);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
#include <command.h>
|
||||
#include <cmd_nvedit.h>
|
||||
#include <cmd_bootm.h>
|
||||
#include <cmd_boot.h>
|
||||
#include <rtc.h>
|
||||
#include <post.h>
|
||||
#include <net.h>
|
||||
#include <malloc.h>
|
||||
|
||||
@@ -53,17 +55,19 @@
|
||||
* space.
|
||||
* on the server this looks like:
|
||||
*
|
||||
* option space U-Boot;
|
||||
* option U-Boot.initrd code 3 = string;
|
||||
* option U-Boot.bootcmd code 4 = string;
|
||||
* option U-Boot.bootflags code 5 = string;
|
||||
* option U-Boot.rootdev code 6 = string;
|
||||
* option space CRAYL1;
|
||||
* option CRAYL1.initrd code 3 = string;
|
||||
* ..etc...
|
||||
*/
|
||||
#define DHCP_VENDOR_SPECX 43
|
||||
#define DHCP_VX_INITRD 3
|
||||
#define DHCP_VX_BOOTCMD 4
|
||||
#define DHCP_VX_BOOTFLAGS 5
|
||||
#define DHCP_VX_BOOTARGS 5
|
||||
#define DHCP_VX_ROOTDEV 6
|
||||
#define DHCP_VX_FROMFLASH 7
|
||||
#define DHCP_VX_BOOTSCRIPT 8
|
||||
#define DHCP_VX_RCFILE 9
|
||||
#define DHCP_VX_MAGIC 10
|
||||
|
||||
/* Things DHCP server can tellme about. If there's no flash address, then
|
||||
* they dont participate in 'update' to flash, and we force their values
|
||||
@@ -89,18 +93,29 @@ static dhcp_item_t Things[] = {
|
||||
/* and the other way.. */
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_INITRD, NULL, "initrd"},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_BOOTCMD, NULL, "bootcmd"},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_BOOTFLAGS, NULL, NULL},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_FROMFLASH, NULL, "fromflash"},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_BOOTSCRIPT, NULL, "bootscript"},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_RCFILE, NULL, "rcfile"},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_BOOTARGS, NULL, "xbootargs"},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_ROOTDEV, NULL, NULL},
|
||||
{DHCP_VENDOR_SPECX, DHCP_VX_MAGIC, NULL, NULL}
|
||||
};
|
||||
|
||||
#define N_THINGS ((sizeof(Things))/(sizeof(dhcp_item_t)))
|
||||
|
||||
static void init_ecc_sdram (void);
|
||||
extern char bootscript[];
|
||||
|
||||
/* Here is the boot logic as HUSH script. Overridden by any TFP provided
|
||||
* bootscript file.
|
||||
*/
|
||||
|
||||
static void init_sdram (void);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
int board_pre_init (void)
|
||||
{
|
||||
init_ecc_sdram ();
|
||||
/* Running from ROM: global data is still READONLY */
|
||||
init_sdram ();
|
||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr (uicer, 0x00000000); /* disable all ints */
|
||||
mtdcr (uiccr, 0x00000020); /* set all but FPGA SMI to be non-critical */
|
||||
@@ -116,6 +131,7 @@ int checkboard (void)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
int misc_init_r (void)
|
||||
@@ -124,6 +140,7 @@ int misc_init_r (void)
|
||||
image_header_t *hdr;
|
||||
time_t timestamp;
|
||||
struct rtc_time tm;
|
||||
char bootcmd[32];
|
||||
|
||||
hdr = (image_header_t *) (CFG_MONITOR_BASE - sizeof (image_header_t));
|
||||
timestamp = (time_t) hdr->ih_time;
|
||||
@@ -143,6 +160,8 @@ int misc_init_r (void)
|
||||
setenv ("ethaddr", e);
|
||||
}
|
||||
}
|
||||
sprintf (bootcmd,"autoscript %X",(unsigned)bootscript);
|
||||
setenv ("bootcmd", bootcmd);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -168,11 +187,11 @@ void rtc_reset (void)
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Do sdram bank init in C so I can read it..
|
||||
/* Do sdram bank init in C so I can read it..no console to print to yet!
|
||||
*/
|
||||
static void init_ecc_sdram (void)
|
||||
static void init_sdram (void)
|
||||
{
|
||||
unsigned long tmp, *p;
|
||||
unsigned long tmp;
|
||||
|
||||
/* write SDRAM bank 0 register */
|
||||
mtdcr (memcfga, mem_mb0cf);
|
||||
@@ -202,33 +221,78 @@ static void init_ecc_sdram (void)
|
||||
mtdcr (memcfgd, 0x90800000);
|
||||
udelay (200);
|
||||
|
||||
/* disable ECC on all banks */
|
||||
/* initially, disable ECC on all banks */
|
||||
udelay (200);
|
||||
mtdcr (memcfga, mem_ecccf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
tmp &= 0xff0fffff;
|
||||
mtdcr (memcfga, mem_ecccf);
|
||||
mtdcr (memcfgd, tmp);
|
||||
|
||||
/* set up SDRAM Controller with ECC enabled */
|
||||
return;
|
||||
}
|
||||
|
||||
extern int memory_post_test (int flags);
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
unsigned long tmp;
|
||||
uint *pstart = (uint *) 0x00000000;
|
||||
uint *pend = (uint *) L1_MEMSIZE;
|
||||
uint *p;
|
||||
|
||||
if (getenv_r("booted",NULL,0) <= 0)
|
||||
{
|
||||
printf ("testdram..");
|
||||
/*AA*/
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0xaaaaaaaa;
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0xaaaaaaaa) {
|
||||
printf ("SDRAM test fails at: %08x, was %08x expected %08x\n",
|
||||
(uint) p, *p, 0xaaaaaaaa);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/*55*/
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = 0x55555555;
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != 0x55555555) {
|
||||
printf ("SDRAM test fails at: %08x, was %08x expected %08x\n",
|
||||
(uint) p, *p, 0x55555555);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/*addr*/
|
||||
for (p = pstart; p < pend; p++)
|
||||
*p = (unsigned)p;
|
||||
for (p = pstart; p < pend; p++) {
|
||||
if (*p != (unsigned)p) {
|
||||
printf ("SDRAM test fails at: %08x, was %08x expected %08x\n",
|
||||
(uint) p, *p, (uint)p);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
printf ("Success. ");
|
||||
}
|
||||
printf ("Enable ECC..");
|
||||
|
||||
mtdcr (memcfga, mem_mcopt1);
|
||||
tmp = (mfdcr (memcfgd) & ~0xFFE00000) | 0x90800000;
|
||||
mtdcr (memcfga, mem_mcopt1);
|
||||
mtdcr (memcfgd, tmp);
|
||||
udelay (600);
|
||||
|
||||
/* fill all the memory */
|
||||
for (p = (unsigned long) 0; ((unsigned long) p < L1_MEMSIZE);
|
||||
*p++ = 0L);
|
||||
for (p = (unsigned long) 0; ((unsigned long) p < L1_MEMSIZE); *p++ = 0L)
|
||||
;
|
||||
udelay (400);
|
||||
mtdcr (memcfga, mem_ecccf);
|
||||
tmp = mfdcr (memcfgd);
|
||||
|
||||
/* enable ECC on bank 0 */
|
||||
tmp |= 0x00800000;
|
||||
mtdcr (memcfgd, tmp);
|
||||
udelay (400);
|
||||
|
||||
return;
|
||||
printf ("enabled.\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -250,7 +314,9 @@ static u8 *dhcp_env_update (u8 thing, u8 * pop)
|
||||
|
||||
/* set env. */
|
||||
if (Things[thing].envname)
|
||||
{
|
||||
setenv (Things[thing].envname, Things[thing].dhcpvalue);
|
||||
}
|
||||
return (Things[thing].dhcpvalue);
|
||||
}
|
||||
|
||||
@@ -285,9 +351,9 @@ u8 *dhcp_vendorex_proc (u8 * pop)
|
||||
oplen -= sub_oplen, sub_op += (sub_oplen + 2)) {
|
||||
for (thing = 0; thing < N_THINGS; thing++) {
|
||||
if (*sub_op == Things[thing].dhcp_vendor_option) {
|
||||
if (!(retval = dhcp_env_update (thing, sub_op))) {
|
||||
return NULL;
|
||||
}
|
||||
if (!(retval = dhcp_env_update (thing, sub_op))) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,5 +364,5 @@ u8 *dhcp_vendorex_proc (u8 * pop)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return (thing >= N_THINGS ? NULL : pop);
|
||||
return (pop);
|
||||
}
|
||||
|
||||
@@ -26,17 +26,27 @@ include $(TOPDIR)/config.mk
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
SOBJS = init.o
|
||||
SOBJS = init.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
# HACK: depend needs bootscript.c, which needs tools/mkimage, which is not
|
||||
# built in the depend stage. So... put bootscript.o here, not in OBJS
|
||||
$(LIB): $(OBJS) $(SOBJS) bootscript.o
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
rm -f $(SOBJS) $(OBJS) bootscript.c bootscript.image bootscript.o
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
$(BOARD).o : $(BOARD).c bootscript.o
|
||||
|
||||
bootscript.c: bootscript.image
|
||||
od -t x1 -v -A x $^ | awk -f x2c.awk > $@
|
||||
|
||||
bootscript.image: bootscript.hush Makefile
|
||||
-$(TOPDIR)/tools/mkimage -A ppc -O linux -T script -C none -a 0 -e 0 -n bootscript -d bootscript.hush $@
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
|
||||
117
board/cray/L1/bootscript.hush
Normal file
117
board/cray/L1/bootscript.hush
Normal file
@@ -0,0 +1,117 @@
|
||||
# $Header$
|
||||
# hush bootscript for PPCBOOT on L1
|
||||
# note: all #s are in hex, do _NOT_ prefix it with 0x
|
||||
|
||||
flash_rfs=ffc00000
|
||||
flash_krl=fff00000
|
||||
tftp_addr=100000
|
||||
tftp2_addr=1000000
|
||||
|
||||
if printenv booted
|
||||
then
|
||||
echo already booted before
|
||||
else
|
||||
echo first boot in environment, create and save settings
|
||||
setenv booted OK
|
||||
saveenv
|
||||
fi
|
||||
|
||||
setenv autoload no
|
||||
# clear out stale env stuff, so we get fresh from dhcp.
|
||||
for setting in initrd fromflash kernel rootfs rootpath
|
||||
do
|
||||
setenv $setting
|
||||
done
|
||||
|
||||
dhcp
|
||||
|
||||
# if host provides us with a different bootscript, us it.
|
||||
if printenv bootscript
|
||||
then
|
||||
tftp $tftp_addr $bootcript
|
||||
if imi $tftp_addr
|
||||
then
|
||||
autoscript $tftp_addr
|
||||
fi
|
||||
fi
|
||||
|
||||
# default base kernel arguments.
|
||||
setenv bootargs $xbootargs devfs=mount ip=$ipaddr:$serverip:$gatewayip:$netmask:L1:eth0:off wdt=120
|
||||
|
||||
# Have a kernel in flash?
|
||||
if imi $flash_krl
|
||||
then
|
||||
echo ok kernel to boot from $flash_krl
|
||||
setenv kernel $flash_krl
|
||||
else
|
||||
echo no kernel to boot from $flash_krl, need tftp
|
||||
fi
|
||||
|
||||
# Have a rootfs in flash?
|
||||
echo test for SQUASHfs at $flash_rfs
|
||||
|
||||
if imi $flash_rfs
|
||||
then
|
||||
echo appears to be a good initrd image at base of flash OK
|
||||
setenv rootfs $flash_rfs
|
||||
else
|
||||
echo no image at base of flash, need nfsroot or initrd
|
||||
fi
|
||||
|
||||
# I boot from flash if told to and I can.
|
||||
if printenv fromflash && printenv kernel && printenv rootfs
|
||||
then
|
||||
echo booting entirely from flash
|
||||
setenv bootargs root=/dev/ram0 rw $bootargs
|
||||
bootm $kernel $rootfs
|
||||
echo oh no failed so I try some other stuff
|
||||
fi
|
||||
|
||||
# TFTP down a kernel
|
||||
if printenv bootfile
|
||||
then
|
||||
tftp $tftp_addr $bootfile
|
||||
setenv kernel $tftp_addr
|
||||
echo I will boot the TFTP kernel
|
||||
else
|
||||
if printenv kernel
|
||||
then
|
||||
echo no bootfile specified, will use one from flash
|
||||
else
|
||||
setenv bootfile /opt/crayx1/craymcu/l1/flash/linux.image
|
||||
echo OH NO! we have no bootfile,nor flash kernel! try default: $bootfile
|
||||
tftp $tftp_addr $bootfile
|
||||
setenv kernel $tftp_addr
|
||||
fi
|
||||
fi
|
||||
|
||||
# the rootfs.
|
||||
if printenv rootpath
|
||||
then
|
||||
echo rootpath is $rootpath
|
||||
if printenv initrd
|
||||
then
|
||||
echo initrd is also specified, so use $initrd
|
||||
tftp $tftp2_addr $initrd
|
||||
setenv bootargs root=/dev/ram0 rw cwsroot=$serverip:$rootpath $bootargs
|
||||
bootm $kernel $tftp2_addr
|
||||
else
|
||||
echo initrd is not specified, so use NFSROOT $rootpat
|
||||
setenv bootargs root=/dev/nfs ro nfsroot=$serverip:$rootpath $bootargs
|
||||
bootm $kernel
|
||||
fi
|
||||
else
|
||||
echo we have no rootpath check for one in flash
|
||||
if printenv rootfs
|
||||
then
|
||||
echo I will use the one in flash
|
||||
setenv bootargs root=/dev/mtdblock/0 ro rootfstype=squashfs $bootargs
|
||||
bootm $kernel
|
||||
else
|
||||
setenv rootpath /export/crayl1
|
||||
echo OH NO! we have no rootpath,nor flash kernel! try default: $rootpath
|
||||
setenv bootargs root=/dev/mtdblock/0 ro rootfstype=squashfs $bootargs
|
||||
bootm $kernel
|
||||
fi
|
||||
fi
|
||||
reset
|
||||
30
board/cray/L1/patchme
Normal file
30
board/cray/L1/patchme
Normal file
@@ -0,0 +1,30 @@
|
||||
# master confi.mk
|
||||
echo "CROSS_COMPILE = powerpc-linux-" >>include/config.mk
|
||||
|
||||
# patch the examples/Makefile to ignore return value from OBJCOPY
|
||||
sed -e 's/$(OBJCOPY)/-&/' < examples/Makefile > examples/makefile
|
||||
|
||||
# add a built target for mkimage on the target architecture
|
||||
sed -e 's/^all:.*$/all: .depend envcrc mkimage mkimage.ppc/' < tools/Makefile > tools/makefile
|
||||
|
||||
cat <<EOF >>tools/makefile
|
||||
mkimage.ppc : mkimage.o.ppc crc32.o.ppc
|
||||
powerpc-linux-gcc -msoft-float -Wall -Wstrict-prototypes -o \$@ \$^
|
||||
powerpc-linux-strip $@
|
||||
|
||||
XFLAGS="-D__KERNEL__ -I../include -DCONFIG_4xx -Wall -Wstict-prototypes"
|
||||
mkimage.o.ppc: mkimage.c
|
||||
powerpc-linux-gcc -msoft-float -Wall -I../include -c -o \$@ \$^
|
||||
|
||||
crc32.o.ppc: crc32.c
|
||||
powerpc-linux-gcc -msoft-float -Wall -I../include -c -o \$@ \$^
|
||||
|
||||
EOF
|
||||
|
||||
# make an image by default out of the u-boot image
|
||||
sed -e 's/^all:.*$/all: u-boot.image /' < Makefile > makefile
|
||||
cat <<EOF >>makefile
|
||||
u-boot.image: u-boot.bin
|
||||
tools/mkimage -A ppc -O linux -T firmware -C none -a 0 -e 0 -n U-Boot -d \$^ \$@
|
||||
|
||||
EOF
|
||||
6
board/cray/L1/x2c.awk
Normal file
6
board/cray/L1/x2c.awk
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/awk
|
||||
BEGIN { print "unsigned char bootscript[] = { \n"}
|
||||
{ for (i = 2; i <= NF ; i++ ) printf "0x"$i","
|
||||
print ""
|
||||
}
|
||||
END { print "\n};\n" }
|
||||
@@ -208,6 +208,7 @@ int checkboard (void)
|
||||
case 0x22 :
|
||||
case 0x23 :
|
||||
case 0x24 :
|
||||
case 0x2a :
|
||||
case 0x3f :
|
||||
puts ("FADS");
|
||||
break;
|
||||
|
||||
@@ -147,7 +147,7 @@ static void flash_get_offsets (ulong base, flash_info_t *info)
|
||||
int i;
|
||||
|
||||
/* set up sector start address table */
|
||||
if ((info->flash_id & FLASH_TYPEMASK) == FLASH_AM040) {
|
||||
if ((info->flash_id & FLASH_TYPEMASK) == FLASH_AM040 || (info->flash_id & FLASH_TYPEMASK) == FLASH_AM080 ) {
|
||||
/* set sector offsets for uniform sector type */
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00040000);
|
||||
@@ -179,6 +179,8 @@ void flash_print_info (flash_info_t *info)
|
||||
{
|
||||
case FLASH_AM040: printf ("29F040 or 29LV040 (4 Mbit, uniform sectors)\n");
|
||||
break;
|
||||
case FLASH_AM080: printf ("29F080 or 29LV080 (8 Mbit, uniform sectors)\n");
|
||||
break;
|
||||
case FLASH_AM400B: printf ("AM29LV400B (4 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM400T: printf ("AM29LV400T (4 Mbit, top boot sector)\n");
|
||||
@@ -278,6 +280,12 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
|
||||
info->size = 0x00200000;
|
||||
break; /* => 2 MB */
|
||||
|
||||
case AMD_ID_F080B:
|
||||
info->flash_id += FLASH_AM080;
|
||||
info->sector_count =16;
|
||||
info->size = 0x00400000;
|
||||
break; /* => 4 MB */
|
||||
|
||||
case AMD_ID_LV400T:
|
||||
info->flash_id += FLASH_AM400T;
|
||||
info->sector_count = 11;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
This directory contains board specific code for a generic MPC860T based
|
||||
embedded computer, called 'GEN860T'. The design is generic in the sense that
|
||||
common, readily available components are used and that the architecture of the
|
||||
system is i(relatively) straightforward:
|
||||
system is relatively straightforward:
|
||||
|
||||
One eight bit wide boot (FLASH) memory
|
||||
32 bit main memory using SDRAM
|
||||
@@ -23,14 +22,14 @@ hearing from you, especially if you discover bugs or find ways to improve the
|
||||
quality of this U-Boot port.
|
||||
|
||||
Here are the salient features of the system:
|
||||
Clock : 33 Mhz oscillator
|
||||
Processor core frequency : 66 Mhz if in 1:2:1 mode; can also run 1:1
|
||||
Bus frequency : 33 Mhz
|
||||
Clock : 33.3 Mhz oscillator
|
||||
Processor core frequency : 66.6 Mhz if in 1:2:1 mode; can also run 1:1
|
||||
Bus frequency : 33.3 Mhz
|
||||
|
||||
Main memory:
|
||||
Type : SDRAM
|
||||
Width : 32 bits
|
||||
Size : 64 megabytes
|
||||
Size : 64 mibibytes
|
||||
Chip : Two Micron MT48LC16M16A2TG-7E
|
||||
CS : MPC860T CS1*/UPMA
|
||||
UPMA CONNECTIONS:
|
||||
@@ -42,7 +41,7 @@ Main memory:
|
||||
Boot memory:
|
||||
Type : FLASH
|
||||
Width : 8 bits
|
||||
Size : 16 megabytes
|
||||
Size : 16 mibibytes
|
||||
Chip : One Intel 28F128J3A (StrataFlash)
|
||||
CS : MPC860T CS0*/GPCM (this is the "boot" chip select)
|
||||
|
||||
@@ -56,7 +55,7 @@ EEPROM memory:
|
||||
Filesystem memory:
|
||||
Type : NAND FLASH (Toshiba)
|
||||
Width : 8 bits (i.e. interface to DOC is 8 bits)
|
||||
Size : 32 megabytes
|
||||
Size : 32 mibibytes
|
||||
Chip : One DiskOnCHip Millenium Plus (DOC 2000+)
|
||||
CS : MPC860T CS2*/GPCM
|
||||
|
||||
@@ -92,6 +91,12 @@ Miscellaneous:
|
||||
Mil-Std 1553 databus interface on CS5*/GPCM.
|
||||
Audio sounder (beeper) with digital volume control connected to SPKROUT.
|
||||
|
||||
SC variant:
|
||||
A reduced-feature version of the GEN860T port is also supported: GEN860T_SC.
|
||||
The 'SC' variant only provides support for the Virtex FPGA, SDRAM main
|
||||
memory, EEPROM and flash memory. The system clock frequency is reduced
|
||||
to 24 MHz.
|
||||
|
||||
Issues:
|
||||
The DOC 2000+ returns 0x40 as its device ID when probed using the method
|
||||
desxribed in the DOC datasheet. Unfortunately, the U-Boot DOC driver
|
||||
@@ -105,11 +110,11 @@ Status:
|
||||
in MTD for this device. I wish I had known this sooner :(
|
||||
|
||||
The GEN860T board specific files and configuration is based on the work
|
||||
of others who have contributed to U-Boot. The copright and license notices
|
||||
of others who have contributed to U-Boot. The copyright and license notices
|
||||
of these authors have been retained wherever their code has been reused.
|
||||
All new code to support the GEN860T board is:
|
||||
|
||||
(C) Copyright 2001-2002
|
||||
(C) Copyright 2001-2003
|
||||
Keith Outwater (keith_outwater@mvis.com)
|
||||
|
||||
and the following license applies:
|
||||
|
||||
@@ -271,18 +271,12 @@ misc_init_r (void)
|
||||
int
|
||||
last_stage_init(void)
|
||||
{
|
||||
#if !defined(CONFIG_SC)
|
||||
unsigned char buf[256];
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Set LEDs here since status LED init code has already run
|
||||
*/
|
||||
status_led_set(STATUS_LED_BIT1, STATUS_LED_ON);
|
||||
status_led_set(STATUS_LED_BIT3, STATUS_LED_ON);
|
||||
|
||||
/*
|
||||
* Turn the beeper volume all the way down in case this is a warm
|
||||
* boot.
|
||||
* Turn the beeper volume all the way down in case this is a warm boot.
|
||||
*/
|
||||
set_beeper_volume(-64);
|
||||
init_beeper();
|
||||
@@ -294,6 +288,18 @@ last_stage_init(void)
|
||||
if (i > 0) {
|
||||
do_beeper(buf);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Stub to make POST code happy. Can't self-poweroff, so just hang.
|
||||
*/
|
||||
void
|
||||
board_poweroff(void)
|
||||
{
|
||||
puts("### Please power off the board ###\n");
|
||||
while (1);
|
||||
}
|
||||
|
||||
/* vim: set ts=4 sw=4 tw=78 : */
|
||||
|
||||
@@ -42,8 +42,9 @@
|
||||
const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = {
|
||||
/*
|
||||
* Port A configuration
|
||||
* Pin Signal Type Active Initial state
|
||||
* PA7 fpgaProgramLowOut Out Low High
|
||||
* Pin Signal Type Active Initial state
|
||||
* PA7 fpgaProgramLowOut Out Low High
|
||||
* PA1 fpgaCoreVoltageFailLow In Low N/A
|
||||
*/
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* No pin */
|
||||
@@ -62,22 +63,32 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = {
|
||||
/* PA4 */ { 1, 0, 0, 1, 0, 0, 0 }, /* red bicolor LED 0*/
|
||||
/* PA3 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PA2 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PA1 */ { 1, 0, 0, 0, 0, 0, 0 }, /* fpgaCoreVoltageFail*/
|
||||
#else
|
||||
/* PA1 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#endif
|
||||
/* PA0 */ { 0, 0, 0, 0, 0, 0, 0 } /* */
|
||||
},
|
||||
|
||||
/*
|
||||
* Port B configuration
|
||||
* Pin Signal Type Active Initial state
|
||||
* PB14 docBusyLowIn In Low X
|
||||
* PB15 gpio1Sig Out High Low
|
||||
* PB16 fpgaDoneBi In High X
|
||||
* PB17 swBitOkLowOut Out Low Low
|
||||
* PB17 swBitOkLowOut Out Low High
|
||||
* PB19 speakerVolSig Out/Hi-Z High/Low High (Hi-Z)
|
||||
* PB22 fpgaInitLowBi In Low X
|
||||
* PB23 batteryOkSig In High X
|
||||
*/
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
/* PB31 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
* PB31 pulseCatcherClr Out High 0
|
||||
*/
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PB31 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#else
|
||||
/* PB31 */ { 1, 0, 0, 1, 0, 0, 0 }, /* pulseCatcherClr */
|
||||
#endif
|
||||
/* PB30 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PB29 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PB28 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
@@ -85,19 +96,32 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = {
|
||||
/* PB26 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PB25 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PB24 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PB23 */ { 1, 0, 0, 0, 0, 0, 0 }, /* batteryOk */
|
||||
#else
|
||||
/* PB23 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#endif
|
||||
/* PB22 */ { 1, 0, 0, 0, 0, 0, 0 }, /* fpgaInitLowBi */
|
||||
/* PB21 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PB20 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PB19 */ { 1, 0, 0, 1, 1, 1, 0 }, /* speakerVol */
|
||||
#else
|
||||
/* PB19 */ { 0, 0, 0, 1, 1, 1, 0 }, /* */
|
||||
#endif
|
||||
/* PB18 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PB17 */ { 1, 0, 0, 1, 0, 0, 0 }, /* swBitOkLow */
|
||||
/* PB17 */ { 1, 0, 0, 1, 0, 1, 0 }, /* swBitOkLow */
|
||||
/* PB16 */ { 1, 0, 0, 0, 0, 0, 0 }, /* fpgaDone */
|
||||
/* PB15 */ { 1, 0, 0, 1, 0, 0, 0 }, /* gpio1 */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PB14 */ { 1, 0, 0, 0, 0, 0, 0 } /* docBusyLow */
|
||||
},
|
||||
#else
|
||||
/* PB14 */ { 0, 0, 0, 0, 0, 0, 0 } /* */
|
||||
#endif
|
||||
},
|
||||
|
||||
/*
|
||||
* Port C configuration
|
||||
* Pin Signal Type Active Initial state
|
||||
* PC4 i2cBus1EnSig Out High High
|
||||
* PC5 i2cBus2EnSig Out High High
|
||||
@@ -108,29 +132,48 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = {
|
||||
* PC12 systemBitOkIn In High X
|
||||
* PC15 selfDreqLow In Low X
|
||||
*/
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PC15 */ { 1, 0, 0, 0, 0, 0, 0 }, /* selfDreqLowIn */
|
||||
/* PC14 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PC13 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PC12 */ { 1, 0, 0, 0, 0, 0, 0 }, /* systemBitOkIn */
|
||||
#else
|
||||
/* PC12 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#endif
|
||||
/* PC11 */ { 1, 0, 0, 1, 0, 1, 0 }, /* fpgaResetLowOut */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PC10 */ { 1, 0, 0, 1, 0, 1, 0 }, /* i2cBus4EnSig */
|
||||
#else
|
||||
/* PC10 */ { 0, 0, 0, 1, 0, 1, 0 }, /* */
|
||||
#endif
|
||||
/* PC9 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PC8 */ { 1, 0, 0, 1, 0, 1, 0 }, /* i2cBus3EnSig */
|
||||
#else
|
||||
/* PC8 */ { 0, 0, 0, 1, 0, 1, 0 }, /* */
|
||||
#endif
|
||||
/* PC7 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PC6 */ { 1, 0, 0, 1, 0, 1, 0 }, /* gpio0 */
|
||||
#if !defined(CONFIG_SC)
|
||||
/* PC5 */ { 1, 0, 0, 1, 0, 1, 0 }, /* i2cBus2EnSig */
|
||||
/* PC4 */ { 1, 0, 0, 1, 0, 1, 0 }, /* i2cBus1EnSig */
|
||||
#else
|
||||
/* PC5 */ { 0, 0, 0, 1, 0, 1, 0 }, /* */
|
||||
/* PC4 */ { 0, 0, 0, 1, 0, 1, 0 }, /* */
|
||||
#endif
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 } /* */
|
||||
},
|
||||
},
|
||||
|
||||
/* Port D configuration */
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
/*
|
||||
* Port D configuration
|
||||
*/
|
||||
{ /* conf ppar psor pdir podr pdat pint function */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* PD15 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
@@ -149,7 +192,7 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = {
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */
|
||||
/* N/A */ { 0, 0, 0, 0, 0, 0, 0 } /* */
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
132
board/gen860t/u-boot-flashenv.lds
Normal file
132
board/gen860t/u-boot-flashenv.lds
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Linker command file for the GEN860T board when the environment is
|
||||
* stored in flash memory.
|
||||
*
|
||||
* (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);
|
||||
SECTIONS
|
||||
{
|
||||
/*
|
||||
* Read-only sections, merged into text segment:
|
||||
*/
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/*
|
||||
* Read-write section, merged into data segment:
|
||||
*/
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||
|
||||
.data:
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__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 = .);
|
||||
|
||||
.ppcenv:
|
||||
{
|
||||
. = env_offset;
|
||||
common/environment.o
|
||||
}
|
||||
}
|
||||
@@ -56,15 +56,6 @@ SECTIONS
|
||||
.text :
|
||||
{
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
/* . = env_offset;
|
||||
common/environment.o(.text) */
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
@@ -128,8 +119,6 @@ SECTIONS
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,13 +49,11 @@
|
||||
#define MC_LATENCY(value) 0x1038(value)
|
||||
#define MC_TREFRESH(value) 0x1040(value)
|
||||
|
||||
#if CPU_CLOCK_RATE==150000000 /* 150 MHz clock for the MIPS core */
|
||||
#define CGU_MODUL_BASE 0xBF107000
|
||||
#define CGU_PLL1CR(value) 0x0008(value)
|
||||
#define CGU_DIVCR(value) 0x0010(value)
|
||||
#define CGU_MUXCR(value) 0x0014(value)
|
||||
#define CGU_PLL1SR(value) 0x000C(value)
|
||||
#endif
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
@@ -67,12 +65,12 @@ memsetup:
|
||||
li t1, 0xA0000041
|
||||
sw t1, EBU_ADDSEL0(t0)
|
||||
|
||||
#if CPU_CLOCK_RATE==150000000 /* 150 MHz clock for the MIPS core */
|
||||
li t1, 0xA841417E
|
||||
sw t1, EBU_BUSCON0(t0) /* value set up by magic flash word */
|
||||
#if CPU_CLOCK_RATE==100000000 /* 100 MHz clock for the MIPS core */
|
||||
lw t1, EBU_BUSCON0(t0) /* value set up by magic flash word */
|
||||
sw t1, EBU_BUSCON2(t0)
|
||||
#else /* 100 MHz */
|
||||
lw t1, EBU_BUSCON0(t0) /* value set up by magic flash word */
|
||||
#else /* 150 MHz or 133 MHz */
|
||||
li t1, 0x8841417E
|
||||
sw t1, EBU_BUSCON0(t0)
|
||||
sw t1, EBU_BUSCON2(t0)
|
||||
#endif
|
||||
|
||||
@@ -85,10 +83,10 @@ memsetup:
|
||||
li t1, 0xBE0000F1
|
||||
sw t1, EBU_ADDSEL1(t0)
|
||||
|
||||
#if CPU_CLOCK_RATE==150000000 /* 150 MHz clock for the MIPS core */
|
||||
li t1, 0x684143FD
|
||||
#else /* 100 MHz */
|
||||
#if CPU_CLOCK_RATE==100000000 /* 100 MHz clock for the MIPS core */
|
||||
li t1, 0x684142BD
|
||||
#else /* 150 MHz or 133 MHz */
|
||||
li t1, 0x684143FD
|
||||
#endif
|
||||
sw t1, EBU_BUSCON1(t0)
|
||||
|
||||
@@ -105,6 +103,14 @@ b1:
|
||||
beq t1, zero, b1
|
||||
li t1, 0x80000001
|
||||
sw t1, CGU_MUXCR(t0)
|
||||
#elif CPU_CLOCK_RATE==133000000 /* 133 MHz clock for the MIPS core */
|
||||
li t0, CGU_MODUL_BASE
|
||||
li t1, 0x80000054
|
||||
sw t1, CGU_DIVCR(t0)
|
||||
li t1, 0x80000000
|
||||
sw t1, CGU_MUXCR(t0)
|
||||
li t1, 0x800B0001
|
||||
sw t1, CGU_PLL1CR(t0)
|
||||
#endif
|
||||
|
||||
/* SDRAM Initialization.
|
||||
|
||||
@@ -47,11 +47,18 @@ V* Verification: dzu@denx.de
|
||||
|
||||
/*------------------------ Local prototypes ---------------------------*/
|
||||
static long int dram_size (long int, long int *, long int);
|
||||
static void kbd_init (void);
|
||||
static int compare_magic (uchar *kbd_data, uchar *str);
|
||||
|
||||
|
||||
/*--------------------- Local macros and constants --------------------*/
|
||||
#define _NOT_USED_ 0xFFFFFFFF
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
static int key_pressed(void);
|
||||
extern void disable_putc(void);
|
||||
#endif /* CONFIG_MODEM_SUPPORT */
|
||||
|
||||
/*
|
||||
* 66 MHz SDRAM access using UPM A
|
||||
*/
|
||||
@@ -396,6 +403,7 @@ int board_pre_init (void)
|
||||
immr->im_cpm.cp_pbodr &= ~PB_ENET_TENA;
|
||||
immr->im_cpm.cp_pbdat &= ~PB_ENET_TENA; /* set to 0 = disabled */
|
||||
immr->im_cpm.cp_pbdir |= PB_ENET_TENA;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -466,38 +474,45 @@ static uchar *key_match (uchar *);
|
||||
#define KEYBD_SET_DEBUGMODE '#' /* Magic key to enable debug output */
|
||||
|
||||
/***********************************************************************
|
||||
F* Function: int misc_init_r (void) P*A*Z*
|
||||
F* Function: int board_postclk_init (void) P*A*Z*
|
||||
*
|
||||
P* Parameters: none
|
||||
P*
|
||||
P* Returnvalue: int
|
||||
P* - 0 is always returned, even in the case of a keyboard
|
||||
P* error.
|
||||
P* - 0 is always returned.
|
||||
*
|
||||
Z* Intention: This function is the misc_init_r() method implementation
|
||||
Z* Intention: This function is the board_postclk_init() method implementation
|
||||
Z* for the lwmon board.
|
||||
Z* The keyboard controller is initialized and the result
|
||||
Z* of a read copied to the environment variable "keybd".
|
||||
Z* If KEYBD_SET_DEBUGMODE is defined, a check is made for
|
||||
Z* this key, and if found display to the LCD will be enabled.
|
||||
Z* The keys in "keybd" are checked against the magic
|
||||
Z* keycommands defined in the environment.
|
||||
Z* See also key_match().
|
||||
*
|
||||
D* Design: wd@denx.de
|
||||
C* Coding: wd@denx.de
|
||||
V* Verification: dzu@denx.de
|
||||
***********************************************************************/
|
||||
int misc_init_r (void)
|
||||
int board_postclk_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
kbd_init();
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
if (key_pressed()) {
|
||||
disable_putc(); /* modem doesn't understand banner etc */
|
||||
gd->do_mdm_init = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void kbd_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
uchar kbd_data[KEYBD_DATALEN];
|
||||
uchar tmp_data[KEYBD_DATALEN];
|
||||
uchar keybd_env[2 * KEYBD_DATALEN + 1];
|
||||
uchar val, errcd;
|
||||
uchar *str;
|
||||
int i;
|
||||
|
||||
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||
|
||||
gd->kbd_status = 0;
|
||||
|
||||
/* Read initial keyboard error code */
|
||||
val = KEYBD_CMD_READ_STATUS;
|
||||
@@ -508,7 +523,7 @@ int misc_init_r (void)
|
||||
/* clear "irrelevant" bits. Recommended by Martin Rajek, LWN */
|
||||
errcd &= ~(KEYBD_STATUS_H_RESET|KEYBD_STATUS_BROWNOUT);
|
||||
if (errcd) {
|
||||
printf ("KEYBD: Error %02X\n", errcd);
|
||||
gd->kbd_status |= errcd << 8;
|
||||
}
|
||||
/* Reset error code and verify */
|
||||
val = KEYBD_CMD_RESET_ERRORS;
|
||||
@@ -521,28 +536,10 @@ int misc_init_r (void)
|
||||
|
||||
val &= KEYBD_STATUS_MASK; /* clear unused bits */
|
||||
if (val) { /* permanent error, report it */
|
||||
printf ("*** Keyboard error code %02X ***\n", val);
|
||||
sprintf (keybd_env, "%02X", val);
|
||||
setenv ("keybd", keybd_env);
|
||||
return 0;
|
||||
gd->kbd_status |= val;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we know that we have a working keyboard, so disable
|
||||
* all output to the LCD except when a key press is detected.
|
||||
*/
|
||||
|
||||
if ((console_assign (stdout, "serial") < 0) ||
|
||||
(console_assign (stderr, "serial") < 0)) {
|
||||
printf ("Can't assign serial port as output device\n");
|
||||
}
|
||||
|
||||
/* Read Version */
|
||||
val = KEYBD_CMD_READ_VERSION;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_VERSIONLEN);
|
||||
printf ("KEYBD: Version %d.%d\n", kbd_data[0], kbd_data[1]);
|
||||
|
||||
/*
|
||||
* Read current keyboard state.
|
||||
*
|
||||
@@ -569,6 +566,73 @@ int misc_init_r (void)
|
||||
memcpy (tmp_data, kbd_data, KEYBD_DATALEN);
|
||||
udelay (5000);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
F* Function: int misc_init_r (void) P*A*Z*
|
||||
*
|
||||
P* Parameters: none
|
||||
P*
|
||||
P* Returnvalue: int
|
||||
P* - 0 is always returned, even in the case of a keyboard
|
||||
P* error.
|
||||
*
|
||||
Z* Intention: This function is the misc_init_r() method implementation
|
||||
Z* for the lwmon board.
|
||||
Z* The keyboard controller is initialized and the result
|
||||
Z* of a read copied to the environment variable "keybd".
|
||||
Z* If KEYBD_SET_DEBUGMODE is defined, a check is made for
|
||||
Z* this key, and if found display to the LCD will be enabled.
|
||||
Z* The keys in "keybd" are checked against the magic
|
||||
Z* keycommands defined in the environment.
|
||||
Z* See also key_match().
|
||||
*
|
||||
D* Design: wd@denx.de
|
||||
C* Coding: wd@denx.de
|
||||
V* Verification: dzu@denx.de
|
||||
***********************************************************************/
|
||||
int misc_init_r (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
uchar kbd_data[KEYBD_DATALEN];
|
||||
uchar keybd_env[2 * KEYBD_DATALEN + 1];
|
||||
uchar kbd_init_status = gd->kbd_status >> 8;
|
||||
uchar kbd_status = gd->kbd_status;
|
||||
uchar val;
|
||||
uchar *str;
|
||||
int i;
|
||||
|
||||
if (kbd_init_status) {
|
||||
printf ("KEYBD: Error %02X\n", kbd_init_status);
|
||||
}
|
||||
if (kbd_status) { /* permanent error, report it */
|
||||
printf ("*** Keyboard error code %02X ***\n", kbd_status);
|
||||
sprintf (keybd_env, "%02X", kbd_status);
|
||||
setenv ("keybd", keybd_env);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we know that we have a working keyboard, so disable
|
||||
* all output to the LCD except when a key press is detected.
|
||||
*/
|
||||
|
||||
if ((console_assign (stdout, "serial") < 0) ||
|
||||
(console_assign (stderr, "serial") < 0)) {
|
||||
printf ("Can't assign serial port as output device\n");
|
||||
}
|
||||
|
||||
/* Read Version */
|
||||
val = KEYBD_CMD_READ_VERSION;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_VERSIONLEN);
|
||||
printf ("KEYBD: Version %d.%d\n", kbd_data[0], kbd_data[1]);
|
||||
|
||||
/* Read current keyboard state */
|
||||
val = KEYBD_CMD_READ_KEYS;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
|
||||
for (i = 0; i < KEYBD_DATALEN; ++i) {
|
||||
sprintf (keybd_env + i + i, "%02X", kbd_data[i]);
|
||||
@@ -598,6 +662,56 @@ int misc_init_r (void)
|
||||
static uchar kbd_magic_prefix[] = "key_magic";
|
||||
static uchar kbd_command_prefix[] = "key_cmd";
|
||||
|
||||
static int compare_magic (uchar *kbd_data, uchar *str)
|
||||
{
|
||||
uchar compare[KEYBD_DATALEN-1];
|
||||
uchar *nxt;
|
||||
int i;
|
||||
|
||||
/* Don't include modifier byte */
|
||||
memcpy (compare, kbd_data+1, KEYBD_DATALEN-1);
|
||||
|
||||
for (; str != NULL; str = (*nxt) ? nxt+1 : nxt) {
|
||||
uchar c;
|
||||
int k;
|
||||
|
||||
c = (uchar) simple_strtoul (str, (char **) (&nxt), 16);
|
||||
|
||||
if (str == nxt) { /* invalid character */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if this key matches the input.
|
||||
* Set matches to zero, so they match only once
|
||||
* and we can find duplicates or extra keys
|
||||
*/
|
||||
for (k = 0; k < sizeof(compare); ++k) {
|
||||
if (compare[k] == '\0') /* only non-zero entries */
|
||||
continue;
|
||||
if (c == compare[k]) { /* found matching key */
|
||||
compare[k] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k == sizeof(compare)) {
|
||||
return -1; /* unmatched key */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A full match leaves no keys in the `compare' array,
|
||||
*/
|
||||
for (i = 0; i < sizeof(compare); ++i) {
|
||||
if (compare[i])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
F* Function: static uchar *key_match (uchar *kbd_data) P*A*Z*
|
||||
*
|
||||
@@ -627,12 +741,9 @@ V* Verification: dzu@denx.de
|
||||
***********************************************************************/
|
||||
static uchar *key_match (uchar *kbd_data)
|
||||
{
|
||||
uchar compare[KEYBD_DATALEN-1];
|
||||
uchar magic[sizeof (kbd_magic_prefix) + 1];
|
||||
uchar extra;
|
||||
uchar *str, *nxt, *suffix;
|
||||
uchar *suffix;
|
||||
uchar *kbd_magic_keys;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* The following string defines the characters that can pe appended
|
||||
@@ -653,50 +764,7 @@ static uchar *key_match (uchar *kbd_data)
|
||||
#if 0
|
||||
printf ("### Check magic \"%s\"\n", magic);
|
||||
#endif
|
||||
/* Don't include modifier byte */
|
||||
memcpy (compare, kbd_data+1, KEYBD_DATALEN-1);
|
||||
|
||||
extra = 0;
|
||||
|
||||
for (str= getenv(magic); str != NULL; str = (*nxt) ? nxt+1 : nxt) {
|
||||
uchar c;
|
||||
int k;
|
||||
|
||||
c = (uchar) simple_strtoul (str, (char **) (&nxt), 16);
|
||||
|
||||
if (str == nxt) { /* invalid character */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if this key matches the input.
|
||||
* Set matches to zero, so they match only once
|
||||
* and we can find duplicates or extra keys
|
||||
*/
|
||||
for (k = 0; k < sizeof(compare); ++k) {
|
||||
if (compare[k] == '\0') /* only non-zero entries */
|
||||
continue;
|
||||
if (c == compare[k]) { /* found matching key */
|
||||
compare[k] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k == sizeof(compare)) {
|
||||
extra = 1; /* unmatched key */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A full match leaves no keys in the `compare' array,
|
||||
* and has no extra keys
|
||||
*/
|
||||
|
||||
for (i = 0; i < sizeof(compare); ++i) {
|
||||
if (compare[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if ((i == sizeof(compare)) && (extra == 0)) {
|
||||
if (compare_magic(kbd_data, getenv(magic)) == 0) {
|
||||
uchar cmd_name[sizeof (kbd_command_prefix) + 1];
|
||||
char *cmd;
|
||||
|
||||
@@ -815,7 +883,9 @@ int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
uchar val;
|
||||
int i;
|
||||
|
||||
#if 0 /* Done in kbd_init */
|
||||
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||
#endif
|
||||
|
||||
/* Read keys */
|
||||
val = KEYBD_CMD_READ_KEYS;
|
||||
@@ -964,3 +1034,18 @@ void board_poweroff (void)
|
||||
|
||||
while (1);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
static int key_pressed(void)
|
||||
{
|
||||
uchar kbd_data[KEYBD_DATALEN];
|
||||
uchar val;
|
||||
|
||||
/* Read keys */
|
||||
val = KEYBD_CMD_READ_KEYS;
|
||||
i2c_write (kbd_addr, 0, 0, &val, 1);
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
|
||||
return (compare_magic(kbd_data, CONFIG_MODEM_KEY_MAGIC) == 0);
|
||||
}
|
||||
#endif /* CONFIG_MODEM_SUPPORT */
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
# mpc8260ads board
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xfff00000
|
||||
TEXT_BASE = 0xfe000000
|
||||
|
||||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
|
||||
|
||||
@@ -55,7 +55,7 @@ static int clear_block_lock_bit(vu_long * addr);
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
#ifndef CONFIG_MPC8260ADS
|
||||
#ifndef CONFIG_MPC8266ADS
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
volatile ip860_bcsr_t *bcsr = (ip860_bcsr_t *)BCSR_BASE;
|
||||
@@ -66,7 +66,7 @@ unsigned long flash_init (void)
|
||||
/* Init: enable write,
|
||||
* or we cannot even write flash commands
|
||||
*/
|
||||
#ifndef CONFIG_MPC8260ADS
|
||||
#ifndef CONFIG_MPC8266ADS
|
||||
bcsr->bd_ctrl |= BD_CTRL_FLWE;
|
||||
#endif
|
||||
|
||||
@@ -86,7 +86,7 @@ unsigned long flash_init (void)
|
||||
size, size<<20);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_MPC8260ADS
|
||||
#ifndef CONFIG_MPC8266ADS
|
||||
/* Remap FLASH according to real size */
|
||||
memctl->memc_or1 = CFG_OR_TIMING_FLASH | (-size & 0xFFFF8000);
|
||||
memctl->memc_br1 = (CFG_FLASH_BASE & BR_BA_MSK) |
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <ioports.h>
|
||||
#include <i2c.h>
|
||||
#include <mpc8260.h>
|
||||
#include <pci.h>
|
||||
|
||||
/*
|
||||
* PBI Page Based Interleaving
|
||||
@@ -155,8 +156,8 @@ const iop_conf_t iop_conf_tab[4][32] = {
|
||||
/* PC13 */ { 0, 0, 0, 1, 0, 0 }, /* PC13 */
|
||||
/* PC12 */ { 0, 1, 0, 1, 0, 0 }, /* PC12 */
|
||||
/* PC11 */ { 0, 0, 0, 1, 0, 0 }, /* LXT971 transmit control */
|
||||
/* PC10 */ { 1, 1, 0, 0, 0, 0 }, /* LXT970 FETHMDC */
|
||||
/* PC9 */ { 1, 1, 0, 0, 0, 0 }, /* LXT970 FETHMDIO */
|
||||
/* PC10 */ { 1, 0, 0, 1, 0, 0 }, /* LXT970 FETHMDC */
|
||||
/* PC9 */ { 1, 0, 0, 0, 0, 0 }, /* LXT970 FETHMDIO */
|
||||
/* PC8 */ { 0, 0, 0, 1, 0, 0 }, /* PC8 */
|
||||
/* PC7 */ { 0, 0, 0, 1, 0, 0 }, /* PC7 */
|
||||
/* PC6 */ { 0, 0, 0, 1, 0, 0 }, /* PC6 */
|
||||
@@ -216,6 +217,11 @@ typedef struct bscr_ {
|
||||
unsigned long bcsr7;
|
||||
} bcsr_t;
|
||||
|
||||
typedef struct pci_ic_s {
|
||||
unsigned long pci_int_stat;
|
||||
unsigned long pci_int_mask;
|
||||
} pci_ic_t;
|
||||
|
||||
void reset_phy(void)
|
||||
{
|
||||
volatile bcsr_t *bcsr = (bcsr_t *)CFG_BCSR;
|
||||
@@ -229,8 +235,13 @@ void reset_phy(void)
|
||||
int board_pre_init (void)
|
||||
{
|
||||
volatile bcsr_t *bcsr = (bcsr_t *)CFG_BCSR;
|
||||
bcsr->bcsr1 = ~FETHIEN & ~RS232EN_1;
|
||||
volatile pci_ic_t *pci_ic = (pci_ic_t *) CFG_PCI_INT;
|
||||
|
||||
bcsr->bcsr1 = ~FETHIEN & ~RS232EN_1 & ~RS232EN_2;
|
||||
|
||||
/* mask all PCI interrupts */
|
||||
pci_ic->pci_int_mask |= 0xfff00000;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -250,7 +261,7 @@ long int initdram(int board_type)
|
||||
uint psdmr = CFG_PSDMR;
|
||||
int i;
|
||||
|
||||
uint psrt = 14; /* for no SPD */
|
||||
uint psrt = 0x21; /* for no SPD */
|
||||
uint chipselects = 1; /* for no SPD */
|
||||
uint sdram_size = CFG_SDRAM_SIZE * 1024 * 1024; /* for no SPD */
|
||||
uint or = CFG_OR2_PRELIM; /* for no SPD */
|
||||
@@ -270,7 +281,7 @@ long int initdram(int board_type)
|
||||
int j;
|
||||
|
||||
/* Keep the compiler from complaining about potentially uninitialized vars */
|
||||
data_width = chipselects = rows = banks = cols = caslatency = psrt = 0;
|
||||
data_width = rows = banks = cols = caslatency = 0;
|
||||
|
||||
/*
|
||||
* Read the SDRAM SPD EEPROM via I2C.
|
||||
@@ -294,17 +305,18 @@ long int initdram(int board_type)
|
||||
{
|
||||
/*
|
||||
* Refresh rate: this assumes the prescaler is set to
|
||||
* approximately 1uSec per tick.
|
||||
* approximately 0.39uSec per tick and the target refresh period
|
||||
* is about 85% of maximum.
|
||||
*/
|
||||
switch(data & 0x7F)
|
||||
{
|
||||
default:
|
||||
case 0: psrt = 16; /* 15.625uS */ break;
|
||||
case 1: psrt = 2; /* 3.9uS */ break;
|
||||
case 2: psrt = 6; /* 7.8uS */ break;
|
||||
case 3: psrt = 29; /* 31.3uS */ break;
|
||||
case 4: psrt = 60; /* 62.5uS */ break;
|
||||
case 5: psrt = 120; /* 125uS */ break;
|
||||
case 0: psrt = 0x21; /* 15.625uS */ break;
|
||||
case 1: psrt = 0x07; /* 3.9uS */ break;
|
||||
case 2: psrt = 0x0F; /* 7.8uS */ break;
|
||||
case 3: psrt = 0x43; /* 31.3uS */ break;
|
||||
case 4: psrt = 0x87; /* 62.5uS */ break;
|
||||
case 5: psrt = 0xFF; /* 125uS */ break;
|
||||
}
|
||||
}
|
||||
else if(j == 17) banks = data;
|
||||
@@ -563,3 +575,14 @@ long int initdram(int board_type)
|
||||
return (sdram_size * chipselects);
|
||||
/*return (16 * 1024 * 1024);*/
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
@@ -26,10 +26,13 @@
|
||||
#include <version.h>
|
||||
#include <asm/regdef.h>
|
||||
|
||||
#define MC_IOGP 0xBF800800
|
||||
|
||||
.globl memsetup
|
||||
memsetup:
|
||||
|
||||
li t0, MC_IOGP
|
||||
li t1, 0xf24
|
||||
sw t1, 0(t0)
|
||||
j ra
|
||||
nop
|
||||
|
||||
|
||||
@@ -51,6 +51,69 @@ extern int asc_serial_getc (void);
|
||||
extern int asc_serial_tstc (void);
|
||||
extern void asc_serial_setbrg (void);
|
||||
|
||||
static void sdram_timing_init (ulong size)
|
||||
{
|
||||
register uint pass;
|
||||
register uint done;
|
||||
register uint count;
|
||||
register uint p0, p1, p2, p3, p4;
|
||||
register uint addr;
|
||||
|
||||
#define WRITE_MC_IOGP_1 *(uint *)0xbf800800 = (p1<<14)+(p2<<13)+(p4<<8)+(p0<<4)+p3;
|
||||
#define WRITE_MC_IOGP_2 *(uint *)0xbf800800 = (p1<<14)+(p2<<13)+((p4-16)<<8)+(p0<<4)+p3;
|
||||
|
||||
done = 0;
|
||||
p0 = 2;
|
||||
while (p0 < 4 && done == 0) {
|
||||
p1 = 0;
|
||||
while (p1 < 2 && done == 0) {
|
||||
p2 = 0;
|
||||
while (p2 < 2 && done == 0) {
|
||||
p3 = 0;
|
||||
while (p3 < 16 && done == 0) {
|
||||
count = 0;
|
||||
p4 = 0;
|
||||
while (p4 < 32 && done == 0) {
|
||||
WRITE_MC_IOGP_1;
|
||||
|
||||
for (addr = KSEG1 + 0x4000;
|
||||
addr < KSEG1ADDR (size);
|
||||
addr = addr + 4) {
|
||||
*(uint *) addr = 0xaa55aa55;
|
||||
}
|
||||
|
||||
pass = 1;
|
||||
|
||||
for (addr = KSEG1 + 0x4000;
|
||||
addr < KSEG1ADDR (size) && pass == 1;
|
||||
addr = addr + 4) {
|
||||
if (*(uint *) addr != 0xaa55aa55)
|
||||
pass = 0;
|
||||
}
|
||||
|
||||
if (pass == 1) {
|
||||
count++;
|
||||
} else {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
if (count == 32) {
|
||||
WRITE_MC_IOGP_2;
|
||||
done = 1;
|
||||
}
|
||||
p4++;
|
||||
}
|
||||
p3++;
|
||||
}
|
||||
p2++;
|
||||
}
|
||||
p1++;
|
||||
}
|
||||
p0++;
|
||||
if (p0 == 1)
|
||||
p0++;
|
||||
}
|
||||
}
|
||||
|
||||
long int initdram(int board_type)
|
||||
{
|
||||
@@ -64,6 +127,11 @@ long int initdram(int board_type)
|
||||
int rows = (cfgpb0 & 0xF0) >> 4;
|
||||
int dw = cfgdw & 0xF;
|
||||
ulong size = (1 << (rows + cols)) * (1 << (dw - 1)) * CFG_NB;
|
||||
void (* sdram_init) (ulong);
|
||||
|
||||
sdram_init = (void (*)(ulong)) KSEG0ADDR(&sdram_timing_init);
|
||||
|
||||
sdram_init(0x10000);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -206,6 +206,12 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info)
|
||||
{
|
||||
FPW value;
|
||||
|
||||
/* Make sure Block Lock Bits get cleared */
|
||||
addr[0] = (FPW) 0x00FF00FF;
|
||||
addr[0] = (FPW) 0x00600060;
|
||||
addr[0] = (FPW) 0x00D000D0;
|
||||
addr[0] = (FPW) 0x00FF00FF;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0x5555] = (FPW) 0x00AA00AA;
|
||||
addr[0x2AAA] = (FPW) 0x00550055;
|
||||
|
||||
@@ -126,12 +126,12 @@ long int initdram (int board_type)
|
||||
memctl->memc_mar = 0x00000088;
|
||||
|
||||
/*
|
||||
* Map controller bank 1 to the SDRAM bank at
|
||||
* Map controller bank 2 to the SDRAM bank at
|
||||
* preliminary address - these have to be modified after the
|
||||
* SDRAM size has been determined.
|
||||
*/
|
||||
memctl->memc_or1 = CFG_OR1_PRELIM;
|
||||
memctl->memc_br1 = CFG_BR1_PRELIM;
|
||||
memctl->memc_or2 = CFG_OR2_PRELIM;
|
||||
memctl->memc_br2 = CFG_BR2_PRELIM;
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR_8COL & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
|
||||
@@ -139,9 +139,9 @@ long int initdram (int board_type)
|
||||
|
||||
/* perform SDRAM initializsation sequence */
|
||||
|
||||
memctl->memc_mcr = 0x80002105; /* SDRAM bank 0 */
|
||||
memctl->memc_mcr = 0x80004105; /* SDRAM bank 0 */
|
||||
udelay (200);
|
||||
memctl->memc_mcr = 0x80002230; /* SDRAM bank 0 - execute twice */
|
||||
memctl->memc_mcr = 0x80004230; /* SDRAM bank 0 - execute twice */
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* enable refresh */
|
||||
@@ -153,7 +153,7 @@ long int initdram (int board_type)
|
||||
*
|
||||
* try 8 column mode
|
||||
*/
|
||||
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
|
||||
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
|
||||
SDRAM_MAX_SIZE);
|
||||
|
||||
udelay (1000);
|
||||
@@ -161,13 +161,13 @@ long int initdram (int board_type)
|
||||
/*
|
||||
* try 9 column mode
|
||||
*/
|
||||
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE1_PRELIM,
|
||||
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
|
||||
SDRAM_MAX_SIZE);
|
||||
|
||||
if (size8 < size9) { /* leave configuration at 9 columns */
|
||||
size_b0 = size9;
|
||||
/* debug ("SDRAM Bank 0 in 9 column mode: %ld MB\n", size >> 20); */
|
||||
} else { /* back to 8 columns */
|
||||
} else { /* back to 8 columns */
|
||||
size_b0 = size8;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL;
|
||||
udelay (500);
|
||||
@@ -200,6 +200,47 @@ long int initdram (int board_type)
|
||||
|
||||
udelay (10000);
|
||||
|
||||
#ifdef CONFIG_CAN_DRIVER
|
||||
/* Initialize OR3 / BR3 */
|
||||
memctl->memc_or3 = CFG_OR3_CAN; /* switch GPLB_5 to GPLA_5 */
|
||||
memctl->memc_br3 = CFG_BR3_CAN;
|
||||
|
||||
/* Initialize MBMR */
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS; /* GPL_B4 works as UPWAITB */
|
||||
|
||||
/* Initialize UPMB for CAN: single read */
|
||||
memctl->memc_mdr = 0xFFFFC004;
|
||||
memctl->memc_mcr = 0x0100 | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0x0FFFD004;
|
||||
memctl->memc_mcr = 0x0101 | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0x0FFFC000;
|
||||
memctl->memc_mcr = 0x0102 | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0x3FFFC004;
|
||||
memctl->memc_mcr = 0x0103 | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0xFFFFDC05;
|
||||
memctl->memc_mcr = 0x0104 | UPMB;
|
||||
|
||||
/* Initialize UPMB for CAN: single write */
|
||||
memctl->memc_mdr = 0xFFFCC004;
|
||||
memctl->memc_mcr = 0x0118 | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0xCFFCD004;
|
||||
memctl->memc_mcr = 0x0119 | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0x0FFCC000;
|
||||
memctl->memc_mcr = 0x011A | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0x7FFCC004;
|
||||
memctl->memc_mcr = 0x011B | UPMB;
|
||||
|
||||
memctl->memc_mdr = 0xFFFDCC05;
|
||||
memctl->memc_mcr = 0x011C | UPMB;
|
||||
#endif
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
@@ -213,8 +254,8 @@ long int initdram (int board_type)
|
||||
* - short between data lines
|
||||
*/
|
||||
|
||||
static long int dram_size (long int mamr_value, long int *base,
|
||||
long int maxsize)
|
||||
static long int dram_size (long int mamr_value,
|
||||
long int *base, long int maxsize)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
@@ -257,10 +298,10 @@ static long int dram_size (long int mamr_value, long int *base,
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
void r360_pwm_write (uchar reg, uchar val)
|
||||
void r360_i2c_lcd_write (uchar data0, uchar data1)
|
||||
{
|
||||
if (i2c_write (CFG_I2C_PWM_ADDR, reg, 1, &val, 1)) {
|
||||
printf ("Can't write PWM register 0x%02X.\n", reg);
|
||||
if (i2c_write (CFG_I2C_LCD_ADDR, data0, 1, &data1, 1)) {
|
||||
printf("Can't write lcd data 0x%02X 0x%02X.\n", data0, data1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,10 +312,8 @@ void r360_pwm_write (uchar reg, uchar val)
|
||||
*/
|
||||
|
||||
/* Number of bytes returned from Keyboard Controller */
|
||||
#define KEYBD_KEY_MAX 20 /* maximum key number */
|
||||
#define KEYBD_DATALEN ((KEYBD_KEY_MAX + 7) / 8) /* normal key scan data */
|
||||
|
||||
static uchar kbd_addr = CFG_I2C_KBD_ADDR;
|
||||
#define KEYBD_KEY_MAX 16 /* maximum key number */
|
||||
#define KEYBD_DATALEN ((KEYBD_KEY_MAX + 7) / 8) /* normal key scan data */
|
||||
|
||||
static uchar *key_match (uchar *);
|
||||
|
||||
@@ -287,14 +326,14 @@ int misc_init_r (void)
|
||||
|
||||
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
i2c_read (CFG_I2C_KEY_ADDR, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
|
||||
for (i = 0; i < KEYBD_DATALEN; ++i) {
|
||||
sprintf (keybd_env + i + i, "%02X", kbd_data[i]);
|
||||
}
|
||||
setenv ("keybd", keybd_env);
|
||||
|
||||
str = strdup (key_match (kbd_data)); /* decode keys */
|
||||
str = strdup (key_match (keybd_env)); /* decode keys */
|
||||
|
||||
#ifdef CONFIG_PREBOOT /* automatically configure "preboot" command on key match */
|
||||
setenv ("preboot", str); /* set or delete definition */
|
||||
@@ -324,16 +363,13 @@ int misc_init_r (void)
|
||||
static uchar kbd_magic_prefix[] = "key_magic";
|
||||
static uchar kbd_command_prefix[] = "key_cmd";
|
||||
|
||||
static uchar *key_match (uchar * kbd_data)
|
||||
static uchar *key_match (uchar * kbd_str)
|
||||
{
|
||||
uchar compare[KEYBD_DATALEN];
|
||||
uchar magic[sizeof (kbd_magic_prefix) + 1];
|
||||
uchar cmd_name[sizeof (kbd_command_prefix) + 1];
|
||||
uchar key_mask;
|
||||
uchar *str, *nxt, *suffix;
|
||||
uchar *str, *suffix;
|
||||
uchar *kbd_magic_keys;
|
||||
char *cmd;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* The following string defines the characters that can pe appended
|
||||
@@ -343,62 +379,48 @@ static uchar *key_match (uchar * kbd_data)
|
||||
* "key_magic" is checked (old behaviour); the string "125" causes
|
||||
* checks for "key_magic1", "key_magic2" and "key_magic5", etc.
|
||||
*/
|
||||
if ((kbd_magic_keys = getenv ("magic_keys")) == NULL)
|
||||
kbd_magic_keys = "";
|
||||
if ((kbd_magic_keys = getenv ("magic_keys")) != NULL) {
|
||||
/* loop over all magic keys;
|
||||
* use '\0' suffix in case of empty string
|
||||
*/
|
||||
for (suffix = kbd_magic_keys;
|
||||
*suffix || suffix == kbd_magic_keys;
|
||||
++suffix) {
|
||||
sprintf (magic, "%s%c", kbd_magic_prefix, *suffix);
|
||||
|
||||
/* loop over all magic keys;
|
||||
* use '\0' suffix in case of empty string
|
||||
*/
|
||||
for (suffix=kbd_magic_keys; *suffix || suffix==kbd_magic_keys; ++suffix) {
|
||||
sprintf (magic, "%s%c", kbd_magic_prefix, *suffix);
|
||||
#if 0
|
||||
printf ("### Check magic \"%s\"\n", magic);
|
||||
printf ("### Check magic \"%s\"\n", magic);
|
||||
#endif
|
||||
|
||||
memcpy(compare, kbd_data, KEYBD_DATALEN);
|
||||
if ((str = getenv (magic)) != 0) {
|
||||
|
||||
for (str = getenv(magic); str != NULL; str = (*nxt) ? nxt+1 : nxt) {
|
||||
uchar c;
|
||||
#if 0
|
||||
printf ("### Compare \"%s\" \"%s\"\n",
|
||||
kbd_str, str);
|
||||
#endif
|
||||
if (strcmp (kbd_str, str) == 0) {
|
||||
sprintf (cmd_name, "%s%c",
|
||||
kbd_command_prefix,
|
||||
*suffix);
|
||||
|
||||
c = (uchar) simple_strtoul (str, (char **) (&nxt), 16);
|
||||
|
||||
if (str == nxt) /* invalid character */
|
||||
break;
|
||||
|
||||
if (c >= KEYBD_KEY_MAX) /* bad key number */
|
||||
goto next_magic;
|
||||
|
||||
key_mask = 0x80 >> (c % 8);
|
||||
|
||||
if (!(compare[c / 8] & key_mask)) /* key not pressed */
|
||||
goto next_magic;
|
||||
|
||||
compare[c / 8] &= ~key_mask;
|
||||
if ((cmd = getenv (cmd_name)) != 0) {
|
||||
#if 0
|
||||
printf ("### Set PREBOOT to $(%s): \"%s\"\n",
|
||||
cmd_name, cmd);
|
||||
#endif
|
||||
return (cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<KEYBD_DATALEN; i++)
|
||||
if (compare[i]) /* key(s) not released */
|
||||
goto next_magic;
|
||||
|
||||
sprintf (cmd_name, "%s%c", kbd_command_prefix, *suffix);
|
||||
|
||||
cmd = getenv (cmd_name);
|
||||
#if 0
|
||||
printf ("### Set PREBOOT to $(%s): \"%s\"\n",
|
||||
cmd_name, cmd ? cmd : "<<NULL>>");
|
||||
#endif
|
||||
*kbd_data = *suffix;
|
||||
return (cmd);
|
||||
|
||||
next_magic:;
|
||||
}
|
||||
#if 0
|
||||
printf ("### Delete PREBOOT\n");
|
||||
#endif
|
||||
*kbd_data = '\0';
|
||||
*kbd_str = '\0';
|
||||
return (NULL);
|
||||
}
|
||||
#endif /* CONFIG_PREBOOT */
|
||||
#endif /* CONFIG_PREBOOT */
|
||||
|
||||
/* Read Keyboard status */
|
||||
int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
@@ -410,7 +432,7 @@ int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||
|
||||
/* Read keys */
|
||||
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
i2c_read (CFG_I2C_KEY_ADDR, 0, 0, kbd_data, KEYBD_DATALEN);
|
||||
|
||||
puts ("Keys:");
|
||||
for (i = 0; i < KEYBD_DATALEN; ++i) {
|
||||
|
||||
@@ -200,7 +200,7 @@ int checkboard (void)
|
||||
|
||||
puts ("Board: ");
|
||||
|
||||
if (!i || strncmp (str, "TQM8260", 7)) {
|
||||
if (!i || strncmp (str, "TQM82", 5)) {
|
||||
puts ("### No HW ID - assuming TQM8260\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#ifdef CFG_BRIGHTNESS
|
||||
static void spi_init(void);
|
||||
static void wait_transmit_done(void);
|
||||
static void tsc2000_write(unsigned int page, unsigned int reg,
|
||||
static void tsc2000_write(unsigned int page, unsigned int reg,
|
||||
unsigned int data);
|
||||
static void tsc2000_set_brightness(void);
|
||||
#endif
|
||||
@@ -328,6 +328,7 @@ static void spi_init(void)
|
||||
for (i = 0; i < 10; i++) {
|
||||
rSPTDAT = 0xFF;
|
||||
}
|
||||
wait_transmit_done();
|
||||
}
|
||||
|
||||
static void wait_transmit_done(void)
|
||||
@@ -335,7 +336,7 @@ static void wait_transmit_done(void)
|
||||
while (!(rSPSTA & 0x01)); /* wait until transfer is done */
|
||||
}
|
||||
|
||||
static void tsc2000_write(unsigned int page, unsigned int reg,
|
||||
static void tsc2000_write(unsigned int page, unsigned int reg,
|
||||
unsigned int data)
|
||||
{
|
||||
unsigned int command;
|
||||
|
||||
@@ -346,9 +346,10 @@ void transfer_pic(int display, unsigned char *adr, int height, int width)
|
||||
}
|
||||
}
|
||||
}
|
||||
display++;
|
||||
if (display > 3)
|
||||
display = 0;
|
||||
if (display > 0)
|
||||
display--;
|
||||
else
|
||||
display = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +487,11 @@ int drv_vfd_init(void)
|
||||
/* frame buffer endadr */
|
||||
rLCDSADDR2 = (gd->fb_base + FRAME_BUF_SIZE) >> 1;
|
||||
rLCDSADDR3 = ((256/4));
|
||||
rLCDCON2 = 0x000DC000;
|
||||
rLCDCON2 = 0x000DC000;
|
||||
if(gd->vfd_type == VFD_TYPE_MN11236)
|
||||
rLCDCON2 = 37 << 14; /* MN11236: 38 lines */
|
||||
else
|
||||
rLCDCON2 = 55 << 14; /* T119C: 56 lines */
|
||||
rLCDCON3 = 0x0051000A;
|
||||
rLCDCON4 = 0x00000001;
|
||||
if (gd->vfd_type && vfd_inv_data)
|
||||
|
||||
@@ -28,7 +28,7 @@ LIB = libcommon.a
|
||||
AOBJS =
|
||||
|
||||
COBJS = main.o altera.o bedbug.o \
|
||||
cmd_autoscript.o cmd_bedbug.o cmd_boot.o \
|
||||
cmd_autoscript.o cmd_bedbug.o cmd_bmp.o cmd_boot.o \
|
||||
cmd_bootm.o cmd_cache.o cmd_console.o cmd_date.o \
|
||||
cmd_dcr.o cmd_diag.o cmd_doc.o cmd_nand.o cmd_dtt.o \
|
||||
cmd_eeprom.o cmd_elf.o cmd_fdc.o cmd_fdos.o cmd_flash.o \
|
||||
|
||||
@@ -56,7 +56,7 @@ void bedbug_init( void )
|
||||
#if defined(CONFIG_4xx)
|
||||
void bedbug405_init( void );
|
||||
bedbug405_init();
|
||||
#elif defined(CONFIG_MPC860)
|
||||
#elif defined(CONFIG_8xx)
|
||||
void bedbug860_init( void );
|
||||
bedbug860_init();
|
||||
#endif
|
||||
|
||||
118
common/cmd_bmp.c
Normal file
118
common/cmd_bmp.c
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Dtlev Zundel, DENX Software Engineering, dzu@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
|
||||
*/
|
||||
|
||||
/*
|
||||
* BMP handling routines
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <bmp_layout.h>
|
||||
#include <command.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
|
||||
static int bmp_info (ulong addr);
|
||||
static int bmp_display (ulong addr);
|
||||
|
||||
/*
|
||||
* Subroutine: do_bmp
|
||||
*
|
||||
* Description: Handler for 'bmp' command..
|
||||
*
|
||||
* Inputs: argv[1] contains the subcommand
|
||||
*
|
||||
* Return: None
|
||||
*
|
||||
*/
|
||||
int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong addr;
|
||||
|
||||
switch (argc) {
|
||||
case 2: /* use load_addr as default address */
|
||||
addr = load_addr;
|
||||
break;
|
||||
case 3: /* use argument */
|
||||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
break;
|
||||
default:
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Allow for short names
|
||||
* Adjust length if more sub-commands get added
|
||||
*/
|
||||
if (strncmp(argv[1],"info",1) == 0) {
|
||||
return (bmp_info(addr));
|
||||
} else if (strncmp(argv[1],"display",1) == 0) {
|
||||
return (bmp_display(addr));
|
||||
} else {
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Subroutine: bmp_info
|
||||
*
|
||||
* Description: Show information about bmp file in memory
|
||||
*
|
||||
* Inputs: addr address of the bmp file
|
||||
*
|
||||
* Return: None
|
||||
*
|
||||
*/
|
||||
static int bmp_info(ulong addr)
|
||||
{
|
||||
bmp_image_t *bmp=(bmp_image_t *)addr;
|
||||
if (!((bmp->header.signature[0]=='B') &&
|
||||
(bmp->header.signature[1]=='M'))) {
|
||||
printf("There is no valid bmp file at the given address\n");
|
||||
return(1);
|
||||
}
|
||||
printf("Image size : %d x %d\n", le32_to_cpu(bmp->header.width),
|
||||
le32_to_cpu(bmp->header.height));
|
||||
printf("Bits per pixel: %d\n", le16_to_cpu(bmp->header.bit_count));
|
||||
printf("Compression : %d\n", le32_to_cpu(bmp->header.compression));
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Subroutine: bmp_display
|
||||
*
|
||||
* Description: Display bmp file located in memory
|
||||
*
|
||||
* Inputs: addr address of the bmp file
|
||||
*
|
||||
* Return: None
|
||||
*
|
||||
*/
|
||||
static int bmp_display(ulong addr)
|
||||
{
|
||||
extern int lcd_display_bitmap (ulong);
|
||||
|
||||
return (lcd_display_bitmap (addr));
|
||||
}
|
||||
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */
|
||||
@@ -332,6 +332,7 @@ load_serial (ulong offset)
|
||||
case SREC_DATA3:
|
||||
case SREC_DATA4:
|
||||
store_addr = addr + offset;
|
||||
#ifndef CFG_NO_FLASH
|
||||
if (addr2info(store_addr)) {
|
||||
int rc;
|
||||
|
||||
@@ -340,7 +341,9 @@ load_serial (ulong offset)
|
||||
flash_perror (rc);
|
||||
return (~0);
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
memcpy ((char *)(store_addr), binbuf, binlen);
|
||||
}
|
||||
if ((store_addr) < start_addr)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <image.h>
|
||||
#include <malloc.h>
|
||||
#include <zlib.h>
|
||||
#include <environment.h>
|
||||
#include <asm/byteorder.h>
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
|
||||
#include <rtc.h>
|
||||
@@ -98,12 +99,16 @@ static boot_os_Fcn do_bootm_linux;
|
||||
extern boot_os_Fcn do_bootm_linux;
|
||||
#endif
|
||||
static boot_os_Fcn do_bootm_netbsd;
|
||||
static boot_os_Fcn do_bootm_rtems;
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_ELF)
|
||||
static boot_os_Fcn do_bootm_vxworks;
|
||||
static boot_os_Fcn do_bootm_qnxelf;
|
||||
int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
|
||||
int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
|
||||
#endif /* CFG_CMD_ELF */
|
||||
#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
|
||||
static boot_os_Fcn do_bootm_artos;
|
||||
#endif
|
||||
|
||||
image_header_t header;
|
||||
|
||||
@@ -287,12 +292,17 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
switch (hdr->ih_type) {
|
||||
case IH_TYPE_STANDALONE:
|
||||
appl = (int (*)(cmd_tbl_t *, int, int, char *[]))ntohl(hdr->ih_ep);
|
||||
if (iflag)
|
||||
enable_interrupts();
|
||||
|
||||
/* load (and uncompress), but don't start if "autostart"
|
||||
* is set to "no"
|
||||
*/
|
||||
if (((s = getenv("autostart")) != NULL) && (strcmp(s,"no") == 0))
|
||||
return 0;
|
||||
appl = (int (*)(cmd_tbl_t *, int, int, char *[]))ntohl(hdr->ih_ep);
|
||||
(*appl)(cmdtp, flag, argc-1, &argv[1]);
|
||||
break;
|
||||
return 0;
|
||||
case IH_TYPE_KERNEL:
|
||||
case IH_TYPE_MULTI:
|
||||
/* handled below */
|
||||
@@ -316,6 +326,12 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
do_bootm_netbsd (cmdtp, flag, argc, argv,
|
||||
addr, len_ptr, verify);
|
||||
break;
|
||||
|
||||
case IH_OS_RTEMS:
|
||||
do_bootm_rtems (cmdtp, flag, argc, argv,
|
||||
addr, len_ptr, verify);
|
||||
break;
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_ELF)
|
||||
case IH_OS_VXWORKS:
|
||||
do_bootm_vxworks (cmdtp, flag, argc, argv,
|
||||
@@ -326,6 +342,12 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
addr, len_ptr, verify);
|
||||
break;
|
||||
#endif /* CFG_CMD_ELF */
|
||||
#ifdef CONFIG_ARTOS
|
||||
case IH_OS_ARTOS:
|
||||
do_bootm_artos (cmdtp, flag, argc, argv,
|
||||
addr, len_ptr, verify);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
SHOW_BOOT_PROGRESS (-9);
|
||||
@@ -705,6 +727,99 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
|
||||
(*loader) (gd->bd, img_addr, consdev, cmdline);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
|
||||
|
||||
/* Function that returns a character from the environment */
|
||||
extern uchar (*env_get_char)(int);
|
||||
|
||||
static void
|
||||
do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
|
||||
int argc, char *argv[],
|
||||
ulong addr,
|
||||
ulong *len_ptr,
|
||||
int verify)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
ulong top;
|
||||
char *s, *cmdline;
|
||||
char **fwenv, **ss;
|
||||
int i, j, nxt, len, envno, envsz;
|
||||
bd_t *kbd;
|
||||
void (*entry)(bd_t *bd, char *cmdline, char **fwenv, ulong top);
|
||||
image_header_t *hdr = &header;
|
||||
|
||||
/*
|
||||
* Booting an ARTOS kernel image + application
|
||||
*/
|
||||
|
||||
/* this used to be the top of memory, but was wrong... */
|
||||
#ifdef CONFIG_PPC
|
||||
/* get stack pointer */
|
||||
asm volatile ("mr %0,1" : "=r"(top) );
|
||||
#endif
|
||||
debug ("## Current stack ends at 0x%08lX ", top);
|
||||
|
||||
top -= 2048; /* just to be sure */
|
||||
if (top > CFG_BOOTMAPSZ)
|
||||
top = CFG_BOOTMAPSZ;
|
||||
top &= ~0xF;
|
||||
|
||||
debug ("=> set upper limit to 0x%08lX\n", top);
|
||||
|
||||
/* first check the artos specific boot args, then the linux args*/
|
||||
if ((s = getenv("abootargs")) == NULL && (s = getenv("bootargs")) == NULL)
|
||||
s = "";
|
||||
|
||||
/* get length of cmdline, and place it */
|
||||
len = strlen(s);
|
||||
top = (top - (len + 1)) & ~0xF;
|
||||
cmdline = (char *)top;
|
||||
debug ("## cmdline at 0x%08lX ", top);
|
||||
strcpy(cmdline, s);
|
||||
|
||||
/* copy bdinfo */
|
||||
top = (top - sizeof(bd_t)) & ~0xF;
|
||||
debug ("## bd at 0x%08lX ", top);
|
||||
kbd = (bd_t *)top;
|
||||
memcpy(kbd, gd->bd, sizeof(bd_t));
|
||||
|
||||
/* first find number of env entries, and their size */
|
||||
envno = 0;
|
||||
envsz = 0;
|
||||
for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
|
||||
for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
|
||||
;
|
||||
envno++;
|
||||
envsz += (nxt - i) + 1; /* plus trailing zero */
|
||||
}
|
||||
envno++; /* plus the terminating zero */
|
||||
debug ("## %u envvars total size %u ", envno, envsz);
|
||||
|
||||
top = (top - sizeof(char **)*envno) & ~0xF;
|
||||
fwenv = (char **)top;
|
||||
debug ("## fwenv at 0x%08lX ", top);
|
||||
|
||||
top = (top - envsz) & ~0xF;
|
||||
s = (char *)top;
|
||||
ss = fwenv;
|
||||
|
||||
/* now copy them */
|
||||
for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
|
||||
for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
|
||||
;
|
||||
*ss++ = s;
|
||||
for (j = i; j < nxt; ++j)
|
||||
*s++ = env_get_char(j);
|
||||
*s++ = '\0';
|
||||
}
|
||||
*ss++ = NULL; /* terminate */
|
||||
|
||||
entry = (void (*)(bd_t *, char *, char **, ulong))ntohl(hdr->ih_ep);
|
||||
(*entry)(kbd, cmdline, fwenv, top);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
|
||||
int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
@@ -826,6 +941,10 @@ print_type (image_header_t *hdr)
|
||||
case IH_OS_VXWORKS: os = "VxWorks"; break;
|
||||
case IH_OS_QNX: os = "QNX"; break;
|
||||
case IH_OS_U_BOOT: os = "U-Boot"; break;
|
||||
case IH_OS_RTEMS: os = "RTEMS"; break;
|
||||
#ifdef CONFIG_ARTOS
|
||||
case IH_OS_ARTOS: os = "ARTOS"; break;
|
||||
#endif
|
||||
default: os = "Unknown OS"; break;
|
||||
}
|
||||
|
||||
@@ -948,6 +1067,29 @@ int gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
|
||||
ulong addr, ulong *len_ptr, int verify)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
image_header_t *hdr = &header;
|
||||
void (*entry_point)(bd_t *);
|
||||
|
||||
entry_point = (void (*)(bd_t *)) hdr->ih_ep;
|
||||
|
||||
printf ("## Transferring control to RTEMS (at address %08lx) ...\n",
|
||||
(ulong)entry_point);
|
||||
|
||||
SHOW_BOOT_PROGRESS (15);
|
||||
|
||||
/*
|
||||
* RTEMS Parameters:
|
||||
* r3: ptr to board info data
|
||||
*/
|
||||
|
||||
(*entry_point ) ( gd->bd );
|
||||
}
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_ELF)
|
||||
static void
|
||||
do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
|
||||
|
||||
@@ -404,7 +404,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
SHOW_BOOT_PROGRESS (-1);
|
||||
return 1;
|
||||
}
|
||||
if (strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) {
|
||||
if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
|
||||
(strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
|
||||
printf ("\n** Invalid partition type \"%.32s\""
|
||||
" (expect \"" BOOT_PART_TYPE "\")\n",
|
||||
info.type);
|
||||
|
||||
@@ -55,7 +55,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
unsigned short data;
|
||||
int rcode = 0;
|
||||
|
||||
#ifdef CONFIG_MPC860
|
||||
#ifdef CONFIG_8xx
|
||||
mii_init ();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void pciinfo(int BusNum, int ShortPCIListing)
|
||||
}
|
||||
}
|
||||
|
||||
char* pci_classes_str(u8 class)
|
||||
static char *pci_classes_str(u8 class)
|
||||
{
|
||||
switch (class) {
|
||||
case PCI_CLASS_NOT_DEFINED:
|
||||
@@ -123,55 +123,55 @@ char* pci_classes_str(u8 class)
|
||||
return "Mass storage controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_NETWORK:
|
||||
return "Network controller ";
|
||||
return "Network controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_DISPLAY:
|
||||
return "Display controller ";
|
||||
return "Display controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_MULTIMEDIA:
|
||||
return "Multimedia device ";
|
||||
return "Multimedia device";
|
||||
break;
|
||||
case PCI_BASE_CLASS_MEMORY:
|
||||
return "Memory controller ";
|
||||
return "Memory controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_BRIDGE:
|
||||
return "Bridge device ";
|
||||
return "Bridge device";
|
||||
break;
|
||||
case PCI_BASE_CLASS_COMMUNICATION:
|
||||
return "Simple comm. controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_SYSTEM:
|
||||
return "Base system peripheral ";
|
||||
return "Base system peripheral";
|
||||
break;
|
||||
case PCI_BASE_CLASS_INPUT:
|
||||
return "Input device ";
|
||||
return "Input device";
|
||||
break;
|
||||
case PCI_BASE_CLASS_DOCKING:
|
||||
return "Docking station ";
|
||||
return "Docking station";
|
||||
break;
|
||||
case PCI_BASE_CLASS_PROCESSOR:
|
||||
return "Processor ";
|
||||
return "Processor";
|
||||
break;
|
||||
case PCI_BASE_CLASS_SERIAL:
|
||||
return "Serial bus controller ";
|
||||
return "Serial bus controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_INTELLIGENT:
|
||||
return "Intelligent controller ";
|
||||
return "Intelligent controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_SATELLITE:
|
||||
return "Satellite controller ";
|
||||
return "Satellite controller";
|
||||
break;
|
||||
case PCI_BASE_CLASS_CRYPT:
|
||||
return "Cryptographic device ";
|
||||
return "Cryptographic device";
|
||||
break;
|
||||
case PCI_BASE_CLASS_SIGNAL_PROCESSING:
|
||||
return "DSP ";
|
||||
return "DSP";
|
||||
break;
|
||||
case PCI_CLASS_OTHERS:
|
||||
return "Does not fit any class ";
|
||||
return "Does not fit any class";
|
||||
break;
|
||||
default:
|
||||
return "??? ";
|
||||
return "???";
|
||||
break;
|
||||
};
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void pci_header_show_brief(pci_dev_t dev)
|
||||
pci_read_config_byte(dev, PCI_CLASS_CODE, &class);
|
||||
pci_read_config_byte(dev, PCI_CLASS_SUB_CODE, &subclass);
|
||||
|
||||
printf("0x%.4x 0x%.4x %s 0x%.2x\n",
|
||||
printf("0x%.4x 0x%.4x %-23s 0x%.2x\n",
|
||||
vendor, device,
|
||||
pci_classes_str(class), subclass);
|
||||
}
|
||||
|
||||
@@ -72,18 +72,24 @@ int pcmcia_on (void);
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
|
||||
static int pcmcia_off (void);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I82365
|
||||
|
||||
extern int i82365_init (void);
|
||||
extern void i82365_exit (void);
|
||||
|
||||
#else /* ! CONFIG_I82365 */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
|
||||
static int hardware_disable(int slot);
|
||||
#endif
|
||||
static int hardware_enable (int slot);
|
||||
static int voltage_set(int slot, int vcc, int vpp);
|
||||
#ifdef CONFIG_IDE_8xx_PCCARD
|
||||
static void print_funcid (int func);
|
||||
static void print_fixed (volatile uchar *p);
|
||||
static int identify (volatile uchar *p);
|
||||
static int check_ide_device (int slot);
|
||||
#endif /* CONFIG_IDE_8xx_PCCARD */
|
||||
|
||||
#ifndef CONFIG_I82365
|
||||
static u_int m8xx_get_graycode(u_int size);
|
||||
#endif /* CONFIG_I82365 */
|
||||
#if 0
|
||||
static u_int m8xx_get_speed(u_int ns, u_int is_io);
|
||||
#endif
|
||||
@@ -99,6 +105,15 @@ static u_int *pcmcia_pgcrx[2] = {
|
||||
|
||||
#define PCMCIA_PGCRX(slot) (*pcmcia_pgcrx[slot])
|
||||
|
||||
#endif /* CONFIG_I82365 */
|
||||
|
||||
#ifdef CONFIG_IDE_8xx_PCCARD
|
||||
static void print_funcid (int func);
|
||||
static void print_fixed (volatile uchar *p);
|
||||
static int identify (volatile uchar *p);
|
||||
static int check_ide_device (int slot);
|
||||
#endif /* CONFIG_IDE_8xx_PCCARD */
|
||||
|
||||
const char *indent = "\t ";
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -128,6 +143,24 @@ int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#ifdef CONFIG_I82365
|
||||
int pcmcia_on (void)
|
||||
{
|
||||
u_int rc;
|
||||
|
||||
debug ("Enable PCMCIA " PCMCIA_SLOT_MSG "\n");
|
||||
|
||||
rc = i82365_init();
|
||||
|
||||
if (rc == 0)
|
||||
{
|
||||
rc = check_ide_device(0);
|
||||
}
|
||||
|
||||
return (rc);
|
||||
}
|
||||
#else
|
||||
|
||||
#if defined(CONFIG_LWMON)
|
||||
# define CFG_PCMCIA_TIMING (PCMCIA_SHT(9) | PCMCIA_SST(3) | PCMCIA_SL(12))
|
||||
#else
|
||||
@@ -222,11 +255,22 @@ int pcmcia_on (void)
|
||||
}
|
||||
return (rc);
|
||||
}
|
||||
#endif /* CONFIG_I82365 */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
|
||||
|
||||
#ifdef CONFIG_I82365
|
||||
static int pcmcia_off (void)
|
||||
{
|
||||
printf ("Disable PCMCIA " PCMCIA_SLOT_MSG "\n");
|
||||
|
||||
i82365_exit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int pcmcia_off (void)
|
||||
{
|
||||
int i;
|
||||
@@ -258,6 +302,7 @@ static int pcmcia_off (void)
|
||||
hardware_disable(_slot_);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_I82365 */
|
||||
|
||||
#endif /* CFG_CMD_PCMCIA */
|
||||
|
||||
@@ -2215,6 +2260,8 @@ static const u_int m8xx_size_to_gray[M8XX_SIZES_NO] =
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#ifndef CONFIG_I82365
|
||||
|
||||
static u_int m8xx_get_graycode(u_int size)
|
||||
{
|
||||
u_int k;
|
||||
@@ -2230,6 +2277,8 @@ static u_int m8xx_get_graycode(u_int size)
|
||||
return k;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_I82365 */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -262,7 +262,8 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
printf("error reading partinfo\n");
|
||||
return 1;
|
||||
}
|
||||
if (strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) {
|
||||
if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
|
||||
(strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
|
||||
printf ("\n** Invalid partition type \"%.32s\""
|
||||
" (expect \"" BOOT_PART_TYPE "\")\n",
|
||||
info.type);
|
||||
|
||||
@@ -376,7 +376,8 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
info.size=2880;
|
||||
printf("error reading partinfo...try to boot raw\n");
|
||||
}
|
||||
if (strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) {
|
||||
if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
|
||||
(strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
|
||||
printf ("\n** Invalid partition type \"%.32s\""
|
||||
" (expect \"" BOOT_PART_TYPE "\")\n",
|
||||
info.type);
|
||||
|
||||
@@ -36,11 +36,10 @@
|
||||
#include <command.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_VFD)
|
||||
#ifdef VFD_TEST_LOGO
|
||||
|
||||
#include <vfd_logo.h>
|
||||
#define VFD_TEST_LOGO_BMPNR 0
|
||||
#define VFD_REMOTE_LOGO_BMPNR 1
|
||||
#endif
|
||||
|
||||
extern int transfer_pic(unsigned char, unsigned char *, int, int);
|
||||
|
||||
@@ -55,30 +54,46 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
bitmap = simple_strtoul(argv[1], NULL, 10);
|
||||
if (argv[1][0] == '#') { /* select bitmap by number */
|
||||
bitmap = simple_strtoul(argv[1]+1, NULL, 10);
|
||||
return (trab_vfd(bitmap));
|
||||
}
|
||||
|
||||
return (trab_vfd(bitmap));
|
||||
/* display bitmap at given address */
|
||||
bitmap = simple_strtoul(argv[1], NULL, 16);
|
||||
transfer_pic(3, (uchar *)bitmap, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CFG_CMD_VFD */
|
||||
|
||||
#ifdef CONFIG_VFD
|
||||
int trab_vfd (ulong bitmap)
|
||||
{
|
||||
uchar *addr;
|
||||
char *s;
|
||||
|
||||
switch (bitmap) {
|
||||
#ifdef VFD_TEST_LOGO
|
||||
case VFD_TEST_LOGO_BMPNR:
|
||||
transfer_pic(1, &vfd_test_logo_bitmap[0],
|
||||
VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH);
|
||||
return 0;
|
||||
case VFD_REMOTE_LOGO_BMPNR:
|
||||
transfer_pic(1, &vfd_remote_logo_bitmap[0],
|
||||
VFD_REMOTE_LOGO_HEIGHT, VFD_REMOTE_LOGO_WIDTH);
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
printf("Unknown bitmap %ld\n", bitmap);
|
||||
return 1;
|
||||
case VFD_TEST_LOGO_BMPNR:
|
||||
if ((s = getenv ("bitmap0")) != NULL) {
|
||||
addr = (uchar *)simple_strtoul (s, NULL, 16);
|
||||
} else {
|
||||
addr = &vfd_test_logo_bitmap[0];
|
||||
}
|
||||
break;
|
||||
case VFD_REMOTE_LOGO_BMPNR:
|
||||
transfer_pic(3, &vfd_remote_logo_bitmap[0],
|
||||
VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
|
||||
if ((s = getenv ("bitmap1")) != NULL) {
|
||||
addr = (uchar *)simple_strtoul (s, NULL, 16);
|
||||
} else {
|
||||
addr = &vfd_remote_logo_bitmap[0];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("Unknown bitmap %ld\n", bitmap);
|
||||
return 1;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
transfer_pic(3, addr, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_VFD */
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include <cmd_vfd.h> /* load a bitmap to the VFDs on TRAB */
|
||||
#include <cmd_log.h>
|
||||
#include <cmd_fdos.h>
|
||||
#include <cmd_bmp.h>
|
||||
|
||||
#ifdef CONFIG_AMIGAONEG3SE
|
||||
#include <cmd_menu.h>
|
||||
@@ -231,6 +232,7 @@ cmd_tbl_t cmd_tbl[] = {
|
||||
CMD_TBL_AUTOSCRIPT
|
||||
CMD_TBL_BASE
|
||||
CMD_TBL_BDINFO
|
||||
CMD_TBL_BMP
|
||||
#ifdef CONFIG_AMIGAONEG3SE
|
||||
CMD_TBL_BOOTA
|
||||
#endif
|
||||
|
||||
@@ -355,7 +355,7 @@ int console_init_f (void)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef CFG_CONSOLE_IS_IN_ENV
|
||||
#if defined(CFG_CONSOLE_IS_IN_ENV) || defined(CONFIG_SPLASH_SCREEN)
|
||||
/* search a device */
|
||||
device_t *search_device (int flags, char *name)
|
||||
{
|
||||
@@ -374,7 +374,7 @@ device_t *search_device (int flags, char *name)
|
||||
}
|
||||
return dev;
|
||||
}
|
||||
#endif /* CFG_CONSOLE_IS_IN_ENV */
|
||||
#endif /* CFG_CONSOLE_IS_IN_ENV || CONFIG_SPLASH_SCREEN */
|
||||
|
||||
#ifdef CFG_CONSOLE_IS_IN_ENV
|
||||
/* Called after the relocation - use desired console functions */
|
||||
@@ -469,6 +469,11 @@ int console_init_r (void)
|
||||
device_t *inputdev = NULL, *outputdev = NULL;
|
||||
int i, items = ListNumItems (devlist);
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
/* suppress all output if splash screen is enabled */
|
||||
outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
|
||||
#endif
|
||||
|
||||
/* Scan devices looking for input and output devices */
|
||||
for (i = 1;
|
||||
(i <= items) && ((inputdev == NULL) || (outputdev == NULL));
|
||||
|
||||
@@ -37,6 +37,11 @@ list_t devlist = 0;
|
||||
device_t *stdio_devices[] = { NULL, NULL, NULL };
|
||||
char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
|
||||
|
||||
#if defined(CONFIG_SPLASH_SCREEN) && !defined(CFG_DEVICE_NULLDEV)
|
||||
#define CFG_DEVICE_NULLDEV 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CFG_DEVICE_NULLDEV
|
||||
void nulldev_putc(const char c)
|
||||
{
|
||||
|
||||
@@ -880,7 +880,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
#else
|
||||
if (parse_string_outer(arg,
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) == 0)
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
GOT_ENTRY(transfer_to_handler)
|
||||
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(.bss)
|
||||
GOT_ENTRY(__bss_start)
|
||||
END_GOT
|
||||
|
||||
/*
|
||||
@@ -716,7 +716,7 @@ in_ram:
|
||||
/*
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(.bss)
|
||||
lwz r3,GOT(__bss_start)
|
||||
lwz r4,GOT(_end)
|
||||
|
||||
cmplw 0, r3, r4
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
GOT_ENTRY(transfer_to_handler)
|
||||
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(.bss)
|
||||
GOT_ENTRY(__bss_start)
|
||||
END_GOT
|
||||
|
||||
/*
|
||||
@@ -527,7 +527,7 @@ clear_bss:
|
||||
/*
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(.bss)
|
||||
lwz r3,GOT(__bss_start)
|
||||
lwz r4,GOT(_end)
|
||||
cmplw 0, r3, r4
|
||||
beq 6f
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
GOT_ENTRY(transfer_to_handler)
|
||||
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(.bss)
|
||||
GOT_ENTRY(__bss_start)
|
||||
#if defined(CONFIG_FADS)
|
||||
GOT_ENTRY(environment)
|
||||
#endif
|
||||
@@ -665,7 +665,7 @@ clear_bss:
|
||||
/*
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(.bss)
|
||||
lwz r3,GOT(__bss_start)
|
||||
lwz r4,GOT(_end)
|
||||
|
||||
cmplw 0, r3, r4
|
||||
|
||||
@@ -28,7 +28,7 @@ LIB = lib$(CPU).a
|
||||
START = start.o kgdb.o
|
||||
OBJS = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
|
||||
interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
|
||||
bedbug_603e.o status_led.o pci.o
|
||||
bedbug_603e.o status_led.o pci.o spi.o
|
||||
|
||||
all: .depend $(START) $(LIB)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
@@ -22,12 +22,12 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* CPU specific code for the MPC8260
|
||||
* CPU specific code for the MPC8255 / MPC8260 CPUs
|
||||
*
|
||||
* written or collected and sometimes rewritten by
|
||||
* Magnus Damm <damm@bitsmart.com>
|
||||
*
|
||||
* minor modifications by
|
||||
* modified by
|
||||
* Wolfgang Denk <wd@denx.de>
|
||||
*
|
||||
* modified for 8260 by
|
||||
@@ -64,7 +64,7 @@ int checkcpu (void)
|
||||
if ((immr & IMMR_ISB_MSK) != CFG_IMMR)
|
||||
return -1; /* whoops! someone moved the IMMR */
|
||||
|
||||
printf ("MPC8260 (Rev %02x, Mask ", rev);
|
||||
printf (CPU_ID_STR " (Rev %02x, Mask ", rev);
|
||||
|
||||
/*
|
||||
* the bottom 16 bits of the immr are the Part Number and Mask Number
|
||||
@@ -101,6 +101,9 @@ int checkcpu (void)
|
||||
case 0x0060:
|
||||
printf ("A.0(A) 2K25A");
|
||||
break;
|
||||
case 0x0062:
|
||||
printf ("B.1 4K25A");
|
||||
break;
|
||||
default:
|
||||
printf ("unknown [immr=0x%04x,k=0x%04x]", m, k);
|
||||
break;
|
||||
|
||||
@@ -250,7 +250,7 @@ int prt_8260_rsr (void)
|
||||
int i;
|
||||
char *sep;
|
||||
|
||||
puts ("MPC8260 Reset Status:");
|
||||
puts (CPU_ID_STR " Reset Status:");
|
||||
|
||||
sep = " ";
|
||||
for (i = 0; i < n; i++)
|
||||
|
||||
@@ -26,22 +26,30 @@
|
||||
#ifdef CONFIG_PCI
|
||||
|
||||
#include <pci.h>
|
||||
#include <mpc8260.h>
|
||||
#include <asm/m8260_pci.h>
|
||||
|
||||
/*
|
||||
* Local->PCI map (from CPU) controlled by
|
||||
* MPC826x master window
|
||||
*
|
||||
* 0x80000000 - 0xBFFFFFFF Total CPU2PCI space PCIBR0
|
||||
* 0x80000000 - 0xBFFFFFFF CPU2PCI space PCIBR0
|
||||
* 0xF4000000 - 0xF7FFFFFF CPU2PCI space PCIBR1
|
||||
*
|
||||
* 0x80000000 - 0x8FFFFFFF PCI Mem with prefetch (Outbound ATU #1)
|
||||
* 0x90000000 - 0x9FFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)
|
||||
* 0xA0000000 - 0xAFFFFFFF 32-bit PCI IO (Outbound ATU #3)
|
||||
* 0x80000000 - 0x9FFFFFFF 0x80000000 - 0x9FFFFFFF (Outbound ATU #1)
|
||||
* PCI Mem with prefetch
|
||||
*
|
||||
* 0xA0000000 - 0xBFFFFFFF 0xA0000000 - 0xBFFFFFFF (Outbound ATU #2)
|
||||
* PCI Mem w/o prefetch
|
||||
*
|
||||
* 0xF4000000 - 0xF7FFFFFF 0x00000000 - 0x03FFFFFF (Outbound ATU #3)
|
||||
* 32-bit PCI IO
|
||||
*
|
||||
* PCI->Local map (from PCI)
|
||||
* MPC826x slave window controlled by
|
||||
*
|
||||
* 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)
|
||||
* 0x00000000 - 0x1FFFFFFF 0x00000000 - 0x1FFFFFFF (Inbound ATU #1)
|
||||
* MPC826x local memory
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -49,20 +57,57 @@
|
||||
* This window is set up using the first set of Inbound ATU registers
|
||||
*/
|
||||
|
||||
#define PCI_SLV_MEM_LOCAL CFG_SDRAM_BASE /* Local base */
|
||||
#define PCI_SLV_MEM_BUS 0x00000000 /* PCI base */
|
||||
#ifndef CFG_PCI_SLV_MEM_LOCAL
|
||||
#define PCI_SLV_MEM_LOCAL CFG_SDRAM_BASE /* Local base */
|
||||
#else
|
||||
#define PCI_SLV_MEM_LOCAL CFG_PCI_SLV_MEM_LOCAL
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_SLV_MEM_BUS
|
||||
#define PCI_SLV_MEM_BUS 0x00000000 /* PCI base */
|
||||
#else
|
||||
#define PCI_SLV_MEM_BUS CFG_PCI_SLV_MEM_BUS
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PICMR0_MASK_ATTRIB
|
||||
#define PICMR0_MASK_ATTRIB (PICMR_MASK_512MB | PICMR_ENABLE | \
|
||||
PICMR_PREFETCH_EN)
|
||||
#else
|
||||
#define PICMR0_MASK_ATTRIB CFG_PICMR0_MASK_ATTRIB
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is the window that allows the CPU to access PCI address space.
|
||||
* It will be setup with the SIU PCIBR0 register. All three PCI master
|
||||
* windows, which allow the CPU to access PCI prefetch, non prefetch,
|
||||
* and IO space (see below), must all fit within this window.
|
||||
* These are the windows that allow the CPU to access PCI address space.
|
||||
* All three PCI master windows, which allow the CPU to access PCI
|
||||
* prefetch, non prefetch, and IO space (see below), must all fit within
|
||||
* these windows.
|
||||
*/
|
||||
|
||||
#define PCI_MSTR_LOCAL 0x80000000 /* Local base */
|
||||
/* PCIBR0 */
|
||||
#ifndef CFG_PCI_MSTR0_LOCAL
|
||||
#define PCI_MSTR0_LOCAL 0x80000000 /* Local base */
|
||||
#else
|
||||
#define PCI_MSTR0_LOCAL CFG_PCI_MSTR0_LOCAL
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCIMSK0_MASK
|
||||
#define PCIMSK0_MASK PCIMSK_1GB /* Size of window */
|
||||
#else
|
||||
#define PCIMSK0_MASK CFG_PCIMSK0_MASK
|
||||
#endif
|
||||
|
||||
/* PCIBR1 */
|
||||
#ifndef CFG_PCI_MSTR1_LOCAL
|
||||
#define PCI_MSTR1_LOCAL 0xF4000000 /* Local base */
|
||||
#else
|
||||
#define PCI_MSTR1_LOCAL CFG_PCI_MSTR1_LOCAL
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCIMSK1_MASK
|
||||
#define PCIMSK1_MASK PCIMSK_64MB /* Size of window */
|
||||
#else
|
||||
#define PCIMSK1_MASK CFG_PCIMSK1_MASK
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Master window that allows the CPU to access PCI Memory (prefetch).
|
||||
@@ -70,11 +115,35 @@
|
||||
* in the bridge.
|
||||
*/
|
||||
|
||||
#define PCI_MSTR_MEM_LOCAL 0x80000000 /* Local base */
|
||||
#define PCI_MSTR_MEM_BUS 0x80000000 /* PCI base */
|
||||
#define CPU_PCI_MEM_START PCI_MSTR_MEM_LOCAL
|
||||
#define PCI_MSTR_MEM_SIZE 0x10000000 /* 256MB */
|
||||
#ifndef CFG_PCI_MSTR_MEM_LOCAL
|
||||
#define PCI_MSTR_MEM_LOCAL 0x80000000 /* Local base */
|
||||
#else
|
||||
#define PCI_MSTR_MEM_LOCAL CFG_PCI_MSTR_MEM_LOCAL
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_MSTR_MEM_BUS
|
||||
#define PCI_MSTR_MEM_BUS 0x80000000 /* PCI base */
|
||||
#else
|
||||
#define PCI_MSTR_MEM_BUS CFG_PCI_MSTR_MEM_BUS
|
||||
#endif
|
||||
|
||||
#ifndef CFG_CPU_PCI_MEM_START
|
||||
#define CPU_PCI_MEM_START PCI_MSTR_MEM_LOCAL
|
||||
#else
|
||||
#define CPU_PCI_MEM_START CFG_CPU_PCI_MEM_START
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_MSTR_MEM_SIZE
|
||||
#define PCI_MSTR_MEM_SIZE 0x10000000 /* 256MB */
|
||||
#else
|
||||
#define PCI_MSTR_MEM_SIZE CFG_PCI_MSTR_MEM_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_POCMR0_MASK_ATTRIB
|
||||
#define POCMR0_MASK_ATTRIB (POCMR_MASK_256MB | POCMR_ENABLE | POCMR_PREFETCH_EN)
|
||||
#else
|
||||
#define POCMR0_MASK_ATTRIB CFG_POCMR0_MASK_ATTRIB
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Master window that allows the CPU to access PCI Memory (non-prefetch).
|
||||
@@ -82,11 +151,35 @@
|
||||
* in the bridge.
|
||||
*/
|
||||
|
||||
#define PCI_MSTR_MEMIO_LOCAL 0x90000000 /* Local base */
|
||||
#define PCI_MSTR_MEMIO_BUS 0x90000000 /* PCI base */
|
||||
#define CPU_PCI_MEMIO_START PCI_MSTR_MEMIO_LOCAL
|
||||
#define PCI_MSTR_MEMIO_SIZE 0x10000000 /* 256MB */
|
||||
#define POCMR1_MASK_ATTRIB (POCMR_MASK_256MB | POCMR_ENABLE)
|
||||
#ifndef CFG_PCI_MSTR_MEMIO_LOCAL
|
||||
#define PCI_MSTR_MEMIO_LOCAL 0x90000000 /* Local base */
|
||||
#else
|
||||
#define PCI_MSTR_MEMIO_LOCAL CFG_PCI_MSTR_MEMIO_LOCAL
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_MSTR_MEMIO_BUS
|
||||
#define PCI_MSTR_MEMIO_BUS 0x90000000 /* PCI base */
|
||||
#else
|
||||
#define PCI_MSTR_MEMIO_BUS CFG_PCI_MSTR_MEMIO_BUS
|
||||
#endif
|
||||
|
||||
#ifndef CFG_CPU_PCI_MEMIO_START
|
||||
#define CPU_PCI_MEMIO_START PCI_MSTR_MEMIO_LOCAL
|
||||
#else
|
||||
#define CPU_PCI_MEMIO_START CFG_CPU_PCI_MEMIO_START
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_MSTR_MEMIO_SIZE
|
||||
#define PCI_MSTR_MEMIO_SIZE 0x20000000 /* 512MB */
|
||||
#else
|
||||
#define PCI_MSTR_MEMIO_SIZE CFG_PCI_MSTR_MEMIO_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_POCMR1_MASK_ATTRIB
|
||||
#define POCMR1_MASK_ATTRIB (POCMR_MASK_512MB | POCMR_ENABLE)
|
||||
#else
|
||||
#define POCMR1_MASK_ATTRIB CFG_POCMR1_MASK_ATTRIB
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Master window that allows the CPU to access PCI IO space.
|
||||
@@ -94,11 +187,35 @@
|
||||
* in the bridge.
|
||||
*/
|
||||
|
||||
#define PCI_MSTR_IO_LOCAL 0xA0000000 /* Local base */
|
||||
#define PCI_MSTR_IO_BUS 0xA0000000 /* PCI base */
|
||||
#define CPU_PCI_IO_START PCI_MSTR_IO_LOCAL
|
||||
#define PCI_MSTR_IO_SIZE 0x10000000 /* 256MB */
|
||||
#ifndef CFG_PCI_MSTR_IO_LOCAL
|
||||
#define PCI_MSTR_IO_LOCAL 0xA0000000 /* Local base */
|
||||
#else
|
||||
#define PCI_MSTR_IO_LOCAL CFG_PCI_MSTR_IO_LOCAL
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_MSTR_IO_BUS
|
||||
#define PCI_MSTR_IO_BUS 0xA0000000 /* PCI base */
|
||||
#else
|
||||
#define PCI_MSTR_IO_BUS CFG_PCI_MSTR_IO_BUS
|
||||
#endif
|
||||
|
||||
#ifndef CFG_CPU_PCI_IO_START
|
||||
#define CPU_PCI_IO_START PCI_MSTR_IO_LOCAL
|
||||
#else
|
||||
#define CPU_PCI_IO_START CFG_CPU_PCI_IO_START
|
||||
#endif
|
||||
|
||||
#ifndef CFG_PCI_MSTR_IO_SIZE
|
||||
#define PCI_MSTR_IO_SIZE 0x10000000 /* 256MB */
|
||||
#else
|
||||
#define PCI_MSTR_IO_SIZE CFG_PCI_MSTR_IO_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_POCMR2_MASK_ATTRIB
|
||||
#define POCMR2_MASK_ATTRIB (POCMR_MASK_256MB | POCMR_ENABLE | POCMR_PCI_IO)
|
||||
#else
|
||||
#define POCMR2_MASK_ATTRIB CFG_POCMR2_MASK_ATTRIB
|
||||
#endif
|
||||
|
||||
/* PCI bus configuration registers.
|
||||
*/
|
||||
@@ -113,6 +230,9 @@ static inline void pci_outl(u32 addr, u32 data)
|
||||
|
||||
void pci_mpc8250_init(struct pci_controller *hose)
|
||||
{
|
||||
#ifdef CONFIG_MPC8266ADS
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#endif
|
||||
u16 tempShort;
|
||||
u32 immr_addr = CFG_IMMR;
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
@@ -121,11 +241,19 @@ void pci_mpc8250_init(struct pci_controller *hose)
|
||||
pci_setup_indirect(hose, CFG_IMMR + PCI_CFG_ADDR_REG,
|
||||
CFG_IMMR + PCI_CFG_DATA_REG);
|
||||
|
||||
/*
|
||||
* Setting required to enable local bus for PCI (SIUMCR [LBPC]).
|
||||
*/
|
||||
#ifdef CONFIG_MPC8266ADS
|
||||
immap->im_siu_conf.sc_siumcr = (immap->im_siu_conf.sc_siumcr & ~SIUMCR_LBPC11)
|
||||
| SIUMCR_LBPC01;
|
||||
#else
|
||||
/*
|
||||
* Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
|
||||
* and local bus for PCI (SIUMCR [LBPC]).
|
||||
*/
|
||||
immap->im_siu_conf.sc_siumcr = 0x00640000;
|
||||
#endif
|
||||
|
||||
/* Make PCI lowest priority */
|
||||
/* Each 4 bits is a device bus request and the MS 4bits
|
||||
@@ -149,18 +277,33 @@ void pci_mpc8250_init(struct pci_controller *hose)
|
||||
immap->im_siu_conf.sc_ppc_acr = 0x6;
|
||||
|
||||
/*
|
||||
* Set up master window that allows the CPU to access PCI space. This
|
||||
* window is set up using the first SIU PCIBR registers.
|
||||
* Set up master windows that allow the CPU to access PCI space. These
|
||||
* windows are set up using the two SIU PCIBR registers.
|
||||
*/
|
||||
*(volatile unsigned long*)(immr_addr + M8265_PCIMSK0) = PCIMSK0_MASK;
|
||||
*(volatile unsigned long*)(immr_addr + M8265_PCIBR0) =
|
||||
PCI_MSTR_LOCAL | PCIBR_ENABLE;
|
||||
PCI_MSTR0_LOCAL | PCIBR_ENABLE;
|
||||
|
||||
#ifdef CONFIG_MPC8266ADS
|
||||
*(volatile unsigned long*)(immr_addr + M8265_PCIMSK1) = PCIMSK1_MASK;
|
||||
*(volatile unsigned long*)(immr_addr + M8265_PCIBR1) =
|
||||
PCI_MSTR1_LOCAL | PCIBR_ENABLE;
|
||||
#endif
|
||||
|
||||
/* Release PCI RST (by default the PCI RST signal is held low) */
|
||||
pci_outl (immr_addr | PCI_GCR_REG, PCIGCR_PCI_BUS_EN);
|
||||
|
||||
/* give it some time */
|
||||
udelay(1000);
|
||||
{
|
||||
#ifdef CONFIG_MPC8266ADS
|
||||
/* Give the PCI cards more time to initialize before query
|
||||
This might be good for other boards also
|
||||
*/
|
||||
int i;
|
||||
for (i = 0; i < 1000; ++i)
|
||||
#endif
|
||||
udelay(1000);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up master window that allows the CPU to access PCI Memory (prefetch)
|
||||
@@ -214,18 +357,34 @@ void pci_mpc8250_init(struct pci_controller *hose)
|
||||
hose->last_busno = 0xff;
|
||||
|
||||
/* System memory space */
|
||||
#ifdef CONFIG_MPC8266ADS
|
||||
pci_set_region(hose->regions + 0,
|
||||
PCI_SLV_MEM_BUS,
|
||||
PCI_SLV_MEM_LOCAL,
|
||||
gd->ram_size,
|
||||
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||
#else
|
||||
pci_set_region(hose->regions + 0,
|
||||
CFG_SDRAM_BASE,
|
||||
CFG_SDRAM_BASE,
|
||||
0x4000000,
|
||||
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||
#endif
|
||||
|
||||
/* PCI memory space */
|
||||
#ifdef CONFIG_MPC8266ADS
|
||||
pci_set_region(hose->regions + 0,
|
||||
PCI_SLV_MEM_BUS,
|
||||
PCI_SLV_MEM_LOCAL,
|
||||
gd->ram_size,
|
||||
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||
#else
|
||||
pci_set_region(hose->regions + 1,
|
||||
PCI_MSTR_MEM_BUS,
|
||||
PCI_MSTR_MEM_LOCAL,
|
||||
PCI_MSTR_MEM_SIZE,
|
||||
PCI_REGION_MEM);
|
||||
#endif
|
||||
|
||||
/* PCI I/O space */
|
||||
pci_set_region(hose->regions + 2,
|
||||
|
||||
@@ -171,7 +171,7 @@ int prt_8260_clks (void)
|
||||
|
||||
cp = &corecnf_tab[corecnf];
|
||||
|
||||
printf ("MPC8260 Clock Configuration\n - Bus-to-Core Mult ");
|
||||
printf (CPU_ID_STR " Clock Configuration\n - Bus-to-Core Mult ");
|
||||
|
||||
switch (cp->b2c_mult) {
|
||||
case _byp:
|
||||
|
||||
435
cpu/mpc8260/spi.c
Normal file
435
cpu/mpc8260/spi.c
Normal file
@@ -0,0 +1,435 @@
|
||||
/*
|
||||
* Copyright (c) 2001 Navin Boppuri / Prashant Patel
|
||||
* <nboppuri@trinetcommunication.com>,
|
||||
* <pmpatel@trinetcommunication.com>
|
||||
* Copyright (c) 2001 Gerd Mennchen <Gerd.Mennchen@icn.siemens.de>
|
||||
* Copyright (c) 2001-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
|
||||
*/
|
||||
|
||||
/*
|
||||
* MPC8260 CPM SPI interface.
|
||||
*
|
||||
* Parts of this code are probably not portable and/or specific to
|
||||
* the board which I used for the tests. Please send fixes/complaints
|
||||
* to wd@denx.de
|
||||
*
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/cpm_8260.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <malloc.h>
|
||||
#include <post.h>
|
||||
#include <net.h>
|
||||
|
||||
#if defined(CONFIG_SPI)
|
||||
|
||||
/* Warning:
|
||||
* You cannot enable DEBUG for early system initalization, i. e. when
|
||||
* this driver is used to read environment parameters like "baudrate"
|
||||
* from EEPROM which are used to initialize the serial port which is
|
||||
* needed to print the debug messages...
|
||||
*/
|
||||
#undef DEBUG
|
||||
|
||||
#define SPI_EEPROM_WREN 0x06
|
||||
#define SPI_EEPROM_RDSR 0x05
|
||||
#define SPI_EEPROM_READ 0x03
|
||||
#define SPI_EEPROM_WRITE 0x02
|
||||
|
||||
/* ---------------------------------------------------------------
|
||||
* Offset for initial SPI buffers in DPRAM:
|
||||
* We need a 520 byte scratch DPRAM area to use at an early stage.
|
||||
* It is used between the two initialization calls (spi_init_f()
|
||||
* and spi_init_r()).
|
||||
* The value 0x2000 makes it far enough from the start of the data
|
||||
* area (as well as from the stack pointer).
|
||||
* --------------------------------------------------------------- */
|
||||
#ifndef CFG_SPI_INIT_OFFSET
|
||||
#define CFG_SPI_INIT_OFFSET 0x2000
|
||||
#endif
|
||||
|
||||
#define CPM_SPI_BASE 0x100
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#define DPRINT(a) printf a;
|
||||
/* -----------------------------------------------
|
||||
* Helper functions to peek into tx and rx buffers
|
||||
* ----------------------------------------------- */
|
||||
static const char * const hex_digit = "0123456789ABCDEF";
|
||||
|
||||
static char quickhex (int i)
|
||||
{
|
||||
return hex_digit[i];
|
||||
}
|
||||
|
||||
static void memdump (void *pv, int num)
|
||||
{
|
||||
int i;
|
||||
unsigned char *pc = (unsigned char *) pv;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
printf ("%c%c ", quickhex (pc[i] >> 4), quickhex (pc[i] & 0x0f));
|
||||
printf ("\t");
|
||||
for (i = 0; i < num; i++)
|
||||
printf ("%c", isprint (pc[i]) ? pc[i] : '.');
|
||||
printf ("\n");
|
||||
}
|
||||
#else /* !DEBUG */
|
||||
|
||||
#define DPRINT(a)
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
/* -------------------
|
||||
* Function prototypes
|
||||
* ------------------- */
|
||||
void spi_init (void);
|
||||
|
||||
ssize_t spi_read (uchar *, int, uchar *, int);
|
||||
ssize_t spi_write (uchar *, int, uchar *, int);
|
||||
ssize_t spi_xfer (size_t);
|
||||
|
||||
/* -------------------
|
||||
* Variables
|
||||
* ------------------- */
|
||||
|
||||
#define MAX_BUFFER 0x104
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* Initially we place the RX and TX buffers at a fixed location in DPRAM!
|
||||
* ---------------------------------------------------------------------- */
|
||||
static uchar *rxbuf =
|
||||
(uchar *)&((immap_t *)CFG_IMMR)->im_dprambase
|
||||
[CFG_SPI_INIT_OFFSET];
|
||||
static uchar *txbuf =
|
||||
(uchar *)&((immap_t *)CFG_IMMR)->im_dprambase
|
||||
[CFG_SPI_INIT_OFFSET+MAX_BUFFER];
|
||||
|
||||
/* **************************************************************************
|
||||
*
|
||||
* Function: spi_init_f
|
||||
*
|
||||
* Description: Init SPI-Controller (ROM part)
|
||||
*
|
||||
* return: ---
|
||||
*
|
||||
* *********************************************************************** */
|
||||
void spi_init_f (void)
|
||||
{
|
||||
unsigned int dpaddr;
|
||||
|
||||
volatile spi_t *spi;
|
||||
volatile immap_t *immr;
|
||||
volatile cpm8260_t *cp;
|
||||
volatile cbd_t *tbdf, *rbdf;
|
||||
|
||||
immr = (immap_t *) CFG_IMMR;
|
||||
cp = (cpm8260_t *) &immr->im_cpm;
|
||||
|
||||
*(ushort *)(&immr->im_dprambase[PROFF_SPI_BASE]) = PROFF_SPI;
|
||||
spi = (spi_t *)&immr->im_dprambase[PROFF_SPI];
|
||||
|
||||
/* 1 */
|
||||
/* ------------------------------------------------
|
||||
* Initialize Port D SPI pins
|
||||
* (we are only in Master Mode !)
|
||||
* ------------------------------------------------ */
|
||||
|
||||
/* --------------------------------------------
|
||||
* GPIO or per. Function
|
||||
* PPARD[16] = 1 [0x00008000] (SPIMISO)
|
||||
* PPARD[17] = 1 [0x00004000] (SPIMOSI)
|
||||
* PPARD[18] = 1 [0x00002000] (SPICLK)
|
||||
* PPARD[12] = 0 [0x00080000] -> GPIO: (CS for ATC EEPROM)
|
||||
* -------------------------------------------- */
|
||||
immr->im_ioport.iop_ppard |= 0x0000E000; /* set bits */
|
||||
immr->im_ioport.iop_ppard &= ~0x00080000; /* reset bit */
|
||||
|
||||
/* ----------------------------------------------
|
||||
* In/Out or per. Function 0/1
|
||||
* PDIRD[16] = 0 [0x00008000] -> PERI1: SPIMISO
|
||||
* PDIRD[17] = 0 [0x00004000] -> PERI1: SPIMOSI
|
||||
* PDIRD[18] = 0 [0x00002000] -> PERI1: SPICLK
|
||||
* PDIRD[12] = 1 [0x00080000] -> GPIO OUT: CS for ATC EEPROM
|
||||
* ---------------------------------------------- */
|
||||
immr->im_ioport.iop_pdird &= ~0x0000E000;
|
||||
immr->im_ioport.iop_pdird |= 0x00080000;
|
||||
|
||||
/* ----------------------------------------------
|
||||
* special option reg.
|
||||
* PSORD[16] = 1 [0x00008000] -> SPIMISO
|
||||
* PSORD[17] = 1 [0x00004000] -> SPIMOSI
|
||||
* PSORD[18] = 1 [0x00002000] -> SPICLK
|
||||
* ---------------------------------------------- */
|
||||
immr->im_ioport.iop_psord |= 0x0000E000;
|
||||
|
||||
/* Initialize the parameter ram.
|
||||
* We need to make sure many things are initialized to zero
|
||||
*/
|
||||
spi->spi_rstate = 0;
|
||||
spi->spi_rdp = 0;
|
||||
spi->spi_rbptr = 0;
|
||||
spi->spi_rbc = 0;
|
||||
spi->spi_rxtmp = 0;
|
||||
spi->spi_tstate = 0;
|
||||
spi->spi_tdp = 0;
|
||||
spi->spi_tbptr = 0;
|
||||
spi->spi_tbc = 0;
|
||||
spi->spi_txtmp = 0;
|
||||
|
||||
/* Allocate space for one transmit and one receive buffer
|
||||
* descriptor in the DP ram
|
||||
*/
|
||||
#ifdef CFG_ALLOC_DPRAM
|
||||
dpaddr = m8260_cpm_dpalloc (sizeof(cbd_t)*2, 8);
|
||||
#else
|
||||
dpaddr = CPM_SPI_BASE;
|
||||
#endif
|
||||
|
||||
/* 3 */
|
||||
/* Set up the SPI parameters in the parameter ram */
|
||||
spi->spi_rbase = dpaddr;
|
||||
spi->spi_tbase = dpaddr + sizeof (cbd_t);
|
||||
|
||||
/***********IMPORTANT******************/
|
||||
|
||||
/*
|
||||
* Setting transmit and receive buffer descriptor pointers
|
||||
* initially to rbase and tbase. Only the microcode patches
|
||||
* documentation talks about initializing this pointer. This
|
||||
* is missing from the sample I2C driver. If you dont
|
||||
* initialize these pointers, the kernel hangs.
|
||||
*/
|
||||
spi->spi_rbptr = spi->spi_rbase;
|
||||
spi->spi_tbptr = spi->spi_tbase;
|
||||
|
||||
/* 4 */
|
||||
/* Init SPI Tx + Rx Parameters */
|
||||
while (cp->cp_cpcr & CPM_CR_FLG)
|
||||
;
|
||||
cp->cp_cpcr = mk_cr_cmd(CPM_CR_SPI_PAGE, CPM_CR_SPI_SBLOCK,
|
||||
0, CPM_CR_INIT_TRX) | CPM_CR_FLG;
|
||||
while (cp->cp_cpcr & CPM_CR_FLG)
|
||||
;
|
||||
|
||||
/* 6 */
|
||||
/* Set to big endian. */
|
||||
spi->spi_tfcr = CPMFCR_EB;
|
||||
spi->spi_rfcr = CPMFCR_EB;
|
||||
|
||||
/* 7 */
|
||||
/* Set maximum receive size. */
|
||||
spi->spi_mrblr = MAX_BUFFER;
|
||||
|
||||
/* 8 + 9 */
|
||||
/* tx and rx buffer descriptors */
|
||||
tbdf = (cbd_t *) & immr->im_dprambase[spi->spi_tbase];
|
||||
rbdf = (cbd_t *) & immr->im_dprambase[spi->spi_rbase];
|
||||
|
||||
tbdf->cbd_sc &= ~BD_SC_READY;
|
||||
rbdf->cbd_sc &= ~BD_SC_EMPTY;
|
||||
|
||||
/* Set the bd's rx and tx buffer address pointers */
|
||||
rbdf->cbd_bufaddr = (ulong) rxbuf;
|
||||
tbdf->cbd_bufaddr = (ulong) txbuf;
|
||||
|
||||
/* 10 + 11 */
|
||||
immr->im_spi.spi_spie = SPI_EMASK; /* Clear all SPI events */
|
||||
immr->im_spi.spi_spim = 0x00; /* Mask all SPI events */
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* **************************************************************************
|
||||
*
|
||||
* Function: spi_init_r
|
||||
*
|
||||
* Description: Init SPI-Controller (RAM part) -
|
||||
* The malloc engine is ready and we can move our buffers to
|
||||
* normal RAM
|
||||
*
|
||||
* return: ---
|
||||
*
|
||||
* *********************************************************************** */
|
||||
void spi_init_r (void)
|
||||
{
|
||||
volatile spi_t *spi;
|
||||
volatile immap_t *immr;
|
||||
volatile cpm8260_t *cp;
|
||||
volatile cbd_t *tbdf, *rbdf;
|
||||
|
||||
immr = (immap_t *) CFG_IMMR;
|
||||
cp = (cpm8260_t *) &immr->im_cpm;
|
||||
|
||||
spi = (spi_t *)&immr->im_dprambase[PROFF_SPI];
|
||||
|
||||
/* tx and rx buffer descriptors */
|
||||
tbdf = (cbd_t *) & immr->im_dprambase[spi->spi_tbase];
|
||||
rbdf = (cbd_t *) & immr->im_dprambase[spi->spi_rbase];
|
||||
|
||||
/* Allocate memory for RX and TX buffers */
|
||||
rxbuf = (uchar *) malloc (MAX_BUFFER);
|
||||
txbuf = (uchar *) malloc (MAX_BUFFER);
|
||||
|
||||
rbdf->cbd_bufaddr = (ulong) rxbuf;
|
||||
tbdf->cbd_bufaddr = (ulong) txbuf;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: spi_write
|
||||
**************************************************************************** */
|
||||
ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
memset(rxbuf, 0, MAX_BUFFER);
|
||||
memset(txbuf, 0, MAX_BUFFER);
|
||||
*txbuf = SPI_EEPROM_WREN; /* write enable */
|
||||
spi_xfer(1);
|
||||
memcpy(txbuf, addr, alen);
|
||||
*txbuf = SPI_EEPROM_WRITE; /* WRITE memory array */
|
||||
memcpy(alen + txbuf, buffer, len);
|
||||
spi_xfer(alen + len);
|
||||
/* ignore received data */
|
||||
for (i = 0; i < 1000; i++) {
|
||||
*txbuf = SPI_EEPROM_RDSR; /* read status */
|
||||
txbuf[1] = 0;
|
||||
spi_xfer(2);
|
||||
if (!(rxbuf[1] & 1)) {
|
||||
break;
|
||||
}
|
||||
udelay(1000);
|
||||
}
|
||||
if (i >= 1000) {
|
||||
printf ("*** spi_write: Time out while writing!\n");
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: spi_read
|
||||
**************************************************************************** */
|
||||
ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int len)
|
||||
{
|
||||
memset(rxbuf, 0, MAX_BUFFER);
|
||||
memset(txbuf, 0, MAX_BUFFER);
|
||||
memcpy(txbuf, addr, alen);
|
||||
*txbuf = SPI_EEPROM_READ; /* READ memory array */
|
||||
|
||||
/*
|
||||
* There is a bug in 860T (?) that cuts the last byte of input
|
||||
* if we're reading into DPRAM. The solution we choose here is
|
||||
* to always read len+1 bytes (we have one extra byte at the
|
||||
* end of the buffer).
|
||||
*/
|
||||
spi_xfer(alen + len + 1);
|
||||
memcpy(buffer, alen + rxbuf, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: spi_xfer
|
||||
**************************************************************************** */
|
||||
ssize_t spi_xfer (size_t count)
|
||||
{
|
||||
volatile immap_t *immr;
|
||||
volatile cpm8260_t *cp;
|
||||
volatile spi_t *spi;
|
||||
cbd_t *tbdf, *rbdf;
|
||||
int tm;
|
||||
|
||||
DPRINT (("*** spi_xfer entered ***\n"));
|
||||
|
||||
immr = (immap_t *) CFG_IMMR;
|
||||
cp = (cpm8260_t *) &immr->im_cpm;
|
||||
|
||||
spi = (spi_t *)&immr->im_dprambase[PROFF_SPI];
|
||||
|
||||
tbdf = (cbd_t *) & immr->im_dprambase[spi->spi_tbase];
|
||||
rbdf = (cbd_t *) & immr->im_dprambase[spi->spi_rbase];
|
||||
|
||||
/* Board-specific: Set CS for device (ATC EEPROM) */
|
||||
immr->im_ioport.iop_pdatd &= ~0x00080000;
|
||||
|
||||
/* Setting tx bd status and data length */
|
||||
tbdf->cbd_sc = BD_SC_READY | BD_SC_LAST | BD_SC_WRAP;
|
||||
tbdf->cbd_datlen = count;
|
||||
|
||||
DPRINT (("*** spi_xfer: Bytes to be xferred: %d ***\n",
|
||||
tbdf->cbd_datlen));
|
||||
|
||||
/* Setting rx bd status and data length */
|
||||
rbdf->cbd_sc = BD_SC_EMPTY | BD_SC_WRAP;
|
||||
rbdf->cbd_datlen = 0; /* rx length has no significance */
|
||||
|
||||
immr->im_spi.spi_spmode = SPMODE_REV |
|
||||
SPMODE_MSTR |
|
||||
SPMODE_EN |
|
||||
SPMODE_LEN(8) | /* 8 Bits per char */
|
||||
SPMODE_PM(0x8) ; /* medium speed */
|
||||
immr->im_spi.spi_spie = SPI_EMASK; /* Clear all SPI events */
|
||||
immr->im_spi.spi_spim = 0x00; /* Mask all SPI events */
|
||||
|
||||
/* start spi transfer */
|
||||
DPRINT (("*** spi_xfer: Performing transfer ...\n"));
|
||||
immr->im_spi.spi_spcom |= SPI_STR; /* Start transmit */
|
||||
|
||||
/* --------------------------------
|
||||
* Wait for SPI transmit to get out
|
||||
* or time out (1 second = 1000 ms)
|
||||
* -------------------------------- */
|
||||
for (tm=0; tm<1000; ++tm) {
|
||||
if (immr->im_spi.spi_spie & SPI_TXB) { /* Tx Buffer Empty */
|
||||
DPRINT (("*** spi_xfer: Tx buffer empty\n"));
|
||||
break;
|
||||
}
|
||||
if ((tbdf->cbd_sc & BD_SC_READY) == 0) {
|
||||
DPRINT (("*** spi_xfer: Tx BD done\n"));
|
||||
break;
|
||||
}
|
||||
udelay (1000);
|
||||
}
|
||||
if (tm >= 1000) {
|
||||
printf ("*** spi_xfer: Time out while xferring to/from SPI!\n");
|
||||
}
|
||||
DPRINT (("*** spi_xfer: ... transfer ended\n"));
|
||||
|
||||
#ifdef DEBUG
|
||||
printf ("\nspi_xfer: txbuf after xfer\n");
|
||||
memdump ((void *) txbuf, 16); /* dump of txbuf before transmit */
|
||||
printf ("spi_xfer: rxbuf after xfer\n");
|
||||
memdump ((void *) rxbuf, 16); /* dump of rxbuf after transmit */
|
||||
printf ("\n");
|
||||
#endif
|
||||
|
||||
/* Clear CS for device */
|
||||
immr->im_ioport.iop_pdatd |= 0x00080000;
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif /* CONFIG_SPI */
|
||||
@@ -67,7 +67,7 @@
|
||||
GOT_ENTRY(transfer_to_handler)
|
||||
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(.bss)
|
||||
GOT_ENTRY(__bss_start)
|
||||
#if defined(CONFIG_HYMOD)
|
||||
GOT_ENTRY(environment)
|
||||
#endif
|
||||
@@ -987,7 +987,7 @@ clear_bss:
|
||||
/*
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(.bss)
|
||||
lwz r3,GOT(__bss_start)
|
||||
#if defined(CONFIG_HYMOD)
|
||||
/*
|
||||
* For HYMOD - the environment is the very last item in flash.
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <bedbug/regs.h>
|
||||
#include <bedbug/ppc.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) && defined(CONFIG_MPC860)
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) && defined(CONFIG_8xx)
|
||||
|
||||
#define MAX_BREAK_POINTS 2
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ static char *cpu_warning = "\n " \
|
||||
|
||||
#if ((defined(CONFIG_MPC860) || defined(CONFIG_MPC855)) && \
|
||||
!defined(CONFIG_MPC862))
|
||||
# ifdef CONFIG_MPC855
|
||||
# ifdef CONFIG_MPC855
|
||||
# define ID_STR "PC855"
|
||||
# else
|
||||
# define ID_STR "PC860"
|
||||
|
||||
173
cpu/mpc8xx/lcd.c
173
cpu/mpc8xx/lcd.c
@@ -27,11 +27,15 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <version.h>
|
||||
#include <stdarg.h>
|
||||
#include <lcdvideo.h>
|
||||
#include <linux/types.h>
|
||||
#include <devices.h>
|
||||
#if defined(CONFIG_POST)
|
||||
#include <post.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
@@ -39,12 +43,10 @@
|
||||
/************************************************************************/
|
||||
/* ** CONFIG STUFF -- should be moved to board config file */
|
||||
/************************************************************************/
|
||||
#ifndef CONFIG_EDT32F10
|
||||
#define CONFIG_LCD_LOGO
|
||||
#define LCD_INFO /* Display Logo, (C) and system info */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_V37
|
||||
#if defined(CONFIG_V37) || defined(CONFIG_EDT32F10)
|
||||
#undef CONFIG_LCD_LOGO
|
||||
#undef LCD_INFO
|
||||
#endif
|
||||
@@ -53,6 +55,14 @@
|
||||
/* #define CFG_INVERT_COLORS */ /* Not needed - adjust vl_dp instead */
|
||||
/************************************************************************/
|
||||
|
||||
/************************************************************************/
|
||||
/* ** BITMAP DISPLAY SUPPORT -- should probably be moved elsewhere */
|
||||
/************************************************************************/
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
#include <bmp_layout.h>
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */
|
||||
|
||||
/************************************************************************/
|
||||
/* ** FONT AND LOGO DATA */
|
||||
/************************************************************************/
|
||||
@@ -177,6 +187,8 @@ static vidinfo_t panel_info = {
|
||||
/*
|
||||
* Sharp LQ057Q3DC02 display. Active, color, single scan.
|
||||
*/
|
||||
#define LCD_DF 12
|
||||
|
||||
static vidinfo_t panel_info = {
|
||||
320, 240, 0, 0, CFG_HIGH, CFG_HIGH, CFG_LOW, CFG_LOW, CFG_HIGH,
|
||||
3, 0, 0, 1, 1, 15, 4, 0, 3
|
||||
@@ -260,11 +272,11 @@ static vidinfo_t panel_info = {
|
||||
* Emerging Display Technologies 320x240. Passive, monochrome, single scan.
|
||||
*/
|
||||
#define LCD_BPP LCD_MONOCHROME
|
||||
#define LCD_DF 20
|
||||
#define LCD_DF 10
|
||||
|
||||
static vidinfo_t panel_info = {
|
||||
320, 240, 0, 0, CFG_HIGH, CFG_HIGH, CFG_HIGH, CFG_HIGH, CFG_LOW,
|
||||
LCD_BPP, 0, 0, 0, 0, 0, 15, 0, 0
|
||||
LCD_BPP, 0, 0, 0, 0, 33, 0, 0, 0
|
||||
};
|
||||
#endif
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -974,18 +986,25 @@ static void lcd_enable (void)
|
||||
|
||||
#if defined(CONFIG_LWMON)
|
||||
{ uchar c = pic_read (0x60);
|
||||
#if defined(CONFIG_LCD) && defined(CONFIG_LWMON) && (CONFIG_POST & CFG_POST_SYSMON)
|
||||
c |= 0x04; /* Chip Enable LCD */
|
||||
#else
|
||||
c |= 0x07; /* Power on CCFL, Enable CCFL, Chip Enable LCD */
|
||||
#endif
|
||||
pic_write (0x60, c);
|
||||
}
|
||||
#elif defined(CONFIG_R360MPI)
|
||||
{
|
||||
extern void r360_pwm_write (uchar reg, uchar val);
|
||||
|
||||
r360_pwm_write(8, 1);
|
||||
r360_pwm_write(0, 4);
|
||||
r360_pwm_write(1, 6);
|
||||
}
|
||||
#endif /* CONFIG_LWMON */
|
||||
|
||||
#if defined(CONFIG_R360MPI)
|
||||
{
|
||||
extern void r360_i2c_lcd_write (uchar data0, uchar data1);
|
||||
|
||||
r360_i2c_lcd_write(0x10, 0x01);
|
||||
r360_i2c_lcd_write(0x20, 0x01);
|
||||
r360_i2c_lcd_write(0x3F, 0xFF);
|
||||
r360_i2c_lcd_write(0x47, 0xFF);
|
||||
}
|
||||
#endif /* CONFIG_R360MPI */
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -1003,10 +1022,12 @@ static void lcd_disable (void)
|
||||
}
|
||||
#elif defined(CONFIG_R360MPI)
|
||||
{
|
||||
extern void r360_pwm_write (uchar reg, uchar val);
|
||||
extern void r360_i2c_lcd_write (uchar data0, uchar data1);
|
||||
|
||||
r360_pwm_write(0, 0);
|
||||
r360_pwm_write(1, 0);
|
||||
r360_i2c_lcd_write(0x10, 0x00);
|
||||
r360_i2c_lcd_write(0x20, 0x00);
|
||||
r360_i2c_lcd_write(0x30, 0x00);
|
||||
r360_i2c_lcd_write(0x40, 0x00);
|
||||
}
|
||||
#endif /* CONFIG_LWMON */
|
||||
/* Disable the LCD panel */
|
||||
@@ -1039,6 +1060,8 @@ static void bitmap_plot (int x, int y)
|
||||
/* Leave room for default color map */
|
||||
cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]);
|
||||
|
||||
WATCHDOG_RESET();
|
||||
|
||||
/* Set color map */
|
||||
for (i=0; i<(sizeof(bmp_logo_palette)/(sizeof(ushort))); ++i) {
|
||||
ushort colreg = bmp_logo_palette[i];
|
||||
@@ -1051,14 +1074,117 @@ static void bitmap_plot (int x, int y)
|
||||
bmap = &bmp_logo_bitmap[0];
|
||||
fb = (char *)(lcd_base + y * lcd_line_length + x);
|
||||
|
||||
WATCHDOG_RESET();
|
||||
|
||||
for (i=0; i<BMP_LOGO_HEIGHT; ++i) {
|
||||
memcpy (fb, bmap, BMP_LOGO_WIDTH);
|
||||
bmap += BMP_LOGO_WIDTH;
|
||||
fb += panel_info.vl_col;
|
||||
}
|
||||
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
#endif /* CONFIG_LCD_LOGO */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
/*
|
||||
* Display the BMP file located at address bmp_image.
|
||||
* Only uncompressed
|
||||
*/
|
||||
int lcd_display_bitmap(ulong bmp_image)
|
||||
{
|
||||
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
volatile cpm8xx_t *cp = &(immr->im_cpm);
|
||||
ushort *cmap;
|
||||
ushort i, j;
|
||||
uchar *fb;
|
||||
bmp_image_t *bmp=(bmp_image_t *)bmp_image;
|
||||
uchar *bmap;
|
||||
ushort padded_line;
|
||||
unsigned long width, height;
|
||||
unsigned colors,bpix;
|
||||
unsigned long compression;
|
||||
|
||||
WATCHDOG_RESET();
|
||||
|
||||
if (!((bmp->header.signature[0]=='B') &&
|
||||
(bmp->header.signature[1]=='M'))) {
|
||||
printf ("Error: no valid bmp image at %lx\n", bmp_image);
|
||||
return 1;
|
||||
}
|
||||
|
||||
width = le32_to_cpu (bmp->header.width);
|
||||
height = le32_to_cpu (bmp->header.height);
|
||||
colors = 1<<le16_to_cpu (bmp->header.bit_count);
|
||||
compression = le32_to_cpu (bmp->header.compression);
|
||||
|
||||
bpix = NBITS(panel_info.vl_bpix);
|
||||
|
||||
if ((bpix != 1) && (bpix != 8)) {
|
||||
printf ("Error: %d bit/pixel mode not supported by U-Boot\n",
|
||||
bpix);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (bpix != le16_to_cpu(bmp->header.bit_count)) {
|
||||
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
|
||||
bpix,
|
||||
le16_to_cpu(bmp->header.bit_count));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (compression!=BMP_BI_RGB) {
|
||||
printf ("Error: compression type %ld not supported\n",
|
||||
compression);
|
||||
return 1;
|
||||
}
|
||||
|
||||
debug ("Display-bmp: %d x %d with %d colors\n",
|
||||
width, height, colors);
|
||||
|
||||
if (bpix==8) {
|
||||
/* Fill the entire color map */
|
||||
cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
|
||||
|
||||
/* Set color map */
|
||||
for (i = 0; i < colors; ++i) {
|
||||
bmp_color_table_entry_t cte = bmp->color_table[i];
|
||||
ushort colreg =
|
||||
((cte.red>>4) << 8) |
|
||||
((cte.green>>4) << 4) |
|
||||
(cte.blue>>4) ;
|
||||
#ifdef CFG_INVERT_COLORS
|
||||
colreg ^= 0xFFF;
|
||||
#endif
|
||||
*cmap-- = colreg;
|
||||
}
|
||||
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
|
||||
padded_line = (width&0x3) ? ((width&~0x3)+4) : (width);
|
||||
if (width>panel_info.vl_col)
|
||||
width = panel_info.vl_col;
|
||||
if (height>panel_info.vl_row)
|
||||
height = panel_info.vl_row;
|
||||
|
||||
bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset);
|
||||
fb = (uchar *)
|
||||
(lcd_base +
|
||||
(((height>=panel_info.vl_row) ? panel_info.vl_row : height)-1)
|
||||
* lcd_line_length);
|
||||
for (i = 0; i < height; ++i) {
|
||||
WATCHDOG_RESET();
|
||||
for (j = 0; j < width ; j++)
|
||||
*(fb++)=255-*(bmap++);
|
||||
bmap += (width - padded_line);
|
||||
fb -= (width + lcd_line_length);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
static void *lcd_logo (void)
|
||||
@@ -1070,6 +1196,19 @@ static void *lcd_logo (void)
|
||||
char temp[32];
|
||||
#endif /* LCD_INFO */
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
char *s;
|
||||
ulong addr;
|
||||
|
||||
if ((s = getenv("splashimage")) != NULL) {
|
||||
addr = simple_strtoul(s, NULL, 16);
|
||||
|
||||
if (lcd_display_bitmap (addr) == 0) {
|
||||
return ((void *)lcd_base);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_SPLASH_SCREEN */
|
||||
|
||||
#ifdef CONFIG_LCD_LOGO
|
||||
bitmap_plot (0, 0);
|
||||
#endif /* CONFIG_LCD_LOGO */
|
||||
@@ -1079,7 +1218,7 @@ static void *lcd_logo (void)
|
||||
sprintf (info, "%s (%s - %s) ", U_BOOT_VERSION, __DATE__, __TIME__);
|
||||
lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, info, strlen(info));
|
||||
|
||||
sprintf (info, "(C) 2002 DENX Software Engineering");
|
||||
sprintf (info, "(C) 2003 DENX Software Engineering");
|
||||
lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT,
|
||||
info, strlen(info));
|
||||
|
||||
|
||||
@@ -246,6 +246,20 @@ serial_setbrg (void)
|
||||
(((gd->cpu_clk / 16 / gd->baudrate)-1) << 1) | CPM_BRG_EN;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
void disable_putc(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
gd->be_quiet = 1;
|
||||
}
|
||||
|
||||
void enable_putc(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
gd->be_quiet = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
serial_putc(const char c)
|
||||
{
|
||||
@@ -255,6 +269,13 @@ serial_putc(const char c)
|
||||
volatile immap_t *im = (immap_t *)CFG_IMMR;
|
||||
volatile cpm8xx_t *cpmp = &(im->im_cpm);
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
if (gd->be_quiet)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (c == '\n')
|
||||
serial_putc ('\r');
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
GOT_ENTRY(transfer_to_handler)
|
||||
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(.bss)
|
||||
GOT_ENTRY(__bss_start)
|
||||
#if defined(CONFIG_FADS) || defined(CONFIG_ICU862)
|
||||
GOT_ENTRY(environment)
|
||||
#endif
|
||||
@@ -684,7 +684,7 @@ clear_bss:
|
||||
/*
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(.bss)
|
||||
lwz r3,GOT(__bss_start)
|
||||
#if defined(CONFIG_FADS) || defined(CONFIG_ICU862)
|
||||
/*
|
||||
* For the FADS - the environment is the very last item in flash.
|
||||
|
||||
@@ -289,7 +289,7 @@ long int spd_sdram(int(read_spd)(uint addr))
|
||||
/* now check for ECC ability of module. We only support ECC
|
||||
* on 32 bit wide devices with 8 bit ECC.
|
||||
*/
|
||||
if ( (read_spd(11)==2) && ((read_spd(6)==40) || (read_spd(14)==8)) ){
|
||||
if ( (read_spd(11)==2) && (read_spd(6)==40) && (read_spd(14)==8) ){
|
||||
sdram0_ecccfg=0xf<<SDRAM0_ECCCFG_SHIFT;
|
||||
ecc_on = 1;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
GOT_ENTRY(transfer_to_handler)
|
||||
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(.bss)
|
||||
GOT_ENTRY(__bss_start)
|
||||
END_GOT
|
||||
|
||||
/*
|
||||
@@ -1339,7 +1339,7 @@ clear_bss:
|
||||
/*
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(.bss)
|
||||
lwz r3,GOT(__bss_start)
|
||||
lwz r4,GOT(_end)
|
||||
|
||||
cmplw 0, r3, r4
|
||||
|
||||
@@ -169,7 +169,9 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
|
||||
* fdisk does not show the extended partitions that
|
||||
* are not in the MBR
|
||||
*/
|
||||
if (pt->sys_ind != 0 && part_num == which_part) {
|
||||
if ((pt->sys_ind != 0) &&
|
||||
(part_num == which_part) &&
|
||||
(is_extended(pt->sys_ind) == 0)) {
|
||||
info->blksz = 512;
|
||||
info->start = ext_part_sector + le32_to_int (pt->start4);
|
||||
info->size = le32_to_int (pt->size4);
|
||||
|
||||
@@ -3,12 +3,36 @@ Installation Instructions:
|
||||
|
||||
1. Put the s2 switch into the following position:
|
||||
|
||||
1 0
|
||||
Off On
|
||||
------
|
||||
|x |
|
||||
| x|
|
||||
|x |
|
||||
| X|
|
||||
|x |
|
||||
| X|
|
||||
------
|
||||
|
||||
Put the s3 switch into the following position:
|
||||
|
||||
Off On
|
||||
------
|
||||
| x |
|
||||
| x |
|
||||
| x|
|
||||
| x|
|
||||
------
|
||||
|
||||
Put the s4 switch into the following position:
|
||||
|
||||
Off On
|
||||
------
|
||||
|x |
|
||||
|x |
|
||||
|x |
|
||||
|x |
|
||||
|x |
|
||||
| x|
|
||||
| x|
|
||||
|x |
|
||||
------
|
||||
|
||||
2. Connect to the serial console and to the BDI. Power on. On the
|
||||
@@ -34,8 +58,17 @@ Installation Instructions:
|
||||
|
||||
prog 0xB0000000 <u-boot.bin> bin
|
||||
|
||||
6. Power off. Restore the original S2 switch position. Power on.
|
||||
U-Boot should come up.
|
||||
6. Power off. Restore the original S2 switch position:
|
||||
|
||||
Off On
|
||||
------
|
||||
| x|
|
||||
| x|
|
||||
|x |
|
||||
| X|
|
||||
------
|
||||
|
||||
Power on. U-Boot should come up.
|
||||
|
||||
|
||||
|
||||
@@ -48,5 +81,5 @@ can't really check whether 'erase' is complete by polling flash as it
|
||||
is usually done. Instead, the flash driver simply waits for a given
|
||||
time and assumes that erase then has passed. This behaviour is
|
||||
identical to what the VxWorks driver does; also, the same timeout (6
|
||||
seconds) was chosen. Note that this timeout applies for each errase
|
||||
seconds) was chosen. Note that this timeout applies for each erase
|
||||
operation, i. e. per erased sector.
|
||||
|
||||
@@ -15,6 +15,7 @@ as 2
|
||||
autoscr 5
|
||||
base 2
|
||||
bdinfo 2
|
||||
bmp 3
|
||||
bootelf 7
|
||||
bootm 5
|
||||
bootp 5
|
||||
|
||||
@@ -30,8 +30,8 @@ LIB = libdrivers.a
|
||||
OBJS = 3c589.o 5701rls.o at91rm9200_ether.o \
|
||||
bcm570x.o bcm570x_autoneg.o \
|
||||
cfb_console.o cs8900.o ct69000.o dc2114x.o \
|
||||
eepro100.o i8042.o inca-ip_sw.o \
|
||||
natsemi.o ns16550.o ns8382x.o ns87308.o \
|
||||
eepro100.o i8042.o i82365.o inca-ip_sw.o \
|
||||
lan91c96.o natsemi.o ns16550.o ns8382x.o ns87308.o \
|
||||
pci.o pci_auto.o pci_indirect.o \
|
||||
pcnet.o plb2800_eth.o \
|
||||
s3c24x0_i2c.o sed13806.o serial.o \
|
||||
|
||||
590
drivers/i82365.c
Normal file
590
drivers/i82365.c
Normal file
@@ -0,0 +1,590 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
********************************************************************
|
||||
*
|
||||
* Lots of code copied from:
|
||||
*
|
||||
* i82365.c 1.352 - Linux driver for Intel 82365 and compatible
|
||||
* PC Card controllers, and Yenta-compatible PCI-to-CardBus controllers.
|
||||
* (C) 1999 David A. Hinds <dahinds@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#ifdef CONFIG_I82365
|
||||
|
||||
#include <command.h>
|
||||
#include <pci.h>
|
||||
#include <pcmcia.h>
|
||||
#include <cmd_pcmcia.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/i82365.h>
|
||||
#include <pcmcia/ti113x.h>
|
||||
#include <pcmcia/yenta.h>
|
||||
|
||||
/* #define DEBUG */
|
||||
|
||||
static struct pci_device_id supported[] = {
|
||||
{PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1510},
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
#define CYCLE_TIME 120
|
||||
|
||||
#ifdef DEBUG
|
||||
static void i82365_dump_regions (pci_dev_t dev);
|
||||
#endif
|
||||
|
||||
typedef struct socket_info_t {
|
||||
pci_dev_t dev;
|
||||
u_short bcr;
|
||||
u_char pci_lat, cb_lat, sub_bus, cache;
|
||||
u_int cb_phys;
|
||||
|
||||
socket_cap_t cap;
|
||||
ti113x_state_t state;
|
||||
} socket_info_t;
|
||||
|
||||
static socket_info_t socket;
|
||||
static socket_state_t state;
|
||||
static struct pccard_mem_map mem;
|
||||
static struct pccard_io_map io;
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
/* Some PCI shortcuts */
|
||||
|
||||
static int pci_readb (socket_info_t * s, int r, u_char * v)
|
||||
{
|
||||
return pci_read_config_byte (s->dev, r, v);
|
||||
}
|
||||
static int pci_writeb (socket_info_t * s, int r, u_char v)
|
||||
{
|
||||
return pci_write_config_byte (s->dev, r, v);
|
||||
}
|
||||
static int pci_readw (socket_info_t * s, int r, u_short * v)
|
||||
{
|
||||
return pci_read_config_word (s->dev, r, v);
|
||||
}
|
||||
static int pci_writew (socket_info_t * s, int r, u_short v)
|
||||
{
|
||||
return pci_write_config_word (s->dev, r, v);
|
||||
}
|
||||
static int pci_readl (socket_info_t * s, int r, u_int * v)
|
||||
{
|
||||
return pci_read_config_dword (s->dev, r, v);
|
||||
}
|
||||
static int pci_writel (socket_info_t * s, int r, u_int v)
|
||||
{
|
||||
return pci_write_config_dword (s->dev, r, v);
|
||||
}
|
||||
|
||||
#define cb_readb(s, r) readb((s)->cb_phys + (r))
|
||||
#define cb_readl(s, r) readl((s)->cb_phys + (r))
|
||||
#define cb_writeb(s, r, v) writeb(v, (s)->cb_phys + (r))
|
||||
#define cb_writel(s, r, v) writel(v, (s)->cb_phys + (r))
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static u_char i365_get (socket_info_t * s, u_short reg)
|
||||
{
|
||||
return cb_readb (s, 0x0800 + reg);
|
||||
}
|
||||
|
||||
static void i365_set (socket_info_t * s, u_short reg, u_char data)
|
||||
{
|
||||
cb_writeb (s, 0x0800 + reg, data);
|
||||
}
|
||||
|
||||
static void i365_bset (socket_info_t * s, u_short reg, u_char mask)
|
||||
{
|
||||
i365_set (s, reg, i365_get (s, reg) | mask);
|
||||
}
|
||||
|
||||
static void i365_bclr (socket_info_t * s, u_short reg, u_char mask)
|
||||
{
|
||||
i365_set (s, reg, i365_get (s, reg) & ~mask);
|
||||
}
|
||||
|
||||
#if 0 /* not used */
|
||||
static void i365_bflip (socket_info_t * s, u_short reg, u_char mask, int b)
|
||||
{
|
||||
u_char d = i365_get (s, reg);
|
||||
|
||||
i365_set (s, reg, (b) ? (d | mask) : (d & ~mask));
|
||||
}
|
||||
|
||||
static u_short i365_get_pair (socket_info_t * s, u_short reg)
|
||||
{
|
||||
return (i365_get (s, reg) + (i365_get (s, reg + 1) << 8));
|
||||
}
|
||||
#endif /* not used */
|
||||
|
||||
static void i365_set_pair (socket_info_t * s, u_short reg, u_short data)
|
||||
{
|
||||
i365_set (s, reg, data & 0xff);
|
||||
i365_set (s, reg + 1, data >> 8);
|
||||
}
|
||||
|
||||
/*======================================================================
|
||||
|
||||
Code to save and restore global state information for TI 1130 and
|
||||
TI 1131 controllers, and to set and report global configuration
|
||||
options.
|
||||
|
||||
======================================================================*/
|
||||
|
||||
static void ti113x_get_state (socket_info_t * s)
|
||||
{
|
||||
ti113x_state_t *p = &s->state;
|
||||
|
||||
pci_readl (s, TI113X_SYSTEM_CONTROL, &p->sysctl);
|
||||
pci_readb (s, TI113X_CARD_CONTROL, &p->cardctl);
|
||||
pci_readb (s, TI113X_DEVICE_CONTROL, &p->devctl);
|
||||
pci_readb (s, TI1250_DIAGNOSTIC, &p->diag);
|
||||
pci_readl (s, TI12XX_IRQMUX, &p->irqmux);
|
||||
}
|
||||
|
||||
static void ti113x_set_state (socket_info_t * s)
|
||||
{
|
||||
ti113x_state_t *p = &s->state;
|
||||
|
||||
pci_writel (s, TI113X_SYSTEM_CONTROL, p->sysctl);
|
||||
pci_writeb (s, TI113X_CARD_CONTROL, p->cardctl);
|
||||
pci_writeb (s, TI113X_DEVICE_CONTROL, p->devctl);
|
||||
pci_writeb (s, TI1250_MULTIMEDIA_CTL, 0);
|
||||
pci_writeb (s, TI1250_DIAGNOSTIC, p->diag);
|
||||
pci_writel (s, TI12XX_IRQMUX, p->irqmux);
|
||||
i365_set_pair (s, TI113X_IO_OFFSET (0), 0);
|
||||
i365_set_pair (s, TI113X_IO_OFFSET (1), 0);
|
||||
}
|
||||
|
||||
static u_int ti113x_set_opts (socket_info_t * s)
|
||||
{
|
||||
ti113x_state_t *p = &s->state;
|
||||
u_int mask = 0xffff;
|
||||
|
||||
p->cardctl &= ~TI113X_CCR_ZVENABLE;
|
||||
p->cardctl |= TI113X_CCR_SPKROUTEN;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
/*======================================================================
|
||||
|
||||
Routines to handle common CardBus options
|
||||
|
||||
======================================================================*/
|
||||
|
||||
/* Default settings for PCI command configuration register */
|
||||
#define CMD_DFLT (PCI_COMMAND_IO|PCI_COMMAND_MEMORY| \
|
||||
PCI_COMMAND_MASTER|PCI_COMMAND_WAIT)
|
||||
|
||||
static void cb_get_state (socket_info_t * s)
|
||||
{
|
||||
pci_readb (s, PCI_CACHE_LINE_SIZE, &s->cache);
|
||||
pci_readb (s, PCI_LATENCY_TIMER, &s->pci_lat);
|
||||
pci_readb (s, CB_LATENCY_TIMER, &s->cb_lat);
|
||||
pci_readb (s, CB_CARDBUS_BUS, &s->cap.cardbus);
|
||||
pci_readb (s, CB_SUBORD_BUS, &s->sub_bus);
|
||||
pci_readw (s, CB_BRIDGE_CONTROL, &s->bcr);
|
||||
}
|
||||
|
||||
static void cb_set_state (socket_info_t * s)
|
||||
{
|
||||
pci_writel (s, CB_LEGACY_MODE_BASE, 0);
|
||||
pci_writel (s, PCI_BASE_ADDRESS_0, s->cb_phys);
|
||||
pci_writew (s, PCI_COMMAND, CMD_DFLT);
|
||||
pci_writeb (s, PCI_CACHE_LINE_SIZE, s->cache);
|
||||
pci_writeb (s, PCI_LATENCY_TIMER, s->pci_lat);
|
||||
pci_writeb (s, CB_LATENCY_TIMER, s->cb_lat);
|
||||
pci_writeb (s, CB_CARDBUS_BUS, s->cap.cardbus);
|
||||
pci_writeb (s, CB_SUBORD_BUS, s->sub_bus);
|
||||
pci_writew (s, CB_BRIDGE_CONTROL, s->bcr);
|
||||
}
|
||||
|
||||
static void cb_set_opts (socket_info_t * s)
|
||||
{
|
||||
if (s->cache == 0)
|
||||
s->cache = 8;
|
||||
if (s->pci_lat == 0)
|
||||
s->pci_lat = 0xa8;
|
||||
if (s->cb_lat == 0)
|
||||
s->cb_lat = 0xb0;
|
||||
}
|
||||
|
||||
/*======================================================================
|
||||
|
||||
Power control for Cardbus controllers: used both for 16-bit and
|
||||
Cardbus cards.
|
||||
|
||||
======================================================================*/
|
||||
|
||||
static int cb_set_power (socket_info_t * s, socket_state_t * state)
|
||||
{
|
||||
u_int reg = 0;
|
||||
|
||||
/* restart card voltage detection if it seems appropriate */
|
||||
if ((state->Vcc == 0) && (state->Vpp == 0) &&
|
||||
!(cb_readl (s, CB_SOCKET_STATE) & CB_SS_VSENSE))
|
||||
cb_writel (s, CB_SOCKET_FORCE, CB_SF_CVSTEST);
|
||||
switch (state->Vcc) {
|
||||
case 0:
|
||||
reg = 0;
|
||||
break;
|
||||
case 33:
|
||||
reg = CB_SC_VCC_3V;
|
||||
break;
|
||||
case 50:
|
||||
reg = CB_SC_VCC_5V;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
switch (state->Vpp) {
|
||||
case 0:
|
||||
break;
|
||||
case 33:
|
||||
reg |= CB_SC_VPP_3V;
|
||||
break;
|
||||
case 50:
|
||||
reg |= CB_SC_VPP_5V;
|
||||
break;
|
||||
case 120:
|
||||
reg |= CB_SC_VPP_12V;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
if (reg != cb_readl (s, CB_SOCKET_CONTROL))
|
||||
cb_writel (s, CB_SOCKET_CONTROL, reg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*======================================================================
|
||||
|
||||
Generic routines to get and set controller options
|
||||
|
||||
======================================================================*/
|
||||
|
||||
static void get_bridge_state (socket_info_t * s)
|
||||
{
|
||||
ti113x_get_state (s);
|
||||
cb_get_state (s);
|
||||
}
|
||||
|
||||
static void set_bridge_state (socket_info_t * s)
|
||||
{
|
||||
cb_set_state (s);
|
||||
i365_set (s, I365_GBLCTL, 0x00);
|
||||
i365_set (s, I365_GENCTL, 0x00);
|
||||
ti113x_set_state (s);
|
||||
}
|
||||
|
||||
static void set_bridge_opts (socket_info_t * s)
|
||||
{
|
||||
ti113x_set_opts (s);
|
||||
cb_set_opts (s);
|
||||
}
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int i365_get_status (socket_info_t * s, u_int * value)
|
||||
{
|
||||
u_int status;
|
||||
|
||||
status = i365_get (s, I365_STATUS);
|
||||
*value = ((status & I365_CS_DETECT) == I365_CS_DETECT) ? SS_DETECT : 0;
|
||||
if (i365_get (s, I365_INTCTL) & I365_PC_IOCARD) {
|
||||
*value |= (status & I365_CS_STSCHG) ? 0 : SS_STSCHG;
|
||||
} else {
|
||||
*value |= (status & I365_CS_BVD1) ? 0 : SS_BATDEAD;
|
||||
*value |= (status & I365_CS_BVD2) ? 0 : SS_BATWARN;
|
||||
}
|
||||
*value |= (status & I365_CS_WRPROT) ? SS_WRPROT : 0;
|
||||
*value |= (status & I365_CS_READY) ? SS_READY : 0;
|
||||
*value |= (status & I365_CS_POWERON) ? SS_POWERON : 0;
|
||||
|
||||
status = cb_readl (s, CB_SOCKET_STATE);
|
||||
*value |= (status & CB_SS_32BIT) ? SS_CARDBUS : 0;
|
||||
*value |= (status & CB_SS_3VCARD) ? SS_3VCARD : 0;
|
||||
*value |= (status & CB_SS_XVCARD) ? SS_XVCARD : 0;
|
||||
*value |= (status & CB_SS_VSENSE) ? 0 : SS_PENDING;
|
||||
/* For now, ignore cards with unsupported voltage keys */
|
||||
if (*value & SS_XVCARD)
|
||||
*value &= ~(SS_DETECT | SS_3VCARD | SS_XVCARD);
|
||||
|
||||
return 0;
|
||||
} /* i365_get_status */
|
||||
|
||||
static int i365_set_socket (socket_info_t * s, socket_state_t * state)
|
||||
{
|
||||
u_char reg;
|
||||
|
||||
set_bridge_state (s);
|
||||
|
||||
/* IO card, RESET flag */
|
||||
reg = 0;
|
||||
reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
|
||||
reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
|
||||
i365_set (s, I365_INTCTL, reg);
|
||||
|
||||
reg = I365_PWR_NORESET;
|
||||
if (state->flags & SS_PWR_AUTO)
|
||||
reg |= I365_PWR_AUTO;
|
||||
if (state->flags & SS_OUTPUT_ENA)
|
||||
reg |= I365_PWR_OUT;
|
||||
|
||||
cb_set_power (s, state);
|
||||
reg |= i365_get (s, I365_POWER) & (I365_VCC_MASK | I365_VPP1_MASK);
|
||||
|
||||
if (reg != i365_get (s, I365_POWER))
|
||||
i365_set (s, I365_POWER, reg);
|
||||
|
||||
return 0;
|
||||
} /* i365_set_socket */
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int i365_set_mem_map (socket_info_t * s, struct pccard_mem_map *mem)
|
||||
{
|
||||
u_short base, i;
|
||||
u_char map;
|
||||
|
||||
map = mem->map;
|
||||
if ((map > 4) ||
|
||||
(mem->card_start > 0x3ffffff) ||
|
||||
(mem->sys_start > mem->sys_stop) ||
|
||||
(mem->speed > 1000)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Turn off the window before changing anything */
|
||||
if (i365_get (s, I365_ADDRWIN) & I365_ENA_MEM (map))
|
||||
i365_bclr (s, I365_ADDRWIN, I365_ENA_MEM (map));
|
||||
|
||||
/* Take care of high byte, for PCI controllers */
|
||||
i365_set (s, CB_MEM_PAGE (map), mem->sys_start >> 24);
|
||||
|
||||
base = I365_MEM (map);
|
||||
i = (mem->sys_start >> 12) & 0x0fff;
|
||||
if (mem->flags & MAP_16BIT)
|
||||
i |= I365_MEM_16BIT;
|
||||
if (mem->flags & MAP_0WS)
|
||||
i |= I365_MEM_0WS;
|
||||
i365_set_pair (s, base + I365_W_START, i);
|
||||
|
||||
i = (mem->sys_stop >> 12) & 0x0fff;
|
||||
switch (mem->speed / CYCLE_TIME) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
i |= I365_MEM_WS0;
|
||||
break;
|
||||
case 2:
|
||||
i |= I365_MEM_WS1;
|
||||
break;
|
||||
default:
|
||||
i |= I365_MEM_WS1 | I365_MEM_WS0;
|
||||
break;
|
||||
}
|
||||
i365_set_pair (s, base + I365_W_STOP, i);
|
||||
|
||||
i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff;
|
||||
if (mem->flags & MAP_WRPROT)
|
||||
i |= I365_MEM_WRPROT;
|
||||
if (mem->flags & MAP_ATTRIB)
|
||||
i |= I365_MEM_REG;
|
||||
i365_set_pair (s, base + I365_W_OFF, i);
|
||||
|
||||
/* Turn on the window if necessary */
|
||||
if (mem->flags & MAP_ACTIVE)
|
||||
i365_bset (s, I365_ADDRWIN, I365_ENA_MEM (map));
|
||||
return 0;
|
||||
} /* i365_set_mem_map */
|
||||
|
||||
static int i365_set_io_map (socket_info_t * s, struct pccard_io_map *io)
|
||||
{
|
||||
u_char map, ioctl;
|
||||
|
||||
map = io->map;
|
||||
if ((map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) ||
|
||||
(io->stop < io->start))
|
||||
return -1;
|
||||
/* Turn off the window before changing anything */
|
||||
if (i365_get (s, I365_ADDRWIN) & I365_ENA_IO (map))
|
||||
i365_bclr (s, I365_ADDRWIN, I365_ENA_IO (map));
|
||||
i365_set_pair (s, I365_IO (map) + I365_W_START, io->start);
|
||||
i365_set_pair (s, I365_IO (map) + I365_W_STOP, io->stop);
|
||||
ioctl = i365_get (s, I365_IOCTL) & ~I365_IOCTL_MASK (map);
|
||||
if (io->speed)
|
||||
ioctl |= I365_IOCTL_WAIT (map);
|
||||
if (io->flags & MAP_0WS)
|
||||
ioctl |= I365_IOCTL_0WS (map);
|
||||
if (io->flags & MAP_16BIT)
|
||||
ioctl |= I365_IOCTL_16BIT (map);
|
||||
if (io->flags & MAP_AUTOSZ)
|
||||
ioctl |= I365_IOCTL_IOCS16 (map);
|
||||
i365_set (s, I365_IOCTL, ioctl);
|
||||
/* Turn on the window if necessary */
|
||||
if (io->flags & MAP_ACTIVE)
|
||||
i365_bset (s, I365_ADDRWIN, I365_ENA_IO (map));
|
||||
return 0;
|
||||
} /* i365_set_io_map */
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
int i82365_init (void)
|
||||
{
|
||||
u_int val;
|
||||
int i;
|
||||
|
||||
if ((socket.dev = pci_find_devices (supported, 0)) < 0) {
|
||||
/* Controller not found */
|
||||
return 1;
|
||||
}
|
||||
|
||||
pci_read_config_dword (socket.dev, PCI_BASE_ADDRESS_0, &socket.cb_phys);
|
||||
socket.cb_phys &= ~0xf;
|
||||
|
||||
get_bridge_state (&socket);
|
||||
set_bridge_opts (&socket);
|
||||
|
||||
i365_get_status (&socket, &val);
|
||||
|
||||
if (val & SS_DETECT) {
|
||||
if (val & SS_3VCARD) {
|
||||
state.Vcc = state.Vpp = 33;
|
||||
puts (" 3.3V card found: ");
|
||||
} else if (!(val & SS_XVCARD)) {
|
||||
state.Vcc = state.Vpp = 50;
|
||||
puts (" 5.0V card found: ");
|
||||
} else {
|
||||
printf ("i82365: unsupported voltage key\n");
|
||||
state.Vcc = state.Vpp = 0;
|
||||
}
|
||||
} else {
|
||||
/* No card inserted */
|
||||
return 1;
|
||||
}
|
||||
|
||||
state.flags = SS_IOCARD | SS_OUTPUT_ENA;
|
||||
state.csc_mask = 0;
|
||||
state.io_irq = 0;
|
||||
|
||||
i365_set_socket (&socket, &state);
|
||||
|
||||
for (i = 500; i; i--) {
|
||||
if ((i365_get (&socket, I365_STATUS) & I365_CS_READY))
|
||||
break;
|
||||
udelay (1000);
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
/* PC Card not ready for data transfer */
|
||||
return 1;
|
||||
}
|
||||
|
||||
mem.map = 0;
|
||||
mem.flags = MAP_ATTRIB | MAP_ACTIVE;
|
||||
mem.speed = 300;
|
||||
mem.sys_start = CFG_PCMCIA_MEM_ADDR;
|
||||
mem.sys_stop = CFG_PCMCIA_MEM_ADDR + CFG_PCMCIA_MEM_SIZE - 1;
|
||||
mem.card_start = 0;
|
||||
|
||||
i365_set_mem_map (&socket, &mem);
|
||||
|
||||
io.map = 0;
|
||||
io.flags = MAP_AUTOSZ | MAP_ACTIVE;
|
||||
io.speed = 0;
|
||||
io.start = 0x0100;
|
||||
io.stop = 0x010F;
|
||||
|
||||
i365_set_io_map (&socket, &io);
|
||||
|
||||
#ifdef DEBUG
|
||||
i82365_dump_regions (socket.dev);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void i82365_exit (void)
|
||||
{
|
||||
io.map = 0;
|
||||
io.flags = 0;
|
||||
io.speed = 0;
|
||||
io.start = 0;
|
||||
io.stop = 0x1;
|
||||
|
||||
i365_set_io_map (&socket, &io);
|
||||
|
||||
mem.map = 0;
|
||||
mem.flags = 0;
|
||||
mem.speed = 0;
|
||||
mem.sys_start = 0;
|
||||
mem.sys_stop = 0x1000;
|
||||
mem.card_start = 0;
|
||||
|
||||
i365_set_mem_map (&socket, &mem);
|
||||
|
||||
socket.state.sysctl &= 0xFFFF00FF;
|
||||
|
||||
state.Vcc = state.Vpp = 0;
|
||||
|
||||
i365_set_socket (&socket, &state);
|
||||
}
|
||||
|
||||
/*======================================================================
|
||||
|
||||
Debug stuff
|
||||
|
||||
======================================================================*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static void i82365_dump_regions (pci_dev_t dev)
|
||||
{
|
||||
u_int tmp[2];
|
||||
u_int *mem = (void *) sock.cb_phys;
|
||||
u_char *cis = (void *) CFG_PCMCIA_MEM_ADDR;
|
||||
u_char *ide = (void *) (CFG_ATA_BASE_ADDR + CFG_ATA_REG_OFFSET);
|
||||
|
||||
pci_read_config_dword (dev, 0x00, tmp + 0);
|
||||
pci_read_config_dword (dev, 0x80, tmp + 1);
|
||||
|
||||
printf ("PCI CONF: %08X ... %08X\n", tmp[0], tmp[1]);
|
||||
printf ("PCI MEM: ... %08X ... %08X\n", mem[0x8 / 4], mem[0x800 / 4]);
|
||||
printf ("CIS: ...%c%c%c%c%c%c%c%c...\n",
|
||||
cis[0x38], cis[0x3a], cis[0x3c], cis[0x3e],
|
||||
cis[0x40], cis[0x42], cis[0x44], cis[0x48]);
|
||||
printf ("CIS CONF: %02X %02X %02X ...\n",
|
||||
cis[0x200], cis[0x202], cis[0x204]);
|
||||
printf ("IDE: %02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
ide[0], ide[1], ide[2], ide[3],
|
||||
ide[4], ide[5], ide[6], ide[7]);
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif /* CONFIG_I82365 */
|
||||
858
drivers/lan91c96.c
Normal file
858
drivers/lan91c96.c
Normal file
@@ -0,0 +1,858 @@
|
||||
/*------------------------------------------------------------------------
|
||||
* lan91c96.c
|
||||
* This is a driver for SMSC's LAN91C96 single-chip Ethernet device, based
|
||||
* on the SMC91111 driver from U-boot.
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Rolf Offermanns <rof@sysgo.de>
|
||||
*
|
||||
* Copyright (C) 2001 Standard Microsystems Corporation (SMSC)
|
||||
* Developed by Simple Network Magic Corporation (SNMC)
|
||||
* Copyright (C) 1996 by Erik Stahlman (ES)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Information contained in this file was obtained from the LAN91C96
|
||||
* manual from SMC. To get a copy, if you really want one, you can find
|
||||
* information under www.smsc.com.
|
||||
*
|
||||
*
|
||||
* "Features" of the SMC chip:
|
||||
* 6144 byte packet memory. ( for the 91C96 )
|
||||
* EEPROM for configuration
|
||||
* AUI/TP selection ( mine has 10Base2/10BaseT select )
|
||||
*
|
||||
* Arguments:
|
||||
* io = for the base address
|
||||
* irq = for the IRQ
|
||||
*
|
||||
* author:
|
||||
* Erik Stahlman ( erik@vt.edu )
|
||||
* Daris A Nevil ( dnevil@snmc.com )
|
||||
*
|
||||
*
|
||||
* Hardware multicast code from Peter Cammaert ( pc@denkart.be )
|
||||
*
|
||||
* Sources:
|
||||
* o SMSC LAN91C96 databook (www.smsc.com)
|
||||
* o smc91111.c (u-boot driver)
|
||||
* o smc9194.c (linux kernel driver)
|
||||
* o lan91c96.c (Intel Diagnostic Manager driver)
|
||||
*
|
||||
* History:
|
||||
* 04/30/03 Mathijs Haarman Modified smc91111.c (u-boot version)
|
||||
* for lan91c96
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include "lan91c96.h"
|
||||
#include <net.h>
|
||||
|
||||
#ifdef CONFIG_DRIVER_LAN91C96
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* Configuration options, for the experienced user to change.
|
||||
*
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
/* Use power-down feature of the chip */
|
||||
#define POWER_DOWN 0
|
||||
|
||||
/*
|
||||
* Wait time for memory to be free. This probably shouldn't be
|
||||
* tuned that much, as waiting for this means nothing else happens
|
||||
* in the system
|
||||
*/
|
||||
#define MEMORY_WAIT_TIME 16
|
||||
|
||||
#define SMC_DEBUG 0
|
||||
|
||||
#if (SMC_DEBUG > 2 )
|
||||
#define PRINTK3(args...) printf(args)
|
||||
#else
|
||||
#define PRINTK3(args...)
|
||||
#endif
|
||||
|
||||
#if SMC_DEBUG > 1
|
||||
#define PRINTK2(args...) printf(args)
|
||||
#else
|
||||
#define PRINTK2(args...)
|
||||
#endif
|
||||
|
||||
#ifdef SMC_DEBUG
|
||||
#define PRINTK(args...) printf(args)
|
||||
#else
|
||||
#define PRINTK(args...)
|
||||
#endif
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* The internal workings of the driver. If you are changing anything
|
||||
* here with the SMC stuff, you should have the datasheet and know
|
||||
* what you are doing.
|
||||
*
|
||||
*------------------------------------------------------------------------
|
||||
*/
|
||||
#define CARDNAME "LAN91C96"
|
||||
|
||||
#define SMC_BASE_ADDRESS CONFIG_LAN91C96_BASE
|
||||
|
||||
#define SMC_DEV_NAME "LAN91C96"
|
||||
#define SMC_ALLOC_MAX_TRY 5
|
||||
#define SMC_TX_TIMEOUT 30
|
||||
|
||||
#define ETH_ZLEN 60
|
||||
|
||||
#ifdef CONFIG_LAN91C96_USE_32_BIT
|
||||
#define USE_32_BIT 1
|
||||
#else
|
||||
#undef USE_32_BIT
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
*
|
||||
* The driver can be entered at any of the following entry points.
|
||||
*
|
||||
*-----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
extern int eth_init (bd_t * bd);
|
||||
extern void eth_halt (void);
|
||||
extern int eth_rx (void);
|
||||
extern int eth_send (volatile void *packet, int length);
|
||||
static int smc_hw_init (void);
|
||||
|
||||
/*
|
||||
* This is called by register_netdev(). It is responsible for
|
||||
* checking the portlist for the SMC9000 series chipset. If it finds
|
||||
* one, then it will initialize the device, find the hardware information,
|
||||
* and sets up the appropriate device parameters.
|
||||
* NOTE: Interrupts are *OFF* when this procedure is called.
|
||||
*
|
||||
* NB:This shouldn't be static since it is referred to externally.
|
||||
*/
|
||||
int smc_init (void);
|
||||
|
||||
/*
|
||||
* This is called by unregister_netdev(). It is responsible for
|
||||
* cleaning up before the driver is finally unregistered and discarded.
|
||||
*/
|
||||
void smc_destructor (void);
|
||||
|
||||
/*
|
||||
* The kernel calls this function when someone wants to use the device,
|
||||
* typically 'ifconfig ethX up'.
|
||||
*/
|
||||
static int smc_open (void);
|
||||
|
||||
|
||||
/*
|
||||
* This is called by the kernel in response to 'ifconfig ethX down'. It
|
||||
* is responsible for cleaning up everything that the open routine
|
||||
* does, and maybe putting the card into a powerdown state.
|
||||
*/
|
||||
static int smc_close (void);
|
||||
|
||||
/*
|
||||
* This is a separate procedure to handle the receipt of a packet, to
|
||||
* leave the interrupt code looking slightly cleaner
|
||||
*/
|
||||
static int smc_rcv (void);
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
* Internal routines
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static char smc_mac_addr[] = { 0xc0, 0x00, 0x00, 0x1b, 0x62, 0x9c };
|
||||
|
||||
/*
|
||||
* This function must be called before smc_open() if you want to override
|
||||
* the default mac address.
|
||||
*/
|
||||
|
||||
void smc_set_mac_addr (const char *addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof (smc_mac_addr); i++) {
|
||||
smc_mac_addr[i] = addr[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* smc_get_macaddr is no longer used. If you want to override the default
|
||||
* mac address, call smc_get_mac_addr as a part of the board initialisation.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
void smc_get_macaddr (byte * addr)
|
||||
{
|
||||
/* MAC ADDRESS AT FLASHBLOCK 1 / OFFSET 0x10 */
|
||||
unsigned char *dnp1110_mac = (unsigned char *) (0xE8000000 + 0x20010);
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
addr[0] = *(dnp1110_mac + 0);
|
||||
addr[1] = *(dnp1110_mac + 1);
|
||||
addr[2] = *(dnp1110_mac + 2);
|
||||
addr[3] = *(dnp1110_mac + 3);
|
||||
addr[4] = *(dnp1110_mac + 4);
|
||||
addr[5] = *(dnp1110_mac + 5);
|
||||
}
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
/***********************************************
|
||||
* Show available memory *
|
||||
***********************************************/
|
||||
void dump_memory_info (void)
|
||||
{
|
||||
word mem_info;
|
||||
word old_bank;
|
||||
|
||||
old_bank = SMC_inw (LAN91C96_BANK_SELECT) & 0xF;
|
||||
|
||||
SMC_SELECT_BANK (0);
|
||||
mem_info = SMC_inw (LAN91C96_MIR);
|
||||
PRINTK2 ("Memory: %4d available\n", (mem_info >> 8) * 2048);
|
||||
|
||||
SMC_SELECT_BANK (old_bank);
|
||||
}
|
||||
|
||||
/*
|
||||
* A rather simple routine to print out a packet for debugging purposes.
|
||||
*/
|
||||
#if SMC_DEBUG > 2
|
||||
static void print_packet (byte *, int);
|
||||
#endif
|
||||
|
||||
/* #define tx_done(dev) 1 */
|
||||
|
||||
|
||||
|
||||
/* this does a soft reset on the device */
|
||||
static void smc_reset (void);
|
||||
|
||||
/* Enable Interrupts, Receive, and Transmit */
|
||||
static void smc_enable (void);
|
||||
|
||||
/* this puts the device in an inactive state */
|
||||
static void smc_shutdown (void);
|
||||
|
||||
|
||||
static int poll4int (byte mask, int timeout)
|
||||
{
|
||||
int tmo = get_timer (0) + timeout * CFG_HZ;
|
||||
int is_timeout = 0;
|
||||
word old_bank = SMC_inw (LAN91C96_BANK_SELECT);
|
||||
|
||||
PRINTK2 ("Polling...\n");
|
||||
SMC_SELECT_BANK (2);
|
||||
while ((SMC_inw (LAN91C96_INT_STATS) & mask) == 0) {
|
||||
if (get_timer (0) >= tmo) {
|
||||
is_timeout = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* restore old bank selection */
|
||||
SMC_SELECT_BANK (old_bank);
|
||||
|
||||
if (is_timeout)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: smc_reset( void )
|
||||
* Purpose:
|
||||
* This sets the SMC91111 chip to its normal state, hopefully from whatever
|
||||
* mess that any other DOS driver has put it in.
|
||||
*
|
||||
* Maybe I should reset more registers to defaults in here? SOFTRST should
|
||||
* do that for me.
|
||||
*
|
||||
* Method:
|
||||
* 1. send a SOFT RESET
|
||||
* 2. wait for it to finish
|
||||
* 3. enable autorelease mode
|
||||
* 4. reset the memory management unit
|
||||
* 5. clear all interrupts
|
||||
*
|
||||
*/
|
||||
static void smc_reset (void)
|
||||
{
|
||||
PRINTK2 ("%s:smc_reset\n", SMC_DEV_NAME);
|
||||
|
||||
/* This resets the registers mostly to defaults, but doesn't
|
||||
affect EEPROM. That seems unnecessary */
|
||||
SMC_SELECT_BANK (0);
|
||||
SMC_outw (LAN91C96_RCR_SOFT_RST, LAN91C96_RCR);
|
||||
|
||||
udelay (10);
|
||||
|
||||
/* Disable transmit and receive functionality */
|
||||
SMC_outw (0, LAN91C96_RCR);
|
||||
SMC_outw (0, LAN91C96_TCR);
|
||||
|
||||
/* set the control register */
|
||||
SMC_SELECT_BANK (1);
|
||||
SMC_outw (SMC_inw (LAN91C96_CONTROL) | LAN91C96_CTR_BIT_8,
|
||||
LAN91C96_CONTROL);
|
||||
|
||||
/* Disable all interrupts */
|
||||
SMC_outb (0, LAN91C96_INT_MASK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: smc_enable
|
||||
* Purpose: let the chip talk to the outside work
|
||||
* Method:
|
||||
* 1. Initialize the Memory Configuration Register
|
||||
* 2. Enable the transmitter
|
||||
* 3. Enable the receiver
|
||||
*/
|
||||
static void smc_enable ()
|
||||
{
|
||||
PRINTK2 ("%s:smc_enable\n", SMC_DEV_NAME);
|
||||
SMC_SELECT_BANK (0);
|
||||
|
||||
/* Initialize the Memory Configuration Register. See page
|
||||
49 of the LAN91C96 data sheet for details. */
|
||||
SMC_outw (LAN91C96_MCR_TRANSMIT_PAGES, LAN91C96_MCR);
|
||||
|
||||
/* Initialize the Transmit Control Register */
|
||||
SMC_outw (LAN91C96_TCR_TXENA, LAN91C96_TCR);
|
||||
/* Initialize the Receive Control Register
|
||||
* FIXME:
|
||||
* The promiscuous bit set because I could not receive ARP reply
|
||||
* packets from the server when I send a ARP request. It only works
|
||||
* when I set the promiscuous bit
|
||||
*/
|
||||
SMC_outw (LAN91C96_RCR_RXEN | LAN91C96_RCR_PRMS, LAN91C96_RCR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: smc_shutdown
|
||||
* Purpose: closes down the SMC91xxx chip.
|
||||
* Method:
|
||||
* 1. zero the interrupt mask
|
||||
* 2. clear the enable receive flag
|
||||
* 3. clear the enable xmit flags
|
||||
*
|
||||
* TODO:
|
||||
* (1) maybe utilize power down mode.
|
||||
* Why not yet? Because while the chip will go into power down mode,
|
||||
* the manual says that it will wake up in response to any I/O requests
|
||||
* in the register space. Empirical results do not show this working.
|
||||
*/
|
||||
static void smc_shutdown ()
|
||||
{
|
||||
PRINTK2 (CARDNAME ":smc_shutdown\n");
|
||||
|
||||
/* no more interrupts for me */
|
||||
SMC_SELECT_BANK (2);
|
||||
SMC_outb (0, LAN91C96_INT_MASK);
|
||||
|
||||
/* and tell the card to stay away from that nasty outside world */
|
||||
SMC_SELECT_BANK (0);
|
||||
SMC_outb (0, LAN91C96_RCR);
|
||||
SMC_outb (0, LAN91C96_TCR);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Function: smc_hardware_send_packet(struct net_device * )
|
||||
* Purpose:
|
||||
* This sends the actual packet to the SMC9xxx chip.
|
||||
*
|
||||
* Algorithm:
|
||||
* First, see if a saved_skb is available.
|
||||
* ( this should NOT be called if there is no 'saved_skb'
|
||||
* Now, find the packet number that the chip allocated
|
||||
* Point the data pointers at it in memory
|
||||
* Set the length word in the chip's memory
|
||||
* Dump the packet to chip memory
|
||||
* Check if a last byte is needed ( odd length packet )
|
||||
* if so, set the control flag right
|
||||
* Tell the card to send it
|
||||
* Enable the transmit interrupt, so I know if it failed
|
||||
* Free the kernel data if I actually sent it.
|
||||
*/
|
||||
static int smc_send_packet (volatile void *packet, int packet_length)
|
||||
{
|
||||
byte packet_no;
|
||||
unsigned long ioaddr;
|
||||
byte *buf;
|
||||
int length;
|
||||
int numPages;
|
||||
int try = 0;
|
||||
int time_out;
|
||||
byte status;
|
||||
|
||||
|
||||
PRINTK3 ("%s:smc_hardware_send_packet\n", SMC_DEV_NAME);
|
||||
|
||||
length = ETH_ZLEN < packet_length ? packet_length : ETH_ZLEN;
|
||||
|
||||
/* allocate memory
|
||||
** The MMU wants the number of pages to be the number of 256 bytes
|
||||
** 'pages', minus 1 ( since a packet can't ever have 0 pages :) )
|
||||
**
|
||||
** The 91C111 ignores the size bits, but the code is left intact
|
||||
** for backwards and future compatibility.
|
||||
**
|
||||
** Pkt size for allocating is data length +6 (for additional status
|
||||
** words, length and ctl!)
|
||||
**
|
||||
** If odd size then last byte is included in this header.
|
||||
*/
|
||||
numPages = ((length & 0xfffe) + 6);
|
||||
numPages >>= 8; /* Divide by 256 */
|
||||
|
||||
if (numPages > 7) {
|
||||
printf ("%s: Far too big packet error. \n", SMC_DEV_NAME);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* now, try to allocate the memory */
|
||||
|
||||
SMC_SELECT_BANK (2);
|
||||
SMC_outw (LAN91C96_MMUCR_ALLOC_TX | numPages, LAN91C96_MMU);
|
||||
|
||||
again:
|
||||
try++;
|
||||
time_out = MEMORY_WAIT_TIME;
|
||||
do {
|
||||
status = SMC_inb (LAN91C96_INT_STATS);
|
||||
if (status & LAN91C96_IST_ALLOC_INT) {
|
||||
|
||||
SMC_outb (LAN91C96_IST_ALLOC_INT, LAN91C96_INT_STATS);
|
||||
break;
|
||||
}
|
||||
} while (--time_out);
|
||||
|
||||
if (!time_out) {
|
||||
PRINTK2 ("%s: memory allocation, try %d failed ...\n",
|
||||
SMC_DEV_NAME, try);
|
||||
if (try < SMC_ALLOC_MAX_TRY)
|
||||
goto again;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRINTK2 ("%s: memory allocation, try %d succeeded ...\n",
|
||||
SMC_DEV_NAME, try);
|
||||
|
||||
/* I can send the packet now.. */
|
||||
|
||||
ioaddr = SMC_BASE_ADDRESS;
|
||||
|
||||
buf = (byte *) packet;
|
||||
|
||||
/* If I get here, I _know_ there is a packet slot waiting for me */
|
||||
packet_no = SMC_inb (LAN91C96_ARR);
|
||||
if (packet_no & LAN91C96_ARR_FAILED) {
|
||||
/* or isn't there? BAD CHIP! */
|
||||
printf ("%s: Memory allocation failed. \n", SMC_DEV_NAME);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* we have a packet address, so tell the card to use it */
|
||||
SMC_outb (packet_no, LAN91C96_PNR);
|
||||
|
||||
/* point to the beginning of the packet */
|
||||
SMC_outw (LAN91C96_PTR_AUTO_INCR, LAN91C96_POINTER);
|
||||
|
||||
PRINTK3 ("%s: Trying to xmit packet of length %x\n",
|
||||
SMC_DEV_NAME, length);
|
||||
|
||||
#if SMC_DEBUG > 2
|
||||
printf ("Transmitting Packet\n");
|
||||
print_packet (buf, length);
|
||||
#endif
|
||||
|
||||
/* send the packet length ( +6 for status, length and ctl byte )
|
||||
and the status word ( set to zeros ) */
|
||||
#ifdef USE_32_BIT
|
||||
SMC_outl ((length + 6) << 16, LAN91C96_DATA_HIGH);
|
||||
#else
|
||||
SMC_outw (0, LAN91C96_DATA_HIGH);
|
||||
/* send the packet length ( +6 for status words, length, and ctl */
|
||||
SMC_outw ((length + 6), LAN91C96_DATA_HIGH);
|
||||
#endif /* USE_32_BIT */
|
||||
|
||||
/* send the actual data
|
||||
* I _think_ it's faster to send the longs first, and then
|
||||
* mop up by sending the last word. It depends heavily
|
||||
* on alignment, at least on the 486. Maybe it would be
|
||||
* a good idea to check which is optimal? But that could take
|
||||
* almost as much time as is saved?
|
||||
*/
|
||||
#ifdef USE_32_BIT
|
||||
SMC_outsl (LAN91C96_DATA_HIGH, buf, length >> 2);
|
||||
if (length & 0x2)
|
||||
SMC_outw (*((word *) (buf + (length & 0xFFFFFFFC))),
|
||||
LAN91C96_DATA_HIGH);
|
||||
#else
|
||||
SMC_outsw (LAN91C96_DATA_HIGH, buf, (length) >> 1);
|
||||
#endif /* USE_32_BIT */
|
||||
|
||||
/* Send the last byte, if there is one. */
|
||||
if ((length & 1) == 0) {
|
||||
SMC_outw (0, LAN91C96_DATA_HIGH);
|
||||
} else {
|
||||
SMC_outw (buf[length - 1] | 0x2000, LAN91C96_DATA_HIGH);
|
||||
}
|
||||
|
||||
/* and let the chipset deal with it */
|
||||
SMC_outw (LAN91C96_MMUCR_ENQUEUE, LAN91C96_MMU);
|
||||
|
||||
/* poll for TX INT */
|
||||
if (poll4int (LAN91C96_MSK_TX_INT, SMC_TX_TIMEOUT)) {
|
||||
/* sending failed */
|
||||
PRINTK2 ("%s: TX timeout, sending failed...\n", SMC_DEV_NAME);
|
||||
|
||||
/* release packet */
|
||||
SMC_outw (LAN91C96_MMUCR_RELEASE_TX, LAN91C96_MMU);
|
||||
|
||||
/* wait for MMU getting ready (low) */
|
||||
while (SMC_inw (LAN91C96_MMU) & LAN91C96_MMUCR_NO_BUSY) {
|
||||
udelay (10);
|
||||
}
|
||||
|
||||
PRINTK2 ("MMU ready\n");
|
||||
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
/* ack. int */
|
||||
SMC_outw (LAN91C96_IST_TX_INT, LAN91C96_INT_STATS);
|
||||
|
||||
PRINTK2 ("%s: Sent packet of length %d \n", SMC_DEV_NAME, length);
|
||||
|
||||
/* release packet */
|
||||
SMC_outw (LAN91C96_MMUCR_RELEASE_TX, LAN91C96_MMU);
|
||||
|
||||
/* wait for MMU getting ready (low) */
|
||||
while (SMC_inw (LAN91C96_MMU) & LAN91C96_MMUCR_NO_BUSY) {
|
||||
udelay (10);
|
||||
}
|
||||
|
||||
PRINTK2 ("MMU ready\n");
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* smc_destructor( struct net_device * dev )
|
||||
* Input parameters:
|
||||
* dev, pointer to the device structure
|
||||
*
|
||||
* Output:
|
||||
* None.
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
void smc_destructor ()
|
||||
{
|
||||
PRINTK2 (CARDNAME ":smc_destructor\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Open and Initialize the board
|
||||
*
|
||||
* Set up everything, reset the card, etc ..
|
||||
*
|
||||
*/
|
||||
static int smc_open ()
|
||||
{
|
||||
int i; /* used to set hw ethernet address */
|
||||
|
||||
PRINTK2 ("%s:smc_open\n", SMC_DEV_NAME);
|
||||
|
||||
/* reset the hardware */
|
||||
|
||||
smc_reset ();
|
||||
smc_enable ();
|
||||
|
||||
SMC_SELECT_BANK (1);
|
||||
|
||||
for (i = 0; i < 6; i += 2) {
|
||||
word address;
|
||||
|
||||
address = smc_mac_addr[i + 1] << 8;
|
||||
address |= smc_mac_addr[i];
|
||||
SMC_outw (address, LAN91C96_IA0 + i);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
*
|
||||
* smc_rcv - receive a packet from the card
|
||||
*
|
||||
* There is ( at least ) a packet waiting to be read from
|
||||
* chip-memory.
|
||||
*
|
||||
* o Read the status
|
||||
* o If an error, record it
|
||||
* o otherwise, read in the packet
|
||||
*-------------------------------------------------------------
|
||||
*/
|
||||
static int smc_rcv ()
|
||||
{
|
||||
int packet_number;
|
||||
word status;
|
||||
word packet_length;
|
||||
int is_error = 0;
|
||||
|
||||
#ifdef USE_32_BIT
|
||||
dword stat_len;
|
||||
#endif
|
||||
|
||||
|
||||
SMC_SELECT_BANK (2);
|
||||
packet_number = SMC_inw (LAN91C96_FIFO);
|
||||
|
||||
if (packet_number & LAN91C96_FIFO_RXEMPTY) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRINTK3 ("%s:smc_rcv\n", SMC_DEV_NAME);
|
||||
/* start reading from the start of the packet */
|
||||
SMC_outw (LAN91C96_PTR_READ | LAN91C96_PTR_RCV |
|
||||
LAN91C96_PTR_AUTO_INCR, LAN91C96_POINTER);
|
||||
|
||||
/* First two words are status and packet_length */
|
||||
#ifdef USE_32_BIT
|
||||
stat_len = SMC_inl (LAN91C96_DATA_HIGH);
|
||||
status = stat_len & 0xffff;
|
||||
packet_length = stat_len >> 16;
|
||||
#else
|
||||
status = SMC_inw (LAN91C96_DATA_HIGH);
|
||||
packet_length = SMC_inw (LAN91C96_DATA_HIGH);
|
||||
#endif
|
||||
|
||||
packet_length &= 0x07ff; /* mask off top bits */
|
||||
|
||||
PRINTK2 ("RCV: STATUS %4x LENGTH %4x\n", status, packet_length);
|
||||
|
||||
if (!(status & FRAME_FILTER)) {
|
||||
/* Adjust for having already read the first two words */
|
||||
packet_length -= 4; /*4; */
|
||||
|
||||
|
||||
|
||||
/* set odd length for bug in LAN91C111, */
|
||||
/* which never sets RS_ODDFRAME */
|
||||
/* TODO ? */
|
||||
|
||||
|
||||
#ifdef USE_32_BIT
|
||||
PRINTK3 (" Reading %d dwords (and %d bytes) \n",
|
||||
packet_length >> 2, packet_length & 3);
|
||||
/* QUESTION: Like in the TX routine, do I want
|
||||
to send the DWORDs or the bytes first, or some
|
||||
mixture. A mixture might improve already slow PIO
|
||||
performance */
|
||||
SMC_insl (LAN91C96_DATA_HIGH, NetRxPackets[0], packet_length >> 2);
|
||||
/* read the left over bytes */
|
||||
if (packet_length & 3) {
|
||||
int i;
|
||||
|
||||
byte *tail = (byte *) (NetRxPackets[0] + (packet_length & ~3));
|
||||
dword leftover = SMC_inl (LAN91C96_DATA_HIGH);
|
||||
|
||||
for (i = 0; i < (packet_length & 3); i++)
|
||||
*tail++ = (byte) (leftover >> (8 * i)) & 0xff;
|
||||
}
|
||||
#else
|
||||
PRINTK3 (" Reading %d words and %d byte(s) \n",
|
||||
(packet_length >> 1), packet_length & 1);
|
||||
SMC_insw (LAN91C96_DATA_HIGH, NetRxPackets[0], packet_length >> 1);
|
||||
|
||||
#endif /* USE_32_BIT */
|
||||
|
||||
#if SMC_DEBUG > 2
|
||||
printf ("Receiving Packet\n");
|
||||
print_packet (NetRxPackets[0], packet_length);
|
||||
#endif
|
||||
} else {
|
||||
/* error ... */
|
||||
/* TODO ? */
|
||||
is_error = 1;
|
||||
}
|
||||
|
||||
while (SMC_inw (LAN91C96_MMU) & LAN91C96_MMUCR_NO_BUSY)
|
||||
udelay (1); /* Wait until not busy */
|
||||
|
||||
/* error or good, tell the card to get rid of this packet */
|
||||
SMC_outw (LAN91C96_MMUCR_RELEASE_RX, LAN91C96_MMU);
|
||||
|
||||
while (SMC_inw (LAN91C96_MMU) & LAN91C96_MMUCR_NO_BUSY)
|
||||
udelay (1); /* Wait until not busy */
|
||||
|
||||
if (!is_error) {
|
||||
/* Pass the packet up to the protocol layers. */
|
||||
NetReceive (NetRxPackets[0], packet_length);
|
||||
return packet_length;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*----------------------------------------------------
|
||||
* smc_close
|
||||
*
|
||||
* this makes the board clean up everything that it can
|
||||
* and not talk to the outside world. Caused by
|
||||
* an 'ifconfig ethX down'
|
||||
*
|
||||
-----------------------------------------------------*/
|
||||
static int smc_close ()
|
||||
{
|
||||
PRINTK2 ("%s:smc_close\n", SMC_DEV_NAME);
|
||||
|
||||
/* clear everything */
|
||||
smc_shutdown ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if SMC_DEBUG > 2
|
||||
static void print_packet (byte * buf, int length)
|
||||
{
|
||||
#if 0
|
||||
int i;
|
||||
int remainder;
|
||||
int lines;
|
||||
|
||||
printf ("Packet of length %d \n", length);
|
||||
|
||||
lines = length / 16;
|
||||
remainder = length % 16;
|
||||
|
||||
for (i = 0; i < lines; i++) {
|
||||
int cur;
|
||||
|
||||
for (cur = 0; cur < 8; cur++) {
|
||||
byte a, b;
|
||||
|
||||
a = *(buf++);
|
||||
b = *(buf++);
|
||||
printf ("%02x%02x ", a, b);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
for (i = 0; i < remainder / 2; i++) {
|
||||
byte a, b;
|
||||
|
||||
a = *(buf++);
|
||||
b = *(buf++);
|
||||
printf ("%02x%02x ", a, b);
|
||||
}
|
||||
printf ("\n");
|
||||
#endif /* 0 */
|
||||
}
|
||||
#endif /* SMC_DEBUG > 2 */
|
||||
|
||||
int eth_init (bd_t * bd)
|
||||
{
|
||||
smc_open ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void eth_halt ()
|
||||
{
|
||||
smc_close ();
|
||||
}
|
||||
|
||||
int eth_rx ()
|
||||
{
|
||||
return smc_rcv ();
|
||||
}
|
||||
|
||||
int eth_send (volatile void *packet, int length)
|
||||
{
|
||||
return smc_send_packet (packet, length);
|
||||
}
|
||||
|
||||
int eth_hw_init ()
|
||||
{
|
||||
return smc_hw_init ();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* smc_hw_init()
|
||||
*
|
||||
* Function:
|
||||
* Reset and enable the device, check if the I/O space location
|
||||
* is correct
|
||||
*
|
||||
* Input parameters:
|
||||
* None
|
||||
*
|
||||
* Output:
|
||||
* 0 --> success
|
||||
* 1 --> error
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
static int smc_hw_init ()
|
||||
{
|
||||
unsigned short status_test;
|
||||
|
||||
/* The attribute register of the LAN91C96 is located at address
|
||||
0x0e000000 on the lubbock platform */
|
||||
volatile unsigned *attaddr = (unsigned *) (0x0e000000);
|
||||
|
||||
/* first reset, then enable the device. Sequence is critical */
|
||||
attaddr[LAN91C96_ECOR] |= LAN91C96_ECOR_SRESET;
|
||||
udelay (100);
|
||||
attaddr[LAN91C96_ECOR] &= ~LAN91C96_ECOR_SRESET;
|
||||
attaddr[LAN91C96_ECOR] |= LAN91C96_ECOR_ENABLE;
|
||||
|
||||
/* force 16-bit mode */
|
||||
attaddr[LAN91C96_ECSR] &= ~LAN91C96_ECSR_IOIS8;
|
||||
udelay (100);
|
||||
|
||||
/* check if the I/O address is correct, the upper byte of the
|
||||
bank select register should read 0x33 */
|
||||
|
||||
status_test = SMC_inw (LAN91C96_BANK_SELECT);
|
||||
if ((status_test & 0xFF00) != 0x3300) {
|
||||
printf ("Failed to initialize ethernetchip\n");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* COMMANDS & CFG_NET */
|
||||
|
||||
#endif /* CONFIG_DRIVER_LAN91C96 */
|
||||
635
drivers/lan91c96.h
Normal file
635
drivers/lan91c96.h
Normal file
@@ -0,0 +1,635 @@
|
||||
/*------------------------------------------------------------------------
|
||||
* lan91c96.h
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Rolf Offermanns <rof@sysgo.de>
|
||||
* Copyright (C) 2001 Standard Microsystems Corporation (SMSC)
|
||||
* Developed by Simple Network Magic Corporation (SNMC)
|
||||
* Copyright (C) 1996 by Erik Stahlman (ES)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* This file contains register information and access macros for
|
||||
* the LAN91C96 single chip ethernet controller. It is a modified
|
||||
* version of the smc9111.h file.
|
||||
*
|
||||
* Information contained in this file was obtained from the LAN91C96
|
||||
* manual from SMC. To get a copy, if you really want one, you can find
|
||||
* information under www.smsc.com.
|
||||
*
|
||||
* Authors
|
||||
* Erik Stahlman ( erik@vt.edu )
|
||||
* Daris A Nevil ( dnevil@snmc.com )
|
||||
*
|
||||
* History
|
||||
* 04/30/03 Mathijs Haarman Modified smc91111.h (u-boot version)
|
||||
* for lan91c96
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef _LAN91C96_H_
|
||||
#define _LAN91C96_H_
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/io.h>
|
||||
#include <config.h>
|
||||
|
||||
/*
|
||||
* This function may be called by the board specific initialisation code
|
||||
* in order to override the default mac address.
|
||||
*/
|
||||
|
||||
void smc_set_mac_addr(const char *addr);
|
||||
int eth_hw_init(void);
|
||||
|
||||
|
||||
/* I want some simple types */
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
typedef unsigned long int dword;
|
||||
|
||||
/*
|
||||
* DEBUGGING LEVELS
|
||||
*
|
||||
* 0 for normal operation
|
||||
* 1 for slightly more details
|
||||
* >2 for various levels of increasingly useless information
|
||||
* 2 for interrupt tracking, status flags
|
||||
* 3 for packet info
|
||||
* 4 for complete packet dumps
|
||||
*/
|
||||
/*#define SMC_DEBUG 0 */
|
||||
|
||||
/* Because of bank switching, the LAN91xxx uses only 16 I/O ports */
|
||||
|
||||
#define SMC_IO_EXTENT 16
|
||||
|
||||
#ifdef CONFIG_PXA250
|
||||
|
||||
#define SMC_inl(r) (*((volatile dword *)(SMC_BASE_ADDRESS+( r * 4 ))))
|
||||
#define SMC_inw(r) (*((volatile word *)(SMC_BASE_ADDRESS+( r * 4 ))))
|
||||
#define SMC_inb(p) ({ \
|
||||
unsigned int __p = (unsigned int)(SMC_BASE_ADDRESS + (p * 4)); \
|
||||
unsigned int __v = *(volatile unsigned short *)((__p) & ~1); \
|
||||
if (__p & 1) __v >>= 8; \
|
||||
else __v &= 0xff; \
|
||||
__v; })
|
||||
|
||||
#define SMC_outl(d,r) (*((volatile dword *)(SMC_BASE_ADDRESS+(r * 4))) = d)
|
||||
#define SMC_outw(d,r) (*((volatile word *)(SMC_BASE_ADDRESS+(r * 4))) = d)
|
||||
#define SMC_outb(d,r) ({ word __d = (byte)(d); \
|
||||
word __w = SMC_inw((r)&~1); \
|
||||
__w &= ((r)&1) ? 0x00FF : 0xFF00; \
|
||||
__w |= ((r)&1) ? __d<<8 : __d; \
|
||||
SMC_outw(__w,(r)&~1); \
|
||||
})
|
||||
|
||||
#define SMC_outsl(r,b,l) ({ int __i; \
|
||||
dword *__b2; \
|
||||
__b2 = (dword *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
SMC_outl( *(__b2 + __i), r ); \
|
||||
} \
|
||||
})
|
||||
|
||||
#define SMC_outsw(r,b,l) ({ int __i; \
|
||||
word *__b2; \
|
||||
__b2 = (word *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
SMC_outw( *(__b2 + __i), r ); \
|
||||
} \
|
||||
})
|
||||
|
||||
#define SMC_insl(r,b,l) ({ int __i ; \
|
||||
dword *__b2; \
|
||||
__b2 = (dword *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
*(__b2 + __i) = SMC_inl(r); \
|
||||
SMC_inl(0); \
|
||||
}; \
|
||||
})
|
||||
|
||||
#define SMC_insw(r,b,l) ({ int __i ; \
|
||||
word *__b2; \
|
||||
__b2 = (word *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
*(__b2 + __i) = SMC_inw(r); \
|
||||
SMC_inw(0); \
|
||||
}; \
|
||||
})
|
||||
|
||||
#define SMC_insb(r,b,l) ({ int __i ; \
|
||||
byte *__b2; \
|
||||
__b2 = (byte *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
*(__b2 + __i) = SMC_inb(r); \
|
||||
SMC_inb(0); \
|
||||
}; \
|
||||
})
|
||||
|
||||
#else /* if not CONFIG_PXA250 */
|
||||
|
||||
/*
|
||||
* We have only 16 Bit PCMCIA access on Socket 0
|
||||
*/
|
||||
|
||||
#define SMC_inw(r) (*((volatile word *)(SMC_BASE_ADDRESS+(r))))
|
||||
#define SMC_inb(r) (((r)&1) ? SMC_inw((r)&~1)>>8 : SMC_inw(r)&0xFF)
|
||||
|
||||
#define SMC_outw(d,r) (*((volatile word *)(SMC_BASE_ADDRESS+(r))) = d)
|
||||
#define SMC_outb(d,r) ({ word __d = (byte)(d); \
|
||||
word __w = SMC_inw((r)&~1); \
|
||||
__w &= ((r)&1) ? 0x00FF : 0xFF00; \
|
||||
__w |= ((r)&1) ? __d<<8 : __d; \
|
||||
SMC_outw(__w,(r)&~1); \
|
||||
})
|
||||
#if 0
|
||||
#define SMC_outsw(r,b,l) outsw(SMC_BASE_ADDRESS+(r), (b), (l))
|
||||
#else
|
||||
#define SMC_outsw(r,b,l) ({ int __i; \
|
||||
word *__b2; \
|
||||
__b2 = (word *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
SMC_outw( *(__b2 + __i), r); \
|
||||
} \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define SMC_insw(r,b,l) insw(SMC_BASE_ADDRESS+(r), (b), (l))
|
||||
#else
|
||||
#define SMC_insw(r,b,l) ({ int __i ; \
|
||||
word *__b2; \
|
||||
__b2 = (word *) b; \
|
||||
for (__i = 0; __i < l; __i++) { \
|
||||
*(__b2 + __i) = SMC_inw(r); \
|
||||
SMC_inw(0); \
|
||||
}; \
|
||||
})
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Bank Select Field
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_BANK_SELECT 14 // Bank Select Register
|
||||
#define LAN91C96_BANKSELECT (0x3UC << 0)
|
||||
#define BANK0 0x00
|
||||
#define BANK1 0x01
|
||||
#define BANK2 0x02
|
||||
#define BANK3 0x03
|
||||
#define BANK4 0x04
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* EEPROM Addresses.
|
||||
****************************************************************************
|
||||
*/
|
||||
#define EEPROM_MAC_OFFSET_1 0x6020
|
||||
#define EEPROM_MAC_OFFSET_2 0x6021
|
||||
#define EEPROM_MAC_OFFSET_3 0x6022
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Bank 0 Register Map in I/O Space
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_TCR 0 // Transmit Control Register
|
||||
#define LAN91C96_EPH_STATUS 2 // EPH Status Register
|
||||
#define LAN91C96_RCR 4 // Receive Control Register
|
||||
#define LAN91C96_COUNTER 6 // Counter Register
|
||||
#define LAN91C96_MIR 8 // Memory Information Register
|
||||
#define LAN91C96_MCR 10 // Memory Configuration Register
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Transmit Control Register - Bank 0 - Offset 0
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_TCR_TXENA (0x1U << 0)
|
||||
#define LAN91C96_TCR_LOOP (0x1U << 1)
|
||||
#define LAN91C96_TCR_FORCOL (0x1U << 2)
|
||||
#define LAN91C96_TCR_TXP_EN (0x1U << 3)
|
||||
#define LAN91C96_TCR_PAD_EN (0x1U << 7)
|
||||
#define LAN91C96_TCR_NOCRC (0x1U << 8)
|
||||
#define LAN91C96_TCR_MON_CSN (0x1U << 10)
|
||||
#define LAN91C96_TCR_FDUPLX (0x1U << 11)
|
||||
#define LAN91C96_TCR_STP_SQET (0x1U << 12)
|
||||
#define LAN91C96_TCR_EPH_LOOP (0x1U << 13)
|
||||
#define LAN91C96_TCR_ETEN_TYPE (0x1U << 14)
|
||||
#define LAN91C96_TCR_FDSE (0x1U << 15)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* EPH Status Register - Bank 0 - Offset 2
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_EPHSR_TX_SUC (0x1U << 0)
|
||||
#define LAN91C96_EPHSR_SNGL_COL (0x1U << 1)
|
||||
#define LAN91C96_EPHSR_MUL_COL (0x1U << 2)
|
||||
#define LAN91C96_EPHSR_LTX_MULT (0x1U << 3)
|
||||
#define LAN91C96_EPHSR_16COL (0x1U << 4)
|
||||
#define LAN91C96_EPHSR_SQET (0x1U << 5)
|
||||
#define LAN91C96_EPHSR_LTX_BRD (0x1U << 6)
|
||||
#define LAN91C96_EPHSR_TX_DEFR (0x1U << 7)
|
||||
#define LAN91C96_EPHSR_WAKEUP (0x1U << 8)
|
||||
#define LAN91C96_EPHSR_LATCOL (0x1U << 9)
|
||||
#define LAN91C96_EPHSR_LOST_CARR (0x1U << 10)
|
||||
#define LAN91C96_EPHSR_EXC_DEF (0x1U << 11)
|
||||
#define LAN91C96_EPHSR_CTR_ROL (0x1U << 12)
|
||||
|
||||
#define LAN91C96_EPHSR_LINK_OK (0x1U << 14)
|
||||
#define LAN91C96_EPHSR_TX_UNRN (0x1U << 15)
|
||||
|
||||
#define LAN91C96_EPHSR_ERRORS (LAN91C96_EPHSR_SNGL_COL | \
|
||||
LAN91C96_EPHSR_MUL_COL | \
|
||||
LAN91C96_EPHSR_16COL | \
|
||||
LAN91C96_EPHSR_SQET | \
|
||||
LAN91C96_EPHSR_TX_DEFR | \
|
||||
LAN91C96_EPHSR_LATCOL | \
|
||||
LAN91C96_EPHSR_LOST_CARR | \
|
||||
LAN91C96_EPHSR_EXC_DEF | \
|
||||
LAN91C96_EPHSR_LINK_OK | \
|
||||
LAN91C96_EPHSR_TX_UNRN)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Receive Control Register - Bank 0 - Offset 4
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_RCR_RX_ABORT (0x1U << 0)
|
||||
#define LAN91C96_RCR_PRMS (0x1U << 1)
|
||||
#define LAN91C96_RCR_ALMUL (0x1U << 2)
|
||||
#define LAN91C96_RCR_RXEN (0x1U << 8)
|
||||
#define LAN91C96_RCR_STRIP_CRC (0x1U << 9)
|
||||
#define LAN91C96_RCR_FILT_CAR (0x1U << 14)
|
||||
#define LAN91C96_RCR_SOFT_RST (0x1U << 15)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Counter Register - Bank 0 - Offset 6
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ECR_SNGL_COL (0xFU << 0)
|
||||
#define LAN91C96_ECR_MULT_COL (0xFU << 5)
|
||||
#define LAN91C96_ECR_DEF_TX (0xFU << 8)
|
||||
#define LAN91C96_ECR_EXC_DEF_TX (0xFU << 12)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Memory Information Register - Bank 0 - OFfset 8
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_MIR_SIZE (0x18 << 0) // 6144 bytes
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Memory Configuration Register - Bank 0 - Offset 10
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_MCR_MEM_RES (0xFFU << 0)
|
||||
#define LAN91C96_MCR_MEM_MULT (0x3U << 9)
|
||||
#define LAN91C96_MCR_HIGH_ID (0x3U << 12)
|
||||
|
||||
#define LAN91C96_MCR_TRANSMIT_PAGES 0x6
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Bank 1 Register Map in I/O Space
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_CONFIG 0 // Configuration Register
|
||||
#define LAN91C96_BASE 2 // Base Address Register
|
||||
#define LAN91C96_IA0 4 // Individual Address Register - 0
|
||||
#define LAN91C96_IA1 5 // Individual Address Register - 1
|
||||
#define LAN91C96_IA2 6 // Individual Address Register - 2
|
||||
#define LAN91C96_IA3 7 // Individual Address Register - 3
|
||||
#define LAN91C96_IA4 8 // Individual Address Register - 4
|
||||
#define LAN91C96_IA5 9 // Individual Address Register - 5
|
||||
#define LAN91C96_GEN_PURPOSE 10 // General Address Registers
|
||||
#define LAN91C96_CONTROL 12 // Control Register
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Configuration Register - Bank 1 - Offset 0
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_CR_INT_SEL0 (0x1U << 1)
|
||||
#define LAN91C96_CR_INT_SEL1 (0x1U << 2)
|
||||
#define LAN91C96_CR_RES (0x3U << 3)
|
||||
#define LAN91C96_CR_DIS_LINK (0x1U << 6)
|
||||
#define LAN91C96_CR_16BIT (0x1U << 7)
|
||||
#define LAN91C96_CR_AUI_SELECT (0x1U << 8)
|
||||
#define LAN91C96_CR_SET_SQLCH (0x1U << 9)
|
||||
#define LAN91C96_CR_FULL_STEP (0x1U << 10)
|
||||
#define LAN91C96_CR_NO_WAIT (0x1U << 12)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Base Address Register - Bank 1 - Offset 2
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_BAR_RA_BITS (0x27U << 0)
|
||||
#define LAN91C96_BAR_ROM_SIZE (0x1U << 6)
|
||||
#define LAN91C96_BAR_A_BITS (0xFFU << 8)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Control Register - Bank 1 - Offset 12
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_CTR_STORE (0x1U << 0)
|
||||
#define LAN91C96_CTR_RELOAD (0x1U << 1)
|
||||
#define LAN91C96_CTR_EEPROM (0x1U << 2)
|
||||
#define LAN91C96_CTR_TE_ENABLE (0x1U << 5)
|
||||
#define LAN91C96_CTR_CR_ENABLE (0x1U << 6)
|
||||
#define LAN91C96_CTR_LE_ENABLE (0x1U << 7)
|
||||
#define LAN91C96_CTR_BIT_8 (0x1U << 8)
|
||||
#define LAN91C96_CTR_AUTO_RELEASE (0x1U << 11)
|
||||
#define LAN91C96_CTR_WAKEUP_EN (0x1U << 12)
|
||||
#define LAN91C96_CTR_PWRDN (0x1U << 13)
|
||||
#define LAN91C96_CTR_RCV_BAD (0x1U << 14)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Bank 2 Register Map in I/O Space
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_MMU 0 // MMU Command Register
|
||||
#define LAN91C96_AUTO_TX_START 1 // Auto Tx Start Register
|
||||
#define LAN91C96_PNR 2 // Packet Number Register
|
||||
#define LAN91C96_ARR 3 // Allocation Result Register
|
||||
#define LAN91C96_FIFO 4 // FIFO Ports Register
|
||||
#define LAN91C96_POINTER 6 // Pointer Register
|
||||
#define LAN91C96_DATA_HIGH 8 // Data High Register
|
||||
#define LAN91C96_DATA_LOW 10 // Data Low Register
|
||||
#define LAN91C96_INT_STATS 12 // Interrupt Status Register - RO
|
||||
#define LAN91C96_INT_ACK 12 // Interrupt Acknowledge Register -WO
|
||||
#define LAN91C96_INT_MASK 13 // Interrupt Mask Register
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* MMU Command Register - Bank 2 - Offset 0
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_MMUCR_NO_BUSY (0x1U << 0)
|
||||
#define LAN91C96_MMUCR_N1 (0x1U << 1)
|
||||
#define LAN91C96_MMUCR_N2 (0x1U << 2)
|
||||
#define LAN91C96_MMUCR_COMMAND (0xFU << 4)
|
||||
#define LAN91C96_MMUCR_ALLOC_TX (0x2U << 4) // WXYZ = 0010
|
||||
#define LAN91C96_MMUCR_RESET_MMU (0x4U << 4) // WXYZ = 0100
|
||||
#define LAN91C96_MMUCR_REMOVE_RX (0x6U << 4) // WXYZ = 0110
|
||||
#define LAN91C96_MMUCR_REMOVE_TX (0x7U << 4) // WXYZ = 0111
|
||||
#define LAN91C96_MMUCR_RELEASE_RX (0x8U << 4) // WXYZ = 1000
|
||||
#define LAN91C96_MMUCR_RELEASE_TX (0xAU << 4) // WXYZ = 1010
|
||||
#define LAN91C96_MMUCR_ENQUEUE (0xCU << 4) // WXYZ = 1100
|
||||
#define LAN91C96_MMUCR_RESET_TX (0xEU << 4) // WXYZ = 1110
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Auto Tx Start Register - Bank 2 - Offset 1
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_AUTOTX (0xFFU << 0)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Packet Number Register - Bank 2 - Offset 2
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_PNR_TX (0x1FU << 0)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Allocation Result Register - Bank 2 - Offset 3
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ARR_ALLOC_PN (0x7FU << 0)
|
||||
#define LAN91C96_ARR_FAILED (0x1U << 7)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* FIFO Ports Register - Bank 2 - Offset 4
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_FIFO_TX_DONE_PN (0x1FU << 0)
|
||||
#define LAN91C96_FIFO_TEMPTY (0x1U << 7)
|
||||
#define LAN91C96_FIFO_RX_DONE_PN (0x1FU << 8)
|
||||
#define LAN91C96_FIFO_RXEMPTY (0x1U << 15)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Pointer Register - Bank 2 - Offset 6
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_PTR_LOW (0xFFU << 0)
|
||||
#define LAN91C96_PTR_HIGH (0x7U << 8)
|
||||
#define LAN91C96_PTR_AUTO_TX (0x1U << 11)
|
||||
#define LAN91C96_PTR_ETEN (0x1U << 12)
|
||||
#define LAN91C96_PTR_READ (0x1U << 13)
|
||||
#define LAN91C96_PTR_AUTO_INCR (0x1U << 14)
|
||||
#define LAN91C96_PTR_RCV (0x1U << 15)
|
||||
|
||||
#define LAN91C96_PTR_RX_FRAME (LAN91C96_PTR_RCV | \
|
||||
LAN91C96_PTR_AUTO_INCR | \
|
||||
LAN91C96_PTR_READ)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Data Register - Bank 2 - Offset 8
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_CONTROL_CRC (0x1U << 4) // CRC bit
|
||||
#define LAN91C96_CONTROL_ODD (0x1U << 5) // ODD bit
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Interrupt Status Register - Bank 2 - Offset 12
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_IST_RCV_INT (0x1U << 0)
|
||||
#define LAN91C96_IST_TX_INT (0x1U << 1)
|
||||
#define LAN91C96_IST_TX_EMPTY_INT (0x1U << 2)
|
||||
#define LAN91C96_IST_ALLOC_INT (0x1U << 3)
|
||||
#define LAN91C96_IST_RX_OVRN_INT (0x1U << 4)
|
||||
#define LAN91C96_IST_EPH_INT (0x1U << 5)
|
||||
#define LAN91C96_IST_ERCV_INT (0x1U << 6)
|
||||
#define LAN91C96_IST_RX_IDLE_INT (0x1U << 7)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Interrupt Acknowledge Register - Bank 2 - Offset 12
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ACK_TX_INT (0x1U << 1)
|
||||
#define LAN91C96_ACK_TX_EMPTY_INT (0x1U << 2)
|
||||
#define LAN91C96_ACK_RX_OVRN_INT (0x1U << 4)
|
||||
#define LAN91C96_ACK_ERCV_INT (0x1U << 6)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Interrupt Mask Register - Bank 2 - Offset 13
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_MSK_RCV_INT (0x1U << 0)
|
||||
#define LAN91C96_MSK_TX_INT (0x1U << 1)
|
||||
#define LAN91C96_MSK_TX_EMPTY_INT (0x1U << 2)
|
||||
#define LAN91C96_MSK_ALLOC_INT (0x1U << 3)
|
||||
#define LAN91C96_MSK_RX_OVRN_INT (0x1U << 4)
|
||||
#define LAN91C96_MSK_EPH_INT (0x1U << 5)
|
||||
#define LAN91C96_MSK_ERCV_INT (0x1U << 6)
|
||||
#define LAN91C96_MSK_TX_IDLE_INT (0x1U << 7)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Bank 3 Register Map in I/O Space
|
||||
**************************************************************************
|
||||
*/
|
||||
#define LAN91C96_MGMT_MDO (0x1U << 0)
|
||||
#define LAN91C96_MGMT_MDI (0x1U << 1)
|
||||
#define LAN91C96_MGMT_MCLK (0x1U << 2)
|
||||
#define LAN91C96_MGMT_MDOE (0x1U << 3)
|
||||
#define LAN91C96_MGMT_LOW_ID (0x3U << 4)
|
||||
#define LAN91C96_MGMT_IOS0 (0x1U << 8)
|
||||
#define LAN91C96_MGMT_IOS1 (0x1U << 9)
|
||||
#define LAN91C96_MGMT_IOS2 (0x1U << 10)
|
||||
#define LAN91C96_MGMT_nXNDEC (0x1U << 11)
|
||||
#define LAN91C96_MGMT_HIGH_ID (0x3U << 12)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Revision Register - Bank 3 - Offset 10
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_REV_REVID (0xFU << 0)
|
||||
#define LAN91C96_REV_CHIPID (0xFU << 4)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Early RCV Register - Bank 3 - Offset 12
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ERCV_THRESHOLD (0x1FU << 0)
|
||||
#define LAN91C96_ERCV_RCV_DISCRD (0x1U << 7)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* PCMCIA Configuration Registers
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ECOR 0x8000 // Ethernet Configuration Register
|
||||
#define LAN91C96_ECSR 0x8002 // Ethernet Configuration and Status
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* PCMCIA Ethernet Configuration Option Register (ECOR)
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ECOR_ENABLE (0x1U << 0)
|
||||
#define LAN91C96_ECOR_WR_ATTRIB (0x1U << 2)
|
||||
#define LAN91C96_ECOR_LEVEL_REQ (0x1U << 6)
|
||||
#define LAN91C96_ECOR_SRESET (0x1U << 7)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* PCMCIA Ethernet Configuration and Status Register (ECSR)
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_ECSR_INTR (0x1U << 1)
|
||||
#define LAN91C96_ECSR_PWRDWN (0x1U << 2)
|
||||
#define LAN91C96_ECSR_IOIS8 (0x1U << 5)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Receive Frame Status Word - See page 38 of the LAN91C96 specification.
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_TOO_SHORT (0x1U << 10)
|
||||
#define LAN91C96_TOO_LONG (0x1U << 11)
|
||||
#define LAN91C96_ODD_FRM (0x1U << 12)
|
||||
#define LAN91C96_BAD_CRC (0x1U << 13)
|
||||
#define LAN91C96_BROD_CAST (0x1U << 14)
|
||||
#define LAN91C96_ALGN_ERR (0x1U << 15)
|
||||
|
||||
#define FRAME_FILTER (LAN91C96_TOO_SHORT | LAN91C96_TOO_LONG | LAN91C96_BAD_CRC | LAN91C96_ALGN_ERR)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Default MAC Address
|
||||
****************************************************************************
|
||||
*/
|
||||
#define MAC_DEF_HI 0x0800
|
||||
#define MAC_DEF_MED 0x3333
|
||||
#define MAC_DEF_LO 0x0100
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* Default I/O Signature - 0x33
|
||||
****************************************************************************
|
||||
*/
|
||||
#define LAN91C96_LOW_SIGNATURE (0x33U << 0)
|
||||
#define LAN91C96_HIGH_SIGNATURE (0x33U << 8)
|
||||
#define LAN91C96_SIGNATURE (LAN91C96_HIGH_SIGNATURE | LAN91C96_LOW_SIGNATURE)
|
||||
|
||||
#define LAN91C96_MAX_PAGES 6 // Maximum number of 256 pages.
|
||||
#define ETHERNET_MAX_LENGTH 1514
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* I define some macros to make it easier to do somewhat common
|
||||
* or slightly complicated, repeated tasks.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* select a register bank, 0 to 3 */
|
||||
|
||||
#define SMC_SELECT_BANK(x) { SMC_outw( x, LAN91C96_BANK_SELECT ); }
|
||||
|
||||
/* this enables an interrupt in the interrupt mask register */
|
||||
#define SMC_ENABLE_INT(x) {\
|
||||
unsigned char mask;\
|
||||
SMC_SELECT_BANK(2);\
|
||||
mask = SMC_inb( LAN91C96_INT_MASK );\
|
||||
mask |= (x);\
|
||||
SMC_outb( mask, LAN91C96_INT_MASK ); \
|
||||
}
|
||||
|
||||
/* this disables an interrupt from the interrupt mask register */
|
||||
|
||||
#define SMC_DISABLE_INT(x) {\
|
||||
unsigned char mask;\
|
||||
SMC_SELECT_BANK(2);\
|
||||
mask = SMC_inb( LAN91C96_INT_MASK );\
|
||||
mask &= ~(x);\
|
||||
SMC_outb( mask, LAN91C96_INT_MASK ); \
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Define the interrupts that I want to receive from the card
|
||||
*
|
||||
* I want:
|
||||
* LAN91C96_IST_EPH_INT, for nasty errors
|
||||
* LAN91C96_IST_RCV_INT, for happy received packets
|
||||
* LAN91C96_IST_RX_OVRN_INT, because I have to kick the receiver
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#define SMC_INTERRUPT_MASK (LAN91C96_IST_EPH_INT | LAN91C96_IST_RX_OVRN_INT | LAN91C96_IST_RCV_INT)
|
||||
|
||||
#endif /* _LAN91C96_H_ */
|
||||
@@ -21,7 +21,7 @@
|
||||
#define cfg_read(val, addr, type, op) *val = op((type)(addr))
|
||||
#define cfg_write(val, addr, type, op) op((type *)(addr), (val))
|
||||
|
||||
#ifdef CONFIG_PM826
|
||||
#if defined(CONFIG_MPC8260)
|
||||
#define INDIRECT_PCI_OP(rw, size, type, op, mask) \
|
||||
static int \
|
||||
indirect_##rw##_config_##size(struct pci_controller *hose, \
|
||||
|
||||
@@ -170,7 +170,7 @@ typedef struct cpm_buf_desc {
|
||||
*/
|
||||
#define PROFF_SMC1 (0)
|
||||
#define PROFF_SMC2 (64)
|
||||
|
||||
#define PROFF_SPI ((16*1024) - 128)
|
||||
|
||||
/* Define enough so I can at least use the serial port as a UART.
|
||||
*/
|
||||
@@ -737,6 +737,17 @@ typedef struct spi {
|
||||
#define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
|
||||
#define SPMODE_PM(x) ((x) &0xF)
|
||||
|
||||
/* SPI Event/Mask register.
|
||||
*/
|
||||
#define SPI_EMASK 0x37 /* Event Mask */
|
||||
#define SPI_MME 0x20 /* Multi-Master Error */
|
||||
#define SPI_TXE 0x10 /* Transmit Error */
|
||||
#define SPI_BSY 0x04 /* Busy */
|
||||
#define SPI_TXB 0x02 /* Tx Buffer Empty */
|
||||
#define SPI_RXB 0x01 /* RX Buffer full/closed */
|
||||
|
||||
#define SPI_STR 0x80 /* SPCOM: Start transmit */
|
||||
|
||||
#define SPI_EB ((u_char)0x10) /* big endian byte order */
|
||||
|
||||
#define BD_IIC_START ((ushort)0x0400)
|
||||
|
||||
@@ -70,10 +70,18 @@ typedef struct global_data {
|
||||
#endif
|
||||
#ifdef CONFIG_POST
|
||||
unsigned long post_log_word; /* Record POST activities */
|
||||
unsigned long post_init_f_time; /* When post_init_f started */
|
||||
#endif
|
||||
#ifdef CONFIG_BOARD_TYPES
|
||||
unsigned long board_type;
|
||||
#endif
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
unsigned long do_mdm_init;
|
||||
unsigned long be_quiet;
|
||||
#endif
|
||||
#ifdef CONFIG_LWMON
|
||||
unsigned long kbd_status;
|
||||
#endif
|
||||
} gd_t;
|
||||
|
||||
/*
|
||||
|
||||
77
include/bmp_layout.h
Normal file
77
include/bmp_layout.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* (C) Copyright 2002
|
||||
* Detlev Zundel, DENX Software Engineering, dzu@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
|
||||
*/
|
||||
|
||||
/************************************************************************/
|
||||
/* ** Layout of a bmp file */
|
||||
/************************************************************************/
|
||||
|
||||
#ifndef _BMP_H_
|
||||
#define _BMP_H_
|
||||
|
||||
typedef struct bmp_color_table_entry {
|
||||
__u8 blue;
|
||||
__u8 green;
|
||||
__u8 red;
|
||||
__u8 reserved;
|
||||
} __attribute__((packed)) bmp_color_table_entry_t;
|
||||
|
||||
/* When accessing these fields, remember that they are stored in little
|
||||
endian format, so use linux macros, e.g. le32_to_cpu(width) */
|
||||
|
||||
typedef struct bmp_header {
|
||||
/* Header */
|
||||
char signature[2];
|
||||
__u32 file_size;
|
||||
__u32 reserved;
|
||||
__u32 data_offset;
|
||||
/* InfoHeader */
|
||||
__u32 size;
|
||||
__u32 width;
|
||||
__u32 height;
|
||||
__u16 planes;
|
||||
__u16 bit_count;
|
||||
__u32 compression;
|
||||
__u32 image_size;
|
||||
__u32 x_pixels_per_m;
|
||||
__u32 y_pixels_per_m;
|
||||
__u32 colors_used;
|
||||
__u32 colors_important;
|
||||
/* ColorTable */
|
||||
|
||||
} __attribute__((packed)) bmp_header_t;
|
||||
|
||||
typedef struct bmp_image {
|
||||
bmp_header_t header;
|
||||
/* We use a zero sized array just as a placeholder for variable
|
||||
sized array */
|
||||
bmp_color_table_entry_t color_table[0];
|
||||
} bmp_image_t;
|
||||
|
||||
/* Data in the bmp_image is aligned to this length */
|
||||
#define BMP_DATA_ALIGN 4
|
||||
|
||||
/* Constants for the compression field */
|
||||
#define BMP_BI_RGB 0
|
||||
#define BMP_BI_RLE8 1
|
||||
#define BMP_BI_RLE4 2
|
||||
|
||||
#endif /* _BMP_H_ */
|
||||
44
include/cmd_bmp.h
Normal file
44
include/cmd_bmp.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* (C) Copyright 2002
|
||||
* Detlev Zundel, DENX Software Engineering, dzu@denx.de.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Bitmap display support
|
||||
*/
|
||||
#ifndef _CMD_BMP_H
|
||||
#define _CMD_BMP_H
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
|
||||
#define CMD_TBL_BMP MK_CMD_TBL_ENTRY( \
|
||||
"bmp", 3, 3, 1, do_bmp, \
|
||||
"bmp - manipulate BMP image data\n", \
|
||||
"info <imageAddr> - display image info\n" \
|
||||
"bmp display <imageAddr> - display image\n" \
|
||||
),
|
||||
int do_bmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
|
||||
#else
|
||||
#define CMD_TBL_BMP
|
||||
#endif
|
||||
|
||||
#endif /* _CMD_BMP_H */
|
||||
@@ -79,6 +79,7 @@
|
||||
#define CFG_CMD_FDOS 0x0000200000000000 /* Floppy DOS support */
|
||||
#define CFG_CMD_VFD 0x0000400000000000 /* VFD support (TRAB) */
|
||||
#define CFG_CMD_NAND 0x0000800000000000 /* NAND support */
|
||||
#define CFG_CMD_BMP 0x0001000000000000 /* BMP support */
|
||||
|
||||
#define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFF /* ALL commands */
|
||||
|
||||
@@ -87,6 +88,7 @@
|
||||
*/
|
||||
#define CFG_CMD_NONSTD (CFG_CMD_ASKENV | \
|
||||
CFG_CMD_BEDBUG | \
|
||||
CFG_CMD_BMP | \
|
||||
CFG_CMD_BSP | \
|
||||
CFG_CMD_CACHE | \
|
||||
CFG_CMD_DATE | \
|
||||
|
||||
@@ -31,9 +31,10 @@
|
||||
#include <command.h>
|
||||
|
||||
/*
|
||||
* Type string for PPC bootable partitions
|
||||
* Type string for U-Boot bootable partitions
|
||||
*/
|
||||
#define BOOT_PART_TYPE "U-Boot"
|
||||
#define BOOT_PART_TYPE "U-Boot" /* primary boot partition type */
|
||||
#define BOOT_PART_COMP "PPCBoot" /* PPCBoot compatibility type */
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
@@ -29,10 +29,12 @@
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_VFD)
|
||||
#define CMD_TBL_VFD MK_CMD_TBL_ENTRY( \
|
||||
"vfd", 3, 2, 0, do_vfd, \
|
||||
"vfd", 3, 2, 0, do_vfd, \
|
||||
"vfd - load a bitmap to the VFDs on TRAB\n", \
|
||||
"N\n" \
|
||||
" - load bitmap N to the VFDs (N is _decimal_ !!!)\n"\
|
||||
"#N\n" \
|
||||
" - load bitmap no. N to the VFDs (N is _decimal_ !!!)\n" \
|
||||
"vfd addr\n" \
|
||||
" - load bitmap at address _addr_ to the VFDs\n" \
|
||||
),
|
||||
|
||||
/* Implemented in common/cmd_misc.c */
|
||||
|
||||
@@ -75,7 +75,8 @@ typedef void (interrupt_handler_t)(void *);
|
||||
|
||||
/* enable common handling for all TQM8xxL boards */
|
||||
#if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || \
|
||||
defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L)
|
||||
defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L) || \
|
||||
defined(CONFIG_TQM862L)
|
||||
# ifndef CONFIG_TQM8xxL
|
||||
# define CONFIG_TQM8xxL
|
||||
# endif
|
||||
@@ -197,7 +198,7 @@ extern void pic_write (uchar reg, uchar val);
|
||||
# define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR
|
||||
#endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */
|
||||
|
||||
#if defined(CONFIG_PCU_E) || defined(CONFIG_CCM)
|
||||
#if defined(CONFIG_PCU_E) || defined(CONFIG_CCM) || defined(CONFIG_ATC)
|
||||
extern void spi_init_f (void);
|
||||
extern void spi_init_r (void);
|
||||
extern ssize_t spi_read (uchar *, int, uchar *, int);
|
||||
|
||||
@@ -1362,9 +1362,11 @@ typedef struct scc_enet {
|
||||
#define SICR_ENET_CLKRT ((uint)0x00002600)
|
||||
#endif /* CONFIG_MVS v1, CONFIG_TQM823L, CONFIG_TQM850L, etc. */
|
||||
|
||||
/*** TQM860L, TQM855L ************************************************/
|
||||
/*** TQM855L, TQM860L, TQM862L **************************************/
|
||||
|
||||
#if (defined(CONFIG_TQM860L) || defined(CONFIG_TQM855L))
|
||||
#if defined(CONFIG_TQM855L) || \
|
||||
defined(CONFIG_TQM860L) || \
|
||||
defined(CONFIG_TQM862L)
|
||||
|
||||
# ifdef CONFIG_SCC1_ENET /* use SCC for 10Mbps Ethernet */
|
||||
|
||||
@@ -1412,7 +1414,7 @@ typedef struct scc_enet {
|
||||
#define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
|
||||
|
||||
# endif /* CONFIG_FEC_ENET */
|
||||
#endif /* CONFIG_TQM860L, CONFIG_TQM855L */
|
||||
#endif /* CONFIG_TQM855L, TQM860L, TQM862L */
|
||||
|
||||
/*** V37 **********************************************************/
|
||||
|
||||
|
||||
@@ -41,43 +41,28 @@
|
||||
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
|
||||
#define CONFIG_MII 1 /* MII PHY management */
|
||||
#define CONFIG_PHY_ADDR 1 /* PHY address; handling of ENET */
|
||||
#define CONFIG_BOARD_PRE_INIT 1 /* setup for 405gp */
|
||||
#define CONFIG_BOARD_PRE_INIT 1 /* early setup for 405gp */
|
||||
#define CONFIG_MISC_INIT_R 1 /* so that a misc_init_r() is called */
|
||||
|
||||
/* set PRAM to keep U-Boot out, mem= to keep linux out, and initrd_hi to
|
||||
* keep possible initrd ramdisk decompression out. This is in k (1024 bytes)
|
||||
#define CONFIG_PRAM 16
|
||||
#define CONFIG_PRAM 16
|
||||
*/
|
||||
#define CONFIG_LOADADDR 0x100000
|
||||
#define CONFIG_LOADADDR 0x100000 /* where TFTP images go */
|
||||
#undef CONFIG_BOOTARGS
|
||||
|
||||
/* the logic is that booting is driven by what env vars get set from DHCP.
|
||||
* Normal DHCP sets things like serverip, rootpath, etc.
|
||||
* if printenv
|
||||
/* Bootcmd is overridden by the bootscript in board/cray/L1
|
||||
*/
|
||||
#define CFG_AUTOLOAD "yes"
|
||||
#define CONFIG_BOOTCOMMAND "dhcp;"\
|
||||
"setenv bootargs devfs=mount;"\
|
||||
"setenv bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:::off $bootargs;"\
|
||||
"if printenv initrd;"\
|
||||
"then;" \
|
||||
"setenv initrd_hi $mem;"\
|
||||
"tftp 1000000 $initrd;"\
|
||||
"setenv bootargs root=/dev/ram0 rw cwsroot=$serverip:$rootpath $bootargs;"\
|
||||
"bootm 100000 1000000;"\
|
||||
"else;"\
|
||||
"setenv bootargs root=/dev/nfs ro nfsroot=$serverip:$rootpath $bootargs;"\
|
||||
"bootm 100000;"\
|
||||
"fi;"
|
||||
#define CFG_AUTOLOAD "no"
|
||||
#define CONFIG_BOOTCOMMAND "dhcp"
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS ""
|
||||
|
||||
/*
|
||||
/*
|
||||
* ..during experiments..
|
||||
#define CONFIG_SERVERIP 10.0.0.1
|
||||
#define CONFIG_ETHADDR 00:40:a6:80:14:5
|
||||
#define CONFIG_ETHADDR 00:40:a6:80:14:5
|
||||
*/
|
||||
#define CONFIG_HARD_I2C 1 /* hardware support for i2c */
|
||||
#define CONFIG_SDRAM_BANK0 1
|
||||
#define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
|
||||
#define CFG_I2C_SLAVE 0x7F
|
||||
#define CFG_I2C_EEPROM_ADDR 0x57
|
||||
@@ -87,6 +72,7 @@
|
||||
#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
|
||||
#define CFG_HUSH_PARSER 1
|
||||
#define CFG_PROMPT_HUSH_PS2 "> "
|
||||
#define CONFIG_AUTOSCRIPT 1
|
||||
|
||||
|
||||
#define CONFIG_COMMANDS (\
|
||||
@@ -106,6 +92,8 @@
|
||||
CFG_CMD_RUN|\
|
||||
CFG_CMD_I2C|\
|
||||
CFG_CMD_EEPROM|\
|
||||
CFG_CMD_DIAG|\
|
||||
CFG_CMD_AUTOSCRIPT|\
|
||||
CFG_CMD_SETGETDCR)
|
||||
|
||||
/*
|
||||
@@ -120,7 +108,13 @@
|
||||
CONFIG_BOOTP_BOOTFILESIZE|\
|
||||
CONFIG_BOOTP_BOOTPATH)
|
||||
|
||||
/*
|
||||
/*
|
||||
* how many time to fail & restart a net-TFTP before giving up & resetting
|
||||
* the board hoping that a reset of net interface might help..
|
||||
*/
|
||||
#define CONFIG_NET_RESET 5
|
||||
|
||||
/*
|
||||
* bauds. Just to make it compile; in our case, I read the base_baud
|
||||
* from the DCR anyway, so its kinda-tied to the above ref. clock which in turn
|
||||
* drives the system clock.
|
||||
@@ -145,6 +139,7 @@
|
||||
#define CFG_LOAD_ADDR 0x100000/* where to load what we get from TFTP */
|
||||
#define CFG_TFTP_LOADADDR CFG_LOAD_ADDR
|
||||
#define CFG_EXTBDINFO 1 /* To use extended board_into (bd_t) */
|
||||
#define CFG_DRAM_TEST 1
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
@@ -155,15 +150,8 @@
|
||||
#define CFG_FLASH_BASE 0xFFC00000
|
||||
#define CFG_MONITOR_BASE TEXT_BASE
|
||||
|
||||
#ifndef CFG_HUSH_PARSER
|
||||
#define CFG_MONITOR_LEN (128 * 1024) /* Reserve 128 kB for Monitor */
|
||||
#define CFG_ENV_OFFSET 0x3D0000
|
||||
#else
|
||||
#define CFG_MONITOR_LEN (192 * 1024) /* Reserve 192 kB for Monitor */
|
||||
#define CFG_ENV_OFFSET 0x3FE000
|
||||
#endif
|
||||
|
||||
#define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */
|
||||
#define CFG_MONITOR_LEN (192 * 1024) /* Reserve 192 kB for Monitor */
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
@@ -180,11 +168,12 @@
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
/* BEG ENVIRONNEMENT FLASH: needs to be a whole FlashSector */
|
||||
#define CFG_ENV_OFFSET 0x3c8000
|
||||
#define CFG_ENV_IS_IN_FLASH 1 /* use FLASH for environment vars */
|
||||
#define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
|
||||
#define CFG_ENV_SIZE 0x1000 /* Total Size of Environment area */
|
||||
#define CFG_ENV_SECT_SIZE 0x10000 /* see README - env sector total size */
|
||||
|
||||
/* Memory tests: U-Boot relocates itself to the top of Ram, so its at
|
||||
/* Memory tests: U-BOOT relocates itself to the top of Ram, so its at
|
||||
* 32meg-(128k+some_malloc_space+copy-of-ENV sector)..
|
||||
*/
|
||||
#define CFG_SDRAM_SIZE 32 /* megs of ram */
|
||||
@@ -193,6 +182,7 @@
|
||||
/* to the end of the DRAM */
|
||||
/* less monitor and malloc area */
|
||||
#define CFG_STACK_USAGE 0x10000 /* Reserve 64k for the stack usage */
|
||||
#define CFG_MALLOC_LEN (128 << 10) /* 128k for malloc space */
|
||||
#define CFG_MEM_END_USAGE ( CFG_MONITOR_LEN \
|
||||
+ CFG_MALLOC_LEN \
|
||||
+ CFG_ENV_SECT_SIZE \
|
||||
@@ -202,7 +192,7 @@
|
||||
/* END ENVIRONNEMENT FLASH */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Cache Configuration. Only used to ..?? clear it, I guess..
|
||||
* Cache Configuration. Only used to ..?? clear it, I guess..
|
||||
*/
|
||||
#define CFG_DCACHE_SIZE 16384
|
||||
#define CFG_CACHELINE_SIZE 32
|
||||
@@ -219,20 +209,26 @@
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for initial stack pointer and data area (in OnChipMem )
|
||||
*/
|
||||
#if 0
|
||||
#define CFG_INIT_RAM_ADDR 0x40000000 /* use data cache */
|
||||
#define CFG_INIT_RAM_END 0x2000 /* End of used area in RAM */
|
||||
#else
|
||||
#if 1
|
||||
/* On Chip Memory location */
|
||||
#define CFG_TEMP_STACK_OCM 1
|
||||
#define CFG_OCM_DATA_ADDR 0xF0000000
|
||||
#define CFG_OCM_DATA_SIZE 0x1000
|
||||
|
||||
#define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* inside of SDRAM */
|
||||
#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of used area in RAM */
|
||||
#define CFG_GBL_DATA_SIZE 256 /* size in bytes reserved for initial data */
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
#else
|
||||
#define CFG_OCM_DATA_ADDR 0xF0000000
|
||||
#define CFG_OCM_DATA_SIZE 0x1000
|
||||
#define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* inside of On Chip SRAM */
|
||||
#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of On Chip SRAM */
|
||||
#endif
|
||||
|
||||
#define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for Serial Presence Detect EEPROM address
|
||||
|
||||
@@ -159,8 +159,8 @@
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 4 /* max number of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
|
||||
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 16 /* max number of sectors on one chip */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
@@ -38,14 +38,22 @@
|
||||
/*
|
||||
* Identify the board
|
||||
*/
|
||||
#define CONFIG_IDENT_STRING " GEN860T"
|
||||
#if !defined(CONFIG_SC)
|
||||
#define CONFIG_IDENT_STRING " B2"
|
||||
#else
|
||||
#define CONFIG_IDENT_STRING " SC"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't depend on the RTC clock to determine clock frequency -
|
||||
* the 860's internal rtc uses a 32.768 KHz clock which is
|
||||
* generated by the DS1337 - and the DS1337 clock can be turned off.
|
||||
*/
|
||||
#define CONFIG_8xx_GCLK_FREQ 66600000
|
||||
#if !defined(CONFIG_SC)
|
||||
#define CONFIG_8xx_GCLK_FREQ 66600000
|
||||
#else
|
||||
#define CONFIG_8xx_GCLK_FREQ 48000000
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The RS-232 console port is on SMC1
|
||||
@@ -143,7 +151,7 @@
|
||||
* environment so that we can autoscript the full default environment.
|
||||
*/
|
||||
#define CONFIG_ETHADDR 9a:52:63:15:85:25
|
||||
#define CONFIG_SERVERIP 10.0.4.200
|
||||
#define CONFIG_SERVERIP 10.0.4.201
|
||||
#define CONFIG_IPADDR 10.0.4.111
|
||||
|
||||
/*
|
||||
@@ -156,17 +164,20 @@
|
||||
#define CFG_I2C_EEPROM_ADDR_LEN 2 /* need 16 bit address */
|
||||
#define CFG_ENV_EEPROM_SIZE (32 * 1024)
|
||||
|
||||
#undef CONFIG_HARD_I2C
|
||||
#define CONFIG_SOFT_I2C
|
||||
|
||||
/*
|
||||
* Configure software I2C support (taken from IP860 BSP).
|
||||
* The I2C bus is connected to the GEN860T's 'dedicated' I2C
|
||||
* pins, i.e. PB26 and PB27
|
||||
* Enable I2C and select the hardware/software driver
|
||||
*/
|
||||
#define CONFIG_HARD_I2C 1 /* CPM based I2C */
|
||||
#undef CONFIG_SOFT_I2C /* Bit-banged I2C */
|
||||
|
||||
#ifdef CONFIG_HARD_I2C
|
||||
#define CFG_I2C_SPEED 100000 /* clock speed in Hz */
|
||||
#define CFG_I2C_SLAVE 0xFE /* I2C slave address */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SOFT_I2C
|
||||
#define PB_SCL 0x00000020 /* PB 26 */
|
||||
#define PB_SDA 0x00000010 /* PB 27 */
|
||||
|
||||
#define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
|
||||
#define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
|
||||
#define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
|
||||
@@ -176,15 +187,14 @@
|
||||
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SCL
|
||||
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
|
||||
|
||||
#define CFG_I2C_SPEED 100000 /* clock speed in Hz */
|
||||
#define CFG_I2C_SLAVE 0xFE /* I2C slave address */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allow environment overwrites by anyone
|
||||
*/
|
||||
#define CONFIG_ENV_OVERWRITE
|
||||
|
||||
#if !defined(CONFIG_SC)
|
||||
/*
|
||||
* The MPC860's internal RTC is horribly broken in rev D masks. Three
|
||||
* internal MPC860T circuit nodes were inadvertently left floating; this
|
||||
@@ -193,35 +203,55 @@
|
||||
* reasonable battery can keep that kind RTC running during powerdown for any
|
||||
* length of time, so we use an external RTC on the I2C bus instead.
|
||||
*/
|
||||
#undef CONFIG_RTC_MPC8xx
|
||||
#define CONFIG_RTC_DS1337
|
||||
#define CFG_I2C_RTC_ADDR 0x68
|
||||
#define CFG_I2C_RTC_ADDR 0x68
|
||||
|
||||
#else
|
||||
/*
|
||||
* No external RTC on SC variant, so we're stuck with the internal one.
|
||||
*/
|
||||
#define CONFIG_RTC_MPC8xx
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allow partial commands to be matched to uniqueness.
|
||||
* Power On Self Test support
|
||||
*/
|
||||
#define CFG_MATCH_PARTIAL_CMD
|
||||
#define CONFIG_POST ( CFG_POST_CACHE | \
|
||||
CFG_POST_MEMORY | \
|
||||
CFG_POST_CPU | \
|
||||
CFG_POST_UART | \
|
||||
CFG_POST_SPR )
|
||||
|
||||
#ifdef CONFIG_POST
|
||||
#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
|
||||
#else
|
||||
#define CFG_CMD_POST_DIAG 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* List of available monitor commands. Use the system default list
|
||||
* plus add some of the "non-standard" commands back in.
|
||||
* See ./cmd_confdefs.h
|
||||
*/
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
#define BASE_CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
CFG_CMD_ASKENV | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_I2C | \
|
||||
CFG_CMD_DOC | \
|
||||
CFG_CMD_EEPROM | \
|
||||
CFG_CMD_REGINFO | \
|
||||
CFG_CMD_IMMAP | \
|
||||
CFG_CMD_ELF | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_FPGA | \
|
||||
CFG_CMD_MII | \
|
||||
CFG_CMD_BEDBUG \
|
||||
)
|
||||
CFG_CMD_BEDBUG | \
|
||||
CFG_CMD_POST_DIAG )
|
||||
|
||||
#if !defined(CONFIG_SC)
|
||||
#define CONFIG_COMMANDS ( BASE_CONFIG_COMMANDS | CFG_CMD_DOC )
|
||||
#else
|
||||
#define CONFIG_COMMANDS BASE_CONFIG_COMMANDS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* There is no IDE/PCMCIA hardware support on the board.
|
||||
@@ -258,7 +288,12 @@
|
||||
* Verbose help from command monitor.
|
||||
*/
|
||||
#define CFG_LONGHELP
|
||||
#define CFG_PROMPT "gen860t> "
|
||||
#if !defined(CONFIG_SC)
|
||||
#define CFG_PROMPT "B2> "
|
||||
#else
|
||||
#define CFG_PROMPT "SC> "
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Use the "hush" command parser
|
||||
@@ -393,15 +428,9 @@
|
||||
/*
|
||||
* Reserve memory for U-Boot.
|
||||
*/
|
||||
#define CFG_MAX_U_BOOT_SECT 3
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define CFG_MONITOR_LEN (512 * 1024)
|
||||
#else
|
||||
#define CFG_MONITOR_LEN (256 * 1024)
|
||||
#endif
|
||||
|
||||
#define CFG_MONITOR_BASE CFG_FLASH_BASE
|
||||
#define CFG_MAX_UBOOT_SECTS 4
|
||||
#define CFG_MONITOR_LEN (CFG_MAX_UBOOT_SECTS * CFG_FLASH_SECT_SIZE)
|
||||
#define CFG_MONITOR_BASE CFG_FLASH_BASE
|
||||
|
||||
/*
|
||||
* Select environment placement. NOTE that u-boot.lds must
|
||||
@@ -414,8 +443,14 @@
|
||||
#define CFG_ENV_SIZE (2 * 1024)
|
||||
#define CFG_ENV_OFFSET (CFG_ENV_EEPROM_SIZE - (8 * 1024))
|
||||
#else
|
||||
#define CFG_ENV_SIZE (4 * 1024)
|
||||
#define CFG_ENV_OFFSET (CFG_MAX_U_BOOT_SECT * CFG_FLASH_SECT_SIZE)
|
||||
#define CFG_ENV_SIZE 0x1000
|
||||
#define CFG_ENV_SECT_SIZE CFG_FLASH_SECT_SIZE
|
||||
|
||||
/*
|
||||
* This ultimately gets passed right into the linker script, so we have to
|
||||
* use a number :(
|
||||
*/
|
||||
#define CFG_ENV_OFFSET 0x060000
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -439,7 +474,7 @@
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
* SYPCR - System Protection Control UM 11-9
|
||||
* SYPCR - System Protection Control UM 11-9
|
||||
* -----------------------------------------------------------------------
|
||||
* SYPCR can only be written once after reset!
|
||||
*
|
||||
@@ -523,6 +558,7 @@
|
||||
*/
|
||||
#define SCCR_MASK SCCR_EBDF11
|
||||
|
||||
#if !defined(CONFIG_SC)
|
||||
#define CFG_SCCR ( SCCR_TBS | /* timebase = GCLK/2 */ \
|
||||
SCCR_COM00 | /* full strength CLKOUT */ \
|
||||
SCCR_DFSYNC00 | /* SYNCLK / 1 (normal) */ \
|
||||
@@ -530,6 +566,17 @@
|
||||
SCCR_DFNL000 | \
|
||||
SCCR_DFNH000 \
|
||||
)
|
||||
#else
|
||||
#define CFG_SCCR ( SCCR_TBS | /* timebase = GCLK/2 */ \
|
||||
SCCR_COM00 | /* full strength CLKOUT */ \
|
||||
SCCR_DFSYNC00 | /* SYNCLK / 1 (normal) */ \
|
||||
SCCR_DFBRG00 | /* BRGCLK / 1 (normal) */ \
|
||||
SCCR_DFNL000 | \
|
||||
SCCR_DFNH000 | \
|
||||
SCCR_RTDIV | \
|
||||
SCCR_RTSEL \
|
||||
)
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* DER - Debug Enable Register UM 37-46
|
||||
@@ -695,10 +742,12 @@
|
||||
/*
|
||||
* Disk On Chip (millenium) configuration
|
||||
*/
|
||||
#if !defined(CONFIG_SC)
|
||||
#define CFG_MAX_DOC_DEVICE 1
|
||||
#undef CFG_DOC_SUPPORT_2000
|
||||
#define CFG_DOC_SUPPORT_MILLENNIUM
|
||||
#undef CFG_DOC_PASSIVE_PROBE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* FEC interrupt assignment
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#define CONFIG_CMD_NORMAL (CONFIG_CMD_DFL & ~CFG_CMD_BOOTD)
|
||||
#define CONFIG_CMD_GDB (CONFIG_CMD_NORMAL | CFG_CMD_KGDB)
|
||||
#define CONFIG_CMD_FULL (CFG_CMD_ALL & ~CFG_CMD_BEDBUG \
|
||||
& ~CFG_CMD_BMP \
|
||||
& ~CFG_CMD_BSP \
|
||||
& ~CFG_CMD_DOC \
|
||||
& ~CFG_CMD_DTT \
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
|
||||
#define CONFIG_COMMANDS (CFG_CMD_ALL & ~( \
|
||||
CFG_CMD_BEDBUG | \
|
||||
CFG_CMD_BMP | \
|
||||
CFG_CMD_BSP | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_DOC | \
|
||||
@@ -190,7 +191,7 @@
|
||||
/* this is stuff came out of the Motorola docs */
|
||||
#define CFG_DEFAULT_IMMR 0x0F010000
|
||||
|
||||
#define CFG_IMMR 0x04700000
|
||||
#define CFG_IMMR 0xF0000000
|
||||
#define CFG_BCSR 0x04500000
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_LSDRAM_BASE 0x04000000
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
|
||||
#define CONFIG_MPC8260ADS 1 /* ...on motorola ads board */
|
||||
#define CONFIG_MPC8266ADS 1 /* ...on motorola ads board */
|
||||
|
||||
#define CONFIG_BOARD_PRE_INIT 1 /* Call board_pre_init */
|
||||
|
||||
@@ -78,6 +78,23 @@
|
||||
#define CONFIG_ETHER_ON_FCC /* define if ether on FCC */
|
||||
#undef CONFIG_ETHER_NONE /* define if ether on something else */
|
||||
#define CONFIG_ETHER_INDEX 2 /* which channel for ether */
|
||||
#define CONFIG_MII /* MII PHY management */
|
||||
#define CONFIG_BITBANGMII /* bit-bang MII PHY management */
|
||||
/*
|
||||
* Port pins used for bit-banged MII communictions (if applicable).
|
||||
*/
|
||||
#define MDIO_PORT 2 /* Port C */
|
||||
#define MDIO_ACTIVE (iop->pdir |= 0x00400000)
|
||||
#define MDIO_TRISTATE (iop->pdir &= ~0x00400000)
|
||||
#define MDIO_READ ((iop->pdat & 0x00400000) != 0)
|
||||
|
||||
#define MDIO(bit) if(bit) iop->pdat |= 0x00400000; \
|
||||
else iop->pdat &= ~0x00400000
|
||||
|
||||
#define MDC(bit) if(bit) iop->pdat |= 0x00200000; \
|
||||
else iop->pdat &= ~0x00200000
|
||||
|
||||
#define MIIDELAY udelay(1)
|
||||
|
||||
#if (CONFIG_ETHER_INDEX == 2)
|
||||
|
||||
@@ -90,7 +107,7 @@
|
||||
# define CFG_CMXFCR_MASK (CMXFCR_FC2 | CMXFCR_RF2CS_MSK | CMXFCR_TF2CS_MSK)
|
||||
# define CFG_CMXFCR_VALUE (CMXFCR_RF2CS_CLK13 | CMXFCR_TF2CS_CLK14)
|
||||
# define CFG_CPMFCR_RAMTYPE 0
|
||||
# define CFG_FCC_PSMR 0
|
||||
# define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
|
||||
|
||||
#endif /* CONFIG_ETHER_INDEX */
|
||||
|
||||
@@ -100,6 +117,12 @@
|
||||
#define CFG_I2C_SLAVE 0x7F
|
||||
#define CFG_I2C_EEPROM_ADDR_LEN 1
|
||||
|
||||
/* PCI */
|
||||
#define CONFIG_PCI
|
||||
#define CONFIG_PCI_PNP
|
||||
#define CONFIG_PCI_BOOTDELAY 0
|
||||
#undef CONFIG_PCI_SCAN_SHOW
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for Serial Presence Detect EEPROM address
|
||||
* (to get SDRAM settings)
|
||||
@@ -107,14 +130,16 @@
|
||||
#define SPD_EEPROM_ADDRESS 0x50
|
||||
|
||||
|
||||
#define CONFIG_8260_CLKIN 66666666 /* in Hz */
|
||||
#define CONFIG_8260_CLKIN 66000000 /* in Hz */
|
||||
#define CONFIG_BAUDRATE 115200
|
||||
|
||||
|
||||
#define CONFIG_COMMANDS (CFG_CMD_ALL & ~( \
|
||||
CFG_CMD_BEDBUG | \
|
||||
CFG_CMD_BMP | \
|
||||
CFG_CMD_BSP | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_DOC | \
|
||||
CFG_CMD_DTT | \
|
||||
CFG_CMD_EEPROM | \
|
||||
@@ -126,21 +151,51 @@
|
||||
CFG_CMD_JFFS2 | \
|
||||
CFG_CMD_KGDB | \
|
||||
CFG_CMD_NAND | \
|
||||
CFG_CMD_MII | \
|
||||
CFG_CMD_PCI | \
|
||||
CFG_CMD_PCMCIA | \
|
||||
CFG_CMD_SCSI | \
|
||||
CFG_CMD_SPI | \
|
||||
CFG_CMD_VFD | \
|
||||
CFG_CMD_USB ) )
|
||||
|
||||
/* Define a command string that is automatically executed when no character
|
||||
* is read on the console interface withing "Boot Delay" after reset.
|
||||
*/
|
||||
#define CONFIG_BOOT_ROOT_INITRD 0 /* Use ram disk for the root file system */
|
||||
#define CONFIG_BOOT_ROOT_NFS 1 /* Use a NFS mounted root file system */
|
||||
|
||||
#if CONFIG_BOOT_ROOT_INITRD
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"version;" \
|
||||
"echo;" \
|
||||
"bootp;" \
|
||||
"setenv bootargs root=/dev/ram0 rw " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
|
||||
"bootm"
|
||||
#endif /* CONFIG_BOOT_ROOT_INITRD */
|
||||
|
||||
#if CONFIG_BOOT_ROOT_NFS
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"version;" \
|
||||
"echo;" \
|
||||
"bootp;" \
|
||||
"setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
|
||||
"bootm"
|
||||
#endif /* CONFIG_BOOT_ROOT_NFS */
|
||||
|
||||
/* Add support for a few extra bootp options like:
|
||||
* - File size
|
||||
* - DNS
|
||||
*/
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | \
|
||||
CONFIG_BOOTP_BOOTFILESIZE | \
|
||||
CONFIG_BOOTP_DNS)
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
|
||||
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
|
||||
#define CONFIG_BOOTCOMMAND "bootm 100000" /* autoboot command */
|
||||
#define CONFIG_BOOTARGS "root=/dev/ram rw"
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#undef CONFIG_KGDB_ON_SMC /* define if kgdb on SMC */
|
||||
@@ -169,7 +224,7 @@
|
||||
#define CFG_MEMTEST_START 0x00100000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
|
||||
|
||||
#define CONFIG_CLOCKS_IN_MHZ 1 /* clocks passsed to Linux in MHz */
|
||||
#undef CONFIG_CLOCKS_IN_MHZ /* clocks passsed to Linux in MHz */
|
||||
/* for versions < 2.4.5-pre5 */
|
||||
|
||||
#define CFG_LOAD_ADDR 0x100000 /* default load address */
|
||||
@@ -178,8 +233,8 @@
|
||||
|
||||
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
|
||||
|
||||
#define CFG_FLASH_BASE 0xff800000
|
||||
#define FLASH_BASE 0xff800000
|
||||
#define CFG_FLASH_BASE 0xFE000000
|
||||
#define FLASH_BASE 0xFE000000
|
||||
#define CFG_MAX_FLASH_BANKS 1 /* max num of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 32 /* max num of sects on one chip */
|
||||
#define CFG_FLASH_SIZE 8
|
||||
@@ -192,14 +247,10 @@
|
||||
/* Only change this if you also change the Hardware configuration Word */
|
||||
#define CFG_DEFAULT_IMMR 0x0F010000
|
||||
|
||||
/*
|
||||
#define CFG_IMMR 0x04700000
|
||||
#define CFG_BCSR 0x04500000
|
||||
*/
|
||||
|
||||
/* Set IMMR to 0xF0000000 or above to boot Linux */
|
||||
#define CFG_IMMR 0xF0000000
|
||||
#define CFG_BCSR 0x04500000
|
||||
#define CFG_BCSR 0xF8000000
|
||||
#define CFG_PCI_INT 0xF8200000 /* PCI interrupt controller */
|
||||
|
||||
/* Define CONFIG_VERY_BIG_RAM to allow use of SDRAMs larger than 256MBytes
|
||||
*/
|
||||
@@ -262,7 +313,7 @@
|
||||
ORxS_ROWST_PBI0_A8 |\
|
||||
ORxS_NUMR_12)
|
||||
#elif (CFG_SDRAM_SIZE == 16)
|
||||
#define CFG_OR2_PRELIM (0xFF000CA0)
|
||||
#define CFG_OR2_PRELIM (0xFF000C80)
|
||||
#else
|
||||
#error "INVALID SDRAM CONFIGURATION"
|
||||
#endif
|
||||
@@ -324,13 +375,13 @@
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
|
||||
|
||||
/* 0x0EA28205 */
|
||||
/*#define CFG_HRCW_MASTER ( ( HRCW_BPS11 | HRCW_CIP ) |\
|
||||
( HRCW_L2CPC10 | HRCW_DPPC10 | HRCW_ISB010 ) |\
|
||||
( HRCW_BMS | HRCW_APPC10 ) |\
|
||||
( HRCW_MODCK_H0101 ) \
|
||||
/* 0x0EB2B645 */
|
||||
#define CFG_HRCW_MASTER (( HRCW_BPS11 | HRCW_CIP ) |\
|
||||
( HRCW_L2CPC10 | HRCW_DPPC11 | HRCW_ISB010 ) |\
|
||||
( HRCW_BMS | HRCW_MMR11 | HRCW_LBPC01 | HRCW_APPC10 ) |\
|
||||
( HRCW_CS10PC01 | HRCW_MODCK_H0101 ) \
|
||||
)
|
||||
*/
|
||||
|
||||
|
||||
/* This value should actually be situated in the first 256 bytes of the FLASH
|
||||
which on the standard MPC8266ADS board is at address 0xFF800000
|
||||
@@ -345,7 +396,7 @@
|
||||
- Rune
|
||||
|
||||
*/
|
||||
#define CFG_HRCW_MASTER 0x0cb23645
|
||||
/* #define CFG_HRCW_MASTER 0x0cb23645 */
|
||||
|
||||
/* no slaves */
|
||||
#define CFG_HRCW_SLAVE1 0
|
||||
@@ -391,22 +442,98 @@
|
||||
#define CFG_HID2 0
|
||||
|
||||
#define CFG_SYPCR 0xFFFFFFC3
|
||||
#define CFG_BCR 0x100C0000
|
||||
#define CFG_SIUMCR 0x0A200000
|
||||
#define CFG_BCR 0x004C0000
|
||||
#define CFG_SIUMCR 0x4E64C000
|
||||
#define CFG_SCCR 0x00000000
|
||||
#define CFG_BR0_PRELIM 0xFF801801
|
||||
#define CFG_OR0_PRELIM 0xFF800836
|
||||
#define CFG_BR1_PRELIM 0x04501801
|
||||
#define CFG_OR1_PRELIM 0xFFFF8010
|
||||
|
||||
#define CFG_RMR 0
|
||||
/* local bus memory map
|
||||
*
|
||||
* 0x00000000-0x03FFFFFF 64MB SDRAM
|
||||
* 0x80000000-0x9FFFFFFF 512MB outbound prefetchable PCI memory window
|
||||
* 0xA0000000-0xBFFFFFFF 512MB outbound non-prefetchable PCI memory window
|
||||
* 0xF0000000-0xF001FFFF 128KB MPC8266 internal memory
|
||||
* 0xF4000000-0xF7FFFFFF 64MB outbound PCI I/O window
|
||||
* 0xF8000000-0xF8007FFF 32KB BCSR
|
||||
* 0xF8100000-0xF8107FFF 32KB ATM UNI
|
||||
* 0xF8200000-0xF8207FFF 32KB PCI interrupt controller
|
||||
* 0xF8300000-0xF8307FFF 32KB EEPROM
|
||||
* 0xFE000000-0xFFFFFFFF 32MB flash
|
||||
*/
|
||||
#define CFG_BR0_PRELIM 0xFE001801 /* flash */
|
||||
#define CFG_OR0_PRELIM 0xFE000836
|
||||
#define CFG_BR1_PRELIM (CFG_BCSR | 0x1801) /* BCSR */
|
||||
#define CFG_OR1_PRELIM 0xFFFF8010
|
||||
#define CFG_BR4_PRELIM 0xF8300801 /* EEPROM */
|
||||
#define CFG_OR4_PRELIM 0xFFFF8846
|
||||
#define CFG_BR5_PRELIM 0xF8100801 /* PM5350 ATM UNI */
|
||||
#define CFG_OR5_PRELIM 0xFFFF8E36
|
||||
#define CFG_BR8_PRELIM (CFG_PCI_INT | 0x1801) /* PCI interrupt controller */
|
||||
#define CFG_OR8_PRELIM 0xFFFF8010
|
||||
|
||||
#define CFG_RMR 0x0001
|
||||
#define CFG_TMCNTSC (TMCNTSC_SEC|TMCNTSC_ALR|TMCNTSC_TCF|TMCNTSC_TCE)
|
||||
#define CFG_PISCR (PISCR_PS|PISCR_PTF|PISCR_PTE)
|
||||
#define CFG_RCCR 0
|
||||
/*#define CFG_PSDMR 0x016EB452*/
|
||||
#define CFG_MPTPR 0x00001900
|
||||
#define CFG_PSRT 0x00000021
|
||||
|
||||
#define CFG_RESET_ADDRESS 0x04400000
|
||||
|
||||
/* PCI Memory map (if different from default map */
|
||||
#define CFG_PCI_SLV_MEM_LOCAL CFG_SDRAM_BASE /* Local base */
|
||||
#define CFG_PCI_SLV_MEM_BUS 0x00000000 /* PCI base */
|
||||
#define CFG_PICMR0_MASK_ATTRIB (PICMR_MASK_512MB | PICMR_ENABLE | \
|
||||
PICMR_PREFETCH_EN)
|
||||
|
||||
/*
|
||||
* These are the windows that allow the CPU to access PCI address space.
|
||||
* All three PCI master windows, which allow the CPU to access PCI
|
||||
* prefetch, non prefetch, and IO space (see below), must all fit within
|
||||
* these windows.
|
||||
*/
|
||||
|
||||
/* PCIBR0 */
|
||||
#define CFG_PCI_MSTR0_LOCAL 0x80000000 /* Local base */
|
||||
#define CFG_PCIMSK0_MASK PCIMSK_1GB /* Size of window */
|
||||
/* PCIBR1 */
|
||||
#define CFG_PCI_MSTR1_LOCAL 0xF4000000 /* Local base */
|
||||
#define CFG_PCIMSK1_MASK PCIMSK_64MB /* Size of window */
|
||||
|
||||
/*
|
||||
* Master window that allows the CPU to access PCI Memory (prefetch).
|
||||
* This window will be setup with the first set of Outbound ATU registers
|
||||
* in the bridge.
|
||||
*/
|
||||
|
||||
#define CFG_PCI_MSTR_MEM_LOCAL 0x80000000 /* Local base */
|
||||
#define CFG_PCI_MSTR_MEM_BUS 0x80000000 /* PCI base */
|
||||
#define CFG_CPU_PCI_MEM_START PCI_MSTR_MEM_LOCAL
|
||||
#define CFG_PCI_MSTR_MEM_SIZE 0x20000000 /* 512MB */
|
||||
#define CFG_POCMR0_MASK_ATTRIB (POCMR_MASK_512MB | POCMR_ENABLE | POCMR_PREFETCH_EN)
|
||||
|
||||
/*
|
||||
* Master window that allows the CPU to access PCI Memory (non-prefetch).
|
||||
* This window will be setup with the second set of Outbound ATU registers
|
||||
* in the bridge.
|
||||
*/
|
||||
|
||||
#define CFG_PCI_MSTR_MEMIO_LOCAL 0xA0000000 /* Local base */
|
||||
#define CFG_PCI_MSTR_MEMIO_BUS 0xA0000000 /* PCI base */
|
||||
#define CPU_PCI_MEMIO_START PCI_MSTR_MEMIO_LOCAL
|
||||
#define CFG_PCI_MSTR_MEMIO_SIZE 0x20000000 /* 512MB */
|
||||
#define CFG_POCMR1_MASK_ATTRIB (POCMR_MASK_512MB | POCMR_ENABLE)
|
||||
|
||||
/*
|
||||
* Master window that allows the CPU to access PCI IO space.
|
||||
* This window will be setup with the third set of Outbound ATU registers
|
||||
* in the bridge.
|
||||
*/
|
||||
|
||||
#define CFG_PCI_MSTR_IO_LOCAL 0xF4000000 /* Local base */
|
||||
#define CFG_PCI_MSTR_IO_BUS 0x00000000 /* PCI base */
|
||||
#define CFG_CPU_PCI_IO_START PCI_MSTR_IO_LOCAL
|
||||
#define CFG_PCI_MSTR_IO_SIZE 0x04000000 /* 64MB */
|
||||
#define CFG_POCMR2_MASK_ATTRIB (POCMR_MASK_64MB | POCMR_ENABLE | POCMR_PCI_IO)
|
||||
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
|
||||
@@ -345,4 +345,6 @@
|
||||
/* Ethernet at SCC2 */
|
||||
#define CONFIG_SCC2_ENET
|
||||
|
||||
#define CONFIG_ARTOS /* include ARTOS support */
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
|
||||
@@ -155,12 +155,22 @@
|
||||
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
|
||||
CFG_CMD_BEDBUG | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_DOC | \
|
||||
CFG_CMD_EEPROM | \
|
||||
CFG_CMD_I2C | \
|
||||
CFG_CMD_PCI)
|
||||
#else /* ! PCI */
|
||||
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
|
||||
CFG_CMD_BEDBUG | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_DOC | \
|
||||
CFG_CMD_EEPROM | \
|
||||
CFG_CMD_I2C )
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#undef CONFIG_EDT32F10
|
||||
#define CONFIG_SHARP_LQ057Q3DC02
|
||||
|
||||
#define CONFIG_SPLASH_SCREEN
|
||||
|
||||
#define MPC8XX_FACT 1 /* Multiply by 1 */
|
||||
#define MPC8XX_XIN 50000000 /* 50 MHz in */
|
||||
#define CONFIG_8xx_GCLK_FREQ 50000000 /* define if can't use get_gclk_freq */
|
||||
@@ -47,7 +49,7 @@
|
||||
#define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
|
||||
#undef CONFIG_8xx_CONS_SMC2
|
||||
#undef CONFIG_8xx_CONS_NONE
|
||||
#define CONFIG_BAUDRATE 9600 /* console baudrate = 9600bps */
|
||||
#define CONFIG_BAUDRATE 115200 /* console baudrate in bps */
|
||||
#if 0
|
||||
#define CONFIG_BOOTDELAY -1 /* autoboot disabled */
|
||||
#else
|
||||
@@ -83,7 +85,7 @@
|
||||
#endif /* CONFIG_LCD */
|
||||
#endif
|
||||
|
||||
#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */
|
||||
#define CONFIG_CAN_DRIVER /* CAN Driver support enabled */
|
||||
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
|
||||
|
||||
@@ -113,11 +115,12 @@
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SCL
|
||||
#define I2C_DELAY udelay(50)
|
||||
|
||||
#define CFG_I2C_PWM_ADDR 0x58 /* Power management coprocessor */
|
||||
#define CFG_I2C_KBD_ADDR 0x50 /* Keyboard coprocessor */
|
||||
#define CFG_I2C_TERM_ADDR 0x49 /* Temperature Sensors */
|
||||
#define CFG_I2C_LCD_ADDR 0x8 /* LCD Control */
|
||||
#define CFG_I2C_KEY_ADDR 0x9 /* Keyboard coprocessor */
|
||||
#define CFG_I2C_TEM_ADDR 0x49 /* Temperature Sensors */
|
||||
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
CFG_CMD_BMP | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_DATE | \
|
||||
CFG_CMD_I2C | \
|
||||
@@ -232,11 +235,7 @@
|
||||
*-----------------------------------------------------------------------
|
||||
* PCMCIA config., multi-function pin tri-state
|
||||
*/
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#else /* we must activate GPL5 in the SIUMCR for CAN */
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* TBSCR - Time Base Status and Control 11-26
|
||||
@@ -362,20 +361,31 @@
|
||||
|
||||
|
||||
/*
|
||||
* BR1 and OR1 (SDRAM)
|
||||
* BR2 and OR2 (SDRAM)
|
||||
*
|
||||
*/
|
||||
#define SDRAM_BASE1_PRELIM 0x00000000 /* SDRAM bank #0 */
|
||||
#define SDRAM_BASE2_PRELIM 0x00000000 /* SDRAM bank #0 */
|
||||
#define SDRAM_MAX_SIZE 0x04000000 /* max 64 MB per bank */
|
||||
|
||||
#define CFG_PRELIM_OR1_AM 0xF8000000 /* OR addr mask */
|
||||
#define CFG_PRELIM_OR2_AM 0xF8000000 /* OR addr mask */
|
||||
|
||||
/* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care) */
|
||||
#define CFG_OR_TIMING_SDRAM (OR_ACS_DIV1 | OR_CSNT_SAM | \
|
||||
OR_SCY_0_CLK | OR_G5LS)
|
||||
|
||||
#define CFG_OR1_PRELIM (CFG_PRELIM_OR1_AM | CFG_OR_TIMING_SDRAM )
|
||||
#define CFG_BR1_PRELIM ((SDRAM_BASE1_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
#define CFG_OR2_PRELIM (CFG_PRELIM_OR2_AM | CFG_OR_TIMING_SDRAM )
|
||||
#define CFG_BR2_PRELIM ((SDRAM_BASE2_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
|
||||
/*
|
||||
* BR3 and OR3 (CAN Controller)
|
||||
*/
|
||||
#ifdef CONFIG_CAN_DRIVER
|
||||
#define CFG_CAN_BASE 0xC0000000 /* CAN base address */
|
||||
#define CFG_CAN_OR_AM 0xFFFF8000 /* 32 kB address mask */
|
||||
#define CFG_OR3_CAN (CFG_CAN_OR_AM | OR_G5LA |OR_BI)
|
||||
#define CFG_BR3_CAN ((CFG_CAN_BASE & BR_BA_MSK) | \
|
||||
BR_PS_8 | BR_MS_UPMB | BR_V)
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* CONFIG_L2_CACHE
|
||||
* CONFIG_266MHz
|
||||
* CONFIG_300MHz
|
||||
* CONFIG_MPC8255
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -202,11 +203,15 @@
|
||||
|
||||
|
||||
/* system clock rate (CLKIN) - equal to the 60x and local bus speed */
|
||||
#ifndef CONFIG_300MHz
|
||||
#define CONFIG_8260_CLKIN 66666666 /* in Hz */
|
||||
#else
|
||||
#define CONFIG_8260_CLKIN 83333000 /* in Hz */
|
||||
#endif
|
||||
#ifdef CONFIG_MPC8255
|
||||
# define CONFIG_8260_CLKIN 66666666 /* in Hz */
|
||||
#else /* !CONFIG_MPC8255 */
|
||||
# ifndef CONFIG_300MHz
|
||||
# define CONFIG_8260_CLKIN 66666666 /* in Hz */
|
||||
# else
|
||||
# define CONFIG_8260_CLKIN 83333000 /* in Hz */
|
||||
# endif
|
||||
#endif /* CONFIG_MPC8255 */
|
||||
|
||||
#if defined(CONFIG_CONS_NONE) || defined(CONFIG_CONS_USE_EXTC)
|
||||
#define CONFIG_BAUDRATE 230400
|
||||
@@ -310,15 +315,19 @@
|
||||
* defines for the various registers affected by the HRCW e.g. changing
|
||||
* HRCW_DPPCxx requires you to also change CFG_SIUMCR.
|
||||
*/
|
||||
#if defined(CONFIG_266MHz)
|
||||
#define CFG_HRCW_MASTER (HRCW_CIP | HRCW_ISB111 | HRCW_BMS | \
|
||||
HRCW_MODCK_H0111)
|
||||
#elif defined(CONFIG_300MHz)
|
||||
#define CFG_HRCW_MASTER (HRCW_CIP | HRCW_ISB111 | HRCW_BMS | \
|
||||
HRCW_MODCK_H0110)
|
||||
#else
|
||||
#define CFG_HRCW_MASTER (HRCW_CIP | HRCW_ISB111 | HRCW_BMS)
|
||||
#endif
|
||||
#define __HRCW__ALL__ (HRCW_CIP | HRCW_ISB111 | HRCW_BMS)
|
||||
|
||||
#ifdef CONFIG_MPC8255
|
||||
# define CFG_HRCW_MASTER (__HRCW__ALL__ | HRCW_MODCK_H0111)
|
||||
#else /* ! MPC8255 */
|
||||
# if defined(CONFIG_266MHz)
|
||||
# define CFG_HRCW_MASTER (__HRCW__ALL__ | HRCW_MODCK_H0111)
|
||||
# elif defined(CONFIG_300MHz)
|
||||
# define CFG_HRCW_MASTER (__HRCW__ALL__ | HRCW_MODCK_H0110)
|
||||
# else
|
||||
# define CFG_HRCW_MASTER (__HRCW__ALL__)
|
||||
# endif
|
||||
#endif /* CONFIG_MPC8255 */
|
||||
|
||||
/* no slaves so just fill with zeros */
|
||||
#define CFG_HRCW_SLAVE1 0
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
CFG_CMD_ASKENV | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_ELF | \
|
||||
CFG_CMD_IDE | \
|
||||
CFG_CMD_DATE )
|
||||
|
||||
|
||||
473
include/configs/TQM862L.h
Normal file
473
include/configs/TQM862L.h
Normal file
@@ -0,0 +1,473 @@
|
||||
/*
|
||||
* (C) Copyright 2000, 2001, 2002
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/*
|
||||
* High Level Configuration Options
|
||||
* (easy to change)
|
||||
*/
|
||||
|
||||
#define CONFIG_MPC860 1
|
||||
#define CONFIG_MPC860T 1
|
||||
#define CONFIG_MPC862 1
|
||||
|
||||
#define CONFIG_TQM862L 1 /* ...on a TQM8xxL module */
|
||||
|
||||
#define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
|
||||
#undef CONFIG_8xx_CONS_SMC2
|
||||
#undef CONFIG_8xx_CONS_NONE
|
||||
|
||||
#define CONFIG_BAUDRATE 115200 /* console baudrate = 115kbps */
|
||||
|
||||
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
|
||||
|
||||
#define CONFIG_CLOCKS_IN_MHZ 1 /* clocks passsed to Linux in MHz */
|
||||
|
||||
#define CONFIG_BOARD_TYPES 1 /* support board types */
|
||||
|
||||
#define CONFIG_PREBOOT "echo;" \
|
||||
"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
|
||||
"echo"
|
||||
|
||||
#undef CONFIG_BOOTARGS
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"nfsargs=setenv bootargs root=/dev/nfs rw " \
|
||||
"nfsroot=$(serverip):$(rootpath)\0" \
|
||||
"ramargs=setenv bootargs root=/dev/ram rw\0" \
|
||||
"addip=setenv bootargs $(bootargs) " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)" \
|
||||
":$(hostname):$(netdev):off panic=1\0" \
|
||||
"flash_nfs=run nfsargs addip;" \
|
||||
"bootm $(kernel_addr)\0" \
|
||||
"flash_self=run ramargs addip;" \
|
||||
"bootm $(kernel_addr) $(ramdisk_addr)\0" \
|
||||
"net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0" \
|
||||
"rootpath=/opt/eldk/ppc_8xx\0" \
|
||||
"bootfile=/tftpboot/TQM860L/uImage\0" \
|
||||
"kernel_addr=40040000\0" \
|
||||
"ramdisk_addr=40100000\0" \
|
||||
""
|
||||
#define CONFIG_BOOTCOMMAND "run flash_self"
|
||||
|
||||
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
|
||||
#undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */
|
||||
|
||||
#undef CONFIG_WATCHDOG /* watchdog disabled */
|
||||
|
||||
#define CONFIG_STATUS_LED 1 /* Status LED enabled */
|
||||
|
||||
#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */
|
||||
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
|
||||
|
||||
#define CONFIG_MAC_PARTITION
|
||||
#define CONFIG_DOS_PARTITION
|
||||
|
||||
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
|
||||
|
||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||
CFG_CMD_ASKENV | \
|
||||
CFG_CMD_DHCP | \
|
||||
CFG_CMD_IDE | \
|
||||
CFG_CMD_DATE )
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
*/
|
||||
#define CFG_LONGHELP /* undef to save memory */
|
||||
#define CFG_PROMPT "=> " /* Monitor Command Prompt */
|
||||
|
||||
#if 0
|
||||
#define CFG_HUSH_PARSER 1 /* use "hush" command parser */
|
||||
#endif
|
||||
#ifdef CFG_HUSH_PARSER
|
||||
#define CFG_PROMPT_HUSH_PS2 "> "
|
||||
#endif
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
|
||||
#else
|
||||
#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
|
||||
#endif
|
||||
#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
|
||||
#define CFG_MAXARGS 16 /* max number of command args */
|
||||
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
|
||||
|
||||
#define CFG_MEMTEST_START 0x0400000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
|
||||
|
||||
#define CFG_LOAD_ADDR 0x100000 /* default load address */
|
||||
|
||||
#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
|
||||
|
||||
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
|
||||
|
||||
/*
|
||||
* Low Level Configuration Settings
|
||||
* (address mappings, register initial values, etc.)
|
||||
* You should know what you are doing if you make changes here.
|
||||
*/
|
||||
/*-----------------------------------------------------------------------
|
||||
* Internal Memory Mapped Register
|
||||
*/
|
||||
#define CFG_IMMR 0xFFF00000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for initial stack pointer and data area (in DPRAM)
|
||||
*/
|
||||
#define CFG_INIT_RAM_ADDR CFG_IMMR
|
||||
#define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
|
||||
#define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
* (Set up by the startup code)
|
||||
* Please note that CFG_SDRAM_BASE _must_ start at 0
|
||||
*/
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_FLASH_BASE 0x40000000
|
||||
#define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
|
||||
#define CFG_MONITOR_BASE CFG_FLASH_BASE
|
||||
#define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
* have to be in the first 8 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 71 /* max number of sectors on one chip */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
|
||||
|
||||
#define CFG_ENV_IS_IN_FLASH 1
|
||||
#define CFG_ENV_OFFSET 0x8000 /* Offset of Environment Sector */
|
||||
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
|
||||
|
||||
/* Address and size of Redundant Environment Sector */
|
||||
#define CFG_ENV_OFFSET_REDUND (CFG_ENV_OFFSET+CFG_ENV_SIZE)
|
||||
#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Hardware Information Block
|
||||
*/
|
||||
#define CFG_HWINFO_OFFSET 0x0003FFC0 /* offset of HW Info block */
|
||||
#define CFG_HWINFO_SIZE 0x00000040 /* size of HW Info block */
|
||||
#define CFG_HWINFO_MAGIC 0x54514D38 /* 'TQM8' */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Cache Configuration
|
||||
*/
|
||||
#define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SYPCR - System Protection Control 11-9
|
||||
* SYPCR can only be written once after reset!
|
||||
*-----------------------------------------------------------------------
|
||||
* Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
|
||||
*/
|
||||
#if defined(CONFIG_WATCHDOG)
|
||||
#define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
|
||||
SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
|
||||
#else
|
||||
#define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SIUMCR - SIU Module Configuration 11-6
|
||||
*-----------------------------------------------------------------------
|
||||
* PCMCIA config., multi-function pin tri-state
|
||||
*/
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#else /* we must activate GPL5 in the SIUMCR for CAN */
|
||||
#define CFG_SIUMCR (SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* TBSCR - Time Base Status and Control 11-26
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Reference Interrupt Status, Timebase freezing enabled
|
||||
*/
|
||||
#define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* RTCSC - Real-Time Clock Status and Control Register 11-27
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PISCR - Periodic Interrupt Status and Control 11-31
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
|
||||
*/
|
||||
#define CFG_PISCR (PISCR_PS | PISCR_PITF)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
|
||||
*-----------------------------------------------------------------------
|
||||
* Reset PLL lock status sticky bit, timer expired status bit and timer
|
||||
* interrupt status bit
|
||||
*
|
||||
* If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)!
|
||||
*/
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_PLPRCR \
|
||||
( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
|
||||
#else /* up to 50 MHz we use a 1:1 clock */
|
||||
#define CFG_PLPRCR (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SCCR - System Clock and reset Control Register 15-27
|
||||
*-----------------------------------------------------------------------
|
||||
* Set clock output, timebase and RTC source and divider,
|
||||
* power management and some other internal clocks
|
||||
*/
|
||||
#define SCCR_MASK SCCR_EBDF11
|
||||
#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */
|
||||
#define CFG_SCCR (/* SCCR_TBS | */ \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#else /* up to 50 MHz we use a 1:1 clock */
|
||||
#define CFG_SCCR (SCCR_TBS | \
|
||||
SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
|
||||
SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
|
||||
SCCR_DFALCD00)
|
||||
#endif /* CONFIG_80MHz */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PCMCIA stuff
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
#define CFG_PCMCIA_MEM_ADDR (0xE0000000)
|
||||
#define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_DMA_ADDR (0xE4000000)
|
||||
#define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_ATTRB_ADDR (0xE8000000)
|
||||
#define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
|
||||
#define CFG_PCMCIA_IO_ADDR (0xEC000000)
|
||||
#define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
|
||||
|
||||
#undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
|
||||
#undef CONFIG_IDE_LED /* LED for ide not supported */
|
||||
#undef CONFIG_IDE_RESET /* reset for ide not supported */
|
||||
|
||||
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
|
||||
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
|
||||
|
||||
#define CFG_ATA_IDE0_OFFSET 0x0000
|
||||
|
||||
#define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
|
||||
|
||||
/* Offset for data I/O */
|
||||
#define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
|
||||
|
||||
/* Offset for normal register accesses */
|
||||
#define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
|
||||
|
||||
/* Offset for alternate registers */
|
||||
#define CFG_ATA_ALT_OFFSET 0x0100
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
/*#define CFG_DER 0x2002000F*/
|
||||
#define CFG_DER 0
|
||||
|
||||
/*
|
||||
* Init Memory Controller:
|
||||
*
|
||||
* BR0/1 and OR0/1 (FLASH)
|
||||
*/
|
||||
|
||||
#define FLASH_BASE0_PRELIM 0x40000000 /* FLASH bank #0 */
|
||||
#define FLASH_BASE1_PRELIM 0x60000000 /* FLASH bank #0 */
|
||||
|
||||
/* used to re-map FLASH both when starting from SRAM or FLASH:
|
||||
* restrict access enough to keep SRAM working (if any)
|
||||
* but not too much to meddle with FLASH accesses
|
||||
*/
|
||||
#define CFG_REMAP_OR_AM 0x80000000 /* OR addr mask */
|
||||
#define CFG_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
|
||||
|
||||
/*
|
||||
* FLASH timing:
|
||||
*/
|
||||
#if defined(CONFIG_80MHz)
|
||||
/* 80 MHz CPU - 40 MHz bus: ACS = 00, TRLX = 0, CSNT = 1, SCY = 3, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | 0 | OR_CSNT_SAM | \
|
||||
OR_SCY_3_CLK | OR_EHTR | OR_BI)
|
||||
#elif defined(CONFIG_66MHz)
|
||||
/* 66 MHz CPU - 66 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
|
||||
OR_SCY_3_CLK | OR_EHTR | OR_BI)
|
||||
#else /* 50 MHz */
|
||||
/* 50 MHz CPU - 50 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 2, EHTR = 1 */
|
||||
#define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
|
||||
OR_SCY_2_CLK | OR_EHTR | OR_BI)
|
||||
#endif /*CONFIG_??MHz */
|
||||
|
||||
#define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
|
||||
#define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
|
||||
#define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )
|
||||
|
||||
#define CFG_OR1_REMAP CFG_OR0_REMAP
|
||||
#define CFG_OR1_PRELIM CFG_OR0_PRELIM
|
||||
#define CFG_BR1_PRELIM ((FLASH_BASE1_PRELIM & BR_BA_MSK) | BR_V )
|
||||
|
||||
/*
|
||||
* BR2/3 and OR2/3 (SDRAM)
|
||||
*
|
||||
*/
|
||||
#define SDRAM_BASE2_PRELIM 0x00000000 /* SDRAM bank #0 */
|
||||
#define SDRAM_BASE3_PRELIM 0x20000000 /* SDRAM bank #1 */
|
||||
#define SDRAM_MAX_SIZE 0x04000000 /* max 64 MB per bank */
|
||||
|
||||
/* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care) */
|
||||
#define CFG_OR_TIMING_SDRAM 0x00000A00
|
||||
|
||||
#define CFG_OR2_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_SDRAM )
|
||||
#define CFG_BR2_PRELIM ((SDRAM_BASE2_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
|
||||
#ifndef CONFIG_CAN_DRIVER
|
||||
#define CFG_OR3_PRELIM CFG_OR2_PRELIM
|
||||
#define CFG_BR3_PRELIM ((SDRAM_BASE3_PRELIM & BR_BA_MSK) | BR_MS_UPMA | BR_V )
|
||||
#else /* CAN uses CS3#, so we can have only one SDRAM bank anyway */
|
||||
#define CFG_CAN_BASE 0xC0000000 /* CAN mapped at 0xC0000000 */
|
||||
#define CFG_CAN_OR_AM 0xFFFF8000 /* 32 kB address mask */
|
||||
#define CFG_OR3_CAN (CFG_CAN_OR_AM | OR_G5LA | OR_BI)
|
||||
#define CFG_BR3_CAN ((CFG_CAN_BASE & BR_BA_MSK) | \
|
||||
BR_PS_8 | BR_MS_UPMB | BR_V )
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
/*
|
||||
* Memory Periodic Timer Prescaler
|
||||
*
|
||||
* The Divider for PTA (refresh timer) configuration is based on an
|
||||
* example SDRAM configuration (64 MBit, one bank). The adjustment to
|
||||
* the number of chip selects (NCS) and the actually needed refresh
|
||||
* rate is done by setting MPTPR.
|
||||
*
|
||||
* PTA is calculated from
|
||||
* PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS)
|
||||
*
|
||||
* gclk CPU clock (not bus clock!)
|
||||
* Trefresh Refresh cycle * 4 (four word bursts used)
|
||||
*
|
||||
* 4096 Rows from SDRAM example configuration
|
||||
* 1000 factor s -> ms
|
||||
* 32 PTP (pre-divider from MPTPR) from SDRAM example configuration
|
||||
* 4 Number of refresh cycles per period
|
||||
* 64 Refresh cycle in ms per number of rows
|
||||
* --------------------------------------------
|
||||
* Divider = 4096 * 32 * 1000 / (4 * 64) = 512000
|
||||
*
|
||||
* 50 MHz => 50.000.000 / Divider = 98
|
||||
* 66 Mhz => 66.000.000 / Divider = 129
|
||||
* 80 Mhz => 80.000.000 / Divider = 156
|
||||
*/
|
||||
#if defined(CONFIG_80MHz)
|
||||
#define CFG_MAMR_PTA 156
|
||||
#elif defined(CONFIG_66MHz)
|
||||
#define CFG_MAMR_PTA 129
|
||||
#else /* 50 MHz */
|
||||
#define CFG_MAMR_PTA 98
|
||||
#endif /*CONFIG_??MHz */
|
||||
|
||||
/*
|
||||
* For 16 MBit, refresh rates could be 31.3 us
|
||||
* (= 64 ms / 2K = 125 / quad bursts).
|
||||
* For a simpler initialization, 15.6 us is used instead.
|
||||
*
|
||||
* #define CFG_MPTPR_2BK_2K MPTPR_PTP_DIV32 for 2 banks
|
||||
* #define CFG_MPTPR_1BK_2K MPTPR_PTP_DIV64 for 1 bank
|
||||
*/
|
||||
#define CFG_MPTPR_2BK_4K MPTPR_PTP_DIV16 /* setting for 2 banks */
|
||||
#define CFG_MPTPR_1BK_4K MPTPR_PTP_DIV32 /* setting for 1 bank */
|
||||
|
||||
/* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256 MBit */
|
||||
#define CFG_MPTPR_2BK_8K MPTPR_PTP_DIV8 /* setting for 2 banks */
|
||||
#define CFG_MPTPR_1BK_8K MPTPR_PTP_DIV16 /* setting for 1 bank */
|
||||
|
||||
/*
|
||||
* MAMR settings for SDRAM
|
||||
*/
|
||||
|
||||
/* 8 column SDRAM */
|
||||
#define CFG_MAMR_8COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
|
||||
MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 | \
|
||||
MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
|
||||
/* 9 column SDRAM */
|
||||
#define CFG_MAMR_9COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
|
||||
MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 | \
|
||||
MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
|
||||
|
||||
|
||||
/*
|
||||
* Internal Definitions
|
||||
*
|
||||
* Boot Flags
|
||||
*/
|
||||
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
|
||||
#define BOOTFLAG_WARM 0x02 /* Software reboot */
|
||||
|
||||
#define CONFIG_NET_MULTI
|
||||
#define CONFIG_SCC1_ENET
|
||||
#define CONFIG_FEC_ENET
|
||||
#define CONFIG_ETHPRIME "SCC ETHERNET"
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
@@ -191,7 +191,7 @@
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_FLASH_BASE 0xFFF80000
|
||||
#define CFG_MONITOR_BASE CFG_FLASH_BASE
|
||||
#define CFG_MONITOR_LEN (192 * 1024) /* Reserve 196 kB for Monitor */
|
||||
#define CFG_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Monitor */
|
||||
#define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */
|
||||
|
||||
/*
|
||||
|
||||
492
include/configs/atc.h
Normal file
492
include/configs/atc.h
Normal file
@@ -0,0 +1,492 @@
|
||||
/*
|
||||
* (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
|
||||
*/
|
||||
|
||||
/*
|
||||
* board/config.h - configuration options, board specific
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/*
|
||||
* High Level Configuration Options
|
||||
* (easy to change)
|
||||
*/
|
||||
|
||||
#define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
|
||||
#define CONFIG_ATC 1 /* ...on a ATC board */
|
||||
|
||||
/*
|
||||
* select serial console configuration
|
||||
*
|
||||
* if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
|
||||
* CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
|
||||
* for SCC).
|
||||
*
|
||||
* if CONFIG_CONS_NONE is defined, then the serial console routines must
|
||||
* defined elsewhere (for example, on the cogent platform, there are serial
|
||||
* ports on the motherboard which are used for the serial console - see
|
||||
* cogent/cma101/serial.[ch]).
|
||||
*/
|
||||
#define CONFIG_CONS_ON_SMC /* define if console on SMC */
|
||||
#undef CONFIG_CONS_ON_SCC /* define if console on SCC */
|
||||
#undef CONFIG_CONS_NONE /* define if console on something else*/
|
||||
#define CONFIG_CONS_INDEX 2 /* which serial channel for console */
|
||||
|
||||
#define CONFIG_BAUDRATE 115200
|
||||
|
||||
/*
|
||||
* select ethernet configuration
|
||||
*
|
||||
* if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
|
||||
* CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
|
||||
* for FCC)
|
||||
*
|
||||
* if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
|
||||
* defined elsewhere (as for the console), or CFG_CMD_NET must be removed
|
||||
* from CONFIG_COMMANDS to remove support for networking.
|
||||
*
|
||||
*/
|
||||
#undef CONFIG_ETHER_ON_SCC /* define if ether on SCC */
|
||||
#undef CONFIG_ETHER_NONE /* define if ether on something else */
|
||||
#define CONFIG_ETHER_ON_FCC
|
||||
|
||||
#define CONFIG_NET_MULTI
|
||||
#define CONFIG_ETHER_ON_FCC2
|
||||
|
||||
/*
|
||||
* - Rx-CLK is CLK13
|
||||
* - Tx-CLK is CLK14
|
||||
* - RAM for BD/Buffers is on the 60x Bus (see 28-13)
|
||||
* - Enable Full Duplex in FSMR
|
||||
*/
|
||||
# define CFG_CMXFCR_MASK2 (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
|
||||
# define CFG_CMXFCR_VALUE2 (CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14)
|
||||
# define CFG_CPMFCR_RAMTYPE 0
|
||||
# define CFG_FCC_PSMR (FCC_PSMR_FDE|FCC_PSMR_LPB)
|
||||
|
||||
#define CONFIG_ETHER_ON_FCC3
|
||||
|
||||
/*
|
||||
* - Rx-CLK is CLK15
|
||||
* - Tx-CLK is CLK16
|
||||
* - RAM for BD/Buffers is on the local Bus (see 28-13)
|
||||
* - Enable Half Duplex in FSMR
|
||||
*/
|
||||
# define CFG_CMXFCR_MASK3 (CMXFCR_FC3|CMXFCR_RF3CS_MSK|CMXFCR_TF3CS_MSK)
|
||||
# define CFG_CMXFCR_VALUE3 (CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16)
|
||||
|
||||
/* system clock rate (CLKIN) - equal to the 60x and local bus speed */
|
||||
#define CONFIG_8260_CLKIN 64000000 /* in Hz */
|
||||
|
||||
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
|
||||
|
||||
#undef CONFIG_CLOCKS_IN_MHZ /* clocks passsed to Linux in Hz */
|
||||
|
||||
#define CONFIG_PREBOOT \
|
||||
"echo;" \
|
||||
"echo Type \"run flash_nfs\" to mount root filesystem over NFS;"\
|
||||
"echo"
|
||||
|
||||
#undef CONFIG_BOOTARGS
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"bootp;" \
|
||||
"setenv bootargs root=/dev/nfs rw " \
|
||||
"nfsroot=$(serverip):$(rootpath) " \
|
||||
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;"\
|
||||
"bootm"
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Miscellaneous configuration options
|
||||
*/
|
||||
|
||||
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
|
||||
#undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */
|
||||
|
||||
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
|
||||
|
||||
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
|
||||
CFG_CMD_EEPROM | \
|
||||
CFG_CMD_PCI | \
|
||||
CFG_CMD_PCMCIA | \
|
||||
CFG_CMD_IDE)
|
||||
#define CONFIG_DOS_PARTITION
|
||||
|
||||
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
|
||||
#include <cmd_confdefs.h>
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
*/
|
||||
#define CFG_LONGHELP /* undef to save memory */
|
||||
#define CFG_PROMPT "=> " /* Monitor Command Prompt */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
|
||||
#else
|
||||
#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
|
||||
#endif
|
||||
#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
|
||||
#define CFG_MAXARGS 16 /* max number of command args */
|
||||
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
|
||||
|
||||
#define CFG_MEMTEST_START 0x0400000 /* memtest works on */
|
||||
#define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
|
||||
|
||||
#define CFG_LOAD_ADDR 0x100000 /* default load address */
|
||||
|
||||
#define CFG_PIO_MODE 0 /* IDE interface in PIO Mode 0 */
|
||||
|
||||
#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
|
||||
|
||||
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
|
||||
|
||||
#define CFG_RESET_ADDRESS 0xFFF00100 /* "bad" address */
|
||||
|
||||
#define CFG_ALLOC_DPRAM
|
||||
|
||||
#undef CONFIG_WATCHDOG /* watchdog disabled */
|
||||
|
||||
#define CONFIG_SPI
|
||||
|
||||
/*
|
||||
* For booting Linux, the board info and command line data
|
||||
* have to be in the first 8 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Flash configuration
|
||||
*/
|
||||
|
||||
#define CFG_BOOTROM_BASE 0xFF800000
|
||||
#define CFG_BOOTROM_SIZE 0x00080000
|
||||
#define CFG_FLASH_BASE 0xFF000000
|
||||
#define CFG_FLASH_SIZE 0x00800000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* FLASH organization
|
||||
*/
|
||||
#define CFG_MAX_FLASH_BANKS 1 /* max num of memory banks */
|
||||
#define CFG_MAX_FLASH_SECT 128 /* max num of sects on one chip */
|
||||
|
||||
#define CFG_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
|
||||
#define CFG_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
|
||||
|
||||
#define CONFIG_FLASH_16BIT
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Hard Reset Configuration Words
|
||||
*
|
||||
* if you change bits in the HRCW, you must also change the CFG_*
|
||||
* defines for the various registers affected by the HRCW e.g. changing
|
||||
* HRCW_DPPCxx requires you to also change CFG_SIUMCR.
|
||||
*/
|
||||
#define CFG_HRCW_MASTER (HRCW_CIP | HRCW_ISB100 | HRCW_BMS | \
|
||||
HRCW_BPS10 | HRCW_DPPC10 |\
|
||||
HRCW_APPC10)
|
||||
|
||||
/* no slaves so just fill with zeros */
|
||||
#define CFG_HRCW_SLAVE1 0
|
||||
#define CFG_HRCW_SLAVE2 0
|
||||
#define CFG_HRCW_SLAVE3 0
|
||||
#define CFG_HRCW_SLAVE4 0
|
||||
#define CFG_HRCW_SLAVE5 0
|
||||
#define CFG_HRCW_SLAVE6 0
|
||||
#define CFG_HRCW_SLAVE7 0
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Internal Memory Mapped Register
|
||||
*/
|
||||
#define CFG_IMMR 0xF0000000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Definitions for initial stack pointer and data area (in DPRAM)
|
||||
*/
|
||||
#define CFG_INIT_RAM_ADDR CFG_IMMR
|
||||
#define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
|
||||
#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data*/
|
||||
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
|
||||
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Start addresses for the final memory configuration
|
||||
* (Set up by the startup code)
|
||||
* Please note that CFG_SDRAM_BASE _must_ start at 0
|
||||
*
|
||||
* 60x SDRAM is mapped at CFG_SDRAM_BASE.
|
||||
*/
|
||||
#define CFG_SDRAM_BASE 0x00000000
|
||||
#define CFG_SDRAM_MAX_SIZE 0x08000000 /* max. 128 MB */
|
||||
#define CFG_MONITOR_BASE TEXT_BASE
|
||||
#define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */
|
||||
#define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc()*/
|
||||
|
||||
#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
|
||||
# define CFG_RAMBOOT
|
||||
#endif
|
||||
|
||||
#define CONFIG_PCI
|
||||
#define CONFIG_PCI_PNP
|
||||
#define CFG_PCI_MSTR_IO_BUS 0x00000000 /* PCI base */
|
||||
|
||||
#if 1
|
||||
/* environment is in Flash */
|
||||
#define CFG_ENV_IS_IN_FLASH 1
|
||||
# define CFG_ENV_ADDR (CFG_FLASH_BASE+0x30000)
|
||||
# define CFG_ENV_SIZE 0x10000
|
||||
# define CFG_ENV_SECT_SIZE 0x10000
|
||||
#else
|
||||
#define CFG_ENV_IS_IN_EEPROM 1
|
||||
#define CFG_ENV_OFFSET 0
|
||||
#define CFG_ENV_SIZE 2048
|
||||
#define CFG_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
|
||||
#endif
|
||||
/*
|
||||
* Internal Definitions
|
||||
*
|
||||
* Boot Flags
|
||||
*/
|
||||
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH*/
|
||||
#define BOOTFLAG_WARM 0x02 /* Software reboot */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Cache Configuration
|
||||
*/
|
||||
#define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
|
||||
# define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* HIDx - Hardware Implementation-dependent Registers 2-11
|
||||
*-----------------------------------------------------------------------
|
||||
* HID0 also contains cache control - initially enable both caches and
|
||||
* invalidate contents, then the final state leaves only the instruction
|
||||
* cache enabled. Note that Power-On and Hard reset invalidate the caches,
|
||||
* but Soft reset does not.
|
||||
*
|
||||
* HID1 has only read-only information - nothing to set.
|
||||
*/
|
||||
#define CFG_HID0_INIT (HID0_ICE|HID0_DCE|HID0_ICFI|\
|
||||
HID0_DCI|HID0_IFEM|HID0_ABE)
|
||||
#define CFG_HID0_FINAL (HID0_IFEM|HID0_ABE)
|
||||
#define CFG_HID2 0
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* RMR - Reset Mode Register 5-5
|
||||
*-----------------------------------------------------------------------
|
||||
* turn on Checkstop Reset Enable
|
||||
*/
|
||||
#define CFG_RMR RMR_CSRE
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* BCR - Bus Configuration 4-25
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define BCR_APD01 0x10000000
|
||||
#define CFG_BCR (BCR_APD01|BCR_ETM|BCR_LETM) /* 8260 mode */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SIUMCR - SIU Module Configuration 4-31
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_SIUMCR (SIUMCR_BBD|SIUMCR_DPPC10|SIUMCR_APPC10|\
|
||||
SIUMCR_CS10PC00|SIUMCR_BCTLC10)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SYPCR - System Protection Control 4-35
|
||||
* SYPCR can only be written once after reset!
|
||||
*-----------------------------------------------------------------------
|
||||
* Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
|
||||
*/
|
||||
#if defined(CONFIG_WATCHDOG)
|
||||
#define CFG_SYPCR (SYPCR_SWTC|SYPCR_BMT|SYPCR_PBME|SYPCR_LBME|\
|
||||
SYPCR_SWRI|SYPCR_SWP|SYPCR_SWE)
|
||||
#else
|
||||
#define CFG_SYPCR (SYPCR_SWTC|SYPCR_BMT|SYPCR_PBME|SYPCR_LBME|\
|
||||
SYPCR_SWRI|SYPCR_SWP)
|
||||
#endif /* CONFIG_WATCHDOG */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* TMCNTSC - Time Counter Status and Control 4-40
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
|
||||
* and enable Time Counter
|
||||
*/
|
||||
#define CFG_TMCNTSC (TMCNTSC_SEC|TMCNTSC_ALR|TMCNTSC_TCF|TMCNTSC_TCE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PISCR - Periodic Interrupt Status and Control 4-42
|
||||
*-----------------------------------------------------------------------
|
||||
* Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
|
||||
* Periodic timer
|
||||
*/
|
||||
#define CFG_PISCR (PISCR_PS|PISCR_PTF|PISCR_PTE)
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* SCCR - System Clock Control 9-8
|
||||
*-----------------------------------------------------------------------
|
||||
* Ensure DFBRG is Divide by 16
|
||||
*/
|
||||
#define CFG_SCCR SCCR_DFBRG01
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* RCCR - RISC Controller Configuration 13-7
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_RCCR 0
|
||||
|
||||
#define CFG_MIN_AM_MASK 0xC0000000
|
||||
/*-----------------------------------------------------------------------
|
||||
* MPTPR - Memory Refresh Timer Prescaler Register 10-18
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_MPTPR 0x1F00
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PSRT - Refresh Timer Register 10-16
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
#define CFG_PSRT 0x0f
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PSRT - SDRAM Mode Register 10-10
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* SDRAM initialization values for 8-column chips
|
||||
*/
|
||||
#define CFG_OR2_8COL (CFG_MIN_AM_MASK |\
|
||||
ORxS_BPD_4 |\
|
||||
ORxS_ROWST_PBI1_A7 |\
|
||||
ORxS_NUMR_12)
|
||||
|
||||
#define CFG_PSDMR_8COL (PSDMR_PBI |\
|
||||
PSDMR_SDAM_A15_IS_A5 |\
|
||||
PSDMR_BSMA_A15_A17 |\
|
||||
PSDMR_SDA10_PBI1_A7 |\
|
||||
PSDMR_RFRC_7_CLK |\
|
||||
PSDMR_PRETOACT_3W |\
|
||||
PSDMR_ACTTORW_2W |\
|
||||
PSDMR_LDOTOPRE_1C |\
|
||||
PSDMR_WRC_1C |\
|
||||
PSDMR_CL_2)
|
||||
|
||||
/* SDRAM initialization values for 9-column chips
|
||||
*/
|
||||
#define CFG_OR2_9COL (CFG_MIN_AM_MASK |\
|
||||
ORxS_BPD_4 |\
|
||||
ORxS_ROWST_PBI1_A6 |\
|
||||
ORxS_NUMR_12)
|
||||
|
||||
#define CFG_PSDMR_9COL (PSDMR_PBI |\
|
||||
PSDMR_SDAM_A16_IS_A5 |\
|
||||
PSDMR_BSMA_A15_A17 |\
|
||||
PSDMR_SDA10_PBI1_A6 |\
|
||||
PSDMR_RFRC_7_CLK |\
|
||||
PSDMR_PRETOACT_3W |\
|
||||
PSDMR_ACTTORW_2W |\
|
||||
PSDMR_LDOTOPRE_1C |\
|
||||
PSDMR_WRC_1C |\
|
||||
PSDMR_CL_2)
|
||||
|
||||
/*
|
||||
* Init Memory Controller:
|
||||
*
|
||||
* Bank Bus Machine PortSz Device
|
||||
* ---- --- ------- ------ ------
|
||||
* 0 60x GPCM 8 bit Boot ROM
|
||||
* 1 60x GPCM 64 bit FLASH
|
||||
* 2 60x SDRAM 64 bit SDRAM
|
||||
*
|
||||
*/
|
||||
|
||||
#define CFG_MRS_OFFS 0x00000000
|
||||
|
||||
/* Bank 0 - FLASH
|
||||
*/
|
||||
#define CFG_BR0_PRELIM ((CFG_FLASH_BASE & BRx_BA_MSK) |\
|
||||
BRx_PS_16 |\
|
||||
BRx_MS_GPCM_P |\
|
||||
BRx_V)
|
||||
|
||||
#define CFG_OR0_PRELIM (P2SZ_TO_AM(CFG_FLASH_SIZE) |\
|
||||
ORxG_CSNT |\
|
||||
ORxG_ACS_DIV1 |\
|
||||
ORxG_SCY_3_CLK |\
|
||||
ORxU_EHTR_8IDLE)
|
||||
|
||||
|
||||
/* Bank 2 - 60x bus SDRAM
|
||||
*/
|
||||
#ifndef CFG_RAMBOOT
|
||||
#define CFG_BR2_PRELIM ((CFG_SDRAM_BASE & BRx_BA_MSK) |\
|
||||
BRx_PS_64 |\
|
||||
BRx_MS_SDRAM_P |\
|
||||
BRx_V)
|
||||
|
||||
#define CFG_OR2_PRELIM CFG_OR2_8COL
|
||||
|
||||
#define CFG_PSDMR CFG_PSDMR_8COL
|
||||
#endif /* CFG_RAMBOOT */
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* PCMCIA stuff
|
||||
*-----------------------------------------------------------------------
|
||||
*
|
||||
*/
|
||||
#define CONFIG_I82365
|
||||
|
||||
#define CFG_PCMCIA_MEM_ADDR 0x81000000
|
||||
#define CFG_PCMCIA_MEM_SIZE 0x1000
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
|
||||
|
||||
#undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
|
||||
#undef CONFIG_IDE_LED /* LED for ide not supported */
|
||||
#undef CONFIG_IDE_RESET /* reset for ide not supported */
|
||||
|
||||
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
|
||||
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
|
||||
|
||||
#define CFG_ATA_IDE0_OFFSET 0x0000
|
||||
|
||||
#define CFG_ATA_BASE_ADDR 0xa0000000
|
||||
|
||||
/* Offset for data I/O */
|
||||
#define CFG_ATA_DATA_OFFSET 0x100
|
||||
|
||||
/* Offset for normal register accesses */
|
||||
#define CFG_ATA_REG_OFFSET 0x100
|
||||
|
||||
/* Offset for alternate registers */
|
||||
#define CFG_ATA_ALT_OFFSET 0x108
|
||||
|
||||
#endif /* __CONFIG_H */
|
||||
@@ -270,6 +270,7 @@
|
||||
/*
|
||||
*/
|
||||
#define CONFIG_COMMANDS ( CFG_CMD_ALL & \
|
||||
~CFG_CMD_BMP & \
|
||||
~CFG_CMD_BSP & \
|
||||
~CFG_CMD_DCR & \
|
||||
~CFG_CMD_DHCP & \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user