Compare commits
103 Commits
v1.3.2-rc1
...
v1.3.2-rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
661bad63a0 | ||
|
|
76957cb3d6 | ||
|
|
118978c8eb | ||
|
|
ce1120dd70 | ||
|
|
5013c09f7a | ||
|
|
ffda586fc1 | ||
|
|
f655adef65 | ||
|
|
093e14c522 | ||
|
|
5f91db7f58 | ||
|
|
44b4dbed41 | ||
|
|
a8b7e47625 | ||
|
|
4fae35a53b | ||
|
|
60ec654c5e | ||
|
|
c313b2c6c5 | ||
|
|
24ae0d1728 | ||
|
|
2f6e76d23c | ||
|
|
44ceec253e | ||
|
|
f3a329acb2 | ||
|
|
217bf6b6a3 | ||
|
|
5599c28cef | ||
|
|
c9bcf75fec | ||
|
|
f8fa6368a6 | ||
|
|
2b22fa4bae | ||
|
|
534ea6b6f8 | ||
|
|
21fae8b2b4 | ||
|
|
347b7938d3 | ||
|
|
495d162374 | ||
|
|
33fa5c0bfa | ||
|
|
64cd594e62 | ||
|
|
14e099e698 | ||
|
|
724902c846 | ||
|
|
4cd288b589 | ||
|
|
b29661fc11 | ||
|
|
00b48a4842 | ||
|
|
b075d74efb | ||
|
|
208acd112e | ||
|
|
495a0dde7f | ||
|
|
e682ba399a | ||
|
|
02409f8cf5 | ||
|
|
e5084af8de | ||
|
|
d01b847c5c | ||
|
|
5a910c224b | ||
|
|
79eac2bfb5 | ||
|
|
2e721094a7 | ||
|
|
bc77881247 | ||
|
|
6a2dcaf1ee | ||
|
|
45d65b7f28 | ||
|
|
239c885802 | ||
|
|
55c802ebb1 | ||
|
|
5a9abcc317 | ||
|
|
81d93e5c4b | ||
|
|
755c35f54b | ||
|
|
16fe77752e | ||
|
|
019895a8de | ||
|
|
98ba144ccc | ||
|
|
e845e07e1e | ||
|
|
beeccf7a5d | ||
|
|
edfed1d91d | ||
|
|
f65c98129c | ||
|
|
1ba639da56 | ||
|
|
e7a85f2683 | ||
|
|
928d1d77f8 | ||
|
|
d5908b0939 | ||
|
|
a551cee99a | ||
|
|
cb06eb961b | ||
|
|
4d264eff43 | ||
|
|
c54f9263e4 | ||
|
|
975a083a5e | ||
|
|
13f5433f70 | ||
|
|
04efddc87c | ||
|
|
83d1b38766 | ||
|
|
b6f29c84c2 | ||
|
|
0937b8d869 | ||
|
|
64d792063f | ||
|
|
375c4353db | ||
|
|
b738654d3c | ||
|
|
ef5b4f221c | ||
|
|
74973126d1 | ||
|
|
8cc10d06b8 | ||
|
|
214398d9cb | ||
|
|
5db6138565 | ||
|
|
30c6a241e8 | ||
|
|
5561857aae | ||
|
|
faf8f9bc95 | ||
|
|
d7d9afa48c | ||
|
|
ae92069abe | ||
|
|
e42d2b0479 | ||
|
|
45da195cf6 | ||
|
|
94a78da26c | ||
|
|
6523010702 | ||
|
|
6d0943a6be | ||
|
|
ea8d989f4e | ||
|
|
9604b6e53d | ||
|
|
64e8a06af6 | ||
|
|
7263ef191b | ||
|
|
6afcabf11d | ||
|
|
fefb6c1092 | ||
|
|
fa506a926c | ||
|
|
20b197c6f2 | ||
|
|
d49fe4bed5 | ||
|
|
a6cdd21b56 | ||
|
|
ea686f52e4 | ||
|
|
f4e7cbfcb0 |
19
CREDITS
19
CREDITS
@@ -391,6 +391,10 @@ E: dan.poirot@windriver.com
|
|||||||
D: Support for the Wind River sbc405, sbc8240 board
|
D: Support for the Wind River sbc405, sbc8240 board
|
||||||
W: http://www.windriver.com
|
W: http://www.windriver.com
|
||||||
|
|
||||||
|
N: Stelian Pop
|
||||||
|
E: stelian.pop@leadtechdesign.com
|
||||||
|
D: Atmel AT91CAP9ADK support
|
||||||
|
|
||||||
N: Stefan Roese
|
N: Stefan Roese
|
||||||
E: sr@denx.de
|
E: sr@denx.de
|
||||||
D: AMCC PPC4xx Support
|
D: AMCC PPC4xx Support
|
||||||
@@ -509,3 +513,18 @@ N: Nobuhiro Iwamatsu
|
|||||||
E: iwamatsu@nigauri.org
|
E: iwamatsu@nigauri.org
|
||||||
D: Support for SuperH, MS7750SE01 and MS7722SE01 boards.
|
D: Support for SuperH, MS7750SE01 and MS7722SE01 boards.
|
||||||
W: http://www.nigauri.org/~iwamatsu/
|
W: http://www.nigauri.org/~iwamatsu/
|
||||||
|
|
||||||
|
N: Alan Lu
|
||||||
|
E: alnalu001@gmail.com
|
||||||
|
D: Support for Artila M-501 starter kit
|
||||||
|
W: http://www.artila.com/
|
||||||
|
|
||||||
|
N: Kimmo Leppala
|
||||||
|
E: kimmo.leppala@sysart.fi
|
||||||
|
D: Support for Artila M-501 starter kit
|
||||||
|
W: http://www.sysart.fi/
|
||||||
|
|
||||||
|
N: Timo Tuunainen
|
||||||
|
E: timo.tuunainen@sysart.fi
|
||||||
|
D: Support for Artila M-501 starter kit
|
||||||
|
W: http://www.sysart.fi/
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ Travis Sawyer (travis.sawyer@sandburst.com>
|
|||||||
|
|
||||||
Heiko Schocher <hs@denx.de>
|
Heiko Schocher <hs@denx.de>
|
||||||
|
|
||||||
ids8247 MPC8272
|
ids8247 MPC8247
|
||||||
jupiter MPC5200
|
jupiter MPC5200
|
||||||
mgcoge MPC8247
|
mgcoge MPC8247
|
||||||
mgsuvd MPC852
|
mgsuvd MPC852
|
||||||
|
|||||||
2
MAKEALL
2
MAKEALL
@@ -446,6 +446,7 @@ LIST_ARM7=" \
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
LIST_ARM9=" \
|
LIST_ARM9=" \
|
||||||
|
at91cap9adk \
|
||||||
at91rm9200dk \
|
at91rm9200dk \
|
||||||
cmc_pu2 \
|
cmc_pu2 \
|
||||||
ap920t \
|
ap920t \
|
||||||
@@ -459,6 +460,7 @@ LIST_ARM9=" \
|
|||||||
cp946es \
|
cp946es \
|
||||||
cp966 \
|
cp966 \
|
||||||
lpd7a400 \
|
lpd7a400 \
|
||||||
|
m501sk \
|
||||||
mp2usb \
|
mp2usb \
|
||||||
mx1ads \
|
mx1ads \
|
||||||
mx1fs2 \
|
mx1fs2 \
|
||||||
|
|||||||
92
Makefile
92
Makefile
@@ -24,7 +24,7 @@
|
|||||||
VERSION = 1
|
VERSION = 1
|
||||||
PATCHLEVEL = 3
|
PATCHLEVEL = 3
|
||||||
SUBLEVEL = 2
|
SUBLEVEL = 2
|
||||||
EXTRAVERSION = -rc1
|
EXTRAVERSION = -rc3
|
||||||
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
|
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
|
||||||
VERSION_FILE = $(obj)include/version_autogenerated.h
|
VERSION_FILE = $(obj)include/version_autogenerated.h
|
||||||
|
|
||||||
@@ -118,6 +118,9 @@ src :=
|
|||||||
endif
|
endif
|
||||||
export obj src
|
export obj src
|
||||||
|
|
||||||
|
# Make sure CDPATH settings don't interfere
|
||||||
|
unexport CDPATH
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
|
ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
|
||||||
@@ -244,7 +247,7 @@ LIBS += libfdt/libfdt.a
|
|||||||
LIBS += api/libapi.a
|
LIBS += api/libapi.a
|
||||||
|
|
||||||
LIBS := $(addprefix $(obj),$(LIBS))
|
LIBS := $(addprefix $(obj),$(LIBS))
|
||||||
.PHONY : $(LIBS)
|
.PHONY : $(LIBS) $(VERSION_FILE)
|
||||||
|
|
||||||
# Add GCC lib
|
# Add GCC lib
|
||||||
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||||
@@ -326,6 +329,9 @@ $(LIBS): depend $(obj)include/autoconf.mk
|
|||||||
$(SUBDIRS): depend $(obj)include/autoconf.mk
|
$(SUBDIRS): depend $(obj)include/autoconf.mk
|
||||||
$(MAKE) -C $@ all
|
$(MAKE) -C $@ all
|
||||||
|
|
||||||
|
$(LDSCRIPT): depend $(obj)include/autoconf.mk
|
||||||
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
||||||
|
|
||||||
$(NAND_SPL): $(VERSION_FILE) $(obj)include/autoconf.mk
|
$(NAND_SPL): $(VERSION_FILE) $(obj)include/autoconf.mk
|
||||||
$(MAKE) -C nand_spl/board/$(BOARDDIR) all
|
$(MAKE) -C nand_spl/board/$(BOARDDIR) all
|
||||||
|
|
||||||
@@ -397,6 +403,10 @@ tags ctags:
|
|||||||
etags:
|
etags:
|
||||||
etags -a -o $(obj)etags `find $(SUBDIRS) $(TAG_SUBDIRS) \
|
etags -a -o $(obj)etags `find $(SUBDIRS) $(TAG_SUBDIRS) \
|
||||||
-name '*.[ch]' -print`
|
-name '*.[ch]' -print`
|
||||||
|
cscope:
|
||||||
|
find $(SUBDIRS) $(TAG_SUBDIRS) -name '*.[ch]' -print \
|
||||||
|
> cscope.files
|
||||||
|
cscope -b -q -k
|
||||||
|
|
||||||
$(obj)System.map: $(obj)u-boot
|
$(obj)System.map: $(obj)u-boot
|
||||||
@$(NM) $< | \
|
@$(NM) $< | \
|
||||||
@@ -411,6 +421,7 @@ $(obj)System.map: $(obj)u-boot
|
|||||||
# to regenerate the autoconf.mk file.
|
# to regenerate the autoconf.mk file.
|
||||||
$(obj)include/autoconf.mk: $(obj)include/config.h $(VERSION_FILE)
|
$(obj)include/autoconf.mk: $(obj)include/config.h $(VERSION_FILE)
|
||||||
@$(XECHO) Generating include/autoconf.mk ; \
|
@$(XECHO) Generating include/autoconf.mk ; \
|
||||||
|
set -e ; \
|
||||||
: Generate the dependancies ; \
|
: Generate the dependancies ; \
|
||||||
$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep ; \
|
$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep ; \
|
||||||
: Extract the config macros ; \
|
: Extract the config macros ; \
|
||||||
@@ -423,7 +434,7 @@ else # !config.mk
|
|||||||
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
|
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
|
||||||
$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
|
$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
|
||||||
$(SUBDIRS) $(VERSION_FILE) gdbtools updater env depend \
|
$(SUBDIRS) $(VERSION_FILE) gdbtools updater env depend \
|
||||||
dep tags ctags etags $(obj)System.map:
|
dep tags ctags etags cscope $(obj)System.map:
|
||||||
@echo "System not configured - see README" >&2
|
@echo "System not configured - see README" >&2
|
||||||
@ exit 1
|
@ exit 1
|
||||||
endif # config.mk
|
endif # config.mk
|
||||||
@@ -729,8 +740,15 @@ motionpro_config: unconfig
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
## MPC512x Systems
|
## MPC512x Systems
|
||||||
#########################################################################
|
#########################################################################
|
||||||
ads5121_config: unconfig
|
ads5121_config \
|
||||||
@$(MKCONFIG) ads5121 ppc mpc512x ads5121
|
ads5121_PCI_config \
|
||||||
|
: unconfig
|
||||||
|
@echo "" >$(obj)include/config.h
|
||||||
|
@if [ "$(findstring _PCI_,$@)" ] ; then \
|
||||||
|
echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
|
||||||
|
$(XECHO) "... with PCI enabled" ; \
|
||||||
|
fi
|
||||||
|
@$(MKCONFIG) -a ads5121 ppc mpc512x ads5121
|
||||||
|
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
@@ -1921,7 +1939,7 @@ M5485HFE_config : unconfig
|
|||||||
M5485EFE_config) BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
|
M5485EFE_config) BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
|
||||||
M5485FFE_config) BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
|
M5485FFE_config) BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
|
||||||
M5485GFE_config) BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
|
M5485GFE_config) BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
|
||||||
M5485HFE_config) BOOT=2;CODE=;VID=1;USB=0;RAM=64;RAM1=0;; \
|
M5485HFE_config) BOOT=2;CODE=16;VID=1;USB=0;RAM=64;RAM1=0;; \
|
||||||
esac; \
|
esac; \
|
||||||
>include/config.h ; \
|
>include/config.h ; \
|
||||||
echo "#define CFG_BUSCLK 100000000" > $(obj)include/config.h ; \
|
echo "#define CFG_BUSCLK 100000000" > $(obj)include/config.h ; \
|
||||||
@@ -2310,8 +2328,11 @@ xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$
|
|||||||
|
|
||||||
xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
|
xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
|
||||||
|
|
||||||
|
at91cap9adk_config : unconfig
|
||||||
|
@$(MKCONFIG) $(@:_config=) arm arm926ejs at91cap9adk atmel at91cap9
|
||||||
|
|
||||||
at91rm9200dk_config : unconfig
|
at91rm9200dk_config : unconfig
|
||||||
@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk NULL at91rm9200
|
@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
|
||||||
|
|
||||||
cmc_pu2_config : unconfig
|
cmc_pu2_config : unconfig
|
||||||
@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
|
@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
|
||||||
@@ -2322,6 +2343,8 @@ csb637_config : unconfig
|
|||||||
mp2usb_config : unconfig
|
mp2usb_config : unconfig
|
||||||
@$(MKCONFIG) $(@:_config=) arm arm920t mp2usb NULL at91rm9200
|
@$(MKCONFIG) $(@:_config=) arm arm920t mp2usb NULL at91rm9200
|
||||||
|
|
||||||
|
m501sk_config : unconfig
|
||||||
|
@$(MKCONFIG) $(@:_config=) arm arm920t m501sk NULL at91rm9200
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
## ARM Integrator boards - see doc/README-integrator for more info.
|
## ARM Integrator boards - see doc/README-integrator for more info.
|
||||||
@@ -2362,17 +2385,8 @@ mx1ads_config : unconfig
|
|||||||
mx1fs2_config : unconfig
|
mx1fs2_config : unconfig
|
||||||
@$(MKCONFIG) $(@:_config=) arm arm920t mx1fs2 NULL imx
|
@$(MKCONFIG) $(@:_config=) arm arm920t mx1fs2 NULL imx
|
||||||
|
|
||||||
netstar_32_config \
|
|
||||||
netstar_config: unconfig
|
netstar_config: unconfig
|
||||||
@mkdir -p $(obj)include
|
@$(MKCONFIG) $(@:_config=) arm arm925t netstar
|
||||||
@if [ "$(findstring _32_,$@)" ] ; then \
|
|
||||||
$(XECHO) "... 32MB SDRAM" ; \
|
|
||||||
echo "#define PHYS_SDRAM_1_SIZE SZ_32M" >>$(obj)include/config.h ; \
|
|
||||||
else \
|
|
||||||
$(XECHO) "... 64MB SDRAM" ; \
|
|
||||||
echo "#define PHYS_SDRAM_1_SIZE SZ_64M" >>$(obj)include/config.h ; \
|
|
||||||
fi
|
|
||||||
@$(MKCONFIG) -a netstar arm arm925t netstar
|
|
||||||
|
|
||||||
omap1510inn_config : unconfig
|
omap1510inn_config : unconfig
|
||||||
@$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn
|
@$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn
|
||||||
@@ -2893,28 +2907,20 @@ clean:
|
|||||||
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
||||||
-o -name '*.o' -o -name '*.a' \) -print \
|
-o -name '*.o' -o -name '*.a' \) -print \
|
||||||
| xargs rm -f
|
| xargs rm -f
|
||||||
@rm -f $(obj)examples/hello_world $(obj)examples/timer \
|
@cd $(obj)examples/ && rm -f hello_world timer eepro100_eeprom sched \
|
||||||
$(obj)examples/eepro100_eeprom $(obj)examples/sched \
|
mem_to_mem_idma2intr 82559_eeprom smc91111_eeprom interrupt \
|
||||||
$(obj)examples/mem_to_mem_idma2intr $(obj)examples/82559_eeprom \
|
test_burst
|
||||||
$(obj)examples/smc91111_eeprom $(obj)examples/interrupt \
|
@cd $(obj)tools/ && rm -f bmp_logo easylogo/easylogo \
|
||||||
$(obj)examples/test_burst
|
env/{fw_printenv,fw_setenv} envcrc gdb/{astest,gdbcont,gdbsend} \
|
||||||
@rm -f $(obj)tools/img2srec $(obj)tools/mkimage $(obj)tools/envcrc \
|
gen_eth_addr img2srec mkimage mpc86x_clk ncb ubsha1
|
||||||
$(obj)tools/gen_eth_addr $(obj)tools/ubsha1
|
@cd $(obj)board/ && rm -f cray/L1/{bootscript.c,bootscript.image} \
|
||||||
@rm -f $(obj)tools/mpc86x_clk $(obj)tools/ncb
|
netstar/{eeprom,crcek,crcit,*.srec,*.bin} \
|
||||||
@rm -f $(obj)tools/easylogo/easylogo $(obj)tools/bmp_logo
|
trab/trab_fkt voiceblue/eeprom \
|
||||||
@rm -f $(obj)tools/gdb/astest $(obj)tools/gdb/gdbcont $(obj)tools/gdb/gdbsend
|
{integratorap,integratorcp}/u-boot.lds integratorcp/u-boot.lds \
|
||||||
@rm -f $(obj)tools/env/fw_printenv $(obj)tools/env/fw_setenv
|
{bf533-ezkit,bf533-stamp,bf537-stamp,bf561-ezkit}/u-boot.lds
|
||||||
@rm -f $(obj)board/cray/L1/bootscript.c $(obj)board/cray/L1/bootscript.image
|
@rm -f $(obj)include/bmp_logo.h $(obj)nand_spl/{u-boot-spl,u-boot-spl.map}
|
||||||
@rm -f $(obj)board/netstar/eeprom $(obj)board/netstar/crcek $(obj)board/netstar/crcit
|
@cd $(obj)onenand_ipl/ && rm -f onenand-ipl onenand-ipl.bin \
|
||||||
@rm -f $(obj)board/netstar/*.srec $(obj)board/netstar/*.bin
|
onenand-ipl-2k.bin onenand-ipl.map
|
||||||
@rm -f $(obj)board/trab/trab_fkt $(obj)board/voiceblue/eeprom
|
|
||||||
@rm -f $(obj)board/integratorap/u-boot.lds $(obj)board/integratorcp/u-boot.lds
|
|
||||||
@rm -f $(obj)board/bf533-ezkit/u-boot.lds $(obj)board/bf533-stamp/u-boot.lds
|
|
||||||
@rm -f $(obj)board/bf537-stamp/u-boot.lds $(obj)board/bf561-ezkit/u-boot.lds
|
|
||||||
@rm -f $(obj)include/bmp_logo.h
|
|
||||||
@rm -f $(obj)nand_spl/u-boot-spl $(obj)nand_spl/u-boot-spl.map
|
|
||||||
@rm -f $(obj)onenand_ipl/onenand-ipl $(obj)onenand_ipl/onenand-ipl.bin \
|
|
||||||
$(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)onenand_ipl/onenand-ipl.map
|
|
||||||
@rm -f $(obj)api_examples/demo $(VERSION_FILE)
|
@rm -f $(obj)api_examples/demo $(VERSION_FILE)
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
@@ -2922,11 +2928,11 @@ clobber: clean
|
|||||||
-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
|
-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
|
||||||
-print0 \
|
-print0 \
|
||||||
| xargs -0 rm -f
|
| xargs -0 rm -f
|
||||||
@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS
|
@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
|
||||||
@rm -fr $(obj)*.*~
|
$(obj)cscope.* $(obj)*.*~
|
||||||
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
|
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
|
||||||
@rm -f $(obj)tools/crc32.c $(obj)tools/environment.c $(obj)tools/env/crc32.c $(obj)tools/sha1.c
|
@rm -f $(obj)tools/{crc32.c,environment.c,env/crc32.c,sha1.c,inca-swap-bytes}
|
||||||
@rm -f $(obj)tools/inca-swap-bytes $(obj)cpu/mpc824x/bedbug_603e.c
|
@rm -f $(obj)cpu/mpc824x/bedbug_603e.c
|
||||||
@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
|
@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
|
||||||
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -lname "*" -print | xargs rm -f
|
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -lname "*" -print | xargs rm -f
|
||||||
@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -lname "*" -print | xargs rm -f
|
@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -lname "*" -print | xargs rm -f
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ int board_init (void)
|
|||||||
*/
|
*/
|
||||||
int checkboard (void)
|
int checkboard (void)
|
||||||
{
|
{
|
||||||
char revision;
|
|
||||||
char *s = getenv ("serial#");
|
char *s = getenv ("serial#");
|
||||||
|
|
||||||
puts ("Board: AcTux-1 rev.");
|
puts ("Board: AcTux-1 rev.");
|
||||||
|
|||||||
@@ -96,11 +96,15 @@ int board_init (void)
|
|||||||
*/
|
*/
|
||||||
int checkboard (void)
|
int checkboard (void)
|
||||||
{
|
{
|
||||||
char revision;
|
|
||||||
char *s = getenv ("serial#");
|
char *s = getenv ("serial#");
|
||||||
|
|
||||||
puts ("Board: AcTux-2 rev.");
|
puts ("Board: AcTux-2 rev.");
|
||||||
putc (ACTUX2_BOARDREL + 'A' - 1);
|
putc (ACTUX2_BOARDREL + 'A' - 1);
|
||||||
|
|
||||||
|
if (s != NULL) {
|
||||||
|
puts (", serial# ");
|
||||||
|
puts (s);
|
||||||
|
}
|
||||||
putc ('\n');
|
putc ('\n');
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@@ -127,8 +131,6 @@ u32 get_board_rev (void)
|
|||||||
|
|
||||||
void reset_phy (void)
|
void reset_phy (void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
/* init IcPlus IP175C ethernet switch to native IP175C mode */
|
/* init IcPlus IP175C ethernet switch to native IP175C mode */
|
||||||
miiphy_write ("NPE0", 29, 31, 0x175C);
|
miiphy_write ("NPE0", 29, 31, 0x175C);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ int board_init (void)
|
|||||||
*/
|
*/
|
||||||
int checkboard (void)
|
int checkboard (void)
|
||||||
{
|
{
|
||||||
char revision;
|
|
||||||
char *s = getenv ("serial#");
|
char *s = getenv ("serial#");
|
||||||
|
|
||||||
puts ("Board: AcTux-3 rev.");
|
puts ("Board: AcTux-3 rev.");
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
|
|||||||
|
|
||||||
LIB = $(obj)lib$(BOARD).a
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
COBJS := $(BOARD).o
|
COBJS-y := $(BOARD).o
|
||||||
|
COBJS-$(CONFIG_PCI) += pci.o
|
||||||
|
|
||||||
|
COBJS := $(COBJS-y)
|
||||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
OBJS := $(addprefix $(obj),$(COBJS))
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
SOBJS := $(addprefix $(obj),$(SOBJS))
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
CLOCK_SCCR1_PSCFIFO_EN | \
|
CLOCK_SCCR1_PSCFIFO_EN | \
|
||||||
CLOCK_SCCR1_DDR_EN | \
|
CLOCK_SCCR1_DDR_EN | \
|
||||||
CLOCK_SCCR1_FEC_EN | \
|
CLOCK_SCCR1_FEC_EN | \
|
||||||
|
CLOCK_SCCR1_PCI_EN | \
|
||||||
CLOCK_SCCR1_TPR_EN)
|
CLOCK_SCCR1_TPR_EN)
|
||||||
|
|
||||||
#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \
|
#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \
|
||||||
|
|||||||
213
board/ads5121/pci.c
Normal file
213
board/ads5121/pci.c
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Freescale Semiconductor, Inc. 2006, 2007. All rights reserved.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
|
||||||
|
#include <asm/mmu.h>
|
||||||
|
#include <asm/global_data.h>
|
||||||
|
#include <pci.h>
|
||||||
|
#if defined(CONFIG_OF_LIBFDT)
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
/* System RAM mapped to PCI space */
|
||||||
|
#define CONFIG_PCI_SYS_MEM_BUS CFG_SDRAM_BASE
|
||||||
|
#define CONFIG_PCI_SYS_MEM_PHYS CFG_SDRAM_BASE
|
||||||
|
|
||||||
|
static struct pci_controller pci_hose;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* pci_init_board()
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
pci_init_board(void)
|
||||||
|
{
|
||||||
|
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||||
|
volatile law512x_t *pci_law;
|
||||||
|
volatile pot512x_t *pci_pot;
|
||||||
|
volatile pcictrl512x_t *pci_ctrl;
|
||||||
|
volatile pciconf512x_t *pci_conf;
|
||||||
|
u16 reg16;
|
||||||
|
u32 reg32;
|
||||||
|
u32 dev;
|
||||||
|
struct pci_controller *hose;
|
||||||
|
|
||||||
|
/* Set PCI divider for 33MHz */
|
||||||
|
reg32 = immr->clk.scfr[0];
|
||||||
|
reg32 &= ~(SCFR1_PCI_DIV_MASK);
|
||||||
|
reg32 |= SCFR1_PCI_DIV << SCFR1_PCI_DIV_SHIFT;
|
||||||
|
immr->clk.scfr[0] = reg32;
|
||||||
|
|
||||||
|
pci_law = immr->sysconf.pcilaw;
|
||||||
|
pci_pot = immr->ios.pot;
|
||||||
|
pci_ctrl = &immr->pci_ctrl;
|
||||||
|
pci_conf = &immr->pci_conf;
|
||||||
|
|
||||||
|
hose = &pci_hose;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Release PCI RST Output signal
|
||||||
|
*/
|
||||||
|
pci_ctrl->gcr = 0;
|
||||||
|
udelay(2000);
|
||||||
|
pci_ctrl->gcr = 1;
|
||||||
|
|
||||||
|
/* We need to wait at least a 1sec based on PCI specs */
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 1000; i++)
|
||||||
|
udelay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PCI Local Access Windows
|
||||||
|
*/
|
||||||
|
pci_law[0].bar = CFG_PCI_MEM_PHYS & LAWBAR_BAR;
|
||||||
|
pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_512M;
|
||||||
|
|
||||||
|
pci_law[1].bar = CFG_PCI_IO_PHYS & LAWBAR_BAR;
|
||||||
|
pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_16M;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PCI Outbound Translation Windows
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* PCI mem space - prefetch */
|
||||||
|
pci_pot[0].potar = (CFG_PCI_MEM_BASE >> 12) & POTAR_TA_MASK;
|
||||||
|
pci_pot[0].pobar = (CFG_PCI_MEM_PHYS >> 12) & POBAR_BA_MASK;
|
||||||
|
pci_pot[0].pocmr = POCMR_EN | POCMR_PRE | POCMR_CM_256M;
|
||||||
|
|
||||||
|
/* PCI IO space */
|
||||||
|
pci_pot[1].potar = (CFG_PCI_IO_BASE >> 12) & POTAR_TA_MASK;
|
||||||
|
pci_pot[1].pobar = (CFG_PCI_IO_PHYS >> 12) & POBAR_BA_MASK;
|
||||||
|
pci_pot[1].pocmr = POCMR_EN | POCMR_IO | POCMR_CM_16M;
|
||||||
|
|
||||||
|
/* PCI mmio - non-prefetch mem space */
|
||||||
|
pci_pot[2].potar = (CFG_PCI_MMIO_BASE >> 12) & POTAR_TA_MASK;
|
||||||
|
pci_pot[2].pobar = (CFG_PCI_MMIO_PHYS >> 12) & POBAR_BA_MASK;
|
||||||
|
pci_pot[2].pocmr = POCMR_EN | POCMR_CM_256M;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PCI Inbound Translation Windows
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* we need RAM mapped to PCI space for the devices to
|
||||||
|
* access main memory */
|
||||||
|
pci_ctrl[0].pitar1 = 0x0;
|
||||||
|
pci_ctrl[0].pibar1 = 0x0;
|
||||||
|
pci_ctrl[0].piebar1 = 0x0;
|
||||||
|
pci_ctrl[0].piwar1 = PIWAR_EN | PIWAR_PF | PIWAR_RTT_SNOOP |
|
||||||
|
PIWAR_WTT_SNOOP | (__ilog2(gd->ram_size) - 1);
|
||||||
|
|
||||||
|
hose->first_busno = 0;
|
||||||
|
hose->last_busno = 0xff;
|
||||||
|
|
||||||
|
/* PCI memory prefetch space */
|
||||||
|
pci_set_region(hose->regions + 0,
|
||||||
|
CFG_PCI_MEM_BASE,
|
||||||
|
CFG_PCI_MEM_PHYS,
|
||||||
|
CFG_PCI_MEM_SIZE,
|
||||||
|
PCI_REGION_MEM|PCI_REGION_PREFETCH);
|
||||||
|
|
||||||
|
/* PCI memory space */
|
||||||
|
pci_set_region(hose->regions + 1,
|
||||||
|
CFG_PCI_MMIO_BASE,
|
||||||
|
CFG_PCI_MMIO_PHYS,
|
||||||
|
CFG_PCI_MMIO_SIZE,
|
||||||
|
PCI_REGION_MEM);
|
||||||
|
|
||||||
|
/* PCI IO space */
|
||||||
|
pci_set_region(hose->regions + 2,
|
||||||
|
CFG_PCI_IO_BASE,
|
||||||
|
CFG_PCI_IO_PHYS,
|
||||||
|
CFG_PCI_IO_SIZE,
|
||||||
|
PCI_REGION_IO);
|
||||||
|
|
||||||
|
/* System memory space */
|
||||||
|
pci_set_region(hose->regions + 3,
|
||||||
|
CONFIG_PCI_SYS_MEM_BUS,
|
||||||
|
CONFIG_PCI_SYS_MEM_PHYS,
|
||||||
|
gd->ram_size,
|
||||||
|
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||||
|
|
||||||
|
hose->region_count = 4;
|
||||||
|
|
||||||
|
pci_setup_indirect(hose,
|
||||||
|
(CFG_IMMR + 0x8300),
|
||||||
|
(CFG_IMMR + 0x8304));
|
||||||
|
|
||||||
|
pci_register_hose(hose);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write to Command register
|
||||||
|
*/
|
||||||
|
reg16 = 0xff;
|
||||||
|
dev = PCI_BDF(hose->first_busno, 0, 0);
|
||||||
|
pci_hose_read_config_word(hose, dev, PCI_COMMAND, ®16);
|
||||||
|
reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
|
||||||
|
pci_hose_write_config_word(hose, dev, PCI_COMMAND, reg16);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear non-reserved bits in status register.
|
||||||
|
*/
|
||||||
|
pci_hose_write_config_word(hose, dev, PCI_STATUS, 0xffff);
|
||||||
|
pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
|
||||||
|
pci_hose_write_config_byte(hose, dev, PCI_CACHE_LINE_SIZE, 0x08);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_SCAN_SHOW
|
||||||
|
printf("PCI: Bus Dev VenId DevId Class Int\n");
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* Hose scan.
|
||||||
|
*/
|
||||||
|
hose->last_busno = pci_hose_scan(hose);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT)
|
||||||
|
void ft_pci_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
int nodeoffset;
|
||||||
|
int tmp[2];
|
||||||
|
const char *path;
|
||||||
|
|
||||||
|
nodeoffset = fdt_path_offset(blob, "/aliases");
|
||||||
|
if (nodeoffset >= 0) {
|
||||||
|
path = fdt_getprop(blob, nodeoffset, "pci", NULL);
|
||||||
|
if (path) {
|
||||||
|
tmp[0] = cpu_to_be32(pci_hose.first_busno);
|
||||||
|
tmp[1] = cpu_to_be32(pci_hose.last_busno);
|
||||||
|
do_fixup_by_path(blob, path, "bus-range",
|
||||||
|
&tmp, sizeof(tmp), 1);
|
||||||
|
|
||||||
|
tmp[0] = cpu_to_be32(gd->pci_clk);
|
||||||
|
do_fixup_by_path(blob, path, "clock-frequency",
|
||||||
|
&tmp, sizeof(tmp[0]), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_OF_LIBFDT */
|
||||||
@@ -117,7 +117,9 @@ long int initdram(int board_type)
|
|||||||
return (CFG_MBYTES_RAM << 20);
|
return (CFG_MBYTES_RAM << 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_NAND_SPL
|
||||||
int testdram(void)
|
int testdram(void)
|
||||||
{
|
{
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -86,10 +86,13 @@ int board_early_init_f(void)
|
|||||||
/* enable USB device */
|
/* enable USB device */
|
||||||
out_8((u8 *) CFG_BCSR_BASE + 0x09, 0x20);
|
out_8((u8 *) CFG_BCSR_BASE + 0x09, 0x20);
|
||||||
|
|
||||||
/* select Ethernet pins */
|
/* select Ethernet (and optionally IIC1) pins */
|
||||||
mfsdr(SDR0_PFC1, sdr0_pfc1);
|
mfsdr(SDR0_PFC1, sdr0_pfc1);
|
||||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) |
|
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) |
|
||||||
SDR0_PFC1_SELECT_CONFIG_4;
|
SDR0_PFC1_SELECT_CONFIG_4;
|
||||||
|
#ifdef CONFIG_I2C_MULTI_BUS
|
||||||
|
sdr0_pfc1 |= ((sdr0_pfc1 & ~SDR0_PFC1_SIS_MASK) | SDR0_PFC1_SIS_IIC1_SEL);
|
||||||
|
#endif
|
||||||
mfsdr(SDR0_PFC2, sdr0_pfc2);
|
mfsdr(SDR0_PFC2, sdr0_pfc2);
|
||||||
sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
|
sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
|
||||||
SDR0_PFC2_SELECT_CONFIG_4;
|
SDR0_PFC2_SELECT_CONFIG_4;
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ void gpmc_init(void)
|
|||||||
sdelay(2000);
|
sdelay(2000);
|
||||||
|
|
||||||
/* setup cs2 */
|
/* setup cs2 */
|
||||||
|
__raw_writel(0x0, GPMC_CONFIG7_2); /* disable current map */
|
||||||
|
sdelay(1000);
|
||||||
__raw_writel(APOLLON_24XX_GPMC_CONFIG1_0 | mux | mtype | mwidth,
|
__raw_writel(APOLLON_24XX_GPMC_CONFIG1_0 | mux | mtype | mwidth,
|
||||||
GPMC_CONFIG1_2);
|
GPMC_CONFIG1_2);
|
||||||
/* It's same as cs 0 */
|
/* It's same as cs 0 */
|
||||||
|
|||||||
50
board/atmel/at91cap9adk/Makefile
Normal file
50
board/atmel/at91cap9adk/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2003-2008
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd <at> 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 = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS := at91cap9adk.o led.o nand.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
286
board/atmel/at91cap9adk/at91cap9adk.c
Normal file
286
board/atmel/at91cap9adk/at91cap9adk.c
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007-2008
|
||||||
|
* Stelian Pop <stelian.pop <at> leadtechdesign.com>
|
||||||
|
* Lead Tech Design <www.leadtechdesign.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/arch/AT91CAP9.h>
|
||||||
|
#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
|
||||||
|
#include <net.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MP_BLOCK_3_BASE 0xFDF00000
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
/*
|
||||||
|
* Miscelaneous platform dependent initialisations
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void at91cap9_serial_hw_init(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_USART0
|
||||||
|
AT91C_BASE_PIOA->PIO_PDR = AT91C_PA22_TXD0 | AT91C_PA23_RXD0;
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_US0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USART1
|
||||||
|
AT91C_BASE_PIOD->PIO_PDR = AT91C_PD0_TXD1 | AT91C_PD1_RXD1;
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_US1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USART2
|
||||||
|
AT91C_BASE_PIOD->PIO_PDR = AT91C_PD2_TXD2 | AT91C_PD3_RXD2;
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_US2;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USART3 /* DBGU */
|
||||||
|
AT91C_BASE_PIOC->PIO_PDR = AT91C_PC31_DTXD | AT91C_PC30_DRXD;
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SYS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void at91cap9_nor_hw_init(void)
|
||||||
|
{
|
||||||
|
/* Ensure EBI supply is 3.3V */
|
||||||
|
AT91C_BASE_CCFG->CCFG_EBICSA |= AT91C_EBI_SUP_3V3;
|
||||||
|
|
||||||
|
/* Configure SMC CS0 for parallel flash */
|
||||||
|
AT91C_BASE_SMC->SMC_SETUP0 = AT91C_FLASH_NWE_SETUP |
|
||||||
|
AT91C_FLASH_NCS_WR_SETUP |
|
||||||
|
AT91C_FLASH_NRD_SETUP |
|
||||||
|
AT91C_FLASH_NCS_RD_SETUP;
|
||||||
|
|
||||||
|
AT91C_BASE_SMC->SMC_PULSE0 = AT91C_FLASH_NWE_PULSE |
|
||||||
|
AT91C_FLASH_NCS_WR_PULSE |
|
||||||
|
AT91C_FLASH_NRD_PULSE |
|
||||||
|
AT91C_FLASH_NCS_RD_PULSE;
|
||||||
|
|
||||||
|
AT91C_BASE_SMC->SMC_CYCLE0 = AT91C_FLASH_NWE_CYCLE |
|
||||||
|
AT91C_FLASH_NRD_CYCLE;
|
||||||
|
|
||||||
|
AT91C_BASE_SMC->SMC_CTRL0 = AT91C_SMC_READMODE |
|
||||||
|
AT91C_SMC_WRITEMODE |
|
||||||
|
AT91C_SMC_NWAITM_NWAIT_DISABLE |
|
||||||
|
AT91C_SMC_BAT_BYTE_WRITE |
|
||||||
|
AT91C_SMC_DBW_WIDTH_SIXTEEN_BITS |
|
||||||
|
(AT91C_SMC_TDF & (1 << 16));
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_NAND
|
||||||
|
static void at91cap9_nand_hw_init(void)
|
||||||
|
{
|
||||||
|
/* Enable CS3 */
|
||||||
|
AT91C_BASE_CCFG->CCFG_EBICSA |= AT91C_EBI_CS3A_SM | AT91C_EBI_SUP_3V3;
|
||||||
|
|
||||||
|
/* Configure SMC CS3 for NAND/SmartMedia */
|
||||||
|
AT91C_BASE_SMC->SMC_SETUP3 = AT91C_SM_NWE_SETUP |
|
||||||
|
AT91C_SM_NCS_WR_SETUP |
|
||||||
|
AT91C_SM_NRD_SETUP |
|
||||||
|
AT91C_SM_NCS_RD_SETUP;
|
||||||
|
|
||||||
|
AT91C_BASE_SMC->SMC_PULSE3 = AT91C_SM_NWE_PULSE |
|
||||||
|
AT91C_SM_NCS_WR_PULSE |
|
||||||
|
AT91C_SM_NRD_PULSE |
|
||||||
|
AT91C_SM_NCS_RD_PULSE;
|
||||||
|
|
||||||
|
AT91C_BASE_SMC->SMC_CYCLE3 = AT91C_SM_NWE_CYCLE |
|
||||||
|
AT91C_SM_NRD_CYCLE;
|
||||||
|
|
||||||
|
AT91C_BASE_SMC->SMC_CTRL3 = AT91C_SMC_READMODE |
|
||||||
|
AT91C_SMC_WRITEMODE |
|
||||||
|
AT91C_SMC_NWAITM_NWAIT_DISABLE |
|
||||||
|
AT91C_SMC_DBW_WIDTH_EIGTH_BITS |
|
||||||
|
AT91C_SM_TDF;
|
||||||
|
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOABCD;
|
||||||
|
|
||||||
|
/* RDY/BSY is not connected */
|
||||||
|
|
||||||
|
/* Enable NandFlash */
|
||||||
|
AT91C_BASE_PIOD->PIO_PER = AT91C_PIO_PD15;
|
||||||
|
AT91C_BASE_PIOD->PIO_OER = AT91C_PIO_PD15;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_DATAFLASH
|
||||||
|
static void at91cap9_spi_hw_init(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOD->PIO_BSR = AT91C_PD0_SPI0_NPCS2D |
|
||||||
|
AT91C_PD1_SPI0_NPCS3D;
|
||||||
|
AT91C_BASE_PIOD->PIO_PDR = AT91C_PD0_SPI0_NPCS2D |
|
||||||
|
AT91C_PD1_SPI0_NPCS3D;
|
||||||
|
|
||||||
|
AT91C_BASE_PIOA->PIO_ASR = AT91C_PA28_SPI0_NPCS3A;
|
||||||
|
AT91C_BASE_PIOA->PIO_BSR = AT91C_PA4_SPI0_NPCS2A |
|
||||||
|
AT91C_PA1_SPI0_MOSI |
|
||||||
|
AT91C_PA0_SPI0_MISO |
|
||||||
|
AT91C_PA3_SPI0_NPCS1 |
|
||||||
|
AT91C_PA5_SPI0_NPCS0 |
|
||||||
|
AT91C_PA2_SPI0_SPCK;
|
||||||
|
AT91C_BASE_PIOA->PIO_PDR = AT91C_PA28_SPI0_NPCS3A |
|
||||||
|
AT91C_PA4_SPI0_NPCS2A |
|
||||||
|
AT91C_PA1_SPI0_MOSI |
|
||||||
|
AT91C_PA0_SPI0_MISO |
|
||||||
|
AT91C_PA3_SPI0_NPCS1 |
|
||||||
|
AT91C_PA5_SPI0_NPCS0 |
|
||||||
|
AT91C_PA2_SPI0_SPCK;
|
||||||
|
|
||||||
|
/* Enable Clock */
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SPI0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_MACB
|
||||||
|
static void at91cap9_macb_hw_init(void)
|
||||||
|
{
|
||||||
|
unsigned int gpio;
|
||||||
|
|
||||||
|
/* Enable clock */
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_EMAC;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Disable pull-up on:
|
||||||
|
* RXDV (PB22) => PHY normal mode (not Test mode)
|
||||||
|
* ERX0 (PB25) => PHY ADDR0
|
||||||
|
* ERX1 (PB26) => PHY ADDR1 => PHYADDR = 0x0
|
||||||
|
*
|
||||||
|
* PHY has internal pull-down
|
||||||
|
*/
|
||||||
|
AT91C_BASE_PIOB->PIO_PPUDR = AT91C_PB22_E_RXDV |
|
||||||
|
AT91C_PB25_E_RX0 |
|
||||||
|
AT91C_PB26_E_RX1;
|
||||||
|
|
||||||
|
/* Need to reset PHY -> 500ms reset */
|
||||||
|
AT91C_BASE_RSTC->RSTC_RMR = (AT91C_RSTC_KEY & (0xA5 << 24)) |
|
||||||
|
(AT91C_RSTC_ERSTL & (0x0D << 8)) |
|
||||||
|
AT91C_RSTC_URSTEN;
|
||||||
|
AT91C_BASE_RSTC->RSTC_RCR = (AT91C_RSTC_KEY & (0xA5 << 24)) |
|
||||||
|
AT91C_RSTC_EXTRST;
|
||||||
|
|
||||||
|
/* Wait for end hardware reset */
|
||||||
|
while (!(AT91C_BASE_RSTC->RSTC_RSR & AT91C_RSTC_NRSTL));
|
||||||
|
|
||||||
|
/* Re-enable pull-up */
|
||||||
|
AT91C_BASE_PIOB->PIO_PPUER = AT91C_PB22_E_RXDV |
|
||||||
|
AT91C_PB25_E_RX0 |
|
||||||
|
AT91C_PB26_E_RX1;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RMII
|
||||||
|
gpio = AT91C_PB30_E_MDIO |
|
||||||
|
AT91C_PB29_E_MDC |
|
||||||
|
AT91C_PB21_E_TXCK |
|
||||||
|
AT91C_PB27_E_RXER |
|
||||||
|
AT91C_PB25_E_RX0 |
|
||||||
|
AT91C_PB22_E_RXDV |
|
||||||
|
AT91C_PB26_E_RX1 |
|
||||||
|
AT91C_PB28_E_TXEN |
|
||||||
|
AT91C_PB23_E_TX0 |
|
||||||
|
AT91C_PB24_E_TX1;
|
||||||
|
AT91C_BASE_PIOB->PIO_ASR = gpio;
|
||||||
|
AT91C_BASE_PIOB->PIO_BSR = 0;
|
||||||
|
AT91C_BASE_PIOB->PIO_PDR = gpio;
|
||||||
|
#else
|
||||||
|
#error AT91CAP9A-DK works only in RMII mode
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Unlock EMAC, 3 0 2 1 sequence */
|
||||||
|
#define MP_MAC_KEY0 0x5969cb2a
|
||||||
|
#define MP_MAC_KEY1 0xb4a1872e
|
||||||
|
#define MP_MAC_KEY2 0x05683fbc
|
||||||
|
#define MP_MAC_KEY3 0x3634fba4
|
||||||
|
#define UNLOCK_MAC 0x00000008
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x3c)) = MP_MAC_KEY3;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x30)) = MP_MAC_KEY0;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x38)) = MP_MAC_KEY2;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x34)) = MP_MAC_KEY1;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x40)) = UNLOCK_MAC;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USB_OHCI_NEW
|
||||||
|
static void at91cap9_uhp_hw_init(void)
|
||||||
|
{
|
||||||
|
/* Unlock USB OHCI, 3 2 0 1 sequence */
|
||||||
|
#define MP_OHCI_KEY0 0x896c11ca
|
||||||
|
#define MP_OHCI_KEY1 0x68ebca21
|
||||||
|
#define MP_OHCI_KEY2 0x4823efbc
|
||||||
|
#define MP_OHCI_KEY3 0x8651aae4
|
||||||
|
#define UNLOCK_OHCI 0x00000010
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x3c)) = MP_OHCI_KEY3;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x38)) = MP_OHCI_KEY2;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x30)) = MP_OHCI_KEY0;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x34)) = MP_OHCI_KEY1;
|
||||||
|
*((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x40)) = UNLOCK_OHCI;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int board_init(void)
|
||||||
|
{
|
||||||
|
/* Enable Ctrlc */
|
||||||
|
console_init_f();
|
||||||
|
|
||||||
|
/* arch number of AT91CAP9ADK-Board */
|
||||||
|
gd->bd->bi_arch_number = MACH_TYPE_AT91CAP9ADK;
|
||||||
|
/* adress of boot parameters */
|
||||||
|
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||||
|
|
||||||
|
at91cap9_serial_hw_init();
|
||||||
|
at91cap9_nor_hw_init();
|
||||||
|
#ifdef CONFIG_CMD_NAND
|
||||||
|
at91cap9_nand_hw_init();
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_HAS_DATAFLASH
|
||||||
|
at91cap9_spi_hw_init();
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_MACB
|
||||||
|
at91cap9_macb_hw_init();
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_USB_OHCI_NEW
|
||||||
|
at91cap9_uhp_hw_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init(void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_dram[0].start = PHYS_SDRAM;
|
||||||
|
gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_RESET_PHY_R
|
||||||
|
void reset_phy(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_MACB
|
||||||
|
/*
|
||||||
|
* Initialize ethernet HW addr prior to starting Linux,
|
||||||
|
* needed for nfsroot
|
||||||
|
*/
|
||||||
|
eth_init(gd->bd);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
1
board/atmel/at91cap9adk/config.mk
Normal file
1
board/atmel/at91cap9adk/config.mk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
TEXT_BASE = 0x73000000
|
||||||
80
board/atmel/at91cap9adk/led.c
Normal file
80
board/atmel/at91cap9adk/led.c
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007-2008
|
||||||
|
* Stelian Pop <stelian.pop <at> leadtechdesign.com>
|
||||||
|
* Lead Tech Design <www.leadtechdesign.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/arch/AT91CAP9.h>
|
||||||
|
|
||||||
|
#define RED_LED AT91C_PIO_PC29 /* this is the power led */
|
||||||
|
#define GREEN_LED AT91C_PIO_PA10 /* this is the user1 led */
|
||||||
|
#define YELLOW_LED AT91C_PIO_PA11 /* this is the user1 led */
|
||||||
|
|
||||||
|
void red_LED_on(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOC->PIO_SODR = RED_LED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void red_LED_off(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOC->PIO_CODR = RED_LED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void green_LED_on(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOA->PIO_CODR = GREEN_LED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void green_LED_off(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOA->PIO_SODR = GREEN_LED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void yellow_LED_on(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOA->PIO_CODR = YELLOW_LED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void yellow_LED_off(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOA->PIO_SODR = YELLOW_LED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void coloured_LED_init(void)
|
||||||
|
{
|
||||||
|
/* Enable clock */
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOABCD;
|
||||||
|
|
||||||
|
/* Disable peripherals on LEDs */
|
||||||
|
AT91C_BASE_PIOA->PIO_PER = GREEN_LED | YELLOW_LED;
|
||||||
|
/* Enable pins as outputs */
|
||||||
|
AT91C_BASE_PIOA->PIO_OER = GREEN_LED | YELLOW_LED;
|
||||||
|
/* Turn all LEDs OFF */
|
||||||
|
AT91C_BASE_PIOA->PIO_SODR = GREEN_LED | YELLOW_LED;
|
||||||
|
|
||||||
|
/* Disable peripherals on LEDs */
|
||||||
|
AT91C_BASE_PIOC->PIO_PER = RED_LED;
|
||||||
|
/* Enable pins as outputs */
|
||||||
|
AT91C_BASE_PIOC->PIO_OER = RED_LED;
|
||||||
|
/* Turn all LEDs OFF */
|
||||||
|
AT91C_BASE_PIOC->PIO_CODR = RED_LED;
|
||||||
|
}
|
||||||
71
board/atmel/at91cap9adk/nand.c
Normal file
71
board/atmel/at91cap9adk/nand.c
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007-2008
|
||||||
|
* Stelian Pop <stelian.pop <at> leadtechdesign.com>
|
||||||
|
* Lead Tech Design <www.leadtechdesign.com>
|
||||||
|
*
|
||||||
|
* (C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/arch/hardware.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_NAND
|
||||||
|
|
||||||
|
#include <nand.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hardware specific access to control-lines
|
||||||
|
*/
|
||||||
|
#define MASK_ALE (1 << 21) /* our ALE is AD21 */
|
||||||
|
#define MASK_CLE (1 << 22) /* our CLE is AD22 */
|
||||||
|
|
||||||
|
static void at91cap9adk_nand_hwcontrol(struct mtd_info *mtd, int cmd)
|
||||||
|
{
|
||||||
|
struct nand_chip *this = mtd->priv;
|
||||||
|
ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
|
||||||
|
|
||||||
|
IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
|
||||||
|
switch (cmd) {
|
||||||
|
case NAND_CTL_SETCLE:
|
||||||
|
IO_ADDR_W |= MASK_CLE;
|
||||||
|
break;
|
||||||
|
case NAND_CTL_SETALE:
|
||||||
|
IO_ADDR_W |= MASK_ALE;
|
||||||
|
break;
|
||||||
|
case NAND_CTL_CLRNCE:
|
||||||
|
AT91C_BASE_PIOD->PIO_SODR = AT91C_PIO_PD15;
|
||||||
|
break;
|
||||||
|
case NAND_CTL_SETNCE:
|
||||||
|
AT91C_BASE_PIOD->PIO_CODR = AT91C_PIO_PD15;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this->IO_ADDR_W = (void *) IO_ADDR_W;
|
||||||
|
}
|
||||||
|
|
||||||
|
int board_nand_init(struct nand_chip *nand)
|
||||||
|
{
|
||||||
|
nand->eccmode = NAND_ECC_SOFT;
|
||||||
|
nand->hwcontrol = at91cap9adk_nand_hwcontrol;
|
||||||
|
nand->chip_delay = 20;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
57
board/atmel/at91cap9adk/u-boot.lds
Normal file
57
board/atmel/at91cap9adk/u-boot.lds
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||||
|
/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
|
||||||
|
OUTPUT_ARCH(arm)
|
||||||
|
ENTRY(_start)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x00000000;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
cpu/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 = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
__bss_start = .;
|
||||||
|
.bss : { *(.bss) }
|
||||||
|
_end = .;
|
||||||
|
}
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
#define FW_DIR "nx-fw"
|
#define FW_DIR "nx-fw"
|
||||||
#define RESCUE_IMAGE "nxrs.img"
|
#define RESCUE_IMAGE "nxrs.img"
|
||||||
#define LOAD_ADDR 0x400000
|
#define LOAD_ADDR 0x400000
|
||||||
#define RS_BOOTARGS "ramdisk=8192K"
|
#define RS_BOOTARGS "ramdisk_size=8192K"
|
||||||
|
|
||||||
/* Main function for fwupdate */
|
/* Main function for fwupdate */
|
||||||
void cm5200_fwupdate(void);
|
void cm5200_fwupdate(void);
|
||||||
|
|||||||
@@ -280,13 +280,14 @@ void pci_init_board(void)
|
|||||||
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
||||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||||
uint devdisr = gur->devdisr;
|
uint devdisr = gur->devdisr;
|
||||||
uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
|
uint io_sel = (gur->pordevsr & MPC8610_PORDEVSR_IO_SEL)
|
||||||
uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
|
>> MPC8610_PORDEVSR_IO_SEL_SHIFT;
|
||||||
|
uint host_agent = (gur->porbmsr & MPC8610_PORBMSR_HA)
|
||||||
|
>> MPC8610_PORBMSR_HA_SHIFT;
|
||||||
|
|
||||||
printf( " pci_init_board: devdisr=%x, io_sel=%x, host_agent=%x\n",
|
printf( " pci_init_board: devdisr=%x, io_sel=%x, host_agent=%x\n",
|
||||||
devdisr, io_sel, host_agent);
|
devdisr, io_sel, host_agent);
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCIE1
|
#ifdef CONFIG_PCIE1
|
||||||
{
|
{
|
||||||
volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CFG_PCIE1_ADDR;
|
volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CFG_PCIE1_ADDR;
|
||||||
|
|||||||
@@ -206,7 +206,8 @@ void pci_init_board(void)
|
|||||||
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
||||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||||
uint devdisr = gur->devdisr;
|
uint devdisr = gur->devdisr;
|
||||||
uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
|
uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
|
||||||
|
>> MPC8641_PORDEVSR_IO_SEL_SHIFT;
|
||||||
|
|
||||||
#ifdef CONFIG_PCI1
|
#ifdef CONFIG_PCI1
|
||||||
{
|
{
|
||||||
@@ -214,7 +215,8 @@ void pci_init_board(void)
|
|||||||
extern void fsl_pci_init(struct pci_controller *hose);
|
extern void fsl_pci_init(struct pci_controller *hose);
|
||||||
struct pci_controller *hose = &pci1_hose;
|
struct pci_controller *hose = &pci1_hose;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
|
uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA)
|
||||||
|
>> MPC8641_PORBMSR_HA_SHIFT;
|
||||||
uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
|
uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
|
||||||
#endif
|
#endif
|
||||||
if ((io_sel == 2 || io_sel == 3 || io_sel == 5
|
if ((io_sel == 2 || io_sel == 3 || io_sel == 5
|
||||||
@@ -321,28 +323,16 @@ void pci_init_board(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(CONFIG_OF_BOARD_SETUP)
|
#if defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
|
||||||
void
|
void
|
||||||
ft_board_setup(void *blob, bd_t *bd)
|
ft_board_setup(void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
int node, tmp[2];
|
int node, tmp[2];
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
fdt_fixup_ethernet(blob, bd);
|
ft_cpu_setup(blob, bd);
|
||||||
|
|
||||||
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
|
|
||||||
"timebase-frequency", bd->bi_busfreq / 4, 1);
|
|
||||||
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
|
|
||||||
"bus-frequency", bd->bi_busfreq, 1);
|
|
||||||
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
|
|
||||||
"clock-frequency", bd->bi_intfreq, 1);
|
|
||||||
do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
|
|
||||||
"bus-frequency", bd->bi_busfreq, 1);
|
|
||||||
|
|
||||||
do_fixup_by_compat_u32(blob, "ns16550",
|
|
||||||
"clock-frequency", bd->bi_busfreq, 1);
|
|
||||||
|
|
||||||
fdt_fixup_memory(blob, bd->bi_memstart, bd->bi_memsize);
|
|
||||||
|
|
||||||
node = fdt_path_offset(blob, "/aliases");
|
node = fdt_path_offset(blob, "/aliases");
|
||||||
tmp[0] = 0;
|
tmp[0] = 0;
|
||||||
|
|||||||
48
board/m501sk/Makefile
Normal file
48
board/m501sk/Makefile
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2003
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = lib$(BOARD).a
|
||||||
|
|
||||||
|
OBJS := m501sk.o eeprom.o
|
||||||
|
|
||||||
|
SOBJS := memsetup.o
|
||||||
|
|
||||||
|
$(LIB): $(OBJS) $(SOBJS)
|
||||||
|
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
|
||||||
|
$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
|
||||||
|
|
||||||
|
-include .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
1
board/m501sk/config.mk
Normal file
1
board/m501sk/config.mk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
TEXT_BASE = 0x21f00000
|
||||||
102
board/m501sk/eeprom.c
Normal file
102
board/m501sk/eeprom.c
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* Add by Alan Lu, 07-29-2005
|
||||||
|
* For ATMEL AT24C16 EEPROM
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <i2c.h>
|
||||||
|
#ifdef CFG_EEPROM_AT24C16
|
||||||
|
#undef DEBUG
|
||||||
|
|
||||||
|
void eeprom_init(void)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
|
||||||
|
i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int eeprom_read(unsigned dev_addr, unsigned offset, uchar *buffer,
|
||||||
|
unsigned cnt)
|
||||||
|
{
|
||||||
|
int page, count = 0, i = 0;
|
||||||
|
page = offset / 0x100;
|
||||||
|
i = offset % 0x100;
|
||||||
|
|
||||||
|
while (count < cnt) {
|
||||||
|
if (i2c_read(dev_addr|page, i++, 1, buffer+count++, 1) != 0)
|
||||||
|
return 1;
|
||||||
|
if (i > 0xff) {
|
||||||
|
page++;
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* for CFG_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is
|
||||||
|
* 0x000nxxxx for EEPROM address selectors at n, offset xxxx in EEPROM.
|
||||||
|
*
|
||||||
|
* for CFG_I2C_EEPROM_ADDR_LEN == 1 (8-bit EEPROM page address) offset is
|
||||||
|
* 0x00000nxx for EEPROM address selectors and page number at n.
|
||||||
|
*/
|
||||||
|
int eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer,
|
||||||
|
unsigned cnt)
|
||||||
|
{
|
||||||
|
int page, i = 0, count = 0;
|
||||||
|
|
||||||
|
page = offset / 0x100;
|
||||||
|
i = offset % 0x100;
|
||||||
|
|
||||||
|
while (count < cnt) {
|
||||||
|
if (i2c_write(dev_addr|page, i++, 1, buffer+count++, 1) != 0)
|
||||||
|
return 1;
|
||||||
|
if (i > 0xff) {
|
||||||
|
page++;
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CFG_EEPROM_PAGE_WRITE_DELAY_MS)
|
||||||
|
udelay(CFG_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_SPI
|
||||||
|
int eeprom_probe(unsigned dev_addr, unsigned offset)
|
||||||
|
{
|
||||||
|
unsigned char chip;
|
||||||
|
|
||||||
|
/* Probe the chip address */
|
||||||
|
#if CFG_I2C_EEPROM_ADDR_LEN == 1 && !defined(CONFIG_SPI_X)
|
||||||
|
chip = offset >> 8; /* block number */
|
||||||
|
#else
|
||||||
|
chip = offset >> 16; /* block number */
|
||||||
|
#endif /* CFG_I2C_EEPROM_ADDR_LEN, CONFIG_SPI_X */
|
||||||
|
|
||||||
|
chip |= dev_addr; /* insert device address */
|
||||||
|
return (i2c_probe(chip));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
194
board/m501sk/m501sk.c
Normal file
194
board/m501sk/m501sk.c
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2008
|
||||||
|
* Based on modifications by Alan Lu / Artila
|
||||||
|
* Author : Timo Tuunainen / Sysart
|
||||||
|
Kimmo Leppala / Sysart
|
||||||
|
*
|
||||||
|
* 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 <at91rm9200_net.h>
|
||||||
|
#include <dm9161.h>
|
||||||
|
#include "m501sk.h"
|
||||||
|
#include "net.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_M501SK
|
||||||
|
|
||||||
|
void m501sk_gpio_init(void)
|
||||||
|
{
|
||||||
|
AT91C_BASE_PIOD->PIO_PER = 1 << (M501SK_DEBUG_LED1 - 96) |
|
||||||
|
1 << (M501SK_DEBUG_LED2 - 96) | 1 << (M501SK_DEBUG_LED3 - 96) |
|
||||||
|
1 << (M501SK_DEBUG_LED4 - 96) | 1 << (M501SK_READY_LED - 96);
|
||||||
|
|
||||||
|
AT91C_BASE_PIOD->PIO_OER = 1 << (M501SK_DEBUG_LED1 - 96) |
|
||||||
|
1 << (M501SK_DEBUG_LED2 - 96) | 1 << (M501SK_DEBUG_LED3 - 96) |
|
||||||
|
1 << (M501SK_DEBUG_LED4 - 96) | 1 << (M501SK_READY_LED - 96);
|
||||||
|
|
||||||
|
AT91C_BASE_PIOD->PIO_SODR = 1 << (M501SK_READY_LED - 96);
|
||||||
|
AT91C_BASE_PIOD->PIO_CODR = 1 << (M501SK_DEBUG_LED3 - 96);
|
||||||
|
AT91C_BASE_PIOB->PIO_PER = 1 << (M501SK_BUZZER - 32);
|
||||||
|
AT91C_BASE_PIOB->PIO_OER = 1 << (M501SK_BUZZER - 32);
|
||||||
|
AT91C_BASE_PIOC->PIO_PDR = (1 << 7) | (1 << 8);
|
||||||
|
|
||||||
|
/* Power OFF all USART's LEDs */
|
||||||
|
AT91C_BASE_PIOA->PIO_PER = AT91C_PA5_TXD3 | AT91C_PA6_RXD3 |
|
||||||
|
AT91C_PA17_TXD0 | AT91C_PA18_RXD0 | AT91C_PA22_RXD2 | \
|
||||||
|
AT91C_PA23_TXD2;
|
||||||
|
|
||||||
|
AT91C_BASE_PIOA->PIO_OER = AT91C_PA5_TXD3 | AT91C_PA6_RXD3 |
|
||||||
|
AT91C_PA17_TXD0 | AT91C_PA18_RXD0 | AT91C_PA22_RXD2 | \
|
||||||
|
AT91C_PA23_TXD2;
|
||||||
|
|
||||||
|
AT91C_BASE_PIOA->PIO_SODR = AT91C_PA5_TXD3 | AT91C_PA6_RXD3 |
|
||||||
|
AT91C_PA17_TXD0 | AT91C_PA18_RXD0 | AT91C_PA22_RXD2 | \
|
||||||
|
AT91C_PA23_TXD2;
|
||||||
|
|
||||||
|
AT91C_BASE_PIOB->PIO_PER = AT91C_PB20_RXD1 | AT91C_PB21_TXD1;
|
||||||
|
AT91C_BASE_PIOB->PIO_OER = AT91C_PB20_RXD1 | AT91C_PB21_TXD1;
|
||||||
|
AT91C_BASE_PIOB->PIO_SODR = AT91C_PB20_RXD1 | AT91C_PB21_TXD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uchar m501sk_gpio_set(M501SK_PIO io)
|
||||||
|
{
|
||||||
|
uchar status = 0xff;
|
||||||
|
switch (io) {
|
||||||
|
case M501SK_DEBUG_LED1:
|
||||||
|
case M501SK_DEBUG_LED2:
|
||||||
|
case M501SK_DEBUG_LED3:
|
||||||
|
case M501SK_DEBUG_LED4:
|
||||||
|
case M501SK_READY_LED:
|
||||||
|
AT91C_BASE_PIOD->PIO_SODR = 1 << (io - 96);
|
||||||
|
status = AT91C_BASE_PIOD->PIO_ODSR & (1 << (io - 96));
|
||||||
|
break;
|
||||||
|
case M501SK_BUZZER:
|
||||||
|
AT91C_BASE_PIOB->PIO_SODR = 1 << (io - 32);
|
||||||
|
status = AT91C_BASE_PIOB->PIO_ODSR & (1 << (io - 32));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
uchar m501sk_gpio_clear(M501SK_PIO io)
|
||||||
|
{
|
||||||
|
uchar status = 0xff;
|
||||||
|
switch (io) {
|
||||||
|
case M501SK_DEBUG_LED1:
|
||||||
|
case M501SK_DEBUG_LED2:
|
||||||
|
case M501SK_DEBUG_LED3:
|
||||||
|
case M501SK_DEBUG_LED4:
|
||||||
|
case M501SK_READY_LED:
|
||||||
|
AT91C_BASE_PIOD->PIO_CODR = 1 << (io - 96);
|
||||||
|
status = AT91C_BASE_PIOD->PIO_ODSR & (1 << (io - 96));
|
||||||
|
break;
|
||||||
|
case M501SK_BUZZER:
|
||||||
|
AT91C_BASE_PIOB->PIO_CODR = 1 << (io - 32);
|
||||||
|
status = AT91C_BASE_PIOB->PIO_ODSR & (1 << (io - 32));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
void load_sernum_ethaddr(void)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Miscelaneous platform dependent initialisations
|
||||||
|
*/
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
int board_init(void)
|
||||||
|
{
|
||||||
|
/* Enable Ctrlc */
|
||||||
|
console_init_f();
|
||||||
|
|
||||||
|
/* Correct IRDA resistor problem */
|
||||||
|
/* Set PA23_TXD in Output */
|
||||||
|
((AT91PS_PIO)AT91C_BASE_PIOA)->PIO_OER = AT91C_PA23_TXD2;
|
||||||
|
|
||||||
|
/* memory and cpu-speed are setup before relocation */
|
||||||
|
/* so we do _nothing_ here */
|
||||||
|
gd->bd->bi_arch_number = MACH_TYPE_M501;
|
||||||
|
/* adress of boot parameters */
|
||||||
|
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||||
|
m501sk_gpio_init();
|
||||||
|
|
||||||
|
/* Do interrupt init here, because flash needs timers */
|
||||||
|
interrupt_init();
|
||||||
|
flash_init();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init(void)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
gd->bd->bi_dram[0].start = PHYS_SDRAM;
|
||||||
|
gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
|
||||||
|
|
||||||
|
for (i = 0; i < 500; i++) {
|
||||||
|
m501sk_gpio_clear(M501SK_DEBUG_LED3);
|
||||||
|
m501sk_gpio_clear(M501SK_BUZZER);
|
||||||
|
udelay(250);
|
||||||
|
m501sk_gpio_set(M501SK_DEBUG_LED3);
|
||||||
|
m501sk_gpio_set(M501SK_BUZZER);
|
||||||
|
udelay(80);
|
||||||
|
}
|
||||||
|
m501sk_gpio_clear(M501SK_BUZZER);
|
||||||
|
m501sk_gpio_clear(M501SK_DEBUG_LED3);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int board_late_init(void)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_CMD_NET)
|
||||||
|
eth_init(gd->bd);
|
||||||
|
eth_halt();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Protect U-Boot, kernel & ramdisk memory addresses */
|
||||||
|
run_command("protect on 10000000 1041ffff", 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_DRIVER_ETHER
|
||||||
|
#if defined(CONFIG_CMD_NET)
|
||||||
|
/*
|
||||||
|
* Name:
|
||||||
|
* at91rm9200_GetPhyInterface
|
||||||
|
* Description:
|
||||||
|
* Initialise the interface functions to the PHY
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
* Return value:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
|
void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
|
||||||
|
{
|
||||||
|
p_phyops->Init = dm9161_InitPhy;
|
||||||
|
p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
|
||||||
|
p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
|
||||||
|
p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_CMD_NET */
|
||||||
|
#endif /* CONFIG_DRIVER_ETHER */
|
||||||
|
#endif /* CONFIG_M501SK */
|
||||||
167
board/m501sk/m501sk.h
Normal file
167
board/m501sk/m501sk.h
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
/*
|
||||||
|
* linux/include/asm-arm/arch-at91/hardware.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 SAN People
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
#ifndef __M501SK_H
|
||||||
|
#define __M501SK_H
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
#include <asm-arm/arch-at91rm9200/AT91RM9200.h>
|
||||||
|
#else
|
||||||
|
#include <asm-arm/arch-at91rm9200/AT91RM9200_inc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define AT91C_PIO_PA22 ((unsigned int) 1 << 22) /* Pin Controlled by PA22 */
|
||||||
|
#define AT91C_PA22_RXD2 ((unsigned int) AT91C_PIO_PA22) /* USART 2 RxD */
|
||||||
|
#define AT91C_PA5_TXD3 ((unsigned int) 1 << 5) /* USART 3 TxD */
|
||||||
|
#define AT91C_PA6_RXD3 ((unsigned int) 1 << 6) /* USART 3 RxD */
|
||||||
|
|
||||||
|
/* ========== Register definition for PIOD peripheral ========== */
|
||||||
|
#define AT91C_PIOD_PDSR ((AT91_REG *) 0xFFFFFA3C) /* Pin Data stat Reg */
|
||||||
|
#define AT91C_PIOD_CODR ((AT91_REG *) 0xFFFFFA34) /* Clear Output Data Reg */
|
||||||
|
#define AT91C_PIOD_OWER ((AT91_REG *) 0xFFFFFAA0) /* Output Write Enable Reg */
|
||||||
|
#define AT91C_PIOD_MDER ((AT91_REG *) 0xFFFFFA50) /* Multi-driver Enable Reg */
|
||||||
|
#define AT91C_PIOD_IMR ((AT91_REG *) 0xFFFFFA48) /* Interrupt Mask Reg */
|
||||||
|
#define AT91C_PIOD_IER ((AT91_REG *) 0xFFFFFA40) /* Interrupt Enable Reg */
|
||||||
|
#define AT91C_PIOD_ODSR ((AT91_REG *) 0xFFFFFA38) /* Output Data stat Reg */
|
||||||
|
#define AT91C_PIOD_SODR ((AT91_REG *) 0xFFFFFA30) /* Set Output Data Reg */
|
||||||
|
#define AT91C_PIOD_PER ((AT91_REG *) 0xFFFFFA00) /* PIO Enable Reg */
|
||||||
|
#define AT91C_PIOD_OWDR ((AT91_REG *) 0xFFFFFAA4) /* Output Write Disable Reg */
|
||||||
|
#define AT91C_PIOD_PPUER ((AT91_REG *) 0xFFFFFA64) /* Pull-up Enable Reg */
|
||||||
|
#define AT91C_PIOD_MDDR ((AT91_REG *) 0xFFFFFA54) /* Multi-driver Disable Reg */
|
||||||
|
#define AT91C_PIOD_ISR ((AT91_REG *) 0xFFFFFA4C) /* Interrupt stat Reg */
|
||||||
|
#define AT91C_PIOD_IDR ((AT91_REG *) 0xFFFFFA44) /* Interrupt Disable Reg */
|
||||||
|
#define AT91C_PIOD_PDR ((AT91_REG *) 0xFFFFFA04) /* PIO Disable Reg */
|
||||||
|
#define AT91C_PIOD_ODR ((AT91_REG *) 0xFFFFFA14) /* Output Disable Regr */
|
||||||
|
#define AT91C_PIOD_OWSR ((AT91_REG *) 0xFFFFFAA8) /* Output Write stat Reg */
|
||||||
|
#define AT91C_PIOD_ABSR ((AT91_REG *) 0xFFFFFA78) /* AB Select stat Reg */
|
||||||
|
#define AT91C_PIOD_ASR ((AT91_REG *) 0xFFFFFA70) /* Select A Reg */
|
||||||
|
#define AT91C_PIOD_PPUSR ((AT91_REG *) 0xFFFFFA68) /* Pad Pull-up stat Reg */
|
||||||
|
#define AT91C_PIOD_PPUDR ((AT91_REG *) 0xFFFFFA60) /* Pull-up Disable Reg */
|
||||||
|
#define AT91C_PIOD_MDSR ((AT91_REG *) 0xFFFFFA58) /* Multi-driver stat Reg */
|
||||||
|
#define AT91C_PIOD_PSR ((AT91_REG *) 0xFFFFFA08) /* PIO stat Reg */
|
||||||
|
#define AT91C_PIOD_OER ((AT91_REG *) 0xFFFFFA10) /* Output Enable Reg */
|
||||||
|
#define AT91C_PIOD_OSR ((AT91_REG *) 0xFFFFFA18) /* Output stat Reg */
|
||||||
|
#define AT91C_PIOD_IFER ((AT91_REG *) 0xFFFFFA20) /* Input Filter Enable Reg */
|
||||||
|
#define AT91C_PIOD_BSR ((AT91_REG *) 0xFFFFFA74) /* Select B Reg */
|
||||||
|
#define AT91C_PIOD_IFDR ((AT91_REG *) 0xFFFFFA24) /* Input Filter Disable Reg */
|
||||||
|
#define AT91C_PIOD_IFSR ((AT91_REG *) 0xFFFFFA28) /* Input Filter stat Reg */
|
||||||
|
|
||||||
|
#define AT91C_PIO_PD0 ((unsigned int) 1 << 0) /* Pin Controlled by PD0 */
|
||||||
|
#define AT91C_PD0_ETX0 ((unsigned int) AT91C_PIO_PD0) /* Enet MAC Tx Data 0*/
|
||||||
|
#define AT91C_PIO_PD1 ((unsigned int) 1 << 1) /* Pin Controlled by PD1 */
|
||||||
|
#define AT91C_PD1_ETX1 ((unsigned int) AT91C_PIO_PD1) /* Enet MAC Tx Data 1*/
|
||||||
|
#define AT91C_PIO_PD10 ((unsigned int) 1 << 10) /* Pin Controlled by PD10 */
|
||||||
|
#define AT91C_PD10_PCK3 ((unsigned int) AT91C_PIO_PD10) /* PMC Prog Clk Oput 3*/
|
||||||
|
#define AT91C_PD10_TPS1 ((unsigned int) AT91C_PIO_PD10) /* ETMARM9 pl stat1 */
|
||||||
|
#define AT91C_PIO_PD11 ((unsigned int) 1 << 11) /* Pin Controlled by PD11 */
|
||||||
|
#define AT91C_PD11_ ((unsigned int) AT91C_PIO_PD11) /* */
|
||||||
|
#define AT91C_PD11_TPS2 ((unsigned int) AT91C_PIO_PD11) /* ETMARM9 pl stat2 */
|
||||||
|
#define AT91C_PIO_PD12 ((unsigned int) 1 << 12) /* Pin Controlled by PD12 */
|
||||||
|
#define AT91C_PD12_ ((unsigned int) AT91C_PIO_PD12) /* */
|
||||||
|
#define AT91C_PD12_TPK0 ((unsigned int) AT91C_PIO_PD12) /* ETM Trace Pkt 0 */
|
||||||
|
#define AT91C_PIO_PD13 ((unsigned int) 1 << 13) /* Pin Controlled by PD13 */
|
||||||
|
#define AT91C_PD13_ ((unsigned int) AT91C_PIO_PD13) /* */
|
||||||
|
#define AT91C_PD13_TPK1 ((unsigned int) AT91C_PIO_PD13) /* ETM Trace Pkt 1 */
|
||||||
|
#define AT91C_PIO_PD14 ((unsigned int) 1 << 14) /* Pin Controlled by PD14 */
|
||||||
|
#define AT91C_PD14_ ((unsigned int) AT91C_PIO_PD14) /* */
|
||||||
|
#define AT91C_PD14_TPK2 ((unsigned int) AT91C_PIO_PD14) /* ETM Trace Pkt 2 */
|
||||||
|
#define AT91C_PIO_PD15 ((unsigned int) 1 << 15) /* Pin Controlled by PD15 */
|
||||||
|
#define AT91C_PD15_TD0 ((unsigned int) AT91C_PIO_PD15) /* SSC TxD */
|
||||||
|
#define AT91C_PD15_TPK3 ((unsigned int) AT91C_PIO_PD15) /* ETM Trace Pkt 3 */
|
||||||
|
#define AT91C_PIO_PD16 ((unsigned int) 1 << 16) /* Pin Controlled by PD16 */
|
||||||
|
#define AT91C_PD16_TD1 ((unsigned int) AT91C_PIO_PD16) /* SSC TxD 1 */
|
||||||
|
#define AT91C_PD16_TPK4 ((unsigned int) AT91C_PIO_PD16) /* ETM Trace Pkt 4 */
|
||||||
|
#define AT91C_PIO_PD17 ((unsigned int) 1 << 17) /* Pin Controlled by PD17 */
|
||||||
|
#define AT91C_PD17_TD2 ((unsigned int) AT91C_PIO_PD17) /* SSC TxD 2 */
|
||||||
|
#define AT91C_PD17_TPK5 ((unsigned int) AT91C_PIO_PD17) /* ETM Trace Pkt 5 */
|
||||||
|
#define AT91C_PIO_PD18 ((unsigned int) 1 << 18) /* Pin Controlled by PD18 */
|
||||||
|
#define AT91C_PD18_NPCS1 ((unsigned int) AT91C_PIO_PD18) /* SPI Perip CS 1 */
|
||||||
|
#define AT91C_PD18_TPK6 ((unsigned int) AT91C_PIO_PD18) /* ETM Trace Pkt 6 */
|
||||||
|
#define AT91C_PIO_PD19 ((unsigned int) 1 << 19) /* Pin Controlled by PD19 */
|
||||||
|
#define AT91C_PD19_NPCS2 ((unsigned int) AT91C_PIO_PD19) /* SPI Perip CS 2 */
|
||||||
|
#define AT91C_PD19_TPK7 ((unsigned int) AT91C_PIO_PD19) /* ETM Trace Pkt 7 */
|
||||||
|
#define AT91C_PIO_PD2 ((unsigned int) 1 << 2) /* Pin Controlled by PD2 */
|
||||||
|
#define AT91C_PD2_ETX2 ((unsigned int) AT91C_PIO_PD2) /* Ethernet MAC TxD 2 */
|
||||||
|
#define AT91C_PIO_PD20 ((unsigned int) 1 << 20) /* Pin Controlled by PD20 */
|
||||||
|
#define AT91C_PD20_NPCS3 ((unsigned int) AT91C_PIO_PD20) /* SPI Perip CS 3 */
|
||||||
|
#define AT91C_PD20_TPK8 ((unsigned int) AT91C_PIO_PD20) /* ETM Trace Pkt 8 */
|
||||||
|
#define AT91C_PIO_PD21 ((unsigned int) 1 << 21) /* Pin Controlled by PD21 */
|
||||||
|
#define AT91C_PD21_RTS0 ((unsigned int) AT91C_PIO_PD21) /* Usart 0 RTS */
|
||||||
|
#define AT91C_PD21_TPK9 ((unsigned int) AT91C_PIO_PD21) /* ETM Trace Pkt 9 */
|
||||||
|
#define AT91C_PIO_PD22 ((unsigned int) 1 << 22) /* Pin Controlled by PD22 */
|
||||||
|
#define AT91C_PD22_RTS1 ((unsigned int) AT91C_PIO_PD22) /* Usart 0 RTS */
|
||||||
|
#define AT91C_PD22_TPK10 ((unsigned int) AT91C_PIO_PD22) /* ETM Trace Pkt 10 */
|
||||||
|
#define AT91C_PIO_PD23 ((unsigned int) 1 << 23) /* Pin Controlled by PD23 */
|
||||||
|
#define AT91C_PD23_RTS2 ((unsigned int) AT91C_PIO_PD23) /* USART 2 RTS */
|
||||||
|
#define AT91C_PD23_TPK11 ((unsigned int) AT91C_PIO_PD23) /* ETM Trace Pkt 11 */
|
||||||
|
#define AT91C_PIO_PD24 ((unsigned int) 1 << 24) /* Pin Controlled by PD24 */
|
||||||
|
#define AT91C_PD24_RTS3 ((unsigned int) AT91C_PIO_PD24) /* USART 3 RTS */
|
||||||
|
#define AT91C_PD24_TPK12 ((unsigned int) AT91C_PIO_PD24) /* ETM Trace Pkt 12 */
|
||||||
|
#define AT91C_PIO_PD25 ((unsigned int) 1 << 25) /* Pin Controlled by PD25 */
|
||||||
|
#define AT91C_PD25_DTR1 ((unsigned int) AT91C_PIO_PD25) /* USART 1 DTR */
|
||||||
|
#define AT91C_PD25_TPK13 ((unsigned int) AT91C_PIO_PD25) /* ETM Trace Pkt 13 */
|
||||||
|
#define AT91C_PIO_PD26 ((unsigned int) 1 << 26) /* Pin Controlled by PD26 */
|
||||||
|
#define AT91C_PD26_TPK14 ((unsigned int) AT91C_PIO_PD26) /* ETM Trace Pkt 14 */
|
||||||
|
#define AT91C_PIO_PD27 ((unsigned int) 1 << 27) /* Pin Controlled by PD27 */
|
||||||
|
#define AT91C_PD27_TPK15 ((unsigned int) AT91C_PIO_PD27) /* ETM Trace Pkt 15 */
|
||||||
|
#define AT91C_PIO_PD3 ((unsigned int) 1 << 3) /* Pin Controlled by PD3 */
|
||||||
|
#define AT91C_PD3_ETX3 ((unsigned int) AT91C_PIO_PD3) /* Enet MAC TxD 3 */
|
||||||
|
#define AT91C_PIO_PD4 ((unsigned int) 1 << 4) /* Pin Controlled by PD4 */
|
||||||
|
#define AT91C_PD4_ETXEN ((unsigned int) AT91C_PIO_PD4) /* Enet MAC TxEn */
|
||||||
|
#define AT91C_PIO_PD5 ((unsigned int) 1 << 5) /* Pin Controlled by PD5 */
|
||||||
|
#define AT91C_PD5_ETXER ((unsigned int) AT91C_PIO_PD5) /* Enet MAC TxCE */
|
||||||
|
#define AT91C_PIO_PD6 ((unsigned int) 1 << 6) /* Pin Controlled by PD6 */
|
||||||
|
#define AT91C_PD6_DTXD ((unsigned int) AT91C_PIO_PD6) /* DBGU Debug TxD */
|
||||||
|
#define AT91C_PIO_PD7 ((unsigned int) 1 << 7) /* Pin Controlled by PD7 */
|
||||||
|
#define AT91C_PD7_PCK0 ((unsigned int) AT91C_PIO_PD7) /* PMC Prog Clk Oput 0*/
|
||||||
|
#define AT91C_PD7_TSYNC ((unsigned int) AT91C_PIO_PD7) /* ETM Sync signal */
|
||||||
|
#define AT91C_PIO_PD8 ((unsigned int) 1 << 8) /* Pin Controlled by PD8 */
|
||||||
|
#define AT91C_PD8_PCK1 ((unsigned int) AT91C_PIO_PD8) /* PMC Prog Clk Oput 1*/
|
||||||
|
#define AT91C_PD8_TCLK ((unsigned int) AT91C_PIO_PD8) /* ETM Trace Clk sig */
|
||||||
|
#define AT91C_PIO_PD9 ((unsigned int) 1 << 9) /* Pin Controlled by PD9 */
|
||||||
|
#define AT91C_PD9_PCK2 ((unsigned int) AT91C_PIO_PD9) /* PMC Prog Clk 2 */
|
||||||
|
#define AT91C_PD9_TPS0 ((unsigned int) AT91C_PIO_PD9) /* ETM ARM9 pl stat0 */
|
||||||
|
#define AT91C_PIO_PB6 ((unsigned int) 1 << 6) /* Pin Controlled by PB6 */
|
||||||
|
#define AT91C_PIO_PC5 ((unsigned int) 1 << 5)
|
||||||
|
#define AT91C_PIO_PC14 ((unsigned int) 1 << 14) /* Pin Controlled by PC1 */
|
||||||
|
#define AT91C_PIO_PC15 ((unsigned int) 1 << 15) /* Pin Controlled by PC1 */
|
||||||
|
#define AT91C_PIO_PA19 ((unsigned int) 1 << 19) /* Pin Controlled by PC1 */
|
||||||
|
#define AT91C_PIO_PB2 ((unsigned int) 1 << 2) /* Pin Controlled by PC1 */
|
||||||
|
#define AT91C_PIO_PB8 ((unsigned int) 1 << 8)
|
||||||
|
#define AT91C_PIO_PB9 ((unsigned int) 1 << 9)
|
||||||
|
#define AT91C_PIO_PB10 ((unsigned int) 1 << 10)
|
||||||
|
#define AT91C_PIO_PB11 ((unsigned int) 1 << 11)
|
||||||
|
#define AT91C_PIO_PB17 ((unsigned int) 1 << 17)
|
||||||
|
#define AT91C_PIO_PB28 ((unsigned int) 1 << 28)
|
||||||
|
#define AT91C_PIO_PB29 ((unsigned int) 1 << 29)
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
M501SK_BUZZER = 38,
|
||||||
|
M501SK_DEBUG_LED1 = 96,
|
||||||
|
M501SK_DEBUG_LED2,
|
||||||
|
M501SK_DEBUG_LED3,
|
||||||
|
M501SK_DEBUG_LED4,
|
||||||
|
M501SK_READY_LED = 102,
|
||||||
|
} M501SK_PIO;
|
||||||
|
|
||||||
|
void m501sk_gpio_init(void);
|
||||||
|
uchar m501sk_gpio_set(M501SK_PIO io);
|
||||||
|
uchar m501sk_gpio_clear(M501SK_PIO io);
|
||||||
|
|
||||||
|
#endif
|
||||||
200
board/m501sk/memsetup.S
Normal file
200
board/m501sk/memsetup.S
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
/*
|
||||||
|
* Memory Setup stuff - taken from blob memsetup.S
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and
|
||||||
|
* Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
|
||||||
|
*
|
||||||
|
* Modified for the at91rm9200dk board by
|
||||||
|
* (C) Copyright 2004
|
||||||
|
* Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <version.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTBINFUNC
|
||||||
|
/*
|
||||||
|
* some parameters for the board
|
||||||
|
*
|
||||||
|
* This is based on rm9200dk.cfg for the BDI2000 from ABATRON which in
|
||||||
|
* turn is based on the boot.bin code from ATMEL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* flash */
|
||||||
|
#define MC_PUIA 0xFFFFFF10
|
||||||
|
#define MC_PUIA_VAL 0x00000000
|
||||||
|
#define MC_PUP 0xFFFFFF50
|
||||||
|
#define MC_PUP_VAL 0x00000000
|
||||||
|
#define MC_PUER 0xFFFFFF54
|
||||||
|
#define MC_PUER_VAL 0x00000000
|
||||||
|
#define MC_ASR 0xFFFFFF04
|
||||||
|
#define MC_ASR_VAL 0x00000000
|
||||||
|
#define MC_AASR 0xFFFFFF08
|
||||||
|
#define MC_AASR_VAL 0x00000000
|
||||||
|
#define EBI_CFGR 0xFFFFFF64
|
||||||
|
#define EBI_CFGR_VAL 0x00000000
|
||||||
|
#define SMC2_CSR 0xFFFFFF70
|
||||||
|
#define SMC2_CSR_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */
|
||||||
|
|
||||||
|
/* clocks */
|
||||||
|
#define PLLAR 0xFFFFFC28
|
||||||
|
#define PLLAR_VAL 0x20263E04 /* 179.712000 MHz for PCK */
|
||||||
|
#define PLLBR 0xFFFFFC2C
|
||||||
|
#define PLLBR_VAL 0x10483E0E /* 48.054857 MHz (divider by 2 for USB) */
|
||||||
|
#define MCKR 0xFFFFFC30
|
||||||
|
/* PCK/3 = MCK Master Clock = 59.904000MHz from PLLA */
|
||||||
|
#define MCKR_VAL 0x00000202
|
||||||
|
|
||||||
|
/* sdram */
|
||||||
|
#define PIOC_ASR 0xFFFFF870
|
||||||
|
#define PIOC_ASR_VAL 0xFFFF0000 /* Configure PIOC as Perip (D16/D31) */
|
||||||
|
#define PIOC_BSR 0xFFFFF874
|
||||||
|
#define PIOC_BSR_VAL 0x00000000
|
||||||
|
#define PIOC_PDR 0xFFFFF804
|
||||||
|
#define PIOC_PDR_VAL 0xFFFF0000
|
||||||
|
#define EBI_CSA 0xFFFFFF60
|
||||||
|
#define EBI_CSA_VAL 0x00000002 /* CS1=SDRAM */
|
||||||
|
#define SDRC_CR 0xFFFFFF98
|
||||||
|
#define SDRC_CR_VAL 0x2188c155 /* set up the SDRAM */
|
||||||
|
#define SDRAM 0x20000000 /* address of the SDRAM */
|
||||||
|
#define SDRAM1 0x20000080 /* address of the SDRAM */
|
||||||
|
#define SDRAM_VAL 0x00000000 /* value written to SDRAM */
|
||||||
|
#define SDRC_MR 0xFFFFFF90
|
||||||
|
#define SDRC_MR_VAL 0x00000002 /* Precharge All */
|
||||||
|
#define SDRC_MR_VAL1 0x00000004 /* refresh */
|
||||||
|
#define SDRC_MR_VAL2 0x00000003 /* Load Mode Register */
|
||||||
|
#define SDRC_MR_VAL3 0x00000000 /* Normal Mode */
|
||||||
|
#define SDRC_TR 0xFFFFFF94
|
||||||
|
#define SDRC_TR_VAL 0x000002E0 /* Write refresh rate */
|
||||||
|
|
||||||
|
_TEXT_BASE:
|
||||||
|
.word TEXT_BASE
|
||||||
|
|
||||||
|
.globl lowlevelinit
|
||||||
|
lowlevelinit:
|
||||||
|
/* memory control configuration */
|
||||||
|
/* this isn't very elegant, but what the heck */
|
||||||
|
ldr r0, =SMRDATA
|
||||||
|
ldr r1, _TEXT_BASE
|
||||||
|
sub r0, r0, r1
|
||||||
|
add r2, r0, #80
|
||||||
|
0:
|
||||||
|
/* the address */
|
||||||
|
ldr r1, [r0], #4
|
||||||
|
/* the value */
|
||||||
|
ldr r3, [r0], #4
|
||||||
|
str r3, [r1]
|
||||||
|
cmp r2, r0
|
||||||
|
bne 0b
|
||||||
|
/* delay - this is all done by guess */
|
||||||
|
ldr r0, =0x00010000
|
||||||
|
1:
|
||||||
|
subs r0, r0, #1
|
||||||
|
bhi 1b
|
||||||
|
ldr r0, =SMRDATA1
|
||||||
|
ldr r1, _TEXT_BASE
|
||||||
|
sub r0, r0, r1
|
||||||
|
add r2, r0, #176
|
||||||
|
2:
|
||||||
|
/* the address */
|
||||||
|
ldr r1, [r0], #4
|
||||||
|
/* the value */
|
||||||
|
ldr r3, [r0], #4
|
||||||
|
str r3, [r1]
|
||||||
|
cmp r2, r0
|
||||||
|
bne 2b
|
||||||
|
|
||||||
|
/* everything is fine now */
|
||||||
|
mov pc, lr
|
||||||
|
|
||||||
|
.ltorg
|
||||||
|
|
||||||
|
SMRDATA:
|
||||||
|
.word MC_PUIA
|
||||||
|
.word MC_PUIA_VAL
|
||||||
|
.word MC_PUP
|
||||||
|
.word MC_PUP_VAL
|
||||||
|
.word MC_PUER
|
||||||
|
.word MC_PUER_VAL
|
||||||
|
.word MC_ASR
|
||||||
|
.word MC_ASR_VAL
|
||||||
|
.word MC_AASR
|
||||||
|
.word MC_AASR_VAL
|
||||||
|
.word EBI_CFGR
|
||||||
|
.word EBI_CFGR_VAL
|
||||||
|
.word SMC2_CSR
|
||||||
|
.word SMC2_CSR_VAL
|
||||||
|
.word PLLAR
|
||||||
|
.word PLLAR_VAL
|
||||||
|
.word PLLBR
|
||||||
|
.word PLLBR_VAL
|
||||||
|
.word MCKR
|
||||||
|
.word MCKR_VAL
|
||||||
|
/* SMRDATA is 80 bytes long */
|
||||||
|
/* here there's a delay of 100 */
|
||||||
|
SMRDATA1:
|
||||||
|
.word PIOC_ASR
|
||||||
|
.word PIOC_ASR_VAL
|
||||||
|
.word PIOC_BSR
|
||||||
|
.word PIOC_BSR_VAL
|
||||||
|
.word PIOC_PDR
|
||||||
|
.word PIOC_PDR_VAL
|
||||||
|
.word EBI_CSA
|
||||||
|
.word EBI_CSA_VAL
|
||||||
|
.word SDRC_CR
|
||||||
|
.word SDRC_CR_VAL
|
||||||
|
.word SDRC_MR
|
||||||
|
.word SDRC_MR_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRC_MR
|
||||||
|
.word SDRC_MR_VAL1
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRC_MR
|
||||||
|
.word SDRC_MR_VAL2
|
||||||
|
.word SDRAM1
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRC_TR
|
||||||
|
.word SDRC_TR_VAL
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
.word SDRC_MR
|
||||||
|
.word SDRC_MR_VAL3
|
||||||
|
.word SDRAM
|
||||||
|
.word SDRAM_VAL
|
||||||
|
/* SMRDATA1 is 176 bytes long */
|
||||||
|
#endif /* CONFIG_BOOTBINFUNC */
|
||||||
55
board/m501sk/u-boot.lds
Normal file
55
board/m501sk/u-boot.lds
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* (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/arm920t/start.o (.text)
|
||||||
|
*(.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
.rodata : { *(.rodata) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
.data : { *(.data) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
.got : { *(.got) }
|
||||||
|
|
||||||
|
__u_boot_cmd_start = .;
|
||||||
|
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||||
|
__u_boot_cmd_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
__bss_start = .;
|
||||||
|
.bss : { *(.bss) }
|
||||||
|
_end = .;
|
||||||
|
}
|
||||||
@@ -193,7 +193,7 @@ void ft_blob_update(void *blob, bd_t *bd)
|
|||||||
"err:%s\n", fdt_strerror(nodeoffset));
|
"err:%s\n", fdt_strerror(nodeoffset));
|
||||||
}
|
}
|
||||||
/* MAC Adresse */
|
/* MAC Adresse */
|
||||||
nodeoffset = fdt_path_offset (blob, "/soc866/cpm/scc");
|
nodeoffset = fdt_path_offset (blob, "/soc866/cpm/ethernet");
|
||||||
if (nodeoffset >= 0) {
|
if (nodeoffset >= 0) {
|
||||||
ret = fdt_setprop(blob, nodeoffset, "mac-address", bd->bi_enetaddr,
|
ret = fdt_setprop(blob, nodeoffset, "mac-address", bd->bi_enetaddr,
|
||||||
sizeof(uchar) * 6);
|
sizeof(uchar) * 6);
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ flash_print_info(flash_info_t * info)
|
|||||||
int i;
|
int i;
|
||||||
uchar *boottype;
|
uchar *boottype;
|
||||||
uchar *bootletter;
|
uchar *bootletter;
|
||||||
uchar *fmt;
|
char *fmt;
|
||||||
uchar botbootletter[] = "B";
|
uchar botbootletter[] = "B";
|
||||||
uchar topbootletter[] = "T";
|
uchar topbootletter[] = "T";
|
||||||
uchar botboottype[] = "bottom boot sector";
|
uchar botboottype[] = "bottom boot sector";
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static void logo_init(void)
|
|||||||
imx_gpio_mode(PD14_PF_FLM_VSYNC);
|
imx_gpio_mode(PD14_PF_FLM_VSYNC);
|
||||||
imx_gpio_mode(PD13_PF_LP_HSYNC);
|
imx_gpio_mode(PD13_PF_LP_HSYNC);
|
||||||
imx_gpio_mode(PD6_PF_LSCLK);
|
imx_gpio_mode(PD6_PF_LSCLK);
|
||||||
imx_gpio_mode(GPIO_PORTD | GPIO_OUT | GPIO_GPIO);
|
imx_gpio_mode(GPIO_PORTD | GPIO_OUT | GPIO_DR);
|
||||||
imx_gpio_mode(PD11_PF_CONTRAST);
|
imx_gpio_mode(PD11_PF_CONTRAST);
|
||||||
imx_gpio_mode(PD10_PF_SPL_SPR);
|
imx_gpio_mode(PD10_PF_SPL_SPR);
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void show_sdram_registers(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
long int fixed_hcu4_sdram (unsigned int dram_size)
|
long int init_ppc405_sdram(unsigned int dram_size)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf(__FUNCTION__);
|
printf(__FUNCTION__);
|
||||||
|
|||||||
@@ -21,18 +21,6 @@
|
|||||||
* MA 02111-1307 USA
|
* MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified 4/5/2001
|
|
||||||
* Wait for completion of each sector erase command issued
|
|
||||||
* 4/5/2001
|
|
||||||
* Chris Hallinan - DS4.COM, Inc. - clh@net1plus.com
|
|
||||||
*
|
|
||||||
* Modified 6/6/2007
|
|
||||||
* Added isync
|
|
||||||
* Niklaus Giger, Netstal Maschinen, niklaus.giger@netstal.com
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <ppc4xx.h>
|
#include <ppc4xx.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
@@ -387,7 +375,6 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
|
|||||||
/* wait at least 80us - let's wait 1 ms */
|
/* wait at least 80us - let's wait 1 ms */
|
||||||
udelay (1000);
|
udelay (1000);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
/*
|
||||||
* We wait for the last triggered sector
|
* We wait for the last triggered sector
|
||||||
*/
|
*/
|
||||||
@@ -396,7 +383,6 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
|
|||||||
wait_for_DQ7 (info, l_sect);
|
wait_for_DQ7 (info, l_sect);
|
||||||
|
|
||||||
DONE:
|
DONE:
|
||||||
#endif
|
|
||||||
/* reset to read mode */
|
/* reset to read mode */
|
||||||
addr = (FLASH_WORD_SIZE *) info->start[0];
|
addr = (FLASH_WORD_SIZE *) info->start[0];
|
||||||
addr[0] = (FLASH_WORD_SIZE) 0x00F000F0; /* reset bank */
|
addr[0] = (FLASH_WORD_SIZE) 0x00F000F0; /* reset bank */
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ extern void set_params_for_sw_install(int install_requested, char *board_name );
|
|||||||
extern void common_misc_init_r(void);
|
extern void common_misc_init_r(void);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* HW_GENERATION_HCU1 is no longer supported */
|
/* HW_GENERATION_HCU1/2 is no longer supported */
|
||||||
HW_GENERATION_HCU2 = 0x10,
|
|
||||||
HW_GENERATION_HCU3 = 0x10,
|
HW_GENERATION_HCU3 = 0x10,
|
||||||
HW_GENERATION_HCU4 = 0x20,
|
HW_GENERATION_HCU4 = 0x20,
|
||||||
HW_GENERATION_HCU5 = 0x30,
|
HW_GENERATION_HCU5 = 0x30,
|
||||||
@@ -36,3 +35,10 @@ enum {
|
|||||||
HW_GENERATION_MCU20 = 0x0a,
|
HW_GENERATION_MCU20 = 0x0a,
|
||||||
HW_GENERATION_MCU25 = 0x09,
|
HW_GENERATION_MCU25 = 0x09,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_405GP
|
||||||
|
#if defined(DEBUG)
|
||||||
|
void show_sdram_registers(void);
|
||||||
|
#endif
|
||||||
|
long int init_ppc405_sdram(unsigned int dram_size);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||||||
|
|
||||||
typedef struct {u8 id; char *name;} generation_info;
|
typedef struct {u8 id; char *name;} generation_info;
|
||||||
|
|
||||||
generation_info generations[7] = {
|
generation_info generations[6] = {
|
||||||
{HW_GENERATION_HCU2, "HCU2"},
|
|
||||||
{HW_GENERATION_HCU3, "HCU3"},
|
{HW_GENERATION_HCU3, "HCU3"},
|
||||||
{HW_GENERATION_HCU4, "HCU4"},
|
{HW_GENERATION_HCU4, "HCU4"},
|
||||||
{HW_GENERATION_HCU5, "HCU5"},
|
{HW_GENERATION_HCU5, "HCU5"},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
*(C) Copyright 2005-2007 Netstal Maschinen AG
|
*(C) Copyright 2005-2008 Netstal Maschinen AG
|
||||||
* Niklaus Giger (Niklaus.Giger@netstal.com)
|
* Niklaus Giger (Niklaus.Giger@netstal.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
@@ -28,17 +28,10 @@
|
|||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#define HCU_MACH_VERSIONS_REGISTER (0x7C000000 + 0xF00000)
|
#define HCU_MACH_VERSIONS_REGISTER (0x7C000000 + 0xF00000)
|
||||||
#define SYS_SLOT_ADDRESS (0x7C000000 + 0x400000)
|
#define HCU_SLOT_ADDRESS (0x7C000000 + 0x400000)
|
||||||
#define HCU3_DIGITAL_IO_REGISTER (0x7C000000 + 0x500000)
|
#define HCU_DIGITAL_IO_REGISTER (0x7C000000 + 0x500000)
|
||||||
#define HCU_SW_INSTALL_REQUESTED 0x10
|
#define HCU_SW_INSTALL_REQUESTED 0x10
|
||||||
|
|
||||||
#undef DEBUG
|
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
void show_sdram_registers(void);
|
|
||||||
#endif
|
|
||||||
long int fixed_hcu4_sdram (unsigned int dram_size);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is run very early, out of flash, and before devices are
|
* This function is run very early, out of flash, and before devices are
|
||||||
* initialized. It is called by lib_ppc/board.c:board_init_f by virtue
|
* initialized. It is called by lib_ppc/board.c:board_init_f by virtue
|
||||||
@@ -49,17 +42,12 @@ long int fixed_hcu4_sdram (unsigned int dram_size);
|
|||||||
* anything, not even stack. So be careful.
|
* anything, not even stack. So be careful.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CPC0_CR0 0xb1 /* Chip control register 0 */
|
|
||||||
#define CPC0_CR1 0xb2 /* Chip control register 1 */
|
|
||||||
/* Attention: If you want 1 microsecs times from the external oscillator
|
/* Attention: If you want 1 microsecs times from the external oscillator
|
||||||
* use 0x00804051. But this causes problems with u-boot and linux!
|
* 0x00004051 is okay for u-boot/linux, but different from old vxworks values
|
||||||
|
* 0x00804051 causes problems with u-boot and linux!
|
||||||
*/
|
*/
|
||||||
#define CPC0_CR0_VALUE 0x0030103c
|
#define CPC0_CR0_VALUE 0x0030103c
|
||||||
#define CPC0_CR1_VALUE 0x00004051
|
#define CPC0_CR1_VALUE 0x00004051
|
||||||
#define CPC0_ECR 0xaa /* Edge condition register */
|
|
||||||
#define EBC0_CFG 0x23 /* External Peripheral Control Register */
|
|
||||||
#define CPC0_EIRR 0xb6 /* External Interrupt Register */
|
|
||||||
|
|
||||||
|
|
||||||
int board_early_init_f (void)
|
int board_early_init_f (void)
|
||||||
{
|
{
|
||||||
@@ -70,16 +58,16 @@ int board_early_init_f (void)
|
|||||||
* IRQ 17-24 RESERVED/UNUSED
|
* IRQ 17-24 RESERVED/UNUSED
|
||||||
* IRQ 31 (EXT IRQ 6) (unused)
|
* IRQ 31 (EXT IRQ 6) (unused)
|
||||||
*/
|
*/
|
||||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||||
mtdcr (uicer, 0x00000000); /* disable all ints */
|
mtdcr(uicer, 0x00000000); /* disable all ints */
|
||||||
mtdcr (uiccr, 0x00000000); /* set all to be non-critical */
|
mtdcr(uiccr, 0x00000000); /* set all to be non-critical */
|
||||||
mtdcr (uicpr, 0xFFFFE000); /* set int polarities */
|
mtdcr(uicpr, 0xFFFFE000); /* set int polarities */
|
||||||
mtdcr (uictr, 0x00000000); /* set int trigger levels */
|
mtdcr(uictr, 0x00000000); /* set int trigger levels */
|
||||||
mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
|
mtdcr(uicsr, 0xFFFFFFFF); /* clear all ints */
|
||||||
|
|
||||||
mtdcr(CPC0_CR1, CPC0_CR1_VALUE);
|
mtdcr(CPC0_CR1, CPC0_CR1_VALUE);
|
||||||
mtdcr(CPC0_ECR, 0x60606000);
|
mtdcr(CPC0_ECR, 0x60606000);
|
||||||
mtdcr(CPC0_EIRR, 0x7c000000);
|
mtdcr(CPC0_EIRR, 0x7C000000);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -93,18 +81,19 @@ int board_pre_init (void)
|
|||||||
|
|
||||||
int sys_install_requested(void)
|
int sys_install_requested(void)
|
||||||
{
|
{
|
||||||
u16 *ioValuePtr = (u16 *)HCU3_DIGITAL_IO_REGISTER;
|
u16 ioValue = in_be16((u16 *)HCU_DIGITAL_IO_REGISTER);
|
||||||
return (in_be16(ioValuePtr) & HCU_SW_INSTALL_REQUESTED) != 0;
|
return (ioValue & HCU_SW_INSTALL_REQUESTED) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int checkboard (void)
|
int checkboard (void)
|
||||||
{
|
{
|
||||||
u16 *boardVersReg = (u16 *)HCU_MACH_VERSIONS_REGISTER;
|
u16 boardVersReg = in_be16((u16 *)HCU_MACH_VERSIONS_REGISTER);
|
||||||
u16 generation = in_be16(boardVersReg) & 0xf0;
|
u16 generation = boardVersReg & 0xf0;
|
||||||
u16 index = in_be16(boardVersReg) & 0x0f;
|
u16 index = boardVersReg & 0x0f;
|
||||||
|
|
||||||
|
/* Cannot be done in board_early_init */
|
||||||
|
mtdcr(cntrl0, CPC0_CR0_VALUE);
|
||||||
|
|
||||||
/* Cannot be done, in board_early_init */
|
|
||||||
mtdcr(CPC0_CR0, CPC0_CR0_VALUE);
|
|
||||||
/* Force /RTS to active. The board it not wired quite
|
/* Force /RTS to active. The board it not wired quite
|
||||||
* correctly to use cts/rtc flow control, so just force the
|
* correctly to use cts/rtc flow control, so just force the
|
||||||
* /RST active and forget about it.
|
* /RST active and forget about it.
|
||||||
@@ -145,8 +134,8 @@ void sdram_init(void)
|
|||||||
*/
|
*/
|
||||||
u32 hcu_get_slot(void)
|
u32 hcu_get_slot(void)
|
||||||
{
|
{
|
||||||
u16 *slot = (u16 *)SYS_SLOT_ADDRESS;
|
u16 slot = in_be16((u16 *)HCU_SLOT_ADDRESS);
|
||||||
return in_be16(slot) & 0x7f;
|
return slot & 0x7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -154,12 +143,12 @@ u32 hcu_get_slot(void)
|
|||||||
*/
|
*/
|
||||||
u32 get_serial_number(void)
|
u32 get_serial_number(void)
|
||||||
{
|
{
|
||||||
u32 *serial = (u32 *)CFG_FLASH_BASE;
|
u32 serial = in_be32((u32 *)CFG_FLASH_BASE);
|
||||||
|
|
||||||
if (in_be32(serial) == 0xffffffff)
|
if (serial == 0xffffffff)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return in_be32(serial);
|
return serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -177,12 +166,15 @@ int misc_init_r(void)
|
|||||||
long int initdram(int board_type)
|
long int initdram(int board_type)
|
||||||
{
|
{
|
||||||
long dram_size = 0;
|
long dram_size = 0;
|
||||||
u16 *boardVersReg = (u16 *) HCU_MACH_VERSIONS_REGISTER;
|
u16 boardVersReg = in_be16((u16 *)HCU_MACH_VERSIONS_REGISTER);
|
||||||
u16 generation = in_be16(boardVersReg) & 0xf0;
|
u16 generation = boardVersReg & 0xf0;
|
||||||
if (generation == HW_GENERATION_HCU3)
|
u16 index = boardVersReg & 0x0f;
|
||||||
dram_size = 32*1024*1024;
|
|
||||||
else dram_size = 64*1024*1024;
|
if (generation == HW_GENERATION_HCU3 && index < 0xf)
|
||||||
fixed_hcu4_sdram(dram_size);
|
dram_size = 32 << 20; /* 32 MB - RAM */
|
||||||
|
else
|
||||||
|
dram_size = 64 << 20; /* 64 MB - RAM */
|
||||||
|
init_ppc405_sdram(dram_size);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
show_sdram_registers();
|
show_sdram_registers();
|
||||||
|
|||||||
@@ -309,15 +309,13 @@ int misc_init_r(void)
|
|||||||
*/
|
*/
|
||||||
if (mfspr(dbcr0) & 0x80000000) {
|
if (mfspr(dbcr0) & 0x80000000) {
|
||||||
/* External debugger alive
|
/* External debugger alive
|
||||||
* enable trace facilty for Lauterback
|
* enable trace facilty for Lauterbach
|
||||||
* CCR0[DAPUIB]=0 Enable broadcast of instruction data
|
|
||||||
* to auxiliary processor interface
|
|
||||||
* CCR0[DTB]=0 Enable broadcast of trace information
|
* CCR0[DTB]=0 Enable broadcast of trace information
|
||||||
* SDR0_PFC0[TRE] Trace signals are enabled instead of
|
* SDR0_PFC0[TRE] Trace signals are enabled instead of
|
||||||
* GPIO49-63
|
* GPIO49-63
|
||||||
*/
|
*/
|
||||||
mtspr(ccr0, mfspr(ccr0) &~ 0x00108000);
|
mtspr(ccr0, mfspr(ccr0) &~ (CCR0_DTB));
|
||||||
mtsdr(SDR0_PFC0, sdr0_pfc1 | 0x00000100);
|
mtsdr(SDR0_PFC0, sdr0_pfc1 | SDR0_PFC0_TRE_ENABLE);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,19 +165,25 @@ static void program_ecc(unsigned long start_address, unsigned long num_bytes)
|
|||||||
u32 val;
|
u32 val;
|
||||||
char str[] = "ECC generation -";
|
char str[] = "ECC generation -";
|
||||||
#if defined(CONFIG_PRAM)
|
#if defined(CONFIG_PRAM)
|
||||||
u32 *magic;
|
u32 *magicPtr;
|
||||||
|
u32 magic;
|
||||||
|
|
||||||
/* Check whether vxWorks is using EDR logging, if yes zero */
|
if ((mfspr(dbcr0) & 0x80000000) == 0) {
|
||||||
/* also PostMortem and user reserved memory */
|
/* only if no external debugger is alive!
|
||||||
magic = (u32 *)in_be32((u32 *)(start_address + num_bytes -
|
* Check whether vxWorks is using EDR logging, if yes zero
|
||||||
(CONFIG_PRAM*1024) + sizeof(u32)));
|
* also PostMortem and user reserved memory
|
||||||
|
*/
|
||||||
debug("\n%s: CONFIG_PRAM %d kB magic 0x%x 0x%p -> 0x%x\n", __FUNCTION__,
|
magicPtr = (u32 *)(start_address + num_bytes -
|
||||||
CONFIG_PRAM,
|
(CONFIG_PRAM*1024) + sizeof(u32));
|
||||||
start_address + num_bytes - (CONFIG_PRAM*1024) + sizeof(u32),
|
magic = in_be32(magicPtr);
|
||||||
magic, in_be32(magic));
|
debug("%s: CONFIG_PRAM %d kB magic 0x%x 0x%p\n",
|
||||||
if (in_be32(magic) == 0xbeefbabe)
|
__FUNCTION__, CONFIG_PRAM,
|
||||||
num_bytes -= (CONFIG_PRAM*1024) - PM_RESERVED_MEM;
|
magicPtr, magic);
|
||||||
|
if (magic == 0xbeefbabe) {
|
||||||
|
printf("%s: preserving at %p\n", __FUNCTION__, magicPtr);
|
||||||
|
num_bytes -= (CONFIG_PRAM*1024) - PM_RESERVED_MEM;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sync();
|
sync();
|
||||||
|
|||||||
@@ -45,23 +45,12 @@ static void netstar_nand_hwcontrol(struct mtd_info *mtd, int cmd)
|
|||||||
this->IO_ADDR_W = (void *) IO_ADDR_W;
|
this->IO_ADDR_W = (void *) IO_ADDR_W;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* chip R/B detection
|
|
||||||
*/
|
|
||||||
/***
|
|
||||||
static int netstar_nand_ready(struct mtd_info *mtd)
|
|
||||||
{
|
|
||||||
return (*(volatile ushort *)GPIO_DATA_INPUT_REG) & 0x02;
|
|
||||||
}
|
|
||||||
***/
|
|
||||||
|
|
||||||
int board_nand_init(struct nand_chip *nand)
|
int board_nand_init(struct nand_chip *nand)
|
||||||
{
|
{
|
||||||
nand->options = NAND_SAMSUNG_LP_OPTIONS;
|
nand->options = NAND_SAMSUNG_LP_OPTIONS;
|
||||||
nand->eccmode = NAND_ECC_SOFT;
|
nand->eccmode = NAND_ECC_SOFT;
|
||||||
nand->hwcontrol = netstar_nand_hwcontrol;
|
nand->hwcontrol = netstar_nand_hwcontrol;
|
||||||
/* nand->dev_ready = netstar_nand_ready; */
|
nand->chip_delay = 400;
|
||||||
nand->chip_delay = 18;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
|||||||
|
|
||||||
LIB = $(obj)lib$(BOARD).a
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
COBJS = $(BOARD).o flash.o
|
COBJS = $(BOARD).o
|
||||||
SOBJS = lowlevel_init.o
|
SOBJS = lowlevel_init.o
|
||||||
|
|
||||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
|||||||
@@ -56,9 +56,10 @@ int checkboard (void)
|
|||||||
{
|
{
|
||||||
volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
|
volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
|
||||||
volatile ccsr_local_ecm_t *ecm = (void *)(CFG_MPC85xx_ECM_ADDR);
|
volatile ccsr_local_ecm_t *ecm = (void *)(CFG_MPC85xx_ECM_ADDR);
|
||||||
|
volatile u_char *rev= (void *)CFG_BD_REV;
|
||||||
|
|
||||||
printf ("Board: Wind River SBC8548 Rev. 0x%01x\n",
|
printf ("Board: Wind River SBC8548 Rev. 0x%01x\n",
|
||||||
(volatile)(*(u_char *)CFG_BD_REV) >> 4);
|
(*rev) >> 4);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize local bus.
|
* Initialize local bus.
|
||||||
@@ -533,12 +534,12 @@ void
|
|||||||
ft_pci_setup(void *blob, bd_t *bd)
|
ft_pci_setup(void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
int node, tmp[2];
|
int node, tmp[2];
|
||||||
const char *path;
|
|
||||||
|
|
||||||
node = fdt_path_offset(blob, "/aliases");
|
node = fdt_path_offset(blob, "/aliases");
|
||||||
tmp[0] = 0;
|
tmp[0] = 0;
|
||||||
if (node >= 0) {
|
if (node >= 0) {
|
||||||
#ifdef CONFIG_PCI1
|
#ifdef CONFIG_PCI1
|
||||||
|
const char *path;
|
||||||
path = fdt_getprop(blob, node, "pci0", NULL);
|
path = fdt_getprop(blob, node, "pci0", NULL);
|
||||||
if (path) {
|
if (path) {
|
||||||
tmp[1] = pci1_hose.last_busno - pci1_hose.first_busno;
|
tmp[1] = pci1_hose.last_busno - pci1_hose.first_busno;
|
||||||
@@ -546,6 +547,7 @@ ft_pci_setup(void *blob, bd_t *bd)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PCIE1
|
#ifdef CONFIG_PCIE1
|
||||||
|
const char *path;
|
||||||
path = fdt_getprop(blob, node, "pci1", NULL);
|
path = fdt_getprop(blob, node, "pci1", NULL);
|
||||||
if (path) {
|
if (path) {
|
||||||
tmp[1] = pcie1_hose.last_busno - pcie1_hose.first_busno;
|
tmp[1] = pcie1_hose.last_busno - pcie1_hose.first_busno;
|
||||||
|
|||||||
@@ -35,11 +35,8 @@
|
|||||||
#include <asm/immap_86xx.h>
|
#include <asm/immap_86xx.h>
|
||||||
#include <asm/immap_fsl_pci.h>
|
#include <asm/immap_fsl_pci.h>
|
||||||
#include <spd.h>
|
#include <spd.h>
|
||||||
|
#include <libfdt.h>
|
||||||
#if defined(CONFIG_OF_FLAT_TREE)
|
#include <fdt_support.h>
|
||||||
#include <ft_build.h>
|
|
||||||
extern void ft_cpu_setup (void *blob, bd_t * bd);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
|
#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
|
||||||
extern void ddr_enable_ecc (unsigned int dram_size);
|
extern void ddr_enable_ecc (unsigned int dram_size);
|
||||||
@@ -233,7 +230,8 @@ void pci_init_board(void)
|
|||||||
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
|
||||||
volatile ccsr_gur_t *gur = &immap->im_gur;
|
volatile ccsr_gur_t *gur = &immap->im_gur;
|
||||||
uint devdisr = gur->devdisr;
|
uint devdisr = gur->devdisr;
|
||||||
uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
|
uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
|
||||||
|
>> MPC8641_PORDEVSR_IO_SEL_SHIFT;
|
||||||
|
|
||||||
#ifdef CONFIG_PCI1
|
#ifdef CONFIG_PCI1
|
||||||
{
|
{
|
||||||
@@ -241,7 +239,8 @@ void pci_init_board(void)
|
|||||||
extern void fsl_pci_init(struct pci_controller *hose);
|
extern void fsl_pci_init(struct pci_controller *hose);
|
||||||
struct pci_controller *hose = &pci1_hose;
|
struct pci_controller *hose = &pci1_hose;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
|
uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA)
|
||||||
|
>> MPC8641_PORBMSR_HA_SHIFT;
|
||||||
uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
|
uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
|
||||||
#endif
|
#endif
|
||||||
if ((io_sel == 2 || io_sel == 3 || io_sel == 5
|
if ((io_sel == 2 || io_sel == 3 || io_sel == 5
|
||||||
@@ -341,18 +340,34 @@ void pci_init_board(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
|
|
||||||
void ft_board_setup (void *blob, bd_t * bd)
|
#if defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
|
||||||
|
void
|
||||||
|
ft_board_setup (void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
u32 *p;
|
int node, tmp[2];
|
||||||
int len;
|
const char *path;
|
||||||
|
|
||||||
ft_cpu_setup (blob, bd);
|
ft_cpu_setup(blob, bd);
|
||||||
|
|
||||||
p = ft_get_prop (blob, "/memory/reg", &len);
|
node = fdt_path_offset(blob, "/aliases");
|
||||||
if (p != NULL) {
|
tmp[0] = 0;
|
||||||
*p++ = cpu_to_be32 (bd->bi_memstart);
|
if (node >= 0) {
|
||||||
*p = cpu_to_be32 (bd->bi_memsize);
|
#ifdef CONFIG_PCI1
|
||||||
|
path = fdt_getprop(blob, node, "pci0", NULL);
|
||||||
|
if (path) {
|
||||||
|
tmp[1] = pci1_hose.last_busno - pci1_hose.first_busno;
|
||||||
|
do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_PCI2
|
||||||
|
path = fdt_getprop(blob, node, "pci1", NULL);
|
||||||
|
if (path) {
|
||||||
|
tmp[1] = pci2_hose.last_busno - pci2_hose.first_busno;
|
||||||
|
do_fixup_by_path(blob, path, "bus-range", &tmp, 8, 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,6 +43,10 @@
|
|||||||
#include "mt48lc16m16a2-75.h"
|
#include "mt48lc16m16a2-75.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_OF_LIBFDT
|
||||||
|
#include <fdt_support.h>
|
||||||
|
#endif /* CONFIG_OF_LIBFDT */
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#ifdef CONFIG_PS2MULT
|
#ifdef CONFIG_PS2MULT
|
||||||
@@ -155,10 +159,13 @@ long int initdram (int board_type)
|
|||||||
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001c; /* 512MB */
|
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001c; /* 512MB */
|
||||||
|
|
||||||
/* find RAM size using SDRAM CS1 only */
|
/* find RAM size using SDRAM CS1 only */
|
||||||
sdram_start(0);
|
if (!dramsize)
|
||||||
test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
|
sdram_start(0);
|
||||||
sdram_start(1);
|
test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
|
||||||
test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
|
if (!dramsize) {
|
||||||
|
sdram_start(1);
|
||||||
|
test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
|
||||||
|
}
|
||||||
if (test1 > test2) {
|
if (test1 > test2) {
|
||||||
sdram_start(0);
|
sdram_start(0);
|
||||||
dramsize2 = test1;
|
dramsize2 = test1;
|
||||||
@@ -792,5 +799,6 @@ int board_get_height (void)
|
|||||||
void ft_board_setup(void *blob, bd_t *bd)
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
ft_cpu_setup(blob, bd);
|
ft_cpu_setup(blob, bd);
|
||||||
|
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
|
|||||||
@@ -550,10 +550,11 @@ int getenv_r (char *name, char *buf, unsigned len)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
|
#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
|
||||||
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|
||||||
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
|
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
|
||||||
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))
|
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
|
||||||
|
&& !defined(CFG_ENV_IS_NOWHERE))
|
||||||
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
extern char * env_name_spec;
|
extern char * env_name_spec;
|
||||||
@@ -605,10 +606,11 @@ U_BOOT_CMD(
|
|||||||
" - delete environment variable 'name'\n"
|
" - delete environment variable 'name'\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
|
#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
|
||||||
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|
||||||
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
|
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
|
||||||
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))
|
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
|
||||||
|
&& !defined(CFG_ENV_IS_NOWHERE))
|
||||||
U_BOOT_CMD(
|
U_BOOT_CMD(
|
||||||
saveenv, 1, 0, do_saveenv,
|
saveenv, 1, 0, do_saveenv,
|
||||||
"saveenv - save environment variables to persistent storage\n",
|
"saveenv - save environment variables to persistent storage\n",
|
||||||
|
|||||||
@@ -44,22 +44,22 @@ extern uchar default_environment[];
|
|||||||
uchar env_get_char_spec (int index)
|
uchar env_get_char_spec (int index)
|
||||||
{
|
{
|
||||||
uchar c;
|
uchar c;
|
||||||
read_dataflash (CFG_ENV_ADDR+index+offsetof(env_t,data),1,&c);
|
read_dataflash(CFG_ENV_ADDR + index + offsetof(env_t,data),
|
||||||
|
1, (char *)&c);
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void env_relocate_spec (void)
|
void env_relocate_spec (void)
|
||||||
{
|
{
|
||||||
read_dataflash (CFG_ENV_ADDR,CFG_ENV_SIZE,(uchar *)env_ptr);
|
read_dataflash(CFG_ENV_ADDR, CFG_ENV_SIZE, (char *)env_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int saveenv(void)
|
int saveenv(void)
|
||||||
{
|
{
|
||||||
/* env must be copied to do not alter env structure in memory*/
|
/* env must be copied to do not alter env structure in memory*/
|
||||||
unsigned char temp[CFG_ENV_SIZE];
|
unsigned char temp[CFG_ENV_SIZE];
|
||||||
int i;
|
|
||||||
memcpy(temp, env_ptr, CFG_ENV_SIZE);
|
memcpy(temp, env_ptr, CFG_ENV_SIZE);
|
||||||
return write_dataflash (CFG_ENV_ADDR, (unsigned long)temp, CFG_ENV_SIZE);
|
return write_dataflash(CFG_ENV_ADDR, (unsigned long)temp, CFG_ENV_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -77,13 +77,14 @@ int env_init(void)
|
|||||||
AT91F_DataflashInit(); /* prepare for DATAFLASH read/write */
|
AT91F_DataflashInit(); /* prepare for DATAFLASH read/write */
|
||||||
|
|
||||||
/* read old CRC */
|
/* read old CRC */
|
||||||
read_dataflash (CFG_ENV_ADDR+offsetof(env_t,crc),sizeof(ulong),&crc);
|
read_dataflash(CFG_ENV_ADDR + offsetof(env_t, crc),
|
||||||
|
sizeof(ulong), (char *)&crc);
|
||||||
new = 0;
|
new = 0;
|
||||||
len = ENV_SIZE;
|
len = ENV_SIZE;
|
||||||
off = offsetof(env_t,data);
|
off = offsetof(env_t,data);
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
int n = (len > sizeof(buf)) ? sizeof(buf) : len;
|
int n = (len > sizeof(buf)) ? sizeof(buf) : len;
|
||||||
read_dataflash (CFG_ENV_ADDR+off,n , buf);
|
read_dataflash(CFG_ENV_ADDR + off, n, (char *)buf);
|
||||||
new = crc32 (new, buf, n);
|
new = crc32 (new, buf, n);
|
||||||
len -= n;
|
len -= n;
|
||||||
off += n;
|
off += n;
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ PLATFORM_CPPFLAGS+= -D__ARM__
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Load generated board configuration
|
||||||
|
sinclude $(OBJTREE)/include/autoconf.mk
|
||||||
|
|
||||||
ifdef ARCH
|
ifdef ARCH
|
||||||
sinclude $(TOPDIR)/$(ARCH)_config.mk # include architecture dependend rules
|
sinclude $(TOPDIR)/$(ARCH)_config.mk # include architecture dependend rules
|
||||||
endif
|
endif
|
||||||
@@ -87,9 +90,6 @@ ifdef BOARD
|
|||||||
sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
|
sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Load generated board configuration
|
|
||||||
sinclude $(OBJTREE)/include/autoconf.mk
|
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
||||||
|
|||||||
@@ -37,145 +37,11 @@
|
|||||||
# include <asm/arch/omap2420.h>
|
# include <asm/arch/omap2420.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
#define TIMER_LOAD_VAL 0
|
#define TIMER_LOAD_VAL 0
|
||||||
|
|
||||||
/* macro to read the 32 bit timer */
|
/* macro to read the 32 bit timer */
|
||||||
#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+TCRR))
|
#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+TCRR))
|
||||||
|
|
||||||
#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 ();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_CINTEGRATOR)
|
#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_CINTEGRATOR)
|
||||||
/* Use the IntegratorCP function from board/integratorcp.c */
|
/* Use the IntegratorCP function from board/integratorcp.c */
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -60,137 +60,9 @@ static struct _irq_handler IRQ_HANDLER[N_IRQS];
|
|||||||
#endif /* CONFIG_S3C4510B */
|
#endif /* CONFIG_S3C4510B */
|
||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
#ifdef CONFIG_USE_IRQ
|
||||||
/* enable IRQ/FIQ 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, #0x80\n"
|
|
||||||
"msr cpsr_c, %1"
|
|
||||||
: "=r" (old), "=r" (temp)
|
|
||||||
:
|
|
||||||
: "memory");
|
|
||||||
return (old & 0x80) == 0;
|
|
||||||
}
|
|
||||||
#else /* CONFIG_USE_IRQ */
|
|
||||||
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)
|
void do_irq (struct pt_regs *pt_regs)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_IMPA7) || defined(CONFIG_EP7312) || defined(CONFIG_NETARM) || defined(CONFIG_ARMADILLO)
|
#if defined(CONFIG_S3C4510B)
|
||||||
printf ("interrupt request\n");
|
|
||||||
show_regs (pt_regs);
|
|
||||||
bad_mode ();
|
|
||||||
#elif defined(CONFIG_S3C4510B)
|
|
||||||
unsigned int pending;
|
unsigned int pending;
|
||||||
|
|
||||||
while ( (pending = GET_REG( REG_INTOFFSET)) != 0x54) { /* sentinal value for no pending interrutps */
|
while ( (pending = GET_REG( REG_INTOFFSET)) != 0x54) { /* sentinal value for no pending interrutps */
|
||||||
@@ -212,7 +84,7 @@ void do_irq (struct pt_regs *pt_regs)
|
|||||||
#error do_irq() not defined for this CPU type
|
#error do_irq() not defined for this CPU type
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_S3C4510B
|
#ifdef CONFIG_S3C4510B
|
||||||
static void default_isr( void *data) {
|
static void default_isr( void *data) {
|
||||||
|
|||||||
@@ -31,149 +31,20 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <arm920t.h>
|
#include <arm920t.h>
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
#ifdef CONFIG_USE_IRQ
|
||||||
/* enable IRQ interrupts */
|
#include <asm/proc-armv/ptrace.h>
|
||||||
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)
|
void do_irq (struct pt_regs *pt_regs)
|
||||||
{
|
{
|
||||||
#if defined (CONFIG_USE_IRQ)
|
|
||||||
#if defined (ARM920_IRQ_CALLBACK)
|
#if defined (ARM920_IRQ_CALLBACK)
|
||||||
ARM920_IRQ_CALLBACK();
|
ARM920_IRQ_CALLBACK();
|
||||||
return;
|
|
||||||
#elif defined (CONFIG_ARCH_INTEGRATOR)
|
#elif defined (CONFIG_ARCH_INTEGRATOR)
|
||||||
/* ASSUMED to be a timer interrupt */
|
/* ASSUMED to be a timer interrupt */
|
||||||
/* Just clear it - count handled in */
|
/* Just clear it - count handled in */
|
||||||
/* integratorap.c */
|
/* integratorap.c */
|
||||||
*(volatile ulong *)(CFG_TIMERBASE + 0x0C) = 0;
|
*(volatile ulong *)(CFG_TIMERBASE + 0x0C) = 0;
|
||||||
#endif /* ARCH_INTEGRATOR */
|
|
||||||
#else
|
#else
|
||||||
printf ("interrupt request\n");
|
#error do_irq() not defined for this cpu type
|
||||||
show_regs (pt_regs);
|
|
||||||
bad_mode ();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ void serial_setbrg(void)
|
|||||||
static int serial_init_dev(const int dev_index)
|
static int serial_init_dev(const int dev_index)
|
||||||
{
|
{
|
||||||
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
|
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
|
||||||
int i;
|
|
||||||
|
|
||||||
/* FIFO enable, Tx/Rx FIFO clear */
|
/* FIFO enable, Tx/Rx FIFO clear */
|
||||||
uart->UFCON = 0x07;
|
uart->UFCON = 0x07;
|
||||||
|
|||||||
@@ -36,146 +36,11 @@
|
|||||||
#include <arm925t.h>
|
#include <arm925t.h>
|
||||||
#include <configs/omap1510.h>
|
#include <configs/omap1510.h>
|
||||||
|
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
#define TIMER_LOAD_VAL 0xffffffff
|
#define TIMER_LOAD_VAL 0xffffffff
|
||||||
|
|
||||||
/* macro to read the 32 bit timer */
|
/* macro to read the 32 bit timer */
|
||||||
#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+8))
|
#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 timestamp;
|
||||||
static ulong lastdec;
|
static ulong lastdec;
|
||||||
|
|
||||||
|
|||||||
46
cpu/arm926ejs/at91cap9/Makefile
Normal file
46
cpu/arm926ejs/at91cap9/Makefile
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2000-2008
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd <at> 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 = $(obj)lib$(SOC).a
|
||||||
|
|
||||||
|
COBJS = ether.o timer.o spi.o usb.o
|
||||||
|
SOBJS = lowlevel_init.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
||||||
|
|
||||||
|
all: $(obj).depend $(LIB)
|
||||||
|
|
||||||
|
$(LIB): $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
2
cpu/arm926ejs/at91cap9/config.mk
Normal file
2
cpu/arm926ejs/at91cap9/config.mk
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PLATFORM_CPPFLAGS += -march=armv5te
|
||||||
|
PLATFORM_CPPFLAGS += $(call cc-option,-mtune=arm926ejs,)
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* (C) Copyright 2003
|
* (C) Copyright 2007-2008
|
||||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
* Stelian Pop <stelian.pop <at> leadtechdesign.com>
|
||||||
|
* Lead Tech Design <www.leadtechdesign.com>
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* See file CREDITS for list of people who contributed to this
|
||||||
* project.
|
* project.
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
@@ -22,19 +23,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
/*-----------------------------------------------------------------------
|
#include <asm/arch/AT91CAP9.h>
|
||||||
* flash_init()
|
|
||||||
*
|
|
||||||
* sets up flash_info and returns size of FLASH (bytes)
|
|
||||||
*/
|
|
||||||
unsigned long flash_init(void)
|
|
||||||
{
|
|
||||||
printf("Skipping flash_init\n");
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int write_buff(void *info, uchar *src, ulong addr, ulong cnt)
|
extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
|
||||||
|
|
||||||
|
#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
|
||||||
|
void at91cap9_eth_initialize(bd_t *bi)
|
||||||
{
|
{
|
||||||
printf("write_buff not implemented\n");
|
macb_eth_initialize(0, (void *)AT91C_BASE_MACB, 0x00);
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
43
cpu/arm926ejs/at91cap9/lowlevel_init.S
Normal file
43
cpu/arm926ejs/at91cap9/lowlevel_init.S
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* AT91CAP9 setup stuff
|
||||||
|
*
|
||||||
|
* (C) Copyright 2007-2008
|
||||||
|
* Stelian Pop <stelian.pop <at> leadtechdesign.com>
|
||||||
|
* Lead Tech Design <www.leadtechdesign.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>
|
||||||
|
|
||||||
|
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||||
|
|
||||||
|
.globl lowlevel_init
|
||||||
|
lowlevel_init:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clocks/SDRAM initialization is handled by at91bootstrap,
|
||||||
|
* no need to do it here...
|
||||||
|
*/
|
||||||
|
mov pc, lr
|
||||||
|
|
||||||
|
.ltorg
|
||||||
|
|
||||||
|
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||||
119
cpu/arm926ejs/at91cap9/spi.c
Normal file
119
cpu/arm926ejs/at91cap9/spi.c
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/*
|
||||||
|
* Driver for ATMEL DataFlash support
|
||||||
|
* Author : Hamid Ikdoumi (Atmel)
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/hardware.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_DATAFLASH
|
||||||
|
#include <dataflash.h>
|
||||||
|
|
||||||
|
/* Max Value = 10MHz to be compliant to the Continuous Array Read function */
|
||||||
|
#define AT91C_SPI_CLK 10000000
|
||||||
|
|
||||||
|
/* AC Characteristics: DLYBS = tCSS = 250ns min and DLYBCT = tCSH = 250ns */
|
||||||
|
#define DATAFLASH_TCSS (0xFA << 16)
|
||||||
|
#define DATAFLASH_TCHS (0x8 << 24)
|
||||||
|
|
||||||
|
#define AT91C_TIMEOUT_WRDY 200000
|
||||||
|
#define AT91C_SPI_PCS0_DATAFLASH_CARD 0xE /* Chip Select 0: NPCS0%1110 */
|
||||||
|
#define AT91C_SPI_PCS3_DATAFLASH_CARD 0x7 /* Chip Select 3: NPCS3%0111 */
|
||||||
|
|
||||||
|
void AT91F_SpiInit(void)
|
||||||
|
{
|
||||||
|
/* Reset the SPI */
|
||||||
|
AT91C_BASE_SPI0->SPI_CR = AT91C_SPI_SWRST;
|
||||||
|
|
||||||
|
/* Configure SPI in Master Mode with No CS selected !!! */
|
||||||
|
AT91C_BASE_SPI0->SPI_MR =
|
||||||
|
AT91C_SPI_MSTR | AT91C_SPI_MODFDIS | AT91C_SPI_PCS;
|
||||||
|
|
||||||
|
/* Configure CS0 */
|
||||||
|
AT91C_BASE_SPI0->SPI_CSR[0] =
|
||||||
|
AT91C_SPI_CPOL |
|
||||||
|
(AT91C_SPI_DLYBS & DATAFLASH_TCSS) |
|
||||||
|
(AT91C_SPI_DLYBCT & DATAFLASH_TCHS) |
|
||||||
|
((AT91C_MASTER_CLOCK / (2*AT91C_SPI_CLK)) << 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AT91F_SpiEnable(int cs)
|
||||||
|
{
|
||||||
|
switch (cs) {
|
||||||
|
case 0: /* Configure SPI CS0 for Serial DataFlash AT45DBxx */
|
||||||
|
AT91C_BASE_SPI0->SPI_MR &= 0xFFF0FFFF;
|
||||||
|
AT91C_BASE_SPI0->SPI_MR |=
|
||||||
|
((AT91C_SPI_PCS0_DATAFLASH_CARD<<16) & AT91C_SPI_PCS);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
AT91C_BASE_SPI0->SPI_MR &= 0xFFF0FFFF;
|
||||||
|
AT91C_BASE_SPI0->SPI_MR |=
|
||||||
|
((AT91C_SPI_PCS3_DATAFLASH_CARD<<16) & AT91C_SPI_PCS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SPI_Enable */
|
||||||
|
AT91C_BASE_SPI0->SPI_CR = AT91C_SPI_SPIEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
|
||||||
|
{
|
||||||
|
unsigned int timeout;
|
||||||
|
|
||||||
|
pDesc->state = BUSY;
|
||||||
|
|
||||||
|
AT91C_BASE_SPI0->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
|
||||||
|
|
||||||
|
/* Initialize the Transmit and Receive Pointer */
|
||||||
|
AT91C_BASE_SPI0->SPI_RPR = (unsigned int)pDesc->rx_cmd_pt;
|
||||||
|
AT91C_BASE_SPI0->SPI_TPR = (unsigned int)pDesc->tx_cmd_pt;
|
||||||
|
|
||||||
|
/* Intialize the Transmit and Receive Counters */
|
||||||
|
AT91C_BASE_SPI0->SPI_RCR = pDesc->rx_cmd_size;
|
||||||
|
AT91C_BASE_SPI0->SPI_TCR = pDesc->tx_cmd_size;
|
||||||
|
|
||||||
|
if (pDesc->tx_data_size != 0) {
|
||||||
|
/* Initialize the Next Transmit and Next Receive Pointer */
|
||||||
|
AT91C_BASE_SPI0->SPI_RNPR = (unsigned int)pDesc->rx_data_pt;
|
||||||
|
AT91C_BASE_SPI0->SPI_TNPR = (unsigned int)pDesc->tx_data_pt;
|
||||||
|
|
||||||
|
/* Intialize the Next Transmit and Next Receive Counters */
|
||||||
|
AT91C_BASE_SPI0->SPI_RNCR = pDesc->rx_data_size;
|
||||||
|
AT91C_BASE_SPI0->SPI_TNCR = pDesc->tx_data_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* arm simple, non interrupt dependent timer */
|
||||||
|
reset_timer_masked();
|
||||||
|
timeout = 0;
|
||||||
|
|
||||||
|
AT91C_BASE_SPI0->SPI_PTCR = AT91C_PDC_TXTEN + AT91C_PDC_RXTEN;
|
||||||
|
while (!(AT91C_BASE_SPI0->SPI_SR & AT91C_SPI_RXBUFF) &&
|
||||||
|
((timeout = get_timer_masked()) < CFG_SPI_WRITE_TOUT));
|
||||||
|
AT91C_BASE_SPI0->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
|
||||||
|
pDesc->state = IDLE;
|
||||||
|
|
||||||
|
if (timeout >= CFG_SPI_WRITE_TOUT) {
|
||||||
|
printf("Error Timeout\n\r");
|
||||||
|
return DATAFLASH_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DATAFLASH_OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
149
cpu/arm926ejs/at91cap9/timer.c
Normal file
149
cpu/arm926ejs/at91cap9/timer.c
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007-2008
|
||||||
|
* Stelian Pop <stelian.pop <at> leadtechdesign.com>
|
||||||
|
* Lead Tech Design <www.leadtechdesign.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/arch/hardware.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We're using the AT91CAP9 PITC in 32 bit mode, by
|
||||||
|
* setting the 20 bit counter period to its maximum (0xfffff).
|
||||||
|
*/
|
||||||
|
#define TIMER_LOAD_VAL 0xfffff
|
||||||
|
#define READ_RESET_TIMER (AT91C_BASE_PITC->PITC_PIVR)
|
||||||
|
#define READ_TIMER (AT91C_BASE_PITC->PITC_PIIR)
|
||||||
|
#define TIMER_FREQ (AT91C_MASTER_CLOCK << 4)
|
||||||
|
#define TICKS_TO_USEC(ticks) ((ticks) / 6)
|
||||||
|
|
||||||
|
ulong get_timer_masked(void);
|
||||||
|
ulong resettime;
|
||||||
|
|
||||||
|
AT91PS_PITC p_pitc;
|
||||||
|
|
||||||
|
/* nothing really to do with interrupts, just starts up a counter. */
|
||||||
|
int interrupt_init(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Enable PITC Clock
|
||||||
|
* The clock is already enabled for system controller in boot
|
||||||
|
*/
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SYS;
|
||||||
|
|
||||||
|
/* Enable PITC */
|
||||||
|
AT91C_BASE_PITC->PITC_PIMR = AT91C_PITC_PITEN;
|
||||||
|
|
||||||
|
/* Load PITC_PIMR with the right timer value */
|
||||||
|
AT91C_BASE_PITC->PITC_PIMR |= TIMER_LOAD_VAL;
|
||||||
|
|
||||||
|
reset_timer_masked();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* timer without interrupts
|
||||||
|
*/
|
||||||
|
|
||||||
|
static inline ulong get_timer_raw(void)
|
||||||
|
{
|
||||||
|
ulong now = READ_TIMER;
|
||||||
|
if (now >= resettime)
|
||||||
|
return now - resettime;
|
||||||
|
else
|
||||||
|
return 0xFFFFFFFFUL - (resettime - now) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_timer_masked(void)
|
||||||
|
{
|
||||||
|
resettime = READ_TIMER;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong get_timer_masked(void)
|
||||||
|
{
|
||||||
|
return TICKS_TO_USEC(get_timer_raw());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void udelay_masked(unsigned long usec)
|
||||||
|
{
|
||||||
|
ulong tmp;
|
||||||
|
|
||||||
|
tmp = get_timer(0);
|
||||||
|
while (get_timer(tmp) < usec) /* our timer works in usecs */
|
||||||
|
; /* NOP */
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_timer(void)
|
||||||
|
{
|
||||||
|
reset_timer_masked();
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong get_timer(ulong base)
|
||||||
|
{
|
||||||
|
ulong now = get_timer_masked();
|
||||||
|
|
||||||
|
if (now >= base)
|
||||||
|
return now - base;
|
||||||
|
else
|
||||||
|
return TICKS_TO_USEC(0xFFFFFFFFUL) - (base - now) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void udelay(unsigned long usec)
|
||||||
|
{
|
||||||
|
udelay_masked(usec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reset the cpu by setting up the watchdog timer and let him time out
|
||||||
|
* on the AT91CAP9ADK board
|
||||||
|
*/
|
||||||
|
void reset_cpu(ulong ignored)
|
||||||
|
{
|
||||||
|
/* this is the way Linux does it */
|
||||||
|
AT91C_BASE_RSTC->RSTC_RCR = (0xA5 << 24) |
|
||||||
|
AT91C_RSTC_PROCRST |
|
||||||
|
AT91C_RSTC_PERRST;
|
||||||
|
|
||||||
|
while (1);
|
||||||
|
/* Never reached */
|
||||||
|
}
|
||||||
54
cpu/arm926ejs/at91cap9/usb.c
Normal file
54
cpu/arm926ejs/at91cap9/usb.c
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2006
|
||||||
|
* DENX Software Engineering <mk <at> 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_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT)
|
||||||
|
#ifdef CONFIG_AT91CAP9
|
||||||
|
|
||||||
|
#include <asm/arch/hardware.h>
|
||||||
|
|
||||||
|
int usb_cpu_init(void)
|
||||||
|
{
|
||||||
|
/* Enable USB host clock. */
|
||||||
|
AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UHP;
|
||||||
|
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_UHP;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int usb_cpu_stop(void)
|
||||||
|
{
|
||||||
|
/* Disable USB host clock. */
|
||||||
|
AT91C_BASE_PMC->PMC_PCDR = 1 << AT91C_ID_UHP;
|
||||||
|
AT91C_BASE_PMC->PMC_SCDR = AT91C_PMC_UHP;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int usb_cpu_init_fail(void)
|
||||||
|
{
|
||||||
|
return usb_cpu_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_AT91CAP9 */
|
||||||
|
#endif /* defined(CONFIG_USB_OHCI) && defined(CFG_USB_OHCI_CPU_INIT) */
|
||||||
@@ -61,6 +61,13 @@ davinci_timer *timer = (davinci_timer *)CFG_TIMERBASE;
|
|||||||
#define TIMER_LOAD_VAL (CFG_HZ_CLOCK / CFG_HZ)
|
#define TIMER_LOAD_VAL (CFG_HZ_CLOCK / CFG_HZ)
|
||||||
#define READ_TIMER timer->tim34
|
#define READ_TIMER timer->tim34
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Timer runs with CFG_HZ_CLOCK, currently 27MHz. To avoid wrap
|
||||||
|
* around of timestamp already after min ~159s, divide it, e.g. by 16.
|
||||||
|
* timestamp will then wrap around all min ~42min
|
||||||
|
*/
|
||||||
|
#define DIV(x) ((x) >> 4)
|
||||||
|
|
||||||
static ulong timestamp;
|
static ulong timestamp;
|
||||||
static ulong lastinc;
|
static ulong lastinc;
|
||||||
|
|
||||||
@@ -101,20 +108,20 @@ void udelay(unsigned long usec)
|
|||||||
|
|
||||||
void reset_timer_masked(void)
|
void reset_timer_masked(void)
|
||||||
{
|
{
|
||||||
lastinc = READ_TIMER;
|
lastinc = DIV(READ_TIMER);
|
||||||
timestamp = 0;
|
timestamp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong get_timer_raw(void)
|
ulong get_timer_raw(void)
|
||||||
{
|
{
|
||||||
ulong now = READ_TIMER;
|
ulong now = DIV(READ_TIMER);
|
||||||
|
|
||||||
if (now >= lastinc) {
|
if (now >= lastinc) {
|
||||||
/* normal mode */
|
/* normal mode */
|
||||||
timestamp += now - lastinc;
|
timestamp += now - lastinc;
|
||||||
} else {
|
} else {
|
||||||
/* overflow ... */
|
/* overflow ... */
|
||||||
timestamp += now + TIMER_LOAD_VAL - lastinc;
|
timestamp += now + DIV(TIMER_LOAD_VAL) - lastinc;
|
||||||
}
|
}
|
||||||
lastinc = now;
|
lastinc = now;
|
||||||
return timestamp;
|
return timestamp;
|
||||||
@@ -122,7 +129,7 @@ ulong get_timer_raw(void)
|
|||||||
|
|
||||||
ulong get_timer_masked(void)
|
ulong get_timer_masked(void)
|
||||||
{
|
{
|
||||||
return(get_timer_raw() / TIMER_LOAD_VAL);
|
return(get_timer_raw() / DIV(TIMER_LOAD_VAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void udelay_masked(unsigned long usec)
|
void udelay_masked(unsigned long usec)
|
||||||
|
|||||||
@@ -37,142 +37,8 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <arm926ejs.h>
|
#include <arm926ejs.h>
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
#if defined(CONFIG_INTEGRATOR) || defined(CONFIG_AT91CAP9ADK)
|
||||||
/* 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 ();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_INTEGRATOR
|
|
||||||
|
|
||||||
/* Timer functionality supplied by Integrator board (AP or CP) */
|
/* Timer functionality supplied by Integrator board (AP or CP) */
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,9 @@ clbss_l:str r2, [r0] /* clear loop... */
|
|||||||
cmp r0, r1
|
cmp r0, r1
|
||||||
ble clbss_l
|
ble clbss_l
|
||||||
|
|
||||||
|
bl coloured_LED_init
|
||||||
|
bl red_LED_on
|
||||||
|
|
||||||
ldr pc, _start_armboot
|
ldr pc, _start_armboot
|
||||||
|
|
||||||
_start_armboot:
|
_start_armboot:
|
||||||
@@ -198,8 +201,7 @@ _start_armboot:
|
|||||||
*
|
*
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
*/
|
*/
|
||||||
|
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||||
|
|
||||||
cpu_init_crit:
|
cpu_init_crit:
|
||||||
/*
|
/*
|
||||||
* flush v4 I/D caches
|
* flush v4 I/D caches
|
||||||
@@ -225,6 +227,8 @@ cpu_init_crit:
|
|||||||
bl lowlevel_init /* go setup pll,mux,memory */
|
bl lowlevel_init /* go setup pll,mux,memory */
|
||||||
mov lr, ip /* restore link */
|
mov lr, ip /* restore link */
|
||||||
mov pc, lr /* back to my caller */
|
mov pc, lr /* back to my caller */
|
||||||
|
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -37,144 +37,10 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <arm946es.h>
|
#include <arm946es.h>
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
#define TIMER_LOAD_VAL 0xffffffff
|
#define TIMER_LOAD_VAL 0xffffffff
|
||||||
extern void reset_cpu(ulong addr);
|
extern void reset_cpu(ulong addr);
|
||||||
|
|
||||||
#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 ();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_INTEGRATOR
|
#ifdef CONFIG_INTEGRATOR
|
||||||
/* Timer functionality supplied by Integrator board (AP or CP) */
|
/* Timer functionality supplied by Integrator board (AP or CP) */
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
|
|||||||
LIB = $(obj)lib$(CPU).a
|
LIB = $(obj)lib$(CPU).a
|
||||||
|
|
||||||
START = start.o
|
START = start.o
|
||||||
COBJS = interrupts.o cpu.o
|
COBJS = cpu.o
|
||||||
|
|
||||||
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
|
OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
#include <asm/arch/ixp425.h>
|
#include <asm/arch/ixp425.h>
|
||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
#ifdef CONFIG_USE_IRQ
|
||||||
|
#include <asm/proc-armv/ptrace.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When interrupts are enabled, use timer 2 for time/delay generation...
|
* When interrupts are enabled, use timer 2 for time/delay generation...
|
||||||
*/
|
*/
|
||||||
@@ -50,34 +52,6 @@ static struct _irq_handler IRQ_HANDLER[N_IRQS];
|
|||||||
|
|
||||||
static volatile ulong timestamp;
|
static volatile ulong timestamp;
|
||||||
|
|
||||||
/* enable IRQ/FIQ 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, #0x80\n"
|
|
||||||
"msr cpsr_c, %1"
|
|
||||||
: "=r" (old), "=r" (temp)
|
|
||||||
:
|
|
||||||
: "memory");
|
|
||||||
return (old & 0x80) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void default_isr(void *data)
|
static void default_isr(void *data)
|
||||||
{
|
{
|
||||||
printf("default_isr(): called for IRQ %d, Interrupt Status=%x PR=%x\n",
|
printf("default_isr(): called for IRQ %d, Interrupt Status=%x PR=%x\n",
|
||||||
@@ -111,114 +85,16 @@ void reset_timer (void)
|
|||||||
timestamp = 0;
|
timestamp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* #ifdef CONFIG_USE_IRQ */
|
|
||||||
void enable_interrupts (void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int disable_interrupts (void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* #ifdef CONFIG_USE_IRQ */
|
#endif /* #ifdef CONFIG_USE_IRQ */
|
||||||
|
|
||||||
void bad_mode (void)
|
#ifdef CONFIG_USE_IRQ
|
||||||
{
|
|
||||||
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);
|
|
||||||
printf("IRQ=%08lx FIQ=%08lx\n", *IXP425_ICIH, *IXP425_ICFH);
|
|
||||||
}
|
|
||||||
|
|
||||||
void do_irq (struct pt_regs *pt_regs)
|
void do_irq (struct pt_regs *pt_regs)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_USE_IRQ
|
|
||||||
int irq = next_irq();
|
int irq = next_irq();
|
||||||
|
|
||||||
IRQ_HANDLER[irq].m_func(IRQ_HANDLER[irq].m_data);
|
IRQ_HANDLER[irq].m_func(IRQ_HANDLER[irq].m_data);
|
||||||
#else
|
|
||||||
printf ("interrupt request\n");
|
|
||||||
show_regs (pt_regs);
|
|
||||||
bad_mode ();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int interrupt_init (void)
|
int interrupt_init (void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,8 +33,6 @@
|
|||||||
#include <arm920t.h>
|
#include <arm920t.h>
|
||||||
#include <lh7a40x.h>
|
#include <lh7a40x.h>
|
||||||
|
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
static ulong timer_load_val = 0;
|
static ulong timer_load_val = 0;
|
||||||
|
|
||||||
/* macro to read the 16 bit timer */
|
/* macro to read the 16 bit timer */
|
||||||
@@ -46,139 +44,6 @@ static inline ulong READ_TIMER(void)
|
|||||||
return (timer->value & 0x0000ffff);
|
return (timer->value & 0x0000ffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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 timestamp;
|
||||||
static ulong lastdec;
|
static ulong lastdec;
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
|
PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
|
||||||
|
|
||||||
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||||
is5249=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg))
|
is5249:=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg))
|
||||||
is5253=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg))
|
is5253:=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg))
|
||||||
is5271=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg))
|
is5271:=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg))
|
||||||
is5272=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg))
|
is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg))
|
||||||
is5282=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
|
is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2)
|
ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ void dtimer_intr_setup(void)
|
|||||||
volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE);
|
volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE);
|
||||||
|
|
||||||
intp->icr0[CFG_TMRINTR_NO] = CFG_TMRINTR_PRI;
|
intp->icr0[CFG_TMRINTR_NO] = CFG_TMRINTR_PRI;
|
||||||
intp->imrl0 &= ~0xFFFFFFFE;
|
intp->imrl0 &= 0xFFFFFFFE;
|
||||||
intp->imrl0 &= ~CFG_TMRINTR_MASK;
|
intp->imrl0 &= ~CFG_TMRINTR_MASK;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MCFTMR */
|
#endif /* CONFIG_MCFTMR */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
# MA 02111-1307 USA
|
# MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
v=$(shell $(AS) --version |grep "GNU assembler" |cut -d. -f2)
|
v=$(shell $(AS) --version |grep "GNU assembler" |cut -d. -f2)
|
||||||
MIPSFLAGS=$(shell \
|
MIPSFLAGS:=$(shell \
|
||||||
if [ "$v" -lt "14" ]; then \
|
if [ "$v" -lt "14" ]; then \
|
||||||
echo "-mcpu=4kc"; \
|
echo "-mcpu=4kc"; \
|
||||||
else \
|
else \
|
||||||
|
|||||||
@@ -67,12 +67,14 @@ int get_clocks (void)
|
|||||||
u8 cpmf;
|
u8 cpmf;
|
||||||
u8 sys_div;
|
u8 sys_div;
|
||||||
u8 ips_div;
|
u8 ips_div;
|
||||||
|
u8 pci_div;
|
||||||
u32 ref_clk = CFG_MPC512X_CLKIN;
|
u32 ref_clk = CFG_MPC512X_CLKIN;
|
||||||
u32 spll;
|
u32 spll;
|
||||||
u32 sys_clk;
|
u32 sys_clk;
|
||||||
u32 core_clk;
|
u32 core_clk;
|
||||||
u32 csb_clk;
|
u32 csb_clk;
|
||||||
u32 ips_clk;
|
u32 ips_clk;
|
||||||
|
u32 pci_clk;
|
||||||
|
|
||||||
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
|
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -95,8 +97,16 @@ int get_clocks (void)
|
|||||||
/* in case we cannot get a sane IPS divisor, fail gracefully */
|
/* in case we cannot get a sane IPS divisor, fail gracefully */
|
||||||
ips_clk = 0;
|
ips_clk = 0;
|
||||||
}
|
}
|
||||||
|
pci_div = (im->clk.scfr[0] & SCFR1_PCI_DIV_MASK) >> SCFR1_PCI_DIV_SHIFT;
|
||||||
|
if (pci_div != 0) {
|
||||||
|
pci_clk = csb_clk / pci_div;
|
||||||
|
} else {
|
||||||
|
/* in case we cannot get a sane IPS divisor, fail gracefully */
|
||||||
|
pci_clk = 333333;
|
||||||
|
}
|
||||||
|
|
||||||
gd->ips_clk = ips_clk;
|
gd->ips_clk = ips_clk;
|
||||||
|
gd->pci_clk = pci_clk;
|
||||||
gd->csb_clk = csb_clk;
|
gd->csb_clk = csb_clk;
|
||||||
gd->cpu_clk = core_clk;
|
gd->cpu_clk = core_clk;
|
||||||
gd->bus_clk = csb_clk;
|
gd->bus_clk = csb_clk;
|
||||||
@@ -115,11 +125,12 @@ ulong get_bus_freq (ulong dummy)
|
|||||||
|
|
||||||
int do_clocks (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
int do_clocks (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
printf ("Clock configuration:\n");
|
printf("Clock configuration:\n");
|
||||||
printf (" CPU: %4d MHz\n", gd->cpu_clk / 1000000);
|
printf(" CPU: %4d MHz\n", gd->cpu_clk / 1000000);
|
||||||
printf (" Coherent System Bus: %4d MHz\n", gd->csb_clk / 1000000);
|
printf(" Coherent System Bus: %4d MHz\n", gd->csb_clk / 1000000);
|
||||||
printf (" IPS Bus: %4d MHz\n", gd->ips_clk / 1000000);
|
printf(" IPS Bus: %4d MHz\n", gd->ips_clk / 1000000);
|
||||||
printf (" DDR: %4d MHz\n", 2 * gd->csb_clk / 1000000);
|
printf(" PCI: %4d MHz\n", gd->pci_clk / 1000000);
|
||||||
|
printf(" DDR: %4d MHz\n", 2 * gd->csb_clk / 1000000);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ int interrupt_init (void)
|
|||||||
set_msr (get_msr () | MSR_EE);
|
set_msr (get_msr () | MSR_EE);
|
||||||
|
|
||||||
#ifdef CONFIG_INTERRUPTS
|
#ifdef CONFIG_INTERRUPTS
|
||||||
pic->iivpr1 = 0x810002; /* 50220 enable ecm interrupts */
|
pic->iivpr1 = 0x810001; /* 50220 enable ecm interrupts */
|
||||||
debug("iivpr1@%x = %x\n",&pic->iivpr1, pic->iivpr1);
|
debug("iivpr1@%x = %x\n",&pic->iivpr1, pic->iivpr1);
|
||||||
|
|
||||||
pic->iivpr2 = 0x810002; /* 50240 enable ddr interrupts */
|
pic->iivpr2 = 0x810002; /* 50240 enable ddr interrupts */
|
||||||
|
|||||||
@@ -992,7 +992,6 @@ trap_reloc:
|
|||||||
|
|
||||||
blr
|
blr
|
||||||
|
|
||||||
#ifdef CFG_INIT_RAM_LOCK
|
|
||||||
.globl unlock_ram_in_cache
|
.globl unlock_ram_in_cache
|
||||||
unlock_ram_in_cache:
|
unlock_ram_in_cache:
|
||||||
/* invalidate the INIT_RAM section */
|
/* invalidate the INIT_RAM section */
|
||||||
@@ -1002,11 +1001,20 @@ unlock_ram_in_cache:
|
|||||||
andi. r4,r4,0x1ff
|
andi. r4,r4,0x1ff
|
||||||
slwi r4,r4,(10 - 1 - L1_CACHE_SHIFT)
|
slwi r4,r4,(10 - 1 - L1_CACHE_SHIFT)
|
||||||
mtctr r4
|
mtctr r4
|
||||||
1: icbi r0,r3
|
1: dcbi r0,r3
|
||||||
dcbi r0,r3
|
|
||||||
addi r3,r3,CFG_CACHELINE_SIZE
|
addi r3,r3,CFG_CACHELINE_SIZE
|
||||||
bdnz 1b
|
bdnz 1b
|
||||||
sync /* Wait for all icbi to complete on bus */
|
sync
|
||||||
|
|
||||||
|
/* Invalidate the TLB entries for the cache */
|
||||||
|
lis r3,CFG_INIT_RAM_ADDR@h
|
||||||
|
ori r3,r3,CFG_INIT_RAM_ADDR@l
|
||||||
|
tlbivax 0,r3
|
||||||
|
addi r3,r3,0x1000
|
||||||
|
tlbivax 0,r3
|
||||||
|
addi r3,r3,0x1000
|
||||||
|
tlbivax 0,r3
|
||||||
|
addi r3,r3,0x1000
|
||||||
|
tlbivax 0,r3
|
||||||
isync
|
isync
|
||||||
blr
|
blr
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -28,13 +28,20 @@ include $(TOPDIR)/config.mk
|
|||||||
|
|
||||||
LIB = $(obj)lib$(CPU).a
|
LIB = $(obj)lib$(CPU).a
|
||||||
|
|
||||||
START = start.o #resetvec.o
|
START = start.o
|
||||||
SOBJS = cache.o
|
SOBJS = cache.o
|
||||||
COBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o \
|
|
||||||
spd_sdram.o
|
|
||||||
|
|
||||||
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
COBJS-y += traps.o
|
||||||
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
COBJS-y += cpu.o
|
||||||
|
COBJS-y += cpu_init.o
|
||||||
|
COBJS-y += speed.o
|
||||||
|
COBJS-y += interrupts.o
|
||||||
|
COBJS-y += spd_sdram.o
|
||||||
|
|
||||||
|
COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
|
||||||
|
|
||||||
|
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
|
||||||
START := $(addprefix $(obj),$(START))
|
START := $(addprefix $(obj),$(START))
|
||||||
|
|
||||||
all: $(obj).depend $(START) $(LIB)
|
all: $(obj).depend $(START) $(LIB)
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
#include <mpc86xx.h>
|
#include <mpc86xx.h>
|
||||||
#include <asm/fsl_law.h>
|
#include <asm/fsl_law.h>
|
||||||
|
|
||||||
#if defined(CONFIG_OF_FLAT_TREE)
|
|
||||||
#include <ft_build.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
checkcpu(void)
|
checkcpu(void)
|
||||||
@@ -269,64 +266,6 @@ dma_xfer(void *dest, uint count, void *src)
|
|||||||
#endif /* CONFIG_DDR_ECC */
|
#endif /* CONFIG_DDR_ECC */
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_OF_FLAT_TREE
|
|
||||||
void
|
|
||||||
ft_cpu_setup(void *blob, bd_t *bd)
|
|
||||||
{
|
|
||||||
u32 *p;
|
|
||||||
ulong clock;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
clock = bd->bi_busfreq;
|
|
||||||
p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
*p = cpu_to_be32(clock);
|
|
||||||
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/serial@4500/clock-frequency", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
*p = cpu_to_be32(clock);
|
|
||||||
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/serial@4600/clock-frequency", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
*p = cpu_to_be32(clock);
|
|
||||||
|
|
||||||
#if defined(CONFIG_TSEC1)
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enetaddr, 6);
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/local-mac-address", &len);
|
|
||||||
if (p)
|
|
||||||
memcpy(p, bd->bi_enetaddr, 6);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_TSEC2)
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enet1addr, 6);
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/local-mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enet1addr, 6);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_TSEC3)
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enet2addr, 6);
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/local-mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enet2addr, 6);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_TSEC4)
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enet3addr, 6);
|
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/local-mac-address", &len);
|
|
||||||
if (p != NULL)
|
|
||||||
memcpy(p, bd->bi_enet3addr, 6);
|
|
||||||
#endif
|
|
||||||
#endif /* CONFIG_OF_FLAT_TREE */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print out the state of various machine registers.
|
* Print out the state of various machine registers.
|
||||||
* Currently prints out LAWs and BR0/OR0
|
* Currently prints out LAWs and BR0/OR0
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <mpc86xx.h>
|
#include <mpc86xx.h>
|
||||||
|
#include <asm/fsl_law.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
|||||||
35
cpu/mpc86xx/fdt.c
Normal file
35
cpu/mpc86xx/fdt.c
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2008 Freescale Semiconductor, Inc.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* Version 2 as published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
|
||||||
|
void ft_cpu_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
|
||||||
|
"timebase-frequency", bd->bi_busfreq / 4, 1);
|
||||||
|
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
|
||||||
|
"bus-frequency", bd->bi_busfreq, 1);
|
||||||
|
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
|
||||||
|
"clock-frequency", bd->bi_intfreq, 1);
|
||||||
|
do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
|
||||||
|
"bus-frequency", bd->bi_busfreq, 1);
|
||||||
|
|
||||||
|
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
|
||||||
|
|
||||||
|
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
|
||||||
|
|| defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
|
||||||
|
fdt_fixup_ethernet(blob, bd);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CFG_NS16550
|
||||||
|
do_fixup_by_compat_u32(blob, "ns16550",
|
||||||
|
"clock-frequency", bd->bi_busfreq, 1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -943,7 +943,7 @@ unsigned int enable_ddr(unsigned int ddr_num)
|
|||||||
spd_eeprom_t spd1,spd2;
|
spd_eeprom_t spd1,spd2;
|
||||||
volatile ccsr_ddr_t *ddr;
|
volatile ccsr_ddr_t *ddr;
|
||||||
unsigned sdram_cfg_1;
|
unsigned sdram_cfg_1;
|
||||||
unsigned char sdram_type, mem_type, config, mod_attr;
|
unsigned char sdram_type, mem_type, mod_attr;
|
||||||
unsigned char d_init;
|
unsigned char d_init;
|
||||||
unsigned int no_dimm1=0, no_dimm2=0;
|
unsigned int no_dimm1=0, no_dimm2=0;
|
||||||
|
|
||||||
@@ -1017,6 +1017,10 @@ unsigned int enable_ddr(unsigned int ddr_num)
|
|||||||
printf("No memory modules found for DDR controller %d!!\n", ddr_num);
|
printf("No memory modules found for DDR controller %d!!\n", ddr_num);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
#if defined(CONFIG_DDR_ECC)
|
||||||
|
unsigned char config;
|
||||||
|
#endif
|
||||||
mem_type = no_dimm2 ? spd1.mem_type : spd2.mem_type;
|
mem_type = no_dimm2 ? spd1.mem_type : spd2.mem_type;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1122,8 +1126,8 @@ spd_sdram(void)
|
|||||||
int memsize_ddr1_dimm2 = 0;
|
int memsize_ddr1_dimm2 = 0;
|
||||||
int memsize_ddr1 = 0;
|
int memsize_ddr1 = 0;
|
||||||
unsigned int law_size_ddr1;
|
unsigned int law_size_ddr1;
|
||||||
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
|
||||||
#ifdef CONFIG_DDR_INTERLEAVE
|
#ifdef CONFIG_DDR_INTERLEAVE
|
||||||
|
volatile immap_t *immap = (immap_t *)CFG_IMMR;
|
||||||
volatile ccsr_ddr_t *ddr1 = &immap->im_ddr1;
|
volatile ccsr_ddr_t *ddr1 = &immap->im_ddr1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1183,7 +1187,6 @@ spd_sdram(void)
|
|||||||
#endif
|
#endif
|
||||||
debug("Interleaved memory size is 0x%08lx\n", memsize_total);
|
debug("Interleaved memory size is 0x%08lx\n", memsize_total);
|
||||||
|
|
||||||
#ifdef CONFIG_DDR_INTERLEAVE
|
|
||||||
#if (CFG_PAGE_INTERLEAVING == 1)
|
#if (CFG_PAGE_INTERLEAVING == 1)
|
||||||
printf("Page ");
|
printf("Page ");
|
||||||
#elif (CFG_BANK_INTERLEAVING == 1)
|
#elif (CFG_BANK_INTERLEAVING == 1)
|
||||||
@@ -1192,7 +1195,6 @@ spd_sdram(void)
|
|||||||
printf("Super-bank ");
|
printf("Super-bank ");
|
||||||
#else
|
#else
|
||||||
printf("Cache-line ");
|
printf("Cache-line ");
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
printf("Interleaved");
|
printf("Interleaved");
|
||||||
return memsize_total * 1024 * 1024;
|
return memsize_total * 1024 * 1024;
|
||||||
|
|||||||
@@ -487,6 +487,9 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
|
|||||||
#endif
|
#endif
|
||||||
u32 bd_cached;
|
u32 bd_cached;
|
||||||
u32 bd_uncached = 0;
|
u32 bd_uncached = 0;
|
||||||
|
#ifdef CONFIG_4xx_DCACHE
|
||||||
|
static u32 last_used_ea = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
EMAC_4XX_HW_PST hw_p = dev->priv;
|
EMAC_4XX_HW_PST hw_p = dev->priv;
|
||||||
|
|
||||||
@@ -850,7 +853,12 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
|
|||||||
|
|
||||||
#ifdef CONFIG_4xx_DCACHE
|
#ifdef CONFIG_4xx_DCACHE
|
||||||
flush_dcache_range(bd_cached, bd_cached + MAL_ALLOC_SIZE);
|
flush_dcache_range(bd_cached, bd_cached + MAL_ALLOC_SIZE);
|
||||||
bd_uncached = bis->bi_memsize;
|
if (!last_used_ea)
|
||||||
|
bd_uncached = bis->bi_memsize;
|
||||||
|
else
|
||||||
|
bd_uncached = last_used_ea + MAL_ALLOC_SIZE;
|
||||||
|
|
||||||
|
last_used_ea = bd_uncached;
|
||||||
program_tlb(bd_cached, bd_uncached, MAL_ALLOC_SIZE,
|
program_tlb(bd_cached, bd_uncached, MAL_ALLOC_SIZE,
|
||||||
TLB_WORD2_I_ENABLE);
|
TLB_WORD2_I_ENABLE);
|
||||||
#else
|
#else
|
||||||
@@ -967,9 +975,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
|
|||||||
/* set transmit enable & receive enable */
|
/* set transmit enable & receive enable */
|
||||||
out_be32((void *)EMAC_M0 + hw_p->hw_addr, EMAC_M0_TXE | EMAC_M0_RXE);
|
out_be32((void *)EMAC_M0 + hw_p->hw_addr, EMAC_M0_TXE | EMAC_M0_RXE);
|
||||||
|
|
||||||
/* set receive fifo to 4k and tx fifo to 2k */
|
|
||||||
mode_reg = in_be32((void *)EMAC_M1 + hw_p->hw_addr);
|
mode_reg = in_be32((void *)EMAC_M1 + hw_p->hw_addr);
|
||||||
mode_reg |= EMAC_M1_RFS_4K | EMAC_M1_TX_FIFO_2K;
|
|
||||||
|
/* set rx-/tx-fifo size */
|
||||||
|
mode_reg = (mode_reg & ~EMAC_MR1_FIFO_MASK) | EMAC_MR1_FIFO_SIZE;
|
||||||
|
|
||||||
/* set speed */
|
/* set speed */
|
||||||
if (speed == _1000BASET) {
|
if (speed == _1000BASET) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing
|
|||||||
PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float
|
PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float
|
||||||
|
|
||||||
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||||
is440=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg))
|
is440:=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg))
|
||||||
|
|
||||||
ifneq (,$(findstring CONFIG_440,$(is440)))
|
ifneq (,$(findstring CONFIG_440,$(is440)))
|
||||||
PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440
|
PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440
|
||||||
|
|||||||
@@ -30,126 +30,9 @@
|
|||||||
#include <asm/arch/pxa-regs.h>
|
#include <asm/arch/pxa-regs.h>
|
||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
#ifdef CONFIG_USE_IRQ
|
||||||
/* enable IRQ/FIQ interrupts */
|
|
||||||
void enable_interrupts (void)
|
|
||||||
{
|
|
||||||
#error: interrupts not implemented yet
|
#error: interrupts not implemented yet
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* disable IRQ/FIQ interrupts
|
|
||||||
* returns true if interrupts had been enabled before we disabled them
|
|
||||||
*/
|
|
||||||
int disable_interrupts (void)
|
|
||||||
{
|
|
||||||
#error: interrupts not implemented yet
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void enable_interrupts (void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int disable_interrupts (void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
#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 ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int interrupt_init (void)
|
int interrupt_init (void)
|
||||||
{
|
{
|
||||||
/* nothing happens here - we don't setup any IRQs */
|
/* nothing happens here - we don't setup any IRQs */
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ mmc_write(uchar * src, ulong dst, int size)
|
|||||||
|
|
||||||
ulong
|
ulong
|
||||||
/****************************************************/
|
/****************************************************/
|
||||||
mmc_bread(int dev_num, ulong blknr, ulong blkcnt, ulong * dst)
|
mmc_bread(int dev_num, ulong blknr, lbaint_t blkcnt, void *dst)
|
||||||
/****************************************************/
|
/****************************************************/
|
||||||
{
|
{
|
||||||
int mmc_block_size = MMC_BLOCK_SIZE;
|
int mmc_block_size = MMC_BLOCK_SIZE;
|
||||||
|
|||||||
@@ -27,8 +27,6 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <asm/hardware.h>
|
#include <asm/hardware.h>
|
||||||
|
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
/* we always count down the max. */
|
/* we always count down the max. */
|
||||||
#define TIMER_LOAD_VAL 0xffff
|
#define TIMER_LOAD_VAL 0xffff
|
||||||
|
|
||||||
@@ -37,110 +35,8 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
#ifdef CONFIG_USE_IRQ
|
||||||
#error CONFIG_USE_IRQ NOT supported
|
#error CONFIG_USE_IRQ NOT supported
|
||||||
#else
|
|
||||||
void enable_interrupts (void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int disable_interrupts (void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
#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 timestamp;
|
||||||
static ulong lastdec;
|
static ulong lastdec;
|
||||||
|
|
||||||
|
|||||||
@@ -29,143 +29,6 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <SA-1100.h>
|
#include <SA-1100.h>
|
||||||
|
|
||||||
#include <asm/proc-armv/ptrace.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_USE_IRQ
|
|
||||||
/* enable IRQ/FIQ 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, #0x80\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 ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int interrupt_init (void)
|
int interrupt_init (void)
|
||||||
{
|
{
|
||||||
/* nothing happens here - we don't setup any IRQs */
|
/* nothing happens here - we don't setup any IRQs */
|
||||||
|
|||||||
@@ -65,3 +65,9 @@ Examples;
|
|||||||
* 40 is SYSCLK, 2.5 is COREPLL ratio, 10 is MPXPLL ratio
|
* 40 is SYSCLK, 2.5 is COREPLL ratio, 10 is MPXPLL ratio
|
||||||
*/
|
*/
|
||||||
pixis-reset altbank cf 40 2.5 10
|
pixis-reset altbank cf 40 2.5 10
|
||||||
|
|
||||||
|
|
||||||
|
DIP Switch Settings
|
||||||
|
-------------------
|
||||||
|
To manually switch the flash banks using the DIP switch
|
||||||
|
settings, toggle both SW6:1 and SW6:2.
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include "biosemui.h"
|
#include "biosemui.h"
|
||||||
|
|
||||||
BE_sysEnv _BE_env = {{0}};
|
BE_sysEnv _BE_env = {{0}};
|
||||||
static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = {
|
static X86EMU_memFuncs _BE_mem __attribute__((section(GOT2_TYPE))) = {
|
||||||
BE_rdb,
|
BE_rdb,
|
||||||
BE_rdw,
|
BE_rdw,
|
||||||
BE_rdl,
|
BE_rdl,
|
||||||
@@ -62,7 +62,7 @@ static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = {
|
|||||||
BE_wrl,
|
BE_wrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
static X86EMU_pioFuncs _BE_pio __attribute__((section(".got2"))) = {
|
static X86EMU_pioFuncs _BE_pio __attribute__((section(GOT2_TYPE))) = {
|
||||||
BE_inb,
|
BE_inb,
|
||||||
BE_inw,
|
BE_inw,
|
||||||
BE_inl,
|
BE_inl,
|
||||||
|
|||||||
@@ -53,6 +53,16 @@ typedef u16 X86EMU_pioAddr;
|
|||||||
|
|
||||||
/*---------------------- Macros and type definitions ----------------------*/
|
/*---------------------- Macros and type definitions ----------------------*/
|
||||||
|
|
||||||
|
#if defined (CONFIG_ARM)
|
||||||
|
#define GAS_LINE_COMMENT "@"
|
||||||
|
#elif defined(CONFIG_MIPS) || defined(CONFIG_PPC)
|
||||||
|
#define GAS_LINE_COMMENT "#"
|
||||||
|
#elif defined (CONFIG_SH)
|
||||||
|
#define GAS_LINE_COMMENT "!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define GOT2_TYPE ".got2,\"aw\"\t"GAS_LINE_COMMENT
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ static char *x86emu_GenOpName[8] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* used by several opcodes */
|
/* used by several opcodes */
|
||||||
static u8 (*genop_byte_operation[])(u8 d, u8 s) __attribute__ ((section(".got2"))) =
|
static u8 (*genop_byte_operation[])(u8 d, u8 s) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
add_byte, /* 00 */
|
add_byte, /* 00 */
|
||||||
or_byte, /* 01 */
|
or_byte, /* 01 */
|
||||||
@@ -103,7 +103,7 @@ static u8 (*genop_byte_operation[])(u8 d, u8 s) __attribute__ ((section(".got2")
|
|||||||
cmp_byte, /* 07 */
|
cmp_byte, /* 07 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static u16 (*genop_word_operation[])(u16 d, u16 s) __attribute__ ((section(".got2"))) =
|
static u16 (*genop_word_operation[])(u16 d, u16 s) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
add_word, /*00 */
|
add_word, /*00 */
|
||||||
or_word, /*01 */
|
or_word, /*01 */
|
||||||
@@ -115,7 +115,7 @@ static u16 (*genop_word_operation[])(u16 d, u16 s) __attribute__ ((section(".got
|
|||||||
cmp_word, /*07 */
|
cmp_word, /*07 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static u32 (*genop_long_operation[])(u32 d, u32 s) __attribute__ ((section(".got2"))) =
|
static u32 (*genop_long_operation[])(u32 d, u32 s) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
add_long, /*00 */
|
add_long, /*00 */
|
||||||
or_long, /*01 */
|
or_long, /*01 */
|
||||||
@@ -128,7 +128,7 @@ static u32 (*genop_long_operation[])(u32 d, u32 s) __attribute__ ((section(".got
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* used by opcodes 80, c0, d0, and d2. */
|
/* used by opcodes 80, c0, d0, and d2. */
|
||||||
static u8(*opcD0_byte_operation[])(u8 d, u8 s) __attribute__ ((section(".got2"))) =
|
static u8(*opcD0_byte_operation[])(u8 d, u8 s) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
rol_byte,
|
rol_byte,
|
||||||
ror_byte,
|
ror_byte,
|
||||||
@@ -141,7 +141,7 @@ static u8(*opcD0_byte_operation[])(u8 d, u8 s) __attribute__ ((section(".got2"))
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* used by opcodes c1, d1, and d3. */
|
/* used by opcodes c1, d1, and d3. */
|
||||||
static u16(*opcD1_word_operation[])(u16 s, u8 d) __attribute__ ((section(".got2"))) =
|
static u16(*opcD1_word_operation[])(u16 s, u8 d) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
rol_word,
|
rol_word,
|
||||||
ror_word,
|
ror_word,
|
||||||
@@ -154,7 +154,7 @@ static u16(*opcD1_word_operation[])(u16 s, u8 d) __attribute__ ((section(".got2"
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* used by opcodes c1, d1, and d3. */
|
/* used by opcodes c1, d1, and d3. */
|
||||||
static u32 (*opcD1_long_operation[])(u32 s, u8 d) __attribute__ ((section(".got2"))) =
|
static u32 (*opcD1_long_operation[])(u32 s, u8 d) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
rol_long,
|
rol_long,
|
||||||
ror_long,
|
ror_long,
|
||||||
@@ -5147,7 +5147,7 @@ void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Single byte operation code table:
|
* Single byte operation code table:
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
void (*x86emu_optab[256])(u8) __attribute__ ((section(".got2"))) =
|
void (*x86emu_optab[256])(u8) __attribute__ ((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
/* 0x00 */ x86emuOp_genop_byte_RM_R,
|
/* 0x00 */ x86emuOp_genop_byte_RM_R,
|
||||||
/* 0x01 */ x86emuOp_genop_word_RM_R,
|
/* 0x01 */ x86emuOp_genop_word_RM_R,
|
||||||
|
|||||||
@@ -1498,7 +1498,7 @@ void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Double byte operation code table:
|
* Double byte operation code table:
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
void (*x86emu_optab2[256])(u8) __attribute__((section(".got2"))) =
|
void (*x86emu_optab2[256])(u8) __attribute__((section(GOT2_TYPE))) =
|
||||||
{
|
{
|
||||||
/* 0x00 */ x86emuOp2_illegal_op, /* Group F (ring 0 PM) */
|
/* 0x00 */ x86emuOp2_illegal_op, /* Group F (ring 0 PM) */
|
||||||
/* 0x01 */ x86emuOp2_illegal_op, /* Group G (ring 0 PM) */
|
/* 0x01 */ x86emuOp2_illegal_op, /* Group G (ring 0 PM) */
|
||||||
|
|||||||
@@ -179,7 +179,13 @@ int dtt_init (void)
|
|||||||
|
|
||||||
int dtt_get_temp(int sensor)
|
int dtt_get_temp(int sensor)
|
||||||
{
|
{
|
||||||
return (dtt_read(sensor, DTT_READ_TEMP) / 256);
|
int const ret = dtt_read(sensor, DTT_READ_TEMP);
|
||||||
|
|
||||||
|
if (ret < 0) {
|
||||||
|
printf("DTT temperature read failed.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return (int)((int16_t) ret / 256);
|
||||||
} /* dtt_get_temp() */
|
} /* dtt_get_temp() */
|
||||||
|
|
||||||
#endif /* CONFIG_DTT_LM75 */
|
#endif /* CONFIG_DTT_LM75 */
|
||||||
|
|||||||
@@ -1538,7 +1538,12 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry)
|
|||||||
{
|
{
|
||||||
int cfi_offset;
|
int cfi_offset;
|
||||||
|
|
||||||
flash_write_cmd (info, 0, 0, info->cmd_reset);
|
/* We do not yet know what kind of commandset to use, so we issue
|
||||||
|
the reset command in both Intel and AMD variants, in the hope
|
||||||
|
that AMD flash roms ignore the Intel command. */
|
||||||
|
flash_write_cmd (info, 0, 0, AMD_CMD_RESET);
|
||||||
|
flash_write_cmd (info, 0, 0, FLASH_CMD_RESET);
|
||||||
|
|
||||||
for (cfi_offset=0;
|
for (cfi_offset=0;
|
||||||
cfi_offset < sizeof(flash_offset_cfi) / sizeof(uint);
|
cfi_offset < sizeof(flash_offset_cfi) / sizeof(uint);
|
||||||
cfi_offset++) {
|
cfi_offset++) {
|
||||||
|
|||||||
@@ -26,24 +26,30 @@
|
|||||||
AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
|
AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
|
||||||
static AT91S_DataFlash DataFlashInst;
|
static AT91S_DataFlash DataFlashInst;
|
||||||
|
|
||||||
|
struct dataflash_addr {
|
||||||
|
unsigned long addr;
|
||||||
|
int cs;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_AT91SAM9260EK
|
#ifdef CONFIG_AT91SAM9260EK
|
||||||
int cs[][CFG_MAX_DATAFLASH_BANKS] = {
|
struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
|
||||||
{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */
|
{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */
|
||||||
{CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
|
{CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
|
||||||
};
|
};
|
||||||
#elif defined(CONFIG_AT91SAM9263EK)
|
#elif defined(CONFIG_AT91SAM9263EK) || defined(CONFIG_AT91CAP9ADK)
|
||||||
int cs[][CFG_MAX_DATAFLASH_BANKS] = {
|
struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
|
||||||
{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0} /* Logical adress, CS */
|
{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
int cs[][CFG_MAX_DATAFLASH_BANKS] = {
|
struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
|
||||||
{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */
|
{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */
|
||||||
{CFG_DATAFLASH_LOGIC_ADDR_CS3, 3}
|
{CFG_DATAFLASH_LOGIC_ADDR_CS3, 3}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*define the area offsets*/
|
/*define the area offsets*/
|
||||||
#if defined(CONFIG_AT91SAM9261EK) || defined(CONFIG_AT91SAM9260EK) || defined(CONFIG_AT91SAM9263EK)
|
#if defined(CONFIG_AT91SAM9261EK) || defined(CONFIG_AT91SAM9260EK) || \
|
||||||
|
defined(CONFIG_AT91SAM9263EK) || defined(CONFIG_AT91CAP9ADK)
|
||||||
#if defined(CONFIG_NEW_PARTITION)
|
#if defined(CONFIG_NEW_PARTITION)
|
||||||
dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
|
dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
|
||||||
{0x00000000, 0x00003FFF, FLAG_PROTECT_SET, 0, "Bootstrap"}, /* ROM code */
|
{0x00000000, 0x00003FFF, FLAG_PROTECT_SET, 0, "Bootstrap"}, /* ROM code */
|
||||||
@@ -114,7 +120,7 @@ int AT91F_DataflashInit (void)
|
|||||||
dataflash_info[i].Desc.state = IDLE;
|
dataflash_info[i].Desc.state = IDLE;
|
||||||
dataflash_info[i].id = 0;
|
dataflash_info[i].id = 0;
|
||||||
dataflash_info[i].Device.pages_number = 0;
|
dataflash_info[i].Device.pages_number = 0;
|
||||||
dfcode = AT91F_DataflashProbe (cs[i][1],
|
dfcode = AT91F_DataflashProbe (cs[i].cs,
|
||||||
&dataflash_info[i].Desc);
|
&dataflash_info[i].Desc);
|
||||||
|
|
||||||
switch (dfcode) {
|
switch (dfcode) {
|
||||||
@@ -123,9 +129,9 @@ int AT91F_DataflashInit (void)
|
|||||||
dataflash_info[i].Device.pages_size = 528;
|
dataflash_info[i].Device.pages_size = 528;
|
||||||
dataflash_info[i].Device.page_offset = 10;
|
dataflash_info[i].Device.page_offset = 10;
|
||||||
dataflash_info[i].Device.byte_mask = 0x300;
|
dataflash_info[i].Device.byte_mask = 0x300;
|
||||||
dataflash_info[i].Device.cs = cs[i][1];
|
dataflash_info[i].Device.cs = cs[i].cs;
|
||||||
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
||||||
dataflash_info[i].logical_address = cs[i][0];
|
dataflash_info[i].logical_address = cs[i].addr;
|
||||||
dataflash_info[i].id = dfcode;
|
dataflash_info[i].id = dfcode;
|
||||||
found[i] += dfcode;;
|
found[i] += dfcode;;
|
||||||
break;
|
break;
|
||||||
@@ -135,9 +141,9 @@ int AT91F_DataflashInit (void)
|
|||||||
dataflash_info[i].Device.pages_size = 528;
|
dataflash_info[i].Device.pages_size = 528;
|
||||||
dataflash_info[i].Device.page_offset = 10;
|
dataflash_info[i].Device.page_offset = 10;
|
||||||
dataflash_info[i].Device.byte_mask = 0x300;
|
dataflash_info[i].Device.byte_mask = 0x300;
|
||||||
dataflash_info[i].Device.cs = cs[i][1];
|
dataflash_info[i].Device.cs = cs[i].cs;
|
||||||
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
||||||
dataflash_info[i].logical_address = cs[i][0];
|
dataflash_info[i].logical_address = cs[i].addr;
|
||||||
dataflash_info[i].id = dfcode;
|
dataflash_info[i].id = dfcode;
|
||||||
found[i] += dfcode;;
|
found[i] += dfcode;;
|
||||||
break;
|
break;
|
||||||
@@ -147,9 +153,9 @@ int AT91F_DataflashInit (void)
|
|||||||
dataflash_info[i].Device.pages_size = 1056;
|
dataflash_info[i].Device.pages_size = 1056;
|
||||||
dataflash_info[i].Device.page_offset = 11;
|
dataflash_info[i].Device.page_offset = 11;
|
||||||
dataflash_info[i].Device.byte_mask = 0x700;
|
dataflash_info[i].Device.byte_mask = 0x700;
|
||||||
dataflash_info[i].Device.cs = cs[i][1];
|
dataflash_info[i].Device.cs = cs[i].cs;
|
||||||
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
||||||
dataflash_info[i].logical_address = cs[i][0];
|
dataflash_info[i].logical_address = cs[i].addr;
|
||||||
dataflash_info[i].id = dfcode;
|
dataflash_info[i].id = dfcode;
|
||||||
found[i] += dfcode;;
|
found[i] += dfcode;;
|
||||||
break;
|
break;
|
||||||
@@ -159,9 +165,9 @@ int AT91F_DataflashInit (void)
|
|||||||
dataflash_info[i].Device.pages_size = 1056;
|
dataflash_info[i].Device.pages_size = 1056;
|
||||||
dataflash_info[i].Device.page_offset = 11;
|
dataflash_info[i].Device.page_offset = 11;
|
||||||
dataflash_info[i].Device.byte_mask = 0x700;
|
dataflash_info[i].Device.byte_mask = 0x700;
|
||||||
dataflash_info[i].Device.cs = cs[i][1];
|
dataflash_info[i].Device.cs = cs[i].cs;
|
||||||
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
||||||
dataflash_info[i].logical_address = cs[i][0];
|
dataflash_info[i].logical_address = cs[i].addr;
|
||||||
dataflash_info[i].id = dfcode;
|
dataflash_info[i].id = dfcode;
|
||||||
found[i] += dfcode;;
|
found[i] += dfcode;;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -417,10 +417,18 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
|
|||||||
|
|
||||||
/* choose RMII or MII mode. This depends on the board */
|
/* choose RMII or MII mode. This depends on the board */
|
||||||
#ifdef CONFIG_RMII
|
#ifdef CONFIG_RMII
|
||||||
|
#ifdef CONFIG_AT91CAP9ADK
|
||||||
|
macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
|
||||||
|
#else
|
||||||
macb_writel(macb, USRIO, 0);
|
macb_writel(macb, USRIO, 0);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifdef CONFIG_AT91CAP9ADK
|
||||||
|
macb_writel(macb, USRIO, MACB_BIT(CLKEN));
|
||||||
#else
|
#else
|
||||||
macb_writel(macb, USRIO, MACB_BIT(MII));
|
macb_writel(macb, USRIO, MACB_BIT(MII));
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* CONFIG_RMII */
|
||||||
|
|
||||||
if (!macb_phy_init(macb))
|
if (!macb_phy_init(macb))
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user