mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
617 Commits
v2014.04
...
v2014.07-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0116f40bbc | ||
|
|
54c5d08a09 | ||
|
|
9665fa8f9e | ||
|
|
33144ea443 | ||
|
|
39338a30fa | ||
|
|
1c8c36f571 | ||
|
|
a9375f3328 | ||
|
|
076446f106 | ||
|
|
21254713d3 | ||
|
|
d7630da6f4 | ||
|
|
d14c6335bc | ||
|
|
ffe1691159 | ||
|
|
939911a64b | ||
|
|
d3f041c0c4 | ||
|
|
02847fcc92 | ||
|
|
9fcf3d3a1d | ||
|
|
4d6bf5542e | ||
|
|
8b0d1bbc7e | ||
|
|
ee77a2389b | ||
|
|
a0a37183bd | ||
|
|
e75e73dd5f | ||
|
|
1dd6e3c2dd | ||
|
|
c9d7519275 | ||
|
|
3eb5e19863 | ||
|
|
c534d2fdcf | ||
|
|
cd324a6dd2 | ||
|
|
e4426d07b6 | ||
|
|
29cc1d8e26 | ||
|
|
3c92c3232c | ||
|
|
ea5940e9d2 | ||
|
|
be4cc457b5 | ||
|
|
06ae2b0ce8 | ||
|
|
bcb2cf1b5a | ||
|
|
e5c809d785 | ||
|
|
dbba3daf9e | ||
|
|
0b3fde1136 | ||
|
|
10dc77716f | ||
|
|
638b3e8342 | ||
|
|
df348d8245 | ||
|
|
d235628434 | ||
|
|
336b6f9048 | ||
|
|
8210a343cd | ||
|
|
1fd93c6e7d | ||
|
|
a5dffa4b67 | ||
|
|
91fdabc67a | ||
|
|
6b2221b008 | ||
|
|
d803fea576 | ||
|
|
46c8ebc8cd | ||
|
|
4d16f67e7b | ||
|
|
f6ed9d5094 | ||
|
|
8e38128596 | ||
|
|
c9afa7cea8 | ||
|
|
716897760f | ||
|
|
358d6ef32e | ||
|
|
71bb8c39e1 | ||
|
|
3f5f17a38f | ||
|
|
dbfd1159ab | ||
|
|
dd73018b16 | ||
|
|
b6c96f7f35 | ||
|
|
d80149b249 | ||
|
|
f55bb6a4c4 | ||
|
|
5c4bb96e9c | ||
|
|
fd77b2ebec | ||
|
|
aa44ae32e1 | ||
|
|
7880356b89 | ||
|
|
f2c51fdc93 | ||
|
|
7f922e32ff | ||
|
|
05aad15bba | ||
|
|
b923d4615f | ||
|
|
e1ee37472b | ||
|
|
a6318a8c61 | ||
|
|
577d07ac9d | ||
|
|
e6f2c20689 | ||
|
|
1a897668ac | ||
|
|
26ea9ce5b8 | ||
|
|
5b815c9c61 | ||
|
|
67193864bc | ||
|
|
7a78bd2679 | ||
|
|
64e809afea | ||
|
|
d0db28f940 | ||
|
|
05d134b084 | ||
|
|
6130c14605 | ||
|
|
d7782d0653 | ||
|
|
e4911815cf | ||
|
|
3246584d19 | ||
|
|
bc2d40ca10 | ||
|
|
3051f3f999 | ||
|
|
80ba6a6f2a | ||
|
|
15231f6dd1 | ||
|
|
9c3fdd883a | ||
|
|
1a344456a9 | ||
|
|
f1a96ec1a9 | ||
|
|
0f1fa36fff | ||
|
|
477c894ff4 | ||
|
|
ffc8667acf | ||
|
|
a26acb7dc9 | ||
|
|
6be6b6bcba | ||
|
|
2dabac1337 | ||
|
|
c6eb9458e8 | ||
|
|
6a2f30a03a | ||
|
|
a90bed77a6 | ||
|
|
44cfc3a83f | ||
|
|
9f5f51540d | ||
|
|
41623c91b0 | ||
|
|
60a4f39fcd | ||
|
|
23ff29bc17 | ||
|
|
cd6cc3440f | ||
|
|
b4ee1491b9 | ||
|
|
9f9d41bad1 | ||
|
|
7d34c5de72 | ||
|
|
580a54c5d4 | ||
|
|
0dfbcf02de | ||
|
|
2405d09c4c | ||
|
|
e7f9350525 | ||
|
|
50c8d66d33 | ||
|
|
c8151b4a5d | ||
|
|
584b55b072 | ||
|
|
1aa4bdc82d | ||
|
|
8630c1c7e3 | ||
|
|
a4539a2aa7 | ||
|
|
2d34151f75 | ||
|
|
9b20fe6f1a | ||
|
|
4180b3dba2 | ||
|
|
2072e72629 | ||
|
|
fab356a0b8 | ||
|
|
66e6715c5f | ||
|
|
f05862d7bd | ||
|
|
841426ad9f | ||
|
|
2e38a90672 | ||
|
|
47b35a516b | ||
|
|
00cf6b4e22 | ||
|
|
c6024c8edd | ||
|
|
eb8c54bfaa | ||
|
|
3cc3fa8672 | ||
|
|
3d456eec43 | ||
|
|
0b680206cc | ||
|
|
dc4a1a2729 | ||
|
|
2da7a745b6 | ||
|
|
6e04769caf | ||
|
|
1540fb725b | ||
|
|
10fa49f428 | ||
|
|
96a2859e54 | ||
|
|
5b73caffeb | ||
|
|
ec9638659f | ||
|
|
3b5b599f17 | ||
|
|
97eeae1a07 | ||
|
|
2d92ba8440 | ||
|
|
532d531828 | ||
|
|
f04776b6d8 | ||
|
|
820969f370 | ||
|
|
4fa2427c5d | ||
|
|
3d47ffb993 | ||
|
|
d57b649e6c | ||
|
|
35fe1cb0c1 | ||
|
|
4b5d383924 | ||
|
|
66c45faefb | ||
|
|
84112b5171 | ||
|
|
111c8e4093 | ||
|
|
823b2c4ce4 | ||
|
|
9fc2ed40cd | ||
|
|
4b97bcbe20 | ||
|
|
0eaf416eea | ||
|
|
557a331908 | ||
|
|
2364e151e4 | ||
|
|
3365479ce7 | ||
|
|
2eba87a30a | ||
|
|
4ff213b8e4 | ||
|
|
9348532f51 | ||
|
|
bb14469ae0 | ||
|
|
eceb3f26f4 | ||
|
|
4a68d3431a | ||
|
|
48ec7a9468 | ||
|
|
f175603f7c | ||
|
|
8ad5d45e00 | ||
|
|
15672c6dbd | ||
|
|
8bae330f5c | ||
|
|
701e640145 | ||
|
|
bffac7aef5 | ||
|
|
73a56b6e9f | ||
|
|
18025756b5 | ||
|
|
ca721fb292 | ||
|
|
eab3bfbcd1 | ||
|
|
f13c9156a9 | ||
|
|
a6c46b994d | ||
|
|
b539534d12 | ||
|
|
522641a788 | ||
|
|
2846c43e2d | ||
|
|
e20c822d0e | ||
|
|
af47faf650 | ||
|
|
848b31ab0f | ||
|
|
18794944c6 | ||
|
|
4921a149e1 | ||
|
|
a53e65d053 | ||
|
|
5122dfae5d | ||
|
|
c665c473b6 | ||
|
|
3a7ed5aa23 | ||
|
|
e47c2a6851 | ||
|
|
4067815998 | ||
|
|
0b2e13d9cc | ||
|
|
652e29b4a0 | ||
|
|
4150f24290 | ||
|
|
27b4e4b991 | ||
|
|
e7d4a88e69 | ||
|
|
3108185985 | ||
|
|
a0735a34f8 | ||
|
|
42a74a08eb | ||
|
|
14cfc4f373 | ||
|
|
2df9d5c431 | ||
|
|
f8c1be9816 | ||
|
|
d9071ce0a8 | ||
|
|
2a6e3869f2 | ||
|
|
b625b9aef3 | ||
|
|
9b97b727dc | ||
|
|
f6ae1ca058 | ||
|
|
bfbc47cc9f | ||
|
|
e6fe968b82 | ||
|
|
69c0d323e3 | ||
|
|
15e82e5309 | ||
|
|
1b37fa832a | ||
|
|
dd6d7967df | ||
|
|
2e98f70882 | ||
|
|
06118973ed | ||
|
|
8b454eeeea | ||
|
|
35dd055b94 | ||
|
|
ae95fad5af | ||
|
|
fa39ffe5d6 | ||
|
|
2a1680e30e | ||
|
|
7e18a1b958 | ||
|
|
717ccc1d7f | ||
|
|
cd834a053b | ||
|
|
e7afb73b50 | ||
|
|
488c47a141 | ||
|
|
6f2ed0e9fa | ||
|
|
5c50a92bbe | ||
|
|
bf69d66423 | ||
|
|
bafd67d3d0 | ||
|
|
96ee97a17b | ||
|
|
822ef00e98 | ||
|
|
65bb6d8dee | ||
|
|
9995d8c8dc | ||
|
|
c42f56d96d | ||
|
|
da384a9d76 | ||
|
|
c85bb5a01a | ||
|
|
1d64377177 | ||
|
|
597fe041a8 | ||
|
|
02aa4c5388 | ||
|
|
d57dee5787 | ||
|
|
8abd053cf0 | ||
|
|
8e2615752e | ||
|
|
3e41c54ad8 | ||
|
|
f4617ef86d | ||
|
|
097c5de5f4 | ||
|
|
258060905e | ||
|
|
102061bd8b | ||
|
|
757f64a89b | ||
|
|
75b3c3aa84 | ||
|
|
ad0e463954 | ||
|
|
1992dbfdb9 | ||
|
|
fd37dac9eb | ||
|
|
bcb879c0e3 | ||
|
|
146b468eb0 | ||
|
|
0ef797a59e | ||
|
|
8bc7c48749 | ||
|
|
7a278f9f1b | ||
|
|
effb7dc6d9 | ||
|
|
483a435d93 | ||
|
|
d1dacf7766 | ||
|
|
bf0adb861e | ||
|
|
98d2cffd23 | ||
|
|
234d89dac6 | ||
|
|
5e2f01772a | ||
|
|
17449272a0 | ||
|
|
93a6d92cfa | ||
|
|
d2a3e91139 | ||
|
|
4148b3d0dd | ||
|
|
1c1c7506de | ||
|
|
0986546582 | ||
|
|
891655ebc1 | ||
|
|
fc25fa27e5 | ||
|
|
ab2f5c12f7 | ||
|
|
dd5b68fba7 | ||
|
|
3aab70afc5 | ||
|
|
9ace3fc814 | ||
|
|
8c6004568f | ||
|
|
1725f12882 | ||
|
|
d0cc456dc3 | ||
|
|
abfe8afe88 | ||
|
|
36ff05c4f9 | ||
|
|
dc1e746c42 | ||
|
|
c2474d9c71 | ||
|
|
ce19d97401 | ||
|
|
66b88b07cd | ||
|
|
5146fc2b37 | ||
|
|
340ed422d2 | ||
|
|
2813006fec | ||
|
|
605d7e2af7 | ||
|
|
f418a1cfc8 | ||
|
|
0954dd61ba | ||
|
|
5c7b8a379f | ||
|
|
e6bfe79f31 | ||
|
|
188c42b335 | ||
|
|
6afc3f6e11 | ||
|
|
2ee93246bd | ||
|
|
173d294b94 | ||
|
|
33b0f7b5e6 | ||
|
|
a1a1f6e938 | ||
|
|
3c3f13f819 | ||
|
|
870e0bda43 | ||
|
|
6c4da35996 | ||
|
|
2fd2489b7a | ||
|
|
c1a9fa4ba6 | ||
|
|
d1d37b5cab | ||
|
|
1161f98db6 | ||
|
|
264e0e591b | ||
|
|
e1ae71d8f4 | ||
|
|
af41d6b4cb | ||
|
|
25fbf96b24 | ||
|
|
c4d0e85604 | ||
|
|
fad8edf0f7 | ||
|
|
41c2d60b3a | ||
|
|
b7d4259af2 | ||
|
|
711b931f90 | ||
|
|
75504e9592 | ||
|
|
6b423b752b | ||
|
|
07a2d42cd4 | ||
|
|
52fded7b94 | ||
|
|
7904b70885 | ||
|
|
ac9ae1333e | ||
|
|
2fc5dab2ed | ||
|
|
a69214dc71 | ||
|
|
a022c1e13c | ||
|
|
fcf2ede190 | ||
|
|
0c51dc6db9 | ||
|
|
8aac6e9c53 | ||
|
|
f5c03006dd | ||
|
|
672ad18c27 | ||
|
|
e6e493f341 | ||
|
|
078d7302ac | ||
|
|
52d45012ff | ||
|
|
fd2a89b20b | ||
|
|
adfc17bf09 | ||
|
|
08a98b89df | ||
|
|
ea42777567 | ||
|
|
ede4d5e387 | ||
|
|
994b56616b | ||
|
|
3deb22a484 | ||
|
|
a405764c1e | ||
|
|
dec1861be9 | ||
|
|
3b31605aef | ||
|
|
694c3bc107 | ||
|
|
0782bdf898 | ||
|
|
563491b7b3 | ||
|
|
f7155fa3f0 | ||
|
|
518d225c43 | ||
|
|
a980d1e469 | ||
|
|
851f556af0 | ||
|
|
5a416df0e1 | ||
|
|
4677b1b605 | ||
|
|
12be4cbe7c | ||
|
|
6ca896f923 | ||
|
|
7f5d0af874 | ||
|
|
444e4925a4 | ||
|
|
a594a6f121 | ||
|
|
8d18bcfd43 | ||
|
|
2c2c6ba6c6 | ||
|
|
b1f78a2ebd | ||
|
|
ccde6771dc | ||
|
|
e05b98dadf | ||
|
|
ae8e1d9d7d | ||
|
|
4e626a3535 | ||
|
|
3f0fd597f9 | ||
|
|
502b92c1ed | ||
|
|
fb3af517ef | ||
|
|
f637656dd4 | ||
|
|
73ff6801e6 | ||
|
|
5dd8dbd7db | ||
|
|
a028abea6c | ||
|
|
210f7b2d26 | ||
|
|
9b7fa2fed6 | ||
|
|
9e018b092a | ||
|
|
dc535e10dc | ||
|
|
e44154ef0a | ||
|
|
ec9b386e26 | ||
|
|
42c53ab0a7 | ||
|
|
5723e24df5 | ||
|
|
8854070784 | ||
|
|
5fcb084932 | ||
|
|
b71bf4add6 | ||
|
|
080d897585 | ||
|
|
0cdd762027 | ||
|
|
6bfa44206e | ||
|
|
e634c9dc7a | ||
|
|
eaf8c986d3 | ||
|
|
99509695db | ||
|
|
e7e9090108 | ||
|
|
adcdeacc3e | ||
|
|
794d5f5540 | ||
|
|
08ad9b068a | ||
|
|
b6036993eb | ||
|
|
cb753850e8 | ||
|
|
b33bd8cd4b | ||
|
|
ef531c7357 | ||
|
|
4d66668300 | ||
|
|
b19e288f47 | ||
|
|
d1c561cd54 | ||
|
|
0c12a1592c | ||
|
|
b0615f0bd2 | ||
|
|
e2c9bc5ea6 | ||
|
|
9307cbaba9 | ||
|
|
0938b6094e | ||
|
|
18c0144542 | ||
|
|
c5dfe6ec58 | ||
|
|
89ad7be8e7 | ||
|
|
1eaa742d85 | ||
|
|
e278ddcd7f | ||
|
|
5abed9c546 | ||
|
|
6b3d588efe | ||
|
|
651fcf6019 | ||
|
|
49efe85b35 | ||
|
|
b26df185c3 | ||
|
|
099b86b7e7 | ||
|
|
169ee57138 | ||
|
|
6259e29134 | ||
|
|
5303a3dea9 | ||
|
|
48f6a9a2bf | ||
|
|
aade20046b | ||
|
|
5aef4c86f3 | ||
|
|
349689b802 | ||
|
|
2ee6c52e22 | ||
|
|
896720ceb2 | ||
|
|
55153d6c30 | ||
|
|
d616fc58e5 | ||
|
|
68b747397b | ||
|
|
4feac1c661 | ||
|
|
9941cf781f | ||
|
|
f4c3917a3c | ||
|
|
613ab32c47 | ||
|
|
c3678b0937 | ||
|
|
22cbf96434 | ||
|
|
11856919f2 | ||
|
|
c60dee03c0 | ||
|
|
34e026f9b1 | ||
|
|
8d451a7129 | ||
|
|
44afbbc0f0 | ||
|
|
e77224e2d8 | ||
|
|
6b50f62cc4 | ||
|
|
59ff5d3306 | ||
|
|
2a44efeb21 | ||
|
|
dcf1d774bf | ||
|
|
2d8db6d315 | ||
|
|
ca4819df83 | ||
|
|
796a781001 | ||
|
|
fb4a2409b4 | ||
|
|
bea3cbb07f | ||
|
|
f978f7c203 | ||
|
|
7efb4b5197 | ||
|
|
50c7636764 | ||
|
|
76c9aaf587 | ||
|
|
0ecb15c8e9 | ||
|
|
fa08d39517 | ||
|
|
fd96ea4dd9 | ||
|
|
f29f804a93 | ||
|
|
46a346834b | ||
|
|
c48e686889 | ||
|
|
94fb182cdf | ||
|
|
c9aab0f9dd | ||
|
|
94b972d366 | ||
|
|
ed638b6af2 | ||
|
|
538cf92c8c | ||
|
|
5f978d7efe | ||
|
|
9f0868fffb | ||
|
|
6dc9bacea5 | ||
|
|
3da7e5a50b | ||
|
|
a0af08b9db | ||
|
|
11a932fb18 | ||
|
|
186d8159f6 | ||
|
|
6eae68e450 | ||
|
|
7e3d473b5e | ||
|
|
79fd7e649e | ||
|
|
b149c4c399 | ||
|
|
53eb768dfb | ||
|
|
a8b993eb81 | ||
|
|
e0ba929982 | ||
|
|
d2ff5e55c3 | ||
|
|
77cc8902e9 | ||
|
|
0e6256d077 | ||
|
|
71ba24581c | ||
|
|
598e2d3388 | ||
|
|
6fb49e4aa0 | ||
|
|
a354ddc3d7 | ||
|
|
f1ae382dfd | ||
|
|
ccfc89cb16 | ||
|
|
c4474fc880 | ||
|
|
36bf57b6fb | ||
|
|
bb3aef9caa | ||
|
|
03f2ecc2cb | ||
|
|
8b043e6dc2 | ||
|
|
0ebf5f5c12 | ||
|
|
4fb3925ff8 | ||
|
|
aa6e1e45cf | ||
|
|
b8a49bdaaa | ||
|
|
d6b11fd1f0 | ||
|
|
a146e8b189 | ||
|
|
e1b7e1e3cf | ||
|
|
fd11bea2cc | ||
|
|
3fa1981e24 | ||
|
|
d4426ce28f | ||
|
|
46d330a6ba | ||
|
|
d8d7cbd96a | ||
|
|
cd8aa893b4 | ||
|
|
a839ce064b | ||
|
|
d62bb61f7c | ||
|
|
ddd880f8d4 | ||
|
|
4ed15fccb7 | ||
|
|
773d998caf | ||
|
|
b9c1f4bf8e | ||
|
|
dc2164da46 | ||
|
|
2e8f5dc16a | ||
|
|
893b92f86f | ||
|
|
d0e6d34d7c | ||
|
|
161d2d5ea8 | ||
|
|
ea467c73ed | ||
|
|
c2e7c7b2d9 | ||
|
|
4e8183b7d4 | ||
|
|
d71dd0428c | ||
|
|
9d70e77285 | ||
|
|
c2800b162b | ||
|
|
ae3248a3fd | ||
|
|
fc9a8e8d40 | ||
|
|
30fe8c150f | ||
|
|
56f624d06a | ||
|
|
2bcdf84d58 | ||
|
|
ef509b9063 | ||
|
|
e8459dcc33 | ||
|
|
356d15ebb2 | ||
|
|
999d7d326d | ||
|
|
11bc755722 | ||
|
|
bf411ea9f1 | ||
|
|
00c200f137 | ||
|
|
df4dbb5df6 | ||
|
|
0dd54619ca | ||
|
|
79b079f35c | ||
|
|
fa1a73fa87 | ||
|
|
585d8bc116 | ||
|
|
b545a98f5d | ||
|
|
d3289aac64 | ||
|
|
2737f0112b | ||
|
|
bea0fd5e6a | ||
|
|
18e44ce3f8 | ||
|
|
fb3ad9bd92 | ||
|
|
ae1590ed52 | ||
|
|
0092fa01a7 | ||
|
|
3523df0078 | ||
|
|
9607faf20a | ||
|
|
ba9a6708ec | ||
|
|
db60580649 | ||
|
|
6dd3b56689 | ||
|
|
39b924a304 | ||
|
|
b9c8ccaba7 | ||
|
|
229695fee9 | ||
|
|
548a64d845 | ||
|
|
79e7e87f91 | ||
|
|
8a0c6d6fa9 | ||
|
|
a88e55c4c6 | ||
|
|
4e4685027c | ||
|
|
e7300f463d | ||
|
|
652fe4044c | ||
|
|
33a1ea2c8f | ||
|
|
da241033ec | ||
|
|
9f66150436 | ||
|
|
dd649f1d00 | ||
|
|
585cd86c78 | ||
|
|
6873fae3a9 | ||
|
|
bef67f1f32 | ||
|
|
0f507779ca | ||
|
|
0f605c1501 | ||
|
|
d381294aef | ||
|
|
8f9fd6caaf | ||
|
|
b1d615f3f1 | ||
|
|
b03f4b3742 | ||
|
|
e04bfdacb3 | ||
|
|
d68c942927 | ||
|
|
1fa3a63413 | ||
|
|
803d01edc2 | ||
|
|
70ad375ee4 | ||
|
|
dfb42fc95d | ||
|
|
a45fa43685 | ||
|
|
e296995767 | ||
|
|
19ed7b4ecf | ||
|
|
07bbd48b47 | ||
|
|
6ac1e542c6 | ||
|
|
dd45948dd7 | ||
|
|
0d2c0d5788 | ||
|
|
fef8c66180 | ||
|
|
d84187ac75 | ||
|
|
1220eeb794 | ||
|
|
e688a99c07 | ||
|
|
3cbeb0f004 | ||
|
|
053b795e30 | ||
|
|
a47e449513 | ||
|
|
93ad66ced3 | ||
|
|
ece0d37014 | ||
|
|
a8a752c084 | ||
|
|
a4223b746d | ||
|
|
7ce1526ed2 | ||
|
|
b401b73d02 | ||
|
|
dc24bb6ddb | ||
|
|
6e7b9f4fa0 | ||
|
|
957ba85ce9 | ||
|
|
29a23f9d6c | ||
|
|
6bf4ca076f | ||
|
|
bf007ebb6f | ||
|
|
db1b5f3d20 | ||
|
|
646257d1f4 | ||
|
|
2842c1c242 | ||
|
|
097dd3e0a9 | ||
|
|
66b36f833a |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -47,8 +47,8 @@
|
||||
/errlog
|
||||
/reloc_off
|
||||
|
||||
!/spl/Makefile
|
||||
/spl/*
|
||||
!/spl/Makefile
|
||||
/tpl/
|
||||
|
||||
#
|
||||
|
||||
4
CREDITS
4
CREDITS
@@ -120,10 +120,6 @@ N: Dan A. Dickey
|
||||
E: ddickey@charter.net
|
||||
D: FADS Support
|
||||
|
||||
N: James F. Dougherty
|
||||
E: jfd@GigabitNetworks.COM
|
||||
D: Port to the MOUSSE board
|
||||
|
||||
N: Mike Dunn
|
||||
E: mikedunn@newsguy.com
|
||||
D: Palmtreo680 board, docg4 nand flash driver
|
||||
|
||||
44
MAKEALL
44
MAKEALL
@@ -418,50 +418,8 @@ LIST_arm="$(targets_by_arch arm | \
|
||||
## MIPS Systems (default = big endian)
|
||||
#########################################################################
|
||||
|
||||
LIST_mips4kc=" \
|
||||
incaip \
|
||||
incaip_100MHz \
|
||||
incaip_133MHz \
|
||||
incaip_150MHz \
|
||||
qemu_mips \
|
||||
vct_platinum \
|
||||
vct_platinum_small \
|
||||
vct_platinum_onenand \
|
||||
vct_platinum_onenand_small \
|
||||
vct_platinumavc \
|
||||
vct_platinumavc_small \
|
||||
vct_platinumavc_onenand \
|
||||
vct_platinumavc_onenand_small \
|
||||
vct_premium \
|
||||
vct_premium_small \
|
||||
vct_premium_onenand \
|
||||
vct_premium_onenand_small \
|
||||
"
|
||||
LIST_mips="$(targets_by_arch mips)"
|
||||
|
||||
LIST_au1xx0=" \
|
||||
dbau1000 \
|
||||
dbau1100 \
|
||||
dbau1500 \
|
||||
dbau1550 \
|
||||
"
|
||||
|
||||
LIST_mips=" \
|
||||
${LIST_mips4kc} \
|
||||
${LIST_mips5kc} \
|
||||
${LIST_au1xx0} \
|
||||
"
|
||||
|
||||
#########################################################################
|
||||
## MIPS Systems (little endian)
|
||||
#########################################################################
|
||||
|
||||
LIST_au1xx0_el=" \
|
||||
dbau1550_el \
|
||||
pb1000 \
|
||||
"
|
||||
LIST_mips_el=" \
|
||||
${LIST_au1xx0_el} \
|
||||
"
|
||||
#########################################################################
|
||||
## OpenRISC Systems
|
||||
#########################################################################
|
||||
|
||||
107
Makefile
107
Makefile
@@ -6,9 +6,9 @@
|
||||
#
|
||||
|
||||
VERSION = 2014
|
||||
PATCHLEVEL = 04
|
||||
PATCHLEVEL = 07
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -rc2
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
@@ -127,7 +127,7 @@ saved-output := $(KBUILD_OUTPUT)
|
||||
KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
|
||||
&& /bin/pwd)
|
||||
$(if $(KBUILD_OUTPUT),, \
|
||||
$(error output directory "$(saved-output)" does not exist))
|
||||
$(error failed to create output directory "$(saved-output)"))
|
||||
|
||||
PHONY += $(MAKECMDGOALS) sub-make
|
||||
|
||||
@@ -205,7 +205,14 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
||||
else echo sh; fi ; fi)
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTCXX = g++
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
|
||||
HOSTCXXFLAGS = -O2
|
||||
|
||||
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
|
||||
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers -fno-delete-null-pointer-checks
|
||||
endif
|
||||
|
||||
ifeq ($(HOSTOS),cygwin)
|
||||
HOSTCFLAGS += -ansi
|
||||
@@ -278,7 +285,7 @@ export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
|
||||
# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
||||
#
|
||||
# If $(quiet) is empty, the whole command will be printed.
|
||||
# If it is set to "quiet_", only the short version will be printed.
|
||||
# If it is set to "quiet_", only the short version will be printed.
|
||||
# If it is set to "silent_", nothing will be printed at all, since
|
||||
# the variable $(silent_cmd_cc_o_c) doesn't exist.
|
||||
#
|
||||
@@ -301,12 +308,26 @@ endif
|
||||
# If the user is running make -s (silent mode), suppress echoing of
|
||||
# commands
|
||||
|
||||
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
|
||||
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
|
||||
quiet=silent_
|
||||
endif
|
||||
else # make-3.8x
|
||||
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
|
||||
quiet=silent_
|
||||
endif
|
||||
endif
|
||||
|
||||
export quiet Q KBUILD_VERBOSE
|
||||
|
||||
ifneq ($(CC),)
|
||||
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
|
||||
COMPILER := clang
|
||||
else
|
||||
COMPILER := gcc
|
||||
endif
|
||||
export COMPILER
|
||||
endif
|
||||
|
||||
# Look for make include files relative to root of kernel src
|
||||
MAKEFLAGS += --include-dir=$(srctree)
|
||||
@@ -368,8 +389,9 @@ export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_ve
|
||||
|
||||
# Files to ignore in find ... statements
|
||||
|
||||
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
|
||||
-o -name .pc -o -name .hg -o -name .git \) -prune -o
|
||||
export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
|
||||
-name CVS -o -name .pc -o -name .hg -o -name .git \) \
|
||||
-prune -o
|
||||
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
|
||||
--exclude CVS --exclude .pc --exclude .hg --exclude .git
|
||||
|
||||
@@ -523,6 +545,20 @@ endif
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
|
||||
|
||||
ifeq ($(COMPILER),clang)
|
||||
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
|
||||
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
|
||||
# Quiet clang warning: comparison of unsigned expression < 0 is always false
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
|
||||
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
|
||||
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
|
||||
# See modpost pattern 2
|
||||
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += -g
|
||||
# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
|
||||
# option to the assembler.
|
||||
@@ -542,12 +578,20 @@ KBUILD_AFLAGS += -Wa,-gstabs,-S
|
||||
endif
|
||||
endif
|
||||
|
||||
# Prohibit date/time macros, which would make the build non-deterministic
|
||||
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
|
||||
|
||||
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
||||
KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
|
||||
endif
|
||||
|
||||
export CONFIG_SYS_TEXT_BASE
|
||||
|
||||
# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
|
||||
KBUILD_CPPFLAGS += $(KCPPFLAGS)
|
||||
KBUILD_AFLAGS += $(KAFLAGS)
|
||||
KBUILD_CFLAGS += $(KCFLAGS)
|
||||
|
||||
# Use UBOOTINCLUDE when you must reference the include/ directory.
|
||||
# Needed to be compatible with the O= option
|
||||
UBOOTINCLUDE := \
|
||||
@@ -655,6 +699,7 @@ PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`
|
||||
endif
|
||||
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
|
||||
export PLATFORM_LIBS
|
||||
export PLATFORM_LIBGCC
|
||||
|
||||
# Special flags for CPP when processing the linker script.
|
||||
# Pass the version down so we can handle backwards compatibility
|
||||
@@ -699,11 +744,18 @@ ALL-y += u-boot.srec u-boot.bin System.map
|
||||
|
||||
ALL-$(CONFIG_NAND_U_BOOT) += u-boot-nand.bin
|
||||
ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
|
||||
ifeq ($(CONFIG_SPL_FSL_PBL),y)
|
||||
ALL-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin
|
||||
else
|
||||
ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
|
||||
endif
|
||||
ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
|
||||
ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
|
||||
ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
|
||||
ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin
|
||||
ifeq ($(CONFIG_SPL_FRAMEWORK),y)
|
||||
ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
|
||||
endif
|
||||
ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb
|
||||
ifneq ($(CONFIG_SPL_TARGET),)
|
||||
ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
|
||||
@@ -806,6 +858,11 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
|
||||
u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
|
||||
|
||||
u-boot-dtb.img: u-boot-dtb.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
u-boot.sha1: u-boot.bin
|
||||
tools/ubsha1 u-boot.bin
|
||||
|
||||
@@ -845,7 +902,7 @@ MKIMAGEFLAGS_u-boot-spl.ais = -s -n $(if $(CONFIG_AIS_CONFIG_FILE), \
|
||||
spl/u-boot-spl.ais: spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_MAX_SIZE)
|
||||
OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
|
||||
u-boot.ais: spl/u-boot-spl.ais u-boot.img FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
@@ -870,6 +927,16 @@ OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
|
||||
u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
MKIMAGEFLAGS_u-boot-spl.gph = -A $(ARCH) -T gpimage -C none \
|
||||
-a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n SPL
|
||||
spl/u-boot-spl.gph: spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
OBJCOPYFLAGS_u-boot-spi.gph = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
|
||||
--gap-fill=0
|
||||
u-boot-spi.gph: spl/u-boot-spl.gph u-boot.img FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
ifneq ($(CONFIG_TEGRA),)
|
||||
OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
|
||||
u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
|
||||
@@ -884,6 +951,21 @@ endif
|
||||
u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE
|
||||
$(call if_changed,cat)
|
||||
|
||||
#Add a target to create boot binary having SPL binary in PBI format
|
||||
#concatenated with u-boot binary. It is need by PowerPC SoC having
|
||||
#internal SRAM <= 512KB.
|
||||
MKIMAGEFLAGS_u-boot-spl.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
|
||||
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
|
||||
|
||||
spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
OBJCOPYFLAGS_u-boot-with-spl-pbl.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
|
||||
--gap-fill=0xff
|
||||
|
||||
u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl u-boot.bin FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
# PPC4xx needs the SPL at the end of the image, since the reset vector
|
||||
# is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
|
||||
# and need to introduce a new build target with the full blown U-Boot
|
||||
@@ -925,7 +1007,7 @@ ifeq ($(CONFIG_KALLSYMS),y)
|
||||
$(call cmd,u-boot__) common/system_map.o
|
||||
endif
|
||||
|
||||
# The actual objects are generated when descending,
|
||||
# The actual objects are generated when descending,
|
||||
# make sure no implicit rule kicks in
|
||||
$(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
|
||||
|
||||
@@ -1168,7 +1250,8 @@ CLOBBER_DIRS += $(patsubst %,spl/%, $(filter-out Makefile, \
|
||||
CLOBBER_FILES += u-boot* MLO* SPL System.map nand_spl/u-boot*
|
||||
|
||||
# Directories & files removed with 'make mrproper'
|
||||
MRPROPER_DIRS += include/config include/generated
|
||||
MRPROPER_DIRS += include/config include/generated \
|
||||
.tmp_objdiff
|
||||
MRPROPER_FILES += .config .config.old \
|
||||
tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
|
||||
include/config.h include/config.mk
|
||||
@@ -1234,8 +1317,8 @@ distclean: mrproper
|
||||
@find $(srctree) $(RCS_FIND_IGNORE) \
|
||||
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
||||
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
|
||||
-o -name '.*.rej' -o -name '*.pyc' \
|
||||
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
|
||||
-o -name '.*.rej' -o -name '*%' -o -name 'core' \
|
||||
-o -name '*.pyc' \) \
|
||||
-type f -print | xargs rm -f
|
||||
|
||||
backup:
|
||||
@@ -1363,7 +1446,7 @@ endif
|
||||
$(build)=$(build-dir) $(@:.ko=.o)
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
||||
|
||||
# FIXME Should go into a make.lib or something
|
||||
# FIXME Should go into a make.lib or something
|
||||
# ===========================================================================
|
||||
|
||||
quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
|
||||
|
||||
130
README
130
README
@@ -132,6 +132,10 @@ Directory Hierarchy:
|
||||
====================
|
||||
|
||||
/arch Architecture specific files
|
||||
/arc Files generic to ARC architecture
|
||||
/cpu CPU specific files
|
||||
/arc700 Files specific to ARC 700 CPUs
|
||||
/lib Architecture specific library files
|
||||
/arm Files generic to ARM architecture
|
||||
/cpu CPU specific files
|
||||
/arm720t Files specific to ARM 720 CPUs
|
||||
@@ -164,7 +168,7 @@ Directory Hierarchy:
|
||||
/mips Files generic to MIPS architecture
|
||||
/cpu CPU specific files
|
||||
/mips32 Files specific to MIPS32 CPUs
|
||||
/xburst Files specific to Ingenic XBurst CPUs
|
||||
/mips64 Files specific to MIPS64 CPUs
|
||||
/lib Architecture specific library files
|
||||
/nds32 Files generic to NDS32 architecture
|
||||
/cpu CPU specific files
|
||||
@@ -260,6 +264,17 @@ e.g. "make cogent_mpc8xx_config". And also configure the cogent
|
||||
directory according to the instructions in cogent/README.
|
||||
|
||||
|
||||
Sandbox Environment:
|
||||
--------------------
|
||||
|
||||
U-Boot can be built natively to run on a Linux host using the 'sandbox'
|
||||
board. This allows feature development which is not board- or architecture-
|
||||
specific to be undertaken on a native platform. The sandbox is also used to
|
||||
run some of U-Boot's tests.
|
||||
|
||||
See board/sandbox/sandbox/README.sandbox for more details.
|
||||
|
||||
|
||||
Configuration Options:
|
||||
----------------------
|
||||
|
||||
@@ -427,7 +442,21 @@ The following options need to be configured:
|
||||
In this mode, a single differential clock is used to supply
|
||||
clocks to the sysclock, ddrclock and usbclock.
|
||||
|
||||
CONFIG_SYS_CPC_REINIT_F
|
||||
This CONFIG is defined when the CPC is configured as SRAM at the
|
||||
time of U-boot entry and is required to be re-initialized.
|
||||
|
||||
CONFIG_DEEP_SLEEP
|
||||
Inidcates this SoC supports deep sleep feature. If deep sleep is
|
||||
supported, core will start to execute uboot when wakes up.
|
||||
|
||||
- Generic CPU options:
|
||||
CONFIG_SYS_GENERIC_GLOBAL_DATA
|
||||
Defines global data is initialized in generic board board_init_f().
|
||||
If this macro is defined, global data is created and cleared in
|
||||
generic board board_init_f(). Without this macro, architecture/board
|
||||
should initialize global data before calling board_init_f().
|
||||
|
||||
CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN
|
||||
|
||||
Defines the endianess of the CPU. Implementation of those
|
||||
@@ -454,6 +483,9 @@ The following options need to be configured:
|
||||
CONFIG_SYS_FSL_DDRC_GEN3
|
||||
Freescale DDR3 controller.
|
||||
|
||||
CONFIG_SYS_FSL_DDRC_GEN4
|
||||
Freescale DDR4 controller.
|
||||
|
||||
CONFIG_SYS_FSL_DDRC_ARM_GEN3
|
||||
Freescale DDR3 controller for ARM-based SoCs.
|
||||
|
||||
@@ -469,7 +501,15 @@ The following options need to be configured:
|
||||
|
||||
CONFIG_SYS_FSL_DDR3
|
||||
Board config to use DDR3. It can be enabled for SoCs with
|
||||
Freescale DDR3 controllers.
|
||||
Freescale DDR3 or DDR3L controllers.
|
||||
|
||||
CONFIG_SYS_FSL_DDR3L
|
||||
Board config to use DDR3L. It can be enabled for SoCs with
|
||||
DDR3L controllers.
|
||||
|
||||
CONFIG_SYS_FSL_DDR4
|
||||
Board config to use DDR4. It can be enabled for SoCs with
|
||||
DDR4 controllers.
|
||||
|
||||
CONFIG_SYS_FSL_IFC_BE
|
||||
Defines the IFC controller register space as Big Endian
|
||||
@@ -486,6 +526,10 @@ The following options need to be configured:
|
||||
PBI commands can be used to configure SoC before it starts the execution.
|
||||
Please refer doc/README.pblimage for more details
|
||||
|
||||
CONFIG_SPL_FSL_PBL
|
||||
It adds a target to create boot binary having SPL binary in PBI format
|
||||
concatenated with u-boot binary.
|
||||
|
||||
CONFIG_SYS_FSL_DDR_BE
|
||||
Defines the DDR controller register space as Big Endian
|
||||
|
||||
@@ -713,6 +757,10 @@ 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_SERIAL_HW_FLOW_CONTROL
|
||||
|
||||
Define this variable to enable hw flow control in serial driver.
|
||||
Current user of this option is drivers/serial/nsl16550.c driver
|
||||
|
||||
- Console Interface:
|
||||
Depending on board, define exactly one serial port
|
||||
@@ -912,6 +960,7 @@ The following options need to be configured:
|
||||
The default command configuration includes all commands
|
||||
except those marked below with a "*".
|
||||
|
||||
CONFIG_CMD_AES AES 128 CBC encrypt/decrypt
|
||||
CONFIG_CMD_ASKENV * ask for env variable
|
||||
CONFIG_CMD_BDI bdinfo
|
||||
CONFIG_CMD_BEDBUG * Include BedBug Debugger
|
||||
@@ -1456,13 +1505,6 @@ The following options need to be configured:
|
||||
for your device
|
||||
- CONFIG_USBD_PRODUCTID 0xFFFF
|
||||
|
||||
Some USB device drivers may need to check USB cable attachment.
|
||||
In this case you can enable following config in BoardName.h:
|
||||
CONFIG_USB_CABLE_CHECK
|
||||
This enables function definition:
|
||||
- usb_cable_connected() in include/usb.h
|
||||
Implementation of this function is board-specific.
|
||||
|
||||
- ULPI Layer Support:
|
||||
The ULPI (UTMI Low Pin (count) Interface) PHYs are supported via
|
||||
the generic ULPI layer. The generic layer accesses the ULPI PHY
|
||||
@@ -1492,6 +1534,16 @@ The following options need to be configured:
|
||||
CONFIG_SH_MMCIF_CLK
|
||||
Define the clock frequency for MMCIF
|
||||
|
||||
CONFIG_GENERIC_MMC
|
||||
Enable the generic MMC driver
|
||||
|
||||
CONFIG_SUPPORT_EMMC_BOOT
|
||||
Enable some additional features of the eMMC boot partitions.
|
||||
|
||||
CONFIG_SUPPORT_EMMC_RPMB
|
||||
Enable the commands for reading, writing and programming the
|
||||
key for the Replay Protection Memory Block partition in eMMC.
|
||||
|
||||
- USB Device Firmware Update (DFU) class support:
|
||||
CONFIG_DFU_FUNCTION
|
||||
This enables the USB portion of the DFU USB class
|
||||
@@ -1537,6 +1589,28 @@ The following options need to be configured:
|
||||
entering dfuMANIFEST state. Host waits this timeout, before
|
||||
sending again an USB request to the device.
|
||||
|
||||
- USB Device Android Fastboot support:
|
||||
CONFIG_CMD_FASTBOOT
|
||||
This enables the command "fastboot" which enables the Android
|
||||
fastboot mode for the platform's USB device. Fastboot is a USB
|
||||
protocol for downloading images, flashing and device control
|
||||
used on Android devices.
|
||||
See doc/README.android-fastboot for more information.
|
||||
|
||||
CONFIG_ANDROID_BOOT_IMAGE
|
||||
This enables support for booting images which use the Android
|
||||
image format header.
|
||||
|
||||
CONFIG_USB_FASTBOOT_BUF_ADDR
|
||||
The fastboot protocol requires a large memory buffer for
|
||||
downloads. Define this to the starting RAM address to use for
|
||||
downloaded images.
|
||||
|
||||
CONFIG_USB_FASTBOOT_BUF_SIZE
|
||||
The fastboot protocol requires a large memory buffer for
|
||||
downloads. This buffer should be as large as possible for a
|
||||
platform. Define this to the size available RAM for fastboot.
|
||||
|
||||
- Journaling Flash filesystem support:
|
||||
CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, CONFIG_JFFS2_NAND_SIZE,
|
||||
CONFIG_JFFS2_NAND_DEV
|
||||
@@ -2508,6 +2582,19 @@ CBFS (Coreboot Filesystem) support
|
||||
|
||||
Specify the number of FPGA devices to support.
|
||||
|
||||
CONFIG_CMD_FPGA_LOADMK
|
||||
|
||||
Enable support for fpga loadmk command
|
||||
|
||||
CONFIG_CMD_FPGA_LOADP
|
||||
|
||||
Enable support for fpga loadp command - load partial bitstream
|
||||
|
||||
CONFIG_CMD_FPGA_LOADBP
|
||||
|
||||
Enable support for fpga loadbp command - load partial bitstream
|
||||
(Xilinx only)
|
||||
|
||||
CONFIG_SYS_FPGA_PROG_FEEDBACK
|
||||
|
||||
Enable printing of hash marks during FPGA configuration.
|
||||
@@ -3254,6 +3341,10 @@ FIT uImage format:
|
||||
supports MMC, NAND and YMODEM loading of U-Boot and NAND
|
||||
NAND loading of the Linux Kernel.
|
||||
|
||||
CONFIG_SPL_OS_BOOT
|
||||
Enable booting directly to an OS from SPL.
|
||||
See also: doc/README.falcon
|
||||
|
||||
CONFIG_SPL_DISPLAY_PRINT
|
||||
For ARM, enable an optional function to print more information
|
||||
about the running system.
|
||||
@@ -3312,6 +3403,9 @@ FIT uImage format:
|
||||
continuing (the hardware starts execution after just
|
||||
loading the first page rather than the full 4K).
|
||||
|
||||
CONFIG_SPL_SKIP_RELOCATE
|
||||
Avoid SPL relocation
|
||||
|
||||
CONFIG_SPL_NAND_BASE
|
||||
Include nand_base.c in the SPL. Requires
|
||||
CONFIG_SPL_NAND_DRIVERS.
|
||||
@@ -3326,6 +3420,10 @@ FIT uImage format:
|
||||
Support for NAND boot using simple NAND drivers that
|
||||
expose the cmd_ctrl() interface.
|
||||
|
||||
CONFIG_SPL_MTD_SUPPORT
|
||||
Support for the MTD subsystem within SPL. Useful for
|
||||
environment on NAND support within SPL.
|
||||
|
||||
CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
|
||||
Set for the SPL on PPC mpc8xxx targets, support for
|
||||
drivers/ddr/fsl/libddr.o in SPL binary.
|
||||
@@ -4488,6 +4586,11 @@ Low Level (hardware related) configuration options:
|
||||
- CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
|
||||
Enables the RTC32K OSC on AM33xx based plattforms
|
||||
|
||||
- CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
|
||||
Option to disable subpage write in NAND driver
|
||||
driver that uses this:
|
||||
drivers/mtd/nand/davinci_nand.c
|
||||
|
||||
Freescale QE/FMAN Firmware Support:
|
||||
-----------------------------------
|
||||
|
||||
@@ -4497,8 +4600,13 @@ This firmware often needs to be loaded during U-Boot booting, so macros
|
||||
are used to identify the storage device (NOR flash, SPI, etc) and the address
|
||||
within that device.
|
||||
|
||||
- CONFIG_SYS_QE_FMAN_FW_ADDR
|
||||
The address in the storage device where the firmware is located. The
|
||||
- CONFIG_SYS_FMAN_FW_ADDR
|
||||
The address in the storage device where the FMAN microcode is located. The
|
||||
meaning of this address depends on which CONFIG_SYS_QE_FW_IN_xxx macro
|
||||
is also specified.
|
||||
|
||||
- CONFIG_SYS_QE_FW_ADDR
|
||||
The address in the storage device where the QE microcode is located. The
|
||||
meaning of this address depends on which CONFIG_SYS_QE_FW_IN_xxx macro
|
||||
is also specified.
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef __ASM_ARC_CONFIG_H_
|
||||
#define __ASM_ARC_CONFIG_H_
|
||||
|
||||
#define CONFIG_SYS_GENERIC_GLOBAL_DATA
|
||||
|
||||
#define CONFIG_LMB
|
||||
|
||||
#endif /*__ASM_ARC_CONFIG_H_ */
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
obj-$(CONFIG_AT91FAMILY) += at91-common/
|
||||
obj-$(CONFIG_TEGRA) += $(SOC)-common/
|
||||
obj-$(CONFIG_TEGRA20) += tegra20-common/
|
||||
obj-$(CONFIG_TEGRA30) += tegra30-common/
|
||||
obj-$(CONFIG_TEGRA114) += tegra114-common/
|
||||
obj-$(CONFIG_TEGRA124) += tegra124-common/
|
||||
obj-$(CONFIG_TEGRA) += tegra-common/
|
||||
|
||||
@@ -15,48 +15,7 @@
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
.globl _start
|
||||
_start: b reset
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
|
||||
_hang:
|
||||
.word do_hang
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678 /* now 16*4=64 */
|
||||
#else
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction: .word undefined_instruction
|
||||
_software_interrupt: .word software_interrupt
|
||||
_prefetch_abort: .word prefetch_abort
|
||||
_data_abort: .word data_abort
|
||||
_not_used: .word not_used
|
||||
_irq: .word irq
|
||||
_fiq: .word fiq
|
||||
_pad: .word 0x12345678 /* now 16*4=64 */
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
.global _end_vect
|
||||
_end_vect:
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -70,26 +29,7 @@ _end_vect:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -152,195 +92,3 @@ cpu_init_crit:
|
||||
mov lr, ip /* restore link */
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack
|
||||
ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs)
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0 (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode)
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of saved stack
|
||||
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction & switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack_swi
|
||||
sub r13, r13, #4 @ space on current stack for scratch reg.
|
||||
str r0, [r13] @ save R0's value.
|
||||
ldr r0, IRQ_STACK_START_IN @ get data regions start
|
||||
str lr, [r0] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r0, #4] @ save spsr in position 1 of saved stack
|
||||
ldr lr, [r0] @ restore lr
|
||||
ldr r0, [r13] @ restore r0
|
||||
add r13, r13, #4 @ pop stack entry
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
.align 5
|
||||
do_hang:
|
||||
bl hang /* hang and never return */
|
||||
#else /* !CONFIG_SPL_BUILD */
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack_swi
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
.align 5
|
||||
.global arm1136_cache_flush
|
||||
arm1136_cache_flush:
|
||||
#if !defined(CONFIG_SYS_ICACHE_OFF)
|
||||
mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
|
||||
#endif
|
||||
#if !defined(CONFIG_SYS_DCACHE_OFF)
|
||||
mcr p15, 0, r1, c7, c14, 0 @ invalidate D cache
|
||||
#endif
|
||||
mov pc, lr @ back to caller
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
@@ -22,48 +22,6 @@
|
||||
#define CONFIG_SYS_PHY_UBOOT_BASE CONFIG_SYS_UBOOT_BASE
|
||||
#endif
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
.globl _start
|
||||
_start: b reset
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction:
|
||||
.word undefined_instruction
|
||||
_software_interrupt:
|
||||
.word software_interrupt
|
||||
_prefetch_abort:
|
||||
.word prefetch_abort
|
||||
_data_abort:
|
||||
.word data_abort
|
||||
_not_used:
|
||||
.word not_used
|
||||
_irq:
|
||||
.word irq
|
||||
_fiq:
|
||||
.word fiq
|
||||
_pad:
|
||||
.word 0x12345678 /* now 16*4=64 */
|
||||
#else
|
||||
. = _start + 64
|
||||
#endif
|
||||
|
||||
.global _end_vect
|
||||
_end_vect:
|
||||
.balignl 16,0xdeadbeef
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -77,14 +35,7 @@ _end_vect:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -182,150 +133,3 @@ skip_tcmdisable:
|
||||
c_runtime_cpu_setup:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
/* carve out a frame on current user stack */
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
/* Save user registers (now in svc mode) r0-r12 */
|
||||
stmia sp, {r0 - r12}
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
/* get values for "aborted" pc and cpsr (into parm regs) */
|
||||
ldmia r2, {r2 - r3}
|
||||
/* grab pointer to old stack */
|
||||
add r0, sp, #S_FRAME_SIZE
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
/* save sp_SVC, lr_SVC, pc, cpsr */
|
||||
stmia r5, {r0 - r3}
|
||||
/* save current stack into r0 (param register) */
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
/* save caller lr in position 0 of saved stack */
|
||||
str lr, [r13]
|
||||
/* get the spsr */
|
||||
mrs lr, spsr
|
||||
/* save spsr in position 1 of saved stack */
|
||||
str lr, [r13, #4]
|
||||
|
||||
/* prepare SVC-Mode */
|
||||
mov r13, #MODE_SVC
|
||||
@ msr spsr_c, r13
|
||||
/* switch modes, make sure moves will execute */
|
||||
msr spsr, r13
|
||||
/* capture return pc */
|
||||
mov lr, pc
|
||||
/* jump to next instruction & switch modes. */
|
||||
movs pc, lr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack_swi
|
||||
/* space on current stack for scratch reg. */
|
||||
sub r13, r13, #4
|
||||
/* save R0's value. */
|
||||
str r0, [r13]
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
/* save caller lr in position 0 of saved stack */
|
||||
str lr, [r0]
|
||||
/* get the spsr */
|
||||
mrs lr, spsr
|
||||
/* save spsr in position 1 of saved stack */
|
||||
str lr, [r0, #4]
|
||||
/* restore lr */
|
||||
ldr lr, [r0]
|
||||
/* restore r0 */
|
||||
ldr r0, [r13]
|
||||
/* pop stack entry */
|
||||
add r13, r13, #4
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack_swi
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
@@ -12,48 +12,6 @@
|
||||
#include <version.h>
|
||||
#include <asm/hardware.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
.globl _start
|
||||
_start: b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
_undefined_instruction: .word _undefined_instruction
|
||||
_software_interrupt: .word _software_interrupt
|
||||
_prefetch_abort: .word _prefetch_abort
|
||||
_data_abort: .word _data_abort
|
||||
_not_used: .word _not_used
|
||||
_irq: .word _irq
|
||||
_fiq: .word _fiq
|
||||
_pad: .word 0x12345678 /* now 16*4=64 */
|
||||
#else
|
||||
_undefined_instruction: .word undefined_instruction
|
||||
_software_interrupt: .word software_interrupt
|
||||
_prefetch_abort: .word prefetch_abort
|
||||
_data_abort: .word data_abort
|
||||
_not_used: .word not_used
|
||||
_irq: .word irq
|
||||
_fiq: .word fiq
|
||||
_pad: .word 0x12345678 /* now 16*4=64 */
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -67,26 +25,7 @@ _pad: .word 0x12345678 /* now 16*4=64 */
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -139,169 +78,3 @@ cpu_init_crit:
|
||||
|
||||
mov pc, lr
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
ldmia r2, {r2 - r4} @ get pc, cpsr, old_r0
|
||||
add r0, sp, #S_FRAME_SIZE @ restore sp_SVC
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_r
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
str lr, [r13] @ save caller lr / spsr
|
||||
mrs lr, spsr
|
||||
str lr, [r13, #4]
|
||||
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
msr spsr_c, r13
|
||||
mov lr, pc
|
||||
movs pc, lr
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
@@ -82,7 +82,7 @@ struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
|
||||
{ .n = 600, .m = 13, .p = 0, .cpcon = 12 }, /* OSC: 26.0 MHz */
|
||||
},
|
||||
/*
|
||||
* T30: 1.4 GHz
|
||||
* T30: 600 MHz
|
||||
*
|
||||
* Register Field Bits Width
|
||||
* ------------------------------
|
||||
@@ -92,10 +92,10 @@ struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
|
||||
* PLLX_MISC cpcon 11: 8 4
|
||||
*/
|
||||
{
|
||||
{ .n = 862, .m = 8, .p = 0, .cpcon = 8 }, /* OSC: 13.0 MHz */
|
||||
{ .n = 583, .m = 8, .p = 0, .cpcon = 4 }, /* OSC: 19.2 MHz */
|
||||
{ .n = 700, .m = 6, .p = 0, .cpcon = 8 }, /* OSC: 12.0 MHz */
|
||||
{ .n = 700, .m = 13, .p = 0, .cpcon = 8 }, /* OSC: 26.0 MHz */
|
||||
{ .n = 600, .m = 13, .p = 0, .cpcon = 8 }, /* OSC: 13.0 MHz */
|
||||
{ .n = 500, .m = 16, .p = 0, .cpcon = 8 }, /* OSC: 19.2 MHz */
|
||||
{ .n = 600, .m = 12, .p = 0, .cpcon = 8 }, /* OSC: 12.0 MHz */
|
||||
{ .n = 600, .m = 26, .p = 0, .cpcon = 8 }, /* OSC: 26.0 MHz */
|
||||
},
|
||||
/*
|
||||
* T114: 700 MHz
|
||||
|
||||
@@ -13,16 +13,18 @@
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
#include <asm/arch-tegra/apb_misc.h>
|
||||
#include <asm/arch-tegra/board.h>
|
||||
#include <asm/arch/spl.h>
|
||||
#include "cpu.h"
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
struct apb_misc_pp_ctlr *apb_misc =
|
||||
(struct apb_misc_pp_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
|
||||
/* enable JTAG */
|
||||
writel(0xC0, &pmt->pmt_cfg_ctl);
|
||||
writel(0xC0, &apb_misc->cfg_ctl);
|
||||
|
||||
board_init_uart_f();
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ static void enable_cpu_power_rail(void)
|
||||
debug("enable_cpu_power_rail entry\n");
|
||||
|
||||
/* un-tristate PWR_I2C SCL/SDA, rest of the defaults are correct */
|
||||
pinmux_tristate_disable(PINGRP_PWR_I2C_SCL);
|
||||
pinmux_tristate_disable(PINGRP_PWR_I2C_SDA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PWR_I2C_SCL_PZ6);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PWR_I2C_SDA_PZ7);
|
||||
|
||||
/*
|
||||
* Set CPUPWRGOOD_TIMER - APB clock is 1/2 of SCLK (102MHz),
|
||||
|
||||
@@ -26,8 +26,8 @@ static void enable_cpu_power_rail(void)
|
||||
debug("enable_cpu_power_rail entry\n");
|
||||
|
||||
/* un-tristate PWR_I2C SCL/SDA, rest of the defaults are correct */
|
||||
pinmux_tristate_disable(PINGRP_PWR_I2C_SCL);
|
||||
pinmux_tristate_disable(PINGRP_PWR_I2C_SDA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PWR_I2C_SCL_PZ6);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PWR_I2C_SDA_PZ7);
|
||||
|
||||
pmic_enable_cpu_vdd();
|
||||
|
||||
|
||||
@@ -41,10 +41,18 @@ void tegra_i2c_ll_write_data(uint data, uint config)
|
||||
writel(config, ®->cnfg);
|
||||
}
|
||||
|
||||
#define TPS62366A_I2C_ADDR 0xC0
|
||||
#define TPS62366A_SET1_REG 0x01
|
||||
#define TPS62366A_SET1_DATA (0x4600 | TPS62366A_SET1_REG)
|
||||
|
||||
#define TPS62361B_I2C_ADDR 0xC0
|
||||
#define TPS62361B_SET3_REG 0x03
|
||||
#define TPS62361B_SET3_DATA (0x4600 | TPS62361B_SET3_REG)
|
||||
|
||||
#define TPS65911_I2C_ADDR 0x5A
|
||||
#define TPS65911_VDDCTRL_OP_REG 0x28
|
||||
#define TPS65911_VDDCTRL_SR_REG 0x27
|
||||
#define TPS65911_VDDCTRL_OP_DATA (0x2300 | TPS65911_VDDCTRL_OP_REG)
|
||||
#define TPS65911_VDDCTRL_OP_DATA (0x2400 | TPS65911_VDDCTRL_OP_REG)
|
||||
#define TPS65911_VDDCTRL_SR_DATA (0x0100 | TPS65911_VDDCTRL_SR_REG)
|
||||
#define I2C_SEND_2_BYTES 0x0A02
|
||||
|
||||
@@ -58,9 +66,20 @@ static void enable_cpu_power_rail(void)
|
||||
reg |= CPUPWRREQ_OE;
|
||||
writel(reg, &pmc->pmc_cntrl);
|
||||
|
||||
/* Set VDD_CORE to 1.200V. */
|
||||
#ifdef CONFIG_TEGRA_VDD_CORE_TPS62366A_SET1
|
||||
tegra_i2c_ll_write_addr(TPS62366A_I2C_ADDR, 2);
|
||||
tegra_i2c_ll_write_data(TPS62366A_SET1_DATA, I2C_SEND_2_BYTES);
|
||||
#endif
|
||||
#ifdef CONFIG_TEGRA_VDD_CORE_TPS62361B_SET3
|
||||
tegra_i2c_ll_write_addr(TPS62361B_I2C_ADDR, 2);
|
||||
tegra_i2c_ll_write_data(TPS62361B_SET3_DATA, I2C_SEND_2_BYTES);
|
||||
#endif
|
||||
udelay(1000);
|
||||
|
||||
/*
|
||||
* Bring up CPU VDD via the TPS65911x PMIC on the DVC I2C bus.
|
||||
* First set VDD to 1.4V, then enable the VDD regulator.
|
||||
* First set VDD to 1.0125V, then enable the VDD regulator.
|
||||
*/
|
||||
tegra_i2c_ll_write_addr(TPS65911_I2C_ADDR, 2);
|
||||
tegra_i2c_ll_write_data(TPS65911_VDDCTRL_OP_DATA, I2C_SEND_2_BYTES);
|
||||
|
||||
@@ -16,7 +16,8 @@ SECTIONS
|
||||
.text :
|
||||
{
|
||||
*(.__image_copy_start)
|
||||
arch/arm/cpu/arm920t/start.o (.text*)
|
||||
*(.vectors)
|
||||
arch/arm/cpu/arm920t/start.o (.text*)
|
||||
/* the EP93xx expects to find the pattern 'CRUS' at 0x1000 */
|
||||
. = 0x1000;
|
||||
LONG(0x53555243)
|
||||
|
||||
@@ -12,36 +12,6 @@
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
.globl _start
|
||||
_start: b start_code
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction: .word undefined_instruction
|
||||
_software_interrupt: .word software_interrupt
|
||||
_prefetch_abort: .word prefetch_abort
|
||||
_data_abort: .word data_abort
|
||||
_not_used: .word not_used
|
||||
_irq: .word irq
|
||||
_fiq: .word fiq
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -55,28 +25,9 @@ _fiq: .word fiq
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
.globl reset
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual start code
|
||||
*/
|
||||
|
||||
start_code:
|
||||
reset:
|
||||
/*
|
||||
* set the cpu to SVC32 mode
|
||||
*/
|
||||
@@ -196,166 +147,3 @@ cpu_init_crit:
|
||||
mov lr, ip
|
||||
mov pc, lr
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
ldmia r2, {r2 - r3} @ get pc, cpsr
|
||||
add r0, sp, #S_FRAME_SIZE @ restore sp_SVC
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r7, sp, #S_PC
|
||||
stmdb r7, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r7, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r7, #4] @ Save CPSR
|
||||
str r0, [r7, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
/* return & move spsr_svc into cpsr */
|
||||
subs pc, lr, #4
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
str lr, [r13] @ save caller lr / spsr
|
||||
mrs lr, spsr
|
||||
str lr, [r13, #4]
|
||||
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13
|
||||
mov lr, pc
|
||||
movs pc, lr
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@ void davinci_enable_uart0(void)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SYS_DA850_PLL_INIT)
|
||||
void da850_waitloop(unsigned long loopcnt)
|
||||
static void da850_waitloop(unsigned long loopcnt)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
@@ -34,7 +34,7 @@ void da850_waitloop(unsigned long loopcnt)
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
|
||||
static int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
|
||||
{
|
||||
if (reg == davinci_pllc0_regs)
|
||||
/* Unlock PLL registers. */
|
||||
@@ -160,7 +160,7 @@ int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
|
||||
#endif /* CONFIG_SYS_DA850_PLL_INIT */
|
||||
|
||||
#if defined(CONFIG_SYS_DA850_DDR_INIT)
|
||||
int da850_ddr_setup(void)
|
||||
static int da850_ddr_setup(void)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void davinci_enable_uart0(void)
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_DRIVER_DAVINCI_I2C
|
||||
#ifdef CONFIG_SYS_I2C_DAVINCI
|
||||
void davinci_enable_i2c(void)
|
||||
{
|
||||
lpsc_on(DAVINCI_LPSC_I2C);
|
||||
|
||||
@@ -12,7 +12,7 @@ void davinci_enable_uart0(void)
|
||||
lpsc_on(DAVINCI_LPSC_UART0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRIVER_DAVINCI_I2C
|
||||
#ifdef CONFIG_SYS_I2C_DAVINCI
|
||||
void davinci_enable_i2c(void)
|
||||
{
|
||||
lpsc_on(DAVINCI_LPSC_I2C);
|
||||
|
||||
@@ -47,7 +47,7 @@ void davinci_enable_emac(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DRIVER_DAVINCI_I2C
|
||||
#ifdef CONFIG_SYS_I2C_DAVINCI
|
||||
void davinci_enable_i2c(void)
|
||||
{
|
||||
lpsc_on(DAVINCI_LPSC_I2C);
|
||||
|
||||
@@ -18,7 +18,7 @@ void davinci_enable_emac(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DRIVER_DAVINCI_I2C
|
||||
#ifdef CONFIG_SYS_I2C_DAVINCI
|
||||
void davinci_enable_i2c(void)
|
||||
{
|
||||
lpsc_on(DAVINCI_DM646X_LPSC_I2C);
|
||||
|
||||
@@ -24,70 +24,6 @@
|
||||
#include <common.h>
|
||||
#include <version.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
b reset
|
||||
b undefined_instruction
|
||||
b software_interrupt
|
||||
b prefetch_abort
|
||||
b data_abort
|
||||
b not_used
|
||||
b irq
|
||||
b fiq
|
||||
|
||||
/*
|
||||
* Vector table, located at address 0x20.
|
||||
* This table allows the code running AFTER SPL, the U-Boot, to install it's
|
||||
* interrupt handlers here. The problem is that the U-Boot is loaded into RAM,
|
||||
* including it's interrupt vectoring table and the table at 0x0 is still the
|
||||
* SPLs. So if interrupt happens in U-Boot, the SPLs interrupt vectoring table
|
||||
* is still used.
|
||||
*/
|
||||
_vt_reset:
|
||||
.word _reset
|
||||
_vt_undefined_instruction:
|
||||
.word _hang
|
||||
_vt_software_interrupt:
|
||||
.word _hang
|
||||
_vt_prefetch_abort:
|
||||
.word _hang
|
||||
_vt_data_abort:
|
||||
.word _hang
|
||||
_vt_not_used:
|
||||
.word _reset
|
||||
_vt_irq:
|
||||
.word _hang
|
||||
_vt_fiq:
|
||||
.word _hang
|
||||
|
||||
reset:
|
||||
ldr pc, _vt_reset
|
||||
undefined_instruction:
|
||||
ldr pc, _vt_undefined_instruction
|
||||
software_interrupt:
|
||||
ldr pc, _vt_software_interrupt
|
||||
prefetch_abort:
|
||||
ldr pc, _vt_prefetch_abort
|
||||
data_abort:
|
||||
ldr pc, _vt_data_abort
|
||||
not_used:
|
||||
ldr pc, _vt_not_used
|
||||
irq:
|
||||
ldr pc, _vt_irq
|
||||
fiq:
|
||||
ldr pc, _vt_fiq
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -101,28 +37,8 @@ fiq:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
|
||||
_reset:
|
||||
.globl reset
|
||||
reset:
|
||||
/*
|
||||
* If the CPU is configured in "Wait JTAG connection mode", the stack
|
||||
* pointer is not configured and is zero. This will cause crash when
|
||||
@@ -179,7 +95,3 @@ _reset:
|
||||
mov r0, #0
|
||||
|
||||
bx lr
|
||||
|
||||
_hang:
|
||||
1:
|
||||
bl 1b /* hang and never return */
|
||||
|
||||
@@ -17,29 +17,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction:
|
||||
_software_interrupt:
|
||||
_prefetch_abort:
|
||||
_data_abort:
|
||||
_not_used:
|
||||
_irq:
|
||||
_fiq:
|
||||
.word infinite_loop
|
||||
|
||||
infinite_loop:
|
||||
b infinite_loop
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -53,9 +30,7 @@ infinite_loop:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
|
||||
@@ -21,6 +21,7 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
*(.vectors)
|
||||
arch/arm/cpu/arm926ejs/spear/start.o (.text*)
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
@@ -20,75 +20,6 @@
|
||||
#include <common.h>
|
||||
#include <version.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifdef CONFIG_SYS_DV_NOR_BOOT_CFG
|
||||
.globl _start
|
||||
_start:
|
||||
.globl _NOR_BOOT_CFG
|
||||
_NOR_BOOT_CFG:
|
||||
.word CONFIG_SYS_DV_NOR_BOOT_CFG
|
||||
b reset
|
||||
#else
|
||||
.globl _start
|
||||
_start:
|
||||
b reset
|
||||
#endif
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
/* No exception handlers in preloader */
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
|
||||
_hang:
|
||||
.word do_hang
|
||||
/* pad to 64 byte boundary */
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
#else
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction:
|
||||
.word undefined_instruction
|
||||
_software_interrupt:
|
||||
.word software_interrupt
|
||||
_prefetch_abort:
|
||||
.word prefetch_abort
|
||||
_data_abort:
|
||||
.word data_abort
|
||||
_not_used:
|
||||
.word not_used
|
||||
_irq:
|
||||
.word irq
|
||||
_fiq:
|
||||
.word fiq
|
||||
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -102,26 +33,7 @@ _fiq:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -198,175 +110,3 @@ flush_dcache:
|
||||
mov lr, ip /* restore link */
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
@ carve out a frame on current user stack
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
@ get values for "aborted" pc and cpsr (into parm regs)
|
||||
ldmia r2, {r2 - r3}
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0 (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
@ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
|
||||
add r8, sp, #S_PC
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of saved stack
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction & switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
.align 5
|
||||
do_hang:
|
||||
1:
|
||||
bl 1b /* hang and never return */
|
||||
#else /* !CONFIG_SPL_BUILD */
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
static void cache_flush(void);
|
||||
|
||||
@@ -51,3 +52,15 @@ static void cache_flush (void)
|
||||
asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
|
||||
asm ("mcr p15, 0, %0, c7, c6, 0": :"r" (i));
|
||||
}
|
||||
|
||||
#ifndef CONFIG_INTEGRATOR
|
||||
|
||||
__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
|
||||
{
|
||||
writew(0x0, 0xfffece10);
|
||||
writew(0x8, 0xfffece10);
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
||||
#endif /* #ifdef CONFIG_INTEGRATOR */
|
||||
|
||||
@@ -19,45 +19,6 @@
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction:
|
||||
.word undefined_instruction
|
||||
_software_interrupt:
|
||||
.word software_interrupt
|
||||
_prefetch_abort:
|
||||
.word prefetch_abort
|
||||
_data_abort:
|
||||
.word data_abort
|
||||
_not_used:
|
||||
.word not_used
|
||||
_irq:
|
||||
.word irq
|
||||
_fiq:
|
||||
.word fiq
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
_vectors_end:
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -71,26 +32,7 @@ _vectors_end:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -157,189 +99,3 @@ cpu_init_crit:
|
||||
mov lr, ip /* restore link */
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
@ carve out a frame on current user stack
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
@ get values for "aborted" pc and cpsr (into parm regs)
|
||||
ldmia r2, {r2 - r3}
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0 (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
@ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
|
||||
add r8, sp, #S_PC
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of saved stack
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction & switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
|
||||
# ifdef CONFIG_INTEGRATOR
|
||||
|
||||
/* Satisfied by general board level routine */
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
.globl reset_cpu
|
||||
reset_cpu:
|
||||
|
||||
ldr r1, rstctl1 /* get clkm1 reset ctl */
|
||||
mov r3, #0x0
|
||||
strh r3, [r1] /* clear it */
|
||||
mov r3, #0x8
|
||||
strh r3, [r1] /* force dsp+arm reset */
|
||||
_loop_forever:
|
||||
b _loop_forever
|
||||
|
||||
rstctl1:
|
||||
.word 0xfffece10
|
||||
|
||||
#endif /* #ifdef CONFIG_INTEGRATOR */
|
||||
|
||||
@@ -18,42 +18,6 @@
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction:
|
||||
.word undefined_instruction
|
||||
_software_interrupt:
|
||||
.word software_interrupt
|
||||
_prefetch_abort:
|
||||
.word prefetch_abort
|
||||
_data_abort:
|
||||
.word data_abort
|
||||
_not_used:
|
||||
.word not_used
|
||||
_irq:
|
||||
.word irq
|
||||
_fiq:
|
||||
.word fiq
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -67,26 +31,7 @@ _fiq:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -132,174 +77,3 @@ cpu_init_crit:
|
||||
*/
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
@ carve out a frame on current user stack
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
@ get values for "aborted" pc and cpsr (into parm regs)
|
||||
ldmia r2, {r2 - r3}
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0 (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
@ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
|
||||
add r8, sp, #S_PC
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of saved stack
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction & switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
.globl undefined_instruction
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
.globl software_interrupt
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
.globl prefetch_abort
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
.globl data_abort
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
.globl not_used
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
.align 5
|
||||
.globl irq
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
.globl fiq
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
.globl irq
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
.globl fiq
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,7 @@ endif
|
||||
|
||||
obj-$(CONFIG_KONA) += kona-common/
|
||||
obj-$(CONFIG_OMAP_COMMON) += omap-common/
|
||||
obj-$(CONFIG_SYS_ARCH_TIMER) += arch_timer.o
|
||||
obj-$(CONFIG_TEGRA) += tegra-common/
|
||||
|
||||
ifneq (,$(filter s5pc1xx exynos,$(SOC)))
|
||||
|
||||
@@ -14,7 +14,6 @@ endif
|
||||
|
||||
obj-$(CONFIG_TI816X) += clock_ti816x.o
|
||||
obj-y += sys_info.o
|
||||
obj-y += mem.o
|
||||
obj-y += ddr.o
|
||||
obj-y += emif4.o
|
||||
obj-y += board.o
|
||||
|
||||
@@ -142,7 +142,7 @@ int arch_misc_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
/*
|
||||
* This function is the place to do per-board things such as ramp up the
|
||||
* MPU clock frequency.
|
||||
@@ -200,9 +200,7 @@ static void watchdog_disable(void)
|
||||
while (readl(&wdtimer->wdtwwps) != 0x0)
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
|
||||
void s_init(void)
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -35,7 +35,7 @@ void dram_init_banksize(void)
|
||||
}
|
||||
|
||||
|
||||
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
#ifdef CONFIG_TI81XX
|
||||
static struct dmm_lisa_map_regs *hw_lisa_map_regs =
|
||||
(struct dmm_lisa_map_regs *)DMM_BASE;
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* (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>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
||||
|
||||
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;
|
||||
#if defined(CONFIG_NOR)
|
||||
/* configure GPMC for NOR */
|
||||
const u32 gpmc_regs[GPMC_MAX_REG] = { STNOR_GPMC_CONFIG1,
|
||||
STNOR_GPMC_CONFIG2,
|
||||
STNOR_GPMC_CONFIG3,
|
||||
STNOR_GPMC_CONFIG4,
|
||||
STNOR_GPMC_CONFIG5,
|
||||
STNOR_GPMC_CONFIG6,
|
||||
STNOR_GPMC_CONFIG7
|
||||
};
|
||||
u32 size = GPMC_SIZE_16M;
|
||||
u32 base = CONFIG_SYS_FLASH_BASE;
|
||||
#elif defined(CONFIG_NAND)
|
||||
/* configure GPMC for NAND */
|
||||
const u32 gpmc_regs[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
|
||||
};
|
||||
u32 size = GPMC_SIZE_256M;
|
||||
u32 base = CONFIG_SYS_NAND_BASE;
|
||||
#else
|
||||
const u32 gpmc_regs[GPMC_MAX_REG] = { 0, 0, 0, 0, 0, 0, 0 };
|
||||
u32 size = 0;
|
||||
u32 base = 0;
|
||||
#endif
|
||||
/* global settings */
|
||||
writel(0x00000008, &gpmc_cfg->sysconfig);
|
||||
writel(0x00000000, &gpmc_cfg->irqstatus);
|
||||
writel(0x00000000, &gpmc_cfg->irqenable);
|
||||
#ifdef CONFIG_NOR
|
||||
writel(0x00000200, &gpmc_cfg->config);
|
||||
#else
|
||||
writel(0x00000012, &gpmc_cfg->config);
|
||||
#endif
|
||||
/*
|
||||
* Disable the GPMC0 config set by ROM code
|
||||
*/
|
||||
writel(0, &gpmc_cfg->cs[0].config7);
|
||||
sdelay(1000);
|
||||
/* enable chip-select specific configurations */
|
||||
enable_gpmc_cs_config(gpmc_regs, &gpmc_cfg->cs[0], base, size);
|
||||
}
|
||||
@@ -79,12 +79,24 @@ u32 get_sysboot_value(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DISPLAY_CPUINFO
|
||||
static char *cpu_revs[] = {
|
||||
"1.0",
|
||||
"2.0",
|
||||
"2.1"};
|
||||
|
||||
|
||||
static char *dev_types[] = {
|
||||
"TST",
|
||||
"EMU",
|
||||
"HS",
|
||||
"GP"};
|
||||
|
||||
/**
|
||||
* Print CPU information
|
||||
*/
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
char *cpu_s, *sec_s;
|
||||
char *cpu_s, *sec_s, *rev_s;
|
||||
|
||||
switch (get_cpu_type()) {
|
||||
case AM335X:
|
||||
@@ -94,28 +106,21 @@ int print_cpuinfo(void)
|
||||
cpu_s = "TI81XX";
|
||||
break;
|
||||
default:
|
||||
cpu_s = "Unknown cpu type";
|
||||
cpu_s = "Unknown CPU type";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (get_device_type()) {
|
||||
case TST_DEVICE:
|
||||
sec_s = "TST";
|
||||
break;
|
||||
case EMU_DEVICE:
|
||||
sec_s = "EMU";
|
||||
break;
|
||||
case HS_DEVICE:
|
||||
sec_s = "HS";
|
||||
break;
|
||||
case GP_DEVICE:
|
||||
sec_s = "GP";
|
||||
break;
|
||||
default:
|
||||
if (get_cpu_rev() < ARRAY_SIZE(cpu_revs))
|
||||
rev_s = cpu_revs[get_cpu_rev()];
|
||||
else
|
||||
rev_s = "?";
|
||||
|
||||
if (get_device_type() < ARRAY_SIZE(dev_types))
|
||||
sec_s = dev_types[get_device_type()];
|
||||
else
|
||||
sec_s = "?";
|
||||
}
|
||||
|
||||
printf("%s-%s rev %d\n", cpu_s, sec_s, get_cpu_rev());
|
||||
printf("%s-%s rev %s\n", cpu_s, sec_s, rev_s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
58
arch/arm/cpu/armv7/arch_timer.c
Normal file
58
arch/arm/cpu/armv7/arch_timer.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <div64.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int timer_init(void)
|
||||
{
|
||||
gd->arch.tbl = 0;
|
||||
gd->arch.tbu = 0;
|
||||
|
||||
gd->arch.timer_rate_hz = CONFIG_SYS_HZ_CLOCK / CONFIG_SYS_HZ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long get_ticks(void)
|
||||
{
|
||||
ulong nowl, nowu;
|
||||
|
||||
asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (nowl), "=r" (nowu));
|
||||
|
||||
gd->arch.tbl = nowl;
|
||||
gd->arch.tbu = nowu;
|
||||
|
||||
return (((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl;
|
||||
}
|
||||
|
||||
|
||||
ulong get_timer(ulong base)
|
||||
{
|
||||
return lldiv(get_ticks(), gd->arch.timer_rate_hz) - base;
|
||||
}
|
||||
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
unsigned long long endtime;
|
||||
|
||||
endtime = lldiv((unsigned long long)usec * gd->arch.timer_rate_hz,
|
||||
1000UL);
|
||||
|
||||
endtime += get_ticks();
|
||||
|
||||
while (get_ticks() < endtime)
|
||||
;
|
||||
}
|
||||
|
||||
ulong get_tbclk(void)
|
||||
{
|
||||
return gd->arch.timer_rate_hz;
|
||||
}
|
||||
@@ -13,30 +13,23 @@
|
||||
|
||||
static void exynos5_uart_config(int peripheral)
|
||||
{
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
struct s5p_gpio_bank *bank;
|
||||
int i, start, count;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
bank = &gpio1->a0;
|
||||
start = 0;
|
||||
start = EXYNOS5_GPIO_A00;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART1:
|
||||
bank = &gpio1->d0;
|
||||
start = 0;
|
||||
start = EXYNOS5_GPIO_D00;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART2:
|
||||
bank = &gpio1->a1;
|
||||
start = 0;
|
||||
start = EXYNOS5_GPIO_A10;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART3:
|
||||
bank = &gpio1->a1;
|
||||
start = 4;
|
||||
start = EXYNOS5_GPIO_A14;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
@@ -44,37 +37,30 @@ static void exynos5_uart_config(int peripheral)
|
||||
return;
|
||||
}
|
||||
for (i = start; i < start + count; i++) {
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos5420_uart_config(int peripheral)
|
||||
{
|
||||
struct exynos5420_gpio_part1 *gpio1 =
|
||||
(struct exynos5420_gpio_part1 *)samsung_get_base_gpio_part1();
|
||||
struct s5p_gpio_bank *bank;
|
||||
int i, start, count;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
bank = &gpio1->a0;
|
||||
start = 0;
|
||||
start = EXYNOS5420_GPIO_A00;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART1:
|
||||
bank = &gpio1->a0;
|
||||
start = 4;
|
||||
start = EXYNOS5420_GPIO_A04;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART2:
|
||||
bank = &gpio1->a1;
|
||||
start = 0;
|
||||
start = EXYNOS5420_GPIO_A10;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART3:
|
||||
bank = &gpio1->a1;
|
||||
start = 4;
|
||||
start = EXYNOS5420_GPIO_A14;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
@@ -83,64 +69,59 @@ static void exynos5420_uart_config(int peripheral)
|
||||
}
|
||||
|
||||
for (i = start; i < start + count; i++) {
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
}
|
||||
}
|
||||
|
||||
static int exynos5_mmc_config(int peripheral, int flags)
|
||||
{
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
struct s5p_gpio_bank *bank, *bank_ext;
|
||||
int i, start = 0, gpio_func = 0;
|
||||
int i, start, start_ext, gpio_func = 0;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SDMMC0:
|
||||
bank = &gpio1->c0;
|
||||
bank_ext = &gpio1->c1;
|
||||
start = 0;
|
||||
gpio_func = GPIO_FUNC(0x2);
|
||||
start = EXYNOS5_GPIO_C00;
|
||||
start_ext = EXYNOS5_GPIO_C10;
|
||||
gpio_func = S5P_GPIO_FUNC(0x2);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC1:
|
||||
bank = &gpio1->c2;
|
||||
bank_ext = NULL;
|
||||
start = EXYNOS5_GPIO_C20;
|
||||
start_ext = 0;
|
||||
break;
|
||||
case PERIPH_ID_SDMMC2:
|
||||
bank = &gpio1->c3;
|
||||
bank_ext = &gpio1->c4;
|
||||
start = 3;
|
||||
gpio_func = GPIO_FUNC(0x3);
|
||||
start = EXYNOS5_GPIO_C30;
|
||||
start_ext = EXYNOS5_GPIO_C43;
|
||||
gpio_func = S5P_GPIO_FUNC(0x3);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC3:
|
||||
bank = &gpio1->c4;
|
||||
bank_ext = NULL;
|
||||
start = EXYNOS5_GPIO_C40;
|
||||
start_ext = 0;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
}
|
||||
if ((flags & PINMUX_FLAG_8BIT_MODE) && !bank_ext) {
|
||||
if ((flags & PINMUX_FLAG_8BIT_MODE) && !start_ext) {
|
||||
debug("SDMMC device %d does not support 8bit mode",
|
||||
peripheral);
|
||||
return -1;
|
||||
}
|
||||
if (flags & PINMUX_FLAG_8BIT_MODE) {
|
||||
for (i = start; i <= (start + 3); i++) {
|
||||
s5p_gpio_cfg_pin(bank_ext, i, gpio_func);
|
||||
s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_UP);
|
||||
s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
|
||||
for (i = start_ext; i <= (start_ext + 3); i++) {
|
||||
gpio_cfg_pin(i, gpio_func);
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_UP);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
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);
|
||||
for (i = start; i < (start + 2); i++) {
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
for (i = 3; i <= 6; i++) {
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_UP);
|
||||
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
|
||||
for (i = (start + 3); i <= (start + 6); i++) {
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_UP);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -148,26 +129,20 @@ static int exynos5_mmc_config(int peripheral, int flags)
|
||||
|
||||
static int exynos5420_mmc_config(int peripheral, int flags)
|
||||
{
|
||||
struct exynos5420_gpio_part3 *gpio3 =
|
||||
(struct exynos5420_gpio_part3 *)samsung_get_base_gpio_part3();
|
||||
struct s5p_gpio_bank *bank = NULL, *bank_ext = NULL;
|
||||
int i, start;
|
||||
int i, start = 0, start_ext = 0;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SDMMC0:
|
||||
bank = &gpio3->c0;
|
||||
bank_ext = &gpio3->c3;
|
||||
start = 0;
|
||||
start = EXYNOS5420_GPIO_C00;
|
||||
start_ext = EXYNOS5420_GPIO_C30;
|
||||
break;
|
||||
case PERIPH_ID_SDMMC1:
|
||||
bank = &gpio3->c1;
|
||||
bank_ext = &gpio3->d1;
|
||||
start = 4;
|
||||
start = EXYNOS5420_GPIO_C10;
|
||||
start_ext = EXYNOS5420_GPIO_D14;
|
||||
break;
|
||||
case PERIPH_ID_SDMMC2:
|
||||
bank = &gpio3->c2;
|
||||
bank_ext = NULL;
|
||||
start = 0;
|
||||
start = EXYNOS5420_GPIO_C20;
|
||||
start_ext = 0;
|
||||
break;
|
||||
default:
|
||||
start = 0;
|
||||
@@ -175,41 +150,41 @@ static int exynos5420_mmc_config(int peripheral, int flags)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((flags & PINMUX_FLAG_8BIT_MODE) && !bank_ext) {
|
||||
if ((flags & PINMUX_FLAG_8BIT_MODE) && !start_ext) {
|
||||
debug("SDMMC device %d does not support 8bit mode",
|
||||
peripheral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (flags & PINMUX_FLAG_8BIT_MODE) {
|
||||
for (i = start; i <= (start + 3); i++) {
|
||||
s5p_gpio_cfg_pin(bank_ext, i, GPIO_FUNC(0x2));
|
||||
s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_UP);
|
||||
s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
|
||||
for (i = start_ext; i <= (start_ext + 3); i++) {
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_UP);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = start; i < (start + 3); i++) {
|
||||
/*
|
||||
* MMC0 is intended to be used for eMMC. The
|
||||
* card detect pin is used as a VDDEN signal to
|
||||
* power on the eMMC. The 5420 iROM makes
|
||||
* this same assumption.
|
||||
*/
|
||||
if ((peripheral == PERIPH_ID_SDMMC0) && (i == 2)) {
|
||||
s5p_gpio_set_value(bank, i, 1);
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_OUTPUT);
|
||||
if ((peripheral == PERIPH_ID_SDMMC0) && (i == (start + 2))) {
|
||||
gpio_set_value(i, 1);
|
||||
gpio_cfg_pin(i, S5P_GPIO_OUTPUT);
|
||||
} else {
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
}
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
|
||||
for (i = 3; i <= 6; i++) {
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_UP);
|
||||
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
|
||||
for (i = (start + 3); i <= (start + 6); i++) {
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_UP);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -217,8 +192,6 @@ static int exynos5420_mmc_config(int peripheral, int flags)
|
||||
|
||||
static void exynos5_sromc_config(int flags)
|
||||
{
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -236,13 +209,13 @@ static void exynos5_sromc_config(int flags)
|
||||
* GPY1[2] SROM_WAIT(2)
|
||||
* GPY1[3] EBI_DATA_RDn(2)
|
||||
*/
|
||||
s5p_gpio_cfg_pin(&gpio1->y0, (flags & PINMUX_FLAG_BANK),
|
||||
GPIO_FUNC(2));
|
||||
s5p_gpio_cfg_pin(&gpio1->y0, 4, GPIO_FUNC(2));
|
||||
s5p_gpio_cfg_pin(&gpio1->y0, 5, GPIO_FUNC(2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y00 + (flags & PINMUX_FLAG_BANK),
|
||||
S5P_GPIO_FUNC(2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y04, S5P_GPIO_FUNC(2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y05, S5P_GPIO_FUNC(2));
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
s5p_gpio_cfg_pin(&gpio1->y1, i, GPIO_FUNC(2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y10 + i, S5P_GPIO_FUNC(2));
|
||||
|
||||
/*
|
||||
* EBI: 8 Addrss Lines
|
||||
@@ -277,108 +250,101 @@ static void exynos5_sromc_config(int flags)
|
||||
* GPY6[7] EBI_DATA[15](2)
|
||||
*/
|
||||
for (i = 0; i < 8; i++) {
|
||||
s5p_gpio_cfg_pin(&gpio1->y3, i, GPIO_FUNC(2));
|
||||
s5p_gpio_set_pull(&gpio1->y3, i, GPIO_PULL_UP);
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y30 + i, S5P_GPIO_FUNC(2));
|
||||
gpio_set_pull(EXYNOS5_GPIO_Y30 + i, S5P_GPIO_PULL_UP);
|
||||
|
||||
s5p_gpio_cfg_pin(&gpio1->y5, i, GPIO_FUNC(2));
|
||||
s5p_gpio_set_pull(&gpio1->y5, i, GPIO_PULL_UP);
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y50 + i, S5P_GPIO_FUNC(2));
|
||||
gpio_set_pull(EXYNOS5_GPIO_Y50 + i, S5P_GPIO_PULL_UP);
|
||||
|
||||
s5p_gpio_cfg_pin(&gpio1->y6, i, GPIO_FUNC(2));
|
||||
s5p_gpio_set_pull(&gpio1->y6, i, GPIO_PULL_UP);
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Y60 + i, S5P_GPIO_FUNC(2));
|
||||
gpio_set_pull(EXYNOS5_GPIO_Y60 + i, S5P_GPIO_PULL_UP);
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos5_i2c_config(int peripheral, int flags)
|
||||
{
|
||||
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_I2C0:
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 0, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 1, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B30, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B31, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C1:
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 2, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 3, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B32, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B33, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C2:
|
||||
s5p_gpio_cfg_pin(&gpio1->a0, 6, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a0, 7, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A06, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A07, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C3:
|
||||
s5p_gpio_cfg_pin(&gpio1->a1, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a1, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A12, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A13, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C4:
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 0, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 1, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A20, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A21, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C5:
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A22, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A23, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C6:
|
||||
s5p_gpio_cfg_pin(&gpio1->b1, 3, GPIO_FUNC(0x4));
|
||||
s5p_gpio_cfg_pin(&gpio1->b1, 4, GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B13, S5P_GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B14, S5P_GPIO_FUNC(0x4));
|
||||
break;
|
||||
case PERIPH_ID_I2C7:
|
||||
s5p_gpio_cfg_pin(&gpio1->b2, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->b2, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B22, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B23, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos5420_i2c_config(int peripheral)
|
||||
{
|
||||
struct exynos5420_gpio_part1 *gpio1 =
|
||||
(struct exynos5420_gpio_part1 *)samsung_get_base_gpio_part1();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_I2C0:
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 0, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 1, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B30, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B31, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C1:
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 2, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 3, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B32, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B33, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C2:
|
||||
s5p_gpio_cfg_pin(&gpio1->a0, 6, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a0, 7, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A06, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A07, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C3:
|
||||
s5p_gpio_cfg_pin(&gpio1->a1, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a1, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A12, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A13, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C4:
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 0, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 1, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A20, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A21, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C5:
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a2, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A22, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_A23, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C6:
|
||||
s5p_gpio_cfg_pin(&gpio1->b1, 3, GPIO_FUNC(0x4));
|
||||
s5p_gpio_cfg_pin(&gpio1->b1, 4, GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B13, S5P_GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B14, S5P_GPIO_FUNC(0x4));
|
||||
break;
|
||||
case PERIPH_ID_I2C7:
|
||||
s5p_gpio_cfg_pin(&gpio1->b2, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->b2, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B22, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B23, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C8:
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 4, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 5, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B34, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B35, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C9:
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 6, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b3, 7, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B36, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B37, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C10:
|
||||
s5p_gpio_cfg_pin(&gpio1->b4, 0, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->b4, 1, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B40, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_B41, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -386,19 +352,15 @@ static void exynos5420_i2c_config(int peripheral)
|
||||
static void exynos5_i2s_config(int peripheral)
|
||||
{
|
||||
int i;
|
||||
struct exynos5_gpio_part1 *gpio1 =
|
||||
(struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
|
||||
struct exynos5_gpio_part4 *gpio4 =
|
||||
(struct exynos5_gpio_part4 *)samsung_get_base_gpio_part4();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_I2S0:
|
||||
for (i = 0; i < 5; i++)
|
||||
s5p_gpio_cfg_pin(&gpio4->z, i, GPIO_FUNC(0x02));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_Z0 + i, S5P_GPIO_FUNC(0x02));
|
||||
break;
|
||||
case PERIPH_ID_I2S1:
|
||||
for (i = 0; i < 5; i++)
|
||||
s5p_gpio_cfg_pin(&gpio1->b0, i, GPIO_FUNC(0x02));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B00 + i, S5P_GPIO_FUNC(0x02));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -406,75 +368,57 @@ static void exynos5_i2s_config(int peripheral)
|
||||
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;
|
||||
cfg = S5P_GPIO_FUNC(0x2);
|
||||
pin = EXYNOS5_GPIO_A20;
|
||||
break;
|
||||
case PERIPH_ID_SPI1:
|
||||
bank = &gpio1->a2;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 4;
|
||||
cfg = S5P_GPIO_FUNC(0x2);
|
||||
pin = EXYNOS5_GPIO_A24;
|
||||
break;
|
||||
case PERIPH_ID_SPI2:
|
||||
bank = &gpio1->b1;
|
||||
cfg = GPIO_FUNC(0x5);
|
||||
pin = 1;
|
||||
cfg = S5P_GPIO_FUNC(0x5);
|
||||
pin = EXYNOS5_GPIO_B11;
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
bank = &gpio2->f1;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 0;
|
||||
cfg = S5P_GPIO_FUNC(0x2);
|
||||
pin = EXYNOS5_GPIO_F10;
|
||||
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));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_F02 + i, S5P_GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_E04 + i, S5P_GPIO_FUNC(0x4));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (peripheral != PERIPH_ID_SPI4) {
|
||||
for (i = pin; i < pin + 4; i++)
|
||||
s5p_gpio_cfg_pin(bank, i, cfg);
|
||||
gpio_cfg_pin(i, cfg);
|
||||
}
|
||||
}
|
||||
|
||||
void exynos5420_spi_config(int peripheral)
|
||||
{
|
||||
int cfg, pin, i;
|
||||
struct s5p_gpio_bank *bank = NULL;
|
||||
struct exynos5420_gpio_part1 *gpio1 =
|
||||
(struct exynos5420_gpio_part1 *)samsung_get_base_gpio_part1();
|
||||
struct exynos5420_gpio_part4 *gpio4 =
|
||||
(struct exynos5420_gpio_part4 *)samsung_get_base_gpio_part4();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SPI0:
|
||||
bank = &gpio1->a2;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 0;
|
||||
pin = EXYNOS5420_GPIO_A20;
|
||||
cfg = S5P_GPIO_FUNC(0x2);
|
||||
break;
|
||||
case PERIPH_ID_SPI1:
|
||||
bank = &gpio1->a2;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 4;
|
||||
pin = EXYNOS5420_GPIO_A24;
|
||||
cfg = S5P_GPIO_FUNC(0x2);
|
||||
break;
|
||||
case PERIPH_ID_SPI2:
|
||||
bank = &gpio1->b1;
|
||||
cfg = GPIO_FUNC(0x5);
|
||||
pin = 1;
|
||||
pin = EXYNOS5420_GPIO_B11;
|
||||
cfg = S5P_GPIO_FUNC(0x5);
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
bank = &gpio4->f1;
|
||||
cfg = GPIO_FUNC(0x2);
|
||||
pin = 0;
|
||||
pin = EXYNOS5420_GPIO_F10;
|
||||
cfg = S5P_GPIO_FUNC(0x2);
|
||||
break;
|
||||
case PERIPH_ID_SPI4:
|
||||
cfg = 0;
|
||||
@@ -489,11 +433,13 @@ void exynos5420_spi_config(int peripheral)
|
||||
|
||||
if (peripheral != PERIPH_ID_SPI4) {
|
||||
for (i = pin; i < pin + 4; i++)
|
||||
s5p_gpio_cfg_pin(bank, i, cfg);
|
||||
gpio_cfg_pin(i, cfg);
|
||||
} else {
|
||||
for (i = 0; i < 2; i++) {
|
||||
s5p_gpio_cfg_pin(&gpio4->f0, i + 2, GPIO_FUNC(0x4));
|
||||
s5p_gpio_cfg_pin(&gpio4->e0, i + 4, GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_F02 + i,
|
||||
S5P_GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS5420_GPIO_E04 + i,
|
||||
S5P_GPIO_FUNC(0x4));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,76 +534,70 @@ static int exynos5420_pinmux_config(int peripheral, int flags)
|
||||
|
||||
static void exynos4_i2c_config(int peripheral, int flags)
|
||||
{
|
||||
struct exynos4_gpio_part1 *gpio1 =
|
||||
(struct exynos4_gpio_part1 *) samsung_get_base_gpio_part1();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_I2C0:
|
||||
s5p_gpio_cfg_pin(&gpio1->d1, 0, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->d1, 1, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_D10, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_D11, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C1:
|
||||
s5p_gpio_cfg_pin(&gpio1->d1, 2, GPIO_FUNC(0x2));
|
||||
s5p_gpio_cfg_pin(&gpio1->d1, 3, GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_D12, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_D13, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C2:
|
||||
s5p_gpio_cfg_pin(&gpio1->a0, 6, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a0, 7, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_A06, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_A07, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C3:
|
||||
s5p_gpio_cfg_pin(&gpio1->a1, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->a1, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_A12, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_A13, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C4:
|
||||
s5p_gpio_cfg_pin(&gpio1->b, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->b, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_B2, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_B3, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C5:
|
||||
s5p_gpio_cfg_pin(&gpio1->b, 6, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->b, 7, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_B6, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_B7, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C6:
|
||||
s5p_gpio_cfg_pin(&gpio1->c1, 3, GPIO_FUNC(0x4));
|
||||
s5p_gpio_cfg_pin(&gpio1->c1, 4, GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_C13, S5P_GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_C14, S5P_GPIO_FUNC(0x4));
|
||||
break;
|
||||
case PERIPH_ID_I2C7:
|
||||
s5p_gpio_cfg_pin(&gpio1->d0, 2, GPIO_FUNC(0x3));
|
||||
s5p_gpio_cfg_pin(&gpio1->d0, 3, GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_D02, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4_GPIO_D03, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
int i, start = 0, start_ext = 0;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SDMMC0:
|
||||
bank = &gpio2->k0;
|
||||
bank_ext = &gpio2->k1;
|
||||
start = EXYNOS4_GPIO_K00;
|
||||
start_ext = EXYNOS4_GPIO_K13;
|
||||
break;
|
||||
case PERIPH_ID_SDMMC2:
|
||||
bank = &gpio2->k2;
|
||||
bank_ext = &gpio2->k3;
|
||||
start = EXYNOS4_GPIO_K20;
|
||||
start_ext = EXYNOS4_GPIO_K33;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
for (i = 0; i < 7; i++) {
|
||||
if (i == 2)
|
||||
for (i = start; i < (start + 7); i++) {
|
||||
if (i == (start + 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);
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_set_drv(i, S5P_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);
|
||||
for (i = start_ext; i < (start_ext + 4); i++) {
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x3));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,41 +606,138 @@ static int exynos4_mmc_config(int peripheral, int flags)
|
||||
|
||||
static void exynos4_uart_config(int peripheral)
|
||||
{
|
||||
struct exynos4_gpio_part1 *gpio1 =
|
||||
(struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1();
|
||||
struct s5p_gpio_bank *bank;
|
||||
int i, start, count;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
bank = &gpio1->a0;
|
||||
start = 0;
|
||||
start = EXYNOS4_GPIO_A00;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART1:
|
||||
bank = &gpio1->a0;
|
||||
start = 4;
|
||||
start = EXYNOS4_GPIO_A04;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART2:
|
||||
bank = &gpio1->a1;
|
||||
start = 0;
|
||||
start = EXYNOS4_GPIO_A10;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART3:
|
||||
bank = &gpio1->a1;
|
||||
start = 4;
|
||||
start = EXYNOS4_GPIO_A14;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return;
|
||||
}
|
||||
for (i = start; i < start + count; i++) {
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
|
||||
for (i = start; i < (start + count); i++) {
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos4x12_i2c_config(int peripheral, int flags)
|
||||
{
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_I2C0:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_D10, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_D11, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C1:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_D12, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_D13, S5P_GPIO_FUNC(0x2));
|
||||
break;
|
||||
case PERIPH_ID_I2C2:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_A06, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_A07, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C3:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_A12, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_A13, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C4:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_B2, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_B3, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C5:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_B6, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_B7, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
case PERIPH_ID_I2C6:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_C13, S5P_GPIO_FUNC(0x4));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_C14, S5P_GPIO_FUNC(0x4));
|
||||
break;
|
||||
case PERIPH_ID_I2C7:
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_D02, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS4X12_GPIO_D03, S5P_GPIO_FUNC(0x3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int exynos4x12_mmc_config(int peripheral, int flags)
|
||||
{
|
||||
int i, start = 0, start_ext = 0;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_SDMMC0:
|
||||
start = EXYNOS4X12_GPIO_K00;
|
||||
start_ext = EXYNOS4X12_GPIO_K13;
|
||||
break;
|
||||
case PERIPH_ID_SDMMC2:
|
||||
start = EXYNOS4X12_GPIO_K20;
|
||||
start_ext = EXYNOS4X12_GPIO_K33;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
for (i = start; i < (start + 7); i++) {
|
||||
if (i == (start + 2))
|
||||
continue;
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
if (flags & PINMUX_FLAG_8BIT_MODE) {
|
||||
for (i = start_ext; i < (start_ext + 4); i++) {
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x3));
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void exynos4x12_uart_config(int peripheral)
|
||||
{
|
||||
int i, start, count;
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
start = EXYNOS4X12_GPIO_A00;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART1:
|
||||
start = EXYNOS4X12_GPIO_A04;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART2:
|
||||
start = EXYNOS4X12_GPIO_A10;
|
||||
count = 4;
|
||||
break;
|
||||
case PERIPH_ID_UART3:
|
||||
start = EXYNOS4X12_GPIO_A14;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return;
|
||||
}
|
||||
for (i = start; i < (start + count); i++) {
|
||||
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
||||
gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
|
||||
}
|
||||
}
|
||||
|
||||
static int exynos4_pinmux_config(int peripheral, int flags)
|
||||
{
|
||||
switch (peripheral) {
|
||||
@@ -736,6 +773,41 @@ static int exynos4_pinmux_config(int peripheral, int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int exynos4x12_pinmux_config(int peripheral, int flags)
|
||||
{
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
case PERIPH_ID_UART1:
|
||||
case PERIPH_ID_UART2:
|
||||
case PERIPH_ID_UART3:
|
||||
exynos4x12_uart_config(peripheral);
|
||||
break;
|
||||
case PERIPH_ID_I2C0:
|
||||
case PERIPH_ID_I2C1:
|
||||
case PERIPH_ID_I2C2:
|
||||
case PERIPH_ID_I2C3:
|
||||
case PERIPH_ID_I2C4:
|
||||
case PERIPH_ID_I2C5:
|
||||
case PERIPH_ID_I2C6:
|
||||
case PERIPH_ID_I2C7:
|
||||
exynos4x12_i2c_config(peripheral, flags);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC0:
|
||||
case PERIPH_ID_SDMMC2:
|
||||
return exynos4x12_mmc_config(peripheral, flags);
|
||||
case PERIPH_ID_SDMMC1:
|
||||
case PERIPH_ID_SDMMC3:
|
||||
case PERIPH_ID_SDMMC4:
|
||||
debug("SDMMC device %d not implemented\n", peripheral);
|
||||
return -1;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int exynos_pinmux_config(int peripheral, int flags)
|
||||
{
|
||||
if (cpu_is_exynos5()) {
|
||||
@@ -744,11 +816,14 @@ int exynos_pinmux_config(int peripheral, int flags)
|
||||
else if (proid_is_exynos5250())
|
||||
return exynos5_pinmux_config(peripheral, flags);
|
||||
} else if (cpu_is_exynos4()) {
|
||||
return exynos4_pinmux_config(peripheral, flags);
|
||||
} else {
|
||||
debug("pinmux functionality not supported\n");
|
||||
if (proid_is_exynos4412())
|
||||
return exynos4x12_pinmux_config(peripheral, flags);
|
||||
else
|
||||
return exynos4_pinmux_config(peripheral, flags);
|
||||
}
|
||||
|
||||
debug("pinmux functionality not supported\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -787,7 +862,7 @@ int pinmux_decode_periph_id(const void *blob, int node)
|
||||
return exynos5_pinmux_decode_periph_id(blob, node);
|
||||
else if (cpu_is_exynos4())
|
||||
return exynos4_pinmux_decode_periph_id(blob, node);
|
||||
else
|
||||
return PERIPH_ID_NONE;
|
||||
|
||||
return PERIPH_ID_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
17
arch/arm/cpu/armv7/keystone/Makefile
Normal file
17
arch/arm/cpu/armv7/keystone/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# (C) Copyright 2012-2014
|
||||
# Texas Instruments Incorporated, <www.ti.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += aemif.o
|
||||
obj-y += init.o
|
||||
obj-y += psc.o
|
||||
obj-y += clock.o
|
||||
obj-y += cmd_clock.o
|
||||
obj-y += cmd_mon.o
|
||||
obj-y += keystone_nav.o
|
||||
obj-y += msmc.o
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||
obj-y += ddr3.o
|
||||
71
arch/arm/cpu/armv7/keystone/aemif.c
Normal file
71
arch/arm/cpu/armv7/keystone/aemif.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Keystone2: Asynchronous EMIF Configuration
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/emif_defs.h>
|
||||
|
||||
#define AEMIF_CFG_SELECT_STROBE(v) ((v) ? 1 << 31 : 0)
|
||||
#define AEMIF_CFG_EXTEND_WAIT(v) ((v) ? 1 << 30 : 0)
|
||||
#define AEMIF_CFG_WR_SETUP(v) (((v) & 0x0f) << 26)
|
||||
#define AEMIF_CFG_WR_STROBE(v) (((v) & 0x3f) << 20)
|
||||
#define AEMIF_CFG_WR_HOLD(v) (((v) & 0x07) << 17)
|
||||
#define AEMIF_CFG_RD_SETUP(v) (((v) & 0x0f) << 13)
|
||||
#define AEMIF_CFG_RD_STROBE(v) (((v) & 0x3f) << 7)
|
||||
#define AEMIF_CFG_RD_HOLD(v) (((v) & 0x07) << 4)
|
||||
#define AEMIF_CFG_TURN_AROUND(v) (((v) & 0x03) << 2)
|
||||
#define AEMIF_CFG_WIDTH(v) (((v) & 0x03) << 0)
|
||||
|
||||
#define set_config_field(reg, field, val) \
|
||||
do { \
|
||||
if (val != -1) { \
|
||||
reg &= ~AEMIF_CFG_##field(0xffffffff); \
|
||||
reg |= AEMIF_CFG_##field(val); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void configure_async_emif(int cs, struct async_emif_config *cfg)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
if (cfg->mode == ASYNC_EMIF_MODE_NAND) {
|
||||
tmp = __raw_readl(&davinci_emif_regs->nandfcr);
|
||||
tmp |= (1 << cs);
|
||||
__raw_writel(tmp, &davinci_emif_regs->nandfcr);
|
||||
|
||||
} else if (cfg->mode == ASYNC_EMIF_MODE_ONENAND) {
|
||||
tmp = __raw_readl(&davinci_emif_regs->one_nand_cr);
|
||||
tmp |= (1 << cs);
|
||||
__raw_writel(tmp, &davinci_emif_regs->one_nand_cr);
|
||||
}
|
||||
|
||||
tmp = __raw_readl(&davinci_emif_regs->abncr[cs]);
|
||||
|
||||
set_config_field(tmp, SELECT_STROBE, cfg->select_strobe);
|
||||
set_config_field(tmp, EXTEND_WAIT, cfg->extend_wait);
|
||||
set_config_field(tmp, WR_SETUP, cfg->wr_setup);
|
||||
set_config_field(tmp, WR_STROBE, cfg->wr_strobe);
|
||||
set_config_field(tmp, WR_HOLD, cfg->wr_hold);
|
||||
set_config_field(tmp, RD_SETUP, cfg->rd_setup);
|
||||
set_config_field(tmp, RD_STROBE, cfg->rd_strobe);
|
||||
set_config_field(tmp, RD_HOLD, cfg->rd_hold);
|
||||
set_config_field(tmp, TURN_AROUND, cfg->turn_around);
|
||||
set_config_field(tmp, WIDTH, cfg->width);
|
||||
|
||||
__raw_writel(tmp, &davinci_emif_regs->abncr[cs]);
|
||||
}
|
||||
|
||||
void init_async_emif(int num_cs, struct async_emif_config *config)
|
||||
{
|
||||
int cs;
|
||||
|
||||
for (cs = 0; cs < num_cs; cs++)
|
||||
configure_async_emif(cs, config + cs);
|
||||
}
|
||||
318
arch/arm/cpu/armv7/keystone/clock.c
Normal file
318
arch/arm/cpu/armv7/keystone/clock.c
Normal file
@@ -0,0 +1,318 @@
|
||||
/*
|
||||
* Keystone2: pll initialization
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm-generic/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/clock_defs.h>
|
||||
|
||||
static void wait_for_completion(const struct pll_init_data *data)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 100; i++) {
|
||||
sdelay(450);
|
||||
if ((pllctl_reg_read(data->pll, stat) & PLLSTAT_GO) == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
struct pll_regs {
|
||||
u32 reg0, reg1;
|
||||
};
|
||||
|
||||
static const struct pll_regs pll_regs[] = {
|
||||
[CORE_PLL] = { K2HK_MAINPLLCTL0, K2HK_MAINPLLCTL1},
|
||||
[PASS_PLL] = { K2HK_PASSPLLCTL0, K2HK_PASSPLLCTL1},
|
||||
[TETRIS_PLL] = { K2HK_ARMPLLCTL0, K2HK_ARMPLLCTL1},
|
||||
[DDR3A_PLL] = { K2HK_DDR3APLLCTL0, K2HK_DDR3APLLCTL1},
|
||||
[DDR3B_PLL] = { K2HK_DDR3BPLLCTL0, K2HK_DDR3BPLLCTL1},
|
||||
};
|
||||
|
||||
/* Fout = Fref * NF(mult) / NR(prediv) / OD */
|
||||
static unsigned long pll_freq_get(int pll)
|
||||
{
|
||||
unsigned long mult = 1, prediv = 1, output_div = 2;
|
||||
unsigned long ret;
|
||||
u32 tmp, reg;
|
||||
|
||||
if (pll == CORE_PLL) {
|
||||
ret = external_clk[sys_clk];
|
||||
if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
|
||||
/* PLL mode */
|
||||
tmp = __raw_readl(K2HK_MAINPLLCTL0);
|
||||
prediv = (tmp & PLL_DIV_MASK) + 1;
|
||||
mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
|
||||
(pllctl_reg_read(pll, mult) &
|
||||
PLLM_MULT_LO_MASK)) + 1;
|
||||
output_div = ((pllctl_reg_read(pll, secctl) >>
|
||||
PLL_CLKOD_SHIFT) & PLL_CLKOD_MASK) + 1;
|
||||
|
||||
ret = ret / prediv / output_div * mult;
|
||||
}
|
||||
} else {
|
||||
switch (pll) {
|
||||
case PASS_PLL:
|
||||
ret = external_clk[pa_clk];
|
||||
reg = K2HK_PASSPLLCTL0;
|
||||
break;
|
||||
case TETRIS_PLL:
|
||||
ret = external_clk[tetris_clk];
|
||||
reg = K2HK_ARMPLLCTL0;
|
||||
break;
|
||||
case DDR3A_PLL:
|
||||
ret = external_clk[ddr3a_clk];
|
||||
reg = K2HK_DDR3APLLCTL0;
|
||||
break;
|
||||
case DDR3B_PLL:
|
||||
ret = external_clk[ddr3b_clk];
|
||||
reg = K2HK_DDR3BPLLCTL0;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
tmp = __raw_readl(reg);
|
||||
|
||||
if (!(tmp & PLLCTL_BYPASS)) {
|
||||
/* Bypass disabled */
|
||||
prediv = (tmp & PLL_DIV_MASK) + 1;
|
||||
mult = ((tmp >> PLL_MULT_SHIFT) & PLL_MULT_MASK) + 1;
|
||||
output_div = ((tmp >> PLL_CLKOD_SHIFT) &
|
||||
PLL_CLKOD_MASK) + 1;
|
||||
ret = ((ret / prediv) * mult) / output_div;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned long clk_get_rate(unsigned int clk)
|
||||
{
|
||||
switch (clk) {
|
||||
case core_pll_clk: return pll_freq_get(CORE_PLL);
|
||||
case pass_pll_clk: return pll_freq_get(PASS_PLL);
|
||||
case tetris_pll_clk: return pll_freq_get(TETRIS_PLL);
|
||||
case ddr3a_pll_clk: return pll_freq_get(DDR3A_PLL);
|
||||
case ddr3b_pll_clk: return pll_freq_get(DDR3B_PLL);
|
||||
case sys_clk0_1_clk:
|
||||
case sys_clk0_clk: return pll_freq_get(CORE_PLL) / pll0div_read(1);
|
||||
case sys_clk1_clk: return pll_freq_get(CORE_PLL) / pll0div_read(2);
|
||||
case sys_clk2_clk: return pll_freq_get(CORE_PLL) / pll0div_read(3);
|
||||
case sys_clk3_clk: return pll_freq_get(CORE_PLL) / pll0div_read(4);
|
||||
case sys_clk0_2_clk: return clk_get_rate(sys_clk0_clk) / 2;
|
||||
case sys_clk0_3_clk: return clk_get_rate(sys_clk0_clk) / 3;
|
||||
case sys_clk0_4_clk: return clk_get_rate(sys_clk0_clk) / 4;
|
||||
case sys_clk0_6_clk: return clk_get_rate(sys_clk0_clk) / 6;
|
||||
case sys_clk0_8_clk: return clk_get_rate(sys_clk0_clk) / 8;
|
||||
case sys_clk0_12_clk: return clk_get_rate(sys_clk0_clk) / 12;
|
||||
case sys_clk0_24_clk: return clk_get_rate(sys_clk0_clk) / 24;
|
||||
case sys_clk1_3_clk: return clk_get_rate(sys_clk1_clk) / 3;
|
||||
case sys_clk1_4_clk: return clk_get_rate(sys_clk1_clk) / 4;
|
||||
case sys_clk1_6_clk: return clk_get_rate(sys_clk1_clk) / 6;
|
||||
case sys_clk1_12_clk: return clk_get_rate(sys_clk1_clk) / 12;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void init_pll(const struct pll_init_data *data)
|
||||
{
|
||||
u32 tmp, tmp_ctl, pllm, plld, pllod, bwadj;
|
||||
|
||||
pllm = data->pll_m - 1;
|
||||
plld = (data->pll_d - 1) & PLL_DIV_MASK;
|
||||
pllod = (data->pll_od - 1) & PLL_CLKOD_MASK;
|
||||
|
||||
if (data->pll == MAIN_PLL) {
|
||||
/* The requered delay before main PLL configuration */
|
||||
sdelay(210000);
|
||||
|
||||
tmp = pllctl_reg_read(data->pll, secctl);
|
||||
|
||||
if (tmp & (PLLCTL_BYPASS)) {
|
||||
setbits_le32(pll_regs[data->pll].reg1,
|
||||
BIT(MAIN_ENSAT_OFFSET));
|
||||
|
||||
pllctl_reg_clrbits(data->pll, ctl, PLLCTL_PLLEN |
|
||||
PLLCTL_PLLENSRC);
|
||||
sdelay(340);
|
||||
|
||||
pllctl_reg_setbits(data->pll, secctl, PLLCTL_BYPASS);
|
||||
pllctl_reg_setbits(data->pll, ctl, PLLCTL_PLLPWRDN);
|
||||
sdelay(21000);
|
||||
|
||||
pllctl_reg_clrbits(data->pll, ctl, PLLCTL_PLLPWRDN);
|
||||
} else {
|
||||
pllctl_reg_clrbits(data->pll, ctl, PLLCTL_PLLEN |
|
||||
PLLCTL_PLLENSRC);
|
||||
sdelay(340);
|
||||
}
|
||||
|
||||
pllctl_reg_write(data->pll, mult, pllm & PLLM_MULT_LO_MASK);
|
||||
|
||||
clrsetbits_le32(pll_regs[data->pll].reg0, PLLM_MULT_HI_SMASK,
|
||||
(pllm << 6));
|
||||
|
||||
/* Set the BWADJ (12 bit field) */
|
||||
tmp_ctl = pllm >> 1; /* Divide the pllm by 2 */
|
||||
clrsetbits_le32(pll_regs[data->pll].reg0, PLL_BWADJ_LO_SMASK,
|
||||
(tmp_ctl << PLL_BWADJ_LO_SHIFT));
|
||||
clrsetbits_le32(pll_regs[data->pll].reg1, PLL_BWADJ_HI_MASK,
|
||||
(tmp_ctl >> 8));
|
||||
|
||||
/*
|
||||
* Set the pll divider (6 bit field) *
|
||||
* PLLD[5:0] is located in MAINPLLCTL0
|
||||
*/
|
||||
clrsetbits_le32(pll_regs[data->pll].reg0, PLL_DIV_MASK, plld);
|
||||
|
||||
/* Set the OUTPUT DIVIDE (4 bit field) in SECCTL */
|
||||
pllctl_reg_rmw(data->pll, secctl, PLL_CLKOD_SMASK,
|
||||
(pllod << PLL_CLKOD_SHIFT));
|
||||
wait_for_completion(data);
|
||||
|
||||
pllctl_reg_write(data->pll, div1, PLLM_RATIO_DIV1);
|
||||
pllctl_reg_write(data->pll, div2, PLLM_RATIO_DIV2);
|
||||
pllctl_reg_write(data->pll, div3, PLLM_RATIO_DIV3);
|
||||
pllctl_reg_write(data->pll, div4, PLLM_RATIO_DIV4);
|
||||
pllctl_reg_write(data->pll, div5, PLLM_RATIO_DIV5);
|
||||
|
||||
pllctl_reg_setbits(data->pll, alnctl, 0x1f);
|
||||
|
||||
/*
|
||||
* Set GOSET bit in PLLCMD to initiate the GO operation
|
||||
* to change the divide
|
||||
*/
|
||||
pllctl_reg_setbits(data->pll, cmd, PLLSTAT_GO);
|
||||
sdelay(1500); /* wait for the phase adj */
|
||||
wait_for_completion(data);
|
||||
|
||||
/* Reset PLL */
|
||||
pllctl_reg_setbits(data->pll, ctl, PLLCTL_PLLRST);
|
||||
sdelay(21000); /* Wait for a minimum of 7 us*/
|
||||
pllctl_reg_clrbits(data->pll, ctl, PLLCTL_PLLRST);
|
||||
sdelay(105000); /* Wait for PLL Lock time (min 50 us) */
|
||||
|
||||
pllctl_reg_clrbits(data->pll, secctl, PLLCTL_BYPASS);
|
||||
|
||||
tmp = pllctl_reg_setbits(data->pll, ctl, PLLCTL_PLLEN);
|
||||
|
||||
} else if (data->pll == TETRIS_PLL) {
|
||||
bwadj = pllm >> 1;
|
||||
/* 1.5 Set PLLCTL0[BYPASS] =1 (enable bypass), */
|
||||
setbits_le32(pll_regs[data->pll].reg0, PLLCTL_BYPASS);
|
||||
/*
|
||||
* Set CHIPMISCCTL1[13] = 0 (enable glitchfree bypass)
|
||||
* only applicable for Kepler
|
||||
*/
|
||||
clrbits_le32(K2HK_MISC_CTRL, ARM_PLL_EN);
|
||||
/* 2 In PLLCTL1, write PLLRST = 1 (PLL is reset) */
|
||||
setbits_le32(pll_regs[data->pll].reg1 ,
|
||||
PLL_PLLRST | PLLCTL_ENSAT);
|
||||
|
||||
/*
|
||||
* 3 Program PLLM and PLLD in PLLCTL0 register
|
||||
* 4 Program BWADJ[7:0] in PLLCTL0 and BWADJ[11:8] in
|
||||
* PLLCTL1 register. BWADJ value must be set
|
||||
* to ((PLLM + 1) >> 1) – 1)
|
||||
*/
|
||||
tmp = ((bwadj & PLL_BWADJ_LO_MASK) << PLL_BWADJ_LO_SHIFT) |
|
||||
(pllm << 6) |
|
||||
(plld & PLL_DIV_MASK) |
|
||||
(pllod << PLL_CLKOD_SHIFT) | PLLCTL_BYPASS;
|
||||
__raw_writel(tmp, pll_regs[data->pll].reg0);
|
||||
|
||||
/* Set BWADJ[11:8] bits */
|
||||
tmp = __raw_readl(pll_regs[data->pll].reg1);
|
||||
tmp &= ~(PLL_BWADJ_HI_MASK);
|
||||
tmp |= ((bwadj>>8) & PLL_BWADJ_HI_MASK);
|
||||
__raw_writel(tmp, pll_regs[data->pll].reg1);
|
||||
/*
|
||||
* 5 Wait for at least 5 us based on the reference
|
||||
* clock (PLL reset time)
|
||||
*/
|
||||
sdelay(21000); /* Wait for a minimum of 7 us*/
|
||||
|
||||
/* 6 In PLLCTL1, write PLLRST = 0 (PLL reset is released) */
|
||||
clrbits_le32(pll_regs[data->pll].reg1, PLL_PLLRST);
|
||||
/*
|
||||
* 7 Wait for at least 500 * REFCLK cycles * (PLLD + 1)
|
||||
* (PLL lock time)
|
||||
*/
|
||||
sdelay(105000);
|
||||
/* 8 disable bypass */
|
||||
clrbits_le32(pll_regs[data->pll].reg0, PLLCTL_BYPASS);
|
||||
/*
|
||||
* 9 Set CHIPMISCCTL1[13] = 1 (disable glitchfree bypass)
|
||||
* only applicable for Kepler
|
||||
*/
|
||||
setbits_le32(K2HK_MISC_CTRL, ARM_PLL_EN);
|
||||
} else {
|
||||
setbits_le32(pll_regs[data->pll].reg1, PLLCTL_ENSAT);
|
||||
/*
|
||||
* process keeps state of Bypass bit while programming
|
||||
* all other DDR PLL settings
|
||||
*/
|
||||
tmp = __raw_readl(pll_regs[data->pll].reg0);
|
||||
tmp &= PLLCTL_BYPASS; /* clear everything except Bypass */
|
||||
|
||||
/*
|
||||
* Set the BWADJ[7:0], PLLD[5:0] and PLLM to PLLCTL0,
|
||||
* bypass disabled
|
||||
*/
|
||||
bwadj = pllm >> 1;
|
||||
tmp |= ((bwadj & PLL_BWADJ_LO_SHIFT) << PLL_BWADJ_LO_SHIFT) |
|
||||
(pllm << PLL_MULT_SHIFT) |
|
||||
(plld & PLL_DIV_MASK) |
|
||||
(pllod << PLL_CLKOD_SHIFT);
|
||||
__raw_writel(tmp, pll_regs[data->pll].reg0);
|
||||
|
||||
/* Set BWADJ[11:8] bits */
|
||||
tmp = __raw_readl(pll_regs[data->pll].reg1);
|
||||
tmp &= ~(PLL_BWADJ_HI_MASK);
|
||||
tmp |= ((bwadj >> 8) & PLL_BWADJ_HI_MASK);
|
||||
|
||||
/* set PLL Select (bit 13) for PASS PLL */
|
||||
if (data->pll == PASS_PLL)
|
||||
tmp |= PLLCTL_PAPLL;
|
||||
|
||||
__raw_writel(tmp, pll_regs[data->pll].reg1);
|
||||
|
||||
/* Reset bit: bit 14 for both DDR3 & PASS PLL */
|
||||
tmp = PLL_PLLRST;
|
||||
/* Set RESET bit = 1 */
|
||||
setbits_le32(pll_regs[data->pll].reg1, tmp);
|
||||
/* Wait for a minimum of 7 us*/
|
||||
sdelay(21000);
|
||||
/* Clear RESET bit */
|
||||
clrbits_le32(pll_regs[data->pll].reg1, tmp);
|
||||
sdelay(105000);
|
||||
|
||||
/* clear BYPASS (Enable PLL Mode) */
|
||||
clrbits_le32(pll_regs[data->pll].reg0, PLLCTL_BYPASS);
|
||||
sdelay(21000); /* Wait for a minimum of 7 us*/
|
||||
}
|
||||
|
||||
/*
|
||||
* This is required to provide a delay between multiple
|
||||
* consequent PPL configurations
|
||||
*/
|
||||
sdelay(210000);
|
||||
}
|
||||
|
||||
void init_plls(int num_pll, struct pll_init_data *config)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_pll; i++)
|
||||
init_pll(&config[i]);
|
||||
}
|
||||
124
arch/arm/cpu/armv7/keystone/cmd_clock.c
Normal file
124
arch/arm/cpu/armv7/keystone/cmd_clock.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* keystone2: commands for clocks
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/psc_defs.h>
|
||||
|
||||
struct pll_init_data cmd_pll_data = {
|
||||
.pll = MAIN_PLL,
|
||||
.pll_m = 16,
|
||||
.pll_d = 1,
|
||||
.pll_od = 2,
|
||||
};
|
||||
|
||||
int do_pll_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc != 5)
|
||||
goto pll_cmd_usage;
|
||||
|
||||
if (strncmp(argv[1], "pa", 2) == 0)
|
||||
cmd_pll_data.pll = PASS_PLL;
|
||||
else if (strncmp(argv[1], "arm", 3) == 0)
|
||||
cmd_pll_data.pll = TETRIS_PLL;
|
||||
else if (strncmp(argv[1], "ddr3a", 5) == 0)
|
||||
cmd_pll_data.pll = DDR3A_PLL;
|
||||
else if (strncmp(argv[1], "ddr3b", 5) == 0)
|
||||
cmd_pll_data.pll = DDR3B_PLL;
|
||||
else
|
||||
goto pll_cmd_usage;
|
||||
|
||||
cmd_pll_data.pll_m = simple_strtoul(argv[2], NULL, 10);
|
||||
cmd_pll_data.pll_d = simple_strtoul(argv[3], NULL, 10);
|
||||
cmd_pll_data.pll_od = simple_strtoul(argv[4], NULL, 10);
|
||||
|
||||
printf("Trying to set pll %d; mult %d; div %d; OD %d\n",
|
||||
cmd_pll_data.pll, cmd_pll_data.pll_m,
|
||||
cmd_pll_data.pll_d, cmd_pll_data.pll_od);
|
||||
init_pll(&cmd_pll_data);
|
||||
|
||||
return 0;
|
||||
|
||||
pll_cmd_usage:
|
||||
return cmd_usage(cmdtp);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
pllset, 5, 0, do_pll_cmd,
|
||||
"set pll multiplier and pre divider",
|
||||
"<pa|arm|ddr3a|ddr3b> <mult> <div> <OD>\n"
|
||||
);
|
||||
|
||||
int do_getclk_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
unsigned int clk;
|
||||
unsigned int freq;
|
||||
|
||||
if (argc != 2)
|
||||
goto getclk_cmd_usage;
|
||||
|
||||
clk = simple_strtoul(argv[1], NULL, 10);
|
||||
|
||||
freq = clk_get_rate(clk);
|
||||
printf("clock index [%d] - frequency %u\n", clk, freq);
|
||||
return 0;
|
||||
|
||||
getclk_cmd_usage:
|
||||
return cmd_usage(cmdtp);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
getclk, 2, 0, do_getclk_cmd,
|
||||
"get clock rate",
|
||||
"<clk index>\n"
|
||||
"See the 'enum clk_e' in the k2hk clock.h for clk indexes\n"
|
||||
);
|
||||
|
||||
int do_psc_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
int psc_module;
|
||||
int res;
|
||||
|
||||
if (argc != 3)
|
||||
goto psc_cmd_usage;
|
||||
|
||||
psc_module = simple_strtoul(argv[1], NULL, 10);
|
||||
if (strcmp(argv[2], "en") == 0) {
|
||||
res = psc_enable_module(psc_module);
|
||||
printf("psc_enable_module(%d) - %s\n", psc_module,
|
||||
(res) ? "ERROR" : "OK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(argv[2], "di") == 0) {
|
||||
res = psc_disable_module(psc_module);
|
||||
printf("psc_disable_module(%d) - %s\n", psc_module,
|
||||
(res) ? "ERROR" : "OK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(argv[2], "domain") == 0) {
|
||||
res = psc_disable_domain(psc_module);
|
||||
printf("psc_disable_domain(%d) - %s\n", psc_module,
|
||||
(res) ? "ERROR" : "OK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
psc_cmd_usage:
|
||||
return cmd_usage(cmdtp);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
psc, 3, 0, do_psc_cmd,
|
||||
"<enable/disable psc module os disable domain>",
|
||||
"<mod/domain index> <en|di|domain>\n"
|
||||
"See the hardware.h for Power and Sleep Controller (PSC) Domains\n"
|
||||
);
|
||||
131
arch/arm/cpu/armv7/keystone/cmd_mon.c
Normal file
131
arch/arm/cpu/armv7/keystone/cmd_mon.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* K2HK: secure kernel command file
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
asm(".arch_extension sec\n\t");
|
||||
|
||||
static int mon_install(u32 addr, u32 dpsc, u32 freq)
|
||||
{
|
||||
int result;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"stmfd r13!, {lr}\n"
|
||||
"mov r0, %1\n"
|
||||
"mov r1, %2\n"
|
||||
"mov r2, %3\n"
|
||||
"blx r0\n"
|
||||
"ldmfd r13!, {lr}\n"
|
||||
: "=&r" (result)
|
||||
: "r" (addr), "r" (dpsc), "r" (freq)
|
||||
: "cc", "r0", "r1", "r2", "memory");
|
||||
return result;
|
||||
}
|
||||
|
||||
static int do_mon_install(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
u32 addr, dpsc_base = 0x1E80000, freq;
|
||||
int rcode = 0;
|
||||
|
||||
if (argc < 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
freq = clk_get_rate(sys_clk0_6_clk);
|
||||
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
|
||||
rcode = mon_install(addr, dpsc_base, freq);
|
||||
printf("## installed monitor, freq [%d], status %d\n",
|
||||
freq, rcode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(mon_install, 2, 0, do_mon_install,
|
||||
"Install boot kernel at 'addr'",
|
||||
""
|
||||
);
|
||||
|
||||
static void core_spin(void)
|
||||
{
|
||||
while (1)
|
||||
; /* forever */;
|
||||
}
|
||||
|
||||
int mon_power_on(int core_id, void *ep)
|
||||
{
|
||||
int result;
|
||||
|
||||
asm volatile (
|
||||
"stmfd r13!, {lr}\n"
|
||||
"mov r1, %1\n"
|
||||
"mov r2, %2\n"
|
||||
"mov r0, #0\n"
|
||||
"smc #0\n"
|
||||
"ldmfd r13!, {lr}\n"
|
||||
: "=&r" (result)
|
||||
: "r" (core_id), "r" (ep)
|
||||
: "cc", "r0", "r1", "r2", "memory");
|
||||
return result;
|
||||
}
|
||||
|
||||
int mon_power_off(int core_id)
|
||||
{
|
||||
int result;
|
||||
|
||||
asm volatile (
|
||||
"stmfd r13!, {lr}\n"
|
||||
"mov r1, %1\n"
|
||||
"mov r0, #1\n"
|
||||
"smc #1\n"
|
||||
"ldmfd r13!, {lr}\n"
|
||||
: "=&r" (result)
|
||||
: "r" (core_id)
|
||||
: "cc", "r0", "r1", "memory");
|
||||
return result;
|
||||
}
|
||||
|
||||
int do_mon_power(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
int rcode = 0, core_id, on;
|
||||
void (*fn)(void);
|
||||
|
||||
fn = core_spin;
|
||||
|
||||
if (argc < 3)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
core_id = simple_strtoul(argv[1], NULL, 16);
|
||||
on = simple_strtoul(argv[2], NULL, 16);
|
||||
|
||||
if (on)
|
||||
rcode = mon_power_on(core_id, fn);
|
||||
else
|
||||
rcode = mon_power_off(core_id);
|
||||
|
||||
if (on) {
|
||||
if (!rcode)
|
||||
printf("core %d powered on successfully\n", core_id);
|
||||
else
|
||||
printf("core %d power on failure\n", core_id);
|
||||
} else {
|
||||
printf("core %d powered off successfully\n", core_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(mon_power, 3, 0, do_mon_power,
|
||||
"Power On/Off secondary core",
|
||||
"mon_power <coreid> <oper>\n"
|
||||
"- coreid (1-3) and oper (1 - ON, 0 - OFF)\n"
|
||||
""
|
||||
);
|
||||
69
arch/arm/cpu/armv7/keystone/ddr3.c
Normal file
69
arch/arm/cpu/armv7/keystone/ddr3.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Keystone2: DDR3 initialization
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
void init_ddrphy(u32 base, struct ddr3_phy_config *phy_cfg)
|
||||
{
|
||||
unsigned int tmp;
|
||||
|
||||
while ((__raw_readl(base + KS2_DDRPHY_PGSR0_OFFSET)
|
||||
& 0x00000001) != 0x00000001)
|
||||
;
|
||||
|
||||
__raw_writel(phy_cfg->pllcr, base + KS2_DDRPHY_PLLCR_OFFSET);
|
||||
|
||||
tmp = __raw_readl(base + KS2_DDRPHY_PGCR1_OFFSET);
|
||||
tmp &= ~(phy_cfg->pgcr1_mask);
|
||||
tmp |= phy_cfg->pgcr1_val;
|
||||
__raw_writel(tmp, base + KS2_DDRPHY_PGCR1_OFFSET);
|
||||
|
||||
__raw_writel(phy_cfg->ptr0, base + KS2_DDRPHY_PTR0_OFFSET);
|
||||
__raw_writel(phy_cfg->ptr1, base + KS2_DDRPHY_PTR1_OFFSET);
|
||||
__raw_writel(phy_cfg->ptr3, base + KS2_DDRPHY_PTR3_OFFSET);
|
||||
__raw_writel(phy_cfg->ptr4, base + KS2_DDRPHY_PTR4_OFFSET);
|
||||
|
||||
tmp = __raw_readl(base + KS2_DDRPHY_DCR_OFFSET);
|
||||
tmp &= ~(phy_cfg->dcr_mask);
|
||||
tmp |= phy_cfg->dcr_val;
|
||||
__raw_writel(tmp, base + KS2_DDRPHY_DCR_OFFSET);
|
||||
|
||||
__raw_writel(phy_cfg->dtpr0, base + KS2_DDRPHY_DTPR0_OFFSET);
|
||||
__raw_writel(phy_cfg->dtpr1, base + KS2_DDRPHY_DTPR1_OFFSET);
|
||||
__raw_writel(phy_cfg->dtpr2, base + KS2_DDRPHY_DTPR2_OFFSET);
|
||||
__raw_writel(phy_cfg->mr0, base + KS2_DDRPHY_MR0_OFFSET);
|
||||
__raw_writel(phy_cfg->mr1, base + KS2_DDRPHY_MR1_OFFSET);
|
||||
__raw_writel(phy_cfg->mr2, base + KS2_DDRPHY_MR2_OFFSET);
|
||||
__raw_writel(phy_cfg->dtcr, base + KS2_DDRPHY_DTCR_OFFSET);
|
||||
__raw_writel(phy_cfg->pgcr2, base + KS2_DDRPHY_PGCR2_OFFSET);
|
||||
|
||||
__raw_writel(phy_cfg->zq0cr1, base + KS2_DDRPHY_ZQ0CR1_OFFSET);
|
||||
__raw_writel(phy_cfg->zq1cr1, base + KS2_DDRPHY_ZQ1CR1_OFFSET);
|
||||
__raw_writel(phy_cfg->zq2cr1, base + KS2_DDRPHY_ZQ2CR1_OFFSET);
|
||||
|
||||
__raw_writel(phy_cfg->pir_v1, base + KS2_DDRPHY_PIR_OFFSET);
|
||||
while ((__raw_readl(base + KS2_DDRPHY_PGSR0_OFFSET) & 0x1) != 0x1)
|
||||
;
|
||||
|
||||
__raw_writel(phy_cfg->pir_v2, base + KS2_DDRPHY_PIR_OFFSET);
|
||||
while ((__raw_readl(base + KS2_DDRPHY_PGSR0_OFFSET) & 0x1) != 0x1)
|
||||
;
|
||||
}
|
||||
|
||||
void init_ddremif(u32 base, struct ddr3_emif_config *emif_cfg)
|
||||
{
|
||||
__raw_writel(emif_cfg->sdcfg, base + KS2_DDR3_SDCFG_OFFSET);
|
||||
__raw_writel(emif_cfg->sdtim1, base + KS2_DDR3_SDTIM1_OFFSET);
|
||||
__raw_writel(emif_cfg->sdtim2, base + KS2_DDR3_SDTIM2_OFFSET);
|
||||
__raw_writel(emif_cfg->sdtim3, base + KS2_DDR3_SDTIM3_OFFSET);
|
||||
__raw_writel(emif_cfg->sdtim4, base + KS2_DDR3_SDTIM4_OFFSET);
|
||||
__raw_writel(emif_cfg->zqcfg, base + KS2_DDR3_ZQCFG_OFFSET);
|
||||
__raw_writel(emif_cfg->sdrfc, base + KS2_DDR3_SDRFC_OFFSET);
|
||||
}
|
||||
56
arch/arm/cpu/armv7/keystone/init.c
Normal file
56
arch/arm/cpu/armv7/keystone/init.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Keystone2: Architecture initialization
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
|
||||
void chip_configuration_unlock(void)
|
||||
{
|
||||
__raw_writel(KEYSTONE_KICK0_MAGIC, KEYSTONE_KICK0);
|
||||
__raw_writel(KEYSTONE_KICK1_MAGIC, KEYSTONE_KICK1);
|
||||
}
|
||||
|
||||
int arch_cpu_init(void)
|
||||
{
|
||||
chip_configuration_unlock();
|
||||
icache_enable();
|
||||
|
||||
#ifdef CONFIG_SOC_K2HK
|
||||
share_all_segments(8);
|
||||
share_all_segments(9);
|
||||
share_all_segments(10); /* QM PDSP */
|
||||
share_all_segments(11); /* PCIE */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
{
|
||||
volatile u32 *rstctrl = (volatile u32 *)(KS2_RSTCTRL);
|
||||
u32 tmp;
|
||||
|
||||
tmp = *rstctrl & KS2_RSTCTRL_MASK;
|
||||
*rstctrl = tmp | KS2_RSTCTRL_KEY;
|
||||
|
||||
*rstctrl &= KS2_RSTCTRL_SWRST;
|
||||
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
||||
void enable_caches(void)
|
||||
{
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
/* Enable D-cache. I-cache is already enabled in start.S */
|
||||
dcache_enable();
|
||||
#endif
|
||||
}
|
||||
376
arch/arm/cpu/armv7/keystone/keystone_nav.c
Normal file
376
arch/arm/cpu/armv7/keystone/keystone_nav.c
Normal file
@@ -0,0 +1,376 @@
|
||||
/*
|
||||
* Multicore Navigator driver for TI Keystone 2 devices.
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/keystone_nav.h>
|
||||
|
||||
static int soc_type =
|
||||
#ifdef CONFIG_SOC_K2HK
|
||||
k2hk;
|
||||
#endif
|
||||
|
||||
struct qm_config k2hk_qm_memmap = {
|
||||
.stat_cfg = 0x02a40000,
|
||||
.queue = (struct qm_reg_queue *)0x02a80000,
|
||||
.mngr_vbusm = 0x23a80000,
|
||||
.i_lram = 0x00100000,
|
||||
.proxy = (struct qm_reg_queue *)0x02ac0000,
|
||||
.status_ram = 0x02a06000,
|
||||
.mngr_cfg = (struct qm_cfg_reg *)0x02a02000,
|
||||
.intd_cfg = 0x02a0c000,
|
||||
.desc_mem = (struct descr_mem_setup_reg *)0x02a03000,
|
||||
.region_num = 64,
|
||||
.pdsp_cmd = 0x02a20000,
|
||||
.pdsp_ctl = 0x02a0f000,
|
||||
.pdsp_iram = 0x02a10000,
|
||||
.qpool_num = 4000,
|
||||
};
|
||||
|
||||
/*
|
||||
* We are going to use only one type of descriptors - host packet
|
||||
* descriptors. We staticaly allocate memory for them here
|
||||
*/
|
||||
struct qm_host_desc desc_pool[HDESC_NUM] __aligned(sizeof(struct qm_host_desc));
|
||||
|
||||
static struct qm_config *qm_cfg;
|
||||
|
||||
inline int num_of_desc_to_reg(int num_descr)
|
||||
{
|
||||
int j, num;
|
||||
|
||||
for (j = 0, num = 32; j < 15; j++, num *= 2) {
|
||||
if (num_descr <= num)
|
||||
return j;
|
||||
}
|
||||
|
||||
return 15;
|
||||
}
|
||||
|
||||
static int _qm_init(struct qm_config *cfg)
|
||||
{
|
||||
u32 j;
|
||||
|
||||
if (cfg == NULL)
|
||||
return QM_ERR;
|
||||
|
||||
qm_cfg = cfg;
|
||||
|
||||
qm_cfg->mngr_cfg->link_ram_base0 = qm_cfg->i_lram;
|
||||
qm_cfg->mngr_cfg->link_ram_size0 = HDESC_NUM * 8;
|
||||
qm_cfg->mngr_cfg->link_ram_base1 = 0;
|
||||
qm_cfg->mngr_cfg->link_ram_size1 = 0;
|
||||
qm_cfg->mngr_cfg->link_ram_base2 = 0;
|
||||
|
||||
qm_cfg->desc_mem[0].base_addr = (u32)desc_pool;
|
||||
qm_cfg->desc_mem[0].start_idx = 0;
|
||||
qm_cfg->desc_mem[0].desc_reg_size =
|
||||
(((sizeof(struct qm_host_desc) >> 4) - 1) << 16) |
|
||||
num_of_desc_to_reg(HDESC_NUM);
|
||||
|
||||
memset(desc_pool, 0, sizeof(desc_pool));
|
||||
for (j = 0; j < HDESC_NUM; j++)
|
||||
qm_push(&desc_pool[j], qm_cfg->qpool_num);
|
||||
|
||||
return QM_OK;
|
||||
}
|
||||
|
||||
int qm_init(void)
|
||||
{
|
||||
switch (soc_type) {
|
||||
case k2hk:
|
||||
return _qm_init(&k2hk_qm_memmap);
|
||||
}
|
||||
|
||||
return QM_ERR;
|
||||
}
|
||||
|
||||
void qm_close(void)
|
||||
{
|
||||
u32 j;
|
||||
|
||||
if (qm_cfg == NULL)
|
||||
return;
|
||||
|
||||
queue_close(qm_cfg->qpool_num);
|
||||
|
||||
qm_cfg->mngr_cfg->link_ram_base0 = 0;
|
||||
qm_cfg->mngr_cfg->link_ram_size0 = 0;
|
||||
qm_cfg->mngr_cfg->link_ram_base1 = 0;
|
||||
qm_cfg->mngr_cfg->link_ram_size1 = 0;
|
||||
qm_cfg->mngr_cfg->link_ram_base2 = 0;
|
||||
|
||||
for (j = 0; j < qm_cfg->region_num; j++) {
|
||||
qm_cfg->desc_mem[j].base_addr = 0;
|
||||
qm_cfg->desc_mem[j].start_idx = 0;
|
||||
qm_cfg->desc_mem[j].desc_reg_size = 0;
|
||||
}
|
||||
|
||||
qm_cfg = NULL;
|
||||
}
|
||||
|
||||
void qm_push(struct qm_host_desc *hd, u32 qnum)
|
||||
{
|
||||
u32 regd;
|
||||
|
||||
if (!qm_cfg)
|
||||
return;
|
||||
|
||||
cpu_to_bus((u32 *)hd, sizeof(struct qm_host_desc)/4);
|
||||
regd = (u32)hd | ((sizeof(struct qm_host_desc) >> 4) - 1);
|
||||
writel(regd, &qm_cfg->queue[qnum].ptr_size_thresh);
|
||||
}
|
||||
|
||||
void qm_buff_push(struct qm_host_desc *hd, u32 qnum,
|
||||
void *buff_ptr, u32 buff_len)
|
||||
{
|
||||
hd->orig_buff_len = buff_len;
|
||||
hd->buff_len = buff_len;
|
||||
hd->orig_buff_ptr = (u32)buff_ptr;
|
||||
hd->buff_ptr = (u32)buff_ptr;
|
||||
qm_push(hd, qnum);
|
||||
}
|
||||
|
||||
struct qm_host_desc *qm_pop(u32 qnum)
|
||||
{
|
||||
u32 uhd;
|
||||
|
||||
if (!qm_cfg)
|
||||
return NULL;
|
||||
|
||||
uhd = readl(&qm_cfg->queue[qnum].ptr_size_thresh) & ~0xf;
|
||||
if (uhd)
|
||||
cpu_to_bus((u32 *)uhd, sizeof(struct qm_host_desc)/4);
|
||||
|
||||
return (struct qm_host_desc *)uhd;
|
||||
}
|
||||
|
||||
struct qm_host_desc *qm_pop_from_free_pool(void)
|
||||
{
|
||||
if (!qm_cfg)
|
||||
return NULL;
|
||||
|
||||
return qm_pop(qm_cfg->qpool_num);
|
||||
}
|
||||
|
||||
void queue_close(u32 qnum)
|
||||
{
|
||||
struct qm_host_desc *hd;
|
||||
|
||||
while ((hd = qm_pop(qnum)))
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* DMA API
|
||||
*/
|
||||
|
||||
struct pktdma_cfg k2hk_netcp_pktdma = {
|
||||
.global = (struct global_ctl_regs *)0x02004000,
|
||||
.tx_ch = (struct tx_chan_regs *)0x02004400,
|
||||
.tx_ch_num = 9,
|
||||
.rx_ch = (struct rx_chan_regs *)0x02004800,
|
||||
.rx_ch_num = 26,
|
||||
.tx_sched = (u32 *)0x02004c00,
|
||||
.rx_flows = (struct rx_flow_regs *)0x02005000,
|
||||
.rx_flow_num = 32,
|
||||
.rx_free_q = 4001,
|
||||
.rx_rcv_q = 4002,
|
||||
.tx_snd_q = 648,
|
||||
};
|
||||
|
||||
struct pktdma_cfg *netcp;
|
||||
|
||||
static int netcp_rx_disable(void)
|
||||
{
|
||||
u32 j, v, k;
|
||||
|
||||
for (j = 0; j < netcp->rx_ch_num; j++) {
|
||||
v = readl(&netcp->rx_ch[j].cfg_a);
|
||||
if (!(v & CPDMA_CHAN_A_ENABLE))
|
||||
continue;
|
||||
|
||||
writel(v | CPDMA_CHAN_A_TDOWN, &netcp->rx_ch[j].cfg_a);
|
||||
for (k = 0; k < TDOWN_TIMEOUT_COUNT; k++) {
|
||||
udelay(100);
|
||||
v = readl(&netcp->rx_ch[j].cfg_a);
|
||||
if (!(v & CPDMA_CHAN_A_ENABLE))
|
||||
continue;
|
||||
}
|
||||
/* TODO: teardown error on if TDOWN_TIMEOUT_COUNT is reached */
|
||||
}
|
||||
|
||||
/* Clear all of the flow registers */
|
||||
for (j = 0; j < netcp->rx_flow_num; j++) {
|
||||
writel(0, &netcp->rx_flows[j].control);
|
||||
writel(0, &netcp->rx_flows[j].tags);
|
||||
writel(0, &netcp->rx_flows[j].tag_sel);
|
||||
writel(0, &netcp->rx_flows[j].fdq_sel[0]);
|
||||
writel(0, &netcp->rx_flows[j].fdq_sel[1]);
|
||||
writel(0, &netcp->rx_flows[j].thresh[0]);
|
||||
writel(0, &netcp->rx_flows[j].thresh[1]);
|
||||
writel(0, &netcp->rx_flows[j].thresh[2]);
|
||||
}
|
||||
|
||||
return QM_OK;
|
||||
}
|
||||
|
||||
static int netcp_tx_disable(void)
|
||||
{
|
||||
u32 j, v, k;
|
||||
|
||||
for (j = 0; j < netcp->tx_ch_num; j++) {
|
||||
v = readl(&netcp->tx_ch[j].cfg_a);
|
||||
if (!(v & CPDMA_CHAN_A_ENABLE))
|
||||
continue;
|
||||
|
||||
writel(v | CPDMA_CHAN_A_TDOWN, &netcp->tx_ch[j].cfg_a);
|
||||
for (k = 0; k < TDOWN_TIMEOUT_COUNT; k++) {
|
||||
udelay(100);
|
||||
v = readl(&netcp->tx_ch[j].cfg_a);
|
||||
if (!(v & CPDMA_CHAN_A_ENABLE))
|
||||
continue;
|
||||
}
|
||||
/* TODO: teardown error on if TDOWN_TIMEOUT_COUNT is reached */
|
||||
}
|
||||
|
||||
return QM_OK;
|
||||
}
|
||||
|
||||
static int _netcp_init(struct pktdma_cfg *netcp_cfg,
|
||||
struct rx_buff_desc *rx_buffers)
|
||||
{
|
||||
u32 j, v;
|
||||
struct qm_host_desc *hd;
|
||||
u8 *rx_ptr;
|
||||
|
||||
if (netcp_cfg == NULL || rx_buffers == NULL ||
|
||||
rx_buffers->buff_ptr == NULL || qm_cfg == NULL)
|
||||
return QM_ERR;
|
||||
|
||||
netcp = netcp_cfg;
|
||||
netcp->rx_flow = rx_buffers->rx_flow;
|
||||
|
||||
/* init rx queue */
|
||||
rx_ptr = rx_buffers->buff_ptr;
|
||||
|
||||
for (j = 0; j < rx_buffers->num_buffs; j++) {
|
||||
hd = qm_pop(qm_cfg->qpool_num);
|
||||
if (hd == NULL)
|
||||
return QM_ERR;
|
||||
|
||||
qm_buff_push(hd, netcp->rx_free_q,
|
||||
rx_ptr, rx_buffers->buff_len);
|
||||
|
||||
rx_ptr += rx_buffers->buff_len;
|
||||
}
|
||||
|
||||
netcp_rx_disable();
|
||||
|
||||
/* configure rx channels */
|
||||
v = CPDMA_REG_VAL_MAKE_RX_FLOW_A(1, 1, 0, 0, 0, 0, 0, netcp->rx_rcv_q);
|
||||
writel(v, &netcp->rx_flows[netcp->rx_flow].control);
|
||||
writel(0, &netcp->rx_flows[netcp->rx_flow].tags);
|
||||
writel(0, &netcp->rx_flows[netcp->rx_flow].tag_sel);
|
||||
|
||||
v = CPDMA_REG_VAL_MAKE_RX_FLOW_D(0, netcp->rx_free_q, 0,
|
||||
netcp->rx_free_q);
|
||||
|
||||
writel(v, &netcp->rx_flows[netcp->rx_flow].fdq_sel[0]);
|
||||
writel(v, &netcp->rx_flows[netcp->rx_flow].fdq_sel[1]);
|
||||
writel(0, &netcp->rx_flows[netcp->rx_flow].thresh[0]);
|
||||
writel(0, &netcp->rx_flows[netcp->rx_flow].thresh[1]);
|
||||
writel(0, &netcp->rx_flows[netcp->rx_flow].thresh[2]);
|
||||
|
||||
for (j = 0; j < netcp->rx_ch_num; j++)
|
||||
writel(CPDMA_CHAN_A_ENABLE, &netcp->rx_ch[j].cfg_a);
|
||||
|
||||
/* configure tx channels */
|
||||
/* Disable loopback in the tx direction */
|
||||
writel(0, &netcp->global->emulation_control);
|
||||
|
||||
/* TODO: make it dependend on a soc type variable */
|
||||
#ifdef CONFIG_SOC_K2HK
|
||||
/* Set QM base address, only for K2x devices */
|
||||
writel(0x23a80000, &netcp->global->qm_base_addr[0]);
|
||||
#endif
|
||||
|
||||
/* Enable all channels. The current state isn't important */
|
||||
for (j = 0; j < netcp->tx_ch_num; j++) {
|
||||
writel(0, &netcp->tx_ch[j].cfg_b);
|
||||
writel(CPDMA_CHAN_A_ENABLE, &netcp->tx_ch[j].cfg_a);
|
||||
}
|
||||
|
||||
return QM_OK;
|
||||
}
|
||||
|
||||
int netcp_init(struct rx_buff_desc *rx_buffers)
|
||||
{
|
||||
switch (soc_type) {
|
||||
case k2hk:
|
||||
_netcp_init(&k2hk_netcp_pktdma, rx_buffers);
|
||||
return QM_OK;
|
||||
}
|
||||
return QM_ERR;
|
||||
}
|
||||
|
||||
int netcp_close(void)
|
||||
{
|
||||
if (!netcp)
|
||||
return QM_ERR;
|
||||
|
||||
netcp_tx_disable();
|
||||
netcp_rx_disable();
|
||||
|
||||
queue_close(netcp->rx_free_q);
|
||||
queue_close(netcp->rx_rcv_q);
|
||||
queue_close(netcp->tx_snd_q);
|
||||
|
||||
return QM_OK;
|
||||
}
|
||||
|
||||
int netcp_send(u32 *pkt, int num_bytes, u32 swinfo2)
|
||||
{
|
||||
struct qm_host_desc *hd;
|
||||
|
||||
hd = qm_pop(qm_cfg->qpool_num);
|
||||
if (hd == NULL)
|
||||
return QM_ERR;
|
||||
|
||||
hd->desc_info = num_bytes;
|
||||
hd->swinfo[2] = swinfo2;
|
||||
hd->packet_info = qm_cfg->qpool_num;
|
||||
|
||||
qm_buff_push(hd, netcp->tx_snd_q, pkt, num_bytes);
|
||||
|
||||
return QM_OK;
|
||||
}
|
||||
|
||||
void *netcp_recv(u32 **pkt, int *num_bytes)
|
||||
{
|
||||
struct qm_host_desc *hd;
|
||||
|
||||
hd = qm_pop(netcp->rx_rcv_q);
|
||||
if (!hd)
|
||||
return NULL;
|
||||
|
||||
*pkt = (u32 *)hd->buff_ptr;
|
||||
*num_bytes = hd->desc_info & 0x3fffff;
|
||||
|
||||
return hd;
|
||||
}
|
||||
|
||||
void netcp_release_rxhd(void *hd)
|
||||
{
|
||||
struct qm_host_desc *_hd = (struct qm_host_desc *)hd;
|
||||
|
||||
_hd->buff_len = _hd->orig_buff_len;
|
||||
_hd->buff_ptr = _hd->orig_buff_ptr;
|
||||
|
||||
qm_push(_hd, netcp->rx_free_q);
|
||||
}
|
||||
68
arch/arm/cpu/armv7/keystone/msmc.c
Normal file
68
arch/arm/cpu/armv7/keystone/msmc.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* MSMC controller utilities
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
|
||||
struct mpax {
|
||||
u32 mpaxl;
|
||||
u32 mpaxh;
|
||||
};
|
||||
|
||||
struct msms_regs {
|
||||
u32 pid;
|
||||
u32 _res_04;
|
||||
u32 smcerrar;
|
||||
u32 smcerrxr;
|
||||
u32 smedcc;
|
||||
u32 smcea;
|
||||
u32 smsecc;
|
||||
u32 smpfar;
|
||||
u32 smpfxr;
|
||||
u32 smpfr;
|
||||
u32 smpfcr;
|
||||
u32 _res_2c;
|
||||
u32 sbndc[8];
|
||||
u32 sbndm;
|
||||
u32 sbnde;
|
||||
u32 _res_58;
|
||||
u32 cfglck;
|
||||
u32 cfgulck;
|
||||
u32 cfglckstat;
|
||||
u32 sms_mpax_lck;
|
||||
u32 sms_mpax_ulck;
|
||||
u32 sms_mpax_lckstat;
|
||||
u32 ses_mpax_lck;
|
||||
u32 ses_mpax_ulck;
|
||||
u32 ses_mpax_lckstat;
|
||||
u32 smestat;
|
||||
u32 smirstat;
|
||||
u32 smirc;
|
||||
u32 smiestat;
|
||||
u32 smiec;
|
||||
u32 _res_94_c0[12];
|
||||
u32 smncerrar;
|
||||
u32 smncerrxr;
|
||||
u32 smncea;
|
||||
u32 _res_d0_1fc[76];
|
||||
struct mpax sms[16][8];
|
||||
struct mpax ses[16][8];
|
||||
};
|
||||
|
||||
|
||||
void share_all_segments(int priv_id)
|
||||
{
|
||||
struct msms_regs *msmc = (struct msms_regs *)K2HK_MSMC_CTRL_BASE;
|
||||
int j;
|
||||
|
||||
for (j = 0; j < 8; j++) {
|
||||
msmc->sms[priv_id][j].mpaxh &= 0xffffff7ful;
|
||||
msmc->ses[priv_id][j].mpaxh &= 0xffffff7ful;
|
||||
}
|
||||
}
|
||||
237
arch/arm/cpu/armv7/keystone/psc.c
Normal file
237
arch/arm/cpu/armv7/keystone/psc.c
Normal file
@@ -0,0 +1,237 @@
|
||||
/*
|
||||
* Keystone: PSC configuration module
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm-generic/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/arch/psc_defs.h>
|
||||
|
||||
#define DEVICE_REG32_R(addr) __raw_readl((u32 *)(addr))
|
||||
#define DEVICE_REG32_W(addr, val) __raw_writel(val, (u32 *)(addr))
|
||||
|
||||
#ifdef CONFIG_SOC_K2HK
|
||||
#define DEVICE_PSC_BASE K2HK_PSC_BASE
|
||||
#endif
|
||||
|
||||
int psc_delay(void)
|
||||
{
|
||||
udelay(10);
|
||||
return 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION PURPOSE: Wait for end of transitional state
|
||||
*
|
||||
* DESCRIPTION: Polls pstat for the selected domain and waits for transitions
|
||||
* to be complete.
|
||||
*
|
||||
* Since this is boot loader code it is *ASSUMED* that interrupts
|
||||
* are disabled and no other core is mucking around with the psc
|
||||
* at the same time.
|
||||
*
|
||||
* Returns 0 when the domain is free. Returns -1 if a timeout
|
||||
* occurred waiting for the completion.
|
||||
*/
|
||||
int psc_wait(u32 domain_num)
|
||||
{
|
||||
u32 retry;
|
||||
u32 ptstat;
|
||||
|
||||
/*
|
||||
* Do nothing if the power domain is in transition. This should never
|
||||
* happen since the boot code is the only software accesses psc.
|
||||
* It's still remotely possible that the hardware state machines
|
||||
* initiate transitions.
|
||||
* Don't trap if the domain (or a module in this domain) is
|
||||
* stuck in transition.
|
||||
*/
|
||||
retry = 0;
|
||||
|
||||
do {
|
||||
ptstat = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_PSTAT);
|
||||
ptstat = ptstat & (1 << domain_num);
|
||||
} while ((ptstat != 0) && ((retry += psc_delay()) <
|
||||
PSC_PTSTAT_TIMEOUT_LIMIT));
|
||||
|
||||
if (retry >= PSC_PTSTAT_TIMEOUT_LIMIT)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 psc_get_domain_num(u32 mod_num)
|
||||
{
|
||||
u32 domain_num;
|
||||
|
||||
/* Get the power domain associated with the module number */
|
||||
domain_num = DEVICE_REG32_R(DEVICE_PSC_BASE +
|
||||
PSC_REG_MDCFG(mod_num));
|
||||
domain_num = PSC_REG_MDCFG_GET_PD(domain_num);
|
||||
|
||||
return domain_num;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION PURPOSE: Power up/down a module
|
||||
*
|
||||
* DESCRIPTION: Powers up/down the requested module and the associated power
|
||||
* domain if required. No action is taken it the module is
|
||||
* already powered up/down.
|
||||
*
|
||||
* This only controls modules. The domain in which the module
|
||||
* resides will be left in the power on state. Multiple modules
|
||||
* can exist in a power domain, so powering down the domain based
|
||||
* on a single module is not done.
|
||||
*
|
||||
* Returns 0 on success, -1 if the module can't be powered up, or
|
||||
* if there is a timeout waiting for the transition.
|
||||
*/
|
||||
int psc_set_state(u32 mod_num, u32 state)
|
||||
{
|
||||
u32 domain_num;
|
||||
u32 pdctl;
|
||||
u32 mdctl;
|
||||
u32 ptcmd;
|
||||
u32 reset_iso;
|
||||
u32 v;
|
||||
|
||||
/*
|
||||
* Get the power domain associated with the module number, and reset
|
||||
* isolation functionality
|
||||
*/
|
||||
v = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_MDCFG(mod_num));
|
||||
domain_num = PSC_REG_MDCFG_GET_PD(v);
|
||||
reset_iso = PSC_REG_MDCFG_GET_RESET_ISO(v);
|
||||
|
||||
/* Wait for the status of the domain/module to be non-transitional */
|
||||
if (psc_wait(domain_num) != 0)
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* Perform configuration even if the current status matches the
|
||||
* existing state
|
||||
*
|
||||
* Set the next state of the power domain to on. It's OK if the domain
|
||||
* is always on. This code will not ever power down a domain, so no
|
||||
* change is made if the new state is power down.
|
||||
*/
|
||||
if (state == PSC_REG_VAL_MDCTL_NEXT_ON) {
|
||||
pdctl = DEVICE_REG32_R(DEVICE_PSC_BASE +
|
||||
PSC_REG_PDCTL(domain_num));
|
||||
pdctl = PSC_REG_PDCTL_SET_NEXT(pdctl,
|
||||
PSC_REG_VAL_PDCTL_NEXT_ON);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_PDCTL(domain_num),
|
||||
pdctl);
|
||||
}
|
||||
|
||||
/* Set the next state for the module to enabled/disabled */
|
||||
mdctl = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num));
|
||||
mdctl = PSC_REG_MDCTL_SET_NEXT(mdctl, state);
|
||||
mdctl = PSC_REG_MDCTL_SET_RESET_ISO(mdctl, reset_iso);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl);
|
||||
|
||||
/* Trigger the enable */
|
||||
ptcmd = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_PTCMD);
|
||||
ptcmd |= (u32)(1<<domain_num);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_PTCMD, ptcmd);
|
||||
|
||||
/* Wait on the complete */
|
||||
return psc_wait(domain_num);
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION PURPOSE: Power up a module
|
||||
*
|
||||
* DESCRIPTION: Powers up the requested module and the associated power domain
|
||||
* if required. No action is taken it the module is already
|
||||
* powered up.
|
||||
*
|
||||
* Returns 0 on success, -1 if the module can't be powered up, or
|
||||
* if there is a timeout waiting for the transition.
|
||||
*/
|
||||
int psc_enable_module(u32 mod_num)
|
||||
{
|
||||
u32 mdctl;
|
||||
|
||||
/* Set the bit to apply reset */
|
||||
mdctl = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num));
|
||||
if ((mdctl & 0x3f) == PSC_REG_VAL_MDSTAT_STATE_ON)
|
||||
return 0;
|
||||
|
||||
return psc_set_state(mod_num, PSC_REG_VAL_MDCTL_NEXT_ON);
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION PURPOSE: Power down a module
|
||||
*
|
||||
* DESCRIPTION: Powers down the requested module.
|
||||
*
|
||||
* Returns 0 on success, -1 on failure or timeout.
|
||||
*/
|
||||
int psc_disable_module(u32 mod_num)
|
||||
{
|
||||
u32 mdctl;
|
||||
|
||||
/* Set the bit to apply reset */
|
||||
mdctl = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num));
|
||||
if ((mdctl & 0x3f) == 0)
|
||||
return 0;
|
||||
mdctl = PSC_REG_MDCTL_SET_LRSTZ(mdctl, 0);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl);
|
||||
|
||||
return psc_set_state(mod_num, PSC_REG_VAL_MDCTL_NEXT_SWRSTDISABLE);
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION PURPOSE: Set the reset isolation bit in mdctl
|
||||
*
|
||||
* DESCRIPTION: The reset isolation enable bit is set. The state of the module
|
||||
* is not changed. Returns 0 if the module config showed that
|
||||
* reset isolation is supported. Returns 1 otherwise. This is not
|
||||
* an error, but setting the bit in mdctl has no effect.
|
||||
*/
|
||||
int psc_set_reset_iso(u32 mod_num)
|
||||
{
|
||||
u32 v;
|
||||
u32 mdctl;
|
||||
|
||||
/* Set the reset isolation bit */
|
||||
mdctl = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num));
|
||||
mdctl = PSC_REG_MDCTL_SET_RESET_ISO(mdctl, 1);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl);
|
||||
|
||||
v = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_MDCFG(mod_num));
|
||||
if (PSC_REG_MDCFG_GET_RESET_ISO(v) == 1)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION PURPOSE: Disable a power domain
|
||||
*
|
||||
* DESCRIPTION: The power domain is disabled
|
||||
*/
|
||||
int psc_disable_domain(u32 domain_num)
|
||||
{
|
||||
u32 pdctl;
|
||||
u32 ptcmd;
|
||||
|
||||
pdctl = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_PDCTL(domain_num));
|
||||
pdctl = PSC_REG_PDCTL_SET_NEXT(pdctl, PSC_REG_VAL_PDCTL_NEXT_OFF);
|
||||
pdctl = PSC_REG_PDCTL_SET_PDMODE(pdctl, PSC_REG_VAL_PDCTL_PDMODE_SLEEP);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_PDCTL(domain_num), pdctl);
|
||||
|
||||
ptcmd = DEVICE_REG32_R(DEVICE_PSC_BASE + PSC_REG_PTCMD);
|
||||
ptcmd |= (u32)(1 << domain_num);
|
||||
DEVICE_REG32_W(DEVICE_PSC_BASE + PSC_REG_PTCMD, ptcmd);
|
||||
|
||||
return psc_wait(domain_num);
|
||||
}
|
||||
45
arch/arm/cpu/armv7/keystone/spl.c
Normal file
45
arch/arm/cpu/armv7/keystone/spl.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* common spl init code
|
||||
*
|
||||
* (C) Copyright 2012-2014
|
||||
* Texas Instruments Incorporated, <www.ti.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <ns16550.h>
|
||||
#include <malloc.h>
|
||||
#include <spl.h>
|
||||
#include <spi_flash.h>
|
||||
|
||||
#include <asm/u-boot.h>
|
||||
#include <asm/utils.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static struct pll_init_data spl_pll_config[] = {
|
||||
CORE_PLL_799,
|
||||
TETRIS_PLL_500,
|
||||
};
|
||||
|
||||
void spl_init_keystone_plls(void)
|
||||
{
|
||||
init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);
|
||||
}
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
spl_init_keystone_plls();
|
||||
preloader_console_init();
|
||||
}
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
#if defined(CONFIG_SPL_SPI_LOAD)
|
||||
return BOOT_DEVICE_SPI;
|
||||
#else
|
||||
puts("Unknown boot device\n");
|
||||
hang();
|
||||
#endif
|
||||
}
|
||||
@@ -27,8 +27,4 @@ obj-y += boot-common.o
|
||||
obj-y += lowlevel_init.o
|
||||
endif
|
||||
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
ifneq ($(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
|
||||
obj-y += mem-common.o
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -56,6 +56,17 @@ void save_omap_boot_params(void)
|
||||
*((u32 *)(dev_data + BOOT_MODE_OFFSET));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRA7XX
|
||||
/*
|
||||
* We get different values for QSPI_1 and QSPI_4 being used, but
|
||||
* don't actually care about this difference. Rather than
|
||||
* mangle the later code, if we're coming in as QSPI_4 just
|
||||
* change to the QSPI_1 value.
|
||||
*/
|
||||
if (gd->arch.omap_boot_params.omap_bootdevice == 11)
|
||||
gd->arch.omap_boot_params.omap_bootdevice = BOOT_DEVICE_SPI;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
|
||||
@@ -1384,8 +1384,10 @@ void sdram_init(void)
|
||||
|
||||
if (sdram_type == EMIF_SDRAM_TYPE_DDR3 &&
|
||||
(!in_sdram && !warm_reset())) {
|
||||
do_bug0039_workaround(EMIF1_BASE);
|
||||
do_bug0039_workaround(EMIF2_BASE);
|
||||
if (emif1_enabled)
|
||||
do_bug0039_workaround(EMIF1_BASE);
|
||||
if (emif2_enabled)
|
||||
do_bug0039_workaround(EMIF2_BASE);
|
||||
}
|
||||
|
||||
debug("<<sdram_init()\n");
|
||||
|
||||
@@ -185,7 +185,7 @@ u32 omap_sdram_size(void)
|
||||
{
|
||||
u32 section, i, valid;
|
||||
u64 sdram_start = 0, sdram_end = 0, addr,
|
||||
size, total_size = 0, trap_size = 0;
|
||||
size, total_size = 0, trap_size = 0, trap_start = 0;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
section = __raw_readl(DMM_BASE + i*4);
|
||||
@@ -194,8 +194,8 @@ u32 omap_sdram_size(void)
|
||||
addr = section & EMIF_SYS_ADDR_MASK;
|
||||
|
||||
/* See if the address is valid */
|
||||
if ((addr >= DRAM_ADDR_SPACE_START) &&
|
||||
(addr < DRAM_ADDR_SPACE_END)) {
|
||||
if ((addr >= TI_ARMV7_DRAM_ADDR_SPACE_START) &&
|
||||
(addr < TI_ARMV7_DRAM_ADDR_SPACE_END)) {
|
||||
size = ((section & EMIF_SYS_SIZE_MASK) >>
|
||||
EMIF_SYS_SIZE_SHIFT);
|
||||
size = 1 << size;
|
||||
@@ -208,12 +208,15 @@ u32 omap_sdram_size(void)
|
||||
sdram_end = addr + size;
|
||||
} else {
|
||||
trap_size = size;
|
||||
trap_start = addr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
total_size = (sdram_end - sdram_start) - (trap_size);
|
||||
|
||||
if ((trap_start >= sdram_start) && (trap_start < sdram_end))
|
||||
total_size = (sdram_end - sdram_start) - (trap_size);
|
||||
else
|
||||
total_size = sdram_end - sdram_start;
|
||||
|
||||
return total_size;
|
||||
}
|
||||
|
||||
@@ -2,31 +2,136 @@
|
||||
* (C) Copyright 2010
|
||||
* Texas Instruments, <www.ti.com>
|
||||
*
|
||||
* Steve Sakoman <steve@sakoman.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>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#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>
|
||||
#include <linux/mtd/omap_gpmc.h>
|
||||
|
||||
struct gpmc *gpmc_cfg;
|
||||
|
||||
#if defined(CONFIG_OMAP34XX)
|
||||
/********************************************************
|
||||
* mem_ok() - test used to see if timings are correct
|
||||
* for a part. Helps in guessing which part
|
||||
* we are currently using.
|
||||
*******************************************************/
|
||||
u32 mem_ok(u32 cs)
|
||||
{
|
||||
u32 val1, val2, addr;
|
||||
u32 pattern = 0x12345678;
|
||||
|
||||
addr = OMAP34XX_SDRC_CS0 + get_sdr_cs_offset(cs);
|
||||
|
||||
writel(0x0, addr + 0x400); /* clear pos A */
|
||||
writel(pattern, addr); /* pattern to pos B */
|
||||
writel(0x0, addr + 4); /* remove pattern off the bus */
|
||||
val1 = readl(addr + 0x400); /* get pos A value */
|
||||
val2 = readl(addr); /* get val2 */
|
||||
writel(0x0, addr + 0x400); /* clear pos A */
|
||||
|
||||
if ((val1 != 0) || (val2 != pattern)) /* see if pos A val changed */
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
#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;
|
||||
|
||||
#if defined(CONFIG_NOR)
|
||||
/* configure GPMC for NOR */
|
||||
const u32 gpmc_regs[GPMC_MAX_REG] = { STNOR_GPMC_CONFIG1,
|
||||
STNOR_GPMC_CONFIG2,
|
||||
STNOR_GPMC_CONFIG3,
|
||||
STNOR_GPMC_CONFIG4,
|
||||
STNOR_GPMC_CONFIG5,
|
||||
STNOR_GPMC_CONFIG6,
|
||||
STNOR_GPMC_CONFIG7
|
||||
};
|
||||
u32 size = GPMC_SIZE_16M;
|
||||
u32 base = CONFIG_SYS_FLASH_BASE;
|
||||
#elif defined(CONFIG_NAND)
|
||||
/* configure GPMC for NAND */
|
||||
const u32 gpmc_regs[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
|
||||
};
|
||||
u32 size = GPMC_SIZE_256M;
|
||||
u32 base = CONFIG_SYS_NAND_BASE;
|
||||
#elif defined(CONFIG_CMD_ONENAND)
|
||||
const u32 gpmc_regs[GPMC_MAX_REG] = { ONENAND_GPMC_CONFIG1,
|
||||
ONENAND_GPMC_CONFIG2,
|
||||
ONENAND_GPMC_CONFIG3,
|
||||
ONENAND_GPMC_CONFIG4,
|
||||
ONENAND_GPMC_CONFIG5,
|
||||
ONENAND_GPMC_CONFIG6,
|
||||
0
|
||||
};
|
||||
u32 base = PISMO1_ONEN_BASE;
|
||||
u32 size = PISMO1_ONEN_SIZE;
|
||||
#else
|
||||
const u32 gpmc_regs[GPMC_MAX_REG] = { 0, 0, 0, 0, 0, 0, 0 };
|
||||
u32 size = 0;
|
||||
u32 base = 0;
|
||||
#endif
|
||||
/* global settings */
|
||||
writel(0, &gpmc_cfg->irqenable); /* isr's sources masked */
|
||||
writel(0, &gpmc_cfg->timeout_control);/* timeout disable */
|
||||
|
||||
writel(0x00000008, &gpmc_cfg->sysconfig);
|
||||
writel(0x00000000, &gpmc_cfg->irqstatus);
|
||||
writel(0x00000000, &gpmc_cfg->irqenable);
|
||||
writel(0x00000000, &gpmc_cfg->timeout_control);
|
||||
#ifdef CONFIG_NOR
|
||||
writel(0x00000200, &gpmc_cfg->config);
|
||||
#else
|
||||
writel(0x00000012, &gpmc_cfg->config);
|
||||
#endif
|
||||
/*
|
||||
* Disable the GPMC0 config set by ROM code
|
||||
* It conflicts with our MPDB (both at 0x08000000)
|
||||
*/
|
||||
writel(0, &gpmc_cfg->cs[0].config7);
|
||||
sdelay(1000);
|
||||
/* enable chip-select specific configurations */
|
||||
enable_gpmc_cs_config(gpmc_regs, &gpmc_cfg->cs[0], base, size);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
static void do_cancel_out(u32 *num, u32 *den, u32 factor)
|
||||
{
|
||||
while (1) {
|
||||
@@ -39,3 +40,23 @@ void cancel_out(u32 *num, u32 *den, u32 den_limit)
|
||||
*den = (*den + 1) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
void __weak usb_fake_mac_from_die_id(u32 *id)
|
||||
{
|
||||
uint8_t device_mac[6];
|
||||
|
||||
if (!getenv("usbethaddr")) {
|
||||
/*
|
||||
* create a fake MAC address from the processor ID code.
|
||||
* first byte is 0x02 to signify locally administered.
|
||||
*/
|
||||
device_mac[0] = 0x02;
|
||||
device_mac[1] = id[3] & 0xff;
|
||||
device_mac[2] = id[2] & 0xff;
|
||||
device_mac[3] = id[1] & 0xff;
|
||||
device_mac[4] = id[0] & 0xff;
|
||||
device_mac[5] = (id[0] >> 8) & 0xff;
|
||||
|
||||
eth_setenv_enetaddr("usbethaddr", device_mac);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ obj-y := lowlevel_init.o
|
||||
|
||||
obj-y += board.o
|
||||
obj-y += clock.o
|
||||
obj-y += mem.o
|
||||
obj-y += sys_info.o
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-$(CONFIG_SPL_OMAP3_ID_NAND) += spl_id_nand.o
|
||||
|
||||
@@ -290,8 +290,8 @@ void watchdog_init(void)
|
||||
* should not be running and does not generate a PRCM reset.
|
||||
*/
|
||||
|
||||
sr32(&prcm_base->fclken_wkup, 5, 1, 1);
|
||||
sr32(&prcm_base->iclken_wkup, 5, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken_wkup, 0x20);
|
||||
setbits_le32(&prcm_base->iclken_wkup, 0x20);
|
||||
wait_on_value(ST_WDT2, 0x20, &prcm_base->idlest_wkup, 5);
|
||||
|
||||
writel(WD_UNLOCK1, &wd2_base->wspr);
|
||||
|
||||
@@ -132,9 +132,9 @@ static void dpll3_init_34xx(u32 sil_index, u32 clk_index)
|
||||
if (xip_safe) {
|
||||
/*
|
||||
* CORE DPLL
|
||||
* sr32(CM_CLKSEL2_EMU) set override to work when asleep
|
||||
*/
|
||||
sr32(&prcm_base->clken_pll, 0, 3, PLL_FAST_RELOCK_BYPASS);
|
||||
clrsetbits_le32(&prcm_base->clken_pll,
|
||||
0x00000007, PLL_FAST_RELOCK_BYPASS);
|
||||
wait_on_value(ST_CORE_CLK, 0, &prcm_base->idlest_ckgen,
|
||||
LDELAY);
|
||||
|
||||
@@ -144,37 +144,50 @@ static void dpll3_init_34xx(u32 sil_index, u32 clk_index)
|
||||
*/
|
||||
|
||||
/* CM_CLKSEL1_EMU[DIV_DPLL3] */
|
||||
sr32(&prcm_base->clksel1_emu, 16, 5, (CORE_M3X2 + 1)) ;
|
||||
sr32(&prcm_base->clksel1_emu, 16, 5, CORE_M3X2);
|
||||
clrsetbits_le32(&prcm_base->clksel1_emu,
|
||||
0x001F0000, (CORE_M3X2 + 1) << 16) ;
|
||||
clrsetbits_le32(&prcm_base->clksel1_emu,
|
||||
0x001F0000, CORE_M3X2 << 16);
|
||||
|
||||
/* M2 (CORE_DPLL_CLKOUT_DIV): CM_CLKSEL1_PLL[27:31] */
|
||||
sr32(&prcm_base->clksel1_pll, 27, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll,
|
||||
0xF8000000, ptr->m2 << 27);
|
||||
|
||||
/* M (CORE_DPLL_MULT): CM_CLKSEL1_PLL[16:26] */
|
||||
sr32(&prcm_base->clksel1_pll, 16, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll,
|
||||
0x07FF0000, ptr->m << 16);
|
||||
|
||||
/* N (CORE_DPLL_DIV): CM_CLKSEL1_PLL[8:14] */
|
||||
sr32(&prcm_base->clksel1_pll, 8, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll,
|
||||
0x00007F00, ptr->n << 8);
|
||||
|
||||
/* Source is the CM_96M_FCLK: CM_CLKSEL1_PLL[6] */
|
||||
sr32(&prcm_base->clksel1_pll, 6, 1, 0);
|
||||
clrbits_le32(&prcm_base->clksel1_pll, 0x00000040);
|
||||
|
||||
/* SSI */
|
||||
sr32(&prcm_base->clksel_core, 8, 4, CORE_SSI_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x00000F00, CORE_SSI_DIV << 8);
|
||||
/* FSUSB */
|
||||
sr32(&prcm_base->clksel_core, 4, 2, CORE_FUSB_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x00000030, CORE_FUSB_DIV << 4);
|
||||
/* L4 */
|
||||
sr32(&prcm_base->clksel_core, 2, 2, CORE_L4_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x0000000C, CORE_L4_DIV << 2);
|
||||
/* L3 */
|
||||
sr32(&prcm_base->clksel_core, 0, 2, CORE_L3_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x00000003, CORE_L3_DIV);
|
||||
/* GFX */
|
||||
sr32(&prcm_base->clksel_gfx, 0, 3, GFX_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_gfx,
|
||||
0x00000007, GFX_DIV);
|
||||
/* RESET MGR */
|
||||
sr32(&prcm_base->clksel_wkup, 1, 2, WKUP_RSM);
|
||||
clrsetbits_le32(&prcm_base->clksel_wkup,
|
||||
0x00000006, WKUP_RSM << 1);
|
||||
/* FREQSEL (CORE_DPLL_FREQSEL): CM_CLKEN_PLL[4:7] */
|
||||
sr32(&prcm_base->clken_pll, 4, 4, ptr->fsel);
|
||||
clrsetbits_le32(&prcm_base->clken_pll,
|
||||
0x000000F0, ptr->fsel << 4);
|
||||
/* LOCK MODE */
|
||||
sr32(&prcm_base->clken_pll, 0, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll,
|
||||
0x00000007, PLL_LOCK);
|
||||
|
||||
wait_on_value(ST_CORE_CLK, 1, &prcm_base->idlest_ckgen,
|
||||
LDELAY);
|
||||
@@ -186,29 +199,29 @@ static void dpll3_init_34xx(u32 sil_index, u32 clk_index)
|
||||
f_lock_pll = (void *) (SRAM_CLK_CODE);
|
||||
|
||||
p0 = readl(&prcm_base->clken_pll);
|
||||
sr32(&p0, 0, 3, PLL_FAST_RELOCK_BYPASS);
|
||||
clrsetbits_le32(&p0, 0x00000007, PLL_FAST_RELOCK_BYPASS);
|
||||
/* FREQSEL (CORE_DPLL_FREQSEL): CM_CLKEN_PLL[4:7] */
|
||||
sr32(&p0, 4, 4, ptr->fsel);
|
||||
clrsetbits_le32(&p0, 0x000000F0, ptr->fsel << 4);
|
||||
|
||||
p1 = readl(&prcm_base->clksel1_pll);
|
||||
/* M2 (CORE_DPLL_CLKOUT_DIV): CM_CLKSEL1_PLL[27:31] */
|
||||
sr32(&p1, 27, 5, ptr->m2);
|
||||
clrsetbits_le32(&p1, 0xF8000000, ptr->m2 << 27);
|
||||
/* M (CORE_DPLL_MULT): CM_CLKSEL1_PLL[16:26] */
|
||||
sr32(&p1, 16, 11, ptr->m);
|
||||
clrsetbits_le32(&p1, 0x07FF0000, ptr->m << 16);
|
||||
/* N (CORE_DPLL_DIV): CM_CLKSEL1_PLL[8:14] */
|
||||
sr32(&p1, 8, 7, ptr->n);
|
||||
clrsetbits_le32(&p1, 0x00007F00, ptr->n << 8);
|
||||
/* Source is the CM_96M_FCLK: CM_CLKSEL1_PLL[6] */
|
||||
sr32(&p1, 6, 1, 0);
|
||||
clrbits_le32(&p1, 0x00000040);
|
||||
|
||||
p2 = readl(&prcm_base->clksel_core);
|
||||
/* SSI */
|
||||
sr32(&p2, 8, 4, CORE_SSI_DIV);
|
||||
clrsetbits_le32(&p2, 0x00000F00, CORE_SSI_DIV << 8);
|
||||
/* FSUSB */
|
||||
sr32(&p2, 4, 2, CORE_FUSB_DIV);
|
||||
clrsetbits_le32(&p2, 0x00000030, CORE_FUSB_DIV << 4);
|
||||
/* L4 */
|
||||
sr32(&p2, 2, 2, CORE_L4_DIV);
|
||||
clrsetbits_le32(&p2, 0x0000000C, CORE_L4_DIV << 2);
|
||||
/* L3 */
|
||||
sr32(&p2, 0, 2, CORE_L3_DIV);
|
||||
clrsetbits_le32(&p2, 0x00000003, CORE_L3_DIV);
|
||||
|
||||
p3 = (u32)&prcm_base->idlest_ckgen;
|
||||
|
||||
@@ -225,7 +238,7 @@ static void dpll4_init_34xx(u32 sil_index, u32 clk_index)
|
||||
ptr = ptr + clk_index;
|
||||
|
||||
/* EN_PERIPH_DPLL: CM_CLKEN_PLL[16:18] */
|
||||
sr32(&prcm_base->clken_pll, 16, 3, PLL_STOP);
|
||||
clrsetbits_le32(&prcm_base->clken_pll, 0x00070000, PLL_STOP << 16);
|
||||
wait_on_value(ST_PERIPH_CLK, 0, &prcm_base->idlest_ckgen, LDELAY);
|
||||
|
||||
/*
|
||||
@@ -234,33 +247,38 @@ static void dpll4_init_34xx(u32 sil_index, u32 clk_index)
|
||||
* and then the actual divisor value
|
||||
*/
|
||||
/* M6 */
|
||||
sr32(&prcm_base->clksel1_emu, 24, 5, (PER_M6X2 + 1));
|
||||
sr32(&prcm_base->clksel1_emu, 24, 5, PER_M6X2);
|
||||
clrsetbits_le32(&prcm_base->clksel1_emu,
|
||||
0x1F000000, (PER_M6X2 + 1) << 24);
|
||||
clrsetbits_le32(&prcm_base->clksel1_emu,
|
||||
0x1F000000, PER_M6X2 << 24);
|
||||
/* M5 */
|
||||
sr32(&prcm_base->clksel_cam, 0, 5, (PER_M5X2 + 1));
|
||||
sr32(&prcm_base->clksel_cam, 0, 5, PER_M5X2);
|
||||
clrsetbits_le32(&prcm_base->clksel_cam, 0x0000001F, (PER_M5X2 + 1));
|
||||
clrsetbits_le32(&prcm_base->clksel_cam, 0x0000001F, PER_M5X2);
|
||||
/* M4 */
|
||||
sr32(&prcm_base->clksel_dss, 0, 5, (PER_M4X2 + 1));
|
||||
sr32(&prcm_base->clksel_dss, 0, 5, PER_M4X2);
|
||||
clrsetbits_le32(&prcm_base->clksel_dss, 0x0000001F, (PER_M4X2 + 1));
|
||||
clrsetbits_le32(&prcm_base->clksel_dss, 0x0000001F, PER_M4X2);
|
||||
/* M3 */
|
||||
sr32(&prcm_base->clksel_dss, 8, 5, (PER_M3X2 + 1));
|
||||
sr32(&prcm_base->clksel_dss, 8, 5, PER_M3X2);
|
||||
clrsetbits_le32(&prcm_base->clksel_dss,
|
||||
0x00001F00, (PER_M3X2 + 1) << 8);
|
||||
clrsetbits_le32(&prcm_base->clksel_dss,
|
||||
0x00001F00, PER_M3X2 << 8);
|
||||
/* M2 (DIV_96M): CM_CLKSEL3_PLL[0:4] */
|
||||
sr32(&prcm_base->clksel3_pll, 0, 5, (ptr->m2 + 1));
|
||||
sr32(&prcm_base->clksel3_pll, 0, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel3_pll, 0x0000001F, (ptr->m2 + 1));
|
||||
clrsetbits_le32(&prcm_base->clksel3_pll, 0x0000001F, ptr->m2);
|
||||
/* Workaround end */
|
||||
|
||||
/* M (PERIPH_DPLL_MULT): CM_CLKSEL2_PLL[8:18] */
|
||||
sr32(&prcm_base->clksel2_pll, 8, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll,
|
||||
0x0007FF00, ptr->m << 8);
|
||||
|
||||
/* N (PERIPH_DPLL_DIV): CM_CLKSEL2_PLL[0:6] */
|
||||
sr32(&prcm_base->clksel2_pll, 0, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll, 0x0000007F, ptr->n);
|
||||
|
||||
/* FREQSEL (PERIPH_DPLL_FREQSEL): CM_CLKEN_PLL[20:23] */
|
||||
sr32(&prcm_base->clken_pll, 20, 4, ptr->fsel);
|
||||
clrsetbits_le32(&prcm_base->clken_pll, 0x00F00000, ptr->fsel << 20);
|
||||
|
||||
/* LOCK MODE (EN_PERIPH_DPLL): CM_CLKEN_PLL[16:18] */
|
||||
sr32(&prcm_base->clken_pll, 16, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll, 0x00070000, PLL_LOCK << 16);
|
||||
wait_on_value(ST_PERIPH_CLK, 2, &prcm_base->idlest_ckgen, LDELAY);
|
||||
}
|
||||
|
||||
@@ -273,13 +291,18 @@ static void dpll5_init_34xx(u32 sil_index, u32 clk_index)
|
||||
ptr = ptr + clk_index;
|
||||
|
||||
/* PER2 DPLL (DPLL5) */
|
||||
sr32(&prcm_base->clken2_pll, 0, 3, PLL_STOP);
|
||||
clrsetbits_le32(&prcm_base->clken2_pll, 0x00000007, PLL_STOP);
|
||||
wait_on_value(1, 0, &prcm_base->idlest2_ckgen, LDELAY);
|
||||
sr32(&prcm_base->clksel5_pll, 0, 5, ptr->m2); /* set M2 (usbtll_fck) */
|
||||
sr32(&prcm_base->clksel4_pll, 8, 11, ptr->m); /* set m (11-bit multiplier) */
|
||||
sr32(&prcm_base->clksel4_pll, 0, 7, ptr->n); /* set n (7-bit divider)*/
|
||||
sr32(&prcm_base->clken_pll, 4, 4, ptr->fsel); /* FREQSEL */
|
||||
sr32(&prcm_base->clken2_pll, 0, 3, PLL_LOCK); /* lock mode */
|
||||
/* set M2 (usbtll_fck) */
|
||||
clrsetbits_le32(&prcm_base->clksel5_pll, 0x0000001F, ptr->m2);
|
||||
/* set m (11-bit multiplier) */
|
||||
clrsetbits_le32(&prcm_base->clksel4_pll, 0x0007FF00, ptr->m << 8);
|
||||
/* set n (7-bit divider)*/
|
||||
clrsetbits_le32(&prcm_base->clksel4_pll, 0x0000007F, ptr->n);
|
||||
/* FREQSEL */
|
||||
clrsetbits_le32(&prcm_base->clken_pll, 0x000000F0, ptr->fsel << 4);
|
||||
/* lock mode */
|
||||
clrsetbits_le32(&prcm_base->clken2_pll, 0x00000007, PLL_LOCK);
|
||||
wait_on_value(1, 1, &prcm_base->idlest2_ckgen, LDELAY);
|
||||
}
|
||||
|
||||
@@ -294,16 +317,20 @@ static void mpu_init_34xx(u32 sil_index, u32 clk_index)
|
||||
/* MPU DPLL (unlocked already) */
|
||||
|
||||
/* M2 (MPU_DPLL_CLKOUT_DIV) : CM_CLKSEL2_PLL_MPU[0:4] */
|
||||
sr32(&prcm_base->clksel2_pll_mpu, 0, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll_mpu,
|
||||
0x0000001F, ptr->m2);
|
||||
|
||||
/* M (MPU_DPLL_MULT) : CM_CLKSEL2_PLL_MPU[8:18] */
|
||||
sr32(&prcm_base->clksel1_pll_mpu, 8, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_mpu,
|
||||
0x0007FF00, ptr->m << 8);
|
||||
|
||||
/* N (MPU_DPLL_DIV) : CM_CLKSEL2_PLL_MPU[0:6] */
|
||||
sr32(&prcm_base->clksel1_pll_mpu, 0, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_mpu,
|
||||
0x0000007F, ptr->n);
|
||||
|
||||
/* FREQSEL (MPU_DPLL_FREQSEL) : CM_CLKEN_PLL_MPU[4:7] */
|
||||
sr32(&prcm_base->clken_pll_mpu, 4, 4, ptr->fsel);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_mpu,
|
||||
0x000000F0, ptr->fsel << 4);
|
||||
}
|
||||
|
||||
static void iva_init_34xx(u32 sil_index, u32 clk_index)
|
||||
@@ -316,23 +343,29 @@ static void iva_init_34xx(u32 sil_index, u32 clk_index)
|
||||
|
||||
/* IVA DPLL */
|
||||
/* EN_IVA2_DPLL : CM_CLKEN_PLL_IVA2[0:2] */
|
||||
sr32(&prcm_base->clken_pll_iva2, 0, 3, PLL_STOP);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_iva2,
|
||||
0x00000007, PLL_STOP);
|
||||
wait_on_value(ST_IVA2_CLK, 0, &prcm_base->idlest_pll_iva2, LDELAY);
|
||||
|
||||
/* M2 (IVA2_DPLL_CLKOUT_DIV) : CM_CLKSEL2_PLL_IVA2[0:4] */
|
||||
sr32(&prcm_base->clksel2_pll_iva2, 0, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll_iva2,
|
||||
0x0000001F, ptr->m2);
|
||||
|
||||
/* M (IVA2_DPLL_MULT) : CM_CLKSEL1_PLL_IVA2[8:18] */
|
||||
sr32(&prcm_base->clksel1_pll_iva2, 8, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_iva2,
|
||||
0x0007FF00, ptr->m << 8);
|
||||
|
||||
/* N (IVA2_DPLL_DIV) : CM_CLKSEL1_PLL_IVA2[0:6] */
|
||||
sr32(&prcm_base->clksel1_pll_iva2, 0, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_iva2,
|
||||
0x0000007F, ptr->n);
|
||||
|
||||
/* FREQSEL (IVA2_DPLL_FREQSEL) : CM_CLKEN_PLL_IVA2[4:7] */
|
||||
sr32(&prcm_base->clken_pll_iva2, 4, 4, ptr->fsel);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_iva2,
|
||||
0x000000F0, ptr->fsel << 4);
|
||||
|
||||
/* LOCK MODE (EN_IVA2_DPLL) : CM_CLKEN_PLL_IVA2[0:2] */
|
||||
sr32(&prcm_base->clken_pll_iva2, 0, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_iva2,
|
||||
0x00000007, PLL_LOCK);
|
||||
|
||||
wait_on_value(ST_IVA2_CLK, 1, &prcm_base->idlest_pll_iva2, LDELAY);
|
||||
}
|
||||
@@ -357,41 +390,54 @@ static void dpll3_init_36xx(u32 sil_index, u32 clk_index)
|
||||
/* CORE DPLL */
|
||||
|
||||
/* Select relock bypass: CM_CLKEN_PLL[0:2] */
|
||||
sr32(&prcm_base->clken_pll, 0, 3, PLL_FAST_RELOCK_BYPASS);
|
||||
clrsetbits_le32(&prcm_base->clken_pll,
|
||||
0x00000007, PLL_FAST_RELOCK_BYPASS);
|
||||
wait_on_value(ST_CORE_CLK, 0, &prcm_base->idlest_ckgen,
|
||||
LDELAY);
|
||||
|
||||
/* CM_CLKSEL1_EMU[DIV_DPLL3] */
|
||||
sr32(&prcm_base->clksel1_emu, 16, 5, CORE_M3X2);
|
||||
clrsetbits_le32(&prcm_base->clksel1_emu,
|
||||
0x001F0000, CORE_M3X2 << 16);
|
||||
|
||||
/* M2 (CORE_DPLL_CLKOUT_DIV): CM_CLKSEL1_PLL[27:31] */
|
||||
sr32(&prcm_base->clksel1_pll, 27, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll,
|
||||
0xF8000000, ptr->m2 << 27);
|
||||
|
||||
/* M (CORE_DPLL_MULT): CM_CLKSEL1_PLL[16:26] */
|
||||
sr32(&prcm_base->clksel1_pll, 16, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll,
|
||||
0x07FF0000, ptr->m << 16);
|
||||
|
||||
/* N (CORE_DPLL_DIV): CM_CLKSEL1_PLL[8:14] */
|
||||
sr32(&prcm_base->clksel1_pll, 8, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll,
|
||||
0x00007F00, ptr->n << 8);
|
||||
|
||||
/* Source is the CM_96M_FCLK: CM_CLKSEL1_PLL[6] */
|
||||
sr32(&prcm_base->clksel1_pll, 6, 1, 0);
|
||||
clrbits_le32(&prcm_base->clksel1_pll, 0x00000040);
|
||||
|
||||
/* SSI */
|
||||
sr32(&prcm_base->clksel_core, 8, 4, CORE_SSI_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x00000F00, CORE_SSI_DIV << 8);
|
||||
/* FSUSB */
|
||||
sr32(&prcm_base->clksel_core, 4, 2, CORE_FUSB_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x00000030, CORE_FUSB_DIV << 4);
|
||||
/* L4 */
|
||||
sr32(&prcm_base->clksel_core, 2, 2, CORE_L4_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x0000000C, CORE_L4_DIV << 2);
|
||||
/* L3 */
|
||||
sr32(&prcm_base->clksel_core, 0, 2, CORE_L3_DIV);
|
||||
clrsetbits_le32(&prcm_base->clksel_core,
|
||||
0x00000003, CORE_L3_DIV);
|
||||
/* GFX */
|
||||
sr32(&prcm_base->clksel_gfx, 0, 3, GFX_DIV_36X);
|
||||
clrsetbits_le32(&prcm_base->clksel_gfx,
|
||||
0x00000007, GFX_DIV_36X);
|
||||
/* RESET MGR */
|
||||
sr32(&prcm_base->clksel_wkup, 1, 2, WKUP_RSM);
|
||||
clrsetbits_le32(&prcm_base->clksel_wkup,
|
||||
0x00000006, WKUP_RSM << 1);
|
||||
/* FREQSEL (CORE_DPLL_FREQSEL): CM_CLKEN_PLL[4:7] */
|
||||
sr32(&prcm_base->clken_pll, 4, 4, ptr->fsel);
|
||||
clrsetbits_le32(&prcm_base->clken_pll,
|
||||
0x000000F0, ptr->fsel << 4);
|
||||
/* LOCK MODE */
|
||||
sr32(&prcm_base->clken_pll, 0, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll,
|
||||
0x00000007, PLL_LOCK);
|
||||
|
||||
wait_on_value(ST_CORE_CLK, 1, &prcm_base->idlest_ckgen,
|
||||
LDELAY);
|
||||
@@ -403,29 +449,29 @@ static void dpll3_init_36xx(u32 sil_index, u32 clk_index)
|
||||
f_lock_pll = (void *) (SRAM_CLK_CODE);
|
||||
|
||||
p0 = readl(&prcm_base->clken_pll);
|
||||
sr32(&p0, 0, 3, PLL_FAST_RELOCK_BYPASS);
|
||||
clrsetbits_le32(&p0, 0x00000007, PLL_FAST_RELOCK_BYPASS);
|
||||
/* FREQSEL (CORE_DPLL_FREQSEL): CM_CLKEN_PLL[4:7] */
|
||||
sr32(&p0, 4, 4, ptr->fsel);
|
||||
clrsetbits_le32(&p0, 0x000000F0, ptr->fsel << 4);
|
||||
|
||||
p1 = readl(&prcm_base->clksel1_pll);
|
||||
/* M2 (CORE_DPLL_CLKOUT_DIV): CM_CLKSEL1_PLL[27:31] */
|
||||
sr32(&p1, 27, 5, ptr->m2);
|
||||
clrsetbits_le32(&p1, 0xF8000000, ptr->m2 << 27);
|
||||
/* M (CORE_DPLL_MULT): CM_CLKSEL1_PLL[16:26] */
|
||||
sr32(&p1, 16, 11, ptr->m);
|
||||
clrsetbits_le32(&p1, 0x07FF0000, ptr->m << 16);
|
||||
/* N (CORE_DPLL_DIV): CM_CLKSEL1_PLL[8:14] */
|
||||
sr32(&p1, 8, 7, ptr->n);
|
||||
clrsetbits_le32(&p1, 0x00007F00, ptr->n << 8);
|
||||
/* Source is the CM_96M_FCLK: CM_CLKSEL1_PLL[6] */
|
||||
sr32(&p1, 6, 1, 0);
|
||||
clrbits_le32(&p1, 0x00000040);
|
||||
|
||||
p2 = readl(&prcm_base->clksel_core);
|
||||
/* SSI */
|
||||
sr32(&p2, 8, 4, CORE_SSI_DIV);
|
||||
clrsetbits_le32(&p2, 0x00000F00, CORE_SSI_DIV << 8);
|
||||
/* FSUSB */
|
||||
sr32(&p2, 4, 2, CORE_FUSB_DIV);
|
||||
clrsetbits_le32(&p2, 0x00000030, CORE_FUSB_DIV << 4);
|
||||
/* L4 */
|
||||
sr32(&p2, 2, 2, CORE_L4_DIV);
|
||||
clrsetbits_le32(&p2, 0x0000000C, CORE_L4_DIV << 2);
|
||||
/* L3 */
|
||||
sr32(&p2, 0, 2, CORE_L3_DIV);
|
||||
clrsetbits_le32(&p2, 0x00000003, CORE_L3_DIV);
|
||||
|
||||
p3 = (u32)&prcm_base->idlest_ckgen;
|
||||
|
||||
@@ -444,35 +490,35 @@ static void dpll4_init_36xx(u32 sil_index, u32 clk_index)
|
||||
ptr += clk_index;
|
||||
|
||||
/* EN_PERIPH_DPLL: CM_CLKEN_PLL[16:18] */
|
||||
sr32(&prcm_base->clken_pll, 16, 3, PLL_STOP);
|
||||
clrsetbits_le32(&prcm_base->clken_pll, 0x00070000, PLL_STOP << 16);
|
||||
wait_on_value(ST_PERIPH_CLK, 0, &prcm_base->idlest_ckgen, LDELAY);
|
||||
|
||||
/* M6 (DIV_DPLL4): CM_CLKSEL1_EMU[24:29] */
|
||||
sr32(&prcm_base->clksel1_emu, 24, 6, ptr->m6);
|
||||
clrsetbits_le32(&prcm_base->clksel1_emu, 0x3F000000, ptr->m6 << 24);
|
||||
|
||||
/* M5 (CLKSEL_CAM): CM_CLKSEL1_EMU[0:5] */
|
||||
sr32(&prcm_base->clksel_cam, 0, 6, ptr->m5);
|
||||
clrsetbits_le32(&prcm_base->clksel_cam, 0x0000003F, ptr->m5);
|
||||
|
||||
/* M4 (CLKSEL_DSS1): CM_CLKSEL_DSS[0:5] */
|
||||
sr32(&prcm_base->clksel_dss, 0, 6, ptr->m4);
|
||||
clrsetbits_le32(&prcm_base->clksel_dss, 0x0000003F, ptr->m4);
|
||||
|
||||
/* M3 (CLKSEL_DSS1): CM_CLKSEL_DSS[8:13] */
|
||||
sr32(&prcm_base->clksel_dss, 8, 6, ptr->m3);
|
||||
clrsetbits_le32(&prcm_base->clksel_dss, 0x00003F00, ptr->m3 << 8);
|
||||
|
||||
/* M2 (DIV_96M): CM_CLKSEL3_PLL[0:4] */
|
||||
sr32(&prcm_base->clksel3_pll, 0, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel3_pll, 0x0000001F, ptr->m2);
|
||||
|
||||
/* M (PERIPH_DPLL_MULT): CM_CLKSEL2_PLL[8:19] */
|
||||
sr32(&prcm_base->clksel2_pll, 8, 12, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll, 0x000FFF00, ptr->m << 8);
|
||||
|
||||
/* N (PERIPH_DPLL_DIV): CM_CLKSEL2_PLL[0:6] */
|
||||
sr32(&prcm_base->clksel2_pll, 0, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll, 0x0000007F, ptr->n);
|
||||
|
||||
/* M2DIV (CLKSEL_96M): CM_CLKSEL_CORE[12:13] */
|
||||
sr32(&prcm_base->clksel_core, 12, 2, ptr->m2div);
|
||||
clrsetbits_le32(&prcm_base->clksel_core, 0x00003000, ptr->m2div << 12);
|
||||
|
||||
/* LOCK MODE (EN_PERIPH_DPLL): CM_CLKEN_PLL[16:18] */
|
||||
sr32(&prcm_base->clken_pll, 16, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll, 0x00070000, PLL_LOCK << 16);
|
||||
wait_on_value(ST_PERIPH_CLK, 2, &prcm_base->idlest_ckgen, LDELAY);
|
||||
}
|
||||
|
||||
@@ -485,12 +531,16 @@ static void dpll5_init_36xx(u32 sil_index, u32 clk_index)
|
||||
ptr = ptr + clk_index;
|
||||
|
||||
/* PER2 DPLL (DPLL5) */
|
||||
sr32(&prcm_base->clken2_pll, 0, 3, PLL_STOP);
|
||||
clrsetbits_le32(&prcm_base->clken2_pll, 0x00000007, PLL_STOP);
|
||||
wait_on_value(1, 0, &prcm_base->idlest2_ckgen, LDELAY);
|
||||
sr32(&prcm_base->clksel5_pll, 0, 5, ptr->m2); /* set M2 (usbtll_fck) */
|
||||
sr32(&prcm_base->clksel4_pll, 8, 11, ptr->m); /* set m (11-bit multiplier) */
|
||||
sr32(&prcm_base->clksel4_pll, 0, 7, ptr->n); /* set n (7-bit divider)*/
|
||||
sr32(&prcm_base->clken2_pll, 0, 3, PLL_LOCK); /* lock mode */
|
||||
/* set M2 (usbtll_fck) */
|
||||
clrsetbits_le32(&prcm_base->clksel5_pll, 0x0000001F, ptr->m2);
|
||||
/* set m (11-bit multiplier) */
|
||||
clrsetbits_le32(&prcm_base->clksel4_pll, 0x0007FF00, ptr->m << 8);
|
||||
/* set n (7-bit divider)*/
|
||||
clrsetbits_le32(&prcm_base->clksel4_pll, 0x0000007F, ptr->n);
|
||||
/* lock mode */
|
||||
clrsetbits_le32(&prcm_base->clken2_pll, 0x00000007, PLL_LOCK);
|
||||
wait_on_value(1, 1, &prcm_base->idlest2_ckgen, LDELAY);
|
||||
}
|
||||
|
||||
@@ -505,13 +555,13 @@ static void mpu_init_36xx(u32 sil_index, u32 clk_index)
|
||||
/* MPU DPLL (unlocked already */
|
||||
|
||||
/* M2 (MPU_DPLL_CLKOUT_DIV) : CM_CLKSEL2_PLL_MPU[0:4] */
|
||||
sr32(&prcm_base->clksel2_pll_mpu, 0, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll_mpu, 0x0000001F, ptr->m2);
|
||||
|
||||
/* M (MPU_DPLL_MULT) : CM_CLKSEL2_PLL_MPU[8:18] */
|
||||
sr32(&prcm_base->clksel1_pll_mpu, 8, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_mpu, 0x0007FF00, ptr->m << 8);
|
||||
|
||||
/* N (MPU_DPLL_DIV) : CM_CLKSEL2_PLL_MPU[0:6] */
|
||||
sr32(&prcm_base->clksel1_pll_mpu, 0, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_mpu, 0x0000007F, ptr->n);
|
||||
}
|
||||
|
||||
static void iva_init_36xx(u32 sil_index, u32 clk_index)
|
||||
@@ -524,20 +574,20 @@ static void iva_init_36xx(u32 sil_index, u32 clk_index)
|
||||
|
||||
/* IVA DPLL */
|
||||
/* EN_IVA2_DPLL : CM_CLKEN_PLL_IVA2[0:2] */
|
||||
sr32(&prcm_base->clken_pll_iva2, 0, 3, PLL_STOP);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_iva2, 0x00000007, PLL_STOP);
|
||||
wait_on_value(ST_IVA2_CLK, 0, &prcm_base->idlest_pll_iva2, LDELAY);
|
||||
|
||||
/* M2 (IVA2_DPLL_CLKOUT_DIV) : CM_CLKSEL2_PLL_IVA2[0:4] */
|
||||
sr32(&prcm_base->clksel2_pll_iva2, 0, 5, ptr->m2);
|
||||
clrsetbits_le32(&prcm_base->clksel2_pll_iva2, 0x0000001F, ptr->m2);
|
||||
|
||||
/* M (IVA2_DPLL_MULT) : CM_CLKSEL1_PLL_IVA2[8:18] */
|
||||
sr32(&prcm_base->clksel1_pll_iva2, 8, 11, ptr->m);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_iva2, 0x0007FF00, ptr->m << 8);
|
||||
|
||||
/* N (IVA2_DPLL_DIV) : CM_CLKSEL1_PLL_IVA2[0:6] */
|
||||
sr32(&prcm_base->clksel1_pll_iva2, 0, 7, ptr->n);
|
||||
clrsetbits_le32(&prcm_base->clksel1_pll_iva2, 0x0000007F, ptr->n);
|
||||
|
||||
/* LOCK (MODE (EN_IVA2_DPLL) : CM_CLKEN_PLL_IVA2[0:2] */
|
||||
sr32(&prcm_base->clken_pll_iva2, 0, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_iva2, 0x00000007, PLL_LOCK);
|
||||
|
||||
wait_on_value(ST_IVA2_CLK, 1, &prcm_base->idlest_pll_iva2, LDELAY);
|
||||
}
|
||||
@@ -561,16 +611,16 @@ void prcm_init(void)
|
||||
get_sys_clkin_sel(osc_clk, &sys_clkin_sel);
|
||||
|
||||
/* set input crystal speed */
|
||||
sr32(&prm_base->clksel, 0, 3, sys_clkin_sel);
|
||||
clrsetbits_le32(&prm_base->clksel, 0x00000007, sys_clkin_sel);
|
||||
|
||||
/* If the input clock is greater than 19.2M always divide/2 */
|
||||
if (sys_clkin_sel > 2) {
|
||||
/* input clock divider */
|
||||
sr32(&prm_base->clksrc_ctrl, 6, 2, 2);
|
||||
clrsetbits_le32(&prm_base->clksrc_ctrl, 0x000000C0, 2 << 6);
|
||||
clk_index = sys_clkin_sel / 2;
|
||||
} else {
|
||||
/* input clock divider */
|
||||
sr32(&prm_base->clksrc_ctrl, 6, 2, 1);
|
||||
clrsetbits_le32(&prm_base->clksrc_ctrl, 0x000000C0, 1 << 6);
|
||||
clk_index = sys_clkin_sel;
|
||||
}
|
||||
|
||||
@@ -587,12 +637,14 @@ void prcm_init(void)
|
||||
* input divider to /1 as it should never set to /6.5
|
||||
* in this case.
|
||||
*/
|
||||
if (sys_clkin_sel != 1) /* 13 MHz */
|
||||
if (sys_clkin_sel != 1) { /* 13 MHz */
|
||||
/* Bit 8: DPLL4_CLKINP_DIV */
|
||||
sr32(&prm_base->clksrc_ctrl, 8, 1, 0);
|
||||
clrbits_le32(&prm_base->clksrc_ctrl, 0x00000100);
|
||||
}
|
||||
|
||||
/* Unlock MPU DPLL (slows things down, and needed later) */
|
||||
sr32(&prcm_base->clken_pll_mpu, 0, 3, PLL_LOW_POWER_BYPASS);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_mpu,
|
||||
0x00000007, PLL_LOW_POWER_BYPASS);
|
||||
wait_on_value(ST_MPU_CLK, 0, &prcm_base->idlest_pll_mpu,
|
||||
LDELAY);
|
||||
|
||||
@@ -603,7 +655,8 @@ void prcm_init(void)
|
||||
mpu_init_36xx(0, clk_index);
|
||||
|
||||
/* Lock MPU DPLL to set frequency */
|
||||
sr32(&prcm_base->clken_pll_mpu, 0, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_mpu,
|
||||
0x00000007, PLL_LOCK);
|
||||
wait_on_value(ST_MPU_CLK, 1, &prcm_base->idlest_pll_mpu,
|
||||
LDELAY);
|
||||
} else {
|
||||
@@ -620,7 +673,8 @@ void prcm_init(void)
|
||||
sil_index = 1;
|
||||
|
||||
/* Unlock MPU DPLL (slows things down, and needed later) */
|
||||
sr32(&prcm_base->clken_pll_mpu, 0, 3, PLL_LOW_POWER_BYPASS);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_mpu,
|
||||
0x00000007, PLL_LOW_POWER_BYPASS);
|
||||
wait_on_value(ST_MPU_CLK, 0, &prcm_base->idlest_pll_mpu,
|
||||
LDELAY);
|
||||
|
||||
@@ -633,14 +687,15 @@ void prcm_init(void)
|
||||
mpu_init_34xx(sil_index, clk_index);
|
||||
|
||||
/* Lock MPU DPLL to set frequency */
|
||||
sr32(&prcm_base->clken_pll_mpu, 0, 3, PLL_LOCK);
|
||||
clrsetbits_le32(&prcm_base->clken_pll_mpu,
|
||||
0x00000007, PLL_LOCK);
|
||||
wait_on_value(ST_MPU_CLK, 1, &prcm_base->idlest_pll_mpu,
|
||||
LDELAY);
|
||||
}
|
||||
|
||||
/* Set up GPTimers to sys_clk source only */
|
||||
sr32(&prcm_base->clksel_per, 0, 8, 0xff);
|
||||
sr32(&prcm_base->clksel_wkup, 0, 1, 1);
|
||||
setbits_le32(&prcm_base->clksel_per, 0x000000FF);
|
||||
setbits_le32(&prcm_base->clksel_wkup, 1);
|
||||
|
||||
sdelay(5000);
|
||||
}
|
||||
@@ -653,16 +708,16 @@ void ehci_clocks_enable(void)
|
||||
struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
|
||||
|
||||
/* Enable USBHOST_L3_ICLK (USBHOST_MICLK) */
|
||||
sr32(&prcm_base->iclken_usbhost, 0, 1, 1);
|
||||
setbits_le32(&prcm_base->iclken_usbhost, 1);
|
||||
/*
|
||||
* Enable USBHOST_48M_FCLK (USBHOST_FCLK1)
|
||||
* and USBHOST_120M_FCLK (USBHOST_FCLK2)
|
||||
*/
|
||||
sr32(&prcm_base->fclken_usbhost, 0, 2, 3);
|
||||
setbits_le32(&prcm_base->fclken_usbhost, 0x00000003);
|
||||
/* Enable USBTTL_ICLK */
|
||||
sr32(&prcm_base->iclken3_core, 2, 1, 1);
|
||||
setbits_le32(&prcm_base->iclken3_core, 0x00000004);
|
||||
/* Enable USBTTL_FCLK */
|
||||
sr32(&prcm_base->fclken3_core, 2, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken3_core, 0x00000004);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -673,62 +728,62 @@ void per_clocks_enable(void)
|
||||
struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
|
||||
|
||||
/* Enable GP2 timer. */
|
||||
sr32(&prcm_base->clksel_per, 0, 1, 0x1); /* GPT2 = sys clk */
|
||||
sr32(&prcm_base->iclken_per, 3, 1, 0x1); /* ICKen GPT2 */
|
||||
sr32(&prcm_base->fclken_per, 3, 1, 0x1); /* FCKen GPT2 */
|
||||
setbits_le32(&prcm_base->clksel_per, 0x01); /* GPT2 = sys clk */
|
||||
setbits_le32(&prcm_base->iclken_per, 0x08); /* ICKen GPT2 */
|
||||
setbits_le32(&prcm_base->fclken_per, 0x08); /* FCKen GPT2 */
|
||||
|
||||
#ifdef CONFIG_SYS_NS16550
|
||||
/* Enable UART1 clocks */
|
||||
sr32(&prcm_base->fclken1_core, 13, 1, 0x1);
|
||||
sr32(&prcm_base->iclken1_core, 13, 1, 0x1);
|
||||
setbits_le32(&prcm_base->fclken1_core, 0x00002000);
|
||||
setbits_le32(&prcm_base->iclken1_core, 0x00002000);
|
||||
|
||||
/* UART 3 Clocks */
|
||||
sr32(&prcm_base->fclken_per, 11, 1, 0x1);
|
||||
sr32(&prcm_base->iclken_per, 11, 1, 0x1);
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00000800);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00000800);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OMAP3_GPIO_2
|
||||
sr32(&prcm_base->fclken_per, 13, 1, 1);
|
||||
sr32(&prcm_base->iclken_per, 13, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00002000);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00002000);
|
||||
#endif
|
||||
#ifdef CONFIG_OMAP3_GPIO_3
|
||||
sr32(&prcm_base->fclken_per, 14, 1, 1);
|
||||
sr32(&prcm_base->iclken_per, 14, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00004000);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00004000);
|
||||
#endif
|
||||
#ifdef CONFIG_OMAP3_GPIO_4
|
||||
sr32(&prcm_base->fclken_per, 15, 1, 1);
|
||||
sr32(&prcm_base->iclken_per, 15, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00008000);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00008000);
|
||||
#endif
|
||||
#ifdef CONFIG_OMAP3_GPIO_5
|
||||
sr32(&prcm_base->fclken_per, 16, 1, 1);
|
||||
sr32(&prcm_base->iclken_per, 16, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00010000);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00010000);
|
||||
#endif
|
||||
#ifdef CONFIG_OMAP3_GPIO_6
|
||||
sr32(&prcm_base->fclken_per, 17, 1, 1);
|
||||
sr32(&prcm_base->iclken_per, 17, 1, 1);
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00020000);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00020000);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_I2C_OMAP34XX
|
||||
/* Turn on all 3 I2C clocks */
|
||||
sr32(&prcm_base->fclken1_core, 15, 3, 0x7);
|
||||
sr32(&prcm_base->iclken1_core, 15, 3, 0x7); /* I2C1,2,3 = on */
|
||||
setbits_le32(&prcm_base->fclken1_core, 0x00038000);
|
||||
setbits_le32(&prcm_base->iclken1_core, 0x00038000); /* I2C1,2,3 = on */
|
||||
#endif
|
||||
/* Enable the ICLK for 32K Sync Timer as its used in udelay */
|
||||
sr32(&prcm_base->iclken_wkup, 2, 1, 0x1);
|
||||
setbits_le32(&prcm_base->iclken_wkup, 0x00000004);
|
||||
|
||||
if (get_cpu_family() != CPU_AM35XX)
|
||||
sr32(&prcm_base->fclken_iva2, 0, 32, FCK_IVA2_ON);
|
||||
out_le32(&prcm_base->fclken_iva2, FCK_IVA2_ON);
|
||||
|
||||
sr32(&prcm_base->fclken1_core, 0, 32, FCK_CORE1_ON);
|
||||
sr32(&prcm_base->iclken1_core, 0, 32, ICK_CORE1_ON);
|
||||
sr32(&prcm_base->iclken2_core, 0, 32, ICK_CORE2_ON);
|
||||
sr32(&prcm_base->fclken_wkup, 0, 32, FCK_WKUP_ON);
|
||||
sr32(&prcm_base->iclken_wkup, 0, 32, ICK_WKUP_ON);
|
||||
sr32(&prcm_base->fclken_dss, 0, 32, FCK_DSS_ON);
|
||||
sr32(&prcm_base->iclken_dss, 0, 32, ICK_DSS_ON);
|
||||
out_le32(&prcm_base->fclken1_core, FCK_CORE1_ON);
|
||||
out_le32(&prcm_base->iclken1_core, ICK_CORE1_ON);
|
||||
out_le32(&prcm_base->iclken2_core, ICK_CORE2_ON);
|
||||
out_le32(&prcm_base->fclken_wkup, FCK_WKUP_ON);
|
||||
out_le32(&prcm_base->iclken_wkup, ICK_WKUP_ON);
|
||||
out_le32(&prcm_base->fclken_dss, FCK_DSS_ON);
|
||||
out_le32(&prcm_base->iclken_dss, ICK_DSS_ON);
|
||||
if (get_cpu_family() != CPU_AM35XX) {
|
||||
sr32(&prcm_base->fclken_cam, 0, 32, FCK_CAM_ON);
|
||||
sr32(&prcm_base->iclken_cam, 0, 32, ICK_CAM_ON);
|
||||
out_le32(&prcm_base->fclken_cam, FCK_CAM_ON);
|
||||
out_le32(&prcm_base->iclken_cam, ICK_CAM_ON);
|
||||
}
|
||||
|
||||
sdelay(1000);
|
||||
|
||||
@@ -40,12 +40,24 @@ static char *rev_s_37xx[CPU_37XX_MAX_REV] = {
|
||||
"1.2"};
|
||||
#endif /* CONFIG_DISPLAY_CPUINFO */
|
||||
|
||||
/*****************************************************************
|
||||
* get_dieid(u32 *id) - read die ID
|
||||
*****************************************************************/
|
||||
void get_dieid(u32 *id)
|
||||
{
|
||||
struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE;
|
||||
|
||||
id[3] = readl(&id_base->die_id_0);
|
||||
id[2] = readl(&id_base->die_id_1);
|
||||
id[1] = readl(&id_base->die_id_2);
|
||||
id[0] = readl(&id_base->die_id_3);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* dieid_num_r(void) - read and set die ID
|
||||
*****************************************************************/
|
||||
void dieid_num_r(void)
|
||||
{
|
||||
struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE;
|
||||
char *uid_s, die_id[34];
|
||||
u32 id[4];
|
||||
|
||||
@@ -54,10 +66,7 @@ void dieid_num_r(void)
|
||||
uid_s = getenv("dieid#");
|
||||
|
||||
if (uid_s == NULL) {
|
||||
id[3] = readl(&id_base->die_id_0);
|
||||
id[2] = readl(&id_base->die_id_1);
|
||||
id[1] = readl(&id_base->die_id_2);
|
||||
id[0] = readl(&id_base->die_id_3);
|
||||
get_dieid(id);
|
||||
sprintf(die_id, "%08x%08x%08x%08x", id[0], id[1], id[2], id[3]);
|
||||
setenv("dieid#", die_id);
|
||||
uid_s = die_id;
|
||||
|
||||
@@ -372,6 +372,38 @@ struct vcores_data dra752_volts = {
|
||||
.iva.pmic = &tps659038,
|
||||
};
|
||||
|
||||
struct vcores_data dra722_volts = {
|
||||
.mpu.value = 1000,
|
||||
.mpu.efuse.reg = STD_FUSE_OPP_VMIN_MPU_NOM,
|
||||
.mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.mpu.addr = 0x23,
|
||||
.mpu.pmic = &tps659038,
|
||||
|
||||
.eve.value = 1000,
|
||||
.eve.efuse.reg = STD_FUSE_OPP_VMIN_DSPEVE_NOM,
|
||||
.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.eve.addr = 0x2f,
|
||||
.eve.pmic = &tps659038,
|
||||
|
||||
.gpu.value = 1000,
|
||||
.gpu.efuse.reg = STD_FUSE_OPP_VMIN_GPU_NOM,
|
||||
.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.gpu.addr = 0x2f,
|
||||
.gpu.pmic = &tps659038,
|
||||
|
||||
.core.value = 1000,
|
||||
.core.efuse.reg = STD_FUSE_OPP_VMIN_CORE_NOM,
|
||||
.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.core.addr = 0x27,
|
||||
.core.pmic = &tps659038,
|
||||
|
||||
.iva.value = 1000,
|
||||
.iva.efuse.reg = STD_FUSE_OPP_VMIN_IVA_NOM,
|
||||
.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.iva.addr = 0x2f,
|
||||
.iva.pmic = &tps659038,
|
||||
};
|
||||
|
||||
/*
|
||||
* Enable essential clock domains, modules and
|
||||
* do some additional special settings needed
|
||||
@@ -558,6 +590,13 @@ void hw_data_init(void)
|
||||
*ctrl = &dra7xx_ctrl;
|
||||
break;
|
||||
|
||||
case DRA722_ES1_0:
|
||||
*prcm = &dra7xx_prcm;
|
||||
*dplls_data = &dra7xx_dplls;
|
||||
*omap_vcores = &dra722_volts;
|
||||
*ctrl = &dra7xx_ctrl;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("\n INVALID OMAP REVISION ");
|
||||
}
|
||||
@@ -580,6 +619,7 @@ void get_ioregs(const struct ctrl_ioregs **regs)
|
||||
break;
|
||||
case DRA752_ES1_0:
|
||||
case DRA752_ES1_1:
|
||||
case DRA722_ES1_0:
|
||||
*regs = &ioregs_dra7xx_es1;
|
||||
break;
|
||||
|
||||
|
||||
@@ -336,6 +336,9 @@ void init_omap_revision(void)
|
||||
case DRA752_CONTROL_ID_CODE_ES1_1:
|
||||
*omap_si_rev = DRA752_ES1_1;
|
||||
break;
|
||||
case DRA722_CONTROL_ID_CODE_ES1_0:
|
||||
*omap_si_rev = DRA722_ES1_0;
|
||||
break;
|
||||
default:
|
||||
*omap_si_rev = OMAP5430_SILICON_ID_INVALID;
|
||||
}
|
||||
|
||||
@@ -447,10 +447,10 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
|
||||
.control_wkup_control_spare_r = 0x4AE0C5B4,
|
||||
.control_wkup_control_spare_r_c0 = 0x4AE0C5B8,
|
||||
.control_srcomp_east_side_wkup = 0x4AE0C5BC,
|
||||
.control_efuse_1 = 0x4AE0C5C0,
|
||||
.control_efuse_2 = 0x4AE0C5C4,
|
||||
.control_efuse_3 = 0x4AE0C5C8,
|
||||
.control_efuse_4 = 0x4AE0C5CC,
|
||||
.control_efuse_1 = 0x4AE0C5C8,
|
||||
.control_efuse_2 = 0x4AE0C5CC,
|
||||
.control_efuse_3 = 0x4AE0C5D0,
|
||||
.control_efuse_4 = 0x4AE0C5D4,
|
||||
.control_efuse_13 = 0x4AE0C5F0,
|
||||
};
|
||||
|
||||
|
||||
@@ -229,6 +229,17 @@ const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2 = {
|
||||
.is_ma_present = 0x1
|
||||
};
|
||||
|
||||
/*
|
||||
* DRA722 EVM EMIF1 CONFIGURATION
|
||||
*/
|
||||
const struct dmm_lisa_map_regs lisa_map_2G_x_2 = {
|
||||
.dmm_lisa_map_0 = 0x0,
|
||||
.dmm_lisa_map_1 = 0x0,
|
||||
.dmm_lisa_map_2 = 0x80600100,
|
||||
.dmm_lisa_map_3 = 0xFF020100,
|
||||
.is_ma_present = 0x1
|
||||
};
|
||||
|
||||
static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs)
|
||||
{
|
||||
switch (omap_revision()) {
|
||||
@@ -255,6 +266,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DRA722_ES1_0:
|
||||
default:
|
||||
*regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
|
||||
}
|
||||
@@ -275,8 +287,11 @@ static void emif_get_dmm_regs_sdp(const struct dmm_lisa_map_regs
|
||||
break;
|
||||
case DRA752_ES1_0:
|
||||
case DRA752_ES1_1:
|
||||
default:
|
||||
*dmm_lisa_regs = &lisa_map_2G_x_2_x_2_2G_x_1_x_2;
|
||||
break;
|
||||
case DRA722_ES1_0:
|
||||
default:
|
||||
*dmm_lisa_regs = &lisa_map_2G_x_2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -463,6 +478,7 @@ static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr,
|
||||
break;
|
||||
case DRA752_ES1_0:
|
||||
case DRA752_ES1_1:
|
||||
case DRA722_ES1_0:
|
||||
if (emif_nr == 1) {
|
||||
*regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif1;
|
||||
*size =
|
||||
@@ -630,6 +646,7 @@ const struct read_write_regs *get_bug_regs(u32 *iterations)
|
||||
break;
|
||||
case DRA752_ES1_0:
|
||||
case DRA752_ES1_1:
|
||||
case DRA722_ES1_0:
|
||||
bug_00339_regs_ptr = dra_bug_00339_regs;
|
||||
*iterations = sizeof(dra_bug_00339_regs)/
|
||||
sizeof(dra_bug_00339_regs[0]);
|
||||
|
||||
@@ -11,7 +11,7 @@ obj-y += emac.o
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board.o
|
||||
obj-$(CONFIG_GLOBAL_TIMER) += timer.o
|
||||
obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o
|
||||
obj-$(CONFIG_R8A7790) += lowlevel_init_ca15.o cpu_info-r8a7790.o pfc-r8a7790.o
|
||||
obj-$(CONFIG_R8A7791) += lowlevel_init_ca15.o cpu_info-r8a7791.o pfc-r8a7791.o
|
||||
obj-$(CONFIG_R8A7790) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7790.o
|
||||
obj-$(CONFIG_R8A7791) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7791.o
|
||||
obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
|
||||
obj-$(CONFIG_TMU_TIMER) += ../../../../sh/lib/time.o
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
|
||||
*
|
||||
* Copyright (C) 2013 Renesas Electronics Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define PRR 0xFF000044
|
||||
|
||||
u32 rmobile_get_cpu_type(void)
|
||||
{
|
||||
u32 product;
|
||||
|
||||
product = readl(PRR);
|
||||
|
||||
return (u32)((product & 0x00007F00) >> 8);
|
||||
}
|
||||
|
||||
u32 rmobile_get_cpu_rev_integer(void)
|
||||
{
|
||||
u32 product;
|
||||
|
||||
product = readl(PRR);
|
||||
|
||||
return (u32)((product & 0x000000F0) >> 4);
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
|
||||
* This file is r8a7790 processor support.
|
||||
* arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
|
||||
*
|
||||
* Copyright (C) 2013 Renesas Electronics Corporation
|
||||
* Copyright (C) 2013,2014 Renesas Electronics Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
@@ -18,5 +17,10 @@ u32 rmobile_get_cpu_type(void)
|
||||
|
||||
u32 rmobile_get_cpu_rev_integer(void)
|
||||
{
|
||||
return (readl(PRR) & 0x000000F0) >> 4;
|
||||
return ((readl(PRR) & 0x000000F0) >> 4) + 1;
|
||||
}
|
||||
|
||||
u32 rmobile_get_cpu_rev_fraction(void)
|
||||
{
|
||||
return readl(PRR) & 0x0000000F;
|
||||
}
|
||||
@@ -44,35 +44,30 @@ static u32 __rmobile_get_cpu_rev_fraction(void)
|
||||
u32 rmobile_get_cpu_rev_fraction(void)
|
||||
__attribute__((weak, alias("__rmobile_get_cpu_rev_fraction")));
|
||||
|
||||
/* CPU infomation table */
|
||||
static const struct {
|
||||
u16 cpu_type;
|
||||
u8 cpu_name[10];
|
||||
} rmobile_cpuinfo[] = {
|
||||
{ 0x37, "SH73A0" },
|
||||
{ 0x40, "R8A7740" },
|
||||
{ 0x45, "R8A7790" },
|
||||
{ 0x47, "R8A7791" },
|
||||
{ 0x0, "CPU" },
|
||||
};
|
||||
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
switch (rmobile_get_cpu_type()) {
|
||||
case 0x37:
|
||||
printf("CPU: Renesas Electronics SH73A0 rev %d.%d\n",
|
||||
rmobile_get_cpu_rev_integer(),
|
||||
rmobile_get_cpu_rev_fraction());
|
||||
break;
|
||||
case 0x40:
|
||||
printf("CPU: Renesas Electronics R8A7740 rev %d.%d\n",
|
||||
rmobile_get_cpu_rev_integer(),
|
||||
rmobile_get_cpu_rev_fraction());
|
||||
break;
|
||||
|
||||
case 0x45:
|
||||
printf("CPU: Renesas Electronics R8A7790 rev %d\n",
|
||||
rmobile_get_cpu_rev_integer());
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
printf("CPU: Renesas Electronics R8A7791 rev %d\n",
|
||||
rmobile_get_cpu_rev_integer());
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("CPU: Renesas Electronics CPU rev %d.%d\n",
|
||||
rmobile_get_cpu_rev_integer(),
|
||||
rmobile_get_cpu_rev_fraction());
|
||||
break;
|
||||
int i = 0;
|
||||
u32 cpu_type = rmobile_get_cpu_type();
|
||||
for (; i < ARRAY_SIZE(rmobile_cpuinfo); i++) {
|
||||
if (rmobile_cpuinfo[i].cpu_type == cpu_type) {
|
||||
printf("CPU: Renesas Electronics %s rev %d.%d\n",
|
||||
rmobile_cpuinfo[i].cpu_name,
|
||||
rmobile_get_cpu_rev_integer(),
|
||||
rmobile_get_cpu_rev_fraction());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S
|
||||
* This file is lager low level initialize.
|
||||
*
|
||||
* Copyright (C) 2013 Renesas Electronics Corporation
|
||||
* Copyright (C) 2013, 2014 Renesas Electronics Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
@@ -36,16 +36,32 @@ do_cpu_waiting:
|
||||
.align 4
|
||||
do_lowlevel_init:
|
||||
/* surpress wfe if ca15 */
|
||||
tst r4, #4
|
||||
tst r4, #4
|
||||
mrceq p15, 0, r0, c1, c0, 1 /* actlr */
|
||||
orreq r0, r0, #(1<<7)
|
||||
mcreq p15, 0, r0, c1, c0, 1
|
||||
|
||||
/* and set l2 latency */
|
||||
mrceq p15, 1, r0, c9, c0, 2 /* l2ctlr */
|
||||
orreq r0, r0, #0x00000800
|
||||
orreq r0, r0, #0x00000003
|
||||
mcreq p15, 1, r0, c9, c0, 2
|
||||
|
||||
mrc p15, 0, r0, c0, c0, 5 /* r0 = MPIDR */
|
||||
and r0, r0, #0xf00
|
||||
lsr r0, r0, #8
|
||||
tst r0, #1 /* only need for cluster 0 */
|
||||
bne _exit_init_l2_a15
|
||||
|
||||
mrc p15, 1, r0, c9, c0, 2 /* r0 = L2CTLR */
|
||||
and r1, r0, #7
|
||||
cmp r1, #3 /* has already been set up */
|
||||
bicne r0, r0, #0xe7
|
||||
orrne r0, r0, #0x83 /* L2CTLR[7:6] + L2CTLR[2:0] */
|
||||
orrne r0, r0, #0x20 /* L2CTLR[5] */
|
||||
mcrne p15, 1, r0, c9, c0, 2
|
||||
|
||||
_exit_init_l2_a15:
|
||||
ldr r3, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
sub sp, r3, #4
|
||||
str lr, [sp]
|
||||
|
||||
@@ -913,7 +913,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
|
||||
/* SEL_SCIF3 [2] */
|
||||
FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3,
|
||||
/* SEL_IEB [2] */
|
||||
FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2,
|
||||
FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2, 0,
|
||||
/* SEL_MMC [1] */
|
||||
FN_SEL_MMC_0, FN_SEL_MMC_1,
|
||||
/* SEL_SCIF5 [1] */
|
||||
|
||||
@@ -10,20 +10,7 @@
|
||||
/* Save the parameter pass in by previous boot loader */
|
||||
.global save_boot_params
|
||||
save_boot_params:
|
||||
/* save the parameter here */
|
||||
|
||||
/*
|
||||
* Setup stack for exception, which is located
|
||||
* at the end of on-chip RAM. We don't expect exception prior to
|
||||
* relocation and if that happens, we won't worry -- it will overide
|
||||
* global data region as the code will goto reset. After relocation,
|
||||
* this region won't be used by other part of program.
|
||||
* Hence it is safe.
|
||||
*/
|
||||
ldr r0, =(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
|
||||
ldr r1, =IRQ_STACK_START_IN
|
||||
str r0, [r1]
|
||||
|
||||
/* no parameter to save */
|
||||
bx lr
|
||||
|
||||
|
||||
|
||||
@@ -19,46 +19,6 @@
|
||||
#include <asm/system.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.globl _start
|
||||
_start: b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
_undefined_instruction: .word _undefined_instruction
|
||||
_software_interrupt: .word _software_interrupt
|
||||
_prefetch_abort: .word _prefetch_abort
|
||||
_data_abort: .word _data_abort
|
||||
_not_used: .word _not_used
|
||||
_irq: .word _irq
|
||||
_fiq: .word _fiq
|
||||
_pad: .word 0x12345678 /* now 16*4=64 */
|
||||
#else
|
||||
.globl _undefined_instruction
|
||||
_undefined_instruction: .word undefined_instruction
|
||||
.globl _software_interrupt
|
||||
_software_interrupt: .word software_interrupt
|
||||
.globl _prefetch_abort
|
||||
_prefetch_abort: .word prefetch_abort
|
||||
.globl _data_abort
|
||||
_data_abort: .word data_abort
|
||||
.globl _not_used
|
||||
_not_used: .word not_used
|
||||
.globl _irq
|
||||
_irq: .word irq
|
||||
.globl _fiq
|
||||
_fiq: .word fiq
|
||||
_pad: .word 0x12345678 /* now 16*4=64 */
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
.global _end_vect
|
||||
_end_vect:
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
/*************************************************************************
|
||||
*
|
||||
* Startup Code (reset vector)
|
||||
@@ -70,26 +30,7 @@ _end_vect:
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
bl save_boot_params
|
||||
@@ -250,195 +191,3 @@ ENTRY(cpu_init_crit)
|
||||
b lowlevel_init @ go setup pll,mux,memory
|
||||
ENDPROC(cpu_init_crit)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current
|
||||
@ user stack
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in
|
||||
@ svc mode) r0-r12
|
||||
ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort
|
||||
@ stack
|
||||
ldmia r2, {r2 - r3} @ get values for "aborted" pc
|
||||
@ and cpsr (into parm regs)
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0
|
||||
@ (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC @ !! R8 NEEDS to be saved !!
|
||||
@ a reserved stack spot would
|
||||
@ be good.
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into
|
||||
@ cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter
|
||||
@ in banked mode)
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0
|
||||
@ of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of
|
||||
@ saved stack
|
||||
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure
|
||||
@ moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction &
|
||||
@ switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack_swi
|
||||
sub r13, r13, #4 @ space on current stack for
|
||||
@ scratch reg.
|
||||
str r0, [r13] @ save R0's value.
|
||||
ldr r0, IRQ_STACK_START_IN @ get data regions start
|
||||
@ spots for abort stack
|
||||
str lr, [r0] @ save caller lr in position 0
|
||||
@ of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r0, #4] @ save spsr in position 1 of
|
||||
@ saved stack
|
||||
ldr lr, [r0] @ restore lr
|
||||
ldr r0, [r13] @ restore r0
|
||||
add r13, r13, #4 @ pop stack entry
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack_swi
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effective fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif /* CONFIG_USE_IRQ */
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
@@ -24,19 +24,6 @@ void sdelay(unsigned long loops)
|
||||
"bne 1b":"=r" (loops):"0"(loops));
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* sr32 - clear & set a value in a bit range for a 32 bit address
|
||||
*****************************************************************/
|
||||
void sr32(void *addr, u32 start_bit, u32 num_bits, u32 value)
|
||||
{
|
||||
u32 tmp, msk = 0;
|
||||
msk = 1 << num_bits;
|
||||
--msk;
|
||||
tmp = readl((u32)addr) & ~(msk << start_bit);
|
||||
tmp |= value << start_bit;
|
||||
writel(tmp, (u32)addr);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* wait_on_value() - common routine to allow waiting for changes in
|
||||
* volatile regs.
|
||||
|
||||
@@ -14,6 +14,9 @@ void lowlevel_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
#define ZYNQ_SILICON_VER_MASK 0xF0000000
|
||||
#define ZYNQ_SILICON_VER_SHIFT 28
|
||||
|
||||
int arch_cpu_init(void)
|
||||
{
|
||||
zynq_slcr_unlock();
|
||||
@@ -42,6 +45,16 @@ int arch_cpu_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int zynq_get_silicon_version(void)
|
||||
{
|
||||
unsigned int ver;
|
||||
|
||||
ver = (readl(&devcfg_base->mctrl) &
|
||||
ZYNQ_SILICON_VER_MASK) >> ZYNQ_SILICON_VER_SHIFT;
|
||||
|
||||
return ver;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
{
|
||||
zynq_slcr_cpu_reset();
|
||||
|
||||
@@ -40,11 +40,8 @@ void zynq_ddrc_init(void)
|
||||
* first stage bootloader. To get ECC to work all memory has
|
||||
* been initialized by writing any value.
|
||||
*/
|
||||
memset(0, 0, 1 * 1024 * 1024);
|
||||
memset((void *)0, 0, 1 * 1024 * 1024);
|
||||
} else {
|
||||
puts("Memory: ECC disabled\n");
|
||||
}
|
||||
|
||||
if (width == ZYNQ_DDRC_CTRLREG_BUSWIDTH_16BIT)
|
||||
gd->ram_size /= 2;
|
||||
}
|
||||
|
||||
@@ -8,26 +8,75 @@
|
||||
#include <asm/io.h>
|
||||
#include <malloc.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/arch/clk.h>
|
||||
|
||||
#define SLCR_LOCK_MAGIC 0x767B
|
||||
#define SLCR_UNLOCK_MAGIC 0xDF0D
|
||||
|
||||
#define SLCR_USB_L1_SEL 0x04
|
||||
|
||||
#define SLCR_IDCODE_MASK 0x1F000
|
||||
#define SLCR_IDCODE_SHIFT 12
|
||||
|
||||
/*
|
||||
* zynq_slcr_mio_get_status - Get the status of MIO peripheral.
|
||||
*
|
||||
* @peri_name: Name of the peripheral for checking MIO status
|
||||
* @get_pins: Pointer to array of get pin for this peripheral
|
||||
* @num_pins: Number of pins for this peripheral
|
||||
* @mask: Mask value
|
||||
* @check_val: Required check value to get the status of periph
|
||||
*/
|
||||
struct zynq_slcr_mio_get_status {
|
||||
const char *peri_name;
|
||||
const int *get_pins;
|
||||
int num_pins;
|
||||
u32 mask;
|
||||
u32 check_val;
|
||||
};
|
||||
|
||||
static const int usb0_pins[] = {
|
||||
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
|
||||
};
|
||||
|
||||
static const int usb1_pins[] = {
|
||||
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
|
||||
};
|
||||
|
||||
static const struct zynq_slcr_mio_get_status mio_periphs[] = {
|
||||
{
|
||||
"usb0",
|
||||
usb0_pins,
|
||||
ARRAY_SIZE(usb0_pins),
|
||||
SLCR_USB_L1_SEL,
|
||||
SLCR_USB_L1_SEL,
|
||||
},
|
||||
{
|
||||
"usb1",
|
||||
usb1_pins,
|
||||
ARRAY_SIZE(usb1_pins),
|
||||
SLCR_USB_L1_SEL,
|
||||
SLCR_USB_L1_SEL,
|
||||
},
|
||||
};
|
||||
|
||||
static int slcr_lock = 1; /* 1 means locked, 0 means unlocked */
|
||||
|
||||
void zynq_slcr_lock(void)
|
||||
{
|
||||
if (!slcr_lock)
|
||||
if (!slcr_lock) {
|
||||
writel(SLCR_LOCK_MAGIC, &slcr_base->slcr_lock);
|
||||
slcr_lock = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void zynq_slcr_unlock(void)
|
||||
{
|
||||
if (slcr_lock)
|
||||
if (slcr_lock) {
|
||||
writel(SLCR_UNLOCK_MAGIC, &slcr_base->slcr_unlock);
|
||||
slcr_lock = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset the entire system */
|
||||
@@ -82,7 +131,7 @@ void zynq_slcr_devcfg_disable(void)
|
||||
{
|
||||
zynq_slcr_unlock();
|
||||
|
||||
/* Disable AXI interface */
|
||||
/* Disable AXI interface by asserting FPGA resets */
|
||||
writel(0xFFFFFFFF, &slcr_base->fpga_rst_ctrl);
|
||||
|
||||
/* Set Level Shifters DT618760 */
|
||||
@@ -98,7 +147,7 @@ void zynq_slcr_devcfg_enable(void)
|
||||
/* Set Level Shifters DT618760 */
|
||||
writel(0xF, &slcr_base->lvl_shftr_en);
|
||||
|
||||
/* Disable AXI interface */
|
||||
/* Enable AXI interface by de-asserting FPGA resets */
|
||||
writel(0x0, &slcr_base->fpga_rst_ctrl);
|
||||
|
||||
zynq_slcr_lock();
|
||||
@@ -115,3 +164,33 @@ u32 zynq_slcr_get_idcode(void)
|
||||
return (readl(&slcr_base->pss_idcode) & SLCR_IDCODE_MASK) >>
|
||||
SLCR_IDCODE_SHIFT;
|
||||
}
|
||||
|
||||
/*
|
||||
* zynq_slcr_get_mio_pin_status - Get the MIO pin status of peripheral.
|
||||
*
|
||||
* @periph: Name of the peripheral
|
||||
*
|
||||
* Returns count to indicate the number of pins configured for the
|
||||
* given @periph.
|
||||
*/
|
||||
int zynq_slcr_get_mio_pin_status(const char *periph)
|
||||
{
|
||||
const struct zynq_slcr_mio_get_status *mio_ptr;
|
||||
int val, i, j;
|
||||
int mio = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
|
||||
if (strcmp(periph, mio_periphs[i].peri_name) == 0) {
|
||||
mio_ptr = &mio_periphs[i];
|
||||
for (j = 0; j < mio_ptr->num_pins; j++) {
|
||||
val = readl(&slcr_base->mio_pin
|
||||
[mio_ptr->get_pins[j]]);
|
||||
if ((val & mio_ptr->mask) == mio_ptr->check_val)
|
||||
mio++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return mio;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,13 @@ void board_init_f(ulong dummy)
|
||||
board_init_r(NULL, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_BOARD_INIT
|
||||
void spl_board_init(void)
|
||||
{
|
||||
board_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
u32 mode;
|
||||
@@ -67,3 +74,11 @@ int spl_start_uboot(void)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
__weak void ps7_init(void)
|
||||
{
|
||||
/*
|
||||
* This function is overridden by the one in
|
||||
* board/xilinx/zynq/ps7_init.c, if it exists.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ SECTIONS
|
||||
}
|
||||
|
||||
/*
|
||||
* Zynq needs to discard more sections because the user
|
||||
* Zynq needs to discard these sections because the user
|
||||
* is expected to pass this image on to tools for boot.bin
|
||||
* generation that require them to be dropped.
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
#include <errno.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#ifdef CONFIG_CPU_PXA25X
|
||||
#if ((CONFIG_SYS_INIT_SP_ADDR) != 0xfffff800)
|
||||
#error "Init SP address must be set to 0xfffff800 for PXA250"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define CPU_MASK_PXA_PRODID 0x000003f0
|
||||
#define CPU_MASK_PXA_REVID 0x0000000f
|
||||
|
||||
|
||||
@@ -23,54 +23,6 @@
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
#ifdef CONFIG_CPU_PXA25X
|
||||
#if ((CONFIG_SYS_INIT_SP_ADDR) != 0xfffff800)
|
||||
#error "Init SP address must be set to 0xfffff800 for PXA250"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
.globl _start
|
||||
_start: b reset
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
ldr pc, _hang
|
||||
|
||||
_hang:
|
||||
.word do_hang
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678
|
||||
.word 0x12345678 /* now 16*4=64 */
|
||||
#else
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction: .word undefined_instruction
|
||||
_software_interrupt: .word software_interrupt
|
||||
_prefetch_abort: .word prefetch_abort
|
||||
_data_abort: .word data_abort
|
||||
_not_used: .word not_used
|
||||
_irq: .word irq
|
||||
_fiq: .word fiq
|
||||
_pad: .word 0x12345678 /* now 16*4=64 */
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
.global _end_vect
|
||||
_end_vect:
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -84,26 +36,7 @@ _end_vect:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -174,190 +107,6 @@ cpu_init_crit:
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif /* !CONFIG_SKIP_LOWLEVEL_INIT || CONFIG_CPU_PXA25X */
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack
|
||||
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack
|
||||
ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs)
|
||||
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
|
||||
mov r0, sp @ save current stack into r0 (param register)
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good.
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode)
|
||||
|
||||
str lr, [r13] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r13, #4] @ save spsr in position 1 of saved stack
|
||||
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
@ msr spsr_c, r13
|
||||
msr spsr, r13 @ switch modes, make sure moves will execute
|
||||
mov lr, pc @ capture return pc
|
||||
movs pc, lr @ jump to next instruction & switch modes.
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack_swi
|
||||
sub r13, r13, #4 @ space on current stack for scratch reg.
|
||||
str r0, [r13] @ save R0's value.
|
||||
ldr r0, IRQ_STACK_START_IN @ get data regions start
|
||||
str lr, [r0] @ save caller lr in position 0 of saved stack
|
||||
mrs lr, spsr @ get the spsr
|
||||
str lr, [r0, #4] @ save spsr in position 1 of saved stack
|
||||
ldr lr, [r0] @ restore lr
|
||||
ldr r0, [r13] @ restore r0
|
||||
add r13, r13, #4 @ pop stack entry
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
.align 5
|
||||
do_hang:
|
||||
bl hang /* hang and never return */
|
||||
#else /* !CONFIG_SPL_BUILD */
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack_swi
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
.align 5
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
|
||||
/*
|
||||
* Enable MMU to use DCache as DRAM.
|
||||
*
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@@ -52,3 +53,16 @@ static void cache_flush (void)
|
||||
|
||||
asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
|
||||
}
|
||||
|
||||
#define RST_BASE 0x90030000
|
||||
#define RSRR 0x00
|
||||
#define RCSR 0x04
|
||||
|
||||
__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
|
||||
{
|
||||
/* repeat endlessly */
|
||||
while (1) {
|
||||
writel(0, RST_BASE + RCSR);
|
||||
writel(1, RST_BASE + RSRR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,36 +13,6 @@
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Jump vector table as in table 3.1 in [1]
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
.globl _start
|
||||
_start: b reset
|
||||
ldr pc, _undefined_instruction
|
||||
ldr pc, _software_interrupt
|
||||
ldr pc, _prefetch_abort
|
||||
ldr pc, _data_abort
|
||||
ldr pc, _not_used
|
||||
ldr pc, _irq
|
||||
ldr pc, _fiq
|
||||
|
||||
_undefined_instruction: .word undefined_instruction
|
||||
_software_interrupt: .word software_interrupt
|
||||
_prefetch_abort: .word prefetch_abort
|
||||
_data_abort: .word data_abort
|
||||
_not_used: .word not_used
|
||||
_irq: .word irq
|
||||
_fiq: .word fiq
|
||||
|
||||
.balignl 16,0xdeadbeef
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
@@ -56,26 +26,7 @@ _fiq: .word fiq
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl IRQ_STACK_START
|
||||
IRQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) */
|
||||
.globl FIQ_STACK_START
|
||||
FIQ_STACK_START:
|
||||
.word 0x0badc0de
|
||||
#endif
|
||||
|
||||
/* IRQ stack memory (calculated at run-time) + 8 bytes */
|
||||
.globl IRQ_STACK_START_IN
|
||||
IRQ_STACK_START_IN:
|
||||
.word 0x0badc0de
|
||||
|
||||
/*
|
||||
* the actual reset code
|
||||
*/
|
||||
.globl reset
|
||||
|
||||
reset:
|
||||
/*
|
||||
@@ -173,177 +124,3 @@ cpu_init_crit:
|
||||
mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */
|
||||
|
||||
mov pc, lr
|
||||
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Interrupt handling
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
@
|
||||
@ IRQ stack frame.
|
||||
@
|
||||
#define S_FRAME_SIZE 72
|
||||
|
||||
#define S_OLD_R0 68
|
||||
#define S_PSR 64
|
||||
#define S_PC 60
|
||||
#define S_LR 56
|
||||
#define S_SP 52
|
||||
|
||||
#define S_IP 48
|
||||
#define S_FP 44
|
||||
#define S_R10 40
|
||||
#define S_R9 36
|
||||
#define S_R8 32
|
||||
#define S_R7 28
|
||||
#define S_R6 24
|
||||
#define S_R5 20
|
||||
#define S_R4 16
|
||||
#define S_R3 12
|
||||
#define S_R2 8
|
||||
#define S_R1 4
|
||||
#define S_R0 0
|
||||
|
||||
#define MODE_SVC 0x13
|
||||
#define I_BIT 0x80
|
||||
|
||||
/*
|
||||
* use bad_save_user_regs for abort/prefetch/undef/swi ...
|
||||
* use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
|
||||
*/
|
||||
|
||||
.macro bad_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC
|
||||
|
||||
ldr r2, IRQ_STACK_START_IN
|
||||
ldmia r2, {r2 - r4} @ get pc, cpsr, old_r0
|
||||
add r0, sp, #S_FRAME_SIZE @ restore sp_SVC
|
||||
|
||||
add r5, sp, #S_SP
|
||||
mov r1, lr
|
||||
stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_r
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_save_user_regs
|
||||
sub sp, sp, #S_FRAME_SIZE
|
||||
stmia sp, {r0 - r12} @ Calling r0-r12
|
||||
add r8, sp, #S_PC
|
||||
stmdb r8, {sp, lr}^ @ Calling SP, LR
|
||||
str lr, [r8, #0] @ Save calling PC
|
||||
mrs r6, spsr
|
||||
str r6, [r8, #4] @ Save CPSR
|
||||
str r0, [r8, #8] @ Save OLD_R0
|
||||
mov r0, sp
|
||||
.endm
|
||||
|
||||
.macro irq_restore_user_regs
|
||||
ldmia sp, {r0 - lr}^ @ Calling r0 - lr
|
||||
mov r0, r0
|
||||
ldr lr, [sp, #S_PC] @ Get PC
|
||||
add sp, sp, #S_FRAME_SIZE
|
||||
subs pc, lr, #4 @ return & move spsr_svc into cpsr
|
||||
.endm
|
||||
|
||||
.macro get_bad_stack
|
||||
ldr r13, IRQ_STACK_START_IN @ setup our mode stack
|
||||
|
||||
str lr, [r13] @ save caller lr / spsr
|
||||
mrs lr, spsr
|
||||
str lr, [r13, #4]
|
||||
|
||||
mov r13, #MODE_SVC @ prepare SVC-Mode
|
||||
msr spsr_c, r13
|
||||
mov lr, pc
|
||||
movs pc, lr
|
||||
.endm
|
||||
|
||||
.macro get_irq_stack @ setup IRQ stack
|
||||
ldr sp, IRQ_STACK_START
|
||||
.endm
|
||||
|
||||
.macro get_fiq_stack @ setup FIQ stack
|
||||
ldr sp, FIQ_STACK_START
|
||||
.endm
|
||||
|
||||
/*
|
||||
* exception handlers
|
||||
*/
|
||||
.align 5
|
||||
undefined_instruction:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_undefined_instruction
|
||||
|
||||
.align 5
|
||||
software_interrupt:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_software_interrupt
|
||||
|
||||
.align 5
|
||||
prefetch_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_prefetch_abort
|
||||
|
||||
.align 5
|
||||
data_abort:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_data_abort
|
||||
|
||||
.align 5
|
||||
not_used:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_not_used
|
||||
|
||||
#ifdef CONFIG_USE_IRQ
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_irq_stack
|
||||
irq_save_user_regs
|
||||
bl do_irq
|
||||
irq_restore_user_regs
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_fiq_stack
|
||||
/* someone ought to write a more effiction fiq_save_user_regs */
|
||||
irq_save_user_regs
|
||||
bl do_fiq
|
||||
irq_restore_user_regs
|
||||
|
||||
#else
|
||||
|
||||
.align 5
|
||||
irq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_irq
|
||||
|
||||
.align 5
|
||||
fiq:
|
||||
get_bad_stack
|
||||
bad_save_user_regs
|
||||
bl do_fiq
|
||||
|
||||
#endif
|
||||
|
||||
.align 5
|
||||
.globl reset_cpu
|
||||
reset_cpu:
|
||||
ldr r0, RST_BASE
|
||||
mov r1, #0x0 @ set bit 3-0 ...
|
||||
str r1, [r0, #RCSR] @ ... to clear in RCSR
|
||||
mov r1, #0x1
|
||||
str r1, [r0, #RSRR] @ and perform reset
|
||||
b reset_cpu @ silly, but repeat endlessly
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += ap.o
|
||||
obj-y += board.o
|
||||
obj-y += cache.o
|
||||
obj-y += clock.o
|
||||
obj-y += lowlevel_init.o
|
||||
obj-y += ap.o board.o clock.o cache.o
|
||||
obj-y += pinmux-common.o
|
||||
obj-$(CONFIG_DISPLAY_CPUINFO) += sys_info.o
|
||||
|
||||
527
arch/arm/cpu/tegra-common/pinmux-common.c
Normal file
527
arch/arm/cpu/tegra-common/pinmux-common.c
Normal file
@@ -0,0 +1,527 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2011 The Chromium OS Authors.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
|
||||
/* return 1 if a pingrp is in range */
|
||||
#define pmux_pingrp_isvalid(pin) (((pin) >= 0) && ((pin) < PMUX_PINGRP_COUNT))
|
||||
|
||||
/* return 1 if a pmux_func is in range */
|
||||
#define pmux_func_isvalid(func) \
|
||||
(((func) >= 0) && ((func) < PMUX_FUNC_COUNT))
|
||||
|
||||
/* return 1 if a pin_pupd_is in range */
|
||||
#define pmux_pin_pupd_isvalid(pupd) \
|
||||
(((pupd) >= PMUX_PULL_NORMAL) && ((pupd) <= PMUX_PULL_UP))
|
||||
|
||||
/* return 1 if a pin_tristate_is in range */
|
||||
#define pmux_pin_tristate_isvalid(tristate) \
|
||||
(((tristate) >= PMUX_TRI_NORMAL) && ((tristate) <= PMUX_TRI_TRISTATE))
|
||||
|
||||
#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC
|
||||
/* return 1 if a pin_io_is in range */
|
||||
#define pmux_pin_io_isvalid(io) \
|
||||
(((io) >= PMUX_PIN_OUTPUT) && ((io) <= PMUX_PIN_INPUT))
|
||||
|
||||
/* return 1 if a pin_lock is in range */
|
||||
#define pmux_pin_lock_isvalid(lock) \
|
||||
(((lock) >= PMUX_PIN_LOCK_DISABLE) && ((lock) <= PMUX_PIN_LOCK_ENABLE))
|
||||
|
||||
/* return 1 if a pin_od is in range */
|
||||
#define pmux_pin_od_isvalid(od) \
|
||||
(((od) >= PMUX_PIN_OD_DISABLE) && ((od) <= PMUX_PIN_OD_ENABLE))
|
||||
|
||||
/* return 1 if a pin_ioreset_is in range */
|
||||
#define pmux_pin_ioreset_isvalid(ioreset) \
|
||||
(((ioreset) >= PMUX_PIN_IO_RESET_DISABLE) && \
|
||||
((ioreset) <= PMUX_PIN_IO_RESET_ENABLE))
|
||||
|
||||
#ifdef TEGRA_PMX_HAS_RCV_SEL
|
||||
/* return 1 if a pin_rcv_sel_is in range */
|
||||
#define pmux_pin_rcv_sel_isvalid(rcv_sel) \
|
||||
(((rcv_sel) >= PMUX_PIN_RCV_SEL_NORMAL) && \
|
||||
((rcv_sel) <= PMUX_PIN_RCV_SEL_HIGH))
|
||||
#endif /* TEGRA_PMX_HAS_RCV_SEL */
|
||||
#endif /* TEGRA_PMX_HAS_PIN_IO_BIT_ETC */
|
||||
|
||||
#define _R(offset) (u32 *)(NV_PA_APB_MISC_BASE + (offset))
|
||||
|
||||
#if defined(CONFIG_TEGRA20)
|
||||
|
||||
#define MUX_REG(grp) _R(0x80 + ((tegra_soc_pingroups[grp].ctl_id / 16) * 4))
|
||||
#define MUX_SHIFT(grp) ((tegra_soc_pingroups[grp].ctl_id % 16) * 2)
|
||||
|
||||
#define PULL_REG(grp) _R(0xa0 + ((tegra_soc_pingroups[grp].pull_id / 16) * 4))
|
||||
#define PULL_SHIFT(grp) ((tegra_soc_pingroups[grp].pull_id % 16) * 2)
|
||||
|
||||
#define TRI_REG(grp) _R(0x14 + (((grp) / 32) * 4))
|
||||
#define TRI_SHIFT(grp) ((grp) % 32)
|
||||
|
||||
#else
|
||||
|
||||
#define REG(pin) _R(0x3000 + ((pin) * 4))
|
||||
|
||||
#define MUX_REG(pin) REG(pin)
|
||||
#define MUX_SHIFT(pin) 0
|
||||
|
||||
#define PULL_REG(pin) REG(pin)
|
||||
#define PULL_SHIFT(pin) 2
|
||||
|
||||
#define TRI_REG(pin) REG(pin)
|
||||
#define TRI_SHIFT(pin) 4
|
||||
|
||||
#endif /* CONFIG_TEGRA20 */
|
||||
|
||||
#define DRV_REG(group) _R(0x868 + ((group) * 4))
|
||||
|
||||
#define IO_SHIFT 5
|
||||
#define OD_SHIFT 6
|
||||
#define LOCK_SHIFT 7
|
||||
#define IO_RESET_SHIFT 8
|
||||
#define RCV_SEL_SHIFT 9
|
||||
|
||||
#if !defined(CONFIG_TEGRA20) && !defined(CONFIG_TEGRA30)
|
||||
/* This register/field only exists on Tegra114 and later */
|
||||
#define APB_MISC_PP_PINMUX_GLOBAL_0 0x40
|
||||
#define CLAMP_INPUTS_WHEN_TRISTATED 1
|
||||
|
||||
void pinmux_set_tristate_input_clamping(void)
|
||||
{
|
||||
u32 *reg = _R(APB_MISC_PP_PINMUX_GLOBAL_0);
|
||||
u32 val;
|
||||
|
||||
val = readl(reg);
|
||||
val |= CLAMP_INPUTS_WHEN_TRISTATED;
|
||||
writel(val, reg);
|
||||
}
|
||||
#endif
|
||||
|
||||
void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
|
||||
{
|
||||
u32 *reg = MUX_REG(pin);
|
||||
int i, mux = -1;
|
||||
u32 val;
|
||||
|
||||
if (func == PMUX_FUNC_DEFAULT)
|
||||
return;
|
||||
|
||||
/* Error check on pin and func */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_func_isvalid(func));
|
||||
|
||||
if (func >= PMUX_FUNC_RSVD1) {
|
||||
mux = (func - PMUX_FUNC_RSVD1) & 3;
|
||||
} else {
|
||||
/* Search for the appropriate function */
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (tegra_soc_pingroups[pin].funcs[i] == func) {
|
||||
mux = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(mux != -1);
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~(3 << MUX_SHIFT(pin));
|
||||
val |= (mux << MUX_SHIFT(pin));
|
||||
writel(val, reg);
|
||||
}
|
||||
|
||||
void pinmux_set_pullupdown(enum pmux_pingrp pin, enum pmux_pull pupd)
|
||||
{
|
||||
u32 *reg = PULL_REG(pin);
|
||||
u32 val;
|
||||
|
||||
/* Error check on pin and pupd */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_pupd_isvalid(pupd));
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~(3 << PULL_SHIFT(pin));
|
||||
val |= (pupd << PULL_SHIFT(pin));
|
||||
writel(val, reg);
|
||||
}
|
||||
|
||||
static void pinmux_set_tristate(enum pmux_pingrp pin, int tri)
|
||||
{
|
||||
u32 *reg = TRI_REG(pin);
|
||||
u32 val;
|
||||
|
||||
/* Error check on pin */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_tristate_isvalid(tri));
|
||||
|
||||
val = readl(reg);
|
||||
if (tri == PMUX_TRI_TRISTATE)
|
||||
val |= (1 << TRI_SHIFT(pin));
|
||||
else
|
||||
val &= ~(1 << TRI_SHIFT(pin));
|
||||
writel(val, reg);
|
||||
}
|
||||
|
||||
void pinmux_tristate_enable(enum pmux_pingrp pin)
|
||||
{
|
||||
pinmux_set_tristate(pin, PMUX_TRI_TRISTATE);
|
||||
}
|
||||
|
||||
void pinmux_tristate_disable(enum pmux_pingrp pin)
|
||||
{
|
||||
pinmux_set_tristate(pin, PMUX_TRI_NORMAL);
|
||||
}
|
||||
|
||||
#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC
|
||||
void pinmux_set_io(enum pmux_pingrp pin, enum pmux_pin_io io)
|
||||
{
|
||||
u32 *reg = REG(pin);
|
||||
u32 val;
|
||||
|
||||
if (io == PMUX_PIN_NONE)
|
||||
return;
|
||||
|
||||
/* Error check on pin and io */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_io_isvalid(io));
|
||||
|
||||
val = readl(reg);
|
||||
if (io == PMUX_PIN_INPUT)
|
||||
val |= (io & 1) << IO_SHIFT;
|
||||
else
|
||||
val &= ~(1 << IO_SHIFT);
|
||||
writel(val, reg);
|
||||
}
|
||||
|
||||
static void pinmux_set_lock(enum pmux_pingrp pin, enum pmux_pin_lock lock)
|
||||
{
|
||||
u32 *reg = REG(pin);
|
||||
u32 val;
|
||||
|
||||
if (lock == PMUX_PIN_LOCK_DEFAULT)
|
||||
return;
|
||||
|
||||
/* Error check on pin and lock */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_lock_isvalid(lock));
|
||||
|
||||
val = readl(reg);
|
||||
if (lock == PMUX_PIN_LOCK_ENABLE) {
|
||||
val |= (1 << LOCK_SHIFT);
|
||||
} else {
|
||||
if (val & (1 << LOCK_SHIFT))
|
||||
printf("%s: Cannot clear LOCK bit!\n", __func__);
|
||||
val &= ~(1 << LOCK_SHIFT);
|
||||
}
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_od(enum pmux_pingrp pin, enum pmux_pin_od od)
|
||||
{
|
||||
u32 *reg = REG(pin);
|
||||
u32 val;
|
||||
|
||||
if (od == PMUX_PIN_OD_DEFAULT)
|
||||
return;
|
||||
|
||||
/* Error check on pin and od */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_od_isvalid(od));
|
||||
|
||||
val = readl(reg);
|
||||
if (od == PMUX_PIN_OD_ENABLE)
|
||||
val |= (1 << OD_SHIFT);
|
||||
else
|
||||
val &= ~(1 << OD_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_ioreset(enum pmux_pingrp pin,
|
||||
enum pmux_pin_ioreset ioreset)
|
||||
{
|
||||
u32 *reg = REG(pin);
|
||||
u32 val;
|
||||
|
||||
if (ioreset == PMUX_PIN_IO_RESET_DEFAULT)
|
||||
return;
|
||||
|
||||
/* Error check on pin and ioreset */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_ioreset_isvalid(ioreset));
|
||||
|
||||
val = readl(reg);
|
||||
if (ioreset == PMUX_PIN_IO_RESET_ENABLE)
|
||||
val |= (1 << IO_RESET_SHIFT);
|
||||
else
|
||||
val &= ~(1 << IO_RESET_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TEGRA_PMX_HAS_RCV_SEL
|
||||
static void pinmux_set_rcv_sel(enum pmux_pingrp pin,
|
||||
enum pmux_pin_rcv_sel rcv_sel)
|
||||
{
|
||||
u32 *reg = REG(pin);
|
||||
u32 val;
|
||||
|
||||
if (rcv_sel == PMUX_PIN_RCV_SEL_DEFAULT)
|
||||
return;
|
||||
|
||||
/* Error check on pin and rcv_sel */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_rcv_sel_isvalid(rcv_sel));
|
||||
|
||||
val = readl(reg);
|
||||
if (rcv_sel == PMUX_PIN_RCV_SEL_HIGH)
|
||||
val |= (1 << RCV_SEL_SHIFT);
|
||||
else
|
||||
val &= ~(1 << RCV_SEL_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif /* TEGRA_PMX_HAS_RCV_SEL */
|
||||
#endif /* TEGRA_PMX_HAS_PIN_IO_BIT_ETC */
|
||||
|
||||
static void pinmux_config_pingrp(const struct pmux_pingrp_config *config)
|
||||
{
|
||||
enum pmux_pingrp pin = config->pingrp;
|
||||
|
||||
pinmux_set_func(pin, config->func);
|
||||
pinmux_set_pullupdown(pin, config->pull);
|
||||
pinmux_set_tristate(pin, config->tristate);
|
||||
#ifdef TEGRA_PMX_HAS_PIN_IO_BIT_ETC
|
||||
pinmux_set_io(pin, config->io);
|
||||
pinmux_set_lock(pin, config->lock);
|
||||
pinmux_set_od(pin, config->od);
|
||||
pinmux_set_ioreset(pin, config->ioreset);
|
||||
#ifdef TEGRA_PMX_HAS_RCV_SEL
|
||||
pinmux_set_rcv_sel(pin, config->rcv_sel);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void pinmux_config_pingrp_table(const struct pmux_pingrp_config *config,
|
||||
int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
pinmux_config_pingrp(&config[i]);
|
||||
}
|
||||
|
||||
#ifdef TEGRA_PMX_HAS_DRVGRPS
|
||||
|
||||
#define pmux_drvgrp_isvalid(pd) (((pd) >= 0) && ((pd) < PMUX_DRVGRP_COUNT))
|
||||
|
||||
#define pmux_slw_isvalid(slw) \
|
||||
(((slw) >= PMUX_SLWF_MIN) && ((slw) <= PMUX_SLWF_MAX))
|
||||
|
||||
#define pmux_drv_isvalid(drv) \
|
||||
(((drv) >= PMUX_DRVUP_MIN) && ((drv) <= PMUX_DRVUP_MAX))
|
||||
|
||||
#define pmux_lpmd_isvalid(lpm) \
|
||||
(((lpm) >= PMUX_LPMD_X8) && ((lpm) <= PMUX_LPMD_X))
|
||||
|
||||
#define pmux_schmt_isvalid(schmt) \
|
||||
(((schmt) >= PMUX_SCHMT_DISABLE) && ((schmt) <= PMUX_SCHMT_ENABLE))
|
||||
|
||||
#define pmux_hsm_isvalid(hsm) \
|
||||
(((hsm) >= PMUX_HSM_DISABLE) && ((hsm) <= PMUX_HSM_ENABLE))
|
||||
|
||||
#define HSM_SHIFT 2
|
||||
#define SCHMT_SHIFT 3
|
||||
#define LPMD_SHIFT 4
|
||||
#define LPMD_MASK (3 << LPMD_SHIFT)
|
||||
#define DRVDN_SHIFT 12
|
||||
#define DRVDN_MASK (0x7F << DRVDN_SHIFT)
|
||||
#define DRVUP_SHIFT 20
|
||||
#define DRVUP_MASK (0x7F << DRVUP_SHIFT)
|
||||
#define SLWR_SHIFT 28
|
||||
#define SLWR_MASK (3 << SLWR_SHIFT)
|
||||
#define SLWF_SHIFT 30
|
||||
#define SLWF_MASK (3 << SLWF_SHIFT)
|
||||
|
||||
static void pinmux_set_drvup_slwf(enum pmux_drvgrp grp, int slwf)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (slwf == PMUX_SLWF_NONE)
|
||||
return;
|
||||
|
||||
/* Error check on pad and slwf */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_slw_isvalid(slwf));
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~SLWF_MASK;
|
||||
val |= (slwf << SLWF_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_drvdn_slwr(enum pmux_drvgrp grp, int slwr)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (slwr == PMUX_SLWR_NONE)
|
||||
return;
|
||||
|
||||
/* Error check on pad and slwr */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_slw_isvalid(slwr));
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~SLWR_MASK;
|
||||
val |= (slwr << SLWR_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_drvup(enum pmux_drvgrp grp, int drvup)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (drvup == PMUX_DRVUP_NONE)
|
||||
return;
|
||||
|
||||
/* Error check on pad and drvup */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_drv_isvalid(drvup));
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~DRVUP_MASK;
|
||||
val |= (drvup << DRVUP_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_drvdn(enum pmux_drvgrp grp, int drvdn)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (drvdn == PMUX_DRVDN_NONE)
|
||||
return;
|
||||
|
||||
/* Error check on pad and drvdn */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_drv_isvalid(drvdn));
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~DRVDN_MASK;
|
||||
val |= (drvdn << DRVDN_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_lpmd(enum pmux_drvgrp grp, enum pmux_lpmd lpmd)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (lpmd == PMUX_LPMD_NONE)
|
||||
return;
|
||||
|
||||
/* Error check pad and lpmd value */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_lpmd_isvalid(lpmd));
|
||||
|
||||
val = readl(reg);
|
||||
val &= ~LPMD_MASK;
|
||||
val |= (lpmd << LPMD_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_schmt(enum pmux_drvgrp grp, enum pmux_schmt schmt)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (schmt == PMUX_SCHMT_NONE)
|
||||
return;
|
||||
|
||||
/* Error check pad */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_schmt_isvalid(schmt));
|
||||
|
||||
val = readl(reg);
|
||||
if (schmt == PMUX_SCHMT_ENABLE)
|
||||
val |= (1 << SCHMT_SHIFT);
|
||||
else
|
||||
val &= ~(1 << SCHMT_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_set_hsm(enum pmux_drvgrp grp, enum pmux_hsm hsm)
|
||||
{
|
||||
u32 *reg = DRV_REG(grp);
|
||||
u32 val;
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (hsm == PMUX_HSM_NONE)
|
||||
return;
|
||||
|
||||
/* Error check pad */
|
||||
assert(pmux_drvgrp_isvalid(grp));
|
||||
assert(pmux_hsm_isvalid(hsm));
|
||||
|
||||
val = readl(reg);
|
||||
if (hsm == PMUX_HSM_ENABLE)
|
||||
val |= (1 << HSM_SHIFT);
|
||||
else
|
||||
val &= ~(1 << HSM_SHIFT);
|
||||
writel(val, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void pinmux_config_drvgrp(const struct pmux_drvgrp_config *config)
|
||||
{
|
||||
enum pmux_drvgrp grp = config->drvgrp;
|
||||
|
||||
pinmux_set_drvup_slwf(grp, config->slwf);
|
||||
pinmux_set_drvdn_slwr(grp, config->slwr);
|
||||
pinmux_set_drvup(grp, config->drvup);
|
||||
pinmux_set_drvdn(grp, config->drvdn);
|
||||
pinmux_set_lpmd(grp, config->lpmd);
|
||||
pinmux_set_schmt(grp, config->schmt);
|
||||
pinmux_set_hsm(grp, config->hsm);
|
||||
}
|
||||
|
||||
void pinmux_config_drvgrp_table(const struct pmux_drvgrp_config *config,
|
||||
int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
pinmux_config_drvgrp(&config[i]);
|
||||
}
|
||||
#endif /* TEGRA_PMX_HAS_DRVGRPS */
|
||||
@@ -29,20 +29,24 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_UART4:
|
||||
switch (config) {
|
||||
case FUNCMUX_UART4_GMI:
|
||||
pinmux_set_func(PINGRP_GMI_A16, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PINGRP_GMI_A17, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PINGRP_GMI_A18, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PINGRP_GMI_A19, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_GMI_A16_PJ7,
|
||||
PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_GMI_A17_PB0,
|
||||
PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_GMI_A18_PB1,
|
||||
PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_GMI_A19_PK7,
|
||||
PMUX_FUNC_UARTD);
|
||||
|
||||
pinmux_set_io(PINGRP_GMI_A16, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PINGRP_GMI_A17, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PINGRP_GMI_A18, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PINGRP_GMI_A19, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_GMI_A16_PJ7, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_GMI_A17_PB0, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_GMI_A18_PB1, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_GMI_A19_PK7, PMUX_PIN_OUTPUT);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_GMI_A16);
|
||||
pinmux_tristate_disable(PINGRP_GMI_A17);
|
||||
pinmux_tristate_disable(PINGRP_GMI_A18);
|
||||
pinmux_tristate_disable(PINGRP_GMI_A19);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMI_A16_PJ7);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMI_A17_PB0);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMI_A18_PB1);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMI_A19_PK7);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,20 +20,20 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_UART4:
|
||||
switch (config) {
|
||||
case FUNCMUX_UART4_GPIO: /* TXD,RXD,CTS,RTS */
|
||||
pinmux_set_func(PINGRP_GPIO_PJ7, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PINGRP_GPIO_PB0, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PINGRP_GPIO_PB1, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PINGRP_GPIO_PK7, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_PJ7, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_PB0, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_PB1, PMUX_FUNC_UARTD);
|
||||
pinmux_set_func(PMUX_PINGRP_PK7, PMUX_FUNC_UARTD);
|
||||
|
||||
pinmux_set_io(PINGRP_GPIO_PJ7, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PINGRP_GPIO_PB0, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PINGRP_GPIO_PB1, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PINGRP_GPIO_PK7, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_PJ7, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_PB0, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_PB1, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_PK7, PMUX_PIN_OUTPUT);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_GPIO_PJ7);
|
||||
pinmux_tristate_disable(PINGRP_GPIO_PB0);
|
||||
pinmux_tristate_disable(PINGRP_GPIO_PB1);
|
||||
pinmux_tristate_disable(PINGRP_GPIO_PK7);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PJ7);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PB0);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PB1);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PK7);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -41,14 +41,16 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_UART1:
|
||||
switch (config) {
|
||||
case FUNCMUX_UART1_KBC:
|
||||
pinmux_set_func(PINGRP_KB_ROW9, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PINGRP_KB_ROW10, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_KB_ROW9_PS1,
|
||||
PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_KB_ROW10_PS2,
|
||||
PMUX_FUNC_UARTA);
|
||||
|
||||
pinmux_set_io(PINGRP_KB_ROW9, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PINGRP_KB_ROW10, PMUX_PIN_INPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_KB_ROW9_PS1, PMUX_PIN_OUTPUT);
|
||||
pinmux_set_io(PMUX_PINGRP_KB_ROW10_PS2, PMUX_PIN_INPUT);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_KB_ROW9);
|
||||
pinmux_tristate_disable(PINGRP_KB_ROW10);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KB_ROW9_PS1);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KB_ROW10_PS2);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,74 +19,6 @@ enum security_op {
|
||||
SECURITY_ENCRYPT = 1 << 1, /* Encrypt the data */
|
||||
};
|
||||
|
||||
static void debug_print_vector(char *name, u32 num_bytes, u8 *data)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
debug("%s [%d] @0x%08x", name, num_bytes, (u32)data);
|
||||
for (i = 0; i < num_bytes; i++) {
|
||||
if (i % 16 == 0)
|
||||
debug(" = ");
|
||||
debug("%02x", data[i]);
|
||||
if ((i+1) % 16 != 0)
|
||||
debug(" ");
|
||||
}
|
||||
debug("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply chain data to the destination using EOR
|
||||
*
|
||||
* Each array is of length AES_AES_KEY_LENGTH.
|
||||
*
|
||||
* \param cbc_chain_data Chain data
|
||||
* \param src Source data
|
||||
* \param dst Destination data, which is modified here
|
||||
*/
|
||||
static void apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
*dst++ = *src++ ^ *cbc_chain_data++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypt some data with AES.
|
||||
*
|
||||
* \param key_schedule Expanded key to use
|
||||
* \param src Source data to encrypt
|
||||
* \param dst Destination buffer
|
||||
* \param num_aes_blocks Number of AES blocks to encrypt
|
||||
*/
|
||||
static void encrypt_object(u8 *key_schedule, u8 *src, u8 *dst,
|
||||
u32 num_aes_blocks)
|
||||
{
|
||||
u8 tmp_data[AES_KEY_LENGTH];
|
||||
u8 *cbc_chain_data;
|
||||
u32 i;
|
||||
|
||||
cbc_chain_data = zero_key; /* Convenient array of 0's for IV */
|
||||
|
||||
for (i = 0; i < num_aes_blocks; i++) {
|
||||
debug("encrypt_object: block %d of %d\n", i, num_aes_blocks);
|
||||
debug_print_vector("AES Src", AES_KEY_LENGTH, src);
|
||||
|
||||
/* Apply the chain data */
|
||||
apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
|
||||
debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data);
|
||||
|
||||
/* encrypt the AES block */
|
||||
aes_encrypt(tmp_data, key_schedule, dst);
|
||||
debug_print_vector("AES Dst", AES_KEY_LENGTH, dst);
|
||||
|
||||
/* Update pointers for next loop. */
|
||||
cbc_chain_data = dst;
|
||||
src += AES_KEY_LENGTH;
|
||||
dst += AES_KEY_LENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shift a vector left by one bit
|
||||
*
|
||||
@@ -129,39 +61,31 @@ static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst,
|
||||
for (i = 0; i < AES_KEY_LENGTH; i++)
|
||||
tmp_data[i] = 0;
|
||||
|
||||
encrypt_object(key_schedule, tmp_data, left, 1);
|
||||
debug_print_vector("AES(key, nonce)", AES_KEY_LENGTH, left);
|
||||
aes_cbc_encrypt_blocks(key_schedule, tmp_data, left, 1);
|
||||
|
||||
left_shift_vector(left, k1, sizeof(left));
|
||||
debug_print_vector("L", AES_KEY_LENGTH, left);
|
||||
|
||||
if ((left[0] >> 7) != 0) /* get MSB of L */
|
||||
k1[AES_KEY_LENGTH-1] ^= AES_CMAC_CONST_RB;
|
||||
debug_print_vector("K1", AES_KEY_LENGTH, k1);
|
||||
|
||||
/* compute the AES-CMAC value */
|
||||
for (i = 0; i < num_aes_blocks; i++) {
|
||||
/* Apply the chain data */
|
||||
apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
|
||||
aes_apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
|
||||
|
||||
/* for the final block, XOR K1 into the IV */
|
||||
if (i == num_aes_blocks - 1)
|
||||
apply_cbc_chain_data(tmp_data, k1, tmp_data);
|
||||
aes_apply_cbc_chain_data(tmp_data, k1, tmp_data);
|
||||
|
||||
/* encrypt the AES block */
|
||||
aes_encrypt(tmp_data, key_schedule, dst);
|
||||
|
||||
debug("sign_obj: block %d of %d\n", i, num_aes_blocks);
|
||||
debug_print_vector("AES-CMAC Src", AES_KEY_LENGTH, src);
|
||||
debug_print_vector("AES-CMAC Xor", AES_KEY_LENGTH, tmp_data);
|
||||
debug_print_vector("AES-CMAC Dst", AES_KEY_LENGTH, dst);
|
||||
|
||||
/* Update pointers for next loop. */
|
||||
cbc_chain_data = dst;
|
||||
src += AES_KEY_LENGTH;
|
||||
}
|
||||
|
||||
debug_print_vector("AES-CMAC Hash", AES_KEY_LENGTH, dst);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +104,6 @@ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src,
|
||||
u8 key_schedule[AES_EXPAND_KEY_LENGTH];
|
||||
|
||||
debug("encrypt_and_sign: length = %d\n", length);
|
||||
debug_print_vector("AES key", AES_KEY_LENGTH, key);
|
||||
|
||||
/*
|
||||
* The only need for a key is for signing/checksum purposes, so
|
||||
@@ -193,7 +116,7 @@ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src,
|
||||
if (oper & SECURITY_ENCRYPT) {
|
||||
/* Perform this in place, resulting in src being encrypted. */
|
||||
debug("encrypt_and_sign: begin encryption\n");
|
||||
encrypt_object(key_schedule, src, src, num_aes_blocks);
|
||||
aes_cbc_encrypt_blocks(key_schedule, src, src, num_aes_blocks);
|
||||
debug("encrypt_and_sign: end encryption\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <fdtdec.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch-tegra/ap.h>
|
||||
#include <asm/arch/apb_misc.h>
|
||||
#include <asm/arch-tegra/apb_misc.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/emc.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* 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}
|
||||
{PMUX_PINGRP_##grp, PMUX_FUNC_##mux, PMUX_PULL_##pupd, PMUX_TRI_##tri}
|
||||
|
||||
static const struct pingroup_config disp1_default[] = {
|
||||
static const struct pmux_pingrp_config disp1_default[] = {
|
||||
PINMUX(LDI, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LHP0, DISPA, NORMAL, NORMAL),
|
||||
PINMUX(LHP1, DISPA, NORMAL, NORMAL),
|
||||
@@ -42,26 +42,26 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_UART1:
|
||||
switch (config) {
|
||||
case FUNCMUX_UART1_IRRX_IRTX:
|
||||
pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PINGRP_IRRX);
|
||||
pinmux_tristate_disable(PINGRP_IRTX);
|
||||
pinmux_set_func(PMUX_PINGRP_IRRX, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_IRTX, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_IRRX);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_IRTX);
|
||||
break;
|
||||
case FUNCMUX_UART1_UAA_UAB:
|
||||
pinmux_set_func(PINGRP_UAA, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PINGRP_UAB, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PINGRP_UAA);
|
||||
pinmux_tristate_disable(PINGRP_UAB);
|
||||
pinmux_set_func(PMUX_PINGRP_UAA, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_UAB, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_UAA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_UAB);
|
||||
bad_config = 0;
|
||||
break;
|
||||
case FUNCMUX_UART1_GPU:
|
||||
pinmux_set_func(PINGRP_GPU, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PINGRP_GPU);
|
||||
pinmux_set_func(PMUX_PINGRP_GPU, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GPU);
|
||||
bad_config = 0;
|
||||
break;
|
||||
case FUNCMUX_UART1_SDIO1:
|
||||
pinmux_set_func(PINGRP_SDIO1, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PINGRP_SDIO1);
|
||||
pinmux_set_func(PMUX_PINGRP_SDIO1, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SDIO1);
|
||||
bad_config = 0;
|
||||
break;
|
||||
}
|
||||
@@ -77,53 +77,53 @@ int funcmux_select(enum periph_id id, int config)
|
||||
* state the group to avoid driving any signal onto it
|
||||
* until we know what's connected.
|
||||
*/
|
||||
pinmux_tristate_enable(PINGRP_SDB);
|
||||
pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
|
||||
pinmux_tristate_enable(PMUX_PINGRP_SDB);
|
||||
pinmux_set_func(PMUX_PINGRP_SDB, PMUX_FUNC_SDIO3);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_UART2:
|
||||
if (config == FUNCMUX_UART2_UAD) {
|
||||
pinmux_set_func(PINGRP_UAD, PMUX_FUNC_UARTB);
|
||||
pinmux_tristate_disable(PINGRP_UAD);
|
||||
pinmux_set_func(PMUX_PINGRP_UAD, PMUX_FUNC_UARTB);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_UAD);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_UART4:
|
||||
if (config == FUNCMUX_UART4_GMC) {
|
||||
pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
|
||||
pinmux_tristate_disable(PINGRP_GMC);
|
||||
pinmux_set_func(PMUX_PINGRP_GMC, PMUX_FUNC_UARTD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMC);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_DVC_I2C:
|
||||
/* there is only one selection, pinmux_config is ignored */
|
||||
if (config == FUNCMUX_DVC_I2CP) {
|
||||
pinmux_set_func(PINGRP_I2CP, PMUX_FUNC_I2C);
|
||||
pinmux_tristate_disable(PINGRP_I2CP);
|
||||
pinmux_set_func(PMUX_PINGRP_I2CP, PMUX_FUNC_I2C);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_I2CP);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_I2C1:
|
||||
/* support pinmux_config of 0 for now, */
|
||||
if (config == FUNCMUX_I2C1_RM) {
|
||||
pinmux_set_func(PINGRP_RM, PMUX_FUNC_I2C);
|
||||
pinmux_tristate_disable(PINGRP_RM);
|
||||
pinmux_set_func(PMUX_PINGRP_RM, PMUX_FUNC_I2C);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_RM);
|
||||
}
|
||||
break;
|
||||
case PERIPH_ID_I2C2: /* I2C2 */
|
||||
switch (config) {
|
||||
case FUNCMUX_I2C2_DDC: /* DDC pin group, select I2C2 */
|
||||
pinmux_set_func(PINGRP_DDC, PMUX_FUNC_I2C2);
|
||||
pinmux_set_func(PMUX_PINGRP_DDC, PMUX_FUNC_I2C2);
|
||||
/* PTA to HDMI */
|
||||
pinmux_set_func(PINGRP_PTA, PMUX_FUNC_HDMI);
|
||||
pinmux_tristate_disable(PINGRP_DDC);
|
||||
pinmux_set_func(PMUX_PINGRP_PTA, PMUX_FUNC_HDMI);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_DDC);
|
||||
break;
|
||||
case FUNCMUX_I2C2_PTA: /* PTA pin group, select I2C2 */
|
||||
pinmux_set_func(PINGRP_PTA, PMUX_FUNC_I2C2);
|
||||
pinmux_set_func(PMUX_PINGRP_PTA, PMUX_FUNC_I2C2);
|
||||
/* set DDC_SEL to RSVDx (RSVD2 works for now) */
|
||||
pinmux_set_func(PINGRP_DDC, PMUX_FUNC_RSVD2);
|
||||
pinmux_tristate_disable(PINGRP_PTA);
|
||||
pinmux_set_func(PMUX_PINGRP_DDC, PMUX_FUNC_RSVD2);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_PTA);
|
||||
bad_config = 0;
|
||||
break;
|
||||
}
|
||||
@@ -131,50 +131,50 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_I2C3: /* I2C3 */
|
||||
/* support pinmux_config of 0 for now */
|
||||
if (config == FUNCMUX_I2C3_DTF) {
|
||||
pinmux_set_func(PINGRP_DTF, PMUX_FUNC_I2C3);
|
||||
pinmux_tristate_disable(PINGRP_DTF);
|
||||
pinmux_set_func(PMUX_PINGRP_DTF, PMUX_FUNC_I2C3);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_DTF);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_SDMMC1:
|
||||
if (config == FUNCMUX_SDMMC1_SDIO1_4BIT) {
|
||||
pinmux_set_func(PINGRP_SDIO1, PMUX_FUNC_SDIO1);
|
||||
pinmux_tristate_disable(PINGRP_SDIO1);
|
||||
pinmux_set_func(PMUX_PINGRP_SDIO1, PMUX_FUNC_SDIO1);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SDIO1);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_SDMMC2:
|
||||
if (config == FUNCMUX_SDMMC2_DTA_DTD_8BIT) {
|
||||
pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
|
||||
pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
|
||||
pinmux_set_func(PMUX_PINGRP_DTA, PMUX_FUNC_SDIO2);
|
||||
pinmux_set_func(PMUX_PINGRP_DTD, PMUX_FUNC_SDIO2);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_DTA);
|
||||
pinmux_tristate_disable(PINGRP_DTD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_DTA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_DTD);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_SDMMC3:
|
||||
switch (config) {
|
||||
case FUNCMUX_SDMMC3_SDB_SLXA_8BIT:
|
||||
pinmux_set_func(PINGRP_SLXA, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PINGRP_SLXC, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PINGRP_SLXD, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PINGRP_SLXK, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SLXA, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SLXC, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SLXD, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SLXK, PMUX_FUNC_SDIO3);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_SLXA);
|
||||
pinmux_tristate_disable(PINGRP_SLXC);
|
||||
pinmux_tristate_disable(PINGRP_SLXD);
|
||||
pinmux_tristate_disable(PINGRP_SLXK);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SLXA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SLXC);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SLXD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SLXK);
|
||||
/* fall through */
|
||||
|
||||
case FUNCMUX_SDMMC3_SDB_4BIT:
|
||||
pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SDB, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_SDIO3);
|
||||
pinmux_set_func(PMUX_PINGRP_SDD, PMUX_FUNC_SDIO3);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_SDB);
|
||||
pinmux_tristate_disable(PINGRP_SDC);
|
||||
pinmux_tristate_disable(PINGRP_SDD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SDB);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SDC);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_SDD);
|
||||
bad_config = 0;
|
||||
break;
|
||||
}
|
||||
@@ -183,24 +183,24 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_SDMMC4:
|
||||
switch (config) {
|
||||
case FUNCMUX_SDMMC4_ATC_ATD_8BIT:
|
||||
pinmux_set_func(PINGRP_ATC, PMUX_FUNC_SDIO4);
|
||||
pinmux_set_func(PINGRP_ATD, PMUX_FUNC_SDIO4);
|
||||
pinmux_set_func(PMUX_PINGRP_ATC, PMUX_FUNC_SDIO4);
|
||||
pinmux_set_func(PMUX_PINGRP_ATD, PMUX_FUNC_SDIO4);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_ATC);
|
||||
pinmux_tristate_disable(PINGRP_ATD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ATC);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ATD);
|
||||
break;
|
||||
|
||||
case FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT:
|
||||
pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
|
||||
pinmux_tristate_disable(PINGRP_GME);
|
||||
pinmux_set_func(PMUX_PINGRP_GME, PMUX_FUNC_SDIO4);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GME);
|
||||
/* fall through */
|
||||
|
||||
case FUNCMUX_SDMMC4_ATB_GMA_4_BIT:
|
||||
pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
|
||||
pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
|
||||
pinmux_set_func(PMUX_PINGRP_ATB, PMUX_FUNC_SDIO4);
|
||||
pinmux_set_func(PMUX_PINGRP_GMA, PMUX_FUNC_SDIO4);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_ATB);
|
||||
pinmux_tristate_disable(PINGRP_GMA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ATB);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMA);
|
||||
bad_config = 0;
|
||||
break;
|
||||
}
|
||||
@@ -208,9 +208,10 @@ int funcmux_select(enum periph_id id, int config)
|
||||
|
||||
case PERIPH_ID_KBC:
|
||||
if (config == FUNCMUX_DEFAULT) {
|
||||
enum pmux_pingrp grp[] = {PINGRP_KBCA, PINGRP_KBCB,
|
||||
PINGRP_KBCC, PINGRP_KBCD, PINGRP_KBCE,
|
||||
PINGRP_KBCF};
|
||||
enum pmux_pingrp grp[] = {PMUX_PINGRP_KBCA,
|
||||
PMUX_PINGRP_KBCB, PMUX_PINGRP_KBCC,
|
||||
PMUX_PINGRP_KBCD, PMUX_PINGRP_KBCE,
|
||||
PMUX_PINGRP_KBCF};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(grp); i++) {
|
||||
@@ -223,44 +224,44 @@ int funcmux_select(enum periph_id id, int config)
|
||||
|
||||
case PERIPH_ID_USB2:
|
||||
if (config == FUNCMUX_USB2_ULPI) {
|
||||
pinmux_set_func(PINGRP_UAA, PMUX_FUNC_ULPI);
|
||||
pinmux_set_func(PINGRP_UAB, PMUX_FUNC_ULPI);
|
||||
pinmux_set_func(PINGRP_UDA, PMUX_FUNC_ULPI);
|
||||
pinmux_set_func(PMUX_PINGRP_UAA, PMUX_FUNC_ULPI);
|
||||
pinmux_set_func(PMUX_PINGRP_UAB, PMUX_FUNC_ULPI);
|
||||
pinmux_set_func(PMUX_PINGRP_UDA, PMUX_FUNC_ULPI);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_UAA);
|
||||
pinmux_tristate_disable(PINGRP_UAB);
|
||||
pinmux_tristate_disable(PINGRP_UDA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_UAA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_UAB);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_UDA);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_SPI1:
|
||||
if (config == FUNCMUX_SPI1_GMC_GMD) {
|
||||
pinmux_set_func(PINGRP_GMC, PMUX_FUNC_SFLASH);
|
||||
pinmux_set_func(PINGRP_GMD, PMUX_FUNC_SFLASH);
|
||||
pinmux_set_func(PMUX_PINGRP_GMC, PMUX_FUNC_SFLASH);
|
||||
pinmux_set_func(PMUX_PINGRP_GMD, PMUX_FUNC_SFLASH);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_GMC);
|
||||
pinmux_tristate_disable(PINGRP_GMD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMC);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_GMD);
|
||||
}
|
||||
break;
|
||||
|
||||
case PERIPH_ID_NDFLASH:
|
||||
switch (config) {
|
||||
case FUNCMUX_NDFLASH_ATC:
|
||||
pinmux_set_func(PINGRP_ATC, PMUX_FUNC_NAND);
|
||||
pinmux_tristate_disable(PINGRP_ATC);
|
||||
pinmux_set_func(PMUX_PINGRP_ATC, PMUX_FUNC_NAND);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ATC);
|
||||
break;
|
||||
case FUNCMUX_NDFLASH_KBC_8_BIT:
|
||||
pinmux_set_func(PINGRP_KBCA, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PINGRP_KBCC, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PINGRP_KBCD, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PINGRP_KBCE, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PINGRP_KBCF, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PMUX_PINGRP_KBCA, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PMUX_PINGRP_KBCC, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PMUX_PINGRP_KBCD, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PMUX_PINGRP_KBCE, PMUX_FUNC_NAND);
|
||||
pinmux_set_func(PMUX_PINGRP_KBCF, PMUX_FUNC_NAND);
|
||||
|
||||
pinmux_tristate_disable(PINGRP_KBCA);
|
||||
pinmux_tristate_disable(PINGRP_KBCC);
|
||||
pinmux_tristate_disable(PINGRP_KBCD);
|
||||
pinmux_tristate_disable(PINGRP_KBCE);
|
||||
pinmux_tristate_disable(PINGRP_KBCF);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KBCA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KBCC);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KBCD);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KBCE);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_KBCF);
|
||||
|
||||
bad_config = 0;
|
||||
break;
|
||||
@@ -270,13 +271,13 @@ int funcmux_select(enum periph_id id, int config)
|
||||
if (config == FUNCMUX_DEFAULT) {
|
||||
int i;
|
||||
|
||||
for (i = PINGRP_LD0; i <= PINGRP_LD17; i++) {
|
||||
for (i = PMUX_PINGRP_LD0; i <= PMUX_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));
|
||||
pinmux_config_pingrp_table(disp1_default,
|
||||
ARRAY_SIZE(disp1_default));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
|
||||
|
||||
/*
|
||||
* This defines the order of the pin mux control bits in the registers. For
|
||||
* some reason there is no correspendence between the tristate, pin mux and
|
||||
@@ -256,302 +254,172 @@ enum pmux_pullid {
|
||||
PUCTL_NONE = -1
|
||||
};
|
||||
|
||||
struct tegra_pingroup_desc {
|
||||
const char *name;
|
||||
enum pmux_func funcs[4];
|
||||
enum pmux_func func_safe;
|
||||
enum pmux_vddio vddio;
|
||||
enum pmux_ctlid ctl_id;
|
||||
enum pmux_pullid pull_id;
|
||||
};
|
||||
|
||||
|
||||
/* Converts a pmux_pingrp number to a tristate register: 0=A, 1=B, 2=C, 3=D */
|
||||
#define TRISTATE_REG(pmux_pingrp) ((pmux_pingrp) >> 5)
|
||||
|
||||
/* Mask value for a tristate (within TRISTATE_REG(id)) */
|
||||
#define TRISTATE_MASK(pmux_pingrp) (1 << ((pmux_pingrp) & 0x1f))
|
||||
|
||||
/* Converts a PUCTL id to a pull register: 0=A, 1=B...4=E */
|
||||
#define PULL_REG(pmux_pullid) ((pmux_pullid) >> 4)
|
||||
|
||||
/* Converts a PUCTL id to a shift position */
|
||||
#define PULL_SHIFT(pmux_pullid) ((pmux_pullid << 1) & 0x1f)
|
||||
|
||||
/* Converts a MUXCTL id to a ctl register: 0=A, 1=B...6=G */
|
||||
#define MUXCTL_REG(pmux_ctlid) ((pmux_ctlid) >> 4)
|
||||
|
||||
/* Converts a MUXCTL id to a shift position */
|
||||
#define MUXCTL_SHIFT(pmux_ctlid) ((pmux_ctlid << 1) & 0x1f)
|
||||
|
||||
/* Convenient macro for defining pin group properties */
|
||||
#define PINALL(pg_name, vdd, f0, f1, f2, f3, f_safe, mux, pupd) \
|
||||
#define PINALL(pingrp, f0, f1, f2, f3, mux, pupd) \
|
||||
{ \
|
||||
.vddio = PMUX_VDDIO_ ## vdd, \
|
||||
.funcs = { \
|
||||
PMUX_FUNC_ ## f0, \
|
||||
PMUX_FUNC_ ## f1, \
|
||||
PMUX_FUNC_ ## f2, \
|
||||
PMUX_FUNC_ ## f3, \
|
||||
PMUX_FUNC_ ## f0, \
|
||||
PMUX_FUNC_ ## f1, \
|
||||
PMUX_FUNC_ ## f2, \
|
||||
PMUX_FUNC_ ## f3, \
|
||||
}, \
|
||||
.func_safe = PMUX_FUNC_ ## f_safe, \
|
||||
.ctl_id = mux, \
|
||||
.pull_id = pupd \
|
||||
}
|
||||
|
||||
/* A normal pin group where the mux name and pull-up name match */
|
||||
#define PIN(pg_name, vdd, f0, f1, f2, f3, f_safe) \
|
||||
PINALL(pg_name, vdd, f0, f1, f2, f3, f_safe, \
|
||||
MUXCTL_ ## pg_name, PUCTL_ ## pg_name)
|
||||
#define PIN(pingrp, f0, f1, f2, f3) \
|
||||
PINALL(pingrp, f0, f1, f2, f3, MUXCTL_##pingrp, PUCTL_##pingrp)
|
||||
|
||||
/* A pin group where the pull-up name doesn't have a 1-1 mapping */
|
||||
#define PINP(pg_name, vdd, f0, f1, f2, f3, f_safe, pupd) \
|
||||
PINALL(pg_name, vdd, f0, f1, f2, f3, f_safe, \
|
||||
MUXCTL_ ## pg_name, PUCTL_ ## pupd)
|
||||
#define PINP(pingrp, f0, f1, f2, f3, pupd) \
|
||||
PINALL(pingrp, f0, f1, f2, f3, MUXCTL_##pingrp, PUCTL_##pupd)
|
||||
|
||||
/* A pin group number which is not used */
|
||||
#define PIN_RESERVED \
|
||||
PIN(NONE, NONE, NONE, NONE, NONE, NONE, NONE)
|
||||
PIN(NONE, RSVD1, RSVD2, RSVD3, RSVD4)
|
||||
|
||||
const struct tegra_pingroup_desc tegra_soc_pingroups[PINGRP_COUNT] = {
|
||||
PIN(ATA, NAND, IDE, NAND, GMI, RSVD, IDE),
|
||||
PIN(ATB, NAND, IDE, NAND, GMI, SDIO4, IDE),
|
||||
PIN(ATC, NAND, IDE, NAND, GMI, SDIO4, IDE),
|
||||
PIN(ATD, NAND, IDE, NAND, GMI, SDIO4, IDE),
|
||||
PIN(CDEV1, AUDIO, OSC, PLLA_OUT, PLLM_OUT1, AUDIO_SYNC, OSC),
|
||||
PIN(CDEV2, AUDIO, OSC, AHB_CLK, APB_CLK, PLLP_OUT4, OSC),
|
||||
PIN(CSUS, VI, PLLC_OUT1, PLLP_OUT2, PLLP_OUT3, VI_SENSOR_CLK,
|
||||
PLLC_OUT1),
|
||||
PIN(DAP1, AUDIO, DAP1, RSVD, GMI, SDIO2, DAP1),
|
||||
#define DRVGRP(drvgrp) \
|
||||
PINALL(drvgrp, RSVD1, RSVD2, RSVD3, RSVD4, MUXCTL_NONE, PUCTL_NONE)
|
||||
|
||||
PIN(DAP2, AUDIO, DAP2, TWC, RSVD, GMI, DAP2),
|
||||
PIN(DAP3, BB, DAP3, RSVD, RSVD, RSVD, DAP3),
|
||||
PIN(DAP4, UART, DAP4, RSVD, GMI, RSVD, DAP4),
|
||||
PIN(DTA, VI, RSVD, SDIO2, VI, RSVD, RSVD4),
|
||||
PIN(DTB, VI, RSVD, RSVD, VI, SPI1, RSVD1),
|
||||
PIN(DTC, VI, RSVD, RSVD, VI, RSVD, RSVD1),
|
||||
PIN(DTD, VI, RSVD, SDIO2, VI, RSVD, RSVD1),
|
||||
PIN(DTE, VI, RSVD, RSVD, VI, SPI1, RSVD1),
|
||||
static const struct pmux_pingrp_desc tegra20_pingroups[] = {
|
||||
PIN(ATA, IDE, NAND, GMI, RSVD4),
|
||||
PIN(ATB, IDE, NAND, GMI, SDIO4),
|
||||
PIN(ATC, IDE, NAND, GMI, SDIO4),
|
||||
PIN(ATD, IDE, NAND, GMI, SDIO4),
|
||||
PIN(CDEV1, OSC, PLLA_OUT, PLLM_OUT1, AUDIO_SYNC),
|
||||
PIN(CDEV2, OSC, AHB_CLK, APB_CLK, PLLP_OUT4),
|
||||
PIN(CSUS, PLLC_OUT1, PLLP_OUT2, PLLP_OUT3, VI_SENSOR_CLK),
|
||||
PIN(DAP1, DAP1, RSVD2, GMI, SDIO2),
|
||||
|
||||
PINP(GPU, UART, PWM, UARTA, GMI, RSVD, RSVD4,
|
||||
GPSLXAU),
|
||||
PIN(GPV, SD, PCIE, RSVD, RSVD, RSVD, PCIE),
|
||||
PIN(I2CP, SYS, I2C, RSVD, RSVD, RSVD, RSVD4),
|
||||
PIN(IRTX, UART, UARTA, UARTB, GMI, SPI4, UARTB),
|
||||
PIN(IRRX, UART, UARTA, UARTB, GMI, SPI4, UARTB),
|
||||
PIN(KBCB, SYS, KBC, NAND, SDIO2, MIO, KBC),
|
||||
PIN(KBCA, SYS, KBC, NAND, SDIO2, EMC_TEST0_DLL, KBC),
|
||||
PINP(PMC, SYS, PWR_ON, PWR_INTR, RSVD, RSVD, PWR_ON, NONE),
|
||||
PIN(DAP2, DAP2, TWC, RSVD3, GMI),
|
||||
PIN(DAP3, DAP3, RSVD2, RSVD3, RSVD4),
|
||||
PIN(DAP4, DAP4, RSVD2, GMI, RSVD4),
|
||||
PIN(DTA, RSVD1, SDIO2, VI, RSVD4),
|
||||
PIN(DTB, RSVD1, RSVD2, VI, SPI1),
|
||||
PIN(DTC, RSVD1, RSVD2, VI, RSVD4),
|
||||
PIN(DTD, RSVD1, SDIO2, VI, RSVD4),
|
||||
PIN(DTE, RSVD1, RSVD2, VI, SPI1),
|
||||
|
||||
PIN(PTA, NAND, I2C2, HDMI, GMI, RSVD, RSVD4),
|
||||
PIN(RM, UART, I2C, RSVD, RSVD, RSVD, RSVD4),
|
||||
PIN(KBCE, SYS, KBC, NAND, OWR, RSVD, KBC),
|
||||
PIN(KBCF, SYS, KBC, NAND, TRACE, MIO, KBC),
|
||||
PIN(GMA, NAND, UARTE, SPI3, GMI, SDIO4, SPI3),
|
||||
PIN(GMC, NAND, UARTD, SPI4, GMI, SFLASH, SPI4),
|
||||
PIN(SDMMC1, BB, SDIO1, RSVD, UARTE, UARTA, RSVD2),
|
||||
PIN(OWC, SYS, OWR, RSVD, RSVD, RSVD, OWR),
|
||||
PINP(GPU, PWM, UARTA, GMI, RSVD4, GPSLXAU),
|
||||
PIN(GPV, PCIE, RSVD2, RSVD3, RSVD4),
|
||||
PIN(I2CP, I2C, RSVD2, RSVD3, RSVD4),
|
||||
PIN(IRTX, UARTA, UARTB, GMI, SPI4),
|
||||
PIN(IRRX, UARTA, UARTB, GMI, SPI4),
|
||||
PIN(KBCB, KBC, NAND, SDIO2, MIO),
|
||||
PIN(KBCA, KBC, NAND, SDIO2, EMC_TEST0_DLL),
|
||||
PINP(PMC, PWR_ON, PWR_INTR, RSVD3, RSVD4, NONE),
|
||||
|
||||
PIN(GME, NAND, RSVD, DAP5, GMI, SDIO4, GMI),
|
||||
PIN(SDC, SD, PWM, TWC, SDIO3, SPI3, TWC),
|
||||
PIN(SDD, SD, UARTA, PWM, SDIO3, SPI3, PWM),
|
||||
PIN(PTA, I2C2, HDMI, GMI, RSVD4),
|
||||
PIN(RM, I2C, RSVD2, RSVD3, RSVD4),
|
||||
PIN(KBCE, KBC, NAND, OWR, RSVD4),
|
||||
PIN(KBCF, KBC, NAND, TRACE, MIO),
|
||||
PIN(GMA, UARTE, SPI3, GMI, SDIO4),
|
||||
PIN(GMC, UARTD, SPI4, GMI, SFLASH),
|
||||
PIN(SDMMC1, SDIO1, RSVD2, UARTE, UARTA),
|
||||
PIN(OWC, OWR, RSVD2, RSVD3, RSVD4),
|
||||
|
||||
PIN(GME, RSVD1, DAP5, GMI, SDIO4),
|
||||
PIN(SDC, PWM, TWC, SDIO3, SPI3),
|
||||
PIN(SDD, UARTA, PWM, SDIO3, SPI3),
|
||||
PIN_RESERVED,
|
||||
PINP(SLXA, SD, PCIE, SPI4, SDIO3, SPI2, PCIE, CRTP),
|
||||
PIN(SLXC, SD, SPDIF, SPI4, SDIO3, SPI2, SPI4),
|
||||
PIN(SLXD, SD, SPDIF, SPI4, SDIO3, SPI2, SPI4),
|
||||
PIN(SLXK, SD, PCIE, SPI4, SDIO3, SPI2, PCIE),
|
||||
PINP(SLXA, PCIE, SPI4, SDIO3, SPI2, CRTP),
|
||||
PIN(SLXC, SPDIF, SPI4, SDIO3, SPI2),
|
||||
PIN(SLXD, SPDIF, SPI4, SDIO3, SPI2),
|
||||
PIN(SLXK, PCIE, SPI4, SDIO3, SPI2),
|
||||
|
||||
PIN(SPDI, AUDIO, SPDIF, RSVD, I2C, SDIO2, RSVD2),
|
||||
PIN(SPDO, AUDIO, SPDIF, RSVD, I2C, SDIO2, RSVD2),
|
||||
PIN(SPIA, AUDIO, SPI1, SPI2, SPI3, GMI, GMI),
|
||||
PIN(SPIB, AUDIO, SPI1, SPI2, SPI3, GMI, GMI),
|
||||
PIN(SPIC, AUDIO, SPI1, SPI2, SPI3, GMI, GMI),
|
||||
PIN(SPID, AUDIO, SPI2, SPI1, SPI2_ALT, GMI, GMI),
|
||||
PIN(SPIE, AUDIO, SPI2, SPI1, SPI2_ALT, GMI, GMI),
|
||||
PIN(SPIF, AUDIO, SPI3, SPI1, SPI2, RSVD, RSVD4),
|
||||
PIN(SPDI, SPDIF, RSVD2, I2C, SDIO2),
|
||||
PIN(SPDO, SPDIF, RSVD2, I2C, SDIO2),
|
||||
PIN(SPIA, SPI1, SPI2, SPI3, GMI),
|
||||
PIN(SPIB, SPI1, SPI2, SPI3, GMI),
|
||||
PIN(SPIC, SPI1, SPI2, SPI3, GMI),
|
||||
PIN(SPID, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PIN(SPIE, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PIN(SPIF, SPI3, SPI1, SPI2, RSVD4),
|
||||
|
||||
PIN(SPIG, AUDIO, SPI3, SPI2, SPI2_ALT, I2C, SPI2_ALT),
|
||||
PIN(SPIH, AUDIO, SPI3, SPI2, SPI2_ALT, I2C, SPI2_ALT),
|
||||
PIN(UAA, BB, SPI3, MIPI_HS, UARTA, ULPI, MIPI_HS),
|
||||
PIN(UAB, BB, SPI2, MIPI_HS, UARTA, ULPI, MIPI_HS),
|
||||
PIN(UAC, BB, OWR, RSVD, RSVD, RSVD, RSVD4),
|
||||
PIN(UAD, UART, UARTB, SPDIF, UARTA, SPI4, SPDIF),
|
||||
PIN(UCA, UART, UARTC, RSVD, GMI, RSVD, RSVD4),
|
||||
PIN(UCB, UART, UARTC, PWM, GMI, RSVD, RSVD4),
|
||||
PIN(SPIG, SPI3, SPI2, SPI2_ALT, I2C),
|
||||
PIN(SPIH, SPI3, SPI2, SPI2_ALT, I2C),
|
||||
PIN(UAA, SPI3, MIPI_HS, UARTA, ULPI),
|
||||
PIN(UAB, SPI2, MIPI_HS, UARTA, ULPI),
|
||||
PIN(UAC, OWR, RSVD2, RSVD3, RSVD4),
|
||||
PIN(UAD, UARTB, SPDIF, UARTA, SPI4),
|
||||
PIN(UCA, UARTC, RSVD2, GMI, RSVD4),
|
||||
PIN(UCB, UARTC, PWM, GMI, RSVD4),
|
||||
|
||||
PIN_RESERVED,
|
||||
PIN(ATE, NAND, IDE, NAND, GMI, RSVD, IDE),
|
||||
PIN(KBCC, SYS, KBC, NAND, TRACE, EMC_TEST1_DLL, KBC),
|
||||
PIN(ATE, IDE, NAND, GMI, RSVD4),
|
||||
PIN(KBCC, KBC, NAND, TRACE, EMC_TEST1_DLL),
|
||||
PIN_RESERVED,
|
||||
PIN_RESERVED,
|
||||
PIN(GMB, NAND, IDE, NAND, GMI, GMI_INT, GMI),
|
||||
PIN(GMD, NAND, RSVD, NAND, GMI, SFLASH, GMI),
|
||||
PIN(DDC, LCD, I2C2, RSVD, RSVD, RSVD, RSVD4),
|
||||
PIN(GMB, IDE, NAND, GMI, GMI_INT),
|
||||
PIN(GMD, RSVD1, NAND, GMI, SFLASH),
|
||||
PIN(DDC, I2C2, RSVD2, RSVD3, RSVD4),
|
||||
|
||||
/* 64 */
|
||||
PINP(LD0, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD1, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD2, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD3, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD4, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD5, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD6, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD7, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD0, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD1, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD2, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD3, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD4, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD5, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD6, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD7, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
|
||||
PINP(LD8, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD9, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD10, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD11, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD12, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD13, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD14, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD15, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD8, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD9, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD10, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD11, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD12, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD13, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD14, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD15, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
|
||||
PINP(LD16, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LD17),
|
||||
PINP(LD17, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD17),
|
||||
PINP(LHP0, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD21_20),
|
||||
PINP(LHP1, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD19_18),
|
||||
PINP(LHP2, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD19_18),
|
||||
PINP(LVP0, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LC),
|
||||
PINP(LVP1, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD21_20),
|
||||
PINP(HDINT, LCD, HDMI, RSVD, RSVD, RSVD, HDMI , LC),
|
||||
PINP(LD16, DISPA, DISPB, XIO, RSVD4, LD17),
|
||||
PINP(LD17, DISPA, DISPB, RSVD3, RSVD4, LD17),
|
||||
PINP(LHP0, DISPA, DISPB, RSVD3, RSVD4, LD21_20),
|
||||
PINP(LHP1, DISPA, DISPB, RSVD3, RSVD4, LD19_18),
|
||||
PINP(LHP2, DISPA, DISPB, RSVD3, RSVD4, LD19_18),
|
||||
PINP(LVP0, DISPA, DISPB, RSVD3, RSVD4, LC),
|
||||
PINP(LVP1, DISPA, DISPB, RSVD3, RSVD4, LD21_20),
|
||||
PINP(HDINT, HDMI, RSVD2, RSVD3, RSVD4, LC),
|
||||
|
||||
PINP(LM0, LCD, DISPA, DISPB, SPI3, RSVD, RSVD4, LC),
|
||||
PINP(LM1, LCD, DISPA, DISPB, RSVD, CRT, RSVD3, LC),
|
||||
PINP(LVS, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LC),
|
||||
PINP(LSC0, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LC),
|
||||
PINP(LSC1, LCD, DISPA, DISPB, SPI3, HDMI, DISPA, LS),
|
||||
PINP(LSCK, LCD, DISPA, DISPB, SPI3, HDMI, DISPA, LS),
|
||||
PINP(LDC, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LS),
|
||||
PINP(LCSN, LCD, DISPA, DISPB, SPI3, RSVD, RSVD4, LS),
|
||||
PINP(LM0, DISPA, DISPB, SPI3, RSVD4, LC),
|
||||
PINP(LM1, DISPA, DISPB, RSVD3, CRT, LC),
|
||||
PINP(LVS, DISPA, DISPB, XIO, RSVD4, LC),
|
||||
PINP(LSC0, DISPA, DISPB, XIO, RSVD4, LC),
|
||||
PINP(LSC1, DISPA, DISPB, SPI3, HDMI, LS),
|
||||
PINP(LSCK, DISPA, DISPB, SPI3, HDMI, LS),
|
||||
PINP(LDC, DISPA, DISPB, RSVD3, RSVD4, LS),
|
||||
PINP(LCSN, DISPA, DISPB, SPI3, RSVD4, LS),
|
||||
|
||||
/* 96 */
|
||||
PINP(LSPI, LCD, DISPA, DISPB, XIO, HDMI, DISPA, LC),
|
||||
PINP(LSDA, LCD, DISPA, DISPB, SPI3, HDMI, DISPA, LS),
|
||||
PINP(LSDI, LCD, DISPA, DISPB, SPI3, RSVD, DISPA, LS),
|
||||
PINP(LPW0, LCD, DISPA, DISPB, SPI3, HDMI, DISPA, LS),
|
||||
PINP(LPW1, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LS),
|
||||
PINP(LPW2, LCD, DISPA, DISPB, SPI3, HDMI, DISPA, LS),
|
||||
PINP(LDI, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD23_22),
|
||||
PINP(LHS, LCD, DISPA, DISPB, XIO, RSVD, RSVD4, LC),
|
||||
PINP(LSPI, DISPA, DISPB, XIO, HDMI, LC),
|
||||
PINP(LSDA, DISPA, DISPB, SPI3, HDMI, LS),
|
||||
PINP(LSDI, DISPA, DISPB, SPI3, RSVD4, LS),
|
||||
PINP(LPW0, DISPA, DISPB, SPI3, HDMI, LS),
|
||||
PINP(LPW1, DISPA, DISPB, RSVD3, RSVD4, LS),
|
||||
PINP(LPW2, DISPA, DISPB, SPI3, HDMI, LS),
|
||||
PINP(LDI, DISPA, DISPB, RSVD3, RSVD4, LD23_22),
|
||||
PINP(LHS, DISPA, DISPB, XIO, RSVD4, LC),
|
||||
|
||||
PINP(LPP, LCD, DISPA, DISPB, RSVD, RSVD, RSVD4, LD23_22),
|
||||
PINP(LPP, DISPA, DISPB, RSVD3, RSVD4, LD23_22),
|
||||
PIN_RESERVED,
|
||||
PIN(KBCD, SYS, KBC, NAND, SDIO2, MIO, KBC),
|
||||
PIN(GPU7, SYS, RTCK, RSVD, RSVD, RSVD, RTCK),
|
||||
PIN(DTF, VI, I2C3, RSVD, VI, RSVD, RSVD4),
|
||||
PIN(UDA, BB, SPI1, RSVD, UARTD, ULPI, RSVD2),
|
||||
PIN(CRTP, LCD, CRT, RSVD, RSVD, RSVD, RSVD),
|
||||
PINP(SDB, SD, UARTA, PWM, SDIO3, SPI2, PWM, NONE),
|
||||
PIN(KBCD, KBC, NAND, SDIO2, MIO),
|
||||
PIN(GPU7, RTCK, RSVD2, RSVD3, RSVD4),
|
||||
PIN(DTF, I2C3, RSVD2, VI, RSVD4),
|
||||
PIN(UDA, SPI1, RSVD2, UARTD, ULPI),
|
||||
PIN(CRTP, CRT, RSVD2, RSVD3, RSVD4),
|
||||
PINP(SDB, UARTA, PWM, SDIO3, SPI2, NONE),
|
||||
|
||||
/* these pin groups only have pullup and pull down control */
|
||||
PINALL(CK32, SYS, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(DDRC, DDR, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(PMCA, SYS, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(PMCB, SYS, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(PMCC, SYS, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(PMCD, SYS, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(PMCE, SYS, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(XM2C, DDR, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
PINALL(XM2D, DDR, RSVD, RSVD, RSVD, RSVD, RSVD, MUXCTL_NONE,
|
||||
PUCTL_NONE),
|
||||
DRVGRP(CK32),
|
||||
DRVGRP(DDRC),
|
||||
DRVGRP(PMCA),
|
||||
DRVGRP(PMCB),
|
||||
DRVGRP(PMCC),
|
||||
DRVGRP(PMCD),
|
||||
DRVGRP(PMCE),
|
||||
DRVGRP(XM2C),
|
||||
DRVGRP(XM2D),
|
||||
};
|
||||
|
||||
void pinmux_set_tristate(enum pmux_pingrp pin, int enable)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *tri = &pmt->pmt_tri[TRISTATE_REG(pin)];
|
||||
u32 reg;
|
||||
|
||||
reg = readl(tri);
|
||||
if (enable)
|
||||
reg |= TRISTATE_MASK(pin);
|
||||
else
|
||||
reg &= ~TRISTATE_MASK(pin);
|
||||
writel(reg, tri);
|
||||
}
|
||||
|
||||
void pinmux_tristate_enable(enum pmux_pingrp pin)
|
||||
{
|
||||
pinmux_set_tristate(pin, 1);
|
||||
}
|
||||
|
||||
void pinmux_tristate_disable(enum pmux_pingrp pin)
|
||||
{
|
||||
pinmux_set_tristate(pin, 0);
|
||||
}
|
||||
|
||||
void pinmux_set_pullupdown(enum pmux_pingrp pin, enum pmux_pull pupd)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
enum pmux_pullid pull_id = tegra_soc_pingroups[pin].pull_id;
|
||||
u32 *pull = &pmt->pmt_pull[PULL_REG(pull_id)];
|
||||
u32 mask_bit;
|
||||
u32 reg;
|
||||
mask_bit = PULL_SHIFT(pull_id);
|
||||
|
||||
reg = readl(pull);
|
||||
reg &= ~(0x3 << mask_bit);
|
||||
reg |= pupd << mask_bit;
|
||||
writel(reg, pull);
|
||||
}
|
||||
|
||||
void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
enum pmux_ctlid mux_id = tegra_soc_pingroups[pin].ctl_id;
|
||||
u32 *muxctl = &pmt->pmt_ctl[MUXCTL_REG(mux_id)];
|
||||
u32 mask_bit;
|
||||
int i, mux = -1;
|
||||
u32 reg;
|
||||
|
||||
assert(pmux_func_isvalid(func));
|
||||
|
||||
/* Handle special values */
|
||||
if (func >= PMUX_FUNC_RSVD1) {
|
||||
mux = (func - PMUX_FUNC_RSVD1) & 0x3;
|
||||
} else {
|
||||
/* Search for the appropriate function */
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (tegra_soc_pingroups[pin].funcs[i] == func) {
|
||||
mux = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(mux != -1);
|
||||
|
||||
mask_bit = MUXCTL_SHIFT(mux_id);
|
||||
reg = readl(muxctl);
|
||||
reg &= ~(0x3 << mask_bit);
|
||||
reg |= mux << mask_bit;
|
||||
writel(reg, muxctl);
|
||||
}
|
||||
|
||||
void pinmux_config_pingroup(const struct pingroup_config *config)
|
||||
{
|
||||
enum pmux_pingrp pin = config->pingroup;
|
||||
|
||||
pinmux_set_func(pin, config->func);
|
||||
pinmux_set_pullupdown(pin, config->pull);
|
||||
pinmux_set_tristate(pin, config->tristate);
|
||||
}
|
||||
|
||||
void pinmux_config_table(const struct pingroup_config *config, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
pinmux_config_pingroup(&config[i]);
|
||||
}
|
||||
const struct pmux_pingrp_desc *tegra_soc_pingroups = tegra20_pingroups;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <asm/arch/sdram_param.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
#include <asm/arch-tegra/ap.h>
|
||||
#include <asm/arch-tegra/apb_misc.h>
|
||||
#include <asm/arch-tegra/clk_rst.h>
|
||||
#include <asm/arch-tegra/pmc.h>
|
||||
#include <asm/arch-tegra/fuse.h>
|
||||
@@ -122,7 +123,8 @@ int warmboot_save_sdram_params(void)
|
||||
{
|
||||
u32 ram_code;
|
||||
struct sdram_params sdram;
|
||||
struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
struct apb_misc_pp_ctlr *apb_misc =
|
||||
(struct apb_misc_pp_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
|
||||
struct apb_misc_gp_ctlr *gp =
|
||||
(struct apb_misc_gp_ctlr *)NV_PA_APB_MISC_GP_BASE;
|
||||
@@ -135,8 +137,8 @@ int warmboot_save_sdram_params(void)
|
||||
union fbio_spare_reg fbio_spare;
|
||||
|
||||
/* get ram code that is used as index to array sdram_params in BCT */
|
||||
ram_code = (readl(&pmt->pmt_strap_opt_a) >>
|
||||
STRAP_OPT_A_RAM_CODE_SHIFT) & 3;
|
||||
ram_code = (readl(&apb_misc->strapping_opt_a) >>
|
||||
STRAP_OPT_A_RAM_CODE_SHIFT) & 3;
|
||||
memcpy(&sdram,
|
||||
(char *)((struct sdram_params *)SDRAM_PARAMS_BASE + ram_code),
|
||||
sizeof(sdram));
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <asm/arch/pinmux.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
#include <asm/arch-tegra/ap.h>
|
||||
#include <asm/arch-tegra/apb_misc.h>
|
||||
#include <asm/arch-tegra/clk_rst.h>
|
||||
#include <asm/arch-tegra/pmc.h>
|
||||
#include <asm/arch-tegra/warmboot.h>
|
||||
@@ -21,7 +22,8 @@
|
||||
|
||||
void wb_start(void)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
struct apb_misc_pp_ctlr *apb_misc =
|
||||
(struct apb_misc_pp_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
|
||||
struct flow_ctlr *flow = (struct flow_ctlr *)NV_PA_FLOW_BASE;
|
||||
struct clk_rst_ctlr *clkrst =
|
||||
@@ -33,7 +35,7 @@ void wb_start(void)
|
||||
u32 reg;
|
||||
|
||||
/* enable JTAG & TBE */
|
||||
writel(CONFIG_CTL_TBE | CONFIG_CTL_JTAG, &pmt->pmt_cfg_ctl);
|
||||
writel(CONFIG_CTL_TBE | CONFIG_CTL_JTAG, &apb_misc->cfg_ctl);
|
||||
|
||||
/* Are we running where we're supposed to be? */
|
||||
asm volatile (
|
||||
|
||||
@@ -29,14 +29,18 @@ int funcmux_select(enum periph_id id, int config)
|
||||
case PERIPH_ID_UART1:
|
||||
switch (config) {
|
||||
case FUNCMUX_UART1_ULPI:
|
||||
pinmux_set_func(PINGRP_ULPI_DATA0, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PINGRP_ULPI_DATA1, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PINGRP_ULPI_DATA2, PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PINGRP_ULPI_DATA3, PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PINGRP_ULPI_DATA0);
|
||||
pinmux_tristate_disable(PINGRP_ULPI_DATA1);
|
||||
pinmux_tristate_disable(PINGRP_ULPI_DATA2);
|
||||
pinmux_tristate_disable(PINGRP_ULPI_DATA3);
|
||||
pinmux_set_func(PMUX_PINGRP_ULPI_DATA0_PO1,
|
||||
PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_ULPI_DATA1_PO2,
|
||||
PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_ULPI_DATA2_PO3,
|
||||
PMUX_FUNC_UARTA);
|
||||
pinmux_set_func(PMUX_PINGRP_ULPI_DATA3_PO4,
|
||||
PMUX_FUNC_UARTA);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ULPI_DATA0_PO1);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ULPI_DATA1_PO2);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ULPI_DATA2_PO3);
|
||||
pinmux_tristate_disable(PMUX_PINGRP_ULPI_DATA3_PO4);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,694 +1,276 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>.
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/* Tegra30 pin multiplexing functions */
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/tegra.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
|
||||
struct tegra_pingroup_desc {
|
||||
const char *name;
|
||||
enum pmux_func funcs[4];
|
||||
enum pmux_func func_safe;
|
||||
enum pmux_vddio vddio;
|
||||
enum pmux_pin_io io;
|
||||
#define PIN(pin, f0, f1, f2, f3) \
|
||||
{ \
|
||||
.funcs = { \
|
||||
PMUX_FUNC_##f0, \
|
||||
PMUX_FUNC_##f1, \
|
||||
PMUX_FUNC_##f2, \
|
||||
PMUX_FUNC_##f3, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#define PIN_RESERVED {}
|
||||
|
||||
static const struct pmux_pingrp_desc tegra30_pingroups[] = {
|
||||
/* pin, f0, f1, f2, f3 */
|
||||
/* Offset 0x3000 */
|
||||
PIN(ULPI_DATA0_PO1, SPI3, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA1_PO2, SPI3, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA2_PO3, SPI3, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA3_PO4, SPI3, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA4_PO5, SPI2, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA5_PO6, SPI2, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA6_PO7, SPI2, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_DATA7_PO0, SPI2, HSI, UARTA, ULPI),
|
||||
PIN(ULPI_CLK_PY0, SPI1, RSVD2, UARTD, ULPI),
|
||||
PIN(ULPI_DIR_PY1, SPI1, RSVD2, UARTD, ULPI),
|
||||
PIN(ULPI_NXT_PY2, SPI1, RSVD2, UARTD, ULPI),
|
||||
PIN(ULPI_STP_PY3, SPI1, RSVD2, UARTD, ULPI),
|
||||
PIN(DAP3_FS_PP0, I2S2, RSVD2, DISPLAYA, DISPLAYB),
|
||||
PIN(DAP3_DIN_PP1, I2S2, RSVD2, DISPLAYA, DISPLAYB),
|
||||
PIN(DAP3_DOUT_PP2, I2S2, RSVD2, DISPLAYA, DISPLAYB),
|
||||
PIN(DAP3_SCLK_PP3, I2S2, RSVD2, DISPLAYA, DISPLAYB),
|
||||
PIN(PV0, RSVD1, RSVD2, RSVD3, RSVD4),
|
||||
PIN(PV1, RSVD1, RSVD2, RSVD3, RSVD4),
|
||||
PIN(SDMMC1_CLK_PZ0, SDMMC1, RSVD2, RSVD3, UARTA),
|
||||
PIN(SDMMC1_CMD_PZ1, SDMMC1, RSVD2, RSVD3, UARTA),
|
||||
PIN(SDMMC1_DAT3_PY4, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PIN(SDMMC1_DAT2_PY5, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PIN(SDMMC1_DAT1_PY6, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PIN(SDMMC1_DAT0_PY7, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PIN(PV2, OWR, RSVD2, RSVD3, RSVD4),
|
||||
PIN(PV3, CLK_12M_OUT, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CLK2_OUT_PW5, EXTPERIPH2, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CLK2_REQ_PCC5, DAP, RSVD2, RSVD3, RSVD4),
|
||||
PIN(LCD_PWR1_PC1, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_PWR2_PC6, DISPLAYA, DISPLAYB, SPI5, HDCP),
|
||||
PIN(LCD_SDIN_PZ2, DISPLAYA, DISPLAYB, SPI5, RSVD4),
|
||||
PIN(LCD_SDOUT_PN5, DISPLAYA, DISPLAYB, SPI5, HDCP),
|
||||
PIN(LCD_WR_N_PZ3, DISPLAYA, DISPLAYB, SPI5, HDCP),
|
||||
PIN(LCD_CS0_N_PN4, DISPLAYA, DISPLAYB, SPI5, RSVD4),
|
||||
PIN(LCD_DC0_PN6, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_SCK_PZ4, DISPLAYA, DISPLAYB, SPI5, HDCP),
|
||||
PIN(LCD_PWR0_PB2, DISPLAYA, DISPLAYB, SPI5, HDCP),
|
||||
PIN(LCD_PCLK_PB3, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_DE_PJ1, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_HSYNC_PJ3, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_VSYNC_PJ4, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D0_PE0, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D1_PE1, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D2_PE2, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D3_PE3, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D4_PE4, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D5_PE5, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D6_PE6, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D7_PE7, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D8_PF0, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D9_PF1, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D10_PF2, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D11_PF3, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D12_PF4, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D13_PF5, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D14_PF6, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D15_PF7, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D16_PM0, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D17_PM1, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D18_PM2, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D19_PM3, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D20_PM4, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D21_PM5, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D22_PM6, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_D23_PM7, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_CS1_N_PW0, DISPLAYA, DISPLAYB, SPI5, RSVD4),
|
||||
PIN(LCD_M1_PW1, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(LCD_DC1_PD2, DISPLAYA, DISPLAYB, RSVD3, RSVD4),
|
||||
PIN(HDMI_INT_PN7, HDMI, RSVD2, RSVD3, RSVD4),
|
||||
PIN(DDC_SCL_PV4, I2C4, RSVD2, RSVD3, RSVD4),
|
||||
PIN(DDC_SDA_PV5, I2C4, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CRT_HSYNC_PV6, CRT, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CRT_VSYNC_PV7, CRT, RSVD2, RSVD3, RSVD4),
|
||||
PIN(VI_D0_PT4, DDR, RSVD2, VI, RSVD4),
|
||||
PIN(VI_D1_PD5, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D2_PL0, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D3_PL1, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D4_PL2, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D5_PL3, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D6_PL4, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D7_PL5, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D8_PL6, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D9_PL7, DDR, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_D10_PT2, DDR, RSVD2, VI, RSVD4),
|
||||
PIN(VI_D11_PT3, DDR, RSVD2, VI, RSVD4),
|
||||
PIN(VI_PCLK_PT0, RSVD1, SDMMC2, VI, RSVD4),
|
||||
PIN(VI_MCLK_PT1, VI, VI_ALT1, VI_ALT2, VI_ALT3),
|
||||
PIN(VI_VSYNC_PD6, DDR, RSVD2, VI, RSVD4),
|
||||
PIN(VI_HSYNC_PD7, DDR, RSVD2, VI, RSVD4),
|
||||
PIN(UART2_RXD_PC3, UARTB, SPDIF, UARTA, SPI4),
|
||||
PIN(UART2_TXD_PC2, UARTB, SPDIF, UARTA, SPI4),
|
||||
PIN(UART2_RTS_N_PJ6, UARTA, UARTB, GMI, SPI4),
|
||||
PIN(UART2_CTS_N_PJ5, UARTA, UARTB, GMI, SPI4),
|
||||
PIN(UART3_TXD_PW6, UARTC, RSVD2, GMI, RSVD4),
|
||||
PIN(UART3_RXD_PW7, UARTC, RSVD2, GMI, RSVD4),
|
||||
PIN(UART3_CTS_N_PA1, UARTC, RSVD2, GMI, RSVD4),
|
||||
PIN(UART3_RTS_N_PC0, UARTC, PWM0, GMI, RSVD4),
|
||||
PIN(PU0, OWR, UARTA, GMI, RSVD4),
|
||||
PIN(PU1, RSVD1, UARTA, GMI, RSVD4),
|
||||
PIN(PU2, RSVD1, UARTA, GMI, RSVD4),
|
||||
PIN(PU3, PWM0, UARTA, GMI, RSVD4),
|
||||
PIN(PU4, PWM1, UARTA, GMI, RSVD4),
|
||||
PIN(PU5, PWM2, UARTA, GMI, RSVD4),
|
||||
PIN(PU6, PWM3, UARTA, GMI, RSVD4),
|
||||
PIN(GEN1_I2C_SDA_PC5, I2C1, RSVD2, RSVD3, RSVD4),
|
||||
PIN(GEN1_I2C_SCL_PC4, I2C1, RSVD2, RSVD3, RSVD4),
|
||||
PIN(DAP4_FS_PP4, I2S3, RSVD2, GMI, RSVD4),
|
||||
PIN(DAP4_DIN_PP5, I2S3, RSVD2, GMI, RSVD4),
|
||||
PIN(DAP4_DOUT_PP6, I2S3, RSVD2, GMI, RSVD4),
|
||||
PIN(DAP4_SCLK_PP7, I2S3, RSVD2, GMI, RSVD4),
|
||||
PIN(CLK3_OUT_PEE0, EXTPERIPH3, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CLK3_REQ_PEE1, DEV3, RSVD2, RSVD3, RSVD4),
|
||||
PIN(GMI_WP_N_PC7, RSVD1, NAND, GMI, GMI_ALT),
|
||||
PIN(GMI_IORDY_PI5, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_WAIT_PI7, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_ADV_N_PK0, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_CLK_PK1, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_CS0_N_PJ0, RSVD1, NAND, GMI, DTV),
|
||||
PIN(GMI_CS1_N_PJ2, RSVD1, NAND, GMI, DTV),
|
||||
PIN(GMI_CS2_N_PK3, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_CS3_N_PK4, RSVD1, NAND, GMI, GMI_ALT),
|
||||
PIN(GMI_CS4_N_PK2, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_CS6_N_PI3, NAND, NAND_ALT, GMI, SATA),
|
||||
PIN(GMI_CS7_N_PI6, NAND, NAND_ALT, GMI, GMI_ALT),
|
||||
PIN(GMI_AD0_PG0, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD1_PG1, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD2_PG2, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD3_PG3, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD4_PG4, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD5_PG5, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD6_PG6, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD7_PG7, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD8_PH0, PWM0, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD9_PH1, PWM1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD10_PH2, PWM2, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD11_PH3, PWM3, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD12_PH4, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD13_PH5, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD14_PH6, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_AD15_PH7, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_A16_PJ7, UARTD, SPI4, GMI, GMI_ALT),
|
||||
PIN(GMI_A17_PB0, UARTD, SPI4, GMI, DTV),
|
||||
PIN(GMI_A18_PB1, UARTD, SPI4, GMI, DTV),
|
||||
PIN(GMI_A19_PK7, UARTD, SPI4, GMI, RSVD4),
|
||||
PIN(GMI_WR_N_PI0, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_OE_N_PI1, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_DQS_PI2, RSVD1, NAND, GMI, RSVD4),
|
||||
PIN(GMI_RST_N_PI4, NAND, NAND_ALT, GMI, RSVD4),
|
||||
PIN(GEN2_I2C_SCL_PT5, I2C2, HDCP, GMI, RSVD4),
|
||||
PIN(GEN2_I2C_SDA_PT6, I2C2, HDCP, GMI, RSVD4),
|
||||
PIN(SDMMC4_CLK_PCC4, INVALID, NAND, GMI, SDMMC4),
|
||||
PIN(SDMMC4_CMD_PT7, I2C3, NAND, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT0_PAA0, UARTE, SPI3, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT1_PAA1, UARTE, SPI3, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT2_PAA2, UARTE, SPI3, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT3_PAA3, UARTE, SPI3, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT4_PAA4, I2C3, I2S4, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT5_PAA5, VGP3, I2S4, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT6_PAA6, VGP4, I2S4, GMI, SDMMC4),
|
||||
PIN(SDMMC4_DAT7_PAA7, VGP5, I2S4, GMI, SDMMC4),
|
||||
PIN(SDMMC4_RST_N_PCC3, VGP6, RSVD2, RSVD3, SDMMC4),
|
||||
PIN(CAM_MCLK_PCC0, VI, VI_ALT1, VI_ALT3, SDMMC4),
|
||||
PIN(PCC1, I2S4, RSVD2, RSVD3, SDMMC4),
|
||||
PIN(PBB0, I2S4, RSVD2, RSVD3, SDMMC4),
|
||||
PIN(CAM_I2C_SCL_PBB1, VGP1, I2C3, RSVD3, SDMMC4),
|
||||
PIN(CAM_I2C_SDA_PBB2, VGP2, I2C3, RSVD3, SDMMC4),
|
||||
PIN(PBB3, VGP3, DISPLAYA, DISPLAYB, SDMMC4),
|
||||
PIN(PBB4, VGP4, DISPLAYA, DISPLAYB, SDMMC4),
|
||||
PIN(PBB5, VGP5, DISPLAYA, DISPLAYB, SDMMC4),
|
||||
PIN(PBB6, VGP6, DISPLAYA, DISPLAYB, SDMMC4),
|
||||
PIN(PBB7, I2S4, RSVD2, RSVD3, SDMMC4),
|
||||
PIN(PCC2, I2S4, RSVD2, RSVD3, RSVD4),
|
||||
PIN(JTAG_RTCK_PU7, RTCK, RSVD2, RSVD3, RSVD4),
|
||||
PIN(PWR_I2C_SCL_PZ6, I2CPWR, RSVD2, RSVD3, RSVD4),
|
||||
PIN(PWR_I2C_SDA_PZ7, I2CPWR, RSVD2, RSVD3, RSVD4),
|
||||
PIN(KB_ROW0_PR0, KBC, NAND, RSVD3, RSVD4),
|
||||
PIN(KB_ROW1_PR1, KBC, NAND, RSVD3, RSVD4),
|
||||
PIN(KB_ROW2_PR2, KBC, NAND, RSVD3, RSVD4),
|
||||
PIN(KB_ROW3_PR3, KBC, NAND, RSVD3, INVALID),
|
||||
PIN(KB_ROW4_PR4, KBC, NAND, TRACE, RSVD4),
|
||||
PIN(KB_ROW5_PR5, KBC, NAND, TRACE, OWR),
|
||||
PIN(KB_ROW6_PR6, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW7_PR7, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW8_PS0, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW9_PS1, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW10_PS2, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW11_PS3, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW12_PS4, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW13_PS5, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW14_PS6, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_ROW15_PS7, KBC, NAND, SDMMC2, MIO),
|
||||
PIN(KB_COL0_PQ0, KBC, NAND, TRACE, TEST),
|
||||
PIN(KB_COL1_PQ1, KBC, NAND, TRACE, TEST),
|
||||
PIN(KB_COL2_PQ2, KBC, NAND, TRACE, RSVD4),
|
||||
PIN(KB_COL3_PQ3, KBC, NAND, TRACE, RSVD4),
|
||||
PIN(KB_COL4_PQ4, KBC, NAND, TRACE, RSVD4),
|
||||
PIN(KB_COL5_PQ5, KBC, NAND, TRACE, RSVD4),
|
||||
PIN(KB_COL6_PQ6, KBC, NAND, TRACE, MIO),
|
||||
PIN(KB_COL7_PQ7, KBC, NAND, TRACE, MIO),
|
||||
PIN(CLK_32K_OUT_PA0, BLINK, RSVD2, RSVD3, RSVD4),
|
||||
PIN(SYS_CLK_REQ_PZ5, SYSCLK, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CORE_PWR_REQ, CORE_PWR_REQ, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CPU_PWR_REQ, CPU_PWR_REQ, RSVD2, RSVD3, RSVD4),
|
||||
PIN(PWR_INT_N, PWR_INT_N, RSVD2, RSVD3, RSVD4),
|
||||
PIN(CLK_32K_IN, CLK_32K_IN, RSVD2, RSVD3, RSVD4),
|
||||
PIN(OWR, OWR, CEC, RSVD3, RSVD4),
|
||||
PIN(DAP1_FS_PN0, I2S0, HDA, GMI, SDMMC2),
|
||||
PIN(DAP1_DIN_PN1, I2S0, HDA, GMI, SDMMC2),
|
||||
PIN(DAP1_DOUT_PN2, I2S0, HDA, GMI, SDMMC2),
|
||||
PIN(DAP1_SCLK_PN3, I2S0, HDA, GMI, SDMMC2),
|
||||
PIN(CLK1_REQ_PEE2, DAP, HDA, RSVD3, RSVD4),
|
||||
PIN(CLK1_OUT_PW4, EXTPERIPH1, RSVD2, RSVD3, RSVD4),
|
||||
PIN(SPDIF_IN_PK6, SPDIF, HDA, I2C1, SDMMC2),
|
||||
PIN(SPDIF_OUT_PK5, SPDIF, RSVD2, I2C1, SDMMC2),
|
||||
PIN(DAP2_FS_PA2, I2S1, HDA, RSVD3, GMI),
|
||||
PIN(DAP2_DIN_PA4, I2S1, HDA, RSVD3, GMI),
|
||||
PIN(DAP2_DOUT_PA5, I2S1, HDA, RSVD3, GMI),
|
||||
PIN(DAP2_SCLK_PA3, I2S1, HDA, RSVD3, GMI),
|
||||
PIN(SPI2_MOSI_PX0, SPI6, SPI2, SPI3, GMI),
|
||||
PIN(SPI2_MISO_PX1, SPI6, SPI2, SPI3, GMI),
|
||||
PIN(SPI2_CS0_N_PX3, SPI6, SPI2, SPI3, GMI),
|
||||
PIN(SPI2_SCK_PX2, SPI6, SPI2, SPI3, GMI),
|
||||
PIN(SPI1_MOSI_PX4, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PIN(SPI1_SCK_PX5, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PIN(SPI1_CS0_N_PX6, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PIN(SPI1_MISO_PX7, SPI3, SPI1, SPI2_ALT, RSVD4),
|
||||
PIN(SPI2_CS1_N_PW2, SPI3, SPI2, SPI2_ALT, I2C1),
|
||||
PIN(SPI2_CS2_N_PW3, SPI3, SPI2, SPI2_ALT, I2C1),
|
||||
PIN(SDMMC3_CLK_PA6, UARTA, PWM2, SDMMC3, SPI3),
|
||||
PIN(SDMMC3_CMD_PA7, UARTA, PWM3, SDMMC3, SPI2),
|
||||
PIN(SDMMC3_DAT0_PB7, RSVD1, RSVD2, SDMMC3, SPI3),
|
||||
PIN(SDMMC3_DAT1_PB6, RSVD1, RSVD2, SDMMC3, SPI3),
|
||||
PIN(SDMMC3_DAT2_PB5, RSVD1, PWM1, SDMMC3, SPI3),
|
||||
PIN(SDMMC3_DAT3_PB4, RSVD1, PWM0, SDMMC3, SPI3),
|
||||
PIN(SDMMC3_DAT4_PD1, PWM1, SPI4, SDMMC3, SPI2),
|
||||
PIN(SDMMC3_DAT5_PD0, PWM0, SPI4, SDMMC3, SPI2),
|
||||
PIN(SDMMC3_DAT6_PD3, SPDIF, SPI4, SDMMC3, SPI2),
|
||||
PIN(SDMMC3_DAT7_PD4, SPDIF, SPI4, SDMMC3, SPI2),
|
||||
PIN(PEX_L0_PRSNT_N_PDD0, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L0_RST_N_PDD1, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L0_CLKREQ_N_PDD2, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_WAKE_N_PDD3, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L1_PRSNT_N_PDD4, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L1_RST_N_PDD5, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L1_CLKREQ_N_PDD6, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L2_PRSNT_N_PDD7, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L2_RST_N_PCC6, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(PEX_L2_CLKREQ_N_PCC7, PCIE, HDA, RSVD3, RSVD4),
|
||||
PIN(HDMI_CEC_PEE3, CEC, RSVD2, RSVD3, RSVD4),
|
||||
};
|
||||
|
||||
#define PMUX_MUXCTL_SHIFT 0
|
||||
#define PMUX_PULL_SHIFT 2
|
||||
#define PMUX_TRISTATE_SHIFT 4
|
||||
#define PMUX_TRISTATE_MASK (1 << PMUX_TRISTATE_SHIFT)
|
||||
#define PMUX_IO_SHIFT 5
|
||||
#define PMUX_OD_SHIFT 6
|
||||
#define PMUX_LOCK_SHIFT 7
|
||||
#define PMUX_IO_RESET_SHIFT 8
|
||||
|
||||
#define PGRP_HSM_SHIFT 2
|
||||
#define PGRP_SCHMT_SHIFT 3
|
||||
#define PGRP_LPMD_SHIFT 4
|
||||
#define PGRP_LPMD_MASK (3 << PGRP_LPMD_SHIFT)
|
||||
#define PGRP_DRVDN_SHIFT 12
|
||||
#define PGRP_DRVDN_MASK (0x7F << PGRP_DRVDN_SHIFT)
|
||||
#define PGRP_DRVUP_SHIFT 20
|
||||
#define PGRP_DRVUP_MASK (0x7F << PGRP_DRVUP_SHIFT)
|
||||
#define PGRP_SLWR_SHIFT 28
|
||||
#define PGRP_SLWR_MASK (3 << PGRP_SLWR_SHIFT)
|
||||
#define PGRP_SLWF_SHIFT 30
|
||||
#define PGRP_SLWF_MASK (3 << PGRP_SLWF_SHIFT)
|
||||
|
||||
/* Convenient macro for defining pin group properties */
|
||||
#define PIN(pg_name, vdd, f0, f1, f2, f3, iod) \
|
||||
{ \
|
||||
.vddio = PMUX_VDDIO_ ## vdd, \
|
||||
.funcs = { \
|
||||
PMUX_FUNC_ ## f0, \
|
||||
PMUX_FUNC_ ## f1, \
|
||||
PMUX_FUNC_ ## f2, \
|
||||
PMUX_FUNC_ ## f3, \
|
||||
}, \
|
||||
.func_safe = PMUX_FUNC_RSVD1, \
|
||||
.io = PMUX_PIN_ ## iod, \
|
||||
}
|
||||
|
||||
/* Input and output pins */
|
||||
#define PINI(pg_name, vdd, f0, f1, f2, f3) \
|
||||
PIN(pg_name, vdd, f0, f1, f2, f3, INPUT)
|
||||
#define PINO(pg_name, vdd, f0, f1, f2, f3) \
|
||||
PIN(pg_name, vdd, f0, f1, f2, f3, OUTPUT)
|
||||
|
||||
const struct tegra_pingroup_desc tegra_soc_pingroups[PINGRP_COUNT] = {
|
||||
/* NAME VDD f0 f1 f2 f3 */
|
||||
PINI(ULPI_DATA0, BB, SPI3, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA1, BB, SPI3, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA2, BB, SPI3, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA3, BB, SPI3, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA4, BB, SPI2, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA5, BB, SPI2, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA6, BB, SPI2, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_DATA7, BB, SPI2, HSI, UARTA, ULPI),
|
||||
PINI(ULPI_CLK, BB, SPI1, RSVD2, UARTD, ULPI),
|
||||
PINI(ULPI_DIR, BB, SPI1, RSVD2, UARTD, ULPI),
|
||||
PINI(ULPI_NXT, BB, SPI1, RSVD2, UARTD, ULPI),
|
||||
PINI(ULPI_STP, BB, SPI1, RSVD2, UARTD, ULPI),
|
||||
PINI(DAP3_FS, BB, I2S2, RSVD2, DISPA, DISPB),
|
||||
PINI(DAP3_DIN, BB, I2S2, RSVD2, DISPA, DISPB),
|
||||
PINI(DAP3_DOUT, BB, I2S2, RSVD2, DISPA, DISPB),
|
||||
PINI(DAP3_SCLK, BB, I2S2, RSVD2, DISPA, DISPB),
|
||||
PINI(GPIO_PV0, BB, RSVD1, RSVD2, RSVD3, RSVD4),
|
||||
PINI(GPIO_PV1, BB, RSVD1, RSVD2, RSVD3, RSVD4),
|
||||
PINI(SDMMC1_CLK, SDMMC1, SDMMC1, RSVD2, RSVD3, UARTA),
|
||||
PINI(SDMMC1_CMD, SDMMC1, SDMMC1, RSVD2, RSVD3, UARTA),
|
||||
PINI(SDMMC1_DAT3, SDMMC1, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PINI(SDMMC1_DAT2, SDMMC1, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PINI(SDMMC1_DAT1, SDMMC1, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PINI(SDMMC1_DAT0, SDMMC1, SDMMC1, RSVD2, UARTE, UARTA),
|
||||
PINI(GPIO_PV2, SDMMC1, OWR, RSVD2, RSVD3, RSVD4),
|
||||
PINI(GPIO_PV3, SDMMC1, CLK_12M_OUT, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CLK2_OUT, SDMMC1, EXTPERIPH2, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CLK2_REQ, SDMMC1, DAP, RSVD2, RSVD3, RSVD4),
|
||||
PINO(LCD_PWR1, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_PWR2, LCD, DISPA, DISPB, SPI5, HDCP),
|
||||
PINO(LCD_SDIN, LCD, DISPA, DISPB, SPI5, RSVD4),
|
||||
PINO(LCD_SDOUT, LCD, DISPA, DISPB, SPI5, HDCP),
|
||||
PINO(LCD_WR_N, LCD, DISPA, DISPB, SPI5, HDCP),
|
||||
PINO(LCD_CS0_N, LCD, DISPA, DISPB, SPI5, RSVD4),
|
||||
PINO(LCD_DC0, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_SCK, LCD, DISPA, DISPB, SPI5, HDCP),
|
||||
PINO(LCD_PWR0, LCD, DISPA, DISPB, SPI5, HDCP),
|
||||
PINO(LCD_PCLK, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_DE, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_HSYNC, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_VSYNC, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D0, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D1, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D2, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D3, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D4, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D5, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D6, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D7, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D8, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D9, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D10, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D11, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D12, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D13, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D14, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D15, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D16, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D17, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D18, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D19, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D20, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D21, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D22, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_D23, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_CS1_N, LCD, DISPA, DISPB, SPI5, RSVD4),
|
||||
PINO(LCD_M1, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINO(LCD_DC1, LCD, DISPA, DISPB, RSVD3, RSVD4),
|
||||
PINI(HDMI_INT, LCD, HDMI, RSVD2, RSVD3, RSVD4),
|
||||
PINI(DDC_SCL, LCD, I2C4, RSVD2, RSVD3, RSVD4),
|
||||
PINI(DDC_SDA, LCD, I2C4, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CRT_HSYNC, LCD, CRT, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CRT_VSYNC, LCD, CRT, RSVD2, RSVD3, RSVD4),
|
||||
PINI(VI_D0, VI, DDR, RSVD2, VI, RSVD4),
|
||||
PINI(VI_D1, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D2, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D3, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D4, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D5, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D6, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D7, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D8, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D9, VI, DDR, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_D10, VI, DDR, RSVD2, VI, RSVD4),
|
||||
PINI(VI_D11, VI, DDR, RSVD2, VI, RSVD4),
|
||||
PINI(VI_PCLK, VI, RSVD1, SDMMC2, VI, RSVD4),
|
||||
PINI(VI_MCLK, VI, VI, VI, VI, VI),
|
||||
PINI(VI_VSYNC, VI, DDR, RSVD2, VI, RSVD4),
|
||||
PINI(VI_HSYNC, VI, DDR, RSVD2, VI, RSVD4),
|
||||
PINI(UART2_RXD, UART, UARTB, SPDIF, UARTA, SPI4),
|
||||
PINI(UART2_TXD, UART, UARTB, SPDIF, UARTA, SPI4),
|
||||
PINI(UART2_RTS_N, UART, UARTA, UARTB, GMI, SPI4),
|
||||
PINI(UART2_CTS_N, UART, UARTA, UARTB, GMI, SPI4),
|
||||
PINI(UART3_TXD, UART, UARTC, RSVD2, GMI, RSVD4),
|
||||
PINI(UART3_RXD, UART, UARTC, RSVD2, GMI, RSVD4),
|
||||
PINI(UART3_CTS_N, UART, UARTC, RSVD2, GMI, RSVD4),
|
||||
PINI(UART3_RTS_N, UART, UARTC, PWM0, GMI, RSVD4),
|
||||
PINI(GPIO_PU0, UART, OWR, UARTA, GMI, RSVD4),
|
||||
PINI(GPIO_PU1, UART, RSVD1, UARTA, GMI, RSVD4),
|
||||
PINI(GPIO_PU2, UART, RSVD1, UARTA, GMI, RSVD4),
|
||||
PINI(GPIO_PU3, UART, PWM0, UARTA, GMI, RSVD4),
|
||||
PINI(GPIO_PU4, UART, PWM1, UARTA, GMI, RSVD4),
|
||||
PINI(GPIO_PU5, UART, PWM2, UARTA, GMI, RSVD4),
|
||||
PINI(GPIO_PU6, UART, PWM3, UARTA, GMI, RSVD4),
|
||||
PINI(GEN1_I2C_SDA, UART, I2C1, RSVD2, RSVD3, RSVD4),
|
||||
PINI(GEN1_I2C_SCL, UART, I2C1, RSVD2, RSVD3, RSVD4),
|
||||
PINI(DAP4_FS, UART, I2S3, RSVD2, GMI, RSVD4),
|
||||
PINI(DAP4_DIN, UART, I2S3, RSVD2, GMI, RSVD4),
|
||||
PINI(DAP4_DOUT, UART, I2S3, RSVD2, GMI, RSVD4),
|
||||
PINI(DAP4_SCLK, UART, I2S3, RSVD2, GMI, RSVD4),
|
||||
PINI(CLK3_OUT, UART, EXTPERIPH3, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CLK3_REQ, UART, DEV3, RSVD2, RSVD3, RSVD4),
|
||||
PINI(GMI_WP_N, GMI, RSVD1, NAND, GMI, GMI_ALT),
|
||||
PINI(GMI_IORDY, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_WAIT, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_ADV_N, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_CLK, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_CS0_N, GMI, RSVD1, NAND, GMI, DTV),
|
||||
PINI(GMI_CS1_N, GMI, RSVD1, NAND, GMI, DTV),
|
||||
PINI(GMI_CS2_N, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_CS3_N, GMI, RSVD1, NAND, GMI, GMI_ALT),
|
||||
PINI(GMI_CS4_N, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_CS6_N, GMI, NAND, NAND_ALT, GMI, SATA),
|
||||
PINI(GMI_CS7_N, GMI, NAND, NAND_ALT, GMI, GMI_ALT),
|
||||
PINI(GMI_AD0, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD1, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD2, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD3, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD4, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD5, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD6, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD7, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD8, GMI, PWM0, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD9, GMI, PWM1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD10, GMI, PWM2, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD11, GMI, PWM3, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD12, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD13, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD14, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_AD15, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_A16, GMI, UARTD, SPI4, GMI, GMI_ALT),
|
||||
PINI(GMI_A17, GMI, UARTD, SPI4, GMI, DTV),
|
||||
PINI(GMI_A18, GMI, UARTD, SPI4, GMI, DTV),
|
||||
PINI(GMI_A19, GMI, UARTD, SPI4, GMI, RSVD4),
|
||||
PINI(GMI_WR_N, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_OE_N, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_DQS, GMI, RSVD1, NAND, GMI, RSVD4),
|
||||
PINI(GMI_RST_N, GMI, NAND, NAND_ALT, GMI, RSVD4),
|
||||
PINI(GEN2_I2C_SCL, GMI, I2C2, HDCP, GMI, RSVD4),
|
||||
PINI(GEN2_I2C_SDA, GMI, I2C2, HDCP, GMI, RSVD4),
|
||||
PINI(SDMMC4_CLK, SDMMC4, RSVD1, NAND, GMI, SDMMC4),
|
||||
PINI(SDMMC4_CMD, SDMMC4, I2C3, NAND, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT0, SDMMC4, UARTE, SPI3, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT1, SDMMC4, UARTE, SPI3, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT2, SDMMC4, UARTE, SPI3, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT3, SDMMC4, UARTE, SPI3, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT4, SDMMC4, I2C3, I2S4, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT5, SDMMC4, VGP3, I2S4, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT6, SDMMC4, VGP4, I2S4, GMI, SDMMC4),
|
||||
PINI(SDMMC4_DAT7, SDMMC4, VGP5, I2S4, GMI, SDMMC4),
|
||||
PINI(SDMMC4_RST_N, SDMMC4, VGP6, RSVD2, RSVD3, SDMMC4),
|
||||
PINI(CAM_MCLK, CAM, VI, RSVD2, VI_ALT2, SDMMC4),
|
||||
PINI(GPIO_PCC1, CAM, I2S4, RSVD2, RSVD3, SDMMC4),
|
||||
PINI(GPIO_PBB0, CAM, I2S4, RSVD2, RSVD3, SDMMC4),
|
||||
PINI(CAM_I2C_SCL, CAM, VGP1, I2C3, RSVD3, SDMMC4),
|
||||
PINI(CAM_I2C_SDA, CAM, VGP2, I2C3, RSVD3, SDMMC4),
|
||||
PINI(GPIO_PBB3, CAM, VGP3, DISPA, DISPB, SDMMC4),
|
||||
PINI(GPIO_PBB4, CAM, VGP4, DISPA, DISPB, SDMMC4),
|
||||
PINI(GPIO_PBB5, CAM, VGP5, DISPA, DISPB, SDMMC4),
|
||||
PINI(GPIO_PBB6, CAM, VGP6, DISPA, DISPB, SDMMC4),
|
||||
PINI(GPIO_PBB7, CAM, I2S4, RSVD2, RSVD3, SDMMC4),
|
||||
PINI(GPIO_PCC2, CAM, I2S4, RSVD2, RSVD3, RSVD4),
|
||||
PINI(JTAG_RTCK, SYS, RTCK, RSVD2, RSVD3, RSVD4),
|
||||
PINI(PWR_I2C_SCL, SYS, I2CPWR, RSVD2, RSVD3, RSVD4),
|
||||
PINI(PWR_I2C_SDA, SYS, I2CPWR, RSVD2, RSVD3, RSVD4),
|
||||
PINI(KB_ROW0, SYS, KBC, NAND, RSVD3, RSVD4),
|
||||
PINI(KB_ROW1, SYS, KBC, NAND, RSVD3, RSVD4),
|
||||
PINI(KB_ROW2, SYS, KBC, NAND, RSVD3, RSVD4),
|
||||
PINI(KB_ROW3, SYS, KBC, NAND, RSVD3, RSVD4),
|
||||
PINI(KB_ROW4, SYS, KBC, NAND, TRACE, RSVD4),
|
||||
PINI(KB_ROW5, SYS, KBC, NAND, TRACE, OWR),
|
||||
PINI(KB_ROW6, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW7, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW8, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW9, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW10, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW11, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW12, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW13, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW14, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_ROW15, SYS, KBC, NAND, SDMMC2, MIO),
|
||||
PINI(KB_COL0, SYS, KBC, NAND, TRACE, TEST),
|
||||
PINI(KB_COL1, SYS, KBC, NAND, TRACE, TEST),
|
||||
PINI(KB_COL2, SYS, KBC, NAND, TRACE, RSVD4),
|
||||
PINI(KB_COL3, SYS, KBC, NAND, TRACE, RSVD4),
|
||||
PINI(KB_COL4, SYS, KBC, NAND, TRACE, RSVD4),
|
||||
PINI(KB_COL5, SYS, KBC, NAND, TRACE, RSVD4),
|
||||
PINI(KB_COL6, SYS, KBC, NAND, TRACE, MIO),
|
||||
PINI(KB_COL7, SYS, KBC, NAND, TRACE, MIO),
|
||||
PINI(CLK_32K_OUT, SYS, BLINK, RSVD2, RSVD3, RSVD4),
|
||||
PINI(SYS_CLK_REQ, SYS, SYSCLK, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CORE_PWR_REQ, SYS, CORE_PWR_REQ, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CPU_PWR_REQ, SYS, CPU_PWR_REQ, RSVD2, RSVD3, RSVD4),
|
||||
PINI(PWR_INT_N, SYS, PWR_INT_N, RSVD2, RSVD3, RSVD4),
|
||||
PINI(CLK_32K_IN, SYS, CLK_32K_IN, RSVD2, RSVD3, RSVD4),
|
||||
PINI(OWR, SYS, OWR, CEC, RSVD3, RSVD4),
|
||||
PINI(DAP1_FS, AUDIO, I2S0, HDA, GMI, SDMMC2),
|
||||
PINI(DAP1_DIN, AUDIO, I2S0, HDA, GMI, SDMMC2),
|
||||
PINI(DAP1_DOUT, AUDIO, I2S0, HDA, GMI, SDMMC2),
|
||||
PINI(DAP1_SCLK, AUDIO, I2S0, HDA, GMI, SDMMC2),
|
||||
PINI(CLK1_REQ, AUDIO, DAP, HDA, RSVD3, RSVD4),
|
||||
PINI(CLK1_OUT, AUDIO, EXTPERIPH1, RSVD2, RSVD3, RSVD4),
|
||||
PINI(SPDIF_IN, AUDIO, SPDIF, HDA, I2C1, SDMMC2),
|
||||
PINI(SPDIF_OUT, AUDIO, SPDIF, RSVD2, I2C1, SDMMC2),
|
||||
PINI(DAP2_FS, AUDIO, I2S1, HDA, RSVD3, GMI),
|
||||
PINI(DAP2_DIN, AUDIO, I2S1, HDA, RSVD3, GMI),
|
||||
PINI(DAP2_DOUT, AUDIO, I2S1, HDA, RSVD3, GMI),
|
||||
PINI(DAP2_SCLK, AUDIO, I2S1, HDA, RSVD3, GMI),
|
||||
PINI(SPI2_MOSI, AUDIO, SPI6, SPI2, GMI, GMI),
|
||||
PINI(SPI2_MISO, AUDIO, SPI6, SPI2, GMI, GMI),
|
||||
PINI(SPI2_CS0_N, AUDIO, SPI6, SPI2, GMI, GMI),
|
||||
PINI(SPI2_SCK, AUDIO, SPI6, SPI2, GMI, GMI),
|
||||
PINI(SPI1_MOSI, AUDIO, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PINI(SPI1_SCK, AUDIO, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PINI(SPI1_CS0_N, AUDIO, SPI2, SPI1, SPI2_ALT, GMI),
|
||||
PINI(SPI1_MISO, AUDIO, SPI3, SPI1, SPI2_ALT, RSVD4),
|
||||
PINI(SPI2_CS1_N, AUDIO, SPI3, SPI2, SPI2_ALT, I2C1),
|
||||
PINI(SPI2_CS2_N, AUDIO, SPI3, SPI2, SPI2_ALT, I2C1),
|
||||
PINI(SDMMC3_CLK, SDMMC3, UARTA, PWM2, SDMMC3, SPI3),
|
||||
PINI(SDMMC3_CMD, SDMMC3, UARTA, PWM3, SDMMC3, SPI2),
|
||||
PINI(SDMMC3_DAT0, SDMMC3, RSVD1, RSVD2, SDMMC3, SPI3),
|
||||
PINI(SDMMC3_DAT1, SDMMC3, RSVD1, RSVD2, SDMMC3, SPI3),
|
||||
PINI(SDMMC3_DAT2, SDMMC3, RSVD1, PWM1, SDMMC3, SPI3),
|
||||
PINI(SDMMC3_DAT3, SDMMC3, RSVD1, PWM0, SDMMC3, SPI3),
|
||||
PINI(SDMMC3_DAT4, SDMMC3, PWM1, SPI4, SDMMC3, SPI2),
|
||||
PINI(SDMMC3_DAT5, SDMMC3, PWM0, SPI4, SDMMC3, SPI2),
|
||||
PINI(SDMMC3_DAT6, SDMMC3, SPDIF, SPI4, SDMMC3, SPI2),
|
||||
PINI(SDMMC3_DAT7, SDMMC3, SPDIF, SPI4, SDMMC3, SPI2),
|
||||
PINI(PEX_L0_PRSNT_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L0_RST_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L0_CLKREQ_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_WAKE_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L1_PRSNT_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L1_RST_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L1_CLKREQ_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L2_PRSNT_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L2_RST_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(PEX_L2_CLKREQ_N, PEXCTL, PCIE, HDA, RSVD3, RSVD4),
|
||||
PINI(HDMI_CEC, SYS, CEC, RSVD2, RSVD3, RSVD4),
|
||||
};
|
||||
|
||||
void pinmux_set_tristate(enum pmux_pingrp pin, int enable)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *tri = &pmt->pmt_ctl[pin];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
|
||||
reg = readl(tri);
|
||||
if (enable)
|
||||
reg |= PMUX_TRISTATE_MASK;
|
||||
else
|
||||
reg &= ~PMUX_TRISTATE_MASK;
|
||||
writel(reg, tri);
|
||||
}
|
||||
|
||||
void pinmux_tristate_enable(enum pmux_pingrp pin)
|
||||
{
|
||||
pinmux_set_tristate(pin, 1);
|
||||
}
|
||||
|
||||
void pinmux_tristate_disable(enum pmux_pingrp pin)
|
||||
{
|
||||
pinmux_set_tristate(pin, 0);
|
||||
}
|
||||
|
||||
void pinmux_set_pullupdown(enum pmux_pingrp pin, enum pmux_pull pupd)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pull = &pmt->pmt_ctl[pin];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin and pupd */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_pupd_isvalid(pupd));
|
||||
|
||||
reg = readl(pull);
|
||||
reg &= ~(0x3 << PMUX_PULL_SHIFT);
|
||||
reg |= (pupd << PMUX_PULL_SHIFT);
|
||||
writel(reg, pull);
|
||||
}
|
||||
|
||||
void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *muxctl = &pmt->pmt_ctl[pin];
|
||||
int i, mux = -1;
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin and func */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_func_isvalid(func));
|
||||
|
||||
/* Handle special values */
|
||||
if (func == PMUX_FUNC_SAFE)
|
||||
func = tegra_soc_pingroups[pin].func_safe;
|
||||
|
||||
if (func & PMUX_FUNC_RSVD1) {
|
||||
mux = func & 0x3;
|
||||
} else {
|
||||
/* Search for the appropriate function */
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (tegra_soc_pingroups[pin].funcs[i] == func) {
|
||||
mux = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(mux != -1);
|
||||
|
||||
reg = readl(muxctl);
|
||||
reg &= ~(0x3 << PMUX_MUXCTL_SHIFT);
|
||||
reg |= (mux << PMUX_MUXCTL_SHIFT);
|
||||
writel(reg, muxctl);
|
||||
|
||||
}
|
||||
|
||||
void pinmux_set_io(enum pmux_pingrp pin, enum pmux_pin_io io)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pin_io = &pmt->pmt_ctl[pin];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin and io */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_io_isvalid(io));
|
||||
|
||||
reg = readl(pin_io);
|
||||
reg &= ~(0x1 << PMUX_IO_SHIFT);
|
||||
reg |= (io & 0x1) << PMUX_IO_SHIFT;
|
||||
writel(reg, pin_io);
|
||||
}
|
||||
|
||||
static int pinmux_set_lock(enum pmux_pingrp pin, enum pmux_pin_lock lock)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pin_lock = &pmt->pmt_ctl[pin];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin and lock */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_lock_isvalid(lock));
|
||||
|
||||
if (lock == PMUX_PIN_LOCK_DEFAULT)
|
||||
return 0;
|
||||
|
||||
reg = readl(pin_lock);
|
||||
reg &= ~(0x1 << PMUX_LOCK_SHIFT);
|
||||
if (lock == PMUX_PIN_LOCK_ENABLE)
|
||||
reg |= (0x1 << PMUX_LOCK_SHIFT);
|
||||
else {
|
||||
/* lock == DISABLE, which isn't possible */
|
||||
printf("%s: Warning: lock == %d, DISABLE is not allowed!\n",
|
||||
__func__, lock);
|
||||
}
|
||||
writel(reg, pin_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pinmux_set_od(enum pmux_pingrp pin, enum pmux_pin_od od)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pin_od = &pmt->pmt_ctl[pin];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin and od */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_od_isvalid(od));
|
||||
|
||||
if (od == PMUX_PIN_OD_DEFAULT)
|
||||
return 0;
|
||||
|
||||
reg = readl(pin_od);
|
||||
reg &= ~(0x1 << PMUX_OD_SHIFT);
|
||||
if (od == PMUX_PIN_OD_ENABLE)
|
||||
reg |= (0x1 << PMUX_OD_SHIFT);
|
||||
writel(reg, pin_od);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pinmux_set_ioreset(enum pmux_pingrp pin,
|
||||
enum pmux_pin_ioreset ioreset)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pin_ioreset = &pmt->pmt_ctl[pin];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pin and ioreset */
|
||||
assert(pmux_pingrp_isvalid(pin));
|
||||
assert(pmux_pin_ioreset_isvalid(ioreset));
|
||||
|
||||
if (ioreset == PMUX_PIN_IO_RESET_DEFAULT)
|
||||
return 0;
|
||||
|
||||
reg = readl(pin_ioreset);
|
||||
reg &= ~(0x1 << PMUX_IO_RESET_SHIFT);
|
||||
if (ioreset == PMUX_PIN_IO_RESET_ENABLE)
|
||||
reg |= (0x1 << PMUX_IO_RESET_SHIFT);
|
||||
writel(reg, pin_ioreset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void pinmux_config_pingroup(struct pingroup_config *config)
|
||||
{
|
||||
enum pmux_pingrp pin = config->pingroup;
|
||||
|
||||
pinmux_set_func(pin, config->func);
|
||||
pinmux_set_pullupdown(pin, config->pull);
|
||||
pinmux_set_tristate(pin, config->tristate);
|
||||
pinmux_set_io(pin, config->io);
|
||||
pinmux_set_lock(pin, config->lock);
|
||||
pinmux_set_od(pin, config->od);
|
||||
pinmux_set_ioreset(pin, config->ioreset);
|
||||
}
|
||||
|
||||
void pinmux_config_table(struct pingroup_config *config, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
pinmux_config_pingroup(&config[i]);
|
||||
}
|
||||
|
||||
static int padgrp_set_drvup_slwf(enum pdrive_pingrp pad,
|
||||
int slwf)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_slwf = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pad and slwf */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
assert(pmux_pad_slw_isvalid(slwf));
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (slwf == PGRP_SLWF_NONE)
|
||||
return 0;
|
||||
|
||||
reg = readl(pad_slwf);
|
||||
reg &= ~PGRP_SLWF_MASK;
|
||||
reg |= (slwf << PGRP_SLWF_SHIFT);
|
||||
writel(reg, pad_slwf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int padgrp_set_drvdn_slwr(enum pdrive_pingrp pad, int slwr)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_slwr = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pad and slwr */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
assert(pmux_pad_slw_isvalid(slwr));
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (slwr == PGRP_SLWR_NONE)
|
||||
return 0;
|
||||
|
||||
reg = readl(pad_slwr);
|
||||
reg &= ~PGRP_SLWR_MASK;
|
||||
reg |= (slwr << PGRP_SLWR_SHIFT);
|
||||
writel(reg, pad_slwr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int padgrp_set_drvup(enum pdrive_pingrp pad, int drvup)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_drvup = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pad and drvup */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
assert(pmux_pad_drv_isvalid(drvup));
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (drvup == PGRP_DRVUP_NONE)
|
||||
return 0;
|
||||
|
||||
reg = readl(pad_drvup);
|
||||
reg &= ~PGRP_DRVUP_MASK;
|
||||
reg |= (drvup << PGRP_DRVUP_SHIFT);
|
||||
writel(reg, pad_drvup);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int padgrp_set_drvdn(enum pdrive_pingrp pad, int drvdn)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_drvdn = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check on pad and drvdn */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
assert(pmux_pad_drv_isvalid(drvdn));
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (drvdn == PGRP_DRVDN_NONE)
|
||||
return 0;
|
||||
|
||||
reg = readl(pad_drvdn);
|
||||
reg &= ~PGRP_DRVDN_MASK;
|
||||
reg |= (drvdn << PGRP_DRVDN_SHIFT);
|
||||
writel(reg, pad_drvdn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int padgrp_set_lpmd(enum pdrive_pingrp pad, enum pgrp_lpmd lpmd)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_lpmd = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check pad and lpmd value */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
assert(pmux_pad_lpmd_isvalid(lpmd));
|
||||
|
||||
/* NONE means unspecified/do not change/use POR value */
|
||||
if (lpmd == PGRP_LPMD_NONE)
|
||||
return 0;
|
||||
|
||||
reg = readl(pad_lpmd);
|
||||
reg &= ~PGRP_LPMD_MASK;
|
||||
reg |= (lpmd << PGRP_LPMD_SHIFT);
|
||||
writel(reg, pad_lpmd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int padgrp_set_schmt(enum pdrive_pingrp pad, enum pgrp_schmt schmt)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_schmt = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check pad */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
|
||||
reg = readl(pad_schmt);
|
||||
reg &= ~(1 << PGRP_SCHMT_SHIFT);
|
||||
if (schmt == PGRP_SCHMT_ENABLE)
|
||||
reg |= (0x1 << PGRP_SCHMT_SHIFT);
|
||||
writel(reg, pad_schmt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int padgrp_set_hsm(enum pdrive_pingrp pad,
|
||||
enum pgrp_hsm hsm)
|
||||
{
|
||||
struct pmux_tri_ctlr *pmt =
|
||||
(struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
|
||||
u32 *pad_hsm = &pmt->pmt_drive[pad];
|
||||
u32 reg;
|
||||
|
||||
/* Error check pad */
|
||||
assert(pmux_padgrp_isvalid(pad));
|
||||
|
||||
reg = readl(pad_hsm);
|
||||
reg &= ~(1 << PGRP_HSM_SHIFT);
|
||||
if (hsm == PGRP_HSM_ENABLE)
|
||||
reg |= (0x1 << PGRP_HSM_SHIFT);
|
||||
writel(reg, pad_hsm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void padctrl_config_pingroup(struct padctrl_config *config)
|
||||
{
|
||||
enum pdrive_pingrp pad = config->padgrp;
|
||||
|
||||
padgrp_set_drvup_slwf(pad, config->slwf);
|
||||
padgrp_set_drvdn_slwr(pad, config->slwr);
|
||||
padgrp_set_drvup(pad, config->drvup);
|
||||
padgrp_set_drvdn(pad, config->drvdn);
|
||||
padgrp_set_lpmd(pad, config->lpmd);
|
||||
padgrp_set_schmt(pad, config->schmt);
|
||||
padgrp_set_hsm(pad, config->hsm);
|
||||
}
|
||||
|
||||
void padgrp_config_table(struct padctrl_config *config, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
padctrl_config_pingroup(&config[i]);
|
||||
}
|
||||
const struct pmux_pingrp_desc *tegra_soc_pingroups = tegra30_pingroups;
|
||||
|
||||
@@ -18,6 +18,7 @@ SECTIONS
|
||||
.text :
|
||||
{
|
||||
__image_copy_start = .;
|
||||
*(.vectors)
|
||||
CPUDIR/start.o (.text*)
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ SECTIONS
|
||||
.text :
|
||||
{
|
||||
*(.__image_copy_start)
|
||||
*(.vectors)
|
||||
CPUDIR/start.o (.text*)
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
|
||||
tegra30-cardhu.dtb \
|
||||
tegra30-tec-ng.dtb \
|
||||
tegra114-dalmore.dtb \
|
||||
tegra124-jetson-tk1.dtb \
|
||||
tegra124-venice2.dtb
|
||||
dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \
|
||||
zynq-zc706.dtb \
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x2008002 0>;
|
||||
cd-gpios = <&gpio 0xA2 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 0x2008002 0>;
|
||||
pwr-gpios = <&gpio 0xA2 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
@@ -111,10 +111,10 @@
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x20c6004 0>;
|
||||
cd-gpios = <&gpio 0x39C 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 0x2008002 0>;
|
||||
pwr-gpios = <&gpio 0xA2 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
@@ -34,7 +34,7 @@
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x20c6004 0>;
|
||||
cd-gpios = <&gpio 0x39C 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user