mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
330 Commits
v2013.01-r
...
v2013.01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a9d879f6f | ||
|
|
df3ad6c81d | ||
|
|
981481958f | ||
|
|
f1972e3255 | ||
|
|
dfe361098d | ||
|
|
a6720762c8 | ||
|
|
44a53b5743 | ||
|
|
dad631ccf7 | ||
|
|
a17617d655 | ||
|
|
1199c377cf | ||
|
|
e4660e0b73 | ||
|
|
02a58b9340 | ||
|
|
d04df3c6ad | ||
|
|
11d80af487 | ||
|
|
acbb4457ab | ||
|
|
bf0c2245a2 | ||
|
|
6efbe21990 | ||
|
|
e0df5353fb | ||
|
|
4c6b235059 | ||
|
|
3c41e90118 | ||
|
|
d17087cd01 | ||
|
|
abbab70363 | ||
|
|
961ffc7759 | ||
|
|
fd70aa4146 | ||
|
|
7a8e739cd5 | ||
|
|
59ee45ee91 | ||
|
|
a2468dedef | ||
|
|
99e516295f | ||
|
|
5374d386f8 | ||
|
|
c39e969e8e | ||
|
|
039cbaefcf | ||
|
|
7de0fe1ac3 | ||
|
|
94bcfe524c | ||
|
|
0e29a24814 | ||
|
|
6fb4d74e59 | ||
|
|
58bd77db9d | ||
|
|
80e409508b | ||
|
|
2f8d8d6b3a | ||
|
|
fe34f8dc8c | ||
|
|
15a33e49de | ||
|
|
e2e3e2b1be | ||
|
|
b2b92f5315 | ||
|
|
06fd853890 | ||
|
|
eae78c3406 | ||
|
|
724cdffca1 | ||
|
|
44df5e8d30 | ||
|
|
d2af028db3 | ||
|
|
ac6b911514 | ||
|
|
03deff433e | ||
|
|
20043a4c3c | ||
|
|
07b2c5c0e5 | ||
|
|
61b59e2749 | ||
|
|
7b4bd121b6 | ||
|
|
1673f199d9 | ||
|
|
9b572852c0 | ||
|
|
4050f0700f | ||
|
|
e00be0d30b | ||
|
|
cd577e2b58 | ||
|
|
612404c28a | ||
|
|
17c5ef2007 | ||
|
|
2b16e51c2f | ||
|
|
ea33fb1a32 | ||
|
|
642ef40bdc | ||
|
|
449485948e | ||
|
|
c6d647e309 | ||
|
|
bfbfab94fd | ||
|
|
3e75e69668 | ||
|
|
23c9946a3b | ||
|
|
7202e8ae51 | ||
|
|
9d86f0c30b | ||
|
|
0a16ea5933 | ||
|
|
136846d77f | ||
|
|
37bead1a70 | ||
|
|
06610e1826 | ||
|
|
2472216cac | ||
|
|
91c038f087 | ||
|
|
61bdb91335 | ||
|
|
e05e5de7fa | ||
|
|
7528cf5f01 | ||
|
|
79f3877794 | ||
|
|
9a0c4f9b87 | ||
|
|
6abd1620be | ||
|
|
69c6f976a1 | ||
|
|
e18bf1f9f2 | ||
|
|
4d3acb9df3 | ||
|
|
cb9b23cda9 | ||
|
|
2f26975df5 | ||
|
|
5d50659dbf | ||
|
|
2b8a053344 | ||
|
|
6647c7ac8e | ||
|
|
f482310c6d | ||
|
|
72dbff12a7 | ||
|
|
d1e8d2cad0 | ||
|
|
f0b1619118 | ||
|
|
a0f816b6bb | ||
|
|
a9d2ae7014 | ||
|
|
d055911887 | ||
|
|
c34253d1fc | ||
|
|
961a54ce1b | ||
|
|
c2425b66c3 | ||
|
|
7a84e1fa22 | ||
|
|
1411fb37b5 | ||
|
|
085e728aa5 | ||
|
|
d22925108e | ||
|
|
7093f85c9e | ||
|
|
49ea0ff5cc | ||
|
|
de7d02aeba | ||
|
|
fb8302bfc5 | ||
|
|
e660c44d9e | ||
|
|
1f75b54150 | ||
|
|
35777e2226 | ||
|
|
54bb84115d | ||
|
|
e56cdd778c | ||
|
|
a08afb398b | ||
|
|
a527757316 | ||
|
|
2f994fe622 | ||
|
|
589b1afdb5 | ||
|
|
fe51f78714 | ||
|
|
aef8af6a3d | ||
|
|
8dd15b43b0 | ||
|
|
f1cbca2be5 | ||
|
|
540b5af281 | ||
|
|
3ea93948cf | ||
|
|
cc9fe33a36 | ||
|
|
1b652071d0 | ||
|
|
fa442bbb3f | ||
|
|
07235ef8a3 | ||
|
|
b189a83a08 | ||
|
|
f8cfcf1b1c | ||
|
|
da77a0e593 | ||
|
|
96764df1b4 | ||
|
|
ba6d4b64b3 | ||
|
|
ba427678a4 | ||
|
|
42e1321874 | ||
|
|
41984e7123 | ||
|
|
854a7836dc | ||
|
|
41b13bc7c4 | ||
|
|
e3c52f2b87 | ||
|
|
bb474b8187 | ||
|
|
1a2621bab8 | ||
|
|
46dc5bcade | ||
|
|
92ace272d0 | ||
|
|
7a546db2ff | ||
|
|
3779c8e319 | ||
|
|
4823b45da2 | ||
|
|
2400727318 | ||
|
|
a683c288d4 | ||
|
|
a098cf41fd | ||
|
|
095728803e | ||
|
|
e80e588bb8 | ||
|
|
598cf6062e | ||
|
|
5a413cae6a | ||
|
|
8b57e2f081 | ||
|
|
359439d288 | ||
|
|
b6d7852cf8 | ||
|
|
c5a927c61f | ||
|
|
a33fada1c0 | ||
|
|
27460be60d | ||
|
|
e3bb3254f8 | ||
|
|
65b0db831e | ||
|
|
85b1980273 | ||
|
|
d8fb710fdd | ||
|
|
b4b81e83f5 | ||
|
|
776e66e8f1 | ||
|
|
71779d5b87 | ||
|
|
88c5c68ffa | ||
|
|
b874df74af | ||
|
|
8965112bbf | ||
|
|
0b38fffbe4 | ||
|
|
9634670323 | ||
|
|
cabe240b59 | ||
|
|
fbef8e6e7f | ||
|
|
211e8438cf | ||
|
|
857765e9aa | ||
|
|
9bd5c1ad0d | ||
|
|
ce851c8b3c | ||
|
|
febc4cd48a | ||
|
|
dcee1ab320 | ||
|
|
abcbe2eb00 | ||
|
|
cdd0729ead | ||
|
|
cfd4ff6f0f | ||
|
|
31f5b651fa | ||
|
|
fe2d59a123 | ||
|
|
21f11c7b49 | ||
|
|
cc1182beea | ||
|
|
86021143a3 | ||
|
|
c7f1cf5f29 | ||
|
|
f281f299df | ||
|
|
e3fe62574d | ||
|
|
8c4445d266 | ||
|
|
d7aff44a00 | ||
|
|
b4606c6cea | ||
|
|
5846b11e88 | ||
|
|
c3754e9cc2 | ||
|
|
04c3757829 | ||
|
|
98b5c26943 | ||
|
|
8eb16b7f73 | ||
|
|
70fb65b093 | ||
|
|
1befaffbfb | ||
|
|
4af9e675fa | ||
|
|
48e91caefe | ||
|
|
2c601c7208 | ||
|
|
ac81e1ccf7 | ||
|
|
b030e73173 | ||
|
|
419fba0c68 | ||
|
|
bcfc8976e5 | ||
|
|
05a860c228 | ||
|
|
393ff47ba3 | ||
|
|
a918a53c36 | ||
|
|
1230e7bc2d | ||
|
|
77cb33bd25 | ||
|
|
58bcadd9d0 | ||
|
|
893aabbead | ||
|
|
3642b1c147 | ||
|
|
b8a7c46796 | ||
|
|
1d4fd0dc3b | ||
|
|
90a21030e3 | ||
|
|
3786a942b5 | ||
|
|
ef24c38a6f | ||
|
|
faf32a0d3c | ||
|
|
72573543b5 | ||
|
|
8c0ec0dbc4 | ||
|
|
1ed0b51b7d | ||
|
|
7155dc97f6 | ||
|
|
4576c6e6f8 | ||
|
|
0d89efef77 | ||
|
|
77139f5170 | ||
|
|
44706a8765 | ||
|
|
ad16617f74 | ||
|
|
9a8efc4604 | ||
|
|
676d319ef5 | ||
|
|
0dde7f5379 | ||
|
|
1b24a50b44 | ||
|
|
0be8f203f6 | ||
|
|
87540de3af | ||
|
|
e1ae0d1f71 | ||
|
|
eefe3e598e | ||
|
|
beca1fdeff | ||
|
|
b344496110 | ||
|
|
95be58c988 | ||
|
|
899590816a | ||
|
|
39e8576164 | ||
|
|
fa88ddb75f | ||
|
|
ec7503bb0e | ||
|
|
562e6c62b6 | ||
|
|
d941e6b63e | ||
|
|
bf5c6fbbf7 | ||
|
|
072f26b1da | ||
|
|
eb141bd36c | ||
|
|
fbae0d108e | ||
|
|
2785694381 | ||
|
|
ed0a6fcff9 | ||
|
|
cc446726de | ||
|
|
3cea335c34 | ||
|
|
de5bf02cb1 | ||
|
|
081237c1f7 | ||
|
|
d84f56f48f | ||
|
|
f22e4fae19 | ||
|
|
961a762838 | ||
|
|
71a5c55bfa | ||
|
|
34d33b671a | ||
|
|
9fa3d093d6 | ||
|
|
31ac2d0c6a | ||
|
|
2cfe0b8f13 | ||
|
|
661052f476 | ||
|
|
394c00dcfc | ||
|
|
7d42432d38 | ||
|
|
bdc5202068 | ||
|
|
164738e940 | ||
|
|
8eeb19be75 | ||
|
|
7a5337732e | ||
|
|
3a8a70017d | ||
|
|
1bf43b829e | ||
|
|
383b5cc58c | ||
|
|
b56b304252 | ||
|
|
fbb5743308 | ||
|
|
363647143c | ||
|
|
2e206caaa6 | ||
|
|
87fa491aee | ||
|
|
6b0884d73a | ||
|
|
75ddfb4ff4 | ||
|
|
02cfce31a7 | ||
|
|
c0c88533ff | ||
|
|
a2d8e0a717 | ||
|
|
511ed5fdd3 | ||
|
|
d984b9f89c | ||
|
|
28c9e34827 | ||
|
|
eed2974218 | ||
|
|
9e26d8a4a0 | ||
|
|
ff0fedd585 | ||
|
|
a6f173073b | ||
|
|
4debcc2c22 | ||
|
|
0d146a56f9 | ||
|
|
5889452403 | ||
|
|
2b5fdd07c5 | ||
|
|
bb6527bc73 | ||
|
|
6fcc059f81 | ||
|
|
ab23304dbc | ||
|
|
11a447983f | ||
|
|
ea7991b8f1 | ||
|
|
d651e88a00 | ||
|
|
a3eab2ac41 | ||
|
|
11c5bc0b9d | ||
|
|
b5598578f5 | ||
|
|
061562c423 | ||
|
|
822593f028 | ||
|
|
ccfa398547 | ||
|
|
34275d70fe | ||
|
|
eb0344d974 | ||
|
|
5ea6d7c8fc | ||
|
|
20332a066a | ||
|
|
3e4d27b06d | ||
|
|
bad05afe08 | ||
|
|
ea215cdfd0 | ||
|
|
ee303c964b | ||
|
|
0d56a120a3 | ||
|
|
2dc0fe9eac | ||
|
|
c14ab2ae13 | ||
|
|
e00c89df06 | ||
|
|
787f4f3082 | ||
|
|
e100a3d52e | ||
|
|
4cfc6c4fa7 | ||
|
|
af2a4093cb | ||
|
|
d6d94e7360 | ||
|
|
d81b27a245 | ||
|
|
a3cbc3969d | ||
|
|
a80834c064 | ||
|
|
d41924a2c1 | ||
|
|
e650030347 | ||
|
|
b736e4b929 |
@@ -586,6 +586,7 @@ Stefano Babic <sbabic@denx.de>
|
||||
trizepsiv xscale/pxa
|
||||
twister omap3
|
||||
vision2 i.MX51
|
||||
woodburn i.MX35
|
||||
|
||||
Lukasz Dalek <luk0104@gmail.com>
|
||||
|
||||
@@ -1202,6 +1203,7 @@ Mark Jonas <mark.jonas@de.bosch.com>
|
||||
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
|
||||
|
||||
MS7720SE SH7720
|
||||
R0P77520000RZ SH7752
|
||||
R0P77570030RL SH7757
|
||||
R0P77850011RL SH7785
|
||||
|
||||
|
||||
8
Makefile
8
Makefile
@@ -24,7 +24,7 @@
|
||||
VERSION = 2013
|
||||
PATCHLEVEL = 01
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION =
|
||||
ifneq "$(SUBLEVEL)" ""
|
||||
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
|
||||
else
|
||||
@@ -316,6 +316,7 @@ LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
|
||||
endif
|
||||
LIBS-y += drivers/rtc/librtc.o
|
||||
LIBS-y += drivers/serial/libserial.o
|
||||
LIBS-y += drivers/sound/libsound.o
|
||||
LIBS-$(CONFIG_GENERIC_LPC_TPM) += drivers/tpm/libtpm.o
|
||||
LIBS-y += drivers/twserial/libtws.o
|
||||
LIBS-y += drivers/usb/eth/libusb_eth.o
|
||||
@@ -510,7 +511,7 @@ $(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
|
||||
ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
|
||||
|
||||
$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
|
||||
elftosb -zdf $(ELFTOSB_TARGET-y) -c $(TOPDIR)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd \
|
||||
elftosb -zf $(ELFTOSB_TARGET-y) -c $(TOPDIR)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd \
|
||||
-o $(obj)u-boot.sb
|
||||
|
||||
# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
|
||||
@@ -868,7 +869,8 @@ clobber: tidy
|
||||
@rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
|
||||
@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
|
||||
@rm -f $(obj)spl/{u-boot-spl.lds,u-boot.lst}
|
||||
@rm -f $(obj)MLO
|
||||
@rm -f $(obj)MLO MLO.byteswap
|
||||
@rm -f $(obj)SPL
|
||||
@rm -f $(obj)tools/xway-swap-bytes
|
||||
@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
|
||||
@rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c
|
||||
|
||||
63
README
63
README
@@ -616,6 +616,14 @@ The following options need to be configured:
|
||||
boot loader that has already initialized the UART. Define this
|
||||
variable to flush the UART at init time.
|
||||
|
||||
CONFIG_SYS_NS16550_BROKEN_TEMT
|
||||
|
||||
16550 UART set the Transmitter Empty (TEMT) Bit when all output
|
||||
has finished and the transmitter is totally empty. U-Boot waits
|
||||
for this bit to be set to initialize the serial console. On some
|
||||
broken platforms this bit is not set in SPL making U-Boot to
|
||||
hang while waiting for TEMT. Define this option to avoid it.
|
||||
|
||||
|
||||
- Console Interface:
|
||||
Depending on board, define exactly one serial port
|
||||
@@ -849,6 +857,7 @@ The following options need to be configured:
|
||||
CONFIG_CMD_LOADS loads
|
||||
CONFIG_CMD_MD5SUM print md5 message digest
|
||||
(requires CONFIG_CMD_MEMORY and CONFIG_MD5)
|
||||
CONFIG_CMD_MEMINFO * Display detailed memory information
|
||||
CONFIG_CMD_MEMORY md, mm, nm, mw, cp, cmp, crc, base,
|
||||
loop, loopw, mtest
|
||||
CONFIG_CMD_MISC Misc functions like sleep etc
|
||||
@@ -1486,6 +1495,21 @@ CBFS (Coreboot Filesystem) support
|
||||
Normally display is black on white background; define
|
||||
CONFIG_SYS_WHITE_ON_BLACK to get it inverted.
|
||||
|
||||
CONFIG_LCD_ALIGNMENT
|
||||
|
||||
Normally the LCD is page-aligned (tyically 4KB). If this is
|
||||
defined then the LCD will be aligned to this value instead.
|
||||
For ARM it is sometimes useful to use MMU_SECTION_SIZE
|
||||
here, since it is cheaper to change data cache settings on
|
||||
a per-section basis.
|
||||
|
||||
CONFIG_CONSOLE_SCROLL_LINES
|
||||
|
||||
When the console need to be scrolled, this is the number of
|
||||
lines to scroll by. It defaults to 1. Increasing this makes
|
||||
the console jump but can help speed up operation when scrolling
|
||||
is slow.
|
||||
|
||||
CONFIG_LCD_BMP_RLE8
|
||||
|
||||
Support drawing of RLE8-compressed bitmaps on the LCD.
|
||||
@@ -1495,7 +1519,6 @@ CBFS (Coreboot Filesystem) support
|
||||
Enables an 'i2c edid' command which can read EDID
|
||||
information over I2C from an attached LCD display.
|
||||
|
||||
|
||||
- Splash Screen Support: CONFIG_SPLASH_SCREEN
|
||||
|
||||
If this option is set, the environment is checked for
|
||||
@@ -2364,6 +2387,15 @@ CBFS (Coreboot Filesystem) support
|
||||
run-time determined information about the hardware to the
|
||||
environment. These will be named board_name, board_rev.
|
||||
|
||||
CONFIG_DELAY_ENVIRONMENT
|
||||
|
||||
Normally the environment is loaded when the board is
|
||||
intialised so that it is available to U-Boot. This inhibits
|
||||
that so that the environment is not available until
|
||||
explicitly loaded later by U-Boot code. With CONFIG_OF_CONTROL
|
||||
this is instead controlled by the value of
|
||||
/config/load-environment.
|
||||
|
||||
- DataFlash Support:
|
||||
CONFIG_HAS_DATAFLASH
|
||||
|
||||
@@ -2390,6 +2422,11 @@ CBFS (Coreboot Filesystem) support
|
||||
CONFIG_SF_DEFAULT_MODE (see include/spi.h)
|
||||
CONFIG_SF_DEFAULT_SPEED in Hz
|
||||
|
||||
CONFIG_CMD_SF_TEST
|
||||
|
||||
Define this option to include a destructive SPI flash
|
||||
test ('sf test').
|
||||
|
||||
- SystemACE Support:
|
||||
CONFIG_SYSTEMACE
|
||||
|
||||
@@ -2677,10 +2714,13 @@ FIT uImage format:
|
||||
CONFIG_FB_ADDR
|
||||
|
||||
Define CONFIG_FB_ADDR if you want to use specific
|
||||
address for frame buffer.
|
||||
Then system will reserve the frame buffer address to
|
||||
defined address instead of lcd_setmem (this function
|
||||
grabs the memory for frame buffer by panel's size).
|
||||
address for frame buffer. This is typically the case
|
||||
when using a graphics controller has separate video
|
||||
memory. U-Boot will then place the frame buffer at
|
||||
the given address instead of dynamically reserving it
|
||||
in system RAM by calling lcd_setmem(), which grabs
|
||||
the memory for the frame buffer depending on the
|
||||
configured panel size.
|
||||
|
||||
Please see board_init_f function.
|
||||
|
||||
@@ -2975,9 +3015,6 @@ Configuration Settings:
|
||||
non page size aligned address and this could cause major
|
||||
problems.
|
||||
|
||||
- CONFIG_SYS_TFTP_LOADADDR:
|
||||
Default load address for network file downloads
|
||||
|
||||
- CONFIG_SYS_LOADS_BAUD_CHANGE:
|
||||
Enable temporary baudrate change while serial download
|
||||
|
||||
@@ -3437,6 +3474,16 @@ use the "saveenv" command to store a valid environment.
|
||||
space for already greatly restricted images, including but not
|
||||
limited to NAND_SPL configurations.
|
||||
|
||||
- CONFIG_DISPLAY_BOARDINFO
|
||||
Display information about the board that U-Boot is running on
|
||||
when U-Boot starts up. The board function checkboard() is called
|
||||
to do this.
|
||||
|
||||
- CONFIG_DISPLAY_BOARDINFO_LATE
|
||||
Similar to the previous option, but display this information
|
||||
later, once stdio is running and output goes to the LCD, if
|
||||
present.
|
||||
|
||||
Low Level (hardware related) configuration options:
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
@@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -march=armv5
|
||||
# =========================================================================
|
||||
PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
|
||||
PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
ALL-y += $(OBJTREE)/SPL
|
||||
endif
|
||||
|
||||
@@ -141,16 +141,6 @@ void flush_cache(unsigned long start, unsigned long size)
|
||||
flush_dcache_range(start, start + size);
|
||||
}
|
||||
|
||||
void enable_caches(void)
|
||||
{
|
||||
#ifndef CONFIG_SYS_ICACHE_OFF
|
||||
icache_enable();
|
||||
#endif
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
dcache_enable();
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* #ifndef CONFIG_SYS_DCACHE_OFF */
|
||||
void invalidate_dcache_all(void)
|
||||
{
|
||||
@@ -172,3 +162,15 @@ void flush_cache(unsigned long start, unsigned long size)
|
||||
{
|
||||
}
|
||||
#endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
|
||||
|
||||
#if !defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF)
|
||||
void enable_caches(void)
|
||||
{
|
||||
#ifndef CONFIG_SYS_ICACHE_OFF
|
||||
icache_enable();
|
||||
#endif
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
dcache_enable();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -161,42 +161,3 @@ ulong get_tbclk(void)
|
||||
{
|
||||
return MXC_CLK32;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
{
|
||||
struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
|
||||
wdog->wcr = WDOG_ENABLE;
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HW_WATCHDOG
|
||||
void mxc_hw_watchdog_enable(void)
|
||||
{
|
||||
struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
|
||||
u16 secs;
|
||||
|
||||
/*
|
||||
* The timer watchdog can be set between
|
||||
* 0.5 and 128 Seconds. If not defined
|
||||
* in configuration file, sets 64 Seconds
|
||||
*/
|
||||
#ifdef CONFIG_SYS_WD_TIMER_SECS
|
||||
secs = (CONFIG_SYS_WD_TIMER_SECS << 1) & 0xFF;
|
||||
if (!secs) secs = 1;
|
||||
#else
|
||||
secs = 64;
|
||||
#endif
|
||||
setbits_le16(&wdog->wcr, (secs << WDOG_WT_SHIFT) | WDOG_ENABLE
|
||||
| WDOG_WDZST);
|
||||
}
|
||||
|
||||
|
||||
void mxc_hw_watchdog_reset(void)
|
||||
{
|
||||
struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
|
||||
|
||||
writew(0x5555, &wdog->wsr);
|
||||
writew(0xAAAA, &wdog->wsr);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,7 @@ LIB = $(obj)lib$(SOC).o
|
||||
COBJS += generic.o
|
||||
COBJS += timer.o
|
||||
COBJS += iomux.o
|
||||
COBJS += mx35_sdram.o
|
||||
|
||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <fsl_esdhc.h>
|
||||
#endif
|
||||
#include <netdev.h>
|
||||
#include <spl.h>
|
||||
|
||||
#define CLK_CODE(arm, ahb, sel) (((arm) << 16) + ((ahb) << 8) + (sel))
|
||||
#define CLK_CODE_ARM(c) (((c) >> 16) & 0xFF)
|
||||
@@ -487,8 +488,76 @@ int get_clocks(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
#define RCSR_MEM_CTL_WEIM 0
|
||||
#define RCSR_MEM_CTL_NAND 1
|
||||
#define RCSR_MEM_CTL_ATA 2
|
||||
#define RCSR_MEM_CTL_EXPANSION 3
|
||||
#define RCSR_MEM_TYPE_NOR 0
|
||||
#define RCSR_MEM_TYPE_ONENAND 2
|
||||
#define RCSR_MEM_TYPE_SD 0
|
||||
#define RCSR_MEM_TYPE_I2C 2
|
||||
#define RCSR_MEM_TYPE_SPI 3
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR;
|
||||
writew(4, &wdog->wcr);
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
|
||||
u32 rcsr = readl(&ccm->rcsr);
|
||||
u32 mem_type, mem_ctl;
|
||||
|
||||
/* In external mode, no boot device is returned */
|
||||
if ((rcsr >> 10) & 0x03)
|
||||
return BOOT_DEVICE_NONE;
|
||||
|
||||
mem_ctl = (rcsr >> 25) & 0x03;
|
||||
mem_type = (rcsr >> 23) & 0x03;
|
||||
|
||||
switch (mem_ctl) {
|
||||
case RCSR_MEM_CTL_WEIM:
|
||||
switch (mem_type) {
|
||||
case RCSR_MEM_TYPE_NOR:
|
||||
return BOOT_DEVICE_NOR;
|
||||
case RCSR_MEM_TYPE_ONENAND:
|
||||
return BOOT_DEVICE_ONE_NAND;
|
||||
default:
|
||||
return BOOT_DEVICE_NONE;
|
||||
}
|
||||
case RCSR_MEM_CTL_NAND:
|
||||
return BOOT_DEVICE_NAND;
|
||||
case RCSR_MEM_CTL_EXPANSION:
|
||||
switch (mem_type) {
|
||||
case RCSR_MEM_TYPE_SD:
|
||||
return BOOT_DEVICE_MMC1;
|
||||
case RCSR_MEM_TYPE_I2C:
|
||||
return BOOT_DEVICE_I2C;
|
||||
case RCSR_MEM_TYPE_SPI:
|
||||
return BOOT_DEVICE_SPI;
|
||||
default:
|
||||
return BOOT_DEVICE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
return BOOT_DEVICE_NONE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
u32 spl_boot_mode(void)
|
||||
{
|
||||
switch (spl_boot_device()) {
|
||||
case BOOT_DEVICE_MMC1:
|
||||
#ifdef CONFIG_SPL_FAT_SUPPORT
|
||||
return MMCSD_MODE_FAT;
|
||||
#else
|
||||
return MMCSD_MODE_RAW;
|
||||
#endif
|
||||
break;
|
||||
case BOOT_DEVICE_NAND:
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
puts("spl: ERROR: unsupported device\n");
|
||||
hang();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
137
arch/arm/cpu/arm1136/mx35/mx35_sdram.c
Normal file
137
arch/arm/cpu/arm1136/mx35/mx35_sdram.c
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) 2012, Stefano Babic <sbabic@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 <asm/io.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
#define ESDCTL_DDR2_EMR2 0x04000000
|
||||
#define ESDCTL_DDR2_EMR3 0x06000000
|
||||
#define ESDCTL_PRECHARGE 0x00000400
|
||||
#define ESDCTL_DDR2_EN_DLL 0x02000400
|
||||
#define ESDCTL_DDR2_RESET_DLL 0x00000333
|
||||
#define ESDCTL_DDR2_MR 0x00000233
|
||||
#define ESDCTL_DDR2_OCD_DEFAULT 0x02000780
|
||||
|
||||
enum {
|
||||
SMODE_NORMAL = 0,
|
||||
SMODE_PRECHARGE,
|
||||
SMODE_AUTO_REFRESH,
|
||||
SMODE_LOAD_REG,
|
||||
SMODE_MANUAL_REFRESH
|
||||
};
|
||||
|
||||
#define set_mode(x, en, m) (x | (en << 31) | (m << 28))
|
||||
|
||||
static inline void dram_wait(unsigned int count)
|
||||
{
|
||||
volatile unsigned int wait = count;
|
||||
|
||||
while (wait--)
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
void mx3_setup_sdram_bank(u32 start_address, u32 ddr2_config,
|
||||
u32 row, u32 col, u32 dsize, u32 refresh)
|
||||
{
|
||||
struct esdc_regs *esdc = (struct esdc_regs *)ESDCTL_BASE_ADDR;
|
||||
u32 *cfg_reg, *ctl_reg;
|
||||
u32 val;
|
||||
u32 ctlval;
|
||||
|
||||
switch (start_address) {
|
||||
case CSD0_BASE_ADDR:
|
||||
cfg_reg = &esdc->esdcfg0;
|
||||
ctl_reg = &esdc->esdctl0;
|
||||
break;
|
||||
case CSD1_BASE_ADDR:
|
||||
cfg_reg = &esdc->esdcfg1;
|
||||
ctl_reg = &esdc->esdctl1;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
/* The MX35 supports 11 up to 14 rows */
|
||||
if (row < 11 || row > 14 || col < 8 || col > 10)
|
||||
return;
|
||||
ctlval = (row - 11) << 24 | (col - 8) << 20 | (dsize << 16);
|
||||
|
||||
/* Initialize MISC register for DDR2 */
|
||||
val = ESDC_MISC_RST | ESDC_MISC_MDDR_EN | ESDC_MISC_MDDR_DL_RST |
|
||||
ESDC_MISC_DDR_EN | ESDC_MISC_DDR2_EN;
|
||||
writel(val, &esdc->esdmisc);
|
||||
val &= ~(ESDC_MISC_RST | ESDC_MISC_MDDR_DL_RST);
|
||||
writel(val, &esdc->esdmisc);
|
||||
|
||||
/*
|
||||
* according to DDR2 specs, wait a while before
|
||||
* the PRECHARGE_ALL command
|
||||
*/
|
||||
dram_wait(0x20000);
|
||||
|
||||
/* Load DDR2 config and timing */
|
||||
writel(ddr2_config, cfg_reg);
|
||||
|
||||
/* Precharge ALL */
|
||||
writel(set_mode(ctlval, 1, SMODE_PRECHARGE),
|
||||
ctl_reg);
|
||||
writel(0xda, start_address + ESDCTL_PRECHARGE);
|
||||
|
||||
/* Load mode */
|
||||
writel(set_mode(ctlval, 1, SMODE_LOAD_REG),
|
||||
ctl_reg);
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EMR2); /* EMRS2 */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EMR3); /* EMRS3 */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EN_DLL); /* Enable DLL */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_RESET_DLL); /* Reset DLL */
|
||||
|
||||
/* Precharge ALL */
|
||||
writel(set_mode(ctlval, 1, SMODE_PRECHARGE),
|
||||
ctl_reg);
|
||||
writel(0xda, start_address + ESDCTL_PRECHARGE);
|
||||
|
||||
/* Set mode auto refresh : at least two refresh are required */
|
||||
writel(set_mode(ctlval, 1, SMODE_AUTO_REFRESH),
|
||||
ctl_reg);
|
||||
writel(0xda, start_address);
|
||||
writel(0xda, start_address);
|
||||
|
||||
writel(set_mode(ctlval, 1, SMODE_LOAD_REG),
|
||||
ctl_reg);
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_MR);
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_OCD_DEFAULT);
|
||||
|
||||
/* OCD mode exit */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EN_DLL); /* Enable DLL */
|
||||
|
||||
/* Set normal mode */
|
||||
writel(set_mode(ctlval, 1, SMODE_NORMAL) | refresh,
|
||||
ctl_reg);
|
||||
|
||||
dram_wait(0x20000);
|
||||
|
||||
/* Do not set delay lines, only for MDDR */
|
||||
}
|
||||
@@ -100,6 +100,10 @@ _TEXT_BASE:
|
||||
_bss_start_ofs:
|
||||
.word __bss_start - _start
|
||||
|
||||
.global _image_copy_end_ofs
|
||||
_image_copy_end_ofs:
|
||||
.word __image_copy_end - _start
|
||||
|
||||
.globl _bss_end_ofs
|
||||
_bss_end_ofs:
|
||||
.word __bss_end__ - _start
|
||||
@@ -161,13 +165,7 @@ next:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -184,16 +182,12 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
ldr r3, _image_copy_end_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
|
||||
copy_loop:
|
||||
@@ -241,50 +235,15 @@ fixnext:
|
||||
add r2, r2, #8 /* each rel.dyn entry is 8 bytes */
|
||||
cmp r2, r3
|
||||
blo fixloop
|
||||
bx lr
|
||||
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
relocate_done:
|
||||
|
||||
bx lr
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
#endif /* #ifndef CONFIG_SPL_BUILD */
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr r0, _nand_boot_ofs
|
||||
mov pc, r0
|
||||
|
||||
_nand_boot_ofs:
|
||||
.word nand_boot
|
||||
#else
|
||||
jump_2_ram:
|
||||
ldr r0, _board_init_r_ofs
|
||||
ldr r1, _TEXT_BASE
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -293,6 +252,13 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
#endif
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
62
arch/arm/cpu/arm1136/u-boot-spl.lds
Normal file
62
arch/arm/cpu/arm1136/u-boot-spl.lds
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
|
||||
*
|
||||
* (C) Copyright 2010
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Aneesh V <aneesh@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
|
||||
LENGTH = CONFIG_SPL_MAX_SIZE }
|
||||
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
|
||||
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__start = .;
|
||||
arch/arm/cpu/arm1136/start.o (.text)
|
||||
*(.text*)
|
||||
} >.sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
|
||||
. = ALIGN(4);
|
||||
__image_copy_end = .;
|
||||
_end = .;
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} >.sdram
|
||||
}
|
||||
@@ -31,7 +31,7 @@ LIB = $(obj)lib$(SOC).o
|
||||
SOBJS = reset.o
|
||||
|
||||
COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
|
||||
COBJS-y += timer.o
|
||||
COBJS-y += timer.o init.o
|
||||
|
||||
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
|
||||
|
||||
|
||||
26
arch/arm/cpu/arm1176/s3c64xx/init.c
Normal file
26
arch/arm/cpu/arm1176/s3c64xx/init.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* (C) Copyright 2012 Ashok Kumar Reddy Kourla
|
||||
* ashokkourla2000@gmail.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.
|
||||
*/
|
||||
|
||||
#include<common.h>
|
||||
|
||||
int arch_cpu_init(void)
|
||||
{
|
||||
icache_enable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -224,12 +224,7 @@ skip_tcmdisable:
|
||||
*/
|
||||
bl lowlevel_init /* go setup pll,mux,memory */
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -246,14 +241,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -343,49 +334,9 @@ mmu_enable:
|
||||
skip_hw_init:
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
#ifndef CONFIG_NAND_SPL
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr pc, _nand_boot
|
||||
|
||||
_nand_boot: .word nand_boot
|
||||
#else
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -399,6 +350,11 @@ _mmu_table_base:
|
||||
.word mmu_table
|
||||
#endif
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
#ifndef CONFIG_NAND_SPL
|
||||
/*
|
||||
* we assume that cache operation is done before. (eg. cleanup_before_linux())
|
||||
|
||||
@@ -147,12 +147,7 @@ reset:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -169,14 +164,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -228,43 +219,10 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
_rel_dyn_end_ofs:
|
||||
@@ -272,6 +230,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -182,12 +182,7 @@ copyex:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -204,14 +199,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -263,51 +254,10 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr r0, _nand_boot_ofs
|
||||
mov pc, r0
|
||||
|
||||
_nand_boot_ofs:
|
||||
.word nand_boot
|
||||
#else
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
_rel_dyn_end_ofs:
|
||||
@@ -315,6 +265,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
#if defined(CONFIG_OMAP1510)
|
||||
#include <./configs/omap1510.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -176,12 +172,7 @@ poll1:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -198,14 +189,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -257,51 +244,10 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr r0, _nand_boot_ofs
|
||||
mov pc, r0
|
||||
|
||||
_nand_boot_ofs:
|
||||
.word nand_boot
|
||||
#else
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
_rel_dyn_end_ofs:
|
||||
@@ -309,6 +255,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -193,6 +193,19 @@ void at91_spi1_hw_init(unsigned long cs_mask)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_USB_OHCI_NEW) || defined(CONFIG_USB_EHCI)
|
||||
void at91_uhp_hw_init(void)
|
||||
{
|
||||
/* Enable VBus on UHP ports */
|
||||
at91_set_pio_output(AT91_PIO_PORTD, 18, 0); /* port A */
|
||||
at91_set_pio_output(AT91_PIO_PORTD, 19, 0); /* port B */
|
||||
#if defined(CONFIG_USB_OHCI_NEW)
|
||||
/* port C is OHCI only */
|
||||
at91_set_pio_output(AT91_PIO_PORTD, 20, 0); /* port C */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACB
|
||||
void at91_macb_hw_init(void)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
void reset_cpu(unsigned long a)
|
||||
{
|
||||
struct davinci_timer *const wdttimer =
|
||||
(struct davinci_timer *)DAVINCI_TIMER1_BASE;
|
||||
(struct davinci_timer *)DAVINCI_WDOG_BASE;
|
||||
writel(0x08, &wdttimer->tgcr);
|
||||
writel(readl(&wdttimer->tgcr) | 0x03, &wdttimer->tgcr);
|
||||
writel(0, &wdttimer->tim12);
|
||||
|
||||
@@ -31,7 +31,7 @@ static u32 kirkwood_variant(void)
|
||||
#define MPP_CTRL(i) (KW_MPP_BASE + (i* 4))
|
||||
#define MPP_NR_REGS (1 + MPP_MAX/8)
|
||||
|
||||
void kirkwood_mpp_conf(u32 *mpp_list, u32 *mpp_save)
|
||||
void kirkwood_mpp_conf(const u32 *mpp_list, u32 *mpp_save)
|
||||
{
|
||||
u32 mpp_ctrl[MPP_NR_REGS];
|
||||
unsigned int variant_mask;
|
||||
|
||||
@@ -50,7 +50,7 @@ void early_delay(int delay)
|
||||
}
|
||||
|
||||
#define MUX_CONFIG_BOOTMODE_PAD (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
|
||||
const iomux_cfg_t iomux_boot[] = {
|
||||
static const iomux_cfg_t iomux_boot[] = {
|
||||
MX28_PAD_LCD_D00__GPIO_1_0 | MUX_CONFIG_BOOTMODE_PAD,
|
||||
MX28_PAD_LCD_D01__GPIO_1_1 | MUX_CONFIG_BOOTMODE_PAD,
|
||||
MX28_PAD_LCD_D02__GPIO_1_2 | MUX_CONFIG_BOOTMODE_PAD,
|
||||
@@ -59,7 +59,7 @@ const iomux_cfg_t iomux_boot[] = {
|
||||
MX28_PAD_LCD_D05__GPIO_1_5 | MUX_CONFIG_BOOTMODE_PAD,
|
||||
};
|
||||
|
||||
uint8_t mxs_get_bootmode_index(void)
|
||||
static uint8_t mxs_get_bootmode_index(void)
|
||||
{
|
||||
uint8_t bootmode = 0;
|
||||
int i;
|
||||
|
||||
@@ -30,7 +30,11 @@
|
||||
|
||||
#include "mxs_init.h"
|
||||
|
||||
static uint32_t mx28_dram_vals[] = {
|
||||
static uint32_t dram_vals[] = {
|
||||
/*
|
||||
* i.MX28 DDR2 at 200MHz
|
||||
*/
|
||||
#if defined(CONFIG_MX28)
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
@@ -79,6 +83,9 @@ static uint32_t mx28_dram_vals[] = {
|
||||
0x06120612, 0x04320432, 0x04320432, 0x00040004,
|
||||
0x00040004, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00010001
|
||||
#else
|
||||
#error Unsupported memory initialization
|
||||
#endif
|
||||
};
|
||||
|
||||
void __mxs_adjust_memory_params(uint32_t *dram_vals)
|
||||
@@ -87,17 +94,17 @@ void __mxs_adjust_memory_params(uint32_t *dram_vals)
|
||||
void mxs_adjust_memory_params(uint32_t *dram_vals)
|
||||
__attribute__((weak, alias("__mxs_adjust_memory_params")));
|
||||
|
||||
void init_mx28_200mhz_ddr2(void)
|
||||
static void initialize_dram_values(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
mxs_adjust_memory_params(mx28_dram_vals);
|
||||
mxs_adjust_memory_params(dram_vals);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mx28_dram_vals); i++)
|
||||
writel(mx28_dram_vals[i], MXS_DRAM_BASE + (4 * i));
|
||||
for (i = 0; i < ARRAY_SIZE(dram_vals); i++)
|
||||
writel(dram_vals[i], MXS_DRAM_BASE + (4 * i));
|
||||
}
|
||||
|
||||
void mxs_mem_init_clock(void)
|
||||
static void mxs_mem_init_clock(void)
|
||||
{
|
||||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
@@ -128,7 +135,7 @@ void mxs_mem_init_clock(void)
|
||||
early_delay(10000);
|
||||
}
|
||||
|
||||
void mxs_mem_setup_cpu_and_hbus(void)
|
||||
static void mxs_mem_setup_cpu_and_hbus(void)
|
||||
{
|
||||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
@@ -160,7 +167,7 @@ void mxs_mem_setup_cpu_and_hbus(void)
|
||||
early_delay(15000);
|
||||
}
|
||||
|
||||
void mxs_mem_setup_vdda(void)
|
||||
static void mxs_mem_setup_vdda(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -171,17 +178,6 @@ void mxs_mem_setup_vdda(void)
|
||||
&power_regs->hw_power_vddactrl);
|
||||
}
|
||||
|
||||
void mxs_mem_setup_vddd(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
writel((0x1c << POWER_VDDDCTRL_TRG_OFFSET) |
|
||||
(0x7 << POWER_VDDDCTRL_BO_OFFSET_OFFSET) |
|
||||
POWER_VDDDCTRL_LINREG_OFFSET_1STEPS_BELOW,
|
||||
&power_regs->hw_power_vdddctrl);
|
||||
}
|
||||
|
||||
uint32_t mxs_mem_get_size(void)
|
||||
{
|
||||
uint32_t sz, da;
|
||||
@@ -229,7 +225,7 @@ void mxs_mem_init(void)
|
||||
/* Clear START bit from DRAM_CTL16 */
|
||||
clrbits_le32(MXS_DRAM_BASE + 0x40, 1);
|
||||
|
||||
init_mx28_200mhz_ddr2();
|
||||
initialize_dram_values();
|
||||
|
||||
/* Clear SREFRESH bit from DRAM_CTL17 */
|
||||
clrbits_le32(MXS_DRAM_BASE + 0x44, 1);
|
||||
@@ -241,8 +237,6 @@ void mxs_mem_init(void)
|
||||
while (!(readl(MXS_DRAM_BASE + 0xe8) & (1 << 20)))
|
||||
;
|
||||
|
||||
mxs_mem_setup_vddd();
|
||||
|
||||
early_delay(10000);
|
||||
|
||||
mxs_mem_setup_cpu_and_hbus();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "mxs_init.h"
|
||||
|
||||
void mxs_power_clock2xtal(void)
|
||||
static void mxs_power_clock2xtal(void)
|
||||
{
|
||||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
@@ -40,7 +40,7 @@ void mxs_power_clock2xtal(void)
|
||||
&clkctrl_regs->hw_clkctrl_clkseq_set);
|
||||
}
|
||||
|
||||
void mxs_power_clock2pll(void)
|
||||
static void mxs_power_clock2pll(void)
|
||||
{
|
||||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
@@ -52,7 +52,7 @@ void mxs_power_clock2pll(void)
|
||||
CLKCTRL_CLKSEQ_BYPASS_CPU);
|
||||
}
|
||||
|
||||
void mxs_power_clear_auto_restart(void)
|
||||
static void mxs_power_clear_auto_restart(void)
|
||||
{
|
||||
struct mxs_rtc_regs *rtc_regs =
|
||||
(struct mxs_rtc_regs *)MXS_RTC_BASE;
|
||||
@@ -85,7 +85,7 @@ void mxs_power_clear_auto_restart(void)
|
||||
;
|
||||
}
|
||||
|
||||
void mxs_power_set_linreg(void)
|
||||
static void mxs_power_set_linreg(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -104,7 +104,7 @@ void mxs_power_set_linreg(void)
|
||||
POWER_VDDIOCTRL_LINREG_OFFSET_1STEPS_BELOW);
|
||||
}
|
||||
|
||||
int mxs_get_batt_volt(void)
|
||||
static int mxs_get_batt_volt(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -115,12 +115,12 @@ int mxs_get_batt_volt(void)
|
||||
return volt;
|
||||
}
|
||||
|
||||
int mxs_is_batt_ready(void)
|
||||
static int mxs_is_batt_ready(void)
|
||||
{
|
||||
return (mxs_get_batt_volt() >= 3600);
|
||||
}
|
||||
|
||||
int mxs_is_batt_good(void)
|
||||
static int mxs_is_batt_good(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -160,7 +160,7 @@ int mxs_is_batt_good(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mxs_power_setup_5v_detect(void)
|
||||
static void mxs_power_setup_5v_detect(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -172,7 +172,7 @@ void mxs_power_setup_5v_detect(void)
|
||||
POWER_5VCTRL_PWRUP_VBUS_CMPS);
|
||||
}
|
||||
|
||||
void mxs_src_power_init(void)
|
||||
static void mxs_src_power_init(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -203,7 +203,7 @@ void mxs_src_power_init(void)
|
||||
clrbits_le32(&power_regs->hw_power_5vctrl, POWER_5VCTRL_DCDC_XFER);
|
||||
}
|
||||
|
||||
void mxs_power_init_4p2_params(void)
|
||||
static void mxs_power_init_4p2_params(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -227,7 +227,7 @@ void mxs_power_init_4p2_params(void)
|
||||
0x3f << POWER_5VCTRL_CHARGE_4P2_ILIMIT_OFFSET);
|
||||
}
|
||||
|
||||
void mxs_enable_4p2_dcdc_input(int xfer)
|
||||
static void mxs_enable_4p2_dcdc_input(int xfer)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -323,7 +323,7 @@ void mxs_enable_4p2_dcdc_input(int xfer)
|
||||
POWER_CTRL_ENIRQ_VDD5V_DROOP);
|
||||
}
|
||||
|
||||
void mxs_power_init_4p2_regulator(void)
|
||||
static void mxs_power_init_4p2_regulator(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -407,7 +407,7 @@ void mxs_power_init_4p2_regulator(void)
|
||||
writel(POWER_CTRL_DCDC4P2_BO_IRQ, &power_regs->hw_power_ctrl_clr);
|
||||
}
|
||||
|
||||
void mxs_power_init_dcdc_4p2_source(void)
|
||||
static void mxs_power_init_dcdc_4p2_source(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -429,7 +429,7 @@ void mxs_power_init_dcdc_4p2_source(void)
|
||||
}
|
||||
}
|
||||
|
||||
void mxs_power_enable_4p2(void)
|
||||
static void mxs_power_enable_4p2(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -488,7 +488,7 @@ void mxs_power_enable_4p2(void)
|
||||
&power_regs->hw_power_charge_clr);
|
||||
}
|
||||
|
||||
void mxs_boot_valid_5v(void)
|
||||
static void mxs_boot_valid_5v(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -511,7 +511,7 @@ void mxs_boot_valid_5v(void)
|
||||
mxs_power_enable_4p2();
|
||||
}
|
||||
|
||||
void mxs_powerdown(void)
|
||||
static void mxs_powerdown(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -520,7 +520,7 @@ void mxs_powerdown(void)
|
||||
&power_regs->hw_power_reset);
|
||||
}
|
||||
|
||||
void mxs_batt_boot(void)
|
||||
static void mxs_batt_boot(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -564,7 +564,7 @@ void mxs_batt_boot(void)
|
||||
0x8 << POWER_5VCTRL_CHARGE_4P2_ILIMIT_OFFSET);
|
||||
}
|
||||
|
||||
void mxs_handle_5v_conflict(void)
|
||||
static void mxs_handle_5v_conflict(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -600,7 +600,7 @@ void mxs_handle_5v_conflict(void)
|
||||
}
|
||||
}
|
||||
|
||||
void mxs_5v_boot(void)
|
||||
static void mxs_5v_boot(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -623,7 +623,7 @@ void mxs_5v_boot(void)
|
||||
mxs_handle_5v_conflict();
|
||||
}
|
||||
|
||||
void mxs_init_batt_bo(void)
|
||||
static void mxs_init_batt_bo(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -637,7 +637,7 @@ void mxs_init_batt_bo(void)
|
||||
writel(POWER_CTRL_ENIRQ_BATT_BO, &power_regs->hw_power_ctrl_clr);
|
||||
}
|
||||
|
||||
void mxs_switch_vddd_to_dcdc_source(void)
|
||||
static void mxs_switch_vddd_to_dcdc_source(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -651,7 +651,7 @@ void mxs_switch_vddd_to_dcdc_source(void)
|
||||
POWER_VDDDCTRL_DISABLE_STEPPING);
|
||||
}
|
||||
|
||||
void mxs_power_configure_power_source(void)
|
||||
static void mxs_power_configure_power_source(void)
|
||||
{
|
||||
int batt_ready, batt_good;
|
||||
struct mxs_power_regs *power_regs =
|
||||
@@ -689,7 +689,7 @@ void mxs_power_configure_power_source(void)
|
||||
mxs_switch_vddd_to_dcdc_source();
|
||||
}
|
||||
|
||||
void mxs_enable_output_rail_protection(void)
|
||||
static void mxs_enable_output_rail_protection(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -707,7 +707,7 @@ void mxs_enable_output_rail_protection(void)
|
||||
POWER_VDDIOCTRL_PWDN_BRNOUT);
|
||||
}
|
||||
|
||||
int mxs_get_vddio_power_source_off(void)
|
||||
static int mxs_get_vddio_power_source_off(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -735,7 +735,7 @@ int mxs_get_vddio_power_source_off(void)
|
||||
|
||||
}
|
||||
|
||||
int mxs_get_vddd_power_source_off(void)
|
||||
static int mxs_get_vddd_power_source_off(void)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
@@ -766,201 +766,115 @@ int mxs_get_vddd_power_source_off(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mxs_power_set_vddio(uint32_t new_target, uint32_t new_brownout)
|
||||
struct mxs_vddx_cfg {
|
||||
uint32_t *reg;
|
||||
uint8_t step_mV;
|
||||
uint16_t lowest_mV;
|
||||
int (*powered_by_linreg)(void);
|
||||
uint32_t trg_mask;
|
||||
uint32_t bo_irq;
|
||||
uint32_t bo_enirq;
|
||||
uint32_t bo_offset_mask;
|
||||
uint32_t bo_offset_offset;
|
||||
};
|
||||
|
||||
static const struct mxs_vddx_cfg mxs_vddio_cfg = {
|
||||
.reg = &(((struct mxs_power_regs *)MXS_POWER_BASE)->
|
||||
hw_power_vddioctrl),
|
||||
.step_mV = 50,
|
||||
.lowest_mV = 2800,
|
||||
.powered_by_linreg = mxs_get_vddio_power_source_off,
|
||||
.trg_mask = POWER_VDDIOCTRL_TRG_MASK,
|
||||
.bo_irq = POWER_CTRL_VDDIO_BO_IRQ,
|
||||
.bo_enirq = POWER_CTRL_ENIRQ_VDDIO_BO,
|
||||
.bo_offset_mask = POWER_VDDIOCTRL_BO_OFFSET_MASK,
|
||||
.bo_offset_offset = POWER_VDDIOCTRL_BO_OFFSET_OFFSET,
|
||||
};
|
||||
|
||||
static const struct mxs_vddx_cfg mxs_vddd_cfg = {
|
||||
.reg = &(((struct mxs_power_regs *)MXS_POWER_BASE)->
|
||||
hw_power_vdddctrl),
|
||||
.step_mV = 25,
|
||||
.lowest_mV = 800,
|
||||
.powered_by_linreg = mxs_get_vddd_power_source_off,
|
||||
.trg_mask = POWER_VDDDCTRL_TRG_MASK,
|
||||
.bo_irq = POWER_CTRL_VDDD_BO_IRQ,
|
||||
.bo_enirq = POWER_CTRL_ENIRQ_VDDD_BO,
|
||||
.bo_offset_mask = POWER_VDDDCTRL_BO_OFFSET_MASK,
|
||||
.bo_offset_offset = POWER_VDDDCTRL_BO_OFFSET_OFFSET,
|
||||
};
|
||||
|
||||
static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
|
||||
uint32_t new_target, uint32_t new_brownout)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
uint32_t cur_target, diff, bo_int = 0;
|
||||
uint32_t powered_by_linreg = 0;
|
||||
int adjust_up, tmp;
|
||||
|
||||
new_brownout = (new_target - new_brownout + 25) / 50;
|
||||
new_brownout = DIV_ROUND(new_target - new_brownout, cfg->step_mV);
|
||||
|
||||
cur_target = readl(&power_regs->hw_power_vddioctrl);
|
||||
cur_target &= POWER_VDDIOCTRL_TRG_MASK;
|
||||
cur_target *= 50; /* 50 mV step*/
|
||||
cur_target += 2800; /* 2800 mV lowest */
|
||||
cur_target = readl(cfg->reg);
|
||||
cur_target &= cfg->trg_mask;
|
||||
cur_target *= cfg->step_mV;
|
||||
cur_target += cfg->lowest_mV;
|
||||
|
||||
powered_by_linreg = mxs_get_vddio_power_source_off();
|
||||
if (new_target > cur_target) {
|
||||
adjust_up = new_target > cur_target;
|
||||
powered_by_linreg = cfg->powered_by_linreg();
|
||||
|
||||
if (adjust_up) {
|
||||
if (powered_by_linreg) {
|
||||
bo_int = readl(&power_regs->hw_power_vddioctrl);
|
||||
clrbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_CTRL_ENIRQ_VDDIO_BO);
|
||||
bo_int = readl(cfg->reg);
|
||||
clrbits_le32(cfg->reg, cfg->bo_enirq);
|
||||
}
|
||||
|
||||
setbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_VDDIOCTRL_BO_OFFSET_MASK);
|
||||
do {
|
||||
if (new_target - cur_target > 100)
|
||||
diff = cur_target + 100;
|
||||
else
|
||||
diff = new_target;
|
||||
|
||||
diff -= 2800;
|
||||
diff /= 50;
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_VDDIOCTRL_TRG_MASK, diff);
|
||||
|
||||
if (powered_by_linreg ||
|
||||
(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_VDD5V_GT_VDDIO))
|
||||
early_delay(500);
|
||||
else {
|
||||
while (!(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_DC_OK))
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
cur_target = readl(&power_regs->hw_power_vddioctrl);
|
||||
cur_target &= POWER_VDDIOCTRL_TRG_MASK;
|
||||
cur_target *= 50; /* 50 mV step*/
|
||||
cur_target += 2800; /* 2800 mV lowest */
|
||||
} while (new_target > cur_target);
|
||||
|
||||
if (powered_by_linreg) {
|
||||
writel(POWER_CTRL_VDDIO_BO_IRQ,
|
||||
&power_regs->hw_power_ctrl_clr);
|
||||
if (bo_int & POWER_CTRL_ENIRQ_VDDIO_BO)
|
||||
setbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_CTRL_ENIRQ_VDDIO_BO);
|
||||
}
|
||||
} else {
|
||||
do {
|
||||
if (cur_target - new_target > 100)
|
||||
diff = cur_target - 100;
|
||||
else
|
||||
diff = new_target;
|
||||
|
||||
diff -= 2800;
|
||||
diff /= 50;
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_VDDIOCTRL_TRG_MASK, diff);
|
||||
|
||||
if (powered_by_linreg ||
|
||||
(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_VDD5V_GT_VDDIO))
|
||||
early_delay(500);
|
||||
else {
|
||||
while (!(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_DC_OK))
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
cur_target = readl(&power_regs->hw_power_vddioctrl);
|
||||
cur_target &= POWER_VDDIOCTRL_TRG_MASK;
|
||||
cur_target *= 50; /* 50 mV step*/
|
||||
cur_target += 2800; /* 2800 mV lowest */
|
||||
} while (new_target < cur_target);
|
||||
setbits_le32(cfg->reg, cfg->bo_offset_mask);
|
||||
}
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_VDDIOCTRL_BO_OFFSET_MASK,
|
||||
new_brownout << POWER_VDDIOCTRL_BO_OFFSET_OFFSET);
|
||||
}
|
||||
|
||||
void mxs_power_set_vddd(uint32_t new_target, uint32_t new_brownout)
|
||||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
uint32_t cur_target, diff, bo_int = 0;
|
||||
uint32_t powered_by_linreg = 0;
|
||||
|
||||
new_brownout = (new_target - new_brownout + 12) / 25;
|
||||
|
||||
cur_target = readl(&power_regs->hw_power_vdddctrl);
|
||||
cur_target &= POWER_VDDDCTRL_TRG_MASK;
|
||||
cur_target *= 25; /* 25 mV step*/
|
||||
cur_target += 800; /* 800 mV lowest */
|
||||
|
||||
powered_by_linreg = mxs_get_vddd_power_source_off();
|
||||
if (new_target > cur_target) {
|
||||
if (powered_by_linreg) {
|
||||
bo_int = readl(&power_regs->hw_power_vdddctrl);
|
||||
clrbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_CTRL_ENIRQ_VDDD_BO);
|
||||
}
|
||||
|
||||
setbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_VDDDCTRL_BO_OFFSET_MASK);
|
||||
|
||||
do {
|
||||
if (new_target - cur_target > 100)
|
||||
do {
|
||||
if (abs(new_target - cur_target) > 100) {
|
||||
if (adjust_up)
|
||||
diff = cur_target + 100;
|
||||
else
|
||||
diff = new_target;
|
||||
|
||||
diff -= 800;
|
||||
diff /= 25;
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_VDDDCTRL_TRG_MASK, diff);
|
||||
|
||||
if (powered_by_linreg ||
|
||||
(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_VDD5V_GT_VDDIO))
|
||||
early_delay(500);
|
||||
else {
|
||||
while (!(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_DC_OK))
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
cur_target = readl(&power_regs->hw_power_vdddctrl);
|
||||
cur_target &= POWER_VDDDCTRL_TRG_MASK;
|
||||
cur_target *= 25; /* 25 mV step*/
|
||||
cur_target += 800; /* 800 mV lowest */
|
||||
} while (new_target > cur_target);
|
||||
|
||||
if (powered_by_linreg) {
|
||||
writel(POWER_CTRL_VDDD_BO_IRQ,
|
||||
&power_regs->hw_power_ctrl_clr);
|
||||
if (bo_int & POWER_CTRL_ENIRQ_VDDD_BO)
|
||||
setbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_CTRL_ENIRQ_VDDD_BO);
|
||||
}
|
||||
} else {
|
||||
do {
|
||||
if (cur_target - new_target > 100)
|
||||
diff = cur_target - 100;
|
||||
else
|
||||
diff = new_target;
|
||||
} else {
|
||||
diff = new_target;
|
||||
}
|
||||
|
||||
diff -= 800;
|
||||
diff /= 25;
|
||||
diff -= cfg->lowest_mV;
|
||||
diff /= cfg->step_mV;
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_VDDDCTRL_TRG_MASK, diff);
|
||||
|
||||
if (powered_by_linreg ||
|
||||
(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_VDD5V_GT_VDDIO))
|
||||
early_delay(500);
|
||||
else {
|
||||
while (!(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_DC_OK))
|
||||
;
|
||||
clrsetbits_le32(cfg->reg, cfg->trg_mask, diff);
|
||||
|
||||
if (powered_by_linreg ||
|
||||
(readl(&power_regs->hw_power_sts) &
|
||||
POWER_STS_VDD5V_GT_VDDIO))
|
||||
early_delay(500);
|
||||
else {
|
||||
for (;;) {
|
||||
tmp = readl(&power_regs->hw_power_sts);
|
||||
if (tmp & POWER_STS_DC_OK)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cur_target = readl(&power_regs->hw_power_vdddctrl);
|
||||
cur_target &= POWER_VDDDCTRL_TRG_MASK;
|
||||
cur_target *= 25; /* 25 mV step*/
|
||||
cur_target += 800; /* 800 mV lowest */
|
||||
} while (new_target < cur_target);
|
||||
cur_target = readl(cfg->reg);
|
||||
cur_target &= cfg->trg_mask;
|
||||
cur_target *= cfg->step_mV;
|
||||
cur_target += cfg->lowest_mV;
|
||||
} while (new_target > cur_target);
|
||||
|
||||
if (adjust_up && powered_by_linreg) {
|
||||
writel(cfg->bo_irq, &power_regs->hw_power_ctrl_clr);
|
||||
if (bo_int & cfg->bo_enirq)
|
||||
setbits_le32(cfg->reg, cfg->bo_enirq);
|
||||
}
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_VDDDCTRL_BO_OFFSET_MASK,
|
||||
new_brownout << POWER_VDDDCTRL_BO_OFFSET_OFFSET);
|
||||
clrsetbits_le32(cfg->reg, cfg->bo_offset_mask,
|
||||
new_brownout << cfg->bo_offset_offset);
|
||||
}
|
||||
|
||||
void mxs_setup_batt_detect(void)
|
||||
static void mxs_setup_batt_detect(void)
|
||||
{
|
||||
mxs_lradc_init();
|
||||
mxs_lradc_enable_batt_measurement();
|
||||
@@ -982,9 +896,8 @@ void mxs_power_init(void)
|
||||
mxs_power_configure_power_source();
|
||||
mxs_enable_output_rail_protection();
|
||||
|
||||
mxs_power_set_vddio(3300, 3150);
|
||||
|
||||
mxs_power_set_vddd(1350, 1200);
|
||||
mxs_power_set_vddx(&mxs_vddio_cfg, 3300, 3150);
|
||||
mxs_power_set_vddx(&mxs_vddd_cfg, 1500, 1000);
|
||||
|
||||
writel(POWER_CTRL_VDDD_BO_IRQ | POWER_CTRL_VDDA_BO_IRQ |
|
||||
POWER_CTRL_VDDIO_BO_IRQ | POWER_CTRL_VDD5V_DROOP_IRQ |
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
#include <common.h>
|
||||
#include <version.h>
|
||||
|
||||
#if defined(CONFIG_OMAP1610)
|
||||
#include <./configs/omap1510.h>
|
||||
#elif defined(CONFIG_OMAP730)
|
||||
#include <./configs/omap730.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -198,20 +192,7 @@ reset:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
#ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
#else
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
ldr sp, =(CONFIG_SPL_STACK)
|
||||
#else
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
#endif
|
||||
#endif
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -229,15 +210,11 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
sub r9, r6, r0 /* r9 <- relocation offset */
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
moveq r9, #0 /* no relocation. offset(r9) = 0 */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -289,56 +266,9 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
/* No relocation for SPL */
|
||||
ldr r0, =__bss_start
|
||||
ldr r1, =__bss_end__
|
||||
#else
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
#endif
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr r0, _nand_boot_ofs
|
||||
mov pc, r0
|
||||
|
||||
_nand_boot_ofs:
|
||||
.word nand_boot
|
||||
#else
|
||||
ldr r0, _board_init_r_ofs
|
||||
ldr r1, _TEXT_BASE
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -346,8 +276,14 @@ _rel_dyn_end_ofs:
|
||||
.word __rel_dyn_end - _start
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
#endif
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -147,12 +147,7 @@ reset:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -169,14 +164,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -228,46 +219,10 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr pc, _nand_boot
|
||||
|
||||
_nand_boot: .word nand_boot
|
||||
#else
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
_rel_dyn_end_ofs:
|
||||
@@ -275,6 +230,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -143,12 +143,7 @@ reset:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -165,14 +160,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -224,50 +215,9 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_NAND_SPL
|
||||
ldr r0, _nand_boot_ofs
|
||||
mov pc, r0
|
||||
|
||||
_nand_boot_ofs:
|
||||
.word nand_boot
|
||||
#else
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -276,6 +226,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -18,10 +18,12 @@ LIB = $(obj)lib$(SOC).o
|
||||
|
||||
COBJS += clock.o
|
||||
COBJS += sys_info.o
|
||||
COBJS += mem.o
|
||||
COBJS += ddr.o
|
||||
COBJS += emif4.o
|
||||
COBJS += board.o
|
||||
COBJS += mux.o
|
||||
COBJS-$(CONFIG_NAND_OMAP_GPMC) += elm.o
|
||||
|
||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||
OBJS := $(addprefix $(obj),$(COBJS) $(COBJS-y) $(SOBJS))
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <asm/arch/ddr_defs.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/arch/mem.h>
|
||||
#include <asm/arch/mmc_host_def.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
@@ -151,6 +151,16 @@ static void enable_per_clocks(void)
|
||||
;
|
||||
#endif /* CONFIG_SERIAL6 */
|
||||
|
||||
/* GPMC */
|
||||
writel(PRCM_MOD_EN, &cmper->gpmcclkctrl);
|
||||
while (readl(&cmper->gpmcclkctrl) != PRCM_MOD_EN)
|
||||
;
|
||||
|
||||
/* ELM */
|
||||
writel(PRCM_MOD_EN, &cmper->elmclkctrl);
|
||||
while (readl(&cmper->elmclkctrl) != PRCM_MOD_EN)
|
||||
;
|
||||
|
||||
/* MMC0*/
|
||||
writel(PRCM_MOD_EN, &cmper->mmc0clkctrl);
|
||||
while (readl(&cmper->mmc0clkctrl) != PRCM_MOD_EN)
|
||||
|
||||
212
arch/arm/cpu/armv7/am33xx/elm.c
Normal file
212
arch/arm/cpu/armv7/am33xx/elm.c
Normal file
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* (C) Copyright 2010-2011 Texas Instruments, <www.ti.com>
|
||||
* Mansoor Ahamed <mansoor.ahamed@ti.com>
|
||||
*
|
||||
* BCH Error Location Module (ELM) support.
|
||||
*
|
||||
* NOTE:
|
||||
* 1. Supports only continuous mode. Dont see need for page mode in uboot
|
||||
* 2. Supports only syndrome polynomial 0. i.e. poly local variable is
|
||||
* always set to ELM_DEFAULT_POLY. Dont see need for other polynomial
|
||||
* sets in uboot
|
||||
*
|
||||
* 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/io.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/arch/omap_gpmc.h>
|
||||
#include <asm/arch/elm.h>
|
||||
|
||||
#define ELM_DEFAULT_POLY (0)
|
||||
|
||||
struct elm *elm_cfg;
|
||||
|
||||
/**
|
||||
* elm_load_syndromes - Load BCH syndromes based on nibble selection
|
||||
* @syndrome: BCH syndrome
|
||||
* @nibbles:
|
||||
* @poly: Syndrome Polynomial set to use
|
||||
*
|
||||
* Load BCH syndromes based on nibble selection
|
||||
*/
|
||||
static void elm_load_syndromes(u8 *syndrome, u32 nibbles, u8 poly)
|
||||
{
|
||||
u32 *ptr;
|
||||
u32 val;
|
||||
|
||||
/* reg 0 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[0];
|
||||
val = syndrome[0] | (syndrome[1] << 8) | (syndrome[2] << 16) |
|
||||
(syndrome[3] << 24);
|
||||
writel(val, ptr);
|
||||
/* reg 1 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[1];
|
||||
val = syndrome[4] | (syndrome[5] << 8) | (syndrome[6] << 16) |
|
||||
(syndrome[7] << 24);
|
||||
writel(val, ptr);
|
||||
|
||||
/* BCH 8-bit with 26 nibbles (4*8=32) */
|
||||
if (nibbles > 13) {
|
||||
/* reg 2 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[2];
|
||||
val = syndrome[8] | (syndrome[9] << 8) | (syndrome[10] << 16) |
|
||||
(syndrome[11] << 24);
|
||||
writel(val, ptr);
|
||||
/* reg 3 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[3];
|
||||
val = syndrome[12] | (syndrome[13] << 8) |
|
||||
(syndrome[14] << 16) | (syndrome[15] << 24);
|
||||
writel(val, ptr);
|
||||
}
|
||||
|
||||
/* BCH 16-bit with 52 nibbles (7*8=56) */
|
||||
if (nibbles > 26) {
|
||||
/* reg 4 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[4];
|
||||
val = syndrome[16] | (syndrome[17] << 8) |
|
||||
(syndrome[18] << 16) | (syndrome[19] << 24);
|
||||
writel(val, ptr);
|
||||
|
||||
/* reg 5 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[5];
|
||||
val = syndrome[20] | (syndrome[21] << 8) |
|
||||
(syndrome[22] << 16) | (syndrome[23] << 24);
|
||||
writel(val, ptr);
|
||||
|
||||
/* reg 6 */
|
||||
ptr = &elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[6];
|
||||
val = syndrome[24] | (syndrome[25] << 8) |
|
||||
(syndrome[26] << 16) | (syndrome[27] << 24);
|
||||
writel(val, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* elm_check_errors - Check for BCH errors and return error locations
|
||||
* @syndrome: BCH syndrome
|
||||
* @nibbles:
|
||||
* @error_count: Returns number of errrors in the syndrome
|
||||
* @error_locations: Returns error locations (in decimal) in this array
|
||||
*
|
||||
* Check the provided syndrome for BCH errors and return error count
|
||||
* and locations in the array passed. Returns -1 if error is not correctable,
|
||||
* else returns 0
|
||||
*/
|
||||
int elm_check_error(u8 *syndrome, u32 nibbles, u32 *error_count,
|
||||
u32 *error_locations)
|
||||
{
|
||||
u8 poly = ELM_DEFAULT_POLY;
|
||||
s8 i;
|
||||
u32 location_status;
|
||||
|
||||
elm_load_syndromes(syndrome, nibbles, poly);
|
||||
|
||||
/* start processing */
|
||||
writel((readl(&elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[6])
|
||||
| ELM_SYNDROME_FRAGMENT_6_SYNDROME_VALID),
|
||||
&elm_cfg->syndrome_fragments[poly].syndrome_fragment_x[6]);
|
||||
|
||||
/* wait for processing to complete */
|
||||
while ((readl(&elm_cfg->irqstatus) & (0x1 << poly)) != 0x1)
|
||||
;
|
||||
/* clear status */
|
||||
writel((readl(&elm_cfg->irqstatus) | (0x1 << poly)),
|
||||
&elm_cfg->irqstatus);
|
||||
|
||||
/* check if correctable */
|
||||
location_status = readl(&elm_cfg->error_location[poly].location_status);
|
||||
if (!(location_status & ELM_LOCATION_STATUS_ECC_CORRECTABLE_MASK))
|
||||
return -1;
|
||||
|
||||
/* get error count */
|
||||
*error_count = readl(&elm_cfg->error_location[poly].location_status) &
|
||||
ELM_LOCATION_STATUS_ECC_NB_ERRORS_MASK;
|
||||
|
||||
for (i = 0; i < *error_count; i++) {
|
||||
error_locations[i] =
|
||||
readl(&elm_cfg->error_location[poly].error_location_x[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* elm_config - Configure ELM module
|
||||
* @level: 4 / 8 / 16 bit BCH
|
||||
*
|
||||
* Configure ELM module based on BCH level.
|
||||
* Set mode as continuous mode.
|
||||
* Currently we are using only syndrome 0 and syndromes 1 to 6 are not used.
|
||||
* Also, the mode is set only for syndrome 0
|
||||
*/
|
||||
int elm_config(enum bch_level level)
|
||||
{
|
||||
u32 val;
|
||||
u8 poly = ELM_DEFAULT_POLY;
|
||||
u32 buffer_size = 0x7FF;
|
||||
|
||||
/* config size and level */
|
||||
val = (u32)(level) & ELM_LOCATION_CONFIG_ECC_BCH_LEVEL_MASK;
|
||||
val |= ((buffer_size << ELM_LOCATION_CONFIG_ECC_SIZE_POS) &
|
||||
ELM_LOCATION_CONFIG_ECC_SIZE_MASK);
|
||||
writel(val, &elm_cfg->location_config);
|
||||
|
||||
/* config continous mode */
|
||||
/* enable interrupt generation for syndrome polynomial set */
|
||||
writel((readl(&elm_cfg->irqenable) | (0x1 << poly)),
|
||||
&elm_cfg->irqenable);
|
||||
/* set continuous mode for the syndrome polynomial set */
|
||||
writel((readl(&elm_cfg->page_ctrl) & ~(0x1 << poly)),
|
||||
&elm_cfg->page_ctrl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* elm_reset - Do a soft reset of ELM
|
||||
*
|
||||
* Perform a soft reset of ELM and return after reset is done.
|
||||
*/
|
||||
void elm_reset(void)
|
||||
{
|
||||
/* initiate reset */
|
||||
writel((readl(&elm_cfg->sysconfig) | ELM_SYSCONFIG_SOFTRESET),
|
||||
&elm_cfg->sysconfig);
|
||||
|
||||
/* wait for reset complete and normal operation */
|
||||
while ((readl(&elm_cfg->sysstatus) & ELM_SYSSTATUS_RESETDONE) !=
|
||||
ELM_SYSSTATUS_RESETDONE)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* elm_init - Initialize ELM module
|
||||
*
|
||||
* Initialize ELM support. Currently it does only base address init
|
||||
* and ELM reset.
|
||||
*/
|
||||
void elm_init(void)
|
||||
{
|
||||
elm_cfg = (struct elm *)ELM_BASE;
|
||||
elm_reset();
|
||||
}
|
||||
101
arch/arm/cpu/armv7/am33xx/mem.c
Normal file
101
arch/arm/cpu/armv7/am33xx/mem.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* (C) Copyright 2010
|
||||
* Texas Instruments, <www.ti.com>
|
||||
*
|
||||
* Author :
|
||||
* Mansoor Ahamed <mansoor.ahamed@ti.com>
|
||||
*
|
||||
* Initial Code from:
|
||||
* Manikandan Pillai <mani.pillai@ti.com>
|
||||
* Richard Woodruff <r-woodruff2@ti.com>
|
||||
* Syed Mohammed Khasim <khasim@ti.com>
|
||||
*
|
||||
* 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/io.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/arch/mem.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <command.h>
|
||||
|
||||
struct gpmc *gpmc_cfg;
|
||||
|
||||
#if defined(CONFIG_CMD_NAND)
|
||||
static const u32 gpmc_m_nand[GPMC_MAX_REG] = {
|
||||
M_NAND_GPMC_CONFIG1,
|
||||
M_NAND_GPMC_CONFIG2,
|
||||
M_NAND_GPMC_CONFIG3,
|
||||
M_NAND_GPMC_CONFIG4,
|
||||
M_NAND_GPMC_CONFIG5,
|
||||
M_NAND_GPMC_CONFIG6, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
|
||||
u32 size)
|
||||
{
|
||||
writel(0, &cs->config7);
|
||||
sdelay(1000);
|
||||
/* Delay for settling */
|
||||
writel(gpmc_config[0], &cs->config1);
|
||||
writel(gpmc_config[1], &cs->config2);
|
||||
writel(gpmc_config[2], &cs->config3);
|
||||
writel(gpmc_config[3], &cs->config4);
|
||||
writel(gpmc_config[4], &cs->config5);
|
||||
writel(gpmc_config[5], &cs->config6);
|
||||
/* Enable the config */
|
||||
writel((((size & 0xF) << 8) | ((base >> 24) & 0x3F) |
|
||||
(1 << 6)), &cs->config7);
|
||||
sdelay(2000);
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* gpmc_init(): init gpmc bus
|
||||
* Init GPMC for x16, MuxMode (SDRAM in x32).
|
||||
* This code can only be executed from SRAM or SDRAM.
|
||||
*****************************************************/
|
||||
void gpmc_init(void)
|
||||
{
|
||||
/* putting a blanket check on GPMC based on ZeBu for now */
|
||||
gpmc_cfg = (struct gpmc *)GPMC_BASE;
|
||||
|
||||
#ifdef CONFIG_CMD_NAND
|
||||
const u32 *gpmc_config = NULL;
|
||||
u32 base = 0;
|
||||
u32 size = 0;
|
||||
#endif
|
||||
/* global settings */
|
||||
writel(0x00000008, &gpmc_cfg->sysconfig);
|
||||
writel(0x00000100, &gpmc_cfg->irqstatus);
|
||||
writel(0x00000200, &gpmc_cfg->irqenable);
|
||||
writel(0x00000012, &gpmc_cfg->config);
|
||||
/*
|
||||
* Disable the GPMC0 config set by ROM code
|
||||
*/
|
||||
writel(0, &gpmc_cfg->cs[0].config7);
|
||||
sdelay(1000);
|
||||
|
||||
#ifdef CONFIG_CMD_NAND
|
||||
gpmc_config = gpmc_m_nand;
|
||||
|
||||
base = PISMO1_NAND_BASE;
|
||||
size = PISMO1_NAND_SIZE;
|
||||
enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[0], base, size);
|
||||
#endif
|
||||
}
|
||||
@@ -297,6 +297,12 @@ void arm_init_before_mmu(void)
|
||||
v7_inval_tlb();
|
||||
}
|
||||
|
||||
void mmu_page_table_flush(unsigned long start, unsigned long stop)
|
||||
{
|
||||
flush_dcache_range(start, stop);
|
||||
v7_inval_tlb();
|
||||
}
|
||||
|
||||
/*
|
||||
* Flush range from all levels of d-cache/unified-cache used:
|
||||
* Affects the range [start, start + size - 1]
|
||||
@@ -329,6 +335,11 @@ void arm_init_before_mmu(void)
|
||||
void flush_cache(unsigned long start, unsigned long size)
|
||||
{
|
||||
}
|
||||
|
||||
void mmu_page_table_flush(unsigned long start, unsigned long stop)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
|
||||
|
||||
#ifndef CONFIG_SYS_ICACHE_OFF
|
||||
|
||||
@@ -25,42 +25,32 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <asm/arch/periph.h>
|
||||
|
||||
/* exynos4: return pll clock frequency */
|
||||
static unsigned long exynos4_get_pll_clk(int pllreg)
|
||||
/* Epll Clock division values to achive different frequency output */
|
||||
static struct set_epll_con_val exynos5_epll_div[] = {
|
||||
{ 192000000, 0, 48, 3, 1, 0 },
|
||||
{ 180000000, 0, 45, 3, 1, 0 },
|
||||
{ 73728000, 1, 73, 3, 3, 47710 },
|
||||
{ 67737600, 1, 90, 4, 3, 20762 },
|
||||
{ 49152000, 0, 49, 3, 3, 9961 },
|
||||
{ 45158400, 0, 45, 3, 3, 10381 },
|
||||
{ 180633600, 0, 45, 3, 1, 10381 }
|
||||
};
|
||||
|
||||
/* exynos: return pll clock frequency */
|
||||
static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
|
||||
{
|
||||
struct exynos4_clock *clk =
|
||||
(struct exynos4_clock *)samsung_get_base_clock();
|
||||
unsigned long r, m, p, s, k = 0, mask, fout;
|
||||
unsigned long m, p, s = 0, mask, fout;
|
||||
unsigned int freq;
|
||||
|
||||
switch (pllreg) {
|
||||
case APLL:
|
||||
r = readl(&clk->apll_con0);
|
||||
break;
|
||||
case MPLL:
|
||||
r = readl(&clk->mpll_con0);
|
||||
break;
|
||||
case EPLL:
|
||||
r = readl(&clk->epll_con0);
|
||||
k = readl(&clk->epll_con1);
|
||||
break;
|
||||
case VPLL:
|
||||
r = readl(&clk->vpll_con0);
|
||||
k = readl(&clk->vpll_con1);
|
||||
break;
|
||||
default:
|
||||
printf("Unsupported PLL (%d)\n", pllreg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* APLL_CON: MIDV [25:16]
|
||||
* MPLL_CON: MIDV [25:16]
|
||||
* EPLL_CON: MIDV [24:16]
|
||||
* VPLL_CON: MIDV [24:16]
|
||||
* BPLL_CON: MIDV [25:16]: Exynos5
|
||||
*/
|
||||
if (pllreg == APLL || pllreg == MPLL)
|
||||
if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
|
||||
mask = 0x3ff;
|
||||
else
|
||||
mask = 0x1ff;
|
||||
@@ -92,13 +82,73 @@ static unsigned long exynos4_get_pll_clk(int pllreg)
|
||||
return fout;
|
||||
}
|
||||
|
||||
/* exynos4: return pll clock frequency */
|
||||
static unsigned long exynos4_get_pll_clk(int pllreg)
|
||||
{
|
||||
struct exynos4_clock *clk =
|
||||
(struct exynos4_clock *)samsung_get_base_clock();
|
||||
unsigned long r, k = 0;
|
||||
|
||||
switch (pllreg) {
|
||||
case APLL:
|
||||
r = readl(&clk->apll_con0);
|
||||
break;
|
||||
case MPLL:
|
||||
r = readl(&clk->mpll_con0);
|
||||
break;
|
||||
case EPLL:
|
||||
r = readl(&clk->epll_con0);
|
||||
k = readl(&clk->epll_con1);
|
||||
break;
|
||||
case VPLL:
|
||||
r = readl(&clk->vpll_con0);
|
||||
k = readl(&clk->vpll_con1);
|
||||
break;
|
||||
default:
|
||||
printf("Unsupported PLL (%d)\n", pllreg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return exynos_get_pll_clk(pllreg, r, k);
|
||||
}
|
||||
|
||||
/* exynos4x12: return pll clock frequency */
|
||||
static unsigned long exynos4x12_get_pll_clk(int pllreg)
|
||||
{
|
||||
struct exynos4x12_clock *clk =
|
||||
(struct exynos4x12_clock *)samsung_get_base_clock();
|
||||
unsigned long r, k = 0;
|
||||
|
||||
switch (pllreg) {
|
||||
case APLL:
|
||||
r = readl(&clk->apll_con0);
|
||||
break;
|
||||
case MPLL:
|
||||
r = readl(&clk->mpll_con0);
|
||||
break;
|
||||
case EPLL:
|
||||
r = readl(&clk->epll_con0);
|
||||
k = readl(&clk->epll_con1);
|
||||
break;
|
||||
case VPLL:
|
||||
r = readl(&clk->vpll_con0);
|
||||
k = readl(&clk->vpll_con1);
|
||||
break;
|
||||
default:
|
||||
printf("Unsupported PLL (%d)\n", pllreg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return exynos_get_pll_clk(pllreg, r, k);
|
||||
}
|
||||
|
||||
/* exynos5: return pll clock frequency */
|
||||
static unsigned long exynos5_get_pll_clk(int pllreg)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
unsigned long r, m, p, s, k = 0, mask, fout;
|
||||
unsigned int freq, pll_div2_sel, fout_sel;
|
||||
unsigned long r, k = 0, fout;
|
||||
unsigned int pll_div2_sel, fout_sel;
|
||||
|
||||
switch (pllreg) {
|
||||
case APLL:
|
||||
@@ -123,41 +173,7 @@ static unsigned long exynos5_get_pll_clk(int pllreg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* APLL_CON: MIDV [25:16]
|
||||
* MPLL_CON: MIDV [25:16]
|
||||
* EPLL_CON: MIDV [24:16]
|
||||
* VPLL_CON: MIDV [24:16]
|
||||
* BPLL_CON: MIDV [25:16]
|
||||
*/
|
||||
if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
|
||||
mask = 0x3ff;
|
||||
else
|
||||
mask = 0x1ff;
|
||||
|
||||
m = (r >> 16) & mask;
|
||||
|
||||
/* PDIV [13:8] */
|
||||
p = (r >> 8) & 0x3f;
|
||||
/* SDIV [2:0] */
|
||||
s = r & 0x7;
|
||||
|
||||
freq = CONFIG_SYS_CLK_FREQ;
|
||||
|
||||
if (pllreg == EPLL) {
|
||||
k = k & 0xffff;
|
||||
/* FOUT = (MDIV + K / 65536) * FIN / (PDIV * 2^SDIV) */
|
||||
fout = (m + k / 65536) * (freq / (p * (1 << s)));
|
||||
} else if (pllreg == VPLL) {
|
||||
k = k & 0xfff;
|
||||
/* FOUT = (MDIV + K / 1024) * FIN / (PDIV * 2^SDIV) */
|
||||
fout = (m + k / 1024) * (freq / (p * (1 << s)));
|
||||
} else {
|
||||
if (s < 1)
|
||||
s = 1;
|
||||
/* FOUT = MDIV * FIN / (PDIV * 2^(SDIV - 1)) */
|
||||
fout = m * (freq / (p * (1 << (s - 1))));
|
||||
}
|
||||
fout = exynos_get_pll_clk(pllreg, r, k);
|
||||
|
||||
/* According to the user manual, in EVT1 MPLL and BPLL always gives
|
||||
* 1.6GHz clock, so divide by 2 to get 800MHz MPLL clock.*/
|
||||
@@ -207,6 +223,28 @@ static unsigned long exynos4_get_arm_clk(void)
|
||||
return armclk;
|
||||
}
|
||||
|
||||
/* exynos4x12: return ARM clock frequency */
|
||||
static unsigned long exynos4x12_get_arm_clk(void)
|
||||
{
|
||||
struct exynos4x12_clock *clk =
|
||||
(struct exynos4x12_clock *)samsung_get_base_clock();
|
||||
unsigned long div;
|
||||
unsigned long armclk;
|
||||
unsigned int core_ratio;
|
||||
unsigned int core2_ratio;
|
||||
|
||||
div = readl(&clk->div_cpu0);
|
||||
|
||||
/* CORE_RATIO: [2:0], CORE2_RATIO: [30:28] */
|
||||
core_ratio = (div >> 0) & 0x7;
|
||||
core2_ratio = (div >> 28) & 0x7;
|
||||
|
||||
armclk = get_pll_clk(APLL) / (core_ratio + 1);
|
||||
armclk /= (core2_ratio + 1);
|
||||
|
||||
return armclk;
|
||||
}
|
||||
|
||||
/* exynos5: return ARM clock frequency */
|
||||
static unsigned long exynos5_get_arm_clk(void)
|
||||
{
|
||||
@@ -272,6 +310,20 @@ static unsigned long exynos4_get_pwm_clk(void)
|
||||
return pclk;
|
||||
}
|
||||
|
||||
/* exynos4x12: return pwm clock frequency */
|
||||
static unsigned long exynos4x12_get_pwm_clk(void)
|
||||
{
|
||||
unsigned long pclk, sclk;
|
||||
unsigned int ratio;
|
||||
|
||||
sclk = get_pll_clk(MPLL);
|
||||
ratio = 8;
|
||||
|
||||
pclk = sclk / (ratio + 1);
|
||||
|
||||
return pclk;
|
||||
}
|
||||
|
||||
/* exynos5: return pwm clock frequency */
|
||||
static unsigned long exynos5_get_pwm_clk(void)
|
||||
{
|
||||
@@ -340,6 +392,51 @@ static unsigned long exynos4_get_uart_clk(int dev_index)
|
||||
return uclk;
|
||||
}
|
||||
|
||||
/* exynos4x12: return uart clock frequency */
|
||||
static unsigned long exynos4x12_get_uart_clk(int dev_index)
|
||||
{
|
||||
struct exynos4x12_clock *clk =
|
||||
(struct exynos4x12_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel;
|
||||
unsigned int ratio;
|
||||
|
||||
/*
|
||||
* CLK_SRC_PERIL0
|
||||
* UART0_SEL [3:0]
|
||||
* UART1_SEL [7:4]
|
||||
* UART2_SEL [8:11]
|
||||
* UART3_SEL [12:15]
|
||||
* UART4_SEL [16:19]
|
||||
*/
|
||||
sel = readl(&clk->src_peril0);
|
||||
sel = (sel >> (dev_index << 2)) & 0xf;
|
||||
|
||||
if (sel == 0x6)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x7)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else if (sel == 0x8)
|
||||
sclk = get_pll_clk(VPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* CLK_DIV_PERIL0
|
||||
* UART0_RATIO [3:0]
|
||||
* UART1_RATIO [7:4]
|
||||
* UART2_RATIO [8:11]
|
||||
* UART3_RATIO [12:15]
|
||||
* UART4_RATIO [16:19]
|
||||
*/
|
||||
ratio = readl(&clk->div_peril0);
|
||||
ratio = (ratio >> (dev_index << 2)) & 0xf;
|
||||
|
||||
uclk = sclk / (ratio + 1);
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
/* exynos5: return uart clock frequency */
|
||||
static unsigned long exynos5_get_uart_clk(int dev_index)
|
||||
{
|
||||
@@ -387,6 +484,100 @@ static unsigned long exynos5_get_uart_clk(int dev_index)
|
||||
return uclk;
|
||||
}
|
||||
|
||||
static unsigned long exynos4_get_mmc_clk(int dev_index)
|
||||
{
|
||||
struct exynos4_clock *clk =
|
||||
(struct exynos4_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel, ratio, pre_ratio;
|
||||
int shift;
|
||||
|
||||
sel = readl(&clk->src_fsys);
|
||||
sel = (sel >> (dev_index << 2)) & 0xf;
|
||||
|
||||
if (sel == 0x6)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x7)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else if (sel == 0x8)
|
||||
sclk = get_pll_clk(VPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
switch (dev_index) {
|
||||
case 0:
|
||||
case 1:
|
||||
ratio = readl(&clk->div_fsys1);
|
||||
pre_ratio = readl(&clk->div_fsys1);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
ratio = readl(&clk->div_fsys2);
|
||||
pre_ratio = readl(&clk->div_fsys2);
|
||||
break;
|
||||
case 4:
|
||||
ratio = readl(&clk->div_fsys3);
|
||||
pre_ratio = readl(&clk->div_fsys3);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dev_index == 1 || dev_index == 3)
|
||||
shift = 16;
|
||||
|
||||
ratio = (ratio >> shift) & 0xf;
|
||||
pre_ratio = (pre_ratio >> (shift + 8)) & 0xff;
|
||||
uclk = (sclk / (ratio + 1)) / (pre_ratio + 1);
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
static unsigned long exynos5_get_mmc_clk(int dev_index)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel, ratio, pre_ratio;
|
||||
int shift;
|
||||
|
||||
sel = readl(&clk->src_fsys);
|
||||
sel = (sel >> (dev_index << 2)) & 0xf;
|
||||
|
||||
if (sel == 0x6)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x7)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else if (sel == 0x8)
|
||||
sclk = get_pll_clk(VPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
switch (dev_index) {
|
||||
case 0:
|
||||
case 1:
|
||||
ratio = readl(&clk->div_fsys1);
|
||||
pre_ratio = readl(&clk->div_fsys1);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
ratio = readl(&clk->div_fsys2);
|
||||
pre_ratio = readl(&clk->div_fsys2);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dev_index == 1 || dev_index == 3)
|
||||
shift = 16;
|
||||
|
||||
ratio = (ratio >> shift) & 0xf;
|
||||
pre_ratio = (pre_ratio >> (shift + 8)) & 0xff;
|
||||
uclk = (sclk / (ratio + 1)) / (pre_ratio + 1);
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
/* exynos4: set the mmc clock */
|
||||
static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
|
||||
{
|
||||
@@ -395,6 +586,38 @@ static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
|
||||
unsigned int addr;
|
||||
unsigned int val;
|
||||
|
||||
/*
|
||||
* CLK_DIV_FSYS1
|
||||
* MMC0_PRE_RATIO [15:8], MMC1_PRE_RATIO [31:24]
|
||||
* CLK_DIV_FSYS2
|
||||
* MMC2_PRE_RATIO [15:8], MMC3_PRE_RATIO [31:24]
|
||||
* CLK_DIV_FSYS3
|
||||
* MMC4_PRE_RATIO [15:8]
|
||||
*/
|
||||
if (dev_index < 2) {
|
||||
addr = (unsigned int)&clk->div_fsys1;
|
||||
} else if (dev_index == 4) {
|
||||
addr = (unsigned int)&clk->div_fsys3;
|
||||
dev_index -= 4;
|
||||
} else {
|
||||
addr = (unsigned int)&clk->div_fsys2;
|
||||
dev_index -= 2;
|
||||
}
|
||||
|
||||
val = readl(addr);
|
||||
val &= ~(0xff << ((dev_index << 4) + 8));
|
||||
val |= (div & 0xff) << ((dev_index << 4) + 8);
|
||||
writel(val, addr);
|
||||
}
|
||||
|
||||
/* exynos4x12: set the mmc clock */
|
||||
static void exynos4x12_set_mmc_clk(int dev_index, unsigned int div)
|
||||
{
|
||||
struct exynos4x12_clock *clk =
|
||||
(struct exynos4x12_clock *)samsung_get_base_clock();
|
||||
unsigned int addr;
|
||||
unsigned int val;
|
||||
|
||||
/*
|
||||
* CLK_DIV_FSYS1
|
||||
* MMC0_PRE_RATIO [15:8], MMC1_PRE_RATIO [31:24]
|
||||
@@ -617,7 +840,7 @@ void exynos5_set_lcd_clk(void)
|
||||
*/
|
||||
cfg = readl(&clk->src_disp1_0);
|
||||
cfg &= ~(0xf);
|
||||
cfg |= 0x8;
|
||||
cfg |= 0x6;
|
||||
writel(cfg, &clk->src_disp1_0);
|
||||
|
||||
/*
|
||||
@@ -732,6 +955,209 @@ static unsigned long exynos5_get_i2c_clk(void)
|
||||
return aclk_66;
|
||||
}
|
||||
|
||||
int exynos5_set_epll_clk(unsigned long rate)
|
||||
{
|
||||
unsigned int epll_con, epll_con_k;
|
||||
unsigned int i;
|
||||
unsigned int lockcnt;
|
||||
unsigned int start;
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
|
||||
epll_con = readl(&clk->epll_con0);
|
||||
epll_con &= ~((EPLL_CON0_LOCK_DET_EN_MASK <<
|
||||
EPLL_CON0_LOCK_DET_EN_SHIFT) |
|
||||
EPLL_CON0_MDIV_MASK << EPLL_CON0_MDIV_SHIFT |
|
||||
EPLL_CON0_PDIV_MASK << EPLL_CON0_PDIV_SHIFT |
|
||||
EPLL_CON0_SDIV_MASK << EPLL_CON0_SDIV_SHIFT);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(exynos5_epll_div); i++) {
|
||||
if (exynos5_epll_div[i].freq_out == rate)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == ARRAY_SIZE(exynos5_epll_div))
|
||||
return -1;
|
||||
|
||||
epll_con_k = exynos5_epll_div[i].k_dsm << 0;
|
||||
epll_con |= exynos5_epll_div[i].en_lock_det <<
|
||||
EPLL_CON0_LOCK_DET_EN_SHIFT;
|
||||
epll_con |= exynos5_epll_div[i].m_div << EPLL_CON0_MDIV_SHIFT;
|
||||
epll_con |= exynos5_epll_div[i].p_div << EPLL_CON0_PDIV_SHIFT;
|
||||
epll_con |= exynos5_epll_div[i].s_div << EPLL_CON0_SDIV_SHIFT;
|
||||
|
||||
/*
|
||||
* Required period ( in cycles) to genarate a stable clock output.
|
||||
* The maximum clock time can be up to 3000 * PDIV cycles of PLLs
|
||||
* frequency input (as per spec)
|
||||
*/
|
||||
lockcnt = 3000 * exynos5_epll_div[i].p_div;
|
||||
|
||||
writel(lockcnt, &clk->epll_lock);
|
||||
writel(epll_con, &clk->epll_con0);
|
||||
writel(epll_con_k, &clk->epll_con1);
|
||||
|
||||
start = get_timer(0);
|
||||
|
||||
while (!(readl(&clk->epll_con0) &
|
||||
(0x1 << EXYNOS5_EPLLCON0_LOCKED_SHIFT))) {
|
||||
if (get_timer(start) > TIMEOUT_EPLL_LOCK) {
|
||||
debug("%s: Timeout waiting for EPLL lock\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void exynos5_set_i2s_clk_source(void)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
|
||||
clrsetbits_le32(&clk->src_peric1, AUDIO1_SEL_MASK,
|
||||
(CLK_SRC_SCLK_EPLL));
|
||||
}
|
||||
|
||||
int exynos5_set_i2s_clk_prescaler(unsigned int src_frq,
|
||||
unsigned int dst_frq)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
unsigned int div;
|
||||
|
||||
if ((dst_frq == 0) || (src_frq == 0)) {
|
||||
debug("%s: Invalid requency input for prescaler\n", __func__);
|
||||
debug("src frq = %d des frq = %d ", src_frq, dst_frq);
|
||||
return -1;
|
||||
}
|
||||
|
||||
div = (src_frq / dst_frq);
|
||||
if (div > AUDIO_1_RATIO_MASK) {
|
||||
debug("%s: Frequency ratio is out of range\n", __func__);
|
||||
debug("src frq = %d des frq = %d ", src_frq, dst_frq);
|
||||
return -1;
|
||||
}
|
||||
clrsetbits_le32(&clk->div_peric4, AUDIO_1_RATIO_MASK,
|
||||
(div & AUDIO_1_RATIO_MASK));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Linearly searches for the most accurate main and fine stage clock scalars
|
||||
* (divisors) for a specified target frequency and scalar bit sizes by checking
|
||||
* all multiples of main_scalar_bits values. Will always return scalars up to or
|
||||
* slower than target.
|
||||
*
|
||||
* @param main_scalar_bits Number of main scalar bits, must be > 0 and < 32
|
||||
* @param fine_scalar_bits Number of fine scalar bits, must be > 0 and < 32
|
||||
* @param input_freq Clock frequency to be scaled in Hz
|
||||
* @param target_freq Desired clock frequency in Hz
|
||||
* @param best_fine_scalar Pointer to store the fine stage divisor
|
||||
*
|
||||
* @return best_main_scalar Main scalar for desired frequency or -1 if none
|
||||
* found
|
||||
*/
|
||||
static int clock_calc_best_scalar(unsigned int main_scaler_bits,
|
||||
unsigned int fine_scalar_bits, unsigned int input_rate,
|
||||
unsigned int target_rate, unsigned int *best_fine_scalar)
|
||||
{
|
||||
int i;
|
||||
int best_main_scalar = -1;
|
||||
unsigned int best_error = target_rate;
|
||||
const unsigned int cap = (1 << fine_scalar_bits) - 1;
|
||||
const unsigned int loops = 1 << main_scaler_bits;
|
||||
|
||||
debug("Input Rate is %u, Target is %u, Cap is %u\n", input_rate,
|
||||
target_rate, cap);
|
||||
|
||||
assert(best_fine_scalar != NULL);
|
||||
assert(main_scaler_bits <= fine_scalar_bits);
|
||||
|
||||
*best_fine_scalar = 1;
|
||||
|
||||
if (input_rate == 0 || target_rate == 0)
|
||||
return -1;
|
||||
|
||||
if (target_rate >= input_rate)
|
||||
return 1;
|
||||
|
||||
for (i = 1; i <= loops; i++) {
|
||||
const unsigned int effective_div = max(min(input_rate / i /
|
||||
target_rate, cap), 1);
|
||||
const unsigned int effective_rate = input_rate / i /
|
||||
effective_div;
|
||||
const int error = target_rate - effective_rate;
|
||||
|
||||
debug("%d|effdiv:%u, effrate:%u, error:%d\n", i, effective_div,
|
||||
effective_rate, error);
|
||||
|
||||
if (error >= 0 && error <= best_error) {
|
||||
best_error = error;
|
||||
best_main_scalar = i;
|
||||
*best_fine_scalar = effective_div;
|
||||
}
|
||||
}
|
||||
|
||||
return best_main_scalar;
|
||||
}
|
||||
|
||||
static int exynos5_set_spi_clk(enum periph_id periph_id,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
int main;
|
||||
unsigned int fine;
|
||||
unsigned shift, pre_shift;
|
||||
unsigned mask = 0xff;
|
||||
u32 *reg;
|
||||
|
||||
main = clock_calc_best_scalar(4, 8, 400000000, rate, &fine);
|
||||
if (main < 0) {
|
||||
debug("%s: Cannot set clock rate for periph %d",
|
||||
__func__, periph_id);
|
||||
return -1;
|
||||
}
|
||||
main = main - 1;
|
||||
fine = fine - 1;
|
||||
|
||||
switch (periph_id) {
|
||||
case PERIPH_ID_SPI0:
|
||||
reg = &clk->div_peric1;
|
||||
shift = 0;
|
||||
pre_shift = 8;
|
||||
break;
|
||||
case PERIPH_ID_SPI1:
|
||||
reg = &clk->div_peric1;
|
||||
shift = 16;
|
||||
pre_shift = 24;
|
||||
break;
|
||||
case PERIPH_ID_SPI2:
|
||||
reg = &clk->div_peric2;
|
||||
shift = 0;
|
||||
pre_shift = 8;
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
reg = &clk->sclk_div_isp;
|
||||
shift = 0;
|
||||
pre_shift = 4;
|
||||
break;
|
||||
case PERIPH_ID_SPI4:
|
||||
reg = &clk->sclk_div_isp;
|
||||
shift = 12;
|
||||
pre_shift = 16;
|
||||
break;
|
||||
default:
|
||||
debug("%s: Unsupported peripheral ID %d\n", __func__,
|
||||
periph_id);
|
||||
return -1;
|
||||
}
|
||||
clrsetbits_le32(reg, mask << shift, (main & mask) << shift);
|
||||
clrsetbits_le32(reg, mask << pre_shift, (fine & mask) << pre_shift);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long exynos4_get_i2c_clk(void)
|
||||
{
|
||||
struct exynos4_clock *clk =
|
||||
@@ -751,16 +1177,22 @@ unsigned long get_pll_clk(int pllreg)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_get_pll_clk(pllreg);
|
||||
else
|
||||
else {
|
||||
if (proid_is_exynos4412())
|
||||
return exynos4x12_get_pll_clk(pllreg);
|
||||
return exynos4_get_pll_clk(pllreg);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long get_arm_clk(void)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_get_arm_clk();
|
||||
else
|
||||
else {
|
||||
if (proid_is_exynos4412())
|
||||
return exynos4x12_get_arm_clk();
|
||||
return exynos4_get_arm_clk();
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long get_i2c_clk(void)
|
||||
@@ -779,24 +1211,41 @@ unsigned long get_pwm_clk(void)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_get_pwm_clk();
|
||||
else
|
||||
else {
|
||||
if (proid_is_exynos4412())
|
||||
return exynos4x12_get_pwm_clk();
|
||||
return exynos4_get_pwm_clk();
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long get_uart_clk(int dev_index)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_get_uart_clk(dev_index);
|
||||
else
|
||||
else {
|
||||
if (proid_is_exynos4412())
|
||||
return exynos4x12_get_uart_clk(dev_index);
|
||||
return exynos4_get_uart_clk(dev_index);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long get_mmc_clk(int dev_index)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_get_mmc_clk(dev_index);
|
||||
else
|
||||
return exynos4_get_mmc_clk(dev_index);
|
||||
}
|
||||
|
||||
void set_mmc_clk(int dev_index, unsigned int div)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
exynos5_set_mmc_clk(dev_index, div);
|
||||
else
|
||||
else {
|
||||
if (proid_is_exynos4412())
|
||||
exynos4x12_set_mmc_clk(dev_index, div);
|
||||
exynos4_set_mmc_clk(dev_index, div);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long get_lcd_clk(void)
|
||||
@@ -820,3 +1269,34 @@ void set_mipi_clk(void)
|
||||
if (cpu_is_exynos4())
|
||||
exynos4_set_mipi_clk();
|
||||
}
|
||||
|
||||
int set_spi_clk(int periph_id, unsigned int rate)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_set_spi_clk(periph_id, rate);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int set_i2s_clk_prescaler(unsigned int src_frq, unsigned int dst_frq)
|
||||
{
|
||||
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_set_i2s_clk_prescaler(src_frq, dst_frq);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void set_i2s_clk_source(void)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
exynos5_set_i2s_clk_source();
|
||||
}
|
||||
|
||||
int set_epll_clk(unsigned long rate)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_set_epll_clk(rate);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <fdtdec.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
#include <asm/arch/sromc.h>
|
||||
@@ -112,6 +113,7 @@ static int exynos5_mmc_config(int peripheral, int flags)
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_UP);
|
||||
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -230,6 +232,59 @@ static void exynos5_i2c_config(int peripheral, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos5_i2s_config(int peripheral)
|
||||
{
|
||||
int i;
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
s5p_gpio_cfg_pin(&gpio1->b0, i, GPIO_FUNC(0x02));
|
||||
}
|
||||
|
||||
void exynos5_spi_config(int peripheral)
|
||||
{
|
||||
int cfg = 0, pin = 0, i;
|
||||
struct s5p_gpio_bank *bank = NULL;
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
struct exynos5_gpio_part2 *gpio2 =
|
||||
(struct exynos5_gpio_part2 *) samsung_get_base_gpio_part2();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SPI0:
|
||||
bank = &gpio1->a2;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 0;
|
||||
break;
|
||||
case PERIPH_ID_SPI1:
|
||||
bank = &gpio1->a2;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 4;
|
||||
break;
|
||||
case PERIPH_ID_SPI2:
|
||||
bank = &gpio1->b1;
|
||||
cfg = GPIO_FUNC(0x5);
|
||||
pin = 1;
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
bank = &gpio2->f1;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 0;
|
||||
break;
|
||||
case PERIPH_ID_SPI4:
|
||||
for (i = 0; i < 2; i++) {
|
||||
s5p_gpio_cfg_pin(&gpio2->f0, i + 2, GPIO_FUNC(0x4));
|
||||
s5p_gpio_cfg_pin(&gpio2->e0, i + 4, GPIO_FUNC(0x4));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (peripheral != PERIPH_ID_SPI4) {
|
||||
for (i = pin; i < pin + 4; i++)
|
||||
s5p_gpio_cfg_pin(bank, i, cfg);
|
||||
}
|
||||
}
|
||||
|
||||
static int exynos5_pinmux_config(int peripheral, int flags)
|
||||
{
|
||||
switch (peripheral) {
|
||||
@@ -257,6 +312,16 @@ static int exynos5_pinmux_config(int peripheral, int flags)
|
||||
case PERIPH_ID_I2C7:
|
||||
exynos5_i2c_config(peripheral, flags);
|
||||
break;
|
||||
case PERIPH_ID_I2S1:
|
||||
exynos5_i2s_config(peripheral);
|
||||
break;
|
||||
case PERIPH_ID_SPI0:
|
||||
case PERIPH_ID_SPI1:
|
||||
case PERIPH_ID_SPI2:
|
||||
case PERIPH_ID_SPI3:
|
||||
case PERIPH_ID_SPI4:
|
||||
exynos5_spi_config(peripheral);
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
@@ -306,6 +371,43 @@ static void exynos4_i2c_config(int peripheral, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
static int exynos4_mmc_config(int peripheral, int flags)
|
||||
{
|
||||
struct exynos4_gpio_part2 *gpio2 =
|
||||
(struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
|
||||
struct s5p_gpio_bank *bank, *bank_ext;
|
||||
int i;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SDMMC0:
|
||||
bank = &gpio2->k0;
|
||||
bank_ext = &gpio2->k1;
|
||||
break;
|
||||
case PERIPH_ID_SDMMC2:
|
||||
bank = &gpio2->k2;
|
||||
bank_ext = &gpio2->k3;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
for (i = 0; i < 7; i++) {
|
||||
if (i == 2)
|
||||
continue;
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
|
||||
}
|
||||
if (flags & PINMUX_FLAG_8BIT_MODE) {
|
||||
for (i = 3; i < 7; i++) {
|
||||
s5p_gpio_cfg_pin(bank_ext, i, GPIO_FUNC(0x3));
|
||||
s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_NONE);
|
||||
s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int exynos4_pinmux_config(int peripheral, int flags)
|
||||
{
|
||||
switch (peripheral) {
|
||||
@@ -319,6 +421,14 @@ static int exynos4_pinmux_config(int peripheral, int flags)
|
||||
case PERIPH_ID_I2C7:
|
||||
exynos4_i2c_config(peripheral, flags);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC0:
|
||||
case PERIPH_ID_SDMMC2:
|
||||
return exynos4_mmc_config(peripheral, flags);
|
||||
case PERIPH_ID_SDMMC1:
|
||||
case PERIPH_ID_SDMMC3:
|
||||
case PERIPH_ID_SDMMC4:
|
||||
printf("SDMMC device %d not implemented\n", peripheral);
|
||||
return -1;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
@@ -338,3 +448,31 @@ int exynos_pinmux_config(int peripheral, int flags)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
|
||||
{
|
||||
int err;
|
||||
u32 cell[3];
|
||||
|
||||
err = fdtdec_get_int_array(blob, node, "interrupts", cell,
|
||||
ARRAY_SIZE(cell));
|
||||
if (err)
|
||||
return PERIPH_ID_NONE;
|
||||
|
||||
/* check for invalid peripheral id */
|
||||
if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
|
||||
return cell[1];
|
||||
|
||||
debug(" invalid peripheral id\n");
|
||||
return PERIPH_ID_NONE;
|
||||
}
|
||||
|
||||
int pinmux_decode_periph_id(const void *blob, int node)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_pinmux_decode_periph_id(blob, node);
|
||||
else
|
||||
return PERIPH_ID_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -928,7 +928,9 @@ int do_mx5_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
printf("IPG %8d kHz\n", mxc_get_clock(MXC_IPG_CLK) / 1000);
|
||||
printf("IPG PERCLK %8d kHz\n", mxc_get_clock(MXC_IPG_PERCLK) / 1000);
|
||||
printf("DDR %8d kHz\n", mxc_get_clock(MXC_DDR_CLK) / 1000);
|
||||
|
||||
#ifdef CONFIG_MXC_SPI
|
||||
printf("CSPI %8d kHz\n", mxc_get_clock(MXC_CSPI_CLK) / 1000);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ ENTRY(lowlevel_init)
|
||||
mov r10, lr
|
||||
mov r4, #0 /* Fix R4 to 0 */
|
||||
|
||||
#if defined(CONFIG_MX51)
|
||||
#if defined(CONFIG_SYS_MAIN_PWR_ON)
|
||||
ldr r0, =GPIO1_BASE_ADDR
|
||||
ldr r1, [r0, #0x0]
|
||||
orr r1, r1, #1 << 23
|
||||
|
||||
@@ -404,7 +404,9 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
printf("\n");
|
||||
printf("IPG %8d kHz\n", mxc_get_clock(MXC_IPG_CLK) / 1000);
|
||||
printf("UART %8d kHz\n", mxc_get_clock(MXC_UART_CLK) / 1000);
|
||||
#ifdef CONFIG_MXC_SPI
|
||||
printf("CSPI %8d kHz\n", mxc_get_clock(MXC_CSPI_CLK) / 1000);
|
||||
#endif
|
||||
printf("AHB %8d kHz\n", mxc_get_clock(MXC_AHB_CLK) / 1000);
|
||||
printf("AXI %8d kHz\n", mxc_get_clock(MXC_AXI_CLK) / 1000);
|
||||
printf("DDR %8d kHz\n", mxc_get_clock(MXC_DDR_CLK) / 1000);
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.macro init_arm_errata
|
||||
/* ARM erratum ID #743622 */
|
||||
mrc p15, 0, r10, c15, c0, 1 /* read diagnostic register */
|
||||
orr r10, r10, #1 << 6 /* set bit #6 */
|
||||
/* ARM erratum ID #751472 */
|
||||
orr r10, r10, #1 << 11 /* set bit #11 */
|
||||
mcr p15, 0, r10, c15, c0, 1 /* write diagnostic register */
|
||||
.endm
|
||||
|
||||
ENTRY(lowlevel_init)
|
||||
init_arm_errata
|
||||
mov pc, lr
|
||||
ENDPROC(lowlevel_init)
|
||||
|
||||
@@ -31,17 +31,33 @@
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/imx-common/boot_mode.h>
|
||||
|
||||
struct scu_regs {
|
||||
u32 ctrl;
|
||||
u32 config;
|
||||
u32 status;
|
||||
u32 invalidate;
|
||||
u32 fpga_rev;
|
||||
};
|
||||
|
||||
u32 get_cpu_rev(void)
|
||||
{
|
||||
struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
|
||||
int reg = readl(&anatop->digprog);
|
||||
u32 reg = readl(&anatop->digprog_sololite);
|
||||
u32 type = ((reg >> 16) & 0xff);
|
||||
|
||||
/* Read mx6 variant: quad, dual or solo */
|
||||
int system_rev = (reg >> 4) & 0xFF000;
|
||||
/* Read mx6 silicon revision */
|
||||
system_rev |= (reg & 0xFF) + 0x10;
|
||||
if (type != MXC_CPU_MX6SL) {
|
||||
reg = readl(&anatop->digprog);
|
||||
type = ((reg >> 16) & 0xff);
|
||||
if (type == MXC_CPU_MX6DL) {
|
||||
struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
|
||||
u32 cfg = readl(&scu->config) & 3;
|
||||
|
||||
return system_rev;
|
||||
if (!cfg)
|
||||
type = MXC_CPU_MX6SOLO;
|
||||
}
|
||||
}
|
||||
reg &= 0xff; /* mx6 silicon revision */
|
||||
return (type << 12) | (reg + 0x10);
|
||||
}
|
||||
|
||||
void init_aips(void)
|
||||
|
||||
@@ -25,9 +25,8 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = $(obj)libomap-common.o
|
||||
|
||||
SOBJS := reset.o
|
||||
|
||||
COBJS := timer.o
|
||||
COBJS := reset.o
|
||||
COBJS += timer.o
|
||||
COBJS += utils.o
|
||||
|
||||
ifneq ($(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <asm/omap_common.h>
|
||||
#include <asm/arch/omap.h>
|
||||
#include <asm/arch/mmc_host_def.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
/*
|
||||
* This is used to verify if the configuration header
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <asm/utils.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
static int emif1_enabled = -1, emif2_enabled = -1;
|
||||
|
||||
void set_lpmode_selfrefresh(u32 base)
|
||||
{
|
||||
struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
|
||||
@@ -1109,6 +1111,7 @@ void emif_post_init_config(u32 base)
|
||||
void dmm_init(u32 base)
|
||||
{
|
||||
const struct dmm_lisa_map_regs *lisa_map_regs;
|
||||
u32 i, section, valid;
|
||||
|
||||
#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
|
||||
emif_get_dmm_regs(&lisa_map_regs);
|
||||
@@ -1216,6 +1219,29 @@ void dmm_init(u32 base)
|
||||
writel(lisa_map_regs->dmm_lisa_map_0,
|
||||
&hw_lisa_map_regs->dmm_lisa_map_0);
|
||||
}
|
||||
|
||||
/*
|
||||
* EMIF should be configured only when
|
||||
* memory is mapped on it. Using emif1_enabled
|
||||
* and emif2_enabled variables for this.
|
||||
*/
|
||||
emif1_enabled = 0;
|
||||
emif2_enabled = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
section = __raw_readl(DMM_BASE + i*4);
|
||||
valid = (section & EMIF_SDRC_MAP_MASK) >>
|
||||
(EMIF_SDRC_MAP_SHIFT);
|
||||
if (valid == 3) {
|
||||
emif1_enabled = 1;
|
||||
emif2_enabled = 1;
|
||||
break;
|
||||
} else if (valid == 1) {
|
||||
emif1_enabled = 1;
|
||||
} else if (valid == 2) {
|
||||
emif2_enabled = 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1255,15 +1281,20 @@ void sdram_init(void)
|
||||
writel(CM_DLL_CTRL_NO_OVERRIDE, &prcm->cm_dll_ctrl);
|
||||
}
|
||||
|
||||
do_sdram_init(EMIF1_BASE);
|
||||
do_sdram_init(EMIF2_BASE);
|
||||
|
||||
if (!in_sdram)
|
||||
dmm_init(DMM_BASE);
|
||||
|
||||
if (emif1_enabled)
|
||||
do_sdram_init(EMIF1_BASE);
|
||||
|
||||
if (emif2_enabled)
|
||||
do_sdram_init(EMIF2_BASE);
|
||||
|
||||
if (!(in_sdram || warm_reset())) {
|
||||
emif_post_init_config(EMIF1_BASE);
|
||||
emif_post_init_config(EMIF2_BASE);
|
||||
if (emif1_enabled)
|
||||
emif_post_init_config(EMIF1_BASE);
|
||||
if (emif2_enabled)
|
||||
emif_post_init_config(EMIF2_BASE);
|
||||
}
|
||||
|
||||
/* for the shadow registers to take effect */
|
||||
|
||||
@@ -478,7 +478,7 @@ void omap3_outer_cache_disable(void)
|
||||
*/
|
||||
omap3_update_aux_cr(0, 0x2);
|
||||
}
|
||||
#endif
|
||||
#endif /* !CONFIG_SYS_L2CACHE_OFF */
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
void enable_caches(void)
|
||||
@@ -486,4 +486,4 @@ void enable_caches(void)
|
||||
/* Enable D-cache. I-cache is already enabled in start.S */
|
||||
dcache_enable();
|
||||
}
|
||||
#endif
|
||||
#endif /* !CONFIG_SYS_DCACHE_OFF */
|
||||
|
||||
@@ -42,14 +42,7 @@ static const u32 gpmc_m_nand[GPMC_MAX_REG] = {
|
||||
M_NAND_GPMC_CONFIG5,
|
||||
M_NAND_GPMC_CONFIG6, 0
|
||||
};
|
||||
|
||||
#if defined(CONFIG_ENV_IS_IN_NAND)
|
||||
#define GPMC_CS 0
|
||||
#else
|
||||
#define GPMC_CS 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_CMD_NAND */
|
||||
|
||||
#if defined(CONFIG_CMD_ONENAND)
|
||||
static const u32 gpmc_onenand[GPMC_MAX_REG] = {
|
||||
@@ -60,14 +53,7 @@ static const u32 gpmc_onenand[GPMC_MAX_REG] = {
|
||||
ONENAND_GPMC_CONFIG5,
|
||||
ONENAND_GPMC_CONFIG6, 0
|
||||
};
|
||||
|
||||
#if defined(CONFIG_ENV_IS_IN_ONENAND)
|
||||
#define GPMC_CS 0
|
||||
#else
|
||||
#define GPMC_CS 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_CMD_ONENAND */
|
||||
|
||||
/********************************************************
|
||||
* mem_ok() - test used to see if timings are correct
|
||||
|
||||
@@ -113,18 +113,18 @@ u32 get_sdr_cs_offset(u32 cs)
|
||||
* - Test CS to make sure it's OK for use
|
||||
*/
|
||||
static void write_sdrc_timings(u32 cs, struct sdrc_actim *sdrc_actim_base,
|
||||
u32 mcfg, u32 ctrla, u32 ctrlb, u32 rfr_ctrl, u32 mr)
|
||||
struct board_sdrc_timings *timings)
|
||||
{
|
||||
/* Setup timings we got from the board. */
|
||||
writel(mcfg, &sdrc_base->cs[cs].mcfg);
|
||||
writel(ctrla, &sdrc_actim_base->ctrla);
|
||||
writel(ctrlb, &sdrc_actim_base->ctrlb);
|
||||
writel(rfr_ctrl, &sdrc_base->cs[cs].rfr_ctrl);
|
||||
writel(timings->mcfg, &sdrc_base->cs[cs].mcfg);
|
||||
writel(timings->ctrla, &sdrc_actim_base->ctrla);
|
||||
writel(timings->ctrlb, &sdrc_actim_base->ctrlb);
|
||||
writel(timings->rfr_ctrl, &sdrc_base->cs[cs].rfr_ctrl);
|
||||
writel(CMD_NOP, &sdrc_base->cs[cs].manual);
|
||||
writel(CMD_PRECHARGE, &sdrc_base->cs[cs].manual);
|
||||
writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual);
|
||||
writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual);
|
||||
writel(mr, &sdrc_base->cs[cs].mr);
|
||||
writel(timings->mr, &sdrc_base->cs[cs].mr);
|
||||
|
||||
/*
|
||||
* Test ram in this bank
|
||||
@@ -143,7 +143,7 @@ static void write_sdrc_timings(u32 cs, struct sdrc_actim *sdrc_actim_base,
|
||||
void do_sdrc_init(u32 cs, u32 early)
|
||||
{
|
||||
struct sdrc_actim *sdrc_actim_base0, *sdrc_actim_base1;
|
||||
u32 mcfg, ctrla, ctrlb, rfr_ctrl, mr;
|
||||
struct board_sdrc_timings timings;
|
||||
|
||||
sdrc_actim_base0 = (struct sdrc_actim *)SDRC_ACTIM_CTRL0_BASE;
|
||||
sdrc_actim_base1 = (struct sdrc_actim *)SDRC_ACTIM_CTRL1_BASE;
|
||||
@@ -158,7 +158,7 @@ void do_sdrc_init(u32 cs, u32 early)
|
||||
* setup CS1.
|
||||
*/
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
get_board_mem_timings(&mcfg, &ctrla, &ctrlb, &rfr_ctrl, &mr);
|
||||
get_board_mem_timings(&timings);
|
||||
#endif
|
||||
if (early) {
|
||||
/* reset sdrc controller */
|
||||
@@ -177,11 +177,9 @@ void do_sdrc_init(u32 cs, u32 early)
|
||||
writel(ENADLL | DLLPHASE_90, &sdrc_base->dlla_ctrl);
|
||||
sdelay(0x20000);
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
write_sdrc_timings(CS0, sdrc_actim_base0, mcfg, ctrla, ctrlb,
|
||||
rfr_ctrl, mr);
|
||||
write_sdrc_timings(CS0, sdrc_actim_base0, &timings);
|
||||
make_cs1_contiguous();
|
||||
write_sdrc_timings(CS1, sdrc_actim_base1, mcfg, ctrla, ctrlb,
|
||||
rfr_ctrl, mr);
|
||||
write_sdrc_timings(CS1, sdrc_actim_base1, &timings);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -193,14 +191,12 @@ void do_sdrc_init(u32 cs, u32 early)
|
||||
* so we may be asked now to setup CS1.
|
||||
*/
|
||||
if (cs == CS1) {
|
||||
mcfg = readl(&sdrc_base->cs[CS0].mcfg),
|
||||
rfr_ctrl = readl(&sdrc_base->cs[CS0].rfr_ctrl);
|
||||
ctrla = readl(&sdrc_actim_base0->ctrla),
|
||||
ctrlb = readl(&sdrc_actim_base0->ctrlb);
|
||||
mr = readl(&sdrc_base->cs[CS0].mr);
|
||||
write_sdrc_timings(cs, sdrc_actim_base1, mcfg, ctrla, ctrlb,
|
||||
rfr_ctrl, mr);
|
||||
|
||||
timings.mcfg = readl(&sdrc_base->cs[CS0].mcfg),
|
||||
timings.rfr_ctrl = readl(&sdrc_base->cs[CS0].rfr_ctrl);
|
||||
timings.ctrla = readl(&sdrc_actim_base0->ctrla);
|
||||
timings.ctrlb = readl(&sdrc_actim_base0->ctrlb);
|
||||
timings.mr = readl(&sdrc_base->cs[CS0].mr);
|
||||
write_sdrc_timings(cs, sdrc_actim_base1, &timings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
*/
|
||||
#define printf(fmt, args...)
|
||||
#define puts(s)
|
||||
#endif
|
||||
#endif /* !CONFIG_SPL_BUILD */
|
||||
|
||||
struct omap4_prcm_regs *const prcm = (struct omap4_prcm_regs *)0x4A004100;
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ void do_io_settings(void)
|
||||
if ((omap4_rev < OMAP4460_ES1_0) || !readl(&ctrl->control_efuse_2))
|
||||
writel(CONTROL_EFUSE_2_OVERRIDE, &ctrl->control_efuse_2);
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
/* dummy fuction for omap4 */
|
||||
void config_data_eye_leveling_samples(u32 emif_base)
|
||||
@@ -182,4 +182,4 @@ void v7_outer_cache_disable(void)
|
||||
{
|
||||
set_pl310_ctrl_reg(0);
|
||||
}
|
||||
#endif
|
||||
#endif /* !CONFIG_SYS_L2CACHE_OFF */
|
||||
|
||||
@@ -28,7 +28,6 @@ LIB = $(obj)libs5p-common.o
|
||||
COBJS-y += cpu_info.o
|
||||
COBJS-y += timer.o
|
||||
COBJS-y += sromc.o
|
||||
COBJS-y += wdt.o
|
||||
COBJS-$(CONFIG_PWM) += pwm.o
|
||||
|
||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||
|
||||
@@ -155,12 +155,7 @@ reset:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -177,14 +172,10 @@ ENTRY(relocate_code)
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _image_copy_end_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -233,34 +224,22 @@ fixnext:
|
||||
add r2, r2, #8 /* each rel.dyn entry is 8 bytes */
|
||||
cmp r2, r3
|
||||
blo fixloop
|
||||
b clear_bss
|
||||
|
||||
relocate_done:
|
||||
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
_rel_dyn_end_ofs:
|
||||
.word __rel_dyn_end - _start
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
ENDPROC(relocate_code)
|
||||
|
||||
clear_bss:
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
#endif
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
jump_2_ram:
|
||||
ENTRY(c_runtime_cpu_setup)
|
||||
/*
|
||||
* If I-cache is enabled invalidate it
|
||||
*/
|
||||
@@ -279,20 +258,9 @@ jump_2_ram:
|
||||
mcr p15, 0, r0, c12, c0, 0 @Set VBAR
|
||||
#endif /* !Tegra20 */
|
||||
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
bx lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
ENDPROC(relocate_code)
|
||||
#endif
|
||||
ENDPROC(c_runtime_cpu_setup)
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
|
||||
@@ -28,6 +28,8 @@ include $(TOPDIR)/config.mk
|
||||
LIB = $(obj)lib$(SOC).o
|
||||
|
||||
COBJS-$(CONFIG_USB_EHCI_TEGRA) += usb.o
|
||||
COBJS-$(CONFIG_PWM_TEGRA) += pwm.o
|
||||
COBJS-$(CONFIG_VIDEO_TEGRA) += display.o
|
||||
|
||||
COBJS := $(COBJS-y)
|
||||
SRCS := $(COBJS:.o=.c)
|
||||
|
||||
409
arch/arm/cpu/armv7/tegra20/display.c
Normal file
409
arch/arm/cpu/armv7/tegra20/display.c
Normal file
@@ -0,0 +1,409 @@
|
||||
/*
|
||||
* (C) Copyright 2010
|
||||
* NVIDIA Corporation <www.nvidia.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/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
#include <asm/arch/display.h>
|
||||
#include <asm/arch/dc.h>
|
||||
#include <asm/arch-tegra/clk_rst.h>
|
||||
#include <asm/arch-tegra/timer.h>
|
||||
|
||||
static struct fdt_disp_config config;
|
||||
|
||||
static void update_window(struct dc_ctlr *dc, struct disp_ctl_win *win)
|
||||
{
|
||||
unsigned h_dda, v_dda;
|
||||
unsigned long val;
|
||||
|
||||
val = readl(&dc->cmd.disp_win_header);
|
||||
val |= WINDOW_A_SELECT;
|
||||
writel(val, &dc->cmd.disp_win_header);
|
||||
|
||||
writel(win->fmt, &dc->win.color_depth);
|
||||
|
||||
clrsetbits_le32(&dc->win.byte_swap, BYTE_SWAP_MASK,
|
||||
BYTE_SWAP_NOSWAP << BYTE_SWAP_SHIFT);
|
||||
|
||||
val = win->out_x << H_POSITION_SHIFT;
|
||||
val |= win->out_y << V_POSITION_SHIFT;
|
||||
writel(val, &dc->win.pos);
|
||||
|
||||
val = win->out_w << H_SIZE_SHIFT;
|
||||
val |= win->out_h << V_SIZE_SHIFT;
|
||||
writel(val, &dc->win.size);
|
||||
|
||||
val = (win->w * win->bpp / 8) << H_PRESCALED_SIZE_SHIFT;
|
||||
val |= win->h << V_PRESCALED_SIZE_SHIFT;
|
||||
writel(val, &dc->win.prescaled_size);
|
||||
|
||||
writel(0, &dc->win.h_initial_dda);
|
||||
writel(0, &dc->win.v_initial_dda);
|
||||
|
||||
h_dda = (win->w * 0x1000) / max(win->out_w - 1, 1);
|
||||
v_dda = (win->h * 0x1000) / max(win->out_h - 1, 1);
|
||||
|
||||
val = h_dda << H_DDA_INC_SHIFT;
|
||||
val |= v_dda << V_DDA_INC_SHIFT;
|
||||
writel(val, &dc->win.dda_increment);
|
||||
|
||||
writel(win->stride, &dc->win.line_stride);
|
||||
writel(0, &dc->win.buf_stride);
|
||||
|
||||
val = WIN_ENABLE;
|
||||
if (win->bpp < 24)
|
||||
val |= COLOR_EXPAND;
|
||||
writel(val, &dc->win.win_opt);
|
||||
|
||||
writel((unsigned long)win->phys_addr, &dc->winbuf.start_addr);
|
||||
writel(win->x, &dc->winbuf.addr_h_offset);
|
||||
writel(win->y, &dc->winbuf.addr_v_offset);
|
||||
|
||||
writel(0xff00, &dc->win.blend_nokey);
|
||||
writel(0xff00, &dc->win.blend_1win);
|
||||
|
||||
val = GENERAL_ACT_REQ | WIN_A_ACT_REQ;
|
||||
val |= GENERAL_UPDATE | WIN_A_UPDATE;
|
||||
writel(val, &dc->cmd.state_ctrl);
|
||||
}
|
||||
|
||||
static void write_pair(struct fdt_disp_config *config, int item, u32 *reg)
|
||||
{
|
||||
writel(config->horiz_timing[item] |
|
||||
(config->vert_timing[item] << 16), reg);
|
||||
}
|
||||
|
||||
static int update_display_mode(struct dc_disp_reg *disp,
|
||||
struct fdt_disp_config *config)
|
||||
{
|
||||
unsigned long val;
|
||||
unsigned long rate;
|
||||
unsigned long div;
|
||||
|
||||
writel(0x0, &disp->disp_timing_opt);
|
||||
write_pair(config, FDT_LCD_TIMING_REF_TO_SYNC, &disp->ref_to_sync);
|
||||
write_pair(config, FDT_LCD_TIMING_SYNC_WIDTH, &disp->sync_width);
|
||||
write_pair(config, FDT_LCD_TIMING_BACK_PORCH, &disp->back_porch);
|
||||
write_pair(config, FDT_LCD_TIMING_FRONT_PORCH, &disp->front_porch);
|
||||
|
||||
writel(config->width | (config->height << 16), &disp->disp_active);
|
||||
|
||||
val = DE_SELECT_ACTIVE << DE_SELECT_SHIFT;
|
||||
val |= DE_CONTROL_NORMAL << DE_CONTROL_SHIFT;
|
||||
writel(val, &disp->data_enable_opt);
|
||||
|
||||
val = DATA_FORMAT_DF1P1C << DATA_FORMAT_SHIFT;
|
||||
val |= DATA_ALIGNMENT_MSB << DATA_ALIGNMENT_SHIFT;
|
||||
val |= DATA_ORDER_RED_BLUE << DATA_ORDER_SHIFT;
|
||||
writel(val, &disp->disp_interface_ctrl);
|
||||
|
||||
/*
|
||||
* The pixel clock divider is in 7.1 format (where the bottom bit
|
||||
* represents 0.5). Here we calculate the divider needed to get from
|
||||
* the display clock (typically 600MHz) to the pixel clock. We round
|
||||
* up or down as requried.
|
||||
*/
|
||||
rate = clock_get_periph_rate(PERIPH_ID_DISP1, CLOCK_ID_CGENERAL);
|
||||
div = ((rate * 2 + config->pixel_clock / 2) / config->pixel_clock) - 2;
|
||||
debug("Display clock %lu, divider %lu\n", rate, div);
|
||||
|
||||
writel(0x00010001, &disp->shift_clk_opt);
|
||||
|
||||
val = PIXEL_CLK_DIVIDER_PCD1 << PIXEL_CLK_DIVIDER_SHIFT;
|
||||
val |= div << SHIFT_CLK_DIVIDER_SHIFT;
|
||||
writel(val, &disp->disp_clk_ctrl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Start up the display and turn on power to PWMs */
|
||||
static void basic_init(struct dc_cmd_reg *cmd)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
writel(0x00000100, &cmd->gen_incr_syncpt_ctrl);
|
||||
writel(0x0000011a, &cmd->cont_syncpt_vsync);
|
||||
writel(0x00000000, &cmd->int_type);
|
||||
writel(0x00000000, &cmd->int_polarity);
|
||||
writel(0x00000000, &cmd->int_mask);
|
||||
writel(0x00000000, &cmd->int_enb);
|
||||
|
||||
val = PW0_ENABLE | PW1_ENABLE | PW2_ENABLE;
|
||||
val |= PW3_ENABLE | PW4_ENABLE | PM0_ENABLE;
|
||||
val |= PM1_ENABLE;
|
||||
writel(val, &cmd->disp_pow_ctrl);
|
||||
|
||||
val = readl(&cmd->disp_cmd);
|
||||
val |= CTRL_MODE_C_DISPLAY << CTRL_MODE_SHIFT;
|
||||
writel(val, &cmd->disp_cmd);
|
||||
}
|
||||
|
||||
static void basic_init_timer(struct dc_disp_reg *disp)
|
||||
{
|
||||
writel(0x00000020, &disp->mem_high_pri);
|
||||
writel(0x00000001, &disp->mem_high_pri_timer);
|
||||
}
|
||||
|
||||
static const u32 rgb_enb_tab[PIN_REG_COUNT] = {
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
static const u32 rgb_polarity_tab[PIN_REG_COUNT] = {
|
||||
0x00000000,
|
||||
0x01000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
static const u32 rgb_data_tab[PIN_REG_COUNT] = {
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
static const u32 rgb_sel_tab[PIN_OUTPUT_SEL_COUNT] = {
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00210222,
|
||||
0x00002200,
|
||||
0x00020000,
|
||||
};
|
||||
|
||||
static void rgb_enable(struct dc_com_reg *com)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < PIN_REG_COUNT; i++) {
|
||||
writel(rgb_enb_tab[i], &com->pin_output_enb[i]);
|
||||
writel(rgb_polarity_tab[i], &com->pin_output_polarity[i]);
|
||||
writel(rgb_data_tab[i], &com->pin_output_data[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < PIN_OUTPUT_SEL_COUNT; i++)
|
||||
writel(rgb_sel_tab[i], &com->pin_output_sel[i]);
|
||||
}
|
||||
|
||||
int setup_window(struct disp_ctl_win *win, struct fdt_disp_config *config)
|
||||
{
|
||||
win->x = 0;
|
||||
win->y = 0;
|
||||
win->w = config->width;
|
||||
win->h = config->height;
|
||||
win->out_x = 0;
|
||||
win->out_y = 0;
|
||||
win->out_w = config->width;
|
||||
win->out_h = config->height;
|
||||
win->phys_addr = config->frame_buffer;
|
||||
win->stride = config->width * (1 << config->log2_bpp) / 8;
|
||||
debug("%s: depth = %d\n", __func__, config->log2_bpp);
|
||||
switch (config->log2_bpp) {
|
||||
case 5:
|
||||
case 24:
|
||||
win->fmt = COLOR_DEPTH_R8G8B8A8;
|
||||
win->bpp = 32;
|
||||
break;
|
||||
case 4:
|
||||
win->fmt = COLOR_DEPTH_B5G6R5;
|
||||
win->bpp = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
debug("Unsupported LCD bit depth");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct fdt_disp_config *tegra_display_get_config(void)
|
||||
{
|
||||
return config.valid ? &config : NULL;
|
||||
}
|
||||
|
||||
static void debug_timing(const char *name, unsigned int timing[])
|
||||
{
|
||||
#ifdef DEBUG
|
||||
int i;
|
||||
|
||||
debug("%s timing: ", name);
|
||||
for (i = 0; i < FDT_LCD_TIMING_COUNT; i++)
|
||||
debug("%d ", timing[i]);
|
||||
debug("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode panel information from the fdt, according to a standard binding
|
||||
*
|
||||
* @param blob fdt blob
|
||||
* @param node offset of fdt node to read from
|
||||
* @param config structure to store fdt config into
|
||||
* @return 0 if ok, -ve on error
|
||||
*/
|
||||
static int tegra_decode_panel(const void *blob, int node,
|
||||
struct fdt_disp_config *config)
|
||||
{
|
||||
int front, back, ref;
|
||||
|
||||
config->width = fdtdec_get_int(blob, node, "xres", -1);
|
||||
config->height = fdtdec_get_int(blob, node, "yres", -1);
|
||||
config->pixel_clock = fdtdec_get_int(blob, node, "clock", 0);
|
||||
if (!config->pixel_clock || config->width == -1 ||
|
||||
config->height == -1) {
|
||||
debug("%s: Pixel parameters missing\n", __func__);
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
|
||||
back = fdtdec_get_int(blob, node, "left-margin", -1);
|
||||
front = fdtdec_get_int(blob, node, "right-margin", -1);
|
||||
ref = fdtdec_get_int(blob, node, "hsync-len", -1);
|
||||
if ((back | front | ref) == -1) {
|
||||
debug("%s: Horizontal parameters missing\n", __func__);
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
|
||||
/* Use a ref-to-sync of 1 always, and take this from the front porch */
|
||||
config->horiz_timing[FDT_LCD_TIMING_REF_TO_SYNC] = 1;
|
||||
config->horiz_timing[FDT_LCD_TIMING_SYNC_WIDTH] = ref;
|
||||
config->horiz_timing[FDT_LCD_TIMING_BACK_PORCH] = back;
|
||||
config->horiz_timing[FDT_LCD_TIMING_FRONT_PORCH] = front -
|
||||
config->horiz_timing[FDT_LCD_TIMING_REF_TO_SYNC];
|
||||
debug_timing("horiz", config->horiz_timing);
|
||||
|
||||
back = fdtdec_get_int(blob, node, "upper-margin", -1);
|
||||
front = fdtdec_get_int(blob, node, "lower-margin", -1);
|
||||
ref = fdtdec_get_int(blob, node, "vsync-len", -1);
|
||||
if ((back | front | ref) == -1) {
|
||||
debug("%s: Vertical parameters missing\n", __func__);
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
|
||||
config->vert_timing[FDT_LCD_TIMING_REF_TO_SYNC] = 1;
|
||||
config->vert_timing[FDT_LCD_TIMING_SYNC_WIDTH] = ref;
|
||||
config->vert_timing[FDT_LCD_TIMING_BACK_PORCH] = back;
|
||||
config->vert_timing[FDT_LCD_TIMING_FRONT_PORCH] = front -
|
||||
config->vert_timing[FDT_LCD_TIMING_REF_TO_SYNC];
|
||||
debug_timing("vert", config->vert_timing);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode the display controller information from the fdt.
|
||||
*
|
||||
* @param blob fdt blob
|
||||
* @param config structure to store fdt config into
|
||||
* @return 0 if ok, -ve on error
|
||||
*/
|
||||
static int tegra_display_decode_config(const void *blob,
|
||||
struct fdt_disp_config *config)
|
||||
{
|
||||
int node, rgb;
|
||||
int bpp, bit;
|
||||
|
||||
/* TODO: Support multiple controllers */
|
||||
node = fdtdec_next_compatible(blob, 0, COMPAT_NVIDIA_TEGRA20_DC);
|
||||
if (node < 0) {
|
||||
debug("%s: Cannot find display controller node in fdt\n",
|
||||
__func__);
|
||||
return node;
|
||||
}
|
||||
config->disp = (struct disp_ctlr *)fdtdec_get_addr(blob, node, "reg");
|
||||
if (!config->disp) {
|
||||
debug("%s: No display controller address\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rgb = fdt_subnode_offset(blob, node, "rgb");
|
||||
|
||||
config->panel_node = fdtdec_lookup_phandle(blob, rgb, "nvidia,panel");
|
||||
if (!config->panel_node < 0) {
|
||||
debug("%s: Cannot find panel information\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tegra_decode_panel(blob, config->panel_node, config)) {
|
||||
debug("%s: Failed to decode panel information\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
bpp = fdtdec_get_int(blob, config->panel_node, "nvidia,bits-per-pixel",
|
||||
-1);
|
||||
bit = ffs(bpp) - 1;
|
||||
if (bpp == (1 << bit))
|
||||
config->log2_bpp = bit;
|
||||
else
|
||||
config->log2_bpp = bpp;
|
||||
if (bpp == -1) {
|
||||
debug("%s: Pixel bpp parameters missing\n", __func__);
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
config->bpp = bpp;
|
||||
|
||||
config->valid = 1; /* we have a valid configuration */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tegra_display_probe(const void *blob, void *default_lcd_base)
|
||||
{
|
||||
struct disp_ctl_win window;
|
||||
struct dc_ctlr *dc;
|
||||
|
||||
if (tegra_display_decode_config(blob, &config))
|
||||
return -1;
|
||||
|
||||
config.frame_buffer = (u32)default_lcd_base;
|
||||
|
||||
dc = (struct dc_ctlr *)config.disp;
|
||||
|
||||
/*
|
||||
* A header file for clock constants was NAKed upstream.
|
||||
* TODO: Put this into the FDT and fdt_lcd struct when we have clock
|
||||
* support there
|
||||
*/
|
||||
clock_start_periph_pll(PERIPH_ID_HOST1X, CLOCK_ID_PERIPH,
|
||||
144 * 1000000);
|
||||
clock_start_periph_pll(PERIPH_ID_DISP1, CLOCK_ID_CGENERAL,
|
||||
600 * 1000000);
|
||||
basic_init(&dc->cmd);
|
||||
basic_init_timer(&dc->disp);
|
||||
rgb_enable(&dc->com);
|
||||
|
||||
if (config.pixel_clock)
|
||||
update_display_mode(&dc->disp, &config);
|
||||
|
||||
if (setup_window(&window, &config))
|
||||
return -1;
|
||||
|
||||
update_window(dc, &window);
|
||||
|
||||
return 0;
|
||||
}
|
||||
101
arch/arm/cpu/armv7/tegra20/pwm.c
Normal file
101
arch/arm/cpu/armv7/tegra20/pwm.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Tegra2 pulse width frequency modulator definitions
|
||||
*
|
||||
* Copyright (c) 2011 The Chromium OS Authors.
|
||||
* 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 <fdtdec.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/pwm.h>
|
||||
|
||||
struct pwm_info {
|
||||
struct pwm_ctlr *pwm; /* Registers for our pwm controller */
|
||||
int pwm_node; /* PWM device tree node */
|
||||
} local;
|
||||
|
||||
void pwm_enable(unsigned channel, int rate, int pulse_width, int freq_divider)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
assert(channel < PWM_NUM_CHANNELS);
|
||||
|
||||
/* TODO: Can we use clock_adjust_periph_pll_div() here? */
|
||||
clock_start_periph_pll(PERIPH_ID_PWM, CLOCK_ID_SFROM32KHZ, rate);
|
||||
|
||||
reg = PWM_ENABLE_MASK;
|
||||
reg |= pulse_width << PWM_WIDTH_SHIFT;
|
||||
reg |= freq_divider << PWM_DIVIDER_SHIFT;
|
||||
writel(reg, &local.pwm[channel].control);
|
||||
debug("%s: channel=%d, rate=%d\n", __func__, channel, rate);
|
||||
}
|
||||
|
||||
int pwm_request(const void *blob, int node, const char *prop_name)
|
||||
{
|
||||
int pwm_node;
|
||||
u32 data[3];
|
||||
|
||||
if (fdtdec_get_int_array(blob, node, prop_name, data,
|
||||
ARRAY_SIZE(data))) {
|
||||
debug("%s: Cannot decode PWM property '%s'\n", __func__,
|
||||
prop_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pwm_node = fdt_node_offset_by_phandle(blob, data[0]);
|
||||
if (pwm_node != local.pwm_node) {
|
||||
debug("%s: PWM property '%s' phandle %d not recognised"
|
||||
"- expecting %d\n", __func__, prop_name, data[0],
|
||||
local.pwm_node);
|
||||
return -1;
|
||||
}
|
||||
if (data[1] >= PWM_NUM_CHANNELS) {
|
||||
debug("%s: PWM property '%s': invalid channel %u\n", __func__,
|
||||
prop_name, data[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: We could maintain a list of requests, but it might not be
|
||||
* worth it for U-Boot.
|
||||
*/
|
||||
return data[1];
|
||||
}
|
||||
|
||||
int pwm_init(const void *blob)
|
||||
{
|
||||
local.pwm_node = fdtdec_next_compatible(blob, 0,
|
||||
COMPAT_NVIDIA_TEGRA20_PWM);
|
||||
if (local.pwm_node < 0) {
|
||||
debug("%s: Cannot find device tree node\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
local.pwm = (struct pwm_ctlr *)fdtdec_get_addr(blob, local.pwm_node,
|
||||
"reg");
|
||||
if (local.pwm == (struct pwm_ctlr *)FDT_ADDR_T_NONE) {
|
||||
debug("%s: Cannot find pwm reg address\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
debug("Tegra PWM at %p, node %d\n", local.pwm, local.pwm_node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -245,12 +245,7 @@ reset:
|
||||
orr r0,r0,#0x13
|
||||
msr cpsr,r0
|
||||
|
||||
/* Set initial stackpointer in SDRAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -267,14 +262,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -326,42 +317,9 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -370,6 +328,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
/****************************************************************************/
|
||||
/* */
|
||||
/* Interrupt handling */
|
||||
|
||||
@@ -164,12 +164,7 @@ reset:
|
||||
bl lock_cache_for_stack
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0, =0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
@@ -186,19 +181,17 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
/* Disable the Dcache RAM lock for stack now */
|
||||
#ifdef CONFIG_CPU_PXA25X
|
||||
mov r12, lr
|
||||
bl cpu_init_crit
|
||||
mov lr, r12
|
||||
#endif
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -250,48 +243,9 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
#endif /* #ifndef CONFIG_SPL_BUILD */
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
#ifdef CONFIG_ONENAND_SPL
|
||||
ldr r0, _onenand_boot_ofs
|
||||
mov pc, r0
|
||||
|
||||
_onenand_boot_ofs:
|
||||
.word onenand_boot
|
||||
#else
|
||||
jump_2_ram:
|
||||
ldr r0, _board_init_r_ofs
|
||||
ldr r1, _TEXT_BASE
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
#endif
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -299,7 +253,14 @@ _rel_dyn_end_ofs:
|
||||
.word __rel_dyn_end - _start
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
#endif
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -128,12 +128,7 @@ reset:
|
||||
bl lowlevel_init
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -150,14 +145,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -209,42 +200,9 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
|
||||
bl coloured_LED_init
|
||||
bl red_led_on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
bx lr
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
@@ -253,6 +211,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -132,12 +132,7 @@ reset:
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
/* Set stackpointer in internal RAM to call board_init_f */
|
||||
call_board_init_f:
|
||||
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
||||
ldr r0,=0x00000000
|
||||
bl board_init_f
|
||||
bl _main
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -154,14 +149,10 @@ relocate_code:
|
||||
mov r5, r1 /* save addr of gd */
|
||||
mov r6, r2 /* save addr of destination */
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov sp, r4
|
||||
|
||||
adr r0, _start
|
||||
cmp r0, r6
|
||||
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
|
||||
beq clear_bss /* skip relocation */
|
||||
beq relocate_done /* skip relocation */
|
||||
mov r1, r6 /* r1 <- scratch for copy_loop */
|
||||
ldr r3, _bss_start_ofs
|
||||
add r2, r0, r3 /* r2 <- source end address */
|
||||
@@ -213,40 +204,10 @@ fixnext:
|
||||
blo fixloop
|
||||
#endif
|
||||
|
||||
clear_bss:
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr r0, _bss_start_ofs
|
||||
ldr r1, _bss_end_ofs
|
||||
mov r4, r6 /* reloc addr */
|
||||
add r0, r0, r4
|
||||
add r1, r1, r4
|
||||
mov r2, #0x00000000 /* clear */
|
||||
relocate_done:
|
||||
|
||||
clbss_l:cmp r0, r1 /* clear loop... */
|
||||
bhs clbss_e /* if reached end of bss, exit */
|
||||
str r2, [r0]
|
||||
add r0, r0, #4
|
||||
b clbss_l
|
||||
clbss_e:
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are done. Do not return, instead branch to second part of board
|
||||
* initialization, now running from RAM.
|
||||
*/
|
||||
ldr r0, _board_init_r_ofs
|
||||
adr r1, _start
|
||||
add lr, r0, r1
|
||||
add lr, lr, r9
|
||||
/* setup parameters for board_init_r */
|
||||
mov r0, r5 /* gd_t */
|
||||
mov r1, r6 /* dest_addr */
|
||||
/* jump to it ... */
|
||||
mov pc, lr
|
||||
|
||||
_board_init_r_ofs:
|
||||
.word board_init_r - _start
|
||||
|
||||
_rel_dyn_start_ofs:
|
||||
.word __rel_dyn_start - _start
|
||||
_rel_dyn_end_ofs:
|
||||
@@ -254,6 +215,11 @@ _rel_dyn_end_ofs:
|
||||
_dynsym_start_ofs:
|
||||
.word __dynsym_start - _start
|
||||
|
||||
.globl c_runtime_cpu_setup
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
|
||||
@@ -25,6 +25,30 @@
|
||||
#include <asm/arch/funcmux.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
|
||||
/*
|
||||
* The PINMUX macro is used to set up pinmux tables.
|
||||
*/
|
||||
#define PINMUX(grp, mux, pupd, tri) \
|
||||
{PINGRP_##grp, PMUX_FUNC_##mux, PMUX_PULL_##pupd, PMUX_TRI_##tri}
|
||||
|
||||
static const struct pingroup_config disp1_default[] = {
|
||||
PINMUX(LDI, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LHP0, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LHP1, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LHP2, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LHS, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LM0, RSVD4, NORMAL, NORMAL),
|
||||
PINMUX(LPP, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LPW0, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LPW2, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LSC0, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LSPI, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LVP1, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LVS, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(SLXD, SPDIF, NORMAL, NORMAL),
|
||||
};
|
||||
|
||||
|
||||
int funcmux_select(enum periph_id id, int config)
|
||||
{
|
||||
int bad_config = config != FUNCMUX_DEFAULT;
|
||||
@@ -257,6 +281,19 @@ int funcmux_select(enum periph_id id, int config)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PERIPH_ID_DISP1:
|
||||
if (config == FUNCMUX_DEFAULT) {
|
||||
int i;
|
||||
|
||||
for (i = PINGRP_LD0; i <= PINGRP_LD17; i++) {
|
||||
pinmux_set_func(i, PMUX_FUNC_DISPA);
|
||||
pinmux_tristate_disable(i);
|
||||
pinmux_set_pullupdown(i, PMUX_PULL_NORMAL);
|
||||
}
|
||||
pinmux_config_table(disp1_default,
|
||||
ARRAY_SIZE(disp1_default));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
debug("%s: invalid periph_id %d", __func__, id);
|
||||
|
||||
@@ -554,7 +554,7 @@ void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
|
||||
writel(reg, muxctl);
|
||||
}
|
||||
|
||||
void pinmux_config_pingroup(struct pingroup_config *config)
|
||||
void pinmux_config_pingroup(const struct pingroup_config *config)
|
||||
{
|
||||
enum pmux_pingrp pin = config->pingroup;
|
||||
|
||||
@@ -563,7 +563,7 @@ void pinmux_config_pingroup(struct pingroup_config *config)
|
||||
pinmux_set_tristate(pin, config->tristate);
|
||||
}
|
||||
|
||||
void pinmux_config_table(struct pingroup_config *config, int len)
|
||||
void pinmux_config_table(const struct pingroup_config *config, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
154
arch/arm/dts/exynos5250.dtsi
Normal file
154
arch/arm/dts/exynos5250.dtsi
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* SAMSUNG EXYNOS5250 SoC device tree source
|
||||
*
|
||||
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* SAMSUNG EXYNOS5250 SoC device nodes are listed in this file.
|
||||
* EXYNOS5250 based board files can include this file and provide
|
||||
* values for board specfic bindings.
|
||||
*
|
||||
* Note: This file does not include device nodes for all the controllers in
|
||||
* EXYNOS5250 SoC. As device tree coverage for EXYNOS5250 increases,
|
||||
* additional nodes can be added to this file.
|
||||
*
|
||||
* 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/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "samsung,exynos5250";
|
||||
|
||||
sromc@12250000 {
|
||||
compatible = "samsung,exynos-sromc";
|
||||
reg = <0x12250000 0x20>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
i2c@12c60000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12C60000 0x100>;
|
||||
interrupts = <0 56 0>;
|
||||
};
|
||||
|
||||
i2c@12c70000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12C70000 0x100>;
|
||||
interrupts = <0 57 0>;
|
||||
};
|
||||
|
||||
i2c@12c80000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12C80000 0x100>;
|
||||
interrupts = <0 58 0>;
|
||||
};
|
||||
|
||||
i2c@12c90000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12C90000 0x100>;
|
||||
interrupts = <0 59 0>;
|
||||
};
|
||||
|
||||
i2c@12ca0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12CA0000 0x100>;
|
||||
interrupts = <0 60 0>;
|
||||
};
|
||||
|
||||
i2c@12cb0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12CB0000 0x100>;
|
||||
interrupts = <0 61 0>;
|
||||
};
|
||||
|
||||
i2c@12cc0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12CC0000 0x100>;
|
||||
interrupts = <0 62 0>;
|
||||
};
|
||||
|
||||
i2c@12cd0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
reg = <0x12CD0000 0x100>;
|
||||
interrupts = <0 63 0>;
|
||||
};
|
||||
|
||||
sound@12d60000 {
|
||||
compatible = "samsung,exynos-sound";
|
||||
reg = <0x12d60000 0x20>;
|
||||
};
|
||||
|
||||
spi@12d20000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-spi";
|
||||
reg = <0x12d20000 0x30>;
|
||||
interrupts = <0 68 0>;
|
||||
};
|
||||
|
||||
spi@12d30000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-spi";
|
||||
reg = <0x12d30000 0x30>;
|
||||
interrupts = <0 69 0>;
|
||||
};
|
||||
|
||||
spi@12d40000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-spi";
|
||||
reg = <0x12d40000 0x30>;
|
||||
clock-frequency = <50000000>;
|
||||
interrupts = <0 70 0>;
|
||||
};
|
||||
|
||||
spi@131a0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-spi";
|
||||
reg = <0x131a0000 0x30>;
|
||||
interrupts = <0 129 0>;
|
||||
};
|
||||
|
||||
spi@131b0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-spi";
|
||||
reg = <0x131b0000 0x30>;
|
||||
interrupts = <0 130 0>;
|
||||
};
|
||||
|
||||
ehci@12110000 {
|
||||
compatible = "samsung,exynos-ehci";
|
||||
reg = <0x12110000 0x100>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
phy {
|
||||
compatible = "samsung,exynos-usb-phy";
|
||||
reg = <0x12130000 0x100>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
@@ -211,4 +211,109 @@
|
||||
compatible = "nvidia,tegra20-nand";
|
||||
reg = <0x70008000 0x100>;
|
||||
};
|
||||
|
||||
pwm: pwm@7000a000 {
|
||||
compatible = "nvidia,tegra20-pwm";
|
||||
reg = <0x7000a000 0x100>;
|
||||
#pwm-cells = <2>;
|
||||
};
|
||||
|
||||
host1x {
|
||||
compatible = "nvidia,tegra20-host1x", "simple-bus";
|
||||
reg = <0x50000000 0x00024000>;
|
||||
interrupts = <0 65 0x04 /* mpcore syncpt */
|
||||
0 67 0x04>; /* mpcore general */
|
||||
status = "disabled";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
ranges = <0x54000000 0x54000000 0x04000000>;
|
||||
|
||||
/* video-encoding/decoding */
|
||||
mpe {
|
||||
reg = <0x54040000 0x00040000>;
|
||||
interrupts = <0 68 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* video input */
|
||||
vi {
|
||||
reg = <0x54080000 0x00040000>;
|
||||
interrupts = <0 69 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* EPP */
|
||||
epp {
|
||||
reg = <0x540c0000 0x00040000>;
|
||||
interrupts = <0 70 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* ISP */
|
||||
isp {
|
||||
reg = <0x54100000 0x00040000>;
|
||||
interrupts = <0 71 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* 2D engine */
|
||||
gr2d {
|
||||
reg = <0x54140000 0x00040000>;
|
||||
interrupts = <0 72 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* 3D engine */
|
||||
gr3d {
|
||||
reg = <0x54180000 0x00040000>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* display controllers */
|
||||
dc@54200000 {
|
||||
compatible = "nvidia,tegra20-dc";
|
||||
reg = <0x54200000 0x00040000>;
|
||||
interrupts = <0 73 0x04>;
|
||||
status = "disabled";
|
||||
|
||||
rgb {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
dc@54240000 {
|
||||
compatible = "nvidia,tegra20-dc";
|
||||
reg = <0x54240000 0x00040000>;
|
||||
interrupts = <0 74 0x04>;
|
||||
status = "disabled";
|
||||
|
||||
rgb {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
/* outputs */
|
||||
hdmi {
|
||||
compatible = "nvidia,tegra20-hdmi";
|
||||
reg = <0x54280000 0x00040000>;
|
||||
interrupts = <0 75 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
tvo {
|
||||
compatible = "nvidia,tegra20-tvo";
|
||||
reg = <0x542c0000 0x00040000>;
|
||||
interrupts = <0 76 0x04>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dsi {
|
||||
compatible = "nvidia,tegra20-dsi";
|
||||
reg = <0x54300000 0x00040000>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -65,20 +65,72 @@ char *get_reset_cause(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_MX53) || defined(CONFIG_MX6)
|
||||
#if defined(CONFIG_MX53)
|
||||
#define MEMCTL_BASE ESDCTL_BASE_ADDR;
|
||||
#else
|
||||
#define MEMCTL_BASE MMDC_P0_BASE_ADDR;
|
||||
#endif
|
||||
static const unsigned char col_lookup[] = {9, 10, 11, 8, 12, 9, 9, 9};
|
||||
static const unsigned char bank_lookup[] = {3, 2};
|
||||
|
||||
struct esd_mmdc_regs {
|
||||
uint32_t ctl;
|
||||
uint32_t pdc;
|
||||
uint32_t otc;
|
||||
uint32_t cfg0;
|
||||
uint32_t cfg1;
|
||||
uint32_t cfg2;
|
||||
uint32_t misc;
|
||||
uint32_t scr;
|
||||
uint32_t ref;
|
||||
uint32_t rsvd1;
|
||||
uint32_t rsvd2;
|
||||
uint32_t rwd;
|
||||
uint32_t or;
|
||||
uint32_t mrr;
|
||||
uint32_t cfg3lp;
|
||||
uint32_t mr4;
|
||||
};
|
||||
|
||||
#define ESD_MMDC_CTL_GET_ROW(mdctl) ((ctl >> 24) & 7)
|
||||
#define ESD_MMDC_CTL_GET_COLUMN(mdctl) ((ctl >> 20) & 7)
|
||||
#define ESD_MMDC_CTL_GET_WIDTH(mdctl) ((ctl >> 16) & 3)
|
||||
#define ESD_MMDC_CTL_GET_CS1(mdctl) ((ctl >> 30) & 1)
|
||||
#define ESD_MMDC_MISC_GET_BANK(mdmisc) ((misc >> 5) & 1)
|
||||
|
||||
unsigned imx_ddr_size(void)
|
||||
{
|
||||
struct esd_mmdc_regs *mem = (struct esd_mmdc_regs *)MEMCTL_BASE;
|
||||
unsigned ctl = readl(&mem->ctl);
|
||||
unsigned misc = readl(&mem->misc);
|
||||
int bits = 11 + 0 + 0 + 1; /* row + col + bank + width */
|
||||
|
||||
bits += ESD_MMDC_CTL_GET_ROW(ctl);
|
||||
bits += col_lookup[ESD_MMDC_CTL_GET_COLUMN(ctl)];
|
||||
bits += bank_lookup[ESD_MMDC_MISC_GET_BANK(misc)];
|
||||
bits += ESD_MMDC_CTL_GET_WIDTH(ctl);
|
||||
bits += ESD_MMDC_CTL_GET_CS1(ctl);
|
||||
return 1 << bits;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
|
||||
static const char *get_imx_type(u32 imxtype)
|
||||
const char *get_imx_type(u32 imxtype)
|
||||
{
|
||||
switch (imxtype) {
|
||||
case 0x63:
|
||||
case MXC_CPU_MX6Q:
|
||||
return "6Q"; /* Quad-core version of the mx6 */
|
||||
case 0x61:
|
||||
return "6DS"; /* Dual/Solo version of the mx6 */
|
||||
case 0x60:
|
||||
case MXC_CPU_MX6DL:
|
||||
return "6DL"; /* Dual Lite version of the mx6 */
|
||||
case MXC_CPU_MX6SOLO:
|
||||
return "6SOLO"; /* Solo version of the mx6 */
|
||||
case MXC_CPU_MX6SL:
|
||||
return "6SL"; /* Solo-Lite version of the mx6 */
|
||||
case 0x51:
|
||||
case MXC_CPU_MX51:
|
||||
return "51";
|
||||
case 0x53:
|
||||
case MXC_CPU_MX53:
|
||||
return "53";
|
||||
default:
|
||||
return "??";
|
||||
@@ -123,11 +175,6 @@ int cpu_mmc_init(bd_t *bis)
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
{
|
||||
__raw_writew(4, WDOG1_BASE_ADDR);
|
||||
}
|
||||
|
||||
u32 get_ahb_clk(void)
|
||||
{
|
||||
struct mxc_ccm_reg *imx_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
|
||||
|
||||
@@ -60,6 +60,59 @@
|
||||
|
||||
#ifndef __KERNEL_STRICT_NAMES
|
||||
#ifndef __ASSEMBLY__
|
||||
struct gpmc_cs {
|
||||
u32 config1; /* 0x00 */
|
||||
u32 config2; /* 0x04 */
|
||||
u32 config3; /* 0x08 */
|
||||
u32 config4; /* 0x0C */
|
||||
u32 config5; /* 0x10 */
|
||||
u32 config6; /* 0x14 */
|
||||
u32 config7; /* 0x18 */
|
||||
u32 nand_cmd; /* 0x1C */
|
||||
u32 nand_adr; /* 0x20 */
|
||||
u32 nand_dat; /* 0x24 */
|
||||
u8 res[8]; /* blow up to 0x30 byte */
|
||||
};
|
||||
|
||||
struct bch_res_0_3 {
|
||||
u32 bch_result_x[4];
|
||||
};
|
||||
|
||||
struct gpmc {
|
||||
u8 res1[0x10];
|
||||
u32 sysconfig; /* 0x10 */
|
||||
u8 res2[0x4];
|
||||
u32 irqstatus; /* 0x18 */
|
||||
u32 irqenable; /* 0x1C */
|
||||
u8 res3[0x20];
|
||||
u32 timeout_control; /* 0x40 */
|
||||
u8 res4[0xC];
|
||||
u32 config; /* 0x50 */
|
||||
u32 status; /* 0x54 */
|
||||
u8 res5[0x8]; /* 0x58 */
|
||||
struct gpmc_cs cs[8]; /* 0x60, 0x90, .. */
|
||||
u8 res6[0x14]; /* 0x1E0 */
|
||||
u32 ecc_config; /* 0x1F4 */
|
||||
u32 ecc_control; /* 0x1F8 */
|
||||
u32 ecc_size_config; /* 0x1FC */
|
||||
u32 ecc1_result; /* 0x200 */
|
||||
u32 ecc2_result; /* 0x204 */
|
||||
u32 ecc3_result; /* 0x208 */
|
||||
u32 ecc4_result; /* 0x20C */
|
||||
u32 ecc5_result; /* 0x210 */
|
||||
u32 ecc6_result; /* 0x214 */
|
||||
u32 ecc7_result; /* 0x218 */
|
||||
u32 ecc8_result; /* 0x21C */
|
||||
u32 ecc9_result; /* 0x220 */
|
||||
u8 res7[12]; /* 0x224 */
|
||||
u32 testmomde_ctrl; /* 0x230 */
|
||||
u8 res8[12]; /* 0x234 */
|
||||
struct bch_res_0_3 bch_result_0_3[2]; /* 0x240 */
|
||||
};
|
||||
|
||||
/* Used for board specific gpmc initialization */
|
||||
extern struct gpmc *gpmc_cfg;
|
||||
|
||||
/* Encapsulating core pll registers */
|
||||
struct cm_wkuppll {
|
||||
unsigned int wkclkstctrl; /* offset 0x00 */
|
||||
|
||||
93
arch/arm/include/asm/arch-am33xx/elm.h
Normal file
93
arch/arm/include/asm/arch-am33xx/elm.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* (C) Copyright 2010-2011 Texas Instruments, <www.ti.com>
|
||||
* Mansoor Ahamed <mansoor.ahamed@ti.com>
|
||||
*
|
||||
* Derived from work done by Rohit Choraria <rohitkc@ti.com> for omap3
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARCH_ELM_H
|
||||
#define __ASM_ARCH_ELM_H
|
||||
/*
|
||||
* ELM Module Registers
|
||||
*/
|
||||
|
||||
/* ELM registers bit fields */
|
||||
#define ELM_SYSCONFIG_SOFTRESET_MASK (0x2)
|
||||
#define ELM_SYSCONFIG_SOFTRESET (0x2)
|
||||
#define ELM_SYSSTATUS_RESETDONE_MASK (0x1)
|
||||
#define ELM_SYSSTATUS_RESETDONE (0x1)
|
||||
#define ELM_LOCATION_CONFIG_ECC_BCH_LEVEL_MASK (0x3)
|
||||
#define ELM_LOCATION_CONFIG_ECC_SIZE_MASK (0x7FF0000)
|
||||
#define ELM_LOCATION_CONFIG_ECC_SIZE_POS (16)
|
||||
#define ELM_SYNDROME_FRAGMENT_6_SYNDROME_VALID (0x00010000)
|
||||
#define ELM_LOCATION_STATUS_ECC_CORRECTABLE_MASK (0x100)
|
||||
#define ELM_LOCATION_STATUS_ECC_NB_ERRORS_MASK (0x1F)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
enum bch_level {
|
||||
BCH_4_BIT = 0,
|
||||
BCH_8_BIT,
|
||||
BCH_16_BIT
|
||||
};
|
||||
|
||||
|
||||
/* BCH syndrome registers */
|
||||
struct syndrome {
|
||||
u32 syndrome_fragment_x[7]; /* 0x400, 0x404.... 0x418 */
|
||||
u8 res1[36]; /* 0x41c */
|
||||
};
|
||||
|
||||
/* BCH error status & location register */
|
||||
struct location {
|
||||
u32 location_status; /* 0x800 */
|
||||
u8 res1[124]; /* 0x804 */
|
||||
u32 error_location_x[16]; /* 0x880.... */
|
||||
u8 res2[64]; /* 0x8c0 */
|
||||
};
|
||||
|
||||
/* BCH ELM register map - do not try to allocate memmory for this structure.
|
||||
* We have used plenty of reserved variables to fill the slots in the ELM
|
||||
* register memory map.
|
||||
* Directly initialize the struct pointer to ELM base address.
|
||||
*/
|
||||
struct elm {
|
||||
u32 rev; /* 0x000 */
|
||||
u8 res1[12]; /* 0x004 */
|
||||
u32 sysconfig; /* 0x010 */
|
||||
u32 sysstatus; /* 0x014 */
|
||||
u32 irqstatus; /* 0x018 */
|
||||
u32 irqenable; /* 0x01c */
|
||||
u32 location_config; /* 0x020 */
|
||||
u8 res2[92]; /* 0x024 */
|
||||
u32 page_ctrl; /* 0x080 */
|
||||
u8 res3[892]; /* 0x084 */
|
||||
struct syndrome syndrome_fragments[8]; /* 0x400 */
|
||||
u8 res4[512]; /* 0x600 */
|
||||
struct location error_location[8]; /* 0x800 */
|
||||
};
|
||||
|
||||
int elm_check_error(u8 *syndrome, u32 nibbles, u32 *error_count,
|
||||
u32 *error_locations);
|
||||
int elm_config(enum bch_level level);
|
||||
void elm_reset(void);
|
||||
void elm_init(void);
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASM_ARCH_ELM_H */
|
||||
@@ -80,6 +80,9 @@
|
||||
#define DDRPHY_0_CONFIG_BASE (CTRL_BASE + 0x1400)
|
||||
#define DDRPHY_CONFIG_BASE DDRPHY_0_CONFIG_BASE
|
||||
|
||||
/* GPMC Base address */
|
||||
#define GPMC_BASE 0x50000000
|
||||
|
||||
/* CPSW Config space */
|
||||
#define AM335X_CPSW_BASE 0x4A100000
|
||||
#define AM335X_CPSW_MDIO_BASE 0x4A101000
|
||||
|
||||
83
arch/arm/include/asm/arch-am33xx/mem.h
Normal file
83
arch/arm/include/asm/arch-am33xx/mem.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* (C) Copyright 2006-2008
|
||||
* Texas Instruments, <www.ti.com>
|
||||
*
|
||||
* Author
|
||||
* Mansoor Ahamed <mansoor.ahamed@ti.com>
|
||||
*
|
||||
* Initial Code from:
|
||||
* Richard Woodruff <r-woodruff2@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MEM_H_
|
||||
#define _MEM_H_
|
||||
|
||||
/*
|
||||
* GPMC settings -
|
||||
* Definitions is as per the following format
|
||||
* #define <PART>_GPMC_CONFIG<x> <value>
|
||||
* Where:
|
||||
* PART is the part name e.g. STNOR - Intel Strata Flash
|
||||
* x is GPMC config registers from 1 to 6 (there will be 6 macros)
|
||||
* Value is corresponding value
|
||||
*
|
||||
* For every valid PRCM configuration there should be only one definition of
|
||||
* the same. if values are independent of the board, this definition will be
|
||||
* present in this file if values are dependent on the board, then this should
|
||||
* go into corresponding mem-boardName.h file
|
||||
*
|
||||
* Currently valid part Names are (PART):
|
||||
* M_NAND - Micron NAND
|
||||
*/
|
||||
#define GPMC_SIZE_256M 0x0
|
||||
#define GPMC_SIZE_128M 0x8
|
||||
#define GPMC_SIZE_64M 0xC
|
||||
#define GPMC_SIZE_32M 0xE
|
||||
#define GPMC_SIZE_16M 0xF
|
||||
|
||||
#define M_NAND_GPMC_CONFIG1 0x00000800
|
||||
#define M_NAND_GPMC_CONFIG2 0x001e1e00
|
||||
#define M_NAND_GPMC_CONFIG3 0x001e1e00
|
||||
#define M_NAND_GPMC_CONFIG4 0x16051807
|
||||
#define M_NAND_GPMC_CONFIG5 0x00151e1e
|
||||
#define M_NAND_GPMC_CONFIG6 0x16000f80
|
||||
#define M_NAND_GPMC_CONFIG7 0x00000008
|
||||
|
||||
/* max number of GPMC Chip Selects */
|
||||
#define GPMC_MAX_CS 8
|
||||
/* max number of GPMC regs */
|
||||
#define GPMC_MAX_REG 7
|
||||
|
||||
#define PISMO1_NOR 1
|
||||
#define PISMO1_NAND 2
|
||||
#define PISMO2_CS0 3
|
||||
#define PISMO2_CS1 4
|
||||
#define PISMO1_ONENAND 5
|
||||
#define DBG_MPDB 6
|
||||
#define PISMO2_NAND_CS0 7
|
||||
#define PISMO2_NAND_CS1 8
|
||||
|
||||
/* make it readable for the gpmc_init */
|
||||
#define PISMO1_NOR_BASE FLASH_BASE
|
||||
#define PISMO1_NAND_BASE CONFIG_SYS_NAND_BASE
|
||||
#define PISMO1_NAND_SIZE GPMC_SIZE_256M
|
||||
|
||||
#endif /* endif _MEM_H_ */
|
||||
120
arch/arm/include/asm/arch-am33xx/omap_gpmc.h
Normal file
120
arch/arm/include/asm/arch-am33xx/omap_gpmc.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
|
||||
* Rohit Choraria <rohitkc@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARCH_OMAP_GPMC_H
|
||||
#define __ASM_ARCH_OMAP_GPMC_H
|
||||
|
||||
#define GPMC_BUF_EMPTY 0
|
||||
#define GPMC_BUF_FULL 1
|
||||
|
||||
#define ECCCLEAR (0x1 << 8)
|
||||
#define ECCRESULTREG1 (0x1 << 0)
|
||||
#define ECCSIZE512BYTE 0xFF
|
||||
#define ECCSIZE1 (ECCSIZE512BYTE << 22)
|
||||
#define ECCSIZE0 (ECCSIZE512BYTE << 12)
|
||||
#define ECCSIZE0SEL (0x000 << 0)
|
||||
|
||||
/* Generic ECC Layouts */
|
||||
/* Large Page x8 NAND device Layout */
|
||||
#ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
|
||||
#define GPMC_NAND_HW_ECC_LAYOUT {\
|
||||
.eccbytes = 12,\
|
||||
.eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
|
||||
9, 10, 11, 12},\
|
||||
.oobfree = {\
|
||||
{.offset = 13,\
|
||||
.length = 51 } } \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Large Page x16 NAND device Layout */
|
||||
#ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
|
||||
#define GPMC_NAND_HW_ECC_LAYOUT {\
|
||||
.eccbytes = 12,\
|
||||
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
|
||||
10, 11, 12, 13},\
|
||||
.oobfree = {\
|
||||
{.offset = 14,\
|
||||
.length = 50 } } \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Small Page x8 NAND device Layout */
|
||||
#ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
|
||||
#define GPMC_NAND_HW_ECC_LAYOUT {\
|
||||
.eccbytes = 3,\
|
||||
.eccpos = {1, 2, 3},\
|
||||
.oobfree = {\
|
||||
{.offset = 4,\
|
||||
.length = 12 } } \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Small Page x16 NAND device Layout */
|
||||
#ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
|
||||
#define GPMC_NAND_HW_ECC_LAYOUT {\
|
||||
.eccbytes = 3,\
|
||||
.eccpos = {2, 3, 4},\
|
||||
.oobfree = {\
|
||||
{.offset = 5,\
|
||||
.length = 11 } } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define GPMC_NAND_HW_BCH4_ECC_LAYOUT {\
|
||||
.eccbytes = 32,\
|
||||
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
|
||||
28, 29, 30, 31, 32, 33},\
|
||||
.oobfree = {\
|
||||
{.offset = 34,\
|
||||
.length = 30 } } \
|
||||
}
|
||||
|
||||
#define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
|
||||
.eccbytes = 56,\
|
||||
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
|
||||
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
|
||||
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
|
||||
52, 53, 54, 55, 56, 57},\
|
||||
.oobfree = {\
|
||||
{.offset = 58,\
|
||||
.length = 6 } } \
|
||||
}
|
||||
|
||||
#define GPMC_NAND_HW_BCH16_ECC_LAYOUT {\
|
||||
.eccbytes = 104,\
|
||||
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
|
||||
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
|
||||
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\
|
||||
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\
|
||||
76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\
|
||||
88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\
|
||||
100, 101, 102, 103, 104, 105},\
|
||||
.oobfree = {\
|
||||
{.offset = 106,\
|
||||
.length = 8 } } \
|
||||
}
|
||||
#endif /* __ASM_ARCH_OMAP_GPMC_H */
|
||||
@@ -33,4 +33,7 @@ u32 get_device_type(void);
|
||||
void setup_clocks_for_console(void);
|
||||
void ddr_pll_config(unsigned int ddrpll_M);
|
||||
|
||||
void sdelay(unsigned long);
|
||||
void gpmc_init(void);
|
||||
void omap_nand_switch_ecc(int);
|
||||
#endif
|
||||
|
||||
@@ -154,6 +154,8 @@
|
||||
#define ATMEL_PIO_PORTS 4
|
||||
#define CPU_HAS_PIO3
|
||||
#define PIO_SCDR_DIV (0x3fff << 0) /* Slow Clock Divider Mask */
|
||||
#define ATMEL_PMC_UHP AT91SAM926x_PMC_UHP
|
||||
#define ATMEL_ID_UHP ATMEL_ID_UHPHS
|
||||
|
||||
/*
|
||||
* at91sam9x5 specific prototypes
|
||||
|
||||
@@ -34,9 +34,14 @@ unsigned long get_arm_clk(void);
|
||||
unsigned long get_i2c_clk(void);
|
||||
unsigned long get_pwm_clk(void);
|
||||
unsigned long get_uart_clk(int dev_index);
|
||||
unsigned long get_mmc_clk(int dev_index);
|
||||
void set_mmc_clk(int dev_index, unsigned int div);
|
||||
unsigned long get_lcd_clk(void);
|
||||
void set_lcd_clk(void);
|
||||
void set_mipi_clk(void);
|
||||
void set_i2s_clk_source(void);
|
||||
int set_i2s_clk_prescaler(unsigned int src_frq, unsigned int dst_frq);
|
||||
int set_epll_clk(unsigned long rate);
|
||||
int set_spi_clk(int periph_id, unsigned int rate);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -251,6 +251,282 @@ struct exynos4_clock {
|
||||
unsigned int div_iem_l1;
|
||||
};
|
||||
|
||||
struct exynos4x12_clock {
|
||||
unsigned char res1[0x4200];
|
||||
unsigned int src_leftbus;
|
||||
unsigned char res2[0x1fc];
|
||||
unsigned int mux_stat_leftbus;
|
||||
unsigned char res3[0xfc];
|
||||
unsigned int div_leftbus;
|
||||
unsigned char res4[0xfc];
|
||||
unsigned int div_stat_leftbus;
|
||||
unsigned char res5[0x1fc];
|
||||
unsigned int gate_ip_leftbus;
|
||||
unsigned char res6[0x12c];
|
||||
unsigned int gate_ip_image;
|
||||
unsigned char res7[0xcc];
|
||||
unsigned int clkout_leftbus;
|
||||
unsigned int clkout_leftbus_div_stat;
|
||||
unsigned char res8[0x37f8];
|
||||
unsigned int src_rightbus;
|
||||
unsigned char res9[0x1fc];
|
||||
unsigned int mux_stat_rightbus;
|
||||
unsigned char res10[0xfc];
|
||||
unsigned int div_rightbus;
|
||||
unsigned char res11[0xfc];
|
||||
unsigned int div_stat_rightbus;
|
||||
unsigned char res12[0x1fc];
|
||||
unsigned int gate_ip_rightbus;
|
||||
unsigned char res13[0x15c];
|
||||
unsigned int gate_ip_perir;
|
||||
unsigned char res14[0x9c];
|
||||
unsigned int clkout_rightbus;
|
||||
unsigned int clkout_rightbus_div_stat;
|
||||
unsigned char res15[0x3608];
|
||||
unsigned int epll_lock;
|
||||
unsigned char res16[0xc];
|
||||
unsigned int vpll_lock;
|
||||
unsigned char res17[0xec];
|
||||
unsigned int epll_con0;
|
||||
unsigned int epll_con1;
|
||||
unsigned int epll_con2;
|
||||
unsigned char res18[0x4];
|
||||
unsigned int vpll_con0;
|
||||
unsigned int vpll_con1;
|
||||
unsigned int vpll_con2;
|
||||
unsigned char res19[0xe4];
|
||||
unsigned int src_top0;
|
||||
unsigned int src_top1;
|
||||
unsigned char res20[0x8];
|
||||
unsigned int src_cam;
|
||||
unsigned int src_tv;
|
||||
unsigned int src_mfc;
|
||||
unsigned int src_g3d;
|
||||
unsigned char res21[0x4];
|
||||
unsigned int src_lcd;
|
||||
unsigned int src_isp;
|
||||
unsigned int src_maudio;
|
||||
unsigned int src_fsys;
|
||||
unsigned char res22[0xc];
|
||||
unsigned int src_peril0;
|
||||
unsigned int src_peril1;
|
||||
unsigned int src_cam1;
|
||||
unsigned char res23[0xb4];
|
||||
unsigned int src_mask_top;
|
||||
unsigned char res24[0xc];
|
||||
unsigned int src_mask_cam;
|
||||
unsigned int src_mask_tv;
|
||||
unsigned char res25[0xc];
|
||||
unsigned int src_mask_lcd;
|
||||
unsigned int src_mask_isp;
|
||||
unsigned int src_mask_maudio;
|
||||
unsigned int src_mask_fsys;
|
||||
unsigned char res26[0xc];
|
||||
unsigned int src_mask_peril0;
|
||||
unsigned int src_mask_peril1;
|
||||
unsigned char res27[0xb8];
|
||||
unsigned int mux_stat_top0;
|
||||
unsigned int mux_stat_top1;
|
||||
unsigned char res28[0x10];
|
||||
unsigned int mux_stat_mfc;
|
||||
unsigned int mux_stat_g3d;
|
||||
unsigned char res29[0x28];
|
||||
unsigned int mux_stat_cam1;
|
||||
unsigned char res30[0xb4];
|
||||
unsigned int div_top;
|
||||
unsigned char res31[0xc];
|
||||
unsigned int div_cam;
|
||||
unsigned int div_tv;
|
||||
unsigned int div_mfc;
|
||||
unsigned int div_g3d;
|
||||
unsigned char res32[0x4];
|
||||
unsigned int div_lcd;
|
||||
unsigned int div_isp;
|
||||
unsigned int div_maudio;
|
||||
unsigned int div_fsys0;
|
||||
unsigned int div_fsys1;
|
||||
unsigned int div_fsys2;
|
||||
unsigned int div_fsys3;
|
||||
unsigned int div_peril0;
|
||||
unsigned int div_peril1;
|
||||
unsigned int div_peril2;
|
||||
unsigned int div_peril3;
|
||||
unsigned int div_peril4;
|
||||
unsigned int div_peril5;
|
||||
unsigned int div_cam1;
|
||||
unsigned char res33[0x14];
|
||||
unsigned int div2_ratio;
|
||||
unsigned char res34[0x8c];
|
||||
unsigned int div_stat_top;
|
||||
unsigned char res35[0xc];
|
||||
unsigned int div_stat_cam;
|
||||
unsigned int div_stat_tv;
|
||||
unsigned int div_stat_mfc;
|
||||
unsigned int div_stat_g3d;
|
||||
unsigned char res36[0x4];
|
||||
unsigned int div_stat_lcd;
|
||||
unsigned int div_stat_isp;
|
||||
unsigned int div_stat_maudio;
|
||||
unsigned int div_stat_fsys0;
|
||||
unsigned int div_stat_fsys1;
|
||||
unsigned int div_stat_fsys2;
|
||||
unsigned int div_stat_fsys3;
|
||||
unsigned int div_stat_peril0;
|
||||
unsigned int div_stat_peril1;
|
||||
unsigned int div_stat_peril2;
|
||||
unsigned int div_stat_peril3;
|
||||
unsigned int div_stat_peril4;
|
||||
unsigned int div_stat_peril5;
|
||||
unsigned int div_stat_cam1;
|
||||
unsigned char res37[0x14];
|
||||
unsigned int div2_stat;
|
||||
unsigned char res38[0x29c];
|
||||
unsigned int gate_ip_cam;
|
||||
unsigned int gate_ip_tv;
|
||||
unsigned int gate_ip_mfc;
|
||||
unsigned int gate_ip_g3d;
|
||||
unsigned char res39[0x4];
|
||||
unsigned int gate_ip_lcd;
|
||||
unsigned int gate_ip_isp;
|
||||
unsigned char res40[0x4];
|
||||
unsigned int gate_ip_fsys;
|
||||
unsigned char res41[0x8];
|
||||
unsigned int gate_ip_gps;
|
||||
unsigned int gate_ip_peril;
|
||||
unsigned char res42[0xc];
|
||||
unsigned char res43[0x4];
|
||||
unsigned char res44[0xc];
|
||||
unsigned int gate_block;
|
||||
unsigned char res45[0x8c];
|
||||
unsigned int clkout_cmu_top;
|
||||
unsigned int clkout_cmu_top_div_stat;
|
||||
unsigned char res46[0x3600];
|
||||
unsigned int mpll_lock;
|
||||
unsigned char res47[0xfc];
|
||||
unsigned int mpll_con0;
|
||||
unsigned int mpll_con1;
|
||||
unsigned char res48[0xf0];
|
||||
unsigned int src_dmc;
|
||||
unsigned char res49[0xfc];
|
||||
unsigned int src_mask_dmc;
|
||||
unsigned char res50[0xfc];
|
||||
unsigned int mux_stat_dmc;
|
||||
unsigned char res51[0xfc];
|
||||
unsigned int div_dmc0;
|
||||
unsigned int div_dmc1;
|
||||
unsigned char res52[0xf8];
|
||||
unsigned int div_stat_dmc0;
|
||||
unsigned int div_stat_dmc1;
|
||||
unsigned char res53[0xf8];
|
||||
unsigned int gate_bus_dmc0;
|
||||
unsigned int gate_bus_dmc1;
|
||||
unsigned char res54[0x1f8];
|
||||
unsigned int gate_ip_dmc0;
|
||||
unsigned int gate_ip_dmc1;
|
||||
unsigned char res55[0xf8];
|
||||
unsigned int clkout_cmu_dmc;
|
||||
unsigned int clkout_cmu_dmc_div_stat;
|
||||
unsigned char res56[0x5f8];
|
||||
unsigned int dcgidx_map0;
|
||||
unsigned int dcgidx_map1;
|
||||
unsigned int dcgidx_map2;
|
||||
unsigned char res57[0x14];
|
||||
unsigned int dcgperf_map0;
|
||||
unsigned int dcgperf_map1;
|
||||
unsigned char res58[0x18];
|
||||
unsigned int dvcidx_map;
|
||||
unsigned char res59[0x1c];
|
||||
unsigned int freq_cpu;
|
||||
unsigned int freq_dpm;
|
||||
unsigned char res60[0x18];
|
||||
unsigned int dvsemclk_en;
|
||||
unsigned int maxperf;
|
||||
unsigned char res61[0x8];
|
||||
unsigned int dmc_freq_ctrl;
|
||||
unsigned int dmc_pause_ctrl;
|
||||
unsigned int dddrphy_lock_ctrl;
|
||||
unsigned int c2c_state;
|
||||
unsigned char res62[0x2f60];
|
||||
unsigned int apll_lock;
|
||||
unsigned char res63[0x8];
|
||||
unsigned char res64[0xf4];
|
||||
unsigned int apll_con0;
|
||||
unsigned int apll_con1;
|
||||
unsigned char res65[0xf8];
|
||||
unsigned int src_cpu;
|
||||
unsigned char res66[0x1fc];
|
||||
unsigned int mux_stat_cpu;
|
||||
unsigned char res67[0xfc];
|
||||
unsigned int div_cpu0;
|
||||
unsigned int div_cpu1;
|
||||
unsigned char res68[0xf8];
|
||||
unsigned int div_stat_cpu0;
|
||||
unsigned int div_stat_cpu1;
|
||||
unsigned char res69[0x2f8];
|
||||
unsigned int clk_gate_ip_cpu;
|
||||
unsigned char res70[0xfc];
|
||||
unsigned int clkout_cmu_cpu;
|
||||
unsigned int clkout_cmu_cpu_div_stat;
|
||||
unsigned char res71[0x5f8];
|
||||
unsigned int armclk_stopctrl;
|
||||
unsigned int atclk_stopctrl;
|
||||
unsigned char res72[0x10];
|
||||
unsigned char res73[0x8];
|
||||
unsigned int pwr_ctrl;
|
||||
unsigned int pwr_ctrl2;
|
||||
unsigned char res74[0xd8];
|
||||
unsigned int apll_con0_l8;
|
||||
unsigned int apll_con0_l7;
|
||||
unsigned int apll_con0_l6;
|
||||
unsigned int apll_con0_l5;
|
||||
unsigned int apll_con0_l4;
|
||||
unsigned int apll_con0_l3;
|
||||
unsigned int apll_con0_l2;
|
||||
unsigned int apll_con0_l1;
|
||||
unsigned int iem_control;
|
||||
unsigned char res75[0xdc];
|
||||
unsigned int apll_con1_l8;
|
||||
unsigned int apll_con1_l7;
|
||||
unsigned int apll_con1_l6;
|
||||
unsigned int apll_con1_l5;
|
||||
unsigned int apll_con1_l4;
|
||||
unsigned int apll_con1_l3;
|
||||
unsigned int apll_con1_l2;
|
||||
unsigned int apll_con1_l1;
|
||||
unsigned char res76[0xe0];
|
||||
unsigned int div_iem_l8;
|
||||
unsigned int div_iem_l7;
|
||||
unsigned int div_iem_l6;
|
||||
unsigned int div_iem_l5;
|
||||
unsigned int div_iem_l4;
|
||||
unsigned int div_iem_l3;
|
||||
unsigned int div_iem_l2;
|
||||
unsigned int div_iem_l1;
|
||||
unsigned char res77[0xe0];
|
||||
unsigned int l2_status;
|
||||
unsigned char res78[0xc];
|
||||
unsigned int cpu_status;
|
||||
unsigned char res79[0xc];
|
||||
unsigned int ptm_status;
|
||||
unsigned char res80[0x2edc];
|
||||
unsigned int div_isp0;
|
||||
unsigned int div_isp1;
|
||||
unsigned char res81[0xf8];
|
||||
unsigned int div_stat_isp0;
|
||||
unsigned int div_stat_isp1;
|
||||
unsigned char res82[0x3f8];
|
||||
unsigned int gate_ip_isp0;
|
||||
unsigned int gate_ip_isp1;
|
||||
unsigned char res83[0x1f8];
|
||||
unsigned int clkout_cmu_isp;
|
||||
unsigned int clkout_cmu_ispd_div_stat;
|
||||
unsigned char res84[0xf8];
|
||||
unsigned int cmu_isp_spar0;
|
||||
unsigned int cmu_isp_spar1;
|
||||
unsigned int cmu_isp_spar2;
|
||||
unsigned int cmu_isp_spar3;
|
||||
};
|
||||
|
||||
struct exynos5_clock {
|
||||
unsigned int apll_lock;
|
||||
unsigned char res1[0xfc];
|
||||
@@ -595,9 +871,38 @@ struct exynos5_clock {
|
||||
unsigned int pll_div2_sel;
|
||||
unsigned char res123[0xf5d8];
|
||||
};
|
||||
|
||||
/* structure for epll configuration used in audio clock configuration */
|
||||
struct set_epll_con_val {
|
||||
unsigned int freq_out; /* frequency out */
|
||||
unsigned int en_lock_det; /* enable lock detect */
|
||||
unsigned int m_div; /* m divider value */
|
||||
unsigned int p_div; /* p divider value */
|
||||
unsigned int s_div; /* s divider value */
|
||||
unsigned int k_dsm; /* k value of delta signal modulator */
|
||||
};
|
||||
#endif
|
||||
|
||||
#define MPLL_FOUT_SEL_SHIFT 4
|
||||
#define EXYNOS5_EPLLCON0_LOCKED_SHIFT 29 /* EPLL Locked bit position*/
|
||||
#define TIMEOUT_EPLL_LOCK 1000
|
||||
|
||||
#define AUDIO_0_RATIO_MASK 0x0f
|
||||
#define AUDIO_1_RATIO_MASK 0x0f
|
||||
|
||||
#define AUDIO1_SEL_MASK 0xf
|
||||
#define CLK_SRC_SCLK_EPLL 0x7
|
||||
|
||||
/* CON0 bit-fields */
|
||||
#define EPLL_CON0_MDIV_MASK 0x1ff
|
||||
#define EPLL_CON0_PDIV_MASK 0x3f
|
||||
#define EPLL_CON0_SDIV_MASK 0x7
|
||||
#define EPLL_CON0_MDIV_SHIFT 16
|
||||
#define EPLL_CON0_PDIV_SHIFT 8
|
||||
#define EPLL_CON0_SDIV_SHIFT 0
|
||||
#define EPLL_CON0_LOCK_DET_EN_SHIFT 28
|
||||
#define EPLL_CON0_LOCK_DET_EN_MASK 1
|
||||
|
||||
#define MPLL_FOUT_SEL_MASK 0x1
|
||||
#define BPLL_FOUT_SEL_SHIFT 0
|
||||
#define BPLL_FOUT_SEL_MASK 0x1
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#define EXYNOS_CPU_NAME "Exynos"
|
||||
#define EXYNOS4_ADDR_BASE 0x10000000
|
||||
|
||||
/* EXYNOS4 */
|
||||
/* EXYNOS4 Common*/
|
||||
#define EXYNOS4_I2C_SPACING 0x10000
|
||||
|
||||
#define EXYNOS4_GPIO_PART3_BASE 0x03860000
|
||||
@@ -53,14 +53,50 @@
|
||||
#define EXYNOS4_UART_BASE 0x13800000
|
||||
#define EXYNOS4_I2C_BASE 0x13860000
|
||||
#define EXYNOS4_ADC_BASE 0x13910000
|
||||
#define EXYNOS4_SPI_BASE 0x13920000
|
||||
#define EXYNOS4_PWMTIMER_BASE 0x139D0000
|
||||
#define EXYNOS4_MODEM_BASE 0x13A00000
|
||||
#define EXYNOS4_USBPHY_CONTROL 0x10020704
|
||||
#define EXYNOS4_I2S_BASE 0xE2100000
|
||||
|
||||
#define EXYNOS4_GPIO_PART4_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_DP_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_SPI_ISP_BASE DEVICE_NOT_AVAILABLE
|
||||
|
||||
/* EXYNOS5 */
|
||||
/* EXYNOS4X12 */
|
||||
#define EXYNOS4X12_GPIO_PART3_BASE 0x03860000
|
||||
#define EXYNOS4X12_PRO_ID 0x10000000
|
||||
#define EXYNOS4X12_SYSREG_BASE 0x10010000
|
||||
#define EXYNOS4X12_POWER_BASE 0x10020000
|
||||
#define EXYNOS4X12_SWRESET 0x10020400
|
||||
#define EXYNOS4X12_USBPHY_CONTROL 0x10020704
|
||||
#define EXYNOS4X12_CLOCK_BASE 0x10030000
|
||||
#define EXYNOS4X12_SYSTIMER_BASE 0x10050000
|
||||
#define EXYNOS4X12_WATCHDOG_BASE 0x10060000
|
||||
#define EXYNOS4X12_DMC0_BASE 0x10600000
|
||||
#define EXYNOS4X12_DMC1_BASE 0x10610000
|
||||
#define EXYNOS4X12_GPIO_PART4_BASE 0x106E0000
|
||||
#define EXYNOS4X12_GPIO_PART2_BASE 0x11000000
|
||||
#define EXYNOS4X12_GPIO_PART1_BASE 0x11400000
|
||||
#define EXYNOS4X12_FIMD_BASE 0x11C00000
|
||||
#define EXYNOS4X12_MIPI_DSIM_BASE 0x11C80000
|
||||
#define EXYNOS4X12_USBOTG_BASE 0x12480000
|
||||
#define EXYNOS4X12_MMC_BASE 0x12510000
|
||||
#define EXYNOS4X12_SROMC_BASE 0x12570000
|
||||
#define EXYNOS4X12_USB_HOST_EHCI_BASE 0x12580000
|
||||
#define EXYNOS4X12_USBPHY_BASE 0x125B0000
|
||||
#define EXYNOS4X12_UART_BASE 0x13800000
|
||||
#define EXYNOS4X12_I2C_BASE 0x13860000
|
||||
#define EXYNOS4X12_PWMTIMER_BASE 0x139D0000
|
||||
|
||||
#define EXYNOS4X12_ADC_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_DP_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_MODEM_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_I2S_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_SPI_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_SPI_ISP_BASE DEVICE_NOT_AVAILABLE
|
||||
|
||||
/* EXYNOS5 Common*/
|
||||
#define EXYNOS5_I2C_SPACING 0x10000
|
||||
|
||||
#define EXYNOS5_GPIO_PART4_BASE 0x03860000
|
||||
@@ -83,7 +119,10 @@
|
||||
#define EXYNOS5_SROMC_BASE 0x12250000
|
||||
#define EXYNOS5_UART_BASE 0x12C00000
|
||||
#define EXYNOS5_I2C_BASE 0x12C60000
|
||||
#define EXYNOS5_SPI_BASE 0x12D20000
|
||||
#define EXYNOS5_I2S_BASE 0x12D60000
|
||||
#define EXYNOS5_PWMTIMER_BASE 0x12DD0000
|
||||
#define EXYNOS5_SPI_ISP_BASE 0x131A0000
|
||||
#define EXYNOS5_GPIO_PART2_BASE 0x13400000
|
||||
#define EXYNOS5_FIMD_BASE 0x14400000
|
||||
#define EXYNOS5_DP_BASE 0x145B0000
|
||||
@@ -141,15 +180,27 @@ static inline int cpu_is_##type(void) \
|
||||
IS_SAMSUNG_TYPE(exynos4, 0x4)
|
||||
IS_SAMSUNG_TYPE(exynos5, 0x5)
|
||||
|
||||
#define IS_EXYNOS_TYPE(type, id) \
|
||||
static inline int proid_is_##type(void) \
|
||||
{ \
|
||||
return s5p_cpu_id == id; \
|
||||
}
|
||||
|
||||
IS_EXYNOS_TYPE(exynos4210, 0x4210)
|
||||
IS_EXYNOS_TYPE(exynos4412, 0x4412)
|
||||
IS_EXYNOS_TYPE(exynos5250, 0x5250)
|
||||
|
||||
#define SAMSUNG_BASE(device, base) \
|
||||
static inline unsigned int samsung_get_base_##device(void) \
|
||||
{ \
|
||||
if (cpu_is_exynos4()) \
|
||||
if (cpu_is_exynos4()) { \
|
||||
if (proid_is_exynos4412()) \
|
||||
return EXYNOS4X12_##base; \
|
||||
return EXYNOS4_##base; \
|
||||
else if (cpu_is_exynos5()) \
|
||||
} else if (cpu_is_exynos5()) { \
|
||||
return EXYNOS5_##base; \
|
||||
else \
|
||||
return 0; \
|
||||
} \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
SAMSUNG_BASE(adc, ADC_BASE)
|
||||
@@ -158,6 +209,7 @@ SAMSUNG_BASE(dp, DP_BASE)
|
||||
SAMSUNG_BASE(sysreg, SYSREG_BASE)
|
||||
SAMSUNG_BASE(fimd, FIMD_BASE)
|
||||
SAMSUNG_BASE(i2c, I2C_BASE)
|
||||
SAMSUNG_BASE(i2s, I2S_BASE)
|
||||
SAMSUNG_BASE(mipi_dsim, MIPI_DSIM_BASE)
|
||||
SAMSUNG_BASE(gpio_part1, GPIO_PART1_BASE)
|
||||
SAMSUNG_BASE(gpio_part2, GPIO_PART2_BASE)
|
||||
@@ -175,6 +227,8 @@ SAMSUNG_BASE(usb_ehci, USB_HOST_EHCI_BASE)
|
||||
SAMSUNG_BASE(usb_otg, USBOTG_BASE)
|
||||
SAMSUNG_BASE(watchdog, WATCHDOG_BASE)
|
||||
SAMSUNG_BASE(power, POWER_BASE)
|
||||
SAMSUNG_BASE(spi, SPI_BASE)
|
||||
SAMSUNG_BASE(spi_isp, SPI_ISP_BASE)
|
||||
#endif
|
||||
|
||||
#endif /* _EXYNOS4_CPU_H */
|
||||
|
||||
@@ -211,4 +211,6 @@ unsigned int exynos_init_dp(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void exynos_set_dp_platform_data(struct exynos_dp_platform_data *pd);
|
||||
|
||||
#endif /* _DP_INFO_H */
|
||||
|
||||
@@ -79,6 +79,67 @@ struct exynos4_gpio_part3 {
|
||||
struct s5p_gpio_bank z;
|
||||
};
|
||||
|
||||
struct exynos4x12_gpio_part1 {
|
||||
struct s5p_gpio_bank a0;
|
||||
struct s5p_gpio_bank a1;
|
||||
struct s5p_gpio_bank b;
|
||||
struct s5p_gpio_bank c0;
|
||||
struct s5p_gpio_bank c1;
|
||||
struct s5p_gpio_bank d0;
|
||||
struct s5p_gpio_bank d1;
|
||||
struct s5p_gpio_bank res1[0x5];
|
||||
struct s5p_gpio_bank f0;
|
||||
struct s5p_gpio_bank f1;
|
||||
struct s5p_gpio_bank f2;
|
||||
struct s5p_gpio_bank f3;
|
||||
struct s5p_gpio_bank res2[0x2];
|
||||
struct s5p_gpio_bank j0;
|
||||
struct s5p_gpio_bank j1;
|
||||
};
|
||||
|
||||
struct exynos4x12_gpio_part2 {
|
||||
struct s5p_gpio_bank res1[0x2];
|
||||
struct s5p_gpio_bank k0;
|
||||
struct s5p_gpio_bank k1;
|
||||
struct s5p_gpio_bank k2;
|
||||
struct s5p_gpio_bank k3;
|
||||
struct s5p_gpio_bank l0;
|
||||
struct s5p_gpio_bank l1;
|
||||
struct s5p_gpio_bank l2;
|
||||
struct s5p_gpio_bank y0;
|
||||
struct s5p_gpio_bank y1;
|
||||
struct s5p_gpio_bank y2;
|
||||
struct s5p_gpio_bank y3;
|
||||
struct s5p_gpio_bank y4;
|
||||
struct s5p_gpio_bank y5;
|
||||
struct s5p_gpio_bank y6;
|
||||
struct s5p_gpio_bank res2[0x3];
|
||||
struct s5p_gpio_bank m0;
|
||||
struct s5p_gpio_bank m1;
|
||||
struct s5p_gpio_bank m2;
|
||||
struct s5p_gpio_bank m3;
|
||||
struct s5p_gpio_bank m4;
|
||||
struct s5p_gpio_bank res3[0x48];
|
||||
struct s5p_gpio_bank x0;
|
||||
struct s5p_gpio_bank x1;
|
||||
struct s5p_gpio_bank x2;
|
||||
struct s5p_gpio_bank x3;
|
||||
};
|
||||
|
||||
struct exynos4x12_gpio_part3 {
|
||||
struct s5p_gpio_bank z;
|
||||
};
|
||||
|
||||
struct exynos4x12_gpio_part4 {
|
||||
struct s5p_gpio_bank v0;
|
||||
struct s5p_gpio_bank v1;
|
||||
struct s5p_gpio_bank res1[0x1];
|
||||
struct s5p_gpio_bank v2;
|
||||
struct s5p_gpio_bank v3;
|
||||
struct s5p_gpio_bank res2[0x1];
|
||||
struct s5p_gpio_bank v4;
|
||||
};
|
||||
|
||||
struct exynos5_gpio_part1 {
|
||||
struct s5p_gpio_bank a0;
|
||||
struct s5p_gpio_bank a1;
|
||||
@@ -163,6 +224,30 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode);
|
||||
- EXYNOS4_GPIO_PART2_BASE) / sizeof(struct s5p_gpio_bank)) \
|
||||
* GPIO_PER_BANK) + pin) + EXYNOS4_GPIO_PART1_MAX)
|
||||
|
||||
#define exynos4x12_gpio_part1_get_nr(bank, pin) \
|
||||
((((((unsigned int) &(((struct exynos4x12_gpio_part1 *) \
|
||||
EXYNOS4X12_GPIO_PART1_BASE)->bank)) \
|
||||
- EXYNOS4X12_GPIO_PART1_BASE) / sizeof(struct s5p_gpio_bank)) \
|
||||
* GPIO_PER_BANK) + pin)
|
||||
|
||||
#define EXYNOS4X12_GPIO_PART1_MAX ((sizeof(struct exynos4x12_gpio_part1) \
|
||||
/ sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
|
||||
|
||||
#define exynos4x12_gpio_part2_get_nr(bank, pin) \
|
||||
(((((((unsigned int) &(((struct exynos4x12_gpio_part2 *) \
|
||||
EXYNOS4X12_GPIO_PART2_BASE)->bank)) \
|
||||
- EXYNOS4X12_GPIO_PART2_BASE) / sizeof(struct s5p_gpio_bank)) \
|
||||
* GPIO_PER_BANK) + pin) + EXYNOS4X12_GPIO_PART1_MAX)
|
||||
|
||||
#define EXYNOS4X12_GPIO_PART2_MAX ((sizeof(struct exynos4x12_gpio_part2) \
|
||||
/ sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
|
||||
|
||||
#define exynos4x12_gpio_part3_get_nr(bank, pin) \
|
||||
(((((((unsigned int) &(((struct exynos4x12_gpio_part3 *) \
|
||||
EXYNOS4X12_GPIO_PART3_BASE)->bank)) \
|
||||
- EXYNOS4X12_GPIO_PART3_BASE) / sizeof(struct s5p_gpio_bank)) \
|
||||
* GPIO_PER_BANK) + pin) + EXYNOS4X12_GPIO_PART2_MAX)
|
||||
|
||||
#define exynos5_gpio_part1_get_nr(bank, pin) \
|
||||
((((((unsigned int) &(((struct exynos5_gpio_part1 *) \
|
||||
EXYNOS5_GPIO_PART1_BASE)->bank)) \
|
||||
@@ -207,6 +292,25 @@ static inline unsigned int s5p_gpio_base(int nr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned int s5p_gpio_part_max(int nr)
|
||||
{
|
||||
if (cpu_is_exynos5()) {
|
||||
if (nr < EXYNOS5_GPIO_PART1_MAX)
|
||||
return 0;
|
||||
else if (nr < EXYNOS5_GPIO_PART2_MAX)
|
||||
return EXYNOS5_GPIO_PART1_MAX;
|
||||
else
|
||||
return EXYNOS5_GPIO_PART2_MAX;
|
||||
|
||||
} else if (cpu_is_exynos4()) {
|
||||
if (nr < EXYNOS4_GPIO_PART1_MAX)
|
||||
return 0;
|
||||
else
|
||||
return EXYNOS4_GPIO_PART1_MAX;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Pin configurations */
|
||||
|
||||
66
arch/arm/include/asm/arch-exynos/i2s-regs.h
Normal file
66
arch/arm/include/asm/arch-exynos/i2s-regs.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics
|
||||
* R. Chandrasekar <rcsekar@samsung.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
|
||||
*/
|
||||
|
||||
#ifndef __I2S_REGS_H__
|
||||
#define __I2S_REGS_H__
|
||||
|
||||
#define CON_TXFIFO_FULL (1 << 8)
|
||||
#define CON_TXCH_PAUSE (1 << 4)
|
||||
#define CON_ACTIVE (1 << 0)
|
||||
|
||||
#define MOD_BLCP_SHIFT 24
|
||||
#define MOD_BLCP_16BIT (0 << MOD_BLCP_SHIFT)
|
||||
#define MOD_BLCP_8BIT (1 << MOD_BLCP_SHIFT)
|
||||
#define MOD_BLCP_24BIT (2 << MOD_BLCP_SHIFT)
|
||||
#define MOD_BLCP_MASK (3 << MOD_BLCP_SHIFT)
|
||||
|
||||
#define MOD_BLC_16BIT (0 << 13)
|
||||
#define MOD_BLC_8BIT (1 << 13)
|
||||
#define MOD_BLC_24BIT (2 << 13)
|
||||
#define MOD_BLC_MASK (3 << 13)
|
||||
|
||||
#define MOD_SLAVE (1 << 11)
|
||||
#define MOD_MASK (3 << 8)
|
||||
#define MOD_LR_LLOW (0 << 7)
|
||||
#define MOD_LR_RLOW (1 << 7)
|
||||
#define MOD_SDF_IIS (0 << 5)
|
||||
#define MOD_SDF_MSB (1 << 5)
|
||||
#define MOD_SDF_LSB (2 << 5)
|
||||
#define MOD_SDF_MASK (3 << 5)
|
||||
#define MOD_RCLK_256FS (0 << 3)
|
||||
#define MOD_RCLK_512FS (1 << 3)
|
||||
#define MOD_RCLK_384FS (2 << 3)
|
||||
#define MOD_RCLK_768FS (3 << 3)
|
||||
#define MOD_RCLK_MASK (3 << 3)
|
||||
#define MOD_BCLK_32FS (0 << 1)
|
||||
#define MOD_BCLK_48FS (1 << 1)
|
||||
#define MOD_BCLK_16FS (2 << 1)
|
||||
#define MOD_BCLK_24FS (3 << 1)
|
||||
#define MOD_BCLK_MASK (3 << 1)
|
||||
|
||||
#define MOD_CDCLKCON (1 << 12)
|
||||
|
||||
#define FIC_TXFLUSH (1 << 15)
|
||||
#define FIC_RXFLUSH (1 << 7)
|
||||
|
||||
#endif /* __I2S_REGS_H__ */
|
||||
@@ -358,7 +358,14 @@ struct mipi_dsim_lcd_driver {
|
||||
void (*mipi_display_on)(struct mipi_dsim_device *dsim_dev);
|
||||
};
|
||||
|
||||
#ifdef CONFIG_EXYNOS_MIPI_DSIM
|
||||
int exynos_mipi_dsi_init(void);
|
||||
#else
|
||||
static inline int exynos_mipi_dsi_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* register mipi_dsim_lcd_driver object defined by lcd panel driver
|
||||
|
||||
@@ -25,12 +25,17 @@
|
||||
#define __ASM_ARM_ARCH_PERIPH_H
|
||||
|
||||
/*
|
||||
* Peripherals requiring clock/pinmux configuration. List will
|
||||
* Peripherals required for pinmux configuration. List will
|
||||
* grow with support for more devices getting added.
|
||||
* Numbering based on interrupt table.
|
||||
*
|
||||
*/
|
||||
enum periph_id {
|
||||
PERIPH_ID_I2C0,
|
||||
PERIPH_ID_UART0 = 51,
|
||||
PERIPH_ID_UART1,
|
||||
PERIPH_ID_UART2,
|
||||
PERIPH_ID_UART3,
|
||||
PERIPH_ID_I2C0 = 56,
|
||||
PERIPH_ID_I2C1,
|
||||
PERIPH_ID_I2C2,
|
||||
PERIPH_ID_I2C3,
|
||||
@@ -38,15 +43,24 @@ enum periph_id {
|
||||
PERIPH_ID_I2C5,
|
||||
PERIPH_ID_I2C6,
|
||||
PERIPH_ID_I2C7,
|
||||
PERIPH_ID_SDMMC0,
|
||||
PERIPH_ID_SPI0 = 68,
|
||||
PERIPH_ID_SPI1,
|
||||
PERIPH_ID_SPI2,
|
||||
PERIPH_ID_SDMMC0 = 75,
|
||||
PERIPH_ID_SDMMC1,
|
||||
PERIPH_ID_SDMMC2,
|
||||
PERIPH_ID_SDMMC3,
|
||||
PERIPH_ID_SROMC,
|
||||
PERIPH_ID_UART0,
|
||||
PERIPH_ID_UART1,
|
||||
PERIPH_ID_UART2,
|
||||
PERIPH_ID_UART3,
|
||||
PERIPH_ID_I2S1 = 99,
|
||||
|
||||
/* Since following peripherals do
|
||||
* not have shared peripheral interrupts (SPIs)
|
||||
* they are numbered arbitiraly after the maximum
|
||||
* SPIs Exynos has (128)
|
||||
*/
|
||||
PERIPH_ID_SROMC = 128,
|
||||
PERIPH_ID_SPI3,
|
||||
PERIPH_ID_SPI4,
|
||||
PERIPH_ID_SDMMC4,
|
||||
|
||||
PERIPH_ID_COUNT,
|
||||
PERIPH_ID_NONE = -1,
|
||||
|
||||
@@ -55,4 +55,12 @@ enum {
|
||||
*/
|
||||
int exynos_pinmux_config(int peripheral, int flags);
|
||||
|
||||
/**
|
||||
* Decode the peripheral id using the interrpt numbers.
|
||||
*
|
||||
* @param blob Device tree blob
|
||||
* @param node FDT I2C node to find
|
||||
* @return peripheral id if ok, PERIPH_ID_NONE on error
|
||||
*/
|
||||
int pinmux_decode_periph_id(const void *blob, int node);
|
||||
#endif
|
||||
|
||||
44
arch/arm/include/asm/arch-exynos/sound.h
Normal file
44
arch/arm/include/asm/arch-exynos/sound.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics
|
||||
* Rajeshwari Shinde <rajeshwari.s@samsung.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
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SOUND_ARCH_H__
|
||||
#define __SOUND_ARCH_H__
|
||||
|
||||
/* I2S values */
|
||||
#define I2S_PLL_CLK 192000000
|
||||
#define I2S_SAMPLING_RATE 48000
|
||||
#define I2S_BITS_PER_SAMPLE 16
|
||||
#define I2S_CHANNELS 2
|
||||
#define I2S_RFS 256
|
||||
#define I2S_BFS 32
|
||||
|
||||
/* I2C values */
|
||||
#define AUDIO_I2C_BUS 1
|
||||
#define AUDIO_I2C_REG 0x1a
|
||||
|
||||
/* Audio Codec */
|
||||
#define AUDIO_CODEC "wm8994"
|
||||
|
||||
#define AUDIO_COMPAT 1
|
||||
#endif
|
||||
78
arch/arm/include/asm/arch-exynos/spi.h
Normal file
78
arch/arm/include/asm/arch-exynos/spi.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* (C) Copyright 2012 SAMSUNG Electronics
|
||||
* Padmavathi Venna <padma.v@samsung.com>
|
||||
*
|
||||
* 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 __ASM_ARCH_EXYNOS_COMMON_SPI_H_
|
||||
#define __ASM_ARCH_EXYNOS_COMMON_SPI_H_
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* SPI peripheral register map; padded to 64KB */
|
||||
struct exynos_spi {
|
||||
unsigned int ch_cfg; /* 0x00 */
|
||||
unsigned char reserved0[4];
|
||||
unsigned int mode_cfg; /* 0x08 */
|
||||
unsigned int cs_reg; /* 0x0c */
|
||||
unsigned char reserved1[4];
|
||||
unsigned int spi_sts; /* 0x14 */
|
||||
unsigned int tx_data; /* 0x18 */
|
||||
unsigned int rx_data; /* 0x1c */
|
||||
unsigned int pkt_cnt; /* 0x20 */
|
||||
unsigned char reserved2[4];
|
||||
unsigned char reserved3[4];
|
||||
unsigned int fb_clk; /* 0x2c */
|
||||
unsigned char padding[0xffd0];
|
||||
};
|
||||
|
||||
#define EXYNOS_SPI_MAX_FREQ 50000000
|
||||
|
||||
#define SPI_TIMEOUT_MS 10
|
||||
|
||||
/* SPI_CHCFG */
|
||||
#define SPI_CH_HS_EN (1 << 6)
|
||||
#define SPI_CH_RST (1 << 5)
|
||||
#define SPI_SLAVE_MODE (1 << 4)
|
||||
#define SPI_CH_CPOL_L (1 << 3)
|
||||
#define SPI_CH_CPHA_B (1 << 2)
|
||||
#define SPI_RX_CH_ON (1 << 1)
|
||||
#define SPI_TX_CH_ON (1 << 0)
|
||||
|
||||
/* SPI_MODECFG */
|
||||
#define SPI_MODE_CH_WIDTH_WORD (0x2 << 29)
|
||||
#define SPI_MODE_BUS_WIDTH_WORD (0x2 << 17)
|
||||
|
||||
/* SPI_CSREG */
|
||||
#define SPI_SLAVE_SIG_INACT (1 << 0)
|
||||
|
||||
/* SPI_STS */
|
||||
#define SPI_ST_TX_DONE (1 << 25)
|
||||
#define SPI_FIFO_LVL_MASK 0x1ff
|
||||
#define SPI_TX_LVL_OFFSET 6
|
||||
#define SPI_RX_LVL_OFFSET 15
|
||||
|
||||
/* Feedback Delay */
|
||||
#define SPI_CLK_BYPASS (0 << 0)
|
||||
#define SPI_FB_DELAY_90 (1 << 0)
|
||||
#define SPI_FB_DELAY_180 (2 << 0)
|
||||
#define SPI_FB_DELAY_270 (3 << 0)
|
||||
|
||||
/* Packet Count */
|
||||
#define SPI_PACKET_CNT_EN (1 << 16)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif
|
||||
@@ -48,4 +48,22 @@ struct s5p_sromc {
|
||||
/* Configure the Band Width and Bank Control Regs for required SROMC Bank */
|
||||
void s5p_config_sromc(u32 srom_bank, u32 srom_bw_conf, u32 srom_bc_conf);
|
||||
|
||||
enum {
|
||||
FDT_SROM_PMC,
|
||||
FDT_SROM_TACP,
|
||||
FDT_SROM_TAH,
|
||||
FDT_SROM_TCOH,
|
||||
FDT_SROM_TACC,
|
||||
FDT_SROM_TCOS,
|
||||
FDT_SROM_TACS,
|
||||
|
||||
FDT_SROM_TIMING_COUNT,
|
||||
};
|
||||
|
||||
struct fdt_sromc {
|
||||
u8 bank; /* srom bank number */
|
||||
u8 width; /* bus width in bytes */
|
||||
unsigned int timing[FDT_SROM_TIMING_COUNT]; /* timing parameters */
|
||||
};
|
||||
|
||||
#endif /* __ASM_ARCH_SROMC_H_ */
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
| (attr << 8) | (kw_winctrl_calcsize(size) << 16))
|
||||
|
||||
#define KWGBE_PORT_SERIAL_CONTROL1_REG(_x) \
|
||||
((_x ? KW_EGIGA0_BASE : KW_EGIGA1_BASE) + 0x44c)
|
||||
((_x ? KW_EGIGA1_BASE : KW_EGIGA0_BASE) + 0x44c)
|
||||
|
||||
#define KW_REG_PCIE_DEVID (KW_REG_PCIE_BASE + 0x00)
|
||||
#define KW_REG_PCIE_REVID (KW_REG_PCIE_BASE + 0x08)
|
||||
|
||||
@@ -312,6 +312,6 @@
|
||||
|
||||
#define MPP_MAX 49
|
||||
|
||||
void kirkwood_mpp_conf(u32 *mpp_list, u32 *mpp_save);
|
||||
void kirkwood_mpp_conf(const u32 *mpp_list, u32 *mpp_save);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
|
||||
#include <asm/types.h>
|
||||
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
extern void mx25_fec_init_pins(void);
|
||||
#endif
|
||||
|
||||
/* Clock Control Module (CCM) registers */
|
||||
struct ccm_regs {
|
||||
u32 mpctl; /* Core PLL Control */
|
||||
@@ -245,6 +241,7 @@ struct aips_regs {
|
||||
#define IMX_RTIC_BASE (0x53FEC000)
|
||||
#define IMX_IIM_BASE (0x53FF0000)
|
||||
#define IMX_USB_BASE (0x53FF4000)
|
||||
#define IMX_USB_PORT_OFFSET 0x200
|
||||
#define IMX_CSI_BASE (0x53FF8000)
|
||||
#define IMX_DRYICE_BASE (0x53FFC000)
|
||||
|
||||
|
||||
@@ -25,5 +25,8 @@
|
||||
#define _SYS_PROTO_H_
|
||||
|
||||
void mx25_uart1_init_pins(void);
|
||||
#if defined CONFIG_FEC_MXC
|
||||
extern void mx25_fec_init_pins(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,7 +58,5 @@ extern void mx31_set_gpr(enum iomux_gp_func gp, char en);
|
||||
void mx31_uart1_hw_init(void);
|
||||
void mx31_uart2_hw_init(void);
|
||||
void mx31_spi2_hw_init(void);
|
||||
void mxc_hw_watchdog_enable(void);
|
||||
void mxc_hw_watchdog_reset(void);
|
||||
|
||||
#endif /* __ASM_ARCH_CLOCK_H */
|
||||
|
||||
@@ -68,17 +68,6 @@ struct cspi_regs {
|
||||
u32 test;
|
||||
};
|
||||
|
||||
/* Watchdog Timer (WDOG) registers */
|
||||
#define WDOG_ENABLE (1 << 2)
|
||||
#define WDOG_WT_SHIFT 8
|
||||
#define WDOG_WDZST (1 << 0)
|
||||
|
||||
struct wdog_regs {
|
||||
u16 wcr; /* Control */
|
||||
u16 wsr; /* Service */
|
||||
u16 wrsr; /* Reset Status */
|
||||
};
|
||||
|
||||
/* IIM Control Registers */
|
||||
struct iim_regs {
|
||||
u32 iim_stat;
|
||||
@@ -687,7 +676,7 @@ struct esdc_regs {
|
||||
|
||||
#define ARM_PPMRR 0x40000015
|
||||
|
||||
#define WDOG_BASE 0x53FDC000
|
||||
#define WDOG1_BASE_ADDR 0x53FDC000
|
||||
|
||||
/*
|
||||
* GPIO
|
||||
@@ -895,32 +884,7 @@ struct esdc_regs {
|
||||
|
||||
#define MX31_AIPS1_BASE_ADDR 0x43f00000
|
||||
#define IMX_USB_BASE (MX31_AIPS1_BASE_ADDR + 0x88000)
|
||||
|
||||
/* USB portsc */
|
||||
/* values for portsc field */
|
||||
#define MXC_EHCI_PHY_LOW_POWER_SUSPEND (1 << 23)
|
||||
#define MXC_EHCI_FORCE_FS (1 << 24)
|
||||
#define MXC_EHCI_UTMI_8BIT (0 << 28)
|
||||
#define MXC_EHCI_UTMI_16BIT (1 << 28)
|
||||
#define MXC_EHCI_SERIAL (1 << 29)
|
||||
#define MXC_EHCI_MODE_UTMI (0 << 30)
|
||||
#define MXC_EHCI_MODE_PHILIPS (1 << 30)
|
||||
#define MXC_EHCI_MODE_ULPI (2 << 30)
|
||||
#define MXC_EHCI_MODE_SERIAL (3 << 30)
|
||||
|
||||
/* values for flags field */
|
||||
#define MXC_EHCI_INTERFACE_DIFF_UNI (0 << 0)
|
||||
#define MXC_EHCI_INTERFACE_DIFF_BI (1 << 0)
|
||||
#define MXC_EHCI_INTERFACE_SINGLE_UNI (2 << 0)
|
||||
#define MXC_EHCI_INTERFACE_SINGLE_BI (3 << 0)
|
||||
#define MXC_EHCI_INTERFACE_MASK (0xf)
|
||||
|
||||
#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5)
|
||||
#define MXC_EHCI_TTL_ENABLED (1 << 6)
|
||||
|
||||
#define MXC_EHCI_INTERNAL_PHY (1 << 7)
|
||||
#define MXC_EHCI_IPPUE_DOWN (1 << 8)
|
||||
#define MXC_EHCI_IPPUE_UP (1 << 9)
|
||||
#define IMX_USB_PORT_OFFSET 0x200
|
||||
|
||||
/*
|
||||
* CSPI register definitions
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#define IRAM_BASE_ADDR 0x10000000 /* internal ram */
|
||||
#define IRAM_SIZE 0x00020000 /* 128 KB */
|
||||
|
||||
#define LOW_LEVEL_SRAM_STACK 0x1001E000
|
||||
|
||||
/*
|
||||
* AIPS 1
|
||||
*/
|
||||
@@ -78,10 +80,12 @@
|
||||
#define GPIO2_BASE_ADDR 0x53FD0000
|
||||
#define SDMA_BASE_ADDR 0x53FD4000
|
||||
#define RTC_BASE_ADDR 0x53FD8000
|
||||
#define WDOG_BASE_ADDR 0x53FDC000
|
||||
#define WDOG1_BASE_ADDR 0x53FDC000
|
||||
#define PWM_BASE_ADDR 0x53FE0000
|
||||
#define RTIC_BASE_ADDR 0x53FEC000
|
||||
#define IIM_BASE_ADDR 0x53FF0000
|
||||
#define IMX_USB_BASE 0x53FF4000
|
||||
#define IMX_USB_PORT_OFFSET 0x400
|
||||
|
||||
#define IMX_CCM_BASE CCM_BASE_ADDR
|
||||
|
||||
@@ -288,15 +292,6 @@ struct cspi_regs {
|
||||
u32 test;
|
||||
};
|
||||
|
||||
/* Watchdog Timer (WDOG) registers */
|
||||
struct wdog_regs {
|
||||
u16 wcr; /* Control */
|
||||
u16 wsr; /* Service */
|
||||
u16 wrsr; /* Reset Status */
|
||||
u16 wicr; /* Interrupt Control */
|
||||
u16 wmcr; /* Misc Control */
|
||||
};
|
||||
|
||||
struct esdc_regs {
|
||||
u32 esdctl0;
|
||||
u32 esdcfg0;
|
||||
|
||||
31
arch/arm/include/asm/arch-mx35/mmc_host_def.h
Normal file
31
arch/arm/include/asm/arch-mx35/mmc_host_def.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* (C) Copyright 2008
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Syed Mohammed Khasim <khasim@ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation's version 2 of
|
||||
* the License.
|
||||
*
|
||||
* 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 MMC_HOST_DEF_H
|
||||
#define MMC_HOST_DEF_H
|
||||
|
||||
/* Driver definitions */
|
||||
#define MMCSD_SECTOR_SIZE 512
|
||||
|
||||
#endif /* MMC_HOST_DEF_H */
|
||||
38
arch/arm/include/asm/arch-mx35/spl.h
Normal file
38
arch/arm/include/asm/arch-mx35/spl.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* (C) Copyright 2012
|
||||
* Texas Instruments, <www.ti.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
|
||||
#define BOOT_DEVICE_NONE 0
|
||||
#define BOOT_DEVICE_XIP 1
|
||||
#define BOOT_DEVICE_XIPWAIT 2
|
||||
#define BOOT_DEVICE_NAND 3
|
||||
#define BOOT_DEVICE_ONE_NAND 4
|
||||
#define BOOT_DEVICE_MMC1 5
|
||||
#define BOOT_DEVICE_MMC2 6
|
||||
#define BOOT_DEVICE_MMC2_2 7
|
||||
#define BOOT_DEVICE_NOR 8
|
||||
#define BOOT_DEVICE_I2C 9
|
||||
#define BOOT_DEVICE_SPI 10
|
||||
|
||||
#endif
|
||||
@@ -25,6 +25,8 @@
|
||||
#define _SYS_PROTO_H_
|
||||
|
||||
u32 get_cpu_rev(void);
|
||||
void mx3_setup_sdram_bank(u32 start_address, u32 ddr2_config,
|
||||
u32 row, u32 col, u32 dsize, u32 refresh);
|
||||
#define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -218,16 +218,6 @@
|
||||
*/
|
||||
#define WBED 1
|
||||
|
||||
/*
|
||||
* WEIM WCR
|
||||
*/
|
||||
#define BCM 1
|
||||
#define GBCD(x) (((x) & 0x3) << 1)
|
||||
#define INTEN (1 << 4)
|
||||
#define INTPOL (1 << 5)
|
||||
#define WDOG_EN (1 << 8)
|
||||
#define WDOG_LIMIT(x) (((x) & 0x3) << 9)
|
||||
|
||||
#define CS0_128 0
|
||||
#define CS0_64M_CS1_64M 1
|
||||
#define CS0_64M_CS1_32M_CS2_32M 2
|
||||
|
||||
@@ -802,22 +802,22 @@ typedef enum iomux_input_select {
|
||||
MX53_CSPI_IPP_CSPI_CLK_IN_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_MISO_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_MOSI_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_SS_B_0_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_SS_B_1_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_SS_B_2_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_SS_B_3_SELECT_INPUT,
|
||||
MX53_CSPI_IPP_IND_SS_B_4_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_CSPI_CLK_IN_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_MISO_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_MOSI_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_SS_B_0_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_SS_B_1_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_SS_B_2_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_SS_B_3_SELECT_INPUT,
|
||||
MX53_ECSPI1_IPP_IND_SS_B_4_SELECT_INPUT,
|
||||
MX53_ECSPI2_IPP_CSPI_CLK_IN_SELECT_INPUT,
|
||||
MX53_ECSPI2_IPP_IND_MISO_SELECT_INPUT,
|
||||
MX53_ECSPI2_IPP_IND_MOSI_SELECT_INPUT,
|
||||
MX53_ECSPI2_IPP_IND_SS_B_0_SELECT_INPUT,
|
||||
MX53_ECSPI2_IPP_IND_SS_B_1_SELECT_INPUT,
|
||||
MX53_ECSPI2_IPP_IND_SS_B_2_SELECT_INPUT,
|
||||
MX53_ESAI1_IPP_IND_FSR_SELECT_INPUT,
|
||||
MX53_ESAI1_IPP_IND_FST_SELECT_INPUT,
|
||||
MX53_ESAI1_IPP_IND_HCKR_SELECT_INPUT,
|
||||
|
||||
@@ -24,8 +24,16 @@
|
||||
#ifndef _SYS_PROTO_H_
|
||||
#define _SYS_PROTO_H_
|
||||
|
||||
u32 get_cpu_rev(void);
|
||||
#define MXC_CPU_MX51 0x51
|
||||
#define MXC_CPU_MX53 0x53
|
||||
#define MXC_CPU_MX6SL 0x60
|
||||
#define MXC_CPU_MX6DL 0x61
|
||||
#define MXC_CPU_MX6SOLO 0x62
|
||||
#define MXC_CPU_MX6Q 0x63
|
||||
|
||||
#define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev)
|
||||
u32 get_cpu_rev(void);
|
||||
unsigned imx_ddr_size(void);
|
||||
void sdelay(unsigned long);
|
||||
void set_chipselect_size(int const);
|
||||
|
||||
|
||||
@@ -564,6 +564,8 @@ struct anatop_regs {
|
||||
u32 usb2_misc_clr; /* 0x258 */
|
||||
u32 usb2_misc_tog; /* 0x25c */
|
||||
u32 digprog; /* 0x260 */
|
||||
u32 reserved1[7];
|
||||
u32 digprog_sololite; /* 0x280 */
|
||||
};
|
||||
|
||||
#define ANATOP_PFD_480_PFD0_FRAC_SHIFT 0
|
||||
|
||||
149
arch/arm/include/asm/arch-mx6/mx6dl_pins.h
Normal file
149
arch/arm/include/asm/arch-mx6/mx6dl_pins.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*
|
||||
* 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.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MX6_MX6DL_PINS_H__
|
||||
#define __ASM_ARCH_MX6_MX6DL_PINS_H__
|
||||
|
||||
#include <asm/imx-common/iomux-v3.h>
|
||||
|
||||
/* Use to set PAD control */
|
||||
#define PAD_CTL_HYS (1 << 16)
|
||||
#define PAD_CTL_PUS_100K_DOWN (0 << 14)
|
||||
#define PAD_CTL_PUS_47K_UP (1 << 14)
|
||||
#define PAD_CTL_PUS_100K_UP (2 << 14)
|
||||
#define PAD_CTL_PUS_22K_UP (3 << 14)
|
||||
|
||||
#define PAD_CTL_PUE (1 << 13)
|
||||
#define PAD_CTL_PKE (1 << 12)
|
||||
#define PAD_CTL_ODE (1 << 11)
|
||||
#define PAD_CTL_SPEED_LOW (1 << 6)
|
||||
#define PAD_CTL_SPEED_MED (2 << 6)
|
||||
#define PAD_CTL_SPEED_HIGH (3 << 6)
|
||||
#define PAD_CTL_DSE_DISABLE (0 << 3)
|
||||
#define PAD_CTL_DSE_240ohm (1 << 3)
|
||||
#define PAD_CTL_DSE_120ohm (2 << 3)
|
||||
#define PAD_CTL_DSE_80ohm (3 << 3)
|
||||
#define PAD_CTL_DSE_60ohm (4 << 3)
|
||||
#define PAD_CTL_DSE_48ohm (5 << 3)
|
||||
#define PAD_CTL_DSE_40ohm (6 << 3)
|
||||
#define PAD_CTL_DSE_34ohm (7 << 3)
|
||||
#define PAD_CTL_SRE_FAST (1 << 0)
|
||||
#define PAD_CTL_SRE_SLOW (0 << 0)
|
||||
|
||||
#define IOMUX_CONFIG_SION 0x10
|
||||
#define NO_MUX_I 0
|
||||
#define NO_PAD_I 0
|
||||
enum {
|
||||
MX6DL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK = IOMUX_PAD(0x03B0, 0x009C, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DI0_PIN15__IPU1_DI0_PIN15 = IOMUX_PAD(0x03B4, 0x00A0, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DI0_PIN2__IPU1_DI0_PIN2 = IOMUX_PAD(0x03B8, 0x00A4, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DI0_PIN3__IPU1_DI0_PIN3 = IOMUX_PAD(0x03BC, 0x00A8, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DI0_PIN4__GPIO_4_20 = IOMUX_PAD(0x03C0, 0x00AC, 5, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT0__IPU1_DISP0_DAT_0 = IOMUX_PAD(0x03C4, 0x00B0, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT1__IPU1_DISP0_DAT_1 = IOMUX_PAD(0x03C8, 0x00B4, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT10__IPU1_DISP0_DAT_10 = IOMUX_PAD(0x03CC, 0x00B8, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT11__IPU1_DISP0_DAT_11 = IOMUX_PAD(0x03D0, 0x00BC, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT12__IPU1_DISP0_DAT_12 = IOMUX_PAD(0x03D4, 0x00C0, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT13__IPU1_DISP0_DAT_13 = IOMUX_PAD(0x03D8, 0x00C4, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT14__IPU1_DISP0_DAT_14 = IOMUX_PAD(0x03DC, 0x00C8, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT15__IPU1_DISP0_DAT_15 = IOMUX_PAD(0x03E0, 0x00CC, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT16__IPU1_DISP0_DAT_16 = IOMUX_PAD(0x03E4, 0x00D0, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT17__IPU1_DISP0_DAT_17 = IOMUX_PAD(0x03E8, 0x00D4, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT18__IPU1_DISP0_DAT_18 = IOMUX_PAD(0x03EC, 0x00D8, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT19__IPU1_DISP0_DAT_19 = IOMUX_PAD(0x03F0, 0x00DC, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT2__IPU1_DISP0_DAT_2 = IOMUX_PAD(0x03F4, 0x00E0, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT20__IPU1_DISP0_DAT_20 = IOMUX_PAD(0x03F8, 0x00E4, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT21__IPU1_DISP0_DAT_21 = IOMUX_PAD(0x03FC, 0x00E8, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT22__IPU1_DISP0_DAT_22 = IOMUX_PAD(0x0400, 0x00EC, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT23__IPU1_DISP0_DAT_23 = IOMUX_PAD(0x0404, 0x00F0, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT3__IPU1_DISP0_DAT_3 = IOMUX_PAD(0x0408, 0x00F4, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT4__IPU1_DISP0_DAT_4 = IOMUX_PAD(0x040C, 0x00F8, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT5__IPU1_DISP0_DAT_5 = IOMUX_PAD(0x0410, 0x00FC, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT6__IPU1_DISP0_DAT_6 = IOMUX_PAD(0x0414, 0x0100, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT7__IPU1_DISP0_DAT_7 = IOMUX_PAD(0x0418, 0x0104, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT8__IPU1_DISP0_DAT_8 = IOMUX_PAD(0x041C, 0x0108, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_DISP0_DAT9__IPU1_DISP0_DAT_9 = IOMUX_PAD(0x0420, 0x010C, 0, 0x0000, 0, PAD_CTL_DSE_120ohm),
|
||||
MX6DL_PAD_EIM_D16__ECSPI1_SCLK = IOMUX_PAD(0x0514, 0x0144, 1, 0x07D8, 2, 0),
|
||||
MX6DL_PAD_EIM_D17__ECSPI1_MISO = IOMUX_PAD(0x0518, 0x0148, 1, 0x07DC, 2, 0),
|
||||
MX6DL_PAD_EIM_D18__ECSPI1_MOSI = IOMUX_PAD(0x051C, 0x014C, 1, 0x07E0, 2, 0),
|
||||
MX6DL_PAD_EIM_D19__GPIO_3_19 = IOMUX_PAD(0x0520, 0x0150, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_EIM_D21__GPIO_3_21 = IOMUX_PAD(0x0528, 0x0158, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_EIM_D21__I2C1_SCL = IOMUX_PAD(0x0528, 0x0158, 6 | IOMUX_CONFIG_SION, 0x0868, 1, 0),
|
||||
MX6DL_PAD_EIM_D23__GPIO_3_23 = IOMUX_PAD(0x0530, 0x0160, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_EIM_D26__UART2_TXD = IOMUX_PAD(0x053C, 0x016C, 4, 0x0000, 0, 0),
|
||||
MX6DL_PAD_EIM_D27__UART2_RXD = IOMUX_PAD(0x0540, 0x0170, 4, 0x0904, 1, 0),
|
||||
MX6DL_PAD_EIM_D28__I2C1_SDA = IOMUX_PAD(0x0544, 0x0174, 1 | IOMUX_CONFIG_SION, 0x086C, 1, 0),
|
||||
MX6DL_PAD_EIM_D28__GPIO_3_28 = IOMUX_PAD(0x0544, 0x0174, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_ENET_MDC__ENET_MDC = IOMUX_PAD(0x05B8, 0x01E8, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_ENET_MDIO__ENET_MDIO = IOMUX_PAD(0x05BC, 0x01EC, 1, 0x0810, 0, 0),
|
||||
MX6DL_PAD_ENET_REF_CLK__ENET_TX_CLK = IOMUX_PAD(0x05C0, 0x01F0, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_ENET_RXD0__GPIO_1_27 = IOMUX_PAD(0x05C8, 0x01F8, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_GPIO_16__GPIO_7_11 = IOMUX_PAD(0x05E4, 0x0214, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_GPIO_16__I2C3_SDA = IOMUX_PAD(0x05E4, 0x0214, 6 | IOMUX_CONFIG_SION, 0x087C, 1, 0),
|
||||
MX6DL_PAD_GPIO_17__GPIO_7_12 = IOMUX_PAD(0x05E8, 0x0218, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_GPIO_18__GPIO_7_13 = IOMUX_PAD(0x05EC, 0x021C, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_GPIO_19__GPIO_4_5 = IOMUX_PAD(0x05F0, 0x0220, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_GPIO_5__GPIO_1_5 = IOMUX_PAD(0x0600, 0x0230, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_GPIO_5__I2C3_SCL = IOMUX_PAD(0x0600, 0x0230, 6 | IOMUX_CONFIG_SION, 0x0878, 2, 0),
|
||||
MX6DL_PAD_KEY_COL3__I2C2_SCL = IOMUX_PAD(0x0638, 0x0250, 4 | IOMUX_CONFIG_SION, 0x0870, 1, 0),
|
||||
MX6DL_PAD_KEY_COL3__GPIO_4_12 = IOMUX_PAD(0x0638, 0x0250, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_KEY_ROW3__I2C2_SDA = IOMUX_PAD(0x064C, 0x0264, 4 | IOMUX_CONFIG_SION, 0x0874, 1, 0),
|
||||
MX6DL_PAD_KEY_ROW3__GPIO_4_13 = IOMUX_PAD(0x064C, 0x0264, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_NANDF_D1__GPIO_2_1 = IOMUX_PAD(0x0670, 0x0288, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_NANDF_D2__GPIO_2_2 = IOMUX_PAD(0x0674, 0x028C, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_NANDF_D3__GPIO_2_3 = IOMUX_PAD(0x0678, 0x0290, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_NANDF_D4__GPIO_2_4 = IOMUX_PAD(0x067C, 0x0294, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_NANDF_D6__GPIO_2_6 = IOMUX_PAD(0x0684, 0x029C, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_RD0__ENET_RGMII_RD0 = IOMUX_PAD(0x0694, 0x02AC, 1, 0x0818, 1, 0),
|
||||
MX6DL_PAD_RGMII_RD0__GPIO_6_25 = IOMUX_PAD(0x0694, 0x02AC, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_RD1__ENET_RGMII_RD1 = IOMUX_PAD(0x0698, 0x02B0, 1, 0x081C, 1, 0),
|
||||
MX6DL_PAD_RGMII_RD1__GPIO_6_27 = IOMUX_PAD(0x0698, 0x02B0, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_RD2__ENET_RGMII_RD2 = IOMUX_PAD(0x069C, 0x02B4, 1, 0x0820, 1, 0),
|
||||
MX6DL_PAD_RGMII_RD2__GPIO_6_28 = IOMUX_PAD(0x069C, 0x02B4, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_RD3__ENET_RGMII_RD3 = IOMUX_PAD(0x06A0, 0x02B8, 1, 0x0824, 1, 0),
|
||||
MX6DL_PAD_RGMII_RD3__GPIO_6_29 = IOMUX_PAD(0x06A0, 0x02B8, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_RX_CTL__RGMII_RX_CTL = IOMUX_PAD(0x06A4, 0x02BC, 1, 0x0828, 1, 0),
|
||||
MX6DL_PAD_RGMII_RX_CTL__GPIO_6_24 = IOMUX_PAD(0x06A4, 0x02BC, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_RXC__ENET_RGMII_RXC = IOMUX_PAD(0x06A8, 0x02C0, 1, 0x0814, 1, 0),
|
||||
MX6DL_PAD_RGMII_RXC__GPIO_6_30 = IOMUX_PAD(0x06A8, 0x02C0, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_TD0__ENET_RGMII_TD0 = IOMUX_PAD(0x06AC, 0x02C4, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_TD1__ENET_RGMII_TD1 = IOMUX_PAD(0x06B0, 0x02C8, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_TD2__ENET_RGMII_TD2 = IOMUX_PAD(0x06B4, 0x02CC, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_TD3__ENET_RGMII_TD3 = IOMUX_PAD(0x06B8, 0x02D0, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_TX_CTL__RGMII_TX_CTL = IOMUX_PAD(0x06BC, 0x02D4, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_RGMII_TXC__ENET_RGMII_TXC = IOMUX_PAD(0x06C0, 0x02D8, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD1_CMD__GPIO_1_18 = IOMUX_PAD(0x06C8, 0x02E0, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD1_DAT3__GPIO_1_21 = IOMUX_PAD(0x06D8, 0x02F0, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_CLK__USDHC3_CLK = IOMUX_PAD(0x06F4, 0x030C, 0, 0x0934, 1, 0),
|
||||
MX6DL_PAD_SD3_CMD__USDHC3_CMD = IOMUX_PAD(0x06F8, 0x0310, 0 | IOMUX_CONFIG_SION, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_DAT0__USDHC3_DAT0 = IOMUX_PAD(0x06FC, 0x0314, 0, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_DAT1__USDHC3_DAT1 = IOMUX_PAD(0x0700, 0x0318, 0, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_DAT2__USDHC3_DAT2 = IOMUX_PAD(0x0704, 0x031C, 0, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_DAT3__USDHC3_DAT3 = IOMUX_PAD(0x0708, 0x0320, 0, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_DAT5__GPIO_7_0 = IOMUX_PAD(0x0710, 0x0328, 5, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD3_DAT6__UART1_RXD = IOMUX_PAD(0x0714, 0x032C, 1, 0x08FC, 2, 0),
|
||||
MX6DL_PAD_SD3_DAT7__UART1_TXD = IOMUX_PAD(0x0718, 0x0330, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD4_CLK__USDHC4_CLK = IOMUX_PAD(0x0720, 0x0338, 0, 0x0938, 1, 0),
|
||||
MX6DL_PAD_SD4_CMD__USDHC4_CMD = IOMUX_PAD(0x0724, 0x033C, 0 | IOMUX_CONFIG_SION, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD4_DAT0__USDHC4_DAT0 = IOMUX_PAD(0x0728, 0x0340, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD4_DAT1__USDHC4_DAT1 = IOMUX_PAD(0x072C, 0x0344, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD4_DAT2__USDHC4_DAT2 = IOMUX_PAD(0x0730, 0x0348, 1, 0x0000, 0, 0),
|
||||
MX6DL_PAD_SD4_DAT3__USDHC4_DAT3 = IOMUX_PAD(0x0734, 0x034C, 1, 0x0000, 0, 0),
|
||||
};
|
||||
#endif /* __ASM_ARCH_MX6_MX6DL_PINS_H__ */
|
||||
@@ -24,9 +24,17 @@
|
||||
#ifndef _SYS_PROTO_H_
|
||||
#define _SYS_PROTO_H_
|
||||
|
||||
#define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev)
|
||||
#define MXC_CPU_MX51 0x51
|
||||
#define MXC_CPU_MX53 0x53
|
||||
#define MXC_CPU_MX6SL 0x60
|
||||
#define MXC_CPU_MX6DL 0x61
|
||||
#define MXC_CPU_MX6SOLO 0x62
|
||||
#define MXC_CPU_MX6Q 0x63
|
||||
|
||||
#define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev)
|
||||
u32 get_cpu_rev(void);
|
||||
const char *get_imx_type(u32 imxtype);
|
||||
unsigned imx_ddr_size(void);
|
||||
|
||||
void set_vddsoc(u32 mv);
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <asm/arch/regs-apbh.h>
|
||||
#include <asm/arch/regs-base.h>
|
||||
#include <asm/arch/regs-bch.h>
|
||||
#include <asm/arch/regs-clkctrl-mx28.h>
|
||||
#include <asm/arch/regs-digctl.h>
|
||||
#include <asm/arch/regs-gpmi.h>
|
||||
#include <asm/arch/regs-i2c.h>
|
||||
@@ -34,9 +33,13 @@
|
||||
#include <asm/arch/regs-lradc.h>
|
||||
#include <asm/arch/regs-ocotp.h>
|
||||
#include <asm/arch/regs-pinctrl.h>
|
||||
#include <asm/arch/regs-power.h>
|
||||
#include <asm/arch/regs-rtc.h>
|
||||
#include <asm/arch/regs-ssp.h>
|
||||
#include <asm/arch/regs-timrot.h>
|
||||
|
||||
#ifdef CONFIG_MX28
|
||||
#include <asm/arch/regs-clkctrl-mx28.h>
|
||||
#include <asm/arch/regs-power-mx28.h>
|
||||
#endif
|
||||
|
||||
#endif /* __IMX_REGS_H__ */
|
||||
|
||||
@@ -31,9 +31,11 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
struct mxs_clkctrl_regs {
|
||||
mxs_reg_32(hw_clkctrl_pll0ctrl0) /* 0x00 */
|
||||
mxs_reg_32(hw_clkctrl_pll0ctrl1) /* 0x10 */
|
||||
uint32_t hw_clkctrl_pll0ctrl1; /* 0x10 */
|
||||
uint32_t reserved_pll0ctrl1[3]; /* 0x14-0x1c */
|
||||
mxs_reg_32(hw_clkctrl_pll1ctrl0) /* 0x20 */
|
||||
mxs_reg_32(hw_clkctrl_pll1ctrl1) /* 0x30 */
|
||||
uint32_t hw_clkctrl_pll1ctrl1; /* 0x30 */
|
||||
uint32_t reserved_pll1ctrl1[3]; /* 0x34-0x3c */
|
||||
mxs_reg_32(hw_clkctrl_pll2ctrl0) /* 0x40 */
|
||||
mxs_reg_32(hw_clkctrl_cpu) /* 0x50 */
|
||||
mxs_reg_32(hw_clkctrl_hbus) /* 0x60 */
|
||||
|
||||
@@ -128,7 +128,7 @@ struct mxs_power_regs {
|
||||
#define POWER_MINPWR_PWD_ANA_CMPS (1 << 10)
|
||||
#define POWER_MINPWR_ENABLE_OSC (1 << 9)
|
||||
#define POWER_MINPWR_SELECT_OSC (1 << 8)
|
||||
#define POWER_MINPWR_FBG_OFF (1 << 7)
|
||||
#define POWER_MINPWR_VBG_OFF (1 << 7)
|
||||
#define POWER_MINPWR_DOUBLE_FETS (1 << 6)
|
||||
#define POWER_MINPWR_HALFFETS (1 << 5)
|
||||
#define POWER_MINPWR_LESSANA_I (1 << 4)
|
||||
@@ -268,7 +268,7 @@ struct mxs_power_regs {
|
||||
#define POWER_DCLIMITS_POSLIMIT_BUCK_MASK (0x7f << 8)
|
||||
#define POWER_DCLIMITS_POSLIMIT_BUCK_OFFSET 8
|
||||
#define POWER_DCLIMITS_NEGLIMIT_MASK 0x7f
|
||||
#define POWER_DCLIMITS_NETLIMIT_OFFSET 0
|
||||
#define POWER_DCLIMITS_NEGLIMIT_OFFSET 0
|
||||
|
||||
#define POWER_LOOPCTRL_TOGGLE_DIF (1 << 20)
|
||||
#define POWER_LOOPCTRL_HYST_SIGN (1 << 19)
|
||||
@@ -32,6 +32,15 @@ struct emu_hal_params {
|
||||
u32 param1;
|
||||
};
|
||||
|
||||
/* Board SDRC timing values */
|
||||
struct board_sdrc_timings {
|
||||
u32 mcfg;
|
||||
u32 ctrla;
|
||||
u32 ctrlb;
|
||||
u32 rfr_ctrl;
|
||||
u32 mr;
|
||||
};
|
||||
|
||||
void prcm_init(void);
|
||||
void per_clocks_enable(void);
|
||||
void ehci_clocks_enable(void);
|
||||
@@ -39,8 +48,8 @@ void ehci_clocks_enable(void);
|
||||
void memif_init(void);
|
||||
void sdrc_init(void);
|
||||
void do_sdrc_init(u32, u32);
|
||||
void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
|
||||
u32 *mr);
|
||||
|
||||
void get_board_mem_timings(struct board_sdrc_timings *timings);
|
||||
void identify_nand_chip(int *mfr, int *id);
|
||||
void emif4_init(void);
|
||||
void gpmc_init(void);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user