Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cb61d7ddd | ||
|
|
6f21347d49 | ||
|
|
c29fdfc1d8 | ||
|
|
ca75added1 | ||
|
|
437ce07b8a | ||
|
|
fe389a82c9 | ||
|
|
d94f92cbd7 | ||
|
|
e0ac62d798 | ||
|
|
ae3af05ec9 | ||
|
|
9374fa287b | ||
|
|
013dc8d9b9 | ||
|
|
d41e5e6994 | ||
|
|
8f713fdfeb | ||
|
|
96e48cf6c1 | ||
|
|
bdccc4fedc | ||
|
|
96dd9af4c7 | ||
|
|
1f4bb37d6b | ||
|
|
7784674852 | ||
|
|
27b207fd0a | ||
|
|
2535d60277 |
No files matched your search
@@ -1,3 +1,157 @@
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.7:
|
||||
======================================================================
|
||||
|
||||
* Patch by Raghu Krishnaprasad, 7 Aug 2003:
|
||||
add support for Adder II MPC852T module
|
||||
|
||||
* Patch by George G. Davis, 19 Aug 2003:
|
||||
fix TI Innovator/OMAP1510 pin configs
|
||||
|
||||
* Patches by Kshitij, 18 Aug 2003
|
||||
- add support for arm926ejs cpu core
|
||||
- add support for TI OMAP 1610 Innovator Board
|
||||
|
||||
* Patch by Yuli Barcohen, 14 Aug 2003:
|
||||
add support for bzip2 uncompression
|
||||
|
||||
* Add GCC library to examples/Makefile so GCC utility functions will
|
||||
be resolved, too
|
||||
|
||||
* Add I2C and RTC support for RMU board using software I2C driver
|
||||
(because of better response to iprobe command); fix problem with
|
||||
"reset" command
|
||||
|
||||
* Patch by Matthias Fuchs, 28 Aug 2003:
|
||||
Added CONFIG_BOOTP_DNS2 and CONFIG_BOOTP_SEND_HOSTNAME to
|
||||
CONFIG_BOOTP_MAKS (see README).
|
||||
|
||||
* Fix ICU862 environment problem
|
||||
|
||||
* Fix RAM size detection for RMU board
|
||||
|
||||
* Implement "reset" for MGT5100/MPC5200 systems
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.6:
|
||||
======================================================================
|
||||
|
||||
* Make Ethernet autonegotiation on INCA-IP work for all clock rates;
|
||||
allow selection of clock frequency as "make" target
|
||||
|
||||
* Implement memory autosizing code for IceCube boards
|
||||
|
||||
* Configure network port on INCA-IP for autonegotiation
|
||||
|
||||
* Fix overflow problem in network timeout code
|
||||
|
||||
* Patch by Richard Woodruff, 8 Aug 2003:
|
||||
Allow crc32 to be used at address 0x000 (crc32_no_comp, too).
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.5:
|
||||
======================================================================
|
||||
|
||||
* Update for TQM board defaults:
|
||||
disable clocks_in_mhz, enable boot count limit
|
||||
|
||||
* Removed tools/gdb from "make all" target. Added make target "gdbtools"
|
||||
in toplevel directory instead. Removed astest.c from tools/gdb because
|
||||
it is no longer relevant.
|
||||
|
||||
* Fix PCI support for MPC5200 / IceCube Board
|
||||
|
||||
* Map ISP1362 USB OTG controller for NSCU board
|
||||
|
||||
* Patch by Brad Parker, 02 Aug 2003:
|
||||
fix sc520_cdp problems
|
||||
|
||||
* Implement Boot Cycle Detection (Req. 2.3 of OSDL CGL Reqirements)
|
||||
|
||||
* Allow erase command to cross flash bank boundaries
|
||||
|
||||
* Patch by Scott McNutt, 21 Jul 2003:
|
||||
Add support for LynuxWorks Kernel Downloadable Images (KDIs).
|
||||
Both LynxOS and BlueCat linux KDIs are supported.
|
||||
|
||||
* Patch by Richard Woodruff, 25 Jul 2003:
|
||||
use more reliable reset for OMAP/925T
|
||||
|
||||
* Patch by Nye Liu, 25 Jul 2003:
|
||||
fix typo in mpc8xx.h
|
||||
|
||||
* Patch by Richard Woodruff, 24 Jul 2003:
|
||||
Fixes for cmd_nand.c:
|
||||
- Fixed null dereferece which could result in incorrect ECC values.
|
||||
- Added support for devices with no Ready/Busy signal hooked up.
|
||||
- Added OMAP1510 read/write protect handling.
|
||||
- Fixed nand.h's ECCPOS. A conflict existed with POS5 and badblock
|
||||
for non-JFFS2.
|
||||
- Switched default ECC to be JFFS2.
|
||||
|
||||
* Allow crc32 to be used at address 0x000
|
||||
|
||||
* Provide consistent interface to standalone applications to access
|
||||
the 'global_data' structure
|
||||
Provide a doc/README.standalone more useful to users/developers.
|
||||
|
||||
* Make IceCube MGT5100 FEC driver work
|
||||
|
||||
* Implement new mechanism to export U-Boot's functions to standalone
|
||||
applications: instead of using (PPC-specific) system calls we now
|
||||
use a jump table; please see doc/README.standalone for details
|
||||
|
||||
* Patch by Dave Westwood, 24 Jul 2003:
|
||||
added support for Unity OS (a proprietary OS)
|
||||
|
||||
* Patch by Detlev Zundel, 23 Jul 2003:
|
||||
add "imls" command to print flash table of contents
|
||||
|
||||
* Fix cold boot detection for log buffer reset
|
||||
|
||||
* Return error for invalid length specifiers with "cp.X" etc.
|
||||
|
||||
* Fix startup problem on MIPS
|
||||
|
||||
* Allow for CONFIG_SPLASH_SCREEN even when no explicit
|
||||
bitmap support is configured
|
||||
|
||||
* Patch by Bill Hargen, 18 Jul 2003:
|
||||
- fix endinaness problem in cpu/mpc824x/drivers/i2c/i2c1.c
|
||||
|
||||
* Patch by Denis Peter, 18 Jul 2003:
|
||||
- fix memory configuration for MIP405T
|
||||
- fix printout of baudrate for "loadb <loadaddr> <baudrate>"
|
||||
|
||||
* Cleanup of TQM82xx configurations; use "official" board types
|
||||
to make selection easier.
|
||||
|
||||
* Patch by Martin Krause, 17 Jul 2003:
|
||||
add delay to get I2C working with "imm" command and s3c24x0_i2c.c
|
||||
|
||||
* Patch by Richard Woodruff, 17 July 03:
|
||||
- Fixed bug in OMAP1510 baud rate divisor settings.
|
||||
|
||||
* Patch by Nye Liu, 16 July 2003:
|
||||
MPC860FADS fixes:
|
||||
- add MPC86xADS support (uses MPC86xADS.h)
|
||||
- add 866P/T core support (also MPC859T/MPC859DSL/MPC852T)
|
||||
o PLPRCR changes
|
||||
o BRG changes (EXTAL/XTAL restricted to 10MHz)
|
||||
o don't trust gclk() software measurement by default, depend on
|
||||
CONFIG_8xx_GCLK_FREQ
|
||||
- add DRAM SIMM not installed detection
|
||||
- use more "correct" SDRAM initialization sequence
|
||||
- allow different SDRAM sizes (8xxADS has 8M)
|
||||
- default DER is 0
|
||||
- remove unused MAMR defines from FADS860T.h (all done in fads.c)
|
||||
- rename MAMR/MBMR defines to be more consistent. Should eventually
|
||||
be merged into MxMR to better reflect the PowerQUICC datasheet.
|
||||
|
||||
* Patch by Yuli Barcohen, 16 Jul 2003:
|
||||
support new Motorola PQ2FADS-ZU evaluation board which replaced
|
||||
MPC8260ADS and MPC8266ADS
|
||||
|
||||
======================================================================
|
||||
Changes for U-Boot 0.4.4:
|
||||
======================================================================
|
||||
|
||||
@@ -278,6 +278,7 @@ Gary Jennejohn <gj@denx.de>
|
||||
|
||||
Kshitij Gupta <kshitij@ti.com>
|
||||
omap1510inn ARM925T
|
||||
omap1610inn ARM926EJS
|
||||
|
||||
David Müller <d.mueller@elsoft.ch>
|
||||
|
||||
|
||||
@@ -31,20 +31,21 @@ LIST_5xxx=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_8xx=" \
|
||||
ADS860 AMX860 c2mon CCM \
|
||||
cogent_mpc8xx ESTEEM192E ETX094 ELPT860 \
|
||||
FADS823 FADS850SAR FADS860T FLAGADM \
|
||||
FPS850L GEN860T GEN860T_SC GENIETV \
|
||||
GTH hermes IAD210 ICU862_100MHz \
|
||||
IP860 IVML24 IVML24_128 IVML24_256 \
|
||||
IVMS8 IVMS8_128 IVMS8_256 KUP4K \
|
||||
LANTEC lwmon MBX MBX860T \
|
||||
MHPC MVS1 NETVIA NETVIA_V2 \
|
||||
NX823 pcu_e R360MPI RBC823 \
|
||||
rmu RPXClassic RPXlite RRvision \
|
||||
SM850 SPD823TS svm_sc8xx SXNI855T \
|
||||
TOP860 TQM823L TQM823L_LCD TQM850L \
|
||||
TQM855L TQM860L v37 \
|
||||
AdderII ADS860 AMX860 c2mon \
|
||||
CCM cogent_mpc8xx ESTEEM192E ETX094 \
|
||||
ELPT860 FADS823 FADS850SAR FADS860T \
|
||||
FLAGADM FPS850L GEN860T GEN860T_SC \
|
||||
GENIETV GTH hermes IAD210 \
|
||||
ICU862_100MHz IP860 IVML24 IVML24_128 \
|
||||
IVML24_256 IVMS8 IVMS8_128 IVMS8_256 \
|
||||
KUP4K LANTEC lwmon MBX \
|
||||
MBX860T MHPC MPC86xADS MVS1 \
|
||||
NETVIA NETVIA_V2 NX823 pcu_e \
|
||||
R360MPI RBC823 rmu RPXClassic \
|
||||
RPXlite RRvision SM850 SPD823TS \
|
||||
svm_sc8xx SXNI855T TOP860 TQM823L \
|
||||
TQM823L_LCD TQM850L TQM855L TQM860L \
|
||||
v37 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -80,7 +81,7 @@ LIST_8260=" \
|
||||
gw8260 hymod IPHASE4539 MPC8260ADS \
|
||||
MPC8266ADS PM826 ppmc8260 RPXsuper \
|
||||
rsdproto sacsng sbc8260 SCM \
|
||||
TQM8260 \
|
||||
TQM8260_AC TQM8260_AD TQM8260_AE \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
@@ -117,7 +118,11 @@ LIST_ARM7="ep7312 impa7"
|
||||
## ARM9 Systems
|
||||
#########################################################################
|
||||
|
||||
LIST_ARM9="at91rm9200dk omap1510inn smdk2400 smdk2410 trab VCMA9"
|
||||
LIST_ARM9=" \
|
||||
at91rm9200dk omap1510inn omap1610inn \
|
||||
smdk2400 smdk2410 trab \
|
||||
VCMA9 \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## Xscale Systems
|
||||
|
||||
@@ -116,13 +116,12 @@ LIBS += post/libpost.a post/cpu/libcpu.a
|
||||
LIBS += common/libcommon.a
|
||||
LIBS += lib_generic/libgeneric.a
|
||||
|
||||
#########################################################################
|
||||
#########################################################################
|
||||
|
||||
all: u-boot.srec u-boot.bin System.map
|
||||
ALL = u-boot.srec u-boot.bin System.map
|
||||
|
||||
install: all
|
||||
-cp u-boot.bin /tftpboot/u-boot.bin
|
||||
-cp u-boot.bin /net/denx/tftpboot/u-boot.bin
|
||||
all: $(ALL)
|
||||
|
||||
u-boot.srec: u-boot
|
||||
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
||||
@@ -130,6 +129,13 @@ u-boot.srec: u-boot
|
||||
u-boot.bin: u-boot
|
||||
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
|
||||
|
||||
u-boot.img: u-boot.bin
|
||||
./tools/mkimage -A $(ARCH) -T firmware -C none \
|
||||
-a $(TEXT_BASE) -e 0 \
|
||||
-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' include/version.h | \
|
||||
sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
|
||||
-d $< $@
|
||||
|
||||
u-boot.dis: u-boot
|
||||
$(OBJDUMP) -d $< > $@
|
||||
|
||||
@@ -142,6 +148,9 @@ u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
|
||||
subdirs:
|
||||
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
|
||||
|
||||
gdbtools:
|
||||
$(MAKE) -C tools/gdb || exit 1
|
||||
|
||||
depend dep:
|
||||
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
|
||||
|
||||
@@ -201,6 +210,9 @@ IceCube_5100_config: unconfig
|
||||
## MPC8xx Systems
|
||||
#########################################################################
|
||||
|
||||
AdderII_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx adderII
|
||||
|
||||
ADS860_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx fads
|
||||
|
||||
@@ -227,6 +239,7 @@ ETX094_config : unconfig
|
||||
|
||||
FADS823_config \
|
||||
FADS850SAR_config \
|
||||
MPC86xADS_config \
|
||||
FADS860T_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx fads
|
||||
|
||||
@@ -407,6 +420,12 @@ TQM860L_80MHz_config \
|
||||
TQM862L_config \
|
||||
TQM862L_66MHz_config \
|
||||
TQM862L_80MHz_config \
|
||||
TQM823M_config \
|
||||
TQM823M_66MHz_config \
|
||||
TQM823M_80MHz_config \
|
||||
TQM850M_config \
|
||||
TQM850M_66MHz_config \
|
||||
TQM850M_80MHz_config \
|
||||
TQM855M_config \
|
||||
TQM855M_66MHz_config \
|
||||
TQM855M_80MHz_config \
|
||||
@@ -661,32 +680,48 @@ sbc8260_config: unconfig
|
||||
SCM_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
|
||||
|
||||
TQM8255_config \
|
||||
TQM8260_config \
|
||||
TQM8260_L2_config \
|
||||
TQM8255_266MHz_config \
|
||||
TQM8260_266MHz_config \
|
||||
TQM8260_L2_266MHz_config \
|
||||
TQM8255_300MHz_config \
|
||||
TQM8260_300MHz_config: unconfig
|
||||
@ >include/config.h
|
||||
@if [ "$(findstring _L2_,$@)" ] ; then \
|
||||
TQM8255_AA_config \
|
||||
TQM8260_AA_config \
|
||||
TQM8260_AB_config \
|
||||
TQM8260_AC_config \
|
||||
TQM8260_AD_config \
|
||||
TQM8260_AE_config \
|
||||
TQM8260_AF_config \
|
||||
TQM8260_AG_config \
|
||||
TQM8260_AH_config \
|
||||
TQM8265_AA_config: unconfig
|
||||
@case "$@" in \
|
||||
TQM8255_AA_config) CTYPE=MPC8255; CFREQ=300; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AA_config) CTYPE=MPC8260; CFREQ=200; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AB_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
|
||||
TQM8260_AC_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
|
||||
TQM8260_AD_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
|
||||
TQM8260_AE_config) CTYPE=MPC8260; CFREQ=266; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AF_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
|
||||
TQM8260_AG_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=8260;; \
|
||||
TQM8260_AH_config) CTYPE=MPC8260; CFREQ=300; CACHE=yes; BMODE=60x;; \
|
||||
TQM8265_AA_config) CTYPE=MPC8265; CFREQ=300; CACHE=no; BMODE=60x;; \
|
||||
esac; \
|
||||
>include/config.h ; \
|
||||
if [ "$${CTYPE}" != "MPC8260" ] ; then \
|
||||
echo "#define CONFIG_$${CTYPE}" >>include/config.h ; \
|
||||
fi; \
|
||||
echo "#define CONFIG_$${CFREQ}MHz" >>include/config.h ; \
|
||||
echo "... with $${CFREQ}MHz system clock" ; \
|
||||
if [ "$${CACHE}" == "yes" ] ; then \
|
||||
echo "#define CONFIG_L2_CACHE" >>include/config.h ; \
|
||||
echo "... with L2 Cache support (60x Bus Mode)" ; \
|
||||
echo "... with L2 Cache support" ; \
|
||||
else \
|
||||
echo "#undef CONFIG_L2_CACHE" >>include/config.h ; \
|
||||
echo "... without L2 Cache support" ; \
|
||||
fi; \
|
||||
if [ "$${BMODE}" == "60x" ] ; then \
|
||||
echo "#define CONFIG_BUSMODE_60x" >>include/config.h ; \
|
||||
echo "... with 60x Bus Mode" ; \
|
||||
else \
|
||||
echo "#undef CONFIG_BUSMODE_60x" >>include/config.h ; \
|
||||
echo "... without 60x Bus Mode" ; \
|
||||
fi
|
||||
@[ -z "$(findstring _266MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_266MHz" >>include/config.h ; \
|
||||
echo "... with 266MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _300MHz,$@)" ] || \
|
||||
{ echo "#define CONFIG_300MHz" >>include/config.h ; \
|
||||
echo "... with 300MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring TQM8255_,$@)" ] || \
|
||||
{ echo "#define CONFIG_MPC8255" >>include/config.h ; }
|
||||
@./mkconfig -a TQM8260 ppc mpc8260 tqm8260
|
||||
|
||||
atc_config: unconfig
|
||||
@@ -744,6 +779,9 @@ xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
|
||||
omap1510inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm925t omap1510inn
|
||||
|
||||
omap1610inn_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm926ejs omap1610inn
|
||||
|
||||
smdk2400_config : unconfig
|
||||
@./mkconfig $(@:_config=) arm arm920t smdk2400
|
||||
|
||||
@@ -816,8 +854,30 @@ sc520_spunk_rel_config : unconfig
|
||||
## MIPS32 4Kc
|
||||
#########################################################################
|
||||
|
||||
incaip_config : unconfig
|
||||
@./mkconfig $(@:_config=) mips mips incaip
|
||||
xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1))))
|
||||
|
||||
incaip_100MHz_config \
|
||||
incaip_133MHz_config \
|
||||
incaip_150MHz_config \
|
||||
incaip_config: unconfig
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _100MHz,$@)" ] || \
|
||||
{ echo "#define CPU_CLOCK_RATE 100000000" >>include/config.h ; \
|
||||
echo "... with 100MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _133MHz,$@)" ] || \
|
||||
{ echo "#define CPU_CLOCK_RATE 133000000" >>include/config.h ; \
|
||||
echo "... with 133MHz system clock" ; \
|
||||
}
|
||||
@[ -z "$(findstring _150MHz,$@)" ] || \
|
||||
{ echo "#define CPU_CLOCK_RATE 150000000" >>include/config.h ; \
|
||||
echo "... with 150MHz system clock" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_incaip,$@) mips mips incaip
|
||||
|
||||
#########################################################################
|
||||
## MIPS64 5Kc
|
||||
#########################################################################
|
||||
|
||||
purple_config : unconfig
|
||||
@./mkconfig $(@:_config=) mips mips purple
|
||||
@@ -847,7 +907,7 @@ clobber: clean
|
||||
| xargs rm -f
|
||||
rm -f $(OBJS) *.bak tags TAGS
|
||||
rm -fr *.*~
|
||||
rm -f u-boot u-boot.bin u-boot.srec u-boot.map System.map
|
||||
rm -f u-boot u-boot.map $(ALL)
|
||||
rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
|
||||
rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
|
||||
rm -f include/asm/proc include/asm/arch include/asm
|
||||
|
||||
@@ -141,6 +141,7 @@ Directory Hierarchy:
|
||||
|
||||
- cpu/74xx_7xx Files specific to Motorola MPC74xx and 7xx CPUs
|
||||
- cpu/arm925t Files specific to ARM 925 CPUs
|
||||
- cpu/arm926ejs Files specific to ARM 926 CPUs
|
||||
- cpu/mpc5xx Files specific to Motorola MPC5xx CPUs
|
||||
- cpu/mpc8xx Files specific to Motorola MPC8xx CPUs
|
||||
- cpu/mpc824x Files specific to Motorola MPC824x CPUs
|
||||
@@ -197,7 +198,7 @@ Directory Hierarchy:
|
||||
- board/lwmon Files specific to LWMON boards
|
||||
- board/mbx8xx Files specific to MBX boards
|
||||
- board/mpc8260ads
|
||||
Files specific to MMPC8260ADS boards
|
||||
Files specific to MPC8260ADS and PQ2FADS-ZU boards
|
||||
- board/mpl/ Files specific to boards manufactured by MPL
|
||||
- board/mpl/common Common files for MPL boards
|
||||
- board/mpl/pip405 Files specific to PIP405 boards
|
||||
@@ -208,6 +209,8 @@ Directory Hierarchy:
|
||||
- board/oxc Files specific to OXC boards
|
||||
- board/omap1510inn
|
||||
Files specific to OMAP 1510 Innovator boards
|
||||
- board/omap1610inn
|
||||
Files specific to OMAP 1610 Innovator boards
|
||||
- board/pcippc2 Files specific to PCIPPC2/PCIPPC6 boards
|
||||
- board/pm826 Files specific to PM826 boards
|
||||
- board/ppmc8260
|
||||
@@ -357,7 +360,7 @@ The following options need to be configured:
|
||||
|
||||
CONFIG_HHP_CRADLE, CONFIG_DNP1110, CONFIG_EP7312,
|
||||
CONFIG_IMPA7, CONFIG_LART, CONFIG_LUBBOCK,
|
||||
CONFIG_INNOVATOROMAP1510,
|
||||
CONFIG_INNOVATOROMAP1510, CONFIG_INNOVATOROMAP1610
|
||||
CONFIG_SHANNON, CONFIG_SMDK2400, CONFIG_SMDK2410,
|
||||
CONFIG_TRAB, CONFIG_AT91RM9200DK
|
||||
|
||||
@@ -383,6 +386,14 @@ The following options need to be configured:
|
||||
the lcd display every second with
|
||||
a "rotator" |\-/|\-/
|
||||
|
||||
- Board flavour: (if CONFIG_MPC8260ADS is defined)
|
||||
CONFIG_ADSTYPE
|
||||
Possible values are:
|
||||
CFG_8260ADS - original MPC8260ADS
|
||||
CFG_8266ADS - MPC8266ADS (untested)
|
||||
CFG_PQ2FADS - PQ2FADS-ZU
|
||||
|
||||
|
||||
- MPC824X Family Member (if CONFIG_MPC824X is defined)
|
||||
Define exactly one of
|
||||
CONFIG_MPC8240, CONFIG_MPC8245
|
||||
@@ -851,6 +862,16 @@ The following options need to be configured:
|
||||
allows for a "silent" boot where a splash screen is
|
||||
loaded very quickly after power-on.
|
||||
|
||||
- Compression support:
|
||||
CONFIG_BZIP2
|
||||
|
||||
If this option is set, support for bzip2 compressed
|
||||
images is included. If not, only uncompressed and gzip
|
||||
compressed images are supported.
|
||||
|
||||
NOTE: the bzip2 algorithm requires a lot of RAM, so
|
||||
the malloc area (as defined by CFG_MALLOC_LEN) should
|
||||
be at least 4MB.
|
||||
|
||||
- Ethernet address:
|
||||
CONFIG_ETHADDR
|
||||
@@ -893,6 +914,29 @@ The following options need to be configured:
|
||||
4th and following
|
||||
BOOTP requests: delay 0 ... 8 sec
|
||||
|
||||
- DHCP Advanced Options:
|
||||
CONFIG_BOOTP_MASK
|
||||
|
||||
You can fine tune the DHCP functionality by adding
|
||||
these flags to the CONFIG_BOOTP_MASK define:
|
||||
|
||||
CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS
|
||||
serverip from a DHCP server, it is possible that more
|
||||
than one DNS serverip is offered to the client.
|
||||
If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS
|
||||
serverip will be stored in the additional environment
|
||||
variable "dnsip2". The first DNS serverip is always
|
||||
stored in the variable "dnsip", when CONFIG_BOOTP_DNS
|
||||
is added to the CONFIG_BOOTP_MASK.
|
||||
|
||||
CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable
|
||||
to do a dynamic update of a DNS server. To do this, they
|
||||
need the hostname of the DHCP requester.
|
||||
If CONFIG_BOOP_SEND_HOSTNAME is added to the
|
||||
CONFIG_BOOTP_MASK, the content of the "hostname"
|
||||
environment variable is passed as option 12 to
|
||||
the DHCP server.
|
||||
|
||||
- Status LED: CONFIG_STATUS_LED
|
||||
|
||||
Several configurations allow to display the current
|
||||
@@ -989,8 +1033,8 @@ The following options need to be configured:
|
||||
is FALSE, it clears it (low).
|
||||
|
||||
eg: #define I2C_SDA(bit) \
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SDA
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SDA
|
||||
|
||||
I2C_SCL(bit)
|
||||
|
||||
@@ -998,8 +1042,8 @@ The following options need to be configured:
|
||||
is FALSE, it clears it (low).
|
||||
|
||||
eg: #define I2C_SCL(bit) \
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SCL
|
||||
if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
|
||||
else immr->im_cpm.cp_pbdat &= ~PB_SCL
|
||||
|
||||
I2C_DELAY
|
||||
|
||||
@@ -1687,9 +1731,10 @@ Low Level (hardware related) configuration options:
|
||||
|
||||
- CFG_DEFAULT_IMMR:
|
||||
Default address of the IMMR after system reset.
|
||||
Needed on some 8260 systems (MPC8260ADS and RPXsuper)
|
||||
to be able to adjust the position of the IMMR
|
||||
register after a reset.
|
||||
|
||||
Needed on some 8260 systems (MPC8260ADS, PQ2FADS-ZU,
|
||||
and RPXsuper) to be able to adjust the position of
|
||||
the IMMR register after a reset.
|
||||
|
||||
- Floppy Disk Support:
|
||||
CFG_FDC_DRIVE_NUMBER
|
||||
@@ -1862,8 +1907,8 @@ configurations; the following names are supported:
|
||||
GENIETV_config TQM823L_config PIP405_config
|
||||
GEN860T_config EBONY_config FPS860L_config
|
||||
ELPT860_config cmi_mpc5xx_config NETVIA_config
|
||||
at91rm9200dk_config omap1510inn_config
|
||||
|
||||
at91rm9200dk_config omap1510inn_config MPC8260ADS_config
|
||||
omap1610inn_config
|
||||
Note: for some board special configuration names may exist; check if
|
||||
additional information is available from the board vendor; for
|
||||
instance, the TQM8xxL systems run normally at 50 MHz and use a
|
||||
@@ -2109,6 +2154,7 @@ depending the information provided by your boot server:
|
||||
|
||||
bootfile - see above
|
||||
dnsip - IP address of your Domain Name Server
|
||||
dnsip2 - IP address of your secondary Domain Name Server
|
||||
gatewayip - IP address of the Gateway (Router) to use
|
||||
hostname - Target hostname
|
||||
ipaddr - see above
|
||||
@@ -2226,12 +2272,11 @@ defines the following image properties:
|
||||
* Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
|
||||
4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
|
||||
LynxOS, pSOS, QNX, RTEMS, ARTOS;
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS).
|
||||
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
|
||||
* Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
|
||||
IA64, MIPS, MIPS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
|
||||
Currently supported: PowerPC).
|
||||
* Compression Type (Provisions for uncompressed, gzip, bzip2;
|
||||
Currently supported: uncompressed, gzip).
|
||||
* Compression Type (uncompressed, gzip, bzip2)
|
||||
* Load Address
|
||||
* Entry Point
|
||||
* Image Name
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o flash.o
|
||||
|
||||
$(LIB): .depend $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
|
||||
int checkboard( void )
|
||||
{
|
||||
puts("Board: ");
|
||||
puts("AdderII(MPC852T)\n" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined( CONFIG_SDRAM_50MHZ )
|
||||
|
||||
/******************************************************************************
|
||||
** for chip Samsung K4S643232F - T70
|
||||
** this table is for 32-50MHz operation
|
||||
*******************************************************************************/
|
||||
|
||||
#define SDRAM_MPTPRVALUE 0x0200
|
||||
|
||||
#define SDRAM_MAMRVALUE0 0x00802114 /* refresh at 32MHz */
|
||||
#define SDRAM_MAMRVALUE1 0x00802118
|
||||
|
||||
#define SDRAM_OR1VALUE 0xff800e00
|
||||
#define SDRAM_BR1VALUE 0x00000081
|
||||
|
||||
#define SDRAM_MARVALUE 94
|
||||
|
||||
#define SDRAM_MCRVALUE0 0x80808105
|
||||
#define SDRAM_MCRVALUE1 0x80808130
|
||||
|
||||
const uint sdram_table[] = {
|
||||
|
||||
/* single read (offset 0x00 in upm ram) */
|
||||
0x1f07fc24, 0xe0aefc04, 0x10adfc04, 0xe0bbbc00,
|
||||
0x10f77c44, 0xf3fffc07, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* burst read (offset 0x08 in upm ram) */
|
||||
0x1f07fc24, 0xe0aefc04, 0x10adfc04, 0xf0affc00,
|
||||
0xf0affc00, 0xf0affc00, 0xf0affc00, 0x10a77c44,
|
||||
0xf7bffc47, 0xfffffc35, 0xfffffc34, 0xfffffc35,
|
||||
0xfffffc35, 0x1ff77c35, 0xfffffc34, 0x1fb57c35,
|
||||
|
||||
/* single write (offset 0x18 in upm ram) */
|
||||
0x1f27fc24, 0xe0aebc04, 0x00b93c00, 0x13f77c47,
|
||||
0xfffdfc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* burst write (offset 0x20 in upm ram) */
|
||||
0x1f07fc24, 0xeeaebc00, 0x10ad7c00, 0xf0affc00,
|
||||
0xf0affc00, 0xe0abbc00, 0x1fb77c47, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* refresh (offset 0x30 in upm ram) */
|
||||
0x1ff5fca4, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc84, 0xfffffc07, 0xfffffc04, 0xfffffc04,
|
||||
0xfffffc04, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
|
||||
/* exception (offset 0x3C in upm ram) */
|
||||
0xfffffc27, 0xfffffc04, 0xfffffc04, 0xfffffc04,
|
||||
};
|
||||
|
||||
#else
|
||||
#error SDRAM not correctly configured
|
||||
#endif
|
||||
|
||||
int _initsdram (uint base, uint noMbytes)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
if (noMbytes != 8) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
upmconfig (UPMA, (uint *) sdram_table,
|
||||
sizeof (sdram_table) / sizeof (uint));
|
||||
|
||||
memctl->memc_mptpr = SDRAM_MPTPRVALUE;
|
||||
|
||||
/* Configure the refresh (mostly). This needs to be
|
||||
* based upon processor clock speed and optimized to provide
|
||||
* the highest level of performance. For multiple banks,
|
||||
* this time has to be divided by the number of banks.
|
||||
* Although it is not clear anywhere, it appears the
|
||||
* refresh steps through the chip selects for this UPM
|
||||
* on each refresh cycle.
|
||||
* We have to be careful changing
|
||||
* UPM registers after we ask it to run these commands.
|
||||
*/
|
||||
|
||||
memctl->memc_mamr = (SDRAM_MAMRVALUE0 | (SDRAM_MARVALUE << 24));
|
||||
memctl->memc_mar = 0x0;
|
||||
udelay (200);
|
||||
|
||||
/* Now run the precharge/nop/mrs commands.
|
||||
*/
|
||||
memctl->memc_mcr = 0x80002115;
|
||||
udelay (200);
|
||||
|
||||
/* Run 8 refresh cycles */
|
||||
memctl->memc_mcr = 0x80002380;
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_mar = 0x88;
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_mcr = 0x80002116;
|
||||
udelay (200);
|
||||
|
||||
memctl->memc_or1 = SDRAM_OR1VALUE;
|
||||
memctl->memc_br1 = SDRAM_BR1VALUE | base;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _sdramdisable( void )
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
memctl->memc_br1 = 0x00000000;
|
||||
|
||||
/* maybe we should turn off upma here or something */
|
||||
}
|
||||
|
||||
int initsdram (uint base, uint * noMbytes)
|
||||
{
|
||||
uint m = 8;
|
||||
|
||||
*noMbytes = m;
|
||||
|
||||
if (!_initsdram (base, m)) {
|
||||
return 0;
|
||||
} else {
|
||||
_sdramdisable ();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
/* AdderII: has 8MB SDRAM */
|
||||
uint sdramsz;
|
||||
uint m = 0;
|
||||
|
||||
if (!initsdram (0x00000000, &sdramsz)) {
|
||||
m += sdramsz;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return (m << 20);
|
||||
}
|
||||
|
||||
int testdram (void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX not an actual SDRAM test */
|
||||
printf ("Test: 8MB SDRAM\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* FLASH Memory Map as used by FADS Monitor:
|
||||
*
|
||||
* Start Address Length
|
||||
* +-----------------------+ 0xFE00_0000 Start of Flash -----------------
|
||||
* | MON8xx code | 0xFE00_0100 Reset Vector
|
||||
* +-----------------------+ 0xFE0?_????
|
||||
* | (unused) |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +-----------------------+
|
||||
* | |
|
||||
* +=======================+
|
||||
* | |
|
||||
* | ... |
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# (C) Copyright 2000
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#
|
||||
# AdderII board ( Analogue-Micro )
|
||||
#
|
||||
|
||||
TEXT_BASE = 0xFE000000
|
||||
|
||||
@@ -0,0 +1,501 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
/******************************************************************************
|
||||
** Notes: AM29LV320DB - 90EI ( 32 Mbit device )
|
||||
** Sectors - Eight 8 Kb sector
|
||||
** - Sixty three 64 Kb sector
|
||||
** Bottom boot sector
|
||||
******************************************************************************/
|
||||
#include <common.h>
|
||||
#include <mpc8xx.h>
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Defines
|
||||
******************************************************************************/
|
||||
#ifdef CONFIG_ADDERII
|
||||
|
||||
#define ADDR0 0x0555
|
||||
#define ADDR1 0x02AA
|
||||
#define FLASH_WORD_SIZE unsigned short
|
||||
|
||||
#endif
|
||||
|
||||
#if defined( CFG_ENV_IS_IN_FLASH )
|
||||
# ifndef CFG_ENV_ADDR
|
||||
# define CFG_ENV_ADDR ( CFG_FLASH_BASE + CFG_ENV_OFFSET )
|
||||
# endif
|
||||
# ifndef CFG_ENV_SIZE
|
||||
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
|
||||
# endif
|
||||
# ifndef CFG_ENV_SECT_SIZE
|
||||
# define CFG_ENV_SECT_SIZE CFG_ENV_SIZE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
** Global Parameters
|
||||
******************************************************************************/
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
|
||||
|
||||
/******************************************************************************
|
||||
** Function Prototypes
|
||||
******************************************************************************/
|
||||
static ulong flash_get_size( vu_long *addr, flash_info_t *info );
|
||||
|
||||
static int write_word( flash_info_t *info, ulong dest, ulong data );
|
||||
|
||||
static void flash_get_offsets( ulong base, flash_info_t *info );
|
||||
|
||||
int wait_for_DQ7( flash_info_t *info, int sect );
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_init
|
||||
** Param : void
|
||||
** Notes : Initializes the Flash Chip
|
||||
******************************************************************************/
|
||||
ulong flash_init (void)
|
||||
{
|
||||
ulong size_b0 = -1;
|
||||
int i;
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
/* Set Flash to unknown */
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Get the Flash Bank Size */
|
||||
|
||||
size_b0 = flash_get_size ((vu_long *) (CFG_FLASH_BASE),
|
||||
&flash_info[0]);
|
||||
|
||||
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
|
||||
printf ("## UNKNOWN Flash on Bank 0 - Size = 0x%08lx = %ldMB\n",
|
||||
size_b0, size_b0 >> 20);
|
||||
}
|
||||
|
||||
/* Remap Flash according to size detected */
|
||||
memctl->memc_or0 = 0xFF800774;
|
||||
memctl->memc_br0 = CFG_BR0_PRELIM;
|
||||
|
||||
/* Setup Flash Sector Offsets */
|
||||
|
||||
flash_get_offsets (CFG_FLASH_BASE, &flash_info[0]);
|
||||
|
||||
/* Monitor Protection ON - default */
|
||||
|
||||
#if ( CFG_MONITOR_BASE >= CFG_FLASH_BASE )
|
||||
flash_protect (FLAG_PROTECT_SET, CFG_MONITOR_BASE,
|
||||
(CFG_MONITOR_BASE + monitor_flash_len - 1),
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
|
||||
/* Protect Environment Variables */
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
flash_protect (FLAG_PROTECT_SET, CFG_ENV_ADDR,
|
||||
(CFG_ENV_ADDR + CFG_ENV_SIZE - 1), &flash_info[0]);
|
||||
#endif
|
||||
|
||||
return size_b0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_get_offsets
|
||||
** Param : ulong base, flash_into_t *info
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_print_info
|
||||
** Param : flash_info_t
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Missing or unknown flash type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_AMD:
|
||||
printf ("AMD ");
|
||||
break;
|
||||
case FLASH_MAN_FUJ:
|
||||
printf ("FUJITSU ");
|
||||
break;
|
||||
case FLASH_MAN_BM:
|
||||
printf ("BRIGHT MICRO ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_AM320B:
|
||||
printf ("AM29LV320B (32 Mbit, bottom boot sect)\n");
|
||||
break;
|
||||
case FLASH_AM320T:
|
||||
printf ("AM29LV320T (32 Mbit, top boot sector)\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n", info->size >> 20,
|
||||
info->sector_count);
|
||||
printf (" Sector Start Addresses:");
|
||||
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
if ((i % 5) == 0) {
|
||||
printf ("\n ");
|
||||
}
|
||||
printf (" %08lX%s",
|
||||
info->start[i],
|
||||
info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
** Function : flash_get_size
|
||||
** Param : vu_long *addr, flash_info_t *info
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
static ulong flash_get_size (vu_long * addr, flash_info_t * info)
|
||||
{
|
||||
short i;
|
||||
FLASH_WORD_SIZE manu_id, dev_id;
|
||||
ulong base = (ulong) addr;
|
||||
volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *) addr;
|
||||
|
||||
/* Write Auto Select Command and read Manufacturer's ID and Dev ID */
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0xAAAAAAAA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE) 0x55555555;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x90909090;
|
||||
|
||||
manu_id = addr2[0];
|
||||
|
||||
switch (manu_id) {
|
||||
case (FLASH_WORD_SIZE) AMD_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_AMD;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read Device Id */
|
||||
dev_id = addr2[1];
|
||||
|
||||
switch (dev_id) {
|
||||
case (FLASH_WORD_SIZE) AMD_ID_LV320B:
|
||||
info->flash_id += FLASH_AM320B;
|
||||
info->sector_count = 71; /* 8 - boot sec + 63 normal */
|
||||
info->size = 0x400000; /* 4MByte */
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set up sector start Addresses */
|
||||
|
||||
if (info->flash_id & FLASH_BTYPE) {
|
||||
/* set sector offsets for bottom boot block
|
||||
** Eight 8 Kb Boot sectors
|
||||
** Sixty Three 64Kb sectors
|
||||
*/
|
||||
for (i = 0; i < 8; i++) {
|
||||
info->start[i] = base + (i * 0x00002000);
|
||||
}
|
||||
for (i = 8; i < info->sector_count; i++) {
|
||||
info->start[i] = base + (i * 0x00010000) - 0x00070000;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset To read mode */
|
||||
|
||||
if (info->flash_id != FLASH_UNKNOWN) {
|
||||
addr = (ulong *) info->start[0];
|
||||
*addr = 0xF0F0F0F0;
|
||||
}
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** Function : flash_erase
|
||||
** Param : flash_info_t *info, int s_first, int s_last
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *addr2;
|
||||
int flag, prot, sect, l_sect;
|
||||
int i;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("Can't erase unknown flash type - aborted\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
l_sect = -1;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
addr2 = (FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) ==
|
||||
FLASH_MAN_SST) {
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE) 0x00500050; /* block erase */
|
||||
for (i = 0; i < 50; i++)
|
||||
udelay (1000); /* wait 1 ms */
|
||||
} else {
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00800080;
|
||||
addr[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[0] = (FLASH_WORD_SIZE) 0x00300030; /* sector erase */
|
||||
}
|
||||
l_sect = sect;
|
||||
/*
|
||||
* Wait for each sector to complete, it's more
|
||||
* reliable. According to AMD Spec, you must
|
||||
* issue all erase commands within a specified
|
||||
* timeout. This has been seen to fail, especially
|
||||
* if printf()s are included (for debug)!!
|
||||
*/
|
||||
wait_for_DQ7 (info, sect);
|
||||
}
|
||||
}
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* wait at least 80us - let's wait 1 ms */
|
||||
udelay (1000);
|
||||
|
||||
/* reset to read mode */
|
||||
addr = (FLASH_WORD_SIZE *) info->start[0];
|
||||
addr[0] = (FLASH_WORD_SIZE) 0x00F000F0; /* reset bank */
|
||||
|
||||
printf (" done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wait_for_DQ7 (flash_info_t * info, int sect)
|
||||
{
|
||||
ulong start, now, last;
|
||||
volatile FLASH_WORD_SIZE *addr =
|
||||
(FLASH_WORD_SIZE *) (info->start[sect]);
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
|
||||
(FLASH_WORD_SIZE) 0x00800080) {
|
||||
if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
return -1;
|
||||
}
|
||||
/* show that we're waiting */
|
||||
if ((now - last) > 1000) {
|
||||
putc ('.');
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Function : write_buff
|
||||
** Param : flash_info_t *info, uchar *src, ulong addr, ulong cnt
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp, data;
|
||||
int i, l, rc;
|
||||
|
||||
/* get lower word aligned address */
|
||||
wp = (addr & ~3);
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < 4 && cnt > 0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < 4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_word (info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
while (cnt >= 4) {
|
||||
data = 0;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_word (info, wp, data)) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += 4;
|
||||
cnt -= 4;
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < 4 && cnt > 0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i < 4; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
return (write_word (info, wp, data));
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** Function : write_word
|
||||
** Param : flash_info_t *info, ulong dest, ulong data
|
||||
** Notes :
|
||||
******************************************************************************/
|
||||
static int write_word (flash_info_t * info, ulong dest, ulong data)
|
||||
{
|
||||
volatile FLASH_WORD_SIZE *addr2 =
|
||||
(FLASH_WORD_SIZE *) (info->start[0]);
|
||||
volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *) dest;
|
||||
volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *) & data;
|
||||
ulong start;
|
||||
int i;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*((volatile FLASH_WORD_SIZE *) dest) &
|
||||
(FLASH_WORD_SIZE) data) != (FLASH_WORD_SIZE) data) {
|
||||
return (2);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4 / sizeof (FLASH_WORD_SIZE); i++) {
|
||||
int flag;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00AA00AA;
|
||||
addr2[ADDR1] = (FLASH_WORD_SIZE) 0x00550055;
|
||||
addr2[ADDR0] = (FLASH_WORD_SIZE) 0x00A000A0;
|
||||
|
||||
dest2[i] = data2[i];
|
||||
|
||||
/* re-enable interrupts if necessary */
|
||||
if (flag)
|
||||
enable_interrupts ();
|
||||
|
||||
/* data polling for D7 */
|
||||
start = get_timer (0);
|
||||
while ((dest2[i] & (FLASH_WORD_SIZE) 0x00800080) !=
|
||||
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
|
||||
if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
/* WARNING - the following is hand-optimized to fit within */
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
/*
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
|
||||
. = env_offset;
|
||||
common/environment.o(.text)
|
||||
*/
|
||||
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
}
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x0FFF) & 0xFFFFF000;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
*(.got)
|
||||
_GOT2_TABLE_ = .;
|
||||
*(.got2)
|
||||
_FIXUP_TABLE_ = .;
|
||||
*(.fixup)
|
||||
}
|
||||
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.dynamic)
|
||||
CONSTRUCTORS
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : { *(.data.init) }
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
*(.sbss) *(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
. = ALIGN(256 * 1024);
|
||||
.ppcenv :
|
||||
{
|
||||
common/environment.o (.ppcenv)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
#include <devices.h>
|
||||
#include <syscall.h>
|
||||
#include <net.h>
|
||||
#include <version.h>
|
||||
#include <dtt.h>
|
||||
|
||||
@@ -173,7 +173,7 @@ void after_reloc (ulong dest_addr)
|
||||
/*
|
||||
* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r(gd, dest_addr);
|
||||
board_init_r((gd_t *)gd, dest_addr);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -142,7 +142,7 @@ void after_reloc (ulong dest_addr)
|
||||
/*
|
||||
* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r (gd, dest_addr);
|
||||
board_init_r ((gd_t *)gd, dest_addr);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -254,7 +254,7 @@ long int initdram (int board_type)
|
||||
upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS;
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* should this be mamr? - NTL */
|
||||
memctl->memc_mptpr = MPTPR_PTP_DIV64;
|
||||
memctl->memc_mar = 0x00008800;
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ after_reloc(ulong dest_addr)
|
||||
}
|
||||
|
||||
/* now, jump to the main U-Boot board init code */
|
||||
board_init_r (gd, dest_addr);
|
||||
board_init_r ((gd_t *)gd, dest_addr);
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
+486
-377
File diff suppressed because it is too large.
Load diff
@@ -128,7 +128,7 @@ long int initdram (int board_type)
|
||||
|
||||
/* That should do it, just enable the periodic refresh in burst of 4*/
|
||||
memctl->memc_mamr = CFG_MAMR_48_SDR | MAMR_TLFA_4X;
|
||||
memctl->memc_mamr |= (MAMR_PTAE | MAMR_GPL_B4DIS);
|
||||
memctl->memc_mamr |= (MAMR_PTAE | MAMR_GPL_A4DIS);
|
||||
|
||||
size_b0 = 16*1024*1024;
|
||||
|
||||
@@ -141,7 +141,7 @@ long int initdram (int board_type)
|
||||
|
||||
upmconfig(UPMB, (uint *)dsp_disp_table, sizeof(dsp_disp_table)/sizeof(uint));
|
||||
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS;
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS;
|
||||
|
||||
memctl->memc_or4 = CFG_OR4;
|
||||
memctl->memc_br4 = CFG_BR4;
|
||||
|
||||
@@ -163,7 +163,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_mcr = 0x80804105; /* SDRAM bank 1 */
|
||||
|
||||
/* Execute refresh 8 times */
|
||||
memctl->memc_mbmr = (CFG_MBMR_8COL & ~MAMR_TLFB_MSK) | MAMR_TLFB_8X ;
|
||||
memctl->memc_mbmr = (CFG_MBMR_8COL & ~MBMR_TLFB_MSK) | MBMR_TLFB_8X ;
|
||||
|
||||
memctl->memc_mcr = 0x80802130; /* SDRAM bank 0 - execute twice */
|
||||
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ int _initsdram (uint base, uint * noMbytes)
|
||||
sizeof (fpga_table) / sizeof (uint));
|
||||
|
||||
/* Enable UPWAITB */
|
||||
mc->memc_mbmr = MAMR_GPL_B4DIS; /* (16-13) */
|
||||
mc->memc_mbmr = MBMR_GPL_B4DIS; /* (16-13) */
|
||||
|
||||
/* CS2, base FPGA_2_BASE - 4 MByte, use UPM B 32 Bit */
|
||||
mc->memc_or2 = 0xffc00000 | OR_BI;
|
||||
|
||||
+105
-38
@@ -23,36 +23,90 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc5xxx.h>
|
||||
#include <pci.h>
|
||||
|
||||
#ifndef CFG_RAMBOOT
|
||||
static long int dram_size(long int *base, long int maxsize)
|
||||
{
|
||||
volatile long int *addr;
|
||||
ulong cnt, val;
|
||||
ulong save[32]; /* to make test non-destructive */
|
||||
unsigned char i = 0;
|
||||
|
||||
for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
save[i++] = *addr;
|
||||
*addr = ~cnt;
|
||||
}
|
||||
|
||||
/* write 0 to base address */
|
||||
addr = base;
|
||||
save[i] = *addr;
|
||||
*addr = 0;
|
||||
|
||||
/* check at base address */
|
||||
if ((val = *addr) != 0) {
|
||||
*addr = save[i];
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
|
||||
addr = base + cnt; /* pointer arith! */
|
||||
|
||||
val = *addr;
|
||||
*addr = save[--i];
|
||||
|
||||
if (val != (~cnt)) {
|
||||
return (cnt * sizeof (long));
|
||||
}
|
||||
}
|
||||
return (maxsize);
|
||||
}
|
||||
|
||||
static void sdram_start (int hi_addr)
|
||||
{
|
||||
long hi_addr_bit = hi_addr ? 0x01000000 : 0;
|
||||
|
||||
/* unlock mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0000 | hi_addr_bit;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x408d0000;
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
#endif
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 | hi_addr_bit;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 | hi_addr_bit;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
/* normal operation */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0x504f0000 | hi_addr_bit;
|
||||
}
|
||||
#endif
|
||||
|
||||
long int initdram (int board_type)
|
||||
{
|
||||
ulong dramsize = 0;
|
||||
#ifndef CFG_RAMBOOT
|
||||
ulong test1, test2;
|
||||
|
||||
/* configure SDRAM start/end */
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x00000018;/* 32M at 0x0 */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x02000000;/* disabled */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
|
||||
|
||||
/* setup config registers */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = 0xc2233a00;
|
||||
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = 0x88b70004;
|
||||
|
||||
/* unlock mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0000;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x408d0000;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0002;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd04f0004;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
/* normal operation */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0x504f0000;
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_START = 0x00000000;
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = 0x000007ff;/* 64M */
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = 0x0000ffff;/* 2G */
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
|
||||
|
||||
/* setup config registers */
|
||||
@@ -61,33 +115,35 @@ long int initdram (int board_type)
|
||||
|
||||
/* address select register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_XLBSEL = 0x03000000;
|
||||
|
||||
/* unlock mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd14f0000;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd14f0002;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
/* precharge all banks */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd14f0002;
|
||||
/* auto refresh */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0xd14f0004;
|
||||
/* set mode register */
|
||||
*(vu_long *)MPC5XXX_SDRAM_MODE = 0x008d0000;
|
||||
/* normal operation */
|
||||
*(vu_long *)MPC5XXX_SDRAM_CTRL = 0x514f0000;
|
||||
#endif
|
||||
sdram_start(0);
|
||||
test1 = dram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
|
||||
sdram_start(1);
|
||||
test2 = dram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
|
||||
if (test1 > test2) {
|
||||
sdram_start(0);
|
||||
dramsize = test1;
|
||||
} else {
|
||||
dramsize = test2;
|
||||
}
|
||||
#if defined(CONFIG_MPC5200)
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS0CFG =
|
||||
(0x13 + __builtin_ffs(dramsize >> 20) - 1);
|
||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
|
||||
#elif defined(CONFIG_MGT5100)
|
||||
*(vu_long *)MPC5XXX_SDRAM_STOP = ((dramsize - 1) >> 15);
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef CONFIG_MGT5100
|
||||
*(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
|
||||
dramsize = ((*(vu_long *)MPC5XXX_SDRAM_STOP + 1) << 15);
|
||||
#else
|
||||
dramsize = ((1 << (*(vu_long *)MPC5XXX_SDRAM_CS0CFG - 0x13)) << 20);
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CFG_RAMBOOT */
|
||||
/* return total ram size */
|
||||
#if defined(CONFIG_MGT5100)
|
||||
return (64 * 1024 * 1024);
|
||||
#elif defined(CONFIG_MPC5200)
|
||||
return (32 * 1024 * 1024);
|
||||
#endif
|
||||
return dramsize;
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
@@ -114,3 +170,14 @@ void flash_preinit(void)
|
||||
#endif
|
||||
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static struct pci_controller hose;
|
||||
|
||||
extern void pci_mpc5xxx_init(struct pci_controller *);
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
pci_mpc5xxx_init(&hose);
|
||||
}
|
||||
#endif
|
||||
@@ -136,11 +136,6 @@ SECTIONS
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
. = ALIGN(256 * 1024);
|
||||
.ppcenv :
|
||||
{
|
||||
common/environment.o (.ppcenv)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
+2
-2
@@ -246,14 +246,14 @@ initdram (int board_type)
|
||||
udelay(1);
|
||||
memctl->memc_mcr = 0x80806130; /* autorefresh */
|
||||
|
||||
memctl->memc_mbmr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mbmr |= MBMR_PTBE; /* refresh enabled */
|
||||
|
||||
/*
|
||||
* Check Bank 0 Memory Size for re-configuration
|
||||
*/
|
||||
size_b0 = dram_size (CFG_MBMR_8COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
|
||||
|
||||
memctl->memc_mbmr = CFG_MBMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mbmr = CFG_MBMR_8COL | MBMR_PTBE;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ long int initdram (int board_type)
|
||||
udelay(1); /* 0x80006106 */
|
||||
memctl->memc_mcr = MCR_OP_RUN | MCR_MB_CS3 | MCR_MLCF(1) | MCR_MAD(0x06);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* refresh enabled */
|
||||
|
||||
udelay(200);
|
||||
|
||||
@@ -170,7 +170,7 @@ long int initdram (int board_type)
|
||||
(ulong *)SDRAM_BASE3_PRELIM,
|
||||
SDRAM_MAX_SIZE);
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;
|
||||
|
||||
/*
|
||||
* Final mapping:
|
||||
|
||||
+4
-4
@@ -246,7 +246,7 @@ long int initdram (int board_type)
|
||||
udelay (1); /* 0x80006106 */
|
||||
memctl->memc_mcr = MCR_OP_RUN | MCR_MB_CS3 | MCR_MLCF (1) | MCR_MAD (0x06);
|
||||
|
||||
memctl->memc_mamr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mamr |= MAMR_PTAE; /* refresh enabled */
|
||||
|
||||
udelay (200);
|
||||
|
||||
@@ -276,11 +276,11 @@ long int initdram (int board_type)
|
||||
|
||||
if (size8 < size9) { /* leave configuration at 9 columns */
|
||||
size_b0 = size9;
|
||||
memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTAE;
|
||||
udelay (500);
|
||||
} else { /* back to 8 columns */
|
||||
size_b0 = size8;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;
|
||||
udelay (500);
|
||||
}
|
||||
|
||||
@@ -1077,7 +1077,7 @@ static int key_pressed(void)
|
||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||
* Called from board_init_f().
|
||||
*/
|
||||
int post_hotkeys_pressed(gd_t *gd)
|
||||
int post_hotkeys_pressed(void)
|
||||
{
|
||||
uchar kbd_data[KEYBD_DATALEN];
|
||||
uchar val;
|
||||
|
||||
@@ -198,11 +198,19 @@ void reset_phy (void)
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
|
||||
/* reset the FEC port */
|
||||
bcsr[1] &= ~FETH_RST;
|
||||
bcsr[1] &= ~FETH1_RST;
|
||||
udelay(2);
|
||||
bcsr[1] |= FETH_RST;
|
||||
bcsr[1] |= FETH1_RST;
|
||||
udelay(1000);
|
||||
#ifdef CONFIG_MII
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
/*
|
||||
* Do not bypass Rx/Tx (de)scrambler (fix configuration error)
|
||||
* Enable autonegotiation.
|
||||
*/
|
||||
miiphy_write(0, 16, 0x610);
|
||||
miiphy_write(0, PHY_BMCR, PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
|
||||
#else
|
||||
/*
|
||||
* Ethernet PHY is configured (by means of configuration pins)
|
||||
* to work at 10Mb/s only. We reconfigure it using MII
|
||||
@@ -212,6 +220,7 @@ void reset_phy (void)
|
||||
miiphy_write(0, PHY_ANAR, 0x01E1); /* Advertise all capabilities */
|
||||
miiphy_write(0, PHY_DCR, 0x0000); /* Do not bypass Rx/Tx (de)scrambler */
|
||||
miiphy_write(0, PHY_BMCR, PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
#endif /* CONFIG_MII */
|
||||
}
|
||||
|
||||
@@ -219,7 +228,7 @@ int board_pre_init (void)
|
||||
{
|
||||
vu_long *bcsr = (vu_long *)CFG_BCSR;
|
||||
|
||||
bcsr[1] = ~FETHIEN & ~RS232EN_1;
|
||||
bcsr[1] = ~FETHIEN1 & ~RS232EN_1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -231,12 +240,10 @@ long int initdram (int board_type)
|
||||
volatile immap_t *immap = (immap_t *) CFG_IMMR;
|
||||
volatile memctl8260_t *memctl = &immap->im_memctl;
|
||||
volatile uchar *ramaddr, c = 0xff;
|
||||
|
||||
/* Initialisation is for 16MB DIMM the board is shipped with */
|
||||
long int msize = 16;
|
||||
uint or = 0xFF000CA0;
|
||||
uint psdmr = CFG_PSDMR;
|
||||
uint psrt = CFG_PSRT;
|
||||
long int msize;
|
||||
uint or;
|
||||
uint psdmr;
|
||||
uint psrt;
|
||||
|
||||
int i;
|
||||
|
||||
@@ -246,22 +253,29 @@ long int initdram (int board_type)
|
||||
immap->im_siu_conf.sc_tescr1 = 0x00004000;
|
||||
|
||||
memctl->memc_mptpr = CFG_MPTPR;
|
||||
/* init local sdram, bank 4 */
|
||||
memctl->memc_lsrt = 0x00000010;
|
||||
#ifdef CFG_LSDRAM_BASE
|
||||
/* Init local bus SDRAM */
|
||||
memctl->memc_lsrt = CFG_LSRT;
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS /* CS3 */
|
||||
memctl->memc_or3 = 0xFF803280;
|
||||
memctl->memc_br3 = CFG_LSDRAM_BASE | 0x00001861;
|
||||
#else /* CS4 */
|
||||
memctl->memc_or4 = 0xFFC01480;
|
||||
memctl->memc_br4 = 0x04001861;
|
||||
memctl->memc_lsdmr = 0x2886A522;
|
||||
memctl->memc_br4 = CFG_LSDRAM_BASE | 0x00001861;
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x28000000;
|
||||
ramaddr = (uchar *) CFG_LSDRAM_BASE;
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = 0x0886A522;
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x08000000;
|
||||
for (i = 0; i < 8; i++) {
|
||||
*ramaddr = c;
|
||||
}
|
||||
memctl->memc_lsdmr = 0x1886A522;
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x18000000;
|
||||
*ramaddr = c;
|
||||
memctl->memc_lsdmr = 0x4086A522;
|
||||
memctl->memc_lsdmr = CFG_LSDMR | 0x40000000;
|
||||
#endif /* CFG_LSDRAM_BASE */
|
||||
|
||||
/* init sdram dimm */
|
||||
/* Init 60x bus SDRAM */
|
||||
#ifdef CONFIG_SPD_EEPROM
|
||||
{
|
||||
spd_eeprom_t spd;
|
||||
@@ -398,6 +412,16 @@ long int initdram (int board_type)
|
||||
printf ("OR=%X, PSDMR=%08X, PSRT=%0X\n", or, psdmr, psrt);
|
||||
#endif /* SPD_DEBUG */
|
||||
}
|
||||
#else /* !CONFIG_SPD_EEPROM */
|
||||
#if CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
msize = 32;
|
||||
or = 0xFE002EC0;
|
||||
#else
|
||||
msize = 16;
|
||||
or = 0xFF000CA0;
|
||||
#endif /* CONFIG_ADSTYPE == CFG_PQ2FADS */
|
||||
psdmr = CFG_PSDMR;
|
||||
psrt = CFG_PSRT;
|
||||
#endif /* CONFIG_SPD_EEPROM */
|
||||
memctl->memc_psrt = psrt;
|
||||
memctl->memc_or2 = or;
|
||||
@@ -415,12 +439,20 @@ long int initdram (int board_type)
|
||||
*ramaddr = c;
|
||||
#endif
|
||||
|
||||
/* return total ram size of DIMM */
|
||||
/* return total 60x bus SDRAM size */
|
||||
return (msize * 1024 * 1024);
|
||||
}
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
#if CONFIG_ADSTYPE == CFG_8260ADS
|
||||
puts ("Board: Motorola MPC8260ADS\n");
|
||||
#elif CONFIG_ADSTYPE == CFG_8266ADS
|
||||
puts ("Board: Motorola MPC8266ADS\n");
|
||||
#elif CONFIG_ADSTYPE == CFG_PQ2FADS
|
||||
puts ("Board: Motorola PQ2FADS-ZU\n");
|
||||
#else
|
||||
puts ("Board: unknown\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -105,6 +105,8 @@ unsigned long flash_init (void)
|
||||
CFG_MONITOR_BASE+monitor_flash_len-1,
|
||||
&flash_info[0]);
|
||||
#endif
|
||||
/* protect reset vector */
|
||||
flash_info[0].protect[flash_info[0].sector_count-1] = 1;
|
||||
size_b1 = 0 ;
|
||||
flash_info[0].size = size_b0;
|
||||
#if 0
|
||||
|
||||
@@ -494,7 +494,7 @@ void mem_test_reloc(void)
|
||||
}
|
||||
|
||||
|
||||
int mem_test (unsigned long start, unsigned long ramsize, int quiet, int reloc)
|
||||
int mem_test (unsigned long start, unsigned long ramsize, int quiet)
|
||||
{
|
||||
unsigned long errors, stage;
|
||||
unsigned long startaddr, size, i;
|
||||
|
||||
@@ -110,7 +110,7 @@ static struct pci_pip405_config_entry piix4_ide_cntrl_f1[] = {
|
||||
#if !defined(CONFIG_MIP405T)
|
||||
{PCI_CFG_PIIX4_IDETIM, 0x80008000, 4}, /* enable Both IDE channels */
|
||||
#else
|
||||
{PCI_CFG_PIIX4_IDETIM, 0x80000000, 4}, /* enable IDE channel0 */
|
||||
{PCI_CFG_PIIX4_IDETIM, 0x00008000, 4}, /* enable IDE channel0 */
|
||||
#endif
|
||||
{ } /* end of device table */
|
||||
};
|
||||
|
||||
+42
-14
@@ -69,6 +69,7 @@
|
||||
#include <miiphy.h>
|
||||
#include "../common/common_util.h"
|
||||
#include <i2c.h>
|
||||
#include <rtc.h>
|
||||
extern block_dev_desc_t * scsi_get_dev(int dev);
|
||||
extern block_dev_desc_t * ide_get_dev(int dev);
|
||||
|
||||
@@ -110,14 +111,14 @@ typedef struct {
|
||||
} sdram_t;
|
||||
#if defined(CONFIG_MIP405T)
|
||||
const sdram_t sdram_table[] = {
|
||||
{ 0x01, /* MIP405T Rev A, 64MByte -1 Board */
|
||||
{ 0x0F, /* MIP405T Rev A, 64MByte -1 Board */
|
||||
3, /* Case Latenty = 3 */
|
||||
3, /* trp 20ns / 7.5 ns datain[27] */
|
||||
3, /* trcd 20ns /7.5 ns (datain[29]) */
|
||||
6, /* tras 44ns /7.5 ns (datain[30]) */
|
||||
4, /* tcpt 44 - 20ns = 24ns */
|
||||
3, /* Address Mode = 3 (13x9x4) */
|
||||
4, /* size value (64MByte) */
|
||||
2, /* Address Mode = 2 (12x9x4) */
|
||||
3, /* size value (32MByte) */
|
||||
0}, /* ECC disabled */
|
||||
{ 0xff, /* terminator */
|
||||
0xff,
|
||||
@@ -281,11 +282,6 @@ int init_sdram (void)
|
||||
if((bc & 0x80)==0x80)
|
||||
SDRAM_err ("U-Boot configured for a MIP405 not for a MIP405T!!!\n");
|
||||
#endif
|
||||
#if !defined(CONFIG_MIP405T)
|
||||
/* since the ECC initialisation needs some time,
|
||||
* we show that we're alive
|
||||
*/
|
||||
serial_puts ("\nInitializing SDRAM, Please stand by");
|
||||
/* set-up the chipselect machine */
|
||||
mtdcr (ebccfga, pb0cr); /* get cs0 config reg */
|
||||
tmp = mfdcr (ebccfgd);
|
||||
@@ -311,7 +307,6 @@ int init_sdram (void)
|
||||
mtdcr (ebccfgd, UART1_AP);
|
||||
mtdcr (ebccfga, pb3cr);
|
||||
mtdcr (ebccfgd, UART1_CR);
|
||||
#endif
|
||||
bc = in8 (PLD_BOARD_CFG_REG);
|
||||
#ifdef SDRAM_DEBUG
|
||||
serial_puts ("\nstart SDRAM Setup\n");
|
||||
@@ -333,6 +328,11 @@ int init_sdram (void)
|
||||
write_hex (i);
|
||||
serial_puts (" \n");
|
||||
#endif
|
||||
/* since the ECC initialisation needs some time,
|
||||
* we show that we're alive
|
||||
*/
|
||||
if (sdram_table[i].ecc)
|
||||
serial_puts ("\nInitializing SDRAM, Please stand by");
|
||||
cal_val = sdram_table[i].cal - 1; /* Cas Latency */
|
||||
trp_clocks = sdram_table[i].trp; /* 20ns / 7.5 ns datain[27] */
|
||||
trcd_clocks = sdram_table[i].trcd; /* 20ns /7.5 ns (datain[29]) */
|
||||
@@ -559,7 +559,7 @@ void get_pcbrev_var(unsigned char *pcbrev, unsigned char *var)
|
||||
unsigned char bc;
|
||||
bc = in8 (PLD_BOARD_CFG_REG);
|
||||
*pcbrev=(bc >> 4) & 0xf;
|
||||
*var=bc & 0xf ;
|
||||
*var=16-(bc & 0xf);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -654,8 +654,6 @@ long int initdram (int board_type)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
extern int mem_test (unsigned long start, unsigned long ramsize,
|
||||
int quiet);
|
||||
|
||||
static int test_dram (unsigned long ramsize)
|
||||
{
|
||||
@@ -666,8 +664,15 @@ static int test_dram (unsigned long ramsize)
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* used to check if the time in RTC is valid */
|
||||
static unsigned long start;
|
||||
static struct rtc_time tm;
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/* check, if RTC is running */
|
||||
rtc_get (&tm);
|
||||
start=get_timer(0);
|
||||
/* if MIP405 has booted from PCI, reset CCR0[24] as described in errata PCI_18 */
|
||||
if (mfdcr(strap) & PSR_ROM_LOC)
|
||||
mtspr(ccr0, (mfspr(ccr0) & ~0x80));
|
||||
@@ -688,9 +693,13 @@ void print_mip405_rev (void)
|
||||
}
|
||||
|
||||
extern void mem_test_reloc(void);
|
||||
extern int mk_date (char *, struct rtc_time *);
|
||||
|
||||
int last_stage_init (void)
|
||||
{
|
||||
unsigned long stop;
|
||||
struct rtc_time newtm;
|
||||
unsigned char *s;
|
||||
mem_test_reloc();
|
||||
/* write correct LED configuration */
|
||||
if (miiphy_write (0x1, 0x14, 0x2402) != 0) {
|
||||
@@ -704,6 +713,25 @@ int last_stage_init (void)
|
||||
print_mip405_rev ();
|
||||
show_stdio_dev ();
|
||||
check_env ();
|
||||
/* check if RTC time is valid */
|
||||
stop=get_timer(start);
|
||||
while(stop<1200) { /* we wait 1.2 sec to check if the RTC is running */
|
||||
udelay(1000);
|
||||
stop=get_timer(start);
|
||||
}
|
||||
rtc_get (&newtm);
|
||||
if(tm.tm_sec==newtm.tm_sec) {
|
||||
s=getenv("defaultdate");
|
||||
if(!s)
|
||||
mk_date ("010112001970", &newtm);
|
||||
else
|
||||
if(mk_date (s, &newtm)!=0) {
|
||||
printf("RTC: Bad date format in defaultdate\n");
|
||||
return 0;
|
||||
}
|
||||
rtc_reset ();
|
||||
rtc_set(&newtm);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -745,10 +773,10 @@ void print_mip405_info (void)
|
||||
printf ("SER1 uses handshakes %s\n",
|
||||
(ext & 0x80) ? "DTR/DSR" : "RTS/CTS");
|
||||
#else
|
||||
printf ("User Config Switch %d %d %d %d %d %d %d %d %d\n",
|
||||
printf ("User Config Switch %d %d %d %d %d %d %d %d\n",
|
||||
(ext) & 0x1, (ext >> 1) & 0x1, (ext >> 2) & 0x1,
|
||||
(ext >> 3) & 0x1, (ext >> 4) & 0x1, (ext >> 5) & 0x1,
|
||||
(ext >> 6) & 0x1,(ext >> 7) & 0x1,(ext >> 8) & 0x1);
|
||||
(ext >> 6) & 0x1,(ext >> 7) & 0x1);
|
||||
#endif
|
||||
printf ("IDE Reset %s\n", (ext & 0x01) ? "asserted" : "not asserted");
|
||||
printf ("IRQs:\n");
|
||||
|
||||
@@ -57,7 +57,6 @@ SECTIONS
|
||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||
|
||||
cpu/mpc8xx/start.o (.text)
|
||||
cpu/mpc8xx/speed.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_ppc/ppcstring.o (.text)
|
||||
lib_generic/vsprintf.o (.text)
|
||||
@@ -67,7 +66,6 @@ SECTIONS
|
||||
lib_generic/string.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_ppc/kgdb.o (.text)
|
||||
/* lib_ppc/ticks.o (.text) */
|
||||
|
||||
. = env_offset;
|
||||
common/environment.o(.text)
|
||||
|
||||
@@ -84,6 +84,9 @@ platformsetup:
|
||||
ldr r0, REG_FUNC_MUX_CTRL_C
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_C
|
||||
str r1, [r0]
|
||||
ldr r0, REG_FUNC_MUX_CTRL_D
|
||||
ldr r1, VAL_FUNC_MUX_CTRL_D
|
||||
str r1, [r0]
|
||||
ldr r0, REG_VOLTAGE_CTRL_0
|
||||
ldr r1, VAL_VOLTAGE_CTRL_0
|
||||
str r1, [r0]
|
||||
@@ -352,9 +355,9 @@ VAL_PULL_DWN_CTRL_0:
|
||||
VAL_PULL_DWN_CTRL_1:
|
||||
.word 0x2e047fff
|
||||
VAL_PULL_DWN_CTRL_2:
|
||||
.word 0xffd7d3e6
|
||||
.word 0xffd603a6
|
||||
VAL_PULL_DWN_CTRL_3:
|
||||
.word 0x00003f03
|
||||
.word 0x00003e03
|
||||
VAL_VOLTAGE_CTRL_0:
|
||||
.word 0x00000007
|
||||
VAL_TEST_DBG_CTRL_0:
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# (C) Copyright 2000, 2001, 2002
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(BOARD).a
|
||||
|
||||
OBJS := omap1610innovator.o flash.o
|
||||
SOBJS := platform.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak .depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
-include .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# (C) Copyright 2002
|
||||
# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
#
|
||||
# (C) Copyright 2003
|
||||
# Texas Instruments, <www.ti.com>
|
||||
# Kshitij Gupta <Kshitij@ti.com>
|
||||
#
|
||||
# TI Innovator board with OMAP1610 (ARM925EJS) cpu
|
||||
# see http://www.ti.com/ for more information on Texas Instruments
|
||||
#
|
||||
# Innovator has 1 bank of 256 MB SDRAM
|
||||
# Physical Address:
|
||||
# 1000'0000 to 2000'0000
|
||||
#
|
||||
#
|
||||
# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000
|
||||
# (mem base + reserved)
|
||||
#
|
||||
# we load ourself to 1100'0000
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
TEXT_BASE = 0x11000000
|
||||
@@ -0,0 +1,482 @@
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
/* Board support for 1 or 2 flash devices */
|
||||
#undef FLASH_PORT_WIDTH32
|
||||
#define FLASH_PORT_WIDTH16
|
||||
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
#define FLASH_PORT_WIDTH ushort
|
||||
#define FLASH_PORT_WIDTHV vu_short
|
||||
#define SWAP(x) __swab16(x)
|
||||
#else
|
||||
#define FLASH_PORT_WIDTH ulong
|
||||
#define FLASH_PORT_WIDTHV vu_long
|
||||
#define SWAP(x) __swab32(x)
|
||||
#endif
|
||||
|
||||
#define FPW FLASH_PORT_WIDTH
|
||||
#define FPWV FLASH_PORT_WIDTHV
|
||||
|
||||
#define mb() __asm__ __volatile__ ("" : : : "memory")
|
||||
|
||||
|
||||
|
||||
/* Flash Organization Structure */
|
||||
typedef struct OrgDef {
|
||||
unsigned int sector_number;
|
||||
unsigned int sector_size;
|
||||
} OrgDef;
|
||||
|
||||
|
||||
/* Flash Organizations */
|
||||
OrgDef OrgIntel_28F256L18T[] = {
|
||||
{4, 32 * 1024}, /* 4 * 32kBytes sectors */
|
||||
{255, 128 * 1024}, /* 255 * 128kBytes sectors */
|
||||
};
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Functions
|
||||
*/
|
||||
unsigned long flash_init (void);
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info);
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data);
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info);
|
||||
void inline spin_wheel (void);
|
||||
void flash_print_info (flash_info_t * info);
|
||||
void flash_unprotect_sectors (FPWV * addr);
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last);
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned long flash_init (void)
|
||||
{
|
||||
int i;
|
||||
ulong size = 0;
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
|
||||
flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
|
||||
break;
|
||||
default:
|
||||
panic ("configured to many flash banks!\n");
|
||||
break;
|
||||
}
|
||||
size += flash_info[i].size;
|
||||
}
|
||||
|
||||
/* Protect monitor and environment sectors
|
||||
*/
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_FLASH_BASE,
|
||||
CFG_FLASH_BASE + monitor_flash_len - 1, &flash_info[0]);
|
||||
|
||||
flash_protect (FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
static void flash_get_offsets (ulong base, flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
OrgDef *pOrgDef;
|
||||
|
||||
pOrgDef = OrgIntel_28F256L18T;
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
|
||||
for (i = 0; i < info->sector_count; i++) {
|
||||
if (i > 255) {
|
||||
info->start[i] = base + (i * 0x8000);
|
||||
info->protect[i] = 0;
|
||||
} else {
|
||||
info->start[i] = base +
|
||||
(i * PHYS_FLASH_SECT_SIZE);
|
||||
info->protect[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
void flash_print_info (flash_info_t * info)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("missing or unknown FLASH type\n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_VENDMASK) {
|
||||
case FLASH_MAN_INTEL:
|
||||
printf ("INTEL ");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Vendor ");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (info->flash_id & FLASH_TYPEMASK) {
|
||||
case FLASH_28F256L18T:
|
||||
printf ("FLASH 28F256L18T\n");
|
||||
break;
|
||||
default:
|
||||
printf ("Unknown Chip Type\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" Size: %ld MB in %d Sectors\n",
|
||||
info->size >> 20, info->sector_count);
|
||||
|
||||
printf (" Sector Start Addresses:");
|
||||
for (i = 0; i < info->sector_count; ++i) {
|
||||
if ((i % 5) == 0)
|
||||
printf ("\n ");
|
||||
printf (" %08lX%s",
|
||||
info->start[i], info->protect[i] ? " (RO)" : " ");
|
||||
}
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code cannot be run from FLASH!
|
||||
*/
|
||||
static ulong flash_get_size (FPW * addr, flash_info_t * info)
|
||||
{
|
||||
volatile FPW value;
|
||||
|
||||
/* Write auto select command: read Manufacturer ID */
|
||||
addr[0x5555] = (FPW) 0x00AA00AA;
|
||||
addr[0x2AAA] = (FPW) 0x00550055;
|
||||
addr[0x5555] = (FPW) 0x00900090;
|
||||
|
||||
mb ();
|
||||
value = addr[0];
|
||||
|
||||
switch (value) {
|
||||
|
||||
case (FPW) INTEL_MANUFACT:
|
||||
info->flash_id = FLASH_MAN_INTEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
info->sector_count = 0;
|
||||
info->size = 0;
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (0); /* no or unknown flash */
|
||||
}
|
||||
|
||||
mb ();
|
||||
value = addr[1]; /* device ID */
|
||||
switch (value) {
|
||||
|
||||
case (FPW) (INTEL_ID_28F256L18T):
|
||||
info->flash_id += FLASH_28F256L18T;
|
||||
info->sector_count = 259;
|
||||
info->size = 0x02000000;
|
||||
break; /* => 32 MB */
|
||||
|
||||
default:
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (info->sector_count > CFG_MAX_FLASH_SECT) {
|
||||
printf ("** ERROR: sector count %d > max (%d) **\n",
|
||||
info->sector_count, CFG_MAX_FLASH_SECT);
|
||||
info->sector_count = CFG_MAX_FLASH_SECT;
|
||||
}
|
||||
|
||||
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
|
||||
return (info->size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* unprotects a sector for write and erase
|
||||
* on some intel parts, this unprotects the entire chip, but it
|
||||
* wont hurt to call this additional times per sector...
|
||||
*/
|
||||
void flash_unprotect_sectors (FPWV * addr)
|
||||
{
|
||||
#define PD_FINTEL_WSMS_READY_MASK 0x0080
|
||||
|
||||
*addr = (FPW) 0x00500050; /* clear status register */
|
||||
|
||||
/* this sends the clear lock bit command */
|
||||
*addr = (FPW) 0x00600060;
|
||||
*addr = (FPW) 0x00D000D0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int flash_erase (flash_info_t * info, int s_first, int s_last)
|
||||
{
|
||||
int flag, prot, sect;
|
||||
ulong type, start, last;
|
||||
int rcode = 0;
|
||||
|
||||
if ((s_first < 0) || (s_first > s_last)) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
printf ("- missing\n");
|
||||
} else {
|
||||
printf ("- no sectors to erase\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
type = (info->flash_id & FLASH_VENDMASK);
|
||||
if ((type != FLASH_MAN_INTEL)) {
|
||||
printf ("Can't erase unknown flash type %08lx - aborted\n",
|
||||
info->flash_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
prot = 0;
|
||||
for (sect = s_first; sect <= s_last; ++sect) {
|
||||
if (info->protect[sect]) {
|
||||
prot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (prot) {
|
||||
printf ("- Warning: %d protected sectors will not be erased!\n",
|
||||
prot);
|
||||
} else {
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
start = get_timer (0);
|
||||
last = start;
|
||||
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
|
||||
/* Start erase on unprotected sectors */
|
||||
for (sect = s_first; sect <= s_last; sect++) {
|
||||
if (info->protect[sect] == 0) { /* not protected */
|
||||
FPWV *addr = (FPWV *) (info->start[sect]);
|
||||
FPW status;
|
||||
|
||||
printf ("Erasing sector %2d ... ", sect);
|
||||
|
||||
flash_unprotect_sectors (addr);
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
*addr = (FPW) 0x00500050;/* clear status register */
|
||||
*addr = (FPW) 0x00200020;/* erase setup */
|
||||
*addr = (FPW) 0x00D000D0;/* erase confirm */
|
||||
|
||||
while (((status =
|
||||
*addr) & (FPW) 0x00800080) !=
|
||||
(FPW) 0x00800080) {
|
||||
if (get_timer_masked () >
|
||||
CFG_FLASH_ERASE_TOUT) {
|
||||
printf ("Timeout\n");
|
||||
/* suspend erase */
|
||||
*addr = (FPW) 0x00B000B0;
|
||||
/* reset to read mode */
|
||||
*addr = (FPW) 0x00FF00FF;
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear status register cmd. */
|
||||
*addr = (FPW) 0x00500050;
|
||||
*addr = (FPW) 0x00FF00FF;/* resest to read mode */
|
||||
printf (" done\n");
|
||||
}
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Copy memory to flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
* 4 - Flash not identified
|
||||
*/
|
||||
|
||||
int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||
{
|
||||
ulong cp, wp;
|
||||
FPW data;
|
||||
int count, i, l, rc, port_width;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
return 4;
|
||||
}
|
||||
/* get lower word aligned address */
|
||||
#ifdef FLASH_PORT_WIDTH16
|
||||
wp = (addr & ~1);
|
||||
port_width = 2;
|
||||
#else
|
||||
wp = (addr & ~3);
|
||||
port_width = 4;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* handle unaligned start bytes
|
||||
*/
|
||||
if ((l = addr - wp) != 0) {
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < l; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
for (; i < port_width && cnt > 0; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
++cp;
|
||||
}
|
||||
for (; cnt == 0 && i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle word aligned part
|
||||
*/
|
||||
count = 0;
|
||||
while (cnt >= port_width) {
|
||||
data = 0;
|
||||
for (i = 0; i < port_width; ++i) {
|
||||
data = (data << 8) | *src++;
|
||||
}
|
||||
if ((rc = write_data (info, wp, SWAP (data))) != 0) {
|
||||
return (rc);
|
||||
}
|
||||
wp += port_width;
|
||||
cnt -= port_width;
|
||||
if (count++ > 0x800) {
|
||||
spin_wheel ();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle unaligned tail bytes
|
||||
*/
|
||||
data = 0;
|
||||
for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
|
||||
data = (data << 8) | *src++;
|
||||
--cnt;
|
||||
}
|
||||
for (; i < port_width; ++i, ++cp) {
|
||||
data = (data << 8) | (*(uchar *) cp);
|
||||
}
|
||||
|
||||
return (write_data (info, wp, SWAP (data)));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Write a word or halfword to Flash, returns:
|
||||
* 0 - OK
|
||||
* 1 - write timeout
|
||||
* 2 - Flash not erased
|
||||
*/
|
||||
static int write_data (flash_info_t * info, ulong dest, FPW data)
|
||||
{
|
||||
FPWV *addr = (FPWV *) dest;
|
||||
ulong status;
|
||||
int flag;
|
||||
|
||||
/* Check if Flash is (sufficiently) erased */
|
||||
if ((*addr & data) != data) {
|
||||
printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr);
|
||||
return (2);
|
||||
}
|
||||
flash_unprotect_sectors (addr);
|
||||
/* Disable interrupts which might cause a timeout here */
|
||||
flag = disable_interrupts ();
|
||||
*addr = (FPW) 0x00400040; /* write setup */
|
||||
*addr = data;
|
||||
|
||||
/* arm simple, non interrupt dependent timer */
|
||||
reset_timer_masked ();
|
||||
|
||||
/* wait while polling the status register */
|
||||
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
|
||||
if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
*addr = (FPW) 0x00FF00FF; /* restore read mode */
|
||||
return (0);
|
||||
}
|
||||
|
||||
void inline spin_wheel (void)
|
||||
{
|
||||
static int p = 0;
|
||||
static char w[] = "\\/-";
|
||||
|
||||
printf ("\010%c", w[p]);
|
||||
(++p == 3) ? (p = 0) : 0;
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#if defined(CONFIG_OMAP1610)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
void flash__init (void);
|
||||
void ether__init (void);
|
||||
void set_muxconf_regs (void);
|
||||
void peripheral_power_enable (void);
|
||||
|
||||
#define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
|
||||
|
||||
static inline void delay (unsigned long loops)
|
||||
{
|
||||
__asm__ volatile ("1:\n"
|
||||
"subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0" (loops));
|
||||
}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* arch number of OMAP 1510-Board */
|
||||
/* to be changed for OMAP 1610 Board */
|
||||
gd->bd->bi_arch_number = 234;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0x10000100;
|
||||
|
||||
/* Configure MUX settings */
|
||||
set_muxconf_regs ();
|
||||
peripheral_power_enable ();
|
||||
|
||||
/* this speeds up your boot a quite a bit. However to make it
|
||||
* work, you need make sure your kernel startup flush bug is fixed.
|
||||
* ... rkw ...
|
||||
*/
|
||||
icache_enable ();
|
||||
|
||||
flash__init ();
|
||||
ether__init ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int misc_init_r (void)
|
||||
{
|
||||
/* currently empty */
|
||||
return (0);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
void flash__init (void)
|
||||
{
|
||||
#define EMIFS_GlB_Config_REG 0xfffecc0c
|
||||
unsigned int regval;
|
||||
regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG);
|
||||
/* Turn off write protection for flash devices. */
|
||||
regval = regval | 0x0001;
|
||||
*((volatile unsigned int *) EMIFS_GlB_Config_REG) = regval;
|
||||
}
|
||||
/*************************************************************
|
||||
Routine:ether__init
|
||||
Description: take the Ethernet controller out of reset and wait
|
||||
for the EEPROM load to complete.
|
||||
*************************************************************/
|
||||
void ether__init (void)
|
||||
{
|
||||
#define ETH_CONTROL_REG 0x0400000b
|
||||
|
||||
*((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
|
||||
udelay (3);
|
||||
}
|
||||
|
||||
/******************************
|
||||
Routine:
|
||||
Description:
|
||||
******************************/
|
||||
int dram_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************
|
||||
Routine: set_muxconf_regs
|
||||
Description: Setting up the configuration Mux registers
|
||||
specific to the hardware
|
||||
*******************************************************/
|
||||
void set_muxconf_regs (void)
|
||||
{
|
||||
volatile unsigned int *MuxConfReg;
|
||||
/* set each registers to its reset value; */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0);
|
||||
/* setup for UART1 */
|
||||
*MuxConfReg &= ~(0x02000000); /* bit 25 */
|
||||
/* setup for UART2 */
|
||||
*MuxConfReg &= ~(0x01000000); /* bit 24 */
|
||||
/* Disable Uwire CS Hi-Z */
|
||||
*MuxConfReg |= 0x08000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_3);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_4);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_5);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_6);
|
||||
/*setup mux for UART3 */
|
||||
*MuxConfReg |= 0x00000001; /* bit3, 1, 0 (mux0 5,5,26) */
|
||||
*MuxConfReg &= ~0x0000003e;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_7);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_8);
|
||||
/* Disable Uwire CS Hi-Z */
|
||||
*MuxConfReg |= 0x00001200; /*bit 9 for CS0 12 for CS3 */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_9);
|
||||
/* Need to turn on bits 21 and 12 in FUNC_MUX_CTRL_9 so the */
|
||||
/* hardware will actually use TX and RTS based on bit 25 in */
|
||||
/* FUNC_MUX_CTRL_0. I told you this thing was screwy! */
|
||||
*MuxConfReg |= 0x00201000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_A);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_B);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_C);
|
||||
/* setup for UART2 */
|
||||
/* Need to turn on bits 27 and 24 in FUNC_MUX_CTRL_C so the */
|
||||
/* hardware will actually use TX and RTS based on bit 24 in */
|
||||
/* FUNC_MUX_CTRL_0. */
|
||||
*MuxConfReg |= 0x09000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_0);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_1);
|
||||
*MuxConfReg = 0x00000000;
|
||||
/* mux setup for SD/MMC driver */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_2);
|
||||
*MuxConfReg &= 0xFFFE0FFF;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_3);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
|
||||
/* bit 13 for MMC2 XOR_CLK */
|
||||
*MuxConfReg &= ~(0x00002000);
|
||||
/* bit 29 for UART 1 */
|
||||
*MuxConfReg &= ~(0x00002000);
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0);
|
||||
/* Configure for USB. Turn on VBUS_CTRL and VBUS_MODE. */
|
||||
*MuxConfReg |= 0x000C0000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int)USB_TRANSCEIVER_CTRL);
|
||||
*MuxConfReg &= ~(0x00000070);
|
||||
*MuxConfReg &= ~(0x00000008);
|
||||
*MuxConfReg |= 0x00000003;
|
||||
*MuxConfReg |= 0x00000180;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
|
||||
/* bit 17, software controls VBUS */
|
||||
*MuxConfReg &= ~(0x00020000);
|
||||
/* Enable USB 48 and 12M clocks */
|
||||
*MuxConfReg |= 0x00000200;
|
||||
*MuxConfReg &= ~(0x00000180);
|
||||
/*2.75V for MMCSDIO1 */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) VOLTAGE_CTRL_0);
|
||||
*MuxConfReg = 0x00001FE7;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_0);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_1);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_2);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_3);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_4);
|
||||
*MuxConfReg = 0x00000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_4);
|
||||
*MuxConfReg = 0x00000000;
|
||||
/* Turn on UART2 48 MHZ clock */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
|
||||
*MuxConfReg |= 0x40000000;
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) USB_OTG_CTRL);
|
||||
/* setup for USB VBus detection OMAP161x */
|
||||
*MuxConfReg |= 0x00040000; /* bit 18 */
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int) PU_PD_SEL_2);
|
||||
/* PullUps for SD/MMC driver */
|
||||
*MuxConfReg |= ~(0xFFFE0FFF);
|
||||
MuxConfReg =
|
||||
(volatile unsigned int *) ((unsigned int)COMP_MODE_CTRL_0);
|
||||
*MuxConfReg = COMP_MODE_ENABLE;
|
||||
}
|
||||
|
||||
/******************************************************
|
||||
Routine: peripheral_power_enable
|
||||
Description: Enable the power for UART1
|
||||
*******************************************************/
|
||||
void peripheral_power_enable (void)
|
||||
{
|
||||
#define UART1_48MHZ_ENABLE ((unsigned short)0x0200)
|
||||
#define SW_CLOCK_REQUEST ((volatile unsigned short *)0xFFFE0834)
|
||||
|
||||
*SW_CLOCK_REQUEST |= UART1_48MHZ_ENABLE;
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
/*
|
||||
* Board specific setup info
|
||||
*
|
||||
* (C) Copyright 2003
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Kshitij Gupta <Kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
#if defined(CONFIG_OMAP1610)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
|
||||
_TEXT_BASE:
|
||||
.word TEXT_BASE /* sdram load addr from config.mk */
|
||||
|
||||
.globl platformsetup
|
||||
platformsetup:
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT1) *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_ARM_IDLECT1
|
||||
ldr r1, VAL_ARM_IDLECT1
|
||||
str r1, [r0]
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT2) *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_ARM_IDLECT2
|
||||
ldr r1, VAL_ARM_IDLECT2
|
||||
str r1, [r0]
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Set up ARM CLM registers (IDLECT3) *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_ARM_IDLECT3
|
||||
ldr r1, VAL_ARM_IDLECT3
|
||||
str r1, [r0]
|
||||
|
||||
|
||||
mov r1, #0x01 /* PER_EN bit */
|
||||
ldr r0, REG_ARM_RSTCT2
|
||||
strh r1, [r0] /* CLKM; Peripheral reset. */
|
||||
|
||||
/* Set CLKM to Sync-Scalable */
|
||||
/* I supposedly need to enable the dsp clock before switching */
|
||||
mov r1, #0x0000
|
||||
ldr r0, REG_ARM_SYSST
|
||||
strh r1, [r0]
|
||||
mov r0, #0x400
|
||||
1:
|
||||
subs r0, r0, #0x1 /* wait for any bubbles to finish */
|
||||
bne 1b
|
||||
ldr r1, VAL_ARM_CKCTL
|
||||
ldr r0, REG_ARM_CKCTL
|
||||
strh r1, [r0]
|
||||
|
||||
/* a few nops to let settle */
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* setup DPLL 1 */
|
||||
/* Ramp up the clock to 96Mhz */
|
||||
ldr r1, VAL_DPLL1_CTL
|
||||
ldr r0, REG_DPLL1_CTL
|
||||
strh r1, [r0]
|
||||
ands r1, r1, #0x10 /* Check if PLL is enabled. */
|
||||
beq lock_end /* Do not look for lock if BYPASS selected */
|
||||
2:
|
||||
ldrh r1, [r0]
|
||||
ands r1, r1, #0x01 /* Check the LOCK bit.*/
|
||||
beq 2b /* loop until bit goes hi. */
|
||||
lock_end:
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* Turn off the watchdog during init... *
|
||||
*------------------------------------------------------*/
|
||||
ldr r0, REG_WATCHDOG
|
||||
ldr r1, WATCHDOG_VAL1
|
||||
str r1, [r0]
|
||||
ldr r1, WATCHDOG_VAL2
|
||||
str r1, [r0]
|
||||
ldr r0, REG_WSPRDOG
|
||||
ldr r1, WSPRDOG_VAL1
|
||||
str r1, [r0]
|
||||
ldr r0, REG_WWPSDOG
|
||||
|
||||
watch1Wait:
|
||||
ldr r1, [r0]
|
||||
tst r1, #0x10
|
||||
bne watch1Wait
|
||||
|
||||
ldr r0, REG_WSPRDOG
|
||||
ldr r1, WSPRDOG_VAL2
|
||||
str r1, [r0]
|
||||
ldr r0, REG_WWPSDOG
|
||||
watch2Wait:
|
||||
ldr r1, [r0]
|
||||
tst r1, #0x10
|
||||
bne watch2Wait
|
||||
|
||||
|
||||
|
||||
|
||||
/* Set memory timings corresponding to the new clock speed */
|
||||
|
||||
/* Check execution location to determine current execution location
|
||||
* and branch to appropriate initialization code.
|
||||
*/
|
||||
/* Load physical SDRAM base. */
|
||||
mov r0, #0x10000000
|
||||
/* Get current execution location. */
|
||||
mov r1, pc
|
||||
/* Compare. */
|
||||
cmp r1, r0
|
||||
/* Skip over EMIF-fast initialization if running from SDRAM. */
|
||||
bge skip_sdram
|
||||
|
||||
/*
|
||||
* Delay for SDRAM initialization.
|
||||
*/
|
||||
mov r3, #0x1800 /* value should be checked */
|
||||
3:
|
||||
subs r3, r3, #0x1 /* Decrement count */
|
||||
bne 3b
|
||||
|
||||
|
||||
/*
|
||||
* Set SDRAM control values. Disable refresh before MRS command.
|
||||
*/
|
||||
|
||||
/* mobile ddr operation */
|
||||
ldr r0, REG_SDRAM_OPERATION
|
||||
mov r2, #07
|
||||
str r2, [r0]
|
||||
|
||||
/* config register */
|
||||
ldr r0, REG_SDRAM_CONFIG
|
||||
ldr r1, SDRAM_CONFIG_VAL
|
||||
str r1, [r0]
|
||||
|
||||
/* manual command register */
|
||||
ldr r0, REG_SDRAM_MANUAL_CMD
|
||||
/* issue set cke high */
|
||||
mov r1, #CMD_SDRAM_CKE_SET_HIGH
|
||||
str r1, [r0]
|
||||
/* issue nop */
|
||||
mov r1, #CMD_SDRAM_NOP
|
||||
str r1, [r0]
|
||||
|
||||
mov r2, #0x0100
|
||||
waitMDDR1:
|
||||
subs r2, r2, #1
|
||||
bne waitMDDR1 /* delay loop */
|
||||
|
||||
/* issue precharge */
|
||||
mov r1, #CMD_SDRAM_PRECHARGE
|
||||
str r1, [r0]
|
||||
|
||||
/* issue autorefresh x 2 */
|
||||
mov r1, #CMD_SDRAM_AUTOREFRESH
|
||||
str r1, [r0]
|
||||
str r1, [r0]
|
||||
|
||||
/* mrs register ddr mobile */
|
||||
ldr r0, REG_SDRAM_MRS
|
||||
mov r1, #0x33
|
||||
str r1, [r0]
|
||||
|
||||
/* emrs1 low-power register */
|
||||
ldr r0, REG_SDRAM_EMRS1
|
||||
/* self refresh on all banks */
|
||||
mov r1, #0
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_DLL_URD_CONTROL
|
||||
ldr r1, DLL_URD_CONTROL_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_DLL_LRD_CONTROL
|
||||
ldr r1, DLL_LRD_CONTROL_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, REG_DLL_WRT_CONTROL
|
||||
ldr r1, DLL_WRT_CONTROL_VAL
|
||||
str r1, [r0]
|
||||
|
||||
/* delay loop */
|
||||
mov r2, #0x0100
|
||||
waitMDDR2:
|
||||
subs r2, r2, #1
|
||||
bne waitMDDR2
|
||||
|
||||
/*
|
||||
* Delay for SDRAM initialization.
|
||||
*/
|
||||
mov r3, #0x1800
|
||||
4:
|
||||
subs r3, r3, #1 /* Decrement count. */
|
||||
bne 4b
|
||||
b common_tc
|
||||
|
||||
skip_sdram:
|
||||
|
||||
ldr r0, REG_SDRAM_CONFIG
|
||||
ldr r1, SDRAM_CONFIG_VAL
|
||||
str r1, [r0]
|
||||
|
||||
common_tc:
|
||||
/* slow interface */
|
||||
ldr r1, VAL_TC_EMIFS_CS0_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS0_CONFIG
|
||||
str r1, [r0] /* Chip Select 0 */
|
||||
|
||||
ldr r1, VAL_TC_EMIFS_CS1_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS1_CONFIG
|
||||
str r1, [r0] /* Chip Select 1 */
|
||||
ldr r1, VAL_TC_EMIFS_CS3_CONFIG
|
||||
ldr r0, REG_TC_EMIFS_CS3_CONFIG
|
||||
str r1, [r0] /* Chip Select 3 */
|
||||
/* back to arch calling code */
|
||||
mov pc, lr
|
||||
|
||||
/* the literal pools origin */
|
||||
.ltorg
|
||||
|
||||
|
||||
REG_TC_EMIFS_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc0c
|
||||
REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc10
|
||||
REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc14
|
||||
REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc18
|
||||
REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */
|
||||
.word 0xfffecc1c
|
||||
|
||||
/* MPU clock/reset/power mode control registers */
|
||||
REG_ARM_CKCTL: /* 16 bits */
|
||||
.word 0xfffece00
|
||||
|
||||
REG_ARM_IDLECT3: /* 16 bits */
|
||||
.word 0xfffece24
|
||||
REG_ARM_IDLECT2: /* 16 bits */
|
||||
.word 0xfffece08
|
||||
REG_ARM_IDLECT1: /* 16 bits */
|
||||
.word 0xfffece04
|
||||
|
||||
REG_ARM_RSTCT2: /* 16 bits */
|
||||
.word 0xfffece14
|
||||
REG_ARM_SYSST: /* 16 bits */
|
||||
.word 0xfffece18
|
||||
/* DPLL control registers */
|
||||
REG_DPLL1_CTL: /* 16 bits */
|
||||
.word 0xfffecf00
|
||||
|
||||
/* Watch Dog register */
|
||||
/* secure watchdog stop */
|
||||
REG_WSPRDOG:
|
||||
.word 0xfffeb048
|
||||
/* watchdog write pending */
|
||||
REG_WWPSDOG:
|
||||
.word 0xfffeb034
|
||||
|
||||
WSPRDOG_VAL1:
|
||||
.word 0x0000aaaa
|
||||
WSPRDOG_VAL2:
|
||||
.word 0x00005555
|
||||
|
||||
/* SDRAM config is: auto refresh enabled, 16 bit 4 bank,
|
||||
counter @8192 rows, 10 ns, 8 burst */
|
||||
REG_SDRAM_CONFIG:
|
||||
.word 0xfffecc20
|
||||
|
||||
/* Operation register */
|
||||
REG_SDRAM_OPERATION:
|
||||
.word 0xfffecc80
|
||||
|
||||
/* Manual command register */
|
||||
REG_SDRAM_MANUAL_CMD:
|
||||
.word 0xfffecc84
|
||||
|
||||
/* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */
|
||||
REG_SDRAM_MRS:
|
||||
.word 0xfffecc70
|
||||
|
||||
/* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */
|
||||
REG_SDRAM_EMRS1:
|
||||
.word 0xfffecc78
|
||||
|
||||
/* WRT DLL register */
|
||||
REG_DLL_WRT_CONTROL:
|
||||
.word 0xfffecc68
|
||||
DLL_WRT_CONTROL_VAL:
|
||||
.word 0x03f00002
|
||||
|
||||
/* URD DLL register */
|
||||
REG_DLL_URD_CONTROL:
|
||||
.word 0xfffeccc0
|
||||
DLL_URD_CONTROL_VAL:
|
||||
.word 0x00800002
|
||||
|
||||
/* LRD DLL register */
|
||||
REG_DLL_LRD_CONTROL:
|
||||
.word 0xfffecccc
|
||||
|
||||
REG_WATCHDOG:
|
||||
.word 0xfffec808
|
||||
|
||||
/* 96 MHz Samsung Mobile DDR */
|
||||
SDRAM_CONFIG_VAL:
|
||||
.word 0x001200f4
|
||||
|
||||
DLL_LRD_CONTROL_VAL:
|
||||
.word 0x00800002
|
||||
|
||||
VAL_ARM_CKCTL:
|
||||
.word 0x3000
|
||||
VAL_DPLL1_CTL:
|
||||
.word 0x2830
|
||||
|
||||
VAL_TC_EMIFS_CS0_CONFIG:
|
||||
.word 0x002130b0
|
||||
VAL_TC_EMIFS_CS1_CONFIG:
|
||||
.word 0x00001131
|
||||
VAL_TC_EMIFS_CS2_CONFIG:
|
||||
.word 0x000055f0
|
||||
VAL_TC_EMIFS_CS3_CONFIG:
|
||||
.word 0x88011131
|
||||
VAL_TC_EMIFF_SDRAM_CONFIG:
|
||||
.word 0x010290fc
|
||||
VAL_TC_EMIFF_MRS:
|
||||
.word 0x00000027
|
||||
|
||||
VAL_ARM_IDLECT1:
|
||||
.word 0x00000400
|
||||
|
||||
VAL_ARM_IDLECT2:
|
||||
.word 0x00000886
|
||||
VAL_ARM_IDLECT3:
|
||||
.word 0x00000015
|
||||
|
||||
WATCHDOG_VAL1:
|
||||
.word 0x000000f5
|
||||
WATCHDOG_VAL2:
|
||||
.word 0x000000a0
|
||||
|
||||
/* command values */
|
||||
.equ CMD_SDRAM_NOP, 0x00000000
|
||||
.equ CMD_SDRAM_PRECHARGE, 0x00000001
|
||||
.equ CMD_SDRAM_AUTOREFRESH, 0x00000002
|
||||
.equ CMD_SDRAM_CKE_SET_HIGH, 0x00000007
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/arm926ejs/start.o (.text)
|
||||
*(.text)
|
||||
}
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
armboot_end_data = .;
|
||||
. = ALIGN(4);
|
||||
.bss : { *(.bss) }
|
||||
armboot_end = .;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void after_reloc (ulong dest_addr)
|
||||
|
||||
/* Jump to the main U-Boot board init code
|
||||
*/
|
||||
board_init_r (gd, dest_addr);
|
||||
board_init_r ((gd_t *)gd, dest_addr);
|
||||
}
|
||||
|
||||
int misc_init_r (void)
|
||||
|
||||
@@ -205,7 +205,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_br3 = CFG_BR3_CAN;
|
||||
|
||||
/* Initialize MBMR */
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS; /* GPL_B4 works as UPWAITB */
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* GPL_B4 works as UPWAITB */
|
||||
|
||||
/* Initialize UPMB for CAN: single read */
|
||||
memctl->memc_mdr = 0xFFFFC004;
|
||||
|
||||
+13
-6
@@ -96,7 +96,7 @@ long int initdram (int board_type)
|
||||
{
|
||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
long int size10 ;
|
||||
long int size9 ;
|
||||
|
||||
upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
|
||||
|
||||
@@ -109,7 +109,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_or1 = CFG_OR1_PRELIM;
|
||||
memctl->memc_br1 = CFG_BR1_PRELIM;
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR_10COL & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
memctl->memc_mamr = CFG_MAMR_9COL & (~(MAMR_PTAE)); /* no refresh yet */
|
||||
|
||||
udelay(200);
|
||||
|
||||
@@ -122,13 +122,20 @@ long int initdram (int board_type)
|
||||
|
||||
udelay (1000);
|
||||
|
||||
/* Check Bank 0 Memory Size
|
||||
* try 10 column mode
|
||||
/* Check Bank 0 Memory Size,
|
||||
* 9 column mode
|
||||
*/
|
||||
|
||||
size10 = dram_size (CFG_MAMR_10COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE) ;
|
||||
size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE) ;
|
||||
|
||||
return (size10);
|
||||
/*
|
||||
* Final mapping:
|
||||
*/
|
||||
|
||||
memctl->memc_or1 = ((-size9) & 0xFFFF0000) | CFG_OR_TIMING_SDRAM;
|
||||
udelay (1000);
|
||||
|
||||
return (size9);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -29,7 +29,7 @@ OBJS := sc520_cdp.o flash.o
|
||||
SOBJS := sc520_cdp_asm.o sc520_cdp_asm16.o
|
||||
|
||||
$(LIB): $(OBJS) $(SOBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
@@ -325,7 +325,7 @@ void flash_print_info(flash_info_t *info)
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
done:
|
||||
done: ;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <asm/pci.h>
|
||||
#include <asm/ic/sc520.h>
|
||||
#include <asm/ic/ali512x.h>
|
||||
#include <ssi.h>
|
||||
#include <spi.h>
|
||||
|
||||
#undef SC520_CDP_DEBUG
|
||||
|
||||
@@ -557,6 +557,19 @@ void ssi_chip_select(int dev)
|
||||
}
|
||||
}
|
||||
|
||||
void spi_eeprom_probe(int x)
|
||||
{
|
||||
}
|
||||
|
||||
int spi_eeprom_read(int x, int offset, char *buffer, int len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int spi_eeprom_write(int x, int offset, char *buffer, int len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void spi_init_f(void)
|
||||
{
|
||||
@@ -585,6 +598,9 @@ ssize_t spi_read(uchar *addr, int alen, uchar *buffer, int len)
|
||||
#endif
|
||||
#ifdef CONFIG_SC520_CDP_USE_MW
|
||||
res = mw_eeprom_read(2, offset, buffer, len);
|
||||
#endif
|
||||
#if !defined(CONFIG_SC520_CDP_USE_SPI) && !defined(CONFIG_SC520_CDP_USE_MW)
|
||||
res = 0;
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
@@ -606,6 +622,9 @@ ssize_t spi_write(uchar *addr, int alen, uchar *buffer, int len)
|
||||
#endif
|
||||
#ifdef CONFIG_SC520_CDP_USE_MW
|
||||
res = mw_eeprom_write(2, offset, buffer, len);
|
||||
#endif
|
||||
#if !defined(CONFIG_SC520_CDP_USE_SPI) && !defined(CONFIG_SC520_CDP_USE_MW)
|
||||
res = 0;
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
@@ -31,7 +31,7 @@ SECTIONS
|
||||
.text : { *(.text); }
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
.rodata : { *(.rodata) *(.rodata.str1.1) *(.rodata.str1.32) }
|
||||
|
||||
. = 0x400000; /* Ram data segment to use */
|
||||
_i386boot_romdata_dest = ABSOLUTE(.);
|
||||
|
||||
@@ -267,7 +267,7 @@ void can_driver_enable (void)
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
|
||||
/* Initialize MBMR */
|
||||
memctl->memc_mbmr = MAMR_GPL_B4DIS; /* GPL_B4 ouput line Disable */
|
||||
memctl->memc_mbmr = MBMR_GPL_B4DIS; /* GPL_B4 ouput line Disable */
|
||||
|
||||
/* Initialize UPMB for CAN: single read */
|
||||
memctl->memc_mdr = 0xFFFFC004;
|
||||
|
||||
@@ -217,9 +217,9 @@ initdram (int board_type)
|
||||
#endif /* XXX */
|
||||
|
||||
reg = memctl->memc_mamr;
|
||||
reg &= ~MAMR_TLFB_MSK; /* switch timer loop ... */
|
||||
reg |= MAMR_TLFB_4X; /* ... to 4x */
|
||||
reg |= MAMR_PTBE; /* enable refresh */
|
||||
reg &= ~MAMR_TLFA_MSK; /* switch timer loop ... */
|
||||
reg |= MAMR_TLFA_4X; /* ... to 4x */
|
||||
reg |= MAMR_PTAE; /* enable refresh */
|
||||
memctl->memc_mamr = reg;
|
||||
|
||||
udelay(200);
|
||||
@@ -246,7 +246,7 @@ initdram (int board_type)
|
||||
size_b0 = dram_size (CFG_MAMR, (ulong *)SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
|
||||
#endif /* XXX */
|
||||
|
||||
memctl->memc_mamr = CFG_MAMR | MAMR_PTBE;
|
||||
memctl->memc_mamr = CFG_MAMR | MAMR_PTAE;
|
||||
|
||||
/*
|
||||
* Final mapping:
|
||||
|
||||
@@ -200,14 +200,14 @@ initdram (int board_type)
|
||||
udelay(1);
|
||||
memctl->memc_mcr = 0x80806106;
|
||||
|
||||
memctl->memc_mbmr |= MAMR_PTBE; /* refresh enabled */
|
||||
memctl->memc_mbmr |= MBMR_PTBE; /* refresh enabled */
|
||||
|
||||
/*
|
||||
* Check Bank 0 Memory Size for re-configuration
|
||||
*/
|
||||
size_b0 = dram_size (CFG_MBMR_8COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
|
||||
|
||||
memctl->memc_mbmr = CFG_MBMR_8COL | MAMR_PTBE;
|
||||
memctl->memc_mbmr = CFG_MBMR_8COL | MBMR_PTBE;
|
||||
|
||||
return (size_b0);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -116,14 +116,15 @@ unsigned long flash_init (void)
|
||||
|
||||
#ifdef CFG_ENV_IS_IN_FLASH
|
||||
/* ENV protection ON by default */
|
||||
debug ("Protect %senvironment: %08lx ... %08lx\n",
|
||||
# ifdef CFG_ENV_ADDR_REDUND
|
||||
"primary ",
|
||||
# else
|
||||
"",
|
||||
# endif
|
||||
debug ("Protect primary environment: %08lx ... %08lx\n",
|
||||
(ulong)CFG_ENV_ADDR,
|
||||
(ulong)CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1);
|
||||
# else
|
||||
debug ("Protect environment: %08lx ... %08lx\n",
|
||||
(ulong)CFG_ENV_ADDR,
|
||||
(ulong)CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1);
|
||||
# endif
|
||||
|
||||
flash_protect(FLAG_PROTECT_SET,
|
||||
CFG_ENV_ADDR,
|
||||
|
||||
@@ -363,7 +363,13 @@ long int initdram (int board_type)
|
||||
memctl->memc_mcr = 0x011C | UPMB;
|
||||
#endif /* CONFIG_CAN_DRIVER */
|
||||
|
||||
|
||||
#ifdef CONFIG_ISP1362_USB
|
||||
/* Initialize OR5 / BR5 */
|
||||
memctl->memc_or5 = CFG_OR5_ISP1362;
|
||||
memctl->memc_br5 = CFG_BR5_ISP1362;
|
||||
#endif /* CONFIG_ISP1362_USB */
|
||||
|
||||
|
||||
return (size_b0 + size_b1);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ long int initdram (int board_type)
|
||||
memctl->memc_br3 = CFG_BR3_CAN;
|
||||
|
||||
/* Initialize MBMR */
|
||||
memctl->memc_mamr = MAMR_GPL_B4DIS; /* GPL_B4 ouput line Disable */
|
||||
memctl->memc_mamr = MAMR_GPL_A4DIS; /* GPL_A4 ouput line Disable */
|
||||
|
||||
/* Initialize UPMB for CAN: single read */
|
||||
memctl->memc_mdr = 0xFFFFC004;
|
||||
|
||||
+2
-2
@@ -42,9 +42,9 @@ COBJS = main.o altera.o bedbug.o \
|
||||
cmd_reginfo.o cmd_scsi.o cmd_spi.o cmd_usb.o cmd_vfd.o \
|
||||
command.o console.o devices.o dlmalloc.o docecc.o \
|
||||
environment.o env_common.o \
|
||||
env_flash.o env_eeprom.o env_nvram.o env_nowhere.o \
|
||||
env_flash.o env_eeprom.o env_nvram.o env_nowhere.o exports.o \
|
||||
flash.o fpga.o \
|
||||
hush.o kgdb.o lists.o miiphybb.o miiphyutil.o \
|
||||
hush.o kgdb.o lists.o lynxkdi.o miiphybb.o miiphyutil.o \
|
||||
s_record.o soft_i2c.o soft_spi.o spartan2.o \
|
||||
usb.o usb_kbd.o usb_storage.o \
|
||||
virtex2.o xilinx.o
|
||||
|
||||
+10
-1
@@ -27,13 +27,15 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <net.h>
|
||||
#include <syscall.h>
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
#if defined(CONFIG_I386)
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#endif
|
||||
ulong addr, rc;
|
||||
int rcode = 0;
|
||||
|
||||
@@ -50,6 +52,13 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
* pass address parameter as argv[0] (aka command name),
|
||||
* and all remaining args
|
||||
*/
|
||||
#if defined(CONFIG_I386)
|
||||
/*
|
||||
* x86 does not use a dedicated register to pass the pointer
|
||||
* to the global_data
|
||||
*/
|
||||
argv[0] = (char *)gd;
|
||||
#endif
|
||||
rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
|
||||
if (rc != 0) rcode = 1;
|
||||
|
||||
|
||||
+108
-1
@@ -30,6 +30,7 @@
|
||||
#include <image.h>
|
||||
#include <malloc.h>
|
||||
#include <zlib.h>
|
||||
#include <bzlib.h>
|
||||
#include <environment.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
@@ -80,6 +81,13 @@ static void zfree(void *, void *, unsigned);
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_IMI)
|
||||
static int image_info (unsigned long addr);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
|
||||
#include <flash.h>
|
||||
extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||
#endif
|
||||
|
||||
static void print_type (image_header_t *hdr);
|
||||
|
||||
#ifdef __I386__
|
||||
@@ -120,6 +128,10 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
|
||||
#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
|
||||
static boot_os_Fcn do_bootm_artos;
|
||||
#endif
|
||||
#ifdef CONFIG_LYNXKDI
|
||||
static boot_os_Fcn do_bootm_lynxkdi;
|
||||
extern void lynxkdi_boot( image_header_t * );
|
||||
#endif
|
||||
|
||||
image_header_t header;
|
||||
|
||||
@@ -131,6 +143,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
ulong addr;
|
||||
ulong data, len, checksum;
|
||||
ulong *len_ptr;
|
||||
uint unc_len = 0x400000;
|
||||
int i, verify;
|
||||
char *name, *s;
|
||||
int (*appl)(cmd_tbl_t *, int, int, char *[]);
|
||||
@@ -296,13 +309,26 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
break;
|
||||
case IH_COMP_GZIP:
|
||||
printf (" Uncompressing %s ... ", name);
|
||||
if (gunzip ((void *)ntohl(hdr->ih_load), 0x400000,
|
||||
if (gunzip ((void *)ntohl(hdr->ih_load), unc_len,
|
||||
(uchar *)data, (int *)&len) != 0) {
|
||||
printf ("GUNZIP ERROR - must RESET board to recover\n");
|
||||
SHOW_BOOT_PROGRESS (-6);
|
||||
do_reset (cmdtp, flag, argc, argv);
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_BZIP2
|
||||
case IH_COMP_BZIP2:
|
||||
printf (" Uncompressing %s ... ", name);
|
||||
i = BZ2_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
|
||||
&unc_len, (char *)data, len, 0, 0);
|
||||
if (i != BZ_OK) {
|
||||
printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
|
||||
SHOW_BOOT_PROGRESS (-6);
|
||||
udelay(100000);
|
||||
do_reset (cmdtp, flag, argc, argv);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_BZIP2 */
|
||||
default:
|
||||
if (iflag)
|
||||
enable_interrupts();
|
||||
@@ -350,6 +376,13 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
addr, len_ptr, verify);
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_LYNXKDI
|
||||
case IH_OS_LYNXOS:
|
||||
do_bootm_lynxkdi (cmdtp, flag, argc, argv,
|
||||
addr, len_ptr, verify);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case IH_OS_RTEMS:
|
||||
do_bootm_rtems (cmdtp, flag, argc, argv,
|
||||
addr, len_ptr, verify);
|
||||
@@ -961,6 +994,56 @@ U_BOOT_CMD(
|
||||
|
||||
#endif /* CFG_CMD_IMI */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
|
||||
/*-----------------------------------------------------------------------
|
||||
* List all images found in flash.
|
||||
*/
|
||||
int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
flash_info_t *info;
|
||||
int i, j;
|
||||
image_header_t *hdr;
|
||||
ulong checksum;
|
||||
|
||||
for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
|
||||
if (info->flash_id == FLASH_UNKNOWN)
|
||||
goto next_bank;
|
||||
for (j=0; j<CFG_MAX_FLASH_SECT; ++j) {
|
||||
|
||||
if (!(hdr=(image_header_t *)info->start[j]) ||
|
||||
(ntohl(hdr->ih_magic) != IH_MAGIC))
|
||||
goto next_sector;
|
||||
|
||||
/* Copy header so we can blank CRC field for re-calculation */
|
||||
memmove (&header, (char *)hdr, sizeof(image_header_t));
|
||||
|
||||
checksum = ntohl(header.ih_hcrc);
|
||||
header.ih_hcrc = 0;
|
||||
|
||||
if (crc32 (0, (char *)&header, sizeof(image_header_t))
|
||||
!= checksum)
|
||||
goto next_sector;
|
||||
|
||||
printf ("Image at %08lX:\n", (ulong)hdr);
|
||||
print_image_hdr( hdr );
|
||||
putc ('\n');
|
||||
next_sector: ;
|
||||
}
|
||||
next_bank: ;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
imls, 1, 1, do_imls,
|
||||
"imls - list all images found in flash\n",
|
||||
"\n"
|
||||
" - Prints information about all images found at sector\n"
|
||||
" boundaries in flash.\n"
|
||||
);
|
||||
#endif /* CFG_CMD_IMLS */
|
||||
|
||||
void
|
||||
print_image_hdr (image_header_t *hdr)
|
||||
{
|
||||
@@ -1011,6 +1094,9 @@ print_type (image_header_t *hdr)
|
||||
case IH_OS_RTEMS: os = "RTEMS"; break;
|
||||
#ifdef CONFIG_ARTOS
|
||||
case IH_OS_ARTOS: os = "ARTOS"; break;
|
||||
#endif
|
||||
#ifdef CONFIG_LYNXKDI
|
||||
case IH_OS_LYNXOS: os = "LynxOS"; break;
|
||||
#endif
|
||||
default: os = "Unknown OS"; break;
|
||||
}
|
||||
@@ -1135,6 +1221,13 @@ int gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BZIP2
|
||||
void bz_internal_error(int errcode)
|
||||
{
|
||||
printf ("BZIP2 internal error %d\n", errcode);
|
||||
}
|
||||
#endif /* CONFIG_BZIP2 */
|
||||
|
||||
static void
|
||||
do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
|
||||
ulong addr, ulong *len_ptr, int verify)
|
||||
@@ -1185,3 +1278,17 @@ do_bootm_qnxelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
|
||||
do_bootelf(cmdtp, 0, 2, local_args);
|
||||
}
|
||||
#endif /* CFG_CMD_ELF */
|
||||
|
||||
#ifdef CONFIG_LYNXKDI
|
||||
static void
|
||||
do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
|
||||
int argc, char *argv[],
|
||||
ulong addr,
|
||||
ulong *len_ptr,
|
||||
int verify)
|
||||
{
|
||||
lynxkdi_boot( &header );
|
||||
}
|
||||
|
||||
#endif /* CONFIG_LYNXKDI */
|
||||
|
||||
+151
-122
@@ -56,45 +56,120 @@ extern flash_info_t flash_info[]; /* info for FLASH chips */
|
||||
* or an invalid flash bank.
|
||||
*/
|
||||
static int
|
||||
abbrev_spec(char *str, flash_info_t **pinfo, int *psf, int *psl)
|
||||
abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl)
|
||||
{
|
||||
flash_info_t *fp;
|
||||
int bank, first, last;
|
||||
char *p, *ep;
|
||||
flash_info_t *fp;
|
||||
int bank, first, last;
|
||||
char *p, *ep;
|
||||
|
||||
if ((p = strchr(str, ':')) == NULL)
|
||||
return 0;
|
||||
*p++ = '\0';
|
||||
|
||||
bank = simple_strtoul(str, &ep, 10);
|
||||
if (ep == str || *ep != '\0' ||
|
||||
bank < 1 || bank > CFG_MAX_FLASH_BANKS ||
|
||||
(fp = &flash_info[bank - 1])->flash_id == FLASH_UNKNOWN)
|
||||
return -1;
|
||||
|
||||
str = p;
|
||||
if ((p = strchr(str, '-')) != NULL)
|
||||
if ((p = strchr (str, ':')) == NULL)
|
||||
return 0;
|
||||
*p++ = '\0';
|
||||
|
||||
first = simple_strtoul(str, &ep, 10);
|
||||
if (ep == str || *ep != '\0' || first >= fp->sector_count)
|
||||
return -1;
|
||||
bank = simple_strtoul (str, &ep, 10);
|
||||
if (ep == str || *ep != '\0' ||
|
||||
bank < 1 || bank > CFG_MAX_FLASH_BANKS ||
|
||||
(fp = &flash_info[bank - 1])->flash_id == FLASH_UNKNOWN)
|
||||
return -1;
|
||||
|
||||
if (p != NULL) {
|
||||
last = simple_strtoul(p, &ep, 10);
|
||||
if (ep == p || *ep != '\0' ||
|
||||
last < first || last >= fp->sector_count)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
last = first;
|
||||
str = p;
|
||||
if ((p = strchr (str, '-')) != NULL)
|
||||
*p++ = '\0';
|
||||
|
||||
*pinfo = fp;
|
||||
*psf = first;
|
||||
*psl = last;
|
||||
first = simple_strtoul (str, &ep, 10);
|
||||
if (ep == str || *ep != '\0' || first >= fp->sector_count)
|
||||
return -1;
|
||||
|
||||
return 1;
|
||||
if (p != NULL) {
|
||||
last = simple_strtoul (p, &ep, 10);
|
||||
if (ep == p || *ep != '\0' ||
|
||||
last < first || last >= fp->sector_count)
|
||||
return -1;
|
||||
} else {
|
||||
last = first;
|
||||
}
|
||||
|
||||
*pinfo = fp;
|
||||
*psf = first;
|
||||
*psl = last;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
|
||||
int *s_first, int *s_last,
|
||||
int *s_count )
|
||||
{
|
||||
flash_info_t *info;
|
||||
ulong bank;
|
||||
int rcode = 0;
|
||||
|
||||
*s_count = 0;
|
||||
|
||||
for (bank=0; bank < CFG_MAX_FLASH_BANKS; ++bank) {
|
||||
s_first[bank] = -1; /* first sector to erase */
|
||||
s_last [bank] = -1; /* last sector to erase */
|
||||
}
|
||||
|
||||
for (bank=0,info=&flash_info[0];
|
||||
(bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last);
|
||||
++bank, ++info) {
|
||||
ulong b_end;
|
||||
int sect;
|
||||
short s_end;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
b_end = info->start[0] + info->size - 1; /* bank end addr */
|
||||
s_end = info->sector_count - 1; /* last sector */
|
||||
|
||||
|
||||
for (sect=0; sect < info->sector_count; ++sect) {
|
||||
ulong end; /* last address in current sect */
|
||||
|
||||
end = (sect == s_end) ? b_end : info->start[sect + 1] - 1;
|
||||
|
||||
if (addr_first > end)
|
||||
continue;
|
||||
if (addr_last < info->start[sect])
|
||||
continue;
|
||||
|
||||
if (addr_first == info->start[sect]) {
|
||||
s_first[bank] = sect;
|
||||
}
|
||||
if (addr_last == end) {
|
||||
s_last[bank] = sect;
|
||||
}
|
||||
}
|
||||
if (s_first[bank] >= 0) {
|
||||
if (s_last[bank] < 0) {
|
||||
if (addr_last > b_end) {
|
||||
s_last[bank] = s_end;
|
||||
} else {
|
||||
printf ("Error: end address"
|
||||
" not on sector boundary\n");
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (s_last[bank] < s_first[bank]) {
|
||||
printf ("Error: end sector"
|
||||
" precedes start sector\n");
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
sect = s_last[bank];
|
||||
addr_first = (sect == s_end) ? b_end + 1: info->start[sect + 1];
|
||||
(*s_count) += s_last[bank] - s_first[bank] + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return rcode;
|
||||
}
|
||||
|
||||
int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong bank;
|
||||
@@ -180,7 +255,6 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf ("Erase Flash from 0x%08lx to 0x%08lx ", addr_first, addr_last);
|
||||
rcode = flash_sect_erase(addr_first, addr_last);
|
||||
return rcode;
|
||||
}
|
||||
@@ -189,53 +263,32 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
|
||||
{
|
||||
flash_info_t *info;
|
||||
ulong bank;
|
||||
int s_first, s_last;
|
||||
int erased;
|
||||
int s_first[CFG_MAX_FLASH_BANKS], s_last[CFG_MAX_FLASH_BANKS];
|
||||
int erased = 0;
|
||||
int planned;
|
||||
int rcode = 0;
|
||||
|
||||
erased = 0;
|
||||
rcode = flash_fill_sect_ranges (addr_first, addr_last,
|
||||
s_first, s_last, &planned );
|
||||
|
||||
for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
|
||||
ulong b_end;
|
||||
int sect;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
b_end = info->start[0] + info->size - 1; /* bank end addr */
|
||||
|
||||
s_first = -1; /* first sector to erase */
|
||||
s_last = -1; /* last sector to erase */
|
||||
|
||||
for (sect=0; sect < info->sector_count; ++sect) {
|
||||
ulong end; /* last address in current sect */
|
||||
short s_end;
|
||||
|
||||
s_end = info->sector_count - 1;
|
||||
|
||||
end = (sect == s_end) ? b_end : info->start[sect + 1] - 1;
|
||||
|
||||
if (addr_first > end)
|
||||
continue;
|
||||
if (addr_last < info->start[sect])
|
||||
continue;
|
||||
|
||||
if (addr_first == info->start[sect]) {
|
||||
s_first = sect;
|
||||
}
|
||||
if (addr_last == end) {
|
||||
s_last = sect;
|
||||
if (planned && (rcode == 0)) {
|
||||
for (bank=0,info=&flash_info[0];
|
||||
(bank < CFG_MAX_FLASH_BANKS) && (rcode == 0);
|
||||
++bank, ++info) {
|
||||
if (s_first[bank]>=0) {
|
||||
erased += s_last[bank] - s_first[bank] + 1;
|
||||
debug ("Erase Flash from 0x%08lx to 0x%08lx "
|
||||
"in Bank # %ld ",
|
||||
info->start[s_first[bank]],
|
||||
(s_last[bank] == info->sector_count) ?
|
||||
info->start[0] + info->size - 1:
|
||||
info->start[s_last[bank]+1] - 1,
|
||||
bank+1);
|
||||
rcode = flash_erase (info, s_first[bank], s_last[bank]);
|
||||
}
|
||||
}
|
||||
if (s_first>=0 && s_first<=s_last) {
|
||||
erased += s_last - s_first + 1;
|
||||
rcode = flash_erase (info, s_first, s_last);
|
||||
}
|
||||
}
|
||||
if (erased) {
|
||||
printf ("Erased %d sectors\n", erased);
|
||||
} else {
|
||||
} else if (rcode == 0) {
|
||||
printf ("Error: start and/or end address"
|
||||
" not on sector boundary\n");
|
||||
rcode = 1;
|
||||
@@ -243,7 +296,6 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
|
||||
return rcode;
|
||||
}
|
||||
|
||||
|
||||
int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
flash_info_t *info;
|
||||
@@ -256,11 +308,11 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "off") == 0)
|
||||
if (strcmp(argv[1], "off") == 0) {
|
||||
p = 0;
|
||||
else if (strcmp(argv[1], "on") == 0)
|
||||
} else if (strcmp(argv[1], "on") == 0) {
|
||||
p = 1;
|
||||
else {
|
||||
} else {
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
@@ -370,66 +422,43 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
|
||||
{
|
||||
flash_info_t *info;
|
||||
ulong bank;
|
||||
int s_first, s_last;
|
||||
int s_first[CFG_MAX_FLASH_BANKS], s_last[CFG_MAX_FLASH_BANKS];
|
||||
int protected, i;
|
||||
int rcode = 0;
|
||||
int planned;
|
||||
int rcode;
|
||||
|
||||
rcode = flash_fill_sect_ranges( addr_first, addr_last, s_first, s_last, &planned );
|
||||
|
||||
protected = 0;
|
||||
|
||||
for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
|
||||
ulong b_end;
|
||||
int sect;
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
b_end = info->start[0] + info->size - 1; /* bank end addr */
|
||||
|
||||
s_first = -1; /* first sector to erase */
|
||||
s_last = -1; /* last sector to erase */
|
||||
|
||||
for (sect=0; sect < info->sector_count; ++sect) {
|
||||
ulong end; /* last address in current sect */
|
||||
short s_end;
|
||||
|
||||
s_end = info->sector_count - 1;
|
||||
|
||||
end = (sect == s_end) ? b_end : info->start[sect + 1] - 1;
|
||||
|
||||
if (addr_first > end)
|
||||
continue;
|
||||
if (addr_last < info->start[sect])
|
||||
if (planned && (rcode == 0)) {
|
||||
for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (addr_first == info->start[sect]) {
|
||||
s_first = sect;
|
||||
}
|
||||
if (addr_last == end) {
|
||||
s_last = sect;
|
||||
}
|
||||
}
|
||||
if (s_first>=0 && s_first<=s_last) {
|
||||
protected += s_last - s_first + 1;
|
||||
for (i=s_first; i<=s_last; ++i) {
|
||||
if (s_first[bank]>=0 && s_first[bank]<=s_last[bank]) {
|
||||
debug ("Protecting sectors %d..%d in bank %ld\n",
|
||||
s_first[bank], s_last[bank], bank+1);
|
||||
protected += s_last[bank] - s_first[bank] + 1;
|
||||
for (i=s_first[bank]; i<=s_last[bank]; ++i) {
|
||||
#if defined(CFG_FLASH_PROTECTION)
|
||||
if (flash_real_protect(info, i, p))
|
||||
rcode = 1;
|
||||
putc ('.');
|
||||
if (flash_real_protect(info, i, p))
|
||||
rcode = 1;
|
||||
putc ('.');
|
||||
#else
|
||||
info->protect[i] = p;
|
||||
info->protect[i] = p;
|
||||
#endif /* CFG_FLASH_PROTECTION */
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(CFG_FLASH_PROTECTION)
|
||||
if (!rcode) putc ('\n');
|
||||
if (!rcode) putc ('\n');
|
||||
#endif /* CFG_FLASH_PROTECTION */
|
||||
}
|
||||
|
||||
}
|
||||
if (protected) {
|
||||
printf ("%sProtected %d sectors\n",
|
||||
p ? "" : "Un-", protected);
|
||||
} else {
|
||||
} else if (rcode == 0) {
|
||||
printf ("Error: start and/or end address"
|
||||
" not on sector boundary\n");
|
||||
rcode = 1;
|
||||
|
||||
@@ -507,6 +507,9 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
|
||||
if(i2c_write(chip, addr, alen, (char *)&data, size) != 0) {
|
||||
printf("Error writing the chip.\n");
|
||||
}
|
||||
#ifdef CFG_EEPROM_PAGE_WRITE_DELAY_MS
|
||||
udelay(CFG_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
|
||||
#endif
|
||||
if (incrflag)
|
||||
addr += size;
|
||||
}
|
||||
|
||||
+4
-5
@@ -28,7 +28,7 @@
|
||||
#include <command.h>
|
||||
#include <s_record.h>
|
||||
#include <net.h>
|
||||
#include <syscall.h>
|
||||
#include <exports.h>
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
|
||||
@@ -213,6 +213,7 @@ load_serial (ulong offset)
|
||||
static int
|
||||
read_record (char *buf, ulong len)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
char *p;
|
||||
char c;
|
||||
|
||||
@@ -236,13 +237,11 @@ read_record (char *buf, ulong len)
|
||||
}
|
||||
|
||||
/* Check for the console hangup (if any different from serial) */
|
||||
#ifdef CONFIG_PPC /* we don't have syscall_tbl anywhere else */
|
||||
if (syscall_tbl[SYSCALL_GETC] != serial_getc) {
|
||||
if (gd->jt[XF_getc] != serial_getc) {
|
||||
if (ctrlc()) {
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* line too long - truncate */
|
||||
@@ -479,7 +478,7 @@ int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
printf ("## Ready for binary (kermit) download "
|
||||
"to 0x%08lX at %d bps...\n",
|
||||
offset,
|
||||
current_baudrate);
|
||||
load_baudrate);
|
||||
addr = load_serial_bin (offset);
|
||||
|
||||
if (addr == ~0) {
|
||||
|
||||
+1
-2
@@ -86,8 +86,7 @@ void logbuff_init_ptrs (void)
|
||||
post_word = post_word_load();
|
||||
#ifdef CONFIG_POST
|
||||
/* The post routines have setup the word so we can simply test it */
|
||||
if (((post_word & 0xffff) == POST_POWERON) ||
|
||||
((post_word & 0xffff) == POST_SLOWTEST)) {
|
||||
if (post_word_load () & POST_COLDBOOT) {
|
||||
logged_chars = log_size = log_start = 0;
|
||||
*ext_tag = LOGBUFF_MAGIC;
|
||||
}
|
||||
|
||||
+26
-13
@@ -53,6 +53,8 @@ int cmd_get_data_size(char* arg, int default_size)
|
||||
return 2;
|
||||
case 'l':
|
||||
return 4;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return default_size;
|
||||
@@ -86,9 +88,10 @@ static ulong base_address = 0;
|
||||
#define DISP_LINE_LEN 16
|
||||
int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong addr, size, length;
|
||||
ulong addr, length;
|
||||
ulong i, nbytes, linebytes;
|
||||
u_char *cp;
|
||||
int size;
|
||||
int rc = 0;
|
||||
|
||||
/* We use the last specified parameters, unless new ones are
|
||||
@@ -107,7 +110,8 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
/* New command specified. Check for a size specification.
|
||||
* Defaults to long if no or incorrect specification.
|
||||
*/
|
||||
size = cmd_get_data_size(argv[0], 4);
|
||||
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
|
||||
return 1;
|
||||
|
||||
/* Address is specified since argc > 1
|
||||
*/
|
||||
@@ -199,7 +203,8 @@ int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong addr, size, writeval, count;
|
||||
ulong addr, writeval, count;
|
||||
int size;
|
||||
|
||||
if ((argc < 3) || (argc > 4)) {
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
@@ -208,7 +213,8 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* Check for size specification.
|
||||
*/
|
||||
size = cmd_get_data_size(argv[0], 4);
|
||||
if ((size = cmd_get_data_size(argv[0], 4)) < 1)
|
||||
return 1;
|
||||
|
||||
/* Address is specified since argc > 1
|
||||
*/
|
||||
@@ -240,7 +246,8 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong size, addr1, addr2, count, ngood;
|
||||
ulong addr1, addr2, count, ngood;
|
||||
int size;
|
||||
int rcode = 0;
|
||||
|
||||
if (argc != 4) {
|
||||
@@ -250,7 +257,8 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* Check for size specification.
|
||||
*/
|
||||
size = cmd_get_data_size(argv[0], 4);
|
||||
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
|
||||
return 1;
|
||||
|
||||
addr1 = simple_strtoul(argv[1], NULL, 16);
|
||||
addr1 += base_address;
|
||||
@@ -316,7 +324,8 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong addr, size, dest, count;
|
||||
ulong addr, dest, count;
|
||||
int size;
|
||||
|
||||
if (argc != 4) {
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
@@ -325,7 +334,8 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* Check for size specification.
|
||||
*/
|
||||
size = cmd_get_data_size(argv[0], 4);
|
||||
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
|
||||
return 1;
|
||||
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
addr += base_address;
|
||||
@@ -458,7 +468,8 @@ int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong addr, size, length, i, junk;
|
||||
ulong addr, length, i, junk;
|
||||
int size;
|
||||
volatile uint *longp;
|
||||
volatile ushort *shortp;
|
||||
volatile u_char *cp;
|
||||
@@ -471,7 +482,8 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
/* Check for a size spefication.
|
||||
* Defaults to long if no or incorrect specification.
|
||||
*/
|
||||
size = cmd_get_data_size(argv[0], 4);
|
||||
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
|
||||
return 1;
|
||||
|
||||
/* Address is always specified.
|
||||
*/
|
||||
@@ -839,8 +851,8 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
static int
|
||||
mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong addr, size, i;
|
||||
int nbytes;
|
||||
ulong addr, i;
|
||||
int nbytes, size;
|
||||
extern char console_buffer[];
|
||||
|
||||
if (argc != 2) {
|
||||
@@ -861,7 +873,8 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
|
||||
/* New command specified. Check for a size specification.
|
||||
* Defaults to long if no or incorrect specification.
|
||||
*/
|
||||
size = cmd_get_data_size(argv[0], 4);
|
||||
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
|
||||
return 1;
|
||||
|
||||
/* Address is specified since argc > 1
|
||||
*/
|
||||
|
||||
+83
-31
@@ -3,7 +3,6 @@
|
||||
* borrowed heavily from:
|
||||
* (c) 1999 Machine Vision Holdings, Inc.
|
||||
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
@@ -24,6 +23,12 @@
|
||||
#include <linux/mtd/nand_ids.h>
|
||||
#include <jffs2/jffs2.h>
|
||||
|
||||
#ifdef CONFIG_OMAP1510
|
||||
void archflashwp(void *archdata, int wp);
|
||||
#endif
|
||||
|
||||
#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1)))
|
||||
|
||||
/*
|
||||
* Definition of the out of band configuration structure
|
||||
*/
|
||||
@@ -52,7 +57,7 @@ struct nand_oob_config {
|
||||
#define ALLOW_ERASE_BAD_DEBUG 0
|
||||
|
||||
#define CONFIG_MTD_NAND_ECC /* enable ECC */
|
||||
/* #define CONFIG_MTD_NAND_ECC_JFFS2 */
|
||||
#define CONFIG_MTD_NAND_ECC_JFFS2
|
||||
|
||||
/* bits for nand_rw() `cmd'; or together as needed */
|
||||
#define NANDRW_READ 0x01
|
||||
@@ -76,6 +81,7 @@ static int nand_read_oob(struct nand_chip* nand, size_t ofs, size_t len,
|
||||
size_t * retlen, u_char * buf);
|
||||
static int nand_write_oob(struct nand_chip* nand, size_t ofs, size_t len,
|
||||
size_t * retlen, const u_char * buf);
|
||||
static int NanD_WaitReady(struct nand_chip *nand, int ale_wait);
|
||||
#ifdef CONFIG_MTD_NAND_ECC
|
||||
static int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
|
||||
static void nand_calculate_ecc (const u_char *dat, u_char *ecc_code);
|
||||
@@ -218,7 +224,7 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
ret = nand_rw(nand_dev_desc + curr_device, cmd, off, size,
|
||||
&total, (u_char*)addr);
|
||||
|
||||
printf ("%d bytes %s: %s\n", total,
|
||||
printf (" %d bytes %s: %s\n", total,
|
||||
(cmd & NANDRW_READ) ? "read" : "write",
|
||||
ret ? "ERROR" : "OK");
|
||||
|
||||
@@ -419,7 +425,7 @@ static int nand_rw (struct nand_chip* nand, int cmd,
|
||||
size_t start, size_t len,
|
||||
size_t * retlen, u_char * buf)
|
||||
{
|
||||
int noecc, ret = 0, n, total = 0;
|
||||
int ret = 0, n, total = 0;
|
||||
char eccbuf[6];
|
||||
/* eblk (once set) is the start of the erase block containing the
|
||||
* data being processed.
|
||||
@@ -457,17 +463,18 @@ static int nand_rw (struct nand_chip* nand, int cmd,
|
||||
}
|
||||
/* The ECC will not be calculated correctly if
|
||||
less than 512 is written or read */
|
||||
noecc = (start != (start | 0x1ff) + 1) || (len < 0x200);
|
||||
/* Is request at least 512 bytes AND it starts on a proper boundry */
|
||||
if((start != ROUND_DOWN(start, 0x200)) || (len < 0x200))
|
||||
printf("Warning block writes should be at least 512 bytes and start on a 512 byte boundry\n");
|
||||
|
||||
if (cmd & NANDRW_READ)
|
||||
ret = nand_read_ecc(nand, start,
|
||||
min(len, eblk + erasesize - start),
|
||||
&n, (u_char*)buf,
|
||||
noecc ? NULL : eccbuf);
|
||||
&n, (u_char*)buf, eccbuf);
|
||||
else
|
||||
ret = nand_write_ecc(nand, start,
|
||||
min(len, eblk + erasesize - start),
|
||||
&n, (u_char*)buf,
|
||||
noecc ? NULL : eccbuf);
|
||||
&n, (u_char*)buf, eccbuf);
|
||||
|
||||
if (ret)
|
||||
break;
|
||||
@@ -502,19 +509,19 @@ static void nand_print(struct nand_chip *nand)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* This function is needed to avoid calls of the __ashrdi3 function. */
|
||||
#if 0
|
||||
static int shr(int val, int shift)
|
||||
{
|
||||
return val >> shift;
|
||||
}
|
||||
#endif
|
||||
static int NanD_WaitReady(struct nand_chip *nand)
|
||||
static int NanD_WaitReady(struct nand_chip *nand, int ale_wait)
|
||||
{
|
||||
/* This is inline, to optimise the common case, where it's ready instantly */
|
||||
int ret = 0;
|
||||
NAND_WAIT_READY(nand);
|
||||
|
||||
#ifdef NAND_NO_RB /* in config file, shorter delays currently wrap accesses */
|
||||
if(ale_wait)
|
||||
NAND_WAIT_READY(nand); /* do the worst case 25us wait */
|
||||
else
|
||||
udelay(10);
|
||||
#else /* has functional r/b signal */
|
||||
NAND_WAIT_READY(nand);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -533,7 +540,16 @@ static inline int NanD_Command(struct nand_chip *nand, unsigned char command)
|
||||
/* Lower the CLE line */
|
||||
NAND_CTL_CLRCLE(nandptr);
|
||||
|
||||
return NanD_WaitReady(nand);
|
||||
#ifdef NAND_NO_RB
|
||||
if(command == NAND_CMD_RESET){
|
||||
u_char ret_val;
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
do{
|
||||
ret_val = READ_NAND(nandptr);/* wait till ready */
|
||||
} while((ret_val & 0x40) != 0x40);
|
||||
}
|
||||
#endif
|
||||
return NanD_WaitReady(nand, 0);
|
||||
}
|
||||
|
||||
/* NanD_Address: Set the current address for the flash chip */
|
||||
@@ -573,7 +589,7 @@ static int NanD_Address(struct nand_chip *nand, int numbytes, unsigned long ofs)
|
||||
NAND_CTL_CLRALE(nandptr);
|
||||
|
||||
/* Wait for the chip to respond */
|
||||
return NanD_WaitReady(nand);
|
||||
return NanD_WaitReady(nand, 1);
|
||||
}
|
||||
|
||||
/* NanD_SelectChip: Select a given flash chip within the current floor */
|
||||
@@ -581,7 +597,7 @@ static int NanD_Address(struct nand_chip *nand, int numbytes, unsigned long ofs)
|
||||
static inline int NanD_SelectChip(struct nand_chip *nand, int chip)
|
||||
{
|
||||
/* Wait for it to be ready */
|
||||
return NanD_WaitReady(nand);
|
||||
return NanD_WaitReady(nand, 0);
|
||||
}
|
||||
|
||||
/* NanD_IdentChip: Identify a given NAND chip given {floor,chip} */
|
||||
@@ -931,8 +947,8 @@ static int nand_write_page (struct nand_chip *nand,
|
||||
{
|
||||
|
||||
int i;
|
||||
#ifdef CONFIG_MTD_NAND_ECC
|
||||
unsigned long nandptr = nand->IO_ADDR;
|
||||
#ifdef CONFIG_MTD_NAND_ECC
|
||||
#ifdef CONFIG_MTD_NAND_VERIFY_WRITE
|
||||
int ecc_bytes = (nand->oobblock == 512) ? 6 : 3;
|
||||
#endif
|
||||
@@ -992,12 +1008,20 @@ static int nand_write_page (struct nand_chip *nand,
|
||||
/* Send command to actually program the data */
|
||||
NanD_Command(nand, NAND_CMD_PAGEPROG);
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
#ifdef NAND_NO_RB
|
||||
{ u_char ret_val;
|
||||
|
||||
do{
|
||||
ret_val = READ_NAND(nandptr); /* wait till ready */
|
||||
} while((ret_val & 0x40) != 0x40);
|
||||
}
|
||||
#endif
|
||||
/* See if device thinks it succeeded */
|
||||
if (READ_NAND(nand->IO_ADDR) & 0x01) {
|
||||
printf ("%s: Failed write, page 0x%08x, ", __FUNCTION__, page);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MTD_NAND_VERIFY_WRITE
|
||||
/*
|
||||
* The NAND device assumes that it is always writing to
|
||||
@@ -1069,7 +1093,10 @@ static int nand_write_ecc (struct nand_chip* nand, size_t to, size_t len,
|
||||
*retlen = 0;
|
||||
|
||||
/* Select the NAND device */
|
||||
NAND_ENABLE_CE(nand); /* set pin low */
|
||||
#ifdef CONFIG_OMAP1510
|
||||
archflashwp(0,0);
|
||||
#endif
|
||||
NAND_ENABLE_CE(nand); /* set pin low */
|
||||
|
||||
/* Check the WP bit */
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
@@ -1113,7 +1140,9 @@ static int nand_write_ecc (struct nand_chip* nand, size_t to, size_t len,
|
||||
out:
|
||||
/* De-select the NAND device */
|
||||
NAND_DISABLE_CE(nand); /* set pin high */
|
||||
|
||||
#ifdef CONFIG_OMAP1510
|
||||
archflashwp(0,1);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1160,7 +1189,7 @@ static int nand_read_oob(struct nand_chip* nand, size_t ofs, size_t len,
|
||||
* causing the flash device to go into busy mode, so we need
|
||||
* to wait until ready 11.4.1 and Toshiba TC58256FT nands */
|
||||
|
||||
ret = NanD_WaitReady(nand);
|
||||
ret = NanD_WaitReady(nand, 1);
|
||||
NAND_DISABLE_CE(nand); /* set pin high */
|
||||
|
||||
return ret;
|
||||
@@ -1215,8 +1244,13 @@ static int nand_write_oob(struct nand_chip* nand, size_t ofs, size_t len,
|
||||
|
||||
NanD_Command(nand, NAND_CMD_PAGEPROG);
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
/* NanD_WaitReady() is implicit in NanD_Command */
|
||||
|
||||
#ifdef NAND_NO_RB
|
||||
{ u_char ret_val;
|
||||
do{
|
||||
ret_val = READ_NAND(nandptr); /* wait till ready */
|
||||
}while((ret_val & 0x40) != 0x40);
|
||||
}
|
||||
#endif
|
||||
if (READ_NAND(nandptr) & 1) {
|
||||
puts ("Error programming oob data\n");
|
||||
/* There was an error */
|
||||
@@ -1233,8 +1267,13 @@ static int nand_write_oob(struct nand_chip* nand, size_t ofs, size_t len,
|
||||
|
||||
NanD_Command(nand, NAND_CMD_PAGEPROG);
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
/* NanD_WaitReady() is implicit in NanD_Command */
|
||||
|
||||
#ifdef NAND_NO_RB
|
||||
{ u_char ret_val;
|
||||
do{
|
||||
ret_val = READ_NAND(nandptr); /* wait till ready */
|
||||
} while((ret_val & 0x40) != 0x40);
|
||||
}
|
||||
#endif
|
||||
if (READ_NAND(nandptr) & 1) {
|
||||
puts ("Error programming oob data\n");
|
||||
/* There was an error */
|
||||
@@ -1272,7 +1311,10 @@ static int nand_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean)
|
||||
nandptr = nand->IO_ADDR;
|
||||
|
||||
/* Select the NAND device */
|
||||
NAND_ENABLE_CE(nand); /* set pin low */
|
||||
#ifdef CONFIG_OMAP1510
|
||||
archflashwp(0,0);
|
||||
#endif
|
||||
NAND_ENABLE_CE(nand); /* set pin low */
|
||||
|
||||
/* Check the WP bit */
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
@@ -1308,6 +1350,13 @@ static int nand_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean)
|
||||
|
||||
NanD_Command(nand, NAND_CMD_STATUS);
|
||||
|
||||
#ifdef NAND_NO_RB
|
||||
{ u_char ret_val;
|
||||
do{
|
||||
ret_val = READ_NAND(nandptr); /* wait till ready */
|
||||
} while((ret_val & 0x40) != 0x40);
|
||||
}
|
||||
#endif
|
||||
if (READ_NAND(nandptr) & 1) {
|
||||
printf ("%s: Error erasing at 0x%lx\n",
|
||||
__FUNCTION__, (long)ofs);
|
||||
@@ -1346,7 +1395,9 @@ static int nand_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean)
|
||||
out:
|
||||
/* De-select the NAND device */
|
||||
NAND_DISABLE_CE(nand); /* set pin high */
|
||||
|
||||
#ifdef CONFIG_OMAP1510
|
||||
archflashwp(0,1);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1596,5 +1647,6 @@ static int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc)
|
||||
/* Should never happen */
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
|
||||
@@ -116,6 +116,13 @@ static void netboot_update_env(void)
|
||||
setenv("dnsip", tmp);
|
||||
}
|
||||
|
||||
#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2)
|
||||
if (NetOurDNS2IP) {
|
||||
ip_to_string (NetOurDNS2IP, tmp);
|
||||
setenv("dnsip2", tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (NetOurNISDomain[0])
|
||||
setenv("domain", NetOurNISDomain);
|
||||
|
||||
|
||||
+13
-13
@@ -25,9 +25,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <malloc.h>
|
||||
#include <console.h>
|
||||
#include <syscall.h>
|
||||
|
||||
void **syscall_tbl;
|
||||
#include <exports.h>
|
||||
|
||||
#ifdef CONFIG_AMIGAONEG3SE
|
||||
int console_changed = 0;
|
||||
@@ -52,6 +50,7 @@ int overwrite_console (void)
|
||||
|
||||
static int console_setfile (int file, device_t * dev)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
int error = 0;
|
||||
|
||||
if (dev == NULL)
|
||||
@@ -78,13 +77,13 @@ static int console_setfile (int file, device_t * dev)
|
||||
*/
|
||||
switch (file) {
|
||||
case stdin:
|
||||
syscall_tbl[SYSCALL_GETC] = dev->getc;
|
||||
syscall_tbl[SYSCALL_TSTC] = dev->tstc;
|
||||
gd->jt[XF_getc] = dev->getc;
|
||||
gd->jt[XF_tstc] = dev->tstc;
|
||||
break;
|
||||
case stdout:
|
||||
syscall_tbl[SYSCALL_PUTC] = dev->putc;
|
||||
syscall_tbl[SYSCALL_PUTS] = dev->puts;
|
||||
syscall_tbl[SYSCALL_PRINTF] = printf;
|
||||
gd->jt[XF_putc] = dev->putc;
|
||||
gd->jt[XF_puts] = dev->puts;
|
||||
gd->jt[XF_printf] = printf;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -394,15 +393,16 @@ device_t *search_device (int flags, char *name)
|
||||
/* Called after the relocation - use desired console functions */
|
||||
int console_init_r (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
char *stdinname, *stdoutname, *stderrname;
|
||||
device_t *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
|
||||
|
||||
/* set default handlers at first */
|
||||
syscall_tbl[SYSCALL_GETC] = serial_getc;
|
||||
syscall_tbl[SYSCALL_TSTC] = serial_tstc;
|
||||
syscall_tbl[SYSCALL_PUTC] = serial_putc;
|
||||
syscall_tbl[SYSCALL_PUTS] = serial_puts;
|
||||
syscall_tbl[SYSCALL_PRINTF] = serial_printf;
|
||||
gd->jt[XF_getc] = serial_getc;
|
||||
gd->jt[XF_tstc] = serial_tstc;
|
||||
gd->jt[XF_putc] = serial_putc;
|
||||
gd->jt[XF_puts] = serial_puts;
|
||||
gd->jt[XF_printf] = serial_printf;
|
||||
|
||||
/* stdin stdout and stderr are in environment */
|
||||
/* scan for it */
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <common.h>
|
||||
#include <exports.h>
|
||||
|
||||
static void dummy(void)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned long get_version(void)
|
||||
{
|
||||
return XF_VERSION;
|
||||
}
|
||||
|
||||
void jumptable_init (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
int i;
|
||||
|
||||
gd->jt = (void **) malloc (XF_MAX * sizeof (void *));
|
||||
for (i = 0; i < XF_MAX; i++)
|
||||
gd->jt[i] = (void *) dummy;
|
||||
|
||||
gd->jt[XF_get_version] = (void *) get_version;
|
||||
gd->jt[XF_malloc] = (void *) malloc;
|
||||
gd->jt[XF_free] = (void *) free;
|
||||
gd->jt[XF_get_timer] = (void *)get_timer;
|
||||
gd->jt[XF_udelay] = (void *)udelay;
|
||||
#if defined(CONFIG_I386) || defined(CONFIG_PPC)
|
||||
gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
|
||||
gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) Orbacom Systems, Inc <www.orbacom.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are freely
|
||||
* permitted provided that the above copyright notice and this
|
||||
* paragraph and the following disclaimer are duplicated in all
|
||||
* such forms.
|
||||
*
|
||||
* This software is provided "AS IS" and without any express or
|
||||
* implied warranties, including, without limitation, the implied
|
||||
* warranties of merchantability and fitness for a particular
|
||||
* purpose.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <image.h>
|
||||
|
||||
#if defined(CONFIG_LYNXKDI)
|
||||
#include <lynxkdi.h>
|
||||
|
||||
#if defined(CONFIG_MPC8260)
|
||||
void lynxkdi_boot ( image_header_t *hdr )
|
||||
{
|
||||
void (*lynxkdi)(void) = (void(*)(void))hdr->ih_ep;
|
||||
lynxos_bootparms_t *parms = (lynxos_bootparms_t *)0x0020;
|
||||
bd_t *kbd;
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
u32 *psz = (u32 *)(hdr->ih_load + 0x0204);
|
||||
|
||||
memset( parms, 0, sizeof(*parms));
|
||||
kbd = gd->bd;
|
||||
parms->clock_ref = kbd->bi_busfreq;
|
||||
parms->dramsz = kbd->bi_memsize;
|
||||
memcpy(parms->ethaddr, kbd->bi_enetaddr, 6);
|
||||
mtspr(SPRN_SPRG2, 0x0020);
|
||||
|
||||
/* Do a simple check for Bluecat so we can pass the
|
||||
* kernel command line parameters.
|
||||
*/
|
||||
if( le32_to_cpu(*psz) == hdr->ih_size ){
|
||||
char *args;
|
||||
char *cmdline = (char *)(hdr->ih_load + 0x020c);
|
||||
int len;
|
||||
|
||||
printf("Booting Bluecat KDI ...\n");
|
||||
udelay(200*1000); /* Allow serial port to flush */
|
||||
if ((args = getenv("bootargs")) == NULL)
|
||||
args = "";
|
||||
/* Prepend the cmdline */
|
||||
len = strlen(args);
|
||||
if( len && (len + strlen(cmdline) + 2 < (0x0400 - 0x020c))) {
|
||||
memmove( cmdline + strlen(args) + 1, cmdline, strlen(cmdline) );
|
||||
strcpy( cmdline, args );
|
||||
cmdline[len] = ' ';
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Booting LynxOS KDI ...\n");
|
||||
}
|
||||
|
||||
lynxkdi();
|
||||
}
|
||||
#else
|
||||
#error "Lynx KDI support not implemented for configured CPU"
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_LYNXKDI */
|
||||
|
||||
+27
-1
@@ -32,6 +32,8 @@
|
||||
#include <hush.h>
|
||||
#endif
|
||||
|
||||
#include <post.h>
|
||||
|
||||
#if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
|
||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* for do_reset() prototype */
|
||||
#endif
|
||||
@@ -258,6 +260,12 @@ void main_loop (void)
|
||||
#ifdef CONFIG_PREBOOT
|
||||
char *p;
|
||||
#endif
|
||||
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||
unsigned long bootcount = 0;
|
||||
unsigned long bootlimit = 0;
|
||||
char *bcs;
|
||||
char bcs_set[16];
|
||||
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||
|
||||
#if defined(CONFIG_VFD) && defined(VFD_TEST_LOGO)
|
||||
ulong bmp = 0; /* default bitmap */
|
||||
@@ -270,6 +278,16 @@ void main_loop (void)
|
||||
trab_vfd (bmp);
|
||||
#endif /* CONFIG_VFD && VFD_TEST_LOGO */
|
||||
|
||||
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||
bootcount = bootcount_load();
|
||||
bootcount++;
|
||||
bootcount_store (bootcount);
|
||||
sprintf (bcs_set, "%lu", bootcount);
|
||||
setenv ("bootcount", bcs_set);
|
||||
bcs = getenv ("bootlimit");
|
||||
bootlimit = bcs ? simple_strtoul (bcs, NULL, 10) : 0;
|
||||
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
debug ("DEBUG: main_loop: do_mdm_init=%d\n", do_mdm_init);
|
||||
if (do_mdm_init) {
|
||||
@@ -322,7 +340,15 @@ void main_loop (void)
|
||||
init_cmd_timeout ();
|
||||
# endif /* CONFIG_BOOT_RETRY_TIME */
|
||||
|
||||
s = getenv ("bootcmd");
|
||||
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||
if (bootlimit && (bootcount > bootlimit)) {
|
||||
printf ("Warning: Bootlimit (%u) exceeded. Using altbootcmd.\n",
|
||||
(unsigned)bootlimit);
|
||||
s = getenv ("altbootcmd");
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||
s = getenv ("bootcmd");
|
||||
|
||||
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
||||
|
||||
|
||||
@@ -112,8 +112,8 @@ gccincdir := $(shell $(CC) -print-file-name=include)
|
||||
CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
|
||||
-D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
|
||||
-I$(TOPDIR)/include \
|
||||
-fno-builtin -nostdinc -isystem $(gccincdir) \
|
||||
-pipe $(PLATFORM_CPPFLAGS)
|
||||
-fno-builtin -ffreestanding -nostdinc -isystem \
|
||||
$(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
|
||||
|
||||
ifdef BUILD_TAG
|
||||
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes \
|
||||
|
||||
+1
-69
@@ -159,75 +159,7 @@ ProgramCheck:
|
||||
STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
STD_EXCEPTION(0xd00, SingleStep, UnknownException)
|
||||
|
||||
STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
|
||||
|
||||
+3
-4
@@ -413,10 +413,9 @@ fiq:
|
||||
.globl reset_cpu
|
||||
reset_cpu:
|
||||
ldr r1, rstctl1 /* get clkm1 reset ctl */
|
||||
mov r3, #0x0
|
||||
strh r3, [r1] /* clear it */
|
||||
mov r3, #0x8
|
||||
strh r3, [r1] /* force dsp+arm reset */
|
||||
mov r3, #0x3 /* dsp_en + arm_rst = global reset */
|
||||
strh r3, [r1] /* force reset */
|
||||
mov r0, r0
|
||||
_loop_forever:
|
||||
b _loop_forever
|
||||
rstctl1:
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = lib$(CPU).a
|
||||
|
||||
START = start.o
|
||||
OBJS = interrupts.o cpu.o
|
||||
|
||||
all: .depend $(START) $(LIB)
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# (C) Copyright 2002
|
||||
# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
# MA 02111-1307 USA
|
||||
#
|
||||
|
||||
PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
|
||||
-mshort-load-bytes -msoft-float
|
||||
|
||||
PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* CPU specific code
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <arm926ejs.h>
|
||||
|
||||
/* read co-processor 15, register #1 (control register) */
|
||||
static unsigned long read_p15_c1 (void)
|
||||
{
|
||||
unsigned long value;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"mrc p15, 0, %0, c1, c0, 0 @ read control reg\n"
|
||||
: "=r" (value)
|
||||
:
|
||||
: "memory");
|
||||
|
||||
#ifdef MMU_DEBUG
|
||||
printf ("p15/c1 is = %08lx\n", value);
|
||||
#endif
|
||||
return value;
|
||||
}
|
||||
|
||||
/* write to co-processor 15, register #1 (control register) */
|
||||
static void write_p15_c1 (unsigned long value)
|
||||
{
|
||||
#ifdef MMU_DEBUG
|
||||
printf ("write %08lx to p15/c1\n", value);
|
||||
#endif
|
||||
__asm__ __volatile__(
|
||||
"mcr p15, 0, %0, c1, c0, 0 @ write it back\n"
|
||||
:
|
||||
: "r" (value)
|
||||
: "memory");
|
||||
|
||||
read_p15_c1 ();
|
||||
}
|
||||
|
||||
static void cp_delay (void)
|
||||
{
|
||||
volatile int i;
|
||||
|
||||
/* Many OMAP regs need at least 2 nops */
|
||||
for (i = 0; i < 100; i++);
|
||||
}
|
||||
|
||||
/* See also ARM Ref. Man. */
|
||||
#define C1_MMU (1<<0) /* mmu off/on */
|
||||
#define C1_ALIGN (1<<1) /* alignment faults off/on */
|
||||
#define C1_DC (1<<2) /* dcache off/on */
|
||||
#define C1_WB (1<<3) /* merging write buffer on/off */
|
||||
#define C1_BIG_ENDIAN (1<<7) /* big endian off/on */
|
||||
#define C1_SYS_PROT (1<<8) /* system protection */
|
||||
#define C1_ROM_PROT (1<<9) /* ROM protection */
|
||||
#define C1_IC (1<<12) /* icache off/on */
|
||||
#define C1_HIGH_VECTORS (1<<13) /* location of vectors: low/high addresses */
|
||||
#define RESERVED_1 (0xf << 3) /* must be 111b for R/W */
|
||||
|
||||
int cpu_init (void)
|
||||
{
|
||||
/*
|
||||
* setup up stack if necessary
|
||||
*/
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
IRQ_STACK_START = _armboot_end +
|
||||
CONFIG_STACKSIZE + CONFIG_STACKSIZE_IRQ - 4;
|
||||
FIQ_STACK_START = IRQ_STACK_START + CONFIG_STACKSIZE_FIQ;
|
||||
_armboot_real_end = FIQ_STACK_START + 4;
|
||||
#else
|
||||
_armboot_real_end = _armboot_end + CONFIG_STACKSIZE;
|
||||
#endif /* CONFIG_USE_IRQ */
|
||||
return (0);
|
||||
}
|
||||
|
||||
int cleanup_before_linux (void)
|
||||
{
|
||||
/*
|
||||
* this function is called just before we call linux
|
||||
* it prepares the processor for linux
|
||||
*
|
||||
* we turn off caches etc ...
|
||||
*/
|
||||
|
||||
unsigned long i;
|
||||
|
||||
disable_interrupts ();
|
||||
|
||||
/* turn off I/D-cache */
|
||||
asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
|
||||
i &= ~(C1_DC | C1_IC);
|
||||
asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i));
|
||||
|
||||
/* flush I/D-cache */
|
||||
i = 0;
|
||||
asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
|
||||
return (0);
|
||||
}
|
||||
|
||||
int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
extern void reset_cpu (ulong addr);
|
||||
|
||||
disable_interrupts ();
|
||||
reset_cpu (0);
|
||||
/*NOTREACHED*/
|
||||
return (0);
|
||||
}
|
||||
|
||||
void icache_enable (void)
|
||||
{
|
||||
ulong reg;
|
||||
|
||||
reg = read_p15_c1 (); /* get control reg. */
|
||||
cp_delay ();
|
||||
write_p15_c1 (reg | C1_IC);
|
||||
}
|
||||
|
||||
void icache_disable (void)
|
||||
{
|
||||
ulong reg;
|
||||
|
||||
reg = read_p15_c1 ();
|
||||
cp_delay ();
|
||||
write_p15_c1 (reg & ~C1_IC);
|
||||
}
|
||||
|
||||
int icache_status (void)
|
||||
{
|
||||
return (read_p15_c1 () & C1_IC) != 0;
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Alex Zuepke <azu@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <arm925t.h>
|
||||
#include <configs/omap1510.h>
|
||||
|
||||
#include <asm/proc-armv/ptrace.h>
|
||||
|
||||
extern void reset_cpu(ulong addr);
|
||||
#define TIMER_LOAD_VAL 0xffffffff
|
||||
|
||||
/* macro to read the 32 bit timer */
|
||||
#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+8))
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* enable IRQ interrupts */
|
||||
void enable_interrupts (void)
|
||||
{
|
||||
unsigned long temp;
|
||||
__asm__ __volatile__("mrs %0, cpsr\n"
|
||||
"bic %0, %0, #0x80\n"
|
||||
"msr cpsr_c, %0"
|
||||
: "=r" (temp)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/*
|
||||
* disable IRQ/FIQ interrupts
|
||||
* returns true if interrupts had been enabled before we disabled them
|
||||
*/
|
||||
int disable_interrupts (void)
|
||||
{
|
||||
unsigned long old,temp;
|
||||
__asm__ __volatile__("mrs %0, cpsr\n"
|
||||
"orr %1, %0, #0xc0\n"
|
||||
"msr cpsr_c, %1"
|
||||
: "=r" (old), "=r" (temp)
|
||||
: "memory");
|
||||
return (old & 0x80) == 0;
|
||||
}
|
||||
#else
|
||||
void enable_interrupts (void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int disable_interrupts (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void bad_mode (void)
|
||||
{
|
||||
panic ("Resetting CPU ...\n");
|
||||
reset_cpu (0);
|
||||
}
|
||||
|
||||
void show_regs (struct pt_regs *regs)
|
||||
{
|
||||
unsigned long flags;
|
||||
const char *processor_modes[] = {
|
||||
"USER_26", "FIQ_26", "IRQ_26", "SVC_26",
|
||||
"UK4_26", "UK5_26", "UK6_26", "UK7_26",
|
||||
"UK8_26", "UK9_26", "UK10_26", "UK11_26",
|
||||
"UK12_26", "UK13_26", "UK14_26", "UK15_26",
|
||||
"USER_32", "FIQ_32", "IRQ_32", "SVC_32",
|
||||
"UK4_32", "UK5_32", "UK6_32", "ABT_32",
|
||||
"UK8_32", "UK9_32", "UK10_32", "UND_32",
|
||||
"UK12_32", "UK13_32", "UK14_32", "SYS_32",
|
||||
};
|
||||
|
||||
flags = condition_codes (regs);
|
||||
|
||||
printf ("pc : [<%08lx>] lr : [<%08lx>]\n"
|
||||
"sp : %08lx ip : %08lx fp : %08lx\n",
|
||||
instruction_pointer (regs),
|
||||
regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
|
||||
printf ("r10: %08lx r9 : %08lx r8 : %08lx\n",
|
||||
regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
|
||||
printf ("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n",
|
||||
regs->ARM_r7, regs->ARM_r6, regs->ARM_r5, regs->ARM_r4);
|
||||
printf ("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
|
||||
regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0);
|
||||
printf ("Flags: %c%c%c%c",
|
||||
flags & CC_N_BIT ? 'N' : 'n',
|
||||
flags & CC_Z_BIT ? 'Z' : 'z',
|
||||
flags & CC_C_BIT ? 'C' : 'c', flags & CC_V_BIT ? 'V' : 'v');
|
||||
printf (" IRQs %s FIQs %s Mode %s%s\n",
|
||||
interrupts_enabled (regs) ? "on" : "off",
|
||||
fast_interrupts_enabled (regs) ? "on" : "off",
|
||||
processor_modes[processor_mode (regs)],
|
||||
thumb_mode (regs) ? " (T)" : "");
|
||||
}
|
||||
|
||||
void do_undefined_instruction (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("undefined instruction\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
void do_software_interrupt (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("software interrupt\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
void do_prefetch_abort (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("prefetch abort\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
void do_data_abort (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("data abort\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
void do_not_used (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("not used\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
void do_fiq (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("fast interrupt request\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
void do_irq (struct pt_regs *pt_regs)
|
||||
{
|
||||
printf ("interrupt request\n");
|
||||
show_regs (pt_regs);
|
||||
bad_mode ();
|
||||
}
|
||||
|
||||
static ulong timestamp;
|
||||
static ulong lastdec;
|
||||
|
||||
/* nothing really to do with interrupts, just starts up a counter. */
|
||||
int interrupt_init (void)
|
||||
{
|
||||
int32_t val;
|
||||
|
||||
*((int32_t *) (CFG_TIMERBASE + LOAD_TIM)) = TIMER_LOAD_VAL;
|
||||
val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE |
|
||||
(CFG_PVT << MPUTIM_PTV_BIT);
|
||||
*((int32_t *) (CFG_TIMERBASE + CNTL_TIMER)) = val;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* timer without interrupts
|
||||
*/
|
||||
|
||||
void reset_timer (void)
|
||||
{
|
||||
reset_timer_masked ();
|
||||
}
|
||||
|
||||
ulong get_timer (ulong base)
|
||||
{
|
||||
return get_timer_masked () - base;
|
||||
}
|
||||
|
||||
void set_timer (ulong t)
|
||||
{
|
||||
timestamp = t;
|
||||
}
|
||||
|
||||
/* very rough timer... */
|
||||
void udelay (unsigned long usec)
|
||||
{
|
||||
#ifdef CONFIG_INNOVATOROMAP1610
|
||||
#define LOOPS_PER_MSEC 100 /* tuned on omap1610 */
|
||||
volatile int i, time_remaining = LOOPS_PER_MSEC * usec;
|
||||
|
||||
for (i = time_remaining; i > 0; i--) {
|
||||
}
|
||||
#else
|
||||
|
||||
ulong tmo;
|
||||
tmo = usec / 1000;
|
||||
tmo *= CFG_HZ;
|
||||
tmo /= 1000;
|
||||
tmo += get_timer (0);
|
||||
while (get_timer_masked () < tmo)
|
||||
/*NOP*/;
|
||||
#endif
|
||||
}
|
||||
|
||||
void reset_timer_masked (void)
|
||||
{
|
||||
/* reset time */
|
||||
lastdec = READ_TIMER;
|
||||
timestamp = 0;
|
||||
}
|
||||
|
||||
ulong get_timer_masked (void)
|
||||
{
|
||||
ulong now = READ_TIMER; /* current tick value */
|
||||
|
||||
if (lastdec >= now) { /* did I roll (rem decrementer) */
|
||||
/* normal mode */
|
||||
/* record amount of time since last check */
|
||||
timestamp += lastdec - now;
|
||||
} else {
|
||||
/* we have an overflow ... */
|
||||
timestamp += lastdec + TIMER_LOAD_VAL - now;
|
||||
}
|
||||
lastdec = now;
|
||||
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void udelay_masked (unsigned long usec)
|
||||
{
|
||||
#ifdef CONFIG_INNOVATOROMAP1610
|
||||
#define LOOPS_PER_MSEC 100 /* tuned on omap1610 */
|
||||
volatile int i, time_remaining = LOOPS_PER_MSEC*usec;
|
||||
for (i=time_remaining; i>0; i--) { }
|
||||
#else
|
||||
|
||||
ulong tmo;
|
||||
|
||||
tmo = usec / 1000;
|
||||
tmo *= CFG_HZ;
|
||||
tmo /= 1000;
|
||||
|
||||
reset_timer_masked ();
|
||||
|
||||
while (get_timer_masked () < tmo)
|
||||
/*NOP*/;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (read timebase as long long).
|
||||
* On ARM it just returns the timer value.
|
||||
*/
|
||||
unsigned long long get_ticks(void)
|
||||
{
|
||||
return get_timer(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (timebase clock frequency).
|
||||
* On ARM it returns the number of timer ticks per second.
|
||||
*/
|
||||
ulong get_tbclk (void)
|
||||
{
|
||||
ulong tbclk;
|
||||
tbclk = CFG_HZ;
|
||||
return tbclk;
|
||||
}
|
||||
@@ -0,0 +1,426 @@
|
||||
/*
|
||||
* armboot - Startup Code for ARM926EJS CPU-core
|
||||
*
|
||||
* Copyright (c) 2003 Texas Instruments
|
||||
*
|
||||
* ----- Adapted for OMAP1610 from ARM925t code ------
|
||||
*
|
||||
* Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
|
||||
* Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
|
||||
* Copyright (c) 2002 Gary Jennejohn <gj@denx.de>
|
||||
* Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
|
||||
* Copyright (c) 2003 Kshitij <kshitij@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
#if defined(CONFIG_OMAP1610)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction:
|
||||
.word undefined_instruction
|
||||
_software_interrupt:
|
||||
.word software_interrupt
|
||||
_prefetch_abort:
|
||||
.word prefetch_abort
|
||||
_data_abort:
|
||||
.word data_abort
|
||||
_not_used:
|
||||
.word not_used
|
||||
_irq:
|
||||
.word irq
|
||||
_fiq:
|
||||
.word fiq
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Startup Code (reset vector)
|
||||
*
|
||||
* do important init only if we don't start from memory!
|
||||
* setup Memory and board specific bits prior to relocation.
|
||||
* relocate armboot to ram
|
||||
* setup stack
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
* CFG_MEM_END is in the board dependent config-file (configs/config_BOARD.h)
|
||||
*/
|
||||
_TEXT_BASE:
|
||||
.word TEXT_BASE
|
||||
|
||||
.globl _armboot_start
|
||||
_armboot_start:
|
||||
.word _start
|
||||
|
||||
/*
|
||||
* Note: _armboot_end_data and _armboot_end are defined
|
||||
* by the (board-dependent) linker script.
|
||||
* _armboot_end_data is the first usable FLASH address after armboot
|
||||
*/
|
||||
.globl _armboot_end_data
|
||||
_armboot_end_data:
|
||||
.word armboot_end_data
|
||||
.globl _armboot_end
|
||||
_armboot_end:
|
||||
.word armboot_end
|
||||
|
||||
/*
|
||||
* _armboot_real_end is the first usable RAM address behind armboot
|
||||
* and the various stacks
|
||||
*/
|
||||
.globl _armboot_real_end
|
||||
_armboot_real_end:
|
||||
.word 0x0badc0de
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
|
||||
reset:
|
||||
/*
|
||||
* set the cpu to SVC32 mode
|
||||
*/
|
||||
mrs r0,cpsr
|
||||
bic r0,r0,#0x1f
|
||||
orr r0,r0,#0xd3
|
||||
msr cpsr,r0
|
||||
|
||||
|
||||
/*
|
||||
* turn off the watchdog, unlock/diable sequence
|
||||
*/
|
||||
mov r1, #0xF5
|
||||
ldr r0, =WDTIM_MODE
|
||||
strh r1, [r0]
|
||||
mov r1, #0xA0
|
||||
strh r1, [r0]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* mask all IRQs by setting all bits in the INTMR - default
|
||||
*/
|
||||
|
||||
mov r1, #0xffffffff
|
||||
ldr r0, =REG_IHL1_MIR
|
||||
str r1, [r0]
|
||||
ldr r0, =REG_IHL2_MIR
|
||||
str r1, [r0]
|
||||
bl cpu_init_crit
|
||||
|
||||
relocate:
|
||||
/*
|
||||
* relocate armboot to RAM
|
||||
*/
|
||||
adr r0, _start /* r0 <- current position of code */
|
||||
ldr r2, _armboot_start
|
||||
ldr r3, _armboot_end
|
||||
sub r2, r3, r2 /* r2 <- size of armboot */
|
||||
ldr r1, _TEXT_BASE /* r1 <- destination address */
|
||||
add r2, r0, r2 /* r2 <- source end address */
|
||||
|
||||
/*
|
||||
* r0 = source address
|
||||
* r1 = target address
|
||||
* r2 = source end address
|
||||
*/
|
||||
copy_loop:
|
||||
ldmia r0!, {r3-r10}
|
||||
stmia r1!, {r3-r10}
|
||||
cmp r0, r2
|
||||
ble copy_loop
|
||||
|
||||
/* set up the stack */
|
||||
ldr r0, _armboot_end
|
||||
add r0, r0, #CONFIG_STACKSIZE
|
||||
sub sp, r0, #12 /* leave 3 words for abort-stack */
|
||||
|
||||
ldr pc, _start_armboot
|
||||
|
||||
_start_armboot:
|
||||
.word start_armboot
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* CPU_init_critical registers
|
||||
*
|
||||
* setup important registers
|
||||
* setup memory timing
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
cpu_init_crit:
|
||||
/*
|
||||
* flush v4 I/D caches
|
||||
*/
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */
|
||||
mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */
|
||||
|
||||
/*
|
||||
* disable MMU stuff and caches
|
||||
*/
|
||||
mrc p15, 0, r0, c1, c0, 0
|
||||
bic r0, r0, #0x00002300 /* clear bits 13, 9:8 (--V- --RS) */
|
||||
bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */
|
||||
orr r0, r0, #0x00000002 /* set bit 2 (A) Align */
|
||||
orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
/*
|
||||
* Go setup Memory and board specific bits prior to relocation.
|
||||
*/
|
||||
mov ip, lr /* perserve link reg across call */
|
||||
bl platformsetup /* go setup pll,mux,memory */
|
||||
mov lr, ip /* restore link */
|
||||
mov pc, lr /* back to my caller */
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
@ carve out a frame on current user stack
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
|
||||
ldr r2, _armboot_end @ find top of stack
|
||||
add r2, r2, #CONFIG_STACKSIZE @ find base of normal stack
|
||||
sub r2, r2, #8 @ set base 2 words into abort stack
|
||||
@ get values for "aborted" pc and cpsr (into parm regs)
|
||||
ldmia r2, {r2 - r3}
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0 (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
@ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
|
||||
add r8, sp, #S_PC
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
@ get bottom of stack (into sp by by user stack pointer).
|
||||
ldr r13, _armboot_end
|
||||
@ head to reserved words at the top of the stack
|
||||
add r13, r13, #CONFIG_STACKSIZE
|
||||
sub r13, r13, #8 @ reserved a couple spots in abort stack
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of saved stack
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction & switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
|
||||
.align 5
|
||||
.globl reset_cpu
|
||||
reset_cpu:
|
||||
ldr r1, rstctl1 /* get clkm1 reset ctl */
|
||||
mov r3, #0x0
|
||||
strh r3, [r1] /* clear it */
|
||||
mov r3, #0x8
|
||||
strh r3, [r1] /* force dsp+arm reset */
|
||||
_loop_forever:
|
||||
b _loop_forever
|
||||
|
||||
|
||||
rstctl1:
|
||||
.word 0xfffece10
|
||||
@@ -22,7 +22,6 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <syscall.h>
|
||||
#include <malloc.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/i8259.h>
|
||||
@@ -58,31 +57,6 @@ typedef struct {
|
||||
|
||||
static irq_desc_t irq_table[MAX_IRQ];
|
||||
|
||||
|
||||
asm(".globl syscall_entry\n" \
|
||||
"syscall_entry:\n" \
|
||||
"popl %ebx\n" /* throw away the return address, flags */ \
|
||||
"popl %ebx\n" /* and segment that the INT instruction pushed */ \
|
||||
"popl %ebx\n" /* on to the stack */ \
|
||||
"movl %eax, %ecx\n" /* load the syscall nr argument*/ \
|
||||
"movl syscall_tbl, %eax\n" /* load start of syscall table */ \
|
||||
"cmpl $(11-1), %ecx\n" /* FixMe: find a way to use NR_SYSCALLS macro here */ \
|
||||
"ja bad_syscall\n" \
|
||||
"movl (%eax, %ecx, 4), %eax\n" /* load the handler of the syscall*/ \
|
||||
"test %eax, %eax\n" /* test for null */ \
|
||||
"je bad_syscall\n" \
|
||||
"popl %ecx\n" \
|
||||
"popl %ebx\n" \
|
||||
"sti \n" \
|
||||
"jmp *%eax\n" \
|
||||
"bad_syscall: movl $0xffffffff, %eax\n" \
|
||||
"popl %ecx\n" \
|
||||
"popl %ebx\n" \
|
||||
"ret");
|
||||
|
||||
void __attribute__ ((regparm(0))) syscall_entry(void);
|
||||
|
||||
|
||||
asm ("irq_return:\n"
|
||||
" addl $4, %esp\n"
|
||||
" popa\n"
|
||||
@@ -483,7 +457,6 @@ int interrupt_init(void)
|
||||
set_vector(0x2e, irq_14);
|
||||
set_vector(0x2f, irq_15);
|
||||
/* vectors 0x30-0x3f are reserved for irq 16-31 */
|
||||
set_vector(0x40, syscall_entry);
|
||||
|
||||
|
||||
/* Mask all interrupts */
|
||||
|
||||
+5
-5
@@ -291,6 +291,11 @@ reset:
|
||||
relocate_code:
|
||||
move sp, a0 /* Set new stack pointer */
|
||||
|
||||
li t0, CFG_MONITOR_BASE
|
||||
la t3, in_ram
|
||||
lw t2, -12(t3) /* t2 <-- uboot_end_data */
|
||||
move t1, a2
|
||||
|
||||
/*
|
||||
* Fix GOT pointer:
|
||||
*
|
||||
@@ -301,11 +306,6 @@ relocate_code:
|
||||
add gp, a2 /* gp now adjusted */
|
||||
sub t6, gp, t6 /* t6 <-- relocation offset */
|
||||
|
||||
li t0, CFG_MONITOR_BASE
|
||||
la t3, in_ram
|
||||
lw t2, -12(t3) /* t2 <-- uboot_end_data */
|
||||
move t1, a2
|
||||
|
||||
/*
|
||||
* t0 = source address
|
||||
* t1 = target address
|
||||
|
||||
+1
-69
@@ -226,75 +226,7 @@ ProgramCheck:
|
||||
STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
STD_EXCEPTION(0xd00, SingleStep, UnknownException)
|
||||
|
||||
STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
|
||||
|
||||
@@ -28,7 +28,7 @@ LIB = lib$(CPU).a
|
||||
START = start.o
|
||||
ASOBJS = io.o firmware_sc_task_bestcomm.impl.o firmware_sc_task.impl.o
|
||||
OBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o serial.o \
|
||||
loadtask.o fec.o
|
||||
loadtask.o fec.o pci_mpc5200.o
|
||||
|
||||
all: .depend $(START) $(ASOBJS) $(LIB)
|
||||
|
||||
|
||||
+5
-19
@@ -54,31 +54,17 @@ int checkcpu (void)
|
||||
int
|
||||
do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
ulong msr, addr;
|
||||
|
||||
*(vu_long *)MPC5XXX_CDM_SRESET &= ~(1 << 16); /* Checkstop Reset enable */
|
||||
|
||||
ulong msr;
|
||||
/* Interrupts and MMU off */
|
||||
__asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
|
||||
|
||||
msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
|
||||
__asm__ __volatile__ ("mtmsr %0"::"r" (msr));
|
||||
|
||||
/*
|
||||
* Trying to execute the next instruction at a non-existing address
|
||||
* should cause a machine check, resulting in reset
|
||||
*/
|
||||
#ifdef CFG_RESET_ADDRESS
|
||||
addr = CFG_RESET_ADDRESS;
|
||||
#else
|
||||
/*
|
||||
* note: when CFG_MONITOR_BASE points to a RAM address, CFG_MONITOR_BASE
|
||||
* - sizeof (ulong) is usually a valid address. Better pick an address
|
||||
* known to be invalid on your system and assign it to CFG_RESET_ADDRESS.
|
||||
*/
|
||||
addr = CFG_MONITOR_BASE - sizeof (ulong);
|
||||
#endif
|
||||
((void (*)(void)) addr) ();
|
||||
/* Charge the watchdog timer */
|
||||
*(vu_long *)(MPC5XXX_GPT0_COUNTER) = 0xf;
|
||||
*(vu_long *)(MPC5XXX_GPT0_ENABLE) = 0x9004; /* wden|ce|timer_ms */
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
@@ -155,6 +155,11 @@ void cpu_init_f (void)
|
||||
#if defined(CFG_GPS_PORT_CONFIG)
|
||||
*(vu_long *)MPC5XXX_GPS_PORT_CONFIG = CFG_GPS_PORT_CONFIG;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MPC5200)
|
||||
/* enable timebase */
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (1 << 13);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -171,11 +176,6 @@ int cpu_init_r (void)
|
||||
*(vu_long *)MPC5XXX_ICTL_CRIT |= 0x0001ffff;
|
||||
*(vu_long *)MPC5XXX_ICTL_EXT &= ~0x00000f00;
|
||||
|
||||
#if defined(CONFIG_MPC5200)
|
||||
/* enable timebase */
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (1 << 13);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_MPC5XXX_FEC)
|
||||
/* load FEC microcode */
|
||||
loadtask(0, 2);
|
||||
|
||||
+57
-53
@@ -14,7 +14,7 @@
|
||||
#include "sdma.h"
|
||||
#include "fec.h"
|
||||
|
||||
#define DEBUG 0x8
|
||||
/* #define DEBUG 0x28 */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
|
||||
defined(CONFIG_MPC5XXX_FEC)
|
||||
@@ -28,25 +28,33 @@ static void rfifo_print(mpc5xxx_fec_priv *fec);
|
||||
static uint32 local_crc32(char *string, unsigned int crc_value, int len);
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uint8 data[1500]; /* actual data */
|
||||
int length; /* actual length */
|
||||
int used; /* buffer in use or not */
|
||||
uint8 head[16]; /* MAC header(6 + 6 + 2) + 2(aligned) */
|
||||
} NBUF;
|
||||
|
||||
/********************************************************************/
|
||||
static int mpc5xxx_fec_rbd_init(mpc5xxx_fec_priv *fec)
|
||||
{
|
||||
int ix;
|
||||
char *data;
|
||||
static int once = 0;
|
||||
|
||||
/*
|
||||
* the receive ring is located right after the transmit one
|
||||
*/
|
||||
for (ix = 0; ix < FEC_RBD_NUM; ix++) {
|
||||
data = (char *)malloc(FEC_MAX_PKT_SIZE);
|
||||
if (data == NULL) {
|
||||
printf ("RBD INIT FAILED\n");
|
||||
return -1;
|
||||
if (!once) {
|
||||
data = (char *)malloc(FEC_MAX_PKT_SIZE);
|
||||
if (data == NULL) {
|
||||
printf ("RBD INIT FAILED\n");
|
||||
return -1;
|
||||
}
|
||||
fec->rbdBase[ix].dataPointer = (uint32)data;
|
||||
}
|
||||
fec->rbdBase[ix].status = FEC_RBD_EMPTY;
|
||||
fec->rbdBase[ix].dataLength = 0;
|
||||
fec->rbdBase[ix].dataPointer = (uint32)data;
|
||||
}
|
||||
once ++;
|
||||
|
||||
/*
|
||||
* have the last RBD to close the ring
|
||||
@@ -335,11 +343,6 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
|
||||
*/
|
||||
SDMA_CLEAR_IEVENT(FEC_RECV_TASK_NO);
|
||||
|
||||
/*
|
||||
* Set SmartDMA intMask register to enable SmartDMA task interrupts
|
||||
*/
|
||||
SDMA_INT_ENABLE(FEC_RECV_TASK_NO);
|
||||
|
||||
/*
|
||||
* Initialize SmartDMA parameters stored in SRAM
|
||||
*/
|
||||
@@ -488,14 +491,16 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
|
||||
printf("mpc5xxx_fec_init... Done \n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/********************************************************************/
|
||||
static void mpc5xxx_fec_halt(struct eth_device *dev)
|
||||
{
|
||||
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
|
||||
#if defined(CONFIG_MPC5200)
|
||||
struct mpc5xxx_sdma *sdma = (struct mpc5xxx_sdma *)MPC5XXX_SDMA;
|
||||
#endif
|
||||
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
|
||||
int counter = 0xffff;
|
||||
|
||||
#if (DEBUG & 0x2)
|
||||
@@ -530,8 +535,6 @@ static void mpc5xxx_fec_halt(struct eth_device *dev)
|
||||
*/
|
||||
while ((counter--) && (!(fec->eth->ievent & 0x10000000))) ;
|
||||
|
||||
SDMA_INT_DISABLE (FEC_RECV_TASK_NO);
|
||||
|
||||
/*
|
||||
* Disable SmartDMA tasks
|
||||
*/
|
||||
@@ -671,7 +674,7 @@ static int mpc5xxx_fec_send(struct eth_device *dev, volatile void *eth_data,
|
||||
pTbd = &fec->tbdBase[fec->tbdIndex];
|
||||
pTbd->dataLength = data_length;
|
||||
pTbd->dataPointer = (uint32)eth_data;
|
||||
pTbd->status |= FEC_TBD_READY;
|
||||
pTbd->status |= FEC_TBD_LAST | FEC_TBD_TC | FEC_TBD_READY;
|
||||
fec->tbdIndex = (fec->tbdIndex + 1) % FEC_TBD_NUM;
|
||||
|
||||
#if (DEBUG & 0x100)
|
||||
@@ -729,8 +732,9 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
|
||||
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
|
||||
FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
|
||||
unsigned long ievent;
|
||||
int frame_length;
|
||||
char *frame;
|
||||
int frame_length, len = 0;
|
||||
NBUF *frame;
|
||||
char buff[FEC_MAX_PKT_SIZE];
|
||||
|
||||
#if (DEBUG & 0x1)
|
||||
printf ("mpc5xxx_fec_recv %d Start...\n", fec->rbdIndex);
|
||||
@@ -763,41 +767,40 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Do we have data in Rx FIFO?
|
||||
*/
|
||||
if ((pRbd->status & FEC_RBD_EMPTY) || !(pRbd->status & FEC_RBD_LAST)){
|
||||
return 0;
|
||||
}
|
||||
if (!(pRbd->status & FEC_RBD_EMPTY)) {
|
||||
if ((pRbd->status & FEC_RBD_LAST) && !(pRbd->status & FEC_RBD_ERR) &&
|
||||
((pRbd->dataLength - 4) > 14)) {
|
||||
|
||||
/*
|
||||
* Pass the packet up only if reception was Ok
|
||||
*/
|
||||
if ((pRbd->dataLength <= 14) || (pRbd->status & FEC_RBD_ERR)) {
|
||||
mpc5xxx_fec_rbd_clean(fec, pRbd);
|
||||
#if (DEBUG & 0x8)
|
||||
printf( "X0" );
|
||||
/*
|
||||
* Get buffer address and size
|
||||
*/
|
||||
frame = (NBUF *)pRbd->dataPointer;
|
||||
frame_length = pRbd->dataLength - 4;
|
||||
|
||||
#if (DEBUG & 0x20)
|
||||
{
|
||||
int i;
|
||||
printf("recv data hdr:");
|
||||
for (i = 0; i < 14; i++)
|
||||
printf("%x ", *(frame->head + i));
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
/*
|
||||
* Fill the buffer and pass it to upper layers
|
||||
*/
|
||||
memcpy(buff, frame->head, 14);
|
||||
memcpy(buff + 14, frame->data, frame_length);
|
||||
NetReceive(buff, frame_length);
|
||||
len = frame_length;
|
||||
}
|
||||
/*
|
||||
* Reset buffer descriptor as empty
|
||||
*/
|
||||
mpc5xxx_fec_rbd_clean(fec, pRbd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get buffer address and size
|
||||
*/
|
||||
frame = (char *)pRbd->dataPointer;
|
||||
frame_length = pRbd->dataLength;
|
||||
|
||||
/*
|
||||
* Pass the buffer to upper layers
|
||||
*/
|
||||
NetReceive(frame, frame_length);
|
||||
|
||||
/*
|
||||
* Reset buffer descriptor as empty
|
||||
*/
|
||||
mpc5xxx_fec_rbd_clean(fec, pRbd);
|
||||
|
||||
return frame_length;
|
||||
SDMA_CLEAR_IEVENT (FEC_RECV_TASK_NO);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
@@ -824,6 +827,7 @@ int mpc5xxx_fec_initialize(bd_t * bis)
|
||||
dev->send = mpc5xxx_fec_send;
|
||||
dev->recv = mpc5xxx_fec_recv;
|
||||
|
||||
sprintf(dev->name, "FEC ETHERNET");
|
||||
eth_register(dev);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if defined(CONFIG_PCI) && defined(CONFIG_MPC5200)
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <pci.h>
|
||||
#include <mpc5xxx.h>
|
||||
|
||||
/* System RAM mapped over PCI */
|
||||
#define CONFIG_PCI_MEMORY_BUS CFG_SDRAM_BASE
|
||||
#define CONFIG_PCI_MEMORY_PHYS CFG_SDRAM_BASE
|
||||
#define CONFIG_PCI_MEMORY_SIZE (1024 * 1024 * 1024)
|
||||
|
||||
/* PCIIWCR bit fields */
|
||||
#define IWCR_MEM (0 << 3)
|
||||
#define IWCR_IO (1 << 3)
|
||||
#define IWCR_READ (0 << 1)
|
||||
#define IWCR_READLINE (1 << 1)
|
||||
#define IWCR_READMULT (2 << 1)
|
||||
#define IWCR_EN (1 << 0)
|
||||
|
||||
static int mpc5200_read_config_dword(struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset, u32* value)
|
||||
{
|
||||
*(volatile u32 *)MPC5XXX_PCI_CAR = (1 << 31) | dev | offset;
|
||||
eieio();
|
||||
*value = in_le32((volatile u32 *)CONFIG_PCI_IO_PHYS);
|
||||
eieio();
|
||||
*(volatile u32 *)MPC5XXX_PCI_CAR = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mpc5200_write_config_dword(struct pci_controller *hose,
|
||||
pci_dev_t dev, int offset, u32 value)
|
||||
{
|
||||
*(volatile u32 *)MPC5XXX_PCI_CAR = (1 << 31) | dev | offset;
|
||||
eieio();
|
||||
out_le32((volatile u32 *)CONFIG_PCI_IO_PHYS, value);
|
||||
eieio();
|
||||
*(volatile u32 *)MPC5XXX_PCI_CAR = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void pci_mpc5xxx_init (struct pci_controller *hose)
|
||||
{
|
||||
hose->first_busno = 0;
|
||||
hose->last_busno = 0xff;
|
||||
|
||||
/* System space */
|
||||
pci_set_region(hose->regions + 0,
|
||||
CONFIG_PCI_MEMORY_BUS,
|
||||
CONFIG_PCI_MEMORY_PHYS,
|
||||
CONFIG_PCI_MEMORY_SIZE,
|
||||
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||
|
||||
/* PCI memory space */
|
||||
pci_set_region(hose->regions + 1,
|
||||
CONFIG_PCI_MEM_BUS,
|
||||
CONFIG_PCI_MEM_PHYS,
|
||||
CONFIG_PCI_MEM_SIZE,
|
||||
PCI_REGION_MEM);
|
||||
|
||||
/* PCI IO space */
|
||||
pci_set_region(hose->regions + 2,
|
||||
CONFIG_PCI_IO_BUS,
|
||||
CONFIG_PCI_IO_PHYS,
|
||||
CONFIG_PCI_IO_SIZE,
|
||||
PCI_REGION_IO);
|
||||
|
||||
hose->region_count = 3;
|
||||
|
||||
pci_register_hose(hose);
|
||||
|
||||
/* GPIO Multiplexing - enable PCI */
|
||||
*(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~(1 << 15);
|
||||
|
||||
/* Set host bridge as pci master and enable memory decoding */
|
||||
*(vu_long *)MPC5XXX_PCI_CMD |=
|
||||
PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
|
||||
|
||||
/* Set maximum latency timer */
|
||||
*(vu_long *)MPC5XXX_PCI_CFG |= (0xf800);
|
||||
|
||||
/* Set cache line size */
|
||||
*(vu_long *)MPC5XXX_PCI_CFG = (*(vu_long *)MPC5XXX_PCI_CFG & ~0xff) |
|
||||
(CFG_CACHELINE_SIZE / 4);
|
||||
|
||||
/* Map MBAR to PCI space */
|
||||
*(vu_long *)MPC5XXX_PCI_BAR0 = CFG_MBAR;
|
||||
*(vu_long *)MPC5XXX_PCI_TBATR1 = CFG_MBAR | 1;
|
||||
|
||||
/* Map RAM to PCI space */
|
||||
*(vu_long *)MPC5XXX_PCI_BAR1 = CONFIG_PCI_MEMORY_BUS | (1 << 3);
|
||||
*(vu_long *)MPC5XXX_PCI_TBATR1 = CONFIG_PCI_MEMORY_PHYS | 1;
|
||||
|
||||
/* Enable snooping for RAM */
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (1 << 15);
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x70) = CONFIG_PCI_MEMORY_PHYS | 0x1d;
|
||||
|
||||
/* Park XLB on PCI */
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x40) &= ~((7 << 8) | (3 << 5));
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (3 << 8) | (3 << 5);
|
||||
|
||||
/* Enable piplining */
|
||||
*(vu_long *)(MPC5XXX_XLBARB + 0x40) &= ~(1 << 31);
|
||||
|
||||
/* Disable interrupts from PCI controller */
|
||||
*(vu_long *)MPC5XXX_PCI_GSCR &= ~(7 << 12);
|
||||
*(vu_long *)MPC5XXX_PCI_ICR &= ~(7 << 24);
|
||||
|
||||
/* Disable initiator windows */
|
||||
*(vu_long *)MPC5XXX_PCI_IWCR = 0;
|
||||
|
||||
/* Map PCI memory to physical space */
|
||||
*(vu_long *)MPC5XXX_PCI_IW0BTAR = CONFIG_PCI_MEM_PHYS |
|
||||
(((CONFIG_PCI_MEM_SIZE - 1) >> 8) & 0x00ff0000) |
|
||||
(CONFIG_PCI_MEM_BUS >> 16);
|
||||
*(vu_long *)MPC5XXX_PCI_IWCR |= (IWCR_MEM | IWCR_READ | IWCR_EN) << 24;
|
||||
|
||||
/* Map PCI I/O to physical space */
|
||||
*(vu_long *)MPC5XXX_PCI_IW1BTAR = CONFIG_PCI_IO_PHYS |
|
||||
(((CONFIG_PCI_IO_SIZE - 1) >> 8) & 0x00ff0000) |
|
||||
(CONFIG_PCI_IO_BUS >> 16);
|
||||
*(vu_long *)MPC5XXX_PCI_IWCR |= (IWCR_IO | IWCR_READ | IWCR_EN) << 16;
|
||||
|
||||
/* Reset the PCI bus */
|
||||
*(vu_long *)MPC5XXX_PCI_GSCR |= 1;
|
||||
udelay(1000);
|
||||
*(vu_long *)MPC5XXX_PCI_GSCR &= ~1;
|
||||
udelay(1000);
|
||||
|
||||
pci_set_ops(hose,
|
||||
pci_hose_read_config_byte_via_dword,
|
||||
pci_hose_read_config_word_via_dword,
|
||||
mpc5200_read_config_dword,
|
||||
pci_hose_write_config_byte_via_dword,
|
||||
pci_hose_write_config_word_via_dword,
|
||||
mpc5200_write_config_dword);
|
||||
|
||||
udelay(1000);
|
||||
|
||||
#ifdef CONFIG_PCI_SCAN_SHOW
|
||||
printf("PCI: Bus Dev VenId DevId Class Int\n");
|
||||
#endif
|
||||
|
||||
hose->last_busno = pci_hose_scan(hose);
|
||||
}
|
||||
#endif /* CONFIG_PCI && CONFIG_MPC5200 */
|
||||
+2
-70
@@ -103,7 +103,7 @@ boot_cold:
|
||||
boot_warm:
|
||||
mfmsr r5 /* save msr contents */
|
||||
|
||||
#if defined(CFG_DEFAULT_MBAR)
|
||||
#if defined(CFG_DEFAULT_MBAR) && !defined(CFG_RAMBOOT)
|
||||
lis r3, CFG_MBAR@h
|
||||
ori r3, r3, CFG_MBAR@l
|
||||
#if defined(CONFIG_MPC5200)
|
||||
@@ -208,75 +208,7 @@ ProgramCheck:
|
||||
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
STD_EXCEPTION(0xd00, SingleStep, UnknownException)
|
||||
|
||||
STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
|
||||
|
||||
@@ -1197,13 +1197,16 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
|
||||
uchar *p;
|
||||
int i;
|
||||
|
||||
p = dummy_buffer;
|
||||
/* fill in address in big endian order */
|
||||
for (i=0; i<alen; ++i)
|
||||
*p++ = (addr >> (i * 8)) & 0xFF;
|
||||
for (i=alen-1; i>=0; --i) {
|
||||
buffer[i] = addr & 0xFF;
|
||||
addr >>= 8;
|
||||
}
|
||||
/* fill in data */
|
||||
p = dummy_buffer + alen;
|
||||
|
||||
for (i=0; i<len; ++i)
|
||||
*p++ = *buffer;
|
||||
*p++ = *buffer++;
|
||||
|
||||
status = I2C_do_buffer (0, I2C_MASTER_XMIT, chip, alen + len,
|
||||
dummy_buffer, I2C_STOP, 1, I2C_NO_RESTART);
|
||||
|
||||
+1
-68
@@ -259,74 +259,7 @@ ProgramCheck:
|
||||
STD_EXCEPTION(EXC_OFF_DECR, Decrementer, timer_interrupt)
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
|
||||
STD_EXCEPTION(EXC_OFF_TRACE, SingleStep, UnknownException)
|
||||
|
||||
|
||||
@@ -208,3 +208,27 @@ ulong post_word_load (void)
|
||||
}
|
||||
|
||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||
|
||||
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||
|
||||
void bootcount_store (ulong a)
|
||||
{
|
||||
volatile ulong *save_addr =
|
||||
(volatile ulong *)(CFG_IMMR + CPM_BOOTCOUNT_ADDR);
|
||||
|
||||
save_addr[0] = a;
|
||||
save_addr[1] = BOOTCOUNT_MAGIC;
|
||||
}
|
||||
|
||||
ulong bootcount_load (void)
|
||||
{
|
||||
volatile ulong *save_addr =
|
||||
(volatile ulong *)(CFG_IMMR + CPM_BOOTCOUNT_ADDR);
|
||||
|
||||
if (save_addr[1] != BOOTCOUNT_MAGIC)
|
||||
return 0;
|
||||
else
|
||||
return save_addr[0];
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||
+1
-69
@@ -319,75 +319,7 @@ ProgramCheck:
|
||||
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
STD_EXCEPTION(0xd00, SingleStep, UnknownException)
|
||||
|
||||
STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
|
||||
|
||||
@@ -110,3 +110,29 @@ ulong post_word_load (void)
|
||||
}
|
||||
|
||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||
|
||||
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||
|
||||
void bootcount_store (ulong a)
|
||||
{
|
||||
volatile ulong *save_addr =
|
||||
(volatile ulong *)( ((immap_t *) CFG_IMMR)->im_cpm.cp_dpmem +
|
||||
CPM_BOOTCOUNT_ADDR );
|
||||
|
||||
save_addr[0] = a;
|
||||
save_addr[1] = BOOTCOUNT_MAGIC;
|
||||
}
|
||||
|
||||
ulong bootcount_load (void)
|
||||
{
|
||||
volatile ulong *save_addr =
|
||||
(volatile ulong *)( ((immap_t *) CFG_IMMR)->im_cpm.cp_dpmem +
|
||||
CPM_BOOTCOUNT_ADDR );
|
||||
|
||||
if (save_addr[1] != BOOTCOUNT_MAGIC)
|
||||
return 0;
|
||||
else
|
||||
return save_addr[0];
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||
+43
-10
@@ -42,12 +42,23 @@
|
||||
static char *cpu_warning = "\n " \
|
||||
"*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***";
|
||||
|
||||
#if ((defined(CONFIG_MPC860) || defined(CONFIG_MPC855)) && \
|
||||
#if ((defined(CONFIG_MPC86x) || defined(CONFIG_MPC855)) && \
|
||||
!defined(CONFIG_MPC862))
|
||||
# ifdef CONFIG_MPC855
|
||||
|
||||
# if defined(CONFIG_MPC855)
|
||||
# define ID_STR "PC855"
|
||||
# elif defined(CONFIG_MPC852T)
|
||||
# define ID_STR "PC852T"
|
||||
# elif defined(CONFIG_MPC859T)
|
||||
# define ID_STR "PC859T"
|
||||
# elif defined(CONFIG_MPC859DSL)
|
||||
# define ID_STR "PC859DSL"
|
||||
# elif defined(CONFIG_MPC860P)
|
||||
# define ID_STR "PC860P"
|
||||
# elif defined(CONFIG_MPC866T)
|
||||
# define ID_STR "PC866T"
|
||||
# else
|
||||
# define ID_STR "PC860"
|
||||
# define ID_STR "PC86x" /* unknown 86x chip */
|
||||
# endif
|
||||
|
||||
static int check_CPU (long clock, uint pvr, uint immr)
|
||||
@@ -68,6 +79,10 @@ static int check_CPU (long clock, uint pvr, uint immr)
|
||||
m = 0;
|
||||
|
||||
switch (k) {
|
||||
#ifdef CONFIG_MPC866_et_al
|
||||
/* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
|
||||
case 0x08000003: pre = 'M'; suf = ""; m = 1; break;
|
||||
#else
|
||||
case 0x00020001: pre = 'p'; suf = ""; break;
|
||||
case 0x00030001: suf = ""; break;
|
||||
case 0x00120003: suf = "A"; break;
|
||||
@@ -76,17 +91,17 @@ static int check_CPU (long clock, uint pvr, uint immr)
|
||||
case 0x00200004: suf = "B"; break;
|
||||
|
||||
case 0x00300004: suf = "C"; break;
|
||||
case 0x00310004: suf = "C1"; m = 1;
|
||||
break;
|
||||
case 0x00310004: suf = "C1"; m = 1; break;
|
||||
|
||||
case 0x00200064: mid = "SR"; suf = "B"; break;
|
||||
case 0x00300065: mid = "SR"; suf = "C"; break;
|
||||
case 0x00310065: mid = "SR"; suf = "C1"; m = 1; break;
|
||||
case 0x05010000: suf = "D3"; m = 1; break;
|
||||
case 0x05020000: suf = "D4"; m = 1; break;
|
||||
|
||||
case 0x08000003: suf = ""; m = 1; break;
|
||||
/* this value is not documented anywhere */
|
||||
case 0x40000000: pre = 'P'; suf = "D"; m = 1; break;
|
||||
#endif
|
||||
|
||||
default: suf = NULL; break;
|
||||
}
|
||||
@@ -101,7 +116,7 @@ static int check_CPU (long clock, uint pvr, uint immr)
|
||||
printf (" %u kB I-Cache", checkicache () >> 10);
|
||||
printf (" %u kB D-Cache", checkdcache () >> 10);
|
||||
|
||||
/* lets check and see if we're running on a 860T (or P?) */
|
||||
/* do we have a FEC (860T/P or 852/859/866)? */
|
||||
|
||||
immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
|
||||
if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
|
||||
@@ -114,6 +129,12 @@ static int check_CPU (long clock, uint pvr, uint immr)
|
||||
|
||||
putc ('\n');
|
||||
|
||||
#ifdef DEBUG
|
||||
if(clock != measure_gclk()) {
|
||||
printf ("clock %ldHz != %dHz\n", clock, measure_gclk());
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -316,7 +337,7 @@ int checkicache (void)
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
u32 cacheon = rd_ic_cst () & IDC_ENABLED;
|
||||
|
||||
#ifdef CONFIG_IP860
|
||||
#ifdef CONFIG_IP86x
|
||||
u32 k = memctl->memc_br1 & ~0x00007fff; /* probe in flash memoryarea */
|
||||
#else
|
||||
u32 k = memctl->memc_br0 & ~0x00007fff; /* probe in flash memoryarea */
|
||||
@@ -363,7 +384,7 @@ int checkdcache (void)
|
||||
volatile memctl8xx_t *memctl = &immap->im_memctl;
|
||||
u32 cacheon = rd_dc_cst () & IDC_ENABLED;
|
||||
|
||||
#ifdef CONFIG_IP860
|
||||
#ifdef CONFIG_IP86x
|
||||
u32 k = memctl->memc_br1 & ~0x00007fff; /* probe in flash memoryarea */
|
||||
#else
|
||||
u32 k = memctl->memc_br0 & ~0x00007fff; /* probe in flash memoryarea */
|
||||
@@ -462,8 +483,20 @@ unsigned long get_tbclk (void)
|
||||
if (immr->im_clkrst.car_sccr & SCCR_TBS) {
|
||||
return (gd->cpu_clk / 16);
|
||||
}
|
||||
#define PLPRCR_val(a) (((CFG_PLPRCR) & PLPRCR_ ## a ## _MSK) >> PLPRCR_ ## a ## _SHIFT)
|
||||
#ifdef CONFIG_MPC866_et_al
|
||||
/* MFN
|
||||
MFI + -------
|
||||
MFD + 1
|
||||
factor = -----------------
|
||||
(PDF + 1) * 2^S
|
||||
*/
|
||||
|
||||
factor = (((CFG_PLPRCR) & PLPRCR_MF_MSK) >> PLPRCR_MF_SHIFT) + 1;
|
||||
factor = (PLPRCR_val(MFI) + PLPRCR_val(MFN)/(PLPRCR_val(MFD)+1))/
|
||||
(PLPRCR_val(PDF)+1) / (1<<PLPRCR_val(S));
|
||||
#else
|
||||
factor = PLPRCR_val(MF)+1;
|
||||
#endif
|
||||
|
||||
oscclk = gd->cpu_clk / factor;
|
||||
|
||||
|
||||
@@ -132,7 +132,8 @@ void cpu_init_f (volatile immap_t * immr)
|
||||
* I owe him a free beer. - wd]
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_GTH) || \
|
||||
#if defined(CONFIG_ADDERII) || \
|
||||
defined(CONFIG_GTH) || \
|
||||
defined(CONFIG_HERMES) || \
|
||||
defined(CONFIG_ICU862) || \
|
||||
defined(CONFIG_IP860) || \
|
||||
@@ -145,6 +146,7 @@ void cpu_init_f (volatile immap_t * immr)
|
||||
defined(CONFIG_RPXCLASSIC) || \
|
||||
defined(CONFIG_RPXLITE) || \
|
||||
defined(CONFIG_SPD823TS) || \
|
||||
defined(CONFIG_MPC86xADS) || \
|
||||
(defined(CONFIG_MPC860T) && defined(CONFIG_FADS))
|
||||
|
||||
memctl->memc_br0 = CFG_BR0_PRELIM;
|
||||
|
||||
+2
-1
@@ -217,7 +217,8 @@ static int fec_init(struct eth_device* dev, bd_t * bd)
|
||||
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
volatile fec_t *fecp = &(immr->im_cpm.cp_fec);
|
||||
|
||||
#if defined(CONFIG_FADS) && defined(CONFIG_MPC860T)
|
||||
#if defined(CONFIG_FADS) && \
|
||||
( defined(CONFIG_MPC860T) || defined(CONFIG_MPC866_et_al) )
|
||||
/* configure FADS for fast (FEC) ethernet, half-duplex */
|
||||
/* The LXT970 needs about 50ms to recover from reset, so
|
||||
* wait for it by discovering the PHY before leaving eth_init().
|
||||
|
||||
@@ -334,7 +334,11 @@ void timer_interrupt (struct pt_regs *regs)
|
||||
/* Reset Timer Expired and Timers Interrupt Status */
|
||||
immr->im_clkrstk.cark_plprcrk = KAPWR_KEY;
|
||||
__asm__ ("nop");
|
||||
#ifdef CONFIG_MPC866_et_al
|
||||
immr->im_clkrst.car_plprcr |= PLPRCR_TEXPS;
|
||||
#else
|
||||
immr->im_clkrst.car_plprcr |= PLPRCR_TEXPS | PLPRCR_TMIST;
|
||||
#endif
|
||||
/* Restore Decrementer Count */
|
||||
set_dec (decrementer_count);
|
||||
|
||||
|
||||
+4
-4
@@ -61,9 +61,9 @@
|
||||
/* ** BITMAP DISPLAY SUPPORT -- should probably be moved elsewhere */
|
||||
/************************************************************************/
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
|
||||
#include <bmp_layout.h>
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
|
||||
|
||||
/************************************************************************/
|
||||
/* ** FONT AND LOGO DATA */
|
||||
@@ -1176,7 +1176,7 @@ static void bitmap_plot (int x, int y)
|
||||
}
|
||||
#endif /* CONFIG_LCD_LOGO */
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP)
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
|
||||
/*
|
||||
* Display the BMP file located at address bmp_image.
|
||||
* Only uncompressed
|
||||
@@ -1273,7 +1273,7 @@ int lcd_display_bitmap(ulong bmp_image)
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
+3
-3
@@ -192,9 +192,9 @@ static int scc_init(struct eth_device* dev, bd_t *bis)
|
||||
|
||||
volatile immap_t *immr = (immap_t *)CFG_IMMR;
|
||||
|
||||
#if defined(CONFIG_FADS)
|
||||
#if defined(CONFIG_MPC860T)
|
||||
/* The FADS860T doesn't use the MODEM_EN or DATA_VOICE signals. */
|
||||
#ifdef CONFIG_FADS
|
||||
#if defined(CONFIG_MPC86xADS) || defined(CONFIG_MPC860T)
|
||||
/* The MPC86xADS/FADS860T don't use the MODEM_EN or DATA_VOICE signals. */
|
||||
*((uint *) BCSR4) &= ~BCSR4_ETHLOOP;
|
||||
*((uint *) BCSR4) |= BCSR4_TFPLDL|BCSR4_TPSQEL;
|
||||
*((uint *) BCSR1) &= ~BCSR1_ETHEN;
|
||||
|
||||
+19
-9
@@ -68,6 +68,23 @@
|
||||
#error "console not correctly defined"
|
||||
#endif
|
||||
|
||||
static void serial_setdivisor(volatile cpm8xx_t *cp)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
int divisor=gd->cpu_clk/16/gd->baudrate;
|
||||
|
||||
if(divisor/16>0x1000) {
|
||||
/* bad divisor, assume 50Mhz clock and 9600 baud */
|
||||
divisor=(50*1000*1000)/16/9600;
|
||||
}
|
||||
|
||||
if(divisor<=0x1000) {
|
||||
cp->cp_brgc1=((divisor-1)<<1) | CPM_BRG_EN;
|
||||
} else {
|
||||
cp->cp_brgc1=((divisor/16-1)<<1) | CPM_BRG_EN | CPM_BRG_DIV16;
|
||||
}
|
||||
}
|
||||
|
||||
#if (defined (CONFIG_8xx_CONS_SMC1) || defined (CONFIG_8xx_CONS_SMC2))
|
||||
|
||||
/*
|
||||
@@ -229,8 +246,6 @@ int serial_init (void)
|
||||
void
|
||||
serial_setbrg (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
volatile immap_t *im = (immap_t *)CFG_IMMR;
|
||||
volatile cpm8xx_t *cp = &(im->im_cpm);
|
||||
|
||||
@@ -242,8 +257,7 @@ serial_setbrg (void)
|
||||
|
||||
cp->cp_simode = 0x00000000;
|
||||
|
||||
cp->cp_brgc1 =
|
||||
(((gd->cpu_clk / 16 / gd->baudrate)-1) << 1) | CPM_BRG_EN;
|
||||
serial_setdivisor(cp);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
@@ -506,8 +520,6 @@ int serial_init (void)
|
||||
void
|
||||
serial_setbrg (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
volatile immap_t *im = (immap_t *)CFG_IMMR;
|
||||
volatile cpm8xx_t *cp = &(im->im_cpm);
|
||||
|
||||
@@ -518,10 +530,8 @@ serial_setbrg (void)
|
||||
*/
|
||||
|
||||
cp->cp_sicr &= ~(0x000000FF << (8 * SCC_INDEX));
|
||||
/* no |= needed, since BRG1 is 000 */
|
||||
|
||||
cp->cp_brgc1 =
|
||||
(((gd->cpu_clk / 16 / gd->baudrate)-1) << 1) | CPM_BRG_EN;
|
||||
serial_setdivisor(cp);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+27
-8
@@ -32,7 +32,6 @@
|
||||
#define SPEED_PITC ((SPEED_PIT_COUNTS - 1) << PITC_SHIFT)
|
||||
#define SPEED_PITC_INIT ((SPEED_PIT_COUNTS + 1) << PITC_SHIFT)
|
||||
|
||||
#if !defined(CONFIG_8xx_GCLK_FREQ)
|
||||
/* Access functions for the Machine State Register */
|
||||
static __inline__ unsigned long get_msr(void)
|
||||
{
|
||||
@@ -46,7 +45,6 @@ static __inline__ void set_msr(unsigned long msr)
|
||||
{
|
||||
asm volatile("mtmsr %0" : : "r" (msr));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -83,16 +81,20 @@ static __inline__ void set_msr(unsigned long msr)
|
||||
* CPU clock that is an even multiple of 0.1 MHz.
|
||||
*/
|
||||
|
||||
int get_clocks (void)
|
||||
unsigned long measure_gclk(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
#ifndef CONFIG_8xx_GCLK_FREQ
|
||||
volatile cpmtimer8xx_t *timerp = &immr->im_cpmtimer;
|
||||
ulong timer2_val;
|
||||
ulong msr_val;
|
||||
|
||||
#ifdef CONFIG_MPC866_et_al
|
||||
/* dont use OSCM, only use EXTCLK/512 */
|
||||
immr->im_clkrst.car_sccr |= SCCR_RTSEL | SCCR_RTDIV;
|
||||
#else
|
||||
immr->im_clkrst.car_sccr &= ~(SCCR_RTSEL | SCCR_RTDIV);
|
||||
#endif
|
||||
|
||||
/* Reset + Stop Timer 2, no cascading
|
||||
*/
|
||||
timerp->cpmt_tgcr &= ~(TGCR_CAS2 | TGCR_RST2);
|
||||
@@ -158,10 +160,27 @@ int get_clocks (void)
|
||||
timerp->cpmt_tgcr &= ~(TGCR_RST2 | TGCR_FRZ2 | TGCR_STP2);
|
||||
immr->im_sit.sit_piscr &= ~PISCR_PTE;
|
||||
|
||||
gd->cpu_clk = ((timer2_val + 2) / 4) * 100000L; /* convert to Hz */
|
||||
#ifdef CONFIG_MPC866_et_al
|
||||
/* not using OSCM, using XIN, so scale appropriately */
|
||||
return (((timer2_val + 2) / 4) * (CFG_8XX_XIN/512))/8192 * 100000L;
|
||||
#else
|
||||
return ((timer2_val + 2) / 4) * 100000L; /* convert to Hz */
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* get_clocks() fills in gd->cpu_clock depending on CONFIG_8xx_GCLK_FREQ
|
||||
* or (if it is not defined) measure_gclk() (which uses the ref clock)
|
||||
* from above.
|
||||
*/
|
||||
int get_clocks (void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||
#ifndef CONFIG_8xx_GCLK_FREQ
|
||||
gd->cpu_clk = measure_gclk();
|
||||
#else /* CONFIG_8xx_GCLK_FREQ */
|
||||
|
||||
/*
|
||||
* If for some reason measuring the gclk frequency won't
|
||||
* work, we return the hardwired value.
|
||||
|
||||
+1
-81
@@ -76,9 +76,6 @@
|
||||
GOT_ENTRY(__init_end)
|
||||
GOT_ENTRY(_end)
|
||||
GOT_ENTRY(__bss_start)
|
||||
#if defined(CONFIG_FADS) || defined(CONFIG_ICU862)
|
||||
GOT_ENTRY(environment)
|
||||
#endif
|
||||
END_GOT
|
||||
|
||||
/*
|
||||
@@ -266,75 +263,7 @@ ProgramCheck:
|
||||
STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
STD_EXCEPTION(0xd00, SingleStep, UnknownException)
|
||||
|
||||
STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
|
||||
@@ -685,16 +614,7 @@ clear_bss:
|
||||
* Now clear BSS segment
|
||||
*/
|
||||
lwz r3,GOT(__bss_start)
|
||||
#if defined(CONFIG_FADS) || defined(CONFIG_ICU862)
|
||||
/*
|
||||
* For the FADS - the environment is the very last item in flash.
|
||||
* The real .bss stops just before environment starts, so only
|
||||
* clear up to that point.
|
||||
*/
|
||||
lwz r4,GOT(environment)
|
||||
#else
|
||||
lwz r4,GOT(_end)
|
||||
#endif
|
||||
|
||||
cmplw 0, r3, r4
|
||||
beq 6f
|
||||
|
||||
+1
-69
@@ -769,75 +769,7 @@ ProgramCheck:
|
||||
STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
|
||||
STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
|
||||
STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
|
||||
|
||||
. = 0xc00
|
||||
/*
|
||||
* r0 - SYSCALL number
|
||||
* r3-... arguments
|
||||
*/
|
||||
SystemCall:
|
||||
addis r11,r0,0 /* get functions table addr */
|
||||
ori r11,r11,0 /* Note: this code is patched in trap_init */
|
||||
addis r12,r0,0 /* get number of functions */
|
||||
ori r12,r12,0
|
||||
|
||||
cmplw 0, r0, r12
|
||||
bge 1f
|
||||
|
||||
rlwinm r0,r0,2,0,31 /* fn_addr = fn_tbl[r0] */
|
||||
add r11,r11,r0
|
||||
lwz r11,0(r11)
|
||||
|
||||
li r20,0xd00-4 /* Get stack pointer */
|
||||
lwz r12,0(r20)
|
||||
subi r12,r12,12 /* Adjust stack pointer */
|
||||
li r0,0xc00+_end_back-SystemCall
|
||||
cmplw 0, r0, r12 /* Check stack overflow */
|
||||
bgt 1f
|
||||
stw r12,0(r20)
|
||||
|
||||
mflr r0
|
||||
stw r0,0(r12)
|
||||
mfspr r0,SRR0
|
||||
stw r0,4(r12)
|
||||
mfspr r0,SRR1
|
||||
stw r0,8(r12)
|
||||
|
||||
li r12,0xc00+_back-SystemCall
|
||||
mtlr r12
|
||||
mtspr SRR0,r11
|
||||
|
||||
1: SYNC
|
||||
rfi
|
||||
|
||||
_back:
|
||||
|
||||
mfmsr r11 /* Disable interrupts */
|
||||
li r12,0
|
||||
ori r12,r12,MSR_EE
|
||||
andc r11,r11,r12
|
||||
SYNC /* Some chip revs need this... */
|
||||
mtmsr r11
|
||||
SYNC
|
||||
|
||||
li r12,0xd00-4 /* restore regs */
|
||||
lwz r12,0(r12)
|
||||
|
||||
lwz r11,0(r12)
|
||||
mtlr r11
|
||||
lwz r11,4(r12)
|
||||
mtspr SRR0,r11
|
||||
lwz r11,8(r12)
|
||||
mtspr SRR1,r11
|
||||
|
||||
addi r12,r12,12 /* Adjust stack pointer */
|
||||
li r20,0xd00-4
|
||||
stw r12,0(r20)
|
||||
|
||||
SYNC
|
||||
rfi
|
||||
_end_back:
|
||||
|
||||
STD_EXCEPTION(0xc00, SystemCall, UnknownException)
|
||||
STD_EXCEPTION(0xd00, SingleStep, UnknownException)
|
||||
|
||||
STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
|
||||
|
||||
@@ -41,4 +41,18 @@ to install a U-Boot image into flash.
|
||||
go 0xb0000000
|
||||
|
||||
|
||||
|
||||
Ethernet autonegotiation needs some time to complete. Instead of
|
||||
delaying the boot process in all cases, we just start the
|
||||
autonegotiation process when U-Boot comes up and that is all. Most
|
||||
likely, it will complete by the time the network transfer is
|
||||
attempted for the first time. In the worst case, if a transfer is
|
||||
attempted before the autonegotiation is complete, just a single
|
||||
packet would be lost resulting in a single timeout error, and then
|
||||
the transfer would proceed normally. So the time that we would have
|
||||
lost unconditionally waiting for the autonegotiation to complete, we
|
||||
have to wait only if the file transfer is started immediately after
|
||||
reset. We've verified that this works for all the clock
|
||||
configurations.
|
||||
|
||||
(C) 2003 Wolfgang Denk
|
||||
@@ -0,0 +1,57 @@
|
||||
LYNX KDI SUPPORT
|
||||
|
||||
Last Update: July 20, 2003
|
||||
=======================================================================
|
||||
|
||||
This file describes support for LynuxWorks KDI within U-Boot. Support
|
||||
is enabled by defining CONFIG_LYNXKDI.
|
||||
|
||||
|
||||
LYNXOS AND BLUECAT SUPPORTED
|
||||
============================
|
||||
Both LynxOS and BlueCat linux KDIs are supported. The implementation
|
||||
automatically detects which is being booted. When you use mkimage
|
||||
you should specify "lynxos" for both (see target-specific notes).
|
||||
|
||||
|
||||
SUPPORTED ARCHITECTURE/TARGETS
|
||||
==============================
|
||||
The following targets have been tested:
|
||||
|
||||
-PowerPC MPC8260ADS
|
||||
|
||||
|
||||
FILES TO LOOK AT
|
||||
================
|
||||
include/lynxkdi.h -defines a simple struct passed to a kdi.
|
||||
common/lynxkdi.c -implements the call to the kdi.
|
||||
common/cmd_bootm.c -top-level command implementation ("bootm").
|
||||
|
||||
|
||||
====================================================================
|
||||
TARGET SPECIFIC NOTES
|
||||
====================================================================
|
||||
|
||||
MPC8260ADS
|
||||
===========
|
||||
The default LynxOS and BlueCat implementations require some
|
||||
modifications to the config file.
|
||||
|
||||
Edit include/configs/MPC8260ADS.h to use the following:
|
||||
|
||||
#define CFG_IMMR 0xFA200000
|
||||
#define CFG_BCSR 0xFA100000
|
||||
#define CFG_BR1_PRELIM 0xFA101801
|
||||
|
||||
When creating a LynxOS or BlueCat u-boot image using mkimage,
|
||||
you must specify the following:
|
||||
|
||||
Both: -A ppc -O lynxos -T kernel -C none
|
||||
LynxOS: -a 0x00004000 -e 0x00004020
|
||||
BlueCat: -a 0x00500000 -e 0x00507000
|
||||
|
||||
To pass the MAC address to BlueCat you should define the
|
||||
"fcc2_ether_addr" parameter in the "bootargs" environment
|
||||
variable. E.g.:
|
||||
|
||||
==> setenv bootargs fcc2_ether_addr=00:11:22:33:44:55:66
|
||||
Loaded 100 of 211 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user