mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 01:52:51 +00:00
Compare commits
1058 Commits
v2.4.0-rc2
...
v3.0.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18ba90f5b4 | ||
|
|
9e5d1ae848 | ||
|
|
01240ada80 | ||
|
|
7fae3ebb90 | ||
|
|
00efc6f224 | ||
|
|
5bf9d31001 | ||
|
|
118dd7d224 | ||
|
|
559e67036d | ||
|
|
c66a1f1fa6 | ||
|
|
9b77fb297c | ||
|
|
95dae95031 | ||
|
|
a29aadbc90 | ||
|
|
753967bf6b | ||
|
|
9a9f9e1cb9 | ||
|
|
4db54ce3d9 | ||
|
|
f7f913ab14 | ||
|
|
6d4788c26f | ||
|
|
6872bd6964 | ||
|
|
a4a9a7692c | ||
|
|
c22ad0089c | ||
|
|
14c6a1a482 | ||
|
|
984faeae9a | ||
|
|
c98c7edc6a | ||
|
|
e8b3a76fd9 | ||
|
|
140d8ba1e6 | ||
|
|
c4bdf03787 | ||
|
|
371b287db4 | ||
|
|
3ed959bf25 | ||
|
|
0e077cf39a | ||
|
|
ef0d3c6fdd | ||
|
|
5ca04b5fb8 | ||
|
|
98453fce9b | ||
|
|
f6d6341ba0 | ||
|
|
8301bfbf89 | ||
|
|
1e844e2668 | ||
|
|
7fa9861cfc | ||
|
|
6500b62920 | ||
|
|
9423f9d6ab | ||
|
|
75374d2765 | ||
|
|
c8c5f14071 | ||
|
|
f12bbe2cac | ||
|
|
2ed8df9b10 | ||
|
|
85374fbbe6 | ||
|
|
4348221b62 | ||
|
|
0036dba689 | ||
|
|
c1a1c21643 | ||
|
|
4c495e7be2 | ||
|
|
42239fb1ba | ||
|
|
89766b187d | ||
|
|
eaa9e8585d | ||
|
|
89b3f9c6a9 | ||
|
|
ecfaf9a263 | ||
|
|
5d43925874 | ||
|
|
d2af552c5a | ||
|
|
b60c18ea3d | ||
|
|
2e3de0eb66 | ||
|
|
49dcafdbff | ||
|
|
3beecaa683 | ||
|
|
5240ac395f | ||
|
|
56e0b3b50c | ||
|
|
daf67c582f | ||
|
|
dfbbb01ea9 | ||
|
|
b4faeefc29 | ||
|
|
2416019d87 | ||
|
|
d3c0df1a4f | ||
|
|
009c003b48 | ||
|
|
8f7369a71c | ||
|
|
78eb88ed26 | ||
|
|
a48e7ce72e | ||
|
|
d804a61cd6 | ||
|
|
04f10325a1 | ||
|
|
2f5b612837 | ||
|
|
b0ef1b3221 | ||
|
|
6d3cc970da | ||
|
|
2e5c9fbeb8 | ||
|
|
546a7df54d | ||
|
|
b1c9f75fc8 | ||
|
|
14ba074b95 | ||
|
|
4612fcfa00 | ||
|
|
e32a9de55f | ||
|
|
0c4f7e9e9d | ||
|
|
af9a47ad72 | ||
|
|
d6f0a1a2cf | ||
|
|
2b8e68551e | ||
|
|
b2ad71e97d | ||
|
|
f1363f70e9 | ||
|
|
10c765076c | ||
|
|
35c36a9bff | ||
|
|
bd1ff8c649 | ||
|
|
e976d56575 | ||
|
|
99f6881a36 | ||
|
|
de2fb200a2 | ||
|
|
c8835ec6ba | ||
|
|
7e52502793 | ||
|
|
e2f0258407 | ||
|
|
64cfe870ec | ||
|
|
265c289235 | ||
|
|
f822dce124 | ||
|
|
7d090a8363 | ||
|
|
1a889b1ebe | ||
|
|
0df37f97d8 | ||
|
|
fa1c620df3 | ||
|
|
ad6f4241c4 | ||
|
|
dba8d27d19 | ||
|
|
f7c79205e9 | ||
|
|
1205d0e5b6 | ||
|
|
b4f73f165d | ||
|
|
ebdce386e4 | ||
|
|
fcc7b8dfac | ||
|
|
9a04d5cb66 | ||
|
|
e185a49c5b | ||
|
|
11bc8c143e | ||
|
|
05bab57b1d | ||
|
|
773040e099 | ||
|
|
47fe3e420e | ||
|
|
2e0301cacb | ||
|
|
3c868746a0 | ||
|
|
4cdb20fea4 | ||
|
|
08ded0c3f9 | ||
|
|
0080a5fb15 | ||
|
|
bd67a6646a | ||
|
|
8706a596e1 | ||
|
|
aa245da361 | ||
|
|
171607a03d | ||
|
|
9ec40d6baa | ||
|
|
d824ff4cf5 | ||
|
|
81862f70db | ||
|
|
0f0a861a6d | ||
|
|
c4b49e5190 | ||
|
|
5f787d92bb | ||
|
|
ee30e1c9c1 | ||
|
|
1841c74d16 | ||
|
|
1c2e5c91d9 | ||
|
|
203f5ca2e6 | ||
|
|
75be792560 | ||
|
|
d321c9c3a9 | ||
|
|
98d0f7b285 | ||
|
|
0cbe985599 | ||
|
|
e61b923048 | ||
|
|
39ca4eedaa | ||
|
|
ce20001751 | ||
|
|
3b68f33298 | ||
|
|
aea4c20bfa | ||
|
|
79d5972643 | ||
|
|
539e288247 | ||
|
|
5ff383df91 | ||
|
|
eef130b2fe | ||
|
|
6517fff793 | ||
|
|
2c6cc0d1d7 | ||
|
|
ba5fd5f252 | ||
|
|
eb1003f215 | ||
|
|
ec613bb6f7 | ||
|
|
ce1448b770 | ||
|
|
8801e89090 | ||
|
|
2947136db9 | ||
|
|
554e4fd90f | ||
|
|
771fc7f369 | ||
|
|
0a2cc59f49 | ||
|
|
1617b399c1 | ||
|
|
4dae21fbdb | ||
|
|
0dd9f0e042 | ||
|
|
49959b644b | ||
|
|
5236542275 | ||
|
|
73d949cf3f | ||
|
|
d9f237b450 | ||
|
|
4f5a3b0c2b | ||
|
|
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 | ||
|
|
e3b1fe36e5 | ||
|
|
5af7e1e7d8 | ||
|
|
057ebb8660 | ||
|
|
17fe72c6e9 | ||
|
|
834ff2fe4f | ||
|
|
ce3849e131 | ||
|
|
66640cdd1a | ||
|
|
300924a4be | ||
|
|
8fb088bcc8 | ||
|
|
b08455228f | ||
|
|
09563eadaf | ||
|
|
2df46a2c77 | ||
|
|
e4fa57b4d0 | ||
|
|
48677a6943 | ||
|
|
e79970ce04 | ||
|
|
b4d1d58fc9 | ||
|
|
d33447709e | ||
|
|
dd995426a5 | ||
|
|
4dcd0ad1da | ||
|
|
9285fd2670 | ||
|
|
187326b7ce | ||
|
|
f8a2de68aa | ||
|
|
41dd91559a | ||
|
|
fc3eec9075 | ||
|
|
e7a6f497a3 | ||
|
|
011340ed6e | ||
|
|
52ea8459e0 | ||
|
|
116b1982ab | ||
|
|
c467a62af3 | ||
|
|
88d783c8ad | ||
|
|
b04759322c | ||
|
|
b0af666cb4 | ||
|
|
27947a07f7 | ||
|
|
c1903ae2f9 | ||
|
|
d5fed93ec0 | ||
|
|
dc35dd1ce5 | ||
|
|
c59c646a5c | ||
|
|
8419c94742 | ||
|
|
8eb24a36f3 | ||
|
|
22b0f780b0 | ||
|
|
3093fda383 | ||
|
|
198aaefbdb | ||
|
|
5dd85e4bb5 | ||
|
|
ff118acdea | ||
|
|
83cdabf037 | ||
|
|
40c0875adf | ||
|
|
d3cf1f6b70 | ||
|
|
9a01085401 | ||
|
|
1833a9a3fb | ||
|
|
827edf3c1d | ||
|
|
eb9bdfaed9 | ||
|
|
c6f7b415d0 | ||
|
|
4da61c2cab | ||
|
|
ab6e7576db | ||
|
|
c140e29589 | ||
|
|
2972abf7e3 | ||
|
|
42cc2f0e78 | ||
|
|
19128346ae | ||
|
|
75ed221675 | ||
|
|
34138032a7 | ||
|
|
65e1a72b57 | ||
|
|
6448427eec | ||
|
|
bb2b6db088 | ||
|
|
48a091a3a2 | ||
|
|
6d9d4ab47a | ||
|
|
0406b7cb95 | ||
|
|
211e9c39e9 | ||
|
|
64009d7d2a | ||
|
|
70e922f609 | ||
|
|
b41b53b9d8 | ||
|
|
92d03f5283 | ||
|
|
8529d7471a | ||
|
|
02c0af4bb4 | ||
|
|
8c987c4949 | ||
|
|
a686beebbb | ||
|
|
ec8d056cc8 | ||
|
|
1d4b8ab7ff | ||
|
|
f87960eadc |
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 }}}'
|
||||||
47
.github/workflows/build-dev.yml
vendored
47
.github/workflows/build-dev.yml
vendored
@@ -1,5 +1,13 @@
|
|||||||
name: Build OpenWrt/uCentral images
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, next, staging-* ]
|
branches: [ main, next, staging-* ]
|
||||||
@@ -8,13 +16,20 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target: ['cig_wf188n', 'cig_wf194c', 'cig_wf194c4', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'edgecore_spw2ac1200-lan-poe', 'hfcl_ion4', '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_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf660a', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap102', '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-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', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Clean unnecessary files to save disk space
|
||||||
|
- name: clean unncessary files to save space
|
||||||
|
run: |
|
||||||
|
docker rmi `docker images -q`
|
||||||
|
|
||||||
- name: Build image for ${{ matrix.target }}
|
- name: Build image for ${{ matrix.target }}
|
||||||
id: build
|
id: build
|
||||||
@@ -24,17 +39,12 @@ jobs:
|
|||||||
make -j TARGET=${{ matrix.target }}
|
make -j TARGET=${{ matrix.target }}
|
||||||
|
|
||||||
- name: Package and upload image for ${{ matrix.target }}
|
- name: Package and upload image for ${{ matrix.target }}
|
||||||
|
id: package_and_upload_image
|
||||||
env:
|
env:
|
||||||
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
||||||
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
||||||
ARTIFACTORY_USERNAME: cicd-indoor-main
|
ARTIFACTORY_USERNAME: cicd-indoor-main
|
||||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
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: |
|
run: |
|
||||||
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
||||||
HASH=$(git rev-parse --short HEAD)
|
HASH=$(git rev-parse --short HEAD)
|
||||||
@@ -42,8 +52,10 @@ jobs:
|
|||||||
if [[ ${GITHUB_REF} == "refs/heads/"* ]]
|
if [[ ${GITHUB_REF} == "refs/heads/"* ]]
|
||||||
then
|
then
|
||||||
REF=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')
|
REF=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')
|
||||||
|
IS_RELEASE="false"
|
||||||
else
|
else
|
||||||
REF=$(echo ${GITHUB_REF#refs/tags/} | tr '/' '-')
|
REF=$(echo ${GITHUB_REF#refs/tags/} | tr '/' '-')
|
||||||
|
IS_RELEASE="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BASENAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$REF-$HASH"
|
BASENAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$REF-$HASH"
|
||||||
@@ -60,7 +72,13 @@ jobs:
|
|||||||
[ -f openwrt/tmp/image-file ] && curl -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 ] && curl -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 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 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:
|
trigger-testing:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -74,3 +92,16 @@ jobs:
|
|||||||
repository: Telecominfraproject/wlan-testing
|
repository: Telecominfraproject/wlan-testing
|
||||||
event-type: new-ap-release
|
event-type: new-ap-release
|
||||||
client-payload: '{"ref": "${GITHUB_REF#refs/tags/}", "sha": "${{ github.sha }}"}'
|
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
|
### Setting up your build machine
|
||||||
First we need to clone and setup our tree. This will result in an openwrt/.
|
|
||||||
|
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
|
cd openwrt
|
||||||
./scripts/gen_config.py ea8300
|
./scripts/gen_config.py linksys_ea8300
|
||||||
```
|
```
|
||||||
Finally we can build the tree.
|
|
||||||
```
|
3. Build the tree (replace `-j 8` with the number of cores to use).
|
||||||
make -j X V=s
|
```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
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
From c51ac602aff1a9b0093687fe39164a3b895fd4a2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Thu, 22 Oct 2020 10:29:34 +0200
|
|
||||||
Subject: [PATCH 01/27] build: build kernel image before building
|
|
||||||
modules/packages
|
|
||||||
|
|
||||||
This is needed for linux 5.10, where modules.builtin is generated from
|
|
||||||
vmlinux.o
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
include/kernel-defaults.mk | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
|
|
||||||
index 3aa1baa761..c02e0d34ca 100644
|
|
||||||
--- a/include/kernel-defaults.mk
|
|
||||||
+++ b/include/kernel-defaults.mk
|
|
||||||
@@ -115,7 +115,7 @@ endef
|
|
||||||
|
|
||||||
define Kernel/CompileModules/Default
|
|
||||||
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
|
||||||
- +$(KERNEL_MAKE) modules
|
|
||||||
+ +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
|
||||||
endef
|
|
||||||
|
|
||||||
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
|
||||||
@@ -139,7 +139,7 @@ endef
|
|
||||||
|
|
||||||
define Kernel/CompileImage/Default
|
|
||||||
rm -f $(TARGET_DIR)/init
|
|
||||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
|
||||||
+ +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
|
||||||
$(call Kernel/CopyImage)
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ define Kernel/CompileImage/Initramfs
|
|
||||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
|
||||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
|
||||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
|
||||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
|
||||||
+ +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
|
||||||
$(call Kernel/CopyImage,-initramfs)
|
|
||||||
endef
|
|
||||||
else
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
From 6c50e27b166b30c0b3f7b730717ab4b7f446e4d0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Wed, 17 Feb 2021 13:49:14 +0100
|
|
||||||
Subject: [PATCH 02/27] build: fix build with CONFIG_STRIP_KERNEL_EXPORTS
|
|
||||||
|
|
||||||
Only use symtab.h on the final kernel link
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
include/kernel-defaults.mk | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
|
|
||||||
index c02e0d34ca..f9316fc3f9 100644
|
|
||||||
--- a/include/kernel-defaults.mk
|
|
||||||
+++ b/include/kernel-defaults.mk
|
|
||||||
@@ -3,7 +3,7 @@
|
|
||||||
# Copyright (C) 2006-2020 OpenWrt.org
|
|
||||||
|
|
||||||
ifdef CONFIG_STRIP_KERNEL_EXPORTS
|
|
||||||
- KERNEL_MAKEOPTS += \
|
|
||||||
+ KERNEL_MAKEOPTS_IMAGE += \
|
|
||||||
EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
|
|
||||||
endif
|
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ endef
|
|
||||||
|
|
||||||
define Kernel/CompileImage/Default
|
|
||||||
rm -f $(TARGET_DIR)/init
|
|
||||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
|
||||||
+ +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
|
||||||
$(call Kernel/CopyImage)
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ define Kernel/CompileImage/Initramfs
|
|
||||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
|
||||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
|
||||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
|
||||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
|
||||||
+ +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
|
||||||
$(call Kernel/CopyImage,-initramfs)
|
|
||||||
endef
|
|
||||||
else
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,74 +0,0 @@
|
|||||||
From 7ed003d57f1c5273fecddabcdc7bd6845c3854a0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Sat, 20 Feb 2021 08:36:43 +0100
|
|
||||||
Subject: [PATCH 05/27] sysupgrade-nand: allow limiting rootfs_data by setting
|
|
||||||
env variable
|
|
||||||
|
|
||||||
Check if firmware environment variable 'rootfs_data_max' exists and is
|
|
||||||
set to a numerical value greater than 0. If so, limit rootfs_data
|
|
||||||
volume to that size instead of using the maximum available size.
|
|
||||||
|
|
||||||
This is useful on devices with lots of flash where users may want to
|
|
||||||
have eg. a volume for persistent logs and statistics or for external
|
|
||||||
applications/containers. Persistence on rootfs overlay is limited by
|
|
||||||
the size of memory available during the sysugprade process as that
|
|
||||||
data needs to be copied to RAM while the volume is being recreated
|
|
||||||
during sysupgrade. Hence it is unsuitable for keeping larger amounts
|
|
||||||
of data accross upgrade which makes additional volume(s) for
|
|
||||||
application data desirable.
|
|
||||||
|
|
||||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
---
|
|
||||||
package/base-files/files/lib/upgrade/nand.sh | 20 ++++++++++++++++----
|
|
||||||
1 file changed, 16 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
|
|
||||||
index 5bc9ff83f9..e335d940ed 100644
|
|
||||||
--- a/package/base-files/files/lib/upgrade/nand.sh
|
|
||||||
+++ b/package/base-files/files/lib/upgrade/nand.sh
|
|
||||||
@@ -117,6 +117,9 @@ nand_restore_config() {
|
|
||||||
nand_upgrade_prepare_ubi() {
|
|
||||||
local rootfs_length="$1"
|
|
||||||
local rootfs_type="$2"
|
|
||||||
+ local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2>/dev/null)"
|
|
||||||
+ [ -n "$rootfs_data_max" ] && rootfs_data_max=$(printf %d "$rootfs_data_max")
|
|
||||||
+
|
|
||||||
local kernel_length="$3"
|
|
||||||
local has_env="${4:-0}"
|
|
||||||
|
|
||||||
@@ -176,11 +179,11 @@ nand_upgrade_prepare_ubi() {
|
|
||||||
|
|
||||||
# update rootfs
|
|
||||||
if [ -n "$rootfs_length" ]; then
|
|
||||||
- local root_size_param
|
|
||||||
+ local rootfs_size_param
|
|
||||||
if [ "$rootfs_type" = "ubifs" ]; then
|
|
||||||
- root_size_param="-m"
|
|
||||||
+ rootfs_size_param="-m"
|
|
||||||
else
|
|
||||||
- root_size_param="-s $rootfs_length"
|
|
||||||
+ rootfs_size_param="-s $rootfs_length"
|
|
||||||
fi
|
|
||||||
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then
|
|
||||||
echo "cannot create rootfs volume"
|
|
||||||
@@ -190,7 +193,16 @@ nand_upgrade_prepare_ubi() {
|
|
||||||
|
|
||||||
# create rootfs_data for non-ubifs rootfs
|
|
||||||
if [ "$rootfs_type" != "ubifs" ]; then
|
|
||||||
- if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then
|
|
||||||
+ local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks)
|
|
||||||
+ local ebsize=$(cat /sys/devices/virtual/ubi/$ubidev/eraseblock_size)
|
|
||||||
+ local avail_size=$(( $availeb * $ebsize ))
|
|
||||||
+ local rootfs_data_size_param="-m"
|
|
||||||
+ if [ -n "$rootfs_data_max" ] &&
|
|
||||||
+ [ "$rootfs_data_max" != "0" ] &&
|
|
||||||
+ [ "$rootfs_data_max" -le "$avail_size" ]; then
|
|
||||||
+ rootfs_data_size_param="-s $rootfs_data_max"
|
|
||||||
+ fi
|
|
||||||
+ if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then
|
|
||||||
echo "cannot initialize rootfs_data volume"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,70 +0,0 @@
|
|||||||
From 1a9921bab861dd2c89337c3e4833c716a0474653 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
Date: Fri, 12 Feb 2021 03:09:39 +0000
|
|
||||||
Subject: [PATCH 07/27] uboot-envtools: add defaults for linksys-e8450-ubi
|
|
||||||
|
|
||||||
Add U-Boot environment configuration for the Linksys E8450 (UBI) to
|
|
||||||
allow access to the bootloader environment from OpenWrt via
|
|
||||||
'fw_printenv' and 'fw_setenv'.
|
|
||||||
|
|
||||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
---
|
|
||||||
package/boot/uboot-envtools/files/mediatek | 46 ++++++++++++++++++++++
|
|
||||||
1 file changed, 46 insertions(+)
|
|
||||||
create mode 100644 package/boot/uboot-envtools/files/mediatek
|
|
||||||
|
|
||||||
diff --git a/package/boot/uboot-envtools/files/mediatek b/package/boot/uboot-envtools/files/mediatek
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..495a837274
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/boot/uboot-envtools/files/mediatek
|
|
||||||
@@ -0,0 +1,46 @@
|
|
||||||
+#
|
|
||||||
+# Copyright (C) 2021 OpenWrt.org
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+[ -e /etc/config/ubootenv ] && exit 0
|
|
||||||
+
|
|
||||||
+touch /etc/config/ubootenv
|
|
||||||
+
|
|
||||||
+. /lib/uboot-envtools.sh
|
|
||||||
+. /lib/functions.sh
|
|
||||||
+
|
|
||||||
+board=$(board_name)
|
|
||||||
+
|
|
||||||
+case "$board" in
|
|
||||||
+linksys,e8450-ubi)
|
|
||||||
+ ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
|
||||||
+ ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
|
||||||
+ ;;
|
|
||||||
+bananapi,bpi-r64)
|
|
||||||
+ . /lib/upgrade/common.sh
|
|
||||||
+ export_bootdevice
|
|
||||||
+ export_partdevice rootdev 0
|
|
||||||
+ case "$rootdev" in
|
|
||||||
+ mmc*)
|
|
||||||
+ local envdev=/dev/$(get_partition_by_name $rootdev ubootenv)
|
|
||||||
+ ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
|
|
||||||
+ ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
|
|
||||||
+ ;;
|
|
||||||
+ *)
|
|
||||||
+ ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
|
||||||
+ ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
|
||||||
+ ;;
|
|
||||||
+ esac
|
|
||||||
+ ;;
|
|
||||||
+buffalo,wsr-2533dhp2)
|
|
||||||
+ ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
|
|
||||||
+ ;;
|
|
||||||
+ubnt,unifi-6-lr-ubootmod)
|
|
||||||
+ ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
|
|
||||||
+ ;;
|
|
||||||
+esac
|
|
||||||
+
|
|
||||||
+config_load ubootenv
|
|
||||||
+config_foreach ubootenv_add_app_config ubootenv
|
|
||||||
+
|
|
||||||
+exit 0
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,33 +0,0 @@
|
|||||||
From 4ed9b7d04405d5109681643f3ceebbd25f3f28e2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Wed, 7 Apr 2021 10:46:26 +0200
|
|
||||||
Subject: [PATCH 09/27] include: set kernel-version.mk
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
include/kernel-version.mk | 6 ++++++
|
|
||||||
1 file changed, 6 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/include/kernel-version.mk b/include/kernel-version.mk
|
|
||||||
index fe81dbf603..3c109c13c8 100644
|
|
||||||
--- a/include/kernel-version.mk
|
|
||||||
+++ b/include/kernel-version.mk
|
|
||||||
@@ -6,9 +6,15 @@ ifdef CONFIG_TESTING_KERNEL
|
|
||||||
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
|
|
||||||
endif
|
|
||||||
|
|
||||||
+LINUX_VERSION-4.4 = .60
|
|
||||||
+LINUX_VERSION-4.14 = .193
|
|
||||||
LINUX_VERSION-5.4 = .142
|
|
||||||
+LINUX_VERSION-5.10 = .27
|
|
||||||
|
|
||||||
+LINUX_KERNEL_HASH-4.4.60 = 2cd8df6f1ac6a5329c5a286ec9b5956215977221a1b731597ed169fff74a9659
|
|
||||||
+LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03
|
|
||||||
LINUX_KERNEL_HASH-5.4.142 = 99785728968564ba27c7e552d024b560072dcbc885540912eabb5c021e231451
|
|
||||||
+LINUX_KERNEL_HASH-5.10.27 = d99dc9662951299c53a0a8d8c8d0a72a16ff861d20e927c0f9b14f63282d69d9
|
|
||||||
|
|
||||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
|
||||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,266 +0,0 @@
|
|||||||
From ad860cb413d1934332de60658d5eb8fb64d19663 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Sun, 9 May 2021 12:23:00 +0200
|
|
||||||
Subject: [PATCH 11/27] backport: mkits.sh
|
|
||||||
|
|
||||||
969083634481c3ab5fb80509f385ef10ab45b55f
|
|
||||||
e991c1b8a2385397fc1e657ed73878938997d951
|
|
||||||
9f714398e060c6338fbfad44cdbfa8c940dbb84b
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
include/image-commands.mk | 2 +-
|
|
||||||
include/image.mk | 2 +-
|
|
||||||
scripts/mkits.sh | 101 +++++++++++++++++++++++++---
|
|
||||||
target/linux/ipq40xx/image/Makefile | 1 +
|
|
||||||
target/linux/ipq806x/image/Makefile | 1 +
|
|
||||||
5 files changed, 95 insertions(+), 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/image-commands.mk b/include/image-commands.mk
|
|
||||||
index 2c917d613e..c6e8eb0293 100644
|
|
||||||
--- a/include/image-commands.mk
|
|
||||||
+++ b/include/image-commands.mk
|
|
||||||
@@ -203,7 +203,7 @@ define Build/fit
|
|
||||||
$(if $(word 3,$(1)),-r $(IMAGE_ROOTFS) -f $(subst _,$(comma),$(DEVICE_NAME))) \
|
|
||||||
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
|
||||||
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
|
|
||||||
- -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
|
||||||
+ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
|
||||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
|
||||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(word 3,$(1)),-E -B 0x1000 -p 0x1000) -f $@.its $@.new
|
|
||||||
@mv $@.new $@
|
|
||||||
diff --git a/include/image.mk b/include/image.mk
|
|
||||||
index b6e8ab3c84..7c2dcf0e8b 100644
|
|
||||||
--- a/include/image.mk
|
|
||||||
+++ b/include/image.mk
|
|
||||||
@@ -139,7 +139,7 @@ endef
|
|
||||||
define Image/BuildKernel/MkFIT
|
|
||||||
$(TOPDIR)/scripts/mkits.sh \
|
|
||||||
-D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
|
|
||||||
- -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
|
||||||
+ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
|
||||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
|
||||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
|
|
||||||
endef
|
|
||||||
diff --git a/scripts/mkits.sh b/scripts/mkits.sh
|
|
||||||
index 3d68fdacbc..7533baf799 100755
|
|
||||||
--- a/scripts/mkits.sh
|
|
||||||
+++ b/scripts/mkits.sh
|
|
||||||
@@ -24,22 +24,29 @@ usage() {
|
|
||||||
printf "\n\t-a ==> set load address to 'addr' (hex)"
|
|
||||||
printf "\n\t-e ==> set entry point to 'entry' (hex)"
|
|
||||||
printf "\n\t-f ==> set device tree compatible string"
|
|
||||||
+ printf "\n\t-i ==> include initrd Blob 'initrd'"
|
|
||||||
printf "\n\t-v ==> set kernel version to 'version'"
|
|
||||||
printf "\n\t-k ==> include kernel image 'kernel'"
|
|
||||||
printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
|
|
||||||
printf "\n\t-n ==> fdt unit-address 'address'"
|
|
||||||
printf "\n\t-d ==> include Device Tree Blob 'dtb'"
|
|
||||||
- printf "\n\t-r ==> include RootFS blob"
|
|
||||||
+ printf "\n\t-r ==> include RootFS blob 'rootfs'"
|
|
||||||
printf "\n\t-H ==> specify hash algo instead of SHA1"
|
|
||||||
- printf "\n\t-o ==> create output file 'its_file'\n"
|
|
||||||
+ printf "\n\t-o ==> create output file 'its_file'"
|
|
||||||
+ printf "\n\t-O ==> create config with dt overlay 'name:dtb'"
|
|
||||||
+ printf "\n\t\t(can be specified more than once)\n"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
FDTNUM=1
|
|
||||||
ROOTFSNUM=1
|
|
||||||
+INITRDNUM=1
|
|
||||||
HASH=sha1
|
|
||||||
+LOADABLES=
|
|
||||||
+DTOVERLAY=
|
|
||||||
+DTADDR=
|
|
||||||
|
|
||||||
-while getopts ":A:a:c:C:D:d:e:f:k:n:o:v:r:S" OPTION
|
|
||||||
+while getopts ":A:a:c:C:D:d:e:f:i:k:n:o:O:v:r:S" OPTION
|
|
||||||
do
|
|
||||||
case $OPTION in
|
|
||||||
A ) ARCH=$OPTARG;;
|
|
||||||
@@ -50,9 +57,11 @@ do
|
|
||||||
d ) DTB=$OPTARG;;
|
|
||||||
e ) ENTRY_ADDR=$OPTARG;;
|
|
||||||
f ) COMPATIBLE=$OPTARG;;
|
|
||||||
+ i ) INITRD=$OPTARG;;
|
|
||||||
k ) KERNEL=$OPTARG;;
|
|
||||||
n ) FDTNUM=$OPTARG;;
|
|
||||||
o ) OUTPUT=$OPTARG;;
|
|
||||||
+ O ) DTOVERLAY="$DTOVERLAY ${OPTARG}";;
|
|
||||||
r ) ROOTFS=$OPTARG;;
|
|
||||||
S ) HASH=$OPTARG;;
|
|
||||||
v ) VERSION=$OPTARG;;
|
|
||||||
@@ -74,14 +83,20 @@ if [ -n "${COMPATIBLE}" ]; then
|
|
||||||
COMPATIBLE_PROP="compatible = \"${COMPATIBLE}\";"
|
|
||||||
fi
|
|
||||||
|
|
||||||
+[ "$DTOVERLAY" ] && {
|
|
||||||
+ dtbsize=$(wc -c "$DTB" | cut -d' ' -f1)
|
|
||||||
+ DTADDR=$(printf "0x%08x" $(($LOAD_ADDR - $dtbsize)) )
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
# Conditionally create fdt information
|
|
||||||
if [ -n "${DTB}" ]; then
|
|
||||||
FDT_NODE="
|
|
||||||
- fdt@$FDTNUM {
|
|
||||||
+ fdt-$FDTNUM {
|
|
||||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\";
|
|
||||||
${COMPATIBLE_PROP}
|
|
||||||
data = /incbin/(\"${DTB}\");
|
|
||||||
type = \"flat_dt\";
|
|
||||||
+ ${DTADDR:+load = <${DTADDR}>;}
|
|
||||||
arch = \"${ARCH}\";
|
|
||||||
compression = \"none\";
|
|
||||||
hash@1 {
|
|
||||||
@@ -92,13 +107,34 @@ if [ -n "${DTB}" ]; then
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"
|
|
||||||
- FDT_PROP="fdt = \"fdt@$FDTNUM\";"
|
|
||||||
+ FDT_PROP="fdt = \"fdt-$FDTNUM\";"
|
|
||||||
fi
|
|
||||||
|
|
||||||
+if [ -n "${INITRD}" ]; then
|
|
||||||
+ INITRD_NODE="
|
|
||||||
+ initrd-$INITRDNUM {
|
|
||||||
+ description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
|
|
||||||
+ ${COMPATIBLE_PROP}
|
|
||||||
+ data = /incbin/(\"${INITRD}\");
|
|
||||||
+ type = \"ramdisk\";
|
|
||||||
+ arch = \"${ARCH}\";
|
|
||||||
+ os = \"linux\";
|
|
||||||
+ hash@1 {
|
|
||||||
+ algo = \"crc32\";
|
|
||||||
+ };
|
|
||||||
+ hash@2 {
|
|
||||||
+ algo = \"${HASH}\";
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+"
|
|
||||||
+ INITRD_PROP="ramdisk=\"initrd-${INITRDNUM}\";"
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
if [ -n "${ROOTFS}" ]; then
|
|
||||||
dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync
|
|
||||||
ROOTFS_NODE="
|
|
||||||
- rootfs@$ROOTFSNUM {
|
|
||||||
+ rootfs-$ROOTFSNUM {
|
|
||||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} rootfs\";
|
|
||||||
${COMPATIBLE_PROP}
|
|
||||||
data = /incbin/(\"${ROOTFS}.pagesync\");
|
|
||||||
@@ -113,9 +149,50 @@ if [ -n "${ROOTFS}" ]; then
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"
|
|
||||||
- ROOTFS_PROP="loadables = \"rootfs@${ROOTFSNUM}\";"
|
|
||||||
+ LOADABLES="${LOADABLES:+$LOADABLES, }\"rootfs-${ROOTFSNUM}\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
+# add DT overlay blobs
|
|
||||||
+FDTOVERLAY_NODE=""
|
|
||||||
+OVCONFIGS=""
|
|
||||||
+[ "$DTOVERLAY" ] && for overlay in $DTOVERLAY ; do
|
|
||||||
+ overlay_blob=${overlay##*:}
|
|
||||||
+ ovname=${overlay%%:*}
|
|
||||||
+ ovnode="fdt-$ovname"
|
|
||||||
+ ovsize=$(wc -c "$overlay_blob" | cut -d' ' -f1)
|
|
||||||
+ echo "$ovname ($overlay_blob) : $ovsize" >&2
|
|
||||||
+ DTADDR=$(printf "0x%08x" $(($DTADDR - $ovsize)))
|
|
||||||
+ FDTOVERLAY_NODE="$FDTOVERLAY_NODE
|
|
||||||
+
|
|
||||||
+ $ovnode {
|
|
||||||
+ description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree overlay $ovname\";
|
|
||||||
+ ${COMPATIBLE_PROP}
|
|
||||||
+ data = /incbin/(\"${overlay_blob}\");
|
|
||||||
+ type = \"flat_dt\";
|
|
||||||
+ arch = \"${ARCH}\";
|
|
||||||
+ load = <${DTADDR}>;
|
|
||||||
+ compression = \"none\";
|
|
||||||
+ hash@1 {
|
|
||||||
+ algo = \"crc32\";
|
|
||||||
+ };
|
|
||||||
+ hash@2 {
|
|
||||||
+ algo = \"${HASH}\";
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+"
|
|
||||||
+ OVCONFIGS="$OVCONFIGS
|
|
||||||
+
|
|
||||||
+ config-$ovname {
|
|
||||||
+ description = \"OpenWrt ${DEVICE} with $ovname\";
|
|
||||||
+ kernel = \"kernel-1\";
|
|
||||||
+ fdt = \"fdt-$FDTNUM\", \"$ovnode\";
|
|
||||||
+ ${LOADABLES:+loadables = ${LOADABLES};}
|
|
||||||
+ ${COMPATIBLE_PROP}
|
|
||||||
+ ${INITRD_PROP}
|
|
||||||
+ };
|
|
||||||
+ "
|
|
||||||
+done
|
|
||||||
+
|
|
||||||
# Create a default, fully populated DTS file
|
|
||||||
DATA="/dts-v1/;
|
|
||||||
|
|
||||||
@@ -124,7 +201,7 @@ DATA="/dts-v1/;
|
|
||||||
#address-cells = <1>;
|
|
||||||
|
|
||||||
images {
|
|
||||||
- kernel@1 {
|
|
||||||
+ kernel-1 {
|
|
||||||
description = \"${ARCH_UPPER} OpenWrt Linux-${VERSION}\";
|
|
||||||
data = /incbin/(\"${KERNEL}\");
|
|
||||||
type = \"kernel\";
|
|
||||||
@@ -140,7 +217,9 @@ DATA="/dts-v1/;
|
|
||||||
algo = \"$HASH\";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
+${INITRD_NODE}
|
|
||||||
${FDT_NODE}
|
|
||||||
+${FDTOVERLAY_NODE}
|
|
||||||
${ROOTFS_NODE}
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -148,11 +227,13 @@ ${ROOTFS_NODE}
|
|
||||||
default = \"${CONFIG}\";
|
|
||||||
${CONFIG} {
|
|
||||||
description = \"OpenWrt ${DEVICE}\";
|
|
||||||
- kernel = \"kernel@1\";
|
|
||||||
+ kernel = \"kernel-1\";
|
|
||||||
${FDT_PROP}
|
|
||||||
- ${ROOTFS_PROP}
|
|
||||||
+ ${LOADABLES:+loadables = ${LOADABLES};}
|
|
||||||
${COMPATIBLE_PROP}
|
|
||||||
+ ${INITRD_PROP}
|
|
||||||
};
|
|
||||||
+ ${OVCONFIGS}
|
|
||||||
};
|
|
||||||
};"
|
|
||||||
|
|
||||||
diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile
|
|
||||||
index 2be262936f..a0d6242a28 100644
|
|
||||||
--- a/target/linux/ipq40xx/image/Makefile
|
|
||||||
+++ b/target/linux/ipq40xx/image/Makefile
|
|
||||||
@@ -8,6 +8,7 @@ define Device/Default
|
|
||||||
KERNEL_PREFIX := $$(IMAGE_PREFIX)
|
|
||||||
KERNEL_LOADADDR := 0x80208000
|
|
||||||
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
|
|
||||||
+ DEVICE_DTS_CONFIG := config@1
|
|
||||||
IMAGES := sysupgrade.bin
|
|
||||||
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
|
|
||||||
IMAGE/sysupgrade.bin/squashfs :=
|
|
||||||
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
|
|
||||||
index bab1da0090..3bc60fa931 100644
|
|
||||||
--- a/target/linux/ipq806x/image/Makefile
|
|
||||||
+++ b/target/linux/ipq806x/image/Makefile
|
|
||||||
@@ -30,6 +30,7 @@ define Device/Default
|
|
||||||
KERNEL_PREFIX := $$(IMAGE_PREFIX)
|
|
||||||
KERNEL_LOADADDR = 0x42208000
|
|
||||||
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
|
|
||||||
+ DEVICE_DTS_CONFIG := config@1
|
|
||||||
IMAGES := sysupgrade.bin
|
|
||||||
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
|
|
||||||
IMAGE/sysupgrade.bin/squashfs :=
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
From bb797fc82f8ade2a1c0b7a68dd7c920eae2f531f Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Tue, 18 May 2021 10:46:43 +0200
|
|
||||||
Subject: [PATCH 01/74] libubox: update to latest HEAD
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/libs/libubox/Makefile | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
|
|
||||||
index d2c07783e1..3b01930d6c 100644
|
|
||||||
--- a/package/libs/libubox/Makefile
|
|
||||||
+++ b/package/libs/libubox/Makefile
|
|
||||||
@@ -5,9 +5,9 @@ PKG_RELEASE=2
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
|
|
||||||
-PKG_MIRROR_HASH:=7dd1db1e0074a9c7c722db654cce3111b3bd3cff0bfd791c4497cb0f6c22d3ca
|
|
||||||
-PKG_SOURCE_DATE:=2021-05-16
|
|
||||||
-PKG_SOURCE_VERSION:=b14c4688612c05c78ce984d7bde633bce8703b1e
|
|
||||||
+PKG_MIRROR_HASH:=82d84fb97e725b0a18ceac639cae0c17d922754bb648ff58c62069d92798a6cd
|
|
||||||
+PKG_SOURCE_DATE:=2021-08-19
|
|
||||||
+PKG_SOURCE_VERSION:=c86a894ec63d83ecf2c373bbf9dc8fba9713d942
|
|
||||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
|
||||||
CMAKE_INSTALL:=1
|
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ define Package/libubox-lua
|
|
||||||
endef
|
|
||||||
|
|
||||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
|
|
||||||
-CMAKE_OPTIONS = \
|
|
||||||
+CMAKE_OPTIONS += \
|
|
||||||
-DLUAPATH=/usr/lib/lua \
|
|
||||||
-DABIVERSION="$(PKG_ABI_VERSION)"
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
From 41db6b8282d09bd9d7ee453f54e592003904ab0e Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Wed, 30 Jun 2021 14:21:23 +0200
|
|
||||||
Subject: [PATCH 13/27] umdns: update to latest HEAD
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/network/services/umdns/Makefile | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile
|
|
||||||
index 9a5f46a705..908758e44b 100644
|
|
||||||
--- a/package/network/services/umdns/Makefile
|
|
||||||
+++ b/package/network/services/umdns/Makefile
|
|
||||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
|
||||||
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
-PKG_SOURCE_DATE:=2021-01-26
|
|
||||||
-PKG_SOURCE_VERSION:=78aa36b0e9808e801c527c6dc47320e593309522
|
|
||||||
-PKG_MIRROR_HASH:=241833f2bf2f3366f356703159be386862ef747d9b253af6c13555f252cc970d
|
|
||||||
+PKG_SOURCE_DATE:=2021-06-30
|
|
||||||
+PKG_SOURCE_VERSION:=4a8747193ab2b8f2d68a9d26334545e19d89cbe2
|
|
||||||
+PKG_MIRROR_HASH:=bdddec2793303e4cc1a90cb2ed2241c04fdd0a736b6c0cbbb1fab9de5527566a
|
|
||||||
|
|
||||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
|
||||||
PKG_LICENSE:=LGPL-2.1
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,242 +0,0 @@
|
|||||||
From 9df1500bde8e609dcbbecbefa0eb5a29d9e6f7f5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Fri, 27 Aug 2021 16:52:34 +0200
|
|
||||||
Subject: [PATCH 14/27] kernel: add bdpu filter support
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
...l-knob-for-filtering-rx-tx-BPDU-pack.patch | 107 ++++++++++++++++++
|
|
||||||
...l-knob-for-filtering-rx-tx-BPDU-pack.patch | 107 ++++++++++++++++++
|
|
||||||
2 files changed, 214 insertions(+)
|
|
||||||
create mode 100644 target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
|
||||||
create mode 100644 target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
|
||||||
|
|
||||||
diff --git a/target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch b/target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..918ae05d12
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
|
||||||
@@ -0,0 +1,107 @@
|
|
||||||
+From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
+Date: Fri, 27 Aug 2021 12:22:32 +0200
|
|
||||||
+Subject: [PATCH] bridge: add sysctl knob for filtering rx/tx BPDU packets on a
|
|
||||||
+ port
|
|
||||||
+
|
|
||||||
+Some devices (e.g. wireless APs) can't have devices behind them be part of
|
|
||||||
+a bridge topology with redundant links, due to address limitations.
|
|
||||||
+Additionally, broadcast traffic on these devices is somewhat expensive, due to
|
|
||||||
+the low data rate and wakeups of clients in powersave mode.
|
|
||||||
+This sysctl knob can be used to ensure that BPDU packets are never sent
|
|
||||||
+or forwarded to/from these devices
|
|
||||||
+
|
|
||||||
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
+---
|
|
||||||
+
|
|
||||||
+--- a/include/linux/if_bridge.h
|
|
||||||
++++ b/include/linux/if_bridge.h
|
|
||||||
+@@ -56,6 +56,7 @@ struct br_ip_list {
|
|
||||||
+ #define BR_MRP_AWARE BIT(17)
|
|
||||||
+ #define BR_MRP_LOST_CONT BIT(18)
|
|
||||||
+ #define BR_MRP_LOST_IN_CONT BIT(19)
|
|
||||||
++#define BR_BPDU_FILTER BIT(20)
|
|
||||||
+
|
|
||||||
+ #define BR_DEFAULT_AGEING_TIME (300 * HZ)
|
|
||||||
+
|
|
||||||
+--- a/net/bridge/br_forward.c
|
|
||||||
++++ b/net/bridge/br_forward.c
|
|
||||||
+@@ -191,6 +191,7 @@ out:
|
|
||||||
+ void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
|
||||||
+ enum br_pkt_type pkt_type, bool local_rcv, bool local_orig)
|
|
||||||
+ {
|
|
||||||
++ const unsigned char *dest = eth_hdr(skb)->h_dest;
|
|
||||||
+ struct net_bridge_port *prev = NULL;
|
|
||||||
+ struct net_bridge_port *p;
|
|
||||||
+
|
|
||||||
+@@ -206,6 +207,10 @@ void br_flood(struct net_bridge *br, str
|
|
||||||
+ case BR_PKT_MULTICAST:
|
|
||||||
+ if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
|
|
||||||
+ continue;
|
|
||||||
++ if ((p->flags & BR_BPDU_FILTER) &&
|
|
||||||
++ unlikely(is_link_local_ether_addr(dest) &&
|
|
||||||
++ dest[5] == 0))
|
|
||||||
++ continue;
|
|
||||||
+ break;
|
|
||||||
+ case BR_PKT_BROADCAST:
|
|
||||||
+ if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
|
|
||||||
+--- a/net/bridge/br_input.c
|
|
||||||
++++ b/net/bridge/br_input.c
|
|
||||||
+@@ -305,6 +305,8 @@ static rx_handler_result_t br_handle_fra
|
|
||||||
+ fwd_mask |= p->group_fwd_mask;
|
|
||||||
+ switch (dest[5]) {
|
|
||||||
+ case 0x00: /* Bridge Group Address */
|
|
||||||
++ if (p->flags & BR_BPDU_FILTER)
|
|
||||||
++ goto drop;
|
|
||||||
+ /* If STP is turned off,
|
|
||||||
+ then must forward to keep loop detection */
|
|
||||||
+ if (p->br->stp_enabled == BR_NO_STP ||
|
|
||||||
+--- a/net/bridge/br_sysfs_if.c
|
|
||||||
++++ b/net/bridge/br_sysfs_if.c
|
|
||||||
+@@ -233,6 +233,7 @@ BRPORT_ATTR_FLAG(multicast_flood, BR_MCA
|
|
||||||
+ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD);
|
|
||||||
+ BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
|
|
||||||
+ BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
|
|
||||||
++BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
|
|
||||||
+
|
|
||||||
+ #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
|
|
||||||
+ static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
|
|
||||||
+@@ -285,6 +286,7 @@ static const struct brport_attribute *br
|
|
||||||
+ &brport_attr_group_fwd_mask,
|
|
||||||
+ &brport_attr_neigh_suppress,
|
|
||||||
+ &brport_attr_isolated,
|
|
||||||
++ &brport_attr_bpdu_filter,
|
|
||||||
+ &brport_attr_backup_port,
|
|
||||||
+ NULL
|
|
||||||
+ };
|
|
||||||
+--- a/net/bridge/br_stp_bpdu.c
|
|
||||||
++++ b/net/bridge/br_stp_bpdu.c
|
|
||||||
+@@ -80,7 +80,8 @@ void br_send_config_bpdu(struct net_brid
|
|
||||||
+ {
|
|
||||||
+ unsigned char buf[35];
|
|
||||||
+
|
|
||||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
|
||||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
|
||||||
++ (p->flags & BR_BPDU_FILTER))
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ buf[0] = 0;
|
|
||||||
+@@ -127,7 +128,8 @@ void br_send_tcn_bpdu(struct net_bridge_
|
|
||||||
+ {
|
|
||||||
+ unsigned char buf[4];
|
|
||||||
+
|
|
||||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
|
||||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
|
||||||
++ (p->flags & BR_BPDU_FILTER))
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ buf[0] = 0;
|
|
||||||
+@@ -172,6 +174,9 @@ void br_stp_rcv(const struct stp_proto *
|
|
||||||
+ if (!(br->dev->flags & IFF_UP))
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
++ if (p->flags & BR_BPDU_FILTER)
|
|
||||||
++ goto out;
|
|
||||||
++
|
|
||||||
+ if (p->state == BR_STATE_DISABLED)
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
diff --git a/target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch b/target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..586d264cd5
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
|
||||||
@@ -0,0 +1,107 @@
|
|
||||||
+From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
+Date: Fri, 27 Aug 2021 12:22:32 +0200
|
|
||||||
+Subject: [PATCH] bridge: add sysctl knob for filtering rx/tx BPDU packets on a
|
|
||||||
+ port
|
|
||||||
+
|
|
||||||
+Some devices (e.g. wireless APs) can't have devices behind them be part of
|
|
||||||
+a bridge topology with redundant links, due to address limitations.
|
|
||||||
+Additionally, broadcast traffic on these devices is somewhat expensive, due to
|
|
||||||
+the low data rate and wakeups of clients in powersave mode.
|
|
||||||
+This sysctl knob can be used to ensure that BPDU packets are never sent
|
|
||||||
+or forwarded to/from these devices
|
|
||||||
+
|
|
||||||
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
+---
|
|
||||||
+
|
|
||||||
+--- a/include/linux/if_bridge.h
|
|
||||||
++++ b/include/linux/if_bridge.h
|
|
||||||
+@@ -47,6 +47,7 @@ struct br_ip_list {
|
|
||||||
+ #define BR_BCAST_FLOOD BIT(14)
|
|
||||||
+ #define BR_NEIGH_SUPPRESS BIT(15)
|
|
||||||
+ #define BR_ISOLATED BIT(16)
|
|
||||||
++#define BR_BPDU_FILTER BIT(17)
|
|
||||||
+
|
|
||||||
+ #define BR_DEFAULT_AGEING_TIME (300 * HZ)
|
|
||||||
+
|
|
||||||
+--- a/net/bridge/br_forward.c
|
|
||||||
++++ b/net/bridge/br_forward.c
|
|
||||||
+@@ -191,6 +191,7 @@ out:
|
|
||||||
+ void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
|
||||||
+ enum br_pkt_type pkt_type, bool local_rcv, bool local_orig)
|
|
||||||
+ {
|
|
||||||
++ const unsigned char *dest = eth_hdr(skb)->h_dest;
|
|
||||||
+ struct net_bridge_port *prev = NULL;
|
|
||||||
+ struct net_bridge_port *p;
|
|
||||||
+
|
|
||||||
+@@ -206,6 +207,10 @@ void br_flood(struct net_bridge *br, str
|
|
||||||
+ case BR_PKT_MULTICAST:
|
|
||||||
+ if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
|
|
||||||
+ continue;
|
|
||||||
++ if ((p->flags & BR_BPDU_FILTER) &&
|
|
||||||
++ unlikely(is_link_local_ether_addr(dest) &&
|
|
||||||
++ dest[5] == 0))
|
|
||||||
++ continue;
|
|
||||||
+ break;
|
|
||||||
+ case BR_PKT_BROADCAST:
|
|
||||||
+ if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
|
|
||||||
+--- a/net/bridge/br_input.c
|
|
||||||
++++ b/net/bridge/br_input.c
|
|
||||||
+@@ -300,6 +300,8 @@ rx_handler_result_t br_handle_frame(stru
|
|
||||||
+ fwd_mask |= p->group_fwd_mask;
|
|
||||||
+ switch (dest[5]) {
|
|
||||||
+ case 0x00: /* Bridge Group Address */
|
|
||||||
++ if (p->flags & BR_BPDU_FILTER)
|
|
||||||
++ goto drop;
|
|
||||||
+ /* If STP is turned off,
|
|
||||||
+ then must forward to keep loop detection */
|
|
||||||
+ if (p->br->stp_enabled == BR_NO_STP ||
|
|
||||||
+--- a/net/bridge/br_sysfs_if.c
|
|
||||||
++++ b/net/bridge/br_sysfs_if.c
|
|
||||||
+@@ -233,6 +233,7 @@ BRPORT_ATTR_FLAG(multicast_flood, BR_MCA
|
|
||||||
+ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD);
|
|
||||||
+ BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
|
|
||||||
+ BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
|
|
||||||
++BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
|
|
||||||
+
|
|
||||||
+ #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
|
|
||||||
+ static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
|
|
||||||
+@@ -285,6 +286,7 @@ static const struct brport_attribute *br
|
|
||||||
+ &brport_attr_group_fwd_mask,
|
|
||||||
+ &brport_attr_neigh_suppress,
|
|
||||||
+ &brport_attr_isolated,
|
|
||||||
++ &brport_attr_bpdu_filter,
|
|
||||||
+ &brport_attr_backup_port,
|
|
||||||
+ NULL
|
|
||||||
+ };
|
|
||||||
+--- a/net/bridge/br_stp_bpdu.c
|
|
||||||
++++ b/net/bridge/br_stp_bpdu.c
|
|
||||||
+@@ -80,7 +80,8 @@ void br_send_config_bpdu(struct net_brid
|
|
||||||
+ {
|
|
||||||
+ unsigned char buf[35];
|
|
||||||
+
|
|
||||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
|
||||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
|
||||||
++ (p->flags & BR_BPDU_FILTER))
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ buf[0] = 0;
|
|
||||||
+@@ -125,7 +126,8 @@ void br_send_tcn_bpdu(struct net_bridge_
|
|
||||||
+ {
|
|
||||||
+ unsigned char buf[4];
|
|
||||||
+
|
|
||||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
|
||||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
|
||||||
++ (p->flags & BR_BPDU_FILTER))
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ buf[0] = 0;
|
|
||||||
+@@ -168,6 +170,9 @@ void br_stp_rcv(const struct stp_proto *
|
|
||||||
+ if (!(br->dev->flags & IFF_UP))
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
++ if (p->flags & BR_BPDU_FILTER)
|
|
||||||
++ goto out;
|
|
||||||
++
|
|
||||||
+ if (p->state == BR_STATE_DISABLED)
|
|
||||||
+ goto out;
|
|
||||||
+
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
From 8ba5feb6aaba50bda126db027490c7d37e428e3b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stijn Tintel <stijn@linux-ipv6.be>
|
|
||||||
Date: Fri, 20 Aug 2021 16:11:12 +0300
|
|
||||||
Subject: [PATCH 15/27] uhttpd: add config option for json_script
|
|
||||||
|
|
||||||
Add a config option for json_script instead of unconditionally including
|
|
||||||
all json files in /etc/uhttpd in every uhttpd instance. This makes it
|
|
||||||
possible to configure a single instance with an unconditional redirect,
|
|
||||||
which is currently not possible as it would render all other uhttpd
|
|
||||||
instances unusable.
|
|
||||||
|
|
||||||
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
|
||||||
---
|
|
||||||
package/network/services/uhttpd/files/uhttpd.init | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init
|
|
||||||
index 869f79bea2..7020912c6c 100755
|
|
||||||
--- a/package/network/services/uhttpd/files/uhttpd.init
|
|
||||||
+++ b/package/network/services/uhttpd/files/uhttpd.init
|
|
||||||
@@ -195,7 +195,8 @@ start_instance()
|
|
||||||
append_bool "$cfg" redirect_https "-q" 0
|
|
||||||
}
|
|
||||||
|
|
||||||
- for file in /etc/uhttpd/*.json; do
|
|
||||||
+ config_get json_script "$cfg" json_script
|
|
||||||
+ for file in $json_script; do
|
|
||||||
[ -s "$file" ] && procd_append_param command -H "$file"
|
|
||||||
done
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
From 63281b982b3692828ff453dcb9e68b8e43d628e5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Mon, 21 Jun 2021 12:53:28 +0200
|
|
||||||
Subject: [PATCH 16/27] iwinfo: update to latest git HEAD
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/network/utils/iwinfo/Makefile | 14 +++++++++++---
|
|
||||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
|
|
||||||
index 815c477988..d235f07da9 100644
|
|
||||||
--- a/package/network/utils/iwinfo/Makefile
|
|
||||||
+++ b/package/network/utils/iwinfo/Makefile
|
|
||||||
@@ -11,12 +11,20 @@ PKG_RELEASE:=2.1
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
|
||||||
-PKG_SOURCE_DATE:=2021-04-30
|
|
||||||
-PKG_SOURCE_VERSION:=c45f0b584b4b86f8250f90ea19afca271c114fa2
|
|
||||||
-PKG_MIRROR_HASH:=24ad04791254a0523cd15a4fec6116d9ff121e006c93e5e41459f91347b33ec2
|
|
||||||
+PKG_SOURCE_DATE:=2021-06-09
|
|
||||||
+PKG_SOURCE_VERSION:=c0414642fead263a4a6a686ad3cb7e965ec8a23a
|
|
||||||
+PKG_MIRROR_HASH:=c5686bbae86753c53db03a686b034bbb80d31107cc359ebd8522ea1c82db35ea
|
|
||||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
|
||||||
|
|
||||||
+PKG_FLAGS := nonshared
|
|
||||||
+
|
|
||||||
+PKG_CONFIG_DEPENDS := \
|
|
||||||
+ CONFIG_PACKAGE_kmod-brcm-wl \
|
|
||||||
+ CONFIG_PACKAGE_kmod-brcm-wl-mini \
|
|
||||||
+ CONFIG_PACKAGE_kmod-brcm-wl-mimo \
|
|
||||||
+ CONFIG_PACKAGE_kmod-cfg80211
|
|
||||||
+
|
|
||||||
IWINFO_ABI_VERSION:=20210430
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
From 1496ca5ceb941ba725311c6c0366193092035f32 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Thu, 27 May 2021 13:24:47 +0200
|
|
||||||
Subject: [PATCH 01/60] netifd: update to latest HEAD
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/network/config/netifd/Makefile | 8 ++--
|
|
||||||
.../config/netifd/patches/100-script.patch | 21 +++++++++++
|
|
||||||
.../config/netifd/patches/hairpin.patch | 37 +++++++++++++++++++
|
|
||||||
3 files changed, 61 insertions(+), 5 deletions(-)
|
|
||||||
create mode 100644 package/network/config/netifd/patches/100-script.patch
|
|
||||||
create mode 100644 package/network/config/netifd/patches/hairpin.patch
|
|
||||||
|
|
||||||
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
|
|
||||||
index 4b5f110da2..d41bddfd56 100644
|
|
||||||
--- a/package/network/config/netifd/Makefile
|
|
||||||
+++ b/package/network/config/netifd/Makefile
|
|
||||||
@@ -5,16 +5,14 @@ PKG_RELEASE:=1
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
|
|
||||||
-PKG_SOURCE_DATE:=2021-07-26
|
|
||||||
-PKG_SOURCE_VERSION:=440eb0647708274cc8d7d9e7c2bb0cfdfba90023
|
|
||||||
-PKG_MIRROR_HASH:=eed957036ab608fdc49bdf801fc5b4405fcd2a3a5e5d3343ec39898e156c10e9
|
|
||||||
+PKG_SOURCE_DATE:=2021-10-20
|
|
||||||
+PKG_SOURCE_VERSION:=c61a1d432b34babe230e49a82712608b07410fc3
|
|
||||||
+PKG_MIRROR_HASH:=2b040d039c560cbc04dfe1e496aa81f714a032db88986803728dd6b724c11cd2
|
|
||||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
|
||||||
PKG_LICENSE_FILES:=
|
|
||||||
|
|
||||||
-PKG_BUILD_PARALLEL:=1
|
|
||||||
-
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
include $(INCLUDE_DIR)/cmake.mk
|
|
||||||
|
|
||||||
diff --git a/package/network/config/netifd/patches/100-script.patch b/package/network/config/netifd/patches/100-script.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..e7ba83f4bb
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/network/config/netifd/patches/100-script.patch
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+Index: a/scripts/netifd-wireless.sh
|
|
||||||
+===================================================================
|
|
||||||
+--- a/scripts/netifd-wireless.sh
|
|
||||||
++++ b/scripts/netifd-wireless.sh
|
|
||||||
+@@ -252,11 +252,14 @@ wireless_vif_parse_encryption() {
|
|
||||||
+ auth_type=owe
|
|
||||||
+ ;;
|
|
||||||
+ wpa3-mixed*)
|
|
||||||
+- auth_type=eap-eap192
|
|
||||||
++ auth_type=eap-eap256
|
|
||||||
+ ;;
|
|
||||||
+- wpa3*)
|
|
||||||
++ wpa3-192*)
|
|
||||||
+ auth_type=eap192
|
|
||||||
+ ;;
|
|
||||||
++ wpa3*)
|
|
||||||
++ auth_type=eap256
|
|
||||||
++ ;;
|
|
||||||
+ psk3-mixed*|sae-mixed*)
|
|
||||||
+ auth_type=psk-sae
|
|
||||||
+ ;;
|
|
||||||
diff --git a/package/network/config/netifd/patches/hairpin.patch b/package/network/config/netifd/patches/hairpin.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..25515d75d4
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/network/config/netifd/patches/hairpin.patch
|
|
||||||
@@ -0,0 +1,37 @@
|
|
||||||
+diff --git a/wireless.c b/wireless.c
|
|
||||||
+index b26c4e8c8f0b..bd847e72ab40 100644
|
|
||||||
+--- a/wireless.c
|
|
||||||
++++ b/wireless.c
|
|
||||||
+@@ -804,20 +804,13 @@ wireless_interface_init_config(struct wireless_interface *vif)
|
|
||||||
+ vif->network = cur;
|
|
||||||
+
|
|
||||||
+ cur = tb[VIF_ATTR_MODE];
|
|
||||||
+- if (cur)
|
|
||||||
+- vif->ap_mode = !strcmp(blobmsg_get_string(cur), "ap");
|
|
||||||
+-
|
|
||||||
+- if (!vif->ap_mode)
|
|
||||||
+- return;
|
|
||||||
++ vif->ap_mode = cur && !strcmp(blobmsg_get_string(cur), "ap");
|
|
||||||
+
|
|
||||||
+ cur = tb[VIF_ATTR_ISOLATE];
|
|
||||||
+- if (cur)
|
|
||||||
+- vif->isolate = blobmsg_get_bool(cur);
|
|
||||||
++ vif->isolate = vif->ap_mode && cur && blobmsg_get_bool(cur);
|
|
||||||
+
|
|
||||||
+ cur = tb[VIF_ATTR_PROXYARP];
|
|
||||||
+- if (cur)
|
|
||||||
+- vif->proxyarp = blobmsg_get_bool(cur);
|
|
||||||
+-
|
|
||||||
++ vif->proxyarp = vif->ap_mode && cur && blobmsg_get_bool(cur);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* vlist update call for wireless interface list */
|
|
||||||
+@@ -846,8 +839,6 @@ vif_update(struct vlist_tree *tree, struct vlist_node *node_new,
|
|
||||||
+ wireless_interface_handle_link(vif_old, NULL, false);
|
|
||||||
+ free(vif_old->config);
|
|
||||||
+ vif_old->config = blob_memdup(vif_new->config);
|
|
||||||
+- vif_old->isolate = vif_new->isolate;
|
|
||||||
+- vif_old->ap_mode = vif_new->ap_mode;
|
|
||||||
+ wireless_interface_init_config(vif_old);
|
|
||||||
+ free(vif_new);
|
|
||||||
+ } else if (vif_new) {
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,179 +0,0 @@
|
|||||||
From 006abf1773051ad355b52d70095f63f44a496b13 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Sun, 25 Jul 2021 13:32:37 +0200
|
|
||||||
Subject: [PATCH 02/70] procd: add uxc support
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/system/procd/Makefile | 15 +++---
|
|
||||||
package/system/procd/files/procd.sh | 79 +++++++++++++++++++++++++++++
|
|
||||||
package/system/procd/files/uxc.init | 4 ++
|
|
||||||
3 files changed, 90 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
|
|
||||||
index 30d5adf427..b831f86639 100644
|
|
||||||
--- a/package/system/procd/Makefile
|
|
||||||
+++ b/package/system/procd/Makefile
|
|
||||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
|
|
||||||
-PKG_SOURCE_DATE:=2021-02-23
|
|
||||||
-PKG_SOURCE_VERSION:=37eed131e9967a35f47bacb3437a9d3c8a57b3f4
|
|
||||||
-PKG_MIRROR_HASH:=2b0131ff9055ccf987cbeb5f36c2c2585dc780999df6be312fbbbcd61ce676d4
|
|
||||||
+PKG_MIRROR_HASH:=0d51642d82d7bb4150355a6986e54504dce171c6fcb7eeff312d20a5d106bad8
|
|
||||||
+PKG_SOURCE_DATE:=2021-11-04
|
|
||||||
+PKG_SOURCE_VERSION:=0ee8e734a7f67220cf4a3412b60ff674b5fb20dd
|
|
||||||
CMAKE_INSTALL:=1
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
|
||||||
@@ -32,7 +32,7 @@ include $(INCLUDE_DIR)/package.mk
|
|
||||||
include $(INCLUDE_DIR)/cmake.mk
|
|
||||||
|
|
||||||
ifeq ($(DUMP),)
|
|
||||||
- STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | mkhash md5)
|
|
||||||
+ STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | $(MKHASH) md5)
|
|
||||||
endif
|
|
||||||
|
|
||||||
CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)"
|
|
||||||
@@ -68,7 +68,7 @@ define Package/procd-ujail
|
|
||||||
SECTION:=base
|
|
||||||
CATEGORY:=Base system
|
|
||||||
DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS \
|
|
||||||
- +libubox +libubus +libblobmsg-json
|
|
||||||
+ +libubox +libubus +libuci +libblobmsg-json
|
|
||||||
TITLE:=OpenWrt process jail helper
|
|
||||||
endef
|
|
||||||
|
|
||||||
@@ -82,15 +82,14 @@ endef
|
|
||||||
define Package/procd-seccomp
|
|
||||||
SECTION:=base
|
|
||||||
CATEGORY:=Base system
|
|
||||||
- DEPENDS:=@(arm||armeb||mips||mipsel||i386||powerpc||x86_64) @!TARGET_uml \
|
|
||||||
- @KERNEL_SECCOMP +libubox +libblobmsg-json
|
|
||||||
+ DEPENDS:=@SECCOMP +libubox +libblobmsg-json
|
|
||||||
TITLE:=OpenWrt process seccomp helper + utrace
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/uxc
|
|
||||||
SECTION:=base
|
|
||||||
CATEGORY:=Base system
|
|
||||||
- DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json
|
|
||||||
+ DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd +PACKAGE_uxc:rpcd
|
|
||||||
TITLE:=OpenWrt container management
|
|
||||||
MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
|
||||||
endef
|
|
||||||
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
|
|
||||||
index d86b7219da..3549a5a914 100644
|
|
||||||
--- a/package/system/procd/files/procd.sh
|
|
||||||
+++ b/package/system/procd/files/procd.sh
|
|
||||||
@@ -329,6 +329,82 @@ _procd_add_config_trigger() {
|
|
||||||
json_close_array
|
|
||||||
}
|
|
||||||
|
|
||||||
+_procd_add_mount_trigger() {
|
|
||||||
+ json_add_array
|
|
||||||
+ _procd_add_array_data "$1"
|
|
||||||
+ local action="$2"
|
|
||||||
+ local multi=0
|
|
||||||
+ shift ; shift
|
|
||||||
+
|
|
||||||
+ json_add_array
|
|
||||||
+ _procd_add_array_data "if"
|
|
||||||
+
|
|
||||||
+ if [ "$2" ]; then
|
|
||||||
+ json_add_array
|
|
||||||
+ _procd_add_array_data "or"
|
|
||||||
+ multi=1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ while [ "$1" ]; do
|
|
||||||
+ json_add_array
|
|
||||||
+ _procd_add_array_data "eq" "target" "$1"
|
|
||||||
+ shift
|
|
||||||
+ json_close_array
|
|
||||||
+ done
|
|
||||||
+
|
|
||||||
+ [ $multi = 1 ] && json_close_array
|
|
||||||
+
|
|
||||||
+ json_add_array
|
|
||||||
+ _procd_add_array_data "run_script" /etc/init.d/$name $action
|
|
||||||
+ json_close_array
|
|
||||||
+
|
|
||||||
+ json_close_array
|
|
||||||
+ _procd_add_timeout
|
|
||||||
+ json_close_array
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+_procd_add_action_mount_trigger() {
|
|
||||||
+ local script=$(readlink "$initscript")
|
|
||||||
+ local name=$(basename ${script:-$initscript})
|
|
||||||
+ local action="$1"
|
|
||||||
+ local mpath
|
|
||||||
+ shift
|
|
||||||
+
|
|
||||||
+ _procd_open_trigger
|
|
||||||
+ _procd_add_mount_trigger mount.add $action "$@"
|
|
||||||
+ _procd_close_trigger
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+procd_get_mountpoints() {
|
|
||||||
+ (
|
|
||||||
+ __procd_check_mount() {
|
|
||||||
+ local cfg="$1"
|
|
||||||
+ local path="${2%%/}/"
|
|
||||||
+ local target
|
|
||||||
+ config_get target "$cfg" target
|
|
||||||
+ target="${target%%/}/"
|
|
||||||
+ [ "$path" != "${path##$target}" ] && echo "${target%%/}"
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ config_load fstab
|
|
||||||
+ for mpath in "$@"; do
|
|
||||||
+ config_foreach __procd_check_mount mount "$mpath"
|
|
||||||
+ done
|
|
||||||
+ ) | sort -u
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+_procd_add_restart_mount_trigger() {
|
|
||||||
+ local mountpoints="$(procd_get_mountpoints "$@")"
|
|
||||||
+ [ "${mountpoints//[[:space:]]}" ] &&
|
|
||||||
+ _procd_add_action_mount_trigger restart $mountpoints
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+_procd_add_reload_mount_trigger() {
|
|
||||||
+ local mountpoints="$(procd_get_mountpoints "$@")"
|
|
||||||
+ [ "${mountpoints//[[:space:]]}" ] &&
|
|
||||||
+ _procd_add_action_mount_trigger reload $mountpoints
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
_procd_add_raw_trigger() {
|
|
||||||
json_add_array
|
|
||||||
_procd_add_array_data "$1"
|
|
||||||
@@ -560,8 +636,11 @@ _procd_wrapper \
|
|
||||||
procd_add_raw_trigger \
|
|
||||||
procd_add_config_trigger \
|
|
||||||
procd_add_interface_trigger \
|
|
||||||
+ procd_add_mount_trigger \
|
|
||||||
procd_add_reload_trigger \
|
|
||||||
procd_add_reload_interface_trigger \
|
|
||||||
+ procd_add_reload_mount_trigger \
|
|
||||||
+ procd_add_restart_mount_trigger \
|
|
||||||
procd_open_trigger \
|
|
||||||
procd_close_trigger \
|
|
||||||
procd_open_instance \
|
|
||||||
diff --git a/package/system/procd/files/uxc.init b/package/system/procd/files/uxc.init
|
|
||||||
index 035c8b0b9e..1e75b796f8 100644
|
|
||||||
--- a/package/system/procd/files/uxc.init
|
|
||||||
+++ b/package/system/procd/files/uxc.init
|
|
||||||
@@ -16,3 +16,7 @@ boot() {
|
|
||||||
__BOOT_UXC=1
|
|
||||||
start
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+service_triggers() {
|
|
||||||
+ procd_add_raw_trigger "mount.add" 3000 /etc/init.d/uxc boot
|
|
||||||
+}
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
From 23c15e2536d0fa5ed81c5bdfe7623d3370dca997 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Paul Spooren <mail@aparcar.org>
|
|
||||||
Date: Fri, 2 Oct 2020 23:30:30 -1000
|
|
||||||
Subject: [PATCH 21/27] build: create APK files parrallel to IPK
|
|
||||||
|
|
||||||
Create APK files based on the folder and control files of IPK packages.
|
|
||||||
|
|
||||||
Signed-off-by: Paul Spooren <mail@aparcar.org>
|
|
||||||
---
|
|
||||||
include/package-ipkg.mk | 48 +++++++++++++++++++++++++------------
|
|
||||||
package/Makefile | 2 ++
|
|
||||||
package/base-files/Makefile | 4 ++++
|
|
||||||
rules.mk | 2 ++
|
|
||||||
scripts/apk-make-index.sh | 20 ++++++++++++++++
|
|
||||||
5 files changed, 61 insertions(+), 15 deletions(-)
|
|
||||||
create mode 100755 scripts/apk-make-index.sh
|
|
||||||
|
|
||||||
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
|
|
||||||
index e972b7de0b..5c31b1774f 100644
|
|
||||||
--- a/include/package-ipkg.mk
|
|
||||||
+++ b/include/package-ipkg.mk
|
|
||||||
@@ -102,6 +102,7 @@ ifeq ($(DUMP),)
|
|
||||||
ABIV_$(1):=$(call FormatABISuffix,$(1),$(ABI_VERSION))
|
|
||||||
PDIR_$(1):=$(call FeedPackageDir,$(1))
|
|
||||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
|
|
||||||
+ APK_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).apk
|
|
||||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
|
||||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
|
||||||
|
|
||||||
@@ -200,7 +201,7 @@ $(_endef)
|
|
||||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
|
||||||
@rm -rf $$(IDIR_$(1)); \
|
|
||||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1))))
|
|
||||||
- mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
|
||||||
+ mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1)) $(PKG_INFO_DIR)
|
|
||||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
|
||||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
|
||||||
$(call Package/$(1)/install-overlay,$$(IDIR_$(1))/rootfs-overlay)
|
|
||||||
@@ -226,6 +227,37 @@ $(_endef)
|
|
||||||
) || true \
|
|
||||||
)
|
|
||||||
endif
|
|
||||||
+
|
|
||||||
+ ifneq ($$(KEEP_$(1)),)
|
|
||||||
+ @( \
|
|
||||||
+ keepfiles=""; \
|
|
||||||
+ for x in $$(KEEP_$(1)); do \
|
|
||||||
+ [ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
|
|
||||||
+ done; \
|
|
||||||
+ [ -z "$$$$keepfiles" ] || { \
|
|
||||||
+ mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
|
|
||||||
+ for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
|
|
||||||
+ }; \
|
|
||||||
+ )
|
|
||||||
+ endif
|
|
||||||
+
|
|
||||||
+ $(INSTALL_DIR) $$(PDIR_$(1))
|
|
||||||
+
|
|
||||||
+ $(FAKEROOT) apk mkpkg \
|
|
||||||
+ --info "name:$(1)" \
|
|
||||||
+ --info "version:$(VERSION)" \
|
|
||||||
+ --info "description:$()" \
|
|
||||||
+ --info "arch:$(PKGARCH)" \
|
|
||||||
+ --info "license:$(LICENSE)" \
|
|
||||||
+ --info "origin:$(SOURCE)" \
|
|
||||||
+ --info "maintainer:$(MAINTAINER)" \
|
|
||||||
+ $$(foreach dep,$$(Package/$(1)/DEPENDS),--info "depends:$$(subst $$(comma),,$$(dep))") \
|
|
||||||
+ --files "$$(IDIR_$(1))" \
|
|
||||||
+ --output "$$(APK_$(1))" \
|
|
||||||
+ --sign "$(BUILD_KEY_APK_SEC)"
|
|
||||||
+
|
|
||||||
+ mkdir -p $$(IDIR_$(1))/CONTROL
|
|
||||||
+
|
|
||||||
(cd $$(IDIR_$(1))/CONTROL; \
|
|
||||||
( \
|
|
||||||
echo "$$$$CONTROL"; \
|
|
||||||
@@ -249,20 +281,6 @@ $(_endef)
|
|
||||||
$($(1)_COMMANDS) \
|
|
||||||
)
|
|
||||||
|
|
||||||
- ifneq ($$(KEEP_$(1)),)
|
|
||||||
- @( \
|
|
||||||
- keepfiles=""; \
|
|
||||||
- for x in $$(KEEP_$(1)); do \
|
|
||||||
- [ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
|
|
||||||
- done; \
|
|
||||||
- [ -z "$$$$keepfiles" ] || { \
|
|
||||||
- mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
|
|
||||||
- for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
|
|
||||||
- }; \
|
|
||||||
- )
|
|
||||||
- endif
|
|
||||||
-
|
|
||||||
- $(INSTALL_DIR) $$(PDIR_$(1))
|
|
||||||
$(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
|
|
||||||
@[ -f $$(IPKG_$(1)) ]
|
|
||||||
|
|
||||||
diff --git a/package/Makefile b/package/Makefile
|
|
||||||
index ec503dc527..18a19fff13 100644
|
|
||||||
--- a/package/Makefile
|
|
||||||
+++ b/package/Makefile
|
|
||||||
@@ -60,6 +60,7 @@ $(curdir)/merge-index: $(curdir)/merge
|
|
||||||
|
|
||||||
ifndef SDK
|
|
||||||
$(curdir)/compile: $(curdir)/system/opkg/host/compile
|
|
||||||
+ $(patsubst %,$(curdir)/%/compile,$(filter-out %/apk/host,$($(curdir)/builddirs))): $(curdir)/system/apk/host/compile
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
|
|
||||||
@@ -84,6 +85,7 @@ $(curdir)/index: FORCE
|
|
||||||
@for d in $(PACKAGE_SUBDIRS); do ( \
|
|
||||||
mkdir -p $$d; \
|
|
||||||
cd $$d || continue; \
|
|
||||||
+ $(SCRIPT_DIR)/apk-make-index.sh . 2>&1; \
|
|
||||||
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
|
|
||||||
grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require|SourceDateEpoch)' Packages.manifest > Packages; \
|
|
||||||
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
|
|
||||||
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
|
|
||||||
index 8a1ddf96f5..9db4812981 100644
|
|
||||||
--- a/package/base-files/Makefile
|
|
||||||
+++ b/package/base-files/Makefile
|
|
||||||
@@ -107,6 +107,10 @@ ifdef CONFIG_SIGNED_PACKAGES
|
|
||||||
[ -s $(BUILD_KEY).ucert ] || \
|
|
||||||
$(STAGING_DIR_HOST)/bin/ucert -I -c $(BUILD_KEY).ucert -p $(BUILD_KEY).pub -s $(BUILD_KEY)
|
|
||||||
|
|
||||||
+ [ -s $(BUILD_KEY_APK_SEC) -a -s $(BUILD_KEY_APK_PUB) ] || \
|
|
||||||
+ openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC); \
|
|
||||||
+ openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB)
|
|
||||||
+
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifndef CONFIG_BUILDBOT
|
|
||||||
diff --git a/rules.mk b/rules.mk
|
|
||||||
index f31d9bb113..de81b65d46 100644
|
|
||||||
--- a/rules.mk
|
|
||||||
+++ b/rules.mk
|
|
||||||
@@ -258,6 +258,8 @@ else
|
|
||||||
endif
|
|
||||||
|
|
||||||
BUILD_KEY=$(TOPDIR)/key-build
|
|
||||||
+BUILD_KEY_APK_SEC=$(TOPDIR)/private-key.pem
|
|
||||||
+BUILD_KEY_APK_PUB=$(TOPDIR)/public-key.pem
|
|
||||||
|
|
||||||
FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
|
|
||||||
|
|
||||||
diff --git a/scripts/apk-make-index.sh b/scripts/apk-make-index.sh
|
|
||||||
new file mode 100755
|
|
||||||
index 0000000000..df1f1a2e2b
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/scripts/apk-make-index.sh
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+#!/usr/bin/env bash
|
|
||||||
+set -e
|
|
||||||
+
|
|
||||||
+pkg_dir=$1
|
|
||||||
+
|
|
||||||
+if [ -z "$pkg_dir" ] || [ ! -d "$pkg_dir" ]; then
|
|
||||||
+ echo "Usage: apk-make-index <package_directory>" >&2
|
|
||||||
+ exit 1
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+(
|
|
||||||
+ cd "$pkg_dir" || exit 1
|
|
||||||
+ GLOBIGNORE="kernel*:libc*"
|
|
||||||
+ set -- *.apk
|
|
||||||
+ if [ "$1" = '*.apk' ]; then
|
|
||||||
+ echo "No APK packages found"
|
|
||||||
+ fi
|
|
||||||
+ apk index --output APKINDEX.tar.gz "$@"
|
|
||||||
+ unset GLOBIGNORE
|
|
||||||
+)
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
From 8e8b3e443a7f1d0644f43888c8683698f26d4d13 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
Date: Sun, 25 Jul 2021 01:20:31 +0100
|
|
||||||
Subject: [PATCH 22/27] fstools: update to git HEAD
|
|
||||||
|
|
||||||
bad1835 fstools: add partname volume driver
|
|
||||||
19d7d93 libfstools: partname: several fixes
|
|
||||||
3c38f0c libfstools: fix build with glibc
|
|
||||||
d05ad93 libfstools: remove superflus include
|
|
||||||
964d1e3 partname: allow skipping existing 'rootfs_data' partition
|
|
||||||
c44b40b overlay: fix syncronizing typo
|
|
||||||
b5397a1 fstools: block: fix segfault on mount with no target
|
|
||||||
bd7cc8d block: use dynamically allocated target string
|
|
||||||
6d8450e blockd: use allocated strings instead of fixed buffers
|
|
||||||
d47909e libblkid-tiny: fix buffer overflow
|
|
||||||
67d2297 block: match device path instead of assuming /dev/%s
|
|
||||||
2aeba88 block: allow autofs and umount commands also on MTD/UBI
|
|
||||||
3d40a1b blockd: add missing #define _GNU_SOURCE
|
|
||||||
4d4dcfb blockd: detect mountpoint of /dev/mapper/*
|
|
||||||
2f42515 block: resolve /dev/mapper/* name for /dev/dm-0 when hotplugging
|
|
||||||
39558a1 blockd: also send ubus notification on mount hotplug
|
|
||||||
3386b6b blockd: fix trigger name
|
|
||||||
cdc9939 blockd: move to its own POSIX process group
|
|
||||||
59f7c11 blockd: create mountpoint parent folder if needed
|
|
||||||
9cc96af Revert "block: resolve /dev/mapper/* name for /dev/dm-0 when hotplugging"
|
|
||||||
06334ac Revert "blockd: detect mountpoint of /dev/mapper/*"
|
|
||||||
9ab3551 block: use /dev/dm-* instead of /dev/mapper/*
|
|
||||||
5114595 block: allow remove hotplug event to arrive at blockd
|
|
||||||
a846c6b blockd: fix length of timeout int passed to ioctl
|
|
||||||
1d681ca block: support umount device basename
|
|
||||||
|
|
||||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
---
|
|
||||||
package/system/fstools/Makefile | 6 +++---
|
|
||||||
package/system/fstools/files/blockd.init | 1 +
|
|
||||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
|
|
||||||
index 2da508d541..b582a17bae 100644
|
|
||||||
--- a/package/system/fstools/Makefile
|
|
||||||
+++ b/package/system/fstools/Makefile
|
|
||||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
|
|
||||||
-PKG_MIRROR_HASH:=a485792d90c71cd4fb396ce97f42a57ee4d2a3d78e5f3fd0748270ffb14209e6
|
|
||||||
-PKG_SOURCE_DATE:=2021-01-04
|
|
||||||
-PKG_SOURCE_VERSION:=c53b18820756f6f32ad0782d3bf489422b7c4ad3
|
|
||||||
+PKG_MIRROR_HASH:=6a457b812166e04e2244ee1be92a4957666b5d1554315c0e18db1b30376cc617
|
|
||||||
+PKG_SOURCE_DATE:=2021-07-28
|
|
||||||
+PKG_SOURCE_VERSION:=cc63933faedd8d4fcdabb872cf4661ac04fe4ba2
|
|
||||||
CMAKE_INSTALL:=1
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
|
||||||
diff --git a/package/system/fstools/files/blockd.init b/package/system/fstools/files/blockd.init
|
|
||||||
index a4ce57d40d..bdd8bbf622 100755
|
|
||||||
--- a/package/system/fstools/files/blockd.init
|
|
||||||
+++ b/package/system/fstools/files/blockd.init
|
|
||||||
@@ -16,6 +16,7 @@ reload_service() {
|
|
||||||
start_service() {
|
|
||||||
procd_open_instance
|
|
||||||
procd_set_param command "$PROG"
|
|
||||||
+ procd_set_param watch block
|
|
||||||
procd_set_param respawn
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
From 873052b99d6597209957ec32898fa56324cf34a4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Rosen Penev <rosenp@gmail.com>
|
|
||||||
Date: Sat, 19 Jun 2021 14:45:11 -0700
|
|
||||||
Subject: [PATCH 23/27] tools/libressl: update to 3.3.3
|
|
||||||
|
|
||||||
Fix wrong FPIC variable usage. Fixes compilation under sparc64 host.
|
|
||||||
|
|
||||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
||||||
(cherry picked from commit bf4dbbb55e2b8e23f186e1334f1e9ce6a3a8ddfe)
|
|
||||||
---
|
|
||||||
tools/libressl/Makefile | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile
|
|
||||||
index 2b5a33450c..e25b5661ee 100644
|
|
||||||
--- a/tools/libressl/Makefile
|
|
||||||
+++ b/tools/libressl/Makefile
|
|
||||||
@@ -8,8 +8,8 @@
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=libressl
|
|
||||||
-PKG_VERSION:=3.3.1
|
|
||||||
-PKG_HASH:=a6d331865e0164a13ac85a228e52517f7cf8f8488f2f95f34e7857302f97cfdb
|
|
||||||
+PKG_VERSION:=3.3.3
|
|
||||||
+PKG_HASH:=a471565b36ccd1a70d0bd7d37c6e95c43a26a62829b487d9d2cdebfe58be3066
|
|
||||||
PKG_RELEASE:=1
|
|
||||||
|
|
||||||
PKG_CPE_ID:=cpe:/a:openbsd:libressl
|
|
||||||
@@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/host-build.mk
|
|
||||||
|
|
||||||
HOSTCC := $(HOSTCC_NOCACHE)
|
|
||||||
HOST_CONFIGURE_ARGS += --enable-static --disable-shared --disable-tests
|
|
||||||
-HOST_CFLAGS += $(FPIC)
|
|
||||||
+HOST_CFLAGS += $(HOST_FPIC)
|
|
||||||
|
|
||||||
ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32)
|
|
||||||
HOST_CONFIGURE_ARGS += --disable-asm
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,312 +0,0 @@
|
|||||||
From bf98d3c1de524ca50cbc09f825a4b0648e353624 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Fri, 13 Aug 2021 08:47:11 +0200
|
|
||||||
Subject: [PATCH 25/27] apk: backport package
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/system/apk/Makefile | 93 +++++++++++++++++++
|
|
||||||
...vel@lists.alpinelinux.org-4a6a0840.rsa.pub | 9 ++
|
|
||||||
...vel@lists.alpinelinux.org-5243ef4b.rsa.pub | 9 ++
|
|
||||||
...vel@lists.alpinelinux.org-5261cecb.rsa.pub | 9 ++
|
|
||||||
package/system/apk/files/alpine-repositories | 3 +
|
|
||||||
.../apk/patches/000-Makefile-version.patch | 11 +++
|
|
||||||
.../patches/0001-remove-doc-generation.patch | 21 +++++
|
|
||||||
package/system/apk/patches/100-link.patch | 16 ++++
|
|
||||||
package/system/apk/patches/100-phtread.patch | 12 +++
|
|
||||||
...ude-limits.h-to-fix-build-with-glibc.patch | 20 ++++
|
|
||||||
package/system/apk/test.sh | 9 ++
|
|
||||||
11 files changed, 212 insertions(+)
|
|
||||||
create mode 100644 package/system/apk/Makefile
|
|
||||||
create mode 100644 package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
|
||||||
create mode 100644 package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
|
|
||||||
create mode 100644 package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
|
|
||||||
create mode 100644 package/system/apk/files/alpine-repositories
|
|
||||||
create mode 100644 package/system/apk/patches/000-Makefile-version.patch
|
|
||||||
create mode 100644 package/system/apk/patches/0001-remove-doc-generation.patch
|
|
||||||
create mode 100644 package/system/apk/patches/100-link.patch
|
|
||||||
create mode 100644 package/system/apk/patches/100-phtread.patch
|
|
||||||
create mode 100644 package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch
|
|
||||||
create mode 100644 package/system/apk/test.sh
|
|
||||||
|
|
||||||
diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..335f50c155
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/Makefile
|
|
||||||
@@ -0,0 +1,93 @@
|
|
||||||
+include $(TOPDIR)/rules.mk
|
|
||||||
+
|
|
||||||
+PKG_NAME:=apk
|
|
||||||
+PKG_VERSION:=3.0.0_pre0
|
|
||||||
+
|
|
||||||
+PKG_SOURCE_PROTO:=git
|
|
||||||
+PKG_SOURCE_URL:=https://git.alpinelinux.org/apk-tools.git
|
|
||||||
+PKG_SOURCE_DATE:=2021-08-17
|
|
||||||
+PKG_SOURCE_VERSION:=a46043bcc4cc15b456ef1eac5c5f9d93bd905d53
|
|
||||||
+PKG_MIRROR_HASH:=e16fd04b18043e78a177acd8c6958fa03fd1484b62c879c2dd0bed8ce9c50625
|
|
||||||
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
|
||||||
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
|
||||||
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_SUBDIR)
|
|
||||||
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
|
|
||||||
+PKG_RELEASE:=r$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))-$(AUTORELEASE)
|
|
||||||
+
|
|
||||||
+PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
|
|
||||||
+PKG_LICENSE:=GPL-2.0-only
|
|
||||||
+PKG_LICENSE_FILES:=LICENSE
|
|
||||||
+
|
|
||||||
+PKG_INSTALL:=1
|
|
||||||
+PKG_BUILD_PARALLEL:=1
|
|
||||||
+
|
|
||||||
+HOST_BUILD_DEPENDS:=lua/host lua-lzlib/host
|
|
||||||
+PKG_BUILD_DEPENDS:=$(HOST_BUILD_DEPENDS)
|
|
||||||
+
|
|
||||||
+include $(INCLUDE_DIR)/package.mk
|
|
||||||
+include $(INCLUDE_DIR)/host-build.mk
|
|
||||||
+
|
|
||||||
+define Package/apk
|
|
||||||
+ SECTION:=utils
|
|
||||||
+ CATEGORY:=Utilities
|
|
||||||
+ TITLE:=apk package manager
|
|
||||||
+ DEPENDS:=+liblua +libopenssl +zlib @!arc
|
|
||||||
+ URL:=$(PKG_SOURCE_URL)
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Package/alpine-keys
|
|
||||||
+ SECTION:=utils
|
|
||||||
+ CATEGORY:=Utilities
|
|
||||||
+ TITLE:=Alpine apk public signing keys
|
|
||||||
+ DEPENDS:=apk
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Package/alpine-repositories
|
|
||||||
+ SECTION:=utils
|
|
||||||
+ CATEGORY:=Utilities
|
|
||||||
+ TITLE:=Official Alpine repositories
|
|
||||||
+ DEPENDS:=apk
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+MAKE_FLAGS += \
|
|
||||||
+ LUA=$(STAGING_DIR_HOSTPKG)/bin/lua \
|
|
||||||
+ LUA_VERSION=5.1 \
|
|
||||||
+ LUA_PC=lua
|
|
||||||
+
|
|
||||||
+HOST_MAKE_FLAGS += \
|
|
||||||
+ LUA=$(STAGING_DIR_HOSTPKG)/bin/lua \
|
|
||||||
+ LUA_VERSION=5.1 \
|
|
||||||
+ DESTDIR=$(STAGING_DIR_HOSTPKG) \
|
|
||||||
+ SBINDIR=/bin \
|
|
||||||
+ PREFIX=
|
|
||||||
+
|
|
||||||
+HOST_LDFLAGS+=-Wl,-rpath=$(STAGING_DIR_HOSTPKG)/lib -lpthread
|
|
||||||
+
|
|
||||||
+define Package/apk/install
|
|
||||||
+ $(INSTALL_DIR) $(1)/lib/apk/db
|
|
||||||
+
|
|
||||||
+ $(INSTALL_DIR) $(1)/bin
|
|
||||||
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/apk $(1)/bin/apk
|
|
||||||
+
|
|
||||||
+ $(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
+ $(CP) $(PKG_INSTALL_DIR)/lib/*.so.* $(1)/usr/lib/
|
|
||||||
+
|
|
||||||
+ $(INSTALL_DIR) $(1)/etc/apk/
|
|
||||||
+ echo $(ARCH) > $(1)/etc/apk/arch
|
|
||||||
+ touch $(1)/etc/apk/world
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Package/alpine-keys/install
|
|
||||||
+ $(INSTALL_DIR) $(1)/etc/apk/keys
|
|
||||||
+ $(INSTALL_DATA) ./files/alpine-keys/* $(1)/etc/apk/keys
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Package/alpine-repositories/install
|
|
||||||
+ $(INSTALL_DIR) $(1)/etc/apk/keys
|
|
||||||
+ $(INSTALL_DATA) ./files/alpine-repositories $(1)/etc/apk/repositories
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+$(eval $(call BuildPackage,apk))
|
|
||||||
+$(eval $(call BuildPackage,alpine-keys))
|
|
||||||
+$(eval $(call BuildPackage,alpine-repositories))
|
|
||||||
+$(eval $(call HostBuild))
|
|
||||||
diff --git a/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..bb4bdc80fd
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+-----BEGIN PUBLIC KEY-----
|
|
||||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1yHJxQgsHQREclQu4Ohe
|
|
||||||
+qxTxd1tHcNnvnQTu/UrTky8wWvgXT+jpveroeWWnzmsYlDI93eLI2ORakxb3gA2O
|
|
||||||
+Q0Ry4ws8vhaxLQGC74uQR5+/yYrLuTKydFzuPaS1dK19qJPXB8GMdmFOijnXX4SA
|
|
||||||
+jixuHLe1WW7kZVtjL7nufvpXkWBGjsfrvskdNA/5MfxAeBbqPgaq0QMEfxMAn6/R
|
|
||||||
+L5kNepi/Vr4S39Xvf2DzWkTLEK8pcnjNkt9/aafhWqFVW7m3HCAII6h/qlQNQKSo
|
|
||||||
+GuH34Q8GsFG30izUENV9avY7hSLq7nggsvknlNBZtFUcmGoQrtx3FmyYsIC8/R+B
|
|
||||||
+ywIDAQAB
|
|
||||||
+-----END PUBLIC KEY-----
|
|
||||||
diff --git a/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6cbfad7441
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+-----BEGIN PUBLIC KEY-----
|
|
||||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvNijDxJ8kloskKQpJdx+
|
|
||||||
+mTMVFFUGDoDCbulnhZMJoKNkSuZOzBoFC94omYPtxnIcBdWBGnrm6ncbKRlR+6oy
|
|
||||||
+DO0W7c44uHKCFGFqBhDasdI4RCYP+fcIX/lyMh6MLbOxqS22TwSLhCVjTyJeeH7K
|
|
||||||
+aA7vqk+QSsF4TGbYzQDDpg7+6aAcNzg6InNePaywA6hbT0JXbxnDWsB+2/LLSF2G
|
|
||||||
+mnhJlJrWB1WGjkz23ONIWk85W4S0XB/ewDefd4Ly/zyIciastA7Zqnh7p3Ody6Q0
|
|
||||||
+sS2MJzo7p3os1smGjUF158s6m/JbVh4DN6YIsxwl2OjDOz9R0OycfJSDaBVIGZzg
|
|
||||||
+cQIDAQAB
|
|
||||||
+-----END PUBLIC KEY-----
|
|
||||||
diff --git a/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..83f0658e9c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+-----BEGIN PUBLIC KEY-----
|
|
||||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwlzMkl7b5PBdfMzGdCT0
|
|
||||||
+cGloRr5xGgVmsdq5EtJvFkFAiN8Ac9MCFy/vAFmS8/7ZaGOXoCDWbYVLTLOO2qtX
|
|
||||||
+yHRl+7fJVh2N6qrDDFPmdgCi8NaE+3rITWXGrrQ1spJ0B6HIzTDNEjRKnD4xyg4j
|
|
||||||
+g01FMcJTU6E+V2JBY45CKN9dWr1JDM/nei/Pf0byBJlMp/mSSfjodykmz4Oe13xB
|
|
||||||
+Ca1WTwgFykKYthoLGYrmo+LKIGpMoeEbY1kuUe04UiDe47l6Oggwnl+8XD1MeRWY
|
|
||||||
+sWgj8sF4dTcSfCMavK4zHRFFQbGp/YFJ/Ww6U9lA3Vq0wyEI6MCMQnoSMFwrbgZw
|
|
||||||
+wwIDAQAB
|
|
||||||
+-----END PUBLIC KEY-----
|
|
||||||
diff --git a/package/system/apk/files/alpine-repositories b/package/system/apk/files/alpine-repositories
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..5babbb23b4
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/files/alpine-repositories
|
|
||||||
@@ -0,0 +1,3 @@
|
|
||||||
+https://dl-cdn.alpinelinux.org/alpine/edge/main
|
|
||||||
+https://dl-cdn.alpinelinux.org/alpine/edge/community
|
|
||||||
+
|
|
||||||
diff --git a/package/system/apk/patches/000-Makefile-version.patch b/package/system/apk/patches/000-Makefile-version.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..2e7f5b0f15
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/patches/000-Makefile-version.patch
|
|
||||||
@@ -0,0 +1,11 @@
|
|
||||||
+--- a/Makefile
|
|
||||||
++++ b/Makefile
|
|
||||||
+@@ -4,7 +4,7 @@
|
|
||||||
+ -include config.mk
|
|
||||||
+
|
|
||||||
+ PACKAGE := apk-tools
|
|
||||||
+-VERSION := 2.12.0
|
|
||||||
++VERSION := 3.0.0_pre0
|
|
||||||
+
|
|
||||||
+ export VERSION
|
|
||||||
+
|
|
||||||
diff --git a/package/system/apk/patches/0001-remove-doc-generation.patch b/package/system/apk/patches/0001-remove-doc-generation.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..dee05c56f2
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/patches/0001-remove-doc-generation.patch
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+From b05a93c48fdbb50f0c464310dc2ce45777d32ea2 Mon Sep 17 00:00:00 2001
|
|
||||||
+From: Paul Spooren <mail@aparcar.org>
|
|
||||||
+Date: Fri, 2 Oct 2020 14:08:52 -1000
|
|
||||||
+Subject: [PATCH] remove doc generation
|
|
||||||
+
|
|
||||||
+Signed-off-by: Paul Spooren <mail@aparcar.org>
|
|
||||||
+---
|
|
||||||
+ Makefile | 2 +-
|
|
||||||
+ 1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
+
|
|
||||||
+--- a/Makefile
|
|
||||||
++++ b/Makefile
|
|
||||||
+@@ -25,7 +25,7 @@ export DESTDIR SBINDIR LIBDIR CONFDIR MA
|
|
||||||
+ ##
|
|
||||||
+ # Top-level subdirs
|
|
||||||
+
|
|
||||||
+-subdirs := libfetch/ src/ doc/
|
|
||||||
++subdirs := libfetch/ src/
|
|
||||||
+
|
|
||||||
+ ##
|
|
||||||
+ # Include all rules and stuff
|
|
||||||
diff --git a/package/system/apk/patches/100-link.patch b/package/system/apk/patches/100-link.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..9cae2787d9
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/patches/100-link.patch
|
|
||||||
@@ -0,0 +1,16 @@
|
|
||||||
+diff -urN apk-2021-08-17-a46043bc.orig/src/Makefile apk-2021-08-17-a46043bc/src/Makefile
|
|
||||||
+--- apk-2021-08-17-a46043bc.orig/src/Makefile 2021-08-17 14:21:04.117760513 +0200
|
|
||||||
++++ apk-2021-08-17-a46043bc/src/Makefile 2021-08-17 14:21:16.653830180 +0200
|
|
||||||
+@@ -65,7 +65,11 @@
|
|
||||||
+ app_convdb.o app_convndx.o app_del.o app_dot.o app_extract.o app_fetch.o \
|
|
||||||
+ app_fix.o app_index.o app_info.o app_list.o app_manifest.o app_mkndx.o \
|
|
||||||
+ app_mkpkg.o app_policy.o app_update.o app_upgrade.o app_search.o \
|
|
||||||
+- app_stats.o app_verify.o app_version.o app_vertest.o applet.o
|
|
||||||
++ app_stats.o app_verify.o app_version.o app_vertest.o applet.o \
|
|
||||||
++ adb.o adb_comp.o adb_walk_adb.o adb_walk_genadb.o adb_walk_gentext.o adb_walk_text.o apk_adb.o \
|
|
||||||
++ atom.o blob.o commit.o common.o context.o crypto_openssl.o database.o hash.o \
|
|
||||||
++ extract.o extract_v2.o extract_v3.o io.o io_gunzip.o io_url.o tar.o \
|
|
||||||
++ package.o pathbuilder.o print.o solver.o trust.o version.o
|
|
||||||
+
|
|
||||||
+ ifeq ($(ADB),y)
|
|
||||||
+ libapk.so.$(libapk_soname)-objs += apk_adb.o
|
|
||||||
diff --git a/package/system/apk/patches/100-phtread.patch b/package/system/apk/patches/100-phtread.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..c252e14dc1
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/patches/100-phtread.patch
|
|
||||||
@@ -0,0 +1,12 @@
|
|
||||||
+diff -urN apk-2021-07-23-3d203e8f.orig/src/Makefile apk-2021-07-23-3d203e8f/src/Makefile
|
|
||||||
+--- apk-2021-07-23-3d203e8f.orig/src/Makefile 2021-07-25 12:55:05.576564663 +0200
|
|
||||||
++++ apk-2021-07-23-3d203e8f/src/Makefile 2021-07-25 12:55:48.660862181 +0200
|
|
||||||
+@@ -87,7 +87,7 @@
|
|
||||||
+ apk.static-libs := $(apk-static-libs)
|
|
||||||
+ LDFLAGS_apk.static := -static
|
|
||||||
+ LIBS_apk.static := -Wl,--as-needed -ldl -Wl,--no-as-needed
|
|
||||||
+-LDFLAGS_apk += -L$(obj)
|
|
||||||
++LDFLAGS_apk += -L$(obj) -pthread
|
|
||||||
+ LDFLAGS_apk-test += -L$(obj)
|
|
||||||
+
|
|
||||||
+ CFLAGS_ALL += $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS)
|
|
||||||
diff --git a/package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch b/package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..43ec7d5f1a
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+From c72ea983e287ec1d8b1f2b3aab1bf40aa7a30b03 Mon Sep 17 00:00:00 2001
|
|
||||||
+From: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
+Date: Wed, 4 Aug 2021 21:37:40 +0100
|
|
||||||
+Subject: [PATCH] tar: include <limits.h> to fix build with glibc
|
|
||||||
+
|
|
||||||
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
+---
|
|
||||||
+ src/tar.c | 1 +
|
|
||||||
+ 1 file changed, 1 insertion(+)
|
|
||||||
+
|
|
||||||
+--- a/src/tar.c
|
|
||||||
++++ b/src/tar.c
|
|
||||||
+@@ -9,6 +9,7 @@
|
|
||||||
+
|
|
||||||
+ #include <sys/stat.h>
|
|
||||||
+ #include <sys/sysmacros.h>
|
|
||||||
++#include <limits.h> /* for SSIZE_MAX with glibc */
|
|
||||||
+
|
|
||||||
+ #include "apk_defines.h"
|
|
||||||
+ #include "apk_tar.h"
|
|
||||||
diff --git a/package/system/apk/test.sh b/package/system/apk/test.sh
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..814777fd70
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/system/apk/test.sh
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+#!/bin/sh
|
|
||||||
+
|
|
||||||
+case "$1" in
|
|
||||||
+ "apk")
|
|
||||||
+ apk --version | grep "${2/-r*/}"
|
|
||||||
+ ;;
|
|
||||||
+ *)
|
|
||||||
+ return 0;
|
|
||||||
+esac
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
From ec862d472fca676cc04ce71b640e880ecefdd477 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Fri, 13 Aug 2021 08:48:02 +0200
|
|
||||||
Subject: [PATCH 26/27] lua-lzlib: backport package
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/libs/lua-lzlib/Makefile | 64 +++++++++++++++++++
|
|
||||||
.../patches/001-allow_optim_flags.patch | 12 ++++
|
|
||||||
2 files changed, 76 insertions(+)
|
|
||||||
create mode 100644 package/libs/lua-lzlib/Makefile
|
|
||||||
create mode 100644 package/libs/lua-lzlib/patches/001-allow_optim_flags.patch
|
|
||||||
|
|
||||||
diff --git a/package/libs/lua-lzlib/Makefile b/package/libs/lua-lzlib/Makefile
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..5e0a16b135
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/libs/lua-lzlib/Makefile
|
|
||||||
@@ -0,0 +1,64 @@
|
|
||||||
+#
|
|
||||||
+# Copyright (C) 2015 OpenWrt.org
|
|
||||||
+#
|
|
||||||
+# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
+# See /LICENSE for more information.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+include $(TOPDIR)/rules.mk
|
|
||||||
+
|
|
||||||
+PKG_NAME:=lua-lzlib
|
|
||||||
+PKG_VERSION:=0.4.3
|
|
||||||
+PKG_RELEASE:=1
|
|
||||||
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
|
|
||||||
+PKG_LICENSE:=MIT
|
|
||||||
+
|
|
||||||
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
||||||
+PKG_MIRROR_HASH:=b6ef5e3f04b7f2137b39931a175ee802489a2486e70537770919bcccca10e723
|
|
||||||
+PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
|
|
||||||
+PKG_SOURCE_PROTO:=git
|
|
||||||
+PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
|
|
||||||
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
+
|
|
||||||
+HOST_BUILD_DEPENDS:=lua/host
|
|
||||||
+
|
|
||||||
+include $(INCLUDE_DIR)/package.mk
|
|
||||||
+include $(INCLUDE_DIR)/host-build.mk
|
|
||||||
+
|
|
||||||
+define Package/lua-lzlib
|
|
||||||
+ SUBMENU:=Lua
|
|
||||||
+ SECTION:=lang
|
|
||||||
+ CATEGORY:=Languages
|
|
||||||
+ TITLE:=Lua zlib binding
|
|
||||||
+ URL:=http://github.com/LuaDist/lzlib
|
|
||||||
+ DEPENDS:= +lua +zlib
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Package/lua-lzlib/description
|
|
||||||
+ A library to access zlib library functions and also to read/write gzip files using an interface similar to the base io package.
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+MAKE_FLAGS += \
|
|
||||||
+ LUA="$(STAGING_DIR)/usr" \
|
|
||||||
+ OFLAGS="$(TARGET_CFLAGS)" \
|
|
||||||
+
|
|
||||||
+HOST_MAKE_FLAGS += \
|
|
||||||
+ LUA="$(STAGING_DIR_HOSTPKG)" \
|
|
||||||
+ OFLAGS="$(HOST_CFLAGS)" \
|
|
||||||
+
|
|
||||||
+define Package/lua-lzlib/install
|
|
||||||
+ $(INSTALL_DIR) $(1)/usr/lib/lua
|
|
||||||
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/zlib.so $(1)/usr/lib/lua/
|
|
||||||
+
|
|
||||||
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/gzip.lua $(1)/usr/lib/lua/
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Host/Install
|
|
||||||
+ $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/lua/5.1
|
|
||||||
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/zlib.so $(STAGING_DIR_HOSTPKG)/lib/lua/5.1
|
|
||||||
+
|
|
||||||
+ $(INSTALL_DATA) $(HOST_BUILD_DIR)/gzip.lua $(STAGING_DIR_HOSTPKG)/lib/lua/5.1
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+$(eval $(call BuildPackage,lua-lzlib))
|
|
||||||
+$(eval $(call HostBuild))
|
|
||||||
diff --git a/package/libs/lua-lzlib/patches/001-allow_optim_flags.patch b/package/libs/lua-lzlib/patches/001-allow_optim_flags.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..78f981d237
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/libs/lua-lzlib/patches/001-allow_optim_flags.patch
|
|
||||||
@@ -0,0 +1,12 @@
|
|
||||||
+--- a/Makefile
|
|
||||||
++++ b/Makefile
|
|
||||||
+@@ -14,7 +14,8 @@ LUABIN= $(LUA)/bin
|
|
||||||
+ ZLIB=../zlib-1.2.3
|
|
||||||
+
|
|
||||||
+ # no need to change anything below here
|
|
||||||
+-CFLAGS= $(INCS) $(DEFS) $(WARN) -O0 -fPIC
|
|
||||||
++CFLAGS= $(INCS) $(DEFS) $(WARN) $(OFLAGS) -fPIC
|
|
||||||
++OFLAGS= -O0
|
|
||||||
+ WARN= -g -Werror -Wall -pedantic #-ansi
|
|
||||||
+ INCS= -I$(LUAINC) -I$(ZLIB)
|
|
||||||
+ LIBS= -L$(ZLIB) -lz -L$(LUALIB) -L$(LUABIN) #-llua51
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
From 5fc717aa60b36934892d6d77c0637fc53aa7f761 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
Date: Sat, 10 Jul 2021 20:21:26 +0100
|
|
||||||
Subject: [PATCH 27/27] lua: make it easier to detect host-built Lua
|
|
||||||
|
|
||||||
Install pkg-config file also for host-build, clean up Lua symlinks.
|
|
||||||
|
|
||||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
(cherry picked from commit 315f52e0f3bfa3d65ad14ca21a696c6d31c4edcd)
|
|
||||||
---
|
|
||||||
package/utils/lua/Makefile | 8 ++++++--
|
|
||||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
|
|
||||||
index d262d1e1fc..e15142d8d2 100644
|
|
||||||
--- a/package/utils/lua/Makefile
|
|
||||||
+++ b/package/utils/lua/Makefile
|
|
||||||
@@ -134,8 +134,12 @@ define Host/Install
|
|
||||||
INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
|
|
||||||
install
|
|
||||||
|
|
||||||
- $(LN) $(STAGING_DIR_HOSTPKG)/bin/lua5.1 $(STAGING_DIR_HOSTPKG)/bin/lua
|
|
||||||
- $(LN) $(STAGING_DIR_HOSTPKG)/bin/luac5.1 $(STAGING_DIR_HOSTPKG)/bin/luac
|
|
||||||
+ $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/pkgconfig
|
|
||||||
+ $(CP) $(HOST_BUILD_DIR)/etc/lua.pc $(STAGING_DIR_HOSTPKG)/lib/pkgconfig/lua5.1.pc
|
|
||||||
+
|
|
||||||
+ $(LN) lua5.1 $(STAGING_DIR_HOSTPKG)/bin/lua
|
|
||||||
+ $(LN) luac5.1 $(STAGING_DIR_HOSTPKG)/bin/luac
|
|
||||||
+ $(LN) lua5.1.pc $(STAGING_DIR_HOSTPKG)/lib/pkgconfig/lua.pc
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
From 99b9f524e94b98ce8fd3e141bf7e07bfa96bbea0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Tue, 14 Sep 2021 09:19:08 +0200
|
|
||||||
Subject: [PATCH] mt76: update to latest HEAD
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
package/kernel/mt76/Makefile | 7 +-
|
|
||||||
...the-dst-buffer-to-of_get_mac_address.patch | 206 ++++++++++++++++++
|
|
||||||
2 files changed, 210 insertions(+), 3 deletions(-)
|
|
||||||
create mode 100644 package/kernel/mt76/patches/001-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
|
|
||||||
|
|
||||||
diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
|
|
||||||
index e4051d8347..431c57a240 100644
|
|
||||||
--- a/package/kernel/mt76/Makefile
|
|
||||||
+++ b/package/kernel/mt76/Makefile
|
|
||||||
@@ -8,11 +8,12 @@ PKG_LICENSE_FILES:=
|
|
||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
-PKG_SOURCE_DATE:=2021-06-06
|
|
||||||
-PKG_SOURCE_VERSION:=22b690334c0f49b11534cc2e331c9d5e17c4a0bc
|
|
||||||
-PKG_MIRROR_HASH:=ff5e563935919d2e40c1e7254ef3bc06f7ecc5e69f8ddd12903e8f5de942d630
|
|
||||||
+PKG_SOURCE_DATE:=2021-07-15
|
|
||||||
+PKG_SOURCE_VERSION:=bbebea7d6dc64313132226adc3f7369d36e9359d
|
|
||||||
+PKG_MIRROR_HASH:=17cd74e72c1f6c8742b698bf6772afacc6fba71b233af8c4d59530600cf44d5b
|
|
||||||
|
|
||||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
|
||||||
+PKG_USE_NINJA:=0
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += \
|
|
||||||
diff --git a/package/kernel/mt76/patches/001-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/package/kernel/mt76/patches/001-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..66075f2771
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/kernel/mt76/patches/001-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
|
|
||||||
@@ -0,0 +1,206 @@
|
|
||||||
+From 83216e3988cd196183542937c9bd58b279f946af Mon Sep 17 00:00:00 2001
|
|
||||||
+From: Michael Walle <michael@walle.cc>
|
|
||||||
+Date: Mon, 12 Apr 2021 19:47:17 +0200
|
|
||||||
+Subject: of: net: pass the dst buffer to of_get_mac_address()
|
|
||||||
+
|
|
||||||
+of_get_mac_address() returns a "const void*" pointer to a MAC address.
|
|
||||||
+Lately, support to fetch the MAC address by an NVMEM provider was added.
|
|
||||||
+But this will only work with platform devices. It will not work with
|
|
||||||
+PCI devices (e.g. of an integrated root complex) and esp. not with DSA
|
|
||||||
+ports.
|
|
||||||
+
|
|
||||||
+There is an of_* variant of the nvmem binding which works without
|
|
||||||
+devices. The returned data of a nvmem_cell_read() has to be freed after
|
|
||||||
+use. On the other hand the return of_get_mac_address() points to some
|
|
||||||
+static data without a lifetime. The trick for now, was to allocate a
|
|
||||||
+device resource managed buffer which is then returned. This will only
|
|
||||||
+work if we have an actual device.
|
|
||||||
+
|
|
||||||
+Change it, so that the caller of of_get_mac_address() has to supply a
|
|
||||||
+buffer where the MAC address is written to. Unfortunately, this will
|
|
||||||
+touch all drivers which use the of_get_mac_address().
|
|
||||||
+
|
|
||||||
+Usually the code looks like:
|
|
||||||
+
|
|
||||||
+ const char *addr;
|
|
||||||
+ addr = of_get_mac_address(np);
|
|
||||||
+ if (!IS_ERR(addr))
|
|
||||||
+ ether_addr_copy(ndev->dev_addr, addr);
|
|
||||||
+
|
|
||||||
+This can then be simply rewritten as:
|
|
||||||
+
|
|
||||||
+ of_get_mac_address(np, ndev->dev_addr);
|
|
||||||
+
|
|
||||||
+Sometimes is_valid_ether_addr() is used to test the MAC address.
|
|
||||||
+of_get_mac_address() already makes sure, it just returns a valid MAC
|
|
||||||
+address. Thus we can just test its return code. But we have to be
|
|
||||||
+careful if there are still other sources for the MAC address before the
|
|
||||||
+of_get_mac_address(). In this case we have to keep the
|
|
||||||
+is_valid_ether_addr() call.
|
|
||||||
+
|
|
||||||
+The following coccinelle patch was used to convert common cases to the
|
|
||||||
+new style. Afterwards, I've manually gone over the drivers and fixed the
|
|
||||||
+return code variable: either used a new one or if one was already
|
|
||||||
+available use that. Mansour Moufid, thanks for that coccinelle patch!
|
|
||||||
+
|
|
||||||
+<spml>
|
|
||||||
+@a@
|
|
||||||
+identifier x;
|
|
||||||
+expression y, z;
|
|
||||||
+@@
|
|
||||||
+- x = of_get_mac_address(y);
|
|
||||||
++ x = of_get_mac_address(y, z);
|
|
||||||
+ <...
|
|
||||||
+- ether_addr_copy(z, x);
|
|
||||||
+ ...>
|
|
||||||
+
|
|
||||||
+@@
|
|
||||||
+identifier a.x;
|
|
||||||
+@@
|
|
||||||
+- if (<+... x ...+>) {}
|
|
||||||
+
|
|
||||||
+@@
|
|
||||||
+identifier a.x;
|
|
||||||
+@@
|
|
||||||
+ if (<+... x ...+>) {
|
|
||||||
+ ...
|
|
||||||
+ }
|
|
||||||
+- else {}
|
|
||||||
+
|
|
||||||
+@@
|
|
||||||
+identifier a.x;
|
|
||||||
+expression e;
|
|
||||||
+@@
|
|
||||||
+- if (<+... x ...+>@e)
|
|
||||||
+- {}
|
|
||||||
+- else
|
|
||||||
++ if (!(e))
|
|
||||||
+ {...}
|
|
||||||
+
|
|
||||||
+@@
|
|
||||||
+expression x, y, z;
|
|
||||||
+@@
|
|
||||||
+- x = of_get_mac_address(y, z);
|
|
||||||
++ of_get_mac_address(y, z);
|
|
||||||
+ ... when != x
|
|
||||||
+</spml>
|
|
||||||
+
|
|
||||||
+All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
|
|
||||||
+compile-time tested.
|
|
||||||
+
|
|
||||||
+Suggested-by: Andrew Lunn <andrew@lunn.ch>
|
|
||||||
+Signed-off-by: Michael Walle <michael@walle.cc>
|
|
||||||
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
|
||||||
+Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
+---
|
|
||||||
+ arch/arm/mach-mvebu/kirkwood.c | 3 +-
|
|
||||||
+ arch/powerpc/sysdev/tsi108_dev.c | 5 +-
|
|
||||||
+ drivers/net/ethernet/aeroflex/greth.c | 6 +--
|
|
||||||
+ drivers/net/ethernet/allwinner/sun4i-emac.c | 10 ++--
|
|
||||||
+ drivers/net/ethernet/altera/altera_tse_main.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/arc/emac_main.c | 8 +--
|
|
||||||
+ drivers/net/ethernet/atheros/ag71xx.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/broadcom/bcm4908_enet.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/broadcom/bcmsysport.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 10 ++--
|
|
||||||
+ drivers/net/ethernet/broadcom/bgmac-platform.c | 11 ++--
|
|
||||||
+ drivers/net/ethernet/cadence/macb_main.c | 11 ++--
|
|
||||||
+ drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 8 +--
|
|
||||||
+ drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 5 +-
|
|
||||||
+ drivers/net/ethernet/davicom/dm9000.c | 10 ++--
|
|
||||||
+ drivers/net/ethernet/ethoc.c | 6 +--
|
|
||||||
+ drivers/net/ethernet/ezchip/nps_enet.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/freescale/fec_main.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/freescale/fec_mpc52xx.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/freescale/fman/mac.c | 9 ++--
|
|
||||||
+ .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 5 +-
|
|
||||||
+ drivers/net/ethernet/freescale/gianfar.c | 8 +--
|
|
||||||
+ drivers/net/ethernet/freescale/ucc_geth.c | 5 +-
|
|
||||||
+ drivers/net/ethernet/hisilicon/hisi_femac.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/lantiq_xrx200.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/marvell/mv643xx_eth.c | 5 +-
|
|
||||||
+ drivers/net/ethernet/marvell/mvneta.c | 6 +--
|
|
||||||
+ .../net/ethernet/marvell/prestera/prestera_main.c | 11 ++--
|
|
||||||
+ drivers/net/ethernet/marvell/pxa168_eth.c | 9 +---
|
|
||||||
+ drivers/net/ethernet/marvell/sky2.c | 8 ++-
|
|
||||||
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 ++--
|
|
||||||
+ drivers/net/ethernet/micrel/ks8851_common.c | 7 ++-
|
|
||||||
+ drivers/net/ethernet/microchip/lan743x_main.c | 5 +-
|
|
||||||
+ drivers/net/ethernet/nxp/lpc_eth.c | 4 +-
|
|
||||||
+ drivers/net/ethernet/qualcomm/qca_spi.c | 10 ++--
|
|
||||||
+ drivers/net/ethernet/qualcomm/qca_uart.c | 9 +---
|
|
||||||
+ drivers/net/ethernet/renesas/ravb_main.c | 12 +++--
|
|
||||||
+ drivers/net/ethernet/renesas/sh_eth.c | 5 +-
|
|
||||||
+ .../net/ethernet/samsung/sxgbe/sxgbe_platform.c | 13 ++---
|
|
||||||
+ drivers/net/ethernet/socionext/sni_ave.c | 10 ++--
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-anarion.c | 2 +-
|
|
||||||
+ .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-generic.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c | 2 +-
|
|
||||||
+ .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/dwmac-visconti.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +-
|
|
||||||
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 14 ++---
|
|
||||||
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.h | 2 +-
|
|
||||||
+ drivers/net/ethernet/ti/am65-cpsw-nuss.c | 19 ++++---
|
|
||||||
+ drivers/net/ethernet/ti/cpsw.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/ti/cpsw_new.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/ti/davinci_emac.c | 8 +--
|
|
||||||
+ drivers/net/ethernet/ti/netcp_core.c | 7 +--
|
|
||||||
+ drivers/net/ethernet/wiznet/w5100-spi.c | 8 ++-
|
|
||||||
+ drivers/net/ethernet/wiznet/w5100.c | 2 +-
|
|
||||||
+ drivers/net/ethernet/xilinx/ll_temac_main.c | 8 +--
|
|
||||||
+ drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 15 +++---
|
|
||||||
+ drivers/net/ethernet/xilinx/xilinx_emaclite.c | 8 +--
|
|
||||||
+ drivers/net/wireless/ath/ath9k/init.c | 5 +-
|
|
||||||
+ drivers/net/wireless/mediatek/mt76/eeprom.c | 9 +---
|
|
||||||
+ drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 6 +--
|
|
||||||
+ drivers/of/of_net.c | 60 ++++++++++------------
|
|
||||||
+ drivers/staging/octeon/ethernet.c | 10 ++--
|
|
||||||
+ drivers/staging/wfx/main.c | 7 ++-
|
|
||||||
+ include/linux/of_net.h | 6 +--
|
|
||||||
+ include/net/dsa.h | 2 +-
|
|
||||||
+ net/dsa/dsa2.c | 2 +-
|
|
||||||
+ net/dsa/slave.c | 2 +-
|
|
||||||
+ net/ethernet/eth.c | 11 ++--
|
|
||||||
+ 85 files changed, 218 insertions(+), 364 deletions(-)
|
|
||||||
+
|
|
||||||
+diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
|
|
||||||
+index 665b54c5c8ae5..6d895738222ad 100644
|
|
||||||
+--- a/eeprom.c
|
|
||||||
++++ b/eeprom.c
|
|
||||||
+@@ -91,15 +91,9 @@ void
|
|
||||||
+ {
|
|
||||||
+ struct mt76_dev *dev = phy->dev;
|
|
||||||
+
|
|
||||||
+-#ifdef CONFIG_OF
|
|
||||||
+ struct device_node *np = dev->dev->of_node;
|
|
||||||
+- const u8 *mac = NULL;
|
|
||||||
+
|
|
||||||
+- if (np)
|
|
||||||
+- mac = of_get_mac_address(np);
|
|
||||||
+- if (!IS_ERR_OR_NULL(mac))
|
|
||||||
+- ether_addr_copy(phy->macaddr, mac);
|
|
||||||
+-#endif
|
|
||||||
++ of_get_mac_address(np, phy->macaddr);
|
|
||||||
+
|
|
||||||
+ if (!is_valid_ether_addr(phy->macaddr)) {
|
|
||||||
+ eth_random_addr(phy->macaddr);
|
|
||||||
+--
|
|
||||||
+cgit 1.2.3-1.el7
|
|
||||||
+
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
From 4b2e6bb352b400e244646a7bc59bc5ca3ca6f5df Mon Sep 17 00:00:00 2001
|
|
||||||
From: Roman Yeryomin <roman@advem.lv>
|
|
||||||
Date: Fri, 3 Sep 2021 17:31:11 +0300
|
|
||||||
Subject: [PATCH 32/32] iproute2: m_xt.so depends on dynsyms.list
|
|
||||||
|
|
||||||
When doing parallel build on a fast machine with bottleneck in i/o,
|
|
||||||
m_xt.so may start linking faster than dynsyms.list gets populated,
|
|
||||||
resulting in error:
|
|
||||||
|
|
||||||
ld:dynsyms.list:0: syntax error in dynamic list
|
|
||||||
|
|
||||||
Fix this by adding dynsyms.list as make dependency to m_xt.so
|
|
||||||
Described also here:
|
|
||||||
https://bugs.openwrt.org/index.php?do=details&task_id=3353
|
|
||||||
|
|
||||||
Change from v1:
|
|
||||||
- add dynsysms.list dependancy only when shared libs are enabled
|
|
||||||
|
|
||||||
Signed-off-by: Roman Yeryomin <roman@advem.lv>
|
|
||||||
Fixes: FS#3353
|
|
||||||
---
|
|
||||||
.../utils/iproute2/patches/175-reduce-dynamic-syms.patch | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch
|
|
||||||
index da961a183b..c3892e5a0e 100644
|
|
||||||
--- a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch
|
|
||||||
+++ b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch
|
|
||||||
@@ -26,13 +26,14 @@
|
|
||||||
|
|
||||||
q_atm.so: q_atm.c
|
|
||||||
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
|
|
||||||
-@@ -205,4 +206,15 @@ static-syms.h: $(wildcard *.c)
|
|
||||||
+@@ -205,4 +206,16 @@ static-syms.h: $(wildcard *.c)
|
|
||||||
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
|
|
||||||
done > $@
|
|
||||||
|
|
||||||
+else
|
|
||||||
+
|
|
||||||
+tc: dynsyms.list
|
|
||||||
++m_xt.so: dynsyms.list
|
|
||||||
+dynsyms.list: $(wildcard *.c)
|
|
||||||
+ files="$(filter-out $(patsubst %.so,%.c,$(TCSO)), $^)" ; \
|
|
||||||
+ echo "{" > $@ ; \
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
From d4e24006e05474b6dbe582f7c56a505cc0c45e81 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Mon, 1 Nov 2021 11:59:41 +0100
|
|
||||||
Subject: [PATCH] ubus: update to the latest version
|
|
||||||
|
|
||||||
b743a331421d ubusd: log ACL init errors
|
|
||||||
2099bb3ad997 libubus: use list_empty/list_first_entry in ubus_process_pending_msg
|
|
||||||
ef038488edc3 libubus: process pending messages in data handler if stack depth is 0
|
|
||||||
a72457b61df0 libubus: increase stack depth for processing obj msgs
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
package/system/ubus/Makefile | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
|
|
||||||
index 8a3fd1de7b..d5f86b6850 100644
|
|
||||||
--- a/package/system/ubus/Makefile
|
|
||||||
+++ b/package/system/ubus/Makefile
|
|
||||||
@@ -5,9 +5,9 @@ PKG_RELEASE:=2
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
|
|
||||||
-PKG_SOURCE_DATE:=2021-06-30
|
|
||||||
-PKG_SOURCE_VERSION:=4fc532c8a55ba8217ad67d7fd47c5eb9a8aba044
|
|
||||||
-PKG_MIRROR_HASH:=a5c8205f2e2b2f1f9ad687592e66a6e2bf8900dc54cfe3ceefe6c297d18971a8
|
|
||||||
+PKG_SOURCE_DATE:=2021-08-09
|
|
||||||
+PKG_SOURCE_VERSION:=a72457b61df045d3c499a6211362b751710590d7
|
|
||||||
+PKG_MIRROR_HASH:=ac617577bcb2ff3dbc3039ad67200afcce910840223a2de15977d3224e6557fd
|
|
||||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
|
||||||
CMAKE_INSTALL:=1
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
From 49ceb8a8d7009e5c81599c68b8aacc16d17d2e62 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stijn Tintel <stijn@linux-ipv6.be>
|
|
||||||
Date: Tue, 9 Nov 2021 17:20:41 +0100
|
|
||||||
Subject: [PATCH] rpcd: bump to git HEAD
|
|
||||||
|
|
||||||
20bf958 session: use uloop_timeout_remaining64
|
|
||||||
d11ffe9 session: use blobmsg_get_u64 for RPC_DUMP_EXPIRES
|
|
||||||
|
|
||||||
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
|
||||||
---
|
|
||||||
package/system/rpcd/Makefile | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
|
|
||||||
index 0896a7dada..af788dcfaa 100644
|
|
||||||
--- a/package/system/rpcd/Makefile
|
|
||||||
+++ b/package/system/rpcd/Makefile
|
|
||||||
@@ -12,10 +12,10 @@ PKG_RELEASE:=1
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
|
|
||||||
-PKG_SOURCE_DATE:=2021-03-11
|
|
||||||
-PKG_SOURCE_VERSION:=ccb75178cf6a726896729c6904bd623636aa0b29
|
|
||||||
+PKG_MIRROR_HASH:=98071b4a1ce983a0e738d7e4a2f6e52b7f6db19f99510ddef430093314134ca4
|
|
||||||
+PKG_SOURCE_DATE:=2021-11-04
|
|
||||||
+PKG_SOURCE_VERSION:=d11ffe9383ae0ec34836421926364b24c1d891ca
|
|
||||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
|
||||||
-PKG_MIRROR_HASH:=87b1839275c209f9767057d6da5272cae973a064767fa28f380a37fb65e2e643
|
|
||||||
|
|
||||||
PKG_LICENSE:=ISC
|
|
||||||
PKG_LICENSE_FILES:=
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
From 3937223beab0c3e4284fd916c0c3b6548c287e03 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Tue, 26 Oct 2021 20:41:22 +0200
|
|
||||||
Subject: [PATCH 050/102] bpf-headers: add a package with kernel headers for
|
|
||||||
ebpf
|
|
||||||
|
|
||||||
In order to genererate suitable kernel headers, a 5.10 kernel tree is
|
|
||||||
prepared with a default config for mips. The arch is forced to mips in
|
|
||||||
order to avoid issues with inline asm on various architectures in a way
|
|
||||||
that doesn't involve relying on the host toolchain/headers.
|
|
||||||
It also has the advantage of supporting both endian types
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
include/bpf.mk | 65 ++++++++++++
|
|
||||||
package/kernel/bpf-headers/Makefile | 99 +++++++++++++++++++
|
|
||||||
.../src/include/generated/bounds.h | 14 +++
|
|
||||||
3 files changed, 178 insertions(+)
|
|
||||||
create mode 100644 include/bpf.mk
|
|
||||||
create mode 100644 package/kernel/bpf-headers/Makefile
|
|
||||||
create mode 100644 package/kernel/bpf-headers/src/include/generated/bounds.h
|
|
||||||
|
|
||||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..3dc65c7685
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/include/bpf.mk
|
|
||||||
@@ -0,0 +1,65 @@
|
|
||||||
+ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
|
|
||||||
+ BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
|
|
||||||
+ ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
|
||||||
+ BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
|
|
||||||
+ else
|
|
||||||
+ BPF_PATH:=$(BPF_PATH)
|
|
||||||
+ endif
|
|
||||||
+ CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' which clang clang-13 clang-12 clang-11))
|
|
||||||
+ LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
|
||||||
+else
|
|
||||||
+ CLANG:=$(STAGING_DIR_HOST)/bin/clang
|
|
||||||
+ LLVM_VER:=
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
+LLVM_PATH:=$(dir $(CLANG))
|
|
||||||
+LLVM_LLC:=$(LLVM_PATH)/llc$(LLVM_VER)
|
|
||||||
+LLVM_DIS:=$(LLVM_PATH)/llvm-dis$(LLVM_VER)
|
|
||||||
+LLVM_OPT:=$(LLVM_PATH)/opt$(LLVM_VER)
|
|
||||||
+LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
|
||||||
+
|
|
||||||
+BPF_KARCH:=mips
|
|
||||||
+BPF_ARCH:=mips$(if $(CONFIG_BIG_ENDIAN),,el)
|
|
||||||
+
|
|
||||||
+BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
|
||||||
+
|
|
||||||
+BPF_KERNEL_INCLUDE := \
|
|
||||||
+ -nostdinc -isystem $(TOOLCHAIN_DIR)/include \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/include \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/uapi \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated/uapi \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/include/uapi \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/include/generated/uapi \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/tools/lib \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/tools/testing/selftests \
|
|
||||||
+ -I$(BPF_HEADERS_DIR)/samples/bpf \
|
|
||||||
+ -include linux/kconfig.h -include asm_goto_workaround.h
|
|
||||||
+
|
|
||||||
+BPF_CFLAGS := \
|
|
||||||
+ $(BPF_KERNEL_INCLUDE) -I$(PKG_BUILD_DIR) \
|
|
||||||
+ -D__KERNEL__ -D__BPF_TRACING__ \
|
|
||||||
+ -D__TARGET_ARCH_${BPF_KARCH} \
|
|
||||||
+ -m$(if $(CONFIG_BIG_ENDIAN),big,little)-endian \
|
|
||||||
+ -fno-stack-protector -Wall \
|
|
||||||
+ -Wno-unused-value -Wno-pointer-sign \
|
|
||||||
+ -Wno-compare-distinct-pointer-types \
|
|
||||||
+ -Wno-gnu-variable-sized-type-not-at-end \
|
|
||||||
+ -Wno-address-of-packed-member -Wno-tautological-compare \
|
|
||||||
+ -Wno-unknown-warning-option \
|
|
||||||
+ -fno-asynchronous-unwind-tables \
|
|
||||||
+ -Wno-uninitialized -Wno-unused-variable \
|
|
||||||
+ -Wno-unused-label \
|
|
||||||
+ -O2 -emit-llvm -Xclang -disable-llvm-passes
|
|
||||||
+
|
|
||||||
+define CompileBPF
|
|
||||||
+ $(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
|
||||||
+ -c $(1) -o $(patsubst %.c,%.bc,$(1))
|
|
||||||
+ $(LLVM_OPT) -O2 -mtriple=bpf-pc-linux < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
|
||||||
+ $(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
|
|
||||||
+ $(LLVM_LLC) -march=bpf -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
|
||||||
+ $(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
diff --git a/package/kernel/bpf-headers/Makefile b/package/kernel/bpf-headers/Makefile
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..5f5b89370d
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/kernel/bpf-headers/Makefile
|
|
||||||
@@ -0,0 +1,99 @@
|
|
||||||
+#
|
|
||||||
+# Copyright (C) 2006-2009 OpenWrt.org
|
|
||||||
+#
|
|
||||||
+# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
+# See /LICENSE for more information.
|
|
||||||
+#
|
|
||||||
+include $(TOPDIR)/rules.mk
|
|
||||||
+
|
|
||||||
+override QUILT:=
|
|
||||||
+override HOST_QUILT:=
|
|
||||||
+
|
|
||||||
+include $(INCLUDE_DIR)/kernel.mk
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+PKG_NAME:=linux
|
|
||||||
+PKG_PATCHVER:=5.10
|
|
||||||
+PKG_VERSION:=$(PKG_PATCHVER)$(strip $(LINUX_VERSION-$(PKG_PATCHVER)))
|
|
||||||
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
|
||||||
+PKG_SOURCE_URL:=$(LINUX_SITE)
|
|
||||||
+PKG_HASH:=$(LINUX_KERNEL_HASH-$(strip $(PKG_VERSION)))
|
|
||||||
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/bpf-headers/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
+
|
|
||||||
+GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
|
||||||
+GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
|
||||||
+GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
|
||||||
+GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(PKG_PATCHVER)),"$(dir)")
|
|
||||||
+PATCH_DIR := $(CURDIR)/patches
|
|
||||||
+FILES_DIR :=
|
|
||||||
+
|
|
||||||
+REAL_LINUX_DIR := $(LINUX_DIR)
|
|
||||||
+LINUX_DIR := $(PKG_BUILD_DIR)
|
|
||||||
+
|
|
||||||
+include $(INCLUDE_DIR)/bpf.mk
|
|
||||||
+include $(INCLUDE_DIR)/package.mk
|
|
||||||
+
|
|
||||||
+define Package/bpf-headers
|
|
||||||
+ SECTION:=kernel
|
|
||||||
+ CATEGORY:=Kernel
|
|
||||||
+ TITLE:=eBPF kernel headers
|
|
||||||
+ BUILDONLY:=1
|
|
||||||
+ HIDDEN:=1
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
|
||||||
+
|
|
||||||
+KERNEL_MAKE := \
|
|
||||||
+ $(MAKE) -C $(PKG_BUILD_DIR) \
|
|
||||||
+ ARCH=$(BPF_KARCH) \
|
|
||||||
+ CROSS_COMPILE=$(BPF_ARCH)-linux- \
|
|
||||||
+ LLVM=1 CC="$(CLANG)" LD="$(TARGET_CROSS)ld" \
|
|
||||||
+ HOSTCC="$(HOSTCC)" \
|
|
||||||
+ HOSTCXX="$(HOSTCXX)" \
|
|
||||||
+ HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \
|
|
||||||
+ KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \
|
|
||||||
+ CONFIG_SHELL="$(BASH)" \
|
|
||||||
+ INSTALL_HDR_PATH="$(PKG_BUILD_DIR)/user_headers"
|
|
||||||
+
|
|
||||||
+define Build/Patch
|
|
||||||
+ $(Kernel/Patch/Default)
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+BPF_DOC = $(PKG_BUILD_DIR)/scripts/bpf_helpers_doc.py
|
|
||||||
+
|
|
||||||
+define Build/Configure
|
|
||||||
+ grep -vE 'CONFIG_(CPU_.*ENDIAN|HZ)' $(PKG_BUILD_DIR)/arch/mips/configs/generic_defconfig > $(PKG_BUILD_DIR)/.config
|
|
||||||
+ echo 'CONFIG_CPU_$(if $(CONFIG_BIG_ENDIAN),BIG,LITTLE)_ENDIAN=y' >> $(PKG_BUILD_DIR)/.config
|
|
||||||
+ grep CONFIG_HZ $(REAL_LINUX_DIR)/.config >> $(PKG_BUILD_DIR)/.config
|
|
||||||
+ yes '' | $(KERNEL_MAKE) oldconfig
|
|
||||||
+ grep 'CONFIG_HZ=' $(REAL_LINUX_DIR)/.config | \
|
|
||||||
+ cut -d= -f2 | \
|
|
||||||
+ bc -q $(LINUX_DIR)/kernel/time/timeconst.bc \
|
|
||||||
+ > $(LINUX_DIR)/include/generated/timeconst.h
|
|
||||||
+ $(BPF_DOC) --header \
|
|
||||||
+ --file $(LINUX_DIR)/tools/include/uapi/linux/bpf.h \
|
|
||||||
+ > $(PKG_BUILD_DIR)/tools/lib/bpf/bpf_helper_defs.h
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Build/Compile
|
|
||||||
+ $(KERNEL_MAKE) archprepare headers_install
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+define Build/InstallDev
|
|
||||||
+ mkdir -p $(1)/bpf-headers/arch $(1)/bpf-headers/tools
|
|
||||||
+ $(CP) \
|
|
||||||
+ $(PKG_BUILD_DIR)/arch/$(BPF_KARCH) \
|
|
||||||
+ $(1)/bpf-headers/arch/
|
|
||||||
+ $(CP) \
|
|
||||||
+ $(PKG_BUILD_DIR)/tools/lib \
|
|
||||||
+ $(PKG_BUILD_DIR)/tools/testing \
|
|
||||||
+ $(1)/bpf-headers/tools/
|
|
||||||
+ $(CP) \
|
|
||||||
+ $(PKG_BUILD_DIR)/include \
|
|
||||||
+ $(PKG_BUILD_DIR)/samples \
|
|
||||||
+ $(PKG_BUILD_DIR)/scripts \
|
|
||||||
+ $(PKG_BUILD_DIR)/user_headers \
|
|
||||||
+ $(1)/bpf-headers
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
+$(eval $(call BuildPackage,bpf-headers))
|
|
||||||
diff --git a/package/kernel/bpf-headers/src/include/generated/bounds.h b/package/kernel/bpf-headers/src/include/generated/bounds.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..82ff01043c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/package/kernel/bpf-headers/src/include/generated/bounds.h
|
|
||||||
@@ -0,0 +1,14 @@
|
|
||||||
+#ifndef __LINUX_BOUNDS_H__
|
|
||||||
+#define __LINUX_BOUNDS_H__
|
|
||||||
+/*
|
|
||||||
+ * DO NOT MODIFY.
|
|
||||||
+ *
|
|
||||||
+ * This file was generated by Kbuild
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#define NR_PAGEFLAGS 23 /* __NR_PAGEFLAGS */
|
|
||||||
+#define MAX_NR_ZONES 4 /* __MAX_NR_ZONES */
|
|
||||||
+#define NR_CPUS_BITS 1 /* ilog2(CONFIG_NR_CPUS) */
|
|
||||||
+#define SPINLOCK_SIZE 64 /* sizeof(spinlock_t) */
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
From 32243b2148fd0dacd0630affaea59345c64df79a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Tue, 2 Nov 2021 10:36:14 +0100
|
|
||||||
Subject: [PATCH 051/102] bpf-headers: unset PKG_CONFIG_PATH
|
|
||||||
|
|
||||||
This fixes an issue where the kernel would pick up an incompatible target
|
|
||||||
libyaml for building host tools
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
package/kernel/bpf-headers/Makefile | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/package/kernel/bpf-headers/Makefile b/package/kernel/bpf-headers/Makefile
|
|
||||||
index 5f5b89370d..df24bfa13f 100644
|
|
||||||
--- a/package/kernel/bpf-headers/Makefile
|
|
||||||
+++ b/package/kernel/bpf-headers/Makefile
|
|
||||||
@@ -41,6 +41,8 @@ define Package/bpf-headers
|
|
||||||
HIDDEN:=1
|
|
||||||
endef
|
|
||||||
|
|
||||||
+PKG_CONFIG_PATH:=
|
|
||||||
+
|
|
||||||
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
|
||||||
|
|
||||||
KERNEL_MAKE := \
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
From 1eb36bc2be4b54e4e4e4ceffc01be78d996205f0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Sun, 17 Oct 2021 17:50:53 +0200
|
|
||||||
Subject: [PATCH 052/102] tools/llvm-bpf: add llvm+clang build suitable for
|
|
||||||
compiling code to eBPF
|
|
||||||
|
|
||||||
Preparation for building packages that ship eBPF code
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
toolchain/Config.in | 7 +++++++
|
|
||||||
tools/Makefile | 2 ++
|
|
||||||
tools/llvm-bpf/Makefile | 36 ++++++++++++++++++++++++++++++++++++
|
|
||||||
3 files changed, 45 insertions(+)
|
|
||||||
create mode 100644 tools/llvm-bpf/Makefile
|
|
||||||
|
|
||||||
diff --git a/toolchain/Config.in b/toolchain/Config.in
|
|
||||||
index 6dda9af92d..9062d6f65e 100644
|
|
||||||
--- a/toolchain/Config.in
|
|
||||||
+++ b/toolchain/Config.in
|
|
||||||
@@ -37,6 +37,13 @@ menuconfig TARGET_OPTIONS
|
|
||||||
|
|
||||||
Most people will answer N.
|
|
||||||
|
|
||||||
+config BUILD_LLVM_BPF
|
|
||||||
+ bool "Build LLVM toolchain for eBPF" if DEVEL
|
|
||||||
+ help
|
|
||||||
+ If enabled, a LLVM toolchain for building eBPF binaries will be built.
|
|
||||||
+ If this is not enabled, eBPF packages can only be built if the host
|
|
||||||
+ has a suitable toolchain
|
|
||||||
+
|
|
||||||
|
|
||||||
menuconfig EXTERNAL_TOOLCHAIN
|
|
||||||
bool
|
|
||||||
diff --git a/tools/Makefile b/tools/Makefile
|
|
||||||
index a2665dbc9a..83147014c6 100644
|
|
||||||
--- a/tools/Makefile
|
|
||||||
+++ b/tools/Makefile
|
|
||||||
@@ -35,6 +35,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
|
|
||||||
tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
|
|
||||||
tools-$(CONFIG_USES_MINOR) += kernel2minor
|
|
||||||
tools-$(CONFIG_USE_SPARSE) += sparse
|
|
||||||
+tools-$(CONFIG_BUILD_LLVM_BPF) += llvm-bpf
|
|
||||||
|
|
||||||
# builddir dependencies
|
|
||||||
$(curdir)/autoconf/compile := $(curdir)/m4/compile
|
|
||||||
@@ -57,6 +58,7 @@ $(curdir)/libelf/compile := $(curdir)/libtool/compile
|
|
||||||
$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
|
|
||||||
$(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile
|
|
||||||
$(curdir)/lzma-old/compile := $(curdir)/zlib/compile
|
|
||||||
+$(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile
|
|
||||||
$(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
|
|
||||||
$(curdir)/missing-macros/compile := $(curdir)/autoconf/compile
|
|
||||||
$(curdir)/mkimage/compile += $(curdir)/libressl/compile
|
|
||||||
diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..a5ba2a4cb7
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tools/llvm-bpf/Makefile
|
|
||||||
@@ -0,0 +1,36 @@
|
|
||||||
+#
|
|
||||||
+# Copyright (C) 2006-2016 OpenWrt.org
|
|
||||||
+#
|
|
||||||
+# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
+# See /LICENSE for more information.
|
|
||||||
+#
|
|
||||||
+include $(TOPDIR)/rules.mk
|
|
||||||
+
|
|
||||||
+PKG_NAME:=llvm-project
|
|
||||||
+PKG_VERSION:=13.0.0
|
|
||||||
+PKG_RELEASE:=1
|
|
||||||
+
|
|
||||||
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz
|
|
||||||
+PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION)
|
|
||||||
+PKG_HASH:=6075ad30f1ac0e15f07c1bf062c1e1268c241d674f11bd32cdf0e040c71f2bf3
|
|
||||||
+
|
|
||||||
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION).src
|
|
||||||
+
|
|
||||||
+HOST_BUILD_PARALLEL:=1
|
|
||||||
+
|
|
||||||
+CMAKE_BINARY_SUBDIR := build
|
|
||||||
+CMAKE_SOURCE_SUBDIR := llvm
|
|
||||||
+
|
|
||||||
+include $(INCLUDE_DIR)/host-build.mk
|
|
||||||
+include $(INCLUDE_DIR)/cmake.mk
|
|
||||||
+
|
|
||||||
+CMAKE_HOST_OPTIONS += \
|
|
||||||
+ -DLLVM_ENABLE_BINDINGS=OFF \
|
|
||||||
+ -DLLVM_INCLUDE_DOCS=OFF \
|
|
||||||
+ -DLLVM_INCLUDE_EXAMPLES=OFF \
|
|
||||||
+ -DLLVM_INCLUDE_TESTS=OFF \
|
|
||||||
+ -DLLVM_ENABLE_PROJECTS="clang;lld" \
|
|
||||||
+ -DLLVM_TARGETS_TO_BUILD=BPF \
|
|
||||||
+ -DCLANG_BUILD_EXAMPLES=OFF
|
|
||||||
+
|
|
||||||
+$(eval $(call HostBuild))
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
From 103a743e7ca4a2e98969d0f60d8aeb6cc7641f67 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Tue, 2 Nov 2021 19:38:12 +0100
|
|
||||||
Subject: [PATCH 053/102] llvm-bpf: move to staging_dir/host/llvm-bpf
|
|
||||||
|
|
||||||
This makes it easier to package it up for the download server
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
tools/llvm-bpf/Makefile | 8 +++++++-
|
|
||||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile
|
|
||||||
index a5ba2a4cb7..ae279d26d2 100644
|
|
||||||
--- a/tools/llvm-bpf/Makefile
|
|
||||||
+++ b/tools/llvm-bpf/Makefile
|
|
||||||
@@ -24,6 +24,8 @@ CMAKE_SOURCE_SUBDIR := llvm
|
|
||||||
include $(INCLUDE_DIR)/host-build.mk
|
|
||||||
include $(INCLUDE_DIR)/cmake.mk
|
|
||||||
|
|
||||||
+CMAKE_HOST_INSTALL_PREFIX = $(STAGING_DIR_HOST)/llvm-bpf
|
|
||||||
+
|
|
||||||
CMAKE_HOST_OPTIONS += \
|
|
||||||
-DLLVM_ENABLE_BINDINGS=OFF \
|
|
||||||
-DLLVM_INCLUDE_DOCS=OFF \
|
|
||||||
@@ -31,6 +33,10 @@ CMAKE_HOST_OPTIONS += \
|
|
||||||
-DLLVM_INCLUDE_TESTS=OFF \
|
|
||||||
-DLLVM_ENABLE_PROJECTS="clang;lld" \
|
|
||||||
-DLLVM_TARGETS_TO_BUILD=BPF \
|
|
||||||
- -DCLANG_BUILD_EXAMPLES=OFF
|
|
||||||
+ -DCLANG_BUILD_EXAMPLES=OFF \
|
|
||||||
+ -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
|
|
||||||
+ -DLLVM_LINK_LLVM_DYLIB=ON \
|
|
||||||
+ -DLLVM_TOOLCHAIN_TOOLS="llvm-objcopy;llvm-objdump;llvm-readelf;llvm-strip;llvm-ar;llvm-as;llvm-dis;llvm-link;llvm-nm;llvm-ranlib;llc;opt" \
|
|
||||||
+ -DCMAKE_SKIP_RPATH=OFF
|
|
||||||
|
|
||||||
$(eval $(call HostBuild))
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
From a368d456ba1e9198fd8f473b7e82c0e066e4eb82 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Mon, 1 Nov 2021 18:40:03 +0100
|
|
||||||
Subject: [PATCH 054/102] build: fix bpf toolchain dependency for qosify
|
|
||||||
|
|
||||||
Add hidden symbols to fix defaults with CONFIG_DEVEL unset
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
include/bpf.mk | 2 ++
|
|
||||||
toolchain/Config.in | 45 +++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
tools/Makefile | 2 +-
|
|
||||||
3 files changed, 48 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
|
||||||
index 3dc65c7685..5211ec4434 100644
|
|
||||||
--- a/include/bpf.mk
|
|
||||||
+++ b/include/bpf.mk
|
|
||||||
@@ -1,3 +1,5 @@
|
|
||||||
+BPF_DEPENDS := @HAS_BPF_TOOLCHAIN
|
|
||||||
+
|
|
||||||
ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
|
|
||||||
BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
|
|
||||||
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
|
||||||
diff --git a/toolchain/Config.in b/toolchain/Config.in
|
|
||||||
index 9062d6f65e..997cff59e4 100644
|
|
||||||
--- a/toolchain/Config.in
|
|
||||||
+++ b/toolchain/Config.in
|
|
||||||
@@ -44,6 +44,32 @@ config BUILD_LLVM_BPF
|
|
||||||
If this is not enabled, eBPF packages can only be built if the host
|
|
||||||
has a suitable toolchain
|
|
||||||
|
|
||||||
+ choice BPF_TOOLCHAIN
|
|
||||||
+ prompt "BPF toolchain" if DEVEL
|
|
||||||
+ default BPF_TOOLCHAIN_NONE
|
|
||||||
+
|
|
||||||
+ config BPF_TOOLCHAIN_NONE
|
|
||||||
+ bool "None"
|
|
||||||
+
|
|
||||||
+ config BPF_TOOLCHAIN_HOST
|
|
||||||
+ select USE_LLVM_HOST
|
|
||||||
+ bool "Use host LLVM toolchain"
|
|
||||||
+
|
|
||||||
+ config BPF_TOOLCHAIN_BUILD_LLVM
|
|
||||||
+ select USE_LLVM_BUILD
|
|
||||||
+ bool "Build LLVM toolchain for eBPF"
|
|
||||||
+ help
|
|
||||||
+ If enabled, a LLVM toolchain for building eBPF binaries will be built.
|
|
||||||
+ If this is not enabled, eBPF packages can only be built if the host
|
|
||||||
+ has a suitable toolchain
|
|
||||||
+ endchoice
|
|
||||||
+
|
|
||||||
+ config BPF_TOOLCHAIN_HOST_PATH
|
|
||||||
+ string
|
|
||||||
+ depends on BPF_TOOLCHAIN_HOST
|
|
||||||
+ prompt "Host LLVM toolchain path (prefix)" if DEVEL
|
|
||||||
+ default "/usr/local/opt/llvm" if HOST_OS_MACOS
|
|
||||||
+ default ""
|
|
||||||
|
|
||||||
menuconfig EXTERNAL_TOOLCHAIN
|
|
||||||
bool
|
|
||||||
@@ -266,6 +292,25 @@ config GDB
|
|
||||||
help
|
|
||||||
Enable if you want to build the gdb.
|
|
||||||
|
|
||||||
+config GDB_PYTHON
|
|
||||||
+ bool
|
|
||||||
+ depends on GDB
|
|
||||||
+ prompt "Build gdb with python binding"
|
|
||||||
+
|
|
||||||
+ help
|
|
||||||
+ Enable the python bindings for GDB to allow using python in the gdb shell.
|
|
||||||
+
|
|
||||||
+config HAS_BPF_TOOLCHAIN
|
|
||||||
+ bool
|
|
||||||
+
|
|
||||||
+config USE_LLVM_HOST
|
|
||||||
+ select HAS_BPF_TOOLCHAIN
|
|
||||||
+ bool
|
|
||||||
+
|
|
||||||
+config USE_LLVM_BUILD
|
|
||||||
+ select HAS_BPF_TOOLCHAIN
|
|
||||||
+ bool
|
|
||||||
+
|
|
||||||
config USE_GLIBC
|
|
||||||
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
|
|
||||||
bool
|
|
||||||
diff --git a/tools/Makefile b/tools/Makefile
|
|
||||||
index 83147014c6..ae3cc5dfd6 100644
|
|
||||||
--- a/tools/Makefile
|
|
||||||
+++ b/tools/Makefile
|
|
||||||
@@ -35,7 +35,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
|
|
||||||
tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
|
|
||||||
tools-$(CONFIG_USES_MINOR) += kernel2minor
|
|
||||||
tools-$(CONFIG_USE_SPARSE) += sparse
|
|
||||||
-tools-$(CONFIG_BUILD_LLVM_BPF) += llvm-bpf
|
|
||||||
+tools-$(CONFIG_USE_LLVM_BUILD) += llvm-bpf
|
|
||||||
|
|
||||||
# builddir dependencies
|
|
||||||
$(curdir)/autoconf/compile := $(curdir)/m4/compile
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
From 2ae5b19a52da190ea342ec4210523407837c58ea Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Tue, 2 Nov 2021 09:56:10 +0100
|
|
||||||
Subject: [PATCH 055/102] include/bpf.mk: fix typo
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
include/bpf.mk | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
|
||||||
index 5211ec4434..6223648c5d 100644
|
|
||||||
--- a/include/bpf.mk
|
|
||||||
+++ b/include/bpf.mk
|
|
||||||
@@ -5,7 +5,7 @@ ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
|
|
||||||
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
|
||||||
BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
|
|
||||||
else
|
|
||||||
- BPF_PATH:=$(BPF_PATH)
|
|
||||||
+ BPF_PATH:=$(PATH)
|
|
||||||
endif
|
|
||||||
CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' which clang clang-13 clang-12 clang-11))
|
|
||||||
LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
From aff796bf3e60d7f09e5ca500cbf59221211dd218 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Tue, 2 Nov 2021 10:39:35 +0100
|
|
||||||
Subject: [PATCH 056/102] include/bpf.mk: fix compile for big-endian targets
|
|
||||||
|
|
||||||
llvm-opt and llc need endian flags in the target as well
|
|
||||||
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
include/bpf.mk | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
|
||||||
index 6223648c5d..9636ad5165 100644
|
|
||||||
--- a/include/bpf.mk
|
|
||||||
+++ b/include/bpf.mk
|
|
||||||
@@ -22,6 +22,7 @@ LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
|
||||||
|
|
||||||
BPF_KARCH:=mips
|
|
||||||
BPF_ARCH:=mips$(if $(CONFIG_BIG_ENDIAN),,el)
|
|
||||||
+BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
|
|
||||||
|
|
||||||
BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
|
||||||
|
|
||||||
@@ -59,9 +60,9 @@ BPF_CFLAGS := \
|
|
||||||
define CompileBPF
|
|
||||||
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
|
||||||
-c $(1) -o $(patsubst %.c,%.bc,$(1))
|
|
||||||
- $(LLVM_OPT) -O2 -mtriple=bpf-pc-linux < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
|
||||||
+ $(LLVM_OPT) -O2 -mtriple=$(BPF_TARGET) < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
|
||||||
$(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
|
|
||||||
- $(LLVM_LLC) -march=bpf -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
|
||||||
+ $(LLVM_LLC) -march=$(BPF_TARGET) -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
|
||||||
$(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
|
|
||||||
endef
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
From d05fae42794c5fe76509935b1e8f900e1d17d9f0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Fri, 5 Nov 2021 10:46:00 +0100
|
|
||||||
Subject: [PATCH] include/bpf.mk: add LD_LIBRARY_PATH
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
include/bpf.mk | 5 +++++
|
|
||||||
1 file changed, 5 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
|
||||||
index 9636ad5165..2f797625b6 100644
|
|
||||||
--- a/include/bpf.mk
|
|
||||||
+++ b/include/bpf.mk
|
|
||||||
@@ -58,11 +58,16 @@ BPF_CFLAGS := \
|
|
||||||
-O2 -emit-llvm -Xclang -disable-llvm-passes
|
|
||||||
|
|
||||||
define CompileBPF
|
|
||||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
|
||||||
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
|
||||||
-c $(1) -o $(patsubst %.c,%.bc,$(1))
|
|
||||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
|
||||||
$(LLVM_OPT) -O2 -mtriple=$(BPF_TARGET) < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
|
||||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
|
||||||
$(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
|
|
||||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
|
||||||
$(LLVM_LLC) -march=$(BPF_TARGET) -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
|
||||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
|
||||||
$(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
|
|
||||||
endef
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
repo: https://github.com/openwrt/openwrt.git
|
repo: https://github.com/openwrt/openwrt.git
|
||||||
branch: openwrt-21.02
|
branch: openwrt-23.05
|
||||||
revision: 378769b5551714ccaa821b481bfeecbf362f351e
|
revision: e92cf0c46ffe3ac7fca936c18577bfb19eb4ce9e
|
||||||
output_dir: ./output
|
output_dir: ./output
|
||||||
|
|
||||||
patch_folders:
|
patch_folders:
|
||||||
- backports/
|
- patches
|
||||||
- patches/
|
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ RUN apt-get update \
|
|||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
time git-core build-essential gcc-multilib clang \
|
time git-core build-essential gcc-multilib clang \
|
||||||
libncurses5-dev zlib1g-dev gawk flex gettext wget unzip python \
|
libncurses5-dev zlib1g-dev gawk flex gettext wget unzip python \
|
||||||
python3 python3-pip python3-yaml libssl-dev rsync llvm llvm-12 \
|
python3 python3-pip python3-yaml libssl-dev rsync \
|
||||||
clang-12 \
|
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
RUN git config --global user.email "you@example.com"
|
RUN git config --global user.email "you@example.com"
|
||||||
RUN git config --global user.name "Your Name"
|
RUN git config --global user.name "Your Name"
|
||||||
|
|||||||
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
|
||||||
|
|
||||||
|
|
||||||
37
feeds/bluetooth-cc2652/cc2652/Makefile
Executable file
37
feeds/bluetooth-cc2652/cc2652/Makefile
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=cc2652
|
||||||
|
PKG_VERSION:=1.0.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/cc2652
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=cc2652 -- TI CC26x2 firmware upgrade tool
|
||||||
|
DEPENDS:=+libstdcpp +zlib
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/cc2652/description
|
||||||
|
TI CC26x2 firmware upgrade tool
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/cc2652/install
|
||||||
|
$(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/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,cc2652))
|
||||||
|
|
||||||
@@ -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
|
||||||
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-wr.sh
Executable file
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-wr.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# com-wr.sh tty time command parser
|
||||||
|
# example com-wr.sh /dev/ttyMSM1 1 "\x01\x1D\xFC\x01\x00" | hexdump.sh --> send "\x01\x1D\xFC\x01\x00" to /dev/ttyMSM1 and then hexdump receive data until 100ms timeout
|
||||||
|
#command example "\x7E\x03\xD0\xAF und normaler Text"
|
||||||
|
tty=$1
|
||||||
|
time=$2
|
||||||
|
command=$3
|
||||||
|
parser=$4
|
||||||
|
stty -F $tty time $time
|
||||||
|
exec 99< $tty
|
||||||
|
echo -en $command > $tty
|
||||||
|
cat $tty
|
||||||
|
exec 99<&-
|
||||||
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/ble5_host_test_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/ble5_host_test_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/blinky_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/blinky_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/multi_role_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/multi_role_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_broadcaster_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_broadcaster_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_central_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_central_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_peripheral_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_peripheral_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/znp_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/znp_bd9.bin
Executable file
Binary file not shown.
28
feeds/bluetooth-cc2652/cc2652/files/ibeacon-broadcaster.sh
Executable file
28
feeds/bluetooth-cc2652/cc2652/files/ibeacon-broadcaster.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
27
feeds/bluetooth-cc2652/cc2652/src/Makefile
Executable file
27
feeds/bluetooth-cc2652/cc2652/src/Makefile
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
# Executable
|
||||||
|
EXE = tisbl
|
||||||
|
|
||||||
|
# Compiler, Linker Defines
|
||||||
|
#CC = g++
|
||||||
|
#CFLAGS = -w -O -Wno-deprecated -I. -fpermissive -std=gnu++0x
|
||||||
|
#CFLAGS = -I. -fpermissive -Wwrite-strings -lstdc++
|
||||||
|
CFLAGS = -I. -Wwrite-strings -std=gnu++0x -lstdc++ -fPIC
|
||||||
|
#CFLAGS = -I. -lstdc++ -Wwrite-strings -std=gnu++0x
|
||||||
|
#LIBS =
|
||||||
|
#LDFLAGS = $(LIBS)
|
||||||
|
|
||||||
|
# Compile and Assemble C++ Source Files into Object Files
|
||||||
|
%.o: %.cpp
|
||||||
|
$(CXX) $(CFLAGS) $(LDFLAGS) -c $< -o $@
|
||||||
|
# Source and Object files
|
||||||
|
SRC = $(wildcard *.cpp)
|
||||||
|
OBJ = $(patsubst %.cpp, %.o, $(SRC))
|
||||||
|
|
||||||
|
# Link all Object Files with external Libraries into Binaries
|
||||||
|
$(EXE): $(OBJ)
|
||||||
|
$(CC) $(CFLAGS) $(OBJ) $(LDFLAGS) -o $(EXE)
|
||||||
|
# $(CC) $(CFLAGS) $(OBJ) $(LDFLAGS) -o $(EXE) -lz
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
-rm -f $(EXE) *.o
|
||||||
13
feeds/bluetooth-cc2652/cc2652/src/debug.h
Executable file
13
feeds/bluetooth-cc2652/cc2652/src/debug.h
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef __DEBUG_H__
|
||||||
|
#define __DEBUG_H__
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#define DEBUG 0
|
||||||
|
#if defined(DEBUG) && DEBUG > 0
|
||||||
|
#define DEBUG_PRINT(fmt, args...) fprintf(stderr, "$$%d:%s:%d:%s():" fmt, \
|
||||||
|
(int)time(NULL), __FILE__, __LINE__, __func__, ##args)
|
||||||
|
#else
|
||||||
|
#define DEBUG_PRINT(fmt, args...) /* Don't do anything in release builds */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // __DEBUG_H__
|
||||||
257
feeds/bluetooth-cc2652/cc2652/src/sblAppEx.cpp
Executable file
257
feeds/bluetooth-cc2652/cc2652/src/sblAppEx.cpp
Executable file
@@ -0,0 +1,257 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Filename: sblAppEx.cpp
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader Library application example.
|
||||||
|
* This example enumerates all COM devices and lets you
|
||||||
|
* select which port to connect to. The example assumes the
|
||||||
|
* connected device is a CC2538, CC2650 or CC2652 and programs
|
||||||
|
* a blinky onto the device. After programming the blinky,
|
||||||
|
* bootloader mode may be forced by
|
||||||
|
* - holding SELECT button on 06EB (for CC2538 and CC26x0 EMKs), or
|
||||||
|
* - holding BTN-1 on the device LaunchPad (for CC26x2 LPs)
|
||||||
|
* when resetting the chip.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 - 2019 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 "serialib.h"
|
||||||
|
#include "sbllib.h"
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
//#include <time.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
// Calculate crc32 checksum the way CC2538 and CC2650 does it.
|
||||||
|
int calcCrcLikeChip(const unsigned char *pData, unsigned long ulByteCount)
|
||||||
|
{
|
||||||
|
unsigned long d, ind;
|
||||||
|
unsigned long acc = 0xFFFFFFFF;
|
||||||
|
const unsigned long ulCrcRand32Lut[] =
|
||||||
|
{
|
||||||
|
0x00000000, 0x1DB71064, 0x3B6E20C8, 0x26D930AC,
|
||||||
|
0x76DC4190, 0x6B6B51F4, 0x4DB26158, 0x5005713C,
|
||||||
|
0xEDB88320, 0xF00F9344, 0xD6D6A3E8, 0xCB61B38C,
|
||||||
|
0x9B64C2B0, 0x86D3D2D4, 0xA00AE278, 0xBDBDF21C
|
||||||
|
};
|
||||||
|
|
||||||
|
while ( ulByteCount-- )
|
||||||
|
{
|
||||||
|
d = *pData++;
|
||||||
|
ind = (acc & 0x0F) ^ (d & 0x0F);
|
||||||
|
acc = (acc >> 4) ^ ulCrcRand32Lut[ind];
|
||||||
|
ind = (acc & 0x0F) ^ (d >> 4);
|
||||||
|
acc = (acc >> 4) ^ ulCrcRand32Lut[ind];
|
||||||
|
}
|
||||||
|
|
||||||
|
return (acc ^ 0xFFFFFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Application status function (used as SBL status callback)
|
||||||
|
void appStatus(char *pcText, bool bError)
|
||||||
|
{
|
||||||
|
if(bError)
|
||||||
|
{
|
||||||
|
cerr << pcText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << pcText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Application progress function (used as SBL progress callback)
|
||||||
|
static void appProgress(uint32_t progress)
|
||||||
|
{
|
||||||
|
fprintf(stdout, "\r%d%% ", progress);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Defines
|
||||||
|
// Name Hex Dec
|
||||||
|
// ------------------------------- --------------- ---------------------------------
|
||||||
|
#define DEVICE_CC2538 0x2538 // 9528
|
||||||
|
#define DEVICE_CC26X0 0x2650 // 9808
|
||||||
|
#define DEVICE_CC2640R2 0x2640 // 9792
|
||||||
|
#define DEVICE_CC26X2 0x2652 // 9810
|
||||||
|
#define CC2538_FLASH_BASE 0x00200000
|
||||||
|
#define CC26XX_FLASH_BASE 0x00000000
|
||||||
|
|
||||||
|
// Application main function
|
||||||
|
// tisbl SerialDevNode baudRate deviceType firmware
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
// START: Program Configuration
|
||||||
|
/* UART baud rate. Default: 230400 */
|
||||||
|
uint32_t baudRate = 115200;
|
||||||
|
uint32_t deviceType = DEVICE_CC26X2;
|
||||||
|
SblDevice *pDevice = NULL; // Pointer to SblDevice object
|
||||||
|
char *SerialDevNode;
|
||||||
|
int32_t devStatus = -1; // Hold SBL status codes
|
||||||
|
std::string fileName; // File name to program
|
||||||
|
uint32_t byteCount = 0; // File size in bytes
|
||||||
|
uint32_t fileCrc, devCrc; // Variables to save CRC checksum
|
||||||
|
uint32_t devFlashBase; // Flash start address
|
||||||
|
static std::vector<char> pvWrite(1);// Vector to application firmware in.
|
||||||
|
static std::ifstream file; // File stream
|
||||||
|
|
||||||
|
// Set callback functions
|
||||||
|
SblDevice::setCallBackStatusFunction(&appStatus);
|
||||||
|
SblDevice::setCallBackProgressFunction(&appProgress);
|
||||||
|
|
||||||
|
// Select device
|
||||||
|
// deviceType FlashBase File
|
||||||
|
// DEVICE_CC2538 CC2538_FLASH_BASE blinky_backdoor_select_btn2538.bin
|
||||||
|
// DEVICE_CC26X0 CC26XX_FLASH_BASE blinky_backdoor_select_btn2650.bin
|
||||||
|
// DEVICE_CC2640R2 CC26XX_FLASH_BASE blinky_backdoor_select_btn2640r2.bin
|
||||||
|
// DEVICE_CC26X2 CC26XX_FLASH_BASE blinky_backdoor_select_btn26x2.bin
|
||||||
|
if(argc < 5) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
SerialDevNode = argv[1];
|
||||||
|
baudRate = atoi(argv[2]);
|
||||||
|
deviceType = strtol(argv[3], NULL, 16);
|
||||||
|
fileName = argv[4];
|
||||||
|
switch(deviceType)
|
||||||
|
{
|
||||||
|
case DEVICE_CC2538:
|
||||||
|
devFlashBase = CC2538_FLASH_BASE;
|
||||||
|
break;
|
||||||
|
case DEVICE_CC26X0:
|
||||||
|
case DEVICE_CC2640R2:
|
||||||
|
case DEVICE_CC26X2:
|
||||||
|
devFlashBase = CC26XX_FLASH_BASE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printf("SerialDevNode=%s, baudRate=%d, deviceType=%04x, fileName=%s\n",SerialDevNode,baudRate,deviceType,fileName.c_str());
|
||||||
|
|
||||||
|
// Should SBL try to enable XOSC? (Not possible for CC26xx)
|
||||||
|
bool bEnableXosc = false;
|
||||||
|
if(deviceType == DEVICE_CC2538)
|
||||||
|
{
|
||||||
|
char answer[64];
|
||||||
|
cout << "Enable device CC2538 XOSC? (Y/N): ";
|
||||||
|
cin >> answer;
|
||||||
|
bEnableXosc = (answer[0] == 'Y' || answer[0] == 'y') ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create SBL object
|
||||||
|
pDevice = SblDevice::Create(deviceType);
|
||||||
|
if(pDevice == NULL)
|
||||||
|
{
|
||||||
|
printf("No SBL device object.\n");
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Connect to device
|
||||||
|
printf("Connecting (%s @ %d baud) ...\n", SerialDevNode, baudRate);
|
||||||
|
if(pDevice->connect(SerialDevNode, baudRate, bEnableXosc) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read file
|
||||||
|
file.open(fileName.c_str(), std::ios::binary);
|
||||||
|
if(file.is_open())
|
||||||
|
{
|
||||||
|
// Get file size:
|
||||||
|
file.seekg(0, std::ios::end);
|
||||||
|
byteCount = (uint32_t)file.tellg();
|
||||||
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
|
// Read data
|
||||||
|
pvWrite.resize(byteCount);
|
||||||
|
file.read((char*) &pvWrite[0], byteCount);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << "Unable to open file " << fileName.c_str();
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate file CRC checksum
|
||||||
|
fileCrc = calcCrcLikeChip((unsigned char *)&pvWrite[0], byteCount);
|
||||||
|
|
||||||
|
if(pDevice->calculateCrc32(devFlashBase, byteCount, &devCrc) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf ("pre-Comparing CRC: fileCrc=%x,devCrc=%x\n",fileCrc,devCrc);
|
||||||
|
|
||||||
|
if(fileCrc == devCrc) {
|
||||||
|
cout << "CRC is same, no need to upgrade\n";
|
||||||
|
pDevice->reset();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Erasing as much flash needed to program firmware.
|
||||||
|
cout << "Erasing flash ...\n";
|
||||||
|
if(pDevice->eraseFlashRange(devFlashBase, byteCount) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Writing file to device flash memory.
|
||||||
|
cout << "Writing flash ...\n";
|
||||||
|
if(pDevice->writeFlashRange(devFlashBase, byteCount, &pvWrite[0]) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate CRC checksum of flashed content.
|
||||||
|
cout << "Calculating CRC on device ...\n";
|
||||||
|
if(pDevice->calculateCrc32(devFlashBase, byteCount, &devCrc) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compare CRC checksums
|
||||||
|
printf ("Comparing CRC: fileCrc=%x,devCrc=%x\n",fileCrc,devCrc);
|
||||||
|
if(fileCrc == devCrc) printf("OK\n");
|
||||||
|
else printf("Mismatch!\n");
|
||||||
|
|
||||||
|
cout << "Resetting device ...\n";
|
||||||
|
pDevice->reset();
|
||||||
|
cout << "OK\n";
|
||||||
|
|
||||||
|
}
|
||||||
673
feeds/bluetooth-cc2652/cc2652/src/sbl_device.cpp
Executable file
673
feeds/bluetooth-cc2652/cc2652/src/sbl_device.cpp
Executable file
@@ -0,0 +1,673 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_device.cpp
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader device file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 <sbllib.h>
|
||||||
|
#include "sbl_device.h"
|
||||||
|
#include "sbl_device_cc2538.h"
|
||||||
|
#include "sbl_device_cc2650.h"
|
||||||
|
#include "sbl_device_cc2652.h"
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#include <ComPort.h>
|
||||||
|
#include <ComPortElement.h>
|
||||||
|
#else
|
||||||
|
#include "serialib.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
// Static variables
|
||||||
|
//
|
||||||
|
std::string SblDevice::sm_csLastError;
|
||||||
|
uint32_t SblDevice::sm_progress = 0;
|
||||||
|
tProgressFPTR SblDevice::sm_pProgressFunction = NULL;
|
||||||
|
tStatusFPTR SblDevice::sm_pStatusFunction = NULL;
|
||||||
|
uint32_t SblDevice::sm_chipType = 0;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Constructor
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
SblDevice::SblDevice()
|
||||||
|
{
|
||||||
|
m_pCom = NULL;
|
||||||
|
m_lastDeviceStatus = -1;
|
||||||
|
m_lastSblStatus = SBL_SUCCESS;
|
||||||
|
m_bCommInitialized = false;
|
||||||
|
m_deviceId = 0;
|
||||||
|
m_ramSize = 0;
|
||||||
|
m_flashSize = 0;
|
||||||
|
m_pageEraseSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Destructor
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
SblDevice::~SblDevice()
|
||||||
|
{
|
||||||
|
if (m_pCom != nullptr)
|
||||||
|
{
|
||||||
|
delete m_pCom;
|
||||||
|
m_pCom = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lastDeviceStatus = -1;
|
||||||
|
m_bCommInitialized = false;
|
||||||
|
m_ramSize = -1;
|
||||||
|
m_flashSize = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Create Serial Bootloader Device
|
||||||
|
*
|
||||||
|
* \param[in] ui32ChipType
|
||||||
|
* Chip type the object should be created for, e.g. 0x2650 for CC2650.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*static*/SblDevice *
|
||||||
|
SblDevice::Create(uint32_t ui32ChipType)
|
||||||
|
{
|
||||||
|
if (ui32ChipType == 0)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
sm_chipType = ui32ChipType;
|
||||||
|
|
||||||
|
switch (ui32ChipType)
|
||||||
|
{
|
||||||
|
case 0x2538:
|
||||||
|
return (SblDevice *)new SblDeviceCC2538();
|
||||||
|
case 0x1350:
|
||||||
|
case 0x1310:
|
||||||
|
case 0x2670:
|
||||||
|
case 0x2650:
|
||||||
|
case 0x2640:
|
||||||
|
case 0x2630:
|
||||||
|
case 0x2620:
|
||||||
|
return (SblDevice *)new SblDeviceCC2650();
|
||||||
|
case 0x1312:
|
||||||
|
case 0x1352:
|
||||||
|
case 0x2642:
|
||||||
|
case 0x2652:
|
||||||
|
return (SblDevice *)new SblDeviceCC2652();
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Enumerate COM port devices
|
||||||
|
*
|
||||||
|
* \param[in/out] pComPortElements
|
||||||
|
* Pointer to array where enumerated COM devices are stored
|
||||||
|
* \param[in/out] numElements
|
||||||
|
* Maximum number of elements to enumerate. Is populated with number
|
||||||
|
* of devices enumerated.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*static*/uint32_t
|
||||||
|
SblDevice::enumerate(ComPortElement *pComPortElements, int &numElements)
|
||||||
|
{
|
||||||
|
ComPort com;
|
||||||
|
if (com.enumerate(pComPortElements, numElements) != ComPort::COMPORT_SUCCESS)
|
||||||
|
{
|
||||||
|
printf("Failed to enumerate COM devices.\n");
|
||||||
|
return SBL_ENUM_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Connect to given port number at specified baud rate.
|
||||||
|
*
|
||||||
|
* \param[in] csPortNum
|
||||||
|
* String containing the COM port to use
|
||||||
|
* \param[in] ui32BaudRate
|
||||||
|
* Baud rate to use for talking to the device.
|
||||||
|
* \param[in] bEnableXosc (optional)
|
||||||
|
* If true, try to enable device XOSC. Defaults to false. This option is
|
||||||
|
* not available for all device types.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDevice::connect(std::string csPortNum, uint32_t ui32BaudRate,
|
||||||
|
bool bEnableXosc/* = false*/)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
int retCode = SBL_SUCCESS;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check input arguments
|
||||||
|
//
|
||||||
|
if (csPortNum.empty() || ui32BaudRate == 0)
|
||||||
|
{
|
||||||
|
setState(SBL_ARGUMENT_ERROR, "Cannot connect. Port number '%s' or baud rate '%d' is invalid.\n",
|
||||||
|
csPortNum.c_str(), ui32BaudRate);
|
||||||
|
return SBL_ARGUMENT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to connect to the specified port at the specified baud rate
|
||||||
|
if (m_pCom != NULL)
|
||||||
|
{
|
||||||
|
// Try to open port
|
||||||
|
#if 1
|
||||||
|
char result = m_pCom->openDevice(csPortNum.c_str(),ui32BaudRate);
|
||||||
|
if(result < 0)
|
||||||
|
{
|
||||||
|
setState(SBL_PORT_ERROR, "SBL: Unable to open %s. Error: %d.\n", csPortNum.c_str(), result);
|
||||||
|
return SBL_PORT_ERROR;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (int result = m_pCom->open(csPortNum,
|
||||||
|
ui32BaudRate,
|
||||||
|
SBL_DEFAULT_READ_TIMEOUT,
|
||||||
|
SBL_DEFAULT_WRITE_TIMEOUT) != ComPort::COMPORT_SUCCESS)
|
||||||
|
{
|
||||||
|
setState(SBL_PORT_ERROR, "SBL: Unable to open %s. Error: %d.\n", csPortNum.c_str(), result);
|
||||||
|
return SBL_PORT_ERROR;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
m_csComPort = csPortNum;
|
||||||
|
m_baudRate = ui32BaudRate;
|
||||||
|
}
|
||||||
|
// Check if device is responding at the given baud rate
|
||||||
|
if ((retCode = initCommunication(bEnableXosc)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Read device ID
|
||||||
|
//
|
||||||
|
uint32_t tmp;
|
||||||
|
if ((retCode = readDeviceId(&tmp)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
setState(retCode, "Failed to read device ID during initial connect.\n");
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Read device flash size
|
||||||
|
//
|
||||||
|
if ((retCode = readFlashSize(&tmp)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
setState(retCode, "Failed to read flash size during initial connect.\n");
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Read device ram size
|
||||||
|
//
|
||||||
|
if ((retCode = readRamSize(&tmp)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
setState(retCode, "Failed to read RAM size during initial connect.\n");
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Send auto baud.
|
||||||
|
*
|
||||||
|
* \param[out] bBaudSetOk
|
||||||
|
* True if response is ACK, false otherwise
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDevice::sendAutoBaud(bool &bBaudSetOk)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
bBaudSetOk = false;
|
||||||
|
//
|
||||||
|
// Send 0x55 0x55 and expect ACK
|
||||||
|
//
|
||||||
|
char pData[2];
|
||||||
|
memset(pData, 0x55, 2);
|
||||||
|
if (m_pCom->writeBytes(pData, 2) != 2)
|
||||||
|
{
|
||||||
|
setState(SBL_PORT_ERROR, "Communication initialization failed. Failed to send data.\n");
|
||||||
|
return SBL_PORT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getCmdResponse(bBaudSetOk, 2, true) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
// No response received. Invalid baud rate?
|
||||||
|
setState(SBL_PORT_ERROR, "No response from device. Device may not be in bootloader mode. Reset device and try again.\nIf problem persists, check connection and baud rate.\n");
|
||||||
|
return SBL_PORT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Get ACK/NAK from the boot loader.
|
||||||
|
*
|
||||||
|
* \param[out] bAck
|
||||||
|
* True if response is ACK, false if response is NAK.
|
||||||
|
* \param[in] ui32MaxRetries (optional)
|
||||||
|
* How many times ComPort::readBytes() can time out before fail is issued.
|
||||||
|
* \param[in] bQuietTimeout (optional)
|
||||||
|
* Do not set error if no command response is received.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDevice::getCmdResponse(bool &bAck,
|
||||||
|
uint32_t ui32MaxRetries/* = SBL_DEFAULT_RETRY_COUNT*/,
|
||||||
|
bool bQuietTimeout/* = false*/)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
unsigned char pIn[2];
|
||||||
|
memset(pIn, 0, 2);
|
||||||
|
uint32_t numBytes = 0;
|
||||||
|
uint32_t retry = 0;
|
||||||
|
bAck = false;
|
||||||
|
uint32_t bytesRecv = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Expect 2 bytes (ACK or NAK)
|
||||||
|
//
|
||||||
|
do
|
||||||
|
{
|
||||||
|
numBytes = m_pCom->readBytes(pIn, 2);
|
||||||
|
bytesRecv += numBytes;
|
||||||
|
retry++;
|
||||||
|
} while ((bytesRecv < 2) && (retry < ui32MaxRetries));
|
||||||
|
|
||||||
|
if (bytesRecv < 2)
|
||||||
|
{
|
||||||
|
if (!bQuietTimeout) setState(SBL_TIMEOUT_ERROR, "Timed out waiting for ACK/NAK. No response from device.\n");
|
||||||
|
return SBL_TIMEOUT_ERROR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (pIn[0] == 0x00 && pIn[1] == 0xCC)
|
||||||
|
{
|
||||||
|
bAck = true;
|
||||||
|
return setState(SBL_SUCCESS);
|
||||||
|
}
|
||||||
|
else if (pIn[0] == 0x00 && pIn[1] == 0x33)
|
||||||
|
{
|
||||||
|
return setState(SBL_SUCCESS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setState(SBL_ERROR, "ACK/NAK not received. Expected 0x00 0xCC or 0x00 0x33, received 0x%02X 0x%02X. bytesRecv=%d\n", pIn[0], pIn[1], bytesRecv);
|
||||||
|
return SBL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SBL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Send command response (ACK/NAK).
|
||||||
|
*
|
||||||
|
* \param[in] bAck
|
||||||
|
* True if response is ACK, false if response is NAK.
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDevice::sendCmdResponse(bool bAck)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
//
|
||||||
|
// Send response
|
||||||
|
//
|
||||||
|
char pData[2];
|
||||||
|
pData[0] = 0x00;
|
||||||
|
pData[1] = (bAck) ? 0xCC : 0x33;
|
||||||
|
|
||||||
|
if (m_pCom->writeBytes(pData, 2) != 2)
|
||||||
|
{
|
||||||
|
setState(SBL_PORT_ERROR, "Failed to send ACK/NAK response over %s\n",
|
||||||
|
m_csComPort.c_str());
|
||||||
|
return SBL_PORT_ERROR;
|
||||||
|
}
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Get response data from device.
|
||||||
|
*
|
||||||
|
* \param[out] pcData
|
||||||
|
* Pointer to where received data will be stored.
|
||||||
|
* \param[in|out] ui32MaxLen
|
||||||
|
* Max number of bytes that can be received. Is populated with the actual
|
||||||
|
* number of bytes received.
|
||||||
|
* \param[in] ui32MaxRetries (optional)
|
||||||
|
* How many times ComPort::readBytes() can time out before fail is issued.
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDevice::getResponseData(char *pcData, uint32_t &ui32MaxLen,
|
||||||
|
uint32_t ui32MaxRetries/* = SBL_DEFAULT_RETRY_COUNT*/)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
uint32_t numBytes = 0;
|
||||||
|
uint32_t retry = 0;
|
||||||
|
unsigned char pcHdr[2];
|
||||||
|
uint32_t numPayloadBytes;
|
||||||
|
uint8_t hdrChecksum, dataChecksum;
|
||||||
|
uint32_t bytesRecv = 0;
|
||||||
|
|
||||||
|
setState(SBL_SUCCESS);
|
||||||
|
//
|
||||||
|
// Read length and checksum
|
||||||
|
//
|
||||||
|
memset(pcHdr, 0, 2);
|
||||||
|
do
|
||||||
|
{
|
||||||
|
bytesRecv += m_pCom->readBytes(&pcHdr[bytesRecv], (2 - bytesRecv));
|
||||||
|
retry++;
|
||||||
|
} while ((bytesRecv < 2) && retry < ui32MaxRetries);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check that we've received 2 bytes
|
||||||
|
//
|
||||||
|
if (bytesRecv < 2)
|
||||||
|
{
|
||||||
|
setState(SBL_TIMEOUT_ERROR, "Timed out waiting for data header from device.\n");
|
||||||
|
return SBL_TIMEOUT_ERROR;
|
||||||
|
}
|
||||||
|
numPayloadBytes = pcHdr[0] - 2;
|
||||||
|
hdrChecksum = pcHdr[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if length byte is too long.
|
||||||
|
//
|
||||||
|
if (numPayloadBytes > ui32MaxLen)
|
||||||
|
{
|
||||||
|
setState(SBL_ERROR, "Error: Device sending more data than expected. \nMax expected was %d, sent was %d.\n", (uint32_t)ui32MaxLen, (numPayloadBytes + 2));
|
||||||
|
#if 1
|
||||||
|
m_pCom->flushReceiver();
|
||||||
|
#endif
|
||||||
|
return SBL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Read the payload data
|
||||||
|
//
|
||||||
|
bytesRecv = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
bytesRecv += m_pCom->readBytes(&pcData[bytesRecv], (numPayloadBytes - bytesRecv));
|
||||||
|
retry++;
|
||||||
|
} while (bytesRecv < numPayloadBytes && retry < ui32MaxRetries);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Have we received what we expected?
|
||||||
|
//
|
||||||
|
if (bytesRecv < numPayloadBytes)
|
||||||
|
{
|
||||||
|
ui32MaxLen = bytesRecv;
|
||||||
|
setState(SBL_TIMEOUT_ERROR, "Timed out waiting for data from device.\n");
|
||||||
|
return SBL_TIMEOUT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Verify data checksum
|
||||||
|
//
|
||||||
|
dataChecksum = generateCheckSum(0, pcData, numPayloadBytes);
|
||||||
|
if (dataChecksum != hdrChecksum)
|
||||||
|
{
|
||||||
|
setState(SBL_ERROR, "Checksum verification error. Expected 0x%02X, got 0x%02X.\n", hdrChecksum, dataChecksum);
|
||||||
|
return SBL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui32MaxLen = bytesRecv;
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Are we connected to the device?
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns true if connected to device.
|
||||||
|
* Returns false if not connected to device.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
SblDevice::isConnected()
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
if (!m_pCom)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function generates the bootloader protocol checksum.
|
||||||
|
*
|
||||||
|
* \param[in] ui32Cmd
|
||||||
|
* The bootloader command
|
||||||
|
* \param[in] pcData
|
||||||
|
* Pointer to the command data.
|
||||||
|
* \param[in] ui32DataLen
|
||||||
|
* Data length in bytes.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns the generated checksum.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint8_t
|
||||||
|
SblDevice::generateCheckSum(uint32_t ui32Cmd, const char *pcData,
|
||||||
|
uint32_t ui32DataLen)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
uint8_t ui8CheckSum = (uint8_t)ui32Cmd;
|
||||||
|
for (uint32_t i = 0; i < ui32DataLen; i++)
|
||||||
|
{
|
||||||
|
ui8CheckSum += pcData[i];
|
||||||
|
}
|
||||||
|
return ui8CheckSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function sets the SBL status and the SBL error string.
|
||||||
|
*
|
||||||
|
* \param[in] ui32Status
|
||||||
|
* The new SBL status. SBL_SUCCESS, SBL_ERROR, ...
|
||||||
|
* \param[in] pcFormat
|
||||||
|
* 'printf' like format string.
|
||||||
|
* \param[in] ...
|
||||||
|
* Input variables to the \e pcFormat string.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDevice::setState(const uint32_t &ui32Status, char *pcFormat, ...)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
va_list args;
|
||||||
|
char text[2048];
|
||||||
|
|
||||||
|
m_lastSblStatus = ui32Status;
|
||||||
|
|
||||||
|
// Attempt to do a sanity check. Not possible to say how long
|
||||||
|
// the formatted text will be, but if we reserve half the space for
|
||||||
|
// formatted arguments it should be sufficient.
|
||||||
|
if (strlen(pcFormat) > 2048 / 2) {
|
||||||
|
return SBL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
va_start(args, pcFormat);
|
||||||
|
#if 0
|
||||||
|
vsprintf_s(text, pcFormat, args);
|
||||||
|
#else
|
||||||
|
vsprintf(text, pcFormat, args);
|
||||||
|
#endif
|
||||||
|
sm_csLastError = text;
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
if (SblDevice::sm_pStatusFunction != NULL)
|
||||||
|
{
|
||||||
|
bool error = (m_lastSblStatus == SBL_SUCCESS) ? false : true;
|
||||||
|
sm_pStatusFunction((char *)sm_csLastError.c_str(), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Utility function for converting 4 elements in char array into
|
||||||
|
* 32 bit variable. Data are converted MSB, that is. \e pcSrc[0] is the
|
||||||
|
* most significant byte.
|
||||||
|
*
|
||||||
|
* \param pcSrc[in]
|
||||||
|
* A pointer to the source array.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns the 32 bit variable.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*static */uint32_t
|
||||||
|
SblDevice::charArrayToUL(const char *pcSrc)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
uint32_t ui32Val = (unsigned char)pcSrc[3];
|
||||||
|
ui32Val += (((unsigned long)pcSrc[2]) & 0xFF) << 8;
|
||||||
|
ui32Val += (((unsigned long)pcSrc[1]) & 0xFF) << 16;
|
||||||
|
ui32Val += (((unsigned long)pcSrc[0]) & 0xFF) << 24;
|
||||||
|
return (ui32Val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Utility function for splitting 32 bit variable into char array
|
||||||
|
* (4 elements). Data are converted MSB, that is, \e pcDst[0] is the
|
||||||
|
* most significant byte.
|
||||||
|
*
|
||||||
|
* \param[in] ui32Src
|
||||||
|
* The 32 bit variable to convert.
|
||||||
|
*
|
||||||
|
* \param[out] pcDst
|
||||||
|
* Pointer to the char array where the data will be stored.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* void
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*static */void
|
||||||
|
SblDevice::ulToCharArray(const uint32_t ui32Src, char *pcDst)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
// MSB first
|
||||||
|
pcDst[0] = (uint8_t)(ui32Src >> 24);
|
||||||
|
pcDst[1] = (uint8_t)(ui32Src >> 16);
|
||||||
|
pcDst[2] = (uint8_t)(ui32Src >> 8);
|
||||||
|
pcDst[3] = (uint8_t)(ui32Src >> 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Utility function for swapping the byte order of a 4B char array.
|
||||||
|
*
|
||||||
|
* \param[in|out] pcArray
|
||||||
|
* The char array to byte swap.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* void
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*static */void
|
||||||
|
SblDevice::byteSwap(char *pcArray)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
uint8_t tmp[2] = { (uint8_t)pcArray[0], (uint8_t)pcArray[1] };
|
||||||
|
pcArray[0] = pcArray[3];
|
||||||
|
pcArray[1] = pcArray[2];
|
||||||
|
pcArray[2] = tmp[1];
|
||||||
|
pcArray[3] = tmp[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This functions sets the SBL progress.
|
||||||
|
*
|
||||||
|
* \param[in] ui32Progress
|
||||||
|
* The current progress, typically in percent [0-100].
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* void
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*static*/uint32_t
|
||||||
|
SblDevice::setProgress(uint32_t ui32Progress)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
if (sm_pProgressFunction)
|
||||||
|
{
|
||||||
|
sm_pProgressFunction(ui32Progress);
|
||||||
|
}
|
||||||
|
|
||||||
|
sm_progress = ui32Progress;
|
||||||
|
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
143
feeds/bluetooth-cc2652/cc2652/src/sbl_device.h
Executable file
143
feeds/bluetooth-cc2652/cc2652/src/sbl_device.h
Executable file
@@ -0,0 +1,143 @@
|
|||||||
|
#ifndef __SBL_DEVICE_H__
|
||||||
|
#define __SBL_DEVICE_H__
|
||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_device.h
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader device header file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 "serialib.h"
|
||||||
|
//
|
||||||
|
// Typedefs for callback functions to report status and progress to application
|
||||||
|
//
|
||||||
|
typedef void (*tStatusFPTR)(char *pcText, bool bError);
|
||||||
|
typedef void (*tProgressFPTR)(uint32_t ui32Value);
|
||||||
|
|
||||||
|
class SblDevice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Constructor
|
||||||
|
~SblDevice();
|
||||||
|
|
||||||
|
// Static functions
|
||||||
|
static SblDevice *Create(uint32_t ui32ChipType);
|
||||||
|
virtual uint32_t connect(std::string csPortNum, uint32_t ui32BaudRate, bool bEnableXosc = false);
|
||||||
|
virtual uint32_t ping() = 0;
|
||||||
|
virtual uint32_t readStatus(uint32_t *pui32Status) = 0;
|
||||||
|
virtual uint32_t readDeviceId(uint32_t *pui32DeviceId) = 0;
|
||||||
|
virtual uint32_t readFlashSize(uint32_t *pui32FlashSize) = 0;
|
||||||
|
virtual uint32_t readRamSize(uint32_t *pui32RamSize) = 0;
|
||||||
|
virtual uint32_t run(uint32_t ui32Address) { (void)ui32Address; return SBL_UNSUPPORTED_FUNCTION; };
|
||||||
|
virtual uint32_t reset() = 0;
|
||||||
|
virtual uint32_t eraseFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount) { (void)ui32StartAddress; (void)ui32ByteCount; return 0; };
|
||||||
|
virtual uint32_t writeFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount, const char *pcData) { (void)ui32StartAddress; (void)ui32ByteCount; (void)pcData; return 0; };
|
||||||
|
virtual uint32_t readMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, uint32_t *pui32Data) = 0;
|
||||||
|
virtual uint32_t readMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, char *pcData) = 0;
|
||||||
|
virtual uint32_t writeMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const uint32_t *pui32Data) = 0;
|
||||||
|
virtual uint32_t writeMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const char *pcData) = 0;
|
||||||
|
virtual uint32_t calculateCrc32(uint32_t ui32StartAddress, uint32_t ui32ByteCount, uint32_t *pui32Crc) = 0;
|
||||||
|
|
||||||
|
// CC2650 specific
|
||||||
|
virtual uint32_t eraseFlashBank(){ return SBL_UNSUPPORTED_FUNCTION; };
|
||||||
|
virtual uint32_t setCCFG(uint32_t ui32Field, uint32_t ui32FieldValue) { (void)ui32Field; (void)ui32FieldValue; return SBL_UNSUPPORTED_FUNCTION; };
|
||||||
|
|
||||||
|
// CC2538 specific
|
||||||
|
virtual uint32_t setXosc() { return SBL_UNSUPPORTED_FUNCTION; };
|
||||||
|
|
||||||
|
// Utility functions
|
||||||
|
bool isConnected();
|
||||||
|
uint32_t getDeviceId() { return m_deviceId; }
|
||||||
|
uint32_t getFlashSize() { return m_flashSize; }
|
||||||
|
uint32_t getRamSize() { return m_ramSize; }
|
||||||
|
uint32_t getBaudRate() { return m_baudRate; }
|
||||||
|
uint32_t getLastStatus() {return m_lastSblStatus; }
|
||||||
|
uint32_t getLastDeviceStatus() { return m_lastDeviceStatus; }
|
||||||
|
uint32_t getPageEraseSize() { return m_pageEraseSize; }
|
||||||
|
static std::string &getLastError(void) { return sm_csLastError;}
|
||||||
|
static uint32_t getProgress() { return sm_progress; }
|
||||||
|
static uint32_t setProgress(uint32_t ui32Progress);
|
||||||
|
static void setCallBackStatusFunction(tStatusFPTR pSf) {sm_pStatusFunction = pSf; }
|
||||||
|
static void setCallBackProgressFunction(tProgressFPTR pPf) {sm_pProgressFunction = pPf; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Constructor
|
||||||
|
SblDevice();
|
||||||
|
|
||||||
|
virtual uint32_t initCommunication(bool bSetXosc) = 0;
|
||||||
|
virtual uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0) = 0;
|
||||||
|
virtual uint32_t sendAutoBaud(bool &bBaudSetOk);
|
||||||
|
virtual uint32_t getCmdResponse(bool &bAck, uint32_t ui32MaxRetries = SBL_DEFAULT_RETRY_COUNT, bool bQuiet = false);
|
||||||
|
virtual uint32_t sendCmdResponse(bool bAck);
|
||||||
|
virtual uint32_t getResponseData(char *pcData, uint32_t &ui32MaxLen, uint32_t ui32MaxRetries = SBL_DEFAULT_RETRY_COUNT);
|
||||||
|
|
||||||
|
virtual uint8_t generateCheckSum(uint32_t ui32Cmd, const char *pcData, uint32_t ui32DataLen);
|
||||||
|
virtual uint32_t addressToPage(uint32_t ui32Address) = 0;
|
||||||
|
virtual bool addressInRam(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1) = 0;
|
||||||
|
virtual bool addressInFlash(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1) = 0;
|
||||||
|
|
||||||
|
virtual uint32_t getBootloaderEnableAddress() = 0;
|
||||||
|
|
||||||
|
uint32_t setState(const uint32_t &ui32Status) { m_lastSblStatus = ui32Status; return m_lastSblStatus;}
|
||||||
|
uint32_t setState(const uint32_t &ui32Status, char *pcFormat, ...);
|
||||||
|
|
||||||
|
// Utility
|
||||||
|
static uint32_t charArrayToUL(const char *pcSrc);
|
||||||
|
static void ulToCharArray(const uint32_t ui32Src, char *pcDst);
|
||||||
|
static void byteSwap(char *pcArray);
|
||||||
|
|
||||||
|
serialib *m_pCom;
|
||||||
|
std::string m_csComPort;
|
||||||
|
bool m_bCommInitialized;
|
||||||
|
uint32_t m_baudRate;
|
||||||
|
|
||||||
|
static uint32_t sm_chipType;
|
||||||
|
uint32_t m_deviceId;
|
||||||
|
uint32_t m_flashSize;
|
||||||
|
uint32_t m_ramSize;
|
||||||
|
uint32_t m_pageEraseSize;
|
||||||
|
|
||||||
|
// Status and progress variables
|
||||||
|
int32_t m_lastDeviceStatus;
|
||||||
|
int32_t m_lastSblStatus;
|
||||||
|
static uint32_t sm_progress;
|
||||||
|
static std::string sm_csLastError;
|
||||||
|
static tProgressFPTR sm_pProgressFunction;
|
||||||
|
static tStatusFPTR sm_pStatusFunction;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __SBL_DEVICE_H__
|
||||||
1762
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.cpp
Executable file
1762
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.cpp
Executable file
File diff suppressed because it is too large
Load Diff
126
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.h
Executable file
126
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.h
Executable file
@@ -0,0 +1,126 @@
|
|||||||
|
#ifndef __SBL_DEVICE_CC2538_H__
|
||||||
|
#define __SBL_DEVICE_CC2538_H__
|
||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_device_cc2538.h
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader for CC2538 header file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 <sbl_device.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
// For more information about the CC2538 serial bootloader interface,
|
||||||
|
// please refer to the CC2538 ROM User's guide (http://www.ti.com/lit/swru333)
|
||||||
|
//
|
||||||
|
|
||||||
|
#define SBL_CC2538_PAGE_ERASE_SIZE 2048
|
||||||
|
#define SBL_CC2538_FLASH_START_ADDRESS 0x00200000
|
||||||
|
#define SBL_CC2538_RAM_START_ADDRESS 0x20000000
|
||||||
|
#define SBL_CC2538_ACCESS_WIDTH_4B 4
|
||||||
|
#define SBL_CC2538_ACCESS_WIDTH_1B 1
|
||||||
|
#define SBL_CC2538_PAGE_ERASE_TIME_MS 20
|
||||||
|
#define SBL_CC2538_MAX_BYTES_PER_TRANSFER 252
|
||||||
|
#define SBL_CC2538_DIECFG0 0x400D3014
|
||||||
|
#define SBL_CC2538_BL_CONFIG_PAGE_OFFSET 2007
|
||||||
|
#define SBL_CC2538_BL_CONFIG_ENABLED_BM 0x10
|
||||||
|
|
||||||
|
class SblDeviceCC2538 : public SblDevice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SblDeviceCC2538(); // Constructor
|
||||||
|
~SblDeviceCC2538(); // Destructor
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CMD_PING = 0x20,
|
||||||
|
CMD_DOWNLOAD = 0x21,
|
||||||
|
CMD_RUN = 0x22,
|
||||||
|
CMD_GET_STATUS = 0x23,
|
||||||
|
CMD_SEND_DATA = 0x24,
|
||||||
|
CMD_RESET = 0x25,
|
||||||
|
CMD_ERASE = 0x26,
|
||||||
|
CMD_CRC32 = 0x27,
|
||||||
|
CMD_GET_CHIP_ID = 0x28,
|
||||||
|
CMD_SET_XOSC = 0x29,
|
||||||
|
CMD_MEMORY_READ = 0x2A,
|
||||||
|
CMD_MEMORY_WRITE = 0x2B,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CMD_RET_SUCCESS = 0x40,
|
||||||
|
CMD_RET_UNKNOWN_CMD = 0x41,
|
||||||
|
CMD_RET_INVALID_CMD = 0x42,
|
||||||
|
CMD_RET_INVALID_ADR = 0x43,
|
||||||
|
CMD_RET_FLASH_FAIL = 0x44,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Virtual functions from SblDevice
|
||||||
|
uint32_t ping();
|
||||||
|
|
||||||
|
uint32_t readStatus(uint32_t *pui32Status);
|
||||||
|
uint32_t readDeviceId(uint32_t *pui32DeviceId);
|
||||||
|
uint32_t readFlashSize(uint32_t *pui32FlashSize);
|
||||||
|
uint32_t readRamSize(uint32_t *pui32RamSize);
|
||||||
|
|
||||||
|
uint32_t run(uint32_t ui32Address);
|
||||||
|
uint32_t reset();
|
||||||
|
uint32_t eraseFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount);
|
||||||
|
uint32_t writeFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount, const char *pcData);
|
||||||
|
uint32_t readMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, uint32_t *pui32Data);
|
||||||
|
uint32_t readMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, char *pcData);
|
||||||
|
uint32_t writeMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const uint32_t *pui32Data);
|
||||||
|
uint32_t writeMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const char *pcData);
|
||||||
|
|
||||||
|
uint32_t calculateCrc32(uint32_t ui32StartAddress, uint32_t ui32ByteCount, uint32_t *pui32Crc);
|
||||||
|
|
||||||
|
uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0);
|
||||||
|
uint32_t addressToPage(uint32_t ui32Address);
|
||||||
|
bool addressInRam(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||||
|
bool addressInFlash(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||||
|
uint32_t setXosc();
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint32_t initCommunication(bool bSetXosc);
|
||||||
|
uint32_t cmdDownload(uint32_t ui32Address, uint32_t ui32Size);
|
||||||
|
uint32_t cmdSendData(const char *pcData, uint32_t ui32ByteCount);
|
||||||
|
|
||||||
|
uint32_t getBootloaderEnableAddress();
|
||||||
|
|
||||||
|
std::string getCmdString(uint32_t ui32Cmd);
|
||||||
|
std::string getCmdStatusString(uint32_t ui32Status);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __SBL_DEVICE_CC2538_H__
|
||||||
1903
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.cpp
Executable file
1903
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.cpp
Executable file
File diff suppressed because it is too large
Load Diff
153
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.h
Executable file
153
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.h
Executable file
@@ -0,0 +1,153 @@
|
|||||||
|
#ifndef __SBL_DEVICE_CC2650_H__
|
||||||
|
#define __SBL_DEVICE_CC2650_H__
|
||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_device_cc2650.h
|
||||||
|
* Revised: $Date: 2013-07-26 09:53:42 +0200 (fr, 26 jul 2013) $
|
||||||
|
* Revision: $Revision: 26971 $
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader for CC2650 header file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 <sbl_device.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define SBL_CC2650_PAGE_ERASE_SIZE 4096
|
||||||
|
#define SBL_CC2650_FLASH_START_ADDRESS 0x00000000
|
||||||
|
#define SBL_CC2650_RAM_START_ADDRESS 0x20000000
|
||||||
|
#define SBL_CC2650_ACCESS_WIDTH_32B 1
|
||||||
|
#define SBL_CC2650_ACCESS_WIDTH_8B 0
|
||||||
|
#define SBL_CC2650_PAGE_ERASE_TIME_MS 20
|
||||||
|
#define SBL_CC2650_MAX_BYTES_PER_TRANSFER 252
|
||||||
|
#define SBL_CC2650_MAX_MEMWRITE_BYTES 247
|
||||||
|
#define SBL_CC2650_MAX_MEMWRITE_WORDS 61
|
||||||
|
#define SBL_CC2650_MAX_MEMREAD_BYTES 253
|
||||||
|
#define SBL_CC2650_MAX_MEMREAD_WORDS 63
|
||||||
|
#define SBL_CC2650_FLASH_SIZE_CFG 0x4003002C
|
||||||
|
#define SBL_CC2650_RAM_SIZE_CFG 0x40082250
|
||||||
|
#define SBL_CC2650_BL_CONFIG_PAGE_OFFSET 0xFDB
|
||||||
|
#define SBL_CC2650_BL_CONFIG_ENABLED_BM 0xC5
|
||||||
|
#define SBL_CC2650_BL_WORK_MEMORY_START 0x20000000
|
||||||
|
#define SBL_CC2650_BL_WORK_MEMORY_END 0x2000016F
|
||||||
|
#define SBL_CC2650_BL_STACK_MEMORY_START 0x20000FC0
|
||||||
|
#define SBL_CC2650_BL_STACK_MEMORY_END 0x20000FFF
|
||||||
|
|
||||||
|
class SblDeviceCC2650 : public SblDevice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SblDeviceCC2650(); // Constructor
|
||||||
|
~SblDeviceCC2650(); // Destructor
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CMD_PING = 0x20,
|
||||||
|
CMD_DOWNLOAD = 0x21,
|
||||||
|
CMD_GET_STATUS = 0x23,
|
||||||
|
CMD_SEND_DATA = 0x24,
|
||||||
|
CMD_RESET = 0x25,
|
||||||
|
CMD_SECTOR_ERASE = 0x26,
|
||||||
|
CMD_CRC32 = 0x27,
|
||||||
|
CMD_GET_CHIP_ID = 0x28,
|
||||||
|
CMD_MEMORY_READ = 0x2A,
|
||||||
|
CMD_MEMORY_WRITE = 0x2B,
|
||||||
|
CMD_BANK_ERASE = 0x2C,
|
||||||
|
CMD_SET_CCFG = 0x2D,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Early samples had different command IDs */
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
REV1_CMD_BANK_ERASE = 0x2A,
|
||||||
|
REV1_CMD_SET_CCFG = 0x2B,
|
||||||
|
REV1_CMD_MEMORY_READ = 0x2C,
|
||||||
|
REV1_CMD_MEMORY_WRITE = 0x2D,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CMD_RET_SUCCESS = 0x40,
|
||||||
|
CMD_RET_UNKNOWN_CMD = 0x41,
|
||||||
|
CMD_RET_INVALID_CMD = 0x42,
|
||||||
|
CMD_RET_INVALID_ADR = 0x43,
|
||||||
|
CMD_RET_FLASH_FAIL = 0x44,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Virtual functions from SblDevice
|
||||||
|
uint32_t ping();
|
||||||
|
|
||||||
|
uint32_t readStatus(uint32_t *pui32Status);
|
||||||
|
uint32_t readDeviceId(uint32_t *pui32DeviceId);
|
||||||
|
virtual uint32_t readFlashSize(uint32_t *pui32FlashSize);
|
||||||
|
virtual uint32_t readRamSize(uint32_t *pui32RamSize);
|
||||||
|
|
||||||
|
uint32_t reset();
|
||||||
|
uint32_t eraseFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount);
|
||||||
|
uint32_t writeFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount, const char *pcData);
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t readMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, uint32_t *pui32Data);
|
||||||
|
uint32_t readMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, char *pcData);
|
||||||
|
uint32_t writeMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const uint32_t *pui32Data);
|
||||||
|
uint32_t writeMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const char *pcData);
|
||||||
|
|
||||||
|
uint32_t calculateCrc32(uint32_t ui32StartAddress, uint32_t ui32ByteCount, uint32_t *pui32Crc);
|
||||||
|
|
||||||
|
uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0);
|
||||||
|
std::string getCmdString(uint32_t ui32Cmd);
|
||||||
|
uint32_t addressToPage(uint32_t ui32Address);
|
||||||
|
bool addressInRam(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||||
|
bool addressInFlash(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||||
|
|
||||||
|
uint32_t convertCmdForEarlySamples(uint32_t ui32Cmd);
|
||||||
|
|
||||||
|
virtual uint32_t getBootloaderEnableAddress();
|
||||||
|
|
||||||
|
// CC2650 specific
|
||||||
|
uint32_t eraseFlashBank();
|
||||||
|
uint32_t setCCFG(uint32_t ui32Field, uint32_t ui32FieldValue);
|
||||||
|
|
||||||
|
// Device revision. Used internally by SBL to handle early samples with different command IDs.
|
||||||
|
uint32_t m_deviceRev;
|
||||||
|
private:
|
||||||
|
uint32_t initCommunication(bool bSetXosc);
|
||||||
|
uint32_t cmdDownload(uint32_t ui32Address, uint32_t ui32Size);
|
||||||
|
uint32_t cmdSendData(const char *pcData, uint32_t ui32ByteCount);
|
||||||
|
|
||||||
|
std::string getCmdStatusString(uint32_t ui32Status);
|
||||||
|
|
||||||
|
bool addressInBLWorkMemory(uint32_t ui32StartAddr, uint32_t ui32ByteCount = 1);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __SBL_DEVICE_CC2650_H__
|
||||||
330
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.cpp
Executable file
330
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.cpp
Executable file
@@ -0,0 +1,330 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_device_cc2652.cpp
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader device file for CC13x2/CC26x2
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 <sbllib.h>
|
||||||
|
#include "sbl_device.h"
|
||||||
|
#include "sbl_device_cc2652.h"
|
||||||
|
|
||||||
|
#include "serialib.h"
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Constructor
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
SblDeviceCC2652::SblDeviceCC2652() : SblDeviceCC2650()
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
m_pageEraseSize = SBL_CC2652_PAGE_ERASE_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Destructor
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
SblDeviceCC2652::~SblDeviceCC2652()
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function reads device FLASH size in bytes.
|
||||||
|
*
|
||||||
|
* \param[out] pui32FlashSize
|
||||||
|
* Pointer to where FLASH size is stored.
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDeviceCC2652::readFlashSize(uint32_t *pui32FlashSize)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
uint32_t retCode = SBL_SUCCESS;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Read CC2652 DIECFG0 (contains FLASH size information)
|
||||||
|
//
|
||||||
|
uint32_t addr = SBL_CC2652_FLASH_SIZE_CFG;
|
||||||
|
uint32_t value;
|
||||||
|
if ((retCode = readMemory32(addr, 1, &value)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
setState((tSblStatus)retCode, "Failed to read device FLASH size: %s", getLastError().c_str());
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Calculate flash size (The number of flash sectors are at bits [7:0])
|
||||||
|
//
|
||||||
|
value &= 0xFF;
|
||||||
|
*pui32FlashSize = value*SBL_CC2652_PAGE_ERASE_SIZE;
|
||||||
|
|
||||||
|
m_flashSize = *pui32FlashSize;
|
||||||
|
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function reads device RAM size in bytes.
|
||||||
|
*
|
||||||
|
* \param[out] pui32RamSize
|
||||||
|
* Pointer to where RAM size is stored.
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDeviceCC2652::readRamSize(uint32_t *pui32RamSize)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
int retCode = SBL_SUCCESS;
|
||||||
|
|
||||||
|
uint32_t addr = SBL_CC2652_RAM_SIZE_CFG;
|
||||||
|
uint32_t value;
|
||||||
|
|
||||||
|
if ((retCode = readMemory32(addr, 1, &value)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
setState(retCode, "Failed to read device RAM size: %s", getLastError().c_str());
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t ramSizeInfo = (value & CHIP_SRAM_SIZE_INFO_M) >> CHIP_SRAM_SIZE_INFO_S;
|
||||||
|
|
||||||
|
m_ramSize = calculateRamSize(ramSizeInfo);
|
||||||
|
|
||||||
|
if (*pui32RamSize != NULL)
|
||||||
|
{
|
||||||
|
*pui32RamSize = m_ramSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Calculate RAM size.
|
||||||
|
*
|
||||||
|
* \param[in] ramSizeInfo
|
||||||
|
* Register value for RAM size configuration (TOP:PRCM:RAMHWOPT).
|
||||||
|
* The argument is optional and the default value is 3 (RAM size 80 KB)
|
||||||
|
* \returns uint32_t
|
||||||
|
* Ram size
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t SblDeviceCC2652::calculateRamSize(uint32_t ramSizeInfo)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
uint32_t ramSize;
|
||||||
|
|
||||||
|
switch (ramSizeInfo)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
ramSize = (32 * 1024);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
ramSize = (48 * 1024);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ramSize = (64 * 1024);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
default:
|
||||||
|
ramSize = (80 * 1024);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ramSize;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function returns the FLASH address of the bootloader enable
|
||||||
|
* configuration.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns true if the address/range is within the device RAM.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t SblDeviceCC2652::getBootloaderEnableAddress()
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
return SBL_CC2652_FLASH_START_ADDRESS + getFlashSize() - getPageEraseSize() + SBL_CC2652_BL_CONFIG_PAGE_OFFSET;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function returns a string with the device command name of
|
||||||
|
* \e ui32Cmd.
|
||||||
|
*
|
||||||
|
* \param[out] ui32Cmd
|
||||||
|
* The serial bootloader command.
|
||||||
|
* \return
|
||||||
|
* Returns std::string with name of device command.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
std::string
|
||||||
|
SblDeviceCC2652::getCmdString(uint32_t ui32Cmd)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
std::string cmd = SblDeviceCC2650::getCmdString(ui32Cmd);
|
||||||
|
if (cmd.find("Unknown") != std::string::npos)
|
||||||
|
{
|
||||||
|
switch (ui32Cmd)
|
||||||
|
{
|
||||||
|
case SblDeviceCC2652::CMD_DOWNLOAD_CRC: cmd = "CMD_DOWNLOAD_CRC"; break;
|
||||||
|
default: cmd = "Unknown command"; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief This function sends the CC2652 download CRC command and handles the
|
||||||
|
* device response.
|
||||||
|
*
|
||||||
|
* \param[in] ui32Address
|
||||||
|
* The start address in CC2652 flash.
|
||||||
|
* \param[in] ui32Size
|
||||||
|
* Number of bytes to be sent.
|
||||||
|
* \param[in] ui32Crc
|
||||||
|
* Total number of bytes to be programmed.
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS if command and response was successful.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t SblDeviceCC2652::cmdDownloadCrc(uint32_t ui32Address, uint32_t ui32Size, uint32_t ui32Crc)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
int retCode = SBL_SUCCESS;
|
||||||
|
bool bSuccess = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check input arguments
|
||||||
|
//
|
||||||
|
if (!addressInFlash(ui32Address, ui32Size) &&
|
||||||
|
!addressInRam(ui32Address, ui32Size))
|
||||||
|
{
|
||||||
|
setState(SBL_ARGUMENT_ERROR, "Specified address range (0x%08X + %d bytes) is not in device FLASH nor RAM.\n", ui32Address, ui32Size);
|
||||||
|
return SBL_ARGUMENT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Generate payload
|
||||||
|
// - 4B Program address
|
||||||
|
// - 4B Program data
|
||||||
|
// - 4B CRC
|
||||||
|
//
|
||||||
|
char pcPayload[12];
|
||||||
|
ulToCharArray(ui32Address, &pcPayload[0]);
|
||||||
|
ulToCharArray(ui32Size, &pcPayload[4]);
|
||||||
|
ulToCharArray(ui32Crc, &pcPayload[8]);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Send command
|
||||||
|
//
|
||||||
|
if ((retCode = sendCmd(SblDeviceCC2652::CMD_DOWNLOAD_CRC, pcPayload, 12) != SBL_SUCCESS))
|
||||||
|
{
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Receive command response (ACK/NAK)
|
||||||
|
//
|
||||||
|
if ((retCode = getCmdResponse(bSuccess)) != SBL_SUCCESS)
|
||||||
|
{
|
||||||
|
return retCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Return command response
|
||||||
|
//
|
||||||
|
return (bSuccess) ? SBL_SUCCESS : SBL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/** \brief Send command.
|
||||||
|
*
|
||||||
|
* \param[in] ui32Cmd
|
||||||
|
* The command to send.
|
||||||
|
* \param[in] pcSendData
|
||||||
|
* Pointer to the data to send with the command.
|
||||||
|
* \param[in] ui32SendLen
|
||||||
|
* The number of bytes to send from \e pcSendData.
|
||||||
|
* \return
|
||||||
|
* Returns SBL_SUCCESS, ...
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
uint32_t
|
||||||
|
SblDeviceCC2652::sendCmd(uint32_t ui32Cmd, const char *pcSendData/* = NULL*/,
|
||||||
|
uint32_t ui32SendLen/* = 0*/)
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("\n");
|
||||||
|
unsigned char pktLen = ui32SendLen + 3; // +3 => <1B Length>, <1B checksum>, <1B cmd>
|
||||||
|
std::vector<char> pvPkt((pktLen));
|
||||||
|
unsigned char pktSum = generateCheckSum(ui32Cmd, pcSendData, ui32SendLen);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Build packet
|
||||||
|
//
|
||||||
|
pvPkt.at(0) = pktLen;
|
||||||
|
pvPkt.at(1) = pktSum;
|
||||||
|
pvPkt.at(2) = (unsigned char)ui32Cmd;
|
||||||
|
if (ui32SendLen)
|
||||||
|
{
|
||||||
|
memcpy(&pvPkt[3], pcSendData, ui32SendLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Send packet
|
||||||
|
//
|
||||||
|
if (m_pCom->writeBytes(&pvPkt[0], pvPkt.size()) < 1)
|
||||||
|
{
|
||||||
|
setState(SBL_PORT_ERROR, "\nWriting to device failed (Command 0x%04x:'%s').\n", ui32Cmd,getCmdString(ui32Cmd).c_str());
|
||||||
|
return SBL_PORT_ERROR;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Empty and deallocate vector
|
||||||
|
//
|
||||||
|
pvPkt.clear();
|
||||||
|
std::vector<char>().swap(pvPkt);
|
||||||
|
|
||||||
|
return SBL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
77
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.h
Executable file
77
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.h
Executable file
@@ -0,0 +1,77 @@
|
|||||||
|
#ifndef __SBL_DEVICE_CC2652_H__
|
||||||
|
#define __SBL_DEVICE_CC2652_H__
|
||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_device_cc2652.h
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader for CC13x2/CC26x2 header file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 "sbl_device_cc2650.h"
|
||||||
|
|
||||||
|
#define SBL_CC2652_PAGE_ERASE_SIZE 8192
|
||||||
|
#define SBL_CC2652_FLASH_SIZE_CFG 0x4003002C
|
||||||
|
#define SBL_CC2652_RAM_SIZE_CFG 0x40082250
|
||||||
|
#define SBL_CC2652_RAM_SIZE_CFG 0x40082250
|
||||||
|
#define SBL_CC2652_FLASH_START_ADDRESS SBL_CC2650_FLASH_START_ADDRESS
|
||||||
|
#define SBL_CC2652_BL_CONFIG_PAGE_OFFSET 0x1FDB
|
||||||
|
|
||||||
|
#define CHIP_SRAM_SIZE_INFO 0x40082250
|
||||||
|
#define CHIP_SRAM_SIZE_INFO_M 0x00000003
|
||||||
|
#define CHIP_SRAM_SIZE_INFO_S 0
|
||||||
|
|
||||||
|
class SblDeviceCC2652 : public SblDeviceCC2650
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SblDeviceCC2652(); // Constructor
|
||||||
|
~SblDeviceCC2652(); // Destructor
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CMD_DOWNLOAD_CRC = 0x2F,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
uint32_t readFlashSize(uint32_t *pui32FlashSize);
|
||||||
|
uint32_t readRamSize(uint32_t *pui32RamSize);
|
||||||
|
uint32_t calculateRamSize(uint32_t ramSizeInfo);
|
||||||
|
uint32_t getBootloaderEnableAddress();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string getCmdString(uint32_t ui32Cmd);
|
||||||
|
uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0);
|
||||||
|
uint32_t cmdDownloadCrc(uint32_t ui32Address, uint32_t ui32Size, uint32_t uiCrc);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __SBL_DEVICE_CC2652_H__
|
||||||
66
feeds/bluetooth-cc2652/cc2652/src/sbl_eb_info.h
Executable file
66
feeds/bluetooth-cc2652/cc2652/src/sbl_eb_info.h
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
#ifndef __SBL_EB_INFO_H__
|
||||||
|
#define __SBL_EB_INFO_H__
|
||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbl_eb_info.h
|
||||||
|
* Revised: $Date: 2013-07-09 15:06:47 +0200 (Tue, 09 Jul 2013) $
|
||||||
|
* Revision: $Revision: 26800 $
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader EB info class header file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 <string.h>
|
||||||
|
|
||||||
|
class SblEbInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
DEVICE_NAME_SIZE = 15,
|
||||||
|
EB_PORT_SIZE = 16,
|
||||||
|
DESCRIPTION_SIZE = 256
|
||||||
|
};
|
||||||
|
|
||||||
|
char ebPort[EB_PORT_SIZE]; // E.g. COM42
|
||||||
|
char ebDescription[DESCRIPTION_SIZE];
|
||||||
|
char devName[DEVICE_NAME_SIZE]; // E.g. CC2538 for CC2650
|
||||||
|
|
||||||
|
SblEbInfo& operator = (const SblEbInfo& other) {
|
||||||
|
strncpy(ebPort, other.ebPort, EB_PORT_SIZE);
|
||||||
|
strncpy(ebDescription, other.ebDescription, DESCRIPTION_SIZE);
|
||||||
|
strncpy(devName, other.devName, DEVICE_NAME_SIZE);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __SBL_EB_INFO_H__
|
||||||
39
feeds/bluetooth-cc2652/cc2652/src/sbllib.cpp
Executable file
39
feeds/bluetooth-cc2652/cc2652/src/sbllib.cpp
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbllib.cpp
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader Library main file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
69
feeds/bluetooth-cc2652/cc2652/src/sbllib.h
Executable file
69
feeds/bluetooth-cc2652/cc2652/src/sbllib.h
Executable file
@@ -0,0 +1,69 @@
|
|||||||
|
#ifndef __SBLLIB_H__
|
||||||
|
#define __SBLLIB_H__
|
||||||
|
/******************************************************************************
|
||||||
|
* Filename: sbllib.h
|
||||||
|
* Revised: $Date$
|
||||||
|
* Revision: $Revision$
|
||||||
|
*
|
||||||
|
* Description: Serial Bootloader Library header file.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Neither the name of Texas Instruments Incorporated 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
|
||||||
|
* OWNER 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 <string>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "debug.h"
|
||||||
|
#define SBL_MAX_DEVICES 20
|
||||||
|
#define SBL_DEFAULT_RETRY_COUNT 1
|
||||||
|
#define SBL_DEFAULT_READ_TIMEOUT 100 // in ms
|
||||||
|
#define SBL_DEFAULT_WRITE_TIMEOUT 200 // in ms
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
SBL_SUCCESS = 0,
|
||||||
|
SBL_ERROR,
|
||||||
|
SBL_ARGUMENT_ERROR,
|
||||||
|
SBL_TIMEOUT_ERROR,
|
||||||
|
SBL_PORT_ERROR,
|
||||||
|
SBL_ENUM_ERROR,
|
||||||
|
SBL_UNSUPPORTED_FUNCTION,
|
||||||
|
} tSblStatus;
|
||||||
|
|
||||||
|
#include "serialib.h"
|
||||||
|
#include "sbl_device.h"
|
||||||
|
#include "sbl_device_cc2538.h"
|
||||||
|
#include "sbl_device_cc2650.h"
|
||||||
|
#include "sbl_device_cc2652.h"
|
||||||
|
#include "sbl_eb_info.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __SBLLIB_H__
|
||||||
1019
feeds/bluetooth-cc2652/cc2652/src/serialib.cpp
Executable file
1019
feeds/bluetooth-cc2652/cc2652/src/serialib.cpp
Executable file
File diff suppressed because it is too large
Load Diff
220
feeds/bluetooth-cc2652/cc2652/src/serialib.h
Executable file
220
feeds/bluetooth-cc2652/cc2652/src/serialib.h
Executable file
@@ -0,0 +1,220 @@
|
|||||||
|
/*!
|
||||||
|
\file serialib.h
|
||||||
|
\brief Header file of the class serialib. This class is used for communication over a serial device.
|
||||||
|
\author Philippe Lucidarme (University of Angers)
|
||||||
|
\version 2.0
|
||||||
|
\date december the 27th of 2019
|
||||||
|
This Serial library is used to communicate through serial port.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
This is a licence-free software, it can be used by anyone who try to build a better world.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SERIALIB_H
|
||||||
|
#define SERIALIB_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Used for TimeOut operations
|
||||||
|
#include <sys/time.h>
|
||||||
|
// Include for windows
|
||||||
|
#if defined (_WIN32) || defined (_WIN64)
|
||||||
|
// Accessing to the serial port under Windows
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Include for Linux
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/shm.h>
|
||||||
|
#include <termios.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <iostream>
|
||||||
|
// File control definitions
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <vector>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*! To avoid unused parameters */
|
||||||
|
#define UNUSED(x) (void)(x)
|
||||||
|
|
||||||
|
|
||||||
|
/*! \class serialib
|
||||||
|
\brief This class is used for communication over a serial device.
|
||||||
|
*/
|
||||||
|
class serialib
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//_____________________________________
|
||||||
|
// ::: Constructors and destructors :::
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Constructor of the class
|
||||||
|
serialib ();
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
~serialib ();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//_________________________________________
|
||||||
|
// ::: Configuration and initialization :::
|
||||||
|
|
||||||
|
|
||||||
|
// Open a device
|
||||||
|
char openDevice (const char *Device,const unsigned int Bauds);
|
||||||
|
|
||||||
|
// Close the current device
|
||||||
|
void closeDevice();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//___________________________________________
|
||||||
|
// ::: Read/Write operation on characters :::
|
||||||
|
|
||||||
|
|
||||||
|
// Write a char
|
||||||
|
char writeChar (char);
|
||||||
|
|
||||||
|
// Read a char (with timeout)
|
||||||
|
char readChar (char *pByte,const unsigned int timeOut_ms=0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//________________________________________
|
||||||
|
// ::: Read/Write operation on strings :::
|
||||||
|
|
||||||
|
|
||||||
|
// Write a string
|
||||||
|
char writeString (const char *String);
|
||||||
|
|
||||||
|
// Read a string (with timeout)
|
||||||
|
int readString ( char *receivedString,
|
||||||
|
char finalChar,
|
||||||
|
unsigned int maxNbBytes,
|
||||||
|
const unsigned int timeOut_ms=0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// _____________________________________
|
||||||
|
// ::: Read/Write operation on bytes :::
|
||||||
|
|
||||||
|
|
||||||
|
// Write an array of bytes
|
||||||
|
int writeBytes (const void *Buffer, const unsigned int NbBytes);
|
||||||
|
|
||||||
|
// Read an array of byte (with timeout)
|
||||||
|
int readBytes (void *buffer,unsigned int maxNbBytes,const unsigned int timeOut_ms=100, unsigned int sleepDuration_us=100);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// _________________________
|
||||||
|
// ::: Special operation :::
|
||||||
|
|
||||||
|
|
||||||
|
// Empty the received buffer
|
||||||
|
char flushReceiver();
|
||||||
|
|
||||||
|
// Return the number of bytes in the received buffer
|
||||||
|
int available();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// _________________________
|
||||||
|
// ::: Access to IO bits :::
|
||||||
|
|
||||||
|
|
||||||
|
// Set CTR status (Data Terminal Ready, pin 4)
|
||||||
|
bool DTR(bool status);
|
||||||
|
bool setDTR();
|
||||||
|
bool clearDTR();
|
||||||
|
|
||||||
|
// Set RTS status (Request To Send, pin 7)
|
||||||
|
bool RTS(bool status);
|
||||||
|
bool setRTS();
|
||||||
|
bool clearRTS();
|
||||||
|
|
||||||
|
// Get RI status (Ring Indicator, pin 9)
|
||||||
|
bool isRI();
|
||||||
|
|
||||||
|
// Get DCD status (Data Carrier Detect, pin 1)
|
||||||
|
bool isDCD();
|
||||||
|
|
||||||
|
// Get CTS status (Clear To Send, pin 8)
|
||||||
|
bool isCTS();
|
||||||
|
|
||||||
|
// Get DSR status (Data Set Ready, pin 9)
|
||||||
|
bool isDSR();
|
||||||
|
|
||||||
|
// Get RTS status (Request To Send, pin 7)
|
||||||
|
bool isRTS();
|
||||||
|
|
||||||
|
// Get CTR status (Data Terminal Ready, pin 4)
|
||||||
|
bool isDTR();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Read a string (no timeout)
|
||||||
|
int readStringNoTimeOut (char *String,char FinalChar,unsigned int MaxNbBytes);
|
||||||
|
|
||||||
|
// Current DTR and RTS state (can't be read on WIndows)
|
||||||
|
bool currentStateRTS;
|
||||||
|
bool currentStateDTR;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (_WIN32) || defined( _WIN64)
|
||||||
|
// Handle on serial device
|
||||||
|
HANDLE hSerial;
|
||||||
|
// For setting serial port timeouts
|
||||||
|
COMMTIMEOUTS timeouts;
|
||||||
|
#endif
|
||||||
|
#ifdef __linux__
|
||||||
|
int fd;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*! \class timeOut
|
||||||
|
\brief This class can manage a timer which is used as a timeout.
|
||||||
|
*/
|
||||||
|
// Class timeOut
|
||||||
|
class timeOut
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
timeOut();
|
||||||
|
|
||||||
|
// Init the timer
|
||||||
|
void initTimer();
|
||||||
|
|
||||||
|
// Return the elapsed time since initialization
|
||||||
|
unsigned long int elapsedTime_ms();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Used to store the previous time (for computing timeout)
|
||||||
|
struct timeval previousTime;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // serialib_H
|
||||||
162
feeds/bluetooth-csr/bluez/Makefile
Normal file
162
feeds/bluetooth-csr/bluez/Makefile
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2006-2016 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=bluez
|
||||||
|
PKG_VERSION:=5.37
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
|
PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
|
||||||
|
PKG_MD5SUM:=33177e5743e24b2b3738f72be64e3ffb
|
||||||
|
|
||||||
|
PKG_LICENSE:=GPL-2.0+
|
||||||
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
|
||||||
|
|
||||||
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/nls.mk
|
||||||
|
|
||||||
|
define Package/bluez/Default
|
||||||
|
TITLE:=Bluetooth
|
||||||
|
URL:=http://www.bluez.org/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-examples
|
||||||
|
$(call Package/bluez/Default)
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE+= python example apps
|
||||||
|
DEPENDS:=
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-examples/description
|
||||||
|
contains many examples apps for bluetooth, requiring python
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-libs
|
||||||
|
$(call Package/bluez/Default)
|
||||||
|
SECTION:=libs
|
||||||
|
CATEGORY:=Libraries
|
||||||
|
TITLE+= library
|
||||||
|
DEPENDS:=+libpthread +kmod-bluetooth
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-utils
|
||||||
|
$(call Package/bluez/Default)
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE+= utilities
|
||||||
|
DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-daemon
|
||||||
|
$(call Package/bluez/Default)
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE+= daemon
|
||||||
|
DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-daemon/conffiles
|
||||||
|
/etc/bluetooth/main.conf
|
||||||
|
/etc/bluetooth/network.conf
|
||||||
|
/etc/bluetooth/input.conf
|
||||||
|
/etc/bluetooth/proximity.conf
|
||||||
|
/etc/config/bluetooth
|
||||||
|
endef
|
||||||
|
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--enable-static \
|
||||||
|
--enable-shared \
|
||||||
|
--enable-client \
|
||||||
|
--enable-datafiles \
|
||||||
|
--enable-experimental \
|
||||||
|
--enable-library \
|
||||||
|
--enable-monitor \
|
||||||
|
--enable-obex \
|
||||||
|
--enable-threads \
|
||||||
|
--enable-tools \
|
||||||
|
--disable-android \
|
||||||
|
--disable-cups \
|
||||||
|
--disable-manpages \
|
||||||
|
--disable-sixaxis \
|
||||||
|
--disable-systemd \
|
||||||
|
--disable-test \
|
||||||
|
--disable-udev \
|
||||||
|
|
||||||
|
TARGET_CPPFLAGS += \
|
||||||
|
-D_GNU_SOURCE
|
||||||
|
|
||||||
|
define Build/InstallDev
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-examples/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin/bluez
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-libs/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-utils/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/bluez-daemon/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
|
||||||
|
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
|
||||||
|
$(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
|
||||||
|
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
|
||||||
|
$(INSTALL_BIN) ./files/bluez-bccmd.init $(1)/etc/init.d/bluez-bccmd
|
||||||
|
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||||
|
$(INSTALL_DATA) ./files/csr8x11-a12-bt4.2-patch.psr $(1)/etc/bluetooth/
|
||||||
|
$(INSTALL_DATA) ./files/csr8x11-coex.psr $(1)/etc/bluetooth/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,bluez-examples))
|
||||||
|
$(eval $(call BuildPackage,bluez-libs))
|
||||||
|
$(eval $(call BuildPackage,bluez-utils))
|
||||||
|
$(eval $(call BuildPackage,bluez-daemon))
|
||||||
15
feeds/bluetooth-csr/bluez/files/bluetooth.config
Normal file
15
feeds/bluetooth-csr/bluez/files/bluetooth.config
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
config bluetoothd
|
||||||
|
# option config /etc/bluetooth/main.conf
|
||||||
|
option enabled 1
|
||||||
|
|
||||||
|
config hciattach
|
||||||
|
option initspeed 115200
|
||||||
|
option tty ttyS1
|
||||||
|
option type csr
|
||||||
|
option speed 115200
|
||||||
|
option flow noflow
|
||||||
|
option enabled 0
|
||||||
|
|
||||||
|
config rfcomm
|
||||||
|
# option config /etc/bluetooth/rfcomm.conf
|
||||||
|
option enabled 0
|
||||||
37
feeds/bluetooth-csr/bluez/files/bluetooth.dbus
Normal file
37
feeds/bluetooth-csr/bluez/files/bluetooth.dbus
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<!-- This configuration file specifies the required security policies
|
||||||
|
for Bluetooth core daemon to work. -->
|
||||||
|
|
||||||
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
|
||||||
|
<!-- ../system.conf have denied everything, so we just punch some holes -->
|
||||||
|
|
||||||
|
<policy user="root">
|
||||||
|
<allow own="org.bluez"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
<policy at_console="true">
|
||||||
|
<allow send_path="/"/>
|
||||||
|
<allow send_path="/org/bluez"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.bluez.Manager"/>
|
||||||
|
<allow receive_sender="org.bluez.Manager"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.bluez.Adapter"/>
|
||||||
|
<allow receive_sender="org.bluez.Adapter"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.bluez.Device"/>
|
||||||
|
<allow receive_sender="org.bluez.Device"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.bluez.Service"/>
|
||||||
|
<allow receive_sender="org.bluez.Service"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.bluez.Database"/>
|
||||||
|
<allow receive_sender="org.bluez.Database"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.bluez.Security"/>
|
||||||
|
<allow receive_sender="org.bluez.Security"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
</busconfig>
|
||||||
13
feeds/bluetooth-csr/bluez/files/bluetoothd.init
Normal file
13
feeds/bluetooth-csr/bluez/files/bluetoothd.init
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (C) 2007 OpenWrt.org
|
||||||
|
|
||||||
|
#start after dbus (60)
|
||||||
|
START=62
|
||||||
|
USE_PROCD=1
|
||||||
|
PROG=/usr/bin/bluetoothd
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG" -n
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
43
feeds/bluetooth-csr/bluez/files/bluez-bccmd.init
Normal file
43
feeds/bluetooth-csr/bluez/files/bluez-bccmd.init
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
. /lib/ar71xx.sh
|
||||||
|
|
||||||
|
START=63
|
||||||
|
|
||||||
|
bt_up(){
|
||||||
|
hciconfig hci0 up
|
||||||
|
|
||||||
|
count=5
|
||||||
|
while [ $count -gt 0 ]
|
||||||
|
do
|
||||||
|
if hciconfig hci0 lestates >/dev/null; then
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
let count=$count-1
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $count -eq 0 ];then
|
||||||
|
echo "Failed to enable hci0" >> /tmp/log/bccmd
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
bccmd_init_csr8x11() {
|
||||||
|
bt_up
|
||||||
|
bccmd -t hci -d hci0 psload /etc/bluetooth/csr8x11-a12-bt4.2-patch.psr
|
||||||
|
bccmd -t hci -d hci0 psload /etc/bluetooth/csr8x11-coex.psr
|
||||||
|
bccmd -t hci -d hci0 warmreset
|
||||||
|
bt_up
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
board_name=$(ar71xx_board_name)
|
||||||
|
|
||||||
|
case "$board_name" in
|
||||||
|
cus531mp3|\
|
||||||
|
cus531mp3-dual|\
|
||||||
|
cus531mp3-nand)
|
||||||
|
bccmd_init_csr8x11
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
50
feeds/bluetooth-csr/bluez/files/csr8x11-a12-bt4.2-patch.psr
Executable file
50
feeds/bluetooth-csr/bluez/files/csr8x11-a12-bt4.2-patch.psr
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
// explicit, PSKEY_HCI_LMP_LOCAL_VERSION (0x010d, 269), 1 words
|
||||||
|
&010d = 0808
|
||||||
|
|
||||||
|
// explicit, PSKEY_LMP_REMOTE_VERSION (0x010e, 270), 1 words
|
||||||
|
&010e = 0008
|
||||||
|
|
||||||
|
// patch_hardware_0, PSKEY_PATCH50 (0x212c, 8492), 56 words
|
||||||
|
&212c = 0000 f001 0617 0513 0118 ff2b ff0e 1a00 2818 009e 081b f100 8888 24f0 f925 f821 0a17 0184 0cf0 0117 0013 0009 02a4 fb25 fa21 f915 f811 fb55 fa61 09e0 ff84 10f0 0117 0013 0009 02a4 f935 f841 f925 f821 0f1b 0712 10a4 0494 0712 e151 0722 f915 f811 0018 ff2b ff0e f000 0518 00e2 5a79
|
||||||
|
|
||||||
|
// patch_hardware_1, PSKEY_PATCH51 (0x212d, 8493), 21 words
|
||||||
|
&212d = 0002 968a 0863 f925 f821 0757 0663 e099 02ec 05e0 f915 0727 f815 0627 0218 ff2b ff0e 9700 8d18 00e2 7e34
|
||||||
|
|
||||||
|
// patch_hardware_2, PSKEY_PATCH52 (0x212e, 8494), 16 words
|
||||||
|
&212e = 0002 0b5a 0100 7834 0040 0327 0223 f815 e311 0218 ff2b ff0e 0b00 5e18 00e2 59c1
|
||||||
|
|
||||||
|
// patch_hardware_3, PSKEY_PATCH53 (0x212f, 8495), 17 words
|
||||||
|
&212f = 0000 7315 0084 04f0 0800 0014 03e0 f800 1215 0b27 0018 ff2b ff0e 7300 1818 00e2 0549
|
||||||
|
|
||||||
|
// patch_hardware_4, PSKEY_PATCH54 (0x2130, 8496), 21 words
|
||||||
|
&2130 = 0001 53f8 0817 0e27 0c00 6384 07f0 0118 ff2b ff0e 5400 0918 00e2 0917 0118 ff2b ff0e 5400 fb18 00e2 91f6
|
||||||
|
|
||||||
|
// patch_hardware_5, PSKEY_PATCH55 (0x2131, 8497), 49 words
|
||||||
|
&2131 = 0002 c0d5 0423 05f4 031b 0012 0280 1df0 021b 0916 1000 00c4 1ef0 0916 03c4 1bf4 031b 0012 0280 17f4 0380 15f4 0480 13f4 0580 11f4 0680 0ff4 0b80 0df4 0d80 0bf4 019c fb00 6719 0d9e 0218 ff2b ff0e c200 8c18 00e2 0218 ff2b ff0e c100 de18 00e2 c5cf
|
||||||
|
|
||||||
|
// patch_hardware_6, PSKEY_PATCH56 (0x2132, 8498), 42 words
|
||||||
|
&2132 = 0003 243f f40b 0827 0923 e019 0916 01b4 0926 0318 ff2b ff0e 2400 4218 00e2 fa0b 3d14 0327 0114 0227 0014 0127 0027 081b 0816 0218 ff2b ff0e f700 fd18 009e e111 081b 0816 0218 ff2b ff0e 3300 ff18 009e fa0f 40f2
|
||||||
|
|
||||||
|
// patch_hardware_7, PSKEY_PATCH57 (0x2133, 8499), 23 words
|
||||||
|
&2133 = 0003 254e 02c0 0916 1000 00c4 02f4 02b0 0916 fec4 e1b1 0922 0816 0318 ff2b ff0e 2500 5218 8000 00c0 08f2 00e2 e402
|
||||||
|
|
||||||
|
// patch_hardware_8, PSKEY_PATCH58 (0x2134, 8500), 16 words
|
||||||
|
&2134 = 0003 21ca fa0b 0227 0323 e019 0916 01b4 0926 0318 ff2b ff0e 2200 cd18 00e2 22dc
|
||||||
|
|
||||||
|
// patch_hardware_9, PSKEY_PATCH59 (0x2135, 8501), 18 words
|
||||||
|
&2135 = 0000 55e2 09f4 0218 ff2b ff0e 2c00 a718 009e 0314 fc0f 0018 ff2b ff0e 5600 0118 00e2 a008
|
||||||
|
|
||||||
|
// patch_hardware_10, PSKEY_PATCH60 (0x2136, 8502), 30 words
|
||||||
|
&2136 = 0004 0d80 1aa4 0418 ff2b ff0e 1d00 ba18 009e 0184 0d2c 0013 8f00 89d0 0117 bf00 d6d4 0318 ff2b ff0e 2700 4218 009e 0418 ff2b ff0e 0e00 8418 00e2 6855
|
||||||
|
|
||||||
|
// patch_hardware_11, PSKEY_PATCH61 (0x2137, 8503), 22 words
|
||||||
|
&2137 = 0002 4da5 0118 ff2b ff0e 6200 c518 009e 031b 2b22 fcc4 2c26 0114 e700 f025 0218 ff2b ff0e 4e00 a818 00e2 8dfc
|
||||||
|
|
||||||
|
// patch_sched_get_or_peek_message, PSKEY_PATCH123 (0x220b, 8715), 49 words
|
||||||
|
&220b = fa0b 0717 0484 2cf0 0617 0690 e119 0c00 d438 041a 001a 022b 23f4 0116 0184 20f0 0216 0327 1df4 e119 0016 0784 19f0 e500 ab15 8000 0054 0100 c018 ff2b fe27 0317 ff0e fe9f e199 0cf4 7d00 f214 0127 0014 0027 0317 000e 019f 0014 021b 0226 fa0f 8392
|
||||||
|
|
||||||
|
// patch_spare1, PSKEY_PATCH155 (0x222b, 8747), 60 words
|
||||||
|
&222b = e70b 1627 a100 8514 0227 0214 0127 6b00 d814 0427 0214 0327 0417 fe27 0317 ff27 1613 0230 0814 0027 e415 0534 ff0e fe9f 0513 0009 01a4 e015 7fc4 7f84 1bf0 0617 1584 18f0 161b 0116 010e 029f e119 049a 11f4 0116 4184 0ef0 e500 ac11 8000 0050 0100 c014 ff27 fe23 0816 ff0e fe9f 0114 02e0 0014 e70f 4d65
|
||||||
|
|
||||||
|
// patch_spare2, PSKEY_PATCH156 (0x222c, 8748), 40 words
|
||||||
|
&222c = f40b 0927 2900 d414 0427 0314 0327 3500 ea14 0627 0314 0527 2900 9614 0827 0414 0727 0917 0110 070e 089f 0917 030e 049f 0617 fe27 0517 ff27 7f14 0027 1514 0127 2a14 0227 0114 0913 ff0e fe9f f40f 3478
|
||||||
38
feeds/bluetooth-csr/bluez/files/csr8x11-coex.psr
Executable file
38
feeds/bluetooth-csr/bluez/files/csr8x11-coex.psr
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
// Set the crystal frequency to 26MHz
|
||||||
|
&01fe = 6590
|
||||||
|
|
||||||
|
// PSKEY_COEX_SCHEME
|
||||||
|
// 7 = Use Unity-e.
|
||||||
|
&2480 = 0007
|
||||||
|
|
||||||
|
// Signal Configuration
|
||||||
|
// --------------------
|
||||||
|
// PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE
|
||||||
|
// BT_ACTIVE (PIO=0, polarity=active high)
|
||||||
|
&2483 = 0000 0001
|
||||||
|
|
||||||
|
// PSKEY_COEX_PIO_UNITY_3_BT_STATUS
|
||||||
|
// BT_STATUS (PIO=5, polarity=active high)
|
||||||
|
&2484 = 0005 0001
|
||||||
|
|
||||||
|
// PSKEY_COEX_PIO_UNITY_3_WLAN_DENY
|
||||||
|
// WLAN_DENY (PIO=1, polarity=active high)
|
||||||
|
&2485 = 0001 0001
|
||||||
|
|
||||||
|
// Priority Configuration
|
||||||
|
// ----------------------
|
||||||
|
// PSKEY_coex_transaction_priority_table
|
||||||
|
&2488 = 0000 0000 0000 0000 0000 0001 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001
|
||||||
|
|
||||||
|
// PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE
|
||||||
|
&2493 = 0000 0000 0000 0000 0000 0000 0000 0000 0001 0001 0001 0000 0000 0000 0000 0001
|
||||||
|
|
||||||
|
// PSKEY_COEX_UNITY_EXPRESS_TIMINGS
|
||||||
|
// BT_ACTIVE lead time - 20 us
|
||||||
|
// BT_STATUS lead time - 12 us
|
||||||
|
&248a = 0014 000c
|
||||||
|
|
||||||
|
|
||||||
|
//Disable clock request on PIO2
|
||||||
|
&0246 = 0000
|
||||||
|
|
||||||
14
feeds/bluetooth-csr/bluez/files/givepin
Normal file
14
feeds/bluetooth-csr/bluez/files/givepin
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Write bluetooth PIN number here:
|
||||||
|
pin=
|
||||||
|
|
||||||
|
if [ -z "$pin" ]; then
|
||||||
|
msg="Set bluetooth PIN in file $0"
|
||||||
|
logger -p user.err "$msg"
|
||||||
|
for i in /dev/pts/* ; do
|
||||||
|
[ -w $i ] && echo "$msg" > $i
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "PIN:$pin"
|
||||||
|
fi
|
||||||
40
feeds/bluetooth-csr/bluez/patches/200-uart-speed.patch
Normal file
40
feeds/bluetooth-csr/bluez/patches/200-uart-speed.patch
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
--- a/tools/hciattach.c
|
||||||
|
+++ b/tools/hciattach.c
|
||||||
|
@@ -101,20 +101,37 @@ int uart_speed(int s)
|
||||||
|
return B230400;
|
||||||
|
case 460800:
|
||||||
|
return B460800;
|
||||||
|
+/* FIX: Not all platform support this high serial speed
|
||||||
|
+ claudyus84 @gamil.com
|
||||||
|
+*/
|
||||||
|
+#ifdef B500000
|
||||||
|
case 500000:
|
||||||
|
return B500000;
|
||||||
|
+#endif
|
||||||
|
+#ifdef B576000
|
||||||
|
case 576000:
|
||||||
|
return B576000;
|
||||||
|
+#endif
|
||||||
|
+#ifdef B921600
|
||||||
|
case 921600:
|
||||||
|
return B921600;
|
||||||
|
+#endif
|
||||||
|
+#ifdef B1000000
|
||||||
|
case 1000000:
|
||||||
|
return B1000000;
|
||||||
|
+#endif
|
||||||
|
+#ifdef B1152000
|
||||||
|
case 1152000:
|
||||||
|
return B1152000;
|
||||||
|
+#endif
|
||||||
|
+#ifdef B1500000
|
||||||
|
case 1500000:
|
||||||
|
return B1500000;
|
||||||
|
+#endif
|
||||||
|
+#ifdef B2000000
|
||||||
|
case 2000000:
|
||||||
|
return B2000000;
|
||||||
|
+#endif
|
||||||
|
#ifdef B2500000
|
||||||
|
case 2500000:
|
||||||
|
return B2500000;
|
||||||
48
feeds/bluetooth-csr/bluez/patches/201-readline.patch
Normal file
48
feeds/bluetooth-csr/bluez/patches/201-readline.patch
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
--- a/Makefile.in
|
||||||
|
+++ b/Makefile.in
|
||||||
|
@@ -2441,7 +2441,7 @@ unit_tests = $(am__append_35) unit/test-
|
||||||
|
@CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c
|
||||||
|
|
||||||
|
@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \
|
||||||
|
-@CLIENT_TRUE@ -lreadline
|
||||||
|
+@CLIENT_TRUE@ -lreadline -lncurses
|
||||||
|
|
||||||
|
@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
|
||||||
|
@MONITOR_TRUE@ monitor/display.h monitor/display.c \
|
||||||
|
@@ -2691,13 +2691,13 @@ unit_tests = $(am__append_35) unit/test-
|
||||||
|
@READLINE_TRUE@ client/display.h
|
||||||
|
|
||||||
|
@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
|
||||||
|
-@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline
|
||||||
|
+@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \
|
||||||
|
@READLINE_TRUE@ tools/obex-client-tool.c
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
|
||||||
|
-@READLINE_TRUE@ @GLIB_LIBS@ -lreadline
|
||||||
|
+@READLINE_TRUE@ @GLIB_LIBS@ -lreadline -lncurses
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
|
||||||
|
@READLINE_TRUE@ tools/obex-server-tool.c
|
||||||
|
@@ -2707,17 +2707,17 @@ unit_tests = $(am__append_35) unit/test-
|
||||||
|
@READLINE_TRUE@ client/display.h client/display.c
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
|
||||||
|
-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
|
||||||
|
+@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \
|
||||||
|
@READLINE_TRUE@ client/display.h client/display.c
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \
|
||||||
|
-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
|
||||||
|
+@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
|
||||||
|
|
||||||
|
@READLINE_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c
|
||||||
|
@READLINE_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
|
||||||
|
-@READLINE_TRUE@ -lreadline
|
||||||
|
+@READLINE_TRUE@ -lreadline -lncurses
|
||||||
|
|
||||||
|
@EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c
|
||||||
|
@EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
--- a/profiles/audio/a2dp-codecs.h
|
||||||
|
+++ b/profiles/audio/a2dp-codecs.h
|
||||||
|
@@ -234,6 +234,11 @@ typedef struct {
|
||||||
|
uint8_t channel_mode:4;
|
||||||
|
} __attribute__ ((packed)) a2dp_aptx_t;
|
||||||
|
|
||||||
|
+typedef struct {
|
||||||
|
+ a2dp_vendor_codec_t info;
|
||||||
|
+ uint8_t unknown[2];
|
||||||
|
+} __attribute__ ((packed)) a2dp_ldac_t;
|
||||||
|
+
|
||||||
|
#else
|
||||||
|
#error "Unknown byte order"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
--- a/tools/bccmd.c
|
||||||
|
+++ b/tools/bccmd.c
|
||||||
|
@@ -48,7 +48,7 @@
|
||||||
|
#define CSR_STORES_PSF (0x0002)
|
||||||
|
#define CSR_STORES_PSROM (0x0004)
|
||||||
|
#define CSR_STORES_PSRAM (0x0008)
|
||||||
|
-#define CSR_STORES_DEFAULT (CSR_STORES_PSI | CSR_STORES_PSF)
|
||||||
|
+#define CSR_STORES_DEFAULT 0
|
||||||
|
|
||||||
|
#define CSR_TYPE_NULL 0
|
||||||
|
#define CSR_TYPE_COMPLEX 1
|
||||||
|
--
|
||||||
|
2.1.4
|
||||||
|
|
||||||
93
feeds/bluetooth-csr/bluez/patches/204-Add-PIO32-setting-oparation.patch
Executable file
93
feeds/bluetooth-csr/bluez/patches/204-Add-PIO32-setting-oparation.patch
Executable file
@@ -0,0 +1,93 @@
|
|||||||
|
diff --git a/tools/bccmd.c b/tools/bccmd.c
|
||||||
|
old mode 100644
|
||||||
|
new mode 100755
|
||||||
|
index 6bc28da..1605d1c
|
||||||
|
--- a/tools/bccmd.c
|
||||||
|
+++ b/tools/bccmd.c
|
||||||
|
@@ -636,6 +636,78 @@ static int opt_pskey(int argc, char *argv[], uint16_t *stores, int *reset, int *
|
||||||
|
return optind;
|
||||||
|
}
|
||||||
|
|
||||||
|
+int inline serialize_u32(uint8_t *array, uint32_t val32)
|
||||||
|
+{
|
||||||
|
+ if (NULL == array)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ array[0] = (val32 & 0xff0000) >> 16;
|
||||||
|
+ array[1] = val32 >> 24;
|
||||||
|
+ array[2] = val32 & 0xff;
|
||||||
|
+ array[3] = (val32 & 0xff00) >> 8;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int inline deserialize_u32(uint8_t *array, uint32_t *pval32)
|
||||||
|
+{
|
||||||
|
+ if (NULL == array || NULL == pval32)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ *pval32 = (array[1]<<24)
|
||||||
|
+ | (array[0]<<16)
|
||||||
|
+ | (array[3]<<8)
|
||||||
|
+ | array[2];
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int setpio32(int transport, uint32_t varID, uint32_t mask, uint32_t bits)
|
||||||
|
+{
|
||||||
|
+ uint8_t array[32];
|
||||||
|
+ uint8_t *ptr = NULL;
|
||||||
|
+ uint32_t result = 0;
|
||||||
|
+ int err;
|
||||||
|
+
|
||||||
|
+ memset(array, 0, sizeof(array));
|
||||||
|
+ ptr = array;
|
||||||
|
+
|
||||||
|
+ serialize_u32(ptr, mask);
|
||||||
|
+ ptr += 4;
|
||||||
|
+
|
||||||
|
+ serialize_u32(ptr, bits);
|
||||||
|
+
|
||||||
|
+ err = transport_write(transport, varID, array, 12);
|
||||||
|
+ if (err < 0)
|
||||||
|
+ return err;
|
||||||
|
+
|
||||||
|
+ deserialize_u32(&array[8], &result);
|
||||||
|
+ printf("result: 0x%x\n", result);
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static int cmd_pio32set(int transport, int argc, char *argv[])
|
||||||
|
+{
|
||||||
|
+ uint32_t varID;
|
||||||
|
+ uint32_t mask;
|
||||||
|
+ uint32_t bits;
|
||||||
|
+
|
||||||
|
+ argc--;
|
||||||
|
+ argv++;
|
||||||
|
+
|
||||||
|
+ if (3 != argc)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ varID = strtol(argv[0] + 2, NULL, 16);
|
||||||
|
+ mask = strtol(argv[1] + 2, NULL, 16);
|
||||||
|
+ bits = strtol(argv[2] + 2, NULL, 16);
|
||||||
|
+
|
||||||
|
+ return setpio32(transport, varID, mask, bits);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
#define OPT_PSKEY(min, max, stores, reset, help) \
|
||||||
|
opt_pskey(argc, argv, (stores), (reset), (help)); \
|
||||||
|
argc -= optind; argv += optind; optind = 0; \
|
||||||
|
@@ -1112,6 +1184,7 @@ static struct {
|
||||||
|
{ "psread", cmd_psread, NULL, "Read all PS keys" },
|
||||||
|
{ "psload", cmd_psload, "<file>", "Load all PS keys from PSR file" },
|
||||||
|
{ "pscheck", cmd_pscheck, "<file>", "Check PSR file" },
|
||||||
|
+ { "pio32set", cmd_pio32set, "<VarID> <mask> <bits>","Set value for PIO32 register" },
|
||||||
|
{ "adc", cmd_adc, "<mux>", "Read ADC value of <mux> input" },
|
||||||
|
{ NULL }
|
||||||
|
};
|
||||||
50
feeds/bluetooth-csr/bluez/patches/205-Support-full-radio-test.patch
Executable file
50
feeds/bluetooth-csr/bluez/patches/205-Support-full-radio-test.patch
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
diff --git a/tools/bccmd.c b/tools/bccmd.c
|
||||||
|
index 1605d1c..5655bb5 100755
|
||||||
|
--- a/tools/bccmd.c
|
||||||
|
+++ b/tools/bccmd.c
|
||||||
|
@@ -555,6 +555,37 @@ static int cmd_radiotest(int transport, int argc, char *argv[])
|
||||||
|
return transport_write(transport, CSR_VARID_RADIOTEST, array, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int cmd_fullradiotest(int transport, int argc, char *argv[])
|
||||||
|
+{
|
||||||
|
+ uint8_t array[8];
|
||||||
|
+ uint16_t testID;
|
||||||
|
+ uint16_t word1;
|
||||||
|
+ uint16_t word2;
|
||||||
|
+ uint16_t word3;
|
||||||
|
+
|
||||||
|
+ OPT_HELP(4, NULL);
|
||||||
|
+
|
||||||
|
+ testID = atoi(argv[0]);
|
||||||
|
+ word1 = atoi(argv[1]);
|
||||||
|
+ word2 = atoi(argv[2]);
|
||||||
|
+ word3 = atoi(argv[3]);
|
||||||
|
+
|
||||||
|
+ printf("TestID %u, word1 %u, word2 %u, word3 %u\n",
|
||||||
|
+ testID, word1, word2, word3);
|
||||||
|
+
|
||||||
|
+ memset(array, 0, sizeof(array));
|
||||||
|
+ array[0] = testID & 0xff;
|
||||||
|
+ array[1] = testID >> 8;
|
||||||
|
+ array[2] = word1 & 0xff;
|
||||||
|
+ array[3] = word1 >> 8;
|
||||||
|
+ array[4] = word2 & 0xff;
|
||||||
|
+ array[5] = word2 >> 8;
|
||||||
|
+ array[6] = word3 & 0xff;
|
||||||
|
+ array[7] = word3 >> 8;
|
||||||
|
+
|
||||||
|
+ return transport_write(transport, CSR_VARID_RADIOTEST, array, 8);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int cmd_memtypes(int transport, int argc, char *argv[])
|
||||||
|
{
|
||||||
|
uint8_t array[8];
|
||||||
|
@@ -1176,6 +1207,7 @@ static struct {
|
||||||
|
{ "hoppingon", cmd_hoppingon, "", "Revert to channel hopping" },
|
||||||
|
{ "rttxdata1", cmd_rttxdata1, "<freq> <level>", "TXData1 radio test" },
|
||||||
|
{ "radiotest", cmd_radiotest, "<freq> <level> <id>", "Run radio tests" },
|
||||||
|
+ { "fullradiotest", cmd_fullradiotest,"<id> <w1> <w2> <w3>", "Run full radio tests" },
|
||||||
|
{ "memtypes", cmd_memtypes, NULL, "Get memory types" },
|
||||||
|
{ "psget", cmd_psget, "<key>", "Get value for PS key" },
|
||||||
|
{ "psset", cmd_psset, "<key> <value>", "Set value for PS key" },
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
Index: bluez-5.37/profiles/input/hog.c
|
||||||
|
===================================================================
|
||||||
|
--- bluez-5.37.orig/profiles/input/hog.c
|
||||||
|
+++ bluez-5.37/profiles/input/hog.c
|
||||||
|
@@ -107,8 +107,13 @@ static struct hog_device *hog_device_new
|
||||||
|
product, version);
|
||||||
|
|
||||||
|
dev = new0(struct hog_device, 1);
|
||||||
|
- dev->device = btd_device_ref(device);
|
||||||
|
dev->hog = bt_hog_new_default(name, vendor, product, version, prim);
|
||||||
|
+ if (!dev->hog) {
|
||||||
|
+ free(dev);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ dev->device = btd_device_ref(device);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: Remove attio callback and use .accept once using
|
||||||
|
@@ -189,6 +194,9 @@ static int hog_probe(struct btd_service
|
||||||
|
continue;
|
||||||
|
|
||||||
|
dev = hog_device_new(device, prim);
|
||||||
|
+ if (!dev)
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
btd_service_set_user_data(service, dev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
29
feeds/bluetooth-csr/csr8811/Makefile
Normal file
29
feeds/bluetooth-csr/csr8811/Makefile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=csr8811
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/csr8811
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=TIP CSR8811 support package
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile/Default
|
||||||
|
|
||||||
|
endef
|
||||||
|
Build/Compile = $(Build/Compile/Default)
|
||||||
|
|
||||||
|
define Package/csr8811/install
|
||||||
|
$(CP) ./files/* $(1)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,csr8811))
|
||||||
9
feeds/bluetooth-csr/csr8811/files/etc/init.d/csr8811
Executable file
9
feeds/bluetooth-csr/csr8811/files/etc/init.d/csr8811
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=80
|
||||||
|
|
||||||
|
boot() {
|
||||||
|
bccmd -t bcsp -b 115200 -d /dev/ttyMSM1 psload -r /lib/firmware/CSR8811/pb-207-csr8x11-rev8.psr
|
||||||
|
sleep 1
|
||||||
|
hciattach -s 115200 /dev/ttyMSM1 any 115200
|
||||||
|
}
|
||||||
@@ -0,0 +1,320 @@
|
|||||||
|
// =============================================================================
|
||||||
|
//
|
||||||
|
// Copyright (c) 2015 - 2017 Qualcomm Technologies International, Ltd.
|
||||||
|
// All Rights Reserved.
|
||||||
|
// Qualcomm Technologies International, Ltd. Confidential and Proprietary.
|
||||||
|
// report this in case of problems:
|
||||||
|
// $Revision: #8 $
|
||||||
|
// Built Mon Feb 20 11:33:32 2017 GMT
|
||||||
|
// Checked-in $DateTime: 2017/02/20 11:36:26 $
|
||||||
|
// $File: //depot/bc/gemini-a12/dev/patches/10520/pb-207.psr $
|
||||||
|
//
|
||||||
|
// Patch is for build 10520 gem_5hci_rom_bt4.1_gemA12_1407301204_dspm_encr128
|
||||||
|
//
|
||||||
|
// Issues patched: B-158094, B-169261, B-171616, B-174351, B-176411,
|
||||||
|
// B-179448, B-180762, B-184008, B-206751, B-208678,
|
||||||
|
// B-216310, B-220605, B-223811
|
||||||
|
//
|
||||||
|
// Documentation from pb-207.pb
|
||||||
|
// ----------------------------
|
||||||
|
//
|
||||||
|
// General purpose patch and PSKEY bundle for CSR8811
|
||||||
|
// and CSR8311 A12 BT4.2 (build ID 10520).
|
||||||
|
//
|
||||||
|
// Documentation from pb-173-common.pb
|
||||||
|
// -----------------------------------
|
||||||
|
//
|
||||||
|
// General patch bundle for Gemini-A12 (build ID 10520)
|
||||||
|
// Patches and keys in here should be common to all
|
||||||
|
// package variants.
|
||||||
|
//
|
||||||
|
// Documentation from report_bt4p2.pb
|
||||||
|
// ----------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-174351
|
||||||
|
//
|
||||||
|
// Report BT version 4.2
|
||||||
|
//
|
||||||
|
// Documentation from patch_ulp_adv_avg_to_calc.xap
|
||||||
|
// ------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-171616
|
||||||
|
//
|
||||||
|
// BlueCore can be configured through BCCMDVARID_BLE_CONFIG_ADV_RSSI_AVG_PARAM
|
||||||
|
// to report the advertising rssi average through LE ADVERTISING REPORT to the
|
||||||
|
// host for a given PEER LE device.
|
||||||
|
// For more information, See CS-317256-AN.
|
||||||
|
//
|
||||||
|
// If the BlueCore is unable to receive a LE ADVERTISING REPORT from the PEER
|
||||||
|
// before a configured average rssi supervision timeout, then the BlueCore
|
||||||
|
// should send a LE ADVERTISING REPORT with rssi value equal to -127 conveying
|
||||||
|
// that the PEER is out of the range; however, it fails to do this.
|
||||||
|
//
|
||||||
|
// Documentation from patch_ble_scan_deaf.xap
|
||||||
|
// ------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-158094
|
||||||
|
//
|
||||||
|
// When BlueCore is asked to do BLE scanning, it scans for a window
|
||||||
|
// approximately 2.5% shorter than asked for. Generally, this does
|
||||||
|
// not cause noticeable effects; sometimes BLE adverts can be missed
|
||||||
|
// making connection initialisation between two BLE devices take
|
||||||
|
// somewhat longer than expected. In pathological cases, especially
|
||||||
|
// if the scan window is long, connections may fail to be made entirely.
|
||||||
|
//
|
||||||
|
// Documentation from patch_usb_suspend_deep_sleep.xap
|
||||||
|
// ---------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-176411
|
||||||
|
//
|
||||||
|
// When BlueCore device is bus powered and is in USB suspend mode,
|
||||||
|
// the current consumption is approximately 8 mA which is higher
|
||||||
|
// than the expected current of 250 uA
|
||||||
|
//
|
||||||
|
// Documentation from patch_tx_if_reduction.xap
|
||||||
|
// --------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-169261
|
||||||
|
//
|
||||||
|
// When a BlueCore7 device is configured to use a +/-500 kHz transmit IF, this
|
||||||
|
// can be overridden and a +/-375 kHz IF used instead. This reduces the
|
||||||
|
// bandwidthof the transmit spectrum providing a greater margin in a Chinese
|
||||||
|
// regulatory test.
|
||||||
|
// Only transmit IFs of +/-500 kHz may be reduced; if BlueCore7 is configured to
|
||||||
|
// use a TX IF of +/-1 MHz IF that will remain unchanged.
|
||||||
|
//
|
||||||
|
// Documentation from coex_shutdown.xap
|
||||||
|
// ------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-208678
|
||||||
|
//
|
||||||
|
// With Coexistence Unity-3 scheme, If the WLAN_DENY signal is asserted during
|
||||||
|
// the initial phase of an adaptive frequency hopping(AFH) scan, the Bluecore
|
||||||
|
// device fails to deassert its BT_ACTIVE signal
|
||||||
|
//
|
||||||
|
// Documentation from patch_access_address.xap
|
||||||
|
// -------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-206751
|
||||||
|
//
|
||||||
|
// BlueCore devices may generate access addresses that only
|
||||||
|
// have one bit transition in the 6 most significant bits.
|
||||||
|
// The problem is seen on access addresses that have the most
|
||||||
|
// significant bit set to one and only have one bit transition
|
||||||
|
// in the 6 most significant bits.
|
||||||
|
//
|
||||||
|
// Furthermore, the access address, whilst not identical to the
|
||||||
|
// advertising channel packets’ Access Address, may differ by
|
||||||
|
// only one bit.
|
||||||
|
//
|
||||||
|
// Documentation from patch_sched_get_or_peek_message.c
|
||||||
|
// ----------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-220605
|
||||||
|
//
|
||||||
|
// During the crossover of a locally initiated
|
||||||
|
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||||
|
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||||
|
// has initiated LMP_unsniff. This probably confuses peer and
|
||||||
|
// peer stops responding, leading to a timeout.
|
||||||
|
//
|
||||||
|
// Documentation from patch_sched_get_or_peek_message_part2.c
|
||||||
|
// ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-220605
|
||||||
|
//
|
||||||
|
// During the crossover of a locally initiated
|
||||||
|
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||||
|
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||||
|
// has initiated LMP_unsniff. This probably confuses peer and
|
||||||
|
// peer stops responding, leading to a timeout.
|
||||||
|
//
|
||||||
|
// Documentation from patch_ble_advt_restart.xap
|
||||||
|
// ---------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-223811
|
||||||
|
//
|
||||||
|
// When advertisements are disabled before the expiry of the interval
|
||||||
|
// and enabled immediately the advertisements are not sent before the
|
||||||
|
// expiry of the advertising interval
|
||||||
|
//
|
||||||
|
// Documentation from patch_whitelist_connection_status.xap
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-180762
|
||||||
|
//
|
||||||
|
// If a BlueCore device attempts but fails to form a Low Energy (LE) connection
|
||||||
|
// to a remote slave using the whitelist, it will make no further attempts to
|
||||||
|
// initiate a connection to that slave until either the BlueCore is reset or the
|
||||||
|
// slave is removed and re-added to the whitelist.
|
||||||
|
//
|
||||||
|
// Documentation from patch_semp2.xap
|
||||||
|
// ----------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-184008
|
||||||
|
//
|
||||||
|
// If HCI_SET_EVENT_MASK_PAGE_2 command is sent with wrong parameters
|
||||||
|
// to Bluecore device, it returns error code
|
||||||
|
// 'INVALID_HCI_COMMAND_PARAMETERS'. It should return error code
|
||||||
|
// 'UNKNOWN_HCI_COMMAND'.
|
||||||
|
//
|
||||||
|
// Documentation from patch_disc_ll_pdu.xap
|
||||||
|
// ----------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-179448
|
||||||
|
//
|
||||||
|
// If a BlueCore device in the Connection State (regardless if in master or
|
||||||
|
// slave role) receives an unexpected Data Channel PDU from the peer Link Layer
|
||||||
|
// during the encryption start or encryption pause procedure, it does not exit
|
||||||
|
// the Connection State and does not notify the Host with error code
|
||||||
|
// "Connection Terminated Due to MIC Failure (0x3d)".
|
||||||
|
//
|
||||||
|
// Documentation from patch_fsm_shared_patchpoint.c
|
||||||
|
// ------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-216310
|
||||||
|
//
|
||||||
|
// In a particular scenario where the peer device retries a Role Switch
|
||||||
|
// (after a failed Role Switch) without EPR sequence, the Hydra/BlueCore
|
||||||
|
// Devices do not handle the user data Start/Stop operation properly.
|
||||||
|
// As a result the user data does not resume after the procedure is finished.
|
||||||
|
//
|
||||||
|
// Version information for input files
|
||||||
|
// -----------------------------------
|
||||||
|
//
|
||||||
|
// Created by patchmaker.pl Revision: #68 Date: 2016/01/18
|
||||||
|
//
|
||||||
|
// Input file: pb-207.pb
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-207.pb
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: pb-173-common.pb
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-173-common.pb
|
||||||
|
// File revision: 7
|
||||||
|
//
|
||||||
|
// Input file: report_bt4p2.pb
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/report_bt4p2.pb
|
||||||
|
// File revision: 1
|
||||||
|
//
|
||||||
|
// Input file: patch_ulp_adv_avg_to_calc.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ulp_adv_avg_to_calc.xap
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: ../patch_utils.inc
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/patch_utils.inc
|
||||||
|
// File revision: 1
|
||||||
|
//
|
||||||
|
// Input file: patch_ble_scan_deaf.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_scan_deaf.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_usb_suspend_deep_sleep.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_usb_suspend_deep_sleep.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_tx_if_reduction.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_tx_if_reduction.xap
|
||||||
|
// File revision: 1
|
||||||
|
//
|
||||||
|
// Input file: coex_shutdown.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/coex_shutdown.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_access_address.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_access_address.xap
|
||||||
|
// File revision: 2
|
||||||
|
//
|
||||||
|
// Input file: patch_sched_get_or_peek_message.c
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message.c
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_sched_get_or_peek_message_part2.c
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message_part2.c
|
||||||
|
// File revision: 2
|
||||||
|
//
|
||||||
|
// Input file: patch_ble_advt_restart.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_advt_restart.xap
|
||||||
|
// File revision: 2
|
||||||
|
//
|
||||||
|
// Input file: patch_whitelist_connection_status.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_whitelist_connection_status.xap
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: patch_semp2.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_semp2.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_disc_ll_pdu.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_disc_ll_pdu.xap
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: patch_fsm_shared_patchpoint.c
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_fsm_shared_patchpoint.c
|
||||||
|
// File revision: 3
|
||||||
|
|
||||||
|
// explicit, PSKEY_HCI_LMP_LOCAL_VERSION (0x010d, 269), 1 words
|
||||||
|
&010d = 0808
|
||||||
|
|
||||||
|
// explicit, PSKEY_LMP_REMOTE_VERSION (0x010e, 270), 1 words
|
||||||
|
&010e = 0008
|
||||||
|
|
||||||
|
// patch_hardware_0, PSKEY_PATCH50 (0x212c, 8492), 56 words
|
||||||
|
&212c = 0000 f001 0617 0513 0118 ff2b ff0e 1a00 2818 009e 081b f100 8888 24f0 f925 f821 0a17 0184 0cf0 0117 0013 0009 02a4 fb25 fa21 f915 f811 fb55 fa61 09e0 ff84 10f0 0117 0013 0009 02a4 f935 f841 f925 f821 0f1b 0712 10a4 0494 0712 e151 0722 f915 f811 0018 ff2b ff0e f000 0518 00e2 5a79
|
||||||
|
|
||||||
|
// patch_hardware_1, PSKEY_PATCH51 (0x212d, 8493), 21 words
|
||||||
|
&212d = 0002 968a 0863 f925 f821 0757 0663 e099 02ec 05e0 f915 0727 f815 0627 0218 ff2b ff0e 9700 8d18 00e2 7e34
|
||||||
|
|
||||||
|
// patch_hardware_2, PSKEY_PATCH52 (0x212e, 8494), 16 words
|
||||||
|
&212e = 0002 0b5a 0100 7834 0040 0327 0223 f815 e311 0218 ff2b ff0e 0b00 5e18 00e2 59c1
|
||||||
|
|
||||||
|
// patch_hardware_3, PSKEY_PATCH53 (0x212f, 8495), 17 words
|
||||||
|
&212f = 0000 7315 0084 04f0 0800 0014 03e0 f800 1215 0b27 0018 ff2b ff0e 7300 1818 00e2 0549
|
||||||
|
|
||||||
|
// patch_hardware_4, PSKEY_PATCH54 (0x2130, 8496), 21 words
|
||||||
|
&2130 = 0001 53f8 0817 0e27 0c00 6384 07f0 0118 ff2b ff0e 5400 0918 00e2 0917 0118 ff2b ff0e 5400 fb18 00e2 91f6
|
||||||
|
|
||||||
|
// patch_hardware_5, PSKEY_PATCH55 (0x2131, 8497), 49 words
|
||||||
|
&2131 = 0002 c0d5 0423 05f4 031b 0012 0280 1df0 021b 0916 1000 00c4 1ef0 0916 03c4 1bf4 031b 0012 0280 17f4 0380 15f4 0480 13f4 0580 11f4 0680 0ff4 0b80 0df4 0d80 0bf4 019c fb00 6719 0d9e 0218 ff2b ff0e c200 8c18 00e2 0218 ff2b ff0e c100 de18 00e2 c5cf
|
||||||
|
|
||||||
|
// patch_hardware_6, PSKEY_PATCH56 (0x2132, 8498), 42 words
|
||||||
|
&2132 = 0003 243f f40b 0827 0923 e019 0916 01b4 0926 0318 ff2b ff0e 2400 4218 00e2 fa0b 3d14 0327 0114 0227 0014 0127 0027 081b 0816 0218 ff2b ff0e f700 fd18 009e e111 081b 0816 0218 ff2b ff0e 3300 ff18 009e fa0f 40f2
|
||||||
|
|
||||||
|
// patch_hardware_7, PSKEY_PATCH57 (0x2133, 8499), 23 words
|
||||||
|
&2133 = 0003 254e 02c0 0916 1000 00c4 02f4 02b0 0916 fec4 e1b1 0922 0816 0318 ff2b ff0e 2500 5218 8000 00c0 08f2 00e2 e402
|
||||||
|
|
||||||
|
// patch_hardware_8, PSKEY_PATCH58 (0x2134, 8500), 16 words
|
||||||
|
&2134 = 0003 21ca fa0b 0227 0323 e019 0916 01b4 0926 0318 ff2b ff0e 2200 cd18 00e2 22dc
|
||||||
|
|
||||||
|
// patch_hardware_9, PSKEY_PATCH59 (0x2135, 8501), 18 words
|
||||||
|
&2135 = 0000 55e2 09f4 0218 ff2b ff0e 2c00 a718 009e 0314 fc0f 0018 ff2b ff0e 5600 0118 00e2 a008
|
||||||
|
|
||||||
|
// patch_hardware_10, PSKEY_PATCH60 (0x2136, 8502), 30 words
|
||||||
|
&2136 = 0004 0d80 1aa4 0418 ff2b ff0e 1d00 ba18 009e 0184 0d2c 0013 8f00 89d0 0117 bf00 d6d4 0318 ff2b ff0e 2700 4218 009e 0418 ff2b ff0e 0e00 8418 00e2 6855
|
||||||
|
|
||||||
|
// patch_hardware_11, PSKEY_PATCH61 (0x2137, 8503), 22 words
|
||||||
|
&2137 = 0002 4da5 0118 ff2b ff0e 6200 c518 009e 031b 2b22 fcc4 2c26 0114 e700 f025 0218 ff2b ff0e 4e00 a818 00e2 8dfc
|
||||||
|
|
||||||
|
// patch_hardware_12, PSKEY_PATCH62 (0x2138, 8504), 19 words
|
||||||
|
&2138 = 0002 0f22 0310 081b 0100 8022 0100 b012 04f4 0114 e019 0426 0218 ff2b ff0e 0f00 2618 00e2 bc41
|
||||||
|
|
||||||
|
// patch_hardware_13, PSKEY_PATCH63 (0x2139, 8505), 12 words
|
||||||
|
&2139 = 0002 0d95 0513 0100 b022 0218 ff2b ff0e 0f00 db18 00e2 7a40
|
||||||
|
|
||||||
|
// patch_fsm_shared_patchpoint, PSKEY_PATCH121 (0x2209, 8713), 36 words
|
||||||
|
&2209 = fc0b 0b13 0717 1d00 c184 1df0 081b 0016 6384 05f0 1380 17f0 0114 13e0 6084 13f0 0100 da80 0df0 0d1b 5d9a 0af4 b900 f014 0127 0214 0027 e315 0010 000e 019f 0014 0d1b 5d26 fc0f a1a6
|
||||||
|
|
||||||
|
// patch_sched_get_or_peek_message, PSKEY_PATCH123 (0x220b, 8715), 49 words
|
||||||
|
&220b = fa0b 0717 0484 2cf0 0617 0690 e119 0c00 d438 041a 001a 022b 23f4 0116 0184 20f0 0216 0327 1df4 e119 0016 0784 19f0 e500 ab15 8000 0054 0100 c018 ff2b fe27 0317 ff0e fe9f e199 0cf4 7d00 f214 0127 0014 0027 0317 000e 019f 0014 021b 0226 fa0f 8392
|
||||||
|
|
||||||
|
// patch_spare1, PSKEY_PATCH155 (0x222b, 8747), 60 words
|
||||||
|
&222b = e70b 1627 a100 8514 0227 0214 0127 6b00 d814 0427 0214 0327 0417 fe27 0317 ff27 1613 0230 0814 0027 e415 0534 ff0e fe9f 0513 0009 01a4 e015 7fc4 7f84 1bf0 0617 1584 18f0 161b 0116 010e 029f e119 049a 11f4 0116 4184 0ef0 e500 ac11 8000 0050 0100 c014 ff27 fe23 0816 ff0e fe9f 0114 02e0 0014 e70f 4d65
|
||||||
|
|
||||||
|
// patch_spare2, PSKEY_PATCH156 (0x222c, 8748), 40 words
|
||||||
|
&222c = f40b 0927 2900 d414 0427 0314 0327 3500 ea14 0627 0314 0527 2900 9614 0827 0414 0727 0917 0110 070e 089f 0917 030e 049f 0617 fe27 0517 ff27 7f14 0027 1514 0127 2a14 0227 0114 0913 ff0e fe9f f40f 3478
|
||||||
|
&01fe = 6590
|
||||||
|
//Interface, BCSP
|
||||||
|
//&01f9 = 0001
|
||||||
|
//Interface, H4
|
||||||
|
&01f9 = 0003
|
||||||
|
//Bit rate for 8811, 115200
|
||||||
|
&01ea = 0001 c200
|
||||||
29
feeds/bluetooth/nrf52840/Makefile
Normal file
29
feeds/bluetooth/nrf52840/Makefile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=nrf52840
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/nrf52840
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
TITLE:=TIP NRF52840 support package
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile/Default
|
||||||
|
|
||||||
|
endef
|
||||||
|
Build/Compile = $(Build/Compile/Default)
|
||||||
|
|
||||||
|
define Package/nrf52840/install
|
||||||
|
$(CP) ./files/* $(1)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,nrf52840))
|
||||||
20
feeds/bluetooth/nrf52840/files/etc/init.d/nrf52840
Executable file
20
feeds/bluetooth/nrf52840/files/etc/init.d/nrf52840
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=80
|
||||||
|
|
||||||
|
boot() {
|
||||||
|
. /lib/functions/system.sh
|
||||||
|
case $(board_name) in
|
||||||
|
edgecore,eap102|\
|
||||||
|
edgecore,oap102)
|
||||||
|
echo 54 > /sys/class/gpio/export
|
||||||
|
echo out > /sys/class/gpio/gpio54/direction
|
||||||
|
echo 0 > /sys/class/gpio/gpio54/value
|
||||||
|
echo 1 > /sys/class/gpio/gpio54/value
|
||||||
|
btmgmt --index 0 static-addr FF:02:03:04:05:FF
|
||||||
|
btmgmt --index 0 auto-power
|
||||||
|
hciconfig hci0 up
|
||||||
|
hcitool -i hci0 cmd 0x3f 0x006
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
@@ -0,0 +1,320 @@
|
|||||||
|
// =============================================================================
|
||||||
|
//
|
||||||
|
// Copyright (c) 2015 - 2017 Qualcomm Technologies International, Ltd.
|
||||||
|
// All Rights Reserved.
|
||||||
|
// Qualcomm Technologies International, Ltd. Confidential and Proprietary.
|
||||||
|
// report this in case of problems:
|
||||||
|
// $Revision: #8 $
|
||||||
|
// Built Mon Feb 20 11:33:32 2017 GMT
|
||||||
|
// Checked-in $DateTime: 2017/02/20 11:36:26 $
|
||||||
|
// $File: //depot/bc/gemini-a12/dev/patches/10520/pb-207.psr $
|
||||||
|
//
|
||||||
|
// Patch is for build 10520 gem_5hci_rom_bt4.1_gemA12_1407301204_dspm_encr128
|
||||||
|
//
|
||||||
|
// Issues patched: B-158094, B-169261, B-171616, B-174351, B-176411,
|
||||||
|
// B-179448, B-180762, B-184008, B-206751, B-208678,
|
||||||
|
// B-216310, B-220605, B-223811
|
||||||
|
//
|
||||||
|
// Documentation from pb-207.pb
|
||||||
|
// ----------------------------
|
||||||
|
//
|
||||||
|
// General purpose patch and PSKEY bundle for CSR8811
|
||||||
|
// and CSR8311 A12 BT4.2 (build ID 10520).
|
||||||
|
//
|
||||||
|
// Documentation from pb-173-common.pb
|
||||||
|
// -----------------------------------
|
||||||
|
//
|
||||||
|
// General patch bundle for Gemini-A12 (build ID 10520)
|
||||||
|
// Patches and keys in here should be common to all
|
||||||
|
// package variants.
|
||||||
|
//
|
||||||
|
// Documentation from report_bt4p2.pb
|
||||||
|
// ----------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-174351
|
||||||
|
//
|
||||||
|
// Report BT version 4.2
|
||||||
|
//
|
||||||
|
// Documentation from patch_ulp_adv_avg_to_calc.xap
|
||||||
|
// ------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-171616
|
||||||
|
//
|
||||||
|
// BlueCore can be configured through BCCMDVARID_BLE_CONFIG_ADV_RSSI_AVG_PARAM
|
||||||
|
// to report the advertising rssi average through LE ADVERTISING REPORT to the
|
||||||
|
// host for a given PEER LE device.
|
||||||
|
// For more information, See CS-317256-AN.
|
||||||
|
//
|
||||||
|
// If the BlueCore is unable to receive a LE ADVERTISING REPORT from the PEER
|
||||||
|
// before a configured average rssi supervision timeout, then the BlueCore
|
||||||
|
// should send a LE ADVERTISING REPORT with rssi value equal to -127 conveying
|
||||||
|
// that the PEER is out of the range; however, it fails to do this.
|
||||||
|
//
|
||||||
|
// Documentation from patch_ble_scan_deaf.xap
|
||||||
|
// ------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-158094
|
||||||
|
//
|
||||||
|
// When BlueCore is asked to do BLE scanning, it scans for a window
|
||||||
|
// approximately 2.5% shorter than asked for. Generally, this does
|
||||||
|
// not cause noticeable effects; sometimes BLE adverts can be missed
|
||||||
|
// making connection initialisation between two BLE devices take
|
||||||
|
// somewhat longer than expected. In pathological cases, especially
|
||||||
|
// if the scan window is long, connections may fail to be made entirely.
|
||||||
|
//
|
||||||
|
// Documentation from patch_usb_suspend_deep_sleep.xap
|
||||||
|
// ---------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-176411
|
||||||
|
//
|
||||||
|
// When BlueCore device is bus powered and is in USB suspend mode,
|
||||||
|
// the current consumption is approximately 8 mA which is higher
|
||||||
|
// than the expected current of 250 uA
|
||||||
|
//
|
||||||
|
// Documentation from patch_tx_if_reduction.xap
|
||||||
|
// --------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-169261
|
||||||
|
//
|
||||||
|
// When a BlueCore7 device is configured to use a +/-500 kHz transmit IF, this
|
||||||
|
// can be overridden and a +/-375 kHz IF used instead. This reduces the
|
||||||
|
// bandwidthof the transmit spectrum providing a greater margin in a Chinese
|
||||||
|
// regulatory test.
|
||||||
|
// Only transmit IFs of +/-500 kHz may be reduced; if BlueCore7 is configured to
|
||||||
|
// use a TX IF of +/-1 MHz IF that will remain unchanged.
|
||||||
|
//
|
||||||
|
// Documentation from coex_shutdown.xap
|
||||||
|
// ------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-208678
|
||||||
|
//
|
||||||
|
// With Coexistence Unity-3 scheme, If the WLAN_DENY signal is asserted during
|
||||||
|
// the initial phase of an adaptive frequency hopping(AFH) scan, the Bluecore
|
||||||
|
// device fails to deassert its BT_ACTIVE signal
|
||||||
|
//
|
||||||
|
// Documentation from patch_access_address.xap
|
||||||
|
// -------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-206751
|
||||||
|
//
|
||||||
|
// BlueCore devices may generate access addresses that only
|
||||||
|
// have one bit transition in the 6 most significant bits.
|
||||||
|
// The problem is seen on access addresses that have the most
|
||||||
|
// significant bit set to one and only have one bit transition
|
||||||
|
// in the 6 most significant bits.
|
||||||
|
//
|
||||||
|
// Furthermore, the access address, whilst not identical to the
|
||||||
|
// advertising channel packets’ Access Address, may differ by
|
||||||
|
// only one bit.
|
||||||
|
//
|
||||||
|
// Documentation from patch_sched_get_or_peek_message.c
|
||||||
|
// ----------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-220605
|
||||||
|
//
|
||||||
|
// During the crossover of a locally initiated
|
||||||
|
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||||
|
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||||
|
// has initiated LMP_unsniff. This probably confuses peer and
|
||||||
|
// peer stops responding, leading to a timeout.
|
||||||
|
//
|
||||||
|
// Documentation from patch_sched_get_or_peek_message_part2.c
|
||||||
|
// ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-220605
|
||||||
|
//
|
||||||
|
// During the crossover of a locally initiated
|
||||||
|
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||||
|
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||||
|
// has initiated LMP_unsniff. This probably confuses peer and
|
||||||
|
// peer stops responding, leading to a timeout.
|
||||||
|
//
|
||||||
|
// Documentation from patch_ble_advt_restart.xap
|
||||||
|
// ---------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-223811
|
||||||
|
//
|
||||||
|
// When advertisements are disabled before the expiry of the interval
|
||||||
|
// and enabled immediately the advertisements are not sent before the
|
||||||
|
// expiry of the advertising interval
|
||||||
|
//
|
||||||
|
// Documentation from patch_whitelist_connection_status.xap
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-180762
|
||||||
|
//
|
||||||
|
// If a BlueCore device attempts but fails to form a Low Energy (LE) connection
|
||||||
|
// to a remote slave using the whitelist, it will make no further attempts to
|
||||||
|
// initiate a connection to that slave until either the BlueCore is reset or the
|
||||||
|
// slave is removed and re-added to the whitelist.
|
||||||
|
//
|
||||||
|
// Documentation from patch_semp2.xap
|
||||||
|
// ----------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-184008
|
||||||
|
//
|
||||||
|
// If HCI_SET_EVENT_MASK_PAGE_2 command is sent with wrong parameters
|
||||||
|
// to Bluecore device, it returns error code
|
||||||
|
// 'INVALID_HCI_COMMAND_PARAMETERS'. It should return error code
|
||||||
|
// 'UNKNOWN_HCI_COMMAND'.
|
||||||
|
//
|
||||||
|
// Documentation from patch_disc_ll_pdu.xap
|
||||||
|
// ----------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-179448
|
||||||
|
//
|
||||||
|
// If a BlueCore device in the Connection State (regardless if in master or
|
||||||
|
// slave role) receives an unexpected Data Channel PDU from the peer Link Layer
|
||||||
|
// during the encryption start or encryption pause procedure, it does not exit
|
||||||
|
// the Connection State and does not notify the Host with error code
|
||||||
|
// "Connection Terminated Due to MIC Failure (0x3d)".
|
||||||
|
//
|
||||||
|
// Documentation from patch_fsm_shared_patchpoint.c
|
||||||
|
// ------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issues patched: B-216310
|
||||||
|
//
|
||||||
|
// In a particular scenario where the peer device retries a Role Switch
|
||||||
|
// (after a failed Role Switch) without EPR sequence, the Hydra/BlueCore
|
||||||
|
// Devices do not handle the user data Start/Stop operation properly.
|
||||||
|
// As a result the user data does not resume after the procedure is finished.
|
||||||
|
//
|
||||||
|
// Version information for input files
|
||||||
|
// -----------------------------------
|
||||||
|
//
|
||||||
|
// Created by patchmaker.pl Revision: #68 Date: 2016/01/18
|
||||||
|
//
|
||||||
|
// Input file: pb-207.pb
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-207.pb
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: pb-173-common.pb
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-173-common.pb
|
||||||
|
// File revision: 7
|
||||||
|
//
|
||||||
|
// Input file: report_bt4p2.pb
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/report_bt4p2.pb
|
||||||
|
// File revision: 1
|
||||||
|
//
|
||||||
|
// Input file: patch_ulp_adv_avg_to_calc.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ulp_adv_avg_to_calc.xap
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: ../patch_utils.inc
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/patch_utils.inc
|
||||||
|
// File revision: 1
|
||||||
|
//
|
||||||
|
// Input file: patch_ble_scan_deaf.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_scan_deaf.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_usb_suspend_deep_sleep.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_usb_suspend_deep_sleep.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_tx_if_reduction.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_tx_if_reduction.xap
|
||||||
|
// File revision: 1
|
||||||
|
//
|
||||||
|
// Input file: coex_shutdown.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/coex_shutdown.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_access_address.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_access_address.xap
|
||||||
|
// File revision: 2
|
||||||
|
//
|
||||||
|
// Input file: patch_sched_get_or_peek_message.c
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message.c
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_sched_get_or_peek_message_part2.c
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message_part2.c
|
||||||
|
// File revision: 2
|
||||||
|
//
|
||||||
|
// Input file: patch_ble_advt_restart.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_advt_restart.xap
|
||||||
|
// File revision: 2
|
||||||
|
//
|
||||||
|
// Input file: patch_whitelist_connection_status.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_whitelist_connection_status.xap
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: patch_semp2.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_semp2.xap
|
||||||
|
// File revision: 3
|
||||||
|
//
|
||||||
|
// Input file: patch_disc_ll_pdu.xap
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_disc_ll_pdu.xap
|
||||||
|
// File revision: 4
|
||||||
|
//
|
||||||
|
// Input file: patch_fsm_shared_patchpoint.c
|
||||||
|
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_fsm_shared_patchpoint.c
|
||||||
|
// File revision: 3
|
||||||
|
|
||||||
|
// explicit, PSKEY_HCI_LMP_LOCAL_VERSION (0x010d, 269), 1 words
|
||||||
|
&010d = 0808
|
||||||
|
|
||||||
|
// explicit, PSKEY_LMP_REMOTE_VERSION (0x010e, 270), 1 words
|
||||||
|
&010e = 0008
|
||||||
|
|
||||||
|
// patch_hardware_0, PSKEY_PATCH50 (0x212c, 8492), 56 words
|
||||||
|
&212c = 0000 f001 0617 0513 0118 ff2b ff0e 1a00 2818 009e 081b f100 8888 24f0 f925 f821 0a17 0184 0cf0 0117 0013 0009 02a4 fb25 fa21 f915 f811 fb55 fa61 09e0 ff84 10f0 0117 0013 0009 02a4 f935 f841 f925 f821 0f1b 0712 10a4 0494 0712 e151 0722 f915 f811 0018 ff2b ff0e f000 0518 00e2 5a79
|
||||||
|
|
||||||
|
// patch_hardware_1, PSKEY_PATCH51 (0x212d, 8493), 21 words
|
||||||
|
&212d = 0002 968a 0863 f925 f821 0757 0663 e099 02ec 05e0 f915 0727 f815 0627 0218 ff2b ff0e 9700 8d18 00e2 7e34
|
||||||
|
|
||||||
|
// patch_hardware_2, PSKEY_PATCH52 (0x212e, 8494), 16 words
|
||||||
|
&212e = 0002 0b5a 0100 7834 0040 0327 0223 f815 e311 0218 ff2b ff0e 0b00 5e18 00e2 59c1
|
||||||
|
|
||||||
|
// patch_hardware_3, PSKEY_PATCH53 (0x212f, 8495), 17 words
|
||||||
|
&212f = 0000 7315 0084 04f0 0800 0014 03e0 f800 1215 0b27 0018 ff2b ff0e 7300 1818 00e2 0549
|
||||||
|
|
||||||
|
// patch_hardware_4, PSKEY_PATCH54 (0x2130, 8496), 21 words
|
||||||
|
&2130 = 0001 53f8 0817 0e27 0c00 6384 07f0 0118 ff2b ff0e 5400 0918 00e2 0917 0118 ff2b ff0e 5400 fb18 00e2 91f6
|
||||||
|
|
||||||
|
// patch_hardware_5, PSKEY_PATCH55 (0x2131, 8497), 49 words
|
||||||
|
&2131 = 0002 c0d5 0423 05f4 031b 0012 0280 1df0 021b 0916 1000 00c4 1ef0 0916 03c4 1bf4 031b 0012 0280 17f4 0380 15f4 0480 13f4 0580 11f4 0680 0ff4 0b80 0df4 0d80 0bf4 019c fb00 6719 0d9e 0218 ff2b ff0e c200 8c18 00e2 0218 ff2b ff0e c100 de18 00e2 c5cf
|
||||||
|
|
||||||
|
// patch_hardware_6, PSKEY_PATCH56 (0x2132, 8498), 42 words
|
||||||
|
&2132 = 0003 243f f40b 0827 0923 e019 0916 01b4 0926 0318 ff2b ff0e 2400 4218 00e2 fa0b 3d14 0327 0114 0227 0014 0127 0027 081b 0816 0218 ff2b ff0e f700 fd18 009e e111 081b 0816 0218 ff2b ff0e 3300 ff18 009e fa0f 40f2
|
||||||
|
|
||||||
|
// patch_hardware_7, PSKEY_PATCH57 (0x2133, 8499), 23 words
|
||||||
|
&2133 = 0003 254e 02c0 0916 1000 00c4 02f4 02b0 0916 fec4 e1b1 0922 0816 0318 ff2b ff0e 2500 5218 8000 00c0 08f2 00e2 e402
|
||||||
|
|
||||||
|
// patch_hardware_8, PSKEY_PATCH58 (0x2134, 8500), 16 words
|
||||||
|
&2134 = 0003 21ca fa0b 0227 0323 e019 0916 01b4 0926 0318 ff2b ff0e 2200 cd18 00e2 22dc
|
||||||
|
|
||||||
|
// patch_hardware_9, PSKEY_PATCH59 (0x2135, 8501), 18 words
|
||||||
|
&2135 = 0000 55e2 09f4 0218 ff2b ff0e 2c00 a718 009e 0314 fc0f 0018 ff2b ff0e 5600 0118 00e2 a008
|
||||||
|
|
||||||
|
// patch_hardware_10, PSKEY_PATCH60 (0x2136, 8502), 30 words
|
||||||
|
&2136 = 0004 0d80 1aa4 0418 ff2b ff0e 1d00 ba18 009e 0184 0d2c 0013 8f00 89d0 0117 bf00 d6d4 0318 ff2b ff0e 2700 4218 009e 0418 ff2b ff0e 0e00 8418 00e2 6855
|
||||||
|
|
||||||
|
// patch_hardware_11, PSKEY_PATCH61 (0x2137, 8503), 22 words
|
||||||
|
&2137 = 0002 4da5 0118 ff2b ff0e 6200 c518 009e 031b 2b22 fcc4 2c26 0114 e700 f025 0218 ff2b ff0e 4e00 a818 00e2 8dfc
|
||||||
|
|
||||||
|
// patch_hardware_12, PSKEY_PATCH62 (0x2138, 8504), 19 words
|
||||||
|
&2138 = 0002 0f22 0310 081b 0100 8022 0100 b012 04f4 0114 e019 0426 0218 ff2b ff0e 0f00 2618 00e2 bc41
|
||||||
|
|
||||||
|
// patch_hardware_13, PSKEY_PATCH63 (0x2139, 8505), 12 words
|
||||||
|
&2139 = 0002 0d95 0513 0100 b022 0218 ff2b ff0e 0f00 db18 00e2 7a40
|
||||||
|
|
||||||
|
// patch_fsm_shared_patchpoint, PSKEY_PATCH121 (0x2209, 8713), 36 words
|
||||||
|
&2209 = fc0b 0b13 0717 1d00 c184 1df0 081b 0016 6384 05f0 1380 17f0 0114 13e0 6084 13f0 0100 da80 0df0 0d1b 5d9a 0af4 b900 f014 0127 0214 0027 e315 0010 000e 019f 0014 0d1b 5d26 fc0f a1a6
|
||||||
|
|
||||||
|
// patch_sched_get_or_peek_message, PSKEY_PATCH123 (0x220b, 8715), 49 words
|
||||||
|
&220b = fa0b 0717 0484 2cf0 0617 0690 e119 0c00 d438 041a 001a 022b 23f4 0116 0184 20f0 0216 0327 1df4 e119 0016 0784 19f0 e500 ab15 8000 0054 0100 c018 ff2b fe27 0317 ff0e fe9f e199 0cf4 7d00 f214 0127 0014 0027 0317 000e 019f 0014 021b 0226 fa0f 8392
|
||||||
|
|
||||||
|
// patch_spare1, PSKEY_PATCH155 (0x222b, 8747), 60 words
|
||||||
|
&222b = e70b 1627 a100 8514 0227 0214 0127 6b00 d814 0427 0214 0327 0417 fe27 0317 ff27 1613 0230 0814 0027 e415 0534 ff0e fe9f 0513 0009 01a4 e015 7fc4 7f84 1bf0 0617 1584 18f0 161b 0116 010e 029f e119 049a 11f4 0116 4184 0ef0 e500 ac11 8000 0050 0100 c014 ff27 fe23 0816 ff0e fe9f 0114 02e0 0014 e70f 4d65
|
||||||
|
|
||||||
|
// patch_spare2, PSKEY_PATCH156 (0x222c, 8748), 40 words
|
||||||
|
&222c = f40b 0927 2900 d414 0427 0314 0327 3500 ea14 0627 0314 0527 2900 9614 0827 0414 0727 0917 0110 070e 089f 0917 030e 049f 0617 fe27 0517 ff27 7f14 0027 1514 0127 2a14 0227 0114 0913 ff0e fe9f f40f 3478
|
||||||
|
&01fe = 6590
|
||||||
|
//Interface, BCSP
|
||||||
|
//&01f9 = 0001
|
||||||
|
//Interface, H4
|
||||||
|
&01f9 = 0003
|
||||||
|
//Bit rate for 8811, 115200
|
||||||
|
&01ea = 0001 c200
|
||||||
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))
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user