Compare commits
903 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30f1806f60 | ||
|
|
5b464c289b | ||
|
|
db695b7851 | ||
|
|
2b3e7e61d6 | ||
|
|
cc3843e364 | ||
|
|
8d4f4a838d | ||
|
|
c6fe4dabac | ||
|
|
76babc8657 | ||
|
|
210ed2004e | ||
|
|
46cb5074a3 | ||
|
|
78a90f827d | ||
|
|
58f3c57c60 | ||
|
|
d75469d48c | ||
|
|
377151c817 | ||
|
|
1ac14d8ea8 | ||
|
|
82afabfeb8 | ||
|
|
e492c90c26 | ||
|
|
270fe261b7 | ||
|
|
f30b6154f1 | ||
|
|
772003e439 | ||
|
|
fc84a8495a | ||
|
|
848e03110c | ||
|
|
bd4458cb47 | ||
|
|
d8ab58b212 | ||
|
|
218892d12a | ||
|
|
334fb53514 | ||
|
|
6bc113886d | ||
|
|
a30a549a35 | ||
|
|
a4475386ce | ||
|
|
e85e2fa85e | ||
|
|
384faaafb9 | ||
|
|
f9301e1cda | ||
|
|
dfece95005 | ||
|
|
74eb022259 | ||
|
|
491fb6dea9 | ||
|
|
42ba58e0c3 | ||
|
|
84d0c2f1e3 | ||
|
|
32bf3d143a | ||
|
|
5b0b2b6fc9 | ||
|
|
91c82076ae | ||
|
|
8ce4e5c2c0 | ||
|
|
661bad63a0 | ||
|
|
76957cb3d6 | ||
|
|
118978c8eb | ||
|
|
ce1120dd70 | ||
|
|
5013c09f7a | ||
|
|
ffda586fc1 | ||
|
|
f655adef65 | ||
|
|
093e14c522 | ||
|
|
5f91db7f58 | ||
|
|
44b4dbed41 | ||
|
|
a8b7e47625 | ||
|
|
4fae35a53b | ||
|
|
60ec654c5e | ||
|
|
c313b2c6c5 | ||
|
|
24ae0d1728 | ||
|
|
2f6e76d23c | ||
|
|
44ceec253e | ||
|
|
f3a329acb2 | ||
|
|
217bf6b6a3 | ||
|
|
5599c28cef | ||
|
|
c9bcf75fec | ||
|
|
f8fa6368a6 | ||
|
|
2b22fa4bae | ||
|
|
534ea6b6f8 | ||
|
|
21fae8b2b4 | ||
|
|
347b7938d3 | ||
|
|
495d162374 | ||
|
|
33fa5c0bfa | ||
|
|
64cd594e62 | ||
|
|
14e099e698 | ||
|
|
724902c846 | ||
|
|
4cd288b589 | ||
|
|
b29661fc11 | ||
|
|
00b48a4842 | ||
|
|
b075d74efb | ||
|
|
208acd112e | ||
|
|
495a0dde7f | ||
|
|
e682ba399a | ||
|
|
02409f8cf5 | ||
|
|
e5084af8de | ||
|
|
d01b847c5c | ||
|
|
5a910c224b | ||
|
|
79eac2bfb5 | ||
|
|
2e721094a7 | ||
|
|
bc77881247 | ||
|
|
6a2dcaf1ee | ||
|
|
45d65b7f28 | ||
|
|
239c885802 | ||
|
|
55c802ebb1 | ||
|
|
5a9abcc317 | ||
|
|
81d93e5c4b | ||
|
|
755c35f54b | ||
|
|
16fe77752e | ||
|
|
019895a8de | ||
|
|
98ba144ccc | ||
|
|
e845e07e1e | ||
|
|
beeccf7a5d | ||
|
|
edfed1d91d | ||
|
|
f65c98129c | ||
|
|
1ba639da56 | ||
|
|
e7a85f2683 | ||
|
|
928d1d77f8 | ||
|
|
d5908b0939 | ||
|
|
a551cee99a | ||
|
|
cb06eb961b | ||
|
|
4d264eff43 | ||
|
|
c54f9263e4 | ||
|
|
975a083a5e | ||
|
|
13f5433f70 | ||
|
|
04efddc87c | ||
|
|
83d1b38766 | ||
|
|
b6f29c84c2 | ||
|
|
0937b8d869 | ||
|
|
64d792063f | ||
|
|
375c4353db | ||
|
|
b738654d3c | ||
|
|
ef5b4f221c | ||
|
|
74973126d1 | ||
|
|
8cc10d06b8 | ||
|
|
214398d9cb | ||
|
|
5db6138565 | ||
|
|
30c6a241e8 | ||
|
|
5561857aae | ||
|
|
faf8f9bc95 | ||
|
|
d7d9afa48c | ||
|
|
ae92069abe | ||
|
|
e42d2b0479 | ||
|
|
45da195cf6 | ||
|
|
67a4389e39 | ||
|
|
f33e9653c9 | ||
|
|
e5c6f9f8be | ||
|
|
1b8607e1f7 | ||
|
|
4124382de0 | ||
|
|
6f4abee789 | ||
|
|
94a78da26c | ||
|
|
ae91a8055c | ||
|
|
9e04a81388 | ||
|
|
a4d60bb917 | ||
|
|
32c70d3420 | ||
|
|
e4992f1252 | ||
|
|
a4f762a994 | ||
|
|
edc886fc3d | ||
|
|
92915741fc | ||
|
|
43157747fe | ||
|
|
d9da0a394a | ||
|
|
7e30f5eac7 | ||
|
|
6f99eec3dc | ||
|
|
f6921e3dc3 | ||
|
|
0ec7a061fb | ||
|
|
208447f8e9 | ||
|
|
1f780aa6f1 | ||
|
|
943afa229c | ||
|
|
b931b3a9c3 | ||
|
|
38cc09c55b | ||
|
|
0bc9efada1 | ||
|
|
e7670f6c1e | ||
|
|
3c234efa69 | ||
|
|
dd24058407 | ||
|
|
26c7bab81e | ||
|
|
751b9b5189 | ||
|
|
21f6f9636f | ||
|
|
f57d7d364c | ||
|
|
746c4b9490 | ||
|
|
3f2ac8f928 | ||
|
|
3f2175fa84 | ||
|
|
f90e69c634 | ||
|
|
6523010702 | ||
|
|
6d0943a6be | ||
|
|
ea8d989f4e | ||
|
|
9604b6e53d | ||
|
|
64e8a06af6 | ||
|
|
7263ef191b | ||
|
|
6afcabf11d | ||
|
|
fefb6c1092 | ||
|
|
fa506a926c | ||
|
|
20b197c6f2 | ||
|
|
d49fe4bed5 | ||
|
|
a6cdd21b56 | ||
|
|
ea686f52e4 | ||
|
|
f4e7cbfcb0 | ||
|
|
b7f6193e76 | ||
|
|
29e3500cbc | ||
|
|
d1bcf9e53b | ||
|
|
fe891ecf4d | ||
|
|
88f72527f5 | ||
|
|
6d1b6f9f89 | ||
|
|
161b2af4d7 | ||
|
|
1b76988175 | ||
|
|
0c9d42e6b0 | ||
|
|
3cfb0c51b2 | ||
|
|
c77ce474b1 | ||
|
|
d9ad115bbf | ||
|
|
ccd6e1464e | ||
|
|
d075eec500 | ||
|
|
10bbb38a40 | ||
|
|
4c309625e7 | ||
|
|
ac2731f185 | ||
|
|
c62776be8d | ||
|
|
73bf1e2de7 | ||
|
|
69018ce2e0 | ||
|
|
37e3c62fa0 | ||
|
|
ac9152830d | ||
|
|
de55d18df3 | ||
|
|
cd9cb62f9d | ||
|
|
8dafa87476 | ||
|
|
ed2cf548ca | ||
|
|
d38da53794 | ||
|
|
61151cccb6 | ||
|
|
b2e1d5b644 | ||
|
|
8269ab5360 | ||
|
|
2bcacc2d84 | ||
|
|
9856a6b310 | ||
|
|
30942b18b6 | ||
|
|
b58d8b48e2 | ||
|
|
94a91e248b | ||
|
|
b779f7a595 | ||
|
|
cc2977acc3 | ||
|
|
d0b01a246d | ||
|
|
4c727c77e4 | ||
|
|
6b9097e5e7 | ||
|
|
97c26e006d | ||
|
|
0858b835e7 | ||
|
|
8dc48d71a4 | ||
|
|
0003613e3c | ||
|
|
60fa72d656 | ||
|
|
d4d7730853 | ||
|
|
6cfcce6767 | ||
|
|
bf53974c2d | ||
|
|
24e02d0fd3 | ||
|
|
4c58eb5552 | ||
|
|
32a9f5f216 | ||
|
|
4087bc88ce | ||
|
|
b45264ee85 | ||
|
|
a93907c43f | ||
|
|
e56b4b494c | ||
|
|
7ec8bb15ee | ||
|
|
16158778b5 | ||
|
|
a7c185ed3d | ||
|
|
a25f72f1f7 | ||
|
|
be19bd5cd0 | ||
|
|
a41dbbd98d | ||
|
|
f7ad79b6f9 | ||
|
|
ff02f13980 | ||
|
|
e1d1429b49 | ||
|
|
28d77d968b | ||
|
|
4fedfddf97 | ||
|
|
2c5260f711 | ||
|
|
481f28b1db | ||
|
|
c95219fae2 | ||
|
|
96bbfa1e66 | ||
|
|
60c1b95aab | ||
|
|
7047b38887 | ||
|
|
a877004d44 | ||
|
|
8931ab1760 | ||
|
|
63f732d3d3 | ||
|
|
0dc1fc22af | ||
|
|
98b742489c | ||
|
|
4f93f8b1a4 | ||
|
|
ddcebcb638 | ||
|
|
9cd32426f2 | ||
|
|
713d818664 | ||
|
|
031976f636 | ||
|
|
4933b91f8a | ||
|
|
1a41f7ce9c | ||
|
|
33dac03b1b | ||
|
|
060193e4c3 | ||
|
|
40dcd6aa75 | ||
|
|
f10d7b9454 | ||
|
|
f58934551e | ||
|
|
b0e49b4cd8 | ||
|
|
351080e2e8 | ||
|
|
a6dff77c2d | ||
|
|
8d54477b9b | ||
|
|
865f0f9754 | ||
|
|
e57ed96bac | ||
|
|
2468592d79 | ||
|
|
8f00731818 | ||
|
|
ed3afca32e | ||
|
|
39166b5c9e | ||
|
|
cfe5ca7797 | ||
|
|
922ff465cc | ||
|
|
6b44394442 | ||
|
|
e006927a0b | ||
|
|
799891ef7b | ||
|
|
66a4344a4d | ||
|
|
bc24345e41 | ||
|
|
aebf00fc4d | ||
|
|
ea99e8f05b | ||
|
|
3d9f3bfb7a | ||
|
|
96bd462942 | ||
|
|
a1cf027a08 | ||
|
|
63ebcc4615 | ||
|
|
6ea66a818d | ||
|
|
57a127201e | ||
|
|
1aee111135 | ||
|
|
777d1abd97 | ||
|
|
72f56adc0b | ||
|
|
ce09fc49b5 | ||
|
|
11865ea844 | ||
|
|
4621fc3fe7 | ||
|
|
570c0186ae | ||
|
|
e2756f4b54 | ||
|
|
c875810279 | ||
|
|
1552af70ec | ||
|
|
397b7b81a1 | ||
|
|
aa5f1f9dc8 | ||
|
|
1ac559d4aa | ||
|
|
320d61991f | ||
|
|
2e72ad0644 | ||
|
|
d2b1649348 | ||
|
|
d9aae62609 | ||
|
|
7af7751d04 | ||
|
|
2956acd5ef | ||
|
|
d59feffb42 | ||
|
|
6bee764bd6 | ||
|
|
80ddd22626 | ||
|
|
04a9e1180a | ||
|
|
a8cb43a89b | ||
|
|
9cfff9e9d4 | ||
|
|
3259eeaa41 | ||
|
|
e169257732 | ||
|
|
ba52be3d0e | ||
|
|
55ed1516cb | ||
|
|
055606bd25 | ||
|
|
69b0634a4e | ||
|
|
efeff5382b | ||
|
|
4371090e5d | ||
|
|
4bd5036e60 | ||
|
|
1a3ac86b79 | ||
|
|
15a08bc2be | ||
|
|
f188896c2f | ||
|
|
ac331da07d | ||
|
|
334e442e6f | ||
|
|
7dc358bb0d | ||
|
|
3b558e26a5 | ||
|
|
74121b470c | ||
|
|
143b518d91 | ||
|
|
818218bac6 | ||
|
|
ff4681c928 | ||
|
|
73aa9ac2b4 | ||
|
|
0db37dc2ee | ||
|
|
219a81b98d | ||
|
|
80d0b6a149 | ||
|
|
0f7a3dc95c | ||
|
|
8716318057 | ||
|
|
44a23cfd63 | ||
|
|
be88b16998 | ||
|
|
c8c41d4a80 | ||
|
|
54a5070115 | ||
|
|
4d3521cc79 | ||
|
|
572b13afc4 | ||
|
|
45f2166ac0 | ||
|
|
e2b159d007 | ||
|
|
2cfaa1aa1a | ||
|
|
7232a2724c | ||
|
|
4bcae9c92a | ||
|
|
83d40dfd79 | ||
|
|
bed8ce838a | ||
|
|
0764c164fe | ||
|
|
7f52fa3c2d | ||
|
|
b8f4162a4f | ||
|
|
c2f896b8fc | ||
|
|
96a236746f | ||
|
|
d1276c76c1 | ||
|
|
18ee320ff6 | ||
|
|
84a3047b72 | ||
|
|
ee62ed3286 | ||
|
|
55fe7c57a8 | ||
|
|
e715888010 | ||
|
|
4c9e98ace7 | ||
|
|
5e918a98c2 | ||
|
|
9e89647889 | ||
|
|
16c3cde050 | ||
|
|
ad8f8687b7 | ||
|
|
7c2221eb23 | ||
|
|
711a794627 | ||
|
|
363eea9ff7 | ||
|
|
f09880ea72 | ||
|
|
2b4c952be7 | ||
|
|
e1d8ed2c08 | ||
|
|
b5cdd7df4a | ||
|
|
8bd522ce4a | ||
|
|
b05884efa6 | ||
|
|
9b958234b0 | ||
|
|
cd9d23053d | ||
|
|
6cb2239ae7 | ||
|
|
83a49c8dd7 | ||
|
|
4b3cc6ece9 | ||
|
|
8d99cd0691 | ||
|
|
2465665b73 | ||
|
|
58d204256c | ||
|
|
66ffb1883f | ||
|
|
2b4f778fe9 | ||
|
|
f91d7ae5ca | ||
|
|
76e49aa7fb | ||
|
|
63a11be683 | ||
|
|
db3995fe51 | ||
|
|
dcd99e88e0 | ||
|
|
c0a04d9373 | ||
|
|
b2b5e2bb78 | ||
|
|
7c10c57275 | ||
|
|
f9913a8ee7 | ||
|
|
9adfc9fb9a | ||
|
|
17bef68097 | ||
|
|
5dd372a23d | ||
|
|
06c428bcd4 | ||
|
|
a0dd99d51e | ||
|
|
f43ad53908 | ||
|
|
8d103071b7 | ||
|
|
51b67d06fa | ||
|
|
dd531aac34 | ||
|
|
89967841e3 | ||
|
|
6d714f82fb | ||
|
|
6eb3fb1558 | ||
|
|
1a0a7ced39 | ||
|
|
0a1e03bcad | ||
|
|
8225d1e3ac | ||
|
|
8d79953d03 | ||
|
|
2b2f43ed6a | ||
|
|
08e99e1dd0 | ||
|
|
ae6d1056d2 | ||
|
|
e343ab83d5 | ||
|
|
f2b6f46106 | ||
|
|
2ad4d3999f | ||
|
|
00ac50e348 | ||
|
|
632de0672d | ||
|
|
0df6b8446c | ||
|
|
64134f0112 | ||
|
|
3afac79ec2 | ||
|
|
5e8def6731 | ||
|
|
5d49e0e152 | ||
|
|
66a9455b6b | ||
|
|
281ff9a45c | ||
|
|
a10ff91961 | ||
|
|
f6db945649 | ||
|
|
fa05664cd8 | ||
|
|
5fb2b2342e | ||
|
|
6341d9d723 | ||
|
|
3bb77fb09a | ||
|
|
5ba7390c3c | ||
|
|
5aa437baae | ||
|
|
ac9db066b2 | ||
|
|
b423d055cc | ||
|
|
381e4e6397 | ||
|
|
bf05293973 | ||
|
|
92fa37eac5 | ||
|
|
efc6f447c1 | ||
|
|
34d51566bc | ||
|
|
c08ba67722 | ||
|
|
14c14db193 | ||
|
|
3709898b3a | ||
|
|
8aadd2d0c4 | ||
|
|
0ec595243d | ||
|
|
bed53753dd | ||
|
|
20c450ef61 | ||
|
|
d5a163d6ba | ||
|
|
d610a60730 | ||
|
|
ff41ffc93c | ||
|
|
e3edcb36f1 | ||
|
|
061aad4d32 | ||
|
|
ded08317ad | ||
|
|
7e74d63d1a | ||
|
|
6f3931a2be | ||
|
|
ec2638ea08 | ||
|
|
c86ef2cd9e | ||
|
|
2c5b48fc20 | ||
|
|
fab6f556bb | ||
|
|
b3d2cde7a3 | ||
|
|
977b57583a | ||
|
|
bb66f56136 | ||
|
|
b830b7f163 | ||
|
|
4d332dbeb0 | ||
|
|
6d8184b00c | ||
|
|
252f60b068 | ||
|
|
422b1a0160 | ||
|
|
d3a6532cbe | ||
|
|
694976afa5 | ||
|
|
17a41e4492 | ||
|
|
80adb27616 | ||
|
|
890dfef06c | ||
|
|
b8ec238503 | ||
|
|
b009f3eca9 | ||
|
|
b964e9368f | ||
|
|
7bd6104b71 | ||
|
|
9e3ed392d2 | ||
|
|
11c45ebd46 | ||
|
|
64d4bcb087 | ||
|
|
ad162249cb | ||
|
|
2146cf5682 | ||
|
|
1d47273d46 | ||
|
|
02df4a270f | ||
|
|
fc16904ce1 | ||
|
|
ecc198c9b9 | ||
|
|
808da52f62 | ||
|
|
6636b62a6e | ||
|
|
cc557950f7 | ||
|
|
7ca9051348 | ||
|
|
4785a694c0 | ||
|
|
10c7382bc5 | ||
|
|
7817cb2083 | ||
|
|
a9b410dc7d | ||
|
|
01c687aa6e | ||
|
|
b9173af73e | ||
|
|
3b93020d74 | ||
|
|
500856eb17 | ||
|
|
fe8dd0b222 | ||
|
|
26a41790f8 | ||
|
|
1df170f8b2 | ||
|
|
c9974ab0a4 | ||
|
|
6007f3251c | ||
|
|
fc6414eca5 | ||
|
|
38d299c2db | ||
|
|
883e3925d9 | ||
|
|
43ef1c381f | ||
|
|
d197ffd817 | ||
|
|
6a5e1d75bf | ||
|
|
58694f9709 | ||
|
|
6a40ef62c4 | ||
|
|
07eb02687f | ||
|
|
c26acc1a43 | ||
|
|
437fc7327f | ||
|
|
3bff4ffa33 | ||
|
|
21d39d598c | ||
|
|
0133502e39 | ||
|
|
95c6bc7d4a | ||
|
|
1208a2dfde | ||
|
|
d16471ee05 | ||
|
|
62d4f43653 | ||
|
|
f540c42d95 | ||
|
|
23d0baf967 | ||
|
|
23776ff292 | ||
|
|
7b74ebe723 | ||
|
|
a2df4da31b | ||
|
|
435dc8fcdb | ||
|
|
2eb6e01049 | ||
|
|
d2ba6bd8f4 | ||
|
|
0b4f579230 | ||
|
|
c1d1633409 | ||
|
|
1466ef8db5 | ||
|
|
b2e2142c50 | ||
|
|
8f24e0637a | ||
|
|
1754f50b71 | ||
|
|
e02c521d94 | ||
|
|
0ddb89601a | ||
|
|
32d6f1bc09 | ||
|
|
46f6e50190 | ||
|
|
64b3727b97 | ||
|
|
1f84021a85 | ||
|
|
6e9233d30a | ||
|
|
580d1d3186 | ||
|
|
ff5fb8a6cc | ||
|
|
7d5d756331 | ||
|
|
c83d7ca4da | ||
|
|
6de66b3542 | ||
|
|
ad3006fe7e | ||
|
|
aec7135bc3 | ||
|
|
9d4450b5ad | ||
|
|
b60af3d4c1 | ||
|
|
238cb7a423 | ||
|
|
ea6d8be153 | ||
|
|
22fb2246df | ||
|
|
802b769bac | ||
|
|
74ac5facb9 | ||
|
|
6775c68683 | ||
|
|
94fab25f5f | ||
|
|
b3458d2cd5 | ||
|
|
5b8bc606c6 | ||
|
|
e496865ecc | ||
|
|
2408b3f20b | ||
|
|
27a256a90c | ||
|
|
a1e1ac8492 | ||
|
|
ccf21c311e | ||
|
|
e6af9932d3 | ||
|
|
f602082b4b | ||
|
|
c16e44fa83 | ||
|
|
921d4b19ad | ||
|
|
24f868433b | ||
|
|
22b448dbfb | ||
|
|
b21add4b42 | ||
|
|
f8900ce909 | ||
|
|
19580e660c | ||
|
|
555da61702 | ||
|
|
03051c3d35 | ||
|
|
651d96f7e4 | ||
|
|
b2893e1fcb | ||
|
|
207f83f102 | ||
|
|
4985ca5af3 | ||
|
|
e05329516a | ||
|
|
6399b23d60 | ||
|
|
5ba576c016 | ||
|
|
845c6c95db | ||
|
|
49db47b8ae | ||
|
|
34065a2ce0 | ||
|
|
9ac6b6f3d3 | ||
|
|
fe9c26b330 | ||
|
|
0ddd969aec | ||
|
|
b05e8bf58b | ||
|
|
5ab884b254 | ||
|
|
196404cdc1 | ||
|
|
ef16fccf96 | ||
|
|
62cc3951ab | ||
|
|
ce3902e176 | ||
|
|
8b0c5c1276 | ||
|
|
505be87a65 | ||
|
|
5ca2d0953e | ||
|
|
f85b607105 | ||
|
|
5c740711f0 | ||
|
|
61d3421bde | ||
|
|
ea9f7395ec | ||
|
|
2c3536425d | ||
|
|
ce37422d00 | ||
|
|
1182e9f8e3 | ||
|
|
1aaab9bfae | ||
|
|
47cc23cbe9 | ||
|
|
8f8b52ea5b | ||
|
|
3dfd708cc1 | ||
|
|
d2995fe392 | ||
|
|
feaa43f3a8 | ||
|
|
e174ac34ad | ||
|
|
8ba132cab1 | ||
|
|
407843a582 | ||
|
|
72c5d52aed | ||
|
|
f6e0f1f618 | ||
|
|
77660c4b59 | ||
|
|
b56bd0fcfc | ||
|
|
c05569066d | ||
|
|
bec9264616 | ||
|
|
fb83a65c60 | ||
|
|
bb701283a8 | ||
|
|
b568fd2557 | ||
|
|
c591dffe0c | ||
|
|
87dc096829 | ||
|
|
8eb52d5d98 | ||
|
|
aba19604d8 | ||
|
|
8a24a69630 | ||
|
|
c46f53333b | ||
|
|
c348578bf6 | ||
|
|
9e2c347151 | ||
|
|
1261827868 | ||
|
|
d3471173e1 | ||
|
|
c68f59fe3e | ||
|
|
0d9cdeac1d | ||
|
|
2e583d6c81 | ||
|
|
42d55ea0bd | ||
|
|
d91722102c | ||
|
|
b0265b576b | ||
|
|
bf8324e4a5 | ||
|
|
328a340392 | ||
|
|
7812bc4a2e | ||
|
|
42ed33ffe1 | ||
|
|
85dc2a7f82 | ||
|
|
052440b022 | ||
|
|
a724a9b40c | ||
|
|
454a6cf8d4 | ||
|
|
c29d2d3680 | ||
|
|
ba79fde58a | ||
|
|
871e6ce188 | ||
|
|
136288847e | ||
|
|
0dc80e2759 | ||
|
|
0dcfe3a225 | ||
|
|
33ed73bc0e | ||
|
|
e318d9e902 | ||
|
|
11d9eec479 | ||
|
|
22d1a56cbf | ||
|
|
b988b8cd44 | ||
|
|
492c704986 | ||
|
|
dabad4b9bc | ||
|
|
61fb15c516 | ||
|
|
6e1bbe6e3e | ||
|
|
81b38be863 | ||
|
|
58bbc77eb0 | ||
|
|
f77ac3d657 | ||
|
|
3f523edb14 | ||
|
|
bd878eb024 | ||
|
|
467bcee11f | ||
|
|
0ddf06ddf6 | ||
|
|
e23741f4a6 | ||
|
|
df9c25ea04 | ||
|
|
acac475212 | ||
|
|
9570bcd87f | ||
|
|
09ea0de03d | ||
|
|
c81cbbad21 | ||
|
|
64ff2357b1 | ||
|
|
667568db15 | ||
|
|
5fee84a794 | ||
|
|
36f28f8a96 | ||
|
|
4d5fa99c73 | ||
|
|
8697e6a19b | ||
|
|
a449c500b1 | ||
|
|
12d30aa797 | ||
|
|
4d7d6936eb | ||
|
|
cdbaefb5f5 | ||
|
|
812711ce6b | ||
|
|
be60a9021c | ||
|
|
3055793bcb | ||
|
|
7e5b9b4715 | ||
|
|
42026c9cb3 | ||
|
|
8ff3de61fc | ||
|
|
82ac8c9714 | ||
|
|
d435793229 | ||
|
|
22abb2d2ea | ||
|
|
415a613bab | ||
|
|
c2d943ffbf | ||
|
|
870ceac5b3 | ||
|
|
acbca876fb | ||
|
|
a853d56c59 | ||
|
|
04db400892 | ||
|
|
2714223f8e | ||
|
|
c480861bf0 | ||
|
|
1563f56e0c | ||
|
|
b90d254976 | ||
|
|
0fd5ec66b1 | ||
|
|
5ce715802f | ||
|
|
aafeefbdb8 | ||
|
|
f59b55a5b8 | ||
|
|
50c03c8cf4 | ||
|
|
addce57e2e | ||
|
|
f852ce72f1 | ||
|
|
3b9abdc448 | ||
|
|
8809a2713b | ||
|
|
9caeaadf50 | ||
|
|
7cfc12a7dc | ||
|
|
9692c2734a | ||
|
|
81b20ccc2d | ||
|
|
c01b17dd85 | ||
|
|
246d4ae6bc | ||
|
|
151c8b09b3 | ||
|
|
3c9272813f | ||
|
|
9c9109e7fc | ||
|
|
d88e7ba098 | ||
|
|
28f384b171 | ||
|
|
f743931f9b | ||
|
|
29592ecba3 | ||
|
|
749ae4c697 | ||
|
|
521dcd30b9 | ||
|
|
41be969f49 | ||
|
|
cf5933ba1e | ||
|
|
a27044b14a | ||
|
|
a90921f71d | ||
|
|
8d4f040a3c | ||
|
|
e15e33433e | ||
|
|
260eea5676 | ||
|
|
aa9c4f1d22 | ||
|
|
c714437342 | ||
|
|
130080874a | ||
|
|
33ecdc2f9d | ||
|
|
febd86b969 | ||
|
|
7fc792895b | ||
|
|
83c5c9b71b | ||
|
|
8be7609036 | ||
|
|
88fed9a120 | ||
|
|
a5f601fd1b | ||
|
|
fe08fb6580 | ||
|
|
3deca9d447 | ||
|
|
a340c325e6 | ||
|
|
63362cfc6b | ||
|
|
ca1ce22628 | ||
|
|
87ddedd6ad | ||
|
|
59829cc189 | ||
|
|
318c0b9043 | ||
|
|
33daf5b785 | ||
|
|
0c698dcaa7 | ||
|
|
f868cc5a50 | ||
|
|
16b195c82a | ||
|
|
e455866629 | ||
|
|
1378df792a | ||
|
|
2439e4bfa1 | ||
|
|
352d259130 | ||
|
|
7364621718 | ||
|
|
93a686ee9c | ||
|
|
cfa4c9d899 | ||
|
|
9162352817 | ||
|
|
9eb77cea1f | ||
|
|
ab544633ab | ||
|
|
dbaf07ce62 | ||
|
|
8d04f02f62 | ||
|
|
e93becf80d | ||
|
|
f738b4a759 | ||
|
|
a3c2933e02 | ||
|
|
98e2867cc8 | ||
|
|
ed1353d74b | ||
|
|
4a43719a77 | ||
|
|
2f155f6c0a | ||
|
|
68b88999da | ||
|
|
74f89faa9d | ||
|
|
890e9413c0 | ||
|
|
080c646dbf | ||
|
|
f92edbd8a0 | ||
|
|
653811a3c2 | ||
|
|
9ea61b5796 | ||
|
|
efe33035ac | ||
|
|
f31d38b9ee | ||
|
|
ecdcbd4f8c | ||
|
|
4d4faae65e | ||
|
|
5798f87dc1 | ||
|
|
df58c81551 | ||
|
|
5dbb6ed622 | ||
|
|
ec00c76de0 | ||
|
|
754f230aa0 | ||
|
|
f0037c56b0 | ||
|
|
1b4aaffe4f | ||
|
|
c9672f81f1 | ||
|
|
aee747f19b | ||
|
|
8ada0ebf38 | ||
|
|
5e71c51d74 | ||
|
|
5fb6d7191e | ||
|
|
f23cb34c36 | ||
|
|
2ae64f5135 | ||
|
|
2db916e144 | ||
|
|
dd28e10d94 | ||
|
|
1d8a49eca1 | ||
|
|
7d0a4066b5 | ||
|
|
2d14684341 | ||
|
|
9be659ac08 | ||
|
|
fbde2169d2 | ||
|
|
5ca9881aad | ||
|
|
b53313dbfc | ||
|
|
c7f69c3402 | ||
|
|
f1cd7aabbb | ||
|
|
b0a41a1184 | ||
|
|
59e7965922 | ||
|
|
070ba56115 | ||
|
|
a877880c69 | ||
|
|
52e5ddfecd | ||
|
|
1815338fbd | ||
|
|
761421ccca | ||
|
|
f3bceaab23 | ||
|
|
9f23ca334a | ||
|
|
a8318ec205 | ||
|
|
9c84709eed | ||
|
|
607b3ae27e | ||
|
|
654f38b3a3 | ||
|
|
3d6cb3b24a | ||
|
|
3cac27c1d4 | ||
|
|
5d96d40d3f | ||
|
|
ea2e142843 | ||
|
|
3db93b8bed | ||
|
|
f71b2888b4 | ||
|
|
a268590406 | ||
|
|
ff768cb168 | ||
|
|
483e09a223 | ||
|
|
d25dfe08fb | ||
|
|
9b94ac61d2 | ||
|
|
06713773da | ||
|
|
6fa397df67 | ||
|
|
1338e6a818 | ||
|
|
2d83476a4c | ||
|
|
7d47cee2cc | ||
|
|
f10493c6d7 | ||
|
|
353f2688b4 | ||
|
|
9f798766aa | ||
|
|
afe9fa59cb | ||
|
|
3248f63ad8 | ||
|
|
e61cb8163a | ||
|
|
882ae41274 | ||
|
|
ad31e40bed | ||
|
|
764e7417ee | ||
|
|
211ea91ac6 | ||
|
|
fa8aea2045 | ||
|
|
837c730b4d | ||
|
|
758c037aee | ||
|
|
087dfdb79b | ||
|
|
770c7af580 | ||
|
|
f6ba9b5660 | ||
|
|
c36c681603 | ||
|
|
5cb4af4791 | ||
|
|
d4cb2d1794 | ||
|
|
fd671802b6 | ||
|
|
4994ffd890 | ||
|
|
db3232ddb0 | ||
|
|
1941cce71b | ||
|
|
566806ca1a | ||
|
|
dbbd125721 | ||
|
|
1d7b874e9c | ||
|
|
4f14ed6230 | ||
|
|
a424a8bb29 | ||
|
|
4f2e92c11f | ||
|
|
19e93b1e16 | ||
|
|
ff68f66bcb | ||
|
|
97923770cb | ||
|
|
4dbee8a90d | ||
|
|
6d95289281 | ||
|
|
3048bcbf0b | ||
|
|
94276eb0a7 | ||
|
|
03d344bb6a | ||
|
|
026f711068 | ||
|
|
c7c6da2302 | ||
|
|
245a362ad3 | ||
|
|
b5af773f8d | ||
|
|
85ac988e86 | ||
|
|
3c89d75409 | ||
|
|
9553df86d3 | ||
|
|
3dd2db53ce | ||
|
|
eda3e1e661 | ||
|
|
d91ea45d15 | ||
|
|
6c0bbdccd3 | ||
|
|
047375bfa4 | ||
|
|
516ad760db | ||
|
|
b02bad1286 | ||
|
|
b8685affe6 | ||
|
|
69df3c4da0 | ||
|
|
0b135cfc2e |
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#
|
||||||
|
# NOTE! Don't add files that are generated in specific
|
||||||
|
# subdirectories here. Add them in the ".gitignore" file
|
||||||
|
# in that subdirectory instead.
|
||||||
|
#
|
||||||
|
# Normal rules
|
||||||
|
#
|
||||||
|
|
||||||
|
*.rej
|
||||||
|
*.orig
|
||||||
|
*.a
|
||||||
|
*.o
|
||||||
|
*~
|
||||||
|
|
||||||
|
#
|
||||||
|
# Top-level generic files
|
||||||
|
#
|
||||||
|
|
||||||
|
/System.map
|
||||||
|
/u-boot
|
||||||
|
/u-boot.hex
|
||||||
|
/u-boot.map
|
||||||
|
/u-boot.bin
|
||||||
|
/u-boot.srec
|
||||||
|
/u-boot.ldr
|
||||||
|
/u-boot.ldr.hex
|
||||||
|
/u-boot.ldr.srec
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generated files
|
||||||
|
#
|
||||||
|
|
||||||
|
*.depend
|
||||||
|
/LOG
|
||||||
|
/errlog
|
||||||
|
/reloc_off
|
||||||
|
|
||||||
|
# stgit generated dirs
|
||||||
|
patches-*
|
||||||
|
|
||||||
|
# quilt's files
|
||||||
|
patches
|
||||||
|
series
|
||||||
|
|
||||||
|
# cscope files
|
||||||
|
cscope.*
|
||||||
37
CREDITS
37
CREDITS
@@ -117,7 +117,7 @@ N: Arun Dharankar
|
|||||||
E: ADharankar@ATTBI.Com
|
E: ADharankar@ATTBI.Com
|
||||||
D: threads / scheduler example code
|
D: threads / scheduler example code
|
||||||
|
|
||||||
N: K<EFBFBD>ri Dav<EFBFBD><EFBFBD>sson
|
N: K?ri Dav??sson
|
||||||
E: kd@flaga.is
|
E: kd@flaga.is
|
||||||
D: FLAGA DM Support
|
D: FLAGA DM Support
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ E: info@elste.org
|
|||||||
D: Port for the ModNET50 Board, NET+50 CPU Port
|
D: Port for the ModNET50 Board, NET+50 CPU Port
|
||||||
W: http://www.imms.de
|
W: http://www.imms.de
|
||||||
|
|
||||||
N: Daniel Engstr<EFBFBD>m
|
N: Daniel Engstr?m
|
||||||
E: daniel@omicron.se
|
E: daniel@omicron.se
|
||||||
D: x86 port, Support for sc520_cdp board
|
D: x86 port, Support for sc520_cdp board
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ W: http://www.leox.org
|
|||||||
|
|
||||||
N: TsiChung Liew
|
N: TsiChung Liew
|
||||||
E: Tsi-Chung.Liew@freescale.com
|
E: Tsi-Chung.Liew@freescale.com
|
||||||
D: Support for ColdFire MCF523x, MCF532x, MCF5445x
|
D: Support for ColdFire MCF523x, MCF532x, MCF5445x, MCF547x_8x
|
||||||
W: www.freescale.com
|
W: www.freescale.com
|
||||||
|
|
||||||
N: Leif Lindholm
|
N: Leif Lindholm
|
||||||
@@ -303,6 +303,11 @@ D: Support for Nios Stratix Development Kit (DK-1S10)
|
|||||||
D: Support for SSV ADNP/ESC1 (Nios Cyclone)
|
D: Support for SSV ADNP/ESC1 (Nios Cyclone)
|
||||||
W: http://www.li-pro.net
|
W: http://www.li-pro.net
|
||||||
|
|
||||||
|
N: Dave Liu
|
||||||
|
E: daveliu@freescale.com
|
||||||
|
D: Support for MPC8315, MPC832x, MPC8360, MPC837x
|
||||||
|
W: www.freescale.com
|
||||||
|
|
||||||
N: Raymond Lo
|
N: Raymond Lo
|
||||||
E: lo@routefree.com
|
E: lo@routefree.com
|
||||||
D: Support for DOS partitions
|
D: Support for DOS partitions
|
||||||
@@ -334,7 +339,7 @@ N: Frank Morauf
|
|||||||
E: frank.morauf@salzbrenner.com
|
E: frank.morauf@salzbrenner.com
|
||||||
D: Support for Embedded Planet RPX Super Board
|
D: Support for Embedded Planet RPX Super Board
|
||||||
|
|
||||||
N: David M<EFBFBD>ller
|
N: David M?ller
|
||||||
E: d.mueller@elsoft.ch
|
E: d.mueller@elsoft.ch
|
||||||
D: Support for Samsung ARM920T SMDK2410 eval board
|
D: Support for Samsung ARM920T SMDK2410 eval board
|
||||||
|
|
||||||
@@ -386,6 +391,10 @@ E: dan.poirot@windriver.com
|
|||||||
D: Support for the Wind River sbc405, sbc8240 board
|
D: Support for the Wind River sbc405, sbc8240 board
|
||||||
W: http://www.windriver.com
|
W: http://www.windriver.com
|
||||||
|
|
||||||
|
N: Stelian Pop
|
||||||
|
E: stelian.pop@leadtechdesign.com
|
||||||
|
D: Atmel AT91CAP9ADK support
|
||||||
|
|
||||||
N: Stefan Roese
|
N: Stefan Roese
|
||||||
E: sr@denx.de
|
E: sr@denx.de
|
||||||
D: AMCC PPC4xx Support
|
D: AMCC PPC4xx Support
|
||||||
@@ -499,3 +508,23 @@ N: Alex Zuepke
|
|||||||
E: azu@sysgo.de
|
E: azu@sysgo.de
|
||||||
D: Overall improvements on StrongARM, ARM720TDMI; Support for Tuxscreen; initial PCMCIA support for ARM
|
D: Overall improvements on StrongARM, ARM720TDMI; Support for Tuxscreen; initial PCMCIA support for ARM
|
||||||
W: www.elinos.com
|
W: www.elinos.com
|
||||||
|
|
||||||
|
N: Nobuhiro Iwamatsu
|
||||||
|
E: iwamatsu@nigauri.org
|
||||||
|
D: Support for SuperH, MS7750SE01 and MS7722SE01 boards.
|
||||||
|
W: http://www.nigauri.org/~iwamatsu/
|
||||||
|
|
||||||
|
N: Alan Lu
|
||||||
|
E: alnalu001@gmail.com
|
||||||
|
D: Support for Artila M-501 starter kit
|
||||||
|
W: http://www.artila.com/
|
||||||
|
|
||||||
|
N: Kimmo Leppala
|
||||||
|
E: kimmo.leppala@sysart.fi
|
||||||
|
D: Support for Artila M-501 starter kit
|
||||||
|
W: http://www.sysart.fi/
|
||||||
|
|
||||||
|
N: Timo Tuunainen
|
||||||
|
E: timo.tuunainen@sysart.fi
|
||||||
|
D: Support for Artila M-501 starter kit
|
||||||
|
W: http://www.sysart.fi/
|
||||||
|
|||||||
73
MAINTAINERS
73
MAINTAINERS
@@ -58,6 +58,10 @@ Conn Clark <clark@esteem.com>
|
|||||||
|
|
||||||
ESTEEM192E MPC8xx
|
ESTEEM192E MPC8xx
|
||||||
|
|
||||||
|
Joe D'Abbraccio <ljd015@freescale.com>
|
||||||
|
|
||||||
|
MPC837xERDB MPC837x
|
||||||
|
|
||||||
K<EFBFBD>ri Dav<61><76>sson <kd@flaga.is>
|
K<EFBFBD>ri Dav<61><76>sson <kd@flaga.is>
|
||||||
|
|
||||||
FLAGADM MPC823
|
FLAGADM MPC823
|
||||||
@@ -146,11 +150,11 @@ Matthias Fuchs <matthias.fuchs@esd-electronics.com>
|
|||||||
CPCI4052 PPC405GP
|
CPCI4052 PPC405GP
|
||||||
CPCI405AB PPC405GP
|
CPCI405AB PPC405GP
|
||||||
CPCI405DT PPC405GP
|
CPCI405DT PPC405GP
|
||||||
CPCI440 PPC440GP
|
|
||||||
CPCIISER4 PPC405GP
|
CPCIISER4 PPC405GP
|
||||||
DASA_SIM IOP480 (PPC401)
|
DASA_SIM IOP480 (PPC401)
|
||||||
DP405 PPC405EP
|
DP405 PPC405EP
|
||||||
DU405 PPC405GP
|
DU405 PPC405GP
|
||||||
|
DU440 PPC440EPx
|
||||||
G2000 PPC405EP
|
G2000 PPC405EP
|
||||||
HH405 PPC405EP
|
HH405 PPC405EP
|
||||||
HUB405 PPC405EP
|
HUB405 PPC405EP
|
||||||
@@ -159,6 +163,7 @@ Matthias Fuchs <matthias.fuchs@esd-electronics.com>
|
|||||||
PCI405 PPC405GP
|
PCI405 PPC405GP
|
||||||
PLU405 PPC405EP
|
PLU405 PPC405EP
|
||||||
PMC405 PPC405GP
|
PMC405 PPC405GP
|
||||||
|
PMC440 PPC440EPx
|
||||||
VOH405 PPC405EP
|
VOH405 PPC405EP
|
||||||
VOM405 PPC405EP
|
VOM405 PPC405EP
|
||||||
WUH405 PPC405EP
|
WUH405 PPC405EP
|
||||||
@@ -190,6 +195,7 @@ Howard Gray <mvsensor@matrix-vision.de>
|
|||||||
|
|
||||||
Joe Hamman <joe.hamman@embeddedspecialties.com>
|
Joe Hamman <joe.hamman@embeddedspecialties.com>
|
||||||
|
|
||||||
|
sbc8548 MPC8548
|
||||||
sbc8641d MPC8641D
|
sbc8641d MPC8641D
|
||||||
|
|
||||||
Klaus Heydeck <heydeck@kieback-peter.de>
|
Klaus Heydeck <heydeck@kieback-peter.de>
|
||||||
@@ -204,6 +210,10 @@ Murray Jensen <Murray.Jensen@csiro.au>
|
|||||||
cogent_mpc8260 MPC8260
|
cogent_mpc8260 MPC8260
|
||||||
hymod MPC8260
|
hymod MPC8260
|
||||||
|
|
||||||
|
Larry Johnson <lrj@acm.org>
|
||||||
|
|
||||||
|
korat PPC440EPx
|
||||||
|
|
||||||
Brad Kemp <Brad.Kemp@seranoa.com>
|
Brad Kemp <Brad.Kemp@seranoa.com>
|
||||||
|
|
||||||
ppmc8260 MPC8260
|
ppmc8260 MPC8260
|
||||||
@@ -217,13 +227,20 @@ Thomas Lange <thomas@corelatus.se>
|
|||||||
|
|
||||||
GTH MPC860
|
GTH MPC860
|
||||||
|
|
||||||
|
Robert Lazarski <robertlazarski@gmail.com>
|
||||||
|
|
||||||
|
ATUM8548 MPC8548
|
||||||
|
|
||||||
The LEOX team <team@leox.org>
|
The LEOX team <team@leox.org>
|
||||||
|
|
||||||
ELPT860 MPC860T
|
ELPT860 MPC860T
|
||||||
|
|
||||||
Dave Liu <daveliu@freescale.com>
|
Dave Liu <daveliu@freescale.com>
|
||||||
|
|
||||||
|
MPC8315ERDB MPC8315
|
||||||
|
MPC832XEMDS MPC832x
|
||||||
MPC8360EMDS MPC8360
|
MPC8360EMDS MPC8360
|
||||||
|
MPC837XEMDS MPC837x
|
||||||
|
|
||||||
Nye Liu <nyet@zumanetworks.com>
|
Nye Liu <nyet@zumanetworks.com>
|
||||||
|
|
||||||
@@ -303,8 +320,11 @@ Stefan Roese <sr@denx.de>
|
|||||||
bamboo PPC440EP
|
bamboo PPC440EP
|
||||||
bunbinga PPC405EP
|
bunbinga PPC405EP
|
||||||
ebony PPC440GP
|
ebony PPC440GP
|
||||||
|
haleakala PPC405EXr
|
||||||
katmai PPC440SPe
|
katmai PPC440SPe
|
||||||
|
kilauea PPC405EX
|
||||||
lwmon5 PPC440EPx
|
lwmon5 PPC440EPx
|
||||||
|
makalu PPC405EX
|
||||||
ocotea PPC440GX
|
ocotea PPC440GX
|
||||||
p3p440 PPC440GP
|
p3p440 PPC440GP
|
||||||
pcs440ep PPC440EP
|
pcs440ep PPC440EP
|
||||||
@@ -329,6 +349,17 @@ Travis Sawyer (travis.sawyer@sandburst.com>
|
|||||||
METROBOX PPC440GX
|
METROBOX PPC440GX
|
||||||
XPEDITE1K PPC440GX
|
XPEDITE1K PPC440GX
|
||||||
|
|
||||||
|
Heiko Schocher <hs@denx.de>
|
||||||
|
|
||||||
|
ids8247 MPC8247
|
||||||
|
jupiter MPC5200
|
||||||
|
mgcoge MPC8247
|
||||||
|
mgsuvd MPC852
|
||||||
|
municse MPC5200
|
||||||
|
sc3 PPC405GP
|
||||||
|
uc101 MPC5200
|
||||||
|
|
||||||
|
|
||||||
Peter De Schrijver <p2@mind.be>
|
Peter De Schrijver <p2@mind.be>
|
||||||
|
|
||||||
ML2 PPC4xx
|
ML2 PPC4xx
|
||||||
@@ -357,6 +388,10 @@ David Updegraff <dave@cray.com>
|
|||||||
|
|
||||||
CRAYL1 PPC4xx
|
CRAYL1 PPC4xx
|
||||||
|
|
||||||
|
Anton Vorontsov <avorontsov@ru.mvista.com>
|
||||||
|
|
||||||
|
MPC8360ERDK MPC8360
|
||||||
|
|
||||||
Josef Wagner <Wagner@Microsys.de>
|
Josef Wagner <Wagner@Microsys.de>
|
||||||
|
|
||||||
CPC45 MPC8245
|
CPC45 MPC8245
|
||||||
@@ -522,6 +557,13 @@ Alex Z
|
|||||||
lart SA1100
|
lart SA1100
|
||||||
dnp1110 SA1110
|
dnp1110 SA1110
|
||||||
|
|
||||||
|
Michael Schwingen <michael@schwingen.org>
|
||||||
|
|
||||||
|
actux1 xscale
|
||||||
|
actux2 xscale
|
||||||
|
actux3 xscale
|
||||||
|
actux4 xscale
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# x86 Systems: #
|
# x86 Systems: #
|
||||||
# #
|
# #
|
||||||
@@ -549,6 +591,9 @@ Thomas Lange <thomas@corelatus.se>
|
|||||||
dbau1x00 MIPS32 Au1000
|
dbau1x00 MIPS32 Au1000
|
||||||
gth2 MIPS32 Au1000
|
gth2 MIPS32 Au1000
|
||||||
|
|
||||||
|
Vlad Lungu <vlad@comsys.ro>
|
||||||
|
qemu_mips MIPS32
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# Nios-32 Systems: #
|
# Nios-32 Systems: #
|
||||||
# #
|
# #
|
||||||
@@ -613,9 +658,13 @@ Zachary P. Landau <zachary.landau@labxtechnologies.com>
|
|||||||
|
|
||||||
TsiChung Liew <Tsi-Chung.Liew@freescale.com>
|
TsiChung Liew <Tsi-Chung.Liew@freescale.com>
|
||||||
|
|
||||||
|
M52277EVB mcf5227x
|
||||||
M5235EVB mcf52x2
|
M5235EVB mcf52x2
|
||||||
M5329EVB mcf532x
|
M5329EVB mcf532x
|
||||||
|
M5373EVB mcf532x
|
||||||
M54455EVB mcf5445x
|
M54455EVB mcf5445x
|
||||||
|
M5475EVB mcf547x_8x
|
||||||
|
M5485EVB mcf547x_8x
|
||||||
|
|
||||||
Hayden Fraser <Hayden.Fraser@freescale.com>
|
Hayden Fraser <Hayden.Fraser@freescale.com>
|
||||||
|
|
||||||
@@ -630,7 +679,27 @@ Hayden Fraser <Hayden.Fraser@freescale.com>
|
|||||||
|
|
||||||
Haavard Skinnemoen <hskinnemoen@atmel.com>
|
Haavard Skinnemoen <hskinnemoen@atmel.com>
|
||||||
|
|
||||||
ATSTK1000 AT32AP7000
|
ATSTK1000 AT32AP7xxx
|
||||||
|
ATSTK1002 AT32AP7000
|
||||||
|
ATSTK1003 AT32AP7001
|
||||||
|
ATSTK1004 AT32AP7002
|
||||||
|
ATNGW100 AT32AP7000
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
# SuperH Systems: #
|
||||||
|
# #
|
||||||
|
# Maintainer Name, Email Address #
|
||||||
|
# Board CPU #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
Nobuhiro Iwmaatsu <iwamatsu@nigauri.org>
|
||||||
|
|
||||||
|
MS7750SE SH7750
|
||||||
|
MS7722SE SH7722
|
||||||
|
|
||||||
|
Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
|
||||||
|
|
||||||
|
MS7720SE SH7720
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# End of MAINTAINERS list #
|
# End of MAINTAINERS list #
|
||||||
|
|||||||
63
MAKEALL
63
MAKEALL
@@ -46,6 +46,7 @@ LIST_5xxx=" \
|
|||||||
mcc200 \
|
mcc200 \
|
||||||
mecp5200 \
|
mecp5200 \
|
||||||
motionpro \
|
motionpro \
|
||||||
|
munices \
|
||||||
o2dnt \
|
o2dnt \
|
||||||
pf5200 \
|
pf5200 \
|
||||||
PM520 \
|
PM520 \
|
||||||
@@ -107,6 +108,7 @@ LIST_8xx=" \
|
|||||||
lwmon \
|
lwmon \
|
||||||
MBX \
|
MBX \
|
||||||
MBX860T \
|
MBX860T \
|
||||||
|
mgsuvd \
|
||||||
MHPC \
|
MHPC \
|
||||||
MPC86xADS \
|
MPC86xADS \
|
||||||
MPC885ADS \
|
MPC885ADS \
|
||||||
@@ -135,6 +137,7 @@ LIST_8xx=" \
|
|||||||
SPD823TS \
|
SPD823TS \
|
||||||
svm_sc8xx \
|
svm_sc8xx \
|
||||||
SXNI855T \
|
SXNI855T \
|
||||||
|
TK885D \
|
||||||
TOP860 \
|
TOP860 \
|
||||||
TQM823L \
|
TQM823L \
|
||||||
TQM823L_LCD \
|
TQM823L_LCD \
|
||||||
@@ -168,7 +171,6 @@ LIST_4xx=" \
|
|||||||
CPCI4052 \
|
CPCI4052 \
|
||||||
CPCI405AB \
|
CPCI405AB \
|
||||||
CPCI405DT \
|
CPCI405DT \
|
||||||
CPCI440 \
|
|
||||||
CPCIISER4 \
|
CPCIISER4 \
|
||||||
CRAYL1 \
|
CRAYL1 \
|
||||||
csb272 \
|
csb272 \
|
||||||
@@ -176,10 +178,13 @@ LIST_4xx=" \
|
|||||||
DASA_SIM \
|
DASA_SIM \
|
||||||
DP405 \
|
DP405 \
|
||||||
DU405 \
|
DU405 \
|
||||||
|
DU440 \
|
||||||
ebony \
|
ebony \
|
||||||
ERIC \
|
ERIC \
|
||||||
EXBITGEN \
|
EXBITGEN \
|
||||||
G2000 \
|
G2000 \
|
||||||
|
haleakala \
|
||||||
|
haleakala_nand \
|
||||||
hcu4 \
|
hcu4 \
|
||||||
hcu5 \
|
hcu5 \
|
||||||
HH405 \
|
HH405 \
|
||||||
@@ -187,8 +192,12 @@ LIST_4xx=" \
|
|||||||
JSE \
|
JSE \
|
||||||
KAREF \
|
KAREF \
|
||||||
katmai \
|
katmai \
|
||||||
|
kilauea \
|
||||||
|
kilauea_nand \
|
||||||
|
korat \
|
||||||
luan \
|
luan \
|
||||||
lwmon5 \
|
lwmon5 \
|
||||||
|
makalu \
|
||||||
METROBOX \
|
METROBOX \
|
||||||
MIP405 \
|
MIP405 \
|
||||||
MIP405T \
|
MIP405T \
|
||||||
@@ -203,6 +212,7 @@ LIST_4xx=" \
|
|||||||
PIP405 \
|
PIP405 \
|
||||||
PLU405 \
|
PLU405 \
|
||||||
PMC405 \
|
PMC405 \
|
||||||
|
PMC440 \
|
||||||
PPChameleonEVB \
|
PPChameleonEVB \
|
||||||
rainier \
|
rainier \
|
||||||
sbc405 \
|
sbc405 \
|
||||||
@@ -274,6 +284,7 @@ LIST_8260=" \
|
|||||||
hymod \
|
hymod \
|
||||||
IPHASE4539 \
|
IPHASE4539 \
|
||||||
ISPAN \
|
ISPAN \
|
||||||
|
mgcoge \
|
||||||
MPC8260ADS \
|
MPC8260ADS \
|
||||||
MPC8266ADS \
|
MPC8266ADS \
|
||||||
MPC8272ADS \
|
MPC8272ADS \
|
||||||
@@ -299,6 +310,7 @@ LIST_8260=" \
|
|||||||
LIST_83xx=" \
|
LIST_83xx=" \
|
||||||
MPC8313ERDB_33 \
|
MPC8313ERDB_33 \
|
||||||
MPC8313ERDB_66 \
|
MPC8313ERDB_66 \
|
||||||
|
MPC8315ERDB \
|
||||||
MPC8323ERDB \
|
MPC8323ERDB \
|
||||||
MPC832XEMDS \
|
MPC832XEMDS \
|
||||||
MPC832XEMDS_ATM \
|
MPC832XEMDS_ATM \
|
||||||
@@ -307,6 +319,10 @@ LIST_83xx=" \
|
|||||||
MPC8349ITXGP \
|
MPC8349ITXGP \
|
||||||
MPC8360EMDS \
|
MPC8360EMDS \
|
||||||
MPC8360EMDS_ATM \
|
MPC8360EMDS_ATM \
|
||||||
|
MPC8360ERDK_33 \
|
||||||
|
MPC8360ERDK_66 \
|
||||||
|
MPC837XEMDS \
|
||||||
|
MPC837XERDB \
|
||||||
sbc8349 \
|
sbc8349 \
|
||||||
TQM834x \
|
TQM834x \
|
||||||
"
|
"
|
||||||
@@ -317,6 +333,7 @@ LIST_83xx=" \
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
LIST_85xx=" \
|
LIST_85xx=" \
|
||||||
|
ATUM8548 \
|
||||||
MPC8540ADS \
|
MPC8540ADS \
|
||||||
MPC8540EVAL \
|
MPC8540EVAL \
|
||||||
MPC8541CDS \
|
MPC8541CDS \
|
||||||
@@ -328,6 +345,7 @@ LIST_85xx=" \
|
|||||||
PM854 \
|
PM854 \
|
||||||
PM856 \
|
PM856 \
|
||||||
sbc8540 \
|
sbc8540 \
|
||||||
|
sbc8548 \
|
||||||
sbc8560 \
|
sbc8560 \
|
||||||
stxgp3 \
|
stxgp3 \
|
||||||
stxssa \
|
stxssa \
|
||||||
@@ -342,6 +360,7 @@ LIST_85xx=" \
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
LIST_86xx=" \
|
LIST_86xx=" \
|
||||||
|
MPC8610HPCD \
|
||||||
MPC8641HPCN \
|
MPC8641HPCN \
|
||||||
sbc8641d \
|
sbc8641d \
|
||||||
"
|
"
|
||||||
@@ -378,6 +397,7 @@ LIST_7xx=" \
|
|||||||
|
|
||||||
LIST_ppc=" \
|
LIST_ppc=" \
|
||||||
${LIST_5xx} \
|
${LIST_5xx} \
|
||||||
|
${LIST_512x} \
|
||||||
${LIST_5xxx} \
|
${LIST_5xxx} \
|
||||||
${LIST_8xx} \
|
${LIST_8xx} \
|
||||||
${LIST_8220} \
|
${LIST_8220} \
|
||||||
@@ -426,6 +446,7 @@ LIST_ARM7=" \
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
LIST_ARM9=" \
|
LIST_ARM9=" \
|
||||||
|
at91cap9adk \
|
||||||
at91rm9200dk \
|
at91rm9200dk \
|
||||||
cmc_pu2 \
|
cmc_pu2 \
|
||||||
ap920t \
|
ap920t \
|
||||||
@@ -439,6 +460,7 @@ LIST_ARM9=" \
|
|||||||
cp946es \
|
cp946es \
|
||||||
cp966 \
|
cp966 \
|
||||||
lpd7a400 \
|
lpd7a400 \
|
||||||
|
m501sk \
|
||||||
mp2usb \
|
mp2usb \
|
||||||
mx1ads \
|
mx1ads \
|
||||||
mx1fs2 \
|
mx1fs2 \
|
||||||
@@ -476,6 +498,7 @@ LIST_ARM10=" \
|
|||||||
LIST_ARM11=" \
|
LIST_ARM11=" \
|
||||||
cp1136 \
|
cp1136 \
|
||||||
omap2420h4 \
|
omap2420h4 \
|
||||||
|
apollon \
|
||||||
"
|
"
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
@@ -500,6 +523,10 @@ LIST_pxa=" \
|
|||||||
"
|
"
|
||||||
|
|
||||||
LIST_ixp=" \
|
LIST_ixp=" \
|
||||||
|
actux1 \
|
||||||
|
actux2 \
|
||||||
|
actux3 \
|
||||||
|
actux4 \
|
||||||
ixdp425 \
|
ixdp425 \
|
||||||
ixdpg425 \
|
ixdpg425 \
|
||||||
pdnb3 \
|
pdnb3 \
|
||||||
@@ -523,6 +550,7 @@ LIST_arm=" \
|
|||||||
|
|
||||||
LIST_mips4kc=" \
|
LIST_mips4kc=" \
|
||||||
incaip \
|
incaip \
|
||||||
|
qemu_mips \
|
||||||
"
|
"
|
||||||
|
|
||||||
LIST_mips5kc=" \
|
LIST_mips5kc=" \
|
||||||
@@ -623,14 +651,18 @@ LIST_coldfire=" \
|
|||||||
EB+MCF-EV123 \
|
EB+MCF-EV123 \
|
||||||
EB+MCF-EV123_internal \
|
EB+MCF-EV123_internal \
|
||||||
idmr \
|
idmr \
|
||||||
|
M52277EVB \
|
||||||
M5235EVB \
|
M5235EVB \
|
||||||
M5249EVB \
|
M5249EVB \
|
||||||
M5253EVB \
|
M5253EVB \
|
||||||
M5271EVB \
|
M5271EVB \
|
||||||
M5272C3 \
|
M5272C3 \
|
||||||
M5282EVB \
|
M5282EVB \
|
||||||
M5329EVB \
|
M5329AFEE \
|
||||||
|
M5373EVB \
|
||||||
M54455EVB \
|
M54455EVB \
|
||||||
|
M5475AFE \
|
||||||
|
M5485AFE \
|
||||||
r5200 \
|
r5200 \
|
||||||
TASREG \
|
TASREG \
|
||||||
"
|
"
|
||||||
@@ -641,6 +673,9 @@ LIST_coldfire=" \
|
|||||||
|
|
||||||
LIST_avr32=" \
|
LIST_avr32=" \
|
||||||
atstk1002 \
|
atstk1002 \
|
||||||
|
atstk1003 \
|
||||||
|
atstk1004 \
|
||||||
|
atngw100 \
|
||||||
"
|
"
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
@@ -654,6 +689,24 @@ LIST_blackfin=" \
|
|||||||
bf561-ezkit \
|
bf561-ezkit \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
## SH Systems
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
LIST_sh4=" \
|
||||||
|
ms7750se \
|
||||||
|
ms7722se \
|
||||||
|
"
|
||||||
|
|
||||||
|
LIST_sh3=" \
|
||||||
|
ms7720se \
|
||||||
|
"
|
||||||
|
|
||||||
|
LIST_sh=" \
|
||||||
|
${LIST_sh3} \
|
||||||
|
${LIST_sh4} \
|
||||||
|
"
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
#----- for now, just run PPC by default -----
|
#----- for now, just run PPC by default -----
|
||||||
@@ -670,7 +723,7 @@ build_target() {
|
|||||||
${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
|
${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
|
||||||
| tee ${LOG_DIR}/$target.ERR
|
| tee ${LOG_DIR}/$target.ERR
|
||||||
|
|
||||||
${CROSS_COMPILE:-ppc_8xx-}size ${BUILD_DIR}/u-boot \
|
${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \
|
||||||
| tee -a ${LOG_DIR}/$target.MAKELOG
|
| tee -a ${LOG_DIR}/$target.MAKELOG
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -688,7 +741,9 @@ do
|
|||||||
mips|mips_el| \
|
mips|mips_el| \
|
||||||
nios|nios2| \
|
nios|nios2| \
|
||||||
ppc|5xx|5xxx|512x|8xx|8220|824x|8260|83xx|85xx|86xx|4xx|7xx|74xx| \
|
ppc|5xx|5xxx|512x|8xx|8220|824x|8260|83xx|85xx|86xx|4xx|7xx|74xx| \
|
||||||
x86|I486|TSEC)
|
x86|I486|TSEC| \
|
||||||
|
sh|sh4|sh3 \
|
||||||
|
)
|
||||||
for target in `eval echo '$LIST_'${arg}`
|
for target in `eval echo '$LIST_'${arg}`
|
||||||
do
|
do
|
||||||
build_target ${target}
|
build_target ${target}
|
||||||
|
|||||||
59
README
59
README
@@ -136,8 +136,10 @@ Directory Hierarchy:
|
|||||||
- i386 Files specific to i386 CPUs
|
- i386 Files specific to i386 CPUs
|
||||||
- ixp Files specific to Intel XScale IXP CPUs
|
- ixp Files specific to Intel XScale IXP CPUs
|
||||||
- mcf52x2 Files specific to Freescale ColdFire MCF52x2 CPUs
|
- mcf52x2 Files specific to Freescale ColdFire MCF52x2 CPUs
|
||||||
|
- mcf5227x Files specific to Freescale ColdFire MCF5227x CPUs
|
||||||
- mcf532x Files specific to Freescale ColdFire MCF5329 CPUs
|
- mcf532x Files specific to Freescale ColdFire MCF5329 CPUs
|
||||||
- mcf5445x Files specific to Freescale ColdFire MCF5445x CPUs
|
- mcf5445x Files specific to Freescale ColdFire MCF5445x CPUs
|
||||||
|
- mcf547x_8x Files specific to Freescale ColdFire MCF547x_8x CPUs
|
||||||
- mips Files specific to MIPS CPUs
|
- mips Files specific to MIPS CPUs
|
||||||
- mpc5xx Files specific to Freescale MPC5xx CPUs
|
- mpc5xx Files specific to Freescale MPC5xx CPUs
|
||||||
- mpc5xxx Files specific to Freescale MPC5xxx CPUs
|
- mpc5xxx Files specific to Freescale MPC5xxx CPUs
|
||||||
@@ -235,9 +237,7 @@ The following options need to be configured:
|
|||||||
- Board Type: Define exactly one, e.g. CONFIG_MPC8540ADS.
|
- Board Type: Define exactly one, e.g. CONFIG_MPC8540ADS.
|
||||||
|
|
||||||
- CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined)
|
- CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined)
|
||||||
Define exactly one of
|
Define exactly one, e.g. CONFIG_ATSTK1002
|
||||||
CONFIG_ATSTK1002
|
|
||||||
|
|
||||||
|
|
||||||
- CPU Module Type: (if CONFIG_COGENT is defined)
|
- CPU Module Type: (if CONFIG_COGENT is defined)
|
||||||
Define exactly one of
|
Define exactly one of
|
||||||
@@ -926,7 +926,7 @@ The following options need to be configured:
|
|||||||
(i.e. setenv videomode 317; saveenv; reset;)
|
(i.e. setenv videomode 317; saveenv; reset;)
|
||||||
|
|
||||||
- "videomode=bootargs" all the video parameters are parsed
|
- "videomode=bootargs" all the video parameters are parsed
|
||||||
from the bootargs. (See drivers/videomodes.c)
|
from the bootargs. (See drivers/video/videomodes.c)
|
||||||
|
|
||||||
|
|
||||||
CONFIG_VIDEO_SED13806
|
CONFIG_VIDEO_SED13806
|
||||||
@@ -1355,7 +1355,7 @@ The following options need to be configured:
|
|||||||
CONFIG_FSL_I2C
|
CONFIG_FSL_I2C
|
||||||
|
|
||||||
Define this option if you want to use Freescale's I2C driver in
|
Define this option if you want to use Freescale's I2C driver in
|
||||||
drivers/fsl_i2c.c.
|
drivers/i2c/fsl_i2c.c.
|
||||||
|
|
||||||
|
|
||||||
- SPI Support: CONFIG_SPI
|
- SPI Support: CONFIG_SPI
|
||||||
@@ -1379,15 +1379,32 @@ The following options need to be configured:
|
|||||||
SPI configuration items (port pins to use, etc). For
|
SPI configuration items (port pins to use, etc). For
|
||||||
an example, see include/configs/sacsng.h.
|
an example, see include/configs/sacsng.h.
|
||||||
|
|
||||||
- FPGA Support: CONFIG_FPGA_COUNT
|
CONFIG_HARD_SPI
|
||||||
|
|
||||||
|
Enables a hardware SPI driver for general-purpose reads
|
||||||
|
and writes. As with CONFIG_SOFT_SPI, the board configuration
|
||||||
|
must define a list of chip-select function pointers.
|
||||||
|
Currently supported on some MPC8xxx processors. For an
|
||||||
|
example, see include/configs/mpc8349emds.h.
|
||||||
|
|
||||||
|
- FPGA Support: CONFIG_FPGA
|
||||||
|
|
||||||
|
Enables FPGA subsystem.
|
||||||
|
|
||||||
|
CONFIG_FPGA_<vendor>
|
||||||
|
|
||||||
|
Enables support for specific chip vendors.
|
||||||
|
(ALTERA, XILINX)
|
||||||
|
|
||||||
|
CONFIG_FPGA_<family>
|
||||||
|
|
||||||
|
Enables support for FPGA family.
|
||||||
|
(SPARTAN2, SPARTAN3, VIRTEX2, CYCLONE2, ACEX1K, ACEX)
|
||||||
|
|
||||||
|
CONFIG_FPGA_COUNT
|
||||||
|
|
||||||
Specify the number of FPGA devices to support.
|
Specify the number of FPGA devices to support.
|
||||||
|
|
||||||
CONFIG_FPGA
|
|
||||||
|
|
||||||
Used to specify the types of FPGA devices. For example,
|
|
||||||
#define CONFIG_FPGA CFG_XILINX_VIRTEX2
|
|
||||||
|
|
||||||
CFG_FPGA_PROG_FEEDBACK
|
CFG_FPGA_PROG_FEEDBACK
|
||||||
|
|
||||||
Enable printing of hash marks during FPGA configuration.
|
Enable printing of hash marks during FPGA configuration.
|
||||||
@@ -2271,6 +2288,10 @@ Low Level (hardware related) configuration options:
|
|||||||
enable I2C microcode relocation patch (MPC8xx);
|
enable I2C microcode relocation patch (MPC8xx);
|
||||||
define relocation offset in DPRAM [DSP2]
|
define relocation offset in DPRAM [DSP2]
|
||||||
|
|
||||||
|
- CFG_SMC_UCODE_PATCH, CFG_SMC_DPMEM_OFFSET [0x1FC0]:
|
||||||
|
enable SMC microcode relocation patch (MPC8xx);
|
||||||
|
define relocation offset in DPRAM [SMC1]
|
||||||
|
|
||||||
- CFG_SPI_UCODE_PATCH, CFG_SPI_DPMEM_OFFSET [0x1FC0]:
|
- CFG_SPI_UCODE_PATCH, CFG_SPI_DPMEM_OFFSET [0x1FC0]:
|
||||||
enable SPI microcode relocation patch (MPC8xx);
|
enable SPI microcode relocation patch (MPC8xx);
|
||||||
define relocation offset in DPRAM [SCC4]
|
define relocation offset in DPRAM [SCC4]
|
||||||
@@ -2680,6 +2701,10 @@ Some configuration options can be set using Environment Variables:
|
|||||||
=> setenv ethact SCC ETHERNET
|
=> setenv ethact SCC ETHERNET
|
||||||
=> ping 10.0.0.1 # traffic sent on SCC ETHERNET
|
=> ping 10.0.0.1 # traffic sent on SCC ETHERNET
|
||||||
|
|
||||||
|
ethrotate - When set to "no" U-Boot does not go through all
|
||||||
|
available network interfaces.
|
||||||
|
It just stays at the currently selected interface.
|
||||||
|
|
||||||
netretry - When set to "no" each network operation will
|
netretry - When set to "no" each network operation will
|
||||||
either succeed or fail without retrying.
|
either succeed or fail without retrying.
|
||||||
When set to "once" the network operation will
|
When set to "once" the network operation will
|
||||||
@@ -2688,6 +2713,9 @@ Some configuration options can be set using Environment Variables:
|
|||||||
Useful on scripts which control the retry operation
|
Useful on scripts which control the retry operation
|
||||||
themselves.
|
themselves.
|
||||||
|
|
||||||
|
npe_ucode - see CONFIG_IXP4XX_NPE_EXT_UCOD
|
||||||
|
if set load address for the npe microcode
|
||||||
|
|
||||||
tftpsrcport - If this is set, the value is used for TFTP's
|
tftpsrcport - If this is set, the value is used for TFTP's
|
||||||
UDP source port.
|
UDP source port.
|
||||||
|
|
||||||
@@ -3471,7 +3499,7 @@ GCC's implementation.
|
|||||||
|
|
||||||
For PowerPC, the following registers have specific use:
|
For PowerPC, the following registers have specific use:
|
||||||
R1: stack pointer
|
R1: stack pointer
|
||||||
R2: TOC pointer
|
R2: reserved for system use
|
||||||
R3-R4: parameter passing and return values
|
R3-R4: parameter passing and return values
|
||||||
R5-R10: parameter passing
|
R5-R10: parameter passing
|
||||||
R13: small data area pointer
|
R13: small data area pointer
|
||||||
@@ -3480,7 +3508,7 @@ For PowerPC, the following registers have specific use:
|
|||||||
|
|
||||||
(U-Boot also uses R14 as internal GOT pointer.)
|
(U-Boot also uses R14 as internal GOT pointer.)
|
||||||
|
|
||||||
==> U-Boot will use R29 to hold a pointer to the global data
|
==> U-Boot will use R2 to hold a pointer to the global data
|
||||||
|
|
||||||
Note: on PPC, we could use a static initializer (since the
|
Note: on PPC, we could use a static initializer (since the
|
||||||
address of the global data structure is known at compile time),
|
address of the global data structure is known at compile time),
|
||||||
@@ -3489,6 +3517,11 @@ For PowerPC, the following registers have specific use:
|
|||||||
average for all boards 752 bytes for the whole U-Boot image,
|
average for all boards 752 bytes for the whole U-Boot image,
|
||||||
624 text + 127 data).
|
624 text + 127 data).
|
||||||
|
|
||||||
|
On Blackfin, the normal C ABI (except for P5) is followed as documented here:
|
||||||
|
http://docs.blackfin.uclinux.org/doku.php?id=application_binary_interface
|
||||||
|
|
||||||
|
==> U-Boot will use P5 to hold a pointer to the global data
|
||||||
|
|
||||||
On ARM, the following registers are used:
|
On ARM, the following registers are used:
|
||||||
|
|
||||||
R0: function argument word/integer result
|
R0: function argument word/integer result
|
||||||
|
|||||||
39
api/Makefile
Normal file
39
api/Makefile
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2007 Semihalf
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundatio; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)libapi.a
|
||||||
|
|
||||||
|
COBJS-$(CONFIG_API) += api.o api_net.o api_storage.o api_platform-$(ARCH).o
|
||||||
|
|
||||||
|
COBJS := $(COBJS-y)
|
||||||
|
SRCS := $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
55
api/README
Normal file
55
api/README
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
U-Boot machine/arch independent API for external apps
|
||||||
|
=====================================================
|
||||||
|
|
||||||
|
1. Main assumptions
|
||||||
|
|
||||||
|
- there is a single entry point (syscall) to the API
|
||||||
|
|
||||||
|
- per current design the syscall is a C-callable function in the U-Boot
|
||||||
|
text, which might evolve into a real syscall using machine exception trap
|
||||||
|
once this initial version proves functional
|
||||||
|
|
||||||
|
- the consumer app is responsible for producing appropriate context (call
|
||||||
|
number and arguments)
|
||||||
|
|
||||||
|
- upon entry, the syscall dispatches the call to other (existing) U-Boot
|
||||||
|
functional areas like networking or storage operations
|
||||||
|
|
||||||
|
- consumer application will recognize the API is available by searching
|
||||||
|
a specified (assumed by convention) range of address space for the
|
||||||
|
signature
|
||||||
|
|
||||||
|
- the U-Boot integral part of the API is meant to be thin and non-intrusive,
|
||||||
|
leaving as much processing as possible on the consumer application side,
|
||||||
|
for example it doesn't keep states, but relies on hints from the app and
|
||||||
|
so on
|
||||||
|
|
||||||
|
- optional (CONFIG_API)
|
||||||
|
|
||||||
|
|
||||||
|
2. Calls
|
||||||
|
|
||||||
|
- console related (getc, putc, tstc etc.)
|
||||||
|
- system (reset, platform info)
|
||||||
|
- time (delay, current)
|
||||||
|
- env vars (enumerate all, get, set)
|
||||||
|
- devices (enumerate all, open, close, read, write); currently two classes
|
||||||
|
of devices are recognized and supported: network and storage (ide, scsi,
|
||||||
|
usb etc.)
|
||||||
|
|
||||||
|
|
||||||
|
3. Structure overview
|
||||||
|
|
||||||
|
- core API, integral part of U-Boot, mandatory
|
||||||
|
- implements the single entry point (mimics UNIX syscall)
|
||||||
|
|
||||||
|
- glue
|
||||||
|
- entry point at the consumer side, allows to make syscall, mandatory
|
||||||
|
part
|
||||||
|
|
||||||
|
- helper conveniency wrappers so that consumer app does not have to use
|
||||||
|
the syscall directly, but in a more friendly manner (a la libc calls),
|
||||||
|
optional part
|
||||||
|
|
||||||
|
- consumer application
|
||||||
|
- calls directly, or leverages the provided glue mid-layer
|
||||||
670
api/api.c
Normal file
670
api/api.c
Normal file
@@ -0,0 +1,670 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_API)
|
||||||
|
|
||||||
|
#include <command.h>
|
||||||
|
#include <common.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#include "api_private.h"
|
||||||
|
|
||||||
|
#define DEBUG
|
||||||
|
#undef DEBUG
|
||||||
|
|
||||||
|
/* U-Boot routines needed */
|
||||||
|
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
|
||||||
|
extern uchar (*env_get_char)(int);
|
||||||
|
extern uchar *env_get_addr(int);
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
*
|
||||||
|
* This is the API core.
|
||||||
|
*
|
||||||
|
* API_ functions are part of U-Boot code and constitute the lowest level
|
||||||
|
* calls:
|
||||||
|
*
|
||||||
|
* - they know what values they need as arguments
|
||||||
|
* - their direct return value pertains to the API_ "shell" itself (0 on
|
||||||
|
* success, some error code otherwise)
|
||||||
|
* - if the call returns a value it is buried within arguments
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||||
|
#else
|
||||||
|
#define debugf(fmt, args...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int (*cfp_t)(va_list argp);
|
||||||
|
|
||||||
|
static int calls_no;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_getc(int *c)
|
||||||
|
*/
|
||||||
|
static int API_getc(va_list ap)
|
||||||
|
{
|
||||||
|
int *c;
|
||||||
|
|
||||||
|
if ((c = (int *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
*c = getc();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_tstc(int *c)
|
||||||
|
*/
|
||||||
|
static int API_tstc(va_list ap)
|
||||||
|
{
|
||||||
|
int *t;
|
||||||
|
|
||||||
|
if ((t = (int *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
*t = tstc();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_putc(char *ch)
|
||||||
|
*/
|
||||||
|
static int API_putc(va_list ap)
|
||||||
|
{
|
||||||
|
char *c;
|
||||||
|
|
||||||
|
if ((c = (char *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
putc(*c);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_puts(char **s)
|
||||||
|
*/
|
||||||
|
static int API_puts(va_list ap)
|
||||||
|
{
|
||||||
|
char *s;
|
||||||
|
|
||||||
|
if ((s = (char *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
puts(s);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_reset(void)
|
||||||
|
*/
|
||||||
|
static int API_reset(va_list ap)
|
||||||
|
{
|
||||||
|
do_reset(NULL, 0, 0, NULL);
|
||||||
|
|
||||||
|
/* NOT REACHED */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_get_sys_info(struct sys_info *si)
|
||||||
|
*
|
||||||
|
* fill out the sys_info struct containing selected parameters about the
|
||||||
|
* machine
|
||||||
|
*/
|
||||||
|
static int API_get_sys_info(va_list ap)
|
||||||
|
{
|
||||||
|
struct sys_info *si;
|
||||||
|
|
||||||
|
si = (struct sys_info *)va_arg(ap, u_int32_t);
|
||||||
|
if (si == NULL)
|
||||||
|
return API_ENOMEM;
|
||||||
|
|
||||||
|
return (platform_sys_info(si)) ? 0 : API_ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_udelay(unsigned long *udelay)
|
||||||
|
*/
|
||||||
|
static int API_udelay(va_list ap)
|
||||||
|
{
|
||||||
|
unsigned long *d;
|
||||||
|
|
||||||
|
if ((d = (unsigned long *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
udelay(*d);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_get_timer(unsigned long *current, unsigned long *base)
|
||||||
|
*/
|
||||||
|
static int API_get_timer(va_list ap)
|
||||||
|
{
|
||||||
|
unsigned long *base, *cur;
|
||||||
|
|
||||||
|
cur = (unsigned long *)va_arg(ap, u_int32_t);
|
||||||
|
if (cur == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
base = (unsigned long *)va_arg(ap, u_int32_t);
|
||||||
|
if (base == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
*cur = get_timer(*base);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_dev_enum(struct device_info *)
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* cookies uniqely identify the previously enumerated device instance and
|
||||||
|
* provide a hint for what to inspect in current enum iteration:
|
||||||
|
*
|
||||||
|
* - net: ð_device struct address from list pointed to by eth_devices
|
||||||
|
*
|
||||||
|
* - storage: block_dev_desc_t struct address from &ide_dev_desc[n],
|
||||||
|
* &scsi_dev_desc[n] and similar tables
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static int API_dev_enum(va_list ap)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
|
||||||
|
/* arg is ptr to the device_info struct we are going to fill out */
|
||||||
|
di = (struct device_info *)va_arg(ap, u_int32_t);
|
||||||
|
if (di == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
if (di->cookie == NULL) {
|
||||||
|
/* start over - clean up enumeration */
|
||||||
|
dev_enum_reset(); /* XXX shouldn't the name contain 'stor'? */
|
||||||
|
debugf("RESTART ENUM\n");
|
||||||
|
|
||||||
|
/* net device enumeration first */
|
||||||
|
if (dev_enum_net(di))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The hidden assumption is there can only be one active network
|
||||||
|
* device and it is identified upon enumeration (re)start, so there's
|
||||||
|
* no point in trying to find network devices in other cases than the
|
||||||
|
* (re)start and hence the 'next' device can only be storage
|
||||||
|
*/
|
||||||
|
if (!dev_enum_storage(di))
|
||||||
|
/* make sure we mark there are no more devices */
|
||||||
|
di->cookie = NULL;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int API_dev_open(va_list ap)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
/* arg is ptr to the device_info struct */
|
||||||
|
di = (struct device_info *)va_arg(ap, u_int32_t);
|
||||||
|
if (di == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
/* Allow only one consumer of the device at a time */
|
||||||
|
if (di->state == DEV_STA_OPEN)
|
||||||
|
return API_EBUSY;
|
||||||
|
|
||||||
|
if (di->cookie == NULL)
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
if (di->type & DEV_TYP_STOR)
|
||||||
|
err = dev_open_stor(di->cookie);
|
||||||
|
|
||||||
|
else if (di->type & DEV_TYP_NET)
|
||||||
|
err = dev_open_net(di->cookie);
|
||||||
|
else
|
||||||
|
err = API_ENODEV;
|
||||||
|
|
||||||
|
if (!err)
|
||||||
|
di->state = DEV_STA_OPEN;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int API_dev_close(va_list ap)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
/* arg is ptr to the device_info struct */
|
||||||
|
di = (struct device_info *)va_arg(ap, u_int32_t);
|
||||||
|
if (di == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
if (di->state == DEV_STA_CLOSED)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (di->cookie == NULL)
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
if (di->type & DEV_TYP_STOR)
|
||||||
|
err = dev_close_stor(di->cookie);
|
||||||
|
|
||||||
|
else if (di->type & DEV_TYP_NET)
|
||||||
|
err = dev_close_net(di->cookie);
|
||||||
|
else
|
||||||
|
/*
|
||||||
|
* In case of unknown device we cannot change its state, so
|
||||||
|
* only return error code
|
||||||
|
*/
|
||||||
|
err = API_ENODEV;
|
||||||
|
|
||||||
|
if (!err)
|
||||||
|
di->state = DEV_STA_CLOSED;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notice: this is for sending network packets only, as U-Boot does not
|
||||||
|
* support writing to storage at the moment (12.2007)
|
||||||
|
*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_dev_write(
|
||||||
|
* struct device_info *di,
|
||||||
|
* void *buf,
|
||||||
|
* int *len
|
||||||
|
* )
|
||||||
|
*
|
||||||
|
* buf: ptr to buffer from where to get the data to send
|
||||||
|
*
|
||||||
|
* len: length of packet to be sent (in bytes)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static int API_dev_write(va_list ap)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
void *buf;
|
||||||
|
int *len;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
/* 1. arg is ptr to the device_info struct */
|
||||||
|
di = (struct device_info *)va_arg(ap, u_int32_t);
|
||||||
|
if (di == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
/* XXX should we check if device is open? i.e. the ->state ? */
|
||||||
|
|
||||||
|
if (di->cookie == NULL)
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
/* 2. arg is ptr to buffer from where to get data to write */
|
||||||
|
buf = (void *)va_arg(ap, u_int32_t);
|
||||||
|
if (buf == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
/* 3. arg is length of buffer */
|
||||||
|
len = (int *)va_arg(ap, u_int32_t);
|
||||||
|
if (len == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
if (*len <= 0)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
if (di->type & DEV_TYP_STOR)
|
||||||
|
/*
|
||||||
|
* write to storage is currently not supported by U-Boot:
|
||||||
|
* no storage device implements block_write() method
|
||||||
|
*/
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
else if (di->type & DEV_TYP_NET)
|
||||||
|
err = dev_write_net(di->cookie, buf, *len);
|
||||||
|
else
|
||||||
|
err = API_ENODEV;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_dev_read(
|
||||||
|
* struct device_info *di,
|
||||||
|
* void *buf,
|
||||||
|
* size_t *len,
|
||||||
|
* unsigned long *start
|
||||||
|
* size_t *act_len
|
||||||
|
* )
|
||||||
|
*
|
||||||
|
* buf: ptr to buffer where to put the read data
|
||||||
|
*
|
||||||
|
* len: ptr to length to be read
|
||||||
|
* - network: len of packet to read (in bytes)
|
||||||
|
* - storage: # of blocks to read (can vary in size depending on define)
|
||||||
|
*
|
||||||
|
* start: ptr to start block (only used for storage devices, ignored for
|
||||||
|
* network)
|
||||||
|
*
|
||||||
|
* act_len: ptr to where to put the len actually read
|
||||||
|
*/
|
||||||
|
static int API_dev_read(va_list ap)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
void *buf;
|
||||||
|
lbasize_t *len_stor, *act_len_stor;
|
||||||
|
lbastart_t *start;
|
||||||
|
int *len_net, *act_len_net;
|
||||||
|
|
||||||
|
/* 1. arg is ptr to the device_info struct */
|
||||||
|
di = (struct device_info *)va_arg(ap, u_int32_t);
|
||||||
|
if (di == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
/* XXX should we check if device is open? i.e. the ->state ? */
|
||||||
|
|
||||||
|
if (di->cookie == NULL)
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
/* 2. arg is ptr to buffer from where to put the read data */
|
||||||
|
buf = (void *)va_arg(ap, u_int32_t);
|
||||||
|
if (buf == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
if (di->type & DEV_TYP_STOR) {
|
||||||
|
/* 3. arg - ptr to var with # of blocks to read */
|
||||||
|
len_stor = (lbasize_t *)va_arg(ap, u_int32_t);
|
||||||
|
if (!len_stor)
|
||||||
|
return API_EINVAL;
|
||||||
|
if (*len_stor <= 0)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
/* 4. arg - ptr to var with start block */
|
||||||
|
start = (lbastart_t *)va_arg(ap, u_int32_t);
|
||||||
|
|
||||||
|
/* 5. arg - ptr to var where to put the len actually read */
|
||||||
|
act_len_stor = (lbasize_t *)va_arg(ap, u_int32_t);
|
||||||
|
if (!act_len_stor)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
*act_len_stor = dev_read_stor(di->cookie, buf, *len_stor, *start);
|
||||||
|
|
||||||
|
} else if (di->type & DEV_TYP_NET) {
|
||||||
|
|
||||||
|
/* 3. arg points to the var with length of packet to read */
|
||||||
|
len_net = (int *)va_arg(ap, u_int32_t);
|
||||||
|
if (!len_net)
|
||||||
|
return API_EINVAL;
|
||||||
|
if (*len_net <= 0)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
/* 4. - ptr to var where to put the len actually read */
|
||||||
|
act_len_net = (int *)va_arg(ap, u_int32_t);
|
||||||
|
if (!act_len_net)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
*act_len_net = dev_read_net(di->cookie, buf, *len_net);
|
||||||
|
|
||||||
|
} else
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_env_get(const char *name, char **value)
|
||||||
|
*
|
||||||
|
* name: ptr to name of env var
|
||||||
|
*/
|
||||||
|
static int API_env_get(va_list ap)
|
||||||
|
{
|
||||||
|
char *name, **value;
|
||||||
|
|
||||||
|
if ((name = (char *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
if ((value = (char **)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
*value = getenv(name);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_env_set(const char *name, const char *value)
|
||||||
|
*
|
||||||
|
* name: ptr to name of env var
|
||||||
|
*
|
||||||
|
* value: ptr to value to be set
|
||||||
|
*/
|
||||||
|
static int API_env_set(va_list ap)
|
||||||
|
{
|
||||||
|
char *name, *value;
|
||||||
|
|
||||||
|
if ((name = (char *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
if ((value = (char *)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
setenv(name, value);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pseudo signature:
|
||||||
|
*
|
||||||
|
* int API_env_enum(const char *last, char **next)
|
||||||
|
*
|
||||||
|
* last: ptr to name of env var found in last iteration
|
||||||
|
*/
|
||||||
|
static int API_env_enum(va_list ap)
|
||||||
|
{
|
||||||
|
int i, n;
|
||||||
|
char *last, **next;
|
||||||
|
|
||||||
|
last = (char *)va_arg(ap, u_int32_t);
|
||||||
|
|
||||||
|
if ((next = (char **)va_arg(ap, u_int32_t)) == NULL)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
if (last == NULL)
|
||||||
|
/* start over */
|
||||||
|
*next = ((char *)env_get_addr(0));
|
||||||
|
else {
|
||||||
|
*next = last;
|
||||||
|
|
||||||
|
for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
|
||||||
|
for (n = i; env_get_char(n) != '\0'; ++n) {
|
||||||
|
if (n >= CFG_ENV_SIZE) {
|
||||||
|
/* XXX shouldn't we set *next = NULL?? */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (envmatch((uchar *)last, i) < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* try to get next name */
|
||||||
|
i = n + 1;
|
||||||
|
if (env_get_char(i) == '\0') {
|
||||||
|
/* no more left */
|
||||||
|
*next = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*next = ((char *)env_get_addr(i));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cfp_t calls_table[API_MAXCALL] = { NULL, };
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The main syscall entry point - this is not reentrant, only one call is
|
||||||
|
* serviced until finished.
|
||||||
|
*
|
||||||
|
* e.g. syscall(1, int *, u_int32_t, u_int32_t, u_int32_t, u_int32_t);
|
||||||
|
*
|
||||||
|
* call: syscall number
|
||||||
|
*
|
||||||
|
* retval: points to the return value placeholder, this is the place the
|
||||||
|
* syscall puts its return value, if NULL the caller does not
|
||||||
|
* expect a return value
|
||||||
|
*
|
||||||
|
* ... syscall arguments (variable number)
|
||||||
|
*
|
||||||
|
* returns: 0 if the call not found, 1 if serviced
|
||||||
|
*/
|
||||||
|
int syscall(int call, int *retval, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int rv;
|
||||||
|
|
||||||
|
if (call < 0 || call >= calls_no || calls_table[call] == NULL) {
|
||||||
|
debugf("invalid call #%d\n", call);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (calls_table[call] == NULL) {
|
||||||
|
debugf("syscall #%d does not have a handler\n", call);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
va_start(ap, retval);
|
||||||
|
rv = calls_table[call](ap);
|
||||||
|
if (retval != NULL)
|
||||||
|
*retval = rv;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_init(void)
|
||||||
|
{
|
||||||
|
struct api_signature *sig = NULL;
|
||||||
|
|
||||||
|
/* TODO put this into linker set one day... */
|
||||||
|
calls_table[API_RSVD] = NULL;
|
||||||
|
calls_table[API_GETC] = &API_getc;
|
||||||
|
calls_table[API_PUTC] = &API_putc;
|
||||||
|
calls_table[API_TSTC] = &API_tstc;
|
||||||
|
calls_table[API_PUTS] = &API_puts;
|
||||||
|
calls_table[API_RESET] = &API_reset;
|
||||||
|
calls_table[API_GET_SYS_INFO] = &API_get_sys_info;
|
||||||
|
calls_table[API_UDELAY] = &API_udelay;
|
||||||
|
calls_table[API_GET_TIMER] = &API_get_timer;
|
||||||
|
calls_table[API_DEV_ENUM] = &API_dev_enum;
|
||||||
|
calls_table[API_DEV_OPEN] = &API_dev_open;
|
||||||
|
calls_table[API_DEV_CLOSE] = &API_dev_close;
|
||||||
|
calls_table[API_DEV_READ] = &API_dev_read;
|
||||||
|
calls_table[API_DEV_WRITE] = &API_dev_write;
|
||||||
|
calls_table[API_ENV_GET] = &API_env_get;
|
||||||
|
calls_table[API_ENV_SET] = &API_env_set;
|
||||||
|
calls_table[API_ENV_ENUM] = &API_env_enum;
|
||||||
|
calls_no = API_MAXCALL;
|
||||||
|
|
||||||
|
debugf("API initialized with %d calls\n", calls_no);
|
||||||
|
|
||||||
|
dev_stor_init();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Produce the signature so the API consumers can find it
|
||||||
|
*/
|
||||||
|
sig = malloc(sizeof(struct api_signature));
|
||||||
|
if (sig == NULL) {
|
||||||
|
printf("API: could not allocate memory for the signature!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
debugf("API sig @ 0x%08x\n", sig);
|
||||||
|
memcpy(sig->magic, API_SIG_MAGIC, 8);
|
||||||
|
sig->version = API_SIG_VERSION;
|
||||||
|
sig->syscall = &syscall;
|
||||||
|
sig->checksum = 0;
|
||||||
|
sig->checksum = crc32(0, (unsigned char *)sig,
|
||||||
|
sizeof(struct api_signature));
|
||||||
|
debugf("syscall entry: 0x%08x\n", sig->syscall);
|
||||||
|
}
|
||||||
|
|
||||||
|
void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long size,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!si->mr || !size || (flags == 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* find free slot */
|
||||||
|
for (i = 0; i < si->mr_no; i++)
|
||||||
|
if (si->mr[i].flags == 0) {
|
||||||
|
/* insert new mem region */
|
||||||
|
si->mr[i].start = start;
|
||||||
|
si->mr[i].size = size;
|
||||||
|
si->mr[i].flags = flags;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_API */
|
||||||
113
api/api_net.c
Normal file
113
api/api_net.c
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_API)
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <net.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
#define DEBUG
|
||||||
|
#undef DEBUG
|
||||||
|
|
||||||
|
#if !defined(CONFIG_NET_MULTI)
|
||||||
|
#error "API/net is currently only available for platforms with CONFIG_NET_MULTI"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||||
|
#else
|
||||||
|
#define debugf(fmt, args...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define errf(fmt, args...) do { printf("ERROR @ %s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||||
|
|
||||||
|
|
||||||
|
static int dev_valid_net(void *cookie)
|
||||||
|
{
|
||||||
|
return ((void *)eth_get_dev() == cookie) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_open_net(void *cookie)
|
||||||
|
{
|
||||||
|
if (!dev_valid_net(cookie))
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
if (eth_init(gd->bd) < 0)
|
||||||
|
return API_EIO;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_close_net(void *cookie)
|
||||||
|
{
|
||||||
|
if (!dev_valid_net(cookie))
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
eth_halt();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There can only be one active eth interface at a time - use what is
|
||||||
|
* currently set to eth_current
|
||||||
|
*/
|
||||||
|
int dev_enum_net(struct device_info *di)
|
||||||
|
{
|
||||||
|
struct eth_device *eth_current = eth_get_dev();
|
||||||
|
|
||||||
|
di->type = DEV_TYP_NET;
|
||||||
|
di->cookie = (void *)eth_current;
|
||||||
|
if (di->cookie == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
memcpy(di->di_net.hwaddr, eth_current->enetaddr, 6);
|
||||||
|
|
||||||
|
debugf("device found, returning cookie 0x%08x\n",
|
||||||
|
(u_int32_t)di->cookie);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_write_net(void *cookie, void *buf, int len)
|
||||||
|
{
|
||||||
|
/* XXX verify that cookie points to a valid net device??? */
|
||||||
|
|
||||||
|
return eth_send(buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_read_net(void *cookie, void *buf, int len)
|
||||||
|
{
|
||||||
|
/* XXX verify that cookie points to a valid net device??? */
|
||||||
|
|
||||||
|
return eth_receive(buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_API */
|
||||||
60
api/api_platform-arm.c
Normal file
60
api/api_platform-arm.c
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This file contains routines that fetch data from ARM-dependent sources
|
||||||
|
* (bd_info etc.)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_API)
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#include <asm/u-boot.h>
|
||||||
|
#include <asm/global_data.h>
|
||||||
|
|
||||||
|
#include "api_private.h"
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Important notice: handling of individual fields MUST be kept in sync with
|
||||||
|
* include/asm-arm/u-boot.h and include/asm-arm/global_data.h, so any changes
|
||||||
|
* need to reflect their current state and layout of structures involved!
|
||||||
|
*/
|
||||||
|
int platform_sys_info(struct sys_info *si)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
|
||||||
|
platform_set_mr(si, gd->bd->bi_dram[i].start,
|
||||||
|
gd->bd->bi_dram[i].size, MR_ATTR_DRAM);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_API */
|
||||||
79
api/api_platform-ppc.c
Normal file
79
api/api_platform-ppc.c
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This file contains routines that fetch data from PowerPC-dependent sources
|
||||||
|
* (bd_info etc.)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_API)
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#include <asm/u-boot.h>
|
||||||
|
#include <asm/global_data.h>
|
||||||
|
|
||||||
|
#include "api_private.h"
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Important notice: handling of individual fields MUST be kept in sync with
|
||||||
|
* include/asm-ppc/u-boot.h and include/asm-ppc/global_data.h, so any changes
|
||||||
|
* need to reflect their current state and layout of structures involved!
|
||||||
|
*/
|
||||||
|
int platform_sys_info(struct sys_info *si)
|
||||||
|
{
|
||||||
|
si->clk_bus = gd->bus_clk;
|
||||||
|
si->clk_cpu = gd->cpu_clk;
|
||||||
|
|
||||||
|
#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) || \
|
||||||
|
defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
|
||||||
|
#define bi_bar bi_immr_base
|
||||||
|
#elif defined(CONFIG_MPC5xxx)
|
||||||
|
#define bi_bar bi_mbar_base
|
||||||
|
#elif defined(CONFIG_MPC83XX)
|
||||||
|
#define bi_bar bi_immrbar
|
||||||
|
#elif defined(CONFIG_MPC8220)
|
||||||
|
#define bi_bar bi_mbar_base
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(bi_bar)
|
||||||
|
si->bar = gd->bd->bi_bar;
|
||||||
|
#undef bi_bar
|
||||||
|
#else
|
||||||
|
si->bar = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
platform_set_mr(si, gd->bd->bi_memstart, gd->bd->bi_memsize, MR_ATTR_DRAM);
|
||||||
|
platform_set_mr(si, gd->bd->bi_flashstart, gd->bd->bi_flashsize, MR_ATTR_FLASH);
|
||||||
|
platform_set_mr(si, gd->bd->bi_sramstart, gd->bd->bi_sramsize, MR_ATTR_SRAM);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_API */
|
||||||
48
api/api_private.h
Normal file
48
api/api_private.h
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _API_PRIVATE_H_
|
||||||
|
#define _API_PRIVATE_H_
|
||||||
|
|
||||||
|
void api_init(void);
|
||||||
|
void platform_set_mr(struct sys_info *, unsigned long, unsigned long, int);
|
||||||
|
int platform_sys_info(struct sys_info *);
|
||||||
|
|
||||||
|
void dev_enum_reset(void);
|
||||||
|
int dev_enum_storage(struct device_info *);
|
||||||
|
int dev_enum_net(struct device_info *);
|
||||||
|
|
||||||
|
int dev_open_stor(void *);
|
||||||
|
int dev_open_net(void *);
|
||||||
|
int dev_close_stor(void *);
|
||||||
|
int dev_close_net(void *);
|
||||||
|
|
||||||
|
lbasize_t dev_read_stor(void *, void *, lbasize_t, lbastart_t);
|
||||||
|
int dev_read_net(void *, void *, int);
|
||||||
|
int dev_write_net(void *, void *, int);
|
||||||
|
|
||||||
|
void dev_stor_init(void);
|
||||||
|
|
||||||
|
#endif /* _API_PRIVATE_H_ */
|
||||||
370
api/api_storage.c
Normal file
370
api/api_storage.c
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_API)
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#define DEBUG
|
||||||
|
#undef DEBUG
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||||
|
#else
|
||||||
|
#define debugf(fmt, args...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define errf(fmt, args...) do { printf("ERROR @ %s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||||
|
|
||||||
|
|
||||||
|
#define ENUM_IDE 0
|
||||||
|
#define ENUM_USB 1
|
||||||
|
#define ENUM_SCSI 2
|
||||||
|
#define ENUM_MMC 3
|
||||||
|
#define ENUM_MAX 4
|
||||||
|
|
||||||
|
struct stor_spec {
|
||||||
|
int max_dev;
|
||||||
|
int enum_started;
|
||||||
|
int enum_ended;
|
||||||
|
int type; /* "external" type: DT_STOR_{IDE,USB,etc} */
|
||||||
|
char name[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, "" }, };
|
||||||
|
|
||||||
|
|
||||||
|
void dev_stor_init(void)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_CMD_IDE)
|
||||||
|
specs[ENUM_IDE].max_dev = CFG_IDE_MAXDEVICE;
|
||||||
|
specs[ENUM_IDE].enum_started = 0;
|
||||||
|
specs[ENUM_IDE].enum_ended = 0;
|
||||||
|
specs[ENUM_IDE].type = DEV_TYP_STOR | DT_STOR_IDE;
|
||||||
|
specs[ENUM_IDE].name = "ide";
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_CMD_USB)
|
||||||
|
specs[ENUM_USB].max_dev = USB_MAX_STOR_DEV;
|
||||||
|
specs[ENUM_USB].enum_started = 0;
|
||||||
|
specs[ENUM_USB].enum_ended = 0;
|
||||||
|
specs[ENUM_USB].type = DEV_TYP_STOR | DT_STOR_USB;
|
||||||
|
specs[ENUM_USB].name = "usb";
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_CMD_SCSI)
|
||||||
|
specs[ENUM_SCSI].max_dev = CFG_SCSI_MAX_DEVICE;
|
||||||
|
specs[ENUM_SCSI].enum_started = 0;
|
||||||
|
specs[ENUM_SCSI].enum_ended = 0;
|
||||||
|
specs[ENUM_SCSI].type = DEV_TYP_STOR | DT_STOR_SCSI;
|
||||||
|
specs[ENUM_SCSI].name = "scsi";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Finds next available device in the storage group
|
||||||
|
*
|
||||||
|
* type: storage group type - ENUM_IDE, ENUM_SCSI etc.
|
||||||
|
*
|
||||||
|
* first: if 1 the first device in the storage group is returned (if
|
||||||
|
* exists), if 0 the next available device is searched
|
||||||
|
*
|
||||||
|
* more: returns 0/1 depending if there are more devices in this group
|
||||||
|
* available (for future iterations)
|
||||||
|
*
|
||||||
|
* returns: 0/1 depending if device found in this iteration
|
||||||
|
*/
|
||||||
|
static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||||
|
{
|
||||||
|
int found = 0;
|
||||||
|
*more = 0;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
block_dev_desc_t *dd;
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
di->cookie = (void *)get_dev(specs[type].name, 0);
|
||||||
|
found = 1;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < specs[type].max_dev; i++)
|
||||||
|
if (di->cookie == (void *)get_dev(specs[type].name, i)) {
|
||||||
|
/* previous cookie found -- advance to the
|
||||||
|
* next device, if possible */
|
||||||
|
|
||||||
|
if (++i >= specs[type].max_dev) {
|
||||||
|
/* out of range, no more to enum */
|
||||||
|
di->cookie = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
di->cookie = (void *)get_dev(specs[type].name, i);
|
||||||
|
found = 1;
|
||||||
|
|
||||||
|
/* provide hint if there are more devices in
|
||||||
|
* this group to enumerate */
|
||||||
|
if ((i + 1) < specs[type].max_dev)
|
||||||
|
*more = 1;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
di->type = specs[type].type;
|
||||||
|
|
||||||
|
if (di->cookie != NULL) {
|
||||||
|
dd = (block_dev_desc_t *)di->cookie;
|
||||||
|
if (dd->type == DEV_TYPE_UNKNOWN) {
|
||||||
|
debugf("device instance exists, but is not active..");
|
||||||
|
found = 0;
|
||||||
|
} else {
|
||||||
|
di->di_stor.block_count = dd->lba;
|
||||||
|
di->di_stor.block_size = dd->blksz;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else
|
||||||
|
di->cookie = NULL;
|
||||||
|
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* returns: ENUM_IDE, ENUM_USB etc. based on block_dev_desc_t
|
||||||
|
*/
|
||||||
|
static int dev_stor_type(block_dev_desc_t *dd)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
for (i = ENUM_IDE; i < ENUM_MAX; i++)
|
||||||
|
for (j = 0; j < specs[i].max_dev; j++)
|
||||||
|
if (dd == get_dev(specs[i].name, j))
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return ENUM_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* returns: 0/1 whether cookie points to some device in this group
|
||||||
|
*/
|
||||||
|
static int dev_is_stor(int type, struct device_info *di)
|
||||||
|
{
|
||||||
|
return (dev_stor_type(di->cookie) == type) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int dev_enum_stor(int type, struct device_info *di)
|
||||||
|
{
|
||||||
|
int found = 0, more = 0;
|
||||||
|
|
||||||
|
debugf("called, type %d\n", type);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Formulae for enumerating storage devices:
|
||||||
|
* 1. if cookie (hint from previous enum call) is NULL we start again
|
||||||
|
* with enumeration, so return the first available device, done.
|
||||||
|
*
|
||||||
|
* 2. if cookie is not NULL, check if it identifies some device in
|
||||||
|
* this group:
|
||||||
|
*
|
||||||
|
* 2a. if cookie is a storage device from our group (IDE, USB etc.),
|
||||||
|
* return next available (if exists) in this group
|
||||||
|
*
|
||||||
|
* 2b. if it isn't device from our group, check if such devices were
|
||||||
|
* ever enumerated before:
|
||||||
|
* - if not, return the first available device from this group
|
||||||
|
* - else return 0
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (di->cookie == NULL) {
|
||||||
|
|
||||||
|
debugf("group%d - enum restart\n", type);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Enumeration (re-)started: take the first available
|
||||||
|
* device, if exists
|
||||||
|
*/
|
||||||
|
found = dev_stor_get(type, 1, &more, di);
|
||||||
|
specs[type].enum_started = 1;
|
||||||
|
|
||||||
|
} else if (dev_is_stor(type, di)) {
|
||||||
|
|
||||||
|
debugf("group%d - enum continued for the next device\n", type);
|
||||||
|
|
||||||
|
if (specs[type].enum_ended) {
|
||||||
|
debugf("group%d - nothing more to enum!\n", type);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 2a. Attempt to take a next available device in the group */
|
||||||
|
found = dev_stor_get(type, 0, &more, di);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (specs[type].enum_ended) {
|
||||||
|
debugf("group %d - already enumerated, skipping\n", type);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
debugf("group%d - first time enum\n", type);
|
||||||
|
|
||||||
|
if (specs[type].enum_started == 0) {
|
||||||
|
/*
|
||||||
|
* 2b. If enumerating devices in this group did not
|
||||||
|
* happen before, it means the cookie pointed to a
|
||||||
|
* device frome some other group (another storage
|
||||||
|
* group, or network); in this case try to take the
|
||||||
|
* first available device from our group
|
||||||
|
*/
|
||||||
|
specs[type].enum_started = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Attempt to take the first device in this group:
|
||||||
|
*'first element' flag is set
|
||||||
|
*/
|
||||||
|
found = dev_stor_get(type, 1, &more, di);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
errf("group%d - out of order iteration\n", type);
|
||||||
|
found = 0;
|
||||||
|
more = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If there are no more devices in this group, consider its
|
||||||
|
* enumeration finished
|
||||||
|
*/
|
||||||
|
specs[type].enum_ended = (!more) ? 1 : 0;
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
debugf("device found, returning cookie 0x%08x\n",
|
||||||
|
(u_int32_t)di->cookie);
|
||||||
|
else
|
||||||
|
debugf("no device found\n");
|
||||||
|
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dev_enum_reset(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < ENUM_MAX; i ++) {
|
||||||
|
specs[i].enum_started = 0;
|
||||||
|
specs[i].enum_ended = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_enum_storage(struct device_info *di)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check: ide, usb, scsi, mmc
|
||||||
|
*/
|
||||||
|
for (i = ENUM_IDE; i < ENUM_MAX; i ++) {
|
||||||
|
if (dev_enum_stor(i, di))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dev_stor_is_valid(int type, block_dev_desc_t *dd)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < specs[type].max_dev; i++)
|
||||||
|
if (dd == get_dev(specs[type].name, i))
|
||||||
|
if (dd->type != DEV_TYPE_UNKNOWN)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int dev_open_stor(void *cookie)
|
||||||
|
{
|
||||||
|
int type = dev_stor_type(cookie);
|
||||||
|
|
||||||
|
if (type == ENUM_MAX)
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
if (dev_stor_is_valid(type, (block_dev_desc_t *)cookie))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return API_ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int dev_close_stor(void *cookie)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Not much to do as we actually do not alter storage devices upon
|
||||||
|
* close
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int dev_stor_index(block_dev_desc_t *dd)
|
||||||
|
{
|
||||||
|
int i, type;
|
||||||
|
|
||||||
|
type = dev_stor_type(dd);
|
||||||
|
for (i = 0; i < specs[type].max_dev; i++)
|
||||||
|
if (dd == get_dev(specs[type].name, i))
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return (specs[type].max_dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
|
||||||
|
{
|
||||||
|
int type;
|
||||||
|
block_dev_desc_t *dd = (block_dev_desc_t *)cookie;
|
||||||
|
|
||||||
|
if ((type = dev_stor_type(dd)) == ENUM_MAX)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!dev_stor_is_valid(type, dd))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if ((dd->block_read) == NULL) {
|
||||||
|
debugf("no block_read() for device 0x%08x\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dd->block_read(dev_stor_index(dd), start, len, buf));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_API */
|
||||||
109
api_examples/Makefile
Normal file
109
api_examples/Makefile
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2007 Semihalf
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundatio; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
ifeq ($(ARCH),ppc)
|
||||||
|
LOAD_ADDR = 0x40000
|
||||||
|
endif
|
||||||
|
|
||||||
|
#ifeq ($(ARCH),arm)
|
||||||
|
#LOAD_ADDR = 0xc100000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
ELF-$(CONFIG_API) += demo
|
||||||
|
BIN-$(CONFIG_API) += demo.bin
|
||||||
|
ELF := $(ELF-y)
|
||||||
|
BIN := $(BIN-y)
|
||||||
|
|
||||||
|
#CFLAGS += -v
|
||||||
|
|
||||||
|
COBJS-$(CONFIG_API) += $(ELF:=.o)
|
||||||
|
SOBJS-$(CONFIG_API) += crt0.o
|
||||||
|
ifeq ($(ARCH),ppc)
|
||||||
|
SOBJS-$(CONFIG_API) += ppcstring.o
|
||||||
|
endif
|
||||||
|
COBJS := $(COBJS-y)
|
||||||
|
SOBJS := $(SOBJS-y)
|
||||||
|
|
||||||
|
LIB = $(obj)libglue.a
|
||||||
|
LIBCOBJS-$(CONFIG_API) += glue.o crc32.o ctype.o string.o vsprintf.o \
|
||||||
|
libgenwrap.o
|
||||||
|
LIBCOBJS := $(LIBCOBJS-y)
|
||||||
|
|
||||||
|
LIBOBJS = $(addprefix $(obj),$(SOBJS) $(LIBCOBJS))
|
||||||
|
|
||||||
|
SRCS := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(SOBJS:.o=.S)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
ELF := $(addprefix $(obj),$(ELF))
|
||||||
|
BIN := $(addprefix $(obj),$(BIN))
|
||||||
|
|
||||||
|
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
||||||
|
|
||||||
|
CPPFLAGS += -I..
|
||||||
|
|
||||||
|
all: $(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
$(LIB): $(obj).depend $(LIBOBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||||
|
|
||||||
|
$(ELF):
|
||||||
|
$(obj)%: $(obj)%.o $(LIB)
|
||||||
|
$(LD) $(obj)crt0.o -Ttext $(LOAD_ADDR) \
|
||||||
|
-o $@ $< $(LIB) \
|
||||||
|
-L$(gcclibdir) -lgcc
|
||||||
|
|
||||||
|
$(BIN):
|
||||||
|
$(obj)%.bin: $(obj)%
|
||||||
|
$(OBJCOPY) -O binary $< $@ 2>/dev/null
|
||||||
|
|
||||||
|
$(obj)crc32.c:
|
||||||
|
@rm -f $(obj)crc32.c
|
||||||
|
ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
|
||||||
|
|
||||||
|
$(obj)ctype.c:
|
||||||
|
@rm -f $(obj)ctype.c
|
||||||
|
ln -s $(src)../lib_generic/ctype.c $(obj)ctype.c
|
||||||
|
|
||||||
|
$(obj)string.c:
|
||||||
|
@rm -f $(obj)string.c
|
||||||
|
ln -s $(src)../lib_generic/string.c $(obj)string.c
|
||||||
|
|
||||||
|
$(obj)vsprintf.c:
|
||||||
|
@rm -f $(obj)vsprintf.c
|
||||||
|
ln -s $(src)../lib_generic/vsprintf.c $(obj)vsprintf.c
|
||||||
|
|
||||||
|
ifeq ($(ARCH),ppc)
|
||||||
|
$(obj)ppcstring.S:
|
||||||
|
@rm -f $(obj)ppcstring.S
|
||||||
|
ln -s $(src)../lib_ppc/ppcstring.S $(obj)ppcstring.S
|
||||||
|
endif
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
50
api_examples/crt0.S
Normal file
50
api_examples/crt0.S
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(CONFIG_PPC)
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
.globl _start
|
||||||
|
_start:
|
||||||
|
b main
|
||||||
|
|
||||||
|
|
||||||
|
.globl syscall
|
||||||
|
syscall:
|
||||||
|
lis %r11, syscall_ptr@ha
|
||||||
|
addi %r11, %r11, syscall_ptr@l
|
||||||
|
lwz %r11, 0(%r11)
|
||||||
|
mtctr %r11
|
||||||
|
bctr
|
||||||
|
|
||||||
|
|
||||||
|
.globl syscall_ptr
|
||||||
|
syscall_ptr:
|
||||||
|
.align 4
|
||||||
|
.long 0
|
||||||
|
#else
|
||||||
|
#error No support for this arch!
|
||||||
|
#endif
|
||||||
258
api_examples/demo.c
Normal file
258
api_examples/demo.c
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#include "glue.h"
|
||||||
|
|
||||||
|
#define errf(fmt, args...) do { printf("ERROR @ %s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||||
|
|
||||||
|
void test_dump_si(struct sys_info *);
|
||||||
|
void test_dump_di(int);
|
||||||
|
void test_dump_sig(struct api_signature *);
|
||||||
|
|
||||||
|
char buf[2048];
|
||||||
|
|
||||||
|
#define WAIT_SECS 5
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int rv = 0;
|
||||||
|
int h, i, j;
|
||||||
|
int devs_no;
|
||||||
|
struct api_signature *sig = NULL;
|
||||||
|
ulong start, now;
|
||||||
|
struct device_info *di;
|
||||||
|
|
||||||
|
if (!api_search_sig(&sig))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
syscall_ptr = sig->syscall;
|
||||||
|
if (syscall_ptr == NULL)
|
||||||
|
return -2;
|
||||||
|
|
||||||
|
if (sig->version > API_SIG_VERSION)
|
||||||
|
return -3;
|
||||||
|
|
||||||
|
printf("API signature found @%x\n", sig);
|
||||||
|
test_dump_sig(sig);
|
||||||
|
|
||||||
|
printf("\n*** Consumer API test ***\n");
|
||||||
|
printf("syscall ptr 0x%08x@%08x\n", syscall_ptr, &syscall_ptr);
|
||||||
|
|
||||||
|
/* console activities */
|
||||||
|
ub_putc('B');
|
||||||
|
|
||||||
|
printf("*** Press any key to continue ***\n");
|
||||||
|
printf("got char 0x%x\n", ub_getc());
|
||||||
|
|
||||||
|
/* system info */
|
||||||
|
test_dump_si(ub_get_sys_info());
|
||||||
|
|
||||||
|
/* timing */
|
||||||
|
printf("\n*** Timing - wait a couple of secs ***\n");
|
||||||
|
start = ub_get_timer(0);
|
||||||
|
printf("\ntime: start %lu\n\n", start);
|
||||||
|
for (i = 0; i < WAIT_SECS; i++)
|
||||||
|
for (j = 0; j < 1000; j++)
|
||||||
|
ub_udelay(1000); /* wait 1 ms */
|
||||||
|
|
||||||
|
/* this is the number of milliseconds that passed from ub_get_timer(0) */
|
||||||
|
now = ub_get_timer(start);
|
||||||
|
printf("\ntime: now %lu\n\n", now);
|
||||||
|
|
||||||
|
/* enumerate devices */
|
||||||
|
printf("\n*** Enumerate devices ***\n");
|
||||||
|
devs_no = ub_dev_enum();
|
||||||
|
|
||||||
|
printf("Number of devices found: %d\n", devs_no);
|
||||||
|
if (devs_no == 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
|
||||||
|
printf("\n*** Show devices ***\n");
|
||||||
|
for (i = 0; i < devs_no; i++) {
|
||||||
|
test_dump_di(i);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\n*** Operations on devices ***\n");
|
||||||
|
|
||||||
|
/* test opening a device already opened */
|
||||||
|
h = 0;
|
||||||
|
if ((rv = ub_dev_open(h)) != 0) {
|
||||||
|
errf("open device %d error %d\n", h, rv);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if ((rv = ub_dev_open(h)) != 0)
|
||||||
|
errf("open device %d error %d\n", h, rv);
|
||||||
|
|
||||||
|
ub_dev_close(h);
|
||||||
|
|
||||||
|
/* test storage */
|
||||||
|
printf("Trying storage devices...\n");
|
||||||
|
for (i = 0; i < devs_no; i++) {
|
||||||
|
di = ub_dev_get(i);
|
||||||
|
|
||||||
|
if (di->type & DEV_TYP_STOR)
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (i == devs_no)
|
||||||
|
printf("No storage devices available\n");
|
||||||
|
else {
|
||||||
|
if ((rv = ub_dev_open(i)) != 0)
|
||||||
|
errf("open device %d error %d\n", i, rv);
|
||||||
|
else if ((rv = ub_dev_read(i, &buf, 200, 20)) != 0)
|
||||||
|
errf("could not read from device %d, error %d\n", i, rv);
|
||||||
|
|
||||||
|
ub_dev_close(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* test networking */
|
||||||
|
printf("Trying network devices...\n");
|
||||||
|
for (i = 0; i < devs_no; i++) {
|
||||||
|
di = ub_dev_get(i);
|
||||||
|
|
||||||
|
if (di->type == DEV_TYP_NET)
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (i == devs_no)
|
||||||
|
printf("No network devices available\n");
|
||||||
|
else {
|
||||||
|
if ((rv = ub_dev_open(i)) != 0)
|
||||||
|
errf("open device %d error %d\n", i, rv);
|
||||||
|
else if ((rv = ub_dev_send(i, &buf, 2048)) != 0)
|
||||||
|
errf("could not send to device %d, error %d\n", i, rv);
|
||||||
|
|
||||||
|
ub_dev_close(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ub_dev_close(h) != 0)
|
||||||
|
errf("could not close device %d\n", h);
|
||||||
|
|
||||||
|
printf("\n*** Env vars ***\n");
|
||||||
|
|
||||||
|
printf("ethact = %s\n", ub_env_get("ethact"));
|
||||||
|
printf("old fileaddr = %s\n", ub_env_get("fileaddr"));
|
||||||
|
ub_env_set("fileaddr", "deadbeef");
|
||||||
|
printf("new fileaddr = %s\n", ub_env_get("fileaddr"));
|
||||||
|
|
||||||
|
const char *env = NULL;
|
||||||
|
|
||||||
|
while ((env = ub_env_enum(env)) != NULL)
|
||||||
|
printf("%s = %s\n", env, ub_env_get(env));
|
||||||
|
|
||||||
|
/* reset */
|
||||||
|
ub_reset();
|
||||||
|
printf("\nHmm, reset returned...?!\n");
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_dump_sig(struct api_signature *sig)
|
||||||
|
{
|
||||||
|
printf("signature:\n");
|
||||||
|
printf(" version\t= %d\n", sig->version);
|
||||||
|
printf(" checksum\t= 0x%08x\n", sig->checksum);
|
||||||
|
printf(" sc entry\t= 0x%08x\n", sig->syscall);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_dump_si(struct sys_info *si)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
printf("sys info:\n");
|
||||||
|
printf(" clkbus\t= 0x%08x\n", si->clk_bus);
|
||||||
|
printf(" clkcpu\t= 0x%08x\n", si->clk_cpu);
|
||||||
|
printf(" bar\t\t= 0x%08x\n", si->bar);
|
||||||
|
|
||||||
|
printf("---\n");
|
||||||
|
for (i = 0; i < si->mr_no; i++) {
|
||||||
|
if (si->mr[i].flags == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
printf(" start\t= 0x%08lx\n", si->mr[i].start);
|
||||||
|
printf(" size\t= 0x%08lx\n", si->mr[i].size);
|
||||||
|
|
||||||
|
switch(si->mr[i].flags & 0x000F) {
|
||||||
|
case MR_ATTR_FLASH:
|
||||||
|
printf(" type FLASH\n");
|
||||||
|
break;
|
||||||
|
case MR_ATTR_DRAM:
|
||||||
|
printf(" type DRAM\n");
|
||||||
|
break;
|
||||||
|
case MR_ATTR_SRAM:
|
||||||
|
printf(" type SRAM\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf(" type UNKNOWN\n");
|
||||||
|
}
|
||||||
|
printf("---\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static char * test_stor_typ(int type)
|
||||||
|
{
|
||||||
|
if (type & DT_STOR_IDE)
|
||||||
|
return "IDE";
|
||||||
|
|
||||||
|
if (type & DT_STOR_SCSI)
|
||||||
|
return "SCSI";
|
||||||
|
|
||||||
|
if (type & DT_STOR_USB)
|
||||||
|
return "USB";
|
||||||
|
|
||||||
|
if (type & DT_STOR_MMC);
|
||||||
|
return "MMC";
|
||||||
|
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_dump_di(int handle)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct device_info *di = ub_dev_get(handle);
|
||||||
|
|
||||||
|
printf("device info (%d):\n", handle);
|
||||||
|
printf(" cookie\t= 0x%08x\n", (uint32_t)di->cookie);
|
||||||
|
printf(" type\t\t= 0x%08x\n", di->type);
|
||||||
|
|
||||||
|
if (di->type == DEV_TYP_NET) {
|
||||||
|
printf(" hwaddr\t= ");
|
||||||
|
for (i = 0; i < 6; i++)
|
||||||
|
printf("%02x ", di->di_net.hwaddr[i]);
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
} else if (di->type & DEV_TYP_STOR) {
|
||||||
|
printf(" type\t\t= %s\n", test_stor_typ(di->type));
|
||||||
|
printf(" blk size\t\t= %d\n", di->di_stor.block_size);
|
||||||
|
printf(" blk count\t\t= %d\n", di->di_stor.block_count);
|
||||||
|
}
|
||||||
|
}
|
||||||
405
api_examples/glue.c
Normal file
405
api_examples/glue.c
Normal file
@@ -0,0 +1,405 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#include "glue.h"
|
||||||
|
|
||||||
|
static int valid_sig(struct api_signature *sig)
|
||||||
|
{
|
||||||
|
uint32_t checksum;
|
||||||
|
struct api_signature s;
|
||||||
|
|
||||||
|
if (sig == NULL)
|
||||||
|
return 0;
|
||||||
|
/*
|
||||||
|
* Clear the checksum field (in the local copy) so as to calculate the
|
||||||
|
* CRC with the same initial contents as at the time when the sig was
|
||||||
|
* produced
|
||||||
|
*/
|
||||||
|
s = *sig;
|
||||||
|
s.checksum = 0;
|
||||||
|
|
||||||
|
checksum = crc32(0, (unsigned char *)&s, sizeof(struct api_signature));
|
||||||
|
|
||||||
|
if (checksum != sig->checksum)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Searches for the U-Boot API signature
|
||||||
|
*
|
||||||
|
* returns 1/0 depending on found/not found result
|
||||||
|
*/
|
||||||
|
int api_search_sig(struct api_signature **sig) {
|
||||||
|
|
||||||
|
unsigned char *sp;
|
||||||
|
|
||||||
|
if (sig == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
sp = (unsigned char *)API_SEARCH_START;
|
||||||
|
|
||||||
|
while ((sp + (int)API_SIG_MAGLEN) < (unsigned char *)API_SEARCH_END) {
|
||||||
|
if (!memcmp(sp, API_SIG_MAGIC, API_SIG_MAGLEN)) {
|
||||||
|
*sig = (struct api_signature *)sp;
|
||||||
|
if (valid_sig(*sig))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sp += API_SIG_MAGLEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
*sig = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************
|
||||||
|
*
|
||||||
|
* console
|
||||||
|
*
|
||||||
|
****************************************/
|
||||||
|
|
||||||
|
int ub_getc(void)
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
|
||||||
|
if (!syscall(API_GETC, NULL, (uint32_t)&c))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ub_tstc(void)
|
||||||
|
{
|
||||||
|
int t;
|
||||||
|
|
||||||
|
if (!syscall(API_TSTC, NULL, (uint32_t)&t))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ub_putc(char c)
|
||||||
|
{
|
||||||
|
syscall(API_PUTC, NULL, (uint32_t)&c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ub_puts(const char *s)
|
||||||
|
{
|
||||||
|
syscall(API_PUTS, NULL, (uint32_t)s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************
|
||||||
|
*
|
||||||
|
* system
|
||||||
|
*
|
||||||
|
****************************************/
|
||||||
|
|
||||||
|
void ub_reset(void)
|
||||||
|
{
|
||||||
|
syscall(API_RESET, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MR_MAX 5
|
||||||
|
static struct mem_region mr[MR_MAX];
|
||||||
|
static struct sys_info si;
|
||||||
|
|
||||||
|
struct sys_info * ub_get_sys_info(void)
|
||||||
|
{
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
memset(&si, 0, sizeof(struct sys_info));
|
||||||
|
si.mr = mr;
|
||||||
|
si.mr_no = MR_MAX;
|
||||||
|
memset(&mr, 0, sizeof(mr));
|
||||||
|
|
||||||
|
if (!syscall(API_GET_SYS_INFO, &err, (u_int32_t)&si))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return ((err) ? NULL : &si);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************
|
||||||
|
*
|
||||||
|
* timing
|
||||||
|
*
|
||||||
|
****************************************/
|
||||||
|
|
||||||
|
void ub_udelay(unsigned long usec)
|
||||||
|
{
|
||||||
|
syscall(API_UDELAY, NULL, &usec);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long ub_get_timer(unsigned long base)
|
||||||
|
{
|
||||||
|
unsigned long cur;
|
||||||
|
|
||||||
|
if (!syscall(API_GET_TIMER, NULL, &cur, &base))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* devices
|
||||||
|
*
|
||||||
|
* Devices are identified by handles: numbers 0, 1, 2, ..., MAX_DEVS-1
|
||||||
|
*
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#define MAX_DEVS 6
|
||||||
|
|
||||||
|
static struct device_info devices[MAX_DEVS];
|
||||||
|
|
||||||
|
struct device_info * ub_dev_get(int i)
|
||||||
|
{
|
||||||
|
return ((i < 0 || i >= MAX_DEVS) ? NULL : &devices[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enumerates the devices: fills out device_info elements in the devices[]
|
||||||
|
* array.
|
||||||
|
*
|
||||||
|
* returns: number of devices found
|
||||||
|
*/
|
||||||
|
int ub_dev_enum(void)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
memset(&devices, 0, sizeof(struct device_info) * MAX_DEVS);
|
||||||
|
di = &devices[0];
|
||||||
|
|
||||||
|
if (!syscall(API_DEV_ENUM, NULL, di))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
while (di->cookie != NULL) {
|
||||||
|
|
||||||
|
if (++n >= MAX_DEVS)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* take another device_info */
|
||||||
|
di++;
|
||||||
|
|
||||||
|
/* pass on the previous cookie */
|
||||||
|
di->cookie = devices[n - 1].cookie;
|
||||||
|
|
||||||
|
if (!syscall(API_DEV_ENUM, NULL, di))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* handle: 0-based id of the device
|
||||||
|
*
|
||||||
|
* returns: 0 when OK, err otherwise
|
||||||
|
*/
|
||||||
|
int ub_dev_open(int handle)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
if (handle < 0 || handle >= MAX_DEVS)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
di = &devices[handle];
|
||||||
|
|
||||||
|
if (!syscall(API_DEV_OPEN, &err, di))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ub_dev_close(int handle)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
|
||||||
|
if (handle < 0 || handle >= MAX_DEVS)
|
||||||
|
return API_EINVAL;
|
||||||
|
|
||||||
|
di = &devices[handle];
|
||||||
|
if (!syscall(API_DEV_CLOSE, NULL, di))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Validates device for read/write, it has to:
|
||||||
|
*
|
||||||
|
* - have sane handle
|
||||||
|
* - be opened
|
||||||
|
*
|
||||||
|
* returns: 0/1 accordingly
|
||||||
|
*/
|
||||||
|
static int dev_valid(int handle)
|
||||||
|
{
|
||||||
|
if (handle < 0 || handle >= MAX_DEVS)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (devices[handle].state != DEV_STA_OPEN)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dev_stor_valid(int handle)
|
||||||
|
{
|
||||||
|
if (!dev_valid(handle))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!(devices[handle].type & DEV_TYP_STOR))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ub_dev_read(int handle, void *buf, lbasize_t len, lbastart_t start)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
lbasize_t act_len;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
if (!dev_stor_valid(handle))
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
di = &devices[handle];
|
||||||
|
if (!syscall(API_DEV_READ, &err, di, buf, &len, &start, &act_len))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
if (act_len != len)
|
||||||
|
return API_EIO;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dev_net_valid(int handle)
|
||||||
|
{
|
||||||
|
if (!dev_valid(handle))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (devices[handle].type != DEV_TYP_NET)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ub_dev_recv(int handle, void *buf, int len)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
int err = 0, act_len;
|
||||||
|
|
||||||
|
if (!dev_net_valid(handle))
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
di = &devices[handle];
|
||||||
|
if (!syscall(API_DEV_READ, &err, di, buf, &len, &act_len))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return act_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ub_dev_send(int handle, void *buf, int len)
|
||||||
|
{
|
||||||
|
struct device_info *di;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
if (!dev_net_valid(handle))
|
||||||
|
return API_ENODEV;
|
||||||
|
|
||||||
|
di = &devices[handle];
|
||||||
|
if (!syscall(API_DEV_WRITE, &err, di, buf, &len))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************
|
||||||
|
*
|
||||||
|
* env vars
|
||||||
|
*
|
||||||
|
****************************************/
|
||||||
|
|
||||||
|
char * ub_env_get(const char *name)
|
||||||
|
{
|
||||||
|
char *value;
|
||||||
|
|
||||||
|
if (!syscall(API_ENV_GET, NULL, (uint32_t)name, (uint32_t)&value))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ub_env_set(const char *name, char *value)
|
||||||
|
{
|
||||||
|
syscall(API_ENV_SET, NULL, (uint32_t)name, (uint32_t)value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static char env_name[256];
|
||||||
|
|
||||||
|
const char * ub_env_enum(const char *last)
|
||||||
|
{
|
||||||
|
const char *env, *str;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
env = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It's OK to pass only the name piece as last (and not the whole
|
||||||
|
* 'name=val' string), since the API_ENUM_ENV call uses envmatch()
|
||||||
|
* internally, which handles such case
|
||||||
|
*/
|
||||||
|
if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!env)
|
||||||
|
/* no more env. variables to enumerate */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* next enumerated env var */
|
||||||
|
memset(env_name, 0, 256);
|
||||||
|
for (i = 0, str = env; *str != '=' && *str != '\0';)
|
||||||
|
env_name[i++] = *str++;
|
||||||
|
|
||||||
|
env_name[i] = '\0';
|
||||||
|
|
||||||
|
return env_name;
|
||||||
|
}
|
||||||
76
api_examples/glue.h
Normal file
76
api_examples/glue.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the header file for conveniency wrapper routines (API glue)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _API_GLUE_H_
|
||||||
|
#define _API_GLUE_H_
|
||||||
|
|
||||||
|
#define API_SEARCH_START (255 * 1024 * 1024) /* start at 1MB below top RAM */
|
||||||
|
#define API_SEARCH_END (256 * 1024 * 1024 - 1) /* ...and search to the end */
|
||||||
|
|
||||||
|
int syscall(int, int *, ...);
|
||||||
|
void * syscall_ptr;
|
||||||
|
|
||||||
|
int api_search_sig(struct api_signature **sig);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ub_ library calls are part of the application, not U-Boot code! They are
|
||||||
|
* front-end wrappers that are used by the consumer application: they prepare
|
||||||
|
* arguments for particular syscall and jump to the low level syscall()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* console */
|
||||||
|
int ub_getc(void);
|
||||||
|
int ub_tstc(void);
|
||||||
|
void ub_putc(char c);
|
||||||
|
void ub_puts(const char *s);
|
||||||
|
|
||||||
|
/* system */
|
||||||
|
void ub_reset(void);
|
||||||
|
struct sys_info * ub_get_sys_info(void);
|
||||||
|
|
||||||
|
/* time */
|
||||||
|
void ub_udelay(unsigned long);
|
||||||
|
unsigned long ub_get_timer(unsigned long);
|
||||||
|
|
||||||
|
/* env vars */
|
||||||
|
char * ub_env_get(const char *name);
|
||||||
|
void ub_env_set(const char *name, char *value);
|
||||||
|
const char * ub_env_enum(const char *last);
|
||||||
|
|
||||||
|
/* devices */
|
||||||
|
int ub_dev_enum(void);
|
||||||
|
int ub_dev_open(int handle);
|
||||||
|
int ub_dev_close(int handle);
|
||||||
|
int ub_dev_read(int handle, void *buf,
|
||||||
|
lbasize_t len, lbastart_t start);
|
||||||
|
int ub_dev_send(int handle, void *buf, int len);
|
||||||
|
int ub_dev_recv(int handle, void *buf, int len);
|
||||||
|
struct device_info * ub_dev_get(int);
|
||||||
|
|
||||||
|
#endif /* _API_GLUE_H_ */
|
||||||
95
api_examples/libgenwrap.c
Normal file
95
api_examples/libgenwrap.c
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007 Semihalf
|
||||||
|
*
|
||||||
|
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This is is a set of wrappers/stubs that allow to use certain routines from
|
||||||
|
* U-Boot's lib_generic in the standalone app. This way way we can re-use
|
||||||
|
* existing code e.g. operations on strings and similar.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <api_public.h>
|
||||||
|
|
||||||
|
#include "glue.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* printf() and vprintf() are stolen from u-boot/common/console.c
|
||||||
|
*/
|
||||||
|
void printf (const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
uint i;
|
||||||
|
char printbuffer[256];
|
||||||
|
|
||||||
|
va_start (args, fmt);
|
||||||
|
|
||||||
|
/* For this to work, printbuffer must be larger than
|
||||||
|
* anything we ever want to print.
|
||||||
|
*/
|
||||||
|
i = vsprintf (printbuffer, fmt, args);
|
||||||
|
va_end (args);
|
||||||
|
|
||||||
|
/* Print the string */
|
||||||
|
ub_puts (printbuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void vprintf (const char *fmt, va_list args)
|
||||||
|
{
|
||||||
|
uint i;
|
||||||
|
char printbuffer[256];
|
||||||
|
|
||||||
|
/* For this to work, printbuffer must be larger than
|
||||||
|
* anything we ever want to print.
|
||||||
|
*/
|
||||||
|
i = vsprintf (printbuffer, fmt, args);
|
||||||
|
|
||||||
|
/* Print the string */
|
||||||
|
ub_puts (printbuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void putc (const char c)
|
||||||
|
{
|
||||||
|
ub_putc(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void udelay(unsigned long usec)
|
||||||
|
{
|
||||||
|
ub_udelay(usec);
|
||||||
|
}
|
||||||
|
|
||||||
|
void do_reset (void)
|
||||||
|
{
|
||||||
|
ub_reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void *malloc (size_t len)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void hang (void)
|
||||||
|
{
|
||||||
|
while (1) ;
|
||||||
|
}
|
||||||
@@ -21,4 +21,12 @@
|
|||||||
# MA 02111-1307 USA
|
# MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN -D__BLACKFIN__
|
PLATFORM_RELFLAGS += -ffixed-P5
|
||||||
|
PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
|
||||||
|
|
||||||
|
SYM_PREFIX = _
|
||||||
|
|
||||||
|
LDR_FLAGS += --use-vmas
|
||||||
|
ifeq (,$(findstring s,$(MAKEFLAGS)))
|
||||||
|
LDR_FLAGS += --quiet
|
||||||
|
endif
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ uint mii_send(uint mii_cmd)
|
|||||||
|
|
||||||
return (mii_reply & 0xffff); /* data read from phy */
|
return (mii_reply & 0xffff); /* data read from phy */
|
||||||
}
|
}
|
||||||
#endif /* CFG_DISCOVER_PHY || (CONFIG_COMMANDS & CONFIG_CMD_MII) */
|
#endif /* CFG_DISCOVER_PHY || CONFIG_CMD_MII */
|
||||||
|
|
||||||
#if defined(CFG_DISCOVER_PHY)
|
#if defined(CFG_DISCOVER_PHY)
|
||||||
int mii_discover_phy(struct eth_device *dev)
|
int mii_discover_phy(struct eth_device *dev)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
_sbss = .;
|
_sbss = .;
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
50
board/actux1/Makefile
Normal file
50
board/actux1/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2000-2006
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS := actux1.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
160
board/actux1/actux1.c
Normal file
160
board/actux1/actux1.c
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* (C) Copyright 2006
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||||
|
* Marius Groeger <mgroeger@sysgo.de>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <asm/arch/ixp425.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
#include <miiphy.h>
|
||||||
|
|
||||||
|
#include "actux1_hw.h"
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
int board_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_arch_number = MACH_TYPE_ACTUX1;
|
||||||
|
|
||||||
|
/* adress of boot parameters */
|
||||||
|
gd->bd->bi_boot_params = 0x00000100;
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_IORST);
|
||||||
|
|
||||||
|
/* Setup GPIO's for PCI INTA */
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_PCI1_INTA);
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_PCI1_INTA);
|
||||||
|
|
||||||
|
/* Setup GPIO's for 33MHz clock output */
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_PCI_CLK);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_EXTBUS_CLK);
|
||||||
|
*IXP425_GPIO_GPCLKR = 0x011001FF;
|
||||||
|
|
||||||
|
/* CS5: Debug port */
|
||||||
|
*IXP425_EXP_CS5 = 0x9d520003;
|
||||||
|
/* CS6: HwRel */
|
||||||
|
*IXP425_EXP_CS6 = 0x81860001;
|
||||||
|
/* CS7: LEDs */
|
||||||
|
*IXP425_EXP_CS7 = 0x80900003;
|
||||||
|
|
||||||
|
udelay (533);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_IORST);
|
||||||
|
|
||||||
|
ACTUX1_LED1 (2);
|
||||||
|
ACTUX1_LED2 (2);
|
||||||
|
ACTUX1_LED3 (0);
|
||||||
|
ACTUX1_LED4 (0);
|
||||||
|
ACTUX1_LED5 (0);
|
||||||
|
ACTUX1_LED6 (0);
|
||||||
|
ACTUX1_LED7 (0);
|
||||||
|
|
||||||
|
ACTUX1_HS (ACTUX1_HS_DCD);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check Board Identity
|
||||||
|
*/
|
||||||
|
int checkboard (void)
|
||||||
|
{
|
||||||
|
char *s = getenv ("serial#");
|
||||||
|
|
||||||
|
puts ("Board: AcTux-1 rev.");
|
||||||
|
putc (ACTUX1_BOARDREL + 'A' - 1);
|
||||||
|
|
||||||
|
if (s != NULL) {
|
||||||
|
puts (", serial# ");
|
||||||
|
puts (s);
|
||||||
|
}
|
||||||
|
putc ('\n');
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* get_board_rev() - setup to pass kernel board revision information
|
||||||
|
* 0 = reserved
|
||||||
|
* 1 = Rev. A
|
||||||
|
* 2 = Rev. B
|
||||||
|
*************************************************************************/
|
||||||
|
u32 get_board_rev (void)
|
||||||
|
{
|
||||||
|
return ACTUX1_BOARDREL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||||
|
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
|
||||||
|
extern struct pci_controller hose;
|
||||||
|
extern void pci_ixp_init (struct pci_controller *hose);
|
||||||
|
|
||||||
|
void pci_init_board (void)
|
||||||
|
{
|
||||||
|
extern void pci_ixp_init (struct pci_controller *hose);
|
||||||
|
pci_ixp_init (&hose);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void reset_phy (void)
|
||||||
|
{
|
||||||
|
u16 id1, id2;
|
||||||
|
|
||||||
|
/* initialize the PHY */
|
||||||
|
miiphy_reset ("NPE0", CONFIG_PHY_ADDR);
|
||||||
|
|
||||||
|
miiphy_read ("NPE0", CONFIG_PHY_ADDR, PHY_PHYIDR1, &id1);
|
||||||
|
miiphy_read ("NPE0", CONFIG_PHY_ADDR, PHY_PHYIDR2, &id2);
|
||||||
|
|
||||||
|
id2 &= 0xFFF0; /* mask out revision bits */
|
||||||
|
|
||||||
|
if (id1 == 0x13 && id2 == 0x78e0) {
|
||||||
|
/*
|
||||||
|
* LXT971/LXT972 PHY: set LED outputs:
|
||||||
|
* LED1(green) = Link/ACT,
|
||||||
|
* LED2 (unused) = LINK,
|
||||||
|
* LED3(red) = Coll
|
||||||
|
*/
|
||||||
|
miiphy_write ("NPE0", CONFIG_PHY_ADDR, 20, 0xD432);
|
||||||
|
} else if (id1 == 0x143 && id2 == 0xbc30) {
|
||||||
|
/* BCM5241: default values are OK */
|
||||||
|
} else
|
||||||
|
printf ("unknown ethernet PHY ID: %x %x\n", id1, id2);
|
||||||
|
}
|
||||||
57
board/actux1/actux1_hw.h
Normal file
57
board/actux1/actux1_hw.h
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* hardware register definitions for the AcTux-1 board.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ACTUX1_HW_H
|
||||||
|
#define _ACTUX1_HW_H
|
||||||
|
|
||||||
|
/* 0 = LED off,1 = green, 2 = red, 3 = orange */
|
||||||
|
#define ACTUX1_LED1(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 0)
|
||||||
|
#define ACTUX1_LED2(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 1)
|
||||||
|
#define ACTUX1_LED3(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 2)
|
||||||
|
#define ACTUX1_LED4(a) writeb((a)^3, IXP425_EXP_BUS_CS7_BASE_PHYS + 3)
|
||||||
|
#define ACTUX1_LED5(a) writeb((a)^3, IXP425_EXP_BUS_CS7_BASE_PHYS + 4)
|
||||||
|
#define ACTUX1_LED6(a) writeb((a)^3, IXP425_EXP_BUS_CS7_BASE_PHYS + 5)
|
||||||
|
#define ACTUX1_LED7(a) writeb((a)^3, IXP425_EXP_BUS_CS7_BASE_PHYS + 6)
|
||||||
|
#define ACTUX1_HS(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 7)
|
||||||
|
#define ACTUX1_HS_DCD 0x01
|
||||||
|
#define ACTUX1_HS_DSR 0x02
|
||||||
|
|
||||||
|
#define ACTUX1_DBG_PORT IXP425_EXP_BUS_CS5_BASE_PHYS
|
||||||
|
#define ACTUX1_BOARDREL (readb(IXP425_EXP_BUS_CS6_BASE_PHYS) & 0x0F)
|
||||||
|
|
||||||
|
/* GPIO settings */
|
||||||
|
#define CFG_GPIO_PCI1_INTA 2
|
||||||
|
#define CFG_GPIO_PCI2_INTA 3
|
||||||
|
#define CFG_GPIO_I2C_SDA 4
|
||||||
|
#define CFG_GPIO_I2C_SCL 5
|
||||||
|
#define CFG_GPIO_DBGJUMPER 9
|
||||||
|
#define CFG_GPIO_BUTTON1 10
|
||||||
|
#define CFG_GPIO_DBGSENSE 11
|
||||||
|
#define CFG_GPIO_DTR 12
|
||||||
|
#define CFG_GPIO_IORST 13 /* Out */
|
||||||
|
#define CFG_GPIO_PCI_CLK 14 /* Out */
|
||||||
|
#define CFG_GPIO_EXTBUS_CLK 15 /* Out */
|
||||||
|
|
||||||
|
#endif
|
||||||
4
board/actux1/config.mk
Normal file
4
board/actux1/config.mk
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
TEXT_BASE = 0x00e00000
|
||||||
|
|
||||||
|
# include NPE ethernet driver
|
||||||
|
BOARDLIBS = cpu/ixp/npe/libnpe.a
|
||||||
69
board/actux1/u-boot.lds
Normal file
69
board/actux1/u-boot.lds
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_FORMAT ("elf32-bigarm", "elf32-bigarm", "elf32-bigarm")
|
||||||
|
OUTPUT_ARCH (arm)
|
||||||
|
ENTRY (_start)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x00000000;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.text : {
|
||||||
|
cpu/ixp/start.o(.text)
|
||||||
|
lib_generic/string.o(.text)
|
||||||
|
lib_generic/vsprintf.o(.text)
|
||||||
|
lib_arm/board.o(.text)
|
||||||
|
common/dlmalloc.o(.text)
|
||||||
|
cpu/ixp/cpu.o(.text)
|
||||||
|
. = env_offset;
|
||||||
|
common/environment.o(.ppcenv)
|
||||||
|
* (.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.rodata : {
|
||||||
|
*(.rodata)
|
||||||
|
}
|
||||||
|
. = ALIGN (4);
|
||||||
|
.data : {
|
||||||
|
*(.data)
|
||||||
|
}
|
||||||
|
. = ALIGN (4);
|
||||||
|
.got : {
|
||||||
|
*(.got)
|
||||||
|
}
|
||||||
|
. =.;
|
||||||
|
__u_boot_cmd_start =.;
|
||||||
|
.u_boot_cmd : {
|
||||||
|
*(.u_boot_cmd)
|
||||||
|
}
|
||||||
|
__u_boot_cmd_end =.;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
__bss_start =.;
|
||||||
|
.bss (NOLOAD): {
|
||||||
|
*(.bss)
|
||||||
|
}
|
||||||
|
_end =.;
|
||||||
|
}
|
||||||
50
board/actux2/Makefile
Normal file
50
board/actux2/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2000-2006
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS := actux2.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
136
board/actux2/actux2.c
Normal file
136
board/actux2/actux2.c
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* (C) Copyright 2006
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||||
|
* Marius Groeger <mgroeger@sysgo.de>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <asm/arch/ixp425.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
#include <miiphy.h>
|
||||||
|
|
||||||
|
#include "actux2_hw.h"
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
int board_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_arch_number = MACH_TYPE_ACTUX2;
|
||||||
|
|
||||||
|
/* adress of boot parameters */
|
||||||
|
gd->bd->bi_boot_params = 0x00000100;
|
||||||
|
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_ETHRST);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_DSR);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_DCD);
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_ETHRST);
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_DSR);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_DCD);
|
||||||
|
|
||||||
|
/* Setup GPIO's for Interrupt inputs */
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_DBGINT);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_ETHINT);
|
||||||
|
|
||||||
|
/* Setup GPIO's for 33MHz clock output */
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_PCI_CLK);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_EXTBUS_CLK);
|
||||||
|
*IXP425_GPIO_GPCLKR = 0x011001FF;
|
||||||
|
|
||||||
|
/* CS1: IPAC-X */
|
||||||
|
*IXP425_EXP_CS1 = 0x94d10013;
|
||||||
|
/* CS5: Debug port */
|
||||||
|
*IXP425_EXP_CS5 = 0x9d520003;
|
||||||
|
/* CS6: HW release register */
|
||||||
|
*IXP425_EXP_CS6 = 0x81860001;
|
||||||
|
/* CS7: LEDs */
|
||||||
|
*IXP425_EXP_CS7 = 0x80900003;
|
||||||
|
|
||||||
|
udelay (533);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_ETHRST);
|
||||||
|
|
||||||
|
ACTUX2_LED1 (1);
|
||||||
|
ACTUX2_LED2 (0);
|
||||||
|
ACTUX2_LED3 (0);
|
||||||
|
ACTUX2_LED4 (0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check Board Identity
|
||||||
|
*/
|
||||||
|
int checkboard (void)
|
||||||
|
{
|
||||||
|
char *s = getenv ("serial#");
|
||||||
|
|
||||||
|
puts ("Board: AcTux-2 rev.");
|
||||||
|
putc (ACTUX2_BOARDREL + 'A' - 1);
|
||||||
|
|
||||||
|
if (s != NULL) {
|
||||||
|
puts (", serial# ");
|
||||||
|
puts (s);
|
||||||
|
}
|
||||||
|
putc ('\n');
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||||
|
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* get_board_rev() - setup to pass kernel board revision information
|
||||||
|
* 0 = reserved
|
||||||
|
* 1 = Rev. A
|
||||||
|
* 2 = Rev. B
|
||||||
|
*************************************************************************/
|
||||||
|
u32 get_board_rev (void)
|
||||||
|
{
|
||||||
|
return ACTUX2_BOARDREL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_phy (void)
|
||||||
|
{
|
||||||
|
/* init IcPlus IP175C ethernet switch to native IP175C mode */
|
||||||
|
miiphy_write ("NPE0", 29, 31, 0x175C);
|
||||||
|
}
|
||||||
59
board/actux2/actux2_hw.h
Normal file
59
board/actux2/actux2_hw.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* hardware register definitions for the AcTux-2 board.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ACTUX2_HW_H
|
||||||
|
#define _ACTUX2_HW_H
|
||||||
|
|
||||||
|
/* 0 = LED off,1 = green, 2 = red, 3 = orange */
|
||||||
|
#define ACTUX2_LED1(a) writeb((a ? 2 : 0), IXP425_EXP_BUS_CS7_BASE_PHYS + 0)
|
||||||
|
#define ACTUX2_LED2(a) writeb((a ? 2 : 0), IXP425_EXP_BUS_CS7_BASE_PHYS + 1)
|
||||||
|
#define ACTUX2_LED3(a) writeb((a ? 0 : 2), IXP425_EXP_BUS_CS7_BASE_PHYS + 2)
|
||||||
|
#define ACTUX2_LED4(a) writeb((a ? 0 : 2), IXP425_EXP_BUS_CS7_BASE_PHYS + 3)
|
||||||
|
|
||||||
|
#define ACTUX2_DBG_PORT IXP425_EXP_BUS_CS5_BASE_PHYS
|
||||||
|
#define ACTUX2_BOARDREL (readb(IXP425_EXP_BUS_CS6_BASE_PHYS) & 0x0F)
|
||||||
|
#define ACTUX2_OPTION (readb(IXP425_EXP_BUS_CS6_BASE_PHYS) & 0xF0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GPIO settings
|
||||||
|
*/
|
||||||
|
#define CFG_GPIO_DBGINT 0
|
||||||
|
#define CFG_GPIO_ETHINT 1
|
||||||
|
#define CFG_GPIO_ETHRST 2 /* Out */
|
||||||
|
#define CFG_GPIO_LED5_GN 3 /* Out */
|
||||||
|
#define CFG_GPIO_UNUSED4 4
|
||||||
|
#define CFG_GPIO_UNUSED5 5
|
||||||
|
#define CFG_GPIO_DSR 6 /* Out */
|
||||||
|
#define CFG_GPIO_DCD 7 /* Out */
|
||||||
|
#define CFG_GPIO_IPAC_INT 8
|
||||||
|
#define CFG_GPIO_DBGJUMPER 9
|
||||||
|
#define CFG_GPIO_BUTTON1 10
|
||||||
|
#define CFG_GPIO_DBGSENSE 11
|
||||||
|
#define CFG_GPIO_DTR 12
|
||||||
|
#define CFG_GPIO_IORST 13 /* Out */
|
||||||
|
#define CFG_GPIO_PCI_CLK 14 /* Out */
|
||||||
|
#define CFG_GPIO_EXTBUS_CLK 15 /* Out */
|
||||||
|
|
||||||
|
#endif
|
||||||
4
board/actux2/config.mk
Normal file
4
board/actux2/config.mk
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
TEXT_BASE = 0x00e00000
|
||||||
|
|
||||||
|
# include NPE ethernet driver
|
||||||
|
BOARDLIBS = cpu/ixp/npe/libnpe.a
|
||||||
74
board/actux2/u-boot.lds
Normal file
74
board/actux2/u-boot.lds
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_FORMAT ("elf32-bigarm", "elf32-bigarm", "elf32-bigarm")
|
||||||
|
OUTPUT_ARCH (arm)
|
||||||
|
ENTRY (_start)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x00000000;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.text : {
|
||||||
|
cpu/ixp/start.o(.text)
|
||||||
|
lib_generic/string.o(.text)
|
||||||
|
lib_generic/vsprintf.o(.text)
|
||||||
|
lib_arm/board.o(.text)
|
||||||
|
common/dlmalloc.o(.text)
|
||||||
|
cpu/ixp/cpu.o(.text)
|
||||||
|
|
||||||
|
. = env_offset;
|
||||||
|
common/environment.o (.ppcenv)
|
||||||
|
|
||||||
|
* (.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.rodata : {
|
||||||
|
*(.rodata)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.data : {
|
||||||
|
*(.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.got : {
|
||||||
|
*(.got)
|
||||||
|
}
|
||||||
|
|
||||||
|
. =.;
|
||||||
|
__u_boot_cmd_start =.;
|
||||||
|
.u_boot_cmd : {
|
||||||
|
*(.u_boot_cmd)
|
||||||
|
}
|
||||||
|
__u_boot_cmd_end =.;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
__bss_start =.;
|
||||||
|
.bss (NOLOAD): {
|
||||||
|
*(.bss)
|
||||||
|
}
|
||||||
|
_end =.;
|
||||||
|
}
|
||||||
50
board/actux3/Makefile
Normal file
50
board/actux3/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2000-2006
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS := actux3.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
164
board/actux3/actux3.c
Normal file
164
board/actux3/actux3.c
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* (C) Copyright 2006
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||||
|
* Marius Groeger <mgroeger@sysgo.de>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <asm/arch/ixp425.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
#include <miiphy.h>
|
||||||
|
|
||||||
|
#include "actux3_hw.h"
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
int board_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_arch_number = MACH_TYPE_ACTUX3;
|
||||||
|
|
||||||
|
/* adress of boot parameters */
|
||||||
|
gd->bd->bi_boot_params = 0x00000100;
|
||||||
|
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_ETHRST);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_DSR);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_DCD);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_LED5_GN);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_LED6_RT);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_LED6_GN);
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_ETHRST);
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_DSR);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_DCD);
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_LED5_GN);
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_LED6_RT);
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_LED6_GN);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setup GPIO's for Interrupt inputs
|
||||||
|
*/
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_DBGINT);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_ETHINT);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setup GPIO's for 33MHz clock output
|
||||||
|
*/
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_PCI_CLK);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_EXTBUS_CLK);
|
||||||
|
*IXP425_GPIO_GPCLKR = 0x011001FF;
|
||||||
|
|
||||||
|
/* CS1: IPAC-X */
|
||||||
|
*IXP425_EXP_CS1 = 0x94d10013;
|
||||||
|
/* CS5: Debug port */
|
||||||
|
*IXP425_EXP_CS5 = 0x9d520003;
|
||||||
|
/* CS6: Release/Option register */
|
||||||
|
*IXP425_EXP_CS6 = 0x81860001;
|
||||||
|
/* CS7: LEDs */
|
||||||
|
*IXP425_EXP_CS7 = 0x80900003;
|
||||||
|
|
||||||
|
udelay (533);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_ETHRST);
|
||||||
|
|
||||||
|
ACTUX3_LED1_RT (1);
|
||||||
|
ACTUX3_LED1_GN (0);
|
||||||
|
ACTUX3_LED2_RT (0);
|
||||||
|
ACTUX3_LED2_GN (0);
|
||||||
|
ACTUX3_LED3_RT (0);
|
||||||
|
ACTUX3_LED3_GN (0);
|
||||||
|
ACTUX3_LED4_GN (0);
|
||||||
|
ACTUX3_LED5_RT (0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check Board Identity
|
||||||
|
*/
|
||||||
|
int checkboard (void)
|
||||||
|
{
|
||||||
|
char *s = getenv ("serial#");
|
||||||
|
|
||||||
|
puts ("Board: AcTux-3 rev.");
|
||||||
|
putc (ACTUX3_BOARDREL + 'A' - 1);
|
||||||
|
|
||||||
|
if (s != NULL) {
|
||||||
|
puts (", serial# ");
|
||||||
|
puts (s);
|
||||||
|
}
|
||||||
|
putc ('\n');
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* get_board_rev() - setup to pass kernel board revision information
|
||||||
|
* 0 = reserved
|
||||||
|
* 1 = Rev. A
|
||||||
|
* 2 = Rev. B
|
||||||
|
*************************************************************************/
|
||||||
|
u32 get_board_rev (void)
|
||||||
|
{
|
||||||
|
return ACTUX3_BOARDREL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||||
|
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_phy (void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* initialize the PHY */
|
||||||
|
miiphy_reset ("NPE0", CONFIG_PHY_ADDR);
|
||||||
|
|
||||||
|
/* all LED outputs = Link/Act */
|
||||||
|
miiphy_write ("NPE0", CONFIG_PHY_ADDR, 0x16, 0x0AAA);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Marvell 88E6060 switch comes up with all ports disabled.
|
||||||
|
* set all ethernet switch ports to forwarding state
|
||||||
|
*/
|
||||||
|
for (i = 1; i <= 5; i++)
|
||||||
|
miiphy_write ("NPE0", CONFIG_PHY_ADDR + 8 + i, 0x04, 0x03);
|
||||||
|
|
||||||
|
}
|
||||||
60
board/actux3/actux3_hw.h
Normal file
60
board/actux3/actux3_hw.h
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* hardware register definitions for the AcTux-3 board.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ACTUX3_HW_H
|
||||||
|
#define _ACTUX3_HW_H
|
||||||
|
|
||||||
|
/* 0 = LED off,1 = ON */
|
||||||
|
#define ACTUX3_LED1_RT(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 0)
|
||||||
|
#define ACTUX3_LED1_GN(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 1)
|
||||||
|
#define ACTUX3_LED2_RT(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 2)
|
||||||
|
#define ACTUX3_LED2_GN(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 3)
|
||||||
|
#define ACTUX3_LED3_RT(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 4)
|
||||||
|
#define ACTUX3_LED3_GN(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 5)
|
||||||
|
#define ACTUX3_LED4_GN(a) writeb((a)^1, IXP425_EXP_BUS_CS7_BASE_PHYS + 6)
|
||||||
|
#define ACTUX3_LED5_RT(a) writeb((a), IXP425_EXP_BUS_CS7_BASE_PHYS + 7)
|
||||||
|
|
||||||
|
#define ACTUX3_DBG_PORT IXP425_EXP_BUS_CS5_BASE_PHYS
|
||||||
|
#define ACTUX3_BOARDREL (readb(IXP425_EXP_BUS_CS6_BASE_PHYS) & 0x0F)
|
||||||
|
#define ACTUX3_OPTION (readb(IXP425_EXP_BUS_CS6_BASE_PHYS) & 0xF0)
|
||||||
|
|
||||||
|
/* GPIO settings */
|
||||||
|
#define CFG_GPIO_DBGINT 0
|
||||||
|
#define CFG_GPIO_ETHINT 1
|
||||||
|
#define CFG_GPIO_ETHRST 2 /* Out */
|
||||||
|
#define CFG_GPIO_LED5_GN 3 /* Out */
|
||||||
|
#define CFG_GPIO_LED6_RT 4 /* Out */
|
||||||
|
#define CFG_GPIO_LED6_GN 5 /* Out */
|
||||||
|
#define CFG_GPIO_DSR 6 /* Out */
|
||||||
|
#define CFG_GPIO_DCD 7 /* Out */
|
||||||
|
#define CFG_GPIO_DBGJUMPER 9
|
||||||
|
#define CFG_GPIO_BUTTON1 10
|
||||||
|
#define CFG_GPIO_DBGSENSE 11
|
||||||
|
#define CFG_GPIO_DTR 12
|
||||||
|
#define CFG_GPIO_IORST 13 /* Out */
|
||||||
|
#define CFG_GPIO_PCI_CLK 14 /* Out */
|
||||||
|
#define CFG_GPIO_EXTBUS_CLK 15 /* Out */
|
||||||
|
|
||||||
|
#endif
|
||||||
4
board/actux3/config.mk
Normal file
4
board/actux3/config.mk
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
TEXT_BASE = 0x00e00000
|
||||||
|
|
||||||
|
# include NPE ethernet driver
|
||||||
|
BOARDLIBS = cpu/ixp/npe/libnpe.a
|
||||||
74
board/actux3/u-boot.lds
Normal file
74
board/actux3/u-boot.lds
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_FORMAT ("elf32-bigarm", "elf32-bigarm", "elf32-bigarm")
|
||||||
|
OUTPUT_ARCH (arm)
|
||||||
|
ENTRY (_start)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x00000000;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.text : {
|
||||||
|
cpu/ixp/start.o (.text)
|
||||||
|
lib_generic/string.o (.text)
|
||||||
|
lib_generic/vsprintf.o (.text)
|
||||||
|
lib_arm/board.o (.text)
|
||||||
|
common/dlmalloc.o (.text)
|
||||||
|
cpu/ixp/cpu.o (.text)
|
||||||
|
|
||||||
|
. = env_offset;
|
||||||
|
common/environment.o (.ppcenv)
|
||||||
|
|
||||||
|
* (.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.rodata : {
|
||||||
|
*(.rodata)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.data : {
|
||||||
|
*(.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.got : {
|
||||||
|
*(.got)
|
||||||
|
}
|
||||||
|
|
||||||
|
. =.;
|
||||||
|
__u_boot_cmd_start =.;
|
||||||
|
.u_boot_cmd : {
|
||||||
|
*(.u_boot_cmd)
|
||||||
|
}
|
||||||
|
__u_boot_cmd_end =.;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
__bss_start =.;
|
||||||
|
.bss (NOLOAD): {
|
||||||
|
*(.bss)
|
||||||
|
}
|
||||||
|
_end =.;
|
||||||
|
}
|
||||||
50
board/actux4/Makefile
Normal file
50
board/actux4/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2000-2006
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS := actux4.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
132
board/actux4/actux4.c
Normal file
132
board/actux4/actux4.c
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* (C) Copyright 2006
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||||
|
*
|
||||||
|
* (C) Copyright 2002
|
||||||
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||||
|
* Marius Groeger <mgroeger@sysgo.de>
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <asm/arch/ixp425.h>
|
||||||
|
|
||||||
|
#include <miiphy.h>
|
||||||
|
|
||||||
|
#include "actux4_hw.h"
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
int board_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_arch_number = MACH_TYPE_ACTUX4;
|
||||||
|
|
||||||
|
/* adress of boot parameters */
|
||||||
|
gd->bd->bi_boot_params = 0x00000100;
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_nPWRON);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_nPWRON);
|
||||||
|
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_IORST);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_IORST);
|
||||||
|
|
||||||
|
/* led not populated on board*/
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_LED3);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_LED3);
|
||||||
|
|
||||||
|
/* middle LED */
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_LED2);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_LED2);
|
||||||
|
|
||||||
|
/* right LED */
|
||||||
|
/* weak pulldown = LED weak on */
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_LED1);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_LED1);
|
||||||
|
|
||||||
|
/* Setup GPIO's for Interrupt inputs */
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_USBINTA);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_USBINTB);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_USBINTC);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_RTCINT);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_PCI_INTA);
|
||||||
|
GPIO_OUTPUT_DISABLE (CFG_GPIO_PCI_INTB);
|
||||||
|
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_USBINTA);
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_USBINTB);
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_USBINTC);
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_RTCINT);
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_PCI_INTA);
|
||||||
|
GPIO_INT_ACT_LOW_SET (CFG_GPIO_PCI_INTB);
|
||||||
|
|
||||||
|
/* Setup GPIO's for 33MHz clock output */
|
||||||
|
*IXP425_GPIO_GPCLKR = 0x011001FF;
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_EXTBUS_CLK);
|
||||||
|
GPIO_OUTPUT_ENABLE (CFG_GPIO_PCI_CLK);
|
||||||
|
|
||||||
|
*IXP425_EXP_CS1 = 0xbd113c42;
|
||||||
|
|
||||||
|
udelay (10000);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_IORST);
|
||||||
|
udelay (10000);
|
||||||
|
GPIO_OUTPUT_CLEAR (CFG_GPIO_IORST);
|
||||||
|
udelay (10000);
|
||||||
|
GPIO_OUTPUT_SET (CFG_GPIO_IORST);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check Board Identity */
|
||||||
|
int checkboard (void)
|
||||||
|
{
|
||||||
|
puts ("Board: AcTux-4\n");
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init (void)
|
||||||
|
{
|
||||||
|
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||||
|
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hardcoded flash setup:
|
||||||
|
* Flash 0 is a non-CFI SST 39VF020 flash, 8 bit flash / 8 bit bus.
|
||||||
|
* Flash 1 is an Intel *16 flash using the CFI driver.
|
||||||
|
*/
|
||||||
|
ulong board_flash_get_legacy (ulong base, int banknum, flash_info_t * info)
|
||||||
|
{
|
||||||
|
if (banknum == 0) { /* non-CFI boot flash */
|
||||||
|
info->portwidth = 1;
|
||||||
|
info->chipwidth = 1;
|
||||||
|
info->interface = FLASH_CFI_X8;
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
49
board/actux4/actux4_hw.h
Normal file
49
board/actux4/actux4_hw.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Michael Schwingen, michael@schwingen.org
|
||||||
|
*
|
||||||
|
* hardware register definitions for the AcTux-4 board.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ACTUX4_HW_H
|
||||||
|
#define _ACTUX4_HW_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GPIO settings
|
||||||
|
*/
|
||||||
|
#define CFG_GPIO_USBINTA 0
|
||||||
|
#define CFG_GPIO_USBINTB 1
|
||||||
|
#define CFG_GPIO_USBINTC 2
|
||||||
|
#define CFG_GPIO_nPWRON 3 /* Out */
|
||||||
|
#define CFG_GPIO_I2C_SCL 4
|
||||||
|
#define CFG_GPIO_I2C_SDA 5
|
||||||
|
#define CFG_GPIO_PCI_INTB 6
|
||||||
|
#define CFG_GPIO_BUTTON1 7
|
||||||
|
#define CFG_GPIO_LED1 8 /* Out */
|
||||||
|
#define CFG_GPIO_RTCINT 9
|
||||||
|
#define CFG_GPIO_LED2 10 /* Out */
|
||||||
|
#define CFG_GPIO_PCI_INTA 11
|
||||||
|
#define CFG_GPIO_IORST 12 /* Out */
|
||||||
|
#define CFG_GPIO_LED3 13 /* Out */
|
||||||
|
#define CFG_GPIO_PCI_CLK 14 /* Out */
|
||||||
|
#define CFG_GPIO_EXTBUS_CLK 15 /* Out */
|
||||||
|
|
||||||
|
#endif
|
||||||
4
board/actux4/config.mk
Normal file
4
board/actux4/config.mk
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
TEXT_BASE = 0x00e00000
|
||||||
|
|
||||||
|
# include NPE ethernet driver
|
||||||
|
BOARDLIBS = cpu/ixp/npe/libnpe.a
|
||||||
65
board/actux4/u-boot.lds
Normal file
65
board/actux4/u-boot.lds
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_FORMAT ("elf32-bigarm", "elf32-bigarm", "elf32-bigarm")
|
||||||
|
OUTPUT_ARCH (arm)
|
||||||
|
ENTRY (_start)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x00000000;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.text : {
|
||||||
|
cpu/ixp/start.o(.text)
|
||||||
|
*(.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.rodata : {
|
||||||
|
*(.rodata)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.data : {
|
||||||
|
*(.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
.got : {
|
||||||
|
*(.got)
|
||||||
|
}
|
||||||
|
|
||||||
|
. =.;
|
||||||
|
__u_boot_cmd_start =.;
|
||||||
|
.u_boot_cmd : {
|
||||||
|
*(.u_boot_cmd)
|
||||||
|
}
|
||||||
|
__u_boot_cmd_end =.;
|
||||||
|
|
||||||
|
. = ALIGN (4);
|
||||||
|
__bss_start =.;
|
||||||
|
.bss (NOLOAD): {
|
||||||
|
*(.bss)
|
||||||
|
}
|
||||||
|
_end =.;
|
||||||
|
}
|
||||||
@@ -112,7 +112,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
|
|||||||
|
|
||||||
LIB = $(obj)lib$(BOARD).a
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
COBJS := $(BOARD).o
|
COBJS-y := $(BOARD).o
|
||||||
|
COBJS-$(CONFIG_PCI) += pci.o
|
||||||
|
|
||||||
|
COBJS := $(COBJS-y)
|
||||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
OBJS := $(addprefix $(obj),$(COBJS))
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
SOBJS := $(addprefix $(obj),$(SOBJS))
|
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <mpc512x.h>
|
#include <mpc512x.h>
|
||||||
#include <asm/bitops.h>
|
#include <asm/bitops.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
|
||||||
/* Clocks in use */
|
/* Clocks in use */
|
||||||
#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \
|
#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \
|
||||||
@@ -32,7 +33,9 @@
|
|||||||
CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \
|
CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \
|
||||||
CLOCK_SCCR1_PSCFIFO_EN | \
|
CLOCK_SCCR1_PSCFIFO_EN | \
|
||||||
CLOCK_SCCR1_DDR_EN | \
|
CLOCK_SCCR1_DDR_EN | \
|
||||||
CLOCK_SCCR1_FEC_EN)
|
CLOCK_SCCR1_FEC_EN | \
|
||||||
|
CLOCK_SCCR1_PCI_EN | \
|
||||||
|
CLOCK_SCCR1_TPR_EN)
|
||||||
|
|
||||||
#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \
|
#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \
|
||||||
CLOCK_SCCR2_SPDIF_EN | \
|
CLOCK_SCCR2_SPDIF_EN | \
|
||||||
@@ -124,24 +127,24 @@ long int fixed_sdram (void)
|
|||||||
im->mddrc.prioman_config2 = CFG_MDDRCGRP_PM_CFG2;
|
im->mddrc.prioman_config2 = CFG_MDDRCGRP_PM_CFG2;
|
||||||
im->mddrc.hiprio_config = CFG_MDDRCGRP_HIPRIO_CFG;
|
im->mddrc.hiprio_config = CFG_MDDRCGRP_HIPRIO_CFG;
|
||||||
im->mddrc.lut_table0_main_upper = CFG_MDDRCGRP_LUT0_MU;
|
im->mddrc.lut_table0_main_upper = CFG_MDDRCGRP_LUT0_MU;
|
||||||
im->mddrc.lut_table1_main_upper = CFG_MDDRCGRP_LUT1_MU;
|
|
||||||
im->mddrc.lut_table2_main_upper = CFG_MDDRCGRP_LUT2_MU;
|
|
||||||
im->mddrc.lut_table3_main_upper = CFG_MDDRCGRP_LUT3_MU;
|
|
||||||
im->mddrc.lut_table4_main_upper = CFG_MDDRCGRP_LUT4_MU;
|
|
||||||
im->mddrc.lut_table0_main_lower = CFG_MDDRCGRP_LUT0_ML;
|
im->mddrc.lut_table0_main_lower = CFG_MDDRCGRP_LUT0_ML;
|
||||||
|
im->mddrc.lut_table1_main_upper = CFG_MDDRCGRP_LUT1_MU;
|
||||||
im->mddrc.lut_table1_main_lower = CFG_MDDRCGRP_LUT1_ML;
|
im->mddrc.lut_table1_main_lower = CFG_MDDRCGRP_LUT1_ML;
|
||||||
|
im->mddrc.lut_table2_main_upper = CFG_MDDRCGRP_LUT2_MU;
|
||||||
im->mddrc.lut_table2_main_lower = CFG_MDDRCGRP_LUT2_ML;
|
im->mddrc.lut_table2_main_lower = CFG_MDDRCGRP_LUT2_ML;
|
||||||
|
im->mddrc.lut_table3_main_upper = CFG_MDDRCGRP_LUT3_MU;
|
||||||
im->mddrc.lut_table3_main_lower = CFG_MDDRCGRP_LUT3_ML;
|
im->mddrc.lut_table3_main_lower = CFG_MDDRCGRP_LUT3_ML;
|
||||||
|
im->mddrc.lut_table4_main_upper = CFG_MDDRCGRP_LUT4_MU;
|
||||||
im->mddrc.lut_table4_main_lower = CFG_MDDRCGRP_LUT4_ML;
|
im->mddrc.lut_table4_main_lower = CFG_MDDRCGRP_LUT4_ML;
|
||||||
im->mddrc.lut_table0_alternate_upper = CFG_MDDRCGRP_LUT0_AU;
|
im->mddrc.lut_table0_alternate_upper = CFG_MDDRCGRP_LUT0_AU;
|
||||||
|
im->mddrc.lut_table0_alternate_lower = CFG_MDDRCGRP_LUT0_AL;
|
||||||
im->mddrc.lut_table1_alternate_upper = CFG_MDDRCGRP_LUT1_AU;
|
im->mddrc.lut_table1_alternate_upper = CFG_MDDRCGRP_LUT1_AU;
|
||||||
im->mddrc.lut_table2_alternate_upper = CFG_MDDRCGRP_LUT2_AU;
|
|
||||||
im->mddrc.lut_table3_alternate_upper = CFG_MDDRCGRP_LUT3_AU;
|
|
||||||
im->mddrc.lut_table4_alternate_upper = CFG_MDDRCGRP_LUT4_AU;
|
|
||||||
im->mddrc.lut_table0_alternate_lower = CFG_MDDRCGRP_LUT0_AU;
|
|
||||||
im->mddrc.lut_table1_alternate_lower = CFG_MDDRCGRP_LUT1_AL;
|
im->mddrc.lut_table1_alternate_lower = CFG_MDDRCGRP_LUT1_AL;
|
||||||
|
im->mddrc.lut_table2_alternate_upper = CFG_MDDRCGRP_LUT2_AU;
|
||||||
im->mddrc.lut_table2_alternate_lower = CFG_MDDRCGRP_LUT2_AL;
|
im->mddrc.lut_table2_alternate_lower = CFG_MDDRCGRP_LUT2_AL;
|
||||||
|
im->mddrc.lut_table3_alternate_upper = CFG_MDDRCGRP_LUT3_AU;
|
||||||
im->mddrc.lut_table3_alternate_lower = CFG_MDDRCGRP_LUT3_AL;
|
im->mddrc.lut_table3_alternate_lower = CFG_MDDRCGRP_LUT3_AL;
|
||||||
|
im->mddrc.lut_table4_alternate_upper = CFG_MDDRCGRP_LUT4_AU;
|
||||||
im->mddrc.lut_table4_alternate_lower = CFG_MDDRCGRP_LUT4_AL;
|
im->mddrc.lut_table4_alternate_lower = CFG_MDDRCGRP_LUT4_AL;
|
||||||
|
|
||||||
/* Initialize MDDRC */
|
/* Initialize MDDRC */
|
||||||
@@ -154,18 +157,26 @@ long int fixed_sdram (void)
|
|||||||
for (i = 0; i < 10; i++)
|
for (i = 0; i < 10; i++)
|
||||||
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
|
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_PCHG_ALL;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_RFSH;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_RFSH;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_INIT_DEV_OP;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_EM2;
|
||||||
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_PCHG_ALL;
|
im->mddrc.ddr_command = CFG_MICRON_PCHG_ALL;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_EM2;
|
im->mddrc.ddr_command = CFG_MICRON_EM2;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_EM3;
|
im->mddrc.ddr_command = CFG_MICRON_EM3;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_EN_DLL;
|
im->mddrc.ddr_command = CFG_MICRON_EN_DLL;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_RST_DLL;
|
im->mddrc.ddr_command = CFG_MICRON_INIT_DEV_OP;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_PCHG_ALL;
|
im->mddrc.ddr_command = CFG_MICRON_PCHG_ALL;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_RFSH;
|
im->mddrc.ddr_command = CFG_MICRON_RFSH;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_INIT_DEV_OP;
|
im->mddrc.ddr_command = CFG_MICRON_INIT_DEV_OP;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_OCD_DEFAULT;
|
im->mddrc.ddr_command = CFG_MICRON_OCD_DEFAULT;
|
||||||
im->mddrc.ddr_command = CFG_MICRON_OCD_EXIT;
|
im->mddrc.ddr_command = CFG_MICRON_PCHG_ALL;
|
||||||
|
|
||||||
for (i = 0; i < 10; i++)
|
|
||||||
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
im->mddrc.ddr_command = CFG_MICRON_NOP;
|
||||||
|
|
||||||
/* Start MDDRC */
|
/* Start MDDRC */
|
||||||
@@ -179,8 +190,24 @@ int checkboard (void)
|
|||||||
{
|
{
|
||||||
ushort brd_rev = *(vu_short *) (CFG_CPLD_BASE + 0x00);
|
ushort brd_rev = *(vu_short *) (CFG_CPLD_BASE + 0x00);
|
||||||
uchar cpld_rev = *(vu_char *) (CFG_CPLD_BASE + 0x02);
|
uchar cpld_rev = *(vu_char *) (CFG_CPLD_BASE + 0x02);
|
||||||
|
volatile immap_t *im = (immap_t *) CFG_IMMR;
|
||||||
|
volatile unsigned long *reg;
|
||||||
|
int i;
|
||||||
|
|
||||||
printf ("Board: ADS5121 rev. 0x%04x (CPLD rev. 0x%02x)\n",
|
printf ("Board: ADS5121 rev. 0x%04x (CPLD rev. 0x%02x)\n",
|
||||||
brd_rev, cpld_rev);
|
brd_rev, cpld_rev);
|
||||||
|
|
||||||
|
/* change the slew rate on all pata pins to max */
|
||||||
|
reg = (unsigned long *) &(im->io_ctrl.regs[PATA_CE1_IDX]);
|
||||||
|
for (i = 0; i < 9; i++)
|
||||||
|
reg[i] |= 0x00000003;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
ft_cpu_setup(blob, bd);
|
||||||
|
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
|
|||||||
213
board/ads5121/pci.c
Normal file
213
board/ads5121/pci.c
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Freescale Semiconductor, Inc. 2006, 2007. All rights reserved.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
|
||||||
|
#include <asm/mmu.h>
|
||||||
|
#include <asm/global_data.h>
|
||||||
|
#include <pci.h>
|
||||||
|
#if defined(CONFIG_OF_LIBFDT)
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
/* System RAM mapped to PCI space */
|
||||||
|
#define CONFIG_PCI_SYS_MEM_BUS CFG_SDRAM_BASE
|
||||||
|
#define CONFIG_PCI_SYS_MEM_PHYS CFG_SDRAM_BASE
|
||||||
|
|
||||||
|
static struct pci_controller pci_hose;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* pci_init_board()
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
pci_init_board(void)
|
||||||
|
{
|
||||||
|
volatile immap_t *immr = (immap_t *) CFG_IMMR;
|
||||||
|
volatile law512x_t *pci_law;
|
||||||
|
volatile pot512x_t *pci_pot;
|
||||||
|
volatile pcictrl512x_t *pci_ctrl;
|
||||||
|
volatile pciconf512x_t *pci_conf;
|
||||||
|
u16 reg16;
|
||||||
|
u32 reg32;
|
||||||
|
u32 dev;
|
||||||
|
struct pci_controller *hose;
|
||||||
|
|
||||||
|
/* Set PCI divider for 33MHz */
|
||||||
|
reg32 = immr->clk.scfr[0];
|
||||||
|
reg32 &= ~(SCFR1_PCI_DIV_MASK);
|
||||||
|
reg32 |= SCFR1_PCI_DIV << SCFR1_PCI_DIV_SHIFT;
|
||||||
|
immr->clk.scfr[0] = reg32;
|
||||||
|
|
||||||
|
pci_law = immr->sysconf.pcilaw;
|
||||||
|
pci_pot = immr->ios.pot;
|
||||||
|
pci_ctrl = &immr->pci_ctrl;
|
||||||
|
pci_conf = &immr->pci_conf;
|
||||||
|
|
||||||
|
hose = &pci_hose;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Release PCI RST Output signal
|
||||||
|
*/
|
||||||
|
pci_ctrl->gcr = 0;
|
||||||
|
udelay(2000);
|
||||||
|
pci_ctrl->gcr = 1;
|
||||||
|
|
||||||
|
/* We need to wait at least a 1sec based on PCI specs */
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 1000; i++)
|
||||||
|
udelay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PCI Local Access Windows
|
||||||
|
*/
|
||||||
|
pci_law[0].bar = CFG_PCI_MEM_PHYS & LAWBAR_BAR;
|
||||||
|
pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_512M;
|
||||||
|
|
||||||
|
pci_law[1].bar = CFG_PCI_IO_PHYS & LAWBAR_BAR;
|
||||||
|
pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_16M;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PCI Outbound Translation Windows
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* PCI mem space - prefetch */
|
||||||
|
pci_pot[0].potar = (CFG_PCI_MEM_BASE >> 12) & POTAR_TA_MASK;
|
||||||
|
pci_pot[0].pobar = (CFG_PCI_MEM_PHYS >> 12) & POBAR_BA_MASK;
|
||||||
|
pci_pot[0].pocmr = POCMR_EN | POCMR_PRE | POCMR_CM_256M;
|
||||||
|
|
||||||
|
/* PCI IO space */
|
||||||
|
pci_pot[1].potar = (CFG_PCI_IO_BASE >> 12) & POTAR_TA_MASK;
|
||||||
|
pci_pot[1].pobar = (CFG_PCI_IO_PHYS >> 12) & POBAR_BA_MASK;
|
||||||
|
pci_pot[1].pocmr = POCMR_EN | POCMR_IO | POCMR_CM_16M;
|
||||||
|
|
||||||
|
/* PCI mmio - non-prefetch mem space */
|
||||||
|
pci_pot[2].potar = (CFG_PCI_MMIO_BASE >> 12) & POTAR_TA_MASK;
|
||||||
|
pci_pot[2].pobar = (CFG_PCI_MMIO_PHYS >> 12) & POBAR_BA_MASK;
|
||||||
|
pci_pot[2].pocmr = POCMR_EN | POCMR_CM_256M;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PCI Inbound Translation Windows
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* we need RAM mapped to PCI space for the devices to
|
||||||
|
* access main memory */
|
||||||
|
pci_ctrl[0].pitar1 = 0x0;
|
||||||
|
pci_ctrl[0].pibar1 = 0x0;
|
||||||
|
pci_ctrl[0].piebar1 = 0x0;
|
||||||
|
pci_ctrl[0].piwar1 = PIWAR_EN | PIWAR_PF | PIWAR_RTT_SNOOP |
|
||||||
|
PIWAR_WTT_SNOOP | (__ilog2(gd->ram_size) - 1);
|
||||||
|
|
||||||
|
hose->first_busno = 0;
|
||||||
|
hose->last_busno = 0xff;
|
||||||
|
|
||||||
|
/* PCI memory prefetch space */
|
||||||
|
pci_set_region(hose->regions + 0,
|
||||||
|
CFG_PCI_MEM_BASE,
|
||||||
|
CFG_PCI_MEM_PHYS,
|
||||||
|
CFG_PCI_MEM_SIZE,
|
||||||
|
PCI_REGION_MEM|PCI_REGION_PREFETCH);
|
||||||
|
|
||||||
|
/* PCI memory space */
|
||||||
|
pci_set_region(hose->regions + 1,
|
||||||
|
CFG_PCI_MMIO_BASE,
|
||||||
|
CFG_PCI_MMIO_PHYS,
|
||||||
|
CFG_PCI_MMIO_SIZE,
|
||||||
|
PCI_REGION_MEM);
|
||||||
|
|
||||||
|
/* PCI IO space */
|
||||||
|
pci_set_region(hose->regions + 2,
|
||||||
|
CFG_PCI_IO_BASE,
|
||||||
|
CFG_PCI_IO_PHYS,
|
||||||
|
CFG_PCI_IO_SIZE,
|
||||||
|
PCI_REGION_IO);
|
||||||
|
|
||||||
|
/* System memory space */
|
||||||
|
pci_set_region(hose->regions + 3,
|
||||||
|
CONFIG_PCI_SYS_MEM_BUS,
|
||||||
|
CONFIG_PCI_SYS_MEM_PHYS,
|
||||||
|
gd->ram_size,
|
||||||
|
PCI_REGION_MEM | PCI_REGION_MEMORY);
|
||||||
|
|
||||||
|
hose->region_count = 4;
|
||||||
|
|
||||||
|
pci_setup_indirect(hose,
|
||||||
|
(CFG_IMMR + 0x8300),
|
||||||
|
(CFG_IMMR + 0x8304));
|
||||||
|
|
||||||
|
pci_register_hose(hose);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write to Command register
|
||||||
|
*/
|
||||||
|
reg16 = 0xff;
|
||||||
|
dev = PCI_BDF(hose->first_busno, 0, 0);
|
||||||
|
pci_hose_read_config_word(hose, dev, PCI_COMMAND, ®16);
|
||||||
|
reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
|
||||||
|
pci_hose_write_config_word(hose, dev, PCI_COMMAND, reg16);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear non-reserved bits in status register.
|
||||||
|
*/
|
||||||
|
pci_hose_write_config_word(hose, dev, PCI_STATUS, 0xffff);
|
||||||
|
pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
|
||||||
|
pci_hose_write_config_byte(hose, dev, PCI_CACHE_LINE_SIZE, 0x08);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_SCAN_SHOW
|
||||||
|
printf("PCI: Bus Dev VenId DevId Class Int\n");
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* Hose scan.
|
||||||
|
*/
|
||||||
|
hose->last_busno = pci_hose_scan(hose);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT)
|
||||||
|
void ft_pci_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
int nodeoffset;
|
||||||
|
int tmp[2];
|
||||||
|
const char *path;
|
||||||
|
|
||||||
|
nodeoffset = fdt_path_offset(blob, "/aliases");
|
||||||
|
if (nodeoffset >= 0) {
|
||||||
|
path = fdt_getprop(blob, nodeoffset, "pci", NULL);
|
||||||
|
if (path) {
|
||||||
|
tmp[0] = cpu_to_be32(pci_hose.first_busno);
|
||||||
|
tmp[1] = cpu_to_be32(pci_hose.last_busno);
|
||||||
|
do_fixup_by_path(blob, path, "bus-range",
|
||||||
|
&tmp, sizeof(tmp), 1);
|
||||||
|
|
||||||
|
tmp[0] = cpu_to_be32(gd->pci_clk);
|
||||||
|
do_fixup_by_path(blob, path, "clock-frequency",
|
||||||
|
&tmp, sizeof(tmp[0]), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_OF_LIBFDT */
|
||||||
@@ -109,7 +109,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -51,6 +51,6 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss : { *(.bss) }
|
.bss (NOLOAD) : { *(.bss) }
|
||||||
_end = .;
|
_end = .;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ SECTIONS
|
|||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.bss)
|
*(.bss)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ SECTIONS
|
|||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.bss)
|
*(.bss)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ SECTIONS
|
|||||||
* bss follows. We keep it adjacent to simplify init code.
|
* bss follows. We keep it adjacent to simplify init code.
|
||||||
*/
|
*/
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.sbss :
|
.sbss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss)
|
*(.sbss)
|
||||||
*(.sbss.*)
|
*(.sbss.*)
|
||||||
@@ -95,7 +95,7 @@ SECTIONS
|
|||||||
*(.scommon)
|
*(.scommon)
|
||||||
}
|
}
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.bss)
|
*(.bss)
|
||||||
*(.bss.*)
|
*(.bss.*)
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ SECTIONS
|
|||||||
* bss follows. We keep it adjacent to simplify init code.
|
* bss follows. We keep it adjacent to simplify init code.
|
||||||
*/
|
*/
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.sbss :
|
.sbss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss)
|
*(.sbss)
|
||||||
*(.sbss.*)
|
*(.sbss.*)
|
||||||
@@ -95,7 +95,7 @@ SECTIONS
|
|||||||
*(.scommon)
|
*(.scommon)
|
||||||
}
|
}
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.bss)
|
*(.bss)
|
||||||
*(.bss.*)
|
*(.bss.*)
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ SECTIONS
|
|||||||
* bss follows. We keep it adjacent to simplify init code.
|
* bss follows. We keep it adjacent to simplify init code.
|
||||||
*/
|
*/
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.sbss :
|
.sbss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss)
|
*(.sbss)
|
||||||
*(.sbss.*)
|
*(.sbss.*)
|
||||||
@@ -95,7 +95,7 @@ SECTIONS
|
|||||||
*(.scommon)
|
*(.scommon)
|
||||||
}
|
}
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.bss)
|
*(.bss)
|
||||||
*(.bss.*)
|
*(.bss.*)
|
||||||
|
|||||||
@@ -117,7 +117,9 @@ long int initdram(int board_type)
|
|||||||
return (CFG_MBYTES_RAM << 20);
|
return (CFG_MBYTES_RAM << 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_NAND_SPL
|
||||||
int testdram(void)
|
int testdram(void)
|
||||||
{
|
{
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -67,13 +67,13 @@ const unsigned char cfg_simulate_spd_eeprom[128] = {
|
|||||||
0x00, /* Module data width continued: +0 */
|
0x00, /* Module data width continued: +0 */
|
||||||
0x04, /* 2.5 Volt */
|
0x04, /* 2.5 Volt */
|
||||||
0x75, /* SDRAM Cycle Time (cas latency 2.5) = 7.5 ns */
|
0x75, /* SDRAM Cycle Time (cas latency 2.5) = 7.5 ns */
|
||||||
|
0x00, /* SDRAM Access from clock */
|
||||||
#ifdef CONFIG_DDR_ECC
|
#ifdef CONFIG_DDR_ECC
|
||||||
0x02, /* ECC ON : 02 OFF : 00 */
|
0x02, /* ECC ON : 02 OFF : 00 */
|
||||||
#else
|
#else
|
||||||
0x00, /* ECC ON : 02 OFF : 00 */
|
0x00, /* ECC ON : 02 OFF : 00 */
|
||||||
#endif
|
#endif
|
||||||
0x82, /* refresh Rate Type: Normal (15.625us) + Self refresh */
|
0x82, /* refresh Rate Type: Normal (7.8us) + Self refresh */
|
||||||
0,
|
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0x01, /* wcsbc = 1 */
|
0x01, /* wcsbc = 1 */
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -62,19 +62,6 @@ SECTIONS
|
|||||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||||
|
|
||||||
cpu/ppc4xx/start.o (.text)
|
cpu/ppc4xx/start.o (.text)
|
||||||
cpu/ppc4xx/kgdb.o (.text)
|
|
||||||
cpu/ppc4xx/traps.o (.text)
|
|
||||||
cpu/ppc4xx/interrupts.o (.text)
|
|
||||||
cpu/ppc4xx/serial.o (.text)
|
|
||||||
cpu/ppc4xx/cpu_init.o (.text)
|
|
||||||
cpu/ppc4xx/speed.o (.text)
|
|
||||||
common/dlmalloc.o (.text)
|
|
||||||
lib_generic/crc32.o (.text)
|
|
||||||
lib_ppc/extable.o (.text)
|
|
||||||
lib_generic/zlib.o (.text)
|
|
||||||
|
|
||||||
/* . = env_offset;*/
|
|
||||||
/* common/environment.o(.text)*/
|
|
||||||
|
|
||||||
*(.text)
|
*(.text)
|
||||||
*(.fixup)
|
*(.fixup)
|
||||||
@@ -138,7 +125,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -68,19 +68,6 @@ SECTIONS
|
|||||||
|
|
||||||
cpu/ppc4xx/start.o (.text)
|
cpu/ppc4xx/start.o (.text)
|
||||||
board/amcc/ebony/init.o (.text)
|
board/amcc/ebony/init.o (.text)
|
||||||
cpu/ppc4xx/kgdb.o (.text)
|
|
||||||
cpu/ppc4xx/traps.o (.text)
|
|
||||||
cpu/ppc4xx/interrupts.o (.text)
|
|
||||||
cpu/ppc4xx/serial.o (.text)
|
|
||||||
cpu/ppc4xx/cpu_init.o (.text)
|
|
||||||
cpu/ppc4xx/speed.o (.text)
|
|
||||||
common/dlmalloc.o (.text)
|
|
||||||
lib_generic/crc32.o (.text)
|
|
||||||
lib_ppc/extable.o (.text)
|
|
||||||
lib_generic/zlib.o (.text)
|
|
||||||
|
|
||||||
/* . = env_offset;*/
|
|
||||||
/* common/environment.o(.text)*/
|
|
||||||
|
|
||||||
*(.text)
|
*(.text)
|
||||||
*(.fixup)
|
*(.fixup)
|
||||||
@@ -145,7 +132,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* (C) Copyright 2007
|
* (C) Copyright 2007-2008
|
||||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* See file CREDITS for list of people who contributed to this
|
||||||
@@ -24,21 +24,16 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <ppc4xx.h>
|
#include <ppc4xx.h>
|
||||||
#include <asm/processor.h>
|
|
||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
#include <asm-ppc/io.h>
|
#include <libfdt.h>
|
||||||
#include <asm-ppc/gpio.h>
|
#include <fdt_support.h>
|
||||||
|
#include <asm/processor.h>
|
||||||
#include "../cpu/ppc4xx/440spe_pcie.h"
|
#include <asm/io.h>
|
||||||
|
#include <asm/gpio.h>
|
||||||
#undef PCIE_ENDPOINT
|
#include <asm/4xx_pcie.h>
|
||||||
/* #define PCIE_ENDPOINT 1 */
|
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
int ppc440spe_init_pcie_rootport(int port);
|
|
||||||
void ppc440spe_setup_pcie(struct pci_controller *hose, int port);
|
|
||||||
|
|
||||||
int board_early_init_f (void)
|
int board_early_init_f (void)
|
||||||
{
|
{
|
||||||
unsigned long mfr;
|
unsigned long mfr;
|
||||||
@@ -224,10 +219,9 @@ int board_early_init_f (void)
|
|||||||
mtdcr (uic0sr, 0x00000000); /* clear all interrupts*/
|
mtdcr (uic0sr, 0x00000000); /* clear all interrupts*/
|
||||||
mtdcr (uic0sr, 0xffffffff); /* clear all interrupts*/
|
mtdcr (uic0sr, 0xffffffff); /* clear all interrupts*/
|
||||||
|
|
||||||
/* SDR0_MFR should be part of Ethernet init */
|
|
||||||
mfsdr(sdr_mfr, mfr);
|
mfsdr(sdr_mfr, mfr);
|
||||||
mfr &= ~SDR0_MFR_ECS_MASK;
|
mfr |= SDR0_MFR_FIXD; /* Workaround for PCI/DMA */
|
||||||
/* mtsdr(sdr_mfr, mfr); */
|
mtsdr(sdr_mfr, mfr);
|
||||||
|
|
||||||
mtsdr(SDR0_PFC0, CFG_PFC0);
|
mtsdr(SDR0_PFC0, CFG_PFC0);
|
||||||
|
|
||||||
@@ -252,6 +246,18 @@ int checkboard (void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Override the default functions in cpu/ppc4xx/44x_spd_ddr2.c with
|
||||||
|
* board specific values.
|
||||||
|
*/
|
||||||
|
u32 ddr_wrdtr(u32 default_val) {
|
||||||
|
return (SDRAM_WRDTR_LLWP_1_CYC | SDRAM_WRDTR_WTR_180_DEG_ADV | 0x823);
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 ddr_clktr(u32 default_val) {
|
||||||
|
return (SDRAM_CLKTR_CLKP_90_DEG_ADV);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CFG_DRAM_TEST)
|
#if defined(CFG_DRAM_TEST)
|
||||||
int testdram (void)
|
int testdram (void)
|
||||||
{
|
{
|
||||||
@@ -396,6 +402,7 @@ void pcie_setup_hoses(int busno)
|
|||||||
{
|
{
|
||||||
struct pci_controller *hose;
|
struct pci_controller *hose;
|
||||||
int i, bus;
|
int i, bus;
|
||||||
|
int ret = 0;
|
||||||
char *env;
|
char *env;
|
||||||
unsigned int delay;
|
unsigned int delay;
|
||||||
|
|
||||||
@@ -409,12 +416,13 @@ void pcie_setup_hoses(int busno)
|
|||||||
if (!katmai_pcie_card_present(i))
|
if (!katmai_pcie_card_present(i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef PCIE_ENDPOINT
|
if (is_end_point(i))
|
||||||
if (ppc440spe_init_pcie_endport(i)) {
|
ret = ppc4xx_init_pcie_endport(i);
|
||||||
#else
|
else
|
||||||
if (ppc440spe_init_pcie_rootport(i)) {
|
ret = ppc4xx_init_pcie_rootport(i);
|
||||||
#endif
|
if (ret) {
|
||||||
printf("PCIE%d: initialization failed\n", i);
|
printf("PCIE%d: initialization as %s failed\n", i,
|
||||||
|
is_end_point(i) ? "endpoint" : "root-complex");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,26 +436,24 @@ void pcie_setup_hoses(int busno)
|
|||||||
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
||||||
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
||||||
CFG_PCIE_MEMSIZE,
|
CFG_PCIE_MEMSIZE,
|
||||||
PCI_REGION_MEM
|
PCI_REGION_MEM);
|
||||||
);
|
|
||||||
hose->region_count = 1;
|
hose->region_count = 1;
|
||||||
pci_register_hose(hose);
|
pci_register_hose(hose);
|
||||||
|
|
||||||
#ifdef PCIE_ENDPOINT
|
if (is_end_point(i)) {
|
||||||
ppc440spe_setup_pcie_endpoint(hose, i);
|
ppc4xx_setup_pcie_endpoint(hose, i);
|
||||||
/*
|
/*
|
||||||
* Reson for no scanning is endpoint can not generate
|
* Reson for no scanning is endpoint can not generate
|
||||||
* upstream configuration accesses.
|
* upstream configuration accesses.
|
||||||
*/
|
*/
|
||||||
#else
|
} else {
|
||||||
ppc440spe_setup_pcie_rootpoint(hose, i);
|
ppc4xx_setup_pcie_rootpoint(hose, i);
|
||||||
|
|
||||||
env = getenv ("pciscandelay");
|
env = getenv ("pciscandelay");
|
||||||
if (env != NULL) {
|
if (env != NULL) {
|
||||||
delay = simple_strtoul(env, NULL, 10);
|
delay = simple_strtoul(env, NULL, 10);
|
||||||
if (delay > 5)
|
if (delay > 5)
|
||||||
printf ("Warning, expect noticable delay before PCIe"
|
printf("Warning, expect noticable delay before "
|
||||||
"scan due to 'pciscandelay' value!\n");
|
"PCIe scan due to 'pciscandelay' value!\n");
|
||||||
mdelay(delay * 1000);
|
mdelay(delay * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,7 +462,7 @@ void pcie_setup_hoses(int busno)
|
|||||||
*/
|
*/
|
||||||
hose->last_busno = pci_hose_scan(hose);
|
hose->last_busno = pci_hose_scan(hose);
|
||||||
bus = hose->last_busno + 1;
|
bus = hose->last_busno + 1;
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_PCI) */
|
#endif /* defined(CONFIG_PCI) */
|
||||||
@@ -541,3 +547,24 @@ int post_hotkeys_pressed(void)
|
|||||||
return (ctrlc());
|
return (ctrlc());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
u32 val[4];
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
ft_cpu_setup(blob, bd);
|
||||||
|
|
||||||
|
/* Fixup NOR mapping */
|
||||||
|
val[0] = 0; /* chip select number */
|
||||||
|
val[1] = 0; /* always 0 */
|
||||||
|
val[2] = gd->bd->bi_flashstart;
|
||||||
|
val[3] = gd->bd->bi_flashsize;
|
||||||
|
rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
|
||||||
|
val, sizeof(val), 1);
|
||||||
|
if (rc)
|
||||||
|
printf("Unable to update property NOR mapping, err=%s\n",
|
||||||
|
fdt_strerror(rc));
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
50
board/amcc/kilauea/Makefile
Normal file
50
board/amcc/kilauea/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2007
|
||||||
|
# Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS = $(BOARD).o cmd_pll.o memory.o
|
||||||
|
SOBJS = init.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend *~
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
297
board/amcc/kilauea/cmd_pll.c
Normal file
297
board/amcc/kilauea/cmd_pll.c
Normal file
@@ -0,0 +1,297 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000, 2001
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ehnus: change pll frequency.
|
||||||
|
* Wed Sep 5 11:45:17 CST 2007
|
||||||
|
* hsun@udtech.com.cn
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <i2c.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_EEPROM
|
||||||
|
|
||||||
|
#define EEPROM_CONF_OFFSET 0
|
||||||
|
#define EEPROM_TEST_OFFSET 16
|
||||||
|
#define EEPROM_SDSTP_PARAM 16
|
||||||
|
|
||||||
|
#define PLL_NAME_MAX 12
|
||||||
|
#define BUF_STEP 8
|
||||||
|
|
||||||
|
/* eeprom_wirtes 8Byte per op. */
|
||||||
|
#define EEPROM_ALTER_FREQ(freq) \
|
||||||
|
do { \
|
||||||
|
int __i; \
|
||||||
|
for (__i = 0; __i < 2; __i++) \
|
||||||
|
eeprom_write (CFG_I2C_EEPROM_ADDR, \
|
||||||
|
EEPROM_CONF_OFFSET + __i*BUF_STEP, \
|
||||||
|
pll_select[freq], \
|
||||||
|
BUF_STEP + __i*BUF_STEP); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define PDEBUG
|
||||||
|
#ifdef PDEBUG
|
||||||
|
#define PLL_DEBUG pll_debug(EEPROM_CONF_OFFSET)
|
||||||
|
#else
|
||||||
|
#define PLL_DEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
PLL_ebc20,
|
||||||
|
PLL_333,
|
||||||
|
PLL_4001,
|
||||||
|
PLL_4002,
|
||||||
|
PLL_533,
|
||||||
|
PLL_600,
|
||||||
|
PLL_666, /* For now, kilauea can't support */
|
||||||
|
RCONF,
|
||||||
|
WTEST,
|
||||||
|
PLL_TOTAL
|
||||||
|
} pll_freq_t;
|
||||||
|
|
||||||
|
static const char
|
||||||
|
pll_name[][PLL_NAME_MAX] = {
|
||||||
|
"PLL_ebc20",
|
||||||
|
"PLL_333",
|
||||||
|
"PLL_400@1",
|
||||||
|
"PLL_400@2",
|
||||||
|
"PLL_533",
|
||||||
|
"PLL_600",
|
||||||
|
"PLL_666",
|
||||||
|
"RCONF",
|
||||||
|
"WTEST",
|
||||||
|
""
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ehnus:
|
||||||
|
*/
|
||||||
|
static uchar
|
||||||
|
pll_select[][EEPROM_SDSTP_PARAM] = {
|
||||||
|
/* 0: CPU 333MHz EBC 20MHz, for test only */
|
||||||
|
{
|
||||||
|
0x8c, 0x12, 0xec, 0x12, 0x88, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 0: 333 */
|
||||||
|
{
|
||||||
|
0x8c, 0x12, 0xec, 0x12, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 1: 400_266 */
|
||||||
|
{
|
||||||
|
0x8e, 0x0e, 0xe8, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 2: 400 */
|
||||||
|
{
|
||||||
|
0x8e, 0x0e, 0xe8, 0x12, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 3: 533 */
|
||||||
|
{
|
||||||
|
0x8e, 0x43, 0x60, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 4: 600 */
|
||||||
|
{
|
||||||
|
0x8d, 0x02, 0x34, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 5: 666 */
|
||||||
|
{
|
||||||
|
0x8d, 0x03, 0x78, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
static uchar
|
||||||
|
testbuf[EEPROM_SDSTP_PARAM] = {
|
||||||
|
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||||
|
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
pll_debug(int off)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
uchar buffer[EEPROM_SDSTP_PARAM];
|
||||||
|
|
||||||
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
eeprom_read(CFG_I2C_EEPROM_ADDR, off,
|
||||||
|
buffer, EEPROM_SDSTP_PARAM);
|
||||||
|
|
||||||
|
printf("Debug: SDSTP[0-3] at offset \"0x%02x\" lists as follows: \n", off);
|
||||||
|
for (i = 0; i < EEPROM_SDSTP_PARAM; i++)
|
||||||
|
printf("%02x ", buffer[i]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_write(void)
|
||||||
|
{
|
||||||
|
printf("Debug: test eeprom_write ... ");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write twice, 8 bytes per write
|
||||||
|
*/
|
||||||
|
eeprom_write (CFG_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET,
|
||||||
|
testbuf, 8);
|
||||||
|
eeprom_write (CFG_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET+8,
|
||||||
|
testbuf, 16);
|
||||||
|
printf("done\n");
|
||||||
|
|
||||||
|
pll_debug(EEPROM_TEST_OFFSET);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
|
{
|
||||||
|
char c = '\0';
|
||||||
|
pll_freq_t pll_freq;
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("Usage: \n%s\n", cmdtp->usage);
|
||||||
|
goto ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (pll_freq = PLL_ebc20; pll_freq < PLL_TOTAL; pll_freq++)
|
||||||
|
if (!strcmp(pll_name[pll_freq], argv[1]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch (pll_freq) {
|
||||||
|
case PLL_ebc20:
|
||||||
|
case PLL_333:
|
||||||
|
case PLL_4001:
|
||||||
|
case PLL_4002:
|
||||||
|
case PLL_533:
|
||||||
|
case PLL_600:
|
||||||
|
EEPROM_ALTER_FREQ(pll_freq);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PLL_666: /* not support */
|
||||||
|
printf("Choose this option will result in a boot failure."
|
||||||
|
"\nContinue? (Y/N): ");
|
||||||
|
|
||||||
|
c = getc(); putc('\n');
|
||||||
|
|
||||||
|
if ((c == 'y') || (c == 'Y')) {
|
||||||
|
EEPROM_ALTER_FREQ(pll_freq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
goto ret;
|
||||||
|
|
||||||
|
case RCONF:
|
||||||
|
pll_debug(EEPROM_CONF_OFFSET);
|
||||||
|
goto ret;
|
||||||
|
case WTEST:
|
||||||
|
printf("DEBUG: write test\n");
|
||||||
|
test_write();
|
||||||
|
goto ret;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("Invalid options"
|
||||||
|
"\n\nUsage: \n%s\n", cmdtp->usage);
|
||||||
|
goto ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("PLL set to %s, "
|
||||||
|
"reset the board to take effect\n", pll_name[pll_freq]);
|
||||||
|
|
||||||
|
PLL_DEBUG;
|
||||||
|
ret:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
U_BOOT_CMD(
|
||||||
|
pllalter, CFG_MAXARGS, 1, do_pll_alter,
|
||||||
|
"pllalter- change pll frequence \n",
|
||||||
|
"pllalter <selection> - change pll frequence \n\n\
|
||||||
|
** New freq take effect after reset. ** \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_ebc20: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t Same as PLL_333 \n\
|
||||||
|
\t except \n\
|
||||||
|
\t EBC: 20 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_333: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 666 MHz \n\
|
||||||
|
\t CPU: 333 MHz \n\
|
||||||
|
\t PLB: 166 MHz \n\
|
||||||
|
\t OPB: 83 MHz \n\
|
||||||
|
\t DDR: 83 MHz \n\
|
||||||
|
------------------------------------------------\n\
|
||||||
|
PLL_400@1: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 800 MHz \n\
|
||||||
|
\t CPU: 400 MHz \n\
|
||||||
|
\t PLB: 133 MHz \n\
|
||||||
|
\t OPB: 66 MHz \n\
|
||||||
|
\t DDR: 133 MHz \n\
|
||||||
|
------------------------------------------------\n\
|
||||||
|
PLL_400@2: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 800 MHz \n\
|
||||||
|
\t CPU: 400 MHz \n\
|
||||||
|
\t PLB: 200 MHz \n\
|
||||||
|
\t OPB: 100 MHz \n\
|
||||||
|
\t DDR: 200 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_533: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 1066 MHz \n\
|
||||||
|
\t CPU: 533 MHz \n\
|
||||||
|
\t PLB: 177 MHz \n\
|
||||||
|
\t OPB: 88 MHz \n\
|
||||||
|
\t DDR: 177 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_600: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 1200 MHz \n\
|
||||||
|
\t CPU: 600 MHz \n\
|
||||||
|
\t PLB: 200 MHz \n\
|
||||||
|
\t OPB: 100 MHz \n\
|
||||||
|
\t DDR: 200 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_666: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 1333 MHz \n\
|
||||||
|
\t CPU: 666 MHz \n\
|
||||||
|
\t PLB: 166 MHz \n\
|
||||||
|
\t OPB: 83 MHz \n\
|
||||||
|
\t DDR: 166 MHz \n\
|
||||||
|
-----------------------------------------------\n\
|
||||||
|
RCONF: Read current eeprom configuration. \n\
|
||||||
|
-----------------------------------------------\n\
|
||||||
|
WTEST: Test EEPROM write with predefined values\n\
|
||||||
|
-----------------------------------------------\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif /* CONFIG_CMD_EEPROM */
|
||||||
32
board/amcc/kilauea/config.mk
Normal file
32
board/amcc/kilauea/config.mk
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2007
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
|
||||||
|
|
||||||
|
ifndef TEXT_BASE
|
||||||
|
TEXT_BASE = 0xFFFA0000
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(debug),1)
|
||||||
|
PLATFORM_CPPFLAGS += -DDEBUG
|
||||||
|
endif
|
||||||
154
board/amcc/kilauea/init.S
Normal file
154
board/amcc/kilauea/init.S
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* Based on code provided from UDTech and AMCC
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <ppc4xx.h>
|
||||||
|
|
||||||
|
#include <ppc_asm.tmpl>
|
||||||
|
#include <ppc_defs.h>
|
||||||
|
|
||||||
|
#define mtsdram_as(reg, value) \
|
||||||
|
addi r4,0,reg ; \
|
||||||
|
mtdcr memcfga,r4 ; \
|
||||||
|
addis r4,0,value@h ; \
|
||||||
|
ori r4,r4,value@l ; \
|
||||||
|
mtdcr memcfgd,r4 ;
|
||||||
|
|
||||||
|
.globl ext_bus_cntlr_init
|
||||||
|
ext_bus_cntlr_init:
|
||||||
|
#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DDR2 setup
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Following the DDR Core Manual, here is the initialization */
|
||||||
|
|
||||||
|
/* Step 1 */
|
||||||
|
|
||||||
|
/* Step 2 */
|
||||||
|
|
||||||
|
/* Step 3 */
|
||||||
|
|
||||||
|
/* base=00000000, size=256MByte (6), mode=7 (n*10*8) */
|
||||||
|
mtsdram_as(SDRAM_MB0CF, 0x00006701);
|
||||||
|
|
||||||
|
/* SET SDRAM_MB1CF - Not enabled */
|
||||||
|
mtsdram_as(SDRAM_MB1CF, 0x00000000);
|
||||||
|
|
||||||
|
/* SET SDRAM_MB2CF - Not enabled */
|
||||||
|
mtsdram_as(SDRAM_MB2CF, 0x00000000);
|
||||||
|
|
||||||
|
/* SET SDRAM_MB3CF - Not enabled */
|
||||||
|
mtsdram_as(SDRAM_MB3CF, 0x00000000);
|
||||||
|
|
||||||
|
/* SDRAM_CLKTR: Adv Addr clock by 90 deg */
|
||||||
|
mtsdram_as(SDRAM_CLKTR, 0x80000000);
|
||||||
|
|
||||||
|
/* Refresh Time register (0x30) Refresh every 7.8125uS */
|
||||||
|
mtsdram_as(SDRAM_RTR, 0x06180000);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR1 */
|
||||||
|
mtsdram_as(SDRAM_SDTR1, 0x80201000);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR2 */
|
||||||
|
mtsdram_as(SDRAM_SDTR2, 0x32204232);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR3 */
|
||||||
|
mtsdram_as(SDRAM_SDTR3, 0x080b0d1a);
|
||||||
|
|
||||||
|
mtsdram_as(SDRAM_MMODE, 0x00000442);
|
||||||
|
mtsdram_as(SDRAM_MEMODE, 0x00000404);
|
||||||
|
|
||||||
|
/* SDRAM0_MCOPT1 (0X20) No ECC Gen */
|
||||||
|
mtsdram_as(SDRAM_MCOPT1, 0x04322000);
|
||||||
|
|
||||||
|
/* NOP */
|
||||||
|
mtsdram_as(SDRAM_INITPLR0, 0xa8380000);
|
||||||
|
/* precharge 3 DDR clock cycle */
|
||||||
|
mtsdram_as(SDRAM_INITPLR1, 0x81900400);
|
||||||
|
/* EMR2 twr = 2tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR2, 0x81020000);
|
||||||
|
/* EMR3 twr = 2tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR3, 0x81030000);
|
||||||
|
/* EMR DLL ENABLE twr = 2tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR4, 0x81010404);
|
||||||
|
/* MR w/ DLL reset
|
||||||
|
* Note: 5 is CL. May need to be changed
|
||||||
|
*/
|
||||||
|
mtsdram_as(SDRAM_INITPLR5, 0x81000542);
|
||||||
|
/* precharge 3 DDR clock cycle */
|
||||||
|
mtsdram_as(SDRAM_INITPLR6, 0x81900400);
|
||||||
|
/* Auto-refresh trfc = 26tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR7, 0x8D080000);
|
||||||
|
/* Auto-refresh trfc = 26tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR8, 0x8D080000);
|
||||||
|
/* Auto-refresh */
|
||||||
|
mtsdram_as(SDRAM_INITPLR9, 0x8D080000);
|
||||||
|
/* Auto-refresh */
|
||||||
|
mtsdram_as(SDRAM_INITPLR10, 0x8D080000);
|
||||||
|
/* MRS - normal operation; wait 2 cycle (set wait to tMRD) */
|
||||||
|
mtsdram_as(SDRAM_INITPLR11, 0x81000442);
|
||||||
|
mtsdram_as(SDRAM_INITPLR12, 0x81010780);
|
||||||
|
mtsdram_as(SDRAM_INITPLR13, 0x81010400);
|
||||||
|
mtsdram_as(SDRAM_INITPLR14, 0x00000000);
|
||||||
|
mtsdram_as(SDRAM_INITPLR15, 0x00000000);
|
||||||
|
|
||||||
|
/* SET MCIF0_CODT Die Termination On */
|
||||||
|
mtsdram_as(SDRAM_CODT, 0x0080f837);
|
||||||
|
mtsdram_as(SDRAM_MODT0, 0x01800000);
|
||||||
|
mtsdram_as(SDRAM_MODT1, 0x00000000);
|
||||||
|
|
||||||
|
mtsdram_as(SDRAM_WRDTR, 0x00000000);
|
||||||
|
|
||||||
|
/* SDRAM0_MCOPT2 (0X21) Start initialization */
|
||||||
|
mtsdram_as(SDRAM_MCOPT2, 0x20000000);
|
||||||
|
|
||||||
|
/* Step 5 */
|
||||||
|
lis r3,0x1 /* 400000 = wait 100ms */
|
||||||
|
mtctr r3
|
||||||
|
|
||||||
|
pll_wait:
|
||||||
|
bdnz pll_wait
|
||||||
|
|
||||||
|
/* Step 6 */
|
||||||
|
|
||||||
|
/* SDRAM_DLCR */
|
||||||
|
mtsdram_as(SDRAM_DLCR, 0x030000a5);
|
||||||
|
|
||||||
|
/* SDRAM_RDCC */
|
||||||
|
mtsdram_as(SDRAM_RDCC, 0x40000000);
|
||||||
|
|
||||||
|
/* SDRAM_RQDC */
|
||||||
|
mtsdram_as(SDRAM_RQDC, 0x80000038);
|
||||||
|
|
||||||
|
/* SDRAM_RFDC */
|
||||||
|
mtsdram_as(SDRAM_RFDC, 0x00000209);
|
||||||
|
|
||||||
|
/* Enable memory controller */
|
||||||
|
mtsdram_as(SDRAM_MCOPT2, 0x28000000);
|
||||||
|
#endif /* #ifndef CONFIG_NAND_U_BOOT */
|
||||||
|
|
||||||
|
blr
|
||||||
392
board/amcc/kilauea/kilauea.c
Normal file
392
board/amcc/kilauea/kilauea.c
Normal file
@@ -0,0 +1,392 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <ppc4xx.h>
|
||||||
|
#include <ppc405.h>
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
#include <asm/processor.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_PCI)
|
||||||
|
#include <pci.h>
|
||||||
|
#include <asm/4xx_pcie.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Board early initialization function
|
||||||
|
*/
|
||||||
|
int board_early_init_f (void)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------+
|
||||||
|
| Interrupt controller setup for the AMCC 405EX(r) PINE evaluation board.
|
||||||
|
+--------------------------------------------------------------------+
|
||||||
|
+---------------------------------------------------------------------+
|
||||||
|
|Interrupt| Source | Pol. | Sensi.| Crit. |
|
||||||
|
+---------+-----------------------------------+-------+-------+-------+
|
||||||
|
| IRQ 00 | UART0 | High | Level | Non |
|
||||||
|
| IRQ 01 | UART1 | High | Level | Non |
|
||||||
|
| IRQ 02 | IIC0 | High | Level | Non |
|
||||||
|
| IRQ 03 | TBD | High | Level | Non |
|
||||||
|
| IRQ 04 | TBD | High | Level | Non |
|
||||||
|
| IRQ 05 | EBM | High | Level | Non |
|
||||||
|
| IRQ 06 | BGI | High | Level | Non |
|
||||||
|
| IRQ 07 | IIC1 | Rising| Edge | Non |
|
||||||
|
| IRQ 08 | SPI | High | Lvl/ed| Non |
|
||||||
|
| IRQ 09 | External IRQ 0 - (PCI-Express) | pgm H | Pgm | Non |
|
||||||
|
| IRQ 10 | MAL TX EOB | High | Level | Non |
|
||||||
|
| IRQ 11 | MAL RX EOB | High | Level | Non |
|
||||||
|
| IRQ 12 | DMA Channel 0 FIFO Full | High | Level | Non |
|
||||||
|
| IRQ 13 | DMA Channel 0 Stat FIFO | High | Level | Non |
|
||||||
|
| IRQ 14 | DMA Channel 1 FIFO Full | High | Level | Non |
|
||||||
|
| IRQ 15 | DMA Channel 1 Stat FIFO | High | Level | Non |
|
||||||
|
| IRQ 16 | PCIE0 AL | high | Level | Non |
|
||||||
|
| IRQ 17 | PCIE0 VPD access | rising| Edge | Non |
|
||||||
|
| IRQ 18 | PCIE0 hot reset request | rising| Edge | Non |
|
||||||
|
| IRQ 19 | PCIE0 hot reset request | faling| Edge | Non |
|
||||||
|
| IRQ 20 | PCIE0 TCR | High | Level | Non |
|
||||||
|
| IRQ 21 | PCIE0 MSI level0 | High | Level | Non |
|
||||||
|
| IRQ 22 | PCIE0 MSI level1 | High | Level | Non |
|
||||||
|
| IRQ 23 | Security EIP-94 | High | Level | Non |
|
||||||
|
| IRQ 24 | EMAC0 interrupt | High | Level | Non |
|
||||||
|
| IRQ 25 | EMAC1 interrupt | High | Level | Non |
|
||||||
|
| IRQ 26 | PCIE0 MSI level2 | High | Level | Non |
|
||||||
|
| IRQ 27 | External IRQ 4 | pgm H | Pgm | Non |
|
||||||
|
| IRQ 28 | UIC2 Non-critical Int. | High | Level | Non |
|
||||||
|
| IRQ 29 | UIC2 Critical Interrupt | High | Level | Crit. |
|
||||||
|
| IRQ 30 | UIC1 Non-critical Int. | High | Level | Non |
|
||||||
|
| IRQ 31 | UIC1 Critical Interrupt | High | Level | Crit. |
|
||||||
|
|----------------------------------------------------------------------
|
||||||
|
| IRQ 32 | MAL Serr | High | Level | Non |
|
||||||
|
| IRQ 33 | MAL Txde | High | Level | Non |
|
||||||
|
| IRQ 34 | MAL Rxde | High | Level | Non |
|
||||||
|
| IRQ 35 | PCIE0 bus master VC0 |falling| Edge | Non |
|
||||||
|
| IRQ 36 | PCIE0 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 37 | EBC | High |Lvl Edg| Non |
|
||||||
|
| IRQ 38 | NDFC | High | Level | Non |
|
||||||
|
| IRQ 39 | GPT Compare Timer 8 | Risin | Edge | Non |
|
||||||
|
| IRQ 40 | GPT Compare Timer 9 | Risin | Edge | Non |
|
||||||
|
| IRQ 41 | PCIE1 AL | high | Level | Non |
|
||||||
|
| IRQ 42 | PCIE1 VPD access | rising| edge | Non |
|
||||||
|
| IRQ 43 | PCIE1 hot reset request | rising| Edge | Non |
|
||||||
|
| IRQ 44 | PCIE1 hot reset request | faling| Edge | Non |
|
||||||
|
| IRQ 45 | PCIE1 TCR | High | Level | Non |
|
||||||
|
| IRQ 46 | PCIE1 bus master VC0 |falling| Edge | Non |
|
||||||
|
| IRQ 47 | GPT Compare Timer 3 | Risin | Edge | Non |
|
||||||
|
| IRQ 48 | GPT Compare Timer 4 | Risin | Edge | Non |
|
||||||
|
| IRQ 49 | Ext. IRQ 7 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 50 | Ext. IRQ 8 - |pgm (H)|pgm/Lvl| Non |
|
||||||
|
| IRQ 51 | Ext. IRQ 9 |pgm (H)|pgm/Lvl| Non |
|
||||||
|
| IRQ 52 | GPT Compare Timer 5 | high | Edge | Non |
|
||||||
|
| IRQ 53 | GPT Compare Timer 6 | high | Edge | Non |
|
||||||
|
| IRQ 54 | GPT Compare Timer 7 | high | Edge | Non |
|
||||||
|
| IRQ 55 | Serial ROM | High | Level | Non |
|
||||||
|
| IRQ 56 | GPT Decrement Pulse | High | Level | Non |
|
||||||
|
| IRQ 57 | Ext. IRQ 2 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 58 | Ext. IRQ 5 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 59 | Ext. IRQ 6 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 60 | EMAC0 Wake-up | High | Level | Non |
|
||||||
|
| IRQ 61 | Ext. IRQ 1 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 62 | EMAC1 Wake-up | High | Level | Non |
|
||||||
|
|----------------------------------------------------------------------
|
||||||
|
| IRQ 64 | PE0 AL | High | Level | Non |
|
||||||
|
| IRQ 65 | PE0 VPD Access | Risin | Edge | Non |
|
||||||
|
| IRQ 66 | PE0 Hot Reset Request | Risin | Edge | Non |
|
||||||
|
| IRQ 67 | PE0 Hot Reset Request | Falli | Edge | Non |
|
||||||
|
| IRQ 68 | PE0 TCR | High | Level | Non |
|
||||||
|
| IRQ 69 | PE0 BusMaster VCO | Falli | Edge | Non |
|
||||||
|
| IRQ 70 | PE0 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 71 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 72 | PE1 AL | High | Level | Non |
|
||||||
|
| IRQ 73 | PE1 VPD Access | Risin | Edge | Non |
|
||||||
|
| IRQ 74 | PE1 Hot Reset Request | Risin | Edge | Non |
|
||||||
|
| IRQ 75 | PE1 Hot Reset Request | Falli | Edge | Non |
|
||||||
|
| IRQ 76 | PE1 TCR | High | Level | Non |
|
||||||
|
| IRQ 77 | PE1 BusMaster VCO | Falli | Edge | Non |
|
||||||
|
| IRQ 78 | PE1 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 79 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 80 | PE2 AL | High | Level | Non |
|
||||||
|
| IRQ 81 | PE2 VPD Access | Risin | Edge | Non |
|
||||||
|
| IRQ 82 | PE2 Hot Reset Request | Risin | Edge | Non |
|
||||||
|
| IRQ 83 | PE2 Hot Reset Request | Falli | Edge | Non |
|
||||||
|
| IRQ 84 | PE2 TCR | High | Level | Non |
|
||||||
|
| IRQ 85 | PE2 BusMaster VCO | Falli | Edge | Non |
|
||||||
|
| IRQ 86 | PE2 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 87 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 88 | External IRQ(5) | Progr | Progr | Non |
|
||||||
|
| IRQ 89 | External IRQ 4 - Ethernet | Progr | Progr | Non |
|
||||||
|
| IRQ 90 | External IRQ 3 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 91 | External IRQ 2 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 92 | External IRQ 1 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 93 | External IRQ 0 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 94 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 95 | Reserved | N/A | N/A | Non |
|
||||||
|
|---------------------------------------------------------------------
|
||||||
|
+---------+-----------------------------------+-------+-------+------*/
|
||||||
|
/*--------------------------------------------------------------------+
|
||||||
|
| Initialise UIC registers. Clear all interrupts. Disable all
|
||||||
|
| interrupts.
|
||||||
|
| Set critical interrupt values. Set interrupt polarities. Set
|
||||||
|
| interrupt trigger levels. Make bit 0 High priority. Clear all
|
||||||
|
| interrupts again.
|
||||||
|
+-------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
mtdcr (uic2sr, 0xffffffff); /* Clear all interrupts */
|
||||||
|
mtdcr (uic2er, 0x00000000); /* disable all interrupts */
|
||||||
|
mtdcr (uic2cr, 0x00000000); /* Set Critical / Non Critical interrupts */
|
||||||
|
mtdcr (uic2pr, 0xf7ffffff); /* Set Interrupt Polarities */
|
||||||
|
mtdcr (uic2tr, 0x01e1fff8); /* Set Interrupt Trigger Levels */
|
||||||
|
mtdcr (uic2vr, 0x00000001); /* Set Vect base=0,INT31 Highest priority */
|
||||||
|
mtdcr (uic2sr, 0x00000000); /* clear all interrupts */
|
||||||
|
mtdcr (uic2sr, 0xffffffff); /* clear all interrupts */
|
||||||
|
|
||||||
|
mtdcr (uic1sr, 0xffffffff); /* Clear all interrupts */
|
||||||
|
mtdcr (uic1er, 0x00000000); /* disable all interrupts */
|
||||||
|
mtdcr (uic1cr, 0x00000000); /* Set Critical / Non Critical interrupts */
|
||||||
|
mtdcr (uic1pr, 0xfffac785); /* Set Interrupt Polarities */
|
||||||
|
mtdcr (uic1tr, 0x001d0040); /* Set Interrupt Trigger Levels */
|
||||||
|
mtdcr (uic1vr, 0x00000001); /* Set Vect base=0,INT31 Highest priority */
|
||||||
|
mtdcr (uic1sr, 0x00000000); /* clear all interrupts */
|
||||||
|
mtdcr (uic1sr, 0xffffffff); /* clear all interrupts */
|
||||||
|
|
||||||
|
mtdcr (uic0sr, 0xffffffff); /* Clear all interrupts */
|
||||||
|
mtdcr (uic0er, 0x0000000a); /* Disable all interrupts */
|
||||||
|
/* Except cascade UIC0 and UIC1 */
|
||||||
|
mtdcr (uic0cr, 0x00000000); /* Set Critical / Non Critical interrupts */
|
||||||
|
mtdcr (uic0pr, 0xffbfefef); /* Set Interrupt Polarities */
|
||||||
|
mtdcr (uic0tr, 0x00007000); /* Set Interrupt Trigger Levels */
|
||||||
|
mtdcr (uic0vr, 0x00000001); /* Set Vect base=0,INT31 Highest priority */
|
||||||
|
mtdcr (uic0sr, 0x00000000); /* clear all interrupts */
|
||||||
|
mtdcr (uic0sr, 0xffffffff); /* clear all interrupts */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: Some cores are still in reset when the chip starts, so
|
||||||
|
* take them out of reset
|
||||||
|
*/
|
||||||
|
mtsdr(SDR0_SRST, 0);
|
||||||
|
|
||||||
|
/* Configure 405EX for NAND usage */
|
||||||
|
val = SDR0_CUST0_MUX_NDFC_SEL |
|
||||||
|
SDR0_CUST0_NDFC_ENABLE |
|
||||||
|
SDR0_CUST0_NDFC_BW_8_BIT |
|
||||||
|
SDR0_CUST0_NRB_BUSY |
|
||||||
|
(0x80000000 >> (28 + CFG_NAND_CS));
|
||||||
|
mtsdr(SDR0_CUST0, val);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PFC (Pin Function Control) registers
|
||||||
|
* -> Enable USB
|
||||||
|
*/
|
||||||
|
val = SDR0_PFC1_USBEN | SDR0_PFC1_USBBIGEN | SDR0_PFC1_GPT_FREQ;
|
||||||
|
mtsdr(SDR0_PFC1, val);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure FPGA register with PCIe reset
|
||||||
|
*/
|
||||||
|
out_be32((void *)CFG_FPGA_BASE, 0xff570cc4); /* assert PCIe reset */
|
||||||
|
mdelay(50);
|
||||||
|
out_be32((void *)CFG_FPGA_BASE, 0xff570cc7); /* deassert PCIe reset */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
#ifdef CFG_ENV_IS_IN_FLASH
|
||||||
|
/* Monitor protection ON by default */
|
||||||
|
flash_protect(FLAG_PROTECT_SET,
|
||||||
|
-CFG_MONITOR_LEN,
|
||||||
|
0xffffffff,
|
||||||
|
&flash_info[0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int board_emac_count(void)
|
||||||
|
{
|
||||||
|
u32 pvr = get_pvr();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 405EXr only has one EMAC interface, 405EX has two
|
||||||
|
*/
|
||||||
|
if ((pvr == PVR_405EXR1_RA) || (pvr == PVR_405EXR2_RA))
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int board_pcie_count(void)
|
||||||
|
{
|
||||||
|
u32 pvr = get_pvr();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 405EXr only has one EMAC interface, 405EX has two
|
||||||
|
*/
|
||||||
|
if ((pvr == PVR_405EXR1_RA) || (pvr == PVR_405EXR2_RA))
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int checkboard (void)
|
||||||
|
{
|
||||||
|
char *s = getenv("serial#");
|
||||||
|
u32 pvr = get_pvr();
|
||||||
|
|
||||||
|
if ((pvr == PVR_405EXR1_RA) || (pvr == PVR_405EXR2_RA))
|
||||||
|
printf("Board: Haleakala - AMCC PPC405EXr Evaluation Board");
|
||||||
|
else
|
||||||
|
printf("Board: Kilauea - AMCC PPC405EX Evaluation Board");
|
||||||
|
|
||||||
|
if (s != NULL) {
|
||||||
|
puts(", serial# ");
|
||||||
|
puts(s);
|
||||||
|
}
|
||||||
|
putc('\n');
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* pci_pre_init
|
||||||
|
*
|
||||||
|
* This routine is called just prior to registering the hose and gives
|
||||||
|
* the board the opportunity to check things. Returning a value of zero
|
||||||
|
* indicates that things are bad & PCI initialization should be aborted.
|
||||||
|
*
|
||||||
|
* Different boards may wish to customize the pci controller structure
|
||||||
|
* (add regions, override default access routines, etc) or perform
|
||||||
|
* certain pre-initialization actions.
|
||||||
|
*
|
||||||
|
************************************************************************/
|
||||||
|
#if defined(CONFIG_PCI)
|
||||||
|
int pci_pre_init(struct pci_controller * hose )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_PCI) */
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI
|
||||||
|
static struct pci_controller pcie_hose[2] = {{0},{0}};
|
||||||
|
|
||||||
|
void pcie_setup_hoses(int busno)
|
||||||
|
{
|
||||||
|
struct pci_controller *hose;
|
||||||
|
int i, bus;
|
||||||
|
int ret = 0;
|
||||||
|
bus = busno;
|
||||||
|
char *env;
|
||||||
|
unsigned int delay;
|
||||||
|
|
||||||
|
for (i = 0; i < board_pcie_count(); i++) {
|
||||||
|
|
||||||
|
if (is_end_point(i))
|
||||||
|
ret = ppc4xx_init_pcie_endport(i);
|
||||||
|
else
|
||||||
|
ret = ppc4xx_init_pcie_rootport(i);
|
||||||
|
if (ret) {
|
||||||
|
printf("PCIE%d: initialization as %s failed\n", i,
|
||||||
|
is_end_point(i) ? "endpoint" : "root-complex");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
hose = &pcie_hose[i];
|
||||||
|
hose->first_busno = bus;
|
||||||
|
hose->last_busno = bus;
|
||||||
|
hose->current_busno = bus;
|
||||||
|
|
||||||
|
/* setup mem resource */
|
||||||
|
pci_set_region(hose->regions + 0,
|
||||||
|
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
||||||
|
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
||||||
|
CFG_PCIE_MEMSIZE,
|
||||||
|
PCI_REGION_MEM);
|
||||||
|
hose->region_count = 1;
|
||||||
|
pci_register_hose(hose);
|
||||||
|
|
||||||
|
if (is_end_point(i)) {
|
||||||
|
ppc4xx_setup_pcie_endpoint(hose, i);
|
||||||
|
/*
|
||||||
|
* Reson for no scanning is endpoint can not generate
|
||||||
|
* upstream configuration accesses.
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
|
ppc4xx_setup_pcie_rootpoint(hose, i);
|
||||||
|
env = getenv ("pciscandelay");
|
||||||
|
if (env != NULL) {
|
||||||
|
delay = simple_strtoul(env, NULL, 10);
|
||||||
|
if (delay > 5)
|
||||||
|
printf("Warning, expect noticable delay before "
|
||||||
|
"PCIe scan due to 'pciscandelay' value!\n");
|
||||||
|
mdelay(delay * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Config access can only go down stream
|
||||||
|
*/
|
||||||
|
hose->last_busno = pci_hose_scan(hose);
|
||||||
|
bus = hose->last_busno + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_POST)
|
||||||
|
/*
|
||||||
|
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||||
|
* Called from board_init_f().
|
||||||
|
*/
|
||||||
|
int post_hotkeys_pressed(void)
|
||||||
|
{
|
||||||
|
return 0; /* No hotkeys supported */
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_POST */
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
u32 val[4];
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
ft_cpu_setup(blob, bd);
|
||||||
|
|
||||||
|
/* Fixup NOR mapping */
|
||||||
|
val[0] = 0; /* chip select number */
|
||||||
|
val[1] = 0; /* always 0 */
|
||||||
|
val[2] = gd->bd->bi_flashstart;
|
||||||
|
val[3] = gd->bd->bi_flashsize;
|
||||||
|
rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
|
||||||
|
val, sizeof(val), 1);
|
||||||
|
if (rc)
|
||||||
|
printf("Unable to update property NOR mapping, err=%s\n",
|
||||||
|
fdt_strerror(rc));
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
79
board/amcc/kilauea/memory.c
Normal file
79
board/amcc/kilauea/memory.c
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/processor.h>
|
||||||
|
#include <i2c.h>
|
||||||
|
|
||||||
|
void sdram_init(void)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
long int initdram(int board_type)
|
||||||
|
{
|
||||||
|
return (CFG_MBYTES_SDRAM << 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CFG_DRAM_TEST)
|
||||||
|
int testdram (void)
|
||||||
|
{
|
||||||
|
printf ("testdram\n");
|
||||||
|
#if defined (CONFIG_NAND_U_BOOT)
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
uint *pstart = (uint *) 0x00000000;
|
||||||
|
uint *pend = (uint *) 0x00001000;
|
||||||
|
uint *p;
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
*p = 0xaaaaaaaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
if (*p != 0xaaaaaaaa) {
|
||||||
|
#if !defined (CONFIG_NAND_SPL)
|
||||||
|
printf ("SDRAM test fails at: %08x\n", (uint) p);
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
*p = 0x55555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
if (*p != 0x55555555) {
|
||||||
|
#if !defined (CONFIG_NAND_SPL)
|
||||||
|
printf ("SDRAM test fails at: %08x\n", (uint) p);
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if !defined (CONFIG_NAND_SPL)
|
||||||
|
printf ("SDRAM test passed!!!\n");
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
137
board/amcc/kilauea/u-boot-nand.lds
Normal file
137
board/amcc/kilauea/u-boot-nand.lds
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_ARCH(powerpc)
|
||||||
|
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* Read-only sections, merged into text segment: */
|
||||||
|
. = + SIZEOF_HEADERS;
|
||||||
|
.interp : { *(.interp) }
|
||||||
|
.hash : { *(.hash) }
|
||||||
|
.dynsym : { *(.dynsym) }
|
||||||
|
.dynstr : { *(.dynstr) }
|
||||||
|
.rel.text : { *(.rel.text) }
|
||||||
|
.rela.text : { *(.rela.text) }
|
||||||
|
.rel.data : { *(.rel.data) }
|
||||||
|
.rela.data : { *(.rela.data) }
|
||||||
|
.rel.rodata : { *(.rel.rodata) }
|
||||||
|
.rela.rodata : { *(.rela.rodata) }
|
||||||
|
.rel.got : { *(.rel.got) }
|
||||||
|
.rela.got : { *(.rela.got) }
|
||||||
|
.rel.ctors : { *(.rel.ctors) }
|
||||||
|
.rela.ctors : { *(.rela.ctors) }
|
||||||
|
.rel.dtors : { *(.rel.dtors) }
|
||||||
|
.rela.dtors : { *(.rela.dtors) }
|
||||||
|
.rel.bss : { *(.rel.bss) }
|
||||||
|
.rela.bss : { *(.rela.bss) }
|
||||||
|
.rel.plt : { *(.rel.plt) }
|
||||||
|
.rela.plt : { *(.rela.plt) }
|
||||||
|
.init : { *(.init) }
|
||||||
|
.plt : { *(.plt) }
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
/* WARNING - the following is hand-optimized to fit within */
|
||||||
|
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||||
|
|
||||||
|
cpu/ppc4xx/start.o (.text)
|
||||||
|
|
||||||
|
/* Align to next NAND block */
|
||||||
|
. = ALIGN(0x4000);
|
||||||
|
common/environment.o (.ppcenv)
|
||||||
|
/* Keep some space here for redundant env and potential bad env blocks */
|
||||||
|
. = ALIGN(0x10000);
|
||||||
|
|
||||||
|
*(.text)
|
||||||
|
*(.fixup)
|
||||||
|
*(.got1)
|
||||||
|
}
|
||||||
|
_etext = .;
|
||||||
|
PROVIDE (etext = .);
|
||||||
|
.rodata :
|
||||||
|
{
|
||||||
|
*(.rodata)
|
||||||
|
*(.rodata1)
|
||||||
|
*(.rodata.str1.4)
|
||||||
|
}
|
||||||
|
.fini : { *(.fini) } =0
|
||||||
|
.ctors : { *(.ctors) }
|
||||||
|
.dtors : { *(.dtors) }
|
||||||
|
|
||||||
|
/* Read-write section, merged into data segment: */
|
||||||
|
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||||
|
_erotext = .;
|
||||||
|
PROVIDE (erotext = .);
|
||||||
|
.reloc :
|
||||||
|
{
|
||||||
|
*(.got)
|
||||||
|
_GOT2_TABLE_ = .;
|
||||||
|
*(.got2)
|
||||||
|
_FIXUP_TABLE_ = .;
|
||||||
|
*(.fixup)
|
||||||
|
}
|
||||||
|
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||||
|
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||||
|
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
*(.data)
|
||||||
|
*(.data1)
|
||||||
|
*(.sdata)
|
||||||
|
*(.sdata2)
|
||||||
|
*(.dynamic)
|
||||||
|
CONSTRUCTORS
|
||||||
|
}
|
||||||
|
_edata = .;
|
||||||
|
PROVIDE (edata = .);
|
||||||
|
|
||||||
|
. = .;
|
||||||
|
__u_boot_cmd_start = .;
|
||||||
|
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||||
|
__u_boot_cmd_end = .;
|
||||||
|
|
||||||
|
|
||||||
|
. = .;
|
||||||
|
__start___ex_table = .;
|
||||||
|
__ex_table : { *(__ex_table) }
|
||||||
|
__stop___ex_table = .;
|
||||||
|
|
||||||
|
. = ALIGN(256);
|
||||||
|
__init_begin = .;
|
||||||
|
.text.init : { *(.text.init) }
|
||||||
|
.data.init : { *(.data.init) }
|
||||||
|
. = ALIGN(256);
|
||||||
|
__init_end = .;
|
||||||
|
|
||||||
|
__bss_start = .;
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
*(.sbss) *(.scommon)
|
||||||
|
*(.dynbss)
|
||||||
|
*(.bss)
|
||||||
|
*(COMMON)
|
||||||
|
}
|
||||||
|
|
||||||
|
_end = . ;
|
||||||
|
PROVIDE (end = .);
|
||||||
|
}
|
||||||
137
board/amcc/kilauea/u-boot.lds
Normal file
137
board/amcc/kilauea/u-boot.lds
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_ARCH(powerpc)
|
||||||
|
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||||
|
/* Do we need any of these for elf?
|
||||||
|
__DYNAMIC = 0; */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* To compile successfully, uncomment the following section.
|
||||||
|
* To go in ram, remove the section.
|
||||||
|
* Added by SunHe.
|
||||||
|
*/
|
||||||
|
.resetvec 0xFFFFFFFC :
|
||||||
|
{
|
||||||
|
*(.resetvec)
|
||||||
|
} = 0xffff
|
||||||
|
|
||||||
|
/* Read-only sections, merged into text segment: */
|
||||||
|
. = + SIZEOF_HEADERS;
|
||||||
|
.interp : { *(.interp) }
|
||||||
|
.hash : { *(.hash) }
|
||||||
|
.dynsym : { *(.dynsym) }
|
||||||
|
.dynstr : { *(.dynstr) }
|
||||||
|
.rel.text : { *(.rel.text) }
|
||||||
|
.rela.text : { *(.rela.text) }
|
||||||
|
.rel.data : { *(.rel.data) }
|
||||||
|
.rela.data : { *(.rela.data) }
|
||||||
|
.rel.rodata : { *(.rel.rodata) }
|
||||||
|
.rela.rodata : { *(.rela.rodata) }
|
||||||
|
.rel.got : { *(.rel.got) }
|
||||||
|
.rela.got : { *(.rela.got) }
|
||||||
|
.rel.ctors : { *(.rel.ctors) }
|
||||||
|
.rela.ctors : { *(.rela.ctors) }
|
||||||
|
.rel.dtors : { *(.rel.dtors) }
|
||||||
|
.rela.dtors : { *(.rela.dtors) }
|
||||||
|
.rel.bss : { *(.rel.bss) }
|
||||||
|
.rela.bss : { *(.rela.bss) }
|
||||||
|
.rel.plt : { *(.rel.plt) }
|
||||||
|
.rela.plt : { *(.rela.plt) }
|
||||||
|
.init : { *(.init) }
|
||||||
|
.plt : { *(.plt) }
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
cpu/ppc4xx/start.o (.text)
|
||||||
|
|
||||||
|
*(.text)
|
||||||
|
*(.fixup)
|
||||||
|
*(.got1)
|
||||||
|
}
|
||||||
|
_etext = .;
|
||||||
|
PROVIDE (etext = .);
|
||||||
|
.rodata :
|
||||||
|
{
|
||||||
|
*(.rodata)
|
||||||
|
*(.rodata1)
|
||||||
|
*(.rodata.str1.4)
|
||||||
|
}
|
||||||
|
.fini : { *(.fini) } =0
|
||||||
|
.ctors : { *(.ctors) }
|
||||||
|
.dtors : { *(.dtors) }
|
||||||
|
|
||||||
|
/* Read-write section, merged into data segment: */
|
||||||
|
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||||
|
_erotext = .;
|
||||||
|
PROVIDE (erotext = .);
|
||||||
|
.reloc :
|
||||||
|
{
|
||||||
|
*(.got)
|
||||||
|
_GOT2_TABLE_ = .;
|
||||||
|
*(.got2)
|
||||||
|
_FIXUP_TABLE_ = .;
|
||||||
|
*(.fixup)
|
||||||
|
}
|
||||||
|
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||||
|
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||||
|
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
*(.data)
|
||||||
|
*(.data1)
|
||||||
|
*(.sdata)
|
||||||
|
*(.sdata2)
|
||||||
|
*(.dynamic)
|
||||||
|
CONSTRUCTORS
|
||||||
|
}
|
||||||
|
_edata = .;
|
||||||
|
PROVIDE (edata = .);
|
||||||
|
|
||||||
|
. = .;
|
||||||
|
__u_boot_cmd_start = .;
|
||||||
|
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||||
|
__u_boot_cmd_end = .;
|
||||||
|
|
||||||
|
. = .;
|
||||||
|
__start___ex_table = .;
|
||||||
|
__ex_table : { *(__ex_table) }
|
||||||
|
__stop___ex_table = .;
|
||||||
|
|
||||||
|
. = ALIGN(256);
|
||||||
|
__init_begin = .;
|
||||||
|
.text.init : { *(.text.init) }
|
||||||
|
.data.init : { *(.data.init) }
|
||||||
|
. = ALIGN(256);
|
||||||
|
__init_end = .;
|
||||||
|
|
||||||
|
__bss_start = .;
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
*(.sbss) *(.scommon)
|
||||||
|
*(.dynbss)
|
||||||
|
*(.bss)
|
||||||
|
*(COMMON)
|
||||||
|
}
|
||||||
|
_end = . ;
|
||||||
|
PROVIDE (end = .);
|
||||||
|
}
|
||||||
@@ -39,6 +39,8 @@ extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
int board_early_init_f(void)
|
int board_early_init_f(void)
|
||||||
{
|
{
|
||||||
|
u32 mfr;
|
||||||
|
|
||||||
mtebc( pb0ap, 0x03800000 ); /* set chip selects */
|
mtebc( pb0ap, 0x03800000 ); /* set chip selects */
|
||||||
mtebc( pb0cr, 0xffc58000 ); /* ebc0_b0cr, 4MB at 0xffc00000 CS0 */
|
mtebc( pb0cr, 0xffc58000 ); /* ebc0_b0cr, 4MB at 0xffc00000 CS0 */
|
||||||
mtebc( pb1ap, 0x03800000 );
|
mtebc( pb1ap, 0x03800000 );
|
||||||
@@ -64,6 +66,10 @@ int board_early_init_f(void)
|
|||||||
mtdcr( uic0sr, 0x00000000 ); /* clear all interrupts */
|
mtdcr( uic0sr, 0x00000000 ); /* clear all interrupts */
|
||||||
mtdcr( uic0sr, 0xffffffff );
|
mtdcr( uic0sr, 0xffffffff );
|
||||||
|
|
||||||
|
mfsdr(sdr_mfr, mfr);
|
||||||
|
mfr |= SDR0_MFR_FIXD; /* Workaround for PCI/DMA */
|
||||||
|
mtsdr(sdr_mfr, mfr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
50
board/amcc/makalu/Makefile
Normal file
50
board/amcc/makalu/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2007
|
||||||
|
# Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
LIB = $(obj)lib$(BOARD).a
|
||||||
|
|
||||||
|
COBJS = $(BOARD).o cmd_pll.o memory.o
|
||||||
|
SOBJS = init.o
|
||||||
|
|
||||||
|
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||||
|
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
||||||
|
|
||||||
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJS)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f $(LIB) core *.bak .depend *~
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# defines $(obj).depend target
|
||||||
|
include $(SRCTREE)/rules.mk
|
||||||
|
|
||||||
|
sinclude $(obj).depend
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
297
board/amcc/makalu/cmd_pll.c
Normal file
297
board/amcc/makalu/cmd_pll.c
Normal file
@@ -0,0 +1,297 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000, 2001
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ehnus: change pll frequency.
|
||||||
|
* Wed Sep 5 11:45:17 CST 2007
|
||||||
|
* hsun@udtech.com.cn
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <i2c.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_EEPROM
|
||||||
|
|
||||||
|
#define EEPROM_CONF_OFFSET 0
|
||||||
|
#define EEPROM_TEST_OFFSET 16
|
||||||
|
#define EEPROM_SDSTP_PARAM 16
|
||||||
|
|
||||||
|
#define PLL_NAME_MAX 12
|
||||||
|
#define BUF_STEP 8
|
||||||
|
|
||||||
|
/* eeprom_wirtes 8Byte per op. */
|
||||||
|
#define EEPROM_ALTER_FREQ(freq) \
|
||||||
|
do { \
|
||||||
|
int __i; \
|
||||||
|
for (__i = 0; __i < 2; __i++) \
|
||||||
|
eeprom_write (CFG_I2C_EEPROM_ADDR, \
|
||||||
|
EEPROM_CONF_OFFSET + __i*BUF_STEP, \
|
||||||
|
pll_select[freq], \
|
||||||
|
BUF_STEP + __i*BUF_STEP); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define PDEBUG
|
||||||
|
#ifdef PDEBUG
|
||||||
|
#define PLL_DEBUG pll_debug(EEPROM_CONF_OFFSET)
|
||||||
|
#else
|
||||||
|
#define PLL_DEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
PLL_ebc20,
|
||||||
|
PLL_333,
|
||||||
|
PLL_4001,
|
||||||
|
PLL_4002,
|
||||||
|
PLL_533,
|
||||||
|
PLL_600,
|
||||||
|
PLL_666, /* For now, kilauea can't support */
|
||||||
|
RCONF,
|
||||||
|
WTEST,
|
||||||
|
PLL_TOTAL
|
||||||
|
} pll_freq_t;
|
||||||
|
|
||||||
|
static const char
|
||||||
|
pll_name[][PLL_NAME_MAX] = {
|
||||||
|
"PLL_ebc20",
|
||||||
|
"PLL_333",
|
||||||
|
"PLL_400@1",
|
||||||
|
"PLL_400@2",
|
||||||
|
"PLL_533",
|
||||||
|
"PLL_600",
|
||||||
|
"PLL_666",
|
||||||
|
"RCONF",
|
||||||
|
"WTEST",
|
||||||
|
""
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ehnus:
|
||||||
|
*/
|
||||||
|
static uchar
|
||||||
|
pll_select[][EEPROM_SDSTP_PARAM] = {
|
||||||
|
/* 0: CPU 333MHz EBC 20MHz, for test only */
|
||||||
|
{
|
||||||
|
0x8c, 0x12, 0xec, 0x12, 0x88, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 0: 333 */
|
||||||
|
{
|
||||||
|
0x8c, 0x12, 0xec, 0x12, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 1: 400_266 */
|
||||||
|
{
|
||||||
|
0x8e, 0x0e, 0xe8, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 2: 400 */
|
||||||
|
{
|
||||||
|
0x8e, 0x0e, 0xe8, 0x12, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 3: 533 */
|
||||||
|
{
|
||||||
|
0x8e, 0x43, 0x60, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 4: 600 */
|
||||||
|
{
|
||||||
|
0x8d, 0x02, 0x34, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 5: 666 */
|
||||||
|
{
|
||||||
|
0x8d, 0x03, 0x78, 0x13, 0x98, 0x00, 0x0a, 0x00,
|
||||||
|
0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00
|
||||||
|
},
|
||||||
|
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
static uchar
|
||||||
|
testbuf[EEPROM_SDSTP_PARAM] = {
|
||||||
|
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||||
|
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
pll_debug(int off)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
uchar buffer[EEPROM_SDSTP_PARAM];
|
||||||
|
|
||||||
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
eeprom_read(CFG_I2C_EEPROM_ADDR, off,
|
||||||
|
buffer, EEPROM_SDSTP_PARAM);
|
||||||
|
|
||||||
|
printf("Debug: SDSTP[0-3] at offset \"0x%02x\" lists as follows: \n", off);
|
||||||
|
for (i = 0; i < EEPROM_SDSTP_PARAM; i++)
|
||||||
|
printf("%02x ", buffer[i]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_write(void)
|
||||||
|
{
|
||||||
|
printf("Debug: test eeprom_write ... ");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write twice, 8 bytes per write
|
||||||
|
*/
|
||||||
|
eeprom_write (CFG_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET,
|
||||||
|
testbuf, 8);
|
||||||
|
eeprom_write (CFG_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET+8,
|
||||||
|
testbuf, 16);
|
||||||
|
printf("done\n");
|
||||||
|
|
||||||
|
pll_debug(EEPROM_TEST_OFFSET);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
|
{
|
||||||
|
char c = '\0';
|
||||||
|
pll_freq_t pll_freq;
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("Usage: \n%s\n", cmdtp->usage);
|
||||||
|
goto ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (pll_freq = PLL_ebc20; pll_freq < PLL_TOTAL; pll_freq++)
|
||||||
|
if (!strcmp(pll_name[pll_freq], argv[1]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch (pll_freq) {
|
||||||
|
case PLL_ebc20:
|
||||||
|
case PLL_333:
|
||||||
|
case PLL_4001:
|
||||||
|
case PLL_4002:
|
||||||
|
case PLL_533:
|
||||||
|
case PLL_600:
|
||||||
|
EEPROM_ALTER_FREQ(pll_freq);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PLL_666: /* not support */
|
||||||
|
printf("Choose this option will result in a boot failure."
|
||||||
|
"\nContinue? (Y/N): ");
|
||||||
|
|
||||||
|
c = getc(); putc('\n');
|
||||||
|
|
||||||
|
if ((c == 'y') || (c == 'Y')) {
|
||||||
|
EEPROM_ALTER_FREQ(pll_freq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
goto ret;
|
||||||
|
|
||||||
|
case RCONF:
|
||||||
|
pll_debug(EEPROM_CONF_OFFSET);
|
||||||
|
goto ret;
|
||||||
|
case WTEST:
|
||||||
|
printf("DEBUG: write test\n");
|
||||||
|
test_write();
|
||||||
|
goto ret;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("Invalid options"
|
||||||
|
"\n\nUsage: \n%s\n", cmdtp->usage);
|
||||||
|
goto ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("PLL set to %s, "
|
||||||
|
"reset the board to take effect\n", pll_name[pll_freq]);
|
||||||
|
|
||||||
|
PLL_DEBUG;
|
||||||
|
ret:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
U_BOOT_CMD(
|
||||||
|
pllalter, CFG_MAXARGS, 1, do_pll_alter,
|
||||||
|
"pllalter- change pll frequence \n",
|
||||||
|
"pllalter <selection> - change pll frequence \n\n\
|
||||||
|
** New freq take effect after reset. ** \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_ebc20: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t Same as PLL_333 \n\
|
||||||
|
\t except \n\
|
||||||
|
\t EBC: 20 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_333: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 666 MHz \n\
|
||||||
|
\t CPU: 333 MHz \n\
|
||||||
|
\t PLB: 166 MHz \n\
|
||||||
|
\t OPB: 83 MHz \n\
|
||||||
|
\t DDR: 83 MHz \n\
|
||||||
|
------------------------------------------------\n\
|
||||||
|
PLL_400@1: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 800 MHz \n\
|
||||||
|
\t CPU: 400 MHz \n\
|
||||||
|
\t PLB: 133 MHz \n\
|
||||||
|
\t OPB: 66 MHz \n\
|
||||||
|
\t DDR: 133 MHz \n\
|
||||||
|
------------------------------------------------\n\
|
||||||
|
PLL_400@2: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 800 MHz \n\
|
||||||
|
\t CPU: 400 MHz \n\
|
||||||
|
\t PLB: 200 MHz \n\
|
||||||
|
\t OPB: 100 MHz \n\
|
||||||
|
\t DDR: 200 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_533: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 1066 MHz \n\
|
||||||
|
\t CPU: 533 MHz \n\
|
||||||
|
\t PLB: 177 MHz \n\
|
||||||
|
\t OPB: 88 MHz \n\
|
||||||
|
\t DDR: 177 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_600: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 1200 MHz \n\
|
||||||
|
\t CPU: 600 MHz \n\
|
||||||
|
\t PLB: 200 MHz \n\
|
||||||
|
\t OPB: 100 MHz \n\
|
||||||
|
\t DDR: 200 MHz \n\
|
||||||
|
----------------------------------------------\n\
|
||||||
|
PLL_666: Board: AMCC 405EX(r) Evaluation Board\n\
|
||||||
|
\t VCO: 1333 MHz \n\
|
||||||
|
\t CPU: 666 MHz \n\
|
||||||
|
\t PLB: 166 MHz \n\
|
||||||
|
\t OPB: 83 MHz \n\
|
||||||
|
\t DDR: 166 MHz \n\
|
||||||
|
-----------------------------------------------\n\
|
||||||
|
RCONF: Read current eeprom configuration. \n\
|
||||||
|
-----------------------------------------------\n\
|
||||||
|
WTEST: Test EEPROM write with predefined values\n\
|
||||||
|
-----------------------------------------------\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif /* CONFIG_CMD_EEPROM */
|
||||||
24
board/amcc/makalu/config.mk
Normal file
24
board/amcc/makalu/config.mk
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# (C) Copyright 2000
|
||||||
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
#
|
||||||
|
# See file CREDITS for list of people who contributed to this
|
||||||
|
# project.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
TEXT_BASE = 0xFFFA0000
|
||||||
148
board/amcc/makalu/init.S
Normal file
148
board/amcc/makalu/init.S
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* Based on code provided from Senao and AMCC
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <ppc4xx.h>
|
||||||
|
|
||||||
|
#include <ppc_asm.tmpl>
|
||||||
|
#include <ppc_defs.h>
|
||||||
|
|
||||||
|
#define mtsdram_as(reg, value) \
|
||||||
|
addi r4,0,reg ; \
|
||||||
|
mtdcr memcfga,r4 ; \
|
||||||
|
addis r4,0,value@h ; \
|
||||||
|
ori r4,r4,value@l ; \
|
||||||
|
mtdcr memcfgd,r4 ;
|
||||||
|
|
||||||
|
.globl ext_bus_cntlr_init
|
||||||
|
ext_bus_cntlr_init:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DDR2 setup
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Following the DDR Core Manual, here is the initialization */
|
||||||
|
|
||||||
|
/* Step 1 */
|
||||||
|
|
||||||
|
/* Step 2 */
|
||||||
|
|
||||||
|
/* Step 3 */
|
||||||
|
|
||||||
|
/* base=00000000, size=128MByte (5), mode=2 (n*10*4) */
|
||||||
|
mtsdram_as(SDRAM_MB0CF, 0x00005201);
|
||||||
|
|
||||||
|
/* base=08000000, size=128MByte (5), mode=2 (n*10*4) */
|
||||||
|
mtsdram_as(SDRAM_MB1CF, (0x08000000 >> 3) | 0x5201);
|
||||||
|
|
||||||
|
/* SDRAM_CLKTR: Adv Addr clock by 90 deg */
|
||||||
|
mtsdram_as(SDRAM_CLKTR,0x80000000);
|
||||||
|
|
||||||
|
/* Refresh Time register (0x30) Refresh every 7.8125uS */
|
||||||
|
mtsdram_as(SDRAM_RTR, 0x06180000);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR1 */
|
||||||
|
mtsdram_as(SDRAM_SDTR1, 0x80201000);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR2 */
|
||||||
|
mtsdram_as(SDRAM_SDTR2, 0x32204232);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR3 */
|
||||||
|
mtsdram_as(SDRAM_SDTR3, 0x080b0d1a);
|
||||||
|
|
||||||
|
mtsdram_as(SDRAM_MMODE, 0x00000442);
|
||||||
|
mtsdram_as(SDRAM_MEMODE, 0x00000404);
|
||||||
|
|
||||||
|
/* SDRAM0_MCOPT1 (0X20) No ECC Gen */
|
||||||
|
mtsdram_as(SDRAM_MCOPT1, 0x04322000);
|
||||||
|
|
||||||
|
/* NOP */
|
||||||
|
mtsdram_as(SDRAM_INITPLR0, 0xa8380000);
|
||||||
|
/* precharge 3 DDR clock cycle */
|
||||||
|
mtsdram_as(SDRAM_INITPLR1, 0x81900400);
|
||||||
|
/* EMR2 twr = 2tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR2, 0x81020000);
|
||||||
|
/* EMR3 twr = 2tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR3, 0x81030000);
|
||||||
|
/* EMR DLL ENABLE twr = 2tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR4, 0x81010404);
|
||||||
|
/* MR w/ DLL reset
|
||||||
|
* Note: 5 is CL. May need to be changed
|
||||||
|
*/
|
||||||
|
mtsdram_as(SDRAM_INITPLR5, 0x81000542);
|
||||||
|
/* precharge 3 DDR clock cycle */
|
||||||
|
mtsdram_as(SDRAM_INITPLR6, 0x81900400);
|
||||||
|
/* Auto-refresh trfc = 26tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR7, 0x8D080000);
|
||||||
|
/* Auto-refresh trfc = 26tck */
|
||||||
|
mtsdram_as(SDRAM_INITPLR8, 0x8D080000);
|
||||||
|
/* Auto-refresh */
|
||||||
|
mtsdram_as(SDRAM_INITPLR9, 0x8D080000);
|
||||||
|
/* Auto-refresh */
|
||||||
|
mtsdram_as(SDRAM_INITPLR10, 0x8D080000);
|
||||||
|
/* MRS - normal operation; wait 2 cycle (set wait to tMRD) */
|
||||||
|
mtsdram_as(SDRAM_INITPLR11, 0x81000442);
|
||||||
|
mtsdram_as(SDRAM_INITPLR12, 0x81010780);
|
||||||
|
mtsdram_as(SDRAM_INITPLR13, 0x81010400);
|
||||||
|
mtsdram_as(SDRAM_INITPLR14, 0x00000000);
|
||||||
|
mtsdram_as(SDRAM_INITPLR15, 0x00000000);
|
||||||
|
|
||||||
|
/* SET MCIF0_CODT Die Termination On */
|
||||||
|
mtsdram_as(SDRAM_CODT, 0x0080f837);
|
||||||
|
mtsdram_as(SDRAM_MODT0, 0x01800000);
|
||||||
|
#if 0 /* test-only: not sure if 0 is ok when 2nd bank is used */
|
||||||
|
mtsdram_as(SDRAM_MODT1, 0x00000000);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
mtsdram_as(SDRAM_WRDTR, 0x00000000);
|
||||||
|
|
||||||
|
/* SDRAM0_MCOPT2 (0X21) Start initialization */
|
||||||
|
mtsdram_as(SDRAM_MCOPT2, 0x20000000);
|
||||||
|
|
||||||
|
/* Step 5 */
|
||||||
|
lis r3,0x1 /* 400000 = wait 100ms */
|
||||||
|
mtctr r3
|
||||||
|
|
||||||
|
pll_wait:
|
||||||
|
bdnz pll_wait
|
||||||
|
|
||||||
|
/* Step 6 */
|
||||||
|
|
||||||
|
/* SDRAM_DLCR */
|
||||||
|
mtsdram_as(SDRAM_DLCR, 0x030000a5);
|
||||||
|
|
||||||
|
/* SDRAM_RDCC */
|
||||||
|
mtsdram_as(SDRAM_RDCC, 0x40000000);
|
||||||
|
|
||||||
|
/* SDRAM_RQDC */
|
||||||
|
mtsdram_as(SDRAM_RQDC, 0x80000038);
|
||||||
|
|
||||||
|
/* SDRAM_RFDC */
|
||||||
|
mtsdram_as(SDRAM_RFDC, 0x00000209);
|
||||||
|
|
||||||
|
/* Enable memory controller */
|
||||||
|
mtsdram_as(SDRAM_MCOPT2, 0x28000000);
|
||||||
|
|
||||||
|
blr
|
||||||
353
board/amcc/makalu/makalu.c
Normal file
353
board/amcc/makalu/makalu.c
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <ppc4xx.h>
|
||||||
|
#include <ppc405.h>
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <asm/processor.h>
|
||||||
|
#include <asm/gpio.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_PCI)
|
||||||
|
#include <pci.h>
|
||||||
|
#include <asm/4xx_pcie.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Board early initialization function
|
||||||
|
*/
|
||||||
|
int board_early_init_f (void)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------+
|
||||||
|
| Interrupt controller setup for the AMCC 405EX(r) PINE evaluation board.
|
||||||
|
+--------------------------------------------------------------------+
|
||||||
|
+---------------------------------------------------------------------+
|
||||||
|
|Interrupt| Source | Pol. | Sensi.| Crit. |
|
||||||
|
+---------+-----------------------------------+-------+-------+-------+
|
||||||
|
| IRQ 00 | UART0 | High | Level | Non |
|
||||||
|
| IRQ 01 | UART1 | High | Level | Non |
|
||||||
|
| IRQ 02 | IIC0 | High | Level | Non |
|
||||||
|
| IRQ 03 | TBD | High | Level | Non |
|
||||||
|
| IRQ 04 | TBD | High | Level | Non |
|
||||||
|
| IRQ 05 | EBM | High | Level | Non |
|
||||||
|
| IRQ 06 | BGI | High | Level | Non |
|
||||||
|
| IRQ 07 | IIC1 | Rising| Edge | Non |
|
||||||
|
| IRQ 08 | SPI | High | Lvl/ed| Non |
|
||||||
|
| IRQ 09 | External IRQ 0 - (PCI-Express) | pgm H | Pgm | Non |
|
||||||
|
| IRQ 10 | MAL TX EOB | High | Level | Non |
|
||||||
|
| IRQ 11 | MAL RX EOB | High | Level | Non |
|
||||||
|
| IRQ 12 | DMA Channel 0 FIFO Full | High | Level | Non |
|
||||||
|
| IRQ 13 | DMA Channel 0 Stat FIFO | High | Level | Non |
|
||||||
|
| IRQ 14 | DMA Channel 1 FIFO Full | High | Level | Non |
|
||||||
|
| IRQ 15 | DMA Channel 1 Stat FIFO | High | Level | Non |
|
||||||
|
| IRQ 16 | PCIE0 AL | high | Level | Non |
|
||||||
|
| IRQ 17 | PCIE0 VPD access | rising| Edge | Non |
|
||||||
|
| IRQ 18 | PCIE0 hot reset request | rising| Edge | Non |
|
||||||
|
| IRQ 19 | PCIE0 hot reset request | faling| Edge | Non |
|
||||||
|
| IRQ 20 | PCIE0 TCR | High | Level | Non |
|
||||||
|
| IRQ 21 | PCIE0 MSI level0 | High | Level | Non |
|
||||||
|
| IRQ 22 | PCIE0 MSI level1 | High | Level | Non |
|
||||||
|
| IRQ 23 | Security EIP-94 | High | Level | Non |
|
||||||
|
| IRQ 24 | EMAC0 interrupt | High | Level | Non |
|
||||||
|
| IRQ 25 | EMAC1 interrupt | High | Level | Non |
|
||||||
|
| IRQ 26 | PCIE0 MSI level2 | High | Level | Non |
|
||||||
|
| IRQ 27 | External IRQ 4 | pgm H | Pgm | Non |
|
||||||
|
| IRQ 28 | UIC2 Non-critical Int. | High | Level | Non |
|
||||||
|
| IRQ 29 | UIC2 Critical Interrupt | High | Level | Crit. |
|
||||||
|
| IRQ 30 | UIC1 Non-critical Int. | High | Level | Non |
|
||||||
|
| IRQ 31 | UIC1 Critical Interrupt | High | Level | Crit. |
|
||||||
|
|----------------------------------------------------------------------
|
||||||
|
| IRQ 32 | MAL Serr | High | Level | Non |
|
||||||
|
| IRQ 33 | MAL Txde | High | Level | Non |
|
||||||
|
| IRQ 34 | MAL Rxde | High | Level | Non |
|
||||||
|
| IRQ 35 | PCIE0 bus master VC0 |falling| Edge | Non |
|
||||||
|
| IRQ 36 | PCIE0 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 37 | EBC | High |Lvl Edg| Non |
|
||||||
|
| IRQ 38 | NDFC | High | Level | Non |
|
||||||
|
| IRQ 39 | GPT Compare Timer 8 | Risin | Edge | Non |
|
||||||
|
| IRQ 40 | GPT Compare Timer 9 | Risin | Edge | Non |
|
||||||
|
| IRQ 41 | PCIE1 AL | high | Level | Non |
|
||||||
|
| IRQ 42 | PCIE1 VPD access | rising| edge | Non |
|
||||||
|
| IRQ 43 | PCIE1 hot reset request | rising| Edge | Non |
|
||||||
|
| IRQ 44 | PCIE1 hot reset request | faling| Edge | Non |
|
||||||
|
| IRQ 45 | PCIE1 TCR | High | Level | Non |
|
||||||
|
| IRQ 46 | PCIE1 bus master VC0 |falling| Edge | Non |
|
||||||
|
| IRQ 47 | GPT Compare Timer 3 | Risin | Edge | Non |
|
||||||
|
| IRQ 48 | GPT Compare Timer 4 | Risin | Edge | Non |
|
||||||
|
| IRQ 49 | Ext. IRQ 7 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 50 | Ext. IRQ 8 - |pgm (H)|pgm/Lvl| Non |
|
||||||
|
| IRQ 51 | Ext. IRQ 9 |pgm (H)|pgm/Lvl| Non |
|
||||||
|
| IRQ 52 | GPT Compare Timer 5 | high | Edge | Non |
|
||||||
|
| IRQ 53 | GPT Compare Timer 6 | high | Edge | Non |
|
||||||
|
| IRQ 54 | GPT Compare Timer 7 | high | Edge | Non |
|
||||||
|
| IRQ 55 | Serial ROM | High | Level | Non |
|
||||||
|
| IRQ 56 | GPT Decrement Pulse | High | Level | Non |
|
||||||
|
| IRQ 57 | Ext. IRQ 2 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 58 | Ext. IRQ 5 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 59 | Ext. IRQ 6 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 60 | EMAC0 Wake-up | High | Level | Non |
|
||||||
|
| IRQ 61 | Ext. IRQ 1 |pgm/Fal|pgm/Lvl| Non |
|
||||||
|
| IRQ 62 | EMAC1 Wake-up | High | Level | Non |
|
||||||
|
|----------------------------------------------------------------------
|
||||||
|
| IRQ 64 | PE0 AL | High | Level | Non |
|
||||||
|
| IRQ 65 | PE0 VPD Access | Risin | Edge | Non |
|
||||||
|
| IRQ 66 | PE0 Hot Reset Request | Risin | Edge | Non |
|
||||||
|
| IRQ 67 | PE0 Hot Reset Request | Falli | Edge | Non |
|
||||||
|
| IRQ 68 | PE0 TCR | High | Level | Non |
|
||||||
|
| IRQ 69 | PE0 BusMaster VCO | Falli | Edge | Non |
|
||||||
|
| IRQ 70 | PE0 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 71 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 72 | PE1 AL | High | Level | Non |
|
||||||
|
| IRQ 73 | PE1 VPD Access | Risin | Edge | Non |
|
||||||
|
| IRQ 74 | PE1 Hot Reset Request | Risin | Edge | Non |
|
||||||
|
| IRQ 75 | PE1 Hot Reset Request | Falli | Edge | Non |
|
||||||
|
| IRQ 76 | PE1 TCR | High | Level | Non |
|
||||||
|
| IRQ 77 | PE1 BusMaster VCO | Falli | Edge | Non |
|
||||||
|
| IRQ 78 | PE1 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 79 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 80 | PE2 AL | High | Level | Non |
|
||||||
|
| IRQ 81 | PE2 VPD Access | Risin | Edge | Non |
|
||||||
|
| IRQ 82 | PE2 Hot Reset Request | Risin | Edge | Non |
|
||||||
|
| IRQ 83 | PE2 Hot Reset Request | Falli | Edge | Non |
|
||||||
|
| IRQ 84 | PE2 TCR | High | Level | Non |
|
||||||
|
| IRQ 85 | PE2 BusMaster VCO | Falli | Edge | Non |
|
||||||
|
| IRQ 86 | PE2 DCR Error | High | Level | Non |
|
||||||
|
| IRQ 87 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 88 | External IRQ(5) | Progr | Progr | Non |
|
||||||
|
| IRQ 89 | External IRQ 4 - Ethernet | Progr | Progr | Non |
|
||||||
|
| IRQ 90 | External IRQ 3 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 91 | External IRQ 2 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 92 | External IRQ 1 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 93 | External IRQ 0 - PCI-X | Progr | Progr | Non |
|
||||||
|
| IRQ 94 | Reserved | N/A | N/A | Non |
|
||||||
|
| IRQ 95 | Reserved | N/A | N/A | Non |
|
||||||
|
|---------------------------------------------------------------------
|
||||||
|
+---------+-----------------------------------+-------+-------+------*/
|
||||||
|
/*--------------------------------------------------------------------+
|
||||||
|
| Initialise UIC registers. Clear all interrupts. Disable all
|
||||||
|
| interrupts.
|
||||||
|
| Set critical interrupt values. Set interrupt polarities. Set
|
||||||
|
| interrupt trigger levels. Make bit 0 High priority. Clear all
|
||||||
|
| interrupts again.
|
||||||
|
+-------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
mtdcr (uic2sr, 0xffffffff); /* Clear all interrupts */
|
||||||
|
mtdcr (uic2er, 0x00000000); /* disable all interrupts */
|
||||||
|
mtdcr (uic2cr, 0x00000000); /* Set Critical / Non Critical interrupts */
|
||||||
|
mtdcr (uic2pr, 0xf7ffffff); /* Set Interrupt Polarities */
|
||||||
|
mtdcr (uic2tr, 0x01e1fff8); /* Set Interrupt Trigger Levels */
|
||||||
|
mtdcr (uic2vr, 0x00000001); /* Set Vect base=0,INT31 Highest priority */
|
||||||
|
mtdcr (uic2sr, 0x00000000); /* clear all interrupts */
|
||||||
|
mtdcr (uic2sr, 0xffffffff); /* clear all interrupts */
|
||||||
|
|
||||||
|
mtdcr (uic1sr, 0xffffffff); /* Clear all interrupts */
|
||||||
|
mtdcr (uic1er, 0x00000000); /* disable all interrupts */
|
||||||
|
mtdcr (uic1cr, 0x00000000); /* Set Critical / Non Critical interrupts */
|
||||||
|
mtdcr (uic1pr, 0xfffac785); /* Set Interrupt Polarities */
|
||||||
|
mtdcr (uic1tr, 0x001d0040); /* Set Interrupt Trigger Levels */
|
||||||
|
mtdcr (uic1vr, 0x00000001); /* Set Vect base=0,INT31 Highest priority */
|
||||||
|
mtdcr (uic1sr, 0x00000000); /* clear all interrupts */
|
||||||
|
mtdcr (uic1sr, 0xffffffff); /* clear all interrupts */
|
||||||
|
|
||||||
|
mtdcr (uic0sr, 0xffffffff); /* Clear all interrupts */
|
||||||
|
mtdcr (uic0er, 0x0000000a); /* Disable all interrupts */
|
||||||
|
/* Except cascade UIC0 and UIC1 */
|
||||||
|
mtdcr (uic0cr, 0x00000000); /* Set Critical / Non Critical interrupts */
|
||||||
|
mtdcr (uic0pr, 0xffbfefef); /* Set Interrupt Polarities */
|
||||||
|
mtdcr (uic0tr, 0x00007000); /* Set Interrupt Trigger Levels */
|
||||||
|
mtdcr (uic0vr, 0x00000001); /* Set Vect base=0,INT31 Highest priority */
|
||||||
|
mtdcr (uic0sr, 0x00000000); /* clear all interrupts */
|
||||||
|
mtdcr (uic0sr, 0xffffffff); /* clear all interrupts */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: Some cores are still in reset when the chip starts, so
|
||||||
|
* take them out of reset
|
||||||
|
*/
|
||||||
|
mtsdr(SDR0_SRST, 0);
|
||||||
|
|
||||||
|
/* Reset PCIe slots */
|
||||||
|
gpio_write_bit(CFG_GPIO_PCIE_RST, 0);
|
||||||
|
udelay(100);
|
||||||
|
gpio_write_bit(CFG_GPIO_PCIE_RST, 1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure PFC (Pin Function Control) registers
|
||||||
|
* -> Enable USB
|
||||||
|
*/
|
||||||
|
val = SDR0_PFC1_USBEN | SDR0_PFC1_USBBIGEN | SDR0_PFC1_GPT_FREQ;
|
||||||
|
mtsdr(SDR0_PFC1, val);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
#ifdef CFG_ENV_IS_IN_FLASH
|
||||||
|
/* Monitor protection ON by default */
|
||||||
|
flash_protect(FLAG_PROTECT_SET,
|
||||||
|
-CFG_MONITOR_LEN,
|
||||||
|
0xffffffff,
|
||||||
|
&flash_info[0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int checkboard (void)
|
||||||
|
{
|
||||||
|
char *s = getenv("serial#");
|
||||||
|
|
||||||
|
printf("Board: Makalu - AMCC PPC405EX Evaluation Board");
|
||||||
|
|
||||||
|
if (s != NULL) {
|
||||||
|
puts(", serial# ");
|
||||||
|
puts(s);
|
||||||
|
}
|
||||||
|
putc('\n');
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* pci_pre_init
|
||||||
|
*
|
||||||
|
* This routine is called just prior to registering the hose and gives
|
||||||
|
* the board the opportunity to check things. Returning a value of zero
|
||||||
|
* indicates that things are bad & PCI initialization should be aborted.
|
||||||
|
*
|
||||||
|
* Different boards may wish to customize the pci controller structure
|
||||||
|
* (add regions, override default access routines, etc) or perform
|
||||||
|
* certain pre-initialization actions.
|
||||||
|
*
|
||||||
|
************************************************************************/
|
||||||
|
#if defined(CONFIG_PCI)
|
||||||
|
int pci_pre_init(struct pci_controller * hose )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_PCI) */
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI
|
||||||
|
static struct pci_controller pcie_hose[2] = {{0},{0}};
|
||||||
|
|
||||||
|
void pcie_setup_hoses(int busno)
|
||||||
|
{
|
||||||
|
struct pci_controller *hose;
|
||||||
|
int i, bus;
|
||||||
|
int ret = 0;
|
||||||
|
bus = busno;
|
||||||
|
char *env;
|
||||||
|
unsigned int delay;
|
||||||
|
|
||||||
|
for (i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
if (is_end_point(i))
|
||||||
|
ret = ppc4xx_init_pcie_endport(i);
|
||||||
|
else
|
||||||
|
ret = ppc4xx_init_pcie_rootport(i);
|
||||||
|
if (ret) {
|
||||||
|
printf("PCIE%d: initialization as %s failed\n", i,
|
||||||
|
is_end_point(i) ? "endpoint" : "root-complex");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
hose = &pcie_hose[i];
|
||||||
|
hose->first_busno = bus;
|
||||||
|
hose->last_busno = bus;
|
||||||
|
hose->current_busno = bus;
|
||||||
|
|
||||||
|
/* setup mem resource */
|
||||||
|
pci_set_region(hose->regions + 0,
|
||||||
|
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
||||||
|
CFG_PCIE_MEMBASE + i * CFG_PCIE_MEMSIZE,
|
||||||
|
CFG_PCIE_MEMSIZE,
|
||||||
|
PCI_REGION_MEM);
|
||||||
|
hose->region_count = 1;
|
||||||
|
pci_register_hose(hose);
|
||||||
|
|
||||||
|
if (is_end_point(i)) {
|
||||||
|
ppc4xx_setup_pcie_endpoint(hose, i);
|
||||||
|
/*
|
||||||
|
* Reson for no scanning is endpoint can not generate
|
||||||
|
* upstream configuration accesses.
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
|
ppc4xx_setup_pcie_rootpoint(hose, i);
|
||||||
|
env = getenv ("pciscandelay");
|
||||||
|
if (env != NULL) {
|
||||||
|
delay = simple_strtoul(env, NULL, 10);
|
||||||
|
if (delay > 5)
|
||||||
|
printf("Warning, expect noticable delay before "
|
||||||
|
"PCIe scan due to 'pciscandelay' value!\n");
|
||||||
|
mdelay(delay * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Config access can only go down stream
|
||||||
|
*/
|
||||||
|
hose->last_busno = pci_hose_scan(hose);
|
||||||
|
bus = hose->last_busno + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_POST)
|
||||||
|
/*
|
||||||
|
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||||
|
* Called from board_init_f().
|
||||||
|
*/
|
||||||
|
int post_hotkeys_pressed(void)
|
||||||
|
{
|
||||||
|
return 0; /* No hotkeys supported */
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_POST */
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
u32 val[4];
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
ft_cpu_setup(blob, bd);
|
||||||
|
|
||||||
|
/* Fixup NOR mapping */
|
||||||
|
val[0] = 0; /* chip select number */
|
||||||
|
val[1] = 0; /* always 0 */
|
||||||
|
val[2] = gd->bd->bi_flashstart;
|
||||||
|
val[3] = gd->bd->bi_flashsize;
|
||||||
|
rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
|
||||||
|
val, sizeof(val), 1);
|
||||||
|
if (rc)
|
||||||
|
printf("Unable to update property NOR mapping, err=%s\n",
|
||||||
|
fdt_strerror(rc));
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
188
board/amcc/makalu/memory.c
Normal file
188
board/amcc/makalu/memory.c
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2007
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/processor.h>
|
||||||
|
|
||||||
|
void sdram_init(void)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
long int initdram(int board_type)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Same as on Kilauea, Makalu generates exception 0x200
|
||||||
|
* (machine check) after trap_init() in board_init_f,
|
||||||
|
* when SDRAM is initialized here (late) and d-cache is
|
||||||
|
* used earlier as INIT_RAM.
|
||||||
|
* So for now, initialize DDR2 in init.S very early and
|
||||||
|
* also use it for INIT_RAM. Then this exception doesn't
|
||||||
|
* occur.
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
/* base=00000000, size=128MByte (5), mode=2 (n*10*4) */
|
||||||
|
mtsdram(SDRAM_MB0CF, 0x00005201);
|
||||||
|
|
||||||
|
/* SET SDRAM_MB1CF - Not enabled */
|
||||||
|
mtsdram(SDRAM_MB1CF, 0x00000000);
|
||||||
|
|
||||||
|
/* SET SDRAM_MB2CF - Not enabled */
|
||||||
|
mtsdram(SDRAM_MB2CF, 0x00000000);
|
||||||
|
|
||||||
|
/* SET SDRAM_MB3CF - Not enabled */
|
||||||
|
mtsdram(SDRAM_MB3CF, 0x00000000);
|
||||||
|
|
||||||
|
/* SDRAM_CLKTR: Adv Addr clock by 90 deg */
|
||||||
|
mtsdram(SDRAM_CLKTR, 0x80000000);
|
||||||
|
|
||||||
|
/* Refresh Time register (0x30) Refresh every 7.8125uS */
|
||||||
|
mtsdram(SDRAM_RTR, 0x06180000);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR1 */
|
||||||
|
mtsdram(SDRAM_SDTR1, 0x80201000);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR2 */
|
||||||
|
mtsdram(SDRAM_SDTR2, 0x32204232);
|
||||||
|
|
||||||
|
/* SDRAM_SDTR3 */
|
||||||
|
mtsdram(SDRAM_SDTR3, 0x080b0d1a);
|
||||||
|
|
||||||
|
mtsdram(SDRAM_MMODE, 0x00000442);
|
||||||
|
mtsdram(SDRAM_MEMODE, 0x00000404);
|
||||||
|
|
||||||
|
/* SDRAM0_MCOPT1 (0X20) No ECC Gen */
|
||||||
|
mtsdram(SDRAM_MCOPT1, 0x04322000);
|
||||||
|
|
||||||
|
/* NOP */
|
||||||
|
mtsdram(SDRAM_INITPLR0, 0xa8380000);
|
||||||
|
/* precharge 3 DDR clock cycle */
|
||||||
|
mtsdram(SDRAM_INITPLR1, 0x81900400);
|
||||||
|
/* EMR2 twr = 2tck */
|
||||||
|
mtsdram(SDRAM_INITPLR2, 0x81020000);
|
||||||
|
/* EMR3 twr = 2tck */
|
||||||
|
mtsdram(SDRAM_INITPLR3, 0x81030000);
|
||||||
|
/* EMR DLL ENABLE twr = 2tck */
|
||||||
|
mtsdram(SDRAM_INITPLR4, 0x81010404);
|
||||||
|
/* MR w/ DLL reset
|
||||||
|
* Note: 5 is CL. May need to be changed
|
||||||
|
*/
|
||||||
|
mtsdram(SDRAM_INITPLR5, 0x81000542);
|
||||||
|
/* precharge 3 DDR clock cycle */
|
||||||
|
mtsdram(SDRAM_INITPLR6, 0x81900400);
|
||||||
|
/* Auto-refresh trfc = 26tck */
|
||||||
|
mtsdram(SDRAM_INITPLR7, 0x8D080000);
|
||||||
|
/* Auto-refresh trfc = 26tck */
|
||||||
|
mtsdram(SDRAM_INITPLR8, 0x8D080000);
|
||||||
|
/* Auto-refresh */
|
||||||
|
mtsdram(SDRAM_INITPLR9, 0x8D080000);
|
||||||
|
/* Auto-refresh */
|
||||||
|
mtsdram(SDRAM_INITPLR10, 0x8D080000);
|
||||||
|
/* MRS - normal operation; wait 2 cycle (set wait to tMRD) */
|
||||||
|
mtsdram(SDRAM_INITPLR11, 0x81000442);
|
||||||
|
mtsdram(SDRAM_INITPLR12, 0x81010780);
|
||||||
|
mtsdram(SDRAM_INITPLR13, 0x81010400);
|
||||||
|
mtsdram(SDRAM_INITPLR14, 0x00000000);
|
||||||
|
mtsdram(SDRAM_INITPLR15, 0x00000000);
|
||||||
|
|
||||||
|
/* SET MCIF0_CODT Die Termination On */
|
||||||
|
mtsdram(SDRAM_CODT, 0x0080f837);
|
||||||
|
mtsdram(SDRAM_MODT0, 0x01800000);
|
||||||
|
mtsdram(SDRAM_MODT1, 0x00000000);
|
||||||
|
|
||||||
|
mtsdram(SDRAM_WRDTR, 0x00000000);
|
||||||
|
|
||||||
|
/* SDRAM0_MCOPT2 (0X21) Start initialization */
|
||||||
|
mtsdram(SDRAM_MCOPT2, 0x20000000);
|
||||||
|
|
||||||
|
/* Step 5 */
|
||||||
|
do {
|
||||||
|
mfsdram(SDRAM_MCSTAT, val);
|
||||||
|
} while ((val & SDRAM_MCSTAT_MIC_COMP) != SDRAM_MCSTAT_MIC_COMP);
|
||||||
|
|
||||||
|
/* Step 6 */
|
||||||
|
|
||||||
|
/* SDRAM_DLCR */
|
||||||
|
mtsdram(SDRAM_DLCR, 0x030000a5);
|
||||||
|
|
||||||
|
/* SDRAM_RDCC */
|
||||||
|
mtsdram(SDRAM_RDCC, 0x40000000);
|
||||||
|
|
||||||
|
/* SDRAM_RQDC */
|
||||||
|
mtsdram(SDRAM_RQDC, 0x80000038);
|
||||||
|
|
||||||
|
/* SDRAM_RFDC */
|
||||||
|
mtsdram(SDRAM_RFDC, 0x00000209);
|
||||||
|
|
||||||
|
/* Enable memory controller */
|
||||||
|
mfsdram(SDRAM_MCOPT2, val);
|
||||||
|
val |= SDRAM_MCOPT2_DCEN_ENABLE;
|
||||||
|
mtsdram(SDRAM_MCOPT2, val);
|
||||||
|
#endif
|
||||||
|
return (CFG_MBYTES_SDRAM << 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CFG_DRAM_TEST)
|
||||||
|
int testdram (void)
|
||||||
|
{
|
||||||
|
printf ("testdram\n");
|
||||||
|
#if defined (CONFIG_NAND_U_BOOT)
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
uint *pstart = (uint *) 0x00000000;
|
||||||
|
uint *pend = (uint *) 0x00001000;
|
||||||
|
uint *p;
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
*p = 0xaaaaaaaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
if (*p != 0xaaaaaaaa) {
|
||||||
|
#if !defined (CONFIG_NAND_SPL)
|
||||||
|
printf ("SDRAM test fails at: %08x\n", (uint) p);
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
*p = 0x55555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = pstart; p < pend; p++) {
|
||||||
|
if (*p != 0x55555555) {
|
||||||
|
#if !defined (CONFIG_NAND_SPL)
|
||||||
|
printf ("SDRAM test fails at: %08x\n", (uint) p);
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if !defined (CONFIG_NAND_SPL)
|
||||||
|
printf ("SDRAM test passed!!!\n");
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
137
board/amcc/makalu/u-boot.lds
Normal file
137
board/amcc/makalu/u-boot.lds
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* (C) Copyright 2000
|
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
*
|
||||||
|
* See file CREDITS for list of people who contributed to this
|
||||||
|
* project.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
* MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
OUTPUT_ARCH(powerpc)
|
||||||
|
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
|
||||||
|
/* Do we need any of these for elf?
|
||||||
|
__DYNAMIC = 0; */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* To compile successfully, uncomment the following section.
|
||||||
|
* To go in ram, remove the section.
|
||||||
|
* Added by SunHe.
|
||||||
|
*/
|
||||||
|
.resetvec 0xFFFFFFFC :
|
||||||
|
{
|
||||||
|
*(.resetvec)
|
||||||
|
} = 0xffff
|
||||||
|
|
||||||
|
/* Read-only sections, merged into text segment: */
|
||||||
|
. = + SIZEOF_HEADERS;
|
||||||
|
.interp : { *(.interp) }
|
||||||
|
.hash : { *(.hash) }
|
||||||
|
.dynsym : { *(.dynsym) }
|
||||||
|
.dynstr : { *(.dynstr) }
|
||||||
|
.rel.text : { *(.rel.text) }
|
||||||
|
.rela.text : { *(.rela.text) }
|
||||||
|
.rel.data : { *(.rel.data) }
|
||||||
|
.rela.data : { *(.rela.data) }
|
||||||
|
.rel.rodata : { *(.rel.rodata) }
|
||||||
|
.rela.rodata : { *(.rela.rodata) }
|
||||||
|
.rel.got : { *(.rel.got) }
|
||||||
|
.rela.got : { *(.rela.got) }
|
||||||
|
.rel.ctors : { *(.rel.ctors) }
|
||||||
|
.rela.ctors : { *(.rela.ctors) }
|
||||||
|
.rel.dtors : { *(.rel.dtors) }
|
||||||
|
.rela.dtors : { *(.rela.dtors) }
|
||||||
|
.rel.bss : { *(.rel.bss) }
|
||||||
|
.rela.bss : { *(.rela.bss) }
|
||||||
|
.rel.plt : { *(.rel.plt) }
|
||||||
|
.rela.plt : { *(.rela.plt) }
|
||||||
|
.init : { *(.init) }
|
||||||
|
.plt : { *(.plt) }
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
cpu/ppc4xx/start.o (.text)
|
||||||
|
|
||||||
|
*(.text)
|
||||||
|
*(.fixup)
|
||||||
|
*(.got1)
|
||||||
|
}
|
||||||
|
_etext = .;
|
||||||
|
PROVIDE (etext = .);
|
||||||
|
.rodata :
|
||||||
|
{
|
||||||
|
*(.rodata)
|
||||||
|
*(.rodata1)
|
||||||
|
*(.rodata.str1.4)
|
||||||
|
}
|
||||||
|
.fini : { *(.fini) } =0
|
||||||
|
.ctors : { *(.ctors) }
|
||||||
|
.dtors : { *(.dtors) }
|
||||||
|
|
||||||
|
/* Read-write section, merged into data segment: */
|
||||||
|
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||||
|
_erotext = .;
|
||||||
|
PROVIDE (erotext = .);
|
||||||
|
.reloc :
|
||||||
|
{
|
||||||
|
*(.got)
|
||||||
|
_GOT2_TABLE_ = .;
|
||||||
|
*(.got2)
|
||||||
|
_FIXUP_TABLE_ = .;
|
||||||
|
*(.fixup)
|
||||||
|
}
|
||||||
|
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
|
||||||
|
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
|
||||||
|
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
*(.data)
|
||||||
|
*(.data1)
|
||||||
|
*(.sdata)
|
||||||
|
*(.sdata2)
|
||||||
|
*(.dynamic)
|
||||||
|
CONSTRUCTORS
|
||||||
|
}
|
||||||
|
_edata = .;
|
||||||
|
PROVIDE (edata = .);
|
||||||
|
|
||||||
|
. = .;
|
||||||
|
__u_boot_cmd_start = .;
|
||||||
|
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||||
|
__u_boot_cmd_end = .;
|
||||||
|
|
||||||
|
. = .;
|
||||||
|
__start___ex_table = .;
|
||||||
|
__ex_table : { *(__ex_table) }
|
||||||
|
__stop___ex_table = .;
|
||||||
|
|
||||||
|
. = ALIGN(256);
|
||||||
|
__init_begin = .;
|
||||||
|
.text.init : { *(.text.init) }
|
||||||
|
.data.init : { *(.data.init) }
|
||||||
|
. = ALIGN(256);
|
||||||
|
__init_end = .;
|
||||||
|
|
||||||
|
__bss_start = .;
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
*(.sbss) *(.scommon)
|
||||||
|
*(.dynbss)
|
||||||
|
*(.bss)
|
||||||
|
*(COMMON)
|
||||||
|
}
|
||||||
|
_end = . ;
|
||||||
|
PROVIDE (end = .);
|
||||||
|
}
|
||||||
@@ -68,19 +68,6 @@ SECTIONS
|
|||||||
|
|
||||||
cpu/ppc4xx/start.o (.text)
|
cpu/ppc4xx/start.o (.text)
|
||||||
board/amcc/ocotea/init.o (.text)
|
board/amcc/ocotea/init.o (.text)
|
||||||
cpu/ppc4xx/kgdb.o (.text)
|
|
||||||
cpu/ppc4xx/traps.o (.text)
|
|
||||||
cpu/ppc4xx/interrupts.o (.text)
|
|
||||||
cpu/ppc4xx/serial.o (.text)
|
|
||||||
cpu/ppc4xx/cpu_init.o (.text)
|
|
||||||
cpu/ppc4xx/speed.o (.text)
|
|
||||||
common/dlmalloc.o (.text)
|
|
||||||
lib_generic/crc32.o (.text)
|
|
||||||
lib_ppc/extable.o (.text)
|
|
||||||
lib_generic/zlib.o (.text)
|
|
||||||
|
|
||||||
/* . = env_offset;*/
|
|
||||||
/* common/environment.o(.text)*/
|
|
||||||
|
|
||||||
*(.text)
|
*(.text)
|
||||||
*(.fixup)
|
*(.fixup)
|
||||||
@@ -145,7 +132,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
* (C) Copyright 2008
|
||||||
|
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* See file CREDITS for list of people who contributed to this
|
||||||
* project.
|
* project.
|
||||||
@@ -20,58 +22,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ppc_asm.tmpl>
|
#include <ppc_asm.tmpl>
|
||||||
|
#include <asm-ppc/mmu.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
/* General */
|
/*
|
||||||
#define TLB_VALID 0x00000200
|
|
||||||
#define _256M 0x10000000
|
|
||||||
|
|
||||||
/* Supported page sizes */
|
|
||||||
|
|
||||||
#define SZ_1K 0x00000000
|
|
||||||
#define SZ_4K 0x00000010
|
|
||||||
#define SZ_16K 0x00000020
|
|
||||||
#define SZ_64K 0x00000030
|
|
||||||
#define SZ_256K 0x00000040
|
|
||||||
#define SZ_1M 0x00000050
|
|
||||||
#define SZ_8M 0x00000060
|
|
||||||
#define SZ_16M 0x00000070
|
|
||||||
#define SZ_256M 0x00000090
|
|
||||||
|
|
||||||
/* Storage attributes */
|
|
||||||
#define SA_W 0x00000800 /* Write-through */
|
|
||||||
#define SA_I 0x00000400 /* Caching inhibited */
|
|
||||||
#define SA_M 0x00000200 /* Memory coherence */
|
|
||||||
#define SA_G 0x00000100 /* Guarded */
|
|
||||||
#define SA_E 0x00000080 /* Endian */
|
|
||||||
|
|
||||||
/* Access control */
|
|
||||||
#define AC_X 0x00000024 /* Execute */
|
|
||||||
#define AC_W 0x00000012 /* Write */
|
|
||||||
#define AC_R 0x00000009 /* Read */
|
|
||||||
|
|
||||||
/* Some handy macros */
|
|
||||||
|
|
||||||
#define EPN(e) ((e) & 0xfffffc00)
|
|
||||||
#define TLB0(epn,sz) ( (EPN((epn)) | (sz) | TLB_VALID ) )
|
|
||||||
#define TLB1(rpn,erpn) ( ((rpn)&0xfffffc00) | (erpn) )
|
|
||||||
#define TLB2(a) ( (a)&0x00000fbf )
|
|
||||||
|
|
||||||
#define tlbtab_start\
|
|
||||||
mflr r1 ;\
|
|
||||||
bl 0f ;
|
|
||||||
|
|
||||||
#define tlbtab_end\
|
|
||||||
.long 0, 0, 0 ; \
|
|
||||||
0: mflr r0 ; \
|
|
||||||
mtlr r1 ; \
|
|
||||||
blr ;
|
|
||||||
|
|
||||||
#define tlbentry(epn,sz,rpn,erpn,attr)\
|
|
||||||
.long TLB0(epn,sz),TLB1(rpn,erpn),TLB2(attr)
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* TLB TABLE
|
* TLB TABLE
|
||||||
*
|
*
|
||||||
* This table is used by the cpu boot code to setup the initial tlb
|
* This table is used by the cpu boot code to setup the initial tlb
|
||||||
@@ -79,16 +33,27 @@
|
|||||||
* this table lets each board set things up however they like.
|
* this table lets each board set things up however they like.
|
||||||
*
|
*
|
||||||
* Pointer to the table is returned in r1
|
* Pointer to the table is returned in r1
|
||||||
*
|
*/
|
||||||
*************************************************************************/
|
|
||||||
.section .bootpg,"ax"
|
.section .bootpg,"ax"
|
||||||
.globl tlbtab
|
.globl tlbtab
|
||||||
|
|
||||||
tlbtab:
|
tlbtab:
|
||||||
tlbtab_start
|
tlbtab_start
|
||||||
|
|
||||||
/*
|
/* vxWorks needs this as first entry for the Machine Check interrupt */
|
||||||
* BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
|
tlbentry( 0x40000000, SZ_256M, 0, 0, AC_R|AC_W|AC_X|SA_G|SA_I )
|
||||||
|
|
||||||
|
/* TLB-entry for DDR SDRAM (Up to 2GB) */
|
||||||
|
#ifdef CONFIG_4xx_DCACHE
|
||||||
|
tlbentry( CFG_SDRAM_BASE, SZ_256M, CFG_SDRAM_BASE, 0, AC_R|AC_W|AC_X|SA_G)
|
||||||
|
#else
|
||||||
|
tlbentry( CFG_SDRAM_BASE, SZ_256M, CFG_SDRAM_BASE, 0, AC_R|AC_W|AC_X|SA_G|SA_I )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* TLB-entry for EBC */
|
||||||
|
tlbentry( CFG_BCSR_BASE, SZ_256M, CFG_BCSR_BASE, 1, AC_R|AC_W|AC_X|SA_G|SA_I )
|
||||||
|
|
||||||
|
/* BOOT_CS (FLASH) must be forth. Before relocation SA_I can be off to use the
|
||||||
* speed up boot process. It is patched after relocation to enable SA_I
|
* speed up boot process. It is patched after relocation to enable SA_I
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIG_NAND_SPL
|
#ifndef CONFIG_NAND_SPL
|
||||||
@@ -97,9 +62,6 @@ tlbtab:
|
|||||||
tlbentry( CFG_NAND_BOOT_SPL_SRC, SZ_4K, CFG_NAND_BOOT_SPL_SRC, 1, AC_R|AC_W|AC_X|SA_G )
|
tlbentry( CFG_NAND_BOOT_SPL_SRC, SZ_4K, CFG_NAND_BOOT_SPL_SRC, 1, AC_R|AC_W|AC_X|SA_G )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TLB-entry for DDR SDRAM (Up to 2GB) */
|
|
||||||
tlbentry( CFG_SDRAM_BASE, SZ_256M, CFG_SDRAM_BASE, 0, AC_R|AC_W|AC_X|SA_G|SA_I )
|
|
||||||
|
|
||||||
#ifdef CFG_INIT_RAM_DCACHE
|
#ifdef CFG_INIT_RAM_DCACHE
|
||||||
/* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
|
/* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
|
||||||
tlbentry( CFG_INIT_RAM_ADDR, SZ_64K, CFG_INIT_RAM_ADDR, 0, AC_R|AC_W|AC_X|SA_G )
|
tlbentry( CFG_INIT_RAM_ADDR, SZ_64K, CFG_INIT_RAM_ADDR, 0, AC_R|AC_W|AC_X|SA_G )
|
||||||
@@ -111,9 +73,6 @@ tlbtab:
|
|||||||
tlbentry( CFG_PCI_MEMBASE2, SZ_256M, CFG_PCI_MEMBASE2, 1, AC_R|AC_W|SA_G|SA_I )
|
tlbentry( CFG_PCI_MEMBASE2, SZ_256M, CFG_PCI_MEMBASE2, 1, AC_R|AC_W|SA_G|SA_I )
|
||||||
tlbentry( CFG_PCI_MEMBASE3, SZ_256M, CFG_PCI_MEMBASE3, 1, AC_R|AC_W|SA_G|SA_I )
|
tlbentry( CFG_PCI_MEMBASE3, SZ_256M, CFG_PCI_MEMBASE3, 1, AC_R|AC_W|SA_G|SA_I )
|
||||||
|
|
||||||
/* TLB-entry for EBC */
|
|
||||||
tlbentry( CFG_BCSR_BASE, SZ_1K, CFG_BCSR_BASE, 1, AC_R|AC_W|AC_X|SA_G|SA_I )
|
|
||||||
|
|
||||||
/* TLB-entry for NAND */
|
/* TLB-entry for NAND */
|
||||||
tlbentry( CFG_NAND_ADDR, SZ_1K, CFG_NAND_ADDR, 1, AC_R|AC_W|AC_X|SA_G|SA_I )
|
tlbentry( CFG_NAND_ADDR, SZ_1K, CFG_NAND_ADDR, 1, AC_R|AC_W|AC_X|SA_G|SA_I )
|
||||||
|
|
||||||
|
|||||||
@@ -33,343 +33,11 @@
|
|||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <ppc440.h>
|
#include <ppc440.h>
|
||||||
|
|
||||||
#include "sdram.h"
|
|
||||||
|
|
||||||
#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL) || \
|
|
||||||
defined(CONFIG_DDR_DATA_EYE)
|
|
||||||
/*-----------------------------------------------------------------------------+
|
/*-----------------------------------------------------------------------------+
|
||||||
* wait_for_dlllock.
|
* Prototypes
|
||||||
+----------------------------------------------------------------------------*/
|
*-----------------------------------------------------------------------------*/
|
||||||
static int wait_for_dlllock(void)
|
extern int denali_wait_for_dlllock(void);
|
||||||
{
|
extern void denali_core_search_data_eye(void);
|
||||||
unsigned long val;
|
|
||||||
int wait = 0;
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Wait for the DCC master delay line to finish calibration
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_17);
|
|
||||||
val = DDR0_17_DLLLOCKREG_UNLOCKED;
|
|
||||||
|
|
||||||
while (wait != 0xffff) {
|
|
||||||
val = mfdcr(ddrcfgd);
|
|
||||||
if ((val & DDR0_17_DLLLOCKREG_MASK) == DDR0_17_DLLLOCKREG_LOCKED)
|
|
||||||
/* dlllockreg bit on */
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
wait++;
|
|
||||||
}
|
|
||||||
debug("0x%04x: DDR0_17 Value (dlllockreg bit): 0x%08x\n", wait, val);
|
|
||||||
debug("Waiting for dlllockreg bit to raise\n");
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_DDR_DATA_EYE)
|
|
||||||
/*-----------------------------------------------------------------------------+
|
|
||||||
* wait_for_dram_init_complete.
|
|
||||||
+----------------------------------------------------------------------------*/
|
|
||||||
int wait_for_dram_init_complete(void)
|
|
||||||
{
|
|
||||||
unsigned long val;
|
|
||||||
int wait = 0;
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------+
|
|
||||||
* Wait for 'DRAM initialization complete' bit in status register
|
|
||||||
* -------------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_00);
|
|
||||||
|
|
||||||
while (wait != 0xffff) {
|
|
||||||
val = mfdcr(ddrcfgd);
|
|
||||||
if ((val & DDR0_00_INT_STATUS_BIT6) == DDR0_00_INT_STATUS_BIT6)
|
|
||||||
/* 'DRAM initialization complete' bit */
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
wait++;
|
|
||||||
}
|
|
||||||
|
|
||||||
debug("DRAM initialization complete bit in status register did not rise\n");
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define NUM_TRIES 64
|
|
||||||
#define NUM_READS 10
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------+
|
|
||||||
* denali_core_search_data_eye.
|
|
||||||
+----------------------------------------------------------------------------*/
|
|
||||||
void denali_core_search_data_eye(unsigned long memory_size)
|
|
||||||
{
|
|
||||||
int k, j;
|
|
||||||
u32 val;
|
|
||||||
u32 wr_dqs_shift, dqs_out_shift, dll_dqs_delay_X;
|
|
||||||
u32 max_passing_cases = 0, wr_dqs_shift_with_max_passing_cases = 0;
|
|
||||||
u32 passing_cases = 0, dll_dqs_delay_X_sw_val = 0;
|
|
||||||
u32 dll_dqs_delay_X_start_window = 0, dll_dqs_delay_X_end_window = 0;
|
|
||||||
volatile u32 *ram_pointer;
|
|
||||||
u32 test[NUM_TRIES] = {
|
|
||||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
||||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
||||||
0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
|
||||||
0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
|
||||||
0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
|
|
||||||
0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
|
|
||||||
0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
|
|
||||||
0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
|
|
||||||
0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
|
|
||||||
0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
|
|
||||||
0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
|
|
||||||
0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
|
|
||||||
0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
|
|
||||||
0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
|
|
||||||
0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55,
|
|
||||||
0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55 };
|
|
||||||
|
|
||||||
ram_pointer = (volatile u32 *)(CFG_SDRAM_BASE);
|
|
||||||
|
|
||||||
for (wr_dqs_shift = 64; wr_dqs_shift < 96; wr_dqs_shift++) {
|
|
||||||
/*for (wr_dqs_shift=1; wr_dqs_shift<96; wr_dqs_shift++) {*/
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* De-assert 'start' parameter.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_02);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_OFF;
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Set 'wr_dqs_shift'
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_09);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_09_WR_DQS_SHIFT_MASK)
|
|
||||||
| DDR0_09_WR_DQS_SHIFT_ENCODE(wr_dqs_shift);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Set 'dqs_out_shift' = wr_dqs_shift + 32
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
dqs_out_shift = wr_dqs_shift + 32;
|
|
||||||
mtdcr(ddrcfga, DDR0_22);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_22_DQS_OUT_SHIFT_MASK)
|
|
||||||
| DDR0_22_DQS_OUT_SHIFT_ENCODE(dqs_out_shift);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
passing_cases = 0;
|
|
||||||
|
|
||||||
for (dll_dqs_delay_X = 1; dll_dqs_delay_X < 64; dll_dqs_delay_X++) {
|
|
||||||
/*for (dll_dqs_delay_X=1; dll_dqs_delay_X<128; dll_dqs_delay_X++) {*/
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Set 'dll_dqs_delay_X'.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
/* dll_dqs_delay_0 */
|
|
||||||
mtdcr(ddrcfga, DDR0_17);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_17_DLL_DQS_DELAY_0_MASK)
|
|
||||||
| DDR0_17_DLL_DQS_DELAY_0_ENCODE(dll_dqs_delay_X);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
/* dll_dqs_delay_1 to dll_dqs_delay_4 */
|
|
||||||
mtdcr(ddrcfga, DDR0_18);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_18_DLL_DQS_DELAY_X_MASK)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_4_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_3_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_2_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_1_ENCODE(dll_dqs_delay_X);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
/* dll_dqs_delay_5 to dll_dqs_delay_8 */
|
|
||||||
mtdcr(ddrcfga, DDR0_19);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_19_DLL_DQS_DELAY_X_MASK)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_8_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_7_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_6_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_5_ENCODE(dll_dqs_delay_X);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
ppcMsync();
|
|
||||||
ppcMbar();
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Assert 'start' parameter.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_02);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_ON;
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
ppcMsync();
|
|
||||||
ppcMbar();
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Wait for the DCC master delay line to finish calibration
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
if (wait_for_dlllock() != 0) {
|
|
||||||
printf("dlllock did not occur !!!\n");
|
|
||||||
printf("denali_core_search_data_eye!!!\n");
|
|
||||||
printf("wr_dqs_shift = %d - dll_dqs_delay_X = %d\n",
|
|
||||||
wr_dqs_shift, dll_dqs_delay_X);
|
|
||||||
hang();
|
|
||||||
}
|
|
||||||
ppcMsync();
|
|
||||||
ppcMbar();
|
|
||||||
|
|
||||||
if (wait_for_dram_init_complete() != 0) {
|
|
||||||
printf("dram init complete did not occur !!!\n");
|
|
||||||
printf("denali_core_search_data_eye!!!\n");
|
|
||||||
printf("wr_dqs_shift = %d - dll_dqs_delay_X = %d\n",
|
|
||||||
wr_dqs_shift, dll_dqs_delay_X);
|
|
||||||
hang();
|
|
||||||
}
|
|
||||||
udelay(100); /* wait 100us to ensure init is really completed !!! */
|
|
||||||
|
|
||||||
/* write values */
|
|
||||||
for (j=0; j<NUM_TRIES; j++) {
|
|
||||||
ram_pointer[j] = test[j];
|
|
||||||
|
|
||||||
/* clear any cache at ram location */
|
|
||||||
__asm__("dcbf 0,%0": :"r" (&ram_pointer[j]));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* read values back */
|
|
||||||
for (j=0; j<NUM_TRIES; j++) {
|
|
||||||
for (k=0; k<NUM_READS; k++) {
|
|
||||||
/* clear any cache at ram location */
|
|
||||||
__asm__("dcbf 0,%0": :"r" (&ram_pointer[j]));
|
|
||||||
|
|
||||||
if (ram_pointer[j] != test[j])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* read error */
|
|
||||||
if (k != NUM_READS)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* See if the dll_dqs_delay_X value passed.*/
|
|
||||||
if (j < NUM_TRIES) {
|
|
||||||
/* Failed */
|
|
||||||
passing_cases = 0;
|
|
||||||
/* break; */
|
|
||||||
} else {
|
|
||||||
/* Passed */
|
|
||||||
if (passing_cases == 0)
|
|
||||||
dll_dqs_delay_X_sw_val = dll_dqs_delay_X;
|
|
||||||
passing_cases++;
|
|
||||||
if (passing_cases >= max_passing_cases) {
|
|
||||||
max_passing_cases = passing_cases;
|
|
||||||
wr_dqs_shift_with_max_passing_cases = wr_dqs_shift;
|
|
||||||
dll_dqs_delay_X_start_window = dll_dqs_delay_X_sw_val;
|
|
||||||
dll_dqs_delay_X_end_window = dll_dqs_delay_X;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* De-assert 'start' parameter.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_02);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_OFF;
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
} /* for (dll_dqs_delay_X=0; dll_dqs_delay_X<128; dll_dqs_delay_X++) */
|
|
||||||
|
|
||||||
} /* for (wr_dqs_shift=0; wr_dqs_shift<96; wr_dqs_shift++) */
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Largest passing window is now detected.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* Compute dll_dqs_delay_X value */
|
|
||||||
dll_dqs_delay_X = (dll_dqs_delay_X_end_window + dll_dqs_delay_X_start_window) / 2;
|
|
||||||
wr_dqs_shift = wr_dqs_shift_with_max_passing_cases;
|
|
||||||
|
|
||||||
debug("DQS calibration - Window detected:\n");
|
|
||||||
debug("max_passing_cases = %d\n", max_passing_cases);
|
|
||||||
debug("wr_dqs_shift = %d\n", wr_dqs_shift);
|
|
||||||
debug("dll_dqs_delay_X = %d\n", dll_dqs_delay_X);
|
|
||||||
debug("dll_dqs_delay_X window = %d - %d\n",
|
|
||||||
dll_dqs_delay_X_start_window, dll_dqs_delay_X_end_window);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* De-assert 'start' parameter.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_02);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_OFF;
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Set 'wr_dqs_shift'
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_09);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_09_WR_DQS_SHIFT_MASK)
|
|
||||||
| DDR0_09_WR_DQS_SHIFT_ENCODE(wr_dqs_shift);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
debug("DDR0_09=0x%08lx\n", val);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Set 'dqs_out_shift' = wr_dqs_shift + 32
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
dqs_out_shift = wr_dqs_shift + 32;
|
|
||||||
mtdcr(ddrcfga, DDR0_22);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_22_DQS_OUT_SHIFT_MASK)
|
|
||||||
| DDR0_22_DQS_OUT_SHIFT_ENCODE(dqs_out_shift);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
debug("DDR0_22=0x%08lx\n", val);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Set 'dll_dqs_delay_X'.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
/* dll_dqs_delay_0 */
|
|
||||||
mtdcr(ddrcfga, DDR0_17);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_17_DLL_DQS_DELAY_0_MASK)
|
|
||||||
| DDR0_17_DLL_DQS_DELAY_0_ENCODE(dll_dqs_delay_X);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
debug("DDR0_17=0x%08lx\n", val);
|
|
||||||
|
|
||||||
/* dll_dqs_delay_1 to dll_dqs_delay_4 */
|
|
||||||
mtdcr(ddrcfga, DDR0_18);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_18_DLL_DQS_DELAY_X_MASK)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_4_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_3_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_2_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_18_DLL_DQS_DELAY_1_ENCODE(dll_dqs_delay_X);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
debug("DDR0_18=0x%08lx\n", val);
|
|
||||||
|
|
||||||
/* dll_dqs_delay_5 to dll_dqs_delay_8 */
|
|
||||||
mtdcr(ddrcfga, DDR0_19);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_19_DLL_DQS_DELAY_X_MASK)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_8_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_7_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_6_ENCODE(dll_dqs_delay_X)
|
|
||||||
| DDR0_19_DLL_DQS_DELAY_5_ENCODE(dll_dqs_delay_X);
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
debug("DDR0_19=0x%08lx\n", val);
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Assert 'start' parameter.
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
mtdcr(ddrcfga, DDR0_02);
|
|
||||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_ON;
|
|
||||||
mtdcr(ddrcfgd, val);
|
|
||||||
|
|
||||||
ppcMsync();
|
|
||||||
ppcMbar();
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------+
|
|
||||||
* Wait for the DCC master delay line to finish calibration
|
|
||||||
* ----------------------------------------------------------*/
|
|
||||||
if (wait_for_dlllock() != 0) {
|
|
||||||
printf("dlllock did not occur !!!\n");
|
|
||||||
hang();
|
|
||||||
}
|
|
||||||
ppcMsync();
|
|
||||||
ppcMbar();
|
|
||||||
|
|
||||||
if (wait_for_dram_init_complete() != 0) {
|
|
||||||
printf("dram init complete did not occur !!!\n");
|
|
||||||
hang();
|
|
||||||
}
|
|
||||||
udelay(100); /* wait 100us to ensure init is really completed !!! */
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_DDR_DATA_EYE */
|
|
||||||
|
|
||||||
#if defined(CONFIG_NAND_SPL)
|
#if defined(CONFIG_NAND_SPL)
|
||||||
/* Using cpu/ppc4xx/speed.c to calculate the bus frequency is too big
|
/* Using cpu/ppc4xx/speed.c to calculate the bus frequency is too big
|
||||||
@@ -428,15 +96,22 @@ long int initdram (int board_type)
|
|||||||
mtsdram(DDR0_44, 0x00000003);
|
mtsdram(DDR0_44, 0x00000003);
|
||||||
mtsdram(DDR0_02, 0x00000001);
|
mtsdram(DDR0_02, 0x00000001);
|
||||||
|
|
||||||
wait_for_dlllock();
|
denali_wait_for_dlllock();
|
||||||
#endif /* #ifndef CONFIG_NAND_U_BOOT */
|
#endif /* #ifndef CONFIG_NAND_U_BOOT */
|
||||||
|
|
||||||
#ifdef CONFIG_DDR_DATA_EYE
|
#ifdef CONFIG_DDR_DATA_EYE
|
||||||
/* -----------------------------------------------------------+
|
/* -----------------------------------------------------------+
|
||||||
* Perform data eye search if requested.
|
* Perform data eye search if requested.
|
||||||
* ----------------------------------------------------------*/
|
* ----------------------------------------------------------*/
|
||||||
denali_core_search_data_eye(CFG_MBYTES_SDRAM << 20);
|
denali_core_search_data_eye();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear possible errors resulting from data-eye-search.
|
||||||
|
* If not done, then we could get an interrupt later on when
|
||||||
|
* exceptions are enabled.
|
||||||
|
*/
|
||||||
|
set_mcsr(get_mcsr());
|
||||||
|
|
||||||
return (CFG_MBYTES_SDRAM << 20);
|
return (CFG_MBYTES_SDRAM << 20);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,505 +0,0 @@
|
|||||||
/*
|
|
||||||
* (C) Copyright 2006
|
|
||||||
* Sylvie Gohl, AMCC/IBM, gohl.sylvie@fr.ibm.com
|
|
||||||
* Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
|
|
||||||
* Thierry Roman, AMCC/IBM, thierry_roman@fr.ibm.com
|
|
||||||
* Alain Saurel, AMCC/IBM, alain.saurel@fr.ibm.com
|
|
||||||
* Robert Snyder, AMCC/IBM, rob.snyder@fr.ibm.com
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SPD_SDRAM_DENALI_H_
|
|
||||||
#define _SPD_SDRAM_DENALI_H_
|
|
||||||
|
|
||||||
#define ppcMsync sync
|
|
||||||
#define ppcMbar eieio
|
|
||||||
|
|
||||||
/* General definitions */
|
|
||||||
#define MAX_SPD_BYTE 128 /* highest SPD byte # to read */
|
|
||||||
#define DENALI_REG_NUMBER 45 /* 45 Regs in PPC440EPx Denali Core */
|
|
||||||
#define SUPPORTED_DIMMS_NB 7 /* Number of supported DIMM modules types */
|
|
||||||
#define SDRAM_NONE 0 /* No DIMM detected in Slot */
|
|
||||||
#define MAXRANKS 2 /* 2 ranks maximum */
|
|
||||||
|
|
||||||
/* Supported PLB Frequencies */
|
|
||||||
#define PLB_FREQ_133MHZ 133333333
|
|
||||||
#define PLB_FREQ_152MHZ 152000000
|
|
||||||
#define PLB_FREQ_160MHZ 160000000
|
|
||||||
#define PLB_FREQ_166MHZ 166666666
|
|
||||||
|
|
||||||
/* Denali Core Registers */
|
|
||||||
#define SDRAM_DCR_BASE 0x10
|
|
||||||
|
|
||||||
#define DDR_DCR_BASE 0x10
|
|
||||||
#define ddrcfga (DDR_DCR_BASE+0x0) /* DDR configuration address reg */
|
|
||||||
#define ddrcfgd (DDR_DCR_BASE+0x1) /* DDR configuration data reg */
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------+
|
|
||||||
| Values for ddrcfga register - indirect addressing of these regs
|
|
||||||
+-----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#define DDR0_00 0x00
|
|
||||||
#define DDR0_00_INT_ACK_MASK 0x7F000000 /* Write only */
|
|
||||||
#define DDR0_00_INT_ACK_ALL 0x7F000000
|
|
||||||
#define DDR0_00_INT_ACK_ENCODE(n) ((((unsigned long)(n))&0x7F)<<24)
|
|
||||||
#define DDR0_00_INT_ACK_DECODE(n) ((((unsigned long)(n))>>24)&0x7F)
|
|
||||||
/* Status */
|
|
||||||
#define DDR0_00_INT_STATUS_MASK 0x00FF0000 /* Read only */
|
|
||||||
/* Bit0. A single access outside the defined PHYSICAL memory space detected. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT0 0x00010000
|
|
||||||
/* Bit1. Multiple accesses outside the defined PHYSICAL memory space detected. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT1 0x00020000
|
|
||||||
/* Bit2. Single correctable ECC event detected */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT2 0x00040000
|
|
||||||
/* Bit3. Multiple correctable ECC events detected. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT3 0x00080000
|
|
||||||
/* Bit4. Single uncorrectable ECC event detected. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT4 0x00100000
|
|
||||||
/* Bit5. Multiple uncorrectable ECC events detected. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT5 0x00200000
|
|
||||||
/* Bit6. DRAM initialization complete. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT6 0x00400000
|
|
||||||
/* Bit7. Logical OR of all lower bits. */
|
|
||||||
#define DDR0_00_INT_STATUS_BIT7 0x00800000
|
|
||||||
|
|
||||||
#define DDR0_00_INT_STATUS_ENCODE(n) ((((unsigned long)(n))&0xFF)<<16)
|
|
||||||
#define DDR0_00_INT_STATUS_DECODE(n) ((((unsigned long)(n))>>16)&0xFF)
|
|
||||||
#define DDR0_00_DLL_INCREMENT_MASK 0x00007F00
|
|
||||||
#define DDR0_00_DLL_INCREMENT_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_00_DLL_INCREMENT_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_00_DLL_START_POINT_MASK 0x0000007F
|
|
||||||
#define DDR0_00_DLL_START_POINT_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_00_DLL_START_POINT_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
|
|
||||||
#define DDR0_01 0x01
|
|
||||||
#define DDR0_01_PLB0_DB_CS_LOWER_MASK 0x1F000000
|
|
||||||
#define DDR0_01_PLB0_DB_CS_LOWER_ENCODE(n) ((((unsigned long)(n))&0x1F)<<24)
|
|
||||||
#define DDR0_01_PLB0_DB_CS_LOWER_DECODE(n) ((((unsigned long)(n))>>24)&0x1F)
|
|
||||||
#define DDR0_01_PLB0_DB_CS_UPPER_MASK 0x001F0000
|
|
||||||
#define DDR0_01_PLB0_DB_CS_UPPER_ENCODE(n) ((((unsigned long)(n))&0x1F)<<16)
|
|
||||||
#define DDR0_01_PLB0_DB_CS_UPPER_DECODE(n) ((((unsigned long)(n))>>16)&0x1F)
|
|
||||||
#define DDR0_01_OUT_OF_RANGE_TYPE_MASK 0x00000700 /* Read only */
|
|
||||||
#define DDR0_01_OUT_OF_RANGE_TYPE_ENCODE(n) ((((unsigned long)(n))&0x7)<<8)
|
|
||||||
#define DDR0_01_OUT_OF_RANGE_TYPE_DECODE(n) ((((unsigned long)(n))>>8)&0x7)
|
|
||||||
#define DDR0_01_INT_MASK_MASK 0x000000FF
|
|
||||||
#define DDR0_01_INT_MASK_ENCODE(n) ((((unsigned long)(n))&0xFF)<<0)
|
|
||||||
#define DDR0_01_INT_MASK_DECODE(n) ((((unsigned long)(n))>>0)&0xFF)
|
|
||||||
#define DDR0_01_INT_MASK_ALL_ON 0x000000FF
|
|
||||||
#define DDR0_01_INT_MASK_ALL_OFF 0x00000000
|
|
||||||
|
|
||||||
#define DDR0_02 0x02
|
|
||||||
#define DDR0_02_MAX_CS_REG_MASK 0x02000000 /* Read only */
|
|
||||||
#define DDR0_02_MAX_CS_REG_ENCODE(n) ((((unsigned long)(n))&0x2)<<24)
|
|
||||||
#define DDR0_02_MAX_CS_REG_DECODE(n) ((((unsigned long)(n))>>24)&0x2)
|
|
||||||
#define DDR0_02_MAX_COL_REG_MASK 0x000F0000 /* Read only */
|
|
||||||
#define DDR0_02_MAX_COL_REG_ENCODE(n) ((((unsigned long)(n))&0xF)<<16)
|
|
||||||
#define DDR0_02_MAX_COL_REG_DECODE(n) ((((unsigned long)(n))>>16)&0xF)
|
|
||||||
#define DDR0_02_MAX_ROW_REG_MASK 0x00000F00 /* Read only */
|
|
||||||
#define DDR0_02_MAX_ROW_REG_ENCODE(n) ((((unsigned long)(n))&0xF)<<8)
|
|
||||||
#define DDR0_02_MAX_ROW_REG_DECODE(n) ((((unsigned long)(n))>>8)&0xF)
|
|
||||||
#define DDR0_02_START_MASK 0x00000001
|
|
||||||
#define DDR0_02_START_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_02_START_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
#define DDR0_02_START_OFF 0x00000000
|
|
||||||
#define DDR0_02_START_ON 0x00000001
|
|
||||||
|
|
||||||
#define DDR0_03 0x03
|
|
||||||
#define DDR0_03_BSTLEN_MASK 0x07000000
|
|
||||||
#define DDR0_03_BSTLEN_ENCODE(n) ((((unsigned long)(n))&0x7)<<24)
|
|
||||||
#define DDR0_03_BSTLEN_DECODE(n) ((((unsigned long)(n))>>24)&0x7)
|
|
||||||
#define DDR0_03_CASLAT_MASK 0x00070000
|
|
||||||
#define DDR0_03_CASLAT_ENCODE(n) ((((unsigned long)(n))&0x7)<<16)
|
|
||||||
#define DDR0_03_CASLAT_DECODE(n) ((((unsigned long)(n))>>16)&0x7)
|
|
||||||
#define DDR0_03_CASLAT_LIN_MASK 0x00000F00
|
|
||||||
#define DDR0_03_CASLAT_LIN_ENCODE(n) ((((unsigned long)(n))&0xF)<<8)
|
|
||||||
#define DDR0_03_CASLAT_LIN_DECODE(n) ((((unsigned long)(n))>>8)&0xF)
|
|
||||||
#define DDR0_03_INITAREF_MASK 0x0000000F
|
|
||||||
#define DDR0_03_INITAREF_ENCODE(n) ((((unsigned long)(n))&0xF)<<0)
|
|
||||||
#define DDR0_03_INITAREF_DECODE(n) ((((unsigned long)(n))>>0)&0xF)
|
|
||||||
|
|
||||||
#define DDR0_04 0x04
|
|
||||||
#define DDR0_04_TRC_MASK 0x1F000000
|
|
||||||
#define DDR0_04_TRC_ENCODE(n) ((((unsigned long)(n))&0x1F)<<24)
|
|
||||||
#define DDR0_04_TRC_DECODE(n) ((((unsigned long)(n))>>24)&0x1F)
|
|
||||||
#define DDR0_04_TRRD_MASK 0x00070000
|
|
||||||
#define DDR0_04_TRRD_ENCODE(n) ((((unsigned long)(n))&0x7)<<16)
|
|
||||||
#define DDR0_04_TRRD_DECODE(n) ((((unsigned long)(n))>>16)&0x7)
|
|
||||||
#define DDR0_04_TRTP_MASK 0x00000700
|
|
||||||
#define DDR0_04_TRTP_ENCODE(n) ((((unsigned long)(n))&0x7)<<8)
|
|
||||||
#define DDR0_04_TRTP_DECODE(n) ((((unsigned long)(n))>>8)&0x7)
|
|
||||||
|
|
||||||
#define DDR0_05 0x05
|
|
||||||
#define DDR0_05_TMRD_MASK 0x1F000000
|
|
||||||
#define DDR0_05_TMRD_ENCODE(n) ((((unsigned long)(n))&0x1F)<<24)
|
|
||||||
#define DDR0_05_TMRD_DECODE(n) ((((unsigned long)(n))>>24)&0x1F)
|
|
||||||
#define DDR0_05_TEMRS_MASK 0x00070000
|
|
||||||
#define DDR0_05_TEMRS_ENCODE(n) ((((unsigned long)(n))&0x7)<<16)
|
|
||||||
#define DDR0_05_TEMRS_DECODE(n) ((((unsigned long)(n))>>16)&0x7)
|
|
||||||
#define DDR0_05_TRP_MASK 0x00000F00
|
|
||||||
#define DDR0_05_TRP_ENCODE(n) ((((unsigned long)(n))&0xF)<<8)
|
|
||||||
#define DDR0_05_TRP_DECODE(n) ((((unsigned long)(n))>>8)&0xF)
|
|
||||||
#define DDR0_05_TRAS_MIN_MASK 0x000000FF
|
|
||||||
#define DDR0_05_TRAS_MIN_ENCODE(n) ((((unsigned long)(n))&0xFF)<<0)
|
|
||||||
#define DDR0_05_TRAS_MIN_DECODE(n) ((((unsigned long)(n))>>0)&0xFF)
|
|
||||||
|
|
||||||
#define DDR0_06 0x06
|
|
||||||
#define DDR0_06_WRITEINTERP_MASK 0x01000000
|
|
||||||
#define DDR0_06_WRITEINTERP_ENCODE(n) ((((unsigned long)(n))&0x1)<<24)
|
|
||||||
#define DDR0_06_WRITEINTERP_DECODE(n) ((((unsigned long)(n))>>24)&0x1)
|
|
||||||
#define DDR0_06_TWTR_MASK 0x00070000
|
|
||||||
#define DDR0_06_TWTR_ENCODE(n) ((((unsigned long)(n))&0x7)<<16)
|
|
||||||
#define DDR0_06_TWTR_DECODE(n) ((((unsigned long)(n))>>16)&0x7)
|
|
||||||
#define DDR0_06_TDLL_MASK 0x0000FF00
|
|
||||||
#define DDR0_06_TDLL_ENCODE(n) ((((unsigned long)(n))&0xFF)<<8)
|
|
||||||
#define DDR0_06_TDLL_DECODE(n) ((((unsigned long)(n))>>8)&0xFF)
|
|
||||||
#define DDR0_06_TRFC_MASK 0x0000007F
|
|
||||||
#define DDR0_06_TRFC_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_06_TRFC_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_07 0x07
|
|
||||||
#define DDR0_07_NO_CMD_INIT_MASK 0x01000000
|
|
||||||
#define DDR0_07_NO_CMD_INIT_ENCODE(n) ((((unsigned long)(n))&0x1)<<24)
|
|
||||||
#define DDR0_07_NO_CMD_INIT_DECODE(n) ((((unsigned long)(n))>>24)&0x1)
|
|
||||||
#define DDR0_07_TFAW_MASK 0x001F0000
|
|
||||||
#define DDR0_07_TFAW_ENCODE(n) ((((unsigned long)(n))&0x1F)<<16)
|
|
||||||
#define DDR0_07_TFAW_DECODE(n) ((((unsigned long)(n))>>16)&0x1F)
|
|
||||||
#define DDR0_07_AUTO_REFRESH_MODE_MASK 0x00000100
|
|
||||||
#define DDR0_07_AUTO_REFRESH_MODE_ENCODE(n) ((((unsigned long)(n))&0x1)<<8)
|
|
||||||
#define DDR0_07_AUTO_REFRESH_MODE_DECODE(n) ((((unsigned long)(n))>>8)&0x1)
|
|
||||||
#define DDR0_07_AREFRESH_MASK 0x00000001
|
|
||||||
#define DDR0_07_AREFRESH_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_07_AREFRESH_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_08 0x08
|
|
||||||
#define DDR0_08_WRLAT_MASK 0x07000000
|
|
||||||
#define DDR0_08_WRLAT_ENCODE(n) ((((unsigned long)(n))&0x7)<<24)
|
|
||||||
#define DDR0_08_WRLAT_DECODE(n) ((((unsigned long)(n))>>24)&0x7)
|
|
||||||
#define DDR0_08_TCPD_MASK 0x00FF0000
|
|
||||||
#define DDR0_08_TCPD_ENCODE(n) ((((unsigned long)(n))&0xFF)<<16)
|
|
||||||
#define DDR0_08_TCPD_DECODE(n) ((((unsigned long)(n))>>16)&0xFF)
|
|
||||||
#define DDR0_08_DQS_N_EN_MASK 0x00000100
|
|
||||||
#define DDR0_08_DQS_N_EN_ENCODE(n) ((((unsigned long)(n))&0x1)<<8)
|
|
||||||
#define DDR0_08_DQS_N_EN_DECODE(n) ((((unsigned long)(n))>>8)&0x1)
|
|
||||||
#define DDR0_08_DDRII_SDRAM_MODE_MASK 0x00000001
|
|
||||||
#define DDR0_08_DDRII_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_08_DDRII_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_09 0x09
|
|
||||||
#define DDR0_09_OCD_ADJUST_PDN_CS_0_MASK 0x1F000000
|
|
||||||
#define DDR0_09_OCD_ADJUST_PDN_CS_0_ENCODE(n) ((((unsigned long)(n))&0x1F)<<24)
|
|
||||||
#define DDR0_09_OCD_ADJUST_PDN_CS_0_DECODE(n) ((((unsigned long)(n))>>24)&0x1F)
|
|
||||||
#define DDR0_09_RTT_0_MASK 0x00030000
|
|
||||||
#define DDR0_09_RTT_0_ENCODE(n) ((((unsigned long)(n))&0x3)<<16)
|
|
||||||
#define DDR0_09_RTT_0_DECODE(n) ((((unsigned long)(n))>>16)&0x3)
|
|
||||||
#define DDR0_09_WR_DQS_SHIFT_BYPASS_MASK 0x00007F00
|
|
||||||
#define DDR0_09_WR_DQS_SHIFT_BYPASS_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_09_WR_DQS_SHIFT_BYPASS_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_09_WR_DQS_SHIFT_MASK 0x0000007F
|
|
||||||
#define DDR0_09_WR_DQS_SHIFT_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_09_WR_DQS_SHIFT_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_10 0x0A
|
|
||||||
#define DDR0_10_WRITE_MODEREG_MASK 0x00010000 /* Write only */
|
|
||||||
#define DDR0_10_WRITE_MODEREG_ENCODE(n) ((((unsigned long)(n))&0x1)<<16)
|
|
||||||
#define DDR0_10_WRITE_MODEREG_DECODE(n) ((((unsigned long)(n))>>16)&0x1)
|
|
||||||
#define DDR0_10_CS_MAP_MASK 0x00000300
|
|
||||||
#define DDR0_10_CS_MAP_NO_MEM 0x00000000
|
|
||||||
#define DDR0_10_CS_MAP_RANK0_INSTALLED 0x00000100
|
|
||||||
#define DDR0_10_CS_MAP_RANK1_INSTALLED 0x00000200
|
|
||||||
#define DDR0_10_CS_MAP_ENCODE(n) ((((unsigned long)(n))&0x3)<<8)
|
|
||||||
#define DDR0_10_CS_MAP_DECODE(n) ((((unsigned long)(n))>>8)&0x3)
|
|
||||||
#define DDR0_10_OCD_ADJUST_PUP_CS_0_MASK 0x0000001F
|
|
||||||
#define DDR0_10_OCD_ADJUST_PUP_CS_0_ENCODE(n) ((((unsigned long)(n))&0x1F)<<0)
|
|
||||||
#define DDR0_10_OCD_ADJUST_PUP_CS_0_DECODE(n) ((((unsigned long)(n))>>0)&0x1F)
|
|
||||||
|
|
||||||
#define DDR0_11 0x0B
|
|
||||||
#define DDR0_11_SREFRESH_MASK 0x01000000
|
|
||||||
#define DDR0_11_SREFRESH_ENCODE(n) ((((unsigned long)(n))&0x1)<<24)
|
|
||||||
#define DDR0_11_SREFRESH_DECODE(n) ((((unsigned long)(n))>>24)&0x1F)
|
|
||||||
#define DDR0_11_TXSNR_MASK 0x00FF0000
|
|
||||||
#define DDR0_11_TXSNR_ENCODE(n) ((((unsigned long)(n))&0xFF)<<16)
|
|
||||||
#define DDR0_11_TXSNR_DECODE(n) ((((unsigned long)(n))>>16)&0xFF)
|
|
||||||
#define DDR0_11_TXSR_MASK 0x0000FF00
|
|
||||||
#define DDR0_11_TXSR_ENCODE(n) ((((unsigned long)(n))&0xFF)<<8)
|
|
||||||
#define DDR0_11_TXSR_DECODE(n) ((((unsigned long)(n))>>8)&0xFF)
|
|
||||||
|
|
||||||
#define DDR0_12 0x0C
|
|
||||||
#define DDR0_12_TCKE_MASK 0x0000007
|
|
||||||
#define DDR0_12_TCKE_ENCODE(n) ((((unsigned long)(n))&0x7)<<0)
|
|
||||||
#define DDR0_12_TCKE_DECODE(n) ((((unsigned long)(n))>>0)&0x7)
|
|
||||||
|
|
||||||
#define DDR0_13 0x0D
|
|
||||||
|
|
||||||
#define DDR0_14 0x0E
|
|
||||||
#define DDR0_14_DLL_BYPASS_MODE_MASK 0x01000000
|
|
||||||
#define DDR0_14_DLL_BYPASS_MODE_ENCODE(n) ((((unsigned long)(n))&0x1)<<24)
|
|
||||||
#define DDR0_14_DLL_BYPASS_MODE_DECODE(n) ((((unsigned long)(n))>>24)&0x1)
|
|
||||||
#define DDR0_14_REDUC_MASK 0x00010000
|
|
||||||
#define DDR0_14_REDUC_64BITS 0x00000000
|
|
||||||
#define DDR0_14_REDUC_32BITS 0x00010000
|
|
||||||
#define DDR0_14_REDUC_ENCODE(n) ((((unsigned long)(n))&0x1)<<16)
|
|
||||||
#define DDR0_14_REDUC_DECODE(n) ((((unsigned long)(n))>>16)&0x1)
|
|
||||||
#define DDR0_14_REG_DIMM_ENABLE_MASK 0x00000100
|
|
||||||
#define DDR0_14_REG_DIMM_ENABLE_ENCODE(n) ((((unsigned long)(n))&0x1)<<8)
|
|
||||||
#define DDR0_14_REG_DIMM_ENABLE_DECODE(n) ((((unsigned long)(n))>>8)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_15 0x0F
|
|
||||||
|
|
||||||
#define DDR0_16 0x10
|
|
||||||
|
|
||||||
#define DDR0_17 0x11
|
|
||||||
#define DDR0_17_DLL_DQS_DELAY_0_MASK 0x7F000000
|
|
||||||
#define DDR0_17_DLL_DQS_DELAY_0_ENCODE(n) ((((unsigned long)(n))&0x7F)<<24)
|
|
||||||
#define DDR0_17_DLL_DQS_DELAY_0_DECODE(n) ((((unsigned long)(n))>>24)&0x7F)
|
|
||||||
#define DDR0_17_DLLLOCKREG_MASK 0x00010000 /* Read only */
|
|
||||||
#define DDR0_17_DLLLOCKREG_LOCKED 0x00010000
|
|
||||||
#define DDR0_17_DLLLOCKREG_UNLOCKED 0x00000000
|
|
||||||
#define DDR0_17_DLLLOCKREG_ENCODE(n) ((((unsigned long)(n))&0x1)<<16)
|
|
||||||
#define DDR0_17_DLLLOCKREG_DECODE(n) ((((unsigned long)(n))>>16)&0x1)
|
|
||||||
#define DDR0_17_DLL_LOCK_MASK 0x00007F00 /* Read only */
|
|
||||||
#define DDR0_17_DLL_LOCK_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_17_DLL_LOCK_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_18 0x12
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_X_MASK 0x7F7F7F7F
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_4_MASK 0x7F000000
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_4_ENCODE(n) ((((unsigned long)(n))&0x7F)<<24)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_4_DECODE(n) ((((unsigned long)(n))>>24)&0x7F)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_3_MASK 0x007F0000
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_3_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_3_DECODE(n) ((((unsigned long)(n))>>16)&0x7F)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_2_MASK 0x00007F00
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_2_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_2_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_1_MASK 0x0000007F
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_1_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_18_DLL_DQS_DELAY_1_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_19 0x13
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_X_MASK 0x7F7F7F7F
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_8_MASK 0x7F000000
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_8_ENCODE(n) ((((unsigned long)(n))&0x7F)<<24)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_8_DECODE(n) ((((unsigned long)(n))>>24)&0x7F)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_7_MASK 0x007F0000
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_7_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_7_DECODE(n) ((((unsigned long)(n))>>16)&0x7F)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_6_MASK 0x00007F00
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_6_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_6_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_5_MASK 0x0000007F
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_5_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_19_DLL_DQS_DELAY_5_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_20 0x14
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_3_MASK 0x7F000000
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_3_ENCODE(n) ((((unsigned long)(n))&0x7F)<<24)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_3_DECODE(n) ((((unsigned long)(n))>>24)&0x7F)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_2_MASK 0x007F0000
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_2_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_2_DECODE(n) ((((unsigned long)(n))>>16)&0x7F)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_1_MASK 0x00007F00
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_1_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_1_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_0_MASK 0x0000007F
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_0_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_20_DLL_DQS_BYPASS_0_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_21 0x15
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_7_MASK 0x7F000000
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_7_ENCODE(n) ((((unsigned long)(n))&0x7F)<<24)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_7_DECODE(n) ((((unsigned long)(n))>>24)&0x7F)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_6_MASK 0x007F0000
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_6_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_6_DECODE(n) ((((unsigned long)(n))>>16)&0x7F)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_5_MASK 0x00007F00
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_5_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_5_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_4_MASK 0x0000007F
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_4_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_21_DLL_DQS_BYPASS_4_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
#define DDR0_22 0x16
|
|
||||||
/* ECC */
|
|
||||||
#define DDR0_22_CTRL_RAW_MASK 0x03000000
|
|
||||||
#define DDR0_22_CTRL_RAW_ECC_DISABLE 0x00000000 /* ECC not being used */
|
|
||||||
#define DDR0_22_CTRL_RAW_ECC_CHECK_ONLY 0x01000000 /* ECC checking is on, but no attempts to correct*/
|
|
||||||
#define DDR0_22_CTRL_RAW_NO_ECC_RAM 0x02000000 /* No ECC RAM storage available */
|
|
||||||
#define DDR0_22_CTRL_RAW_ECC_ENABLE 0x03000000 /* ECC checking and correcting on */
|
|
||||||
#define DDR0_22_CTRL_RAW_ENCODE(n) ((((unsigned long)(n))&0x3)<<24)
|
|
||||||
#define DDR0_22_CTRL_RAW_DECODE(n) ((((unsigned long)(n))>>24)&0x3)
|
|
||||||
|
|
||||||
#define DDR0_22_DQS_OUT_SHIFT_BYPASS_MASK 0x007F0000
|
|
||||||
#define DDR0_22_DQS_OUT_SHIFT_BYPASS_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
|
|
||||||
#define DDR0_22_DQS_OUT_SHIFT_BYPASS_DECODE(n) ((((unsigned long)(n))>>16)&0x7F)
|
|
||||||
#define DDR0_22_DQS_OUT_SHIFT_MASK 0x00007F00
|
|
||||||
#define DDR0_22_DQS_OUT_SHIFT_ENCODE(n) ((((unsigned long)(n))&0x7F)<<8)
|
|
||||||
#define DDR0_22_DQS_OUT_SHIFT_DECODE(n) ((((unsigned long)(n))>>8)&0x7F)
|
|
||||||
#define DDR0_22_DLL_DQS_BYPASS_8_MASK 0x0000007F
|
|
||||||
#define DDR0_22_DLL_DQS_BYPASS_8_ENCODE(n) ((((unsigned long)(n))&0x7F)<<0)
|
|
||||||
#define DDR0_22_DLL_DQS_BYPASS_8_DECODE(n) ((((unsigned long)(n))>>0)&0x7F)
|
|
||||||
|
|
||||||
|
|
||||||
#define DDR0_23 0x17
|
|
||||||
#define DDR0_23_ODT_RD_MAP_CS0_MASK 0x03000000
|
|
||||||
#define DDR0_23_ODT_RD_MAP_CS0_ENCODE(n) ((((unsigned long)(n))&0x3)<<24)
|
|
||||||
#define DDR0_23_ODT_RD_MAP_CS0_DECODE(n) ((((unsigned long)(n))>>24)&0x3)
|
|
||||||
#define DDR0_23_ECC_C_SYND_MASK 0x00FF0000 /* Read only */
|
|
||||||
#define DDR0_23_ECC_C_SYND_ENCODE(n) ((((unsigned long)(n))&0xFF)<<16)
|
|
||||||
#define DDR0_23_ECC_C_SYND_DECODE(n) ((((unsigned long)(n))>>16)&0xFF)
|
|
||||||
#define DDR0_23_ECC_U_SYND_MASK 0x0000FF00 /* Read only */
|
|
||||||
#define DDR0_23_ECC_U_SYND_ENCODE(n) ((((unsigned long)(n))&0xFF)<<8)
|
|
||||||
#define DDR0_23_ECC_U_SYND_DECODE(n) ((((unsigned long)(n))>>8)&0xFF)
|
|
||||||
#define DDR0_23_FWC_MASK 0x00000001 /* Write only */
|
|
||||||
#define DDR0_23_FWC_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_23_FWC_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_24 0x18
|
|
||||||
#define DDR0_24_RTT_PAD_TERMINATION_MASK 0x03000000
|
|
||||||
#define DDR0_24_RTT_PAD_TERMINATION_ENCODE(n) ((((unsigned long)(n))&0x3)<<24)
|
|
||||||
#define DDR0_24_RTT_PAD_TERMINATION_DECODE(n) ((((unsigned long)(n))>>24)&0x3)
|
|
||||||
#define DDR0_24_ODT_WR_MAP_CS1_MASK 0x00030000
|
|
||||||
#define DDR0_24_ODT_WR_MAP_CS1_ENCODE(n) ((((unsigned long)(n))&0x3)<<16)
|
|
||||||
#define DDR0_24_ODT_WR_MAP_CS1_DECODE(n) ((((unsigned long)(n))>>16)&0x3)
|
|
||||||
#define DDR0_24_ODT_RD_MAP_CS1_MASK 0x00000300
|
|
||||||
#define DDR0_24_ODT_RD_MAP_CS1_ENCODE(n) ((((unsigned long)(n))&0x3)<<8)
|
|
||||||
#define DDR0_24_ODT_RD_MAP_CS1_DECODE(n) ((((unsigned long)(n))>>8)&0x3)
|
|
||||||
#define DDR0_24_ODT_WR_MAP_CS0_MASK 0x00000003
|
|
||||||
#define DDR0_24_ODT_WR_MAP_CS0_ENCODE(n) ((((unsigned long)(n))&0x3)<<0)
|
|
||||||
#define DDR0_24_ODT_WR_MAP_CS0_DECODE(n) ((((unsigned long)(n))>>0)&0x3)
|
|
||||||
|
|
||||||
#define DDR0_25 0x19
|
|
||||||
#define DDR0_25_VERSION_MASK 0xFFFF0000 /* Read only */
|
|
||||||
#define DDR0_25_VERSION_ENCODE(n) ((((unsigned long)(n))&0xFFFF)<<16)
|
|
||||||
#define DDR0_25_VERSION_DECODE(n) ((((unsigned long)(n))>>16)&0xFFFF)
|
|
||||||
#define DDR0_25_OUT_OF_RANGE_LENGTH_MASK 0x000003FF /* Read only */
|
|
||||||
#define DDR0_25_OUT_OF_RANGE_LENGTH_ENCODE(n) ((((unsigned long)(n))&0x3FF)<<0)
|
|
||||||
#define DDR0_25_OUT_OF_RANGE_LENGTH_DECODE(n) ((((unsigned long)(n))>>0)&0x3FF)
|
|
||||||
|
|
||||||
#define DDR0_26 0x1A
|
|
||||||
#define DDR0_26_TRAS_MAX_MASK 0xFFFF0000
|
|
||||||
#define DDR0_26_TRAS_MAX_ENCODE(n) ((((unsigned long)(n))&0xFFFF)<<16)
|
|
||||||
#define DDR0_26_TRAS_MAX_DECODE(n) ((((unsigned long)(n))>>16)&0xFFFF)
|
|
||||||
#define DDR0_26_TREF_MASK 0x00003FFF
|
|
||||||
#define DDR0_26_TREF_ENCODE(n) ((((unsigned long)(n))&0x3FF)<<0)
|
|
||||||
#define DDR0_26_TREF_DECODE(n) ((((unsigned long)(n))>>0)&0x3FF)
|
|
||||||
|
|
||||||
#define DDR0_27 0x1B
|
|
||||||
#define DDR0_27_EMRS_DATA_MASK 0x3FFF0000
|
|
||||||
#define DDR0_27_EMRS_DATA_ENCODE(n) ((((unsigned long)(n))&0x3FFF)<<16)
|
|
||||||
#define DDR0_27_EMRS_DATA_DECODE(n) ((((unsigned long)(n))>>16)&0x3FFF)
|
|
||||||
#define DDR0_27_TINIT_MASK 0x0000FFFF
|
|
||||||
#define DDR0_27_TINIT_ENCODE(n) ((((unsigned long)(n))&0xFFFF)<<0)
|
|
||||||
#define DDR0_27_TINIT_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFF)
|
|
||||||
|
|
||||||
#define DDR0_28 0x1C
|
|
||||||
#define DDR0_28_EMRS3_DATA_MASK 0x3FFF0000
|
|
||||||
#define DDR0_28_EMRS3_DATA_ENCODE(n) ((((unsigned long)(n))&0x3FFF)<<16)
|
|
||||||
#define DDR0_28_EMRS3_DATA_DECODE(n) ((((unsigned long)(n))>>16)&0x3FFF)
|
|
||||||
#define DDR0_28_EMRS2_DATA_MASK 0x00003FFF
|
|
||||||
#define DDR0_28_EMRS2_DATA_ENCODE(n) ((((unsigned long)(n))&0x3FFF)<<0)
|
|
||||||
#define DDR0_28_EMRS2_DATA_DECODE(n) ((((unsigned long)(n))>>0)&0x3FFF)
|
|
||||||
|
|
||||||
#define DDR0_29 0x1D
|
|
||||||
|
|
||||||
#define DDR0_30 0x1E
|
|
||||||
|
|
||||||
#define DDR0_31 0x1F
|
|
||||||
#define DDR0_31_XOR_CHECK_BITS_MASK 0x0000FFFF
|
|
||||||
#define DDR0_31_XOR_CHECK_BITS_ENCODE(n) ((((unsigned long)(n))&0xFFFF)<<0)
|
|
||||||
#define DDR0_31_XOR_CHECK_BITS_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFF)
|
|
||||||
|
|
||||||
#define DDR0_32 0x20
|
|
||||||
#define DDR0_32_OUT_OF_RANGE_ADDR_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_32_OUT_OF_RANGE_ADDR_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_32_OUT_OF_RANGE_ADDR_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_33 0x21
|
|
||||||
#define DDR0_33_OUT_OF_RANGE_ADDR_MASK 0x00000001 /* Read only */
|
|
||||||
#define DDR0_33_OUT_OF_RANGE_ADDR_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_33_OUT_OF_RANGE_ADDR_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_34 0x22
|
|
||||||
#define DDR0_34_ECC_U_ADDR_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_34_ECC_U_ADDR_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_34_ECC_U_ADDR_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_35 0x23
|
|
||||||
#define DDR0_35_ECC_U_ADDR_MASK 0x00000001 /* Read only */
|
|
||||||
#define DDR0_35_ECC_U_ADDR_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_35_ECC_U_ADDR_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_36 0x24
|
|
||||||
#define DDR0_36_ECC_U_DATA_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_36_ECC_U_DATA_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_36_ECC_U_DATA_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_37 0x25
|
|
||||||
#define DDR0_37_ECC_U_DATA_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_37_ECC_U_DATA_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_37_ECC_U_DATA_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_38 0x26
|
|
||||||
#define DDR0_38_ECC_C_ADDR_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_38_ECC_C_ADDR_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_38_ECC_C_ADDR_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_39 0x27
|
|
||||||
#define DDR0_39_ECC_C_ADDR_MASK 0x00000001 /* Read only */
|
|
||||||
#define DDR0_39_ECC_C_ADDR_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_39_ECC_C_ADDR_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_40 0x28
|
|
||||||
#define DDR0_40_ECC_C_DATA_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_40_ECC_C_DATA_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_40_ECC_C_DATA_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_41 0x29
|
|
||||||
#define DDR0_41_ECC_C_DATA_MASK 0xFFFFFFFF /* Read only */
|
|
||||||
#define DDR0_41_ECC_C_DATA_ENCODE(n) ((((unsigned long)(n))&0xFFFFFFFF)<<0)
|
|
||||||
#define DDR0_41_ECC_C_DATA_DECODE(n) ((((unsigned long)(n))>>0)&0xFFFFFFFF)
|
|
||||||
|
|
||||||
#define DDR0_42 0x2A
|
|
||||||
#define DDR0_42_ADDR_PINS_MASK 0x07000000
|
|
||||||
#define DDR0_42_ADDR_PINS_ENCODE(n) ((((unsigned long)(n))&0x7)<<24)
|
|
||||||
#define DDR0_42_ADDR_PINS_DECODE(n) ((((unsigned long)(n))>>24)&0x7)
|
|
||||||
#define DDR0_42_CASLAT_LIN_GATE_MASK 0x0000000F
|
|
||||||
#define DDR0_42_CASLAT_LIN_GATE_ENCODE(n) ((((unsigned long)(n))&0xF)<<0)
|
|
||||||
#define DDR0_42_CASLAT_LIN_GATE_DECODE(n) ((((unsigned long)(n))>>0)&0xF)
|
|
||||||
|
|
||||||
#define DDR0_43 0x2B
|
|
||||||
#define DDR0_43_TWR_MASK 0x07000000
|
|
||||||
#define DDR0_43_TWR_ENCODE(n) ((((unsigned long)(n))&0x7)<<24)
|
|
||||||
#define DDR0_43_TWR_DECODE(n) ((((unsigned long)(n))>>24)&0x7)
|
|
||||||
#define DDR0_43_APREBIT_MASK 0x000F0000
|
|
||||||
#define DDR0_43_APREBIT_ENCODE(n) ((((unsigned long)(n))&0xF)<<16)
|
|
||||||
#define DDR0_43_APREBIT_DECODE(n) ((((unsigned long)(n))>>16)&0xF)
|
|
||||||
#define DDR0_43_COLUMN_SIZE_MASK 0x00000700
|
|
||||||
#define DDR0_43_COLUMN_SIZE_ENCODE(n) ((((unsigned long)(n))&0x7)<<8)
|
|
||||||
#define DDR0_43_COLUMN_SIZE_DECODE(n) ((((unsigned long)(n))>>8)&0x7)
|
|
||||||
#define DDR0_43_EIGHT_BANK_MODE_MASK 0x00000001
|
|
||||||
#define DDR0_43_EIGHT_BANK_MODE_8_BANKS 0x00000001
|
|
||||||
#define DDR0_43_EIGHT_BANK_MODE_4_BANKS 0x00000000
|
|
||||||
#define DDR0_43_EIGHT_BANK_MODE_ENCODE(n) ((((unsigned long)(n))&0x1)<<0)
|
|
||||||
#define DDR0_43_EIGHT_BANK_MODE_DECODE(n) ((((unsigned long)(n))>>0)&0x1)
|
|
||||||
|
|
||||||
#define DDR0_44 0x2C
|
|
||||||
#define DDR0_44_TRCD_MASK 0x000000FF
|
|
||||||
#define DDR0_44_TRCD_ENCODE(n) ((((unsigned long)(n))&0xFF)<<0)
|
|
||||||
#define DDR0_44_TRCD_DECODE(n) ((((unsigned long)(n))>>0)&0xFF)
|
|
||||||
|
|
||||||
#endif /* _SPD_SDRAM_DENALI_H_ */
|
|
||||||
@@ -23,9 +23,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <libfdt.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
#include <ppc440.h>
|
||||||
|
#include <asm/gpio.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <ppc440.h>
|
#include <asm/bitops.h>
|
||||||
|
#include <asm/ppc4xx-intvec.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
@@ -42,39 +47,9 @@ int board_early_init_f(void)
|
|||||||
mtdcr(ebccfga, xbcfg);
|
mtdcr(ebccfga, xbcfg);
|
||||||
mtdcr(ebccfgd, 0xb8400000);
|
mtdcr(ebccfgd, 0xb8400000);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------
|
/*
|
||||||
* Setup the GPIO pins
|
|
||||||
*-------------------------------------------------------------------*/
|
|
||||||
/* test-only: take GPIO init from pcs440ep ???? in config file */
|
|
||||||
out32(GPIO0_OR, 0x00000000);
|
|
||||||
out32(GPIO0_TCR, 0x0000000f);
|
|
||||||
out32(GPIO0_OSRL, 0x50015400);
|
|
||||||
out32(GPIO0_OSRH, 0x550050aa);
|
|
||||||
out32(GPIO0_TSRL, 0x50015400);
|
|
||||||
out32(GPIO0_TSRH, 0x55005000);
|
|
||||||
out32(GPIO0_ISR1L, 0x50000000);
|
|
||||||
out32(GPIO0_ISR1H, 0x00000000);
|
|
||||||
out32(GPIO0_ISR2L, 0x00000000);
|
|
||||||
out32(GPIO0_ISR2H, 0x00000100);
|
|
||||||
out32(GPIO0_ISR3L, 0x00000000);
|
|
||||||
out32(GPIO0_ISR3H, 0x00000000);
|
|
||||||
|
|
||||||
out32(GPIO1_OR, 0x00000000);
|
|
||||||
out32(GPIO1_TCR, 0xc2000000);
|
|
||||||
out32(GPIO1_OSRL, 0x5c280000);
|
|
||||||
out32(GPIO1_OSRH, 0x00000000);
|
|
||||||
out32(GPIO1_TSRL, 0x0c000000);
|
|
||||||
out32(GPIO1_TSRH, 0x00000000);
|
|
||||||
out32(GPIO1_ISR1L, 0x00005550);
|
|
||||||
out32(GPIO1_ISR1H, 0x00000000);
|
|
||||||
out32(GPIO1_ISR2L, 0x00050000);
|
|
||||||
out32(GPIO1_ISR2H, 0x00000000);
|
|
||||||
out32(GPIO1_ISR3L, 0x01400000);
|
|
||||||
out32(GPIO1_ISR3H, 0x00000000);
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------
|
|
||||||
* Setup the interrupt controller polarities, triggers, etc.
|
* Setup the interrupt controller polarities, triggers, etc.
|
||||||
*-------------------------------------------------------------------*/
|
*/
|
||||||
mtdcr(uic0sr, 0xffffffff); /* clear all */
|
mtdcr(uic0sr, 0xffffffff); /* clear all */
|
||||||
mtdcr(uic0er, 0x00000000); /* disable all */
|
mtdcr(uic0er, 0x00000000); /* disable all */
|
||||||
mtdcr(uic0cr, 0x00000005); /* ATI & UIC1 crit are critical */
|
mtdcr(uic0cr, 0x00000005); /* ATI & UIC1 crit are critical */
|
||||||
@@ -100,22 +75,27 @@ int board_early_init_f(void)
|
|||||||
mtdcr(uic2sr, 0xffffffff); /* clear all */
|
mtdcr(uic2sr, 0xffffffff); /* clear all */
|
||||||
|
|
||||||
/* 50MHz tmrclk */
|
/* 50MHz tmrclk */
|
||||||
*(unsigned char *)(CFG_BCSR_BASE | 0x04) = 0x00;
|
out_8((u8 *) CFG_BCSR_BASE + 0x04, 0x00);
|
||||||
|
|
||||||
/* clear write protects */
|
/* clear write protects */
|
||||||
*(unsigned char *)(CFG_BCSR_BASE | 0x07) = 0x00;
|
out_8((u8 *) CFG_BCSR_BASE + 0x07, 0x00);
|
||||||
|
|
||||||
/* enable Ethernet */
|
/* enable Ethernet */
|
||||||
*(unsigned char *)(CFG_BCSR_BASE | 0x08) = 0x00;
|
out_8((u8 *) CFG_BCSR_BASE + 0x08, 0x00);
|
||||||
|
|
||||||
/* enable USB device */
|
/* enable USB device */
|
||||||
*(unsigned char *)(CFG_BCSR_BASE | 0x09) = 0x20;
|
out_8((u8 *) CFG_BCSR_BASE + 0x09, 0x20);
|
||||||
|
|
||||||
/* select Ethernet pins */
|
/* select Ethernet (and optionally IIC1) pins */
|
||||||
mfsdr(SDR0_PFC1, sdr0_pfc1);
|
mfsdr(SDR0_PFC1, sdr0_pfc1);
|
||||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) | SDR0_PFC1_SELECT_CONFIG_4;
|
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) |
|
||||||
|
SDR0_PFC1_SELECT_CONFIG_4;
|
||||||
|
#ifdef CONFIG_I2C_MULTI_BUS
|
||||||
|
sdr0_pfc1 |= ((sdr0_pfc1 & ~SDR0_PFC1_SIS_MASK) | SDR0_PFC1_SIS_IIC1_SEL);
|
||||||
|
#endif
|
||||||
mfsdr(SDR0_PFC2, sdr0_pfc2);
|
mfsdr(SDR0_PFC2, sdr0_pfc2);
|
||||||
sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) | SDR0_PFC2_SELECT_CONFIG_4;
|
sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
|
||||||
|
SDR0_PFC2_SELECT_CONFIG_4;
|
||||||
mtsdr(SDR0_PFC2, sdr0_pfc2);
|
mtsdr(SDR0_PFC2, sdr0_pfc2);
|
||||||
mtsdr(SDR0_PFC1, sdr0_pfc1);
|
mtsdr(SDR0_PFC1, sdr0_pfc1);
|
||||||
|
|
||||||
@@ -135,9 +115,6 @@ int board_early_init_f(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------+
|
|
||||||
| misc_init_r.
|
|
||||||
+---------------------------------------------------------------------------*/
|
|
||||||
int misc_init_r(void)
|
int misc_init_r(void)
|
||||||
{
|
{
|
||||||
uint pbcr;
|
uint pbcr;
|
||||||
@@ -150,11 +127,7 @@ int misc_init_r(void)
|
|||||||
char *act = getenv("usbact");
|
char *act = getenv("usbact");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/* Re-do flash sizing to get full correct info */
|
||||||
* FLASH stuff...
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Re-do sizing to get full correct info */
|
|
||||||
|
|
||||||
/* adjust flash start and offset */
|
/* adjust flash start and offset */
|
||||||
gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
|
gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
|
||||||
@@ -166,32 +139,7 @@ int misc_init_r(void)
|
|||||||
mtdcr(ebccfga, pb0cr);
|
mtdcr(ebccfga, pb0cr);
|
||||||
#endif
|
#endif
|
||||||
pbcr = mfdcr(ebccfgd);
|
pbcr = mfdcr(ebccfgd);
|
||||||
switch (gd->bd->bi_flashsize) {
|
size_val = ffs(gd->bd->bi_flashsize) - 21;
|
||||||
case 1 << 20:
|
|
||||||
size_val = 0;
|
|
||||||
break;
|
|
||||||
case 2 << 20:
|
|
||||||
size_val = 1;
|
|
||||||
break;
|
|
||||||
case 4 << 20:
|
|
||||||
size_val = 2;
|
|
||||||
break;
|
|
||||||
case 8 << 20:
|
|
||||||
size_val = 3;
|
|
||||||
break;
|
|
||||||
case 16 << 20:
|
|
||||||
size_val = 4;
|
|
||||||
break;
|
|
||||||
case 32 << 20:
|
|
||||||
size_val = 5;
|
|
||||||
break;
|
|
||||||
case 64 << 20:
|
|
||||||
size_val = 6;
|
|
||||||
break;
|
|
||||||
case 128 << 20:
|
|
||||||
size_val = 7;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
|
pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
|
||||||
#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
|
#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
|
||||||
mtdcr(ebccfga, pb3cr);
|
mtdcr(ebccfga, pb3cr);
|
||||||
@@ -231,27 +179,32 @@ int misc_init_r(void)
|
|||||||
mfsdr(SDR0_USB2H0CR, usb2h0cr);
|
mfsdr(SDR0_USB2H0CR, usb2h0cr);
|
||||||
|
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ; /*1*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST; /*1*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST; /*1*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;
|
||||||
|
|
||||||
/* An 8-bit/60MHz interface is the only possible alternative
|
/*
|
||||||
when connecting the Device to the PHY */
|
* An 8-bit/60MHz interface is the only possible alternative
|
||||||
|
* when connecting the Device to the PHY
|
||||||
|
*/
|
||||||
usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
|
usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
|
||||||
usb2h0cr = usb2h0cr | SDR0_USB2H0CR_WDINT_16BIT_30MHZ; /*1*/
|
usb2h0cr = usb2h0cr | SDR0_USB2H0CR_WDINT_16BIT_30MHZ;
|
||||||
|
|
||||||
/* To enable the USB 2.0 Device function through the UTMI interface */
|
/*
|
||||||
|
* To enable the USB 2.0 Device function
|
||||||
|
* through the UTMI interface
|
||||||
|
*/
|
||||||
usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
|
usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
|
||||||
usb2d0cr = usb2d0cr | SDR0_USB2D0CR_USB2DEV_SELECTION; /*1*/
|
usb2d0cr = usb2d0cr | SDR0_USB2D0CR_USB2DEV_SELECTION;
|
||||||
|
|
||||||
sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
|
sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
|
||||||
sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_USB2D_SEL; /*0*/
|
sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_USB2D_SEL;
|
||||||
|
|
||||||
mtsdr(SDR0_PFC1, sdr0_pfc1);
|
mtsdr(SDR0_PFC1, sdr0_pfc1);
|
||||||
mtsdr(SDR0_USB2D0CR, usb2d0cr);
|
mtsdr(SDR0_USB2D0CR, usb2d0cr);
|
||||||
@@ -271,13 +224,13 @@ int misc_init_r(void)
|
|||||||
mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
|
mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
|
||||||
|
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST; /*1*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST; /*1*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;
|
||||||
mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
|
mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
|
||||||
|
|
||||||
udelay (1000);
|
udelay (1000);
|
||||||
@@ -302,24 +255,24 @@ int misc_init_r(void)
|
|||||||
mfsdr(SDR0_PFC1, sdr0_pfc1);
|
mfsdr(SDR0_PFC1, sdr0_pfc1);
|
||||||
|
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PUREN; /*1*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PUREN;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_DEV; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_DEV;
|
||||||
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
|
usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
|
||||||
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_DEV; /*0*/
|
usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_DEV;
|
||||||
|
|
||||||
usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
|
usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
|
||||||
usb2h0cr = usb2h0cr | SDR0_USB2H0CR_WDINT_8BIT_60MHZ; /*0*/
|
usb2h0cr = usb2h0cr | SDR0_USB2H0CR_WDINT_8BIT_60MHZ;
|
||||||
|
|
||||||
usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
|
usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
|
||||||
usb2d0cr = usb2d0cr | SDR0_USB2D0CR_EBC_SELECTION; /*0*/
|
usb2d0cr = usb2d0cr | SDR0_USB2D0CR_EBC_SELECTION;
|
||||||
|
|
||||||
sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
|
sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
|
||||||
sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_EBCHR_SEL; /*1*/
|
sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_EBCHR_SEL;
|
||||||
|
|
||||||
mtsdr(SDR0_USB2H0CR, usb2h0cr);
|
mtsdr(SDR0_USB2H0CR, usb2h0cr);
|
||||||
mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
|
mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
|
||||||
@@ -414,7 +367,17 @@ int testdram(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*************************************************************************
|
#if defined(CONFIG_PCI) && defined(CONFIG_PCI_PNP)
|
||||||
|
/*
|
||||||
|
* Assign interrupts to PCI devices.
|
||||||
|
*/
|
||||||
|
void sequoia_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
|
||||||
|
{
|
||||||
|
pci_hose_write_config_byte(hose, dev, PCI_INTERRUPT_LINE, VECNUM_EIR2);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
* pci_pre_init
|
* pci_pre_init
|
||||||
*
|
*
|
||||||
* This routine is called just prior to registering the hose and gives
|
* This routine is called just prior to registering the hose and gives
|
||||||
@@ -424,33 +387,32 @@ int testdram(void)
|
|||||||
* Different boards may wish to customize the pci controller structure
|
* Different boards may wish to customize the pci controller structure
|
||||||
* (add regions, override default access routines, etc) or perform
|
* (add regions, override default access routines, etc) or perform
|
||||||
* certain pre-initialization actions.
|
* certain pre-initialization actions.
|
||||||
*
|
*/
|
||||||
************************************************************************/
|
|
||||||
#if defined(CONFIG_PCI)
|
#if defined(CONFIG_PCI)
|
||||||
int pci_pre_init(struct pci_controller *hose)
|
int pci_pre_init(struct pci_controller *hose)
|
||||||
{
|
{
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*
|
||||||
| Set priority for all PLB3 devices to 0.
|
* Set priority for all PLB3 devices to 0.
|
||||||
| Set PLB3 arbiter to fair mode.
|
* Set PLB3 arbiter to fair mode.
|
||||||
+-------------------------------------------------------------------------*/
|
*/
|
||||||
mfsdr(sdr_amp1, addr);
|
mfsdr(sdr_amp1, addr);
|
||||||
mtsdr(sdr_amp1, (addr & 0x000000FF) | 0x0000FF00);
|
mtsdr(sdr_amp1, (addr & 0x000000FF) | 0x0000FF00);
|
||||||
addr = mfdcr(plb3_acr);
|
addr = mfdcr(plb3_acr);
|
||||||
mtdcr(plb3_acr, addr | 0x80000000);
|
mtdcr(plb3_acr, addr | 0x80000000);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*
|
||||||
| Set priority for all PLB4 devices to 0.
|
* Set priority for all PLB4 devices to 0.
|
||||||
+-------------------------------------------------------------------------*/
|
*/
|
||||||
mfsdr(sdr_amp0, addr);
|
mfsdr(sdr_amp0, addr);
|
||||||
mtsdr(sdr_amp0, (addr & 0x000000FF) | 0x0000FF00);
|
mtsdr(sdr_amp0, (addr & 0x000000FF) | 0x0000FF00);
|
||||||
addr = mfdcr(plb4_acr) | 0xa0000000; /* Was 0x8---- */
|
addr = mfdcr(plb4_acr) | 0xa0000000; /* Was 0x8---- */
|
||||||
mtdcr(plb4_acr, addr);
|
mtdcr(plb4_acr, addr);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*
|
||||||
| Set Nebula PLB4 arbiter to fair mode.
|
* Set Nebula PLB4 arbiter to fair mode.
|
||||||
+-------------------------------------------------------------------------*/
|
*/
|
||||||
/* Segment0 */
|
/* Segment0 */
|
||||||
addr = (mfdcr(plb0_acr) & ~plb0_acr_ppm_mask) | plb0_acr_ppm_fair;
|
addr = (mfdcr(plb0_acr) & ~plb0_acr_ppm_mask) | plb0_acr_ppm_fair;
|
||||||
addr = (addr & ~plb0_acr_hbu_mask) | plb0_acr_hbu_enabled;
|
addr = (addr & ~plb0_acr_hbu_mask) | plb0_acr_hbu_enabled;
|
||||||
@@ -465,51 +427,58 @@ int pci_pre_init(struct pci_controller *hose)
|
|||||||
addr = (addr & ~plb1_acr_wrp_mask) | plb1_acr_wrp_2deep;
|
addr = (addr & ~plb1_acr_wrp_mask) | plb1_acr_wrp_2deep;
|
||||||
mtdcr(plb1_acr, addr);
|
mtdcr(plb1_acr, addr);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_PNP
|
||||||
|
hose->fixup_irq = sequoia_pci_fixup_irq;
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_PCI) */
|
#endif /* defined(CONFIG_PCI) */
|
||||||
|
|
||||||
/*************************************************************************
|
/*
|
||||||
* pci_target_init
|
* pci_target_init
|
||||||
*
|
*
|
||||||
* The bootstrap configuration provides default settings for the pci
|
* The bootstrap configuration provides default settings for the pci
|
||||||
* inbound map (PIM). But the bootstrap config choices are limited and
|
* inbound map (PIM). But the bootstrap config choices are limited and
|
||||||
* may not be sufficient for a given board.
|
* may not be sufficient for a given board.
|
||||||
*
|
*/
|
||||||
************************************************************************/
|
|
||||||
#if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
|
#if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
|
||||||
void pci_target_init(struct pci_controller *hose)
|
void pci_target_init(struct pci_controller *hose)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------+
|
/*
|
||||||
* Set up Direct MMIO registers
|
* Set up Direct MMIO registers
|
||||||
*--------------------------------------------------------------------------*/
|
*/
|
||||||
/*--------------------------------------------------------------------------+
|
/*
|
||||||
| PowerPC440EPX PCI Master configuration.
|
* PowerPC440EPX PCI Master configuration.
|
||||||
| Map one 1Gig range of PLB/processor addresses to PCI memory space.
|
* Map one 1Gig range of PLB/processor addresses to PCI memory space.
|
||||||
| PLB address 0xA0000000-0xDFFFFFFF ==> PCI address 0xA0000000-0xDFFFFFFF
|
* PLB address 0xA0000000-0xDFFFFFFF
|
||||||
| Use byte reversed out routines to handle endianess.
|
* ==> PCI address 0xA0000000-0xDFFFFFFF
|
||||||
| Make this region non-prefetchable.
|
* Use byte reversed out routines to handle endianess.
|
||||||
+--------------------------------------------------------------------------*/
|
* Make this region non-prefetchable.
|
||||||
out32r(PCIX0_PMM0MA, 0x00000000); /* PMM0 Mask/Attribute - disabled b4 setting */
|
*/
|
||||||
|
out32r(PCIX0_PMM0MA, 0x00000000); /* PMM0 Mask/Attribute */
|
||||||
|
/* - disabled b4 setting */
|
||||||
out32r(PCIX0_PMM0LA, CFG_PCI_MEMBASE); /* PMM0 Local Address */
|
out32r(PCIX0_PMM0LA, CFG_PCI_MEMBASE); /* PMM0 Local Address */
|
||||||
out32r(PCIX0_PMM0PCILA, CFG_PCI_MEMBASE); /* PMM0 PCI Low Address */
|
out32r(PCIX0_PMM0PCILA, CFG_PCI_MEMBASE); /* PMM0 PCI Low Address */
|
||||||
out32r(PCIX0_PMM0PCIHA, 0x00000000); /* PMM0 PCI High Address */
|
out32r(PCIX0_PMM0PCIHA, 0x00000000); /* PMM0 PCI High Address */
|
||||||
out32r(PCIX0_PMM0MA, 0xE0000001); /* 512M + No prefetching, and enable region */
|
out32r(PCIX0_PMM0MA, 0xE0000001); /* 512M + No prefetching, */
|
||||||
|
/* and enable region */
|
||||||
|
|
||||||
out32r(PCIX0_PMM1MA, 0x00000000); /* PMM0 Mask/Attribute - disabled b4 setting */
|
out32r(PCIX0_PMM1MA, 0x00000000); /* PMM0 Mask/Attribute */
|
||||||
|
/* - disabled b4 setting */
|
||||||
out32r(PCIX0_PMM1LA, CFG_PCI_MEMBASE2); /* PMM0 Local Address */
|
out32r(PCIX0_PMM1LA, CFG_PCI_MEMBASE2); /* PMM0 Local Address */
|
||||||
out32r(PCIX0_PMM1PCILA, CFG_PCI_MEMBASE2); /* PMM0 PCI Low Address */
|
out32r(PCIX0_PMM1PCILA, CFG_PCI_MEMBASE2); /* PMM0 PCI Low Address */
|
||||||
out32r(PCIX0_PMM1PCIHA, 0x00000000); /* PMM0 PCI High Address */
|
out32r(PCIX0_PMM1PCIHA, 0x00000000); /* PMM0 PCI High Address */
|
||||||
out32r(PCIX0_PMM1MA, 0xE0000001); /* 512M + No prefetching, and enable region */
|
out32r(PCIX0_PMM1MA, 0xE0000001); /* 512M + No prefetching, */
|
||||||
|
/* and enable region */
|
||||||
|
|
||||||
out32r(PCIX0_PTM1MS, 0x00000001); /* Memory Size/Attribute */
|
out32r(PCIX0_PTM1MS, 0x00000001); /* Memory Size/Attribute */
|
||||||
out32r(PCIX0_PTM1LA, 0); /* Local Addr. Reg */
|
out32r(PCIX0_PTM1LA, 0); /* Local Addr. Reg */
|
||||||
out32r(PCIX0_PTM2MS, 0); /* Memory Size/Attribute */
|
out32r(PCIX0_PTM2MS, 0); /* Memory Size/Attribute */
|
||||||
out32r(PCIX0_PTM2LA, 0); /* Local Addr. Reg */
|
out32r(PCIX0_PTM2LA, 0); /* Local Addr. Reg */
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------+
|
/*
|
||||||
* Set up Configuration registers
|
* Set up Configuration registers
|
||||||
*--------------------------------------------------------------------------*/
|
*/
|
||||||
|
|
||||||
/* Program the board's subsystem id/vendor id */
|
/* Program the board's subsystem id/vendor id */
|
||||||
pci_write_config_word(0, PCI_SUBSYSTEM_VENDOR_ID,
|
pci_write_config_word(0, PCI_SUBSYSTEM_VENDOR_ID,
|
||||||
@@ -530,20 +499,16 @@ void pci_target_init(struct pci_controller *hose)
|
|||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT) */
|
#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT) */
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* pci_master_init
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
#if defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT)
|
#if defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT)
|
||||||
void pci_master_init(struct pci_controller *hose)
|
void pci_master_init(struct pci_controller *hose)
|
||||||
{
|
{
|
||||||
unsigned short temp_short;
|
unsigned short temp_short;
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------+
|
/*
|
||||||
| Write the PowerPC440 EP PCI Configuration regs.
|
* Write the PowerPC440 EP PCI Configuration regs.
|
||||||
| Enable PowerPC440 EP to be a master on the PCI bus (PMM).
|
* Enable PowerPC440 EP to be a master on the PCI bus (PMM).
|
||||||
| Enable PowerPC440 EP to act as a PCI memory target (PTM).
|
* Enable PowerPC440 EP to act as a PCI memory target (PTM).
|
||||||
+--------------------------------------------------------------------------*/
|
*/
|
||||||
pci_read_config_word(0, PCI_COMMAND, &temp_short);
|
pci_read_config_word(0, PCI_COMMAND, &temp_short);
|
||||||
pci_write_config_word(0, PCI_COMMAND,
|
pci_write_config_word(0, PCI_COMMAND,
|
||||||
temp_short | PCI_COMMAND_MASTER |
|
temp_short | PCI_COMMAND_MASTER |
|
||||||
@@ -551,7 +516,7 @@ void pci_master_init(struct pci_controller *hose)
|
|||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT) */
|
#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT) */
|
||||||
|
|
||||||
/*************************************************************************
|
/*
|
||||||
* is_pci_host
|
* is_pci_host
|
||||||
*
|
*
|
||||||
* This routine is called to determine if a pci scan should be
|
* This routine is called to determine if a pci scan should be
|
||||||
@@ -563,9 +528,7 @@ void pci_master_init(struct pci_controller *hose)
|
|||||||
* 440 pci code requires the board to decide at runtime.
|
* 440 pci code requires the board to decide at runtime.
|
||||||
*
|
*
|
||||||
* Return 0 for adapter mode, non-zero for host (monarch) mode.
|
* Return 0 for adapter mode, non-zero for host (monarch) mode.
|
||||||
*
|
*/
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
#if defined(CONFIG_PCI)
|
#if defined(CONFIG_PCI)
|
||||||
int is_pci_host(struct pci_controller *hose)
|
int is_pci_host(struct pci_controller *hose)
|
||||||
{
|
{
|
||||||
@@ -573,6 +536,7 @@ int is_pci_host(struct pci_controller *hose)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_PCI) */
|
#endif /* defined(CONFIG_PCI) */
|
||||||
|
|
||||||
#if defined(CONFIG_POST)
|
#if defined(CONFIG_POST)
|
||||||
/*
|
/*
|
||||||
* Returns 1 if keys pressed to start the power-on long-running tests
|
* Returns 1 if keys pressed to start the power-on long-running tests
|
||||||
@@ -583,3 +547,24 @@ int post_hotkeys_pressed(void)
|
|||||||
return 0; /* No hotkeys supported */
|
return 0; /* No hotkeys supported */
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_POST */
|
#endif /* CONFIG_POST */
|
||||||
|
|
||||||
|
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
|
||||||
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
|
{
|
||||||
|
u32 val[4];
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
ft_cpu_setup(blob, bd);
|
||||||
|
|
||||||
|
/* Fixup NOR mapping */
|
||||||
|
val[0] = 0; /* chip select number */
|
||||||
|
val[1] = 0; /* always 0 */
|
||||||
|
val[2] = gd->bd->bi_flashstart;
|
||||||
|
val[3] = gd->bd->bi_flashsize;
|
||||||
|
rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
|
||||||
|
val, sizeof(val), 1);
|
||||||
|
if (rc)
|
||||||
|
printf("Unable to update property NOR mapping, err=%s\n",
|
||||||
|
fdt_strerror(rc));
|
||||||
|
}
|
||||||
|
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ void spi_sda(int bit)
|
|||||||
|
|
||||||
unsigned char spi_read(void)
|
unsigned char spi_read(void)
|
||||||
{
|
{
|
||||||
return (unsigned char)gpio_read_out_bit(SPI_DIN_GPIO15);
|
return (unsigned char)gpio_read_in_bit(SPI_DIN_GPIO15);
|
||||||
}
|
}
|
||||||
|
|
||||||
void taihu_spi_chipsel(int cs)
|
void taihu_spi_chipsel(int cs)
|
||||||
|
|||||||
@@ -62,19 +62,6 @@ SECTIONS
|
|||||||
/* the sector layout of our flash chips! XXX FIXME XXX */
|
/* the sector layout of our flash chips! XXX FIXME XXX */
|
||||||
|
|
||||||
cpu/ppc4xx/start.o (.text)
|
cpu/ppc4xx/start.o (.text)
|
||||||
cpu/ppc4xx/kgdb.o (.text)
|
|
||||||
cpu/ppc4xx/traps.o (.text)
|
|
||||||
cpu/ppc4xx/interrupts.o (.text)
|
|
||||||
cpu/ppc4xx/serial.o (.text)
|
|
||||||
cpu/ppc4xx/cpu_init.o (.text)
|
|
||||||
cpu/ppc4xx/speed.o (.text)
|
|
||||||
common/dlmalloc.o (.text)
|
|
||||||
lib_generic/crc32.o (.text)
|
|
||||||
lib_ppc/extable.o (.text)
|
|
||||||
lib_generic/zlib.o (.text)
|
|
||||||
|
|
||||||
/* . = env_offset;*/
|
|
||||||
/* common/environment.o(.text)*/
|
|
||||||
|
|
||||||
*(.text)
|
*(.text)
|
||||||
*(.fixup)
|
*(.fixup)
|
||||||
@@ -138,7 +125,7 @@ SECTIONS
|
|||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss) *(.scommon)
|
||||||
*(.dynbss)
|
*(.dynbss)
|
||||||
|
|||||||
@@ -33,25 +33,25 @@ void show_reset_reg(void)
|
|||||||
|
|
||||||
/* read clock regsiter */
|
/* read clock regsiter */
|
||||||
printf("===== Display reset and initialize register Start =========\n");
|
printf("===== Display reset and initialize register Start =========\n");
|
||||||
mfclk(clk_pllc,reg);
|
mfcpr(clk_pllc,reg);
|
||||||
printf("cpr_pllc = %#010x\n",reg);
|
printf("cpr_pllc = %#010x\n",reg);
|
||||||
|
|
||||||
mfclk(clk_plld,reg);
|
mfcpr(clk_plld,reg);
|
||||||
printf("cpr_plld = %#010x\n",reg);
|
printf("cpr_plld = %#010x\n",reg);
|
||||||
|
|
||||||
mfclk(clk_primad,reg);
|
mfcpr(clk_primad,reg);
|
||||||
printf("cpr_primad = %#010x\n",reg);
|
printf("cpr_primad = %#010x\n",reg);
|
||||||
|
|
||||||
mfclk(clk_primbd,reg);
|
mfcpr(clk_primbd,reg);
|
||||||
printf("cpr_primbd = %#010x\n",reg);
|
printf("cpr_primbd = %#010x\n",reg);
|
||||||
|
|
||||||
mfclk(clk_opbd,reg);
|
mfcpr(clk_opbd,reg);
|
||||||
printf("cpr_opbd = %#010x\n",reg);
|
printf("cpr_opbd = %#010x\n",reg);
|
||||||
|
|
||||||
mfclk(clk_perd,reg);
|
mfcpr(clk_perd,reg);
|
||||||
printf("cpr_perd = %#010x\n",reg);
|
printf("cpr_perd = %#010x\n",reg);
|
||||||
|
|
||||||
mfclk(clk_mald,reg);
|
mfcpr(clk_mald,reg);
|
||||||
printf("cpr_mald = %#010x\n",reg);
|
printf("cpr_mald = %#010x\n",reg);
|
||||||
|
|
||||||
/* read sdr register */
|
/* read sdr register */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user