mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
Compare commits
818 Commits
v2.5.0-rc3
...
v2.11.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb5d3ecd2d | ||
|
|
d9f237b450 | ||
|
|
4f5a3b0c2b | ||
|
|
dd41f15987 | ||
|
|
007cfe9c16 | ||
|
|
52884b2835 | ||
|
|
6a6af16f48 | ||
|
|
2818722b19 | ||
|
|
194eba2d21 | ||
|
|
3d41a22fba | ||
|
|
acd4b79dd4 | ||
|
|
befac1e065 | ||
|
|
7e4e221ccb | ||
|
|
1d9b69ee6f | ||
|
|
018f20119d | ||
|
|
9a6e41adb8 | ||
|
|
970b22856f | ||
|
|
95032994fe | ||
|
|
48cda63dc5 | ||
|
|
8e9f79964a | ||
|
|
3c7df86373 | ||
|
|
38e6aee074 | ||
|
|
0a13684bb6 | ||
|
|
e7ca6e8455 | ||
|
|
f17e635d34 | ||
|
|
90e78c6068 | ||
|
|
550bb6fb7e | ||
|
|
b3a0ebe534 | ||
|
|
6d16e50bbe | ||
|
|
513eec1c5f | ||
|
|
6a797e8a64 | ||
|
|
082134bc43 | ||
|
|
03ec2de777 | ||
|
|
989d39d1f2 | ||
|
|
b6b298ad68 | ||
|
|
be1cb862f1 | ||
|
|
eb6e95f760 | ||
|
|
f04eb1d604 | ||
|
|
cc1512e42a | ||
|
|
88d6633c85 | ||
|
|
1773435a2c | ||
|
|
cf12abc92e | ||
|
|
d8c4b1f0e2 | ||
|
|
45cbd5d93a | ||
|
|
2646db0826 | ||
|
|
0289ea7293 | ||
|
|
c02c293651 | ||
|
|
e6786115cc | ||
|
|
89b9596e27 | ||
|
|
23cd3b3e99 | ||
|
|
5a8cf73137 | ||
|
|
79dfb1e861 | ||
|
|
4eb30ba080 | ||
|
|
1829c9c96f | ||
|
|
fa2424750b | ||
|
|
441cb82d32 | ||
|
|
c34d346b57 | ||
|
|
f7a766be20 | ||
|
|
54e8411980 | ||
|
|
09ebd5f406 | ||
|
|
44aef94d82 | ||
|
|
aeac214236 | ||
|
|
81f8a368d1 | ||
|
|
cde9d148b8 | ||
|
|
b1bf054d74 | ||
|
|
18100e0b4e | ||
|
|
42f0c520da | ||
|
|
fbee159481 | ||
|
|
ca4a4365d6 | ||
|
|
54ffbadc2d | ||
|
|
a4cd9cb03b | ||
|
|
f3406891b2 | ||
|
|
6f7c5995ad | ||
|
|
8046c336c3 | ||
|
|
c39f92eea7 | ||
|
|
37d1da8b01 | ||
|
|
6f65229d66 | ||
|
|
7bf62b76bd | ||
|
|
693e147cd9 | ||
|
|
eab2445d14 | ||
|
|
5c53054de9 | ||
|
|
1866ffcccc | ||
|
|
5c7fe1a0fa | ||
|
|
672578af01 | ||
|
|
9c27a4b878 | ||
|
|
4cf4a5152e | ||
|
|
7daf37be9e | ||
|
|
7975de1101 | ||
|
|
2d1bbeedd9 | ||
|
|
e0fc96b950 | ||
|
|
835909f3cc | ||
|
|
e02d9261df | ||
|
|
2f7a1e5952 | ||
|
|
0ad0aa8255 | ||
|
|
4db35c127b | ||
|
|
f6ae95da15 | ||
|
|
daec2bef52 | ||
|
|
4e5e483743 | ||
|
|
ea1cb7a4a6 | ||
|
|
ce33b86c6f | ||
|
|
8e0e4d81d8 | ||
|
|
74616bda9a | ||
|
|
47afa20ff1 | ||
|
|
b4c68157c8 | ||
|
|
5dd721b206 | ||
|
|
9ef59ba079 | ||
|
|
fafb5cbffd | ||
|
|
dca6ea517f | ||
|
|
43436e4726 | ||
|
|
18c6087d56 | ||
|
|
a5eaccb29a | ||
|
|
ee090f6230 | ||
|
|
5b397d54ce | ||
|
|
323dc65770 | ||
|
|
bccdb175b0 | ||
|
|
92f59a3f22 | ||
|
|
ccdca73cd6 | ||
|
|
3fde7d88fb | ||
|
|
79dcd8a900 | ||
|
|
3d851f6343 | ||
|
|
ed3142aa10 | ||
|
|
5d0a5e377e | ||
|
|
439c386506 | ||
|
|
1371a9d3d8 | ||
|
|
52f6189c10 | ||
|
|
cf63cb94aa | ||
|
|
94a442abcf | ||
|
|
6cf990f142 | ||
|
|
8422d572e7 | ||
|
|
659e7c52ba | ||
|
|
2536cfdc9e | ||
|
|
e9b64b0dfd | ||
|
|
b4ed6a8367 | ||
|
|
5362455444 | ||
|
|
eff55cc055 | ||
|
|
295a81450b | ||
|
|
ad48758229 | ||
|
|
0f5302044d | ||
|
|
398e17a583 | ||
|
|
b303909c83 | ||
|
|
d7c88de1a7 | ||
|
|
c144aeed12 | ||
|
|
b3d791b34e | ||
|
|
9b77f6ed22 | ||
|
|
7eb5d45bb8 | ||
|
|
8b64db3c7a | ||
|
|
cd461e555e | ||
|
|
9195806206 | ||
|
|
9621c21535 | ||
|
|
f74cee802b | ||
|
|
0c7aecde9f | ||
|
|
9ab2f5ede9 | ||
|
|
a7fe885dc5 | ||
|
|
105e55c01a | ||
|
|
200b759d6f | ||
|
|
5da87dc07d | ||
|
|
25f42bdcaf | ||
|
|
43361d0ee7 | ||
|
|
93a8a764a8 | ||
|
|
1e515ed1e1 | ||
|
|
78388a8ecf | ||
|
|
1e1c286f06 | ||
|
|
81f7d7d7ce | ||
|
|
2403eb2a87 | ||
|
|
5a686344e8 | ||
|
|
ff1214b1dc | ||
|
|
cf8769e4b5 | ||
|
|
f770253a52 | ||
|
|
bb4b7cb95c | ||
|
|
d3f4afd4a7 | ||
|
|
35e1cbd15b | ||
|
|
cf2f80fd3c | ||
|
|
56549a44ea | ||
|
|
59b3387ece | ||
|
|
1ebc3f59ba | ||
|
|
5d93a1ddc0 | ||
|
|
5d0f75f68e | ||
|
|
eeec28eb4a | ||
|
|
1c38559cf0 | ||
|
|
c9b2877de1 | ||
|
|
21d79d1a9e | ||
|
|
95a7b6d54d | ||
|
|
a647368f15 | ||
|
|
97f641a16b | ||
|
|
1252ca6778 | ||
|
|
e561f4a82e | ||
|
|
395e98dc66 | ||
|
|
b5e33cec05 | ||
|
|
ec924ea3d7 | ||
|
|
e30cfbf36b | ||
|
|
39510a6728 | ||
|
|
0abc0c17ff | ||
|
|
3375803a26 | ||
|
|
16e06ad7aa | ||
|
|
a12f43e912 | ||
|
|
a6a9ef6c1b | ||
|
|
866583625b | ||
|
|
4c272fe5f5 | ||
|
|
45def78972 | ||
|
|
f1c4a39540 | ||
|
|
a9df4b8549 | ||
|
|
4d8bc3c5bd | ||
|
|
245b062db8 | ||
|
|
c6d07ca178 | ||
|
|
60c708dce9 | ||
|
|
dfdf25834c | ||
|
|
1e82a24192 | ||
|
|
ce20be0b3b | ||
|
|
3e483bd524 | ||
|
|
1cded2e983 | ||
|
|
3219fceb48 | ||
|
|
78c7a3cbfa | ||
|
|
0a390bea0b | ||
|
|
cad21f394e | ||
|
|
3384986bef | ||
|
|
23073a8ae5 | ||
|
|
3ab700de32 | ||
|
|
454856e5c2 | ||
|
|
7e4030c0bc | ||
|
|
1deab06c09 | ||
|
|
a4bc2913e1 | ||
|
|
87dbd3e289 | ||
|
|
3f79bc76ac | ||
|
|
4820218fc2 | ||
|
|
b30bcf501a | ||
|
|
d9e62da73d | ||
|
|
404a3a4813 | ||
|
|
e9f5aec955 | ||
|
|
9eada6166c | ||
|
|
e8875a7375 | ||
|
|
33c4c732c9 | ||
|
|
2c8e736fa8 | ||
|
|
e18d485bdc | ||
|
|
a1678619be | ||
|
|
eec945417d | ||
|
|
cd3fb41eb0 | ||
|
|
0445caf2b8 | ||
|
|
3bb4304fe4 | ||
|
|
2edf5d750c | ||
|
|
89d1213f39 | ||
|
|
3eb13481c9 | ||
|
|
e2ffc6650c | ||
|
|
42be849af8 | ||
|
|
d9adc8f7a1 | ||
|
|
399f862bb9 | ||
|
|
e73633402c | ||
|
|
acc3d67cff | ||
|
|
c3ab147246 | ||
|
|
8cbc9e4fb1 | ||
|
|
3fc4414a84 | ||
|
|
5d7650a69c | ||
|
|
e4d81ee5b9 | ||
|
|
8ec07e0588 | ||
|
|
8262342e1c | ||
|
|
a7341b418e | ||
|
|
fc80a4aa84 | ||
|
|
db37e3727d | ||
|
|
d667c2e2b9 | ||
|
|
b7f8c7e788 | ||
|
|
243f42454f | ||
|
|
74651831ef | ||
|
|
b44c7b09db | ||
|
|
ecc8829a01 | ||
|
|
8029c318d0 | ||
|
|
16cf91b3d2 | ||
|
|
7bbad0ed50 | ||
|
|
c89b054324 | ||
|
|
e2abfd7b72 | ||
|
|
e55abc109c | ||
|
|
7d68d6d5c3 | ||
|
|
d16b3d6919 | ||
|
|
e91f49bdbd | ||
|
|
4688ba6996 | ||
|
|
4a6bc07d61 | ||
|
|
6f5f7bf068 | ||
|
|
5b27dc31fc | ||
|
|
d9d0ae77e9 | ||
|
|
a195b9e316 | ||
|
|
e211647656 | ||
|
|
64b248fad1 | ||
|
|
d792176347 | ||
|
|
5bd7b4bc51 | ||
|
|
929ca004c4 | ||
|
|
848b09b6e1 | ||
|
|
1061890189 | ||
|
|
39b1211541 | ||
|
|
08e976af26 | ||
|
|
b89ba787fe | ||
|
|
1548fac62a | ||
|
|
3dafdff716 | ||
|
|
5cd786fb9a | ||
|
|
be67c7fa07 | ||
|
|
5f3f788955 | ||
|
|
8667eecdcf | ||
|
|
47b396873b | ||
|
|
74dd8fc89e | ||
|
|
2a75855f23 | ||
|
|
7895a40487 | ||
|
|
1f9a41b386 | ||
|
|
efb57bcc5a | ||
|
|
70cdfe7103 | ||
|
|
082e96d546 | ||
|
|
3aa1ff70bb | ||
|
|
28623fb4b3 | ||
|
|
e35aacca4b | ||
|
|
91e3140f5a | ||
|
|
5c84541011 | ||
|
|
b9b03a6e38 | ||
|
|
3b6582117b | ||
|
|
50cbd4688b | ||
|
|
354089a7f2 | ||
|
|
f669fdaddc | ||
|
|
267147f971 | ||
|
|
63e8acadfc | ||
|
|
690d7655a0 | ||
|
|
52c39cd3bf | ||
|
|
ebd7c79e65 | ||
|
|
560e9f326d | ||
|
|
3da1530926 | ||
|
|
abcf6dd1fd | ||
|
|
2bcedafe0d | ||
|
|
c0cf066900 | ||
|
|
6462efd6bc | ||
|
|
0bce7dc7a4 | ||
|
|
a3f0fb23b7 | ||
|
|
b9d20e083c | ||
|
|
725899248a | ||
|
|
c8685f2352 | ||
|
|
7d10d77e35 | ||
|
|
96c391eaac | ||
|
|
c700795895 | ||
|
|
8bcb4c2063 | ||
|
|
ea95356ebd | ||
|
|
8111566f35 | ||
|
|
c952b34858 | ||
|
|
792e3a8a2e | ||
|
|
ae75067938 | ||
|
|
81b66ad44b | ||
|
|
e193250291 | ||
|
|
dc0dae6284 | ||
|
|
7c535de60d | ||
|
|
26192989cd | ||
|
|
317aaadcbd | ||
|
|
c670733ea5 | ||
|
|
f92617f24a | ||
|
|
337a68cf1d | ||
|
|
e09633fc2a | ||
|
|
d838391850 | ||
|
|
d59e58b794 | ||
|
|
ee7bf9671a | ||
|
|
c4f0f367bc | ||
|
|
5f649ea1f4 | ||
|
|
397c6df34a | ||
|
|
7a37e9bf0b | ||
|
|
e4ed881dd7 | ||
|
|
9aff26b7fb | ||
|
|
5603442a37 | ||
|
|
8a86ae3b7d | ||
|
|
9997af10a5 | ||
|
|
5fec90d4ca | ||
|
|
f1a56edd09 | ||
|
|
3f03cfa7c4 | ||
|
|
f34db0bb24 | ||
|
|
94d154c628 | ||
|
|
071962440e | ||
|
|
5171b52570 | ||
|
|
fb282e2aff | ||
|
|
5013b9c7fe | ||
|
|
0e2fcfcb95 | ||
|
|
a7ea6ef398 | ||
|
|
b4a2291dce | ||
|
|
9348c426e5 | ||
|
|
678c4db8f0 | ||
|
|
e979df64d1 | ||
|
|
43fa167f14 | ||
|
|
2a8858a3a2 | ||
|
|
977d16557a | ||
|
|
3db254c306 | ||
|
|
9274c3a719 | ||
|
|
993ff2624e | ||
|
|
60f6565d18 | ||
|
|
924d30af74 | ||
|
|
c55d19c3c5 | ||
|
|
9221c3e7e7 | ||
|
|
eb862cf2d2 | ||
|
|
1e3cef1a26 | ||
|
|
50fd49fd3d | ||
|
|
8e8a763485 | ||
|
|
ab47566e82 | ||
|
|
e9a834c205 | ||
|
|
6dc524e67b | ||
|
|
b61b3aa06f | ||
|
|
b9d43eb897 | ||
|
|
c069ba71cc | ||
|
|
df01a9acc0 | ||
|
|
e0aa0eec98 | ||
|
|
2a145ba46a | ||
|
|
9f34e57df8 | ||
|
|
9c8affad09 | ||
|
|
cd76797336 | ||
|
|
feb26f21fd | ||
|
|
5ff23ce3cf | ||
|
|
cacb8a23dd | ||
|
|
f5604d42f6 | ||
|
|
8f74933b37 | ||
|
|
2d92eeab07 | ||
|
|
c44ab8b4e6 | ||
|
|
d3ad594940 | ||
|
|
8f53da4f79 | ||
|
|
1cc9673e8c | ||
|
|
258e484d5f | ||
|
|
7edbe99599 | ||
|
|
fbcfddfbdc | ||
|
|
0e75b82eb6 | ||
|
|
492db67f64 | ||
|
|
6129f525d5 | ||
|
|
2ec381534e | ||
|
|
29d6d9f1ea | ||
|
|
a530af9354 | ||
|
|
e42fd1e3a4 | ||
|
|
30cfc34e1c | ||
|
|
0737a706ec | ||
|
|
b3589c92dc | ||
|
|
0f40cb8e77 | ||
|
|
a051edcd00 | ||
|
|
18b19c92be | ||
|
|
a2eabf35e3 | ||
|
|
0dfe43f1e6 | ||
|
|
20cda84f47 | ||
|
|
0228173d53 | ||
|
|
0db604ad1e | ||
|
|
c53d342b6a | ||
|
|
42e77e6f5a | ||
|
|
e8bd819e39 | ||
|
|
0c03b63c0f | ||
|
|
5ed2f1d964 | ||
|
|
515793450e | ||
|
|
541e9b0b4f | ||
|
|
24611df4c6 | ||
|
|
083010d43c | ||
|
|
f9b46fd6b0 | ||
|
|
74eb6f96ab | ||
|
|
4967fcd2be | ||
|
|
e973110de7 | ||
|
|
a62503328b | ||
|
|
e42051d3a9 | ||
|
|
e5336b7351 | ||
|
|
5469af35f1 | ||
|
|
8c9cd8f9d2 | ||
|
|
8b3ac5ea36 | ||
|
|
c230825486 | ||
|
|
e8b0f5da60 | ||
|
|
bc45e11824 | ||
|
|
d6b3e97c34 | ||
|
|
d35a12b4f4 | ||
|
|
a42f103500 | ||
|
|
dc2a48c515 | ||
|
|
db617e23f0 | ||
|
|
71189b1b74 | ||
|
|
5567de89e6 | ||
|
|
5430d79f53 | ||
|
|
9d82d88a0c | ||
|
|
0e264203de | ||
|
|
469443da2a | ||
|
|
692958d2fd | ||
|
|
e65fa74071 | ||
|
|
fb64d45c39 | ||
|
|
71e5c8f441 | ||
|
|
8e34f6653c | ||
|
|
bee060b9bb | ||
|
|
e3e94fe520 | ||
|
|
237c090cb4 | ||
|
|
74ea7a7a1e | ||
|
|
330dbd49e6 | ||
|
|
a84b047061 | ||
|
|
3795060bf2 | ||
|
|
e61ab97815 | ||
|
|
0162828df8 | ||
|
|
73cfef1203 | ||
|
|
3eb6360054 | ||
|
|
47e4bc585a | ||
|
|
3746722a4d | ||
|
|
5828971cfe | ||
|
|
dd911cbf21 | ||
|
|
f167553348 | ||
|
|
d483c55c14 | ||
|
|
d9815c0f62 | ||
|
|
daadf043d8 | ||
|
|
1a56d5820d | ||
|
|
8e2f2fcce3 | ||
|
|
fc5a841563 | ||
|
|
d511a338df | ||
|
|
a3d348b664 | ||
|
|
b48506b156 | ||
|
|
17bb88b67a | ||
|
|
578a616b00 | ||
|
|
93f603e27c | ||
|
|
09b513550c | ||
|
|
5e451461cf | ||
|
|
fd33396acb | ||
|
|
3bdfa68ff5 | ||
|
|
3dbc070f2c | ||
|
|
b48e5eb057 | ||
|
|
3501bd9c11 | ||
|
|
70635ac911 | ||
|
|
f9a00b7ebd | ||
|
|
5bec28b7e5 | ||
|
|
e41818470f | ||
|
|
a31422d3d7 | ||
|
|
bea3d2c4f8 | ||
|
|
4c4cb58027 | ||
|
|
4312a42b62 | ||
|
|
011e5b6e1a | ||
|
|
8233c10569 | ||
|
|
fb73d889ed | ||
|
|
80bfb8671d | ||
|
|
521df1a142 | ||
|
|
72a75b72ac | ||
|
|
c22dce10d3 | ||
|
|
8eb801a0cc | ||
|
|
6eaef7adad | ||
|
|
0272d4bcad | ||
|
|
41c64e9978 | ||
|
|
9c2f0a098d | ||
|
|
0bb8d0dcc0 | ||
|
|
a542660072 | ||
|
|
8ee15d0053 | ||
|
|
311515867c | ||
|
|
16bbcddd40 | ||
|
|
a4b663b824 | ||
|
|
736ab2b803 | ||
|
|
cd2fbd11f2 | ||
|
|
708fe70e75 | ||
|
|
0c9499c085 | ||
|
|
d52d4ff627 | ||
|
|
324df56861 | ||
|
|
a21a08e8bf | ||
|
|
393db0ec2a | ||
|
|
ca26d347eb | ||
|
|
c56b7adea8 | ||
|
|
84d31765db | ||
|
|
fb617ea136 | ||
|
|
47468145c6 | ||
|
|
854c8a44d4 | ||
|
|
86948e1052 | ||
|
|
39053d366d | ||
|
|
daaed910da | ||
|
|
bf6abd80dd | ||
|
|
e74e22e184 | ||
|
|
b8f5e17e38 | ||
|
|
956a31db8f | ||
|
|
9eeefa2fbf | ||
|
|
c33705ca60 | ||
|
|
ba41e6773b | ||
|
|
8ebf884436 | ||
|
|
7d4353caf0 | ||
|
|
fa6220a615 | ||
|
|
26517bb6ae | ||
|
|
ea4c4b3fe5 | ||
|
|
00f273000e | ||
|
|
6014d3a04d | ||
|
|
08f082acfe | ||
|
|
12e5efcda4 | ||
|
|
26be5ba20e | ||
|
|
dc2feb3cc7 | ||
|
|
ed397f5ce4 | ||
|
|
19f0260c0a | ||
|
|
49c55bdec5 | ||
|
|
2ab86ee29d | ||
|
|
888aa40057 | ||
|
|
2291ccf198 | ||
|
|
1d031a0535 | ||
|
|
cb7ed7a37b | ||
|
|
e692aea19e | ||
|
|
a8bb06fb1c | ||
|
|
63b5803086 | ||
|
|
68689674b7 | ||
|
|
fccdccdba3 | ||
|
|
21176badf7 | ||
|
|
87adc56e60 | ||
|
|
0f8be3bbde | ||
|
|
a3fc407f25 | ||
|
|
30c2c68579 | ||
|
|
736e3e58cf | ||
|
|
b38cd9bb9f | ||
|
|
d69a8f159d | ||
|
|
baaa31f445 | ||
|
|
cf18242ee5 | ||
|
|
fdcfffd81d | ||
|
|
c9a76b8d76 | ||
|
|
9bd53e7d91 | ||
|
|
812fb18160 | ||
|
|
0571cc73da | ||
|
|
6bdd93ce0f | ||
|
|
0603953d9f | ||
|
|
098c81376f | ||
|
|
7ef10fcfb4 | ||
|
|
823ac590ff | ||
|
|
9b68205dc0 | ||
|
|
d8216dc583 | ||
|
|
2e3c52160c | ||
|
|
8686846a09 | ||
|
|
8de22ca44b | ||
|
|
3e692ed95a | ||
|
|
128bd3a17e | ||
|
|
cc54c8654f | ||
|
|
200f627a9c | ||
|
|
0134c1cb64 | ||
|
|
5519ab913b | ||
|
|
530332fb51 | ||
|
|
8bb8c16b34 | ||
|
|
a6a7d82607 | ||
|
|
f78dc0cd77 | ||
|
|
aaf830ae27 | ||
|
|
555e1a2b1b | ||
|
|
0fbe2e9089 | ||
|
|
e87c1ca2dd | ||
|
|
c0b3e38215 | ||
|
|
0bf5ea74b3 | ||
|
|
1c4c82a9df | ||
|
|
4d1022f29b | ||
|
|
a652e6c8d2 | ||
|
|
7b91863cba | ||
|
|
c7ad6eaf2c | ||
|
|
c06923a022 | ||
|
|
d9a8e771ae | ||
|
|
7e2cec9d91 | ||
|
|
84add765fe | ||
|
|
f050d53ed4 | ||
|
|
26be8ab162 | ||
|
|
3f93f7c972 | ||
|
|
7bab50dd3c | ||
|
|
cf657dbd94 | ||
|
|
33c9876760 | ||
|
|
4d6d7405d6 | ||
|
|
e249701c34 | ||
|
|
0d50975152 | ||
|
|
6d87847d15 | ||
|
|
eebe021780 | ||
|
|
c6e0384f21 | ||
|
|
23ae850f72 | ||
|
|
708cf2dec6 | ||
|
|
a95745d95b | ||
|
|
83ccea0abf | ||
|
|
bfeaf89238 | ||
|
|
7439217b3c | ||
|
|
ae2377f4d2 | ||
|
|
b81d0aaf0e | ||
|
|
1546bef93f | ||
|
|
32b1aade42 | ||
|
|
2a92b75fe1 | ||
|
|
cb30d9e20a | ||
|
|
588206b93b | ||
|
|
6399649038 | ||
|
|
aa3cb95233 | ||
|
|
3ea06dac40 | ||
|
|
a70dda4a8e | ||
|
|
a01f1add81 | ||
|
|
57849591d7 | ||
|
|
b4a09e7167 | ||
|
|
96bb8b1372 | ||
|
|
99ea9da785 | ||
|
|
bfe7fadfc5 | ||
|
|
ad1dcc4f45 | ||
|
|
f371c789d0 | ||
|
|
386eca1f65 | ||
|
|
8b9047952d | ||
|
|
5a105ef06e | ||
|
|
c60dc1e045 | ||
|
|
1e1bd19429 | ||
|
|
cfe07f6e15 | ||
|
|
a64039db20 | ||
|
|
7f81ddb8cc | ||
|
|
3c0d495334 | ||
|
|
38a7c54cce | ||
|
|
1aead07444 | ||
|
|
d2f44cbb12 | ||
|
|
43d7ca31d6 | ||
|
|
0985c573b0 | ||
|
|
d9ed861c1d | ||
|
|
8ef9989147 | ||
|
|
7d5eab4bf3 | ||
|
|
5e03e04bbd | ||
|
|
6fabaeca53 | ||
|
|
be4ca445f5 | ||
|
|
e99c8b27e1 | ||
|
|
e9055b4f08 | ||
|
|
cfcafb676b | ||
|
|
899b4d6bfd | ||
|
|
2003632ddb | ||
|
|
d4a14106b7 | ||
|
|
85af9d7e0b | ||
|
|
d4442efbfe | ||
|
|
3a26ae2695 | ||
|
|
09af596e85 | ||
|
|
5985187316 | ||
|
|
33ac83a309 | ||
|
|
921c1b553d | ||
|
|
d160507230 | ||
|
|
7368620fd2 | ||
|
|
a910e297a3 | ||
|
|
f819bb8753 | ||
|
|
cc0d4bded2 | ||
|
|
e3b2b7f232 | ||
|
|
c8dde50eba | ||
|
|
3c355f96eb | ||
|
|
93dd24ef6e | ||
|
|
107bc8ef65 | ||
|
|
9a8278afcc | ||
|
|
1c48765913 | ||
|
|
c6a45184fd | ||
|
|
18d5b8cba7 | ||
|
|
65c08ade18 | ||
|
|
3f6fee91e9 | ||
|
|
d29c4e49b3 | ||
|
|
f162000749 | ||
|
|
c804333bc0 | ||
|
|
449795db97 | ||
|
|
af92a2c7aa | ||
|
|
b68affdf6a | ||
|
|
7a95f9ac2d | ||
|
|
8b5d9d84de | ||
|
|
93d93c7708 | ||
|
|
b35232ab4a | ||
|
|
770a2bdd36 | ||
|
|
9650f8eaa8 | ||
|
|
63ab76bb30 | ||
|
|
fcb21ca0b6 | ||
|
|
d6d5422152 | ||
|
|
5b970a3f12 | ||
|
|
a4a7c1f9f3 | ||
|
|
5cbac23e3f | ||
|
|
172c0d3690 | ||
|
|
535f41d58b | ||
|
|
2be18091a4 | ||
|
|
73f42e3c6f | ||
|
|
cff778d8ca | ||
|
|
94d4498a2d | ||
|
|
eb0ab17f58 | ||
|
|
1ab99d50b2 | ||
|
|
dfeddc0d89 | ||
|
|
efde86be9d | ||
|
|
739e8c12fb | ||
|
|
3fdbbff9f7 | ||
|
|
0a56755bef | ||
|
|
c35290772d | ||
|
|
cedcbcbc2b | ||
|
|
9de96deca8 | ||
|
|
19dbb1d5e3 | ||
|
|
83b6ccf562 | ||
|
|
ea86593835 | ||
|
|
36b5478005 | ||
|
|
1ad19297c1 | ||
|
|
f5357f7854 | ||
|
|
8a3140b89b | ||
|
|
16e0724ace | ||
|
|
17ff9eecf5 | ||
|
|
4b870f978c | ||
|
|
8b83365961 | ||
|
|
c6ebb5537a | ||
|
|
6ebe189d71 | ||
|
|
98b56551d5 | ||
|
|
606e27e256 | ||
|
|
94fe14b9f9 | ||
|
|
58388f84b6 | ||
|
|
79ea04af49 | ||
|
|
396e2bd06c | ||
|
|
1a484c7f39 | ||
|
|
e6b1030991 | ||
|
|
6e32e68302 | ||
|
|
0f13f7f5cd | ||
|
|
2ac4f9ef1d | ||
|
|
f1a75c25f9 | ||
|
|
ff8d70753d | ||
|
|
caea6baecd | ||
|
|
2e914c9b35 | ||
|
|
da65d7e06f | ||
|
|
d18eef480c | ||
|
|
f3532c66e5 | ||
|
|
9678b1d6a5 | ||
|
|
379a4e2382 | ||
|
|
edb33cd560 | ||
|
|
2ff425ddeb | ||
|
|
7d016ac27f | ||
|
|
9790377dec | ||
|
|
597c547101 | ||
|
|
73b2645027 | ||
|
|
8d58387d15 | ||
|
|
54dac4d348 | ||
|
|
a0880ed0f1 | ||
|
|
ed6d683980 | ||
|
|
4c72c6a35a | ||
|
|
125d56866e | ||
|
|
a70a767ec0 | ||
|
|
b8a6764207 | ||
|
|
98c9fcfd5d | ||
|
|
eac5504fec | ||
|
|
c2c75b67eb | ||
|
|
ef3eacefa7 | ||
|
|
ef7481596a | ||
|
|
6f4e00aa46 | ||
|
|
be65578a7f | ||
|
|
20d4bd0c7d | ||
|
|
531f4eb811 | ||
|
|
3b0dae7189 | ||
|
|
79395593ba | ||
|
|
61248b98e0 | ||
|
|
72b5abb72a | ||
|
|
673a029a02 | ||
|
|
7efb85180f | ||
|
|
f95eadaa8f | ||
|
|
6f6b40a94f | ||
|
|
d84982f161 | ||
|
|
4b07afe59f | ||
|
|
5d53d138b0 | ||
|
|
e40631b8cd | ||
|
|
22135129bd | ||
|
|
de4b3c4edc |
39
.github/actions/create-ami-from-image/action.yml
vendored
Normal file
39
.github/actions/create-ami-from-image/action.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Create AMI from firmware image in S3 bucket
|
||||
|
||||
inputs:
|
||||
firmware_image_name:
|
||||
description: Name of the firmware image
|
||||
required: true
|
||||
firmware_image_s3_bucket:
|
||||
description: Name of the S3 bucket where the image resides
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Import snapshot based on firmware image
|
||||
id: import_snapshot
|
||||
shell: bash
|
||||
run: |
|
||||
echo "import_task_id=$(aws ec2 import-snapshot --description '${{ inputs.firmware_image_name }}' --disk-container 'Format=raw,UserBucket={S3Bucket=${{ inputs.firmware_image_s3_bucket }},S3Key=${{ inputs.firmware_image_name }}}' | jq -r '.ImportTaskId')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Wait for import task to complete and get snapshot ID
|
||||
id: get_snapshot_id
|
||||
shell: bash
|
||||
run: |
|
||||
IMPORT_TASK_STATUS=""
|
||||
while [[ $IMPORT_TASK_STATUS != 'completed' ]]; do
|
||||
IMPORT_TASK_STATUS=$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.Status')
|
||||
echo "Import task status is $IMPORT_TASK_STATUS, waiting for completion."
|
||||
done
|
||||
echo "id=$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.SnapshotId')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Tag snapshot with image name
|
||||
shell: bash
|
||||
run: |
|
||||
aws ec2 create-tags --resources ${{ steps.get_snapshot_id.outputs.id }} --tags 'Key=Name,Value=${{ inputs.firmware_image_name }}'
|
||||
|
||||
- name: Register AMI based on snapshot
|
||||
shell: bash
|
||||
run: |
|
||||
aws ec2 register-image --name '${{ inputs.firmware_image_name }}' --root-device-name /dev/xvda --block-device-mappings 'DeviceName=/dev/xvda,Ebs={SnapshotId=${{ steps.get_snapshot_id.outputs.id }}}'
|
||||
38
.github/workflows/build-dev.yml
vendored
38
.github/workflows/build-dev.yml
vendored
@@ -1,5 +1,13 @@
|
||||
name: Build OpenWrt/uCentral images
|
||||
|
||||
env:
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
||||
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, next, staging-* ]
|
||||
@@ -8,13 +16,15 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ['actiontec_web7200', 'cig_wf188n', 'cig_wf194c', 'cig_wf194c4', 'cig_wf196', 'cig_wf160d', 'cig_wf808', 'cybertan_eww622-a1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'edgecore_spw2ac1200-lan-poe', 'hfcl_ion4', 'hfcl_ion4xe', 'hfcl_ion4xi', 'indio_um-305ac', 'linksys_ea6350-v4', 'linksys_e8450-ubi', 'linksys_ea8300', 'tp-link_ec420-g1', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018_v4' ]
|
||||
target: [ 'cig_wf186w', 'cig_wf188n-ca', 'cig_wf188n-ca-ath12', 'cig_wf188n-us', 'cig_wf196-us', 'cig_wf196-ca', 'cig_wf196-ca-ath12', 'cig_wf610d', 'cig_wf660a', 'cig_wf808', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap101-ath12', 'edgecore_eap102', 'edgecore_eap102-ath12', 'edgecore_eap104', 'edgecore_eap104-ath12', 'liteon_wpx8324', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_oap101-6e', 'edgecore_oap101e', 'hfcl_ion4','hfcl_ion4xi_wp', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4xi_HMR', 'hfcl_ion4x_w', 'indio_um-305ac', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'indio_um-310ax-v1', 'indio_um-510axp-v1', 'indio_um-510axm-v1', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018_v4', 'x64_vm', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build image for ${{ matrix.target }}
|
||||
id: build
|
||||
@@ -24,17 +34,12 @@ jobs:
|
||||
make -j TARGET=${{ matrix.target }}
|
||||
|
||||
- name: Package and upload image for ${{ matrix.target }}
|
||||
id: package_and_upload_image
|
||||
env:
|
||||
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
||||
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
||||
ARTIFACTORY_USERNAME: cicd-indoor-main
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
||||
run: |
|
||||
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
||||
HASH=$(git rev-parse --short HEAD)
|
||||
@@ -66,6 +71,10 @@ jobs:
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/json" "latest-upgrade.json" "s3://$AWS_S3_BUCKET_NAME/$JSON_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$JSON_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
|
||||
if [ ${{ matrix.target }} == 'x64_vm' ]; then
|
||||
echo "x64_vm_image_name=$(echo $IMG_NAME)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
trigger-testing:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
@@ -78,3 +87,16 @@ jobs:
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
event-type: new-ap-release
|
||||
client-payload: '{"ref": "${GITHUB_REF#refs/tags/}", "sha": "${{ github.sha }}"}'
|
||||
|
||||
create-x64_vm-ami:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use create-ami-from-image composite action
|
||||
uses: ./.github/actions/create-ami-from-image
|
||||
with:
|
||||
firmware_image_name: ${{ needs.build.outputs.x64_vm_image_name }}
|
||||
firmware_image_s3_bucket: ${{ env.AWS_S3_BUCKET_NAME }}
|
||||
|
||||
88
.github/workflows/x64_vm-build-test.yml
vendored
Normal file
88
.github/workflows/x64_vm-build-test.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: Test x64_vm build and AMI creation
|
||||
|
||||
env:
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
||||
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ['x64_vm']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build image for ${{ matrix.target }}
|
||||
id: build
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
make -j TARGET=${{ matrix.target }} make -j TARGET=${{ matrix.target }}
|
||||
|
||||
- name: Package and upload image for ${{ matrix.target }}
|
||||
id: package_and_upload_image
|
||||
env:
|
||||
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
||||
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
||||
ARTIFACTORY_USERNAME: cicd-indoor-main
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
run: |
|
||||
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
||||
HASH=$(git rev-parse --short HEAD)
|
||||
|
||||
if [[ ${GITHUB_REF} == "refs/heads/"* ]]
|
||||
then
|
||||
REF=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')
|
||||
IS_RELEASE="false"
|
||||
else
|
||||
REF=$(echo ${GITHUB_REF#refs/tags/} | tr '/' '-')
|
||||
IS_RELEASE="true"
|
||||
fi
|
||||
|
||||
BASENAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$REF-$HASH"
|
||||
TAR_NAME="$BASENAME.tar.gz"
|
||||
IMG_NAME="$BASENAME-upgrade.bin";
|
||||
JSON_NAME="$BASENAME.json";
|
||||
|
||||
tar cfz "$TAR_NAME" -C openwrt/bin/targets/ .
|
||||
curl -s -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "$TAR_NAME" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/"$TAR_NAME""
|
||||
IMG_NAME="$BASENAME-upgrade.bin";
|
||||
TIP_VERSION="$(grep DISTRIB_TIP= openwrt/tmp/openwrt_release | cut -d\' -f2)"
|
||||
echo -e "{\n\t\"image\":\""${IMG_NAME}"\",\n\t\"revision\": \""${TIP_VERSION}"\",\n\t\"timestamp\":\""$(date +%s)"\",\n\t\"compatible\": \""${LOWERCASE_TARGET}"\"\n}" > latest-upgrade.json
|
||||
[ -f openwrt/tmp/image-file ] && curl -s -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "openwrt/$(cat openwrt/tmp/image-file)" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/"$IMG_NAME""
|
||||
[ -f openwrt/tmp/image-file ] && curl -s -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "latest-upgrade.json" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/latest-upgrade.json"
|
||||
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/octet-stream" "openwrt/$(cat openwrt/tmp/image-file)" "s3://$AWS_S3_BUCKET_NAME/$IMG_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$IMG_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/json" "latest-upgrade.json" "s3://$AWS_S3_BUCKET_NAME/$JSON_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$JSON_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
|
||||
if [[ ${{ matrix.target }} == 'x64_vm' ]]; then
|
||||
echo "x64_vm_image_name=$(echo $IMG_NAME)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
create-x64_vm-ami:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: WIFI-7206-add-workflow-to-build-virtual-ap-image
|
||||
|
||||
- name: Use create-ami-from-image composite action
|
||||
uses: ./.github/actions/create-ami-from-image
|
||||
with:
|
||||
firmware_image_name: ${{ needs.build.outputs.x64_vm_image_name }}
|
||||
firmware_image_s3_bucket: ${{ env.AWS_S3_BUCKET_NAME }}
|
||||
85
README.md
85
README.md
@@ -1,20 +1,83 @@
|
||||
# Setting up your build machine
|
||||
# OpenWiFi AP NOS
|
||||
|
||||
Requires a recent linux installation. Older systems without python 3.7 will have trouble. See this link for details: https://openwrt.org/docs/guide-developer/quickstart-build-images
|
||||
OpenWrt-based access point network operating system (AP NOS) for TIP OpenWiFi.
|
||||
Read more at [openwifi.tip.build](https://openwifi.tip.build/).
|
||||
|
||||
Install build packages: sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml.
|
||||
## Building
|
||||
|
||||
# Doing a native build on Linux
|
||||
First we need to clone and setup our tree. This will result in an openwrt/.
|
||||
### Setting up your build machine
|
||||
|
||||
Building requires a recent Linux installation. Older systems without Python 3.7
|
||||
will have trouble. See this guide for details:
|
||||
https://openwrt.org/docs/guide-developer/toolchain/beginners-build-guide
|
||||
|
||||
Install build packages on Debian/Ubuntu (or see above guide for other systems):
|
||||
```
|
||||
./setup.py --setup
|
||||
sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml
|
||||
```
|
||||
Next we need to select the profile and base package selection. This setup will install the feeds, packages and generate the .config file.
|
||||
|
||||
### Doing a native build on Linux
|
||||
|
||||
Use `./build.sh <target>`, or follow the manual steps below:
|
||||
|
||||
1. Clone and set up the tree. This will create an `openwrt/` directory.
|
||||
```shell
|
||||
./setup.py --setup # for subsequent builds, use --rebase instead
|
||||
```
|
||||
|
||||
2. Select the profile and base package selection. This setup will install the
|
||||
feeds and packages and generate the `.config` file.
|
||||
```shell
|
||||
cd openwrt
|
||||
./scripts/gen_config.py ea8300
|
||||
./scripts/gen_config.py linksys_ea8300
|
||||
```
|
||||
Finally we can build the tree.
|
||||
```
|
||||
make -j X V=s
|
||||
|
||||
3. Build the tree (replace `-j 8` with the number of cores to use).
|
||||
```shell
|
||||
make -j 8 V=s
|
||||
```
|
||||
|
||||
### Build output
|
||||
|
||||
The build results are located in the `openwrt/bin/` directory:
|
||||
|
||||
| Type | Path |
|
||||
| ---------------- | ---------------------------------------------------- |
|
||||
| Firmware images | `openwrt/bin/targets/<target>/<subtarget>/` |
|
||||
| Kernel modules | `openwrt/bin/targets/<target>/<subtarget>/packages/` |
|
||||
| Package binaries | `openwrt/bin/packages/<platform>/<feed>/` |
|
||||
|
||||
## Developer Notes
|
||||
|
||||
### Branching model
|
||||
|
||||
- `main` - Stable dev branch
|
||||
- `next` - Integration branch
|
||||
- `staging-*` - Feature/bug branches
|
||||
- `release/v#.#.#` - Release branches (*major.minor.patch*)
|
||||
|
||||
### Repository structure
|
||||
|
||||
Build files:
|
||||
- `Makefile` - Calls Docker environment per target
|
||||
- `dock-run.sh` - Dockerized build environment
|
||||
- `docker/Dockerfile` - Dockerfile for build image
|
||||
- `build.sh` - Build script
|
||||
- `setup.py` - Clone and set up the tree
|
||||
- `config.yml` - Specifies OpenWrt version and patches to apply
|
||||
|
||||
Directories:
|
||||
- `feeds/` - OpenWiFi feeds
|
||||
- `patches/` - OpenWiFi patches applied during builds
|
||||
- `profiles/` - Per-target kernel configs, packages, and feeds
|
||||
- [wifi-ax](profiles/wifi-ax.yml): Wi-Fi AX packages
|
||||
- [ucentral-ap](profiles/ucentral-ap.yml): uCentral packages
|
||||
- [x64_vm](profiles/x64_vm.yml): x86-64 VM image
|
||||
|
||||
### uCentral packages
|
||||
|
||||
AP-NOS packages implementing the uCentral protocol include the following
|
||||
repositories (refer to the [ucentral](feeds/ucentral/) feed for a full list):
|
||||
- ucentral-client: https://github.com/Telecominfraproject/wlan-ucentral-client
|
||||
- ucentral-schema: https://github.com/Telecominfraproject/wlan-ucentral-schema
|
||||
- ucentral-wifi: https://github.com/blogic/ucentral-wifi
|
||||
|
||||
@@ -12,5 +12,5 @@ patch_folders:
|
||||
- patches/ipq40xx
|
||||
- patches/ipq806x
|
||||
- patches/ipq807x
|
||||
- patches/rtkmipsel
|
||||
- patches/rest
|
||||
- patches/x86
|
||||
|
||||
29
feeds/bluetooth-cc2652/ble_scan/Makefile
Normal file
29
feeds/bluetooth-cc2652/ble_scan/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ble_scan
|
||||
PKG_VERSION:=1.0
|
||||
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ble_scan
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=ble_scan
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/ble_scan/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ble_scan $(1)/bin/
|
||||
endef
|
||||
|
||||
define Package/ble_scan/extra_provides
|
||||
echo "libc.so.6";
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ble_scan))
|
||||
47
feeds/bluetooth-cc2652/ble_scan/src/Makefile
Normal file
47
feeds/bluetooth-cc2652/ble_scan/src/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#all: ble_scan
|
||||
#ble_scan: ble_scan.o
|
||||
# $(CC) $(LDFLAGS) ble_scan.o -o ble_scan
|
||||
#blescan.o: ble_scan.c
|
||||
# $(CC) $(CFLAGS) -c ble_scan.c
|
||||
#clean:
|
||||
# rm *.o ble_scan
|
||||
|
||||
#
|
||||
#
|
||||
# Author: Teunis van Beelen
|
||||
#
|
||||
# email: teuniz@protonmail.com
|
||||
#
|
||||
#
|
||||
|
||||
#CROSS-COMPILE:=../../../../../qsdk/staging_dir/toolchain-arm/bin/arm-openwrt-linux-
|
||||
#CC:=$(CROSS-COMPILE)gcc
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -Wshadow -Wformat-nonliteral -Wformat-security -Wtype-limits -O2
|
||||
|
||||
objects = rs232.o
|
||||
|
||||
all: ble_scan
|
||||
|
||||
ble_scan : $(objects) ble_scan.o
|
||||
$(CC) $(CFLAGS) $(objects) ble_scan.o -o ble_scan
|
||||
|
||||
ble_scan.o : ble_scan.c rs232.h
|
||||
$(CC) $(CFLAGS) -c ble_scan.c -o ble_scan.o
|
||||
|
||||
rs232.o : rs232.h rs232.c
|
||||
$(CC) $(CFLAGS) -c rs232.c -o rs232.o
|
||||
|
||||
clean :
|
||||
$(RM) ble_scan $(objects) ble_scan.o
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
387
feeds/bluetooth-cc2652/ble_scan/src/ble_scan.c
Normal file
387
feeds/bluetooth-cc2652/ble_scan/src/ble_scan.c
Normal file
@@ -0,0 +1,387 @@
|
||||
|
||||
/**************************************************
|
||||
|
||||
file: ble_scan.c
|
||||
purpose: Send HCI command to do BLE scan
|
||||
|
||||
compile with the command: gcc ble_scan.c rs232.c -Wall -Wextra -o2 -o ble_scan
|
||||
|
||||
**************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "rs232.h"
|
||||
|
||||
#define TX 0
|
||||
#define RX 1
|
||||
#define BUF_SIZE 4095
|
||||
#define FULL_BUF_SIZE BUF_SIZE*4
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#else
|
||||
#endif
|
||||
|
||||
int print_hex(int mode, unsigned char *buf, int size);
|
||||
int rx_pkt_parser(unsigned char *buf, int size);
|
||||
|
||||
|
||||
struct rx_packet_h{
|
||||
unsigned char rxType;
|
||||
unsigned char rxEventCode;
|
||||
unsigned char rxDataLen;
|
||||
unsigned char Event[2];
|
||||
unsigned char Status;
|
||||
};
|
||||
|
||||
struct event_cmd_st_h{
|
||||
unsigned char OpCode[2];
|
||||
unsigned char DataLength;
|
||||
};
|
||||
|
||||
struct event_scn_evnt_rep_h{
|
||||
unsigned char EventId[4];
|
||||
unsigned char AdvRptEventType;
|
||||
unsigned char AddressType;
|
||||
unsigned char Address[6];
|
||||
unsigned char PrimaryPHY;
|
||||
unsigned char SecondaryPHY;
|
||||
unsigned char AdvSid;
|
||||
unsigned char TxPower;
|
||||
unsigned char RSSI;
|
||||
unsigned char DirectAddrType;
|
||||
unsigned char DirectAddr[6];
|
||||
unsigned char PeriodicAdvInt[2];
|
||||
unsigned char DataLength[2];
|
||||
//unsigned char *DataPtr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
int cport_nr,bdrate,n;
|
||||
//cport_nr=0, /* /dev/ttyS0 (COM1 on windows) */
|
||||
//bdrate=9600; /* 9600 baud */
|
||||
cport_nr=39, /* (ttyMSM1 : 39) */
|
||||
bdrate=115200; /* 115200 baud */
|
||||
#ifdef DEBUG
|
||||
clock_t t;
|
||||
#endif
|
||||
char mode[]={'8','N','1',0};
|
||||
|
||||
unsigned char buf[BUF_SIZE];
|
||||
unsigned char full_buf[FULL_BUF_SIZE];
|
||||
int full_buf_ptr = 0;
|
||||
unsigned char HCIExt_ResetSystemCmd[] = {0x01, 0x1D, 0xFC, 0x01, 0x00 };
|
||||
int HCIExt_ResetSystemCmd_length = 5;
|
||||
|
||||
unsigned char GAP_DeviceInitCmd[] = {0x01, 0x00, 0xFE, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
int GAP_DeviceInitCmd_length = 12;
|
||||
|
||||
unsigned char GapScan_enableCmd[] = {0x01, 0x51, 0xFE, 0x06, 0x00, 0x00, 0xF4, 0x01, 0x28, 0x00 };
|
||||
int GapScan_enableCmd_length = 10;
|
||||
|
||||
if(RS232_OpenComport(cport_nr, bdrate, mode, 0))
|
||||
{
|
||||
printf("Can not open comport\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
RS232_flushRXTX(cport_nr);
|
||||
|
||||
// send reset command
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(TX, HCIExt_ResetSystemCmd, HCIExt_ResetSystemCmd_length);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t); //60
|
||||
#else
|
||||
/* sleep for 60ms */
|
||||
usleep(60000);
|
||||
#endif
|
||||
|
||||
|
||||
RS232_SendBuf(cport_nr, HCIExt_ResetSystemCmd, HCIExt_ResetSystemCmd_length);
|
||||
/* sleep for 1 Second */
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
#endif
|
||||
usleep(1000000);
|
||||
#ifdef DEBUG
|
||||
t=clock()-t;
|
||||
printf("CLOCKS_PER_SEC=%ld\n",t);
|
||||
#endif
|
||||
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
|
||||
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(RX, buf, n);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 300ms */
|
||||
usleep(300000);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// send device initial command
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(TX, GAP_DeviceInitCmd, GAP_DeviceInitCmd_length);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 250 ms */
|
||||
usleep(250000);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
RS232_SendBuf(cport_nr, GAP_DeviceInitCmd, GAP_DeviceInitCmd_length);
|
||||
/* sleep for 0.5 Second */
|
||||
usleep(500000);
|
||||
|
||||
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
|
||||
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(RX, buf, n);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 500 ms */
|
||||
usleep(500000);
|
||||
#endif
|
||||
|
||||
|
||||
// send scan command
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(TX, GapScan_enableCmd, GapScan_enableCmd_length);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 30ms */
|
||||
usleep(30000);
|
||||
#endif
|
||||
|
||||
|
||||
RS232_SendBuf(cport_nr, GapScan_enableCmd, GapScan_enableCmd_length);
|
||||
|
||||
//read scan respone
|
||||
while (n > 0)
|
||||
{
|
||||
/* sleep for 400 mS */
|
||||
usleep(400000);
|
||||
|
||||
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(RX, buf, n);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#endif
|
||||
|
||||
if (full_buf_ptr+n>FULL_BUF_SIZE)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("buffer full. break.\n");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
memcpy(full_buf+full_buf_ptr, buf, n);
|
||||
full_buf_ptr+=n;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("n:%d, full_buf_ptr:%d\n",n, full_buf_ptr);
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG
|
||||
print_hex(RX, full_buf, full_buf_ptr);
|
||||
#endif
|
||||
rx_pkt_parser( full_buf, full_buf_ptr);
|
||||
#ifdef DEBUG
|
||||
printf("n:%d, full_buf_ptr:%d\n",n, full_buf_ptr);
|
||||
#endif
|
||||
RS232_flushRXTX(cport_nr);
|
||||
RS232_CloseComport(cport_nr);
|
||||
return(0);
|
||||
}
|
||||
/**************************************************
|
||||
Print buffer in HEX
|
||||
**************************************************/
|
||||
int print_hex(int mode, unsigned char *buf, int size)
|
||||
{
|
||||
|
||||
int ii,jj;
|
||||
|
||||
if (mode == TX)
|
||||
printf("TX: ");
|
||||
else
|
||||
printf("RX: ");
|
||||
|
||||
for(ii=0,jj=0; ii < size; ii++,jj++)
|
||||
{
|
||||
printf("%02X ",buf[ii]);
|
||||
if (jj==15)
|
||||
{
|
||||
printf("\n");
|
||||
jj = 0;
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int rx_pkt_parser(unsigned char *buf, int size)
|
||||
{
|
||||
int pkt_index=0;
|
||||
int pkt_size=0;
|
||||
int temp_event=0;
|
||||
int temp_EventId=0;
|
||||
int total_device_count=0;
|
||||
char szAddress[18];
|
||||
struct rx_packet_h *rx_packet;
|
||||
struct event_scn_evnt_rep_h *event_scn_evnt_rep;
|
||||
#ifdef DEBUG
|
||||
int dump_i=0;
|
||||
unsigned char *pkt_ptr;
|
||||
#endif
|
||||
if(size<=0){printf("size error\n");return -1;}
|
||||
|
||||
printf("BLE scan start:\n");
|
||||
rx_packet = (struct rx_packet_h *)(buf);
|
||||
|
||||
while(pkt_index<size)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("--------------------------------------------------------------------\n");
|
||||
printf("-Type : 0x%02X (%s)\n",rx_packet->rxType,rx_packet->rxType==0x4?"Event":"Unknown");
|
||||
|
||||
if(rx_packet->rxType!=0x4)
|
||||
{
|
||||
printf(" Type unknown, rxType:0x%02X, pkt_index:%d\n",rx_packet->rxType,pkt_index);
|
||||
}
|
||||
|
||||
printf("-EventCode : 0x%02X (%s)\n",rx_packet->rxEventCode,rx_packet->rxEventCode==0xff?"HCI_LE_ExtEvent":"Unknown");
|
||||
if(rx_packet->rxEventCode!=0xff)
|
||||
{
|
||||
printf(" EventCode unknown, rxEventCode:0x%02X, pkt_index:%d\n",rx_packet->rxEventCode,pkt_index);
|
||||
}
|
||||
|
||||
printf("-Data Length : 0x%02X (%d) bytes(s)\n",rx_packet->rxDataLen,rx_packet->rxDataLen);
|
||||
#endif
|
||||
temp_event = (rx_packet->Event[1]<<8)+rx_packet->Event[0] ;
|
||||
#ifdef DEBUG
|
||||
printf(" Event : 0x%02X%02X (%d) ",rx_packet->Event[1],rx_packet->Event[0],temp_event);
|
||||
if(temp_event==0x067F)
|
||||
{
|
||||
printf("(GAP_HCI_ExtentionCommandStatus)\n");
|
||||
}
|
||||
else if(temp_event==0x0600)
|
||||
{
|
||||
printf("(GAP_DeviceInitDone)\n");
|
||||
}
|
||||
else if(temp_event==0x0613)
|
||||
{
|
||||
printf("(GAP_AdvertiserScannerEvent)\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" Event unknown, Event:0x%04X, pkt_index:%d\n",temp_event,pkt_index);
|
||||
}
|
||||
|
||||
printf(" Status : 0x%02X (%d) (%s)\n",rx_packet->Status,rx_packet->Status,rx_packet->Status==0?"SUCCESS":"FAIL");
|
||||
#endif
|
||||
|
||||
if(temp_event==0x0613)
|
||||
{
|
||||
event_scn_evnt_rep = (struct event_scn_evnt_rep_h *)(&(rx_packet->Status) + 1);
|
||||
temp_EventId = (event_scn_evnt_rep->EventId[3]<<24) + (event_scn_evnt_rep->EventId[2]<<16) +
|
||||
(event_scn_evnt_rep->EventId[1]<<8) + (event_scn_evnt_rep->EventId[0]) ;
|
||||
#ifdef DEBUG
|
||||
printf(" EventId : 0x%02X%02X%02X%02X (%d) ", event_scn_evnt_rep->EventId[3],
|
||||
event_scn_evnt_rep->EventId[2],
|
||||
event_scn_evnt_rep->EventId[1],
|
||||
event_scn_evnt_rep->EventId[0],temp_EventId);
|
||||
|
||||
if(temp_EventId==0x00010000)
|
||||
{
|
||||
printf("(GAP_EVT_SCAN_ENABLED)\n");
|
||||
}
|
||||
else if(temp_EventId==0x00020000)
|
||||
{
|
||||
printf("(GAP_EVT_SCAN_DISABLED)\n");
|
||||
}
|
||||
else if(temp_EventId==0x00400000)
|
||||
{
|
||||
printf("(GAP_EVT_ADV_REPORT)\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" EventId unknown, EventId:0x%08X, pkt_index:%d\n",temp_EventId,pkt_index);
|
||||
}
|
||||
#endif
|
||||
if(temp_EventId==0x00400000)
|
||||
{
|
||||
sprintf(szAddress,"%02X:%02X:%02X:%02X:%02X:%02X", event_scn_evnt_rep->Address[5],
|
||||
event_scn_evnt_rep->Address[4],
|
||||
event_scn_evnt_rep->Address[3],
|
||||
event_scn_evnt_rep->Address[2],
|
||||
event_scn_evnt_rep->Address[1],
|
||||
event_scn_evnt_rep->Address[0]);
|
||||
#ifdef DEBUG
|
||||
printf("%04d", total_device_count);
|
||||
printf(" Address : %s", szAddress);
|
||||
printf(" RSSI : 0x%02X (%d)(%d)",event_scn_evnt_rep->RSSI,event_scn_evnt_rep->RSSI,event_scn_evnt_rep->RSSI-256);
|
||||
#else
|
||||
printf(" Address: %s RSSI: %d", szAddress, event_scn_evnt_rep->RSSI-256);
|
||||
#endif
|
||||
printf("\n");
|
||||
total_device_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pkt_size = 3+rx_packet->rxDataLen;
|
||||
|
||||
#ifdef DEBUG
|
||||
pkt_ptr = (unsigned char *)rx_packet;
|
||||
printf(" <Info > Dump(Rx):");
|
||||
for(dump_i=0; dump_i < pkt_size; dump_i++)
|
||||
{
|
||||
if (dump_i%16==0)
|
||||
{
|
||||
printf("\n");
|
||||
printf("%04x:",dump_i);
|
||||
}
|
||||
printf("%02X ",pkt_ptr[dump_i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
pkt_index+=pkt_size;
|
||||
#ifdef DEBUG
|
||||
printf(" pkt_size:%d, pkt_index:%d\n",pkt_size,pkt_index);
|
||||
#endif
|
||||
rx_packet = (struct rx_packet_h *)(&(rx_packet->rxDataLen) + rx_packet->rxDataLen + 1);
|
||||
|
||||
}
|
||||
printf("Total: %d Device found.\n",total_device_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
879
feeds/bluetooth-cc2652/ble_scan/src/rs232.c
Executable file
879
feeds/bluetooth-cc2652/ble_scan/src/rs232.c
Executable file
@@ -0,0 +1,879 @@
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* Author: Teunis van Beelen
|
||||
*
|
||||
* Copyright (C) 2005 - 2021 Teunis van Beelen
|
||||
*
|
||||
* Email: teuniz@protonmail.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 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Last revision: February 9, 2021 */
|
||||
/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
|
||||
|
||||
|
||||
#include "rs232.h"
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
|
||||
|
||||
#define RS232_PORTNR 40
|
||||
|
||||
|
||||
int Cport[RS232_PORTNR],
|
||||
error;
|
||||
|
||||
struct termios new_port_settings,
|
||||
old_port_settings[RS232_PORTNR];
|
||||
|
||||
const char *comports[RS232_PORTNR]={"/dev/ttyS0","/dev/ttyS1","/dev/ttyS2","/dev/ttyS3","/dev/ttyS4","/dev/ttyS5",
|
||||
"/dev/ttyS6","/dev/ttyS7","/dev/ttyS8","/dev/ttyS9","/dev/ttyS10","/dev/ttyS11",
|
||||
"/dev/ttyS12","/dev/ttyS13","/dev/ttyS14","/dev/ttyS15","/dev/ttyUSB0",
|
||||
"/dev/ttyUSB1","/dev/ttyUSB2","/dev/ttyUSB3","/dev/ttyUSB4","/dev/ttyUSB5",
|
||||
"/dev/ttyAMA0","/dev/ttyAMA1","/dev/ttyACM0","/dev/ttyACM1",
|
||||
"/dev/rfcomm0","/dev/rfcomm1","/dev/ircomm0","/dev/ircomm1",
|
||||
"/dev/cuau0","/dev/cuau1","/dev/cuau2","/dev/cuau3",
|
||||
"/dev/cuaU0","/dev/cuaU1","/dev/cuaU2","/dev/cuaU3",
|
||||
"/dev/ttyMSM0","/dev/ttyMSM1"};
|
||||
int RS232_OpenComport(int comport_number, int baudrate, const char *mode, int flowctrl)
|
||||
{
|
||||
int baudr,
|
||||
status;
|
||||
|
||||
if((comport_number>=RS232_PORTNR)||(comport_number<0))
|
||||
{
|
||||
printf("illegal comport number\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(baudrate)
|
||||
{
|
||||
case 50 : baudr = B50;
|
||||
break;
|
||||
case 75 : baudr = B75;
|
||||
break;
|
||||
case 110 : baudr = B110;
|
||||
break;
|
||||
case 134 : baudr = B134;
|
||||
break;
|
||||
case 150 : baudr = B150;
|
||||
break;
|
||||
case 200 : baudr = B200;
|
||||
break;
|
||||
case 300 : baudr = B300;
|
||||
break;
|
||||
case 600 : baudr = B600;
|
||||
break;
|
||||
case 1200 : baudr = B1200;
|
||||
break;
|
||||
case 1800 : baudr = B1800;
|
||||
break;
|
||||
case 2400 : baudr = B2400;
|
||||
break;
|
||||
case 4800 : baudr = B4800;
|
||||
break;
|
||||
case 9600 : baudr = B9600;
|
||||
break;
|
||||
case 19200 : baudr = B19200;
|
||||
break;
|
||||
case 38400 : baudr = B38400;
|
||||
break;
|
||||
case 57600 : baudr = B57600;
|
||||
break;
|
||||
case 115200 : baudr = B115200;
|
||||
break;
|
||||
case 230400 : baudr = B230400;
|
||||
break;
|
||||
case 460800 : baudr = B460800;
|
||||
break;
|
||||
#if defined(__linux__)
|
||||
case 500000 : baudr = B500000;
|
||||
break;
|
||||
case 576000 : baudr = B576000;
|
||||
break;
|
||||
case 921600 : baudr = B921600;
|
||||
break;
|
||||
case 1000000 : baudr = B1000000;
|
||||
break;
|
||||
case 1152000 : baudr = B1152000;
|
||||
break;
|
||||
case 1500000 : baudr = B1500000;
|
||||
break;
|
||||
case 2000000 : baudr = B2000000;
|
||||
break;
|
||||
case 2500000 : baudr = B2500000;
|
||||
break;
|
||||
case 3000000 : baudr = B3000000;
|
||||
break;
|
||||
case 3500000 : baudr = B3500000;
|
||||
break;
|
||||
case 4000000 : baudr = B4000000;
|
||||
break;
|
||||
#endif
|
||||
default : printf("invalid baudrate\n");
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
int cbits=CS8,
|
||||
cpar=0,
|
||||
ipar=IGNPAR,
|
||||
bstop=0;
|
||||
|
||||
if(strlen(mode) != 3)
|
||||
{
|
||||
printf("invalid mode \"%s\"\n", mode);
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(mode[0])
|
||||
{
|
||||
case '8': cbits = CS8;
|
||||
break;
|
||||
case '7': cbits = CS7;
|
||||
break;
|
||||
case '6': cbits = CS6;
|
||||
break;
|
||||
case '5': cbits = CS5;
|
||||
break;
|
||||
default : printf("invalid number of data-bits '%c'\n", mode[0]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[1])
|
||||
{
|
||||
case 'N':
|
||||
case 'n': cpar = 0;
|
||||
ipar = IGNPAR;
|
||||
break;
|
||||
case 'E':
|
||||
case 'e': cpar = PARENB;
|
||||
ipar = INPCK;
|
||||
break;
|
||||
case 'O':
|
||||
case 'o': cpar = (PARENB | PARODD);
|
||||
ipar = INPCK;
|
||||
break;
|
||||
default : printf("invalid parity '%c'\n", mode[1]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[2])
|
||||
{
|
||||
case '1': bstop = 0;
|
||||
break;
|
||||
case '2': bstop = CSTOPB;
|
||||
break;
|
||||
default : printf("invalid number of stop bits '%c'\n", mode[2]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
http://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html
|
||||
|
||||
http://man7.org/linux/man-pages/man3/termios.3.html
|
||||
*/
|
||||
|
||||
Cport[comport_number] = open(comports[comport_number], O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
if(Cport[comport_number]==-1)
|
||||
{
|
||||
perror("unable to open comport ");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* lock access so that another process can't also use the port */
|
||||
if(flock(Cport[comport_number], LOCK_EX | LOCK_NB) != 0)
|
||||
{
|
||||
close(Cport[comport_number]);
|
||||
perror("Another process has locked the comport.");
|
||||
return(1);
|
||||
}
|
||||
|
||||
error = tcgetattr(Cport[comport_number], old_port_settings + comport_number);
|
||||
if(error==-1)
|
||||
{
|
||||
close(Cport[comport_number]);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to read portsettings ");
|
||||
return(1);
|
||||
}
|
||||
memset(&new_port_settings, 0, sizeof(new_port_settings)); /* clear the new struct */
|
||||
|
||||
new_port_settings.c_cflag = cbits | cpar | bstop | CLOCAL | CREAD;
|
||||
if(flowctrl)
|
||||
{
|
||||
new_port_settings.c_cflag |= CRTSCTS;
|
||||
}
|
||||
new_port_settings.c_iflag = ipar;
|
||||
new_port_settings.c_oflag = 0;
|
||||
new_port_settings.c_lflag = 0;
|
||||
new_port_settings.c_cc[VMIN] = 0; /* block untill n bytes are received */
|
||||
new_port_settings.c_cc[VTIME] = 0; /* block untill a timer expires (n * 100 mSec.) */
|
||||
|
||||
cfsetispeed(&new_port_settings, baudr);
|
||||
cfsetospeed(&new_port_settings, baudr);
|
||||
|
||||
error = tcsetattr(Cport[comport_number], TCSANOW, &new_port_settings);
|
||||
if(error==-1)
|
||||
{
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
close(Cport[comport_number]);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to adjust portsettings ");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* http://man7.org/linux/man-pages/man4/tty_ioctl.4.html */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to get portstatus");
|
||||
return(1);
|
||||
}
|
||||
|
||||
status |= TIOCM_DTR; /* turn on DTR */
|
||||
status |= TIOCM_RTS; /* turn on RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to set portstatus");
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_PollComport(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n;
|
||||
|
||||
n = read(Cport[comport_number], buf, size);
|
||||
|
||||
if(n < 0)
|
||||
{
|
||||
if(errno == EAGAIN) return 0;
|
||||
}
|
||||
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendByte(int comport_number, unsigned char byte)
|
||||
{
|
||||
int n = write(Cport[comport_number], &byte, 1);
|
||||
if(n < 0)
|
||||
{
|
||||
if(errno == EAGAIN)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendBuf(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n = write(Cport[comport_number], buf, size);
|
||||
if(n < 0)
|
||||
{
|
||||
if(errno == EAGAIN)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
void RS232_CloseComport(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status &= ~TIOCM_DTR; /* turn off DTR */
|
||||
status &= ~TIOCM_RTS; /* turn off RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
close(Cport[comport_number]);
|
||||
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
}
|
||||
|
||||
/*
|
||||
Constant Description
|
||||
TIOCM_LE DSR (data set ready/line enable)
|
||||
TIOCM_DTR DTR (data terminal ready)
|
||||
TIOCM_RTS RTS (request to send)
|
||||
TIOCM_ST Secondary TXD (transmit)
|
||||
TIOCM_SR Secondary RXD (receive)
|
||||
TIOCM_CTS CTS (clear to send)
|
||||
TIOCM_CAR DCD (data carrier detect)
|
||||
TIOCM_CD see TIOCM_CAR
|
||||
TIOCM_RNG RNG (ring)
|
||||
TIOCM_RI see TIOCM_RNG
|
||||
TIOCM_DSR DSR (data set ready)
|
||||
|
||||
http://man7.org/linux/man-pages/man4/tty_ioctl.4.html
|
||||
*/
|
||||
|
||||
int RS232_IsDCDEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_CAR) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsRINGEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_RNG) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsCTSEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_CTS) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsDSREnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_DSR) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableDTR(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status |= TIOCM_DTR; /* turn on DTR */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableDTR(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status &= ~TIOCM_DTR; /* turn off DTR */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableRTS(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status |= TIOCM_RTS; /* turn on RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableRTS(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status &= ~TIOCM_RTS; /* turn off RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushRX(int comport_number)
|
||||
{
|
||||
tcflush(Cport[comport_number], TCIFLUSH);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushTX(int comport_number)
|
||||
{
|
||||
tcflush(Cport[comport_number], TCOFLUSH);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushRXTX(int comport_number)
|
||||
{
|
||||
tcflush(Cport[comport_number], TCIOFLUSH);
|
||||
}
|
||||
|
||||
|
||||
#else /* windows */
|
||||
|
||||
#define RS232_PORTNR 32
|
||||
|
||||
HANDLE Cport[RS232_PORTNR];
|
||||
|
||||
|
||||
const char *comports[RS232_PORTNR]={"\\\\.\\COM1", "\\\\.\\COM2", "\\\\.\\COM3", "\\\\.\\COM4",
|
||||
"\\\\.\\COM5", "\\\\.\\COM6", "\\\\.\\COM7", "\\\\.\\COM8",
|
||||
"\\\\.\\COM9", "\\\\.\\COM10", "\\\\.\\COM11", "\\\\.\\COM12",
|
||||
"\\\\.\\COM13", "\\\\.\\COM14", "\\\\.\\COM15", "\\\\.\\COM16",
|
||||
"\\\\.\\COM17", "\\\\.\\COM18", "\\\\.\\COM19", "\\\\.\\COM20",
|
||||
"\\\\.\\COM21", "\\\\.\\COM22", "\\\\.\\COM23", "\\\\.\\COM24",
|
||||
"\\\\.\\COM25", "\\\\.\\COM26", "\\\\.\\COM27", "\\\\.\\COM28",
|
||||
"\\\\.\\COM29", "\\\\.\\COM30", "\\\\.\\COM31", "\\\\.\\COM32"};
|
||||
|
||||
char mode_str[128];
|
||||
|
||||
|
||||
int RS232_OpenComport(int comport_number, int baudrate, const char *mode, int flowctrl)
|
||||
{
|
||||
if((comport_number>=RS232_PORTNR)||(comport_number<0))
|
||||
{
|
||||
printf("illegal comport number\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(baudrate)
|
||||
{
|
||||
case 110 : strcpy(mode_str, "baud=110");
|
||||
break;
|
||||
case 300 : strcpy(mode_str, "baud=300");
|
||||
break;
|
||||
case 600 : strcpy(mode_str, "baud=600");
|
||||
break;
|
||||
case 1200 : strcpy(mode_str, "baud=1200");
|
||||
break;
|
||||
case 2400 : strcpy(mode_str, "baud=2400");
|
||||
break;
|
||||
case 4800 : strcpy(mode_str, "baud=4800");
|
||||
break;
|
||||
case 9600 : strcpy(mode_str, "baud=9600");
|
||||
break;
|
||||
case 19200 : strcpy(mode_str, "baud=19200");
|
||||
break;
|
||||
case 38400 : strcpy(mode_str, "baud=38400");
|
||||
break;
|
||||
case 57600 : strcpy(mode_str, "baud=57600");
|
||||
break;
|
||||
case 115200 : strcpy(mode_str, "baud=115200");
|
||||
break;
|
||||
case 128000 : strcpy(mode_str, "baud=128000");
|
||||
break;
|
||||
case 256000 : strcpy(mode_str, "baud=256000");
|
||||
break;
|
||||
case 500000 : strcpy(mode_str, "baud=500000");
|
||||
break;
|
||||
case 921600 : strcpy(mode_str, "baud=921600");
|
||||
break;
|
||||
case 1000000 : strcpy(mode_str, "baud=1000000");
|
||||
break;
|
||||
case 1500000 : strcpy(mode_str, "baud=1500000");
|
||||
break;
|
||||
case 2000000 : strcpy(mode_str, "baud=2000000");
|
||||
break;
|
||||
case 3000000 : strcpy(mode_str, "baud=3000000");
|
||||
break;
|
||||
default : printf("invalid baudrate\n");
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
if(strlen(mode) != 3)
|
||||
{
|
||||
printf("invalid mode \"%s\"\n", mode);
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(mode[0])
|
||||
{
|
||||
case '8': strcat(mode_str, " data=8");
|
||||
break;
|
||||
case '7': strcat(mode_str, " data=7");
|
||||
break;
|
||||
case '6': strcat(mode_str, " data=6");
|
||||
break;
|
||||
case '5': strcat(mode_str, " data=5");
|
||||
break;
|
||||
default : printf("invalid number of data-bits '%c'\n", mode[0]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[1])
|
||||
{
|
||||
case 'N':
|
||||
case 'n': strcat(mode_str, " parity=n");
|
||||
break;
|
||||
case 'E':
|
||||
case 'e': strcat(mode_str, " parity=e");
|
||||
break;
|
||||
case 'O':
|
||||
case 'o': strcat(mode_str, " parity=o");
|
||||
break;
|
||||
default : printf("invalid parity '%c'\n", mode[1]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[2])
|
||||
{
|
||||
case '1': strcat(mode_str, " stop=1");
|
||||
break;
|
||||
case '2': strcat(mode_str, " stop=2");
|
||||
break;
|
||||
default : printf("invalid number of stop bits '%c'\n", mode[2]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
if(flowctrl)
|
||||
{
|
||||
strcat(mode_str, " xon=off to=off odsr=off dtr=on rts=off");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(mode_str, " xon=off to=off odsr=off dtr=on rts=on");
|
||||
}
|
||||
|
||||
/*
|
||||
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363145%28v=vs.85%29.aspx
|
||||
|
||||
http://technet.microsoft.com/en-us/library/cc732236.aspx
|
||||
|
||||
https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_dcb
|
||||
*/
|
||||
|
||||
Cport[comport_number] = CreateFileA(comports[comport_number],
|
||||
GENERIC_READ|GENERIC_WRITE,
|
||||
0, /* no share */
|
||||
NULL, /* no security */
|
||||
OPEN_EXISTING,
|
||||
0, /* no threads */
|
||||
NULL); /* no templates */
|
||||
|
||||
if(Cport[comport_number]==INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printf("unable to open comport\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
DCB port_settings;
|
||||
memset(&port_settings, 0, sizeof(port_settings)); /* clear the new struct */
|
||||
port_settings.DCBlength = sizeof(port_settings);
|
||||
|
||||
if(!BuildCommDCBA(mode_str, &port_settings))
|
||||
{
|
||||
printf("unable to set comport dcb settings\n");
|
||||
CloseHandle(Cport[comport_number]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
if(flowctrl)
|
||||
{
|
||||
port_settings.fOutxCtsFlow = TRUE;
|
||||
port_settings.fRtsControl = RTS_CONTROL_HANDSHAKE;
|
||||
}
|
||||
|
||||
if(!SetCommState(Cport[comport_number], &port_settings))
|
||||
{
|
||||
printf("unable to set comport cfg settings\n");
|
||||
CloseHandle(Cport[comport_number]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
COMMTIMEOUTS Cptimeouts;
|
||||
|
||||
Cptimeouts.ReadIntervalTimeout = MAXDWORD;
|
||||
Cptimeouts.ReadTotalTimeoutMultiplier = 0;
|
||||
Cptimeouts.ReadTotalTimeoutConstant = 0;
|
||||
Cptimeouts.WriteTotalTimeoutMultiplier = 0;
|
||||
Cptimeouts.WriteTotalTimeoutConstant = 0;
|
||||
|
||||
if(!SetCommTimeouts(Cport[comport_number], &Cptimeouts))
|
||||
{
|
||||
printf("unable to set comport time-out settings\n");
|
||||
CloseHandle(Cport[comport_number]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_PollComport(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n;
|
||||
|
||||
/* added the void pointer cast, otherwise gcc will complain about */
|
||||
/* "warning: dereferencing type-punned pointer will break strict aliasing rules" */
|
||||
|
||||
if(!ReadFile(Cport[comport_number], buf, size, (LPDWORD)((void *)&n), NULL))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendByte(int comport_number, unsigned char byte)
|
||||
{
|
||||
int n;
|
||||
|
||||
if(!WriteFile(Cport[comport_number], &byte, 1, (LPDWORD)((void *)&n), NULL))
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
|
||||
if(n<0) return(1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendBuf(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n;
|
||||
|
||||
if(WriteFile(Cport[comport_number], buf, size, (LPDWORD)((void *)&n), NULL))
|
||||
{
|
||||
return(n);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
void RS232_CloseComport(int comport_number)
|
||||
{
|
||||
CloseHandle(Cport[comport_number]);
|
||||
}
|
||||
|
||||
/*
|
||||
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363258%28v=vs.85%29.aspx
|
||||
*/
|
||||
|
||||
int RS232_IsDCDEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_RLSD_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsRINGEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_RING_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsCTSEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_CTS_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsDSREnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_DSR_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableDTR(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], SETDTR);
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableDTR(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], CLRDTR);
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableRTS(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], SETRTS);
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableRTS(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], CLRRTS);
|
||||
}
|
||||
|
||||
/*
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363428%28v=vs.85%29.aspx
|
||||
*/
|
||||
|
||||
void RS232_flushRX(int comport_number)
|
||||
{
|
||||
PurgeComm(Cport[comport_number], PURGE_RXCLEAR | PURGE_RXABORT);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushTX(int comport_number)
|
||||
{
|
||||
PurgeComm(Cport[comport_number], PURGE_TXCLEAR | PURGE_TXABORT);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushRXTX(int comport_number)
|
||||
{
|
||||
PurgeComm(Cport[comport_number], PURGE_RXCLEAR | PURGE_RXABORT);
|
||||
PurgeComm(Cport[comport_number], PURGE_TXCLEAR | PURGE_TXABORT);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void RS232_cputs(int comport_number, const char *text) /* sends a string to serial port */
|
||||
{
|
||||
while(*text != 0) RS232_SendByte(comport_number, *(text++));
|
||||
}
|
||||
|
||||
|
||||
/* return index in comports matching to device name or -1 if not found */
|
||||
int RS232_GetPortnr(const char *devname)
|
||||
{
|
||||
int i;
|
||||
|
||||
char str[32];
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
|
||||
strcpy(str, "/dev/");
|
||||
#else /* windows */
|
||||
strcpy(str, "\\\\.\\");
|
||||
#endif
|
||||
strncat(str, devname, 16);
|
||||
str[31] = 0;
|
||||
|
||||
for(i=0; i<RS232_PORTNR; i++)
|
||||
{
|
||||
if(!strcmp(comports[i], str))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1; /* device not found */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
85
feeds/bluetooth-cc2652/ble_scan/src/rs232.h
Executable file
85
feeds/bluetooth-cc2652/ble_scan/src/rs232.h
Executable file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* Author: Teunis van Beelen
|
||||
*
|
||||
* Copyright (C) 2005 - 2021 Teunis van Beelen
|
||||
*
|
||||
* Email: teuniz@protonmail.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 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
|
||||
|
||||
|
||||
#ifndef rs232_INCLUDED
|
||||
#define rs232_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
#include <sys/file.h>
|
||||
#include <errno.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#endif
|
||||
|
||||
int RS232_OpenComport(int, int, const char *, int);
|
||||
int RS232_PollComport(int, unsigned char *, int);
|
||||
int RS232_SendByte(int, unsigned char);
|
||||
int RS232_SendBuf(int, unsigned char *, int);
|
||||
void RS232_CloseComport(int);
|
||||
void RS232_cputs(int, const char *);
|
||||
int RS232_IsDCDEnabled(int);
|
||||
int RS232_IsRINGEnabled(int);
|
||||
int RS232_IsCTSEnabled(int);
|
||||
int RS232_IsDSREnabled(int);
|
||||
void RS232_enableDTR(int);
|
||||
void RS232_disableDTR(int);
|
||||
void RS232_enableRTS(int);
|
||||
void RS232_disableRTS(int);
|
||||
void RS232_flushRX(int);
|
||||
void RS232_flushTX(int);
|
||||
void RS232_flushRXTX(int);
|
||||
int RS232_GetPortnr(const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,21 +25,12 @@ define Build/Prepare
|
||||
endef
|
||||
|
||||
define Package/cc2652/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/tisbl.init $(1)/etc/init.d/tisbl
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/tifirmware
|
||||
$(INSTALL_BIN) ./files/firmware/* $(1)/etc/tifirmware/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/cc2562
|
||||
$(INSTALL_BIN) ./files/firmware/* $(1)/lib/firmware/cc2562
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tisbl $(1)/usr/bin/
|
||||
$(INSTALL_BIN) ./files/*.sh $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/tisbl.config $(1)/etc/config/tisbl
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/tisbl.defaults $(1)/etc/uci-defaults
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,cc2652))
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
--[[
|
||||
ByteCnt: 1 1 1 2 1 4
|
||||
---- --------- ---------- ----- ------ -------
|
||||
FieldName:Type EventCode DataLength Event Status EventId
|
||||
--]]
|
||||
|
||||
--Type
|
||||
Command = 0x01
|
||||
Event = 0x04
|
||||
|
||||
--OpCode
|
||||
GapScan_enable = 0xFE51
|
||||
|
||||
--EventCode
|
||||
HCI_LE_ExtEvent = 0xff
|
||||
|
||||
--Status
|
||||
SUCCESS = 0x00
|
||||
|
||||
--Event
|
||||
GAP_HCI_ExtentionCommandStatus = 0x067F
|
||||
GAP_AdvertiserScannerEvent = 0x0613
|
||||
|
||||
--EventId
|
||||
GAP_EVT_ADV_REPORT = 0x00400000
|
||||
GAP_EVT_SCAN_ENABLED = 0x00010000
|
||||
|
||||
local write = io.write
|
||||
function print(...)
|
||||
local n = select("#",...)
|
||||
for i = 1,n do
|
||||
local v = tostring(select(i,...))
|
||||
write(v)
|
||||
if i~=n then write'\t' end
|
||||
end
|
||||
-- write'\n'
|
||||
end
|
||||
|
||||
function printf(str, ...)
|
||||
return print(str:format(...))
|
||||
end
|
||||
|
||||
function lshift(x, by)
|
||||
return x * 2 ^ by
|
||||
end
|
||||
|
||||
function GetUint8(Payload, position)
|
||||
return string.byte(Payload, position)
|
||||
end
|
||||
|
||||
function GetUint32(Payload, position)
|
||||
return (lshift(string.byte(Payload, position+3),24) + lshift(string.byte(Payload, position+2),16) + lshift(string.byte(Payload, position+1),8) + string.byte(Payload, position))
|
||||
end
|
||||
|
||||
function GetUint16(Payload, position)
|
||||
return (lshift(string.byte(Payload, position+1),8) + string.byte(Payload, position))
|
||||
end
|
||||
|
||||
function hexdump(Payload,separator)
|
||||
for i=1,Payload:len(), 1 do
|
||||
io.write(string.format("%02X", Payload:byte(i)))
|
||||
if (i< Payload:len()) then
|
||||
io.write(separator)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ibeacon_hdr=string.char(0x1A,0xFF,0x4C,0x00,0x02,0x15)
|
||||
|
||||
function DumpAdvertiserData(Payload)
|
||||
--[[
|
||||
Len(1byte)+Type(1byte)+Data(Len bytes)
|
||||
--]]
|
||||
while( Payload:len() > 0 ) do
|
||||
local Len = GetUint8(Payload,1)
|
||||
if (GetUint8(Payload,2) == 0xff) then -- manufacturer data
|
||||
print(" MFR=")
|
||||
hexdump(Payload:sub(1,Len+1),'')
|
||||
if (Payload:sub(1,6) == ibeacon_hdr) then
|
||||
print(" [ibeacon]")
|
||||
end
|
||||
end
|
||||
Payload = string.sub(Payload,Len+2,-1)
|
||||
end
|
||||
end
|
||||
|
||||
function DumpAdvertiserScannerEvent(Payload)
|
||||
local Status = GetUint8(Payload,3)
|
||||
local EventId = GetUint32(Payload,4)
|
||||
if((EventId==GAP_EVT_ADV_REPORT) and (Status==SUCCESS))
|
||||
then
|
||||
local MAC = string.sub(Payload,10,15)
|
||||
local TxPower = GetUint8(Payload,19)
|
||||
local RSSI = GetUint8(Payload,20)
|
||||
printf("MAC=%02X%02X%02X%02X%02X%02X RSI=%d PWR=%d",string.byte(MAC,6),string.byte(MAC,5),string.byte(MAC,4),
|
||||
string.byte(MAC,3),string.byte(MAC,2),string.byte(MAC,1),RSSI,TxPower)
|
||||
local DataLength = GetUint16(Payload,30)
|
||||
DumpAdvertiserData(string.sub(Payload,32,-1))
|
||||
print("\n")
|
||||
end
|
||||
end
|
||||
|
||||
function hci_event_paser()
|
||||
while true do
|
||||
local Header = io.read(3)
|
||||
if not Header then break end
|
||||
local EventType = GetUint8(Header,1)
|
||||
local EventCode = GetUint8(Header,2)
|
||||
local DataLength = GetUint8(Header,3)
|
||||
|
||||
local Data = io.read(DataLength)
|
||||
local Event = GetUint16(Data,1)
|
||||
-- print(EventType,EventCode,DataLength,Event)
|
||||
if not Data then break end
|
||||
if(Event==GAP_AdvertiserScannerEvent)
|
||||
then
|
||||
DumpAdvertiserScannerEvent(Data)
|
||||
-- hexdump(ibeacon_hdr)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hci_event_paser()
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
com-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x08\x00\x00\x00\x00\x00\x00\x00" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x02" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x03" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x04" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x05" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 3 "\x01\x51\xFE\x06\x00\x00\xF4\x01\x28\x00" | tee /tmp/blescan.data | ble-scan-rx-parser.sh
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /sys/class/gpio/ble_enable/value ]; then
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
fi
|
||||
echo 0 > /sys/class/gpio/ble_backdoor/value
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
echo 0 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_backdoor/value
|
||||
tisbl /dev/ttyMSM1 115200 2652 /lib/firmware/cc2562/simple_broadcaster_bd9.bin
|
||||
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-flash-scanner.sh
Normal file
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-flash-scanner.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /sys/class/gpio/ble_enable/value ]; then
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
fi
|
||||
echo 0 > /sys/class/gpio/ble_backdoor/value
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
echo 0 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_backdoor/value
|
||||
tisbl /dev/ttyMSM1 115200 2652 /lib/firmware/cc2562/ble5_host_test_bd9.bin
|
||||
10
feeds/bluetooth-cc2652/cc2652/files/cc2562-reset.sh
Normal file
10
feeds/bluetooth-cc2652/cc2652/files/cc2562-reset.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /sys/class/gpio/ble_enable/value ]; then
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
fi
|
||||
echo 1 > /sys/class/gpio/ble_backdoor/value
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
local block = 16
|
||||
while true do
|
||||
local bytes = io.read(block)
|
||||
if not bytes then break end
|
||||
for b in string.gfind(bytes, ".") do
|
||||
io.write(string.format("%02X ", string.byte(b)))
|
||||
end
|
||||
io.write(string.rep(" ", block - string.len(bytes) + 1))
|
||||
io.write(string.gsub(bytes, "%c", "."), "\n")
|
||||
end
|
||||
@@ -1,20 +1,28 @@
|
||||
#!/bin/sh
|
||||
# script---------------- UUID---------------------------------------------------------------------- MAJOR----- MINOR----- POWER-
|
||||
#example: ibeacon-broadcaster.sh "\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61" "\x01\x23" "\x45\x67" "\xC8"
|
||||
if [ "$#" -eq 4 ]; then
|
||||
UUID=$1
|
||||
MAJOR=$2
|
||||
MINOR=$3
|
||||
POWER=$4
|
||||
else
|
||||
UUID="\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61"
|
||||
MAJOR="\x01\x23"
|
||||
MINOR="\x45\x67"
|
||||
POWER="\xC8"
|
||||
fi
|
||||
function iBeconScan() {
|
||||
if [ "$#" -eq 4 ]; then
|
||||
UUID=$1
|
||||
MAJOR=$2
|
||||
MINOR=$3
|
||||
POWER=$4
|
||||
else
|
||||
UUID="\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61"
|
||||
MAJOR="\x01\x23"
|
||||
MINOR="\x45\x67"
|
||||
POWER="\xC8"
|
||||
fi
|
||||
|
||||
com-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x01\x00\x00\x00\x00\x00\x00\x00" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x3E\xFE\x15\x12\x00\xA0\x00\x00\xA0\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x7F\x01\x01\x00" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x09\x44\xFE\x23\x00\x00\x00\x1E\x00\x02\x01\x1A\x1A\xFF\x4C\x00\x02\x15${UUID}${MAJOR}${MINOR}${POWER}\x00" > /dev/null
|
||||
com-wr.sh /dev/ttyMSM1 1 "\x01\x3F\xFE\x04\x00\x00\x00\x00" | hexdump.sh
|
||||
cc2562-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x01\x00\x00\x00\x00\x00\x00\x00" > /dev/null
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x3E\xFE\x15\x12\x00\xA0\x00\x00\xA0\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x7F\x01\x01\x00" > /dev/null
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x09\x44\xFE\x23\x00\x00\x00\x1E\x00\x02\x01\x1A\x1A\xFF\x4C\x00\x02\x15${UUID}${MAJOR}${MINOR}${POWER}\x00" > /dev/null
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x3F\xFE\x04\x00\x00\x00\x00"
|
||||
}
|
||||
|
||||
cc2562-reset.sh
|
||||
|
||||
while true
|
||||
do
|
||||
iBeconScan
|
||||
sleep 1
|
||||
done
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
killall -9 ser2net
|
||||
tisbl.sh /dev/ttyMSM1 115200 2652 /etc/tifirmware/ble5_host_test_bd9.bin 79 34
|
||||
echo "7000:telnet:0:/dev/ttyMSM1:115200 8DATABITS NONE 1STOPBIT remctl" > /tmp/ser2net.conf
|
||||
ser2net -c /tmp/ser2net.conf
|
||||
@@ -1,7 +0,0 @@
|
||||
config tisbl 'tisbl'
|
||||
option firmware '/etc/tifirmware/ble5_host_test_bd9.bin'
|
||||
option tty '/dev/ttyMSM1'
|
||||
option tichip '2652'
|
||||
option baudrate '115200'
|
||||
option resetpin '79'
|
||||
option backdoorpin '34'
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case $board in
|
||||
edgecore,eap104)
|
||||
uci set tisbl.tisbl.backdoorpin=31
|
||||
uci set tisbl.tisbl.resetpin=35
|
||||
;;
|
||||
esac
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
#start after dbus (60)
|
||||
START=62
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
firmware="$(uci -q get tisbl.tisbl.firmware)"
|
||||
tty="$(uci -q get tisbl.tisbl.tty)"
|
||||
tichip="$(uci -q get tisbl.tisbl.tichip)"
|
||||
baudrate="$(uci -q get tisbl.tisbl.baudrate)"
|
||||
resetpin="$(uci -q get tisbl.tisbl.resetpin)"
|
||||
backdoorpin="$(uci -q get tisbl.tisbl.backdoorpin)"
|
||||
tisbl.sh $tty $baudrate $tichip $firmware $resetpin $backdoorpin
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "tisbl"
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
# tisbl.sh $tty $baudrate $tichip $firmware $resetpin $backdoorpin
|
||||
# tisbl.sh /dev/ttyMSM1 115200 2652 /etc/tifirmware/blinky_bd13.bin 79 67
|
||||
|
||||
#assumption: resetpin and backdoorpin are low active
|
||||
tty=$1
|
||||
baudrate=$2
|
||||
tichip=$3
|
||||
firmware=$4
|
||||
resetpin=$5
|
||||
backdoorpin=$6
|
||||
|
||||
ti_reset() #assumption:resetpin is low active
|
||||
{
|
||||
if [ ! -e /sys/class/gpio/gpio${resetpin} ]; then
|
||||
echo ${resetpin} > /sys/class/gpio/export
|
||||
fi
|
||||
echo out > /sys/class/gpio/gpio${resetpin}/direction
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio${resetpin}/value
|
||||
echo 0 > /sys/class/gpio/gpio${resetpin}/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/gpio${resetpin}/value
|
||||
}
|
||||
|
||||
ti_goto_bootloader() #assumption:backdoorpin is low active
|
||||
{
|
||||
if [ ! -e /sys/class/gpio/gpio${backdoorpin} ]; then
|
||||
echo ${backdoorpin} > /sys/class/gpio/export
|
||||
fi
|
||||
echo out > /sys/class/gpio/gpio${backdoorpin}/direction
|
||||
|
||||
echo 0 > /sys/class/gpio/gpio${backdoorpin}/value
|
||||
ti_reset
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/gpio${backdoorpin}/value
|
||||
}
|
||||
|
||||
if [ -e $firmware ]; then
|
||||
ti_goto_bootloader
|
||||
tisbl $tty $baudrate $tichip $firmware #try to upgrade firmware
|
||||
fi
|
||||
|
||||
29
feeds/edgecore/eltt2/Makefile
Normal file
29
feeds/edgecore/eltt2/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=eltt2
|
||||
PKG_VERSION:=1.0
|
||||
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/eltt2
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=eltt2
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/eltt2/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/eltt2 $(1)/bin/
|
||||
endef
|
||||
|
||||
define Package/eltt2/extra_provides
|
||||
echo "libc.so.6";
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,eltt2))
|
||||
27
feeds/edgecore/eltt2/src/License.txt
Normal file
27
feeds/edgecore/eltt2/src/License.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2014, Infineon Technologies AG
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
15
feeds/edgecore/eltt2/src/Makefile
Normal file
15
feeds/edgecore/eltt2/src/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
# Makefile for Embedded Linux TPM Toolbox 2 (ELTT2)
|
||||
# Copyright (c) Infineon Technologies AG
|
||||
|
||||
#CROSS-COMPILE:=../../../../../qsdk/staging_dir/toolchain-arm/bin/arm-openwrt-linux-
|
||||
#CC:=$(CROSS-COMPILE)gcc
|
||||
CC = gcc
|
||||
CFLAGS=-Wall -Wextra -std=c99 -g
|
||||
|
||||
all: eltt2
|
||||
|
||||
eltt2: eltt2.c eltt2.h
|
||||
$(CC) $(CFLAGS) eltt2.c -o eltt2
|
||||
|
||||
clean:
|
||||
rm -rf eltt2
|
||||
230
feeds/edgecore/eltt2/src/README.md
Normal file
230
feeds/edgecore/eltt2/src/README.md
Normal file
@@ -0,0 +1,230 @@
|
||||
# ELTT2 - Infineon Embedded Linux TPM Toolbox 2 for TPM 2.0
|
||||
|
||||
|
||||
All information in this document is Copyright (c) 2014-2022, Infineon Technologies AG <br>
|
||||
All rights reserved.
|
||||
|
||||
|
||||
# 1. Welcome
|
||||
|
||||
Welcome to Embedded Linux TPM Toolbox 2 (ELTT2). ELTT2 is a single-file executable program intended for testing, performing diagnosis and basic state changes of the Infineon Technologies TPM 2.0.
|
||||
|
||||
|
||||
## 1.1 Prerequisites
|
||||
|
||||
To build and run ELTT2 you need GCC and a Linux system capable of hosting a TPM.
|
||||
|
||||
ELTT2 may run on many other little-endian hardware and software configurations capable of running Linux and hosting a TPM, but this has not been tested.
|
||||
|
||||
ELTT2 does not support machines with a big-endian CPU.
|
||||
|
||||
## 1.2 Getting Started
|
||||
|
||||
A TPM 2.0 evaluation board can be ordered in the [Hitex Webshop](https://www.ehitex.de/evaluation-boards/infineon/2564/iridium-9670-tpm2.0-spi).
|
||||
|
||||
|
||||
<p align="center">
|
||||
<img src="https://cloud.githubusercontent.com/assets/19730245/25651091/77a84744-2fe1-11e7-91bd-a2e39678202d.JPG" width="350"/>
|
||||
</p>
|
||||
|
||||
In order to execute ELTT2, you need to compile it first:
|
||||
1. Switch to the directory with the ELTT2 source code
|
||||
2. Compile the source code by typing the following command:
|
||||
make
|
||||
|
||||
Due to hardware (and thus TPM) access restrictions for normal users, ELTT2 requires root (aka superuser or administrator) privileges. They can be obtained e.g. by using the 'sudo' command on Debian Linux derivates.
|
||||
|
||||
The Infineon [TPM 2.0 Application Note](https://www.infineon.com/dgdl/Infineon-App-Note-SLx9670-TPM2.0_Embedded_RPi_DI_SLx-AN-v01_20-EN.pdf?fileId=5546d46267c74c9a01684b96e69f5d7b) shows how the TPM device driver can be set up (e.g. for Linux Kernel 4.14).
|
||||
|
||||
|
||||
|
||||
# 2. Usage of ELTT2
|
||||
|
||||
## 2.1 Generic Usage
|
||||
|
||||
ELTT2 is operated as follows:
|
||||
|
||||
Call: `./eltt2 <option(s)>`
|
||||
|
||||
For example: `./eltt2 -g` or `./eltt2 -gc`
|
||||
|
||||
For getting an overview of the possible commands, run `./eltt2 -h`
|
||||
|
||||
Some options require the TPM to be in a specific state. This state is shown in brackets ("[]") behind each command line option in the list below:
|
||||
|
||||
\[-\]: none <br>
|
||||
\[\*\]: the TPM platform hierarchy authorization value is not set (i.e., empty buffer) <br>
|
||||
\[l\]: the required PCR bank is allocated <br>
|
||||
\[u\]: started <br>
|
||||
|
||||
To get the TPM into the required state, call ELTT2 with the corresponding commands ("x" for a state means that whether this state is required or not depends on the actual command or the command parameters sent eventually to the TPM).
|
||||
|
||||
Command line option | Explanation | Precondition
|
||||
--- | --- | ---
|
||||
`-a [hash algorithm] <data bytes>` | Hash Sequence SHA-1/256/384 \[default: SHA-1\] | \[u\]
|
||||
`-A <data bytes>` | Hash Sequence SHA-256 | \[u\]
|
||||
`-b <command bytes>` | Enter your own TPM command | \[u\]
|
||||
`-c` | Read Clock | \[u\]
|
||||
`-d <shutdown type>` | Shutdown | \[u\]
|
||||
`-e [hash algorithm] <PCR index> <PCR digest>` | PCR Extend SHA-1/256/384 \[default: SHA-1\] | \[u\], \[l\]
|
||||
`-E <PCR index> <PCR digest>` | PCR Extend SHA-256 | \[u\], \[l\]
|
||||
`-g` | Get fixed capability values | \[u\]
|
||||
`-v` | Get variable capability values | \[u\]
|
||||
`-G <data length>` | Get Random | \[u\]
|
||||
`-h` | Help | \[-\]
|
||||
`-l <hash algorithm>` | PCR Allocate SHA-1/256/384 | \[u\], \[\*\]
|
||||
`-r [hash algorithm] <PCR index>` | PCR Read SHA-1/256/384 \[default: SHA-1\] | \[u\], \[l\]
|
||||
`-R <PCR index>` | PCR Read SHA-256 | \[u\], \[l\]
|
||||
`-s [hash algorithm] <data bytes>` | Hash SHA-1/256/384 \[default: SHA-1\] | \[u\]
|
||||
`-S <data bytes>` | Hash SHA-256 | \[u\]
|
||||
`-t <test type>` | Self Test | \[u\]
|
||||
`-T` | Get Test Result | \[u\]
|
||||
`-u <startup type>` | Startup | \[-\]
|
||||
`-z <PCR index>` | PCR Reset | \[u\]
|
||||
|
||||
|
||||
Additional information:
|
||||
|
||||
`-a`: <br>
|
||||
With the "-a" command you can hash given data with the SHA-1/256/384 hash algorithm. This hash sequence sends 3 commands \[start, update, complete\] to the TPM and allows to hash an arbitrary amount of data. For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -a 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
or <br>
|
||||
`./eltt2 -a sha1 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
`./eltt2 -a sha256 41624364` Hash given data with SHA-256 hash algorithm. <br>
|
||||
`./eltt2 -a sha384 41624364` Hash given data with SHA-384 hash algorithm. <br>
|
||||
|
||||
`-A`: <br>
|
||||
With the "-A" command you can hash given data with the SHA-256 hash algorithm. This hash sequence sends 3 commands \[start, update, complete\] to the TPM and allows to hash an arbitrary amount of data. For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -A 41624364`
|
||||
|
||||
`-b`: <br>
|
||||
With the "-b" command you can enter your own TPM command bytes and read the TPM response. For example, use the following command to send a TPM2_Startup with startup type CLEAR to the TPM: <br>
|
||||
`./eltt2 -b 80010000000C000001440000`
|
||||
|
||||
`-c`: <br>
|
||||
With the "-c" command you can read the clock values of the TPM.
|
||||
|
||||
`-d`: <br>
|
||||
With the "-d" command you can issue a TPM shutdown. It has 2 options: <br>
|
||||
`./eltt2 -d` <br>
|
||||
or <br>
|
||||
`./eltt2 -d clear` send a TPM2_Shutdown command with shutdown type CLEAR to the TPM. <br>
|
||||
`./eltt2 -d state` send a TPM2_Shutdown command with shutdown type STATE to the TPM. <br>
|
||||
|
||||
`-e`: <br>
|
||||
With the "-e" command you can extend bytes in the selected PCR with SHA-1/256/384. To do so, you have to enter the index of PCR in hexadecimal that you like to extend and the digest you want to extend the selected PCR with. Note that you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest must have a length of 20/32/48 bytes (will be padded with 0 if necessary). The TPM then builds an SHA-1/256/384 hash over the PCR data in the selected PCR and the digest you provided and writes the result back to the selected PCR. For example, use the following command to extend PCR 23 (0x17) with the byte sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}: <br>
|
||||
`./eltt2 -e 17 41624364` Extend bytes in PCR 23 with SHA-1. <br>
|
||||
or <br>
|
||||
`./eltt2 -e sha1 17 41624364` Extend bytes in PCR 23 with SHA-1. <br>
|
||||
`./eltt2 -e sha256 17 41624364` Extend bytes in PCR 23 with SHA-256. <br>
|
||||
`./eltt2 -e sha384 17 41624364` Extend bytes in PCR 23 with SHA-384. <br>
|
||||
|
||||
`-E`: <br>
|
||||
With the "-E" command you can extend bytes in the selected PCR with SHA-256. To do so, you have to enter the index of PCR in hexadecimal that you like to extend and the digest you want to extend the selected PCR with. Note that you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest must have a length of 32 bytes (will be padded with 0 if necessary). The TPM then builds an SHA-256 hash over the PCR data in the selected PCR and the digest you provided and writes the result back to the selected PCR. For example, use the following command to extend PCR 23 (0x17) with the byte sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}: <br>
|
||||
`./eltt2 -E 17 41624364`
|
||||
|
||||
`-g`: <br>
|
||||
With the "-g" command you can read the TPM's fixed properties.
|
||||
|
||||
`-v`: <br>
|
||||
With the "-v" command you can read the TPM's variable properties.
|
||||
|
||||
`-G`: <br>
|
||||
With the "-G" command you can get a given amount of random bytes. Note that you can only request a maximum amount of 32 random bytes at once. For example, use the following command to get 20 (0x14) random bytes: <br>
|
||||
`./eltt2 -G 14`
|
||||
|
||||
`-l`: <br>
|
||||
With the "-l" command you can allocate the SHA-1/256/384 PCR bank. Take note of two things. Firstly, the command requires a platform authorization value and it is set to an empty buffer; hence the command cannot be used if the TPM platform authorization value is set (e.g., by UEFI). Secondly, when the command is executed successfully a TPM reset has to follow for it to take effect. For example, use the following command to allocate a PCR bank: <br>
|
||||
`./eltt2 -l sha1` Allocate SHA-1 PCR bank. <br>
|
||||
`./eltt2 -l sha256` Allocate SHA-256 PCR bank. <br>
|
||||
`./eltt2 -l sha384` Allocate SHA-384 PCR bank. <br>
|
||||
|
||||
`-r`: <br>
|
||||
With the "-r" command you can read data from a selected SHA-1/256/384 PCR. For example, use the following command to read data from PCR 23 (0x17): <br>
|
||||
`./eltt2 -r 17` Read data from SHA-1 PCR 23. <br>
|
||||
or <br>
|
||||
`./eltt2 -r sha1 17` Read data from SHA-1 PCR 23. <br>
|
||||
`./eltt2 -r sha256 17` Read data from SHA-256 PCR 23. <br>
|
||||
`./eltt2 -r sha384 17` Read data from SHA-384 PCR 23. <br>
|
||||
|
||||
`-R`: <br>
|
||||
With the "-R" command you can read data from a selected SHA-256 PCR. For example, use the following command to read data from PCR 23 (0x17): <br>
|
||||
`./eltt2 -R 17`
|
||||
|
||||
`-s`: <br>
|
||||
With the "-s" command you can hash given data with the SHA-1/256/384 hash algorithm. This command only allows a limited amount of data to be hashed (depending on the TPM's maximum input buffer size). For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -s 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
or <br>
|
||||
`./eltt2 -s sha1 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
`./eltt2 -s sha256 41624364` Hash given data with SHA-256 hash algorithm. <br>
|
||||
`./eltt2 -s sha384 41624364` Hash given data with SHA-384 hash algorithm. <br>
|
||||
|
||||
`-S`: <br>
|
||||
With the "-S" command you can hash given data with the SHA-256 hash algorithm. This command only allows a limited amount of data to be hashed (depending on the TPM input buffer size). For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -S 41624364`
|
||||
|
||||
`-t`: <br>
|
||||
With the "-t" command you can issue a TPM selftest. It has 3 options: <br>
|
||||
`./eltt2 -t` <br>
|
||||
or<br>
|
||||
`./eltt2 -t not_full` Perform a partial TPM2_Selftest to test previously untested TPM capabilities. <br>
|
||||
`./eltt2 -t full` Perform a full TPM2_Selftest to test all TPM capabilities. <br>
|
||||
`./eltt2 -t incremental` Perform a test of selected algorithms.
|
||||
|
||||
`-T`: <br>
|
||||
With the "-T" command you can read the results of a previously run selftest.
|
||||
|
||||
`-u`: <br>
|
||||
With the "-u" command you can issue a TPM startup command. It has 2 options: <br>
|
||||
`./eltt2 -u` <br>
|
||||
or <br>
|
||||
`./eltt2 -u clear` send a TPM2_Startup with startup type CLEAR to the TPM. <br>
|
||||
`./eltt2 -u state` send a TPM2_Startup with startup type STATE to the TPM.
|
||||
|
||||
`-z`: <br>
|
||||
With the "-z" command you can reset a selected PCR. Note that you can only reset PCRs 16 and 23. For example, use the following command to reset PCR 23 (0x17): <br>
|
||||
`./eltt2 -z 17`
|
||||
|
||||
## 2.2 Examples:
|
||||
|
||||
In order to work with the TPM, perform the following steps:
|
||||
- Send the TPM2_Startup command: `./eltt2 -u`
|
||||
|
||||
|
||||
# 3. If you have questions
|
||||
|
||||
If you have any questions or problems, please read the section "FAQ and
|
||||
Troubleshooting" in this document.
|
||||
In case you still have questions, contact your local Infineon
|
||||
Representative.
|
||||
Further information is available at <https://www.infineon.com/tpm>.
|
||||
|
||||
|
||||
# 4. FAQ and Troubleshooting
|
||||
|
||||
If you encounter any error, please make sure that
|
||||
- the TPM is properly connected.
|
||||
- the TPM driver is loaded, i.e. check that "/dev/tpm0" exists. In case of driver loading problems (e.g. shown by "Error opening device"), reboot your system and try to load the driver again.
|
||||
- ELTT2 has been started with root permissions. Please note that ELTT2 needs root permissions for all commands.
|
||||
- the TPM is started. (See section 2.2 in this document on how to do this.)
|
||||
|
||||
|
||||
The following list shows the most common errors and their solution:
|
||||
|
||||
The ELTT2 response is "Error opening the device.":
|
||||
- You need to load a TPM driver before you can work with ELTT2.
|
||||
- You need to start ELTT2 with root permissions.
|
||||
|
||||
The ELTT2 responds with error code 0x100.
|
||||
- You need to send the TPM2_Startup command, or you did send it twice. In
|
||||
case you have not sent it yet, do so with `./eltt2 -u`.
|
||||
|
||||
The TPM does not change any of the permanent flags shown by sending the "-g"
|
||||
command , e.g. after a force clear.
|
||||
- The TPM requires a reset in order to change any of the permanent flags.
|
||||
Press the reset button or disconnect the TPM to do so.
|
||||
|
||||
The value of a PCR does not change after sending PCR extend or reset.
|
||||
- With the application permissions you cannot modify every PCR. For more
|
||||
details, please refer to the description for the different PCR commands
|
||||
in this file.
|
||||
362
feeds/edgecore/eltt2/src/README.txt
Normal file
362
feeds/edgecore/eltt2/src/README.txt
Normal file
@@ -0,0 +1,362 @@
|
||||
--------------------------------------------------------------------------------
|
||||
Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0 v1.1
|
||||
Infineon Technologies AG
|
||||
|
||||
All information in this document is Copyright (c) 2014, Infineon Technologies AG
|
||||
All rights reserved.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Contents:
|
||||
|
||||
1. Welcome
|
||||
1.1 Prerequisites
|
||||
1.2 Contents of the package
|
||||
1.3 Getting Started
|
||||
|
||||
2. Usage of Embedded Linux TPM Toolbox 2 (ELTT2)
|
||||
2.1 Generic Usage
|
||||
2.2 Examples
|
||||
|
||||
3. If you have questions
|
||||
|
||||
4. Release Info
|
||||
|
||||
5. FAQ
|
||||
|
||||
================================================================================
|
||||
|
||||
|
||||
|
||||
1. Welcome
|
||||
|
||||
Welcome to Embedded Linux TPM Toolbox 2 (ELTT2).
|
||||
ELTT2 is a single-file executable program intended for testing, performing
|
||||
diagnosis and basic state changes of the Infineon Technologies TPM 2.0.
|
||||
|
||||
|
||||
1.1 Prerequisites
|
||||
|
||||
To build and run ELTT2 you need GCC and a Linux system capable of hosting a
|
||||
TPM 2.0.
|
||||
|
||||
Tested PC Platforms (x86):
|
||||
- Ubuntu (R) Linux 12.04 LTS - 64 bit (modified Kernel 3.15.4)
|
||||
with Infineon TPM 2.0 SLB9665 Firmware 5.22
|
||||
|
||||
Tested Embedded Platforms (ARM):
|
||||
- Android 6.0 "Marshmallow" - 64 bit (modified Kernel 3.18.0+) on HiKey
|
||||
with Prototype Infineon I2C TPM 2.0 for Embedded Platforms
|
||||
|
||||
ELTT2 may run on many other little-endian hardware and software
|
||||
configurations capable of running Linux and hosting a TPM 2.0, but this has
|
||||
not been tested.
|
||||
|
||||
ELTT2 does not support machines with a big-endian CPU.
|
||||
|
||||
|
||||
1.2 Contents of Package
|
||||
|
||||
ELTT2 consists of the following files:
|
||||
- eltt2.c
|
||||
Contains all method implementations of ELTT2.
|
||||
- eltt2.h
|
||||
Contains all constant definitions, method and command byte declarations
|
||||
for the operation of ELTT2.
|
||||
- License.txt
|
||||
Contains the license agreement for ELTT2.
|
||||
- Makefile
|
||||
Contains the command to compile ELTT2.
|
||||
- README.txt
|
||||
This file.
|
||||
|
||||
|
||||
1.3 Getting Started
|
||||
|
||||
In order to execute ELTT2, you need to compile it first:
|
||||
1. Switch to the directory with the ELTT2 source code
|
||||
2. Compile the source code by typing the following command:
|
||||
make
|
||||
|
||||
Due to hardware (and thus TPM) access restrictions for normal users, ELTT2
|
||||
requires root (aka superuser or administrator) privileges. They can be
|
||||
obtained e.g. by using the 'sudo' command on Debian Linux derivates.
|
||||
|
||||
|
||||
2. Usage of ELTT2
|
||||
|
||||
|
||||
2.1 Generic Usage
|
||||
|
||||
ELTT2 is operated as follows:
|
||||
|
||||
Call: ./eltt2 <option(s)>
|
||||
|
||||
For example: ./eltt2 -g or ./eltt2 -gc
|
||||
|
||||
For getting an overview of the possible commands, run ./eltt2 -h
|
||||
|
||||
Some options require the TPM to be in a specific state. This state is shown
|
||||
in brackets ("[]") behind each command line option in the list below:
|
||||
|
||||
[-]: none
|
||||
[*]: the TPM platform hierarchy authorization value is not set (i.e., empty buffer)
|
||||
[l]: the required PCR bank is allocated
|
||||
[u]: started
|
||||
|
||||
To get the TPM into the required state, call ELTT2 with the corresponding
|
||||
commands ("x" for a state means that whether this state is required or not
|
||||
depends on the actual command or the command parameters sent eventually to
|
||||
the TPM).
|
||||
|
||||
|
||||
Command line options: Preconditions:
|
||||
|
||||
-a [hash algorithm] <data bytes>: Hash Sequence SHA-1/256/384 [default: SHA-1] [u]
|
||||
|
||||
-A <data bytes>: Hash Sequence SHA-256 [u]
|
||||
|
||||
-b <command bytes>: Enter your own TPM command [u]
|
||||
|
||||
-c: Read Clock [u]
|
||||
|
||||
-d <shutdown type>: Shutdown [u]
|
||||
|
||||
-e [hash algorithm] <PCR index> <PCR digest>: PCR Extend SHA-1/256/384 [default: SHA-1] [u], [l]
|
||||
|
||||
-E <PCR index> <PCR digest>: PCR Extend SHA-256 [u], [l]
|
||||
|
||||
-g: Get fixed capability values [u]
|
||||
|
||||
-v: Get variable capability values [u]
|
||||
|
||||
-G <data length>: Get Random [u]
|
||||
|
||||
-h: Help [-]
|
||||
|
||||
-l <hash algorithm>: PCR Allocate SHA-1/256/384 [u], [*]
|
||||
|
||||
-r [hash algorithm] <PCR index>: PCR Read SHA-1/256/384 [default: SHA-1] [u], [l]
|
||||
|
||||
-R <PCR index>: PCR Read SHA-256 [u], [l]
|
||||
|
||||
-s [hash algorithm] <data bytes>: Hash SHA-1/SHA256 [default: SHA-1] [u]
|
||||
|
||||
-S <data bytes>: Hash SHA-256 [u]
|
||||
|
||||
-t <test type>: Self Test [u]
|
||||
|
||||
-T: Get Test Result [u]
|
||||
|
||||
-u <startup type>: Startup [-]
|
||||
|
||||
-z <PCR index>: PCR Reset [u]
|
||||
|
||||
|
||||
Additional information:
|
||||
|
||||
-a:
|
||||
With the "-a" command you can hash given data with the SHA-1/256/384 hash
|
||||
algorithm. This hash sequence sends 3 commands [start, update, complete]
|
||||
to the TPM and allows to hash an arbitrary amount of data.
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -a 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
or
|
||||
./eltt2 -a sha1 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
./eltt2 -a sha256 41624364 Hash given data with SHA-256 hash algorithm.
|
||||
|
||||
-A:
|
||||
With the "-A" command you can hash given data with the SHA-256 hash
|
||||
algorithm. This hash sequence sends 3 commands [start, update, complete] to
|
||||
the TPM and allows to hash an arbitrary amount of data.
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -A 41624364
|
||||
|
||||
-b:
|
||||
With the "-b" command you can enter your own TPM command bytes and read the
|
||||
TPM response.
|
||||
For example, use the following command to send a TPM2_Startup with startup
|
||||
type CLEAR to the TPM:
|
||||
./eltt2 -b 80010000000C000001440000
|
||||
|
||||
-c:
|
||||
With the "-c" command you can read the clock values of the TPM.
|
||||
|
||||
-d:
|
||||
With the "-d" command you can issue a TPM shutdown. It has 2 options:
|
||||
./eltt2 -d
|
||||
or
|
||||
./eltt2 -d clear send a TPM2_Shutdown command with shutdown type CLEAR to
|
||||
the TPM.
|
||||
./eltt2 -d state send a TPM2_Shutdown command with shutdown type STATE to
|
||||
the TPM.
|
||||
|
||||
-e:
|
||||
With the "-e" command you can extend bytes in the selected PCR with SHA-1/256/384.
|
||||
To do so, you have to enter the index of PCR in hexadecimal that you like to
|
||||
extend and the digest you want to extend the selected PCR with. Note that
|
||||
you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest
|
||||
must have a length of 20/32/48 bytes (will be padded with 0 if necessary).
|
||||
The TPM then builds an SHA-1/256/384 hash over the PCR data in the selected PCR
|
||||
and the digest you provided and writes the result back to the selected PCR.
|
||||
For example, use the following command to extend PCR 23 (0x17) with the byte
|
||||
sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}:
|
||||
./eltt2 -e 17 41624364 Extend bytes in PCR 23 with SHA-1.
|
||||
or
|
||||
./eltt2 -e sha1 17 41624364 Extend bytes in PCR 23 with SHA-1.
|
||||
./eltt2 -e sha256 17 41624364 Extend bytes in PCR 23 with SHA-256.
|
||||
|
||||
-E:
|
||||
With the "-E" command you can extend bytes in the selected PCR with SHA-256.
|
||||
To do so, you have to enter the index of PCR in hexadecimal that you like to
|
||||
extend and the digest you want to extend the selected PCR with. Note that
|
||||
you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest
|
||||
must have a length of 32 bytes (will be padded with 0 if necessary).
|
||||
The TPM then builds an SHA-256 hash over the PCR data in the selected PCR
|
||||
and the digest you provided and writes the result back to the selected PCR.
|
||||
For example, use the following command to extend PCR 23 (0x17) with the byte
|
||||
sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}:
|
||||
./eltt2 -E 17 41624364
|
||||
|
||||
-g:
|
||||
With the "-g" command you can read the TPM's fixed properties.
|
||||
|
||||
-v:
|
||||
With the "-v" command you can read the TPM's variable properties.
|
||||
|
||||
-G:
|
||||
With the "-G" command you can get a given amount of random bytes. Note that
|
||||
you can only request a maximum amount of 32 random bytes at once.
|
||||
For example, use the following command to get 20 (0x14) random bytes:
|
||||
./eltt2 -G 14
|
||||
|
||||
-l:
|
||||
With the "-l" command you can allocate the SHA-1/256/384 PCR bank.
|
||||
Take note of two things. Firstly, the command requires a platform
|
||||
authorization value and it is set to an empty buffer; hence the command
|
||||
cannot be used if the TPM platform authorization value is set (e.g., by UEFI).
|
||||
Secondly, when the command is executed successfully a TPM reset has to
|
||||
follow for it to take effect. For example, use the following command to
|
||||
allocate a PCR bank:
|
||||
./eltt2 -l sha1 Allocate SHA-1 PCR bank.
|
||||
./eltt2 -l sha256 Allocate SHA-256 PCR bank.
|
||||
./eltt2 -l sha384 Allocate SHA-384 PCR bank.
|
||||
|
||||
-r:
|
||||
With the "-r" command you can read data from a selected SHA-1/256/384 PCR.
|
||||
For example, use the following command to read data from PCR 23 (0x17):
|
||||
./eltt2 -r 17 Read data from SHA-1 PCR 23.
|
||||
or
|
||||
./eltt2 -r sha1 17 Read data from SHA-1 PCR 23.
|
||||
./eltt2 -r sha256 17 Read data from SHA-256 PCR 23.
|
||||
|
||||
-R:
|
||||
With the "-R" command you can read data from a selected SHA-256 PCR.
|
||||
For example, use the following command to read data from PCR 23 (0x17):
|
||||
./eltt2 -R 17
|
||||
|
||||
-s:
|
||||
With the "-s" command you can hash given data with the SHA-1/256/384 hash
|
||||
algorithm. This command only allows a limited amount of data to be hashed
|
||||
(depending on the TPM's maximum input buffer size).
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -s 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
or
|
||||
./eltt2 -s sha1 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
./eltt2 -s sha256 41624364 Hash given data with SHA-256 hash algorithm.
|
||||
|
||||
-S:
|
||||
With the "-S" command you can hash given data with the SHA-256 hash
|
||||
algorithm. This command only allows a limited amount of data to be hashed
|
||||
(depending on the TPM input buffer size).
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -S 41624364
|
||||
|
||||
-t:
|
||||
With the "-t" command you can issue a TPM selftest. It has 3 options:
|
||||
./eltt2 -t
|
||||
or
|
||||
./eltt2 -t not_full Perform a partial TPM2_Selftest to test previously
|
||||
untested TPM capabilities.
|
||||
./eltt2 -t full Perform a full TPM2_Selftest to test all TPM
|
||||
capabilities.
|
||||
./eltt2 -t incremental Perform a test of selected algorithms.
|
||||
|
||||
-T:
|
||||
With the "-T" command you can read the results of a previously run selftest.
|
||||
|
||||
-u:
|
||||
With the "-u" command you can issue a TPM startup command. It has 2 options:
|
||||
./eltt2 -u
|
||||
or
|
||||
./eltt2 -u clear send a TPM2_Startup with startup type CLEAR to the TPM.
|
||||
./eltt2 -u state send a TPM2_Startup with startup type STATE to the TPM.
|
||||
|
||||
-z:
|
||||
With the "-z" command you can reset a selected PCR. Note that you can only
|
||||
reset PCRs 16 and 23 and that the PCR is going to be reset in both banks
|
||||
(SHA-1 and SHA-256).
|
||||
For example, use the following command to reset PCR 23 (0x17):
|
||||
./eltt2 -z 17
|
||||
|
||||
|
||||
2.2 Examples:
|
||||
|
||||
In order to work with the TPM, perform the following steps:
|
||||
- Send the TPM2_Startup command: ./eltt2 -u
|
||||
|
||||
|
||||
|
||||
3. If you have questions
|
||||
|
||||
If you have any questions or problems, please read the section "FAQ and
|
||||
Troubleshooting" in this document.
|
||||
In case you still have questions, contact your local Infineon
|
||||
Representative.
|
||||
Further information is available at http://www.infineon.com/tpm.
|
||||
|
||||
|
||||
|
||||
4. Release Info
|
||||
|
||||
This is version 1.1. This version is a general release.
|
||||
|
||||
|
||||
|
||||
5. FAQ and Troubleshooting
|
||||
|
||||
If you encounter any error, please make sure that
|
||||
- the TPM is properly connected.
|
||||
- the TPM driver is loaded, i.e. check that "/dev/tpm0" exists. In case of
|
||||
driver loading problems (e.g. shown by "Error opening device"), reboot
|
||||
your system and try to load the driver again.
|
||||
- ELTT2 has been started with root permissions. Please note that ELTT2 needs
|
||||
root permissions for all commands.
|
||||
- the TPM is started. (See section 2.2 in this document on how to do this.)
|
||||
- Trousers do not run anymore. In some cases the Kernel starts Trousers by
|
||||
booting.
|
||||
Shut down Trousers by entering the following command:
|
||||
sudo pkill tcsd
|
||||
|
||||
The following list shows the most common errors and their solution:
|
||||
|
||||
The ELTT2 response is "Error opening the device.":
|
||||
- You need to load a TPM driver before you can work with ELTT2.
|
||||
- You need to start ELTT2 with root permissions.
|
||||
|
||||
The ELTT2 responds with error code 0x100.
|
||||
- You need to send the TPM2_Startup command, or you did send it twice. In
|
||||
case you have not sent it yet, do so with "./eltt2 -u".
|
||||
|
||||
The TPM does not change any of the permanent flags shown by sending the "-g"
|
||||
command , e.g. after a force clear.
|
||||
- The TPM requires a reset in order to change any of the permanent flags.
|
||||
Press the reset button or disconnect the TPM to do so.
|
||||
|
||||
The value of a PCR does not change after sending PCR extend or reset.
|
||||
- With the application permissions you cannot modify every PCR. For more
|
||||
details, please refer to the description for the different PCR commands
|
||||
in this file.
|
||||
1742
feeds/edgecore/eltt2/src/eltt2.c
Normal file
1742
feeds/edgecore/eltt2/src/eltt2.c
Normal file
File diff suppressed because it is too large
Load Diff
634
feeds/edgecore/eltt2/src/eltt2.h
Normal file
634
feeds/edgecore/eltt2/src/eltt2.h
Normal file
@@ -0,0 +1,634 @@
|
||||
#ifndef _ELTT2_H_
|
||||
#define _ELTT2_H_
|
||||
/**
|
||||
* @brief Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0
|
||||
* @details eltt2.h implements all TPM byte commands and the prototype declarations for eltt2.c.
|
||||
* @file eltt2.h
|
||||
* @date 2014/06/26
|
||||
* @copyright Copyright (c) 2014 - 2017 Infineon Technologies AG ( www.infineon.com ).\n
|
||||
* All rights reserved.\n
|
||||
* \n
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
||||
* conditions are met:\n
|
||||
* \n
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
* disclaimer.\n
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided with the distribution.\n
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.\n
|
||||
* \n
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// this is the main page for doxygen documentation.
|
||||
/** @mainpage Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0 Documentation
|
||||
*
|
||||
* @section Welcome
|
||||
* Welcome to Infineon TPM 2.0 Software-Tool "Embedded Linux TPM Toolbox 2 (ELTT2)".\n
|
||||
* \n
|
||||
* @section Introduction
|
||||
* ELTT2 is a single file-executable program
|
||||
* intended for test, diagnosis and basic state changes of the Infineon
|
||||
* Technologies TPM 2.0.\n
|
||||
* \n
|
||||
* @section Copyright
|
||||
* Copyright (c) 2014 - 2017 Infineon Technologies AG ( www.infineon.com ).\n
|
||||
* All rights reserved.\n
|
||||
* \n
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
||||
* conditions are met:\n
|
||||
* \n
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
* disclaimer.\n
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided with the distribution.\n
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.\n
|
||||
* \n
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
//-------------"Defines"-------------
|
||||
#define TPM_RESP_MAX_SIZE 4096 ///< This is the maximum possible TPM response size in bytes.
|
||||
#define TPM_REQ_MAX_SIZE 1024 ///< This is the maximum possible TPM request size in bytes. TBD: Find out correct value.
|
||||
#define ERR_COMMUNICATION -1 ///< Return error check for read and write to the TPM.
|
||||
#define ERR_BAD_CMD -2 ///< Error code for a bad command line argument or option.
|
||||
#define TPM_SHA1_DIGEST_SIZE 20 ///< For all SHA-1 operations the digest's size is always 20 bytes.
|
||||
#define TPM_SHA256_DIGEST_SIZE 32 ///< For all SHA-256 operations the digest's size is always 32 bytes.
|
||||
#define TPM_SHA384_DIGEST_SIZE 48 ///< For all SHA-384 operations the digest's size is always 48 bytes.
|
||||
#define TPM_CMD_HEADER_SIZE 10 ///< The size of a standard TPM command header is 10 bytes.
|
||||
#define TPM_CMD_SIZE_OFFSET 2 ///< The offset of a TPM command's size value is 2 bytes.
|
||||
#define HEX_BYTE_STRING_LENGTH 2 ///< A byte can be represented by two hexadecimal characters.
|
||||
#ifndef INT_MAX
|
||||
#define INT_MAX 0x7FFFFFF ///< The maximum value of a signed 32-bit integer.
|
||||
#endif
|
||||
// TPM Return codes
|
||||
#define TPM_RC_SUCCESS 0x00000000 ///< The response error code for TPM_SUCCESS.
|
||||
#define TPM_RC_BAD_TAG 0x0000001E ///< The response error code for TPM_RC_BAD_TAG.
|
||||
#define TPM_RC_SIZE 0x00000095 ///< The response error code for TPM_RC_SIZE.
|
||||
#define TPM_RC_INITIALIZE 0x00000100 ///< The response error code for TPM_RC_INITIALIZE.
|
||||
#define TPM_RC_FAILURE 0x00000101 ///< The response error code for TPM_RC_FAILURE.
|
||||
#define TPM_RC_LOCALITY 0x00000907 ///< The response error code for TPM_RC_LOCALITY.
|
||||
#define FU_FIRMWARE_VALID_FLAG 4 ///< If this flag is set, the firmware is valid.
|
||||
#define FU_OWNER_FLAG 1 ///< If this flag is set, the owner is set.
|
||||
// print_response_buf options
|
||||
#define PRINT_RESPONSE_CLEAR 1 ///< Prints response unformatted.
|
||||
#define PRINT_RESPONSE_HEADERBLOCKS 2 ///< Prints response in commented blocks.
|
||||
#define PRINT_RESPONSE_HEX_BLOCK 3 ///< Prints response in rows of 16 bytes and shows the line number.
|
||||
#define PRINT_RESPONSE_HASH 4 ///< Prints response of Hash
|
||||
#define PRINT_RESPONSE_WITHOUT_HEADER 12 ///< Prints the response buffer from byte 12.
|
||||
#define PRINT_RESPONSE_HASH_WITHOUT_HEADER 16 ///< Prints the response buffer from byte 16.
|
||||
#define PRINT_RESPONSE_WITH_HEADER 0 ///< Prints the response buffer from byte 0.
|
||||
#define PRINT_RESPONSE_PCR_WITHOUT_HEADER 30 ///< Prints the pcr buffer from pcr_read.
|
||||
// time conversion
|
||||
#define YEAR_SECONDS 31536000 ///< Number of seconds in one year
|
||||
#define DAY_SECONDS 86400 ///< Number of seconds in one day
|
||||
#define HOUR_SECONDS 3600 ///< Number of seconds in one hour
|
||||
#define MINUTE_SECONDS 60 ///< Number of seconds in one minute
|
||||
#define MILISECOND_TO_SECOND 1000 ///< Convertion from miliseconds to seconds
|
||||
// hash
|
||||
#define STD_CC_HASH_SIZE 18 ///< Hash command size
|
||||
// TPM_PT constants
|
||||
#define PT_FIXED_SELECTOR 1 ///< Fixed GetCapability Flags
|
||||
#define PT_VAR_SELECTOR 2 ///< Variable GetCapability Flags
|
||||
|
||||
//-------------"Macros"-------------
|
||||
// Null pointer check
|
||||
#define NULL_POINTER_CHECK(x) if (NULL == x) { ret_val = EINVAL; fprintf(stderr, "Error: Invalid argument.\n"); break; } ///< Argument NULL check.
|
||||
#define MALLOC_ERROR_CHECK(x) if (NULL == x) { ret_val = errno; fprintf(stderr, "Error (re)allocating memory.\n"); break; } ///< Malloc error check.
|
||||
#define MEMSET_FREE(x, y) if (NULL != x) { memset(x, 0, y); free(x); x = NULL; } ///< Sets memory to 0, frees memory and sets pointer to NULL.
|
||||
// Return value check
|
||||
#define RET_VAL_CHECK(x) if (EXIT_SUCCESS != x) { break; } ///< Return value check
|
||||
// Command line option parser for hash algorithm
|
||||
#define HASH_ALG_PARSER(o, c) \
|
||||
do { \
|
||||
if (o == option) \
|
||||
{ \
|
||||
if (c == argc) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA1; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (0 == strcasecmp(optarg, "sha1")) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA1; \
|
||||
} \
|
||||
else if (0 == strcasecmp(optarg, "sha256")) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA256; \
|
||||
} \
|
||||
else if (0 == strcasecmp(optarg, "sha384")) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA384; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
ret_val = ERR_BAD_CMD; \
|
||||
fprintf(stderr, "Unknown option. Use '-h' for more information.\n"); \
|
||||
break; \
|
||||
} \
|
||||
if (argc > optind) \
|
||||
{ \
|
||||
optarg = argv[optind++]; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
hash_algo = ALG_SHA256; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
//--------------"Enums"--------------
|
||||
// Hash algorithms
|
||||
typedef enum hash_algo_enum
|
||||
{
|
||||
ALG_NULL,
|
||||
ALG_SHA1,
|
||||
ALG_SHA256,
|
||||
ALG_SHA384,
|
||||
} hash_algo_enum;
|
||||
|
||||
//-------------"Methods"-------------
|
||||
/**
|
||||
* @brief Convert (max.) 8 byte buffer to an unsigned 64-bit integer.
|
||||
* @param [in] *input_buffer Input buffer. Make sure that its size is at least as high as offset + length.
|
||||
* @param [in] offset Start byte for conversion.
|
||||
* @param [in] length Amount of bytes to be converted.
|
||||
* @param [out] *output_value Return the converted unsigned 64-bit integer.
|
||||
* @param [in] input_buffer_size Size of input_buffer in bytes.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or length is greater than 8.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int buf_to_uint64(uint8_t *input_buffer, uint32_t offset, uint32_t length, uint64_t *output_value, uint32_t input_buffer_size);
|
||||
|
||||
/**
|
||||
* @brief Convert a hexadecimal string representation of bytes like "0A1F" and
|
||||
returns an array containing the actual byte values as an array (e.g. { 0x0A, 0x1F }).
|
||||
* @param [in] *byte_string Incoming bytes as string.
|
||||
* @param [out] *byte_values Byte array representation of given input string.
|
||||
* Must be allocated by caller with the length given in byte_values_size.
|
||||
* @param [in] byte_values_size Size of byte_values array.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval value of errno In case parsing error.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int hexstr_to_bytearray(char *byte_string, uint8_t *byte_values, size_t byte_values_size);
|
||||
|
||||
/**
|
||||
* @brief Convert a number to a byte buffer.
|
||||
* @param [in] input User input.
|
||||
* @param [in] input_size Size of input data type in bytes.
|
||||
* @param [out] *output_byte Return buffer for the converted integer.
|
||||
Must be allocated by the caller with at least a size of 'input_size'.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int int_to_bytearray(uint64_t input, uint32_t input_size, uint8_t *output_byte);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Extend command.
|
||||
* @param [in] *pcr_index_str User input string for PCR index.
|
||||
* @param [in] *pcr_digest_str User input string of value to extend the selected PCR with.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command. Must be allocated by caller.
|
||||
* @param [in] *pcr_cmd_buf_size Size of memory allocated at pcr_cmd_buf in bytes.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for extending with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an invalid option.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int pcr_extend(char *pcr_index_str, char *pcr_digest_str, uint8_t *pcr_cmd_buf, size_t pcr_cmd_buf_size, hash_algo_enum hash_algo);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Allocate command.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 to allocate SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an invalid option.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2022/05/09
|
||||
*/
|
||||
static int pcr_allocate(uint8_t *pcr_cmd_buf, hash_algo_enum hash_algo);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Read command.
|
||||
* @param [in] *pcr_index_str User input string for PCR index.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for reading with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an invalid option.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int pcr_read(char *pcr_index_str, uint8_t *pcr_cmd_buf, hash_algo_enum hash_algo);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Reset command.
|
||||
* @param [in] *pcr_index_str User input string for PCR index.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int pcr_reset(char *pcr_index_str, uint8_t *pcr_cmd_buf);
|
||||
|
||||
/**
|
||||
* @brief Print the command line usage and switches.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static void print_help();
|
||||
|
||||
/**
|
||||
* @brief Print the response buffer in different formats.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @param [in] resp_size TPM response size.
|
||||
* @param [in] offset Starting point for printing buffer.
|
||||
* @param [in] format Select the output format.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an unknown output format has been transfered.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int print_response_buf(uint8_t *response_buf, size_t resp_size, uint32_t offset, int format);
|
||||
|
||||
/**
|
||||
* @brief Print a TPM response.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @param [in] resp_size TPM response size.
|
||||
* @param [in] option Defines appearance of output. Can have the following values:\n
|
||||
- PRINT_RESPONSE_CLEAR
|
||||
- PRINT_RESPONSE_HEADERBLOCKS
|
||||
- PRINT_RESPONSE_HEX_BLOCK
|
||||
- PRINT_RESPONSE_WITHOUT_HEADER
|
||||
- PRINT_RESPONSE_WITH_HEADER
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval print_response_buf All error codes from print_response_buf.
|
||||
* @retval print_clock_info All error codes from print_clock_info.
|
||||
* @retval print_capability_flags All error codes from print_capability_flags.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int response_print(uint8_t *response_buf, size_t resp_size, int option);
|
||||
|
||||
/**
|
||||
* @brief Check a TPM response for errors.
|
||||
* @param [in] *response_buf TPM response. Must have at least a size of TPM_CMD_HEADER_SIZE bytes.
|
||||
* @return Returns the TPM return code extracted from the given TPM response or one of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int return_error_handling(uint8_t *response_buf);
|
||||
|
||||
/**
|
||||
* @brief Transmit TPM command to /dev/tpm0 and get the response.
|
||||
* @param [in] *buf TPM request.
|
||||
* @param [in] length TPM request length.
|
||||
* @param [out] *response TPM response.
|
||||
* @param [out] *resp_length TPM response length.
|
||||
* @return One of the listed return codes or the error code stored in the global errno system variable.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int tpmtool_transmit(const uint8_t *buf, ssize_t length, uint8_t *response, ssize_t *resp_length);
|
||||
|
||||
/**
|
||||
* @brief Print the capability flags.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @param [in] cap_selector Type of capabilities to print.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int print_capability_flags(uint8_t *response_buf, uint8_t cap_selector);
|
||||
|
||||
/**
|
||||
* @brief Print the clock info.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int print_clock_info(uint8_t *response_buf);
|
||||
|
||||
/**
|
||||
* @brief Create the get_random command.
|
||||
* @param [in] *data_length_string User input string for random data length.
|
||||
* @param [out] *response_buf Return buffer for the complete command.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int get_random(char *data_length_string, uint8_t *response_buf);
|
||||
|
||||
/**
|
||||
* @brief Create the simple hash command.
|
||||
* @param [in] *data_string User input string of data to be hashed.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for hashing with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @param [out] *hash_cmd_buf Return buffer for the complete command.
|
||||
* @param [in] hash_cmd_buf_size Return buffer size.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @retval int_to_bytearray All error codes from int_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int create_hash(char *data_string, hash_algo_enum hash_algo, uint8_t *hash_cmd_buf, uint32_t hash_cmd_buf_size);
|
||||
|
||||
/**
|
||||
* @brief Create and transmit a sequence of TPM commands for hashing larger amounts of data.
|
||||
* @param [in] *data_string User input string of data to be hashed.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for hashing with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @param [out] *tpm_response_buf TPM response.
|
||||
* @param [out] *tpm_response_buf_size Size of tpm_response_buf.
|
||||
* @return One of the listed return codes or the error code stored in the global errno system variable.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval value of errno In case of memory allocation error.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @retval int_to_bytearray All error codes from int_to_bytearray.
|
||||
* @retval tpmtool_transmit All error codes from tpmtool_transmit.
|
||||
* @retval print_response_buf All error codes from print_response_buf
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int create_hash_sequence(char *data_string, hash_algo_enum hash_algo, uint8_t *tpm_response_buf, ssize_t *tpm_response_buf_size);
|
||||
|
||||
//-------------"command bytes"-------------
|
||||
static const uint8_t tpm2_startup_clear[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x44, // TPM_CC_Startup
|
||||
0x00, 0x00 // TPM_SU_CLEAR
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_startup_state[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x44, // TPM_CC_Startup
|
||||
0x00, 0x01 // TPM_SU_STATE
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_shutdown_clear[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x45, // TPM_CC_Shutdown
|
||||
0x00, 0x00 // TPM_SU_CLEAR
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_shutdown_state[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x45, // TPM_CC_Shutdown
|
||||
0x00, 0x01 // TPM_SU_STATE
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_self_test[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0B, // commandSize
|
||||
0x00, 0x00, 0x01, 0x43, // TPM_CC_SelfTest
|
||||
0x00 // fullTest=No
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_self_test_full[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0B, // commandSize
|
||||
0x00, 0x00, 0x01, 0x43, // TPM_CC_SelfTest
|
||||
0x01 // fullTest=Yes
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_get_test_result[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0A, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7C // TPM_CC_GetTestResult
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_self_test_incremental[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x2A, // commandSize
|
||||
0x00, 0x00, 0x01, 0x42, // TPM_CC_IncrementalSelfTest
|
||||
0x00, 0x00, 0x00, 0x0E, // Count of Algorithm
|
||||
0x00, 0x01, 0x00, 0x04, // Algorithm two per line
|
||||
0x00, 0x05, 0x00, 0x06,
|
||||
0x00, 0x08, 0x00, 0x0A,
|
||||
0x00, 0x0B, 0x00, 0x14,
|
||||
0x00, 0x15, 0x00, 0x16,
|
||||
0x00, 0x17, 0x00, 0x22,
|
||||
0x00, 0x25, 0x00, 0x43
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_getrandom[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7B, // TPM_CC_GetRandom
|
||||
0x00, 0x00 // bytesRequested (will be set later)
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_readclock[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0A, // commandSize
|
||||
0x00, 0x00, 0x01, 0x81 // TPM_CC_ReadClock
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_getcapability_fixed[] ={
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x16, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7A, // TPM_CC_GetCapability
|
||||
0x00, 0x00, 0x00, 0x06, // TPM_CAP_TPM_PROPERTIES (Property Type: TPM_PT)
|
||||
0x00, 0x00, 0x01, 0x00, // Property: TPM_PT_FAMILY_INDICATOR: PT_GROUP * 1 + 0
|
||||
0x00, 0x00, 0x00, 0x66 // PropertyCount 102 (from 100 - 201)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_getcapability_var[] ={
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x16, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7A, // TPM_CC_GetCapability
|
||||
0x00, 0x00, 0x00, 0x06, // TPM_CAP_TPM_PROPERTIES (Property Type: TPM_PT)
|
||||
0x00, 0x00, 0x02, 0x00, // Property: TPM_PT_FAMILY_INDICATOR: PT_GROUP * 2 + 0
|
||||
0x00, 0x00, 0x00, 0x02 // PropertyCount 02 (from 200 - 201)
|
||||
};
|
||||
|
||||
// Hash
|
||||
static const uint8_t tpm2_hash[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0e, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7D, // TPM_CC_Hash
|
||||
0x00, 0x00, // size (will be set later)
|
||||
// buffer (will be added later)
|
||||
0x00, 0x00, // hashAlg (will be added later)
|
||||
0x00, 0x00, 0x00, 0x00 // hierarchy of the ticket (TPM_RH_NULL; will be added later)
|
||||
};
|
||||
|
||||
// HashSequence
|
||||
static uint8_t tpm2_hash_sequence_start[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0e, // commandSize
|
||||
0x00, 0x00, 0x01, 0x86, // TPM_CC_HashSequenceStart
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x00 // hashAlg (will be set later)
|
||||
};
|
||||
|
||||
static uint8_t tpm2_sequence_update[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x00, // commandSize (will be set later)
|
||||
0x00, 0x00, 0x01, 0x5c, // TPM_CC_SequenceUpdate
|
||||
0x00, 0x00, 0x00, 0x00, // sequenceHandle (will be set later)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00 // size (will be set later)
|
||||
// buffer (will be added later)
|
||||
};
|
||||
|
||||
static uint8_t tpm2_sequence_complete[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x21, // commandSize
|
||||
0x00, 0x00, 0x01, 0x3e, // TPM_CC_SequenceComplete
|
||||
0x00, 0x00, 0x00, 0x00, // sequenceHandle (will be set later)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, // size (NULL buffer)
|
||||
// null (indicate an empty buffer buffer)
|
||||
0x40, 0x00, 0x00, 0x07 // hierarchy of the ticket (TPM_RH_NULL)
|
||||
};
|
||||
|
||||
static const uint8_t sha1_alg[] = {
|
||||
0x00, 0x04 // command for sha1 alg
|
||||
};
|
||||
|
||||
static const uint8_t sha256_alg[] = {
|
||||
0x00, 0x0B // command for sha256 alg
|
||||
};
|
||||
|
||||
static const uint8_t sha384_alg[] = {
|
||||
0x00, 0x0C // command for sha384 alg
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_hash_hierarchy[] = {
|
||||
0x40, 0x00, 0x00, 0x07 // hierarchy of the ticket (TPM_RH_NULL)
|
||||
};
|
||||
|
||||
//PCR_Command
|
||||
static const uint8_t tpm2_pcr_allocate[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x31, // commandSize
|
||||
0x00, 0x00, 0x01, 0x2B, // TPM_CC_PCR_Allocate
|
||||
0x40, 0x00, 0x00, 0x0C, // TPM_RH_PLATFORM
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x03, // count (TPML_PCR_SELECTION)
|
||||
0x00, 0x04, // hash (TPMS_PCR_SELECTION; SHA-1)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00, // pcrSelect (TPMS_PCR_SELECTION; will be set later)
|
||||
0x00, 0x0B, // hash (TPMS_PCR_SELECTION; SHA-256)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00, // pcrSelect (TPMS_PCR_SELECTION; will be set later)
|
||||
0x00, 0x0C, // hash (TPMS_PCR_SELECTION; SHA-384)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00 // pcrSelect (TPMS_PCR_SELECTION; will be set later)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_pcr_read[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x14, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7E, // TPM_CC_PCR_Read
|
||||
0x00, 0x00, 0x00, 0x01, // count (TPML_PCR_SELECTION)
|
||||
0x00, 0x00, // hash (TPMS_PCR_SELECTION; will be set later)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00 // pcrSelect (TPMS_PCR_SELECTION)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_pcr_extend[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x00, // commandSize (will be set later)
|
||||
0x00, 0x00, 0x01, 0x82, // TPM_CC_PCR_Extend
|
||||
0x00, 0x00, 0x00, 0x00, // {PCR_FIRST:PCR_LAST} (TPMI_DH_PCR)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01, // count (TPML_DIGEST_VALUES)
|
||||
0x00, 0x00 // hashAlg (TPMT_HA; will be set later)
|
||||
// digest (TPMT_HA; will be added later)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_pcr_reset[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x1B, // commandSize
|
||||
0x00, 0x00, 0x01, 0x3D, // TPM_CC_PCR_Reset
|
||||
0x00, 0x00, 0x00, 0x00, // {PCR_FIRST:PCR_LAST} (TPMI_DH_PCR)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00
|
||||
};
|
||||
|
||||
#endif /* _ELTT2_H_ */
|
||||
@@ -1,77 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
#
|
||||
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fbwifi
|
||||
PKG_VERSION:=2
|
||||
PKG_RELEASE:=0
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_MAINTAINER:=Simon Kinane <skinane@fb.com>
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fbwifi
|
||||
SUBMENU:=Captive Portals
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+iptables +luasec +luasocket \
|
||||
+libuci-lua +luaposix \
|
||||
+lua-cjson +uhttpd
|
||||
TITLE:=Facebook Wi-Fi
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/fbwifi/description
|
||||
Facebook Wi-Fi, an AP authorisation solution
|
||||
endef
|
||||
|
||||
|
||||
define Package/luci-app-fbwifi
|
||||
SUBMENU:=3. Applications
|
||||
SECTION:=luci
|
||||
CATEGORY:=LuCI
|
||||
TITLE:=LuCI support for Facebook Wi-Fi
|
||||
DEPENDS:= \
|
||||
+fbwifi \
|
||||
+luci-base +luci-mod-network +luci-mod-status +luci-theme-bootstrap
|
||||
endef
|
||||
|
||||
define Package/luci-app-fbwifi/description
|
||||
LuCI support for Facebook Wi-Fi
|
||||
endef
|
||||
|
||||
|
||||
define Package/fbwifi/conffiles
|
||||
/etc/config/fbwifi
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/fbwifi/install
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) ./files/fbwifi/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/luci-app-fbwifi/install
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) ./files/luci-app-fbwifi/* $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fbwifi))
|
||||
$(eval $(call BuildPackage,luci-app-fbwifi))
|
||||
@@ -1,22 +0,0 @@
|
||||
# Facebook Wi-Fi v2.0 Reference Implementation for OpenWrt
|
||||
|
||||
## Getting started
|
||||
|
||||
Case studies for OEM customers are available at the official page of [Facebook Wi-Fi](https://www.facebook.com/facebook-wifi).
|
||||
|
||||
For OEM engineers, start by reading the init script in [files/etc/init.d/fbwifi](https://github.com/facebookincubator/fbc_owrt_feed/blob/master/fbwifi/files/etc/init.d/fbwifi)
|
||||
|
||||
To enable Facebook Wi-Fi, configure the gateway_token in `/etc/config/fbwifi`, and run `fbwifi enable`.
|
||||
To disable Facebook Wi-Fi, run `fbwifi disable`.
|
||||
|
||||
## Contents
|
||||
|
||||
The 'files' subdirectory contains two subdirectories, one for the fbwifi
|
||||
package that implements the Facebook Wi-Fi v2.0 standard for OpenWrt, and
|
||||
another one containing a LuCI application to configure Facebook Wi-Fi.
|
||||
|
||||
The folder structures follow *nix conventions:
|
||||
- 'etc' is the boot time scripts and configuration
|
||||
- 'usr' contains procedural scripts, lua common code module and GUI prototype for luci
|
||||
- 'www' contains the HTTP endpoints as CGI handlers
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
config fbwifi 'main'
|
||||
option enabled '0'
|
||||
option gateway_token 'FBWIFI:GATEWAY|123456789|0123456789|abcdeABCDE123456789'
|
||||
option http_port '2060'
|
||||
option https_port '2061'
|
||||
option zone 'lan'
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
|
||||
/etc/init.d/fbwifi enabled || exit 0
|
||||
|
||||
ip route get fibmatch 1.1.1.1 | grep -q "$DEVICE" || exit 0
|
||||
|
||||
logger -t fbwifi "Reloading fbwifi due to $ACTION of $INTERFACE ($DEVICE)"
|
||||
/etc/init.d/fbwifi restart
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=90
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger fbwifi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
config_load fbwifi
|
||||
config_get_bool enabled 'main' 'enabled' '0'
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
|
||||
config_get http_port main http_port
|
||||
[ -z "$http_port" ] && {
|
||||
logger -t fbwifi "required option http_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
config_get https_port main https_port
|
||||
[ -z "$https_port" ] && {
|
||||
logger -t fbwifi "required option https_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
logger "[fbwifi] Enabled; starting"
|
||||
|
||||
mkdir -p /tmp/fbwifi
|
||||
|
||||
/usr/sbin/fbwifi reload
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/fbwifi_validate_token_db
|
||||
procd_set_param respawn 1 300 0
|
||||
procd_close_instance
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
-- SPDX-License-Identifier: GPL-2.0-only
|
||||
-- Copyright (c) Facebook, Inc. and its affiliates.
|
||||
--
|
||||
-- FBWIFI Lua library
|
||||
-- function table
|
||||
local fbwifi = {}
|
||||
|
||||
local http = require("ssl.https")
|
||||
local json = require("cjson")
|
||||
local log = require("posix.syslog")
|
||||
local uci = require("uci")
|
||||
|
||||
function fbwifi.gateway_token()
|
||||
token = uci.get("fbwifi.main.gateway_token")
|
||||
if token and string.len(token) > 0 then
|
||||
return token
|
||||
else
|
||||
log.syslog( log.LOG_WARNING, "[fbwifi] UCI option fbwifi.main.gateway_token is missing" )
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function fbwifi.validate_token( token )
|
||||
|
||||
local valid = false
|
||||
|
||||
if string.len(token or '' ) > 0 then
|
||||
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/token"
|
||||
BODY="token="..token
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN, BODY)
|
||||
|
||||
if code==200 then
|
||||
valid = true
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] validate_token:"..body)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return valid
|
||||
end
|
||||
|
||||
local mac_to_purge=''
|
||||
function remove_client_by_mac(client)
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
|
||||
for key, value in pairs(client) do
|
||||
if
|
||||
key == 'mac' and
|
||||
value == mac_to_purge
|
||||
then
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] Purging DB entry %s for MAC %s", client['.name'] or 'unknown', mac_to_purge) )
|
||||
state:delete("fbwifi", client['.name'])
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function fbwifi.instate_client_rule( token, client_mac )
|
||||
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Validating client "..client_mac)
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
state_name = "token_" .. token
|
||||
|
||||
RULE_COND="iptables -w -L FBWIFI_CLIENT_TO_INTERNET -t mangle | grep -i -q \"%s\""
|
||||
RULE_FMT="iptables -w -t mangle -%s FBWIFI_CLIENT_TO_INTERNET -m mac --mac-source \"%s\" -j MARK --set-mark 0xfb"
|
||||
local RULE
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] Cleaning DB for MAC %s", client_mac) )
|
||||
mac_to_purge = client_mac
|
||||
state:foreach("fbwifi", "client", remove_client_by_mac)
|
||||
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] Adding DB entry %s for MAC %s", state_name, client_mac) )
|
||||
state:set("fbwifi", state_name, "client")
|
||||
state:set("fbwifi", state_name, "token", token)
|
||||
state:set("fbwifi", state_name, "mac", client_mac)
|
||||
state:set("fbwifi", state_name, "authenticated", "true")
|
||||
|
||||
-- verify a rule exists for the given client MAC,
|
||||
-- OR install it
|
||||
RULE=string.format(RULE_COND.." || "..RULE_FMT, client_mac, "A", client_mac)
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format( "[fbwifi] Opening iptables for %s", client_mac ) )
|
||||
res = os.execute(RULE)
|
||||
if res ~= 0 then
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] Failed to update iptables (%s)", res ) )
|
||||
end
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] "..RULE)
|
||||
|
||||
state:save('fbwifi')
|
||||
state:commit('fbwifi')
|
||||
end
|
||||
|
||||
function fbwifi.revoke_client_rule( token )
|
||||
|
||||
if (token == nil) then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Invalidating token, but token is Nil")
|
||||
return
|
||||
end
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format( "[fbwifi] Invalidating token (%s)", token) )
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
state_name = "token_" .. token
|
||||
|
||||
client_mac = state:get("fbwifi", state_name, "mac")
|
||||
|
||||
if client_mac then
|
||||
RULE_COND="iptables -w -L FBWIFI_CLIENT_TO_INTERNET -t mangle | grep -i -q \"%s\""
|
||||
RULE_FMT="iptables -w -t mangle -%s FBWIFI_CLIENT_TO_INTERNET -m mac --mac-source \"%s\" -j MARK --set-mark 0xfb"
|
||||
|
||||
-- verify a rule exists for the given client MAC,
|
||||
-- AND delete it
|
||||
RULE=string.format(RULE_COND.." && "..RULE_FMT, client_mac, "D", client_mac)
|
||||
|
||||
res = os.execute(RULE)
|
||||
if res ~= 0 then
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] Failed to update iptables (%s)", res ) )
|
||||
end
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] "..RULE)
|
||||
|
||||
state:delete("fbwifi", state_name)
|
||||
state:save('fbwifi')
|
||||
state:commit('fbwifi')
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] Client MAC not found in DB (%s)", state_name ) )
|
||||
end
|
||||
end
|
||||
|
||||
function fbwifi.reset()
|
||||
|
||||
local success = false
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
URL="https://api.fbwifi.com/v2.0/gateway/reset"
|
||||
BODY="{}"
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN, BODY)
|
||||
|
||||
if code==200 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Reset committed")
|
||||
success = true
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Reset failed : "..body)
|
||||
end
|
||||
|
||||
return success
|
||||
end
|
||||
|
||||
--
|
||||
-- Return the function table to the host script
|
||||
--
|
||||
return fbwifi
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
disable)
|
||||
uci set fbwifi.main.enabled=0
|
||||
|
||||
uci delete firewall.fbwifi
|
||||
|
||||
uci delete uhttpd.fbwifi_redirect
|
||||
|
||||
uci delete uhttpd.main.json_script
|
||||
uci set uhttpd.main.cert='/etc/uhttpd.crt'
|
||||
uci set uhttpd.main.key='/etc/uhttpd.key'
|
||||
uci set uhttpd.main.rfc1918_filter=1
|
||||
;;
|
||||
enable)
|
||||
uci set fbwifi.main.enabled=1
|
||||
|
||||
uci set firewall.fbwifi=include
|
||||
uci set firewall.fbwifi.enabled=1
|
||||
uci set firewall.fbwifi.family=ipv4
|
||||
uci set firewall.fbwifi.path=/usr/share/fbwifi/firewall.include
|
||||
uci set firewall.fbwifi.reload=1
|
||||
uci set firewall.fbwifi.type=script
|
||||
|
||||
uci set uhttpd.fbwifi_redirect=uhttpd
|
||||
uci set uhttpd.fbwifi_redirect.enabled=1
|
||||
uci set uhttpd.fbwifi_redirect.cert='/tmp/fbwifi/https_server_cert'
|
||||
uci set uhttpd.fbwifi_redirect.home='/dev/null'
|
||||
uci set uhttpd.fbwifi_redirect.json_script='/tmp/fbwifi/uhttpd-redirect.json'
|
||||
uci set uhttpd.fbwifi_redirect.key='/tmp/fbwifi/https_server_key'
|
||||
uci set uhttpd.fbwifi_redirect.listen_http='0.0.0.0:2060'
|
||||
uci set uhttpd.fbwifi_redirect.listen_https='0.0.0.0:2061'
|
||||
|
||||
uci set uhttpd.main.cert='/tmp/fbwifi/https_server_cert'
|
||||
uci set uhttpd.main.json_script='/usr/share/fbwifi/uhttpd.json'
|
||||
uci set uhttpd.main.key='/tmp/fbwifi/https_server_key'
|
||||
uci set uhttpd.main.rfc1918_filter=0
|
||||
;;
|
||||
reload)
|
||||
/usr/sbin/fbwifi_get_config
|
||||
|
||||
login_url=$(uci -c /var/state get fbwifi.main.captive_portal_url)
|
||||
[ -z "$login_url" ] && {
|
||||
logger -t fbwifi "captive_portal_url not available yet"
|
||||
exit 1
|
||||
}
|
||||
printf '{ "request": [ ["redirect", "%s", 302] ] }' "$login_url" > /tmp/fbwifi/uhttpd-redirect.json
|
||||
|
||||
/etc/init.d/uhttpd restart
|
||||
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
uci commit
|
||||
/etc/init.d/uhttpd restart
|
||||
reload_config
|
||||
@@ -1,8 +0,0 @@
|
||||
echo -e "Runtime configuration and token DB\n"
|
||||
uci -c /var/state export fbwifi
|
||||
|
||||
echo -e "\nDynamic firewall flow rules\n"
|
||||
iptables -t mangle -L FBWIFI_CLIENT_TO_INTERNET
|
||||
|
||||
echo -e "\nDHCP leases\n"
|
||||
cat /tmp/dhcp.leases
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
http = require("ssl.https")
|
||||
json = require("cjson")
|
||||
log = require("posix.syslog")
|
||||
socket = require("socket")
|
||||
require("uci")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
|
||||
payload="name="..socket.dns.gethostname()
|
||||
|
||||
function queue_ssid_update(iface)
|
||||
bssid_file="/sys/class/net/br-"..iface["network"].."/address"
|
||||
local file = io.open(bssid_file)
|
||||
if file then
|
||||
for line in file:lines() do
|
||||
payload=payload.."&bssid[]="..line
|
||||
end
|
||||
file:close()
|
||||
payload=payload.."ssid[]="..iface["ssid"]
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to find BSSID for interface br-"..iface["network"])
|
||||
end
|
||||
end
|
||||
|
||||
state:foreach("wireless", "wifi-iface", queue_ssid_update)
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/gateway"
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN, payload)
|
||||
if code == 200 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] gateway information updated "..body)
|
||||
os.exit(0)
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] gateway API failed "..body)
|
||||
os.exit(code)
|
||||
end
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
http = require("ssl.https")
|
||||
json = require("cjson")
|
||||
require("uci")
|
||||
log = require("posix.syslog")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
http_port = uci.get("fbwifi.main.http_port")
|
||||
https_port = uci.get("fbwifi.main.https_port")
|
||||
|
||||
statefile = assert(io.open("/var/state/fbwifi", "a"), "could not create state file")
|
||||
statefile:close()
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/gateway"
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN.."&fields=config,config_version")
|
||||
|
||||
if code == 200 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Got gateway config ("..code..")")
|
||||
else
|
||||
log.syslog(log.LOG_CRIT, "[fbwifi] Failed to get gateway config ("..code..")")
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
obj = json.decode(body)
|
||||
|
||||
function save_cert(name, value)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Saving cert "..name)
|
||||
local f = assert(io.open("/tmp/fbwifi/"..name, "w"))
|
||||
f:write(value)
|
||||
f:close()
|
||||
end
|
||||
|
||||
function process_redirect(ix, host)
|
||||
IP_SET = "ip addr replace dev lo "..host
|
||||
local result = os.execute(IP_SET)
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Redirect address applied "..host)
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to apply redirect address "..host)
|
||||
end
|
||||
|
||||
ip = string.match(host, '([0-9\.]*)/([0-9]*)')
|
||||
RULE_FMT="grep -q \"%s\" /etc/hosts || echo \"%s\tstar.fbwifigateway.net\" >> /etc/hosts"
|
||||
HOSTS_RULE = string.format(RULE_FMT, ip, ip)
|
||||
result = os.execute(HOSTS_RULE)
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Cached redirect host for DNS")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to amend /etc/hosts")
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] "..HOSTS_RULE)
|
||||
end
|
||||
|
||||
result = os.execute("iptables -t nat -A FBWIFI_HOST_REDIRLIST -p tcp --dport 80 -d "..ip.." -j ACCEPT # REDIRECT --to-ports "..http_port)
|
||||
--print(result)
|
||||
result = os.execute("iptables -t nat -A FBWIFI_HOST_REDIRLIST -p tcp --dport 443 -d "..ip.." -j ACCEPT # REDIRECT --to-ports "..https_port)
|
||||
--print(result)
|
||||
end
|
||||
|
||||
save_cert("https_server_cert", obj['config']['https_server_cert'])
|
||||
save_cert("https_server_key", obj['config']['https_server_key'])
|
||||
|
||||
result = os.execute("iptables -t nat -F FBWIFI_HOST_REDIRLIST")
|
||||
--print(result)
|
||||
table.foreach(obj['config']['host_redirect_ips'], process_redirect)
|
||||
|
||||
RULE_FORMAT = "iptables -t mangle -A FBWIFI_TRAFFIC_ALLOWLIST -d %s -p %s --dport %s -j MARK --set-mark 0xfb"
|
||||
function process_traffic_rule(ix, rule)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Traffic rule "..ix)
|
||||
|
||||
if rule["protocol"] == 6 then
|
||||
PROTO = "tcp"
|
||||
elseif rule["protocol"] == 17 then
|
||||
PROTO = "udp"
|
||||
end
|
||||
RULE = string.format(RULE_FORMAT, rule["ip"], PROTO, rule["port"])
|
||||
local result = os.execute(RULE)
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Traffic rule "..ix)
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to install traffic rule ; "..RULE)
|
||||
end
|
||||
end
|
||||
|
||||
local cross_origin_list = {}
|
||||
function process_cross_origin_rule(ix, url)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Cross origin rule "..url)
|
||||
table.insert(cross_origin_list, url)
|
||||
end
|
||||
|
||||
function process_url(url_purpose, fqdn)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Caching "..url_purpose)
|
||||
state:set("fbwifi", "main", url_purpose, fqdn)
|
||||
end
|
||||
|
||||
state:set("fbwifi", "main", "config")
|
||||
|
||||
result = os.execute("iptables -t mangle -F FBWIFI_TRAFFIC_ALLOWLIST ")
|
||||
--print(result)
|
||||
table.foreach(obj['config']['traffic_allowlist'], process_traffic_rule)
|
||||
table.foreach(obj['config']['cross_origin_allowlist'], process_cross_origin_rule)
|
||||
table.foreach(obj['config']['urls'], process_url)
|
||||
|
||||
state:set("fbwifi", "main", "cross_origin_allow_rules", cross_origin_list)
|
||||
state:set("fbwifi", "main", "config_version", obj['config_version'])
|
||||
|
||||
state:save('fbwifi')
|
||||
state:commit('fbwifi')
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
https = require("ssl.https")
|
||||
json = require("cjson")
|
||||
log = require("posix.syslog")
|
||||
fbwifi = require("fbwifi")
|
||||
require("uci")
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
request = {
|
||||
tokens = {},
|
||||
traffic_type = "total",
|
||||
config_version = state:get("fbwifi", "main", "config_version")
|
||||
}
|
||||
|
||||
function queue_token(client)
|
||||
|
||||
request.tokens[client.token]={
|
||||
incoming = json.null,
|
||||
outgoing = json.null,
|
||||
connected_time_sec = json.null,
|
||||
inactive_time_sec = json.null,
|
||||
signal_rssi_dbm = json.null,
|
||||
--expected_tpus_mbps = json.null,
|
||||
is_connected = true
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
state:foreach("fbwifi", "client", queue_token)
|
||||
print( "\nRequest:\n"..json.encode(request) )
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/tokens"
|
||||
BODY=string.format(
|
||||
"tokens=%s&traffic_type=%s&config_version=%s",
|
||||
json.encode(request.tokens),
|
||||
"total",
|
||||
state:get("fbwifi", "main", "config_version")
|
||||
)
|
||||
|
||||
body, code, headers = https.request(URL.."?access_token="..GATEWAY_TOKEN, BODY)
|
||||
|
||||
if code then
|
||||
print( "\nResponse:\n"..body )
|
||||
end
|
||||
|
||||
response = json.decode(body)
|
||||
--print(response)
|
||||
--table.foreach(response,print)
|
||||
--table.foreach(response.tokens,print)
|
||||
|
||||
if response.config_valid then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Config validated")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] config is stale, refreshing config")
|
||||
local result = os.execute("/usr/sbin/fbwifi reload")
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] successfully fetched and loaded new config ")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] failed to fetch and load new config, possible stale config")
|
||||
end
|
||||
end
|
||||
|
||||
function process_token(token, metadata)
|
||||
table.foreach(metadata,print)
|
||||
if metadata.valid then
|
||||
print("OK: "..token)
|
||||
else
|
||||
print("Nok: "..token)
|
||||
fbwifi.revoke_client_rule( token )
|
||||
end
|
||||
end
|
||||
table.foreach(response.tokens,process_token)
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
IPT4="/usr/sbin/iptables"
|
||||
|
||||
set -- --wait 1 --wait-interval 100
|
||||
|
||||
fbwifi_http_port="$(uci get fbwifi.main.http_port)"
|
||||
[ -n "$fbwifi_http_port" ] || {
|
||||
logger -t fbwifi "required option http_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
fbwifi_https_port="$(uci get fbwifi.main.https_port)"
|
||||
[ -n "$fbwifi_https_port" ] || {
|
||||
logger -t fbwifi "required option https_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
fbwifi_zone="$(uci get fbwifi.main.zone)"
|
||||
[ -n "$fbwifi_zone" ] || {
|
||||
logger -t fbwifi "required option zone not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
fbwifi_ifaces="$(fw3 -q zone "$fbwifi_zone")"
|
||||
|
||||
## Create custom chains
|
||||
"$IPT4" "$@" -t filter -N FBWIFI_FORWARD 2>/dev/null
|
||||
"$IPT4" "$@" -t filter -N FBWIFI_INPUT 2>/dev/null
|
||||
"$IPT4" "$@" -t mangle -N FBWIFI_CLIENT_TO_INTERNET 2>/dev/null
|
||||
"$IPT4" "$@" -t mangle -N FBWIFI_PREROUTING 2>/dev/null
|
||||
"$IPT4" "$@" -t mangle -N FBWIFI_TRAFFIC_ALLOWLIST 2>/dev/null
|
||||
"$IPT4" "$@" -t nat -N FBWIFI_CLIENT_TO_INTERNET 2>/dev/null
|
||||
"$IPT4" "$@" -t nat -N FBWIFI_PREROUTING 2>/dev/null
|
||||
"$IPT4" "$@" -t nat -N FBWIFI_HOST_REDIRLIST 2>/dev/null
|
||||
|
||||
## Flush custom chains
|
||||
"$IPT4" "$@" -t filter -F FBWIFI_FORWARD
|
||||
"$IPT4" "$@" -t filter -F FBWIFI_INPUT
|
||||
"$IPT4" "$@" -t mangle -F FBWIFI_CLIENT_TO_INTERNET
|
||||
"$IPT4" "$@" -t mangle -F FBWIFI_PREROUTING
|
||||
"$IPT4" "$@" -t mangle -F FBWIFI_TRAFFIC_ALLOWLIST
|
||||
"$IPT4" "$@" -t nat -F FBWIFI_CLIENT_TO_INTERNET
|
||||
"$IPT4" "$@" -t nat -F FBWIFI_PREROUTING
|
||||
"$IPT4" "$@" -t nat -F FBWIFI_HOST_REDIRLIST
|
||||
|
||||
## Populate custom chains
|
||||
"$IPT4" "$@" -t filter -A FBWIFI_FORWARD -p udp --dport 53 -m conntrack --ctstate NEW -j ACCEPT
|
||||
"$IPT4" "$@" -t filter -A FBWIFI_FORWARD -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
"$IPT4" "$@" -t filter -A FBWIFI_FORWARD -j REJECT
|
||||
"$IPT4" "$@" -t filter -A FBWIFI_INPUT -p tcp --dport "$fbwifi_http_port" -m conntrack --ctstate NEW -j ACCEPT
|
||||
"$IPT4" "$@" -t filter -A FBWIFI_INPUT -p tcp --dport "$fbwifi_https_port" -m conntrack --ctstate NEW -j ACCEPT
|
||||
"$IPT4" "$@" -t filter -A FBWIFI_INPUT -p tcp --dport 443 -m conntrack --ctstate NEW -j ACCEPT
|
||||
"$IPT4" "$@" -t mangle -A FBWIFI_PREROUTING -j FBWIFI_CLIENT_TO_INTERNET
|
||||
"$IPT4" "$@" -t mangle -A FBWIFI_PREROUTING -j FBWIFI_TRAFFIC_ALLOWLIST
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_PREROUTING -j FBWIFI_CLIENT_TO_INTERNET
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 80 -m conntrack --ctstate NEW -j FBWIFI_HOST_REDIRLIST
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 443 -m conntrack --ctstate NEW -j FBWIFI_HOST_REDIRLIST
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p udp --dport 443 -m conntrack --ctstate NEW -j FBWIFI_HOST_REDIRLIST
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 80 -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 443 -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p udp --dport 443 -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
"$IPT4" "$@" -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 80 -m conntrack --ctstate NEW -j REDIRECT --to-ports "$fbwifi_http_port"
|
||||
|
||||
## Hook custom chains in firewall3 chains
|
||||
"$IPT4" "$@" -t filter -I "zone_${fbwifi_zone}_input" 2 -j FBWIFI_INPUT
|
||||
"$IPT4" "$@" -t filter -I "zone_${fbwifi_zone}_forward" 2 -j FBWIFI_FORWARD
|
||||
"$IPT4" "$@" -t nat -I "zone_${fbwifi_zone}_prerouting" 2 -j FBWIFI_PREROUTING
|
||||
# There are no firewall3 zone chains in the mangle table so we need to do this for all interfaces in the zone
|
||||
for iface in $fbwifi_ifaces; do
|
||||
"$IPT4" "$@" -t mangle -I PREROUTING -i "$iface" -j FBWIFI_PREROUTING
|
||||
done
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"request": [
|
||||
[ "if",
|
||||
[ "regex", "REQUEST_URI", "^/fbwifi" ],
|
||||
[ "rewrite", "/cgi-bin%REQUEST_URI%" ]
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
require("uci")
|
||||
log = require("posix.syslog")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
function process_cors()
|
||||
origin = os.getenv("HTTP_ORIGIN")
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] [auth] process_cors origin %s", origin or 'not found') )
|
||||
if string.len(origin or '') > 0 then
|
||||
allow_list = state:get("fbwifi", "main", "cross_origin_allow_rules")
|
||||
for _, value in pairs(allow_list) do
|
||||
if value == origin then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] process_cors Appending CORS Headers to HTTP")
|
||||
print("Access-Control-Allow-Origin: "..origin)
|
||||
print("Vary: Origin")
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] process_cors No CORS Headers added to Response")
|
||||
end
|
||||
end
|
||||
|
||||
method = os.getenv("REQUEST_METHOD")
|
||||
if method == 'GET' then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] GET handler")
|
||||
print("Status: 302 Found")
|
||||
print("Location: "..state:get("fbwifi", "main", "landing_page_url"))
|
||||
process_cors()
|
||||
print ('\n')
|
||||
|
||||
elseif method == 'POST' then
|
||||
local token
|
||||
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] POST handler")
|
||||
process_cors()
|
||||
print("Status: 200 OK")
|
||||
|
||||
form_data=io.read()
|
||||
while form_data do
|
||||
token = string.match(form_data, '[%d]+')
|
||||
if string.len(token or '') > 14 then
|
||||
|
||||
client = os.getenv("REMOTE_ADDR")
|
||||
f = io.popen("awk '/"..client..".*0x2/ { printf(\"%s\", $4) }' /proc/net/arp", 'r')
|
||||
client_mac = assert(f:read('*a'))
|
||||
f:close()
|
||||
|
||||
if fbwifi.validate_token(token) then
|
||||
log.syslog(log.LOG_INFO, string.format( "[fbwifi] [auth] POST handler : Validating Token (%s) for MAC (%s)", token or 'nil', client_mac or 'nil') )
|
||||
fbwifi.instate_client_rule(token, client_mac)
|
||||
print("\n{\"valid\":true}\n")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] [auth] POST handler : ! Invalid token (%s) for mac (%s) !", token or 'nil', client_mac or 'nil') )
|
||||
fbwifi.revoke_client_rule(token)
|
||||
print("\n{\"valid\":false}\n")
|
||||
end
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] POST handler completed")
|
||||
return
|
||||
end
|
||||
|
||||
form_data=io.read()
|
||||
end
|
||||
print ('\n')
|
||||
|
||||
log.syslog(log.LOG_WARNING, string.format("[fbwifi] [auth] POST handler : token not found" ))
|
||||
fbwifi.revoke_client_rule(token)
|
||||
print("\n{\"valid\":false}\n")
|
||||
end
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
json = require("cjson")
|
||||
require("uci")
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
client_mac = ""
|
||||
token = ""
|
||||
|
||||
response = {}
|
||||
response['venue-info-url'] = state:get("fbwifi", "main", "capport_venue_info_url")
|
||||
|
||||
function map_remote_mac_to_token(client)
|
||||
for key, value in pairs(client) do
|
||||
if
|
||||
key == 'mac' and
|
||||
value == client_mac
|
||||
then
|
||||
token = client.token
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function hasValidToken(client_ip)
|
||||
f = io.popen("awk '/"..client_ip..".*0x2/ { printf(\"%s\", $4) }' /proc/net/arp", 'r')
|
||||
client_mac = assert(f:read('*a'))
|
||||
f:close()
|
||||
state:foreach("fbwifi", "client", map_remote_mac_to_token)
|
||||
|
||||
return 0 < string.len(token)
|
||||
end
|
||||
|
||||
print("Content-type: application/captive+json; charset=utf-8\n")
|
||||
|
||||
client = os.getenv("REMOTE_ADDR")
|
||||
response['captive'] = not hasValidToken(client)
|
||||
|
||||
if response['captive'] then
|
||||
response['user-portal-url'] = state:get("fbwifi", "main", "captive_portal_url")
|
||||
end
|
||||
|
||||
print( json.encode(response) )
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
json = require("cjson")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
response = { api_version = "2.0", token = json.null }
|
||||
client_mac = ""
|
||||
|
||||
function process_cors()
|
||||
origin = os.getenv("HTTP_ORIGIN")
|
||||
if string.len(origin or '') > 0 then
|
||||
allow_list = state:get("fbwifi", "main", "cross_origin_allow_rules")
|
||||
for _, value in pairs(allow_list) do
|
||||
if value == origin then
|
||||
print("Access-Control-Allow-Origin: "..origin)
|
||||
print("Vary: Origin")
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function map_remote_mac_to_token(client)
|
||||
|
||||
for key, value in pairs(client) do
|
||||
if
|
||||
key == 'mac' and
|
||||
value == client_mac
|
||||
then
|
||||
response.token = client.token
|
||||
return false -- escape outer loop
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function getClientToken(client_ip)
|
||||
f = io.popen("awk '/"..client_ip..".*0x2/ { printf(\"%s\", $4) }' /proc/net/arp", 'r')
|
||||
client_mac = assert(f:read('*a'))
|
||||
f:close()
|
||||
|
||||
state:foreach("fbwifi", "client", map_remote_mac_to_token)
|
||||
end
|
||||
|
||||
function getGatewayId()
|
||||
id = string.match(GATEWAY_TOKEN, 'FBWIFI:GATEWAY|[0-9]*|([0-9]*)')
|
||||
return id
|
||||
end
|
||||
|
||||
process_cors()
|
||||
print("Content-type: application/json; charset=utf-8\n")
|
||||
|
||||
getClientToken(os.getenv("REMOTE_ADDR"))
|
||||
response.gateway_id = getGatewayId()
|
||||
|
||||
print( json.encode(response) )
|
||||
@@ -1,12 +0,0 @@
|
||||
-- SPDX-License-Identifier: GPL-2.0-only
|
||||
-- Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
module("luci.controller.fbwifi", package.seeall)
|
||||
|
||||
sys = require "luci.sys"
|
||||
ut = require "luci.util"
|
||||
|
||||
function index()
|
||||
entry({"admin", "network", "fbwifi"}, template("fbwifi"), "Facebook Wi-Fi", 90).dependent=false
|
||||
end
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<%#
|
||||
Copyright
|
||||
Licensed to the public under the GNU General Public License v2.
|
||||
-%>
|
||||
|
||||
<%+header%>
|
||||
|
||||
<h1>Facebook Wi-Fi</h1>
|
||||
<%
|
||||
require("uci")
|
||||
state = uci.cursor("/var/state", "/tmp/fbwifi")
|
||||
url = state:get("fbwifi", "main", "captive_portal_config_url")
|
||||
%>
|
||||
<a href="<% print(url) %>">Configure FB business page</a>
|
||||
|
||||
<%+footer%>
|
||||
@@ -10,14 +10,15 @@ CPU_TYPE:=cortex-a7
|
||||
|
||||
KERNEL_PATCHVER:=4.4
|
||||
KERNEL_NAME_SUFFIX=-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016
|
||||
KERNEL_QSDK_4_4:=y
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \
|
||||
kmod-qca-nss-drv \
|
||||
kmod-usb-phy-ipq807x kmod-usb-dwc3-of-simple \
|
||||
kmod-ath11k-ahb kmod-qrtr_mproc wpad \
|
||||
kmod-gpio-button-hotplug \
|
||||
qca-thermald-10.4 qca-ssdk-shell kmod-qca-nss-drv-bridge-mgr \
|
||||
kmod-gpio-button-hotplug kmod-bootconfig \
|
||||
qca-thermald-10.4 qca-ssdk-shell \
|
||||
uboot-envtools
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
@@ -34,11 +34,32 @@ edgecore,eap104)
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt"
|
||||
ucidef_set_led_netdev "wan" "wan" "yellow:uplink" "eth0"
|
||||
;;
|
||||
liteon,wpx8324)
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "orange:wifi2" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt"
|
||||
ucidef_set_led_netdev "wan" "wan" "blue:uplink" "eth0"
|
||||
;;
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4xi_wp|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
hfcl,ion4xe)
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wifi5" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wifi2" "phy1tpt"
|
||||
;;
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800)
|
||||
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" "tx rx link"
|
||||
;;
|
||||
yuncore,fap650|\
|
||||
yuncore,fap655|\
|
||||
muxi,ap3220l)
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
@@ -13,6 +13,8 @@ qcom_setup_interfaces()
|
||||
|
||||
case $board in
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4xe)
|
||||
ucidef_set_interface_wan "eth0 eth1"
|
||||
ucidef_set_interface_lan ""
|
||||
@@ -31,20 +33,55 @@ qcom_setup_interfaces()
|
||||
cig,wf194c|\
|
||||
cig,wf194c4|\
|
||||
edgecore,eap106|\
|
||||
indio,um-310ax-v1|\
|
||||
indio,um-510axp-v1|\
|
||||
indio,um-510axm-v1|\
|
||||
qcom,ipq5018-mp03.1|\
|
||||
qcom,ipq5018-mp03.3|\
|
||||
sercomm,wallaby)
|
||||
yuncore,ax840|\
|
||||
motorola,q14|\
|
||||
sercomm,wallaby|\
|
||||
plasmacloud,pax1800-v1|\
|
||||
plasmacloud,pax1800-v2)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
ucidef_set_interface_wan "eth1"
|
||||
;;
|
||||
edgecore,eap101)
|
||||
edgecore,eap101|\
|
||||
glinet,axt1800)
|
||||
ucidef_set_interface_lan "eth1 eth2"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
edgecore,eap102|\
|
||||
edgecore,eap104|\
|
||||
liteon,wpx8324|\
|
||||
wallys,dr6018|\
|
||||
cig,wf188n|\
|
||||
cig,wf196)
|
||||
cig,wf196|\
|
||||
muxi,ap3220l)
|
||||
ucidef_set_interface_lan "eth1"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
cig,wf660a)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
cig,wf186w)
|
||||
ucidef_add_switch "switch0" "4:wan" "0:lan" "1:lan" "2:lan" "3:lan" "6@eth0"
|
||||
;;
|
||||
cig,wf186h)
|
||||
ucidef_add_switch "switch0" "4:wan" "1:lan" "2:lan" "6@eth0"
|
||||
;;
|
||||
yuncore,fap650)
|
||||
ucidef_set_interface_lan "eth3 eth2 eth1 eth0"
|
||||
ucidef_set_interface_wan "eth4"
|
||||
;;
|
||||
hfcl,ion4xi_wp)
|
||||
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
|
||||
ucidef_set_interface_wan "eth4"
|
||||
;;
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
hfcl,ion4xi_HMR)
|
||||
ucidef_set_interface_lan "eth1"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
@@ -52,11 +89,22 @@ qcom_setup_interfaces()
|
||||
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
|
||||
ucidef_set_interface_wan "eth4"
|
||||
;;
|
||||
wallys,dr6018-v4)
|
||||
wallys,dr6018-v4|\
|
||||
glinet,ax1800|\
|
||||
meshpp,s618-cp03|\
|
||||
meshpp,s618-cp01)
|
||||
ucidef_set_interface_lan "eth1 eth2 eth3 eth4"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
cybertan,eww622-a1|\
|
||||
cybertan,eww622-a1)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
xunison,d50-5g)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_set_interface_lan "eth1"
|
||||
;;
|
||||
qcom,ipq5018-mp03.1)
|
||||
ucidef_set_interface_lan "eth1"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
@@ -64,6 +112,42 @@ qcom_setup_interfaces()
|
||||
ucidef_add_switch_attr "switch1" "enable" "false"
|
||||
ucidef_add_switch_attr "switch1" "reset" "true"
|
||||
;;
|
||||
qcom,ipq5018-mp03.3)
|
||||
ucidef_set_interface_lan "eth1"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch1"
|
||||
ucidef_add_switch_attr "switch1" "enable" "false"
|
||||
ucidef_add_switch_attr "switch1" "reset" "true"
|
||||
;;
|
||||
edgecore,eap104)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
cybertan,eww631-a1)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch1"
|
||||
ucidef_add_switch_attr "switch1" "enable" "false"
|
||||
ucidef_add_switch_attr "switch1" "reset" "true"
|
||||
;;
|
||||
cybertan,eww631-b1)
|
||||
ucidef_add_switch "switch0"
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_set_interface_lan ""
|
||||
ucidef_add_switch "switch1"
|
||||
ucidef_add_switch_attr "switch1" "enable" "false"
|
||||
ucidef_add_switch_attr "switch1" "reset" "true"
|
||||
;;
|
||||
wallys,dr5018)
|
||||
ucidef_set_interface_lan "eth0 eth1"
|
||||
ucidef_add_switch "switch1"
|
||||
ucidef_add_switch_attr "switch1" "enable" "false"
|
||||
ucidef_add_switch_attr "switch1" "reset" "true"
|
||||
;;
|
||||
yuncore,fap655)
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -74,20 +158,119 @@ qcom_setup_macs()
|
||||
case $board in
|
||||
cig,wf194c|\
|
||||
cig,wf194c4)
|
||||
mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2)
|
||||
mtd=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mtd" ] && return;
|
||||
mac=$(grep BaseMacAddress= $mtd | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth0 $lan_mac
|
||||
ucidef_set_network_device_mac eth1 $wan_mac
|
||||
ip link set eth0 address $lan_mac
|
||||
ip link set eth1 address $wan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
cig,wf186w)
|
||||
mtd=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mtd" ] && return;
|
||||
mac=$(grep BaseMacAddress= $mtd | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
#lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
# ucidef_set_network_device_mac eth1 $wan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
# ip link set eth1 address $wan_mac
|
||||
# ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
cig,wf186h)
|
||||
mtd=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mtd" ] && return;
|
||||
mac=$(grep BaseMacAddress= $mtd | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
;;
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1)
|
||||
mac=$(grep -i -m 1 BaseMacAddress= /dev/`cat /proc/mtd | grep APPSBLENV | cut -d: -f1` | cut -d= -f2)
|
||||
[ -z "$mac"] && mac="00:11:22:33:44:00"
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
cig,wf188n|\
|
||||
cig,wf196)
|
||||
mtd=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mtd" ] && return;
|
||||
mac=$(grep BaseMacAddress= $mtd | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth1 $lan_mac
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
ip link set eth1 address $lan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
cig,wf660a)
|
||||
mmc_dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mmc_dev" ] && mmc_dev=$(find_mmc_part "0:APPSBLENV")
|
||||
[ -z "$mmc_dev" ] && return
|
||||
mac=$(grep BaseMacAddress= $mmc_dev | cut -dx -f2)
|
||||
[ -z "$mac" ] && return;
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
;;
|
||||
cybertan,eww622-a1)
|
||||
mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2)
|
||||
[ -z "$mac"] && mac="00:11:22:33:44:55"
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ucidef_set_network_device_mac eth1 $lan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
indio,um-310ax-v1|\
|
||||
indio,um-510axp-v1|\
|
||||
indio,um-510axm-v1|\
|
||||
yuncore,ax840)
|
||||
wan_mac=$(cat /sys/class/net/eth1/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
;;
|
||||
yuncore,fap650)
|
||||
wan_mac=$(cat /sys/class/net/eth4/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
;;
|
||||
yuncore,fap655)
|
||||
wan_mac=$(cat /sys/class/net/eth0/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
;;
|
||||
muxi,ap3220l)
|
||||
wan_mac=$(mtd_get_mac_binary 0:Product_Info 0x5b)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ucidef_set_network_device_mac eth1 $lan_mac
|
||||
ip link set eth0 address $wan_mac
|
||||
ip link set eth1 address $lan_mac
|
||||
;;
|
||||
*)
|
||||
wan_mac=$(cat /sys/class/net/eth0/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
;;
|
||||
wallys,dr5018)
|
||||
mac=$(grep -i -m 1 BaseMacAddress= /dev/`cat /proc/mtd | grep APPSBLENV | cut -d: -f1` | cut -d= -f2)
|
||||
[ -z "$mac"] && mac="00:11:22:33:44:00"
|
||||
wan_mac=$(macaddr_canonicalize $mac)
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
ucidef_set_label_macaddr $wan_mac
|
||||
;;
|
||||
esac
|
||||
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
||||
[ -n "$wan_mac" ] && ucidef_set_label_macaddr "$wan_mac"
|
||||
}
|
||||
|
||||
board_config_update
|
||||
|
||||
@@ -39,32 +39,86 @@ ath11k_generate_macs_wf194() {
|
||||
echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_ion4x() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
wifimac0=$(grep WLAN0_BASEMAC= /dev/mtd15 |cut -d '=' -f2)
|
||||
wifimac1=$(grep WLAN1_BASEMAC= /dev/mtd15 |cut -d '=' -f2)
|
||||
wifimac2=00:00:00:00:00:00
|
||||
ath11k_generate_macs_ion4x() {
|
||||
local dev=$(find_mtd_chardev "0:ART")
|
||||
touch /lib/firmware/ath11k-macs
|
||||
wifimac0=$(grep WLAN0_BASEMAC= $dev |cut -d '=' -f2)
|
||||
wifimac1=$(grep WLAN1_BASEMAC= $dev |cut -d '=' -f2)
|
||||
wifimac2=00:00:00:00:00:00
|
||||
echo -ne \\x${wifimac0//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${wifimac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${wifimac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_pax1800() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
eth=$(cat /sys/class/net/eth0/address)
|
||||
mac1=$(macaddr_add $eth 10)
|
||||
mac2=$(macaddr_add $eth 2)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_wf660a() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
mmc_dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
[ -z "$mmc_dev" ] && mmc_dev=$(find_mmc_part "0:APPSBLENV")
|
||||
[ -n "$mmc_dev" ] && mac=$(grep BaseMacAddress= $mmc_dev | cut -dx -f2)
|
||||
eth=$(macaddr_canonicalize $mac)
|
||||
mac1=$(macaddr_add $eth 1)
|
||||
mac2=$(macaddr_add $eth 2)
|
||||
mac3=$(macaddr_add $eth 3)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_wf186w() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
local dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
mac=$(grep BaseMacAddress= $dev | cut -dx -f2)
|
||||
eth=$(macaddr_canonicalize $mac)
|
||||
mac1=$(macaddr_add $eth 2)
|
||||
mac2=$(macaddr_add $eth 3)
|
||||
mac3=$(macaddr_add $eth 4)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
ath11k_generate_macs_wf186h() {
|
||||
touch /lib/firmware/ath11k-macs
|
||||
local dev=$(find_mtd_chardev "0:APPSBLENV")
|
||||
mac=$(grep BaseMacAddress= $dev | cut -dx -f2)
|
||||
eth=$(macaddr_canonicalize $mac)
|
||||
mac1=$(macaddr_add $eth 2)
|
||||
mac2=$(macaddr_add $eth 3)
|
||||
mac3=$(macaddr_add $eth 4)
|
||||
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs
|
||||
}
|
||||
|
||||
|
||||
caldata_die() {
|
||||
echo "caldata: " "$*"
|
||||
exit 1
|
||||
echo "caldata: " "$*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
caldata_extract() {
|
||||
local part=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
local mtd
|
||||
local part=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
local mtd
|
||||
|
||||
mtd=$(find_mtd_chardev $part)
|
||||
[ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
|
||||
mtd=$(find_mtd_chardev $part)
|
||||
if [ -z "$mtd" ]; then
|
||||
mtd=/dev/$(echo $(find_mmc_part $part) | sed 's/^.\{5\}//')
|
||||
fi
|
||||
[ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
|
||||
|
||||
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
||||
caldata_die "failed to extract calibration data from $mtd"
|
||||
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
||||
caldata_die "failed to extract calibration data from $mtd"
|
||||
}
|
||||
|
||||
board=$(board_name)
|
||||
@@ -77,12 +131,15 @@ case "$FIRMWARE" in
|
||||
cig,wf196|\
|
||||
edgecore,eap102 |\
|
||||
edgecore,eap106 |\
|
||||
indio,um-310ax-v1|\
|
||||
indio,um-510axp-v1|\
|
||||
indio,um-510axm-v1|\
|
||||
qcom,ipq807x-hk01|\
|
||||
qcom,ipq807x-hk14|\
|
||||
tplink,ex227|\
|
||||
tplink,ex447|\
|
||||
sercomm,wallaby)
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -90,40 +147,91 @@ case "$FIRMWARE" in
|
||||
case "$board" in
|
||||
cig,wf188|\
|
||||
cig,wf188n|\
|
||||
cig,wf660a|\
|
||||
edgecore,eap101|\
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4xe|\
|
||||
hfcl,ion4xi_wp|\
|
||||
wallys,dr6018|\
|
||||
wallys,dr6018-v4|\
|
||||
meshpp,ipq6018-cp01|\
|
||||
meshpp,ipq6018-cp03|\
|
||||
qcom,ipq6018-cp03|\
|
||||
qcom,ipq6018-cp01|\
|
||||
xiaomi,ax1800)
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
xiaomi,ax1800|\
|
||||
glinet,ax1800|\
|
||||
yuncore,ax840|\
|
||||
yuncore,fap650|\
|
||||
plasmacloud,pax1800-v1|\
|
||||
plasmacloud,pax1800-v2)
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ath11k/IPQ5018/hw1.0/caldata.bin)
|
||||
case "$board" in
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
cybertan,eww622-a1|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
wallys,dr5018|\
|
||||
edgecore,eap104|\
|
||||
yuncore,fap655|\
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
liteon,wpx8324|\
|
||||
motorola,q14|\
|
||||
muxi,ap3220l|\
|
||||
xunison,d50-5g|\
|
||||
qcom,ipq5018-mp03.1)
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
caldata_extract "0:ART" 0x1000 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ath11k/qcn6122/hw1.0/caldata_1.bin)
|
||||
case "$board" in
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
wallys,dr5018|\
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
yuncore,fap655|\
|
||||
motorola,q14)
|
||||
caldata_extract "0:ART" 0x26800 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ath11k/qcn6122/hw1.0/caldata_2.bin)
|
||||
case "$board" in
|
||||
edgecore,eap104)
|
||||
caldata_extract "0:ART" 0x4c000 0x20000
|
||||
motorola,q14|\
|
||||
wallys,dr5018|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
edgecore,eap104|\
|
||||
liteon,wpx8324)
|
||||
caldata_extract "0:ART" 0x4c000 0x20000
|
||||
;;
|
||||
muxi,ap3220l)
|
||||
caldata_extract "0:ART" 0x26800 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ath11k/QCN9074/hw1.0/caldata_1.bin)
|
||||
case "$board" in
|
||||
cig,wf196|\
|
||||
wallys,dr6018-v4|\
|
||||
cybertan,eww622-a1|\
|
||||
xunison,d50-5g|\
|
||||
qcom,ipq5018-mp03.1|\
|
||||
qcom,ipq807x-hk14)
|
||||
caldata_extract "0:ART" 0x26800 0x20000
|
||||
caldata_extract "0:ART" 0x26800 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -131,27 +239,54 @@ ath11k/QCN9074/hw1.0/caldata_2.bin)
|
||||
case "$board" in
|
||||
qcom,ipq807x-hk14|\
|
||||
qcom,ipq5018-mp03.3)
|
||||
caldata_extract "0:ART" 0x4C000 0x20000
|
||||
caldata_extract "0:ART" 0x4C000 0x20000
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ath11k-macs)
|
||||
case "$board" in
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4xe)
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
hfcl,ion4xi_wp|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4xe)
|
||||
ath11k_generate_macs_ion4x
|
||||
;;
|
||||
edgecore,eap101)
|
||||
ath11k_generate_macs_eap101
|
||||
;;
|
||||
yuncore,ax840|\
|
||||
yuncore,fap655|\
|
||||
edgecore,eap102|\
|
||||
edgecore,eap104|\
|
||||
edgecore,eap106|\
|
||||
indio,um-310ax-v1|\
|
||||
indio,um-510axp-v1|\
|
||||
indio,um-510axm-v1|\
|
||||
xunison,d50-5g|\
|
||||
cig,wf188n)
|
||||
ath11k_generate_macs
|
||||
;;
|
||||
cig,wf194c|\
|
||||
cig,wf194c)
|
||||
cig,wf194c4|\
|
||||
cig,wf196)
|
||||
ath11k_generate_macs_wf194
|
||||
;;
|
||||
plasmacloud,pax1800-v1|\
|
||||
plasmacloud,pax1800-v2)
|
||||
ath11k_generate_macs_pax1800
|
||||
;;
|
||||
cig,wf660a)
|
||||
ath11k_generate_macs_wf660a
|
||||
;;
|
||||
cig,wf186w)
|
||||
ath11k_generate_macs_wf186w
|
||||
;;
|
||||
cig,wf186h)
|
||||
ath11k_generate_macs_wf186h
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
40
feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/50-dvlan
Normal file
40
feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/50-dvlan
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
debug() {
|
||||
logger -t HOTPLUG-DVLAN "$*"
|
||||
}
|
||||
|
||||
if [ "${INTERFACE:0:4}" != "wlan" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$(board_name)" in
|
||||
"cig,wf186w")
|
||||
wan_iface="eth0"
|
||||
switch_dev="switch0"
|
||||
switch_wan_port=4
|
||||
switch_cpu_port=6
|
||||
;;
|
||||
|
||||
*)
|
||||
exit 0
|
||||
esac
|
||||
|
||||
VSTR="$(echo $INTERFACE | egrep -o 'v([0-9]+)$')"
|
||||
[ -z "$VSTR" ] && exit 0
|
||||
VID="${VSTR:1}"
|
||||
[ $VID -lt 1 -o $VID -gt 4096 ] && exit 0
|
||||
|
||||
if [ "$ACTION" = "add" ]; then
|
||||
debug "[$INTERFACE] Dynamic VLAN $VID added, configuring switch"
|
||||
swconfig dev ${switch_dev} vlan $VID set ports "${switch_wan_port}t ${switch_cpu_port}t"
|
||||
elif [ "$ACTION" = "remove" ]; then
|
||||
let cnt="$(bridge vlan show vid $VID | egrep "^wlan" | wc -l)"
|
||||
debug "[$INTERFACE] Dynamic VLAN interface removed, references left = $cnt"
|
||||
if [ $cnt -eq 0 ]; then
|
||||
debug "[$INTERFACE] No more references, removing $VID from switch"
|
||||
swconfig dev ${switch_dev} vlan $VID set ports ""
|
||||
fi
|
||||
fi
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
mac=$(cat /etc/board.json | jsonfilter -e '@["network-device"]["'$DEVICENAME'"]'.macaddr)
|
||||
mac=$(cat /etc/board.json | jsonfilter -e '@["network_device"]["'$DEVICENAME'"]'.macaddr)
|
||||
[ -n "$mac" ] && ip link set $DEVICENAME address $mac
|
||||
|
||||
@@ -19,4 +19,12 @@ boot() {
|
||||
ssdk_sh debug phy set 8 0x4004c441 0x8
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$(board_name)" in
|
||||
cig,wf196)
|
||||
# setup the leds
|
||||
ssdk_sh debug phy set 0 0x401ec431 0xc00f
|
||||
ssdk_sh debug phy set 0 0x401ec430 0x806f
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -4,8 +4,20 @@ START=99
|
||||
|
||||
boot() {
|
||||
case "$(board_name)" in
|
||||
hfcl,ion4xe|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
hfcl,ion4xi_wp|\
|
||||
hfcl,ion4xi)
|
||||
fw_setenv boot_count 0
|
||||
;;
|
||||
edgecore,eap101|\
|
||||
edgecore,eap102)
|
||||
avail=$(fw_printenv -n upgrade_available)
|
||||
[ "${avail}" -eq 1 ] || fw_setenv upgrade_available 1
|
||||
fw_setenv bootcount 0
|
||||
;;
|
||||
esac
|
||||
|
||||
126
feeds/ipq807x/ipq807x/base-files/lib/upgrade/dualboot_datachk.sh
Normal file
126
feeds/ipq807x/ipq807x/base-files/lib/upgrade/dualboot_datachk.sh
Normal file
@@ -0,0 +1,126 @@
|
||||
# The U-Boot loader with the datachk patchset for dualbooting requires image
|
||||
# sizes and checksums to be provided in the U-Boot environment.
|
||||
# The devices come with 2 main partitions - while one is active
|
||||
# sysupgrade will flash the other. The boot order is changed to boot the
|
||||
# newly flashed partition. If the new partition can't be booted due to
|
||||
# upgrade failures the previously used partition is loaded.
|
||||
|
||||
platform_post_upgrade_sanity_check()
|
||||
{
|
||||
local part_name=$1
|
||||
local inactive_mtd=$2
|
||||
local cfg_md5=$3
|
||||
local part_offset=$4
|
||||
local part_size=$5
|
||||
|
||||
md5_part_disk=$(dd if=/dev/${inactive_mtd} bs=$((64*1024)) skip=$((part_offset / (64*1024))) count=$((part_size / (64*1024))) 2>&- | md5sum | awk '{print $1}')
|
||||
|
||||
if [ "${cfg_md5}" != "${md5_part_disk}" ]; then
|
||||
echo "post-flashing checksum mismatch: ${part_name}" >&2
|
||||
echo "${cfg_md5} != ${md5_part_disk}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
platform_do_upgrade_dualboot_datachk() {
|
||||
local tar_file="$1"
|
||||
local restore_backup
|
||||
local primary_kernel_mtd
|
||||
|
||||
local setenv_script="/tmp/fw_env_upgrade"
|
||||
|
||||
local kernel_mtd="$(find_mtd_index $PART_NAME)"
|
||||
local kernel_offset="$(cat /sys/class/mtd/mtd${kernel_mtd}/offset)"
|
||||
local total_size="$(cat /sys/class/mtd/mtd${kernel_mtd}/size)"
|
||||
|
||||
# detect to which flash region the new image is written to.
|
||||
#
|
||||
# 1. check what is the mtd index for the first flash region on this
|
||||
# device
|
||||
# 2. check if the target partition ("inactive") has the mtd index of
|
||||
# the first flash region
|
||||
#
|
||||
# - when it is: the new bootseq will be 1,2 and the first region is
|
||||
# modified
|
||||
# - when it isnt: bootseq will be 2,1 and the second region is
|
||||
# modified
|
||||
#
|
||||
# The detection has to be done via the hardcoded mtd partition because
|
||||
# the current boot might be done with the fallback region. Let us
|
||||
# assume that the current bootseq is 1,2. The bootloader detected that
|
||||
# the image in flash region 1 is corrupt and thus switches to flash
|
||||
# region 2. The bootseq in the u-boot-env is now still the same and
|
||||
# the sysupgrade code can now only rely on the actual mtd indexes and
|
||||
# not the bootseq variable to detect the currently booted flash
|
||||
# region/image.
|
||||
#
|
||||
# In the above example, an implementation which uses bootseq ("1,2") to
|
||||
# detect the currently booted image would assume that region 1 is booted
|
||||
# and then overwrite the variables for the wrong flash region (aka the
|
||||
# one which isn't modified). This could result in a device which doesn't
|
||||
# boot anymore to Linux until it was reflashed with ap51-flash.
|
||||
local next_boot_part="1"
|
||||
case "$(board_name)" in
|
||||
plasmacloud,pax1800-v1|\
|
||||
plasmacloud,pax1800-v2)
|
||||
primary_kernel_mtd=9
|
||||
;;
|
||||
*)
|
||||
echo "failed to detect primary kernel mtd partition for board"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
[ "$kernel_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
|
||||
local kernel_length=$(tar xf $tar_file ${board_dir}/kernel -O | wc -c)
|
||||
local rootfs_length=$(tar xf $tar_file ${board_dir}/root -O | wc -c)
|
||||
# rootfs without EOF marker
|
||||
rootfs_length=$((rootfs_length-4))
|
||||
|
||||
local kernel_md5=$(tar xf $tar_file ${board_dir}/kernel -O | md5sum); kernel_md5="${kernel_md5%% *}"
|
||||
# md5 checksum of rootfs with EOF marker
|
||||
local rootfs_md5=$(tar xf $tar_file ${board_dir}/root -O | dd bs=1 count=$rootfs_length | md5sum); rootfs_md5="${rootfs_md5%% *}"
|
||||
|
||||
#
|
||||
# add tar support to get_image() to use default_do_upgrade() instead?
|
||||
#
|
||||
|
||||
# take care of restoring a saved config
|
||||
[ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}"
|
||||
|
||||
mtd -q erase inactive
|
||||
tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME
|
||||
tar xf $tar_file ${board_dir}/kernel -O | mtd -n write - $PART_NAME
|
||||
|
||||
platform_post_upgrade_sanity_check "kernel" "mtd${kernel_mtd}" $kernel_md5 0 $kernel_length || return 1
|
||||
platform_post_upgrade_sanity_check "rootfs" "mtd${kernel_mtd}" $rootfs_md5 $kernel_length $rootfs_length || return 1
|
||||
|
||||
# prepare new u-boot env
|
||||
if [ "$next_boot_part" = "1" ]; then
|
||||
echo "bootseq 1,2" > $setenv_script
|
||||
else
|
||||
echo "bootseq 2,1" > $setenv_script
|
||||
fi
|
||||
|
||||
printf "kernel_size_%i 0x%08x\n" $next_boot_part $kernel_length >> $setenv_script
|
||||
printf "vmlinux_start_addr 0x%08x\n" ${kernel_offset} >> $setenv_script
|
||||
printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script
|
||||
printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script
|
||||
|
||||
printf "rootfs_size_%i 0x%08x\n" $next_boot_part $((total_size-kernel_length)) >> $setenv_script
|
||||
printf "rootfs_start_addr 0x%08x\n" $((kernel_offset+kernel_length)) >> $setenv_script
|
||||
printf "rootfs_size 0x%08x\n" ${rootfs_length} >> $setenv_script
|
||||
printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script
|
||||
|
||||
# store u-boot env changes
|
||||
mkdir -p /var/lock
|
||||
fw_setenv -s $setenv_script || {
|
||||
echo "failed to update U-Boot environment"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,168 @@
|
||||
. /lib/functions/system.sh
|
||||
|
||||
qca_do_upgrade() {
|
||||
local tar_file="$1"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
RAMFS_COPY_BIN='fw_setenv'
|
||||
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock /tmp/downgrade'
|
||||
|
||||
qca_do_upgrade() {
|
||||
local tar_file="$1"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
local dev=$(find_mtd_chardev "0:HLOS")
|
||||
|
||||
tar Oxf $tar_file ${board_dir}/kernel | mtd write - ${dev}
|
||||
tar Oxf $tar_file ${board_dir}/kernel | mtd write - ${dev}
|
||||
|
||||
if [ -n "$UPGRADE_BACKUP" ]; then
|
||||
tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs
|
||||
else
|
||||
tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs
|
||||
fi
|
||||
if [ -n "$UPGRADE_BACKUP" ]; then
|
||||
tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs
|
||||
else
|
||||
tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs
|
||||
fi
|
||||
}
|
||||
|
||||
find_mmc_part() {
|
||||
local DEVNAME PARTNAME
|
||||
|
||||
if grep -q "$1" /proc/mtd; then
|
||||
echo "" && return 0
|
||||
fi
|
||||
|
||||
for DEVNAME in /sys/block/mmcblk*/mmcblk*p*; do
|
||||
PARTNAME=$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=')
|
||||
[ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0
|
||||
done
|
||||
}
|
||||
|
||||
do_flash_emmc() {
|
||||
local tar_file=$1
|
||||
local emmcblock=$(find_mmc_part $2)
|
||||
local board_dir=$3
|
||||
local part=$4
|
||||
|
||||
[ -b "$emmcblock" ] || emmcblock=$(find_mmc_part $2)
|
||||
|
||||
[ -z "$emmcblock" ] && {
|
||||
echo failed to find $2
|
||||
return
|
||||
}
|
||||
|
||||
echo erase $4 / $emmcblock
|
||||
dd if=/dev/zero of=${emmcblock} 2> /dev/null
|
||||
echo flash $4
|
||||
tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock}
|
||||
}
|
||||
|
||||
spi_nor_emmc_do_upgrade_bootconfig() {
|
||||
local tar_file="$1"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
[ -f /proc/boot_info/getbinary_bootconfig ] || {
|
||||
echo "bootconfig does not exist"
|
||||
exit
|
||||
}
|
||||
CI_ROOTPART="$(cat /proc/boot_info/rootfs/upgradepartition)"
|
||||
CI_KERNPART="$(cat /proc/boot_info/0:HLOS/upgradepartition)"
|
||||
|
||||
[ -n "$CI_KERNPART" -a -n "$CI_ROOTPART" ] || {
|
||||
echo "kernel or rootfs partition is unknown"
|
||||
exit
|
||||
}
|
||||
|
||||
local primary="0"
|
||||
[ "$(cat /proc/boot_info/rootfs/primaryboot)" = "0" ] && primary="1"
|
||||
echo "$primary" > /proc/boot_info/rootfs/primaryboot 2>/dev/null
|
||||
echo "$primary" > /proc/boot_info/0:HLOS/primaryboot 2>/dev/null
|
||||
cp /proc/boot_info/getbinary_bootconfig /tmp/bootconfig
|
||||
|
||||
do_flash_emmc $tar_file $CI_KERNPART $board_dir kernel
|
||||
do_flash_emmc $tar_file $CI_ROOTPART $board_dir root
|
||||
|
||||
local emmcblock="$(find_mmc_part "rootfs_data")"
|
||||
if [ -e "$emmcblock" ]; then
|
||||
mkfs.ext4 -F "$emmcblock"
|
||||
fi
|
||||
|
||||
for part in "0:BOOTCONFIG" "0:BOOTCONFIG1"; do
|
||||
local mtdchar=$(echo $(find_mtd_chardev $part) | sed 's/^.\{5\}//')
|
||||
if [ -n "$mtdchar" ]; then
|
||||
echo start to update $mtdchar
|
||||
mtd -qq write /proc/boot_info/getbinary_bootconfig "/dev/${mtdchar}" 2>/dev/null && echo update mtd $mtdchar
|
||||
else
|
||||
emmcblock=$(find_mmc_part $part)
|
||||
echo erase ${emmcblock}
|
||||
dd if=/dev/zero of=${emmcblock} 2> /dev/null
|
||||
echo update $emmcblock
|
||||
dd if=/tmp/bootconfig of=${emmcblock} 2> /dev/null
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
emmc_do_upgrade() {
|
||||
local tar_file="$1"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
do_flash_emmc $tar_file '0:HLOS' $board_dir kernel
|
||||
do_flash_emmc $tar_file 'rootfs' $board_dir root
|
||||
|
||||
local emmcblock="$(find_mmc_part "rootfs_data")"
|
||||
if [ -e "$emmcblock" ]; then
|
||||
mkfs.ext4 -F "$emmcblock"
|
||||
fi
|
||||
}
|
||||
|
||||
platform_check_image() {
|
||||
local magic_long="$(get_magic_long "$1")"
|
||||
board=$(board_name)
|
||||
case $board in
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
cig,wf188|\
|
||||
cig,wf660a|\
|
||||
cig,wf188n|\
|
||||
cig,wf194c|\
|
||||
cig,wf194c4|\
|
||||
cig,wf196|\
|
||||
cybertan,eww622-a1|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800|\
|
||||
indio,um-310ax-v1|\
|
||||
indio,um-510axp-v1|\
|
||||
indio,um-510axm-v1|\
|
||||
wallys,dr5018|\
|
||||
wallys,dr6018|\
|
||||
wallys,dr6018-v4|\
|
||||
edgecore,eap101|\
|
||||
edgecore,eap102|\
|
||||
edgecore,eap104|\
|
||||
liteon,wpx8324|\
|
||||
edgecore,eap106|\
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
hfcl,ion4xi_wp|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4xe|\
|
||||
muxi,ap3220l|\
|
||||
plasmacloud,pax1800-v1|\
|
||||
plasmacloud,pax1800-v2|\
|
||||
tplink,ex227|\
|
||||
tplink,ex447|\
|
||||
yuncore,ax840|\
|
||||
yuncore,fap650|\
|
||||
yuncore,fap655|\
|
||||
motorola,q14|\
|
||||
muxi,ap3220l|\
|
||||
qcom,ipq6018-cp01|\
|
||||
qcom,ipq807x-hk01|\
|
||||
qcom,ipq807x-hk14|\
|
||||
xunison,d50|\
|
||||
xunison,d50-5g|\
|
||||
qcom,ipq5018-mp03.3)
|
||||
[ "$magic_long" = "73797375" ] && return 0
|
||||
;;
|
||||
@@ -56,30 +180,108 @@ platform_do_upgrade() {
|
||||
cig,wf188)
|
||||
qca_do_upgrade $1
|
||||
;;
|
||||
cig,wf660a)
|
||||
spi_nor_emmc_do_upgrade_bootconfig $1
|
||||
;;
|
||||
motorola,q14)
|
||||
emmc_do_upgrade $1
|
||||
;;
|
||||
cig,wf188n|\
|
||||
cig,wf194c|\
|
||||
cig,wf194c4|\
|
||||
cig,wf196|\
|
||||
cybertan,eww622-a1|\
|
||||
edgecore,eap104|\
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4xe|\
|
||||
cybertan,eww631-a1|\
|
||||
cybertan,eww631-b1|\
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800|\
|
||||
indio,um-310ax-v1|\
|
||||
indio,um-510axp-v1|\
|
||||
indio,um-510axm-v1|\
|
||||
qcom,ipq6018-cp01|\
|
||||
qcom,ipq807x-hk01|\
|
||||
qcom,ipq807x-hk14|\
|
||||
xunison,d50|\
|
||||
xunison,d50-5g|\
|
||||
qcom,ipq5018-mp03.3|\
|
||||
wallys,dr5018|\
|
||||
wallys,dr6018|\
|
||||
wallys,dr6018-v4|\
|
||||
yuncore,fap650|\
|
||||
tplink,ex447|\
|
||||
tplink,ex227)
|
||||
tplink,ex227|\
|
||||
meshpp,s618-cp03|\
|
||||
meshpp,s618-cp01)
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
edgecore,eap106|\
|
||||
edgecore,eap102|\
|
||||
edgecore,eap101)
|
||||
hfcl,ion4xi|\
|
||||
hfcl,ion4x|\
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4xe)
|
||||
if grep -q rootfs_1 /proc/cmdline; then
|
||||
CI_UBIPART="rootfs"
|
||||
fw_setenv primary 0 || exit 1
|
||||
else
|
||||
CI_UBIPART="rootfs_1"
|
||||
fw_setenv primary 1 || exit 1
|
||||
fi
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
hfcl,ion4xi_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_HMR|\
|
||||
hfcl,ion4xi_wp)
|
||||
wp_part=$(fw_printenv primary | cut -d = -f2)
|
||||
echo "Current Primary is $wp_part"
|
||||
if [[ $wp_part == 1 ]]; then
|
||||
CI_UBIPART="rootfs"
|
||||
CI_FWSETENV="primary 0"
|
||||
else
|
||||
CI_UBIPART="rootfs_1"
|
||||
CI_FWSETENV="primary 1"
|
||||
fi
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
edgecore,eap104|\
|
||||
liteon,wpx8324|\
|
||||
edgecore,eap106)
|
||||
CI_UBIPART="rootfs1"
|
||||
[ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs"
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
edgecore,eap101|\
|
||||
edgecore,eap102)
|
||||
if [ "$(find_mtd_chardev rootfs)" ]; then
|
||||
CI_UBIPART="rootfs"
|
||||
else
|
||||
if [ -e /tmp/downgrade ]; then
|
||||
CI_UBIPART="rootfs1"
|
||||
fw_setenv active 1 || exit 1
|
||||
fw_setenv upgrade_available 0 || exit 1
|
||||
elif grep -q rootfs1 /proc/cmdline; then
|
||||
CI_UBIPART="rootfs2"
|
||||
CI_FWSETENV="active 2"
|
||||
else
|
||||
CI_UBIPART="rootfs1"
|
||||
CI_FWSETENV="active 1"
|
||||
fi
|
||||
fi
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
plasmacloud,pax1800-v1|\
|
||||
plasmacloud,pax1800-v2)
|
||||
PART_NAME="inactive"
|
||||
platform_do_upgrade_dualboot_datachk "$1"
|
||||
;;
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
yuncore,ax840|\
|
||||
yuncore,fap655)
|
||||
[ -f /proc/boot_info/rootfs/upgradepartition ] && {
|
||||
CI_UBIPART="$(cat /proc/boot_info/rootfs/upgradepartition)"
|
||||
CI_BOOTCFG=1
|
||||
}
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ CONFIG_BLK_DEV_NVME=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
# CONFIG_BOOTCONFIG_PARTITION is not set
|
||||
# CONFIG_VIRTIO_BLK is not set
|
||||
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
|
||||
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
|
||||
@@ -547,8 +548,8 @@ CONFIG_PROC_PAGE_MONITOR=y
|
||||
# CONFIG_PROC_STRIPPED is not set
|
||||
CONFIG_PSTORE=y
|
||||
CONFIG_PSTORE_RAM=y
|
||||
# CONFIG_PSTORE_CONSOLE is not set
|
||||
# CONFIG_PSTORE_PMSG is not set
|
||||
CONFIG_PSTORE_CONSOLE=y
|
||||
CONFIG_PSTORE_PMSG=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_IPQ4019=y
|
||||
# CONFIG_PWM_PCA9685 is not set
|
||||
@@ -823,7 +824,6 @@ CONFIG_SKB_FIXED_SIZE_2K=y
|
||||
CONFIG_AQ_PHY=y
|
||||
CONFIG_DIAG_CHAR=y
|
||||
# CONFIG_HW_RANDOM_VIRTIO is not set
|
||||
# CONFIG_BOOTCONFIG_PARTITION is not set
|
||||
# CONFIG_CRYPTO_DEV_QCEDEV is not set
|
||||
# CONFIG_CRYPTO_DEV_QCRYPTO is not set
|
||||
# CONFIG_MHI_BUS_TEST is not set
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts"
|
||||
|
||||
/ {
|
||||
model = "CyberTan EWW631-A1";
|
||||
compatible = "cybertan,eww631-a1", "qcom,ipq5018";
|
||||
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
10
feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-b1.dts
Executable file
10
feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-b1.dts
Executable file
@@ -0,0 +1,10 @@
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts"
|
||||
|
||||
/ {
|
||||
model = "CyberTan EWW631-B1";
|
||||
compatible = "cybertan,eww631-b1", "qcom,ipq5018";
|
||||
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_HMR.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-liteon-wpx8324.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-muxi-ap3220l.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-q14.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
10
feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-wallys-dr5018.dts
Executable file
10
feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-wallys-dr5018.dts
Executable file
@@ -0,0 +1,10 @@
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-wallys-dr5018.dts"
|
||||
|
||||
/ {
|
||||
model = "Wallys DR5018";
|
||||
compatible = "wallys,dr5018", "qcom,ipq5018";
|
||||
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-xunison-d50-5g.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-xunison-d50.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-yuncore-fap655.dts"
|
||||
|
||||
/ {
|
||||
pmuv8: pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-gl-axt1800.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x_2.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-indio-um-310ax-v1.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axm-v1.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axp-v1.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp01.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp03.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v1.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v2.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-yuncore-ax840.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-yuncore-fap650.dts"
|
||||
#include "qcom-ipq6018.dtsi"
|
||||
1441
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-hfcl-ion4xi_HMR.dtsi
Executable file
1441
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-hfcl-ion4xi_HMR.dtsi
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,965 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "qcom-ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "CIG wf186h";
|
||||
compatible = "cig,wf186h","qcom,ipq5018-mp03.3", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* + | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 16MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C000000 | 13MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4CD00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4CE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4CF00000 | 15MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4DE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4DF00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |QCN9000 | 0x4E000000 | 17MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | MHI1 | 0x4F100000 | 16MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x3000000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01000000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4c000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4c000000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4CD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region:q6_etr_dump@4CE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CF00000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4DE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4DF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn9000_region: qcn9000_pcie0@4E000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E000000 0x0 0x01100000>;
|
||||
};
|
||||
|
||||
mhi_region1: dma_pool1@4F100000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x4F100000 0x0 0x01000000>;
|
||||
};
|
||||
#elif __IPQ_MEM_PROFILE_512_MB__
|
||||
/* 512 MB Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 16MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C000000 | 14MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4CE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4CF00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4D000000 | 2MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4D200000 | 16MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4E200000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4E400000 | 5MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |QCN9000 | 0x4E900000 | 30MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | MHI1 | 0x50700000 | 16MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x3900000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01000000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C000000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4CE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4CF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D000000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn9000_region: qcn9000_pcie0@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0x01E00000>;
|
||||
};
|
||||
|
||||
mhi_region1: dma_pool1@50700000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x50700000 0x0 0x01000000>;
|
||||
};
|
||||
#else
|
||||
/* 1G Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 16MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C000000 | 14MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4CE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4CF00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4D000000 | 2MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4D200000 | 16MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4E200000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4E400000 | 5MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |QCN9000 | 0x4E900000 | 45MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | MHI1 | 0x51600000 | 24MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x3900000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01000000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C000000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4CE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4CF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D000000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn9000_region: qcn9000_pcie0@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0x02D00000>;
|
||||
};
|
||||
|
||||
mhi_region1: dma_pool1@51600000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x51600000 0x0 0x01800000>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 35 0>;
|
||||
cig_clk_div = <0xff>;
|
||||
ethernet-phy@0 {
|
||||
reg = <0x1d>;
|
||||
};
|
||||
};
|
||||
|
||||
realtek@29{
|
||||
compatible = "realtek,rtl8367s";
|
||||
mii-bus = <&mdio1>;
|
||||
realtek,extif0 = <0 0 10 1 1 1 1 1 2>;
|
||||
switch = <&tlmm 35 0>;
|
||||
phy-addr = <29>;
|
||||
status = "ok";
|
||||
};
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
compatible = "qcom,ess-switch-ipq50xx";
|
||||
device_id = <0>;
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
forced-speed = <1000>;
|
||||
forced-duplex = <1>;
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wifi0: wifi@c000000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "rst";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio31", "gpio33";
|
||||
function = "blsp1_uart1";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
rst_button {
|
||||
pins = "gpio27";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
};
|
||||
audio_pins: audio_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio24";
|
||||
function = "audio_rxbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_2 {
|
||||
pins = "gpio25";
|
||||
function = "audio_rxfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_5 {
|
||||
pins = "gpio28";
|
||||
function = "audio_txbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
pwm_pins: pwm_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio0";
|
||||
function = "pwm10";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio1";
|
||||
function = "pwm20";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_3 {
|
||||
pins = "gpio45";
|
||||
function = "pwm3";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&soc {
|
||||
|
||||
pwm: pwm@0x1941010 {
|
||||
pinctrl-0 = <&pwm_pins>;
|
||||
pinctrl-names = "default";
|
||||
used-pwm-indices = <1>, <1>, <1>, <1>;
|
||||
dft-pwm-status = <1>, <0>, <0>, <0>;
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "disabled";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
status = "ok";
|
||||
perst-gpio = <&tlmm 18 1>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 15 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x2phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
qrtr_instance_id = <0x21>;
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
memory-region = <&mhi_region1>;
|
||||
#if !defined(__CNSS2__)
|
||||
base-addr = <0x4E900000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
etr-addr = <0x4FE00000>;
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
qcom,tgt-mem-mode = <0x1>;
|
||||
mhi,max-channels = <30>;
|
||||
mhi,timeout = <10000>;
|
||||
qcom,board_id = <0xa4>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&wifi3 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qfprom {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&tsens {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qcom_q6v5_wcss {
|
||||
qcom,multipd_arch;
|
||||
memory-region = <&q6_mem_regions>;
|
||||
qcom,share_bootargs;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
|
||||
/* IPQ5018 */
|
||||
q6v5_wcss_userpd1 {
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <1>;
|
||||
qca,auto-restart;
|
||||
qca,int_radio;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* QCN6122 5G */
|
||||
q6v5_wcss_userpd2 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <2>;
|
||||
qca,auto-restart;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&qgic_msi_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x0 0x4D000000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4D000000>;
|
||||
m3-dump-addr = <0x4CE00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x200000>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x0 0x4E400000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4E400000>;
|
||||
m3-dump-addr = <0x4E200000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
status = "ok";
|
||||
};
|
||||
965
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts
Executable file
965
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts
Executable file
@@ -0,0 +1,965 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "qcom-ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "CIG wf186w";
|
||||
compatible = "cig,wf186w","qcom,ipq5018-mp03.3", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* + | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 16MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C000000 | 13MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4CD00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4CE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4CF00000 | 15MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4DE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4DF00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |QCN9000 | 0x4E000000 | 17MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | MHI1 | 0x4F100000 | 16MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x3000000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01000000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4c000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4c000000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4CD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region:q6_etr_dump@4CE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CF00000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4DE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4DF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn9000_region: qcn9000_pcie0@4E000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E000000 0x0 0x01100000>;
|
||||
};
|
||||
|
||||
mhi_region1: dma_pool1@4F100000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x4F100000 0x0 0x01000000>;
|
||||
};
|
||||
#elif __IPQ_MEM_PROFILE_512_MB__
|
||||
/* 512 MB Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 16MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C000000 | 14MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4CE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4CF00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4D000000 | 2MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4D200000 | 16MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4E200000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4E400000 | 5MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |QCN9000 | 0x4E900000 | 30MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | MHI1 | 0x50700000 | 16MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x3900000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01000000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C000000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4CE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4CF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D000000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn9000_region: qcn9000_pcie0@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0x01E00000>;
|
||||
};
|
||||
|
||||
mhi_region1: dma_pool1@50700000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x50700000 0x0 0x01000000>;
|
||||
};
|
||||
#else
|
||||
/* 1G Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 16MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C000000 | 14MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4CE00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4CF00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4D000000 | 2MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4D200000 | 16MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4E200000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | caldb | 0x4E400000 | 5MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |QCN9000 | 0x4E900000 | 45MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | MHI1 | 0x51600000 | 24MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x3900000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01000000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C000000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4CE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4CF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CF00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D000000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn9000_region: qcn9000_pcie0@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E900000 0x0 0x02D00000>;
|
||||
};
|
||||
|
||||
mhi_region1: dma_pool1@51600000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x51600000 0x0 0x01800000>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 35 0>;
|
||||
cig_clk_div = <0xff>;
|
||||
ethernet-phy@0 {
|
||||
reg = <0x1d>;
|
||||
};
|
||||
};
|
||||
|
||||
realtek@29{
|
||||
compatible = "realtek,rtl8367s";
|
||||
mii-bus = <&mdio1>;
|
||||
realtek,extif0 = <0 0 10 1 1 1 1 1 2>;
|
||||
switch = <&tlmm 35 0>;
|
||||
phy-addr = <29>;
|
||||
status = "ok";
|
||||
};
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
compatible = "qcom,ess-switch-ipq50xx";
|
||||
device_id = <0>;
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
forced-speed = <1000>;
|
||||
forced-duplex = <1>;
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wifi0: wifi@c000000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "rst";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio31", "gpio33";
|
||||
function = "blsp1_uart1";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
rst_button {
|
||||
pins = "gpio27";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
};
|
||||
audio_pins: audio_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio24";
|
||||
function = "audio_rxbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_2 {
|
||||
pins = "gpio25";
|
||||
function = "audio_rxfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_5 {
|
||||
pins = "gpio28";
|
||||
function = "audio_txbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
pwm_pins: pwm_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio0";
|
||||
function = "pwm10";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio1";
|
||||
function = "pwm20";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_3 {
|
||||
pins = "gpio45";
|
||||
function = "pwm3";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&soc {
|
||||
|
||||
pwm: pwm@0x1941010 {
|
||||
pinctrl-0 = <&pwm_pins>;
|
||||
pinctrl-names = "default";
|
||||
used-pwm-indices = <1>, <1>, <1>, <1>;
|
||||
dft-pwm-status = <1>, <0>, <0>, <0>;
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "disabled";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
status = "ok";
|
||||
perst-gpio = <&tlmm 18 1>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 15 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x2phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
qrtr_instance_id = <0x21>;
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
memory-region = <&mhi_region1>;
|
||||
#if !defined(__CNSS2__)
|
||||
base-addr = <0x4E900000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
etr-addr = <0x4FE00000>;
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
qcom,tgt-mem-mode = <0x1>;
|
||||
mhi,max-channels = <30>;
|
||||
mhi,timeout = <10000>;
|
||||
qcom,board_id = <0xa4>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&wifi3 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qfprom {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&tsens {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qcom_q6v5_wcss {
|
||||
qcom,multipd_arch;
|
||||
memory-region = <&q6_mem_regions>;
|
||||
qcom,share_bootargs;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
|
||||
/* IPQ5018 */
|
||||
q6v5_wcss_userpd1 {
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <1>;
|
||||
qca,auto-restart;
|
||||
qca,int_radio;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* QCN6122 5G */
|
||||
q6v5_wcss_userpd2 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <2>;
|
||||
qca,auto-restart;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&qgic_msi_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x0 0x4D000000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4D000000>;
|
||||
m3-dump-addr = <0x4CE00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x200000>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x0 0x4E400000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4E400000>;
|
||||
m3-dump-addr = <0x4E200000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
status = "ok";
|
||||
};
|
||||
@@ -32,6 +32,10 @@
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
led-boot = &led_sys;
|
||||
led-failsafe = &led_sys;
|
||||
led-running = &led_sys;
|
||||
led-upgrade = &led_sys;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -708,32 +712,20 @@
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@1 {
|
||||
led_sys: led@1 {
|
||||
label = "sys:blue";
|
||||
gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; /* GPIO_1 */
|
||||
/* default-state="on"; */
|
||||
linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on";
|
||||
};
|
||||
led@35 {
|
||||
label = "sys:green";
|
||||
gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* GPIO_35 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
led@31 {
|
||||
label = "sys:red";
|
||||
gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; /* GPIO_31 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,908 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "qcom-ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03.5-C1";
|
||||
compatible = "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E400000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 0x0 0x100000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "disabled";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
/*
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
*/
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
/*
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
*/
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: blsp0_uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio23", "gpio25", "gpio24", "gpio26";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
audio_pins: audio_pinmux {
|
||||
mux_1 {
|
||||
pins = "gpio24";
|
||||
function = "audio_rxbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_2 {
|
||||
pins = "gpio25";
|
||||
function = "audio_rxfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_3 {
|
||||
pins = "gpio26";
|
||||
function = "audio_rxd";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_4 {
|
||||
pins = "gpio27";
|
||||
function = "audio_txmclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_5 {
|
||||
pins = "gpio28";
|
||||
function = "audio_txbclk";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_6 {
|
||||
pins = "gpio29";
|
||||
function = "audio_txfsync";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
mux_7 {
|
||||
pins = "gpio30";
|
||||
function = "audio_txd";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
leds_pins: leds_pinmux {
|
||||
sys_blue {
|
||||
pins = "gpio30";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
sys_red {
|
||||
pins = "gpio36";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
sys_green {
|
||||
pins = "gpio37";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
gpio_leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@30 {
|
||||
label = "sys:blue";
|
||||
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */
|
||||
default-state="on";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
led@36 {
|
||||
label = "sys:red";
|
||||
gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; /* GPIO_36 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
led@37 {
|
||||
label = "sys:green";
|
||||
gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; /* GPIO_37 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "disabled";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 18 1>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 15 1>;
|
||||
};
|
||||
|
||||
&bt {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x2phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
&qfprom {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&tsens {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qcom_q6v5_wcss {
|
||||
qcom,multipd_arch;
|
||||
memory-region = <&q6_mem_regions>;
|
||||
qcom,share_bootargs;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
/* IPQ5018 */
|
||||
q6v5_wcss_userpd1 {
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <1>;
|
||||
qca,auto-restart;
|
||||
qca,int_radio;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* QCN6122 6G */
|
||||
q6v5_wcss_userpd2 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <2>;
|
||||
qca,auto-restart;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* QCN6122 5G */
|
||||
q6v5_wcss_userpd3 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <3>;
|
||||
qca,auto-restart;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&qgic_msi_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qgic_msi_1 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4D400000>;
|
||||
m3-dump-addr = <0x4D200000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x200000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -0,0 +1,791 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "qcom-ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP02.1";
|
||||
compatible = "qcom,ipq5018-mp02.1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
MP_256;
|
||||
/delete-property/ MP_512;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
//serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
|
||||
bootargs-append = " swiotlb=1";
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
/* 256 MB Profile
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* + | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Q6 | 0x4B000000 | 20MB |
|
||||
* | code/ | | |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* |IPQ5018 | 0x4C400000 | 13MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4D100000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4D300000 | 15MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4E200000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* |QCN6122 | 0x4E400000 | 15MB |
|
||||
* | data | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | M3 Dump| 0x4F300000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +=================================================+
|
||||
*/
|
||||
reserved-memory {
|
||||
/delete-node/ nss@40000000;
|
||||
|
||||
nss@40000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x40000000 0x0 0x0800000>;
|
||||
};
|
||||
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 0x0 0x100000>;
|
||||
};
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
/*
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
*/
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 38 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
ethernet-phy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
ethernet-phy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
|
||||
ethernet-phy@4 {
|
||||
reg = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x2>;
|
||||
ess-switch@0x39c00000 {
|
||||
compatible = "qcom,ess-switch-ipq50xx";
|
||||
device_id = <0>;
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
// mdiobus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
forced-speed = <1000>;
|
||||
forced-duplex = <1>;
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "low";
|
||||
};
|
||||
};
|
||||
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <0x26>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap (Port 6 GMAC) */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
qcom_q6v5_wcss@CD00000 {
|
||||
memory-region = <&q6_mem_regions>;
|
||||
};
|
||||
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
&sdhc_1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: blsp0_uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx {
|
||||
pins = "gpio23";
|
||||
function = "blsp1_uart2";
|
||||
drive-strength = <8>;
|
||||
input-enable;
|
||||
bias-disable;
|
||||
bias-pull-up;
|
||||
};
|
||||
blsp1_uart_tx {
|
||||
pins = "gpio25";
|
||||
function = "blsp1_uart2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-high;
|
||||
bias-pull-up;
|
||||
};
|
||||
blsp1_uart_rfr {
|
||||
pins = "gpio24";
|
||||
function = "blsp1_uart2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-high;
|
||||
bias-pull-up;
|
||||
};
|
||||
blsp1_uart_cts {
|
||||
pins = "gpio26";
|
||||
function = "blsp1_uart2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
input-enable;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
phy_pins: phy_pins {
|
||||
phy_intr {
|
||||
pins = "gpio25";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
phy_reset {
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
poe_pins: poe_pinmux {
|
||||
/*
|
||||
LAN port PoE output enable
|
||||
H --> enable; L --> disable (Default setting to H)
|
||||
*/
|
||||
mux_0 {
|
||||
pins = "gpio24";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
output-high;
|
||||
};
|
||||
|
||||
mux_1 { /* PSE_INT_N */
|
||||
pins = "gpio27";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
input;
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pinmux {
|
||||
sys_green {
|
||||
pins = "gpio1";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sys_blue {
|
||||
pins = "gpio30";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
sys_red {
|
||||
pins = "gpio46";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio_leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@1 {
|
||||
label = "sys:green";
|
||||
gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; /* GPIO_1/ATST_QP0 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
|
||||
led@30 {
|
||||
label = "sys:blue";
|
||||
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */
|
||||
default-state="on";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
|
||||
led@46 {
|
||||
label = "sys:red";
|
||||
gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; /* GPIO_46 */
|
||||
default-state="off";
|
||||
/* linux,default-trigger = "timer";
|
||||
active-delay = <700>;
|
||||
inactive-delay = <700>;
|
||||
default-state="on"; */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 27 1>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 15 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x2phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&qfprom {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&tsens {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qcom_q6v5_wcss {
|
||||
qcom,multipd_arch;
|
||||
qcom,share_bootargs;
|
||||
qcom,bootargs_smem = <507>;
|
||||
/* Please refer the IPQ50xx SoC Software doc to define pcie reset pin */
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x0F 0x0 0x0>;
|
||||
|
||||
/* IPQ5018 */
|
||||
q6v5_wcss_userpd1 {
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <1>;
|
||||
qca,auto-restart;
|
||||
qca,int_radio;
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
};
|
||||
|
||||
/* QCN6122 6G */
|
||||
q6v5_wcss_userpd2 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <2>;
|
||||
qca,auto-restart;
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
};
|
||||
|
||||
/* QCN6122 5G */
|
||||
q6v5_wcss_userpd3 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <3>;
|
||||
qca,auto-restart;
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qgic_msi_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qgic_msi_1 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 24G*/
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
qcom,board_id = <0x24>;
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D400000>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
nss-radio-priority = <0>;
|
||||
m3-dump-addr = <0x4D200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
qcom,board_id = <0x60>;
|
||||
qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4E800000>;
|
||||
m3-dump-addr = <0x4E600000>;
|
||||
nss-radio-priority = <1>;
|
||||
mem-region = <&q6_qcn6122_data1>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
1063
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts
Executable file
1063
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts
Executable file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1063
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts
Executable file
1063
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts
Executable file
File diff suppressed because it is too large
Load Diff
1441
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dtsi
Executable file
1441
feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dtsi
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,812 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "qcom-ipq5018.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Liteon WPX8324";
|
||||
compatible = "liteon,wpx8324", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
/*serial1 = &blsp1_uart2;*/
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E400000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 0x0 0x100000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
spi_2: spi@78b7000 { /* BLSP1 QUP2 */
|
||||
pinctrl-0 = <&blsp2_spi0_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
tpm0: slb9670@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <1>; /* CE1 */
|
||||
compatible = "infineon,slb9670";
|
||||
linux,modalias = "slb9670", "slb9670a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 26 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
};
|
||||
wifi0: wifi@c000000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_blue: led@19 {
|
||||
label = "blue:uplink";
|
||||
gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
led_orange: led@18 {
|
||||
label = "orange:wifi2";
|
||||
gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
led_green: led@39 {
|
||||
label = "green:wifi5";
|
||||
gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_blue {
|
||||
pins = "gpio19";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_orange {
|
||||
pins = "gpio18";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_green {
|
||||
pins = "gpio39";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
blsp0_uart_pins: uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp2_spi0_pins: blsp2_spi0_pins {
|
||||
mux {
|
||||
pins = "gpio31", "gpio32", "gpio33", "gpio34";
|
||||
function = "blsp2_spi0";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio18", "gpio19", "gpio39";
|
||||
/* function = "led0"; */
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio29";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&tlmm 29 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 28 0>;
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 18 1>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
status = "disabled";
|
||||
perst-gpio = <&tlmm 15 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x2phy {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
&qfprom {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&tsens {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qcom_q6v5_wcss {
|
||||
qcom,multipd_arch;
|
||||
memory-region = <&q6_mem_regions>;
|
||||
qcom,share_bootargs;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
/* IPQ5018 */
|
||||
q6v5_wcss_userpd1 {
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <1>;
|
||||
qca,auto-restart;
|
||||
qca,int_radio;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* QCN6122 6G */
|
||||
q6v5_wcss_userpd2 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <2>;
|
||||
qca,auto-restart;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* QCN6122 5G */
|
||||
q6v5_wcss_userpd3 {
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names ="fatal",
|
||||
"ready",
|
||||
"spawn_ack",
|
||||
"stop-ack";
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
qca,asid = <3>;
|
||||
qca,auto-restart;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&qgic_msi_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qgic_msi_1 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4D400000>;
|
||||
m3-dump-addr = <0x4D200000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x200000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x60>;
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
#else
|
||||
qcom,caldb-addr = <0x4FF00000>;
|
||||
m3-dump-addr = <0x4FD00000>;
|
||||
#endif
|
||||
qcom,caldb-size = <0x500000>;
|
||||
status = "ok";
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user