Compare commits
1608 Commits
wip/nvidia
...
kudu6
Author | SHA1 | Date | |
---|---|---|---|
|
45fcc5bb6c | ||
|
ceb6908a78 | ||
|
1bcce6f204 | ||
|
b3563572f2 | ||
|
cd0254dfc4 | ||
|
86033d34b3 | ||
|
7dd9a8837e | ||
|
ee392ba10b | ||
|
6a26d0da0a | ||
|
1165fa9e03 | ||
|
83424ce3c8 | ||
|
1cfef49b64 | ||
|
3502c82019 | ||
|
19e85a3a21 | ||
|
b734f0fed0 | ||
|
d33dcc7a45 | ||
|
67a59cb124 | ||
|
bfa4225fdf | ||
|
137b12aee4 | ||
|
1957255f5e | ||
|
7e0a708cf9 | ||
|
fbd1e7305b | ||
|
334f6f944e | ||
|
63367e4b13 | ||
|
f0b04c0874 | ||
|
880501405b | ||
|
8482a83d1d | ||
|
cf0a4fcc67 | ||
|
4d2a48330e | ||
|
7e4221e335 | ||
|
c419da8394 | ||
|
90ac4fe952 | ||
|
2479c7c784 | ||
|
dfbcfaa533 | ||
|
6e9ec53576 | ||
|
c24f2ed615 | ||
|
b5cdcb1094 | ||
|
19e658a279 | ||
|
f1a67f8924 | ||
|
85b2e0d8f1 | ||
|
149f6cb1c2 | ||
|
4b657deaa1 | ||
|
afcfa1c1a9 | ||
|
872c49bc5e | ||
|
36c44fb448 | ||
|
7bcc106226 | ||
|
4cb1593c16 | ||
|
0d96fb33b9 | ||
|
f14f41e814 | ||
|
0e0b593e2a | ||
|
98513ad676 | ||
|
c111e46659 | ||
|
98b27e93ff | ||
|
fd7e5f888b | ||
|
9c1f72a500 | ||
|
14976dbed0 | ||
|
61c9440888 | ||
|
ef47212bf8 | ||
|
41994fee94 | ||
|
d91a6842bf | ||
|
d1275fb886 | ||
|
5b0ce06d3d | ||
|
d55a08242b | ||
|
f04faa149f | ||
|
b6d522f6c7 | ||
|
bf265b456b | ||
|
11fb6a87d7 | ||
|
159db81b64 | ||
|
d2133c2ebf | ||
|
08ec66dd12 | ||
|
a55e5b7739 | ||
|
b832955161 | ||
|
cb6e4926e7 | ||
|
b29d128023 | ||
|
df533e6911 | ||
|
0724ab1335 | ||
|
782d012590 | ||
|
8c83e3f7fd | ||
|
dc07db0c76 | ||
|
166b35210c | ||
|
5a0432182f | ||
|
895691a783 | ||
|
559563aaaa | ||
|
282d715133 | ||
|
c17330c1dd | ||
|
ca7c9cc3f2 | ||
|
e1d6f5b80d | ||
|
3248db0e5a | ||
|
6c4135e636 | ||
|
a7305c19e6 | ||
|
0ff941dd20 | ||
|
5b0103f9b5 | ||
|
2938c46765 | ||
|
9647e630a0 | ||
|
727a224aed | ||
|
79313528cd | ||
|
ffc8532869 | ||
|
4ffdd075af | ||
|
de66e66517 | ||
|
fff20212af | ||
|
97a0d61f0d | ||
|
33b7bb6ee5 | ||
|
8c93feda7f | ||
|
53c2250dbf | ||
|
83881e7824 | ||
|
fd539b40af | ||
|
a816c29882 | ||
|
8d436cfc1a | ||
|
7d8b553608 | ||
|
5e8dd5d24a | ||
|
c249c4b8f0 | ||
|
3307451752 | ||
|
55e43d82ac | ||
|
45f9ca4824 | ||
|
1dc1a56a5d | ||
|
d00cfcb0a1 | ||
|
3461917898 | ||
|
c35ce0e2a6 | ||
|
4e722d0766 | ||
|
c063b5d08e | ||
|
17fbf58fdb | ||
|
80ddd29adb | ||
|
72236b475f | ||
|
f57bf3f994 | ||
|
6198a8213a | ||
|
8ac40f3ea7 | ||
|
0de0254a1f | ||
|
575a2e589d | ||
|
148b545671 | ||
|
49e669f955 | ||
|
bb052ced54 | ||
|
7c31d17317 | ||
|
b3671ec5de | ||
|
9e00a817f3 | ||
|
42914feb1f | ||
|
112ffd7642 | ||
|
b09166d0e6 | ||
|
6c5efcd268 | ||
|
bd842a9b92 | ||
|
975c5e5ab0 | ||
|
b63d5f8b9c | ||
|
002d9b2a7a | ||
|
343b36bbc3 | ||
|
e8c160e6af | ||
|
92d449902e | ||
|
d85319a12d | ||
|
dfde9b125c | ||
|
2d58d5c052 | ||
|
7c2f57a4c7 | ||
|
81d3cdeab2 | ||
|
0fcf8356eb | ||
|
df81e07c37 | ||
|
d43e688ed2 | ||
|
02b2afa8e9 | ||
|
9fc5166ca7 | ||
|
cae27ebf49 | ||
|
8b875d028d | ||
|
646b6a0f6f | ||
|
aae362c4ed | ||
|
ad90edc3e0 | ||
|
28894c5798 | ||
|
399d3cf878 | ||
|
0e688b113d | ||
|
fafcb749b4 | ||
|
eaee04b4a1 | ||
|
507064b835 | ||
|
d8cf72f7e6 | ||
|
4893003581 | ||
|
b2e9193231 | ||
|
f91538c3ec | ||
|
bc13c64a2d | ||
|
c5b912f788 | ||
|
514965a9ce | ||
|
aa3a42df44 | ||
|
b3b17b2a3f | ||
|
e80e53cac6 | ||
|
6c5ec8e31c | ||
|
39cf79900f | ||
|
2fdcb64ec9 | ||
|
b0844490db | ||
|
e42731603e | ||
|
b8258bd2b9 | ||
|
1169e5943c | ||
|
af5a9d64a5 | ||
|
6f0b5b3e6b | ||
|
d2e278df33 | ||
|
3a96074441 | ||
|
dba9b54731 | ||
|
956a8b69d2 | ||
|
bcbcdf7394 | ||
|
e985d211fb | ||
|
c1de9e88e7 | ||
|
d495456429 | ||
|
b26d005bbe | ||
|
6ba6bc24eb | ||
|
cdbfa6e637 | ||
|
b0947172c8 | ||
|
19567d8ec2 | ||
|
457d98d130 | ||
|
8d6ebe9d31 | ||
|
7a91a10c61 | ||
|
eb1891a9a8 | ||
|
8b5841e9ea | ||
|
08d2016e50 | ||
|
e527c713bd | ||
|
707e5452e7 | ||
|
ed04aab813 | ||
|
252fc29d1a | ||
|
3c00c7ec6b | ||
|
9813544151 | ||
|
1ba6049ad9 | ||
|
b8a23013c5 | ||
|
cfc594cddd | ||
|
c9f6baf425 | ||
|
2481f1e7b5 | ||
|
caea806499 | ||
|
bde5558e54 | ||
|
20b9245d55 | ||
|
74249b9af9 | ||
|
caa1d41d5c | ||
|
47318c923e | ||
|
8ad51a8abf | ||
|
c585d8c96c | ||
|
9048043302 | ||
|
a3b79c5063 | ||
|
6e122455bd | ||
|
7516766abc | ||
|
876cfe0ee2 | ||
|
fd07fa20da | ||
|
1f6b7a273b | ||
|
5b76ae9611 | ||
|
3d121ae1a1 | ||
|
49be1a9346 | ||
|
ecdc714ef8 | ||
|
20536c90c6 | ||
|
e8f5c20282 | ||
|
4c6f074e0b | ||
|
37f4bf3802 | ||
|
86ce03361b | ||
|
b1963920b3 | ||
|
228e7c2e98 | ||
|
6c10007b42 | ||
|
0bcf771cd2 | ||
|
0ce6925849 | ||
|
a2322df64e | ||
|
e6460a4777 | ||
|
43e8807b6f | ||
|
facdd7e04c | ||
|
85ec4e2a74 | ||
|
8dd1763bef | ||
|
8572417007 | ||
|
e72eb02c27 | ||
|
e90243a0e7 | ||
|
9f9d5106c5 | ||
|
7d7f3ae69b | ||
|
09c047c297 | ||
|
efe0fe2674 | ||
|
1e25fd426a | ||
|
4b38a0b860 | ||
|
110e5ced75 | ||
|
ababf01e0e | ||
|
5a835161a2 | ||
|
b25261fc7f | ||
|
9b5b17feca | ||
|
3922aa5c2c | ||
|
80c9289712 | ||
|
71f03b4630 | ||
|
9c5a10714d | ||
|
c5ab260cbd | ||
|
5c7a923757 | ||
|
e0f0801802 | ||
|
5dff66bfd3 | ||
|
9354307157 | ||
|
f1a3f187ba | ||
|
55ba8df28c | ||
|
ceefc74f01 | ||
|
45ba318b2a | ||
|
9d28899f2d | ||
|
8b627daf80 | ||
|
4db4282e6b | ||
|
1597748a80 | ||
|
22ad8f2508 | ||
|
c168f115e4 | ||
|
83bc408416 | ||
|
af382a77d7 | ||
|
2aa5618871 | ||
|
1828a541f1 | ||
|
e9665959ed | ||
|
266041f0e6 | ||
|
984d03c492 | ||
|
a120e0defd | ||
|
6bb9e57a8f | ||
|
ab84fd7605 | ||
|
7cd8ba6eda | ||
|
1ee6e4ab6c | ||
|
7e653d8451 | ||
|
d1a74167a8 | ||
|
4bc9ac7c29 | ||
|
d5ae3f908a | ||
|
65aaccda59 | ||
|
ccd0905a23 | ||
|
84d4ccde79 | ||
|
2aef22f6fb | ||
|
cf7305f053 | ||
|
0d6972fcb2 | ||
|
51c75ac0df | ||
|
6efc7edc13 | ||
|
168c25b82b | ||
|
ad8a2a475e | ||
|
ec4493f88b | ||
|
5bd6096f82 | ||
|
b0789ede5f | ||
|
409e6fc6b9 | ||
|
16fa339d84 | ||
|
2412c81fce | ||
|
96451a7c6d | ||
|
0eef54b8be | ||
|
a4d033a66d | ||
|
ddf137f822 | ||
|
70f32bb203 | ||
|
6c170e6b3c | ||
|
e5592d3d99 | ||
|
9ec7227c9b | ||
|
7261b5ade5 | ||
|
7aea15aa6b | ||
|
710bdc42a5 | ||
|
0c1158b15d | ||
|
c8d26c0158 | ||
|
ceaf959678 | ||
|
2c079fce45 | ||
|
f73e49a784 | ||
|
3babc8e12c | ||
|
3623eca525 | ||
|
8b94d3e9d9 | ||
|
cd8771640f | ||
|
75739d3913 | ||
|
6f9e4ab059 | ||
|
716ccb7450 | ||
|
c6b65c1a81 | ||
|
b6cf642732 | ||
|
8e4742d76d | ||
|
6151ff3eae | ||
|
3bdbdb77a2 | ||
|
6d1db72958 | ||
|
2fb232af8b | ||
|
526cc3ed44 | ||
|
ebd75315b4 | ||
|
a84d4f2312 | ||
|
e04be37806 | ||
|
556d1cc17f | ||
|
bb42f67240 | ||
|
42d8cbf4d2 | ||
|
429971a5fb | ||
|
f3a1990021 | ||
|
480e7e5ac8 | ||
|
1d886639ce | ||
|
46c9f761d4 | ||
|
2c1c3138bc | ||
|
de70db137b | ||
|
0d390195a3 | ||
|
3c5da531ce | ||
|
0db4247b9f | ||
|
9ec5f444d0 | ||
|
8fb462fcc8 | ||
|
a69125c723 | ||
|
880f70660d | ||
|
687793d3c0 | ||
|
1039d27856 | ||
|
cfb044322e | ||
|
3c965dc3ac | ||
|
92b7815702 | ||
|
cfd3224197 | ||
|
a0696645b0 | ||
|
fa4d0510ea | ||
|
21fdd44db0 | ||
|
8a576f60ff | ||
|
7edf910d79 | ||
|
7a3c416ebd | ||
|
67d0672296 | ||
|
b998fd073d | ||
|
57fc1b91b9 | ||
|
5a49f3aa79 | ||
|
7ef471c67a | ||
|
ce70f0b699 | ||
|
d6dbd9338c | ||
|
ea47c6b580 | ||
|
be3e911d53 | ||
|
e49a615320 | ||
|
32e0673232 | ||
|
736f9cced0 | ||
|
2ad24833d9 | ||
|
fedc5427fd | ||
|
a0dd454115 | ||
|
abac030662 | ||
|
da2827779c | ||
|
7e91db7148 | ||
|
506ca3ef4e | ||
|
894f6f8229 | ||
|
bab9d72f15 | ||
|
d91af22f11 | ||
|
ea026aa915 | ||
|
82e3913a82 | ||
|
484708e9ca | ||
|
7663852a9d | ||
|
57cd69f293 | ||
|
facb9e4dca | ||
|
fae13d6063 | ||
|
ca544c9cee | ||
|
45f512c8e0 | ||
|
442c598a0c | ||
|
bef4ec7e57 | ||
|
abdf684c37 | ||
|
8ed02de830 | ||
|
3d945890d8 | ||
|
2a542da89f | ||
|
78695fd969 | ||
|
a70415624f | ||
|
f2a9c8d57c | ||
|
41aa8d6035 | ||
|
cabf9e33a7 | ||
|
f023270a68 | ||
|
b11f381740 | ||
|
87d1cc6598 | ||
|
2302fcf039 | ||
|
4b4aa0bed6 | ||
|
01e426d217 | ||
|
e258df2cb7 | ||
|
b627964f2e | ||
|
18ef52083d | ||
|
249c4044c2 | ||
|
ac69049030 | ||
|
919b0c7d4d | ||
|
48cb78b6d9 | ||
|
96771bf92c | ||
|
7503cd1c88 | ||
|
a04666110a | ||
|
b196834b62 | ||
|
ad489d889b | ||
|
e2c1ea7ad9 | ||
|
6fe32f55b7 | ||
|
3e4f28f8c2 | ||
|
948ed24ac5 | ||
|
5e8ecf5567 | ||
|
b4cdfb5128 | ||
|
ce7ec14f36 | ||
|
5561468eeb | ||
|
3f8bff7764 | ||
|
38c7314137 | ||
|
e9d0653308 | ||
|
fb6d6a9333 | ||
|
730107e6c1 | ||
|
bfdc132436 | ||
|
1cac6e06dc | ||
|
4bffbb661c | ||
|
fa99982b71 | ||
|
3b6d202ee5 | ||
|
eaac053d23 | ||
|
8a48241b8d | ||
|
289a67d160 | ||
|
ad3828e3ce | ||
|
28fa297901 | ||
|
5e84a42055 | ||
|
e15aa7fc7a | ||
|
3c46371a51 | ||
|
0bc5d9dfff | ||
|
f711bf03a6 | ||
|
f9e9250d46 | ||
|
45bf0411f3 | ||
|
5f72179d57 | ||
|
73b90c6872 | ||
|
117361278f | ||
|
49f0f9a422 | ||
|
f6bd2788b8 | ||
|
a3f8eda8a6 | ||
|
91068c95b7 | ||
|
bc1febad5b | ||
|
ba21a1f76c | ||
|
cbf290c692 | ||
|
1c3b2a706e | ||
|
9517ae9f69 | ||
|
6b90511da4 | ||
|
49cb32d430 | ||
|
039be8c7c7 | ||
|
8a09cbd336 | ||
|
283999ad53 | ||
|
b1fe9de74d | ||
|
a48f29192d | ||
|
2f478b85ca | ||
|
cea684df9f | ||
|
648a44acbc | ||
|
ef8a1390b2 | ||
|
5d48e78341 | ||
|
0015df5927 | ||
|
9c89e3ada2 | ||
|
aef6de3426 | ||
|
58e2c50d88 | ||
|
be35479f91 | ||
|
ec31cf13e2 | ||
|
921b99ed4b | ||
|
a233eb4b0a | ||
|
62b23c10e0 | ||
|
30f05c4e7c | ||
|
2c7e498876 | ||
|
8d6c1c2d0e | ||
|
79effad1fc | ||
|
2bff154598 | ||
|
d87b0c371e | ||
|
96eb676b5e | ||
|
2cd3384b18 | ||
|
eb9e63f21f | ||
|
98d76cb708 | ||
|
74b85f2e2e | ||
|
69d92deb6c | ||
|
6e4b81c20a | ||
|
d9e50b1343 | ||
|
2e7b78bad4 | ||
|
d575c8d4ed | ||
|
2e88d06d2b | ||
|
18167d4ac1 | ||
|
d03b824893 | ||
|
f1b11e7fcc | ||
|
707aa2ae77 | ||
|
af2f8b9297 | ||
|
393b093f71 | ||
|
7e8a0e61e7 | ||
|
fe678cbd19 | ||
|
a3525af1d2 | ||
|
d4b5ad0ce3 | ||
|
978930e860 | ||
|
a36f9ab041 | ||
|
73674a72bc | ||
|
8b54c0e04b | ||
|
2a404b599b | ||
|
b65c3015b0 | ||
|
51ede8af2e | ||
|
0251ecdd62 | ||
|
52ac424b9c | ||
|
0099832cda | ||
|
964055d74f | ||
|
6ec3dd2e5c | ||
|
e8feab018b | ||
|
7f8ab005ca | ||
|
ff99f1246f | ||
|
10b2c73875 | ||
|
8f2df280e1 | ||
|
7760fe4645 | ||
|
5cd7579ee5 | ||
|
36425312ee | ||
|
f4bb77bd9e | ||
|
20f836bfdf | ||
|
a27d1fa175 | ||
|
1f0eb6b0db | ||
|
9d93b16487 | ||
|
af356d313d | ||
|
a8d7c043f6 | ||
|
421c7d1a99 | ||
|
3c44c6227e | ||
|
6abaccf13d | ||
|
dd68649fe0 | ||
|
48eb9aa6d2 | ||
|
bf52cdbca1 | ||
|
672e844692 | ||
|
1b57537530 | ||
|
4337349883 | ||
|
83c30a9cf1 | ||
|
b3cd55b224 | ||
|
6dfa528af9 | ||
|
0d7eaba0d6 | ||
|
426ea9670f | ||
|
63b53561e1 | ||
|
86302a806c | ||
|
1e1aa0ca4d | ||
|
5be92e6f33 | ||
|
c067e4a6e5 | ||
|
36871dbdb7 | ||
|
23e2cde597 | ||
|
1587324a0d | ||
|
e383b3dcc4 | ||
|
bf73c498d4 | ||
|
f33c9bf79a | ||
|
03b1d3ef48 | ||
|
c7018cc009 | ||
|
203e6c2ed3 | ||
|
5fe3032e06 | ||
|
e24b006ee4 | ||
|
25387927c0 | ||
|
6a4f5739c8 | ||
|
38fcf40330 | ||
|
77426ffa6c | ||
|
dc0eb656eb | ||
|
6a3bdf9aa5 | ||
|
6fb126773f | ||
|
cef6770a0b | ||
|
0ddb47048d | ||
|
21bc2ca5d5 | ||
|
cf4bba82cb | ||
|
3b589c8148 | ||
|
3625a12625 | ||
|
85f691ab8d | ||
|
47486b92ce | ||
|
1c5cc56acc | ||
|
28a97a2ae5 | ||
|
8a4a89fdcb | ||
|
cd1cd8d117 | ||
|
cdd0252028 | ||
|
4ac35707d9 | ||
|
0767da9fc9 | ||
|
56ab8e2aae | ||
|
6ac5dc2ca6 | ||
|
a727d54536 | ||
|
58b2d86bb9 | ||
|
14a1c2778f | ||
|
c8283d7014 | ||
|
b1a0fcefe4 | ||
|
ba9183245f | ||
|
dbe92ead87 | ||
|
eed82d181b | ||
|
9a14fab340 | ||
|
0fd734046a | ||
|
db8afc70ba | ||
|
5338a16b2e | ||
|
415eadb90b | ||
|
50251400d2 | ||
|
e5af29c40b | ||
|
3e95cadacc | ||
|
5a8b9c94a6 | ||
|
57309d362c | ||
|
ec877d633d | ||
|
c89be7ae42 | ||
|
9341920453 | ||
|
2a81cab066 | ||
|
805956bce3 | ||
|
53c7453ba1 | ||
|
2746649dea | ||
|
0f9c7c009f | ||
|
80a7f4e7b6 | ||
|
bf993110b3 | ||
|
2abb826312 | ||
|
0bb6383f59 | ||
|
d2e423fc8d | ||
|
15c9c78057 | ||
|
e74ebcde38 | ||
|
a0d9ad322f | ||
|
98ce39dce4 | ||
|
0f76a18c3a | ||
|
ac24a96579 | ||
|
395f5b3129 | ||
|
d74b8d9c99 | ||
|
e565f75221 | ||
|
dc6071d2ce | ||
|
c98df1478b | ||
|
a99355376b | ||
|
c08b6a7037 | ||
|
63ec2ac97a | ||
|
4503a0cb0f | ||
|
a92589bc5c | ||
|
db29b3765b | ||
|
f04e83abbf | ||
|
ad50b40eed | ||
|
a2f51f2225 | ||
|
6b416ffc6a | ||
|
ca6e5ee594 | ||
|
62afdb675a | ||
|
45b6080561 | ||
|
9f0285b6fe | ||
|
7a2bc06b12 | ||
|
c14ba95beb | ||
|
b145fd1960 | ||
|
cdedc08d82 | ||
|
0c1c2decde | ||
|
d8bcad594f | ||
|
577afe62c9 | ||
|
435e003825 | ||
|
60570f4134 | ||
|
41a1a9e03c | ||
|
727a84b9a7 | ||
|
ae3f90b8f3 | ||
|
7788513667 | ||
|
878d3723fb | ||
|
ec58c01372 | ||
|
db199cc073 | ||
|
5352d22378 | ||
|
2853f0fd63 | ||
|
787ee8b9ea | ||
|
ad45f681aa | ||
|
b3398ba562 | ||
|
88e37c7aff | ||
|
64175bcb76 | ||
|
6c4edff487 | ||
|
a421b1a289 | ||
|
a52b9c3a40 | ||
|
bf4592743c | ||
|
8d092aa5d9 | ||
|
caa83ab2e1 | ||
|
27b02c2eee | ||
|
54bbe2da20 | ||
|
6f811f6d5c | ||
|
8473322727 | ||
|
baaee5fbfe | ||
|
206b0bc212 | ||
|
5e7f90bb4c | ||
|
29e33551a9 | ||
|
c7fc9d6c4c | ||
|
a6bc494e23 | ||
|
9a91ed3370 | ||
|
05865b8fbd | ||
|
17c9cfe212 | ||
|
cab1285c03 | ||
|
84bd9dcc51 | ||
|
c0e8357d5e | ||
|
874068eb1d | ||
|
ffc4002863 | ||
|
a6608bc990 | ||
|
ef6139ff0c | ||
|
ddaf2d0d18 | ||
|
17ce870755 | ||
|
5214cc978c | ||
|
ad6ff7fe25 | ||
|
03824a6b2e | ||
|
619dfeaa59 | ||
|
e6543ab56b | ||
|
60c7cc2b95 | ||
|
ba6b06f3b5 | ||
|
4ceb3530c5 | ||
|
7d874e7b22 | ||
|
02001a38be | ||
|
f6e74c45c0 | ||
|
8ebc6d1b7a | ||
|
3b9c3dd150 | ||
|
b14e6ea052 | ||
|
0a55d59f76 | ||
|
bd8ef95739 | ||
|
872afccbb9 | ||
|
60b0034991 | ||
|
76806c3263 | ||
|
7f1a63f074 | ||
|
2d531e9028 | ||
|
7f7d9df0c3 | ||
|
b0cda4b169 | ||
|
bdaff7ea84 | ||
|
079c8006bf | ||
|
63e54275f6 | ||
|
1fa3da4d9b | ||
|
b7d1b35175 | ||
|
150fee60cc | ||
|
502a761221 | ||
|
6a3ecc508a | ||
|
f26ce9f00e | ||
|
d2bba5ccd8 | ||
|
20777ec5a9 | ||
|
9b9fe92e28 | ||
|
da3edab901 | ||
|
f23cc1c0c1 | ||
|
44d103581d | ||
|
69d98b3655 | ||
|
02275be61e | ||
|
63660592dc | ||
|
c1d1cfa243 | ||
|
20ba6e4834 | ||
|
2360d7c277 | ||
|
3538461468 | ||
|
f00680afc5 | ||
|
138f547c8b | ||
|
af69af996e | ||
|
b6a15a7227 | ||
|
f94405219c | ||
|
ef5f7ee696 | ||
|
c921da3f0e | ||
|
d4c161ec55 | ||
|
362a4819b3 | ||
|
1e9dfd9d8c | ||
|
8eedca3e9e | ||
|
08351d2727 | ||
|
060e89f347 | ||
|
2dcc7224a0 | ||
|
7be44d2ad6 | ||
|
ff553ba8b3 | ||
|
328bfb3937 | ||
|
0de3e6570e | ||
|
c2c9618607 | ||
|
2b1afef1ea | ||
|
38712b84ba | ||
|
beaef09a9b | ||
|
5ba87a8092 | ||
|
e2192e6a82 | ||
|
f58ce3bdaa | ||
|
fc7a40fad9 | ||
|
e3411cda2e | ||
|
cf39336ccf | ||
|
40c9c8aa80 | ||
|
8d0e77bbd4 | ||
|
7fff266b07 | ||
|
78e6b3d28b | ||
|
642bcbf06a | ||
|
724fc89887 | ||
|
d43d864fc0 | ||
|
0dc0772118 | ||
|
90c6cff159 | ||
|
c46cadd22b | ||
|
a8a9552d75 | ||
|
df1d2b4bb9 | ||
|
a265c49eaa | ||
|
6f1435e0a9 | ||
|
1ef30cbf75 | ||
|
0bb9104ead | ||
|
6a8e0b14f7 | ||
|
8def542ff9 | ||
|
47235990d4 | ||
|
35eabc7c23 | ||
|
667f51193a | ||
|
056b2501e2 | ||
|
9e95f6e0bc | ||
|
a97f03513f | ||
|
249343bebb | ||
|
5a5ed1fb20 | ||
|
51b9eb74bf | ||
|
6dfc0aebb3 | ||
|
774ffe3998 | ||
|
088667a2d9 | ||
|
159a3045ce | ||
|
eb14a979f9 | ||
|
c045b099e4 | ||
|
8b63dac061 | ||
|
bdad283237 | ||
|
8bdbe23a93 | ||
|
a5b6ec05a8 | ||
|
fa7f37b75d | ||
|
e7640ccadd | ||
|
f1edd4fe60 | ||
|
fc86f8bf27 | ||
|
3a0355a8bc | ||
|
5ca0015dc5 | ||
|
0594bf87c1 | ||
|
cb8c3ddaea | ||
|
219bda737e | ||
|
8550fbcea8 | ||
|
9980019e14 | ||
|
1e0fd0b7bd | ||
|
6feb70ec04 | ||
|
b510670774 | ||
|
51ab5e454d | ||
|
58f6a5d744 | ||
|
187bec7ac0 | ||
|
2219d89d9d | ||
|
8a44eb9a5b | ||
|
0bbc3ccabb | ||
|
71c5dfc01e | ||
|
af4bd5633d | ||
|
0b9d186e3d | ||
|
876cffae65 | ||
|
1106bcce0d | ||
|
2a4858afed | ||
|
69107c149b | ||
|
b4a169a1e1 | ||
|
627313081e | ||
|
83ef7a647d | ||
|
355d8444a8 | ||
|
654930e7f2 | ||
|
2b1f8d4129 | ||
|
346bb0b010 | ||
|
e065db0dc2 | ||
|
f424c8b80f | ||
|
b6519812d4 | ||
|
434fd4cbc1 | ||
|
9e8f8c18c1 | ||
|
d6b181f81c | ||
|
df2bb60560 | ||
|
1aa197ee9b | ||
|
a4320fcc7b | ||
|
338bd0bcf4 | ||
|
bbe6e9706a | ||
|
1c5e9d1331 | ||
|
35f903074d | ||
|
8973942adf | ||
|
0a0a890d3b | ||
|
b7ec42d2ff | ||
|
8292f4160a | ||
|
b23571c18e | ||
|
fe657614e9 | ||
|
6af4200523 | ||
|
e81d12e866 | ||
|
1a6925cd7c | ||
|
ecc63d9bf4 | ||
|
9dafc29cae | ||
|
98be4d6ea5 | ||
|
d4a91aaf1f | ||
|
9f8ce8f2eb | ||
|
fa36e65a86 | ||
|
66e2630052 | ||
|
c104e4cdd7 | ||
|
40bc82fcde | ||
|
e15e64054c | ||
|
355fb2fb98 | ||
|
e7f1f6be86 | ||
|
da4c4ded58 | ||
|
70f59e28a0 | ||
|
176279eff1 | ||
|
0e790c6cba | ||
|
c8c312c7e8 | ||
|
42fcf5acfd | ||
|
60e1dfa8cd | ||
|
ca1b2a5b65 | ||
|
ab62663767 | ||
|
406453c973 | ||
|
5a303b0bca | ||
|
0a137cb91b | ||
|
db4cf7f93a | ||
|
b232ca67d7 | ||
|
9655cfc9c9 | ||
|
a330382db4 | ||
|
fde7a05223 | ||
|
7b7e44ed26 | ||
|
2f79a838db | ||
|
3dc8f56a18 | ||
|
3d3d498e8f | ||
|
24eb605280 | ||
|
150daaf3e2 | ||
|
34fe2ba447 | ||
|
621744b85f | ||
|
0d92ec872f | ||
|
291ba82acf | ||
|
6e9e3fddc7 | ||
|
0069f6a18c | ||
|
100c2f6d38 | ||
|
527e4a499d | ||
|
91596bcead | ||
|
e2c105ea69 | ||
|
ea642ab6e1 | ||
|
263beafc6f | ||
|
f59d76175a | ||
|
d8cf9626e8 | ||
|
5f013f7eb2 | ||
|
f3c313b47c | ||
|
d190cdd25e | ||
|
4fd000193b | ||
|
a13e3cd1da | ||
|
fbf01e1624 | ||
|
34c4a51d1b | ||
|
6b3a899bc4 | ||
|
1eba1968b5 | ||
|
f94ec24eb9 | ||
|
4e099552d8 | ||
|
a64944f5b2 | ||
|
3d778c3aee | ||
|
abff1a51c4 | ||
|
1bdac6a8e7 | ||
|
26fbcc91d6 | ||
|
a2ad07dc69 | ||
|
c94d91bba5 | ||
|
4aab487270 | ||
|
fe62d6911e | ||
|
5e5c14b36d | ||
|
3a8f0875c0 | ||
|
103f89a200 | ||
|
3a46206c08 | ||
|
44b014950b | ||
|
2c670870fd | ||
|
f00caca13e | ||
|
cb9f038ec5 | ||
|
2e4cc9b699 | ||
|
ae2d14b4a1 | ||
|
f5b162e55d | ||
|
73078edd5e | ||
|
931a1cec09 | ||
|
a6fe3f82a8 | ||
|
53b6c206e5 | ||
|
5e0fc511fd | ||
|
2318677866 | ||
|
dac0408492 | ||
|
83ba290f6d | ||
|
6b0b1aafe7 | ||
|
0cd553b3df | ||
|
de32da3c55 | ||
|
da20fa7abc | ||
|
8da3711edd | ||
|
c93781f96e | ||
|
38ac171ddd | ||
|
e55a7d160b | ||
|
c13aea6810 | ||
|
2bdffaa272 | ||
|
bb665ed635 | ||
|
f64ad5e2d3 | ||
|
d0437f331a | ||
|
6ed79cbddc | ||
|
ffe40a7a70 | ||
|
ce134ababd | ||
|
52607fd91e | ||
|
0f6de92fc3 | ||
|
c660a911d9 | ||
|
c4de2535da | ||
|
34dde858d6 | ||
|
df88199882 | ||
|
e490e59c78 | ||
|
c92c87b2fd | ||
|
3884a411dc | ||
|
7f25f14e00 | ||
|
4878940de3 | ||
|
a8b0c1a024 | ||
|
b385640e83 | ||
|
58e6789e5f | ||
|
dcebf6c791 | ||
|
e0625f8c8b | ||
|
3462a1b858 | ||
|
acc2ce9758 | ||
|
d05f2319df | ||
|
d67de90708 | ||
|
783e2bff53 | ||
|
1f796dacf7 | ||
|
550c072365 | ||
|
31531eab35 | ||
|
773c007af4 | ||
|
7b168c92f6 | ||
|
bb3300c14a | ||
|
1a0b557822 | ||
|
2b222a0a1a | ||
|
994541e8a3 | ||
|
4cadff28aa | ||
|
43ff69626d | ||
|
b8ea301e71 | ||
|
2ab680ed44 | ||
|
bdcf92f5c3 | ||
|
c584476fda | ||
|
27b9b5b72e | ||
|
1fe5c61b75 | ||
|
7cfaa5d74c | ||
|
f8f5062430 | ||
|
db01d1e2fc | ||
|
a0583a46b9 | ||
|
800b24f7f7 | ||
|
32992f264f | ||
|
e226aabf79 | ||
|
c1e46bde50 | ||
|
9758ef9c84 | ||
|
eb4edc3ef1 | ||
|
edb4f759ea | ||
|
5e4232d389 | ||
|
f371a78d90 | ||
|
d22cdbe73f | ||
|
d45b113fb5 | ||
|
b84476bcea | ||
|
b09459fcef | ||
|
647dd8a6bf | ||
|
ec3c2e2e6b | ||
|
e146196030 | ||
|
564accf926 | ||
|
ec14217d39 | ||
|
6c158a3c55 | ||
|
f511b9ba71 | ||
|
4864d2e3fd | ||
|
e1290e9cfc | ||
|
3e73566819 | ||
|
c555162cde | ||
|
1e68d3d9a9 | ||
|
d507c49156 | ||
|
30f4c531ac | ||
|
112fde01ab | ||
|
1d3cff3f61 | ||
|
520a4a618f | ||
|
6c307d7646 | ||
|
ff01bca624 | ||
|
ad489b8a27 | ||
|
58e016ed69 | ||
|
2b1e737289 | ||
|
4bf08cfbfe | ||
|
a9796ce010 | ||
|
8402c421b1 | ||
|
b647e35119 | ||
|
84cd7c351f | ||
|
4f1378ee47 | ||
|
15d4b95cc6 | ||
|
02a2f58a6c | ||
|
b138a8eb85 | ||
|
351d3a1967 | ||
|
8fac662f30 | ||
|
e7006fb414 | ||
|
bcd7873ea8 | ||
|
c729ebe945 | ||
|
7ff067ce38 | ||
|
fe7554c3ac | ||
|
8f363cd00f | ||
|
94ee1cb19c | ||
|
ae8004ad5f | ||
|
591789b50b | ||
|
0afecdf95a | ||
|
d448f8ce0f | ||
|
9fe2ce802a | ||
|
2ea8b945ec | ||
|
e061fbf1e7 | ||
|
0617d5a16f | ||
|
0071e6b528 | ||
|
f78a4b9f86 | ||
|
235a2a11b3 | ||
|
3ee9bb012d | ||
|
a62cb5693b | ||
|
d27dd97e17 | ||
|
baf027d50c | ||
|
82a283dad9 | ||
|
f0215b4cae | ||
|
a4dddfc3a3 | ||
|
b5ff51719d | ||
|
02031018e1 | ||
|
d22d692a19 | ||
|
01c06d7ba5 | ||
|
ae69f518b6 | ||
|
ec9de74d2d | ||
|
4b75b44bd8 | ||
|
4454c9af3c | ||
|
57af68fec9 | ||
|
aff2457723 | ||
|
58ce8b7db0 | ||
|
b89c798ddc | ||
|
b39f2a9066 | ||
|
1a7afb8363 | ||
|
f490d48b5c | ||
|
a7e85d43c8 | ||
|
8140691742 | ||
|
fba3668f5a | ||
|
aed38a94e3 | ||
|
4b4114f709 | ||
|
9e830540ec | ||
|
d992aa6111 | ||
|
bad64c8b9b | ||
|
ea6ee07f43 | ||
|
2d020e1cc3 | ||
|
25aa5606c2 | ||
|
fbfb906081 | ||
|
4b9ac2c993 | ||
|
a2c10a2539 | ||
|
6d84c08fbf | ||
|
1ea1e9d13a | ||
|
2bfc6c6a42 | ||
|
20f27da2b0 | ||
|
907cc5ab01 | ||
|
1a811bcb3b | ||
|
6ebb3b60a4 | ||
|
52ad866939 | ||
|
03ab722f54 | ||
|
55405a3ddd | ||
|
310d3271e4 | ||
|
df2049be31 | ||
|
032255c90f | ||
|
9f043742a8 | ||
|
01c9b98ef2 | ||
|
78ee4889dc | ||
|
0040bba74f | ||
|
09f7303518 | ||
|
f5dfe248ce | ||
|
4aaea85044 | ||
|
d3c0fb86be | ||
|
6df286ee19 | ||
|
3ca82e2d78 | ||
|
39dea9310b | ||
|
6fff2497b1 | ||
|
8ad94770e2 | ||
|
2649f5a518 | ||
|
1ca8b6e3c3 | ||
|
7f5a1eeb24 | ||
|
74d2218cc7 | ||
|
d8f07c1f35 | ||
|
af54d7d0dd | ||
|
a825170966 | ||
|
6f81c8698e | ||
|
1329d58a94 | ||
|
a169c74088 | ||
|
e3fd52a802 | ||
|
fc373c7dac | ||
|
55dce1d55d | ||
|
e3ae755575 | ||
|
856d6bc6d3 | ||
|
1105fe8913 | ||
|
a3930dafd4 | ||
|
6b0f45199c | ||
|
601a971545 | ||
|
19ad39b7f2 | ||
|
a1430c340e | ||
|
540951e374 | ||
|
bc62891378 | ||
|
0ccb7b2d48 | ||
|
1b66bbaf83 | ||
|
5e59f169ec | ||
|
cddded2f58 | ||
|
44633997d8 | ||
|
88efeafa66 | ||
|
3990da0bfe | ||
|
fd13fb54ac | ||
|
ccc27d2cca | ||
|
add2e93050 | ||
|
0fd072d3f2 | ||
|
772714d3b3 | ||
|
58ea2819ba | ||
|
ee56998a37 | ||
|
ac6070a79f | ||
|
da83d2c97f | ||
|
d85cee8310 | ||
|
2efb6142ca | ||
|
3437a6fbb0 | ||
|
941239d54d | ||
|
f79f775eda | ||
|
123312d6a5 | ||
|
10f457af5f | ||
|
25096eb950 | ||
|
20ad36547e | ||
|
282957232e | ||
|
38afe9e31c | ||
|
d76d2e275f | ||
|
7e7ea2bdf0 | ||
|
0f0edeed2e | ||
|
c71e320bae | ||
|
aa709a4996 | ||
|
f0a03b374a | ||
|
a70288d9fc | ||
|
32f883e532 | ||
|
b0d3a01941 | ||
|
1ac0dc164d | ||
|
dcf045918b | ||
|
feab8bb195 | ||
|
b32599ea89 | ||
|
ae0ea32c52 | ||
|
8bb59ca2fa | ||
|
5588f34a35 | ||
|
610b016caf | ||
|
178153dc45 | ||
|
ed8081cddd | ||
|
23488a1b78 | ||
|
5f2d114842 | ||
|
20fe24b4f7 | ||
|
dd1ee27503 | ||
|
f7d6eb2fef | ||
|
48fbf2f21d | ||
|
acb17fec34 | ||
|
92226dc6c3 | ||
|
dbd2362caa | ||
|
362dac6d6d | ||
|
de6b489ec5 | ||
|
18dfed5e8e | ||
|
07092189c1 | ||
|
c591d9c7ab | ||
|
642c8d4c08 | ||
|
83cf3333a2 | ||
|
2aa1ff4eea | ||
|
8474f4dc9b | ||
|
83d54c30fa | ||
|
715b787fd3 | ||
|
2bf2e6d1cc | ||
|
b0db75563a | ||
|
0dcdfd3561 | ||
|
e6ffdb47cd | ||
|
26e384bf34 | ||
|
3f5f1b5bff | ||
|
09ca258349 | ||
|
3d523635e8 | ||
|
b33f351a59 | ||
|
5af890d666 | ||
|
2a8de6dafb | ||
|
64f1319702 | ||
|
5bb9227845 | ||
|
76c426ab28 | ||
|
9f6805afe8 | ||
|
7edea1b790 | ||
|
693556e0ba | ||
|
3c1ee4b9ac | ||
|
18dd6b8a9a | ||
|
d5ea920785 | ||
|
59d64f06be | ||
|
105495f37e | ||
|
c7ab9f410c | ||
|
9a185e5bfe | ||
|
289e2f6a64 | ||
|
0b25e00ab1 | ||
|
0365fc8186 | ||
|
688f09f97a | ||
|
09cdecec9c | ||
|
9bfbcd2127 | ||
|
858481e814 | ||
|
e96861f5c7 | ||
|
9f01bbf410 | ||
|
eb102ccbd6 | ||
|
d22e921178 | ||
|
c5432ec098 | ||
|
00c834dc26 | ||
|
04cf42775c | ||
|
6ebcdf3872 | ||
|
c90d406008 | ||
|
3332c2dc6e | ||
|
6ddacd6f5b | ||
|
ca1e8aaec4 | ||
|
b049eb2d99 | ||
|
12f216bf87 | ||
|
b6f29c9bf4 | ||
|
eb3260b971 | ||
|
ad31061e66 | ||
|
987e3dc80b | ||
|
1f8563ec0e | ||
|
e138fbd794 | ||
|
93f50b35a4 | ||
|
dc35d2a693 | ||
|
5b334b88a6 | ||
|
c7f0bca9c2 | ||
|
9f37647b04 | ||
|
b88d845c56 | ||
|
7676fea000 | ||
|
57ff302a6c | ||
|
7424576e41 | ||
|
21d7d75796 | ||
|
461ff1d3e6 | ||
|
1883106c73 | ||
|
727c7bf221 | ||
|
7d925c5fb8 | ||
|
df808f3619 | ||
|
7311b4e52c | ||
|
46dbbb67bf | ||
|
9eb7070bc4 | ||
|
333edcc7c6 | ||
|
49c25f2cef | ||
|
b9277bad50 | ||
|
78c9b678d7 | ||
|
7e7cc1a8c9 | ||
|
c75d846971 | ||
|
0f42e5e8f1 | ||
|
2f236c232d | ||
|
c627b0edeb | ||
|
f364eb9e1a | ||
|
29c7622d08 | ||
|
4a0dee21ae | ||
|
012dc590b3 | ||
|
84b9191831 | ||
|
3bb1d923af | ||
|
0b697a2473 | ||
|
e81560c6cf | ||
|
c1d49b65b8 | ||
|
9450a40ffd | ||
|
a7ebca3969 | ||
|
769994cbf6 | ||
|
fc69b9d5ef | ||
|
2a30359d5a | ||
|
ea1bb5f7de | ||
|
e0869c3e49 | ||
|
bef5c40582 | ||
|
4fcf13a51d | ||
|
ac812eda0b | ||
|
df72b18db7 | ||
|
900758bd33 | ||
|
b1da051f17 | ||
|
b974dd96b6 | ||
|
4457768300 | ||
|
cca657f898 | ||
|
effe39b1f6 | ||
|
68ff33720a | ||
|
1ce0f3aab7 | ||
|
db925aaf38 | ||
|
734a777d94 | ||
|
0c9b1deb63 | ||
|
74033df2bd | ||
|
0167f5adbb | ||
|
67c778d74c | ||
|
f1505816ce | ||
|
275fe98738 | ||
|
39b2e7abdd | ||
|
9f10950426 | ||
|
5fb0e5564d | ||
|
ccff304751 | ||
|
d11c814172 | ||
|
05a6d5c601 | ||
|
54888d0846 | ||
|
b63e1f114b | ||
|
50f428d48b | ||
|
ea619425ee | ||
|
6ba7bee1aa | ||
|
5c59fefd89 | ||
|
5df090856b | ||
|
efe402a348 | ||
|
783a874545 | ||
|
18881f993c | ||
|
05714ccab7 | ||
|
0cd6ab338c | ||
|
6c2b860691 | ||
|
f6205d3deb | ||
|
8c4fe3f0f6 | ||
|
4b5a490b6f | ||
|
6b446b991b | ||
|
a19d6253f8 | ||
|
f3644ddae5 | ||
|
1186265898 | ||
|
88da0b8622 | ||
|
f083d5e5a3 | ||
|
3f15581faf | ||
|
5b94cd9e9d | ||
|
248dbe0908 | ||
|
9f91ced9dd | ||
|
561a2afc18 | ||
|
75a7c6e7a9 | ||
|
777ffff442 | ||
|
60df92fdce | ||
|
0cd50ae661 | ||
|
6670c68934 | ||
|
0d30ddde55 | ||
|
6eeba88050 | ||
|
8ddbc7dcbe | ||
|
5aba2aeead | ||
|
3b1d1ce1af | ||
|
257094ac1a | ||
|
50449eb05f | ||
|
1e3b48c534 | ||
|
de8c8eccc4 | ||
|
7480e87d76 | ||
|
7656571563 | ||
|
9734e8091f | ||
|
20fe2ee502 | ||
|
8422740933 | ||
|
85d94740c4 | ||
|
ede87184f8 | ||
|
ffe50fde1a | ||
|
fca89d3d05 | ||
|
81a69665dc | ||
|
47516553fb | ||
|
c5e56f5948 | ||
|
4b6c2b8cf9 | ||
|
e7c9b5329a | ||
|
580150de46 | ||
|
9234d9231b | ||
|
40713aaa43 | ||
|
02cef7a4a8 | ||
|
19072dcd6f | ||
|
1a55dbf7e9 | ||
|
d43d171f65 | ||
|
655fa5c39b | ||
|
7fd65a9791 | ||
|
1a2e5c5627 | ||
|
92ca892727 | ||
|
e0ab086028 | ||
|
6c59f377ec | ||
|
2e6c9d6488 | ||
|
ed533f7077 | ||
|
03f0fa1822 | ||
|
4298e13868 | ||
|
0c54461cf9 | ||
|
d560ad6e7a | ||
|
2f5cb2e355 | ||
|
f80f32b0e5 | ||
|
23d03e912a | ||
|
29b7f1459d | ||
|
18456169e6 | ||
|
2cb8ed1128 | ||
|
ebf62d6aff | ||
|
5484a956b8 | ||
|
b2c2b92a6d | ||
|
3215e004e4 | ||
|
68aca73cfd | ||
|
0bc4684f89 | ||
|
a7190ef2ec | ||
|
baa72db1b2 | ||
|
e2f30b4e56 | ||
|
61ac508712 | ||
|
c194f75bb5 | ||
|
0e9a616c29 | ||
|
8815409ec3 | ||
|
7fe266d59d | ||
|
3e8ca37b6c | ||
|
8928ae380b | ||
|
e961033ec4 | ||
|
9ed2490e5b | ||
|
281e2c1987 | ||
|
673716dedd | ||
|
05c6d65308 | ||
|
30c1bb60d5 | ||
|
a8820c74b5 | ||
|
a31dbb8b8e | ||
|
72b92c9207 | ||
|
7f61d41c1b | ||
|
fd6c8d607e | ||
|
8e0bfe263c | ||
|
7aedf83b30 | ||
|
c69ea3285e | ||
|
162083072e | ||
|
72628fa813 | ||
|
b207f3f370 | ||
|
8ebea12763 | ||
|
aa133e42ba | ||
|
34b70fd163 | ||
|
924c33b760 | ||
|
12a98ffbfb | ||
|
3c01123abb | ||
|
d88d2da813 | ||
|
15235b2d89 | ||
|
f1dbd67381 | ||
|
e987845fef | ||
|
ea6a93f140 | ||
|
1d565b500d | ||
|
5e3c454fbb | ||
|
b35acf9210 | ||
|
2c89d08d7e | ||
|
63c0fd2dbe | ||
|
667471b8d8 | ||
|
c47beec2d3 | ||
|
708c937c11 | ||
|
84f3807f5c | ||
|
f1e401c6cb | ||
|
a5cbe27148 | ||
|
b2a442ed59 | ||
|
37e261f374 | ||
|
6de48981fa | ||
|
797bc1b8e4 | ||
|
6b81adf8bc | ||
|
17441a3ac5 | ||
|
be0722ac91 | ||
|
69ed3ed5d8 | ||
|
89b6d4bf12 | ||
|
296994bec8 | ||
|
6973a3e7c4 | ||
|
b2e8bd8364 | ||
|
8c45f236bc | ||
|
2ee30add35 | ||
|
d7375b3fdd | ||
|
5a13d6617c | ||
|
ca247629da | ||
|
c8193ce587 | ||
|
31605959a5 | ||
|
7cbf203d9b | ||
|
ef164196cb | ||
|
7dce190808 | ||
|
bef23d1f79 | ||
|
ada539ee50 | ||
|
f0e721050a | ||
|
04e8c2b5ff | ||
|
423e9e0fc0 | ||
|
65adc70165 | ||
|
c9bc7a7591 | ||
|
98e827ea74 | ||
|
d58599dcb8 | ||
|
188be6b270 | ||
|
eae7bf2327 | ||
|
88295c35cc | ||
|
da815303a3 | ||
|
cd04c6e07d | ||
|
e589ee3879 | ||
|
c510346b08 | ||
|
570645dc2a | ||
|
6e2c5a3d18 | ||
|
b749d3f0d2 | ||
|
b846b42a36 | ||
|
3feddeb398 | ||
|
9afe02798a | ||
|
f6c53c0543 | ||
|
2e445ad1af | ||
|
e1095496e1 | ||
|
0087de817a | ||
|
fcb267a81d | ||
|
85d9f47014 | ||
|
d16a085110 | ||
|
5c3d12eaee | ||
|
f9df79e8d6 | ||
|
f347166928 | ||
|
6296ae0258 | ||
|
a592bef03f | ||
|
847a39fec7 | ||
|
1a4b132413 | ||
|
e08df8e138 | ||
|
a952b3f794 | ||
|
98c7d55eaa | ||
|
42b8835beb | ||
|
57d4bc63f0 | ||
|
9a640c0f69 | ||
|
c7e17bce06 | ||
|
ad5fda5fbf | ||
|
bade5caedb | ||
|
d8e8c873c0 | ||
|
15486f44a2 | ||
|
e3964c75d7 | ||
|
7c14ff0261 | ||
|
9d321588d0 | ||
|
e2cc773f71 | ||
|
db85b096d4 | ||
|
86a9cdd589 | ||
|
3fd39467b5 | ||
|
df99e57289 | ||
|
b25576fa63 | ||
|
571e7f02de | ||
|
d7e7d60e0f | ||
|
88c0faddad | ||
|
94030cfa55 | ||
|
4ab77addc5 | ||
|
966b502d35 | ||
|
1cbcfc13eb | ||
|
f3b2c157f5 | ||
|
2ec91a37bc | ||
|
da0c4f42f6 | ||
|
aba1c13581 | ||
|
b0d48ed88b | ||
|
b8b833fc6a | ||
|
d31effffc8 | ||
|
964eb67de6 | ||
|
a3811fe5e7 | ||
|
b5811c0b48 | ||
|
642508aa9c | ||
|
436eac827a | ||
|
ed784bc0a7 | ||
|
3b03798953 | ||
|
f005c34172 | ||
|
fb02f0a55e | ||
|
91c3ace5af | ||
|
6bc300d8d5 | ||
|
cbbb02777c | ||
|
434fa6367f | ||
|
07e6b5f67d | ||
|
f1d0c828d7 | ||
|
a2610581a5 | ||
|
53075c720b | ||
|
b8f0539d2d |
32
.gitmodules
vendored
32
.gitmodules
vendored
@@ -1,62 +1,62 @@
|
||||
[submodule "3rdparty/blobs"]
|
||||
path = 3rdparty/blobs
|
||||
url = ../blobs.git
|
||||
url = https://review.coreboot.org/blobs.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "util/nvidia-cbootimage"]
|
||||
path = util/nvidia/cbootimage
|
||||
url = ../nvidia-cbootimage.git
|
||||
url = https://review.coreboot.org/nvidia-cbootimage.git
|
||||
[submodule "vboot"]
|
||||
path = 3rdparty/vboot
|
||||
url = ../vboot.git
|
||||
url = https://review.coreboot.org/vboot.git
|
||||
branch = main
|
||||
[submodule "arm-trusted-firmware"]
|
||||
path = 3rdparty/arm-trusted-firmware
|
||||
url = ../arm-trusted-firmware.git
|
||||
url = https://review.coreboot.org/arm-trusted-firmware.git
|
||||
[submodule "3rdparty/chromeec"]
|
||||
path = 3rdparty/chromeec
|
||||
url = ../chrome-ec.git
|
||||
url = https://review.coreboot.org/chrome-ec.git
|
||||
[submodule "libhwbase"]
|
||||
path = 3rdparty/libhwbase
|
||||
url = ../libhwbase.git
|
||||
url = https://review.coreboot.org/libhwbase.git
|
||||
[submodule "libgfxinit"]
|
||||
path = 3rdparty/libgfxinit
|
||||
url = ../libgfxinit.git
|
||||
url = https://review.coreboot.org/libgfxinit.git
|
||||
[submodule "3rdparty/fsp"]
|
||||
path = 3rdparty/fsp
|
||||
url = ../fsp.git
|
||||
url = https://review.coreboot.org/fsp.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "opensbi"]
|
||||
path = 3rdparty/opensbi
|
||||
url = ../opensbi.git
|
||||
url = https://review.coreboot.org/opensbi.git
|
||||
[submodule "intel-microcode"]
|
||||
path = 3rdparty/intel-microcode
|
||||
url = ../intel-microcode.git
|
||||
url = https://review.coreboot.org/intel-microcode.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
branch = main
|
||||
[submodule "3rdparty/ffs"]
|
||||
path = 3rdparty/ffs
|
||||
url = ../ffs.git
|
||||
url = https://review.coreboot.org/ffs.git
|
||||
[submodule "3rdparty/amd_blobs"]
|
||||
path = 3rdparty/amd_blobs
|
||||
url = ../amd_blobs
|
||||
url = https://review.coreboot.org/amd_blobs
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/cmocka"]
|
||||
path = 3rdparty/cmocka
|
||||
url = ../cmocka.git
|
||||
url = https://review.coreboot.org/cmocka.git
|
||||
update = none
|
||||
[submodule "3rdparty/qc_blobs"]
|
||||
path = 3rdparty/qc_blobs
|
||||
url = ../qc_blobs.git
|
||||
url = https://review.coreboot.org/qc_blobs.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/intel-sec-tools"]
|
||||
path = 3rdparty/intel-sec-tools
|
||||
url = ../9esec-security-tooling.git
|
||||
url = https://review.coreboot.org/9esec-security-tooling.git
|
||||
[submodule "3rdparty/stm"]
|
||||
path = 3rdparty/stm
|
||||
url = ../STM
|
||||
url = https://review.coreboot.org/STM
|
||||
branch = stmpe
|
||||
|
2
3rdparty/amd_blobs
vendored
2
3rdparty/amd_blobs
vendored
Submodule 3rdparty/amd_blobs updated: f638765f17...9e8f457edc
2
3rdparty/arm-trusted-firmware
vendored
2
3rdparty/arm-trusted-firmware
vendored
Submodule 3rdparty/arm-trusted-firmware updated: 586aafa3a4...e0a6a512b5
2
3rdparty/blobs
vendored
2
3rdparty/blobs
vendored
Submodule 3rdparty/blobs updated: f388b6794e...f14575cb99
2
3rdparty/chromeec
vendored
2
3rdparty/chromeec
vendored
Submodule 3rdparty/chromeec updated: 4c21b57eb9...e486b388a7
2
3rdparty/intel-microcode
vendored
2
3rdparty/intel-microcode
vendored
Submodule 3rdparty/intel-microcode updated: 3f97690f0d...115c3e4cda
2
3rdparty/qc_blobs
vendored
2
3rdparty/qc_blobs
vendored
Submodule 3rdparty/qc_blobs updated: 98db38671b...9ab0f0b71c
2
3rdparty/vboot
vendored
2
3rdparty/vboot
vendored
Submodule 3rdparty/vboot updated: 13f601fbd4...25b9493525
@@ -24,6 +24,13 @@ ships with coreboot and support upstream maintenance for the devices through a
|
||||
third party, [3mdeb](https://3mdeb.com). They provide current and tested
|
||||
firmware binaries on [GitHub](https://pcengines.github.io).
|
||||
|
||||
### Star Labs
|
||||
|
||||
[Star Labs](https://starlabs.systems/) offers a range of laptops designed and
|
||||
built specifically for Linux that are available with coreboot firmware. They
|
||||
use Tianocore as the payload and include an NVRAM option to disable the
|
||||
Intel Management Engine.
|
||||
|
||||
### System76
|
||||
|
||||
[System76](https://system76.com/) manufactures Linux laptops, desktops, and
|
||||
|
@@ -193,8 +193,10 @@ the wip flag:
|
||||
* When pushing patches that are not for submission, these should be marked
|
||||
as such. This can be done in the title ‘[DONOTSUBMIT]’, or can be pushed as
|
||||
private changes, so that only explicitly added reviewers will see them. These
|
||||
sorts of patches are frequently posted as ideas or RFCs for the community
|
||||
to look at. To push a private change, use the command:
|
||||
sorts of patches are frequently posted as ideas or RFCs for the community to
|
||||
look at. Note that private changes can still be fetched from Gerrit by anybody
|
||||
who knows their commit ID, so don't use this for sensitive changes. To push
|
||||
a private change, use the command:
|
||||
git push origin HEAD:refs/for/master%private
|
||||
|
||||
* Multiple push options can be combined:
|
||||
|
@@ -162,6 +162,53 @@ The first is configuring a pin as an output, when it was designed to be an
|
||||
input. There is a real risk in this case of short-circuiting a component which
|
||||
could cause catastrophic failures, up to and including your mainboard!
|
||||
|
||||
### Intel SoCs
|
||||
|
||||
As per Intel Platform Controller Hub (PCH) EDS since Skylake, a GPIO PAD register
|
||||
supports four different types of GPIO reset as:
|
||||
|
||||
| PAD Reset Config | Platform Reset | GPP | GPD |
|
||||
|-------------------------------------------------|----------------|-----|-----|
|
||||
| 00 - Power Good (GPP: RSMRST, GPD: DSW_PWROK) | Warm Reset | N | N |
|
||||
| | Cold Reset | N | N |
|
||||
| | S3/S4/S5 | N | N |
|
||||
| | Global Reset | N | N |
|
||||
| | Deep Sx | Y | N |
|
||||
| | G3 | Y | N |
|
||||
| 01 - Deep | Warm Reset | Y | Y |
|
||||
| | Cold Reset | Y | Y |
|
||||
| | S3/S4/S5 | N | N |
|
||||
| | Global Reset | Y | Y |
|
||||
| | Deep Sx | Y | Y |
|
||||
| | G3 | Y | Y |
|
||||
| 10 - Host Reset/PLTRST | Warm Reset | Y | Y |
|
||||
| | Cold Reset | Y | Y |
|
||||
| | S3/S4/S5 | Y | Y |
|
||||
| | Global Reset | Y | Y |
|
||||
| | Deep Sx | Y | Y |
|
||||
| | G3 | Y | Y |
|
||||
| 11 - Resume Reset (GPP: Reserved, GPD: RSMRST) | Warm Reset | - | N |
|
||||
| | Cold Reset | - | N |
|
||||
| | S3/S4/S5 | - | N |
|
||||
| | Global Reset | - | N |
|
||||
| | Deep Sx | - | Y |
|
||||
| | G3 | - | Y |
|
||||
|
||||
Each GPIO Community has a Pad Configuration Lock register for a GPP allowing locking
|
||||
specific register fields in the PAD configuration register.
|
||||
|
||||
The Pad Config Lock registers reset type is default hardcoded to **Power Good** and
|
||||
it's **not** configurable by GPIO PAD DW0.PadRstCfg. Hence, it may appear that for a GPP,
|
||||
the Pad Reset Config (DW0 Bit 31) is configured differently from `Power Good`.
|
||||
|
||||
This would create confusion where the Pad configuration is returned to its `default`
|
||||
value but remains `locked`, this would prevent software to reprogram the GPP.
|
||||
Additionally, this means software can't rely on GPIOs being reset by PLTRST# or Sx entry.
|
||||
|
||||
Hence, as per GPIO BIOS Writers Guide (BWG) it's recommended to change the Pad Reset
|
||||
Configuration for lock GPP as `Power Good` so that pad configuration and lock bit are
|
||||
always in sync and can be reset at the same time.
|
||||
|
||||
## Soft Straps
|
||||
|
||||
Soft straps, that can be configured by the vendor in the Intel Flash Image Tool
|
||||
|
177
Documentation/mainboard/acer/g43t-am3.md
Normal file
177
Documentation/mainboard/acer/g43t-am3.md
Normal file
@@ -0,0 +1,177 @@
|
||||
# Acer G43T-AM3
|
||||
|
||||
The Acer G43T-AM3 is a microATX-sized desktop board. It was used for the
|
||||
Acer models Aspire M3800, Aspire M5800 and possibly more.
|
||||
|
||||
## Technology
|
||||
|
||||
```eval_rst
|
||||
+------------------+--------------------------------------------------+
|
||||
| Northbridge | Intel G43 (called x4x in coreboot code) |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Southbridge | Intel ICH10R (called i82801jx in coreboot code) |
|
||||
+------------------+--------------------------------------------------+
|
||||
| CPU socket | LGA 775 |
|
||||
+------------------+--------------------------------------------------+
|
||||
| RAM | 4 x DDR3-1066 |
|
||||
+------------------+--------------------------------------------------+
|
||||
| SuperIO | ITE IT8720F |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Audio | Realtek ALC888S |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Network | Intel 82567V-2 Gigabit Ethernet |
|
||||
+------------------+--------------------------------------------------+
|
||||
```
|
||||
|
||||
There is no serial port. Serial console output is possible by soldering
|
||||
to a point at the corresponding Super I/O pin and patching the
|
||||
mainboard-specific code accordingly.
|
||||
|
||||
## Status
|
||||
|
||||
### Working
|
||||
|
||||
Tests were done with SeaBIOS 1.14.0 and slackware64-live from 2019-07-12
|
||||
(linux-4.19.50).
|
||||
|
||||
+ Intel Core 2 processors at up to FSB 1333
|
||||
+ All four DIMM slots at 1066 MHz (tested 2x2GB + 2x4GB)
|
||||
+ Integrated graphics (libgfxinit)
|
||||
+ HDMI and VGA ports
|
||||
+ Both PCI slots
|
||||
+ Both PCI-e slots
|
||||
+ USB (8 internal, 4 external)
|
||||
+ All six SATA ports
|
||||
+ Onboard Ethernet
|
||||
+ Onboard sound card with output on the rear stereo connector
|
||||
+ PS/2 mouse and keyboard
|
||||
+ With SeaBIOS, use CONFIG_SEABIOS_PS2_TIMEOUT, tested: 500
|
||||
+ With FILO it works without further settings
|
||||
+ Temperature readings from the Super I/O (including the CPU temperature
|
||||
via PECI)
|
||||
+ Super I/O EC automatic fan control
|
||||
+ S3 suspend/resume
|
||||
+ Poweroff
|
||||
|
||||
### Not working
|
||||
|
||||
+ DDR3 memory with 512Mx8 chips (G43 limitation)
|
||||
+ 4x4GB of DDR3 memory (works, but showed a single bit error within one
|
||||
pass of Memtest86+ 5.01)
|
||||
+ Super I/O voltage reading conversions
|
||||
|
||||
### Untested
|
||||
|
||||
+ Other audio jacks or the front panel header
|
||||
+ S/PDIF output
|
||||
+ On-board Firewire
|
||||
+ Wake-on-LAN
|
||||
|
||||
## Flashing coreboot
|
||||
|
||||
```eval_rst
|
||||
+-------------------+---------------------+
|
||||
| Type | Value |
|
||||
+===================+=====================+
|
||||
| Socketed flash | No |
|
||||
+-------------------+---------------------+
|
||||
| Model | Macronix MX25L1605D |
|
||||
+-------------------+---------------------+
|
||||
| Size | 2 MiB |
|
||||
+-------------------+---------------------+
|
||||
| Package | 8-Pin SOP |
|
||||
+-------------------+---------------------+
|
||||
| Write protection | No |
|
||||
+-------------------+---------------------+
|
||||
| Dual BIOS feature | No |
|
||||
+-------------------+---------------------+
|
||||
| Internal flashing | Yes |
|
||||
+-------------------+---------------------+
|
||||
```
|
||||
|
||||
The flash is divided into the following regions, as obtained with
|
||||
`ifdtool -f rom.layout backup.rom`:
|
||||
```
|
||||
00000000:00001fff fd
|
||||
00100000:001fffff bios
|
||||
00006000:000fffff me
|
||||
00002000:00005fff gbe
|
||||
```
|
||||
|
||||
In general, flashing is possible internally and from an external header. It
|
||||
might be necessary to specify the chip type; `MX25L1605D/MX25L1608D/MX25L1673E`
|
||||
is the correct one, not `MX25L1605`.
|
||||
|
||||
### Internal flashing
|
||||
|
||||
Internal access to the flash chip is unrestricted. When installing coreboot,
|
||||
only the BIOS region should be updated by passing the `--ifd` and `-i bios`
|
||||
parameters to flashrom. A full backup is advisable.
|
||||
|
||||
Here is an example:
|
||||
|
||||
```
|
||||
$ sudo flashrom \
|
||||
-p internal \
|
||||
-c "MX25L1605D/MX25L1608D/MX25L1673E" \
|
||||
-r backup.rom
|
||||
$ sudo flashrom \
|
||||
-p internal \
|
||||
-c "MX25L1605D/MX25L1608D/MX25L1673E" \
|
||||
--ifd -i bios \
|
||||
-w coreboot.rom
|
||||
```
|
||||
|
||||
```eval_rst
|
||||
In addition to the information here, please see the
|
||||
:doc:`../../flash_tutorial/index`.
|
||||
```
|
||||
|
||||
### External flashing
|
||||
|
||||
The SPI flash chip on this board can be flashed externally through the
|
||||
SPI_ROM1 header while the board is off and disconnected from power. There
|
||||
seems to be a diode that prevents the external programmer from powering the
|
||||
whole board.
|
||||
|
||||
The signal assigment on the header is identical to the pinout of the flash
|
||||
chip. The pinout diagram below is valid when the PCI slots are on the left
|
||||
and the CPU is on the right. Note that HOLD# and WP# must be pulled high
|
||||
(to VCC) to be able to flash the chip.
|
||||
|
||||
+---+---+
|
||||
SPI_CSn <- | x | x | -> VCC
|
||||
+---+---+
|
||||
SPI_MISO <- | x | x | -> HOLDn
|
||||
+---+---+
|
||||
WPn <- | x | x | -> SPI_CLK
|
||||
+---+---+
|
||||
GND <- | x | x | -> SPI_MOSI
|
||||
+---+---+
|
||||
|
||||
## Intel Management Engine
|
||||
|
||||
The Intel Management Engine (ME) can be disabled by setting the ME_DISABLE
|
||||
jumper on the board. It pulls GPIO33 on the ICH10 low, causing the "Flash
|
||||
Descriptor Security Override Strap" to be set. This disables the ME and also
|
||||
disables any read/write restrictions to the flash chip that may be set in the
|
||||
Intel Flash Descriptor (IFD) (none on this board). Note that changing this
|
||||
jumper only comes into effect when starting the board from a shutdown or
|
||||
suspend state, not during normal operation.
|
||||
|
||||
To completely remove the ME blob from the flash image and to decrease the size
|
||||
of the ME region, thus increasing the size of the BIOS region, `me_cleaner` can
|
||||
be used with the `-t`, `-r` and `-S` options.
|
||||
|
||||
## Fan control
|
||||
|
||||
There are two fan connectors that can be controlled individually. CPU_FAN
|
||||
can only control a fan by a PWM signal and SYS_FAN only by voltage. See
|
||||
the mainboard's `devicetree.cb` file for how coreboot configures the Super
|
||||
I/O to control the fans.
|
||||
|
||||
## Variants
|
||||
|
||||
Various similar mainboards exist, like the Acer Q45T-AM. During a discussion
|
||||
in #coreboot on IRC, ECS was suspected to be the original designer of this
|
||||
series of mainboards. They have similar models such as the ECS G43T-WM.
|
174
Documentation/mainboard/asrock/h77pro4-m.md
Normal file
174
Documentation/mainboard/asrock/h77pro4-m.md
Normal file
@@ -0,0 +1,174 @@
|
||||
# ASRock H77 Pro4-M
|
||||
|
||||
The ASRock H77 Pro4-M is a microATX-sized desktop board for Intel Sandy
|
||||
Bridge and Ivy Bridge CPUs.
|
||||
|
||||
## Technology
|
||||
|
||||
```eval_rst
|
||||
+------------------+--------------------------------------------------+
|
||||
| Northbridge | :doc:`../../northbridge/intel/sandybridge/index` |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Southbridge | Intel H77 (bd82x6x) |
|
||||
+------------------+--------------------------------------------------+
|
||||
| CPU socket | LGA 1155 |
|
||||
+------------------+--------------------------------------------------+
|
||||
| RAM | 4 x DDR3-1600 |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Super I/O | Nuvoton NCT6776 |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Audio | Realtek ALC892 |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Network | Realtek RTL8111E |
|
||||
+------------------+--------------------------------------------------+
|
||||
| Serial | Internal header (RS-232) |
|
||||
+------------------+--------------------------------------------------+
|
||||
```
|
||||
|
||||
## Status
|
||||
|
||||
Tests were done with SeaBIOS 1.14.0 and slackware64-live from 2019-07-12
|
||||
(linux-4.19.50).
|
||||
|
||||
### Working
|
||||
|
||||
- Sandy Bridge and Ivy Bridge CPUs (tested: i5-2500, Pentium G2120)
|
||||
- Native RAM initialization with four DIMMs
|
||||
- PS/2 combined port (mouse or keyboard)
|
||||
- Integrated GPU by libgfxinit on all monitor ports (DVI-D, HDMI, D-Sub)
|
||||
- PCIe graphics in the PEG slot
|
||||
- All three additional PCIe slots
|
||||
- All rear and internal USB2 ports
|
||||
- All rear and internal USB3 ports
|
||||
- All six SATA ports from the PCH (two 6 Gb/s, four 3 Gb/s)
|
||||
- All two SATA ports from the ASM1061 PCIe-to-SATA bridge (6 Gb/s)
|
||||
- Rear eSATA connector (multiplexed with one ASM1061 port)
|
||||
- Gigabit Ethernet
|
||||
- Console output on the serial port
|
||||
- SeaBIOS 1.14.0 and 1.15.0 to boot Windows 10 (needs VGA BIOS) and Linux via
|
||||
extlinux
|
||||
- Internal flashing with flashrom-1.2, see
|
||||
[Internal Programming](#internal-programming)
|
||||
- External flashing with flashrom-1.2 and a Raspberry Pi 1
|
||||
- S3 suspend/resume from either Linux or Windows 10
|
||||
- Poweroff
|
||||
|
||||
### Not working
|
||||
|
||||
- Booting from the two SATA ports provided by the ASM1061
|
||||
- Automatic fan control with the NCT6776D Super I/O
|
||||
|
||||
### Untested
|
||||
|
||||
- EHCI debug
|
||||
- S/PDIF audio
|
||||
- Other audio jacks than the green one, and the front panel header
|
||||
- Parallel port
|
||||
- Infrared/CIR
|
||||
- Wakeup from anything but the power button
|
||||
|
||||
## Flashing coreboot
|
||||
|
||||
```eval_rst
|
||||
+---------------------+------------+
|
||||
| Type | Value |
|
||||
+=====================+============+
|
||||
| Socketed flash | yes |
|
||||
+---------------------+------------+
|
||||
| Model | W25Q64.V |
|
||||
+---------------------+------------+
|
||||
| Size | 8 MiB |
|
||||
+---------------------+------------+
|
||||
| Package | DIP-8 |
|
||||
+---------------------+------------+
|
||||
| Write protection | no |
|
||||
+---------------------+------------+
|
||||
| Dual BIOS feature | no |
|
||||
+---------------------+------------+
|
||||
| Internal flashing | yes |
|
||||
+---------------------+------------+
|
||||
```
|
||||
|
||||
The flash is divided into the following regions, as obtained with
|
||||
`ifdtool -f rom.layout backup.rom`:
|
||||
```
|
||||
00000000:00000fff fd
|
||||
00200000:007fffff bios
|
||||
00001000:001fffff me
|
||||
```
|
||||
|
||||
### Internal programming
|
||||
|
||||
The main SPI flash can be accessed using flashrom. By default, only
|
||||
the BIOS region of the flash is writable. If you wish to change any
|
||||
other region (Management Engine or flash descriptor), then an external
|
||||
programmer is required.
|
||||
|
||||
The following command may be used to flash coreboot:
|
||||
|
||||
```
|
||||
$ sudo flashrom --noverify-all --ifd -i bios -p internal -w coreboot.rom
|
||||
```
|
||||
|
||||
The use of `--noverify-all` is required since the Management Engine
|
||||
region is not readable even by the host.
|
||||
|
||||
```eval_rst
|
||||
In addition to the information here, please see the
|
||||
:doc:`../../flash_tutorial/index`.
|
||||
```
|
||||
|
||||
## Hardware monitoring and fan control
|
||||
|
||||
There are two fan headers for the CPU cooler, CPU_FAN1 and CPU_FAN2. They share
|
||||
a single fan tachometer input on the Super I/O while some dedicated logic
|
||||
selects which one is allowed to reach it. Two GPIO pins on the Super I/O are
|
||||
used to control that logic. The firmware has to set them; coreboot selects
|
||||
CPU_FAN1 by default, but the user can change that setting if it was built with
|
||||
CONFIG_USE_OPTION_TABLE:
|
||||
|
||||
```
|
||||
$ sudo nvramtool -e cpu_fan_header
|
||||
[..]
|
||||
$ sudo nvramtool -w cpu_fan_header=CPU_FAN2
|
||||
$ sudo nvramtool -w cpu_fan_header=None
|
||||
$ sudo nvramtool -w cpu_fan_header=Both
|
||||
```
|
||||
|
||||
The setting will take effect after a reboot. Selecting and connecting both fan
|
||||
headers is possible but the Super I/O will report wrong fan speeds.
|
||||
|
||||
Currently there is no automatic, OS-independent fan control, but a software
|
||||
like `fancontrol` from the lm-sensors package can be used instead.
|
||||
|
||||
## Serial port header
|
||||
|
||||
Serial port 1, provided by the Super I/O, is exposed on a pin header. The
|
||||
RS-232 signals are assigned to the header so that its pin numbers map directly
|
||||
to the pin numbers of a DE-9 connector. If your serial port doesn't seem to
|
||||
work, check if your bracket expects a different assignment. Also don't try to
|
||||
connect it directly to a device that operates at TTL levels - it would need a
|
||||
level converter like a MAX232.
|
||||
|
||||
Here is a top view of the serial port header found on this board:
|
||||
|
||||
+---+---+
|
||||
N/C | | 9 | RI -> pin 9
|
||||
+---+---+
|
||||
Pin 8 <- CTS | 8 | 7 | RTS -> pin 7
|
||||
+---+---+
|
||||
Pin 6 <- DSR | 6 | 5 | GND -> pin 5
|
||||
+---+---+
|
||||
Pin 4 <- DTR | 4 | 3 | TxD -> pin 3
|
||||
+---+---+
|
||||
Pin 2 <- RxD | 2 | 1 | DCD -> pin 1
|
||||
+---+---+
|
||||
|
||||
## eSATA
|
||||
|
||||
The eSATA port on the rear I/O panel and the internal connector SATA3_A1 share
|
||||
the same controller port on the ASM1061. Attaching an eSATA drive causes a
|
||||
multiplexer chip to disconnect the internal port from the SATA controller and
|
||||
connect the eSATA port instead. This can be seen on GP23 of the Super I/O
|
||||
GPIOs: it is '0' when something is connected to the eSATA port and '1'
|
||||
otherwise.
|
52
Documentation/mainboard/emulation/qemu-power9.md
Normal file
52
Documentation/mainboard/emulation/qemu-power9.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# QEMU PPC64 emulator
|
||||
This page describes how to build and run coreboot for QEMU/PPC64.
|
||||
|
||||
## Building coreboot
|
||||
```bash
|
||||
make defconfig KBUILD_DEFCONFIG=configs/config.emulation_qemu_power9
|
||||
make
|
||||
```
|
||||
|
||||
This builds coreboot with no payload.
|
||||
|
||||
## Payloads
|
||||
You can configure ELF or `skiboot` payload via `make menuconfig`. In either case
|
||||
you might need to adjust "ROM chip size" and make it large enough to accommodate
|
||||
the payload (see how much space it needs in the error you get if it doesn't
|
||||
fit).
|
||||
|
||||
## Running coreboot in QEMU
|
||||
```bash
|
||||
qemu-system-ppc64 -M powernv,hb-mode=on \
|
||||
-cpu power9 \
|
||||
-bios build/coreboot.rom \
|
||||
-drive file=build/coreboot.rom,if=mtd \
|
||||
-serial stdio \
|
||||
-display none
|
||||
```
|
||||
|
||||
- The default CPU in QEMU for AArch64 is a 604. You specify a suitable
|
||||
PowerPC CPU via `-cpu power9`.
|
||||
- By default Hostboot mode is off and needs to be turned on to run coreboot
|
||||
as a firmware rather than like an OS.
|
||||
- `-bios` specifies initial program (bootloader should suffice, but whole image
|
||||
works fine too).
|
||||
- `-drive` specifies image for emulated flash device.
|
||||
|
||||
## Running with a kernel
|
||||
Loading `skiboot` (built automatically by coreboot or otherwise) allows
|
||||
specifying kernel and root file system to be run.
|
||||
|
||||
```bash
|
||||
qemu-system-ppc64 -M powernv,hb-mode=on \
|
||||
-cpu power9 \
|
||||
-bios build/coreboot.rom \
|
||||
-drive file=build/coreboot.rom,if=mtd \
|
||||
-serial stdio \
|
||||
-display none \
|
||||
-kernel zImage \
|
||||
-initrd initrd.cpio.xz
|
||||
```
|
||||
|
||||
- Specify path to your kernel via `-kernel`.
|
||||
- Specify path to your rootfs via `-initrd`.
|
@@ -5,10 +5,7 @@ This page describes how to run coreboot on the Facebook FBG1701.
|
||||
FBG1701 are assembled with different onboard memory modules:
|
||||
Rev 1.0 Onboard Samsung K4B8G1646D-MYKO memory
|
||||
Rev 1.1 and 1.2 Onboard Micron MT41K512M16HA-125A memory
|
||||
Rev 1.3 Onboard Kingston B5116ECMDXGGB memory
|
||||
|
||||
Use make menuconfig to configure `onboard memory manufacturer Samsung` in
|
||||
Mainboard menu.
|
||||
Rev 1.3 and 1.4 Onboard Kingston B5116ECMDXGGB memory
|
||||
|
||||
## Required blobs
|
||||
|
||||
|
@@ -6,11 +6,16 @@ This section contains documentation about coreboot on specific mainboards.
|
||||
|
||||
- [X210](51nb/x210.md)
|
||||
|
||||
## Acer
|
||||
|
||||
- [G43T-AM3](acer/g43t-am3.md)
|
||||
|
||||
## AMD
|
||||
- [padmelon](amd/padmelon/padmelon.md)
|
||||
|
||||
## ASRock
|
||||
|
||||
- [H77 Pro4-M](asrock/h77pro4-m.md)
|
||||
- [H81M-HDS](asrock/h81m-hds.md)
|
||||
- [H110M-DVS](asrock/h110m-dvs.md)
|
||||
|
||||
@@ -172,6 +177,10 @@ The boards in this section are not real mainboards, but emulators.
|
||||
|
||||
- [SiFive HiFive Unleashed](sifive/hifive-unleashed.md)
|
||||
|
||||
## Star Labs Systems
|
||||
|
||||
- [StarBook Mk V](starlabs/starbook_tgl.md)
|
||||
|
||||
## Supermicro
|
||||
|
||||
- [X10SLM+-F](supermicro/x10slm-f.md)
|
||||
|
@@ -7,7 +7,16 @@ Delta Lake server platform.
|
||||
|
||||
OCP Delta Lake server platform is a component of multi-host server system
|
||||
Yosemite-V3. Both [Delta Lake server design spec] and [Yosemite-V3 design
|
||||
spec] were contributed to [OCP].
|
||||
spec] were [OCP] accepted.
|
||||
|
||||
On the other hand, Wiwynn's Yosemite-V3 system and Delta Lake server product
|
||||
along with its OSF implementation, which is based on FSP/coreboot/LinuxBoot
|
||||
stack, was [OCP] accepted; For details, check:
|
||||
- [The OCP blog]
|
||||
- [The Wiwynn Press Release]
|
||||
- [The Wiwynn's Yosemite-V3 product in OCP market place]
|
||||
Wiwynn and 9Elements formed a partnership to offer the Wiwynn's Yosemite-V3
|
||||
product and OSF for it.
|
||||
|
||||
Delta Lake server is a single socket Cooper Lake Scalable Processor (CPX-SP) server.
|
||||
Intel Cooper Lake Scalable Processor was launched in Q2 2020.
|
||||
@@ -15,7 +24,7 @@ Intel Cooper Lake Scalable Processor was launched in Q2 2020.
|
||||
Yosemite-V3 has multiple configurations. Depending on configurations, it may
|
||||
host up to 4 Delta Lake servers (blades) in one sled.
|
||||
|
||||
The Yosemite-V3 system is in mass production. Facebook, Intel and partners
|
||||
The Yosemite-V3 system is in mass production. Meta, Intel and partners
|
||||
jointly develop Open System Firmware (OSF) solution on Delta Lake as an alternative
|
||||
solution. The OSF solution is based on FSP/coreboot/LinuxBoot stack. The
|
||||
OSF solution reached production quality for some use cases in July, 2021.
|
||||
@@ -187,6 +196,9 @@ and [u-root] as initramfs.
|
||||
[OCP]: https://www.opencompute.org
|
||||
[Delta Lake server design spec]: https://www.opencompute.org/documents/delta-lake-1s-server-design-specification-1v05-pdf
|
||||
[Yosemite-V3 design spec]: https://www.opencompute.org/documents/ocp-yosemite-v3-platform-design-specification-1v16-pdf
|
||||
[The OCP blog]: https://www.opencompute.org/blog/open-system-firmware-for-ocp-server-deltalake-is-published
|
||||
[The Wiwynn Press Release]: https://www.prnewswire.com/news-releases/wiwynn-successfully-implemented-open-system-firmware-on-its-ocp-yosemite-v3-server-301417374.html?tc=eml_cleartime
|
||||
[The Wiwynn's Yosemite-V3 product in OCP market place]: https://www.opencompute.org/products/423/wiwynn-yosemite-v3-server
|
||||
[osf-builder]: https://github.com/facebookincubator/osf-builder
|
||||
[OCP virtual summit 2020]: https://www.opencompute.org/summit/virtual-summit/schedule
|
||||
[flashrom]: https://flashrom.org/Flashrom
|
||||
|
BIN
Documentation/mainboard/starlabs/BiosLock.jpg
Normal file
BIN
Documentation/mainboard/starlabs/BiosLock.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
BIN
Documentation/mainboard/starlabs/SwitchBranch.png
Normal file
BIN
Documentation/mainboard/starlabs/SwitchBranch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
Documentation/mainboard/starlabs/fwupdVersion.png
Normal file
BIN
Documentation/mainboard/starlabs/fwupdVersion.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
154
Documentation/mainboard/starlabs/starbook_tgl.md
Normal file
154
Documentation/mainboard/starlabs/starbook_tgl.md
Normal file
@@ -0,0 +1,154 @@
|
||||
# StarBook Mk V
|
||||
|
||||
## Specs
|
||||
|
||||
- CPU (full processor specs available at https://ark.intel.com)
|
||||
- Intel i7-1165G7 (Tiger Lake)
|
||||
- Intel i3-1110G4 (Tiger Lake)
|
||||
- EC
|
||||
- ITE IT5570E
|
||||
- Backlit Keyboard, with standard PS/2 keycodes and SCI hotkeys
|
||||
- Battery
|
||||
- Charger, using AC adapter or USB-C PD
|
||||
- Suspend / resume
|
||||
- GPU
|
||||
- Intel® Iris® Xe Graphics
|
||||
- GOP driver is recommended, VBT is provided
|
||||
- eDP 14-inch 1920x1080 LCD
|
||||
- HDMI video
|
||||
- USB-C DisplayPort video
|
||||
- Memory
|
||||
- 2 x DDR4 SODIMM
|
||||
- Networking
|
||||
- AX201 2230 WiFi / Bluetooth
|
||||
- Sound
|
||||
- Realtek ALC256
|
||||
- Internal speakers
|
||||
- Internal microphone
|
||||
- Combined headphone / microphone 3.5-mm jack
|
||||
- HDMI audio
|
||||
- USB-C DisplayPort audio
|
||||
- Storage
|
||||
- M.2 PCIe SSD
|
||||
- RTS5129 MicroSD card reader
|
||||
- USB
|
||||
- 1280x720 CCD camera
|
||||
- Thunderbolt 4.0 (left)
|
||||
- USB 3.1 Gen 2 Type-A (left)
|
||||
- USB 3.1 Gen 1 Type-A (right)
|
||||
- USB 2.0 Type-A (right)
|
||||
|
||||
## Building coreboot
|
||||
|
||||
### Preliminaries
|
||||
|
||||
Prior to building coreboot the following files are required:
|
||||
* Intel Flash Descriptor file (descriptor.bin)
|
||||
* Intel Management Engine firmware (me.bin)
|
||||
* ITE Embedded Controller firmware (ec.bin)
|
||||
|
||||
The files listed below are optional:
|
||||
- Splash screen image in Windows 3.1 BMP format (Logo.bmp)
|
||||
|
||||
These files exist in the correct location in the StarLabsLtd/blobs repo on GitHub which is used in place of the standard 3rdparty/blobs repo.
|
||||
|
||||
### Build
|
||||
|
||||
The following commands will build a working image:
|
||||
|
||||
```bash
|
||||
make distclean
|
||||
make defconfig KBUILD_DEFCONFIG=configs/config.starlabs_starbook_tgl
|
||||
make
|
||||
```
|
||||
|
||||
## Flashing coreboot
|
||||
|
||||
```eval_rst
|
||||
+---------------------+------------+
|
||||
| Type | Value |
|
||||
+=====================+============+
|
||||
| Socketed flash | no |
|
||||
+---------------------+------------+
|
||||
| Vendor | Winbond |
|
||||
+---------------------+------------+
|
||||
| Model | 25Q128JVSQ |
|
||||
+---------------------+------------+
|
||||
| Size | 16 MiB |
|
||||
+---------------------+------------+
|
||||
| Package | SOIC-8 |
|
||||
+---------------------+------------+
|
||||
| Internal flashing | yes |
|
||||
+---------------------+------------+
|
||||
| External flashing | yes |
|
||||
+---------------------+------------+
|
||||
|
||||
#### **Requirements:**
|
||||
|
||||
* fwupd version 1.5.6 or later
|
||||
* The battery must be charged to at least 30%
|
||||
* The charger must be connected (either USB-C or DC Jack)
|
||||
* BIOS Lock must be disabled
|
||||
* Supported Linux distribution (Ubuntu 20.04 +, Linux Mint 20.1 + elementaryOS 6 +, Manjaro 21+)
|
||||
|
||||
**fwupd 1.5.6 or later**
|
||||
To check the version of **fwupd** you have installed, open a terminal window and enter the below command:
|
||||
|
||||
```
|
||||
fwupdmgr --version
|
||||
```
|
||||
|
||||
This will show the version number. **1.5.6** or greater will work.
|
||||

|
||||
On Ubuntu 20.04, Ubuntu 20.10, Linux Mint 20.1 and elementaryOS 6, fwupd 1.5.6 can be installed from our PPA with the below terminal commands:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:starlabs/ppa
|
||||
sudo apt update
|
||||
sudo apt install fwupd
|
||||
```
|
||||
|
||||
On Manjaro:
|
||||
|
||||
```
|
||||
sudo pacman -Sy fwupd-git flashrom-starlabs
|
||||
```
|
||||
|
||||
Instructions for other distributions will be added once fwupd 1.5.6 is available. If you are not using one of the distributions listed above, it is possible to install coreboot using a Live USB.
|
||||
|
||||
**Disable BIOS Lock**
|
||||
BIOS Lock must be disabled when switching from the standard AMI (American Megatrends Inc.) firmware to coreboot. To disable BIOS Lock:
|
||||
|
||||
1\. Start with your LabTop turned off\. Turn it on whilst holding the **F2** key to access the BIOS settings.
|
||||
2\. When the BIOS settings load, use the arrow keys to navigate to the **Advanced** tab\. Here you will see **BIOS Lock**\.
|
||||
3\. Press `Enter` to change this setting from **Enabled** to **Disabled**
|
||||
|
||||

|
||||
|
||||
4\. Next, press the `F10` key to **Save & Exit** and then `Enter` to confirm.
|
||||
|
||||
#### **Switching Branch**
|
||||
|
||||
Switching branch refers to changing from AMI firmware to coreboot, or vice versa.
|
||||
|
||||
First, check for new firmware files with the below terminal command:
|
||||
|
||||
```
|
||||
fwupdmgr refresh --force
|
||||
```
|
||||
|
||||
Then, to change branch, enter the below terminal command:
|
||||
|
||||
```
|
||||
fwupdmgr switch-branch
|
||||
```
|
||||
|
||||
You can then select which branch you would like to use, by typing in the corresponding number:
|
||||

|
||||
You will be prompted to confirm, press `y` to continue or `n` to cancel.
|
||||
|
||||
Once the switch has been completed, you will be prompted to restart.
|
||||
|
||||
The next reboot can take up to **5 minutes,** do not interrupt this process or disconnect the charger. Once the reboot is complete, that's it - you'll continue to receive updates for whichever branch you are using.
|
||||
|
||||
You can switch branch at any time.
|
@@ -17,3 +17,11 @@ Significant changes
|
||||
-------------------
|
||||
|
||||
### Add significant changes here
|
||||
|
||||
### Option to disable Intel Management Engine
|
||||
Disable the Intel (Converged Security) Management Engine ((CS)ME) via HECI based
|
||||
on Intel Core processors from Skylake to Alder Lake. State is set based on a
|
||||
CMOS value of `me_state`. A value of `0` will result in a (CS)ME state of `0`
|
||||
(working) and value of `1` will result in a (CS)ME state of `3` (disabled). For
|
||||
an example CMOS layout and more info, see
|
||||
[cse.c](../../src/soc/intel/common/block/cse/cse.c).
|
||||
|
19
Documentation/releases/coreboot-4.17-relnotes.md
Normal file
19
Documentation/releases/coreboot-4.17-relnotes.md
Normal file
@@ -0,0 +1,19 @@
|
||||
Upcoming release - coreboot 4.17
|
||||
================================
|
||||
|
||||
The 4.17 release is planned for May, 2022.
|
||||
|
||||
We are continuing the quarterly release cadence in order to enable others to
|
||||
release quarterly on a fresher version of coreboot.
|
||||
|
||||
Update this document with changes that should be in the release notes.
|
||||
|
||||
* Please use Markdown.
|
||||
* See the past few release notes for the general format.
|
||||
* The chip and board additions and removals will be updated right
|
||||
before the release, so those do not need to be added.
|
||||
|
||||
Significant changes
|
||||
-------------------
|
||||
|
||||
### Add significant changes here
|
@@ -23,6 +23,11 @@ names etc.
|
||||
|
||||
* [checklist](checklist.md)
|
||||
|
||||
For release related communications consider using a template so everything
|
||||
important is taken care of.
|
||||
|
||||
* [templates](templates.md)
|
||||
|
||||
Upcoming release
|
||||
----------------
|
||||
|
||||
|
83
Documentation/releases/templates.md
Normal file
83
Documentation/releases/templates.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# Communication templates related to release management
|
||||
|
||||
## Deprecation notices
|
||||
|
||||
Deprecation notices are part of release notes to act as a warning: at some
|
||||
point in the future some part of coreboot gets removed. That point must be
|
||||
at least 6 months after the release of the notice and it must be right after
|
||||
some release: That is, the specified release must still contain the part in
|
||||
question while one git commit later it might be removed.
|
||||
|
||||
The usual reason is progress: Infrastructure module X has been replaced by
|
||||
infrastructure module X+1. Removing X helps keep the sources manageable
|
||||
and likely opens opportunities to improve the codebase even more.
|
||||
Sometimes everything using some module has been converted to its successor
|
||||
already and it's natural for such modules to be removed. Even then it might
|
||||
be useful to add an entry to the release notes to make everybody aware of
|
||||
such a change, for maintainers of incomplete boards that they might keep in
|
||||
their local trees and also to give credit to the developers of that change.
|
||||
|
||||
However this template isn't about such cases. Sometimes the tree contains
|
||||
mainboards that rely on X and can't be easily migrated to X+1, often because
|
||||
no active developer has access to these mainboards, and that is where this
|
||||
type of deprecation notice comes in:
|
||||
|
||||
A deprecation notice shall outline what is being removed, when it is planned
|
||||
for removal (always directly _after_ a future release so it remains clear when
|
||||
something is part of coreboot and when it isn't anymore) and which devices
|
||||
would be affected at the time of writing. Since past deprecation notices have
|
||||
been read as "we plan to remove mainboards A, B, and C", sparking outrage
|
||||
with the devoted users of A, B, or C, some care is necessary to make clear
|
||||
which parts are slated for removal and which parts are merely consequences
|
||||
if no action is taken. Or put differently: It should be obvious that besides
|
||||
the deprecation plan, there is a call to action to save a couple of devices
|
||||
from becoming officially unsupported.
|
||||
|
||||
As such, consider the following template when announcing a deprecation:
|
||||
|
||||
### The Thing to remove
|
||||
|
||||
A short description of the Thing slated for removal.
|
||||
|
||||
A short rationale why it's being removed (e.g. new and better Thing exists
|
||||
in parallel; new Thing already demonstrated to work in this many releases;
|
||||
removing Thing enables this or that improvement)
|
||||
|
||||
Timeline: Announced here, Thing will be removed right after the release X
|
||||
months out (where X >= 6)
|
||||
|
||||
#### Call to action
|
||||
|
||||
Removing Thing requires work on a number of (boards, chipsets, …) that didn't
|
||||
make the switch yet. The work approximately looks like this: (e.g. pointers to
|
||||
commits where a board has been successfully migrated from Thing to new Thing).
|
||||
|
||||
Working on migrating away from Thing involves (hardware components, coreboot
|
||||
systems, …) 1, 2, and 3. It's difficult to do on the remaining devices because
|
||||
...
|
||||
|
||||
Parts of the tree that need work to become independent of Thing.
|
||||
- chipset A
|
||||
- board A1
|
||||
- board A2
|
||||
- chipset B
|
||||
- board B1
|
||||
|
||||
We prefer to move them along, but if we don't see any maintenance in our tree
|
||||
we'll have to assume that there's no more interest in these platforms. As a
|
||||
consequence these devices either have to work without Thing by the removal
|
||||
date or they will be removed together with Thing. (side note: these removals
|
||||
aren't the law, so if there's work in progress to move boards off X and a
|
||||
roadmap that makes it probable to succeed, just not within the announced
|
||||
deprecation timeline, we can still decide to postpone the actual removal by
|
||||
one release. This needn't be put in the release notes themselves though or
|
||||
it might encourage people to look for simple escape hatches.)
|
||||
|
||||
(If there are developers offering to write patches: )
|
||||
There are developers interested in helping move these forward but they can't
|
||||
test any changes for lack of equipment. If you have an affected device and
|
||||
can run tests on it, please reach out to developers α, β, and γ.
|
||||
|
||||
(Otherwise maybe something more generic like this: )
|
||||
If you want to take this on, the coreboot developer community will try to
|
||||
help you: Reach out through one of our [forums](../community/forums.md).
|
@@ -2,6 +2,18 @@
|
||||
|
||||
This section contains documentation about Intel-FSP in public domain.
|
||||
|
||||
## Integration Guidelines
|
||||
|
||||
Some guiding principles when working on the glue to integrate FSP into
|
||||
coreboot, e.g. on how to configure a board in devicetree when that affects
|
||||
the way FSP works:
|
||||
|
||||
* It should be possible to replace FSP based boot with a native coreboot
|
||||
implementation for a given chipset without touching the mainboard code.
|
||||
* The devicetree configures coreboot and part of what coreboot does with the
|
||||
information is setting some FSP UPDs. The devicetree isn't supposed to
|
||||
directly configure FSP.
|
||||
|
||||
## Bugs
|
||||
As Intel doesn't even list known bugs, they are collected here until
|
||||
those are fixed. If possible a workaround is described here as well.
|
||||
|
@@ -1,9 +1,9 @@
|
||||
# NCT5539D SuperIO
|
||||
# NCT5539D Super I/O
|
||||
|
||||
The SuperIO has the ID `0xd121` and the source can be found in
|
||||
The Super I/O has the ID `0xd121` and the source can be found in
|
||||
`src/superio/nuvoton/nct5539d/`.
|
||||
|
||||
## For developers
|
||||
|
||||
The SuperIO generates ACPI using the
|
||||
The Super I/O generates ACPI using the
|
||||
[SSDT generator for generic SuperIOs](../common/ssdt.md).
|
||||
|
@@ -12,37 +12,24 @@ select **Google OAuth2** (gerrit-oauth-provider plugin). **Note:** Your
|
||||
username for the account will be the username of the account you used to
|
||||
sign-in with. (ex. your Google username).
|
||||
|
||||
## Step 2a: Set up RSA Private/Public Key
|
||||
## Step 2a: Set up SSH keys
|
||||
|
||||
If you prefer to use an HTTP password instead, skip to Step 2b.
|
||||
|
||||
For the most up-to-date instructions on how to set up SSH keys with Gerrit go to
|
||||
<https://gerrit-documentation.storage.googleapis.com/Documentation/2.14.2/user-upload.html#configure_ssh>
|
||||
and follow the instructions there. Then, skip to Step 3.
|
||||
|
||||
Additionally, that section of the Web site provides explanation on starting
|
||||
an ssh-agent, which may be particularly helpful for those who anticipate
|
||||
frequently uploading changes.
|
||||
|
||||
If you instead prefer to have review.coreboot.org specific instructions,
|
||||
follow the steps below. Note that this particular section may have the
|
||||
most up-to-date instructions.
|
||||
|
||||
If you do not have an RSA key set up on your account already (as is the case
|
||||
If you do not have an SSH key set up on your account already (as is the case
|
||||
with a newly created account), follow the instructions below; otherwise,
|
||||
doing so could overwrite an existing key.
|
||||
|
||||
In the upper right corner, select your name and click on **Settings**.
|
||||
Select **SSH Public Keys** on the left-hand side.
|
||||
|
||||
In a terminal, run `ssh-keygen` and confirm the default path `.ssh/id_rsa`.
|
||||
In a terminal, run `ssh-keygen -t ed25519` and confirm the default path
|
||||
`.ssh/id_ed25519`.
|
||||
|
||||
Make a passphrase -- remember this phrase. It will be needed whenever you use
|
||||
this RSA Public Key. **Note:** You might want to use a short password, or
|
||||
this public key. **Note:** You might want to use a short password, or
|
||||
forego the password altogether as you will be using it very often.
|
||||
|
||||
Open `id_rsa.pub`, copy all contents and paste into the textbox under
|
||||
"Add SSH Public Key" in the https://review.coreboot.org webpage.
|
||||
Copy the content of `.ssh/id_ed25519.pub` (notice the ".pub" suffix
|
||||
as you need to send the public key) into the textbox "New SSH Key" at
|
||||
https://review.coreboot.org/settings/#SSHKeys and save it.
|
||||
|
||||
## Step 2b: Set up an HTTP Password
|
||||
|
||||
@@ -173,7 +160,9 @@ When you are done with your commit, run `git push` to push your commit to
|
||||
coreboot.org. **Note:** To submit as a private patch, use
|
||||
`git push origin HEAD:refs/for/master%private`. Submitting as a private patch
|
||||
means that your commit will be on review.coreboot.org, but is only visible to
|
||||
yourself and those you add as reviewers.
|
||||
yourself and those you add as reviewers. This mode isn't perfect: Somebody who
|
||||
knows the commit ID can still fetch the change and everything it refers (e.g.
|
||||
parent commits).
|
||||
|
||||
This has been a quick primer on how to submit a change to Gerrit for review
|
||||
using git. You may wish to review the [Gerrit code review workflow
|
||||
|
@@ -12,6 +12,8 @@ settings. `Perl`
|
||||
* __apcb__ - AMD PSP Control Block tools
|
||||
* _apcb_edit.py_ - This tool allows patching an existing APCB
|
||||
binary with specific SPDs and GPIO selection pins. `Python3`
|
||||
* _apcb_v3_edit.py_ - This tool allows patching an existing APCB V3
|
||||
binary with specific SPDs. `Python3`
|
||||
* __archive__ - Concatenate files and create an archive `C`
|
||||
* __autoport__ - Automated porting coreboot to Sandy Bridge/Ivy Bridge
|
||||
platforms `Go`
|
||||
|
42
MAINTAINERS
42
MAINTAINERS
@@ -142,6 +142,7 @@ M: Marshall Dawson <marshalldawson3rd@gmail.com>
|
||||
M: Felix Held <felix-coreboot@felixheld.de>
|
||||
M: Jason Glenesk <jason.glenesk@gmail.com>
|
||||
S: Maintained
|
||||
F: src/mainboard/amd/chausie/
|
||||
F: src/mainboard/amd/majolica/
|
||||
F: src/mainboard/amd/mandolin/
|
||||
|
||||
@@ -219,25 +220,18 @@ F: src/mainboard/clevo/
|
||||
|
||||
FACEBOOK FBG1701 MAINBOARD
|
||||
M: Frans Hendriks <fhendriks@eltan.com>
|
||||
M: Wim Vervoorn <wvervoorn@eltan.com>
|
||||
M: Erik van den Bogaert <ebogaert@eltan.com>
|
||||
S: Maintained
|
||||
F: src/mainboard/facebook/fbg1701/
|
||||
|
||||
FACEBOOK MONOLITH MAINBOARD
|
||||
M: Frans Hendriks <fhendriks@eltan.com>
|
||||
M: Wim Vervoorn <wvervoorn@eltan.com>
|
||||
M: Erik van den Bogaert <ebogaert@eltan.com>
|
||||
S: Maintained
|
||||
F: src/mainboard/facebook/monolith/
|
||||
|
||||
|
||||
|
||||
GETAC P470 MAINBOARD
|
||||
M: Patrick Georgi <patrick@georgi.software>
|
||||
S: Maintained
|
||||
F: src/mainboard/getac/p470/
|
||||
|
||||
|
||||
|
||||
GIGABYTE GA-D510UD MAINBOARD
|
||||
M: Angel Pons <th3fanbus@gmail.com>
|
||||
S: Maintained
|
||||
@@ -401,7 +395,7 @@ F: src/mainboard/pcengines/
|
||||
|
||||
PORTWELL PQ-M107 MAINBOARD
|
||||
M: Frans Hendriks <fhendriks@eltan.com>
|
||||
M: Wim Vervoorn <wvervoorn@eltan.com>
|
||||
M: Erik van den Bogaert <ebogaert@eltan.com>
|
||||
S: Maintained
|
||||
F: src/mainboard/portwell/m107/
|
||||
|
||||
@@ -451,6 +445,13 @@ F: src/mainboard/siemens/mc_apl1/
|
||||
|
||||
|
||||
|
||||
STAR LABS MAINBOARDS
|
||||
M: Sean Rhodes <sean@starlabs.systems>
|
||||
S: Maintained
|
||||
F: src/mainboard/starlabs/
|
||||
|
||||
|
||||
|
||||
SYSTEM76 MAINBOARDS
|
||||
M: Jeremy Soller <jeremy@system76.com>
|
||||
M: Tim Crawford <tcrawford@system76.com>
|
||||
@@ -523,6 +524,11 @@ M: Alexander Couzens <lynxis@fe80.eu>
|
||||
S: Maintained
|
||||
F: src/ec/lenovo/
|
||||
|
||||
STARLABS EC
|
||||
M: Sean Rhodes <sean@starlabs.systems>
|
||||
S: Maintained
|
||||
F: src/ec/starlabs/
|
||||
|
||||
SYSTEM76 EC
|
||||
M: Jeremy Soller <jeremy@system76.com>
|
||||
M: Tim Crawford <tcrawford@system76.com>
|
||||
@@ -628,6 +634,15 @@ S: Maintained
|
||||
F: src/soc/amd/picasso/
|
||||
F: src/vendorcode/amd/fsp/picasso/
|
||||
|
||||
AMD Sabrina
|
||||
M: Marshall Dawson <marshalldawson3rd@gmail.com>
|
||||
M: Felix Held <felix-coreboot@felixheld.de>
|
||||
M: Jason Glenesk <jason.glenesk@gmail.com>
|
||||
M: Raul E Rangel <rrangel@chromium.org>
|
||||
S: Maintained
|
||||
F: src/soc/amd/sabrina/
|
||||
F: src/vendorcode/amd/fsp/sabrina/
|
||||
|
||||
AMD Stoneyridge
|
||||
M: Marshall Dawson <marshalldawson3rd@gmail.com>
|
||||
M: Felix Held <felix-coreboot@felixheld.de>
|
||||
@@ -719,7 +734,6 @@ F: payloads/external/LinuxBoot/
|
||||
################################################################################
|
||||
|
||||
ABUILD
|
||||
M: Patrick Georgi <patrick@georgi-clan.de>
|
||||
M: Martin Roth <gaumless@gmail.com>
|
||||
S: Supported
|
||||
F: util/abuild/
|
||||
@@ -728,7 +742,6 @@ BOARD STATUS
|
||||
F: util/board_status/
|
||||
|
||||
BUILD SYSTEM
|
||||
M: Patrick Georgi <patrick@georgi-clan.de>
|
||||
M: Martin Roth <gaumless@gmail.com>
|
||||
S: Supported
|
||||
F: Makefile
|
||||
@@ -752,7 +765,6 @@ F: .git*
|
||||
F: /util/gitconfig
|
||||
|
||||
LINT SCRIPTS
|
||||
M: Patrick Georgi <patrick@georgi-clan.de>
|
||||
M: Martin Roth <gaumless@gmail.com>
|
||||
S: Supported
|
||||
F: util/lint/
|
||||
@@ -876,7 +888,7 @@ F: *.ld
|
||||
|
||||
ELTAN VENDORCODE
|
||||
M: Frans Hendriks <fhendriks@eltan.com>
|
||||
M: Wim Vervoorn <wvervoorn@eltan.com>
|
||||
M: Erik van den Bogaert <ebogaert@eltan.com>
|
||||
S: Maintained
|
||||
F: src/vendorcode/eltan/
|
||||
|
||||
@@ -890,6 +902,7 @@ TESTS
|
||||
M: Jakub Czapiga <jacz@semihalf.com>
|
||||
S: Maintained
|
||||
F: tests/
|
||||
F: payloads/libpayload/tests/
|
||||
|
||||
MISSING: TIMERS / DELAYS
|
||||
|
||||
@@ -927,7 +940,6 @@ MISSING: SPI
|
||||
|
||||
CODE OF CONDUCT
|
||||
M: Stefan Reinauer <stefan.reinauer@coreboot.org>
|
||||
M: Patrick Georgi <patrick@coreboot.org>
|
||||
M: Ronald Minnich <rminnich@coreboot.org>
|
||||
M: Martin Roth <martin@coreboot.org>
|
||||
S: Maintained
|
||||
|
23
Makefile
23
Makefile
@@ -20,17 +20,6 @@ VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib)
|
||||
COREBOOT_EXPORTS := COREBOOT_EXPORTS
|
||||
COREBOOT_EXPORTS += top src srck obj objutil objk
|
||||
|
||||
# reproducible builds
|
||||
LANG:=C
|
||||
LC_ALL:=C
|
||||
TZ:=UTC0
|
||||
ifneq ($(NOCOMPILE),1)
|
||||
SOURCE_DATE_EPOCH := $(shell $(top)/util/genbuild_h/genbuild_h.sh . | sed -n 's/^.define COREBOOT_BUILD_EPOCH\>.*"\(.*\)".*/\1/p')
|
||||
endif
|
||||
# don't use COREBOOT_EXPORTS to ensure build steps outside the coreboot build system
|
||||
# are reproducible
|
||||
export LANG LC_ALL TZ SOURCE_DATE_EPOCH
|
||||
|
||||
DOTCONFIG ?= $(top)/.config
|
||||
KCONFIG_CONFIG = $(DOTCONFIG)
|
||||
KCONFIG_AUTOADS := $(obj)/cb-config.ads
|
||||
@@ -63,6 +52,7 @@ ifneq ($(V),1)
|
||||
ifneq ($(Q),)
|
||||
.SILENT:
|
||||
MAKEFLAGS += -s
|
||||
quiet_errors := 2>/dev/null
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -175,6 +165,17 @@ $(error $(xcompile) deleted because it's invalid. \
|
||||
Restarting the build should fix that, or explain the problem)
|
||||
endif
|
||||
|
||||
# reproducible builds
|
||||
LANG:=C
|
||||
LC_ALL:=C
|
||||
TZ:=UTC0
|
||||
ifneq ($(NOCOMPILE),1)
|
||||
SOURCE_DATE_EPOCH := $(shell $(top)/util/genbuild_h/genbuild_h.sh . | sed -n 's/^.define COREBOOT_BUILD_EPOCH\>.*"\(.*\)".*/\1/p')
|
||||
endif
|
||||
# don't use COREBOOT_EXPORTS to ensure build steps outside the coreboot build system
|
||||
# are reproducible
|
||||
export LANG LC_ALL TZ SOURCE_DATE_EPOCH
|
||||
|
||||
ifneq ($(CONFIG_MMX),y)
|
||||
CFLAGS_x86_32 += -mno-mmx
|
||||
endif
|
||||
|
47
Makefile.inc
47
Makefile.inc
@@ -189,29 +189,29 @@ ramstage-generic-ccopts += -D__RAMSTAGE__
|
||||
ifeq ($(CONFIG_COVERAGE),y)
|
||||
ramstage-c-ccopts += -fprofile-arcs -ftest-coverage
|
||||
endif
|
||||
|
||||
ifneq ($(UPDATED_SUBMODULES),1)
|
||||
# try to fetch non-optional submodules if the source is under git
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init $(quiet_errors)))
|
||||
# Checkout Cmocka repository
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/cmocka))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/cmocka $(quiet_errors)))
|
||||
ifeq ($(CONFIG_USE_BLOBS),y)
|
||||
# These items are necessary because each has update=none in .gitmodules. They are ignored
|
||||
# until expressly requested and enabled with --checkout
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/intel-microcode))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs $(quiet_errors)))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/intel-microcode $(quiet_errors)))
|
||||
ifeq ($(CONFIG_FSP_USE_REPO),y)
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/fsp))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/fsp $(quiet_errors)))
|
||||
endif
|
||||
ifeq ($(CONFIG_USE_AMD_BLOBS),y)
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/amd_blobs))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/amd_blobs $(quiet_errors)))
|
||||
endif
|
||||
ifeq ($(CONFIG_USE_QC_BLOBS),y)
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/qc_blobs))
|
||||
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/qc_blobs $(quiet_errors)))
|
||||
endif
|
||||
endif
|
||||
UPDATED_SUBMODULES:=1
|
||||
COREBOOT_EXPORTS += UPDATED_SUBMODULES
|
||||
|
||||
endif
|
||||
|
||||
postcar-c-deps:=$$(OPTION_TABLE_H)
|
||||
@@ -263,15 +263,24 @@ EMPTY_RESOURCE_TEMPLATE_WARNING = 3150
|
||||
# Redundant offset remarks are not useful in any way and are masking useful
|
||||
# ones that might indicate an issue so it is better to hide them.
|
||||
REDUNDANT_OFFSET_REMARK = 2158
|
||||
# Ignore _HID & _ADR coexisting in Intel Lynxpoint ASL code.
|
||||
# See cb:38802
|
||||
# "Multiple types (Device object requires either a _HID or _ADR, but not both)"
|
||||
MULTIPLE_TYPES_WARNING = 3073
|
||||
# IASL compiler check for usage of _CRS, _DIS, _PRS, and _SRS objects:
|
||||
# 1) If _PRS is present, must have _CRS and _SRS
|
||||
# 2) If _SRS is present, must have _PRS (_PRS requires _CRS and _SRS)
|
||||
# 3) If _DIS is present, must have _SRS (_SRS requires _PRS, _PRS requires _CRS and _SRS)
|
||||
# 4) If _SRS is present, probably should have a _DIS (Remark only)
|
||||
# A warning will be issued for each of these cases.
|
||||
# For existing ASL code, ignore this warnings
|
||||
IASL_MISSING_DEPENDENCY = 3141
|
||||
|
||||
IASL_WARNINGS_LIST = $(EMPTY_RESOURCE_TEMPLATE_WARNING) $(REDUNDANT_OFFSET_REMARK)
|
||||
|
||||
ifeq ($(CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT),y)
|
||||
IASL_WARNINGS_LIST += $(MULTIPLE_TYPES_WARNING)
|
||||
ifeq ($(CONFIG_IGNORE_IASL_MISSING_DEPENDENCY),y)
|
||||
IASL_WARNINGS_LIST += $(IASL_MISSING_DEPENDENCY)
|
||||
build_complete::
|
||||
printf "*** WARNING: The ASL code for this platform is incomplete. Please fix it. ***\n"
|
||||
printf "*** If _PRS is present, must have _CRS and _SRS ***\n"
|
||||
printf "*** If _SRS is present, must have _PRS, _CRS, and _SRS ***\n"
|
||||
printf "*** If _DIS is present, must have _SRS, _PRS, _CRS, and _SRS ***\n"
|
||||
endif
|
||||
|
||||
IGNORED_IASL_WARNINGS = $(addprefix -vw , $(IASL_WARNINGS_LIST))
|
||||
@@ -280,6 +289,9 @@ define asl_template
|
||||
$(CONFIG_CBFS_PREFIX)/$(1).aml-file = $(obj)/$(1).aml
|
||||
$(CONFIG_CBFS_PREFIX)/$(1).aml-type = raw
|
||||
$(CONFIG_CBFS_PREFIX)/$(1).aml-compression = none
|
||||
ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA),y)
|
||||
$(CONFIG_CBFS_PREFIX)/$(1).aml-align = 64
|
||||
endif
|
||||
cbfs-files-$(if $(2),$(2),y) += $(CONFIG_CBFS_PREFIX)/$(1).aml
|
||||
-include $(obj)/$(1).d
|
||||
$(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h
|
||||
@@ -441,6 +453,7 @@ ADAFLAGS_common += -pipe -g -nostdinc
|
||||
ADAFLAGS_common += -Wstrict-aliasing -Wshadow
|
||||
ADAFLAGS_common += -fno-common -fomit-frame-pointer
|
||||
ADAFLAGS_common += -ffunction-sections -fdata-sections
|
||||
ADAFLAGS_common += -fno-pie
|
||||
# Ada warning options:
|
||||
#
|
||||
# a Activate most optional warnings.
|
||||
@@ -588,6 +601,8 @@ AMDFWTOOL:=$(objutil)/amdfwtool/amdfwtool
|
||||
|
||||
APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
|
||||
|
||||
APCB_V3_EDIT_TOOL:=$(top)/util/apcb/apcb_v3_edit.py
|
||||
|
||||
CBOOTIMAGE:=$(objutil)/cbootimage/cbootimage
|
||||
|
||||
FUTILITY?=$(objutil)/futility/futility
|
||||
@@ -1214,6 +1229,10 @@ cbfs-files-$(CONFIG_HAVE_RAMSTAGE) += $(CONFIG_CBFS_PREFIX)/ramstage
|
||||
$(CONFIG_CBFS_PREFIX)/ramstage-file := $(RAMSTAGE)
|
||||
$(CONFIG_CBFS_PREFIX)/ramstage-type := stage
|
||||
$(CONFIG_CBFS_PREFIX)/ramstage-compression := $(CBFS_COMPRESS_FLAG)
|
||||
# The AMD LPC SPI DMA controller requires source files to be 64 byte aligned.
|
||||
ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA),y)
|
||||
$(CONFIG_CBFS_PREFIX)/ramstage-align := 64
|
||||
endif
|
||||
|
||||
cbfs-files-$(CONFIG_HAVE_REFCODE_BLOB) += $(CONFIG_CBFS_PREFIX)/refcode
|
||||
$(CONFIG_CBFS_PREFIX)/refcode-file := $(REFCODE_BLOB)
|
||||
|
1
configs/config.emulation_qemu_power9
Normal file
1
configs/config.emulation_qemu_power9
Normal file
@@ -0,0 +1 @@
|
||||
CONFIG_BOARD_EMULATION_QEMU_POWER9=y
|
@@ -8,3 +8,4 @@ CONFIG_DEBUG_PIRQ=y
|
||||
CONFIG_DEBUG_MALLOC=y
|
||||
CONFIG_DEBUG_BOOT_STATE=y
|
||||
CONFIG_DEBUG_ADA_CODE=y
|
||||
CONFIG_CPU_QEMU_X86_PARALLEL_MP=y
|
||||
|
@@ -1,6 +1,5 @@
|
||||
CONFIG_VENDOR_FACEBOOK=y
|
||||
CONFIG_BOARD_FACEBOOK_FBG1701=y
|
||||
CONFIG_ONBOARD_SAMSUNG_MEM=y
|
||||
CONFIG_CPU_MICROCODE_CBFS_LOC=0xFFF8B000
|
||||
CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
|
||||
CONFIG_CPU_UCODE_BINARIES="3rdparty/intel-microcode/intel-ucode/06-4c-04"
|
||||
|
8
configs/config.google_trogdor.build_test
Normal file
8
configs/config.google_trogdor.build_test
Normal file
@@ -0,0 +1,8 @@
|
||||
# Config to build test some optional Kconfigs on an Arm platform
|
||||
CONFIG_USE_BLOBS=y
|
||||
CONFIG_USE_QC_BLOBS=y
|
||||
CONFIG_VENDOR_GOOGLE=y
|
||||
CONFIG_BOARD_GOOGLE_TROGDOR=y
|
||||
CONFIG_CBFS_VERIFICATION=y
|
||||
CONFIG_TPM_MEASURED_BOOT=y
|
||||
CONFIG_PAYLOAD_NONE=y
|
@@ -30,3 +30,4 @@ CONFIG_DEBUG_MALLOC=y
|
||||
CONFIG_DEBUG_CONSOLE_INIT=y
|
||||
CONFIG_DEBUG_SPI_FLASH=y
|
||||
CONFIG_DEBUG_BOOT_STATE=y
|
||||
CONFIG_CBFS_VERIFICATION=y
|
||||
|
13
configs/config.prodrive_hermes
Normal file
13
configs/config.prodrive_hermes
Normal file
@@ -0,0 +1,13 @@
|
||||
# Settings used by Prodrive to build coreboot for the Hermes
|
||||
CONFIG_VENDOR_PRODRIVE=y
|
||||
CONFIG_BOARD_PRODRIVE_HERMES=y
|
||||
CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="Prodrive Techonologies B.V."
|
||||
CONFIG_POST_IO=y
|
||||
CONFIG_USE_LEGACY_8254_TIMER=y
|
||||
CONFIG_HERMES_USES_SPS_FIRMWARE=y
|
||||
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
|
||||
CONFIG_SMMSTORE=y
|
||||
CONFIG_SMMSTORE_V2=y
|
||||
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3=y
|
||||
CONFIG_POST_DEVICE_LPC=y
|
||||
CONFIG_MAINBOARD_SERIAL_NUMBER="N/A"
|
@@ -28,6 +28,7 @@ payloads/external/tianocore \
|
||||
payloads/external/GRUB2 \
|
||||
payloads/external/LinuxBoot \
|
||||
payloads/external/Yabits \
|
||||
payloads/external/skiboot \
|
||||
|
||||
force-payload:
|
||||
|
||||
@@ -48,5 +49,16 @@ distclean-payloads:
|
||||
print-repo-info-payloads:
|
||||
-$(foreach payload, $(PAYLOADS_LIST), $(MAKE) -C $(payload) print-repo-info 2>/dev/null; )
|
||||
|
||||
ifeq ($(CONFIG_PAYLOAD_NONE),y)
|
||||
files_added:: warn_no_payload
|
||||
endif
|
||||
|
||||
warn_no_payload:
|
||||
printf "\n\t** WARNING **\n"
|
||||
printf "coreboot has been built without a payload. Writing\n"
|
||||
printf "a coreboot image without a payload to your board's\n"
|
||||
printf "flash chip will result in a non-booting system. You\n"
|
||||
printf "can use cbfstool to add a payload to the image.\n\n"
|
||||
|
||||
.PHONY: force-payload coreinfo nvramcui
|
||||
.PHONY: clean-payloads distclean-payloads print-repo-info-payloads
|
||||
.PHONY: clean-payloads distclean-payloads print-repo-info-payloads warn_no_payload
|
||||
|
2
payloads/external/.gitignore
vendored
2
payloads/external/.gitignore
vendored
@@ -8,3 +8,5 @@ tint/tint/
|
||||
U-Boot/u-boot/
|
||||
Memtest86Plus/memtest86plus/
|
||||
iPXE/ipxe/
|
||||
skiboot/skiboot
|
||||
skiboot/build
|
||||
|
10
payloads/external/Makefile.inc
vendored
10
payloads/external/Makefile.inc
vendored
@@ -197,8 +197,9 @@ payloads/external/GRUB2/grub2/build/default_payload.elf: grub2
|
||||
|
||||
# U-Boot
|
||||
|
||||
payloads/external/U-Boot/u-boot/u-boot-dtb.bin u-boot: $(DOTCONFIG)
|
||||
payloads/external/U-Boot/build/u-boot.bin u-boot: $(DOTCONFIG)
|
||||
$(MAKE) -C payloads/external/U-Boot \
|
||||
STABLE_COMMIT_ID=$(CONFIG_UBOOT_STABLE_COMMIT_ID) \
|
||||
CONFIG_UBOOT_MASTER=$(CONFIG_UBOOT_MASTER) \
|
||||
CONFIG_UBOOT_STABLE=$(CONFIG_UBOOT_STABLE)
|
||||
|
||||
@@ -331,3 +332,10 @@ payloads/external/Yabits/uefi/build/uefi.elf yabits:
|
||||
|
||||
payloads/external/BOOTBOOT/bootboot/dist/bootbootcb.elf:
|
||||
$(MAKE) -C payloads/external/BOOTBOOT all
|
||||
|
||||
# skiboot
|
||||
|
||||
payloads/external/skiboot/build/skiboot.elf:
|
||||
$(MAKE) -C payloads/external/skiboot all \
|
||||
CONFIG_SKIBOOT_GIT_REPO=$(CONFIG_SKIBOOT_GIT_REPO) \
|
||||
CONFIG_SKIBOOT_REVISION=$(CONFIG_SKIBOOT_REVISION)
|
||||
|
11
payloads/external/U-Boot/Kconfig
vendored
11
payloads/external/U-Boot/Kconfig
vendored
@@ -3,13 +3,18 @@ if PAYLOAD_UBOOT
|
||||
config PAYLOAD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select PAYLOAD_IS_FLAT_BINARY
|
||||
select WANT_LINEAR_FRAMEBUFFER
|
||||
|
||||
config UBOOT_STABLE_COMMIT_ID
|
||||
string
|
||||
default "v2021.07"
|
||||
|
||||
choice
|
||||
prompt "U-Boot version"
|
||||
default UBOOT_STABLE
|
||||
|
||||
config UBOOT_STABLE
|
||||
bool "v2019.4"
|
||||
bool "v2021.07"
|
||||
help
|
||||
Stable U-Boot version
|
||||
|
||||
@@ -32,9 +37,9 @@ config PAYLOAD_CONFIGFILE
|
||||
from the U-Boot config directory
|
||||
|
||||
config PAYLOAD_FILE
|
||||
default "payloads/external/U-Boot/u-boot/u-boot-dtb.bin"
|
||||
default "payloads/external/U-Boot/build/u-boot.bin"
|
||||
|
||||
config PAYLOAD_OPTIONS
|
||||
default "-l 0x1110000 -e 0x1110015"
|
||||
default "-l 0x1110000 -e 0x1110000"
|
||||
|
||||
endif
|
||||
|
24
payloads/external/U-Boot/Makefile
vendored
24
payloads/external/U-Boot/Makefile
vendored
@@ -1,15 +1,15 @@
|
||||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# 2019-4 tag
|
||||
STABLE_COMMIT_ID=3c99166441bf3ea325af2da83cfe65430b49c066
|
||||
|
||||
TAG-$(CONFIG_UBOOT_MASTER)=origin/master
|
||||
TAG-$(CONFIG_UBOOT_STABLE)=$(STABLE_COMMIT_ID)
|
||||
|
||||
project_name=U-Boot
|
||||
project_dir=u-boot
|
||||
project_git_repo=http://git.denx.de/u-boot.git
|
||||
project_config_file=$(project_dir)/.config
|
||||
project_build_dir=build
|
||||
project_config_file=$(project_build_dir)/.config
|
||||
|
||||
make_args=-C $(project_dir) O=../build
|
||||
|
||||
unexport KCONFIG_AUTOHEADER
|
||||
unexport KCONFIG_AUTOCONFIG
|
||||
@@ -23,7 +23,7 @@ all: build
|
||||
|
||||
$(project_dir):
|
||||
echo " Cloning $(project_name) from Git"
|
||||
git clone $(project_git_repo) $(project_dir)
|
||||
git clone $(project_git_repo) -b $(TAG-y) $(project_dir)
|
||||
|
||||
fetch: $(project_dir)
|
||||
ifeq ($(CONFIG_UBOOT_MASTER),y)
|
||||
@@ -31,11 +31,11 @@ ifeq ($(CONFIG_UBOOT_MASTER),y)
|
||||
git fetch
|
||||
|
||||
#master doesn't get a file, so it's continuously updated
|
||||
rm -f $(project_dir)/$(STABLE_COMMIT_ID)
|
||||
rm -f $(STABLE_COMMIT_ID)
|
||||
else
|
||||
cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ]; \
|
||||
then echo " Fetching new commits from the $(project_name) git repo"; git fetch; fi
|
||||
touch $(project_dir)/$(STABLE_COMMIT_ID)
|
||||
touch $(STABLE_COMMIT_ID)
|
||||
endif
|
||||
|
||||
checkout: fetch
|
||||
@@ -43,26 +43,26 @@ checkout: fetch
|
||||
cd $(project_dir); git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
|
||||
|
||||
config: checkout
|
||||
mkdir -p $(project_build_dir)
|
||||
rm -f $(project_config_file)
|
||||
ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),)
|
||||
ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","")
|
||||
cat $(CONFIG_PAYLOAD_CONFIGFILE)" > tag-$(project_config_file)
|
||||
$(MAKE) $(make_args) olddefconfig
|
||||
else
|
||||
echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist"
|
||||
false
|
||||
endif
|
||||
else
|
||||
cat $(project_dir)/configs/coreboot_defconfig >> $(project_config_file)
|
||||
$(MAKE) $(make_args) coreboot_defconfig
|
||||
endif
|
||||
|
||||
$(MAKE) -C $(project_dir) olddefconfig
|
||||
|
||||
build: config
|
||||
echo " MAKE $(project_name) $(TAG-y)"
|
||||
$(MAKE) -C $(project_dir)
|
||||
$(MAKE) $(make_args)
|
||||
|
||||
clean:
|
||||
test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0
|
||||
test -d $(project_dir) && $(MAKE) $(make_args) clean || exit 0
|
||||
|
||||
distclean:
|
||||
rm -rf $(project_dir)
|
||||
|
21
payloads/external/skiboot/Kconfig
vendored
Normal file
21
payloads/external/skiboot/Kconfig
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
if PAYLOAD_SKIBOOT
|
||||
|
||||
config PAYLOAD_FILE
|
||||
default "payloads/external/skiboot/build/skiboot.elf"
|
||||
|
||||
config SKIBOOT_GIT_REPO
|
||||
string "Git repository of skiboot payload"
|
||||
default "https://github.com/open-power/skiboot"
|
||||
help
|
||||
Git repository which will be used to clone skiboot.
|
||||
|
||||
config SKIBOOT_REVISION
|
||||
string "Revision of skiboot payload"
|
||||
default "d93ddbd39b4eeac0bc11dacbdadea76df2996c13" if BOARD_EMULATION_QEMU_POWER9
|
||||
help
|
||||
Revision, that skiboot repository will be checked out to, before building
|
||||
an image.
|
||||
|
||||
endif # PAYLOAD_SKIBOOT
|
8
payloads/external/skiboot/Kconfig.name
vendored
Normal file
8
payloads/external/skiboot/Kconfig.name
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
config PAYLOAD_SKIBOOT
|
||||
bool "skiboot"
|
||||
depends on ARCH_PPC64
|
||||
help
|
||||
Select this option if you want to build a coreboot image
|
||||
with a skiboot payload.
|
36
payloads/external/skiboot/Makefile
vendored
Normal file
36
payloads/external/skiboot/Makefile
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
build_dir=$(CURDIR)/build
|
||||
skiboot_dir=$(CURDIR)/skiboot
|
||||
skiboot_git_repo=$(CONFIG_SKIBOOT_GIT_REPO)
|
||||
skiboot_revision=$(CONFIG_SKIBOOT_REVISION)
|
||||
skiboot_elf=$(build_dir)/skiboot.elf
|
||||
skiboot_cross=$(or $(CROSS),powerpc64-linux-gnu-)
|
||||
|
||||
unexport $(COREBOOT_EXPORTS)
|
||||
|
||||
.PHONY: all clean distclean
|
||||
|
||||
all: $(skiboot_elf)
|
||||
|
||||
$(skiboot_elf): | $(skiboot_dir) $(build_dir)
|
||||
+$(MAKE) -C $(skiboot_dir) CROSS="$(skiboot_cross)"
|
||||
cp $(skiboot_dir)/skiboot.elf $@
|
||||
# skiboot is always built with debug information due to unconditional -ggdb
|
||||
$(skiboot_cross)strip $@
|
||||
|
||||
$(skiboot_dir):
|
||||
git clone $(skiboot_git_repo) $(skiboot_dir)
|
||||
git -C $(skiboot_dir) checkout $(skiboot_revision)
|
||||
|
||||
$(build_dir):
|
||||
mkdir -p $(build_dir)
|
||||
|
||||
distclean: clean
|
||||
rm -rf $(skiboot_dir)
|
||||
|
||||
clean:
|
||||
# Redefine RM because it's used like `$(RM) non-existent-file`
|
||||
# Also ignore useless messages about removing test files
|
||||
[ ! -d $(skiboot_dir) ] || $(MAKE) -C $(skiboot_dir) RM="rm -rf" clean > /dev/null
|
||||
rm -rf $(build_dir)
|
@@ -208,11 +208,7 @@ config PDCURSES
|
||||
|
||||
endchoice
|
||||
|
||||
config CBFS
|
||||
bool "CBFS support"
|
||||
default y
|
||||
help
|
||||
CBFS is the archive format of coreboot
|
||||
source "libcbfs/Kconfig"
|
||||
|
||||
config LZMA
|
||||
bool "LZMA decoder"
|
||||
@@ -227,6 +223,9 @@ config LZ4
|
||||
help
|
||||
Decoder implementation for the LZ4 compression algorithm.
|
||||
Adds standalone functions (CBFS support coming soon).
|
||||
|
||||
source "vboot/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Console Options"
|
||||
|
@@ -29,16 +29,23 @@
|
||||
## SUCH DAMAGE.
|
||||
##
|
||||
|
||||
ifneq ($(words $(CURDIR)),1)
|
||||
$(error ERROR: Path to the main directory cannot contain spaces)
|
||||
endif
|
||||
|
||||
ifeq ($(INNER_SCANBUILD),y)
|
||||
CC_real:=$(CC)
|
||||
endif
|
||||
|
||||
export top := $(CURDIR)
|
||||
export coreboottop ?= $(abspath $(top)/../../)
|
||||
export src := src
|
||||
export srck := $(abspath $(top)/../../util/kconfig)
|
||||
export obj ?= build
|
||||
export objutil ?= $(obj)/util
|
||||
export objk := $(objutil)/lp_kconfig
|
||||
export absobj := $(abspath $(obj))
|
||||
VBOOT_SOURCE ?= $(coreboottop)/3rdparty/vboot
|
||||
|
||||
export KCONFIG_AUTOHEADER := $(obj)/config.h
|
||||
export KCONFIG_AUTOCONFIG := $(obj)/auto.conf
|
||||
@@ -289,9 +296,11 @@ includemakefiles= \
|
||||
$(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \
|
||||
$(foreach class,$(classes), \
|
||||
$(eval $(class)-srcs+= \
|
||||
$$(subst $(absobj)/,$(obj)/, \
|
||||
$$(subst $(top)/,, \
|
||||
$$(abspath $$(addprefix $(dir $(1)),$$($(class)-y)))))) \
|
||||
$(eval subdirs+=$$(subst $(CURDIR)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))
|
||||
$$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \
|
||||
$(eval subdirs+=$$(subst $(CURDIR)/,,$$(wildcard $$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))))
|
||||
|
||||
|
||||
# For each path in $(subdirs) call includemakefiles
|
||||
# Repeat until subdirs is empty
|
||||
@@ -310,8 +319,15 @@ else
|
||||
include $(TOPLEVEL)/tests/Makefile.inc
|
||||
endif
|
||||
|
||||
src-to-obj=$(addsuffix .$(1).o, $(basename $(addprefix $(obj)/, $($(1)-srcs))))
|
||||
$(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class))))
|
||||
# Converts one or more source file paths to the corresponding build/ paths.
|
||||
# $1 lib name
|
||||
# $2 file path (list)
|
||||
src-to-obj=\
|
||||
$(addsuffix .$(1).o,\
|
||||
$(basename \
|
||||
$(addprefix $(obj)/,\
|
||||
$(subst $(coreboottop)/,coreboot/,$(2)))))
|
||||
$(foreach class,$(classes),$(eval $(class)-objs+=$(call src-to-obj,$(class),$($(class)-srcs))))
|
||||
|
||||
allsrcs:=$(foreach var, $(addsuffix -srcs,$(classes)), $($(var)))
|
||||
allobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var)))
|
||||
@@ -325,7 +341,7 @@ define create_cc_template
|
||||
# $4 additional dependencies
|
||||
ifn$(EMPTY)def $(1)-objs_$(2)_template
|
||||
de$(EMPTY)fine $(1)-objs_$(2)_template
|
||||
$(obj)/$$(1).$(1).o: $$(1).$(2) $(obj)/libpayload-config.h $(4)
|
||||
$$(call src-to-obj,$(1), $$(1).$(2)): $$(1).$(2) $(obj)/libpayload-config.h $(4)
|
||||
@printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
|
||||
$(CC) $(3) -MMD $$$$(CFLAGS) $(EXTRA_CFLAGS) -c -o $$$$@ $$$$<
|
||||
en$(EMPTY)def
|
||||
@@ -340,7 +356,7 @@ $(foreach class,$(classes), \
|
||||
foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(basename $(file)))))
|
||||
$(eval $(foreach class,$(classes),$(call foreach-src,$(class))))
|
||||
|
||||
DEPENDENCIES = $(allobjs:.o=.d)
|
||||
DEPENDENCIES = $($(filter %.o,%(allobjs)):.o=.d)
|
||||
-include $(DEPENDENCIES)
|
||||
|
||||
printall:
|
||||
|
@@ -46,6 +46,8 @@ classes-$(CONFIG_LP_CBFS) += libcbfs
|
||||
classes-$(CONFIG_LP_LZMA) += liblzma
|
||||
classes-$(CONFIG_LP_LZ4) += liblz4
|
||||
classes-$(CONFIG_LP_REMOTEGDB) += libgdb
|
||||
classes-$(CONFIG_LP_VBOOT_LIB) += vboot_fw
|
||||
classes-$(CONFIG_LP_VBOOT_LIB) += tlcl
|
||||
libraries := $(classes-y)
|
||||
classes-y += head.o
|
||||
|
||||
@@ -55,9 +57,12 @@ subdirs-$(CONFIG_LP_CURSES) += curses
|
||||
subdirs-$(CONFIG_LP_CBFS) += libcbfs
|
||||
subdirs-$(CONFIG_LP_LZMA) += liblzma
|
||||
subdirs-$(CONFIG_LP_LZ4) += liblz4
|
||||
subdirs-$(CONFIG_LP_VBOOT_LIB) += vboot
|
||||
|
||||
INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj)
|
||||
INCLUDES += -include include/kconfig.h -include include/compiler.h
|
||||
INCLUDES += -I$(coreboottop)/src/commonlib/bsd/include
|
||||
INCLUDES += -I$(VBOOT_SOURCE)/firmware/include
|
||||
|
||||
CFLAGS += $(INCLUDES) -Os -pipe -nostdinc -ggdb3
|
||||
CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer
|
||||
@@ -90,11 +95,11 @@ includes-handler= \
|
||||
|
||||
$(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs))
|
||||
printf " AR $(subst $(CURDIR)/,,$(@))\n"
|
||||
$(AR) rc $@ $^
|
||||
printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
|
||||
|
||||
$(obj)/%.a: $$(%-objs)
|
||||
printf " AR $(subst $(CURDIR)/,,$(@))\n"
|
||||
$(AR) rc $@ $^
|
||||
printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
|
||||
|
||||
$(obj)/head.o: $(obj)/arch/$(ARCHDIR-y)/head.head.o.o
|
||||
printf " CP $(subst $(CURDIR)/,,$(@))\n"
|
||||
@@ -115,10 +120,24 @@ install: real-target
|
||||
install -m 755 -d $(DESTDIR)/libpayload/`dirname $$file`; \
|
||||
install -m 644 $$file $(DESTDIR)/libpayload/$$file; \
|
||||
done
|
||||
for file in `find $(coreboottop)/src/commonlib/bsd/include -name *.h -type f`; do \
|
||||
dest_file=$$(realpath --relative-to=$(coreboottop)/src/commonlib/bsd/ $$file); \
|
||||
install -m 755 -d "$(DESTDIR)/libpayload/`dirname $$dest_file`"; \
|
||||
install -m 644 "$$file" "$(DESTDIR)/libpayload/$$dest_file"; \
|
||||
done
|
||||
install -m 644 $(obj)/libpayload-config.h $(DESTDIR)/libpayload/include
|
||||
$(foreach item,$(includes), \
|
||||
install -m 755 -d $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); \
|
||||
install -m 644 $(call extract_nth,1,$(item)) $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); )
|
||||
printf " INSTALL $(DESTDIR)/libpayload/vboot\n"
|
||||
install -m 755 -d $(DESTDIR)/libpayload/vboot
|
||||
for file in `find $(VBOOT_SOURCE)/firmware/include \
|
||||
$(VBOOT_SOURCE)/firmware/2lib/include \
|
||||
-iname '*.h' -type f \
|
||||
| sed 's,$(VBOOT_SOURCE)/firmware/,,'`; do \
|
||||
install -m 755 -d $(DESTDIR)/libpayload/vboot/$$(dirname $$file); \
|
||||
install -m 644 $(VBOOT_SOURCE)/firmware/$$file $(DESTDIR)/libpayload/vboot/$$file ; \
|
||||
done
|
||||
printf " INSTALL $(DESTDIR)/libpayload/bin\n"
|
||||
install -m 755 -d $(DESTDIR)/libpayload/bin
|
||||
install -m 755 bin/lpgcc $(DESTDIR)/libpayload/bin
|
||||
|
@@ -5,3 +5,5 @@ head.o-y += head.c
|
||||
libc-y += virtual.c
|
||||
|
||||
libcbfs-$(CONFIG_LP_CBFS) += mock_media.c
|
||||
|
||||
CFLAGS += -Wno-address-of-packed-member
|
||||
|
17
payloads/libpayload/arch/x86/boot_media.c
Normal file
17
payloads/libpayload/arch/x86/boot_media.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#include <boot_device.h>
|
||||
#include <commonlib/bsd/cb_err.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <sysinfo.h>
|
||||
|
||||
__attribute__((weak)) ssize_t boot_device_read(void *buf, size_t offset, size_t size)
|
||||
{
|
||||
/* Memory-mapping usually only works for the top 16MB. */
|
||||
if (!lib_sysinfo.boot_media_size || lib_sysinfo.boot_media_size - offset > 16 * MiB)
|
||||
return CB_ERR_ARG;
|
||||
void *ptr = (void *)(uintptr_t)(0 - lib_sysinfo.boot_media_size + offset);
|
||||
memcpy(buf, ptr, size);
|
||||
return size;
|
||||
}
|
@@ -47,20 +47,12 @@ static void cb_parse_x86_rom_var_mtrr(void *ptr, struct sysinfo_t *info)
|
||||
info->x86_rom_var_mtrr_index = rom_mtrr->index;
|
||||
}
|
||||
|
||||
static void cb_parse_mrc_cache(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->mrc_cache = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
int cb_parse_arch_specific(struct cb_record *rec, struct sysinfo_t *info)
|
||||
{
|
||||
switch(rec->tag) {
|
||||
case CB_TAG_X86_ROM_MTRR:
|
||||
cb_parse_x86_rom_var_mtrr(rec, info);
|
||||
break;
|
||||
case CB_TAG_MRC_CACHE:
|
||||
cb_parse_mrc_cache(rec, info);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@@ -63,3 +63,9 @@ if [ -d $BASE/../include ]; then
|
||||
else
|
||||
_INCDIR=$LIBPAYLOAD_PREFIX/include
|
||||
fi
|
||||
|
||||
if [ -d $BASE/../vboot ]; then
|
||||
_VBOOTINCDIR=$BASE/../vboot/include
|
||||
else
|
||||
_VBOOTINCDIR=$LIBPAYLOAD_PREFIX/../vboot/include
|
||||
fi
|
||||
|
@@ -167,6 +167,11 @@ if [ $_LIBDIR = $_OBJ ]; then
|
||||
if [ "$CONFIG_LP_TINYCURSES" = y ]; then
|
||||
_CFLAGS="$_CFLAGS -I$BASE/../curses"
|
||||
fi
|
||||
|
||||
_CFLAGS="$_CFLAGS -I$BASE/../../../src/commonlib/bsd/include"
|
||||
_CFLAGS="$_CFLAGS -I$BASE/../../../3rdparty/vboot/firmware/include"
|
||||
else
|
||||
_CFLAGS="$_CFLAGS -I$_VBOOTINCDIR"
|
||||
fi
|
||||
|
||||
# Check for the -fno-stack-protector silliness
|
||||
|
@@ -29,6 +29,17 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __TEST__
|
||||
|
||||
/* CMocka function redefinition */
|
||||
void mock_assert(const int result, const char *const expression, const char *const file,
|
||||
const int line);
|
||||
|
||||
#define MOCK_ASSERT(result, expression) mock_assert((result), (expression), __FILE__, __LINE__)
|
||||
#define assert(statement) MOCK_ASSERT(!!(statement), #statement)
|
||||
|
||||
#else
|
||||
|
||||
// assert's existence depends on NDEBUG state on _last_ inclusion of assert.h,
|
||||
// so don't guard this against double-includes.
|
||||
#ifdef NDEBUG
|
||||
@@ -43,3 +54,5 @@
|
||||
abort(); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TEST__ */
|
||||
|
22
payloads/libpayload/include/boot_device.h
Normal file
22
payloads/libpayload/include/boot_device.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#ifndef _BOOT_DEVICE_H
|
||||
#define _BOOT_DEVICE_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* This is a boot device access function, which is used by libpayload to read data from
|
||||
* the flash memory (or other boot device). It has to be implemented by payloads that want
|
||||
* to use FMAP or libcbfs.
|
||||
*
|
||||
* @param buf The output buffer to which the data should be written to.
|
||||
* @param offset Absolute offset in bytes of the requested boot device memory area. Not aligned.
|
||||
* @param size Size in bytes of the requested boot device memory area. Not aligned.
|
||||
*
|
||||
* @returns Number of bytes returned to the buffer, or negative value on error. Typically should
|
||||
* be equal to the `size`, and not aligned forcefully.
|
||||
*/
|
||||
ssize_t boot_device_read(void *buf, size_t offset, size_t size);
|
||||
|
||||
#endif /* _BOOT_DEVICE_H */
|
@@ -1,82 +1,146 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
|
||||
* Copyright (C) 2013 Google, Inc.
|
||||
*
|
||||
* This file is dual-licensed. You can choose between:
|
||||
* - The GNU GPL, version 2, as published by the Free Software Foundation
|
||||
* - The revised BSD license (without advertising clause)
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#ifndef _CBFS_H_
|
||||
#define _CBFS_H_
|
||||
|
||||
#include <cbfs_core.h>
|
||||
#include <commonlib/bsd/cb_err.h>
|
||||
#include <commonlib/bsd/cbfs_mdata.h>
|
||||
#include <endian.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* legacy APIs */
|
||||
const struct cbfs_header *get_cbfs_header(void);
|
||||
struct cbfs_file *cbfs_find(const char *name);
|
||||
void *cbfs_find_file(const char *name, int type);
|
||||
|
||||
int cbfs_execute_stage(struct cbfs_media *media, const char *name);
|
||||
void *cbfs_load_optionrom(struct cbfs_media *media, uint16_t vendor,
|
||||
uint16_t device);
|
||||
void *cbfs_load_payload(struct cbfs_media *media, const char *name);
|
||||
void *cbfs_load_stage(struct cbfs_media *media, const char *name);
|
||||
/**********************************************************************************************
|
||||
* CBFS FILE ACCESS APIs *
|
||||
**********************************************************************************************/
|
||||
|
||||
/* Simple buffer for streaming media. */
|
||||
struct cbfs_simple_buffer {
|
||||
char *buffer;
|
||||
size_t allocated;
|
||||
size_t size;
|
||||
size_t last_allocate;
|
||||
};
|
||||
/* For documentation look in src/include/cbfs.h file in the main coreboot source tree. */
|
||||
|
||||
void *cbfs_simple_buffer_map(struct cbfs_simple_buffer *buffer,
|
||||
struct cbfs_media *media,
|
||||
size_t offset, size_t count);
|
||||
static inline size_t cbfs_load(const char *name, void *buf, size_t size);
|
||||
static inline size_t cbfs_ro_load(const char *name, void *buf, size_t size);
|
||||
static inline size_t cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t size);
|
||||
|
||||
void *cbfs_simple_buffer_unmap(struct cbfs_simple_buffer *buffer,
|
||||
const void *address);
|
||||
static inline void *cbfs_map(const char *name, size_t *size_out);
|
||||
static inline void *cbfs_ro_map(const char *name, size_t *size_out);
|
||||
static inline void *cbfs_unverified_area_map(const char *area, const char *name,
|
||||
size_t *size_out);
|
||||
|
||||
// Utility functions
|
||||
int run_address(void *f);
|
||||
void cbfs_unmap(void *mapping);
|
||||
|
||||
/* Defined in individual arch / board implementation. */
|
||||
int init_default_cbfs_media(struct cbfs_media *media);
|
||||
static inline size_t cbfs_get_size(const char *name);
|
||||
static inline size_t cbfs_ro_get_size(const char *name);
|
||||
|
||||
static inline enum cbfs_type cbfs_get_type(const char *name);
|
||||
static inline enum cbfs_type cbfs_ro_get_type(const char *name);
|
||||
|
||||
static inline bool cbfs_file_exists(const char *name);
|
||||
static inline bool cbfs_ro_file_exists(const char *name);
|
||||
|
||||
/**********************************************************************************************
|
||||
* INTERNAL HELPERS FOR INLINES, DO NOT USE. *
|
||||
**********************************************************************************************/
|
||||
ssize_t _cbfs_boot_lookup(const char *name, bool force_ro, union cbfs_mdata *mdata);
|
||||
|
||||
void *_cbfs_load(const char *name, void *buf, size_t *size_inout, bool force_ro);
|
||||
|
||||
void *_cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t *size_inout);
|
||||
|
||||
/**********************************************************************************************
|
||||
* INLINE IMPLEMENTATIONS *
|
||||
**********************************************************************************************/
|
||||
|
||||
static inline void *cbfs_map(const char *name, size_t *size_out)
|
||||
{
|
||||
return _cbfs_load(name, NULL, size_out, false);
|
||||
}
|
||||
|
||||
static inline void *cbfs_ro_map(const char *name, size_t *size_out)
|
||||
{
|
||||
return _cbfs_load(name, NULL, size_out, true);
|
||||
}
|
||||
|
||||
static inline void *cbfs_unverified_area_map(const char *area, const char *name,
|
||||
size_t *size_out)
|
||||
{
|
||||
return _cbfs_unverified_area_load(area, name, NULL, size_out);
|
||||
}
|
||||
|
||||
static inline size_t cbfs_load(const char *name, void *buf, size_t size)
|
||||
{
|
||||
if (_cbfs_load(name, buf, &size, false))
|
||||
return size;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline size_t cbfs_ro_load(const char *name, void *buf, size_t size)
|
||||
{
|
||||
if (_cbfs_load(name, buf, &size, true))
|
||||
return size;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline size_t cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t size)
|
||||
{
|
||||
if (_cbfs_unverified_area_load(area, name, buf, &size))
|
||||
return size;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline size_t cbfs_get_size(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
if (_cbfs_boot_lookup(name, false, &mdata) < 0)
|
||||
return 0;
|
||||
else
|
||||
return be32toh(mdata.h.len);
|
||||
}
|
||||
|
||||
static inline size_t cbfs_ro_get_size(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
if (_cbfs_boot_lookup(name, true, &mdata) < 0)
|
||||
return 0;
|
||||
else
|
||||
return be32toh(mdata.h.len);
|
||||
}
|
||||
|
||||
static inline enum cbfs_type cbfs_get_type(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
if (_cbfs_boot_lookup(name, false, &mdata) < 0)
|
||||
return CBFS_TYPE_NULL;
|
||||
else
|
||||
return be32toh(mdata.h.type);
|
||||
}
|
||||
|
||||
static inline enum cbfs_type cbfs_ro_get_type(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
if (_cbfs_boot_lookup(name, true, &mdata) < 0)
|
||||
return CBFS_TYPE_NULL;
|
||||
else
|
||||
return be32toh(mdata.h.type);
|
||||
}
|
||||
|
||||
static inline bool cbfs_file_exists(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
return _cbfs_boot_lookup(name, false, &mdata) >= 0;
|
||||
}
|
||||
|
||||
static inline bool cbfs_ro_file_exists(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
return _cbfs_boot_lookup(name, true, &mdata) >= 0;
|
||||
}
|
||||
|
||||
|
||||
/* Legacy API. Designated for removal in the future. */
|
||||
#include <cbfs_legacy.h>
|
||||
|
||||
#endif
|
||||
|
@@ -45,139 +45,14 @@
|
||||
#ifndef _CBFS_CORE_H_
|
||||
#define _CBFS_CORE_H_
|
||||
|
||||
#include <commonlib/bsd/cbfs_serialized.h>
|
||||
#include <endian.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/** These are standard values for the known compression
|
||||
alogrithms that coreboot knows about for stages and
|
||||
payloads. Of course, other CBFS users can use whatever
|
||||
values they want, as long as they understand them. */
|
||||
|
||||
#define CBFS_COMPRESS_NONE 0
|
||||
#define CBFS_COMPRESS_LZMA 1
|
||||
#define CBFS_COMPRESS_LZ4 2
|
||||
|
||||
/** These are standard component types for well known
|
||||
components (i.e - those that coreboot needs to consume.
|
||||
Users are welcome to use any other value for their
|
||||
components */
|
||||
|
||||
#define CBFS_TYPE_STAGE 0x10
|
||||
#define CBFS_TYPE_SELF 0x20
|
||||
#define CBFS_TYPE_FIT 0x21
|
||||
#define CBFS_TYPE_OPTIONROM 0x30
|
||||
#define CBFS_TYPE_BOOTSPLASH 0x40
|
||||
#define CBFS_TYPE_RAW 0x50
|
||||
#define CBFS_TYPE_VSA 0x51
|
||||
#define CBFS_TYPE_MBI 0x52
|
||||
#define CBFS_TYPE_MICROCODE 0x53
|
||||
#define CBFS_TYPE_STRUCT 0x70
|
||||
#define CBFS_COMPONENT_CMOS_DEFAULT 0xaa
|
||||
#define CBFS_COMPONENT_CMOS_LAYOUT 0x01aa
|
||||
|
||||
#define CBFS_HEADER_MAGIC 0x4F524243
|
||||
#define CBFS_HEADER_VERSION1 0x31313131
|
||||
#define CBFS_HEADER_VERSION2 0x31313132
|
||||
#define CBFS_HEADER_VERSION CBFS_HEADER_VERSION2
|
||||
|
||||
#define CBFS_HEADER_INVALID_ADDRESS ((void*)(0xffffffff))
|
||||
|
||||
/* this is the master cbfs header - it must be located somewhere available
|
||||
* to bootblock (to load romstage). The last 4 bytes in the image contain its
|
||||
* relative offset from the end of the image (as a 32-bit signed integer). */
|
||||
|
||||
struct cbfs_header {
|
||||
uint32_t magic;
|
||||
uint32_t version;
|
||||
uint32_t romsize;
|
||||
uint32_t bootblocksize;
|
||||
uint32_t align; /* fixed to 64 bytes */
|
||||
uint32_t offset;
|
||||
uint32_t architecture;
|
||||
uint32_t pad[1];
|
||||
} __packed;
|
||||
|
||||
/* this used to be flexible, but wasn't ever set to something different. */
|
||||
#define CBFS_ALIGNMENT 64
|
||||
|
||||
/* "Unknown" refers to CBFS headers version 1,
|
||||
* before the architecture was defined (i.e., x86 only).
|
||||
*/
|
||||
#define CBFS_ARCHITECTURE_UNKNOWN 0xFFFFFFFF
|
||||
#define CBFS_ARCHITECTURE_X86 0x00000001
|
||||
#define CBFS_ARCHITECTURE_ARM 0x00000010
|
||||
#define CBFS_ARCHITECTURE_ARM64 0x00000011
|
||||
|
||||
/** This is a component header - every entry in the CBFS
|
||||
will have this header.
|
||||
|
||||
This is how the component is arranged in the ROM:
|
||||
|
||||
-------------- <- 0
|
||||
component header
|
||||
-------------- <- sizeof(struct component)
|
||||
component name
|
||||
-------------- <- offset
|
||||
data
|
||||
...
|
||||
-------------- <- offset + len
|
||||
*/
|
||||
|
||||
#define CBFS_FILE_MAGIC "LARCHIVE"
|
||||
|
||||
struct cbfs_file {
|
||||
char magic[8];
|
||||
uint32_t len;
|
||||
uint32_t type;
|
||||
uint32_t attributes_offset;
|
||||
uint32_t offset;
|
||||
char filename[];
|
||||
} __packed;
|
||||
|
||||
/* Depending on how the header was initialized, it may be backed with 0x00 or
|
||||
* 0xff. Support both. */
|
||||
#define CBFS_FILE_ATTR_TAG_UNUSED 0
|
||||
#define CBFS_FILE_ATTR_TAG_UNUSED2 0xffffffff
|
||||
#define CBFS_FILE_ATTR_TAG_COMPRESSION 0x42435a4c
|
||||
#define CBFS_FILE_ATTR_TAG_HASH 0x68736148
|
||||
#define CBFS_FILE_ATTR_TAG_IBB 0x32494242 /* Initial BootBlock */
|
||||
|
||||
/* The common fields of extended cbfs file attributes.
|
||||
Attributes are expected to start with tag/len, then append their
|
||||
specific fields. */
|
||||
struct cbfs_file_attribute {
|
||||
uint32_t tag;
|
||||
/* len covers the whole structure, incl. tag and len */
|
||||
uint32_t len;
|
||||
uint8_t data[0];
|
||||
} __packed;
|
||||
|
||||
struct cbfs_file_attr_compression {
|
||||
uint32_t tag;
|
||||
uint32_t len;
|
||||
/* whole file compression format. 0 if no compression. */
|
||||
uint32_t compression;
|
||||
uint32_t decompressed_size;
|
||||
} __packed;
|
||||
|
||||
struct cbfs_file_attr_hash {
|
||||
uint32_t tag;
|
||||
uint32_t len;
|
||||
uint32_t hash_type;
|
||||
/* hash_data is len - sizeof(struct) bytes */
|
||||
uint8_t hash_data[];
|
||||
} __packed;
|
||||
|
||||
/*** Component sub-headers ***/
|
||||
|
||||
/* Following are component sub-headers for the "standard"
|
||||
component types */
|
||||
|
||||
/** This is the sub-header for stage components. Stages are
|
||||
loaded by coreboot during the normal boot process */
|
||||
|
||||
struct cbfs_stage {
|
||||
uint32_t compression; /** Compression type */
|
||||
uint64_t entry; /** entry point */
|
||||
@@ -186,33 +61,6 @@ struct cbfs_stage {
|
||||
uint32_t memlen; /** total length of object in memory */
|
||||
} __packed;
|
||||
|
||||
/** this is the sub-header for payload components. Payloads
|
||||
are loaded by coreboot at the end of the boot process */
|
||||
|
||||
struct cbfs_payload_segment {
|
||||
uint32_t type;
|
||||
uint32_t compression;
|
||||
uint32_t offset;
|
||||
uint64_t load_addr;
|
||||
uint32_t len;
|
||||
uint32_t mem_len;
|
||||
} __packed;
|
||||
|
||||
struct cbfs_payload {
|
||||
struct cbfs_payload_segment segments;
|
||||
};
|
||||
|
||||
#define PAYLOAD_SEGMENT_CODE 0x45444F43
|
||||
#define PAYLOAD_SEGMENT_DATA 0x41544144
|
||||
#define PAYLOAD_SEGMENT_BSS 0x20535342
|
||||
#define PAYLOAD_SEGMENT_PARAMS 0x41524150
|
||||
#define PAYLOAD_SEGMENT_ENTRY 0x52544E45
|
||||
|
||||
struct cbfs_optionrom {
|
||||
uint32_t compression;
|
||||
uint32_t len;
|
||||
} __packed;
|
||||
|
||||
#define CBFS_MEDIA_INVALID_MAP_ADDRESS ((void*)(0xffffffff))
|
||||
#define CBFS_DEFAULT_MEDIA ((void*)(0x0))
|
||||
|
||||
|
46
payloads/libpayload/include/cbfs_glue.h
Normal file
46
payloads/libpayload/include/cbfs_glue.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#ifndef _CBFS_CBFS_GLUE_H
|
||||
#define _CBFS_CBFS_GLUE_H
|
||||
|
||||
#include <libpayload-config.h>
|
||||
#include <boot_device.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define CBFS_ENABLE_HASHING CONFIG(LP_CBFS_VERIFICATION)
|
||||
|
||||
#define ERROR(...) printf("CBFS ERROR: " __VA_ARGS__)
|
||||
#define LOG(...) printf("CBFS: " __VA_ARGS__)
|
||||
#define DEBUG(...) \
|
||||
do { \
|
||||
if (CONFIG(LP_DEBUG_CBFS)) \
|
||||
printf("CBFS DEBUG: " __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
struct cbfs_dev {
|
||||
size_t offset;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct cbfs_boot_device {
|
||||
struct cbfs_dev dev;
|
||||
void *mcache;
|
||||
size_t mcache_size;
|
||||
};
|
||||
|
||||
typedef const struct cbfs_dev *cbfs_dev_t;
|
||||
|
||||
static inline ssize_t cbfs_dev_read(cbfs_dev_t dev, void *buffer, size_t offset, size_t size)
|
||||
{
|
||||
if (offset + size < offset || offset + size > dev->size)
|
||||
return CB_ERR_ARG;
|
||||
|
||||
return boot_device_read(buffer, dev->offset + offset, size);
|
||||
}
|
||||
|
||||
static inline size_t cbfs_dev_size(cbfs_dev_t dev)
|
||||
{
|
||||
return dev->size;
|
||||
}
|
||||
|
||||
#endif /* _CBFS_CBFS_GLUE_H */
|
82
payloads/libpayload/include/cbfs_legacy.h
Normal file
82
payloads/libpayload/include/cbfs_legacy.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
|
||||
* Copyright (C) 2013 Google, Inc.
|
||||
*
|
||||
* This file is dual-licensed. You can choose between:
|
||||
* - The GNU GPL, version 2, as published by the Free Software Foundation
|
||||
* - The revised BSD license (without advertising clause)
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _CBFS_LEGACY_H_
|
||||
#define _CBFS_LEGACY_H_
|
||||
|
||||
#include <cbfs_core.h>
|
||||
|
||||
/* legacy APIs */
|
||||
const struct cbfs_header *get_cbfs_header(void);
|
||||
struct cbfs_file *cbfs_find(const char *name);
|
||||
void *cbfs_find_file(const char *name, int type);
|
||||
|
||||
int cbfs_execute_stage(struct cbfs_media *media, const char *name);
|
||||
void *cbfs_load_optionrom(struct cbfs_media *media, uint16_t vendor,
|
||||
uint16_t device);
|
||||
void *cbfs_load_payload(struct cbfs_media *media, const char *name);
|
||||
void *cbfs_load_stage(struct cbfs_media *media, const char *name);
|
||||
|
||||
/* Simple buffer for streaming media. */
|
||||
struct cbfs_simple_buffer {
|
||||
char *buffer;
|
||||
size_t allocated;
|
||||
size_t size;
|
||||
size_t last_allocate;
|
||||
};
|
||||
|
||||
void *cbfs_simple_buffer_map(struct cbfs_simple_buffer *buffer,
|
||||
struct cbfs_media *media,
|
||||
size_t offset, size_t count);
|
||||
|
||||
void *cbfs_simple_buffer_unmap(struct cbfs_simple_buffer *buffer,
|
||||
const void *address);
|
||||
|
||||
// Utility functions
|
||||
int run_address(void *f);
|
||||
|
||||
/* Defined in individual arch / board implementation. */
|
||||
int init_default_cbfs_media(struct cbfs_media *media);
|
||||
|
||||
#endif
|
@@ -321,6 +321,16 @@ struct cb_boot_media_params {
|
||||
uint64_t boot_media_size;
|
||||
};
|
||||
|
||||
|
||||
struct cb_cbmem_entry {
|
||||
uint32_t tag;
|
||||
uint32_t size;
|
||||
|
||||
uint64_t address;
|
||||
uint32_t entry_size;
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
struct cb_tsc_info {
|
||||
uint32_t tag;
|
||||
uint32_t size;
|
||||
@@ -443,6 +453,4 @@ static inline const char *cb_mb_part_string(const struct cb_mainboard *cbm)
|
||||
(void *)(((u8 *) (_rec)) + sizeof(*(_rec)) \
|
||||
+ (sizeof((_rec)->map[0]) * (_idx)))
|
||||
|
||||
/* Helper functions */
|
||||
uintptr_t get_cbmem_addr(const void *cbmem_tab_entry);
|
||||
#endif
|
||||
|
12
payloads/libpayload/include/fmap.h
Normal file
12
payloads/libpayload/include/fmap.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* SPDX_License-Identifier: BSD-3-Clause */
|
||||
|
||||
#ifndef _FMAP_H
|
||||
#define _FMAP_H
|
||||
|
||||
#include <commonlib/bsd/cb_err.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* Looks for area with |name| in FlashMap. Requires lib_sysinfo.fmap_cache. */
|
||||
cb_err_t fmap_locate_area(const char *name, size_t *offset, size_t *size);
|
||||
|
||||
#endif /* _FMAP_H */
|
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010, Google Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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 Google Inc. 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.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef FLASHMAP_SERIALIZED_H__
|
||||
#define FLASHMAP_SERIALIZED_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FMAP_SIGNATURE "__FMAP__"
|
||||
#define FMAP_VER_MAJOR 1 /* this header's FMAP minor version */
|
||||
#define FMAP_VER_MINOR 1 /* this header's FMAP minor version */
|
||||
#define FMAP_STRLEN 32 /* maximum length for strings, */
|
||||
/* including null-terminator */
|
||||
|
||||
enum fmap_flags {
|
||||
FMAP_AREA_STATIC = 1 << 0,
|
||||
FMAP_AREA_COMPRESSED = 1 << 1,
|
||||
FMAP_AREA_RO = 1 << 2,
|
||||
FMAP_AREA_PRESERVE = 1 << 3,
|
||||
};
|
||||
|
||||
/* Mapping of volatile and static regions in firmware binary */
|
||||
struct fmap_area {
|
||||
uint32_t offset; /* offset relative to base */
|
||||
uint32_t size; /* size in bytes */
|
||||
uint8_t name[FMAP_STRLEN]; /* descriptive name */
|
||||
uint16_t flags; /* flags for this area */
|
||||
} __packed;
|
||||
|
||||
struct fmap {
|
||||
uint8_t signature[8]; /* "__FMAP__" (0x5F5F464D41505F5F) */
|
||||
uint8_t ver_major; /* major version */
|
||||
uint8_t ver_minor; /* minor version */
|
||||
uint64_t base; /* address of the firmware binary */
|
||||
uint32_t size; /* size of firmware binary in bytes */
|
||||
uint8_t name[FMAP_STRLEN]; /* name of this firmware binary */
|
||||
uint16_t nareas; /* number of areas described by
|
||||
fmap_areas[] below */
|
||||
struct fmap_area areas[];
|
||||
} __packed;
|
||||
|
||||
#endif /* FLASHMAP_SERIALIZED_H__ */
|
@@ -45,10 +45,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <libpayload-config.h>
|
||||
#include <cbgfx.h>
|
||||
#include <commonlib/bsd/fmap_serialized.h>
|
||||
#include <ctype.h>
|
||||
#include <die.h>
|
||||
#include <endian.h>
|
||||
#include <fmap_serialized.h>
|
||||
#include <fmap.h>
|
||||
#include <ipchksum.h>
|
||||
#include <kconfig.h>
|
||||
#include <stddef.h>
|
||||
@@ -457,6 +458,8 @@ static inline int clz(u32 x)
|
||||
static inline int log2(u32 x) { return (int)sizeof(x) * 8 - clz(x) - 1; }
|
||||
/* Find First Set: __ffs(0xf) == 0, __ffs(0) == -1, __ffs(1 << 31) == 31 */
|
||||
static inline int __ffs(u32 x) { return log2(x & (u32)(-(s32)x)); }
|
||||
/* Find Last Set: __fls(1) == 0, __fls(5) == 2, __fls(1 << 31) == 31 */
|
||||
static inline int __fls(u32 x) { return log2(x); }
|
||||
|
||||
static inline int popcnt64(u64 x) { return __builtin_popcountll(x); }
|
||||
static inline int clz64(u64 x)
|
||||
@@ -466,6 +469,7 @@ static inline int clz64(u64 x)
|
||||
|
||||
static inline int log2_64(u64 x) { return sizeof(x) * 8 - clz64(x) - 1; }
|
||||
static inline int __ffs64(u64 x) { return log2_64(x & (u64)(-(s64)x)); }
|
||||
static inline int __fls64(u64 x) { return log2_64(x); }
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@@ -150,6 +150,12 @@ struct sysinfo_t {
|
||||
#endif
|
||||
/* USB Type-C Port Configuration Info */
|
||||
uintptr_t type_c_info;
|
||||
|
||||
/* CBFS RW/RO Metadata Cache */
|
||||
uintptr_t cbfs_ro_mcache_offset;
|
||||
uint32_t cbfs_ro_mcache_size;
|
||||
uintptr_t cbfs_rw_mcache_offset;
|
||||
uint32_t cbfs_rw_mcache_size;
|
||||
};
|
||||
|
||||
extern struct sysinfo_t lib_sysinfo;
|
||||
|
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <libpayload-config.h>
|
||||
#include <libpayload.h>
|
||||
#include <commonlib/bsd/cbmem_id.h>
|
||||
#include <coreboot_tables.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -41,12 +42,6 @@
|
||||
/* === Parsing code === */
|
||||
/* This is the generic parsing code. */
|
||||
|
||||
uintptr_t get_cbmem_addr(const void *const cbmem_tab_entry)
|
||||
{
|
||||
const struct cb_cbmem_tab *const cbmem = cbmem_tab_entry;
|
||||
return cbmem->cbmem_tab;
|
||||
}
|
||||
|
||||
static void cb_parse_memory(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
struct cb_memory *mem = ptr;
|
||||
@@ -83,11 +78,6 @@ static void cb_parse_serial(void *ptr, struct sysinfo_t *info)
|
||||
info->cb_serial = virt_to_phys(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_vboot_workbuf(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->vboot_workbuf = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_vbnv(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
struct lb_range *vbnv = (struct lb_range *)ptr;
|
||||
@@ -128,26 +118,6 @@ static void cb_parse_mac_addresses(unsigned char *ptr,
|
||||
info->macs[i] = macs->mac_addrs[i];
|
||||
}
|
||||
|
||||
static void cb_parse_tstamp(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->tstamp_table = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_cbmem_cons(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->cbmem_cons = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_acpi_gnvs(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->acpi_gnvs = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_acpi_cnvs(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->acpi_cnvs = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_board_config(unsigned char *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
struct cb_board_config *const config = (struct cb_board_config *)ptr;
|
||||
@@ -188,11 +158,6 @@ static void cb_parse_string(const void *const ptr, uintptr_t *const info)
|
||||
*info = virt_to_phys(str->string);
|
||||
}
|
||||
|
||||
static void cb_parse_wifi_calibration(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->wifi_calibration = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_ramoops(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
struct lb_range *ramoops = (struct lb_range *)ptr;
|
||||
@@ -236,21 +201,6 @@ static void cb_parse_boot_media_params(unsigned char *ptr,
|
||||
info->boot_media_size = bmp->boot_media_size;
|
||||
}
|
||||
|
||||
static void cb_parse_vpd(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->chromeos_vpd = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_fmap_cache(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->fmap_cache = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
static void cb_parse_type_c_info(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
info->type_c_info = get_cbmem_addr(ptr);
|
||||
}
|
||||
|
||||
#if CONFIG(LP_TIMER_RDTSC)
|
||||
static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
@@ -264,6 +214,57 @@ static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void cb_parse_cbmem_entry(void *ptr, struct sysinfo_t *info)
|
||||
{
|
||||
const struct cb_cbmem_entry *cbmem_entry = ptr;
|
||||
|
||||
if (cbmem_entry->size != sizeof(*cbmem_entry))
|
||||
return;
|
||||
|
||||
switch (cbmem_entry->id) {
|
||||
case CBMEM_ID_ACPI_CNVS:
|
||||
info->acpi_cnvs = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_ACPI_GNVS:
|
||||
info->acpi_gnvs = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_CBFS_RO_MCACHE:
|
||||
info->cbfs_ro_mcache_offset = cbmem_entry->address;
|
||||
info->cbfs_ro_mcache_size = cbmem_entry->entry_size;
|
||||
break;
|
||||
case CBMEM_ID_CBFS_RW_MCACHE:
|
||||
info->cbfs_rw_mcache_offset = cbmem_entry->address;
|
||||
info->cbfs_rw_mcache_size = cbmem_entry->entry_size;
|
||||
break;
|
||||
case CBMEM_ID_CONSOLE:
|
||||
info->cbmem_cons = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_MRCDATA:
|
||||
info->mrc_cache = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_VBOOT_WORKBUF:
|
||||
info->vboot_workbuf = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_TIMESTAMP:
|
||||
info->tstamp_table = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_VPD:
|
||||
info->chromeos_vpd = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_FMAP:
|
||||
info->fmap_cache = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_WIFI_CALIBRATION:
|
||||
info->wifi_calibration = cbmem_entry->address;
|
||||
break;
|
||||
case CBMEM_ID_TYPE_C_INFO:
|
||||
info->type_c_info = cbmem_entry->address;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||
{
|
||||
struct cb_header *header;
|
||||
@@ -372,33 +373,15 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||
case CB_TAG_VBNV:
|
||||
cb_parse_vbnv(ptr, info);
|
||||
break;
|
||||
case CB_TAG_VBOOT_WORKBUF:
|
||||
cb_parse_vboot_workbuf(ptr, info);
|
||||
break;
|
||||
case CB_TAG_MAC_ADDRS:
|
||||
cb_parse_mac_addresses(ptr, info);
|
||||
break;
|
||||
case CB_TAG_SERIALNO:
|
||||
cb_parse_string(ptr, &info->serialno);
|
||||
break;
|
||||
case CB_TAG_TIMESTAMPS:
|
||||
cb_parse_tstamp(ptr, info);
|
||||
break;
|
||||
case CB_TAG_CBMEM_CONSOLE:
|
||||
cb_parse_cbmem_cons(ptr, info);
|
||||
break;
|
||||
case CB_TAG_ACPI_GNVS:
|
||||
cb_parse_acpi_gnvs(ptr, info);
|
||||
break;
|
||||
case CB_TAG_ACPI_CNVS:
|
||||
cb_parse_acpi_cnvs(ptr, info);
|
||||
break;
|
||||
case CB_TAG_BOARD_CONFIG:
|
||||
cb_parse_board_config(ptr, info);
|
||||
break;
|
||||
case CB_TAG_WIFI_CALIBRATION:
|
||||
cb_parse_wifi_calibration(ptr, info);
|
||||
break;
|
||||
case CB_TAG_RAM_OOPS:
|
||||
cb_parse_ramoops(ptr, info);
|
||||
break;
|
||||
@@ -414,20 +397,14 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||
case CB_TAG_BOOT_MEDIA_PARAMS:
|
||||
cb_parse_boot_media_params(ptr, info);
|
||||
break;
|
||||
case CB_TAG_CBMEM_ENTRY:
|
||||
cb_parse_cbmem_entry(ptr, info);
|
||||
break;
|
||||
#if CONFIG(LP_TIMER_RDTSC)
|
||||
case CB_TAG_TSC_INFO:
|
||||
cb_parse_tsc_info(ptr, info);
|
||||
break;
|
||||
#endif
|
||||
case CB_TAG_VPD:
|
||||
cb_parse_vpd(ptr, info);
|
||||
break;
|
||||
case CB_TAG_FMAP:
|
||||
cb_parse_fmap_cache(ptr, info);
|
||||
break;
|
||||
case CB_TAG_TYPE_C_INFO:
|
||||
cb_parse_type_c_info(ptr, info);
|
||||
break;
|
||||
default:
|
||||
cb_parse_arch_specific(rec, info);
|
||||
break;
|
||||
|
@@ -28,10 +28,60 @@
|
||||
|
||||
#include <libpayload-config.h>
|
||||
#include <libpayload.h>
|
||||
#include <commonlib/bsd/fmap_serialized.h>
|
||||
#include <coreboot_tables.h>
|
||||
#include <cbfs.h>
|
||||
#include <fmap_serialized.h>
|
||||
#include <boot_device.h>
|
||||
#include <stdint.h>
|
||||
#include <arch/virtual.h>
|
||||
|
||||
/* Private fmap cache. */
|
||||
static struct fmap *_fmap_cache;
|
||||
|
||||
static cb_err_t fmap_find_area(struct fmap *fmap, const char *name, size_t *offset,
|
||||
size_t *size)
|
||||
{
|
||||
for (size_t i = 0; i < le32toh(fmap->nareas); ++i) {
|
||||
if (strncmp((const char *)fmap->areas[i].name, name, FMAP_STRLEN) != 0)
|
||||
continue;
|
||||
if (offset)
|
||||
*offset = le32toh(fmap->areas[i].offset);
|
||||
if (size)
|
||||
*size = le32toh(fmap->areas[i].size);
|
||||
return CB_SUCCESS;
|
||||
}
|
||||
|
||||
return CB_ERR;
|
||||
}
|
||||
|
||||
static bool fmap_is_signature_valid(struct fmap *fmap)
|
||||
{
|
||||
return memcmp(fmap->signature, FMAP_SIGNATURE, sizeof(fmap->signature)) == 0;
|
||||
}
|
||||
|
||||
static bool fmap_setup_cache(void)
|
||||
{
|
||||
/* Use FMAP cache if available */
|
||||
if (lib_sysinfo.fmap_cache
|
||||
&& fmap_is_signature_valid((struct fmap *)phys_to_virt(lib_sysinfo.fmap_cache))) {
|
||||
_fmap_cache = (struct fmap *)phys_to_virt(lib_sysinfo.fmap_cache);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cb_err_t fmap_locate_area(const char *name, size_t *offset, size_t *size)
|
||||
{
|
||||
if (!_fmap_cache && !fmap_setup_cache())
|
||||
return CB_ERR;
|
||||
|
||||
return fmap_find_area(_fmap_cache, name, offset, size);
|
||||
}
|
||||
|
||||
/***********************************************************************************************
|
||||
* LEGACY CODE *
|
||||
**********************************************************************************************/
|
||||
|
||||
int fmap_region_by_name(const uint32_t fmap_offset, const char * const name,
|
||||
uint32_t * const offset, uint32_t * const size)
|
||||
|
31
payloads/libpayload/libcbfs/Kconfig
Normal file
31
payloads/libpayload/libcbfs/Kconfig
Normal file
@@ -0,0 +1,31 @@
|
||||
## SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
|
||||
|
||||
config CBFS
|
||||
bool "CBFS support"
|
||||
default y
|
||||
help
|
||||
CBFS is the archive format of coreboot
|
||||
|
||||
if CBFS
|
||||
|
||||
config DEBUG_CBFS
|
||||
bool "Output verbose CBFS debug messages"
|
||||
default n
|
||||
help
|
||||
This option enables additional CBFS related debug messages.
|
||||
|
||||
config ENABLE_CBFS_FALLBACK
|
||||
bool "Fallback to RO (COREBOOT) region"
|
||||
default n
|
||||
help
|
||||
When this option is enabled, the CBFS code will look for a file in the
|
||||
RO (COREBOOT) region, if it isn't available in the active RW region.
|
||||
This option makes sense only if CONFIG_VBOOT was enabled in the coreboot.
|
||||
|
||||
config CBFS_VERIFICATION
|
||||
bool "Enable CBFS verification"
|
||||
depends on VBOOT_LIB
|
||||
help
|
||||
This option enables hash verification of CBFS files in RO (COREBOOT) and RW regions.
|
||||
|
||||
endif
|
@@ -28,3 +28,9 @@
|
||||
|
||||
libcbfs-$(CONFIG_LP_CBFS) += cbfs.c
|
||||
libcbfs-$(CONFIG_LP_CBFS) += ram_media.c
|
||||
libcbfs-$(CONFIG_LP_CBFS) += cbfs_legacy.c
|
||||
|
||||
ifeq ($(CONFIG_LP_CBFS),y)
|
||||
libcbfs-srcs += $(coreboottop)/src/commonlib/bsd/cbfs_private.c
|
||||
libcbfs-srcs += $(coreboottop)/src/commonlib/bsd/cbfs_mcache.c
|
||||
endif
|
||||
|
@@ -1,243 +1,225 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011 secunet Security Networks AG
|
||||
* Copyright (C) 2013 Google, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
*/
|
||||
#define LIBPAYLOAD
|
||||
|
||||
#ifdef LIBPAYLOAD
|
||||
# include <libpayload-config.h>
|
||||
# if CONFIG(LP_LZMA)
|
||||
# include <lzma.h>
|
||||
# define CBFS_CORE_WITH_LZMA
|
||||
# endif
|
||||
# if CONFIG(LP_LZ4)
|
||||
# include <lz4.h>
|
||||
# define CBFS_CORE_WITH_LZ4
|
||||
# endif
|
||||
# define CBFS_MINI_BUILD
|
||||
#elif defined(__SMM__)
|
||||
# define CBFS_MINI_BUILD
|
||||
#else
|
||||
# define CBFS_CORE_WITH_LZMA
|
||||
# define CBFS_CORE_WITH_LZ4
|
||||
# include <lib.h>
|
||||
#endif
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#include <libpayload-config.h>
|
||||
#include <arch/virtual.h>
|
||||
#include <assert.h>
|
||||
#include <cbfs.h>
|
||||
#include <cbfs_glue.h>
|
||||
#include <commonlib/bsd/cbfs_private.h>
|
||||
#include <commonlib/bsd/fmap_serialized.h>
|
||||
#include <libpayload.h>
|
||||
#include <lz4.h>
|
||||
#include <lzma.h>
|
||||
#include <string.h>
|
||||
#include <sysinfo.h>
|
||||
|
||||
#ifdef LIBPAYLOAD
|
||||
# include <stdio.h>
|
||||
# define DEBUG(x...)
|
||||
# define LOG(x...)
|
||||
# define ERROR(x...) printf(x)
|
||||
#else
|
||||
# include <console/console.h>
|
||||
# define ERROR(x...) printk(BIOS_ERR, "CBFS: " x)
|
||||
# define LOG(x...) printk(BIOS_INFO, "CBFS: " x)
|
||||
# if CONFIG_LP_DEBUG_CBFS
|
||||
# define DEBUG(x...) printk(BIOS_SPEW, "CBFS: " x)
|
||||
# else
|
||||
# define DEBUG(x...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "cbfs_core.c"
|
||||
|
||||
#ifndef __SMM__
|
||||
static inline int tohex4(unsigned int c)
|
||||
static const struct cbfs_boot_device *cbfs_get_boot_device(bool force_ro)
|
||||
{
|
||||
return (c <= 9) ? (c + '0') : (c - 10 + 'a');
|
||||
static struct cbfs_boot_device ro;
|
||||
static struct cbfs_boot_device rw;
|
||||
|
||||
if (!force_ro) {
|
||||
if (!rw.dev.size) {
|
||||
rw.dev.offset = lib_sysinfo.cbfs_offset;
|
||||
rw.dev.size = lib_sysinfo.cbfs_size;
|
||||
rw.mcache = phys_to_virt(lib_sysinfo.cbfs_rw_mcache_offset);
|
||||
rw.mcache_size = lib_sysinfo.cbfs_rw_mcache_size;
|
||||
}
|
||||
return &rw;
|
||||
}
|
||||
|
||||
if (ro.dev.size)
|
||||
return &ro;
|
||||
|
||||
if (fmap_locate_area("COREBOOT", &ro.dev.offset, &ro.dev.size))
|
||||
return NULL;
|
||||
|
||||
ro.mcache = phys_to_virt(lib_sysinfo.cbfs_ro_mcache_offset);
|
||||
ro.mcache_size = lib_sysinfo.cbfs_ro_mcache_size;
|
||||
|
||||
return &ro;
|
||||
}
|
||||
|
||||
static void tohex16(unsigned int val, char* dest)
|
||||
ssize_t _cbfs_boot_lookup(const char *name, bool force_ro, union cbfs_mdata *mdata)
|
||||
{
|
||||
dest[0] = tohex4(val>>12);
|
||||
dest[1] = tohex4((val>>8) & 0xf);
|
||||
dest[2] = tohex4((val>>4) & 0xf);
|
||||
dest[3] = tohex4(val & 0xf);
|
||||
const struct cbfs_boot_device *cbd = cbfs_get_boot_device(force_ro);
|
||||
if (!cbd)
|
||||
return CB_ERR;
|
||||
|
||||
size_t data_offset;
|
||||
cb_err_t err = CB_CBFS_CACHE_FULL;
|
||||
if (cbd->mcache_size)
|
||||
err = cbfs_mcache_lookup(cbd->mcache, cbd->mcache_size, name, mdata,
|
||||
&data_offset);
|
||||
|
||||
if (err == CB_CBFS_CACHE_FULL)
|
||||
err = cbfs_lookup(&cbd->dev, name, mdata, &data_offset, NULL);
|
||||
|
||||
/* Fallback to RO if possible. */
|
||||
if (CONFIG(LP_ENABLE_CBFS_FALLBACK) && !force_ro && err == CB_CBFS_NOT_FOUND) {
|
||||
LOG("Fall back to RO region for '%s'\n", name);
|
||||
return _cbfs_boot_lookup(name, true, mdata);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
if (err == CB_CBFS_NOT_FOUND)
|
||||
LOG("'%s' not found.\n", name);
|
||||
else
|
||||
ERROR("Error %d when looking up '%s'\n", err, name);
|
||||
return err;
|
||||
}
|
||||
|
||||
return cbd->dev.offset + data_offset;
|
||||
}
|
||||
|
||||
void *cbfs_load_optionrom(struct cbfs_media *media, uint16_t vendor,
|
||||
uint16_t device)
|
||||
void cbfs_unmap(void *mapping)
|
||||
{
|
||||
char name[17] = "pciXXXX,XXXX.rom";
|
||||
|
||||
tohex16(vendor, name+3);
|
||||
tohex16(device, name+8);
|
||||
|
||||
return cbfs_get_file_content(media, name, CBFS_TYPE_OPTIONROM, NULL);
|
||||
free(mapping);
|
||||
}
|
||||
|
||||
void * cbfs_load_stage(struct cbfs_media *media, const char *name)
|
||||
static bool cbfs_file_hash_mismatch(const void *buffer, size_t size,
|
||||
const union cbfs_mdata *mdata, bool skip_verification)
|
||||
{
|
||||
struct cbfs_stage *stage = (struct cbfs_stage *)
|
||||
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE, NULL);
|
||||
/* this is a mess. There is no ntohll. */
|
||||
/* for now, assume compatible byte order until we solve this. */
|
||||
uintptr_t entry;
|
||||
uint32_t final_size;
|
||||
if (!CONFIG(LP_CBFS_VERIFICATION) || skip_verification)
|
||||
return false;
|
||||
|
||||
if (stage == NULL)
|
||||
return (void *) -1;
|
||||
const struct vb2_hash *hash = cbfs_file_hash(mdata);
|
||||
if (!hash) {
|
||||
ERROR("'%s' does not have a file hash!\n", mdata->h.filename);
|
||||
return true;
|
||||
}
|
||||
if (vb2_hash_verify(buffer, size, hash) != VB2_SUCCESS) {
|
||||
ERROR("'%s' file hash mismatch!\n", mdata->h.filename);
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG("loading stage %s @ %p (%d bytes), entry @ 0x%llx\n",
|
||||
name,
|
||||
(void*)(uintptr_t) stage->load, stage->memlen,
|
||||
stage->entry);
|
||||
return false;
|
||||
}
|
||||
|
||||
final_size = cbfs_decompress(stage->compression,
|
||||
((unsigned char *) stage) +
|
||||
sizeof(struct cbfs_stage),
|
||||
stage->len,
|
||||
(void *) (uintptr_t) stage->load,
|
||||
stage->memlen);
|
||||
if (!final_size) {
|
||||
entry = -1;
|
||||
static size_t cbfs_load_and_decompress(size_t offset, size_t in_size, void *buffer,
|
||||
size_t buffer_size, uint32_t compression,
|
||||
const union cbfs_mdata *mdata, bool skip_verification)
|
||||
{
|
||||
void *load = buffer;
|
||||
size_t out_size = 0;
|
||||
|
||||
DEBUG("Decompressing %zu bytes from '%s' to %p with algo %d\n", in_size,
|
||||
mdata->h.filename, buffer, compression);
|
||||
|
||||
if (compression != CBFS_COMPRESS_NONE) {
|
||||
load = malloc(in_size);
|
||||
if (!load) {
|
||||
ERROR("'%s' buffer allocation failed\n", mdata->h.filename);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (boot_device_read(load, offset, in_size) != in_size) {
|
||||
ERROR("'%s' failed to read contents of file\n", mdata->h.filename);
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset((void *)((uintptr_t)stage->load + final_size), 0,
|
||||
stage->memlen - final_size);
|
||||
|
||||
DEBUG("stage loaded.\n");
|
||||
|
||||
entry = stage->entry;
|
||||
// entry = ntohll(stage->entry);
|
||||
if (cbfs_file_hash_mismatch(buffer, in_size, mdata, skip_verification))
|
||||
goto out;
|
||||
|
||||
switch (compression) {
|
||||
case CBFS_COMPRESS_NONE:
|
||||
out_size = in_size;
|
||||
break;
|
||||
case CBFS_COMPRESS_LZ4:
|
||||
if (!CONFIG(LP_LZ4))
|
||||
goto out;
|
||||
out_size = ulz4fn(load, in_size, buffer, buffer_size);
|
||||
break;
|
||||
case CBFS_COMPRESS_LZMA:
|
||||
if (!CONFIG(LP_LZMA))
|
||||
goto out;
|
||||
out_size = ulzman(load, in_size, buffer, buffer_size);
|
||||
break;
|
||||
default:
|
||||
ERROR("'%s' decompression algo %d not supported\n", mdata->h.filename,
|
||||
compression);
|
||||
}
|
||||
out:
|
||||
free(stage);
|
||||
return (void *) entry;
|
||||
if (load != buffer)
|
||||
free(load);
|
||||
return out_size;
|
||||
}
|
||||
|
||||
int cbfs_execute_stage(struct cbfs_media *media, const char *name)
|
||||
static void *do_load(union cbfs_mdata *mdata, ssize_t offset, void *buf, size_t *size_inout,
|
||||
bool skip_verification)
|
||||
{
|
||||
struct cbfs_stage *stage = (struct cbfs_stage *)
|
||||
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE, NULL);
|
||||
|
||||
if (stage == NULL)
|
||||
return 1;
|
||||
|
||||
if (ntohl(stage->compression) != CBFS_COMPRESS_NONE) {
|
||||
LOG("Unable to run %s: Compressed file"
|
||||
"Not supported for in-place execution\n", name);
|
||||
free(stage);
|
||||
return 1;
|
||||
bool malloced = false;
|
||||
size_t out_size;
|
||||
uint32_t compression = CBFS_COMPRESS_NONE;
|
||||
const struct cbfs_file_attr_compression *cattr =
|
||||
cbfs_find_attr(mdata, CBFS_FILE_ATTR_TAG_COMPRESSION, sizeof(*cattr));
|
||||
if (cattr) {
|
||||
compression = be32toh(cattr->compression);
|
||||
out_size = be32toh(cattr->decompressed_size);
|
||||
} else {
|
||||
out_size = be32toh(mdata->h.len);
|
||||
}
|
||||
|
||||
LOG("run @ %p\n", (void *) (uintptr_t)ntohll(stage->entry));
|
||||
int result = run_address((void *)(uintptr_t)ntohll(stage->entry));
|
||||
free(stage);
|
||||
return result;
|
||||
if (buf) {
|
||||
if (!size_inout || *size_inout < out_size) {
|
||||
ERROR("'%s' buffer too small", mdata->h.filename);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
buf = malloc(out_size);
|
||||
if (!buf) {
|
||||
ERROR("'%s' allocation failure", mdata->h.filename);
|
||||
return NULL;
|
||||
}
|
||||
malloced = true;
|
||||
}
|
||||
|
||||
if (cbfs_load_and_decompress(offset, be32toh(mdata->h.len), buf, out_size, compression,
|
||||
mdata, skip_verification)
|
||||
!= out_size) {
|
||||
if (malloced)
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
if (size_inout)
|
||||
*size_inout = out_size;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void *cbfs_load_payload(struct cbfs_media *media, const char *name)
|
||||
void *_cbfs_load(const char *name, void *buf, size_t *size_inout, bool force_ro)
|
||||
{
|
||||
return (struct cbfs_payload *)cbfs_get_file_content(
|
||||
media, name, CBFS_TYPE_SELF, NULL);
|
||||
}
|
||||
ssize_t offset;
|
||||
union cbfs_mdata mdata;
|
||||
|
||||
struct cbfs_file *cbfs_find(const char *name) {
|
||||
struct cbfs_handle *handle = cbfs_get_handle(CBFS_DEFAULT_MEDIA, name);
|
||||
struct cbfs_media *m = &handle->media;
|
||||
void *ret;
|
||||
DEBUG("%s(name='%s', buf=%p, force_ro=%s)\n", __func__, name, buf,
|
||||
force_ro ? "true" : "false");
|
||||
|
||||
if (!handle)
|
||||
offset = _cbfs_boot_lookup(name, force_ro, &mdata);
|
||||
if (offset < 0)
|
||||
return NULL;
|
||||
|
||||
ret = m->map(m, handle->media_offset,
|
||||
handle->content_offset + handle->content_size);
|
||||
if (ret == CBFS_MEDIA_INVALID_MAP_ADDRESS) {
|
||||
free(handle);
|
||||
return do_load(&mdata, offset, buf, size_inout, false);
|
||||
}
|
||||
|
||||
void *_cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t *size_inout)
|
||||
{
|
||||
struct cbfs_dev dev;
|
||||
union cbfs_mdata mdata;
|
||||
size_t data_offset;
|
||||
|
||||
DEBUG("%s(area='%s', name='%s', buf=%p)\n", __func__, area, name, buf);
|
||||
|
||||
if (fmap_locate_area(area, &dev.offset, &dev.size) != CB_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
if (cbfs_lookup(&dev, name, &mdata, &data_offset, NULL)) {
|
||||
ERROR("'%s' not found in '%s'\n", name, area);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
free(handle);
|
||||
return ret;
|
||||
return do_load(&mdata, dev.offset + data_offset, buf, size_inout, true);
|
||||
}
|
||||
|
||||
void *cbfs_find_file(const char *name, int type) {
|
||||
return cbfs_get_file_content(CBFS_DEFAULT_MEDIA, name, type, NULL);
|
||||
}
|
||||
|
||||
const struct cbfs_header *get_cbfs_header(void) {
|
||||
return cbfs_get_header(CBFS_DEFAULT_MEDIA);
|
||||
}
|
||||
|
||||
/* Simple buffer */
|
||||
|
||||
void *cbfs_simple_buffer_map(struct cbfs_simple_buffer *buffer,
|
||||
struct cbfs_media *media,
|
||||
size_t offset, size_t count) {
|
||||
void *address = buffer->buffer + buffer->allocated;
|
||||
DEBUG("simple_buffer_map(offset=%zu, count=%zu): "
|
||||
"allocated=%zu, size=%zu, last_allocate=%zu\n",
|
||||
offset, count, buffer->allocated, buffer->size,
|
||||
buffer->last_allocate);
|
||||
if (buffer->allocated + count >= buffer->size)
|
||||
return CBFS_MEDIA_INVALID_MAP_ADDRESS;
|
||||
if (media->read(media, address, offset, count) != count) {
|
||||
ERROR("simple_buffer: fail to read %zd bytes from 0x%zx\n",
|
||||
count, offset);
|
||||
return CBFS_MEDIA_INVALID_MAP_ADDRESS;
|
||||
}
|
||||
buffer->allocated += count;
|
||||
buffer->last_allocate = count;
|
||||
return address;
|
||||
}
|
||||
|
||||
void *cbfs_simple_buffer_unmap(struct cbfs_simple_buffer *buffer,
|
||||
const void *address) {
|
||||
// TODO Add simple buffer management so we can free more than last
|
||||
// allocated one.
|
||||
DEBUG("simple_buffer_unmap(address=%p): "
|
||||
"allocated=%zu, size=%zu, last_allocate=%zu\n",
|
||||
address, buffer->allocated, buffer->size,
|
||||
buffer->last_allocate);
|
||||
if ((buffer->buffer + buffer->allocated - buffer->last_allocate) ==
|
||||
address) {
|
||||
buffer->allocated -= buffer->last_allocate;
|
||||
buffer->last_allocate = 0;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* run_address is passed the address of a function taking no parameters and
|
||||
* jumps to it, returning the result.
|
||||
* @param f the address to call as a function.
|
||||
* @return value returned by the function.
|
||||
*/
|
||||
|
||||
int run_address(void *f)
|
||||
{
|
||||
int (*v) (void);
|
||||
v = f;
|
||||
return v();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
243
payloads/libpayload/libcbfs/cbfs_legacy.c
Normal file
243
payloads/libpayload/libcbfs/cbfs_legacy.c
Normal file
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011 secunet Security Networks AG
|
||||
* Copyright (C) 2013 Google, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
*/
|
||||
#define LIBPAYLOAD
|
||||
|
||||
#ifdef LIBPAYLOAD
|
||||
# include <libpayload-config.h>
|
||||
# if CONFIG(LP_LZMA)
|
||||
# include <lzma.h>
|
||||
# define CBFS_CORE_WITH_LZMA
|
||||
# endif
|
||||
# if CONFIG(LP_LZ4)
|
||||
# include <lz4.h>
|
||||
# define CBFS_CORE_WITH_LZ4
|
||||
# endif
|
||||
# define CBFS_MINI_BUILD
|
||||
#elif defined(__SMM__)
|
||||
# define CBFS_MINI_BUILD
|
||||
#else
|
||||
# define CBFS_CORE_WITH_LZMA
|
||||
# define CBFS_CORE_WITH_LZ4
|
||||
# include <lib.h>
|
||||
#endif
|
||||
|
||||
#include <cbfs.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef LIBPAYLOAD
|
||||
# include <stdio.h>
|
||||
# define DEBUG(x...)
|
||||
# define LOG(x...)
|
||||
# define ERROR(x...) printf(x)
|
||||
#else
|
||||
# include <console/console.h>
|
||||
# define ERROR(x...) printk(BIOS_ERR, "CBFS: " x)
|
||||
# define LOG(x...) printk(BIOS_INFO, "CBFS: " x)
|
||||
# if CONFIG_LP_DEBUG_CBFS
|
||||
# define DEBUG(x...) printk(BIOS_SPEW, "CBFS: " x)
|
||||
# else
|
||||
# define DEBUG(x...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "cbfs_core.c"
|
||||
|
||||
#ifndef __SMM__
|
||||
static inline int tohex4(unsigned int c)
|
||||
{
|
||||
return (c <= 9) ? (c + '0') : (c - 10 + 'a');
|
||||
}
|
||||
|
||||
static void tohex16(unsigned int val, char* dest)
|
||||
{
|
||||
dest[0] = tohex4(val>>12);
|
||||
dest[1] = tohex4((val>>8) & 0xf);
|
||||
dest[2] = tohex4((val>>4) & 0xf);
|
||||
dest[3] = tohex4(val & 0xf);
|
||||
}
|
||||
|
||||
void *cbfs_load_optionrom(struct cbfs_media *media, uint16_t vendor,
|
||||
uint16_t device)
|
||||
{
|
||||
char name[17] = "pciXXXX,XXXX.rom";
|
||||
|
||||
tohex16(vendor, name+3);
|
||||
tohex16(device, name+8);
|
||||
|
||||
return cbfs_get_file_content(media, name, CBFS_TYPE_OPTIONROM, NULL);
|
||||
}
|
||||
|
||||
void * cbfs_load_stage(struct cbfs_media *media, const char *name)
|
||||
{
|
||||
struct cbfs_stage *stage = (struct cbfs_stage *)
|
||||
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE, NULL);
|
||||
/* this is a mess. There is no ntohll. */
|
||||
/* for now, assume compatible byte order until we solve this. */
|
||||
uintptr_t entry;
|
||||
uint32_t final_size;
|
||||
|
||||
if (stage == NULL)
|
||||
return (void *) -1;
|
||||
|
||||
LOG("loading stage %s @ %p (%d bytes), entry @ 0x%llx\n",
|
||||
name,
|
||||
(void*)(uintptr_t) stage->load, stage->memlen,
|
||||
stage->entry);
|
||||
|
||||
final_size = cbfs_decompress(stage->compression,
|
||||
((unsigned char *) stage) +
|
||||
sizeof(struct cbfs_stage),
|
||||
stage->len,
|
||||
(void *) (uintptr_t) stage->load,
|
||||
stage->memlen);
|
||||
if (!final_size) {
|
||||
entry = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset((void *)((uintptr_t)stage->load + final_size), 0,
|
||||
stage->memlen - final_size);
|
||||
|
||||
DEBUG("stage loaded.\n");
|
||||
|
||||
entry = stage->entry;
|
||||
// entry = ntohll(stage->entry);
|
||||
|
||||
out:
|
||||
free(stage);
|
||||
return (void *) entry;
|
||||
}
|
||||
|
||||
int cbfs_execute_stage(struct cbfs_media *media, const char *name)
|
||||
{
|
||||
struct cbfs_stage *stage = (struct cbfs_stage *)
|
||||
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE, NULL);
|
||||
|
||||
if (stage == NULL)
|
||||
return 1;
|
||||
|
||||
if (ntohl(stage->compression) != CBFS_COMPRESS_NONE) {
|
||||
LOG("Unable to run %s: Compressed file"
|
||||
"Not supported for in-place execution\n", name);
|
||||
free(stage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG("run @ %p\n", (void *) (uintptr_t)ntohll(stage->entry));
|
||||
int result = run_address((void *)(uintptr_t)ntohll(stage->entry));
|
||||
free(stage);
|
||||
return result;
|
||||
}
|
||||
|
||||
void *cbfs_load_payload(struct cbfs_media *media, const char *name)
|
||||
{
|
||||
return (struct cbfs_payload *)cbfs_get_file_content(
|
||||
media, name, CBFS_TYPE_SELF, NULL);
|
||||
}
|
||||
|
||||
struct cbfs_file *cbfs_find(const char *name) {
|
||||
struct cbfs_handle *handle = cbfs_get_handle(CBFS_DEFAULT_MEDIA, name);
|
||||
struct cbfs_media *m = &handle->media;
|
||||
void *ret;
|
||||
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
ret = m->map(m, handle->media_offset,
|
||||
handle->content_offset + handle->content_size);
|
||||
if (ret == CBFS_MEDIA_INVALID_MAP_ADDRESS) {
|
||||
free(handle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
free(handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *cbfs_find_file(const char *name, int type) {
|
||||
return cbfs_get_file_content(CBFS_DEFAULT_MEDIA, name, type, NULL);
|
||||
}
|
||||
|
||||
const struct cbfs_header *get_cbfs_header(void) {
|
||||
return cbfs_get_header(CBFS_DEFAULT_MEDIA);
|
||||
}
|
||||
|
||||
/* Simple buffer */
|
||||
|
||||
void *cbfs_simple_buffer_map(struct cbfs_simple_buffer *buffer,
|
||||
struct cbfs_media *media,
|
||||
size_t offset, size_t count) {
|
||||
void *address = buffer->buffer + buffer->allocated;
|
||||
DEBUG("simple_buffer_map(offset=%zu, count=%zu): "
|
||||
"allocated=%zu, size=%zu, last_allocate=%zu\n",
|
||||
offset, count, buffer->allocated, buffer->size,
|
||||
buffer->last_allocate);
|
||||
if (buffer->allocated + count >= buffer->size)
|
||||
return CBFS_MEDIA_INVALID_MAP_ADDRESS;
|
||||
if (media->read(media, address, offset, count) != count) {
|
||||
ERROR("simple_buffer: fail to read %zd bytes from 0x%zx\n",
|
||||
count, offset);
|
||||
return CBFS_MEDIA_INVALID_MAP_ADDRESS;
|
||||
}
|
||||
buffer->allocated += count;
|
||||
buffer->last_allocate = count;
|
||||
return address;
|
||||
}
|
||||
|
||||
void *cbfs_simple_buffer_unmap(struct cbfs_simple_buffer *buffer,
|
||||
const void *address) {
|
||||
// TODO Add simple buffer management so we can free more than last
|
||||
// allocated one.
|
||||
DEBUG("simple_buffer_unmap(address=%p): "
|
||||
"allocated=%zu, size=%zu, last_allocate=%zu\n",
|
||||
address, buffer->allocated, buffer->size,
|
||||
buffer->last_allocate);
|
||||
if ((buffer->buffer + buffer->allocated - buffer->last_allocate) ==
|
||||
address) {
|
||||
buffer->allocated -= buffer->last_allocate;
|
||||
buffer->last_allocate = 0;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* run_address is passed the address of a function taking no parameters and
|
||||
* jumps to it, returning the result.
|
||||
* @param f the address to call as a function.
|
||||
* @return value returned by the function.
|
||||
*/
|
||||
|
||||
int run_address(void *f)
|
||||
{
|
||||
int (*v) (void);
|
||||
v = f;
|
||||
return v();
|
||||
}
|
||||
|
||||
#endif
|
@@ -11,8 +11,6 @@ testobj := $(obj)/tests
|
||||
endif
|
||||
coverage-dir := $(testobj)/coverage_reports
|
||||
|
||||
coreboottop := ../../
|
||||
|
||||
cmockasrc := $(coreboottop)/3rdparty/cmocka
|
||||
cmockaobj := $(objutil)/cmocka
|
||||
CMOCKA_LIB := $(cmockaobj)/src/libcmocka.so
|
||||
@@ -34,16 +32,19 @@ TEST_CONFIG_ := CONFIG_LP_
|
||||
# Default includes
|
||||
TEST_CFLAGS := -include include/kconfig.h -include include/compiler.h
|
||||
TEST_CFLAGS += -Iinclude -Iinclude/mock
|
||||
TEST_CFLAGS += -I$(coreboottop)/src/commonlib/bsd/include
|
||||
TEST_CFLAGS += -I$(dir $(TEST_KCONFIG_AUTOHEADER))
|
||||
TEST_CFLAGS += -I$(VBOOT_SOURCE)/firmware/include
|
||||
|
||||
# Test specific includes
|
||||
TEST_CFLAGS += -I$(testsrc)/include -I$(testsrc)/include/mocks
|
||||
TEST_CFLAGS += -I$(testsrc)/include
|
||||
TEST_CFLAGS += -I$(cmockasrc)/include
|
||||
|
||||
# Minimal subset of warnings and errors. Tests can be less strict than actual build.
|
||||
TEST_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wvla
|
||||
TEST_CFLAGS += -Wwrite-strings -Wno-trigraphs -Wimplicit-fallthrough
|
||||
TEST_CFLAGS += -Wstrict-aliasing -Wshadow -Werror
|
||||
TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type
|
||||
|
||||
TEST_CFLAGS += -std=gnu11 -Os -ffunction-sections -fdata-sections -fno-builtin
|
||||
|
||||
@@ -140,10 +141,10 @@ $($(1)-objs): $(testobj)/$(1)/%.o: $$$$*.c $$($(1)-config-file)
|
||||
objcopy_wrap_flags=''; \
|
||||
for sym in $$($(1)-mocks); do \
|
||||
sym_line="$$$$($(HOSTOBJDUMP) -t $$@.orig \
|
||||
| grep -E \"[0-9a-fA-F]+\\s+w\\s+F\\s+.*\\s$$$$sym$$$$\")"; \
|
||||
| grep -E "[0-9a-fA-F]+\\s+w\\s+F\\s+.*\\s+$$$$sym$$$$")"; \
|
||||
if [ ! -z "$$$$sym_line" ] ; then \
|
||||
addr="$$$$(echo \"$$$$sym_line\" | awk '{ print $$$$1 }')"; \
|
||||
section="$$$$(echo \"$$$$sym_line\" | awk '{ print $$$$(NF - 2) }')"; \
|
||||
addr="$$$$(echo "$$$$sym_line" | awk '{ print $$$$1 }')"; \
|
||||
section="$$$$(echo "$$$$sym_line" | awk '{ print $$$$(NF - 2) }')"; \
|
||||
objcopy_wrap_flags="$$$$objcopy_wrap_flags --add-symbol __real_$$$${sym}=$$$${section}:0x$$$${addr},function,global"; \
|
||||
fi \
|
||||
done ; \
|
||||
|
114
payloads/libpayload/tests/include/mocks/cbfs_util.h
Normal file
114
payloads/libpayload/tests/include/mocks/cbfs_util.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef MOCKS_CBFS_UTIL_H
|
||||
#define MOCKS_CBFS_UTIL_H
|
||||
|
||||
#include <cbfs.h>
|
||||
#include <stddef.h>
|
||||
#include <tests/test.h>
|
||||
|
||||
#define BE32(be32) EMPTY_WRAP(\
|
||||
((be32) >> 24) & 0xff, ((be32) >> 16) & 0xff, \
|
||||
((be32) >> 8) & 0xff, ((be32) >> 0) & 0xff)
|
||||
|
||||
#define BE64(be64) EMPTY_WRAP( \
|
||||
BE32(((be64) >> 32) & 0xFFFFFFFF), \
|
||||
BE32(((be64) >> 0) & 0xFFFFFFFF))
|
||||
|
||||
#define LE32(val32) EMPTY_WRAP(\
|
||||
((val32) >> 0) & 0xff, ((val32) >> 8) & 0xff, \
|
||||
((val32) >> 16) & 0xff, ((val32) >> 24) & 0xff)
|
||||
|
||||
#define LE64(val64) EMPTY_WRAP( \
|
||||
BE32(((val64) >> 0) & 0xFFFFFFFF), \
|
||||
BE32(((val64) >> 32) & 0xFFFFFFFF))
|
||||
|
||||
#define FILENAME_SIZE 16
|
||||
|
||||
struct cbfs_test_file {
|
||||
struct cbfs_file header;
|
||||
u8 filename[FILENAME_SIZE];
|
||||
u8 attrs_and_data[200];
|
||||
};
|
||||
|
||||
#define TEST_MCACHE_SIZE (2 * MiB)
|
||||
|
||||
#define HEADER_INITIALIZER(ftype, attr_len, file_len) { \
|
||||
.magic = CBFS_FILE_MAGIC, \
|
||||
.len = htobe32(file_len), \
|
||||
.type = htobe32(ftype), \
|
||||
.attributes_offset = \
|
||||
htobe32(attr_len ? sizeof(struct cbfs_file) + FILENAME_SIZE : 0), \
|
||||
.offset = htobe32(sizeof(struct cbfs_file) + FILENAME_SIZE + attr_len), \
|
||||
}
|
||||
|
||||
#define HASH_ATTR_SIZE (offsetof(struct cbfs_file_attr_hash, hash.raw) + VB2_SHA256_DIGEST_SIZE)
|
||||
|
||||
/* This macro basically does nothing but suppresses linter messages */
|
||||
#define EMPTY_WRAP(...) __VA_ARGS__
|
||||
|
||||
#define TEST_DATA_1_FILENAME "test/data/1"
|
||||
#define TEST_DATA_1_SIZE sizeof((u8[]){TEST_DATA_1})
|
||||
#define TEST_DATA_1 EMPTY_WRAP( \
|
||||
'!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', \
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', \
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', \
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', \
|
||||
'[', '\\', ']', '^', '_', '`', \
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', \
|
||||
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
|
||||
|
||||
#define TEST_DATA_2_FILENAME "test/data/2"
|
||||
#define TEST_DATA_2_SIZE sizeof((u8[]){TEST_DATA_2})
|
||||
#define TEST_DATA_2 EMPTY_WRAP( \
|
||||
0x9d, 0xa9, 0x91, 0xac, 0x5d, 0xb2, 0x70, 0x76, 0x37, 0x94, 0x94, 0xa8, 0x8b, 0x78, \
|
||||
0xb9, 0xaa, 0x1a, 0x8e, 0x9a, 0x16, 0xbe, 0xdc, 0x29, 0x42, 0x46, 0x58, 0xd4, 0x37, \
|
||||
0x94, 0xca, 0x05, 0xdb, 0x54, 0xfa, 0xd8, 0x6e, 0x54, 0xd8, 0x30, 0x46, 0x5d, 0x62, \
|
||||
0xc2, 0xce, 0xd8, 0x74, 0x60, 0xaf, 0x83, 0x8f, 0xfa, 0x97, 0xdd, 0x6e, 0xcb, 0x60, \
|
||||
0xfa, 0xed, 0x8b, 0x55, 0x9e, 0xc1, 0xc2, 0x18, 0x4f, 0xe2, 0x28, 0x7e, 0xd7, 0x2f, \
|
||||
0xa2, 0x86, 0xfb, 0x4d, 0x3e, 0x00, 0x5a, 0xf7, 0xc2, 0xad, 0x0e, 0xa7, 0xa2, 0xf7, \
|
||||
0x38, 0x66, 0xe6, 0x5c, 0x76, 0x98, 0x89, 0x63, 0xeb, 0xc5, 0xf5, 0xb7, 0xa7, 0x58, \
|
||||
0xe0, 0xf0, 0x2e, 0x2f, 0xb0, 0x95, 0xb7, 0x43, 0x28, 0x19, 0x2d, 0xef, 0x1a, 0xb3, \
|
||||
0x42, 0x31, 0x55, 0x0f, 0xbc, 0xcd, 0x01, 0xe5, 0x39, 0x18, 0x88, 0x83, 0xb2, 0xc5, \
|
||||
0x4b, 0x3b, 0x38, 0xe7)
|
||||
|
||||
#define TEST_DATA_INT_1_FILENAME "test-int-1"
|
||||
#define TEST_DATA_INT_1_SIZE 8
|
||||
#define TEST_DATA_INT_1 0xFEDCBA9876543210ULL
|
||||
|
||||
#define TEST_DATA_INT_2_FILENAME "test-int-2"
|
||||
#define TEST_DATA_INT_2_SIZE 8
|
||||
#define TEST_DATA_INT_2 0x10FE32DC54A97698ULL
|
||||
|
||||
#define TEST_DATA_INT_3_FILENAME "test-int-3"
|
||||
#define TEST_DATA_INT_3_SIZE 8
|
||||
#define TEST_DATA_INT_3 0xFA57F003B0036667ULL
|
||||
|
||||
#define TEST_SHA256 \
|
||||
EMPTY_WRAP(0xef, 0xc7, 0xb1, 0x0a, 0xbf, 0x54, 0x2f, 0xaa, 0x12, 0xa6, 0xeb, 0xf, \
|
||||
0xff, 0xf4, 0x19, 0xc1, 0x63, 0xf4, 0x60, 0x50, 0xc5, 0xb0, 0xbe, 0x37, \
|
||||
0x32, 0x11, 0x19, 0x63, 0x61, 0xe0, 0x53, 0xe0)
|
||||
|
||||
#define INVALID_SHA256 \
|
||||
EMPTY_WRAP('T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'n', 'o', 't', ' ', 'a', ' ', 'v', \
|
||||
'a', 'l', 'i', 'd', ' ', 'S', 'H', 'A', '2', '5', '6', '!', '!', '!', '!', \
|
||||
'!', '!')
|
||||
|
||||
extern const u8 test_data_1[TEST_DATA_1_SIZE];
|
||||
extern const u8 test_data_2[TEST_DATA_2_SIZE];
|
||||
extern const u8 test_data_int_1[TEST_DATA_INT_1_SIZE];
|
||||
extern const u8 test_data_int_2[TEST_DATA_INT_2_SIZE];
|
||||
extern const u8 test_data_int_3[TEST_DATA_INT_3_SIZE];
|
||||
|
||||
extern const u8 good_hash[VB2_SHA256_DIGEST_SIZE];
|
||||
extern const u8 bad_hash[VB2_SHA256_DIGEST_SIZE];
|
||||
|
||||
extern const struct cbfs_test_file file_no_hash;
|
||||
extern const struct cbfs_test_file file_valid_hash;
|
||||
extern const struct cbfs_test_file file_broken_hash;
|
||||
extern const struct cbfs_test_file test_file_1;
|
||||
extern const struct cbfs_test_file test_file_2;
|
||||
extern const struct cbfs_test_file test_file_int_1;
|
||||
extern const struct cbfs_test_file test_file_int_2;
|
||||
extern const struct cbfs_test_file test_file_int_3;
|
||||
|
||||
#endif /* MOCKS_CBFS_UTIL_H */
|
3
payloads/libpayload/tests/libc/Makefile.inc
Normal file
3
payloads/libpayload/tests/libc/Makefile.inc
Normal file
@@ -0,0 +1,3 @@
|
||||
tests-y += fmap_locate_area-test
|
||||
|
||||
fmap_locate_area-test-srcs += tests/libc/fmap_locate_area-test.c
|
112
payloads/libpayload/tests/libc/fmap_locate_area-test.c
Normal file
112
payloads/libpayload/tests/libc/fmap_locate_area-test.c
Normal file
@@ -0,0 +1,112 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include "../libc/fmap.c"
|
||||
|
||||
#include <libpayload.h>
|
||||
#include <tests/test.h>
|
||||
|
||||
|
||||
/* Mocks */
|
||||
struct sysinfo_t lib_sysinfo;
|
||||
unsigned long virtual_offset = 0;
|
||||
|
||||
static void reset_fmap_cache(void)
|
||||
{
|
||||
_fmap_cache = NULL;
|
||||
}
|
||||
|
||||
static int setup_fmap_test(void **state)
|
||||
{
|
||||
reset_fmap_cache();
|
||||
lib_sysinfo.fmap_cache = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_fmap_locate_area_no_fmap_available(void **state)
|
||||
{
|
||||
size_t offset = 0;
|
||||
size_t size = 0;
|
||||
|
||||
assert_int_equal(-1, fmap_locate_area("COREBOOT", &offset, &size));
|
||||
}
|
||||
|
||||
static void test_fmap_locate_area_incorrect_signature(void **state)
|
||||
{
|
||||
size_t offset = 0;
|
||||
size_t size = 0;
|
||||
struct fmap mock_fmap = {
|
||||
.signature = "NOT_MAP",
|
||||
};
|
||||
lib_sysinfo.fmap_cache = (uintptr_t)&mock_fmap;
|
||||
|
||||
assert_int_equal(-1, fmap_locate_area("COREBOOT", &offset, &size));
|
||||
}
|
||||
|
||||
static void test_fmap_locate_area_success(void **state)
|
||||
{
|
||||
size_t offset = 0;
|
||||
size_t size = 0;
|
||||
struct fmap mock_fmap = {
|
||||
.signature = FMAP_SIGNATURE,
|
||||
.ver_major = 1,
|
||||
.ver_minor = 1,
|
||||
.base = 0xAABB,
|
||||
.size = 0x10000,
|
||||
.nareas = 3,
|
||||
};
|
||||
struct fmap_area area_1 = {
|
||||
.size = 0x1100,
|
||||
.offset = 0x11,
|
||||
.name = {'F', 'I', 'R', 'S', 'T', '_', 'A', 'R', 'E', 'A', 0},
|
||||
.flags = 0,
|
||||
};
|
||||
struct fmap_area area_2 = {
|
||||
.size = 0x2200,
|
||||
.offset = 0x1111,
|
||||
.name = {'S', 'E', 'C', 'O', 'N', 'D', '_', 'A', 'R', 'E', 'A', 0},
|
||||
.flags = 0,
|
||||
};
|
||||
struct fmap_area area_3 = {
|
||||
.size = 0x100,
|
||||
.offset = 0x3311,
|
||||
.name = {'T', 'H', 'I', 'R', 'D', '_', 'A', 'R', 'E', 'A', 0},
|
||||
.flags = 0,
|
||||
};
|
||||
u8 fmap_buffer[sizeof(struct fmap) + 3 * sizeof(struct fmap_area)];
|
||||
memcpy(fmap_buffer, &mock_fmap, sizeof(mock_fmap));
|
||||
memcpy(&fmap_buffer[sizeof(mock_fmap)], &area_1, sizeof(area_1));
|
||||
memcpy(&fmap_buffer[sizeof(mock_fmap) + sizeof(area_1)], &area_2, sizeof(area_2));
|
||||
memcpy(&fmap_buffer[sizeof(mock_fmap) + sizeof(area_1) + sizeof(area_2)], &area_3,
|
||||
sizeof(area_3));
|
||||
|
||||
/* Cache only */
|
||||
reset_fmap_cache();
|
||||
lib_sysinfo.fmap_cache = (uintptr_t)fmap_buffer;
|
||||
|
||||
assert_int_equal(0, fmap_locate_area("FIRST_AREA", &offset, &size));
|
||||
assert_int_equal(area_1.offset, offset);
|
||||
assert_int_equal(area_1.size, size);
|
||||
|
||||
assert_int_equal(0, fmap_locate_area("THIRD_AREA", &offset, &size));
|
||||
assert_int_equal(area_3.offset, offset);
|
||||
assert_int_equal(area_3.size, size);
|
||||
|
||||
assert_int_equal(0, fmap_locate_area("SECOND_AREA", &offset, &size));
|
||||
assert_int_equal(area_2.offset, offset);
|
||||
assert_int_equal(area_2.size, size);
|
||||
|
||||
reset_fmap_cache();
|
||||
}
|
||||
|
||||
#define FMAP_LOCATE_AREA_TEST(fn) cmocka_unit_test_setup(fn, setup_fmap_test)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const struct CMUnitTest tests[] = {
|
||||
FMAP_LOCATE_AREA_TEST(test_fmap_locate_area_no_fmap_available),
|
||||
FMAP_LOCATE_AREA_TEST(test_fmap_locate_area_incorrect_signature),
|
||||
FMAP_LOCATE_AREA_TEST(test_fmap_locate_area_success),
|
||||
};
|
||||
|
||||
return lp_run_group_tests(tests, NULL, NULL);
|
||||
}
|
33
payloads/libpayload/tests/libcbfs/Makefile.inc
Normal file
33
payloads/libpayload/tests/libcbfs/Makefile.inc
Normal file
@@ -0,0 +1,33 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
tests-y += cbfs-lookup-no-fallback-test
|
||||
tests-y += cbfs-lookup-has-fallback-test
|
||||
tests-y += cbfs-verification-no-sha512-test
|
||||
tests-y += cbfs-verification-has-sha512-test
|
||||
tests-y += cbfs-no-verification-no-sha512-test
|
||||
tests-y += cbfs-no-verification-has-sha512-test
|
||||
|
||||
|
||||
cbfs-lookup-no-fallback-test-srcs += tests/libcbfs/cbfs-lookup-test.c
|
||||
cbfs-lookup-no-fallback-test-srcs += tests/mocks/cbfs_file_mock.c
|
||||
cbfs-lookup-no-fallback-test-config += CONFIG_LP_ENABLE_CBFS_FALLBACK=0
|
||||
cbfs-lookup-no-fallback-test-config += CONFIG_LP_LZ4=1
|
||||
cbfs-lookup-no-fallback-test-config += CONFIG_LP_LZMA=1
|
||||
|
||||
$(call copy-test,cbfs-lookup-no-fallback-test,cbfs-lookup-has-fallback-test)
|
||||
cbfs-lookup-has-fallback-test-config += CONFIG_LP_ENABLE_CBFS_FALLBACK=1
|
||||
|
||||
cbfs-verification-no-sha512-test-srcs += tests/libcbfs/cbfs-verification-test.c
|
||||
cbfs-verification-no-sha512-test-srcs += tests/mocks/cbfs_file_mock.c
|
||||
cbfs-verification-no-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=1
|
||||
cbfs-verification-no-sha512-test-config += VB2_SUPPORT_SHA512=0
|
||||
|
||||
$(call copy-test,cbfs-verification-no-sha512-test,cbfs-verification-has-sha512-test)
|
||||
cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1
|
||||
|
||||
$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-no-sha512-test)
|
||||
cbfs-verification-has-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=0
|
||||
|
||||
$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-has-sha512-test)
|
||||
cbfs-verification-has-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=0
|
||||
cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1
|
729
payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c
Normal file
729
payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c
Normal file
@@ -0,0 +1,729 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0.-only */
|
||||
|
||||
#include <libpayload-config.h>
|
||||
#include <cbfs.h>
|
||||
#include <cbfs_glue.h>
|
||||
#include <commonlib/bsd/cb_err.h>
|
||||
#include <commonlib/bsd/cbfs_mdata.h>
|
||||
#include <endian.h>
|
||||
#include <mocks/cbfs_util.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysinfo.h>
|
||||
#include <tests/test.h>
|
||||
|
||||
#include "../libcbfs/cbfs.c"
|
||||
|
||||
/* Mocks */
|
||||
|
||||
unsigned long virtual_offset = 0;
|
||||
struct sysinfo_t lib_sysinfo;
|
||||
|
||||
unsigned long ulzman(const unsigned char *src, unsigned long srcn, unsigned char *dst,
|
||||
unsigned long dstn)
|
||||
{
|
||||
assert_true(dstn != 0);
|
||||
check_expected(srcn);
|
||||
check_expected(dstn);
|
||||
memcpy(dst, src, dstn);
|
||||
return dstn;
|
||||
}
|
||||
|
||||
size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
|
||||
{
|
||||
assert_non_null(dstn);
|
||||
check_expected(srcn);
|
||||
check_expected(dstn);
|
||||
memcpy(dst, src, dstn);
|
||||
return dstn;
|
||||
}
|
||||
|
||||
static size_t test_fmap_offset = 0;
|
||||
static size_t test_fmap_size = 0;
|
||||
static cb_err_t test_fmap_result = CB_SUCCESS;
|
||||
|
||||
static void set_fmap_locate_area_results(size_t offset, size_t size, size_t result)
|
||||
{
|
||||
test_fmap_offset = offset;
|
||||
test_fmap_size = size;
|
||||
test_fmap_result = result;
|
||||
}
|
||||
|
||||
cb_err_t fmap_locate_area(const char *name, size_t *offset, size_t *size)
|
||||
{
|
||||
*offset = test_fmap_offset;
|
||||
*size = test_fmap_size;
|
||||
return test_fmap_result;
|
||||
}
|
||||
|
||||
cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name,
|
||||
union cbfs_mdata *mdata_out, size_t *data_offset_out)
|
||||
{
|
||||
assert_non_null(mcache);
|
||||
assert_true(mcache_size > 0 && mcache_size % CBFS_MCACHE_ALIGNMENT == 0);
|
||||
assert_non_null(mdata_out);
|
||||
assert_non_null(data_offset_out);
|
||||
|
||||
check_expected(name);
|
||||
|
||||
cb_err_t ret = mock_type(cb_err_t);
|
||||
if (ret != CB_SUCCESS)
|
||||
return ret;
|
||||
|
||||
memcpy(mdata_out, mock_ptr_type(const union cbfs_mdata *), sizeof(union cbfs_mdata));
|
||||
*data_offset_out = mock_type(size_t);
|
||||
return CB_SUCCESS;
|
||||
}
|
||||
|
||||
static void expect_cbfs_mcache_lookup(const char *name, cb_err_t err,
|
||||
const union cbfs_mdata *mdata, size_t data_offset_out)
|
||||
{
|
||||
expect_string(cbfs_mcache_lookup, name, name);
|
||||
will_return(cbfs_mcache_lookup, err);
|
||||
|
||||
if (err == CB_SUCCESS) {
|
||||
will_return(cbfs_mcache_lookup, mdata);
|
||||
will_return(cbfs_mcache_lookup, data_offset_out);
|
||||
}
|
||||
}
|
||||
|
||||
cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out,
|
||||
size_t *data_offset_out, struct vb2_hash *metadata_hash)
|
||||
{
|
||||
assert_non_null(dev);
|
||||
check_expected(name);
|
||||
|
||||
cb_err_t ret = mock_type(cb_err_t);
|
||||
if (ret != CB_SUCCESS)
|
||||
return ret;
|
||||
|
||||
memcpy(mdata_out, mock_ptr_type(const union cbfS_mdata *), sizeof(union cbfs_mdata));
|
||||
*data_offset_out = mock_type(size_t);
|
||||
return CB_SUCCESS;
|
||||
}
|
||||
|
||||
static void expect_cbfs_lookup(const char *name, cb_err_t err, const union cbfs_mdata *mdata,
|
||||
size_t data_offset_out)
|
||||
{
|
||||
expect_string(cbfs_lookup, name, name);
|
||||
will_return(cbfs_lookup, err);
|
||||
|
||||
if (err == CB_SUCCESS) {
|
||||
will_return(cbfs_lookup, mdata);
|
||||
will_return(cbfs_lookup, data_offset_out);
|
||||
}
|
||||
}
|
||||
|
||||
const void *cbfs_find_attr(const union cbfs_mdata *mdata, uint32_t attr_tag, size_t size_check)
|
||||
{
|
||||
return mock_ptr_type(void *);
|
||||
}
|
||||
|
||||
static bool force_single_boot_device_size_failure = false;
|
||||
|
||||
ssize_t boot_device_read(void *buf, size_t offset, size_t size)
|
||||
{
|
||||
memcpy(buf, (void *)offset, size);
|
||||
if (force_single_boot_device_size_failure) {
|
||||
force_single_boot_device_size_failure = false;
|
||||
return CB_ERR;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
/* Utils */
|
||||
|
||||
static size_t get_cbfs_file_size(const void *file_ptr)
|
||||
{
|
||||
const struct cbfs_file *f = file_ptr;
|
||||
return be32toh(f->offset) + be32toh(f->len);
|
||||
}
|
||||
|
||||
static void create_cbfs(const struct cbfs_test_file *files[], const size_t nfiles,
|
||||
uint8_t *buffer, const size_t buffer_size)
|
||||
{
|
||||
uint8_t *data_ptr = buffer;
|
||||
size_t file_size = 0;
|
||||
memset(buffer, 0, buffer_size);
|
||||
for (size_t i = 0; i < nfiles; ++i) {
|
||||
if (files[i] == NULL) {
|
||||
file_size = CBFS_ALIGNMENT;
|
||||
assert_true(&data_ptr[file_size] < &buffer[buffer_size]);
|
||||
} else {
|
||||
file_size = get_cbfs_file_size(files[i]);
|
||||
assert_true(&data_ptr[file_size] < &buffer[buffer_size]);
|
||||
memcpy(data_ptr, files[i], file_size);
|
||||
}
|
||||
data_ptr = &data_ptr[file_size];
|
||||
data_ptr = &buffer[ALIGN_UP((uintptr_t)data_ptr - (uintptr_t)buffer,
|
||||
CBFS_ALIGNMENT)];
|
||||
}
|
||||
}
|
||||
|
||||
static size_t get_created_cbfs_file_start_offset(const struct cbfs_test_file *files[],
|
||||
const size_t nfile)
|
||||
{
|
||||
size_t offset_out = 0;
|
||||
size_t offset = 0;
|
||||
for (size_t i = 0; i < nfile; ++i) {
|
||||
offset = files[i] ? get_cbfs_file_size(files[i]) : CBFS_ALIGNMENT;
|
||||
offset_out = ALIGN_UP(offset_out + offset, CBFS_ALIGNMENT);
|
||||
}
|
||||
return offset_out;
|
||||
}
|
||||
|
||||
/* Setup */
|
||||
|
||||
static uint8_t
|
||||
aligned_cbfs_ro_buffer[(sizeof(struct cbfs_test_file) + CBFS_ALIGNMENT * 50)] __aligned(
|
||||
CBFS_ALIGNMENT);
|
||||
static const size_t aligned_cbfs_ro_buffer_size = sizeof(aligned_cbfs_ro_buffer);
|
||||
static uint8_t
|
||||
aligned_cbfs_rw_buffer[(sizeof(struct cbfs_test_file) + CBFS_ALIGNMENT * 50)] __aligned(
|
||||
CBFS_ALIGNMENT);
|
||||
static const size_t aligned_cbfs_rw_buffer_size = sizeof(aligned_cbfs_rw_buffer);
|
||||
|
||||
static uint8_t *unaligned_cbfs_ro_buffer = &aligned_cbfs_ro_buffer[5];
|
||||
static const size_t unaligned_cbfs_ro_buffer_size = aligned_cbfs_ro_buffer_size - 5;
|
||||
static uint8_t *unaligned_cbfs_rw_buffer = &aligned_cbfs_rw_buffer[5];
|
||||
static const size_t unaligned_cbfs_rw_buffer_size = aligned_cbfs_rw_buffer_size - 5;
|
||||
|
||||
struct cbfs_test_state {
|
||||
uint8_t *cbfs_ro_buf;
|
||||
uint64_t cbfs_ro_size;
|
||||
uint8_t *cbfs_rw_buf;
|
||||
uint64_t cbfs_rw_size;
|
||||
|
||||
size_t mcache_ro_offset;
|
||||
size_t mcache_ro_size;
|
||||
size_t mcache_rw_offset;
|
||||
size_t mcache_rw_size;
|
||||
|
||||
struct cbfs_test_setup {
|
||||
bool unaligned;
|
||||
bool init_ro;
|
||||
bool init_rw;
|
||||
} ex;
|
||||
};
|
||||
|
||||
|
||||
/* Because of how CMocka works, it should be called in the test function, or in the setup
|
||||
function only if CBFS API capable of initializing RO CBFS boot device is called. */
|
||||
static void setup_cbfs_boot_device(struct cbfs_test_state *s)
|
||||
{
|
||||
set_fmap_locate_area_results(0, 0, CB_SUCCESS);
|
||||
lib_sysinfo.cbfs_ro_mcache_offset = 0;
|
||||
lib_sysinfo.cbfs_ro_mcache_size = 0;
|
||||
memset((void *)cbfs_get_boot_device(true), 0, sizeof(struct cbfs_boot_device));
|
||||
if (s->ex.init_ro) {
|
||||
set_fmap_locate_area_results((size_t)s->cbfs_ro_buf, s->cbfs_ro_size,
|
||||
CB_SUCCESS);
|
||||
lib_sysinfo.cbfs_ro_mcache_offset = s->mcache_ro_offset;
|
||||
lib_sysinfo.cbfs_ro_mcache_size = s->mcache_ro_size;
|
||||
}
|
||||
|
||||
lib_sysinfo.cbfs_offset = 0;
|
||||
lib_sysinfo.cbfs_size = 0;
|
||||
lib_sysinfo.cbfs_rw_mcache_offset = 0;
|
||||
lib_sysinfo.cbfs_rw_mcache_size = 0;
|
||||
memset((void *)cbfs_get_boot_device(false), 0, sizeof(struct cbfs_boot_device));
|
||||
if (s->ex.init_rw) {
|
||||
lib_sysinfo.cbfs_offset = (uint64_t)s->cbfs_rw_buf;
|
||||
lib_sysinfo.cbfs_size = s->cbfs_rw_size;
|
||||
lib_sysinfo.cbfs_rw_mcache_offset = s->mcache_rw_offset;
|
||||
lib_sysinfo.cbfs_rw_mcache_size = s->mcache_rw_size;
|
||||
}
|
||||
}
|
||||
|
||||
static int setup_cbfs_test(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = calloc(1, sizeof(*s));
|
||||
|
||||
if (!s)
|
||||
return 1;
|
||||
|
||||
if (*state)
|
||||
memcpy(&s->ex, *state, sizeof(s->ex));
|
||||
|
||||
if (s->ex.init_ro) {
|
||||
if (s->ex.unaligned) {
|
||||
s->cbfs_ro_buf = unaligned_cbfs_ro_buffer;
|
||||
s->cbfs_ro_size = unaligned_cbfs_ro_buffer_size;
|
||||
} else {
|
||||
s->cbfs_ro_buf = aligned_cbfs_ro_buffer;
|
||||
s->cbfs_ro_size = aligned_cbfs_ro_buffer_size;
|
||||
}
|
||||
}
|
||||
|
||||
if (s->ex.init_rw) {
|
||||
if (s->ex.unaligned) {
|
||||
s->cbfs_rw_buf = unaligned_cbfs_rw_buffer;
|
||||
s->cbfs_rw_size = unaligned_cbfs_rw_buffer_size;
|
||||
} else {
|
||||
s->cbfs_rw_buf = aligned_cbfs_rw_buffer;
|
||||
s->cbfs_rw_size = aligned_cbfs_rw_buffer_size;
|
||||
}
|
||||
}
|
||||
|
||||
*state = s;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int teardown_cbfs_test(void **state)
|
||||
{
|
||||
if (*state)
|
||||
free(*state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Tests */
|
||||
|
||||
static void test_cbfs_boot_device_init(void **state)
|
||||
{
|
||||
const struct cbfs_boot_device *cbd = NULL;
|
||||
|
||||
/* No valid RO, should fail */
|
||||
set_fmap_locate_area_results(0, 0, CB_ERR);
|
||||
lib_sysinfo.cbfs_offset = 0;
|
||||
lib_sysinfo.cbfs_size = 0;
|
||||
lib_sysinfo.cbfs_rw_mcache_size = 0;
|
||||
lib_sysinfo.cbfs_rw_mcache_offset = 0;
|
||||
lib_sysinfo.cbfs_ro_mcache_offset = 0;
|
||||
lib_sysinfo.cbfs_ro_mcache_size = 0;
|
||||
assert_int_equal(NULL, cbfs_get_boot_device(true));
|
||||
assert_null(cbfs_ro_map("file", NULL));
|
||||
|
||||
/* Valid RO */
|
||||
set_fmap_locate_area_results(0x12345678, 0x90ABCDEF, CB_SUCCESS);
|
||||
lib_sysinfo.cbfs_ro_mcache_offset = 0x600D41C3;
|
||||
lib_sysinfo.cbfs_ro_mcache_size = 0xBADBEEFF;
|
||||
cbd = cbfs_get_boot_device(true);
|
||||
assert_non_null(cbd);
|
||||
assert_int_equal(0x12345678, cbd->dev.offset);
|
||||
assert_int_equal(0x90ABCDEF, cbd->dev.size);
|
||||
assert_int_equal(0xBADBEEFF, cbd->mcache_size);
|
||||
assert_int_equal(0x600D41C3, cbd->mcache);
|
||||
|
||||
lib_sysinfo.cbfs_offset = 0xAABBCCDD;
|
||||
lib_sysinfo.cbfs_size = 0x1000;
|
||||
lib_sysinfo.cbfs_rw_mcache_offset = 0x8F8F8F8F;
|
||||
lib_sysinfo.cbfs_rw_mcache_size = 0x500;
|
||||
cbd = cbfs_get_boot_device(false);
|
||||
assert_non_null(cbd);
|
||||
assert_int_equal(0xAABBCCDD, cbd->dev.offset);
|
||||
assert_int_equal(0x1000, cbd->dev.size);
|
||||
assert_int_equal(0x8F8F8F8F, cbd->mcache);
|
||||
assert_int_equal(0x500, cbd->mcache_size);
|
||||
}
|
||||
|
||||
/* This test checks cbfs_map() basic cases and covers only RW CBFS. */
|
||||
void test_cbfs_map(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
void *mapping = NULL;
|
||||
size_t size_out = 0;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_int_1, &test_file_2, NULL, &test_file_int_3,
|
||||
&test_file_int_2, NULL, NULL, &test_file_1,
|
||||
};
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
size_t foffset = 0;
|
||||
|
||||
setup_cbfs_boot_device(s);
|
||||
cbfs_buf = s->cbfs_rw_buf;
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_rw_buf, s->cbfs_rw_size);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 0);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_map(TEST_DATA_INT_1_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_1_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_1, mapping, TEST_DATA_INT_1_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 1);
|
||||
expect_cbfs_lookup(TEST_DATA_2_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_2.header.offset));
|
||||
will_return(cbfs_find_attr, &test_file_2.attrs_and_data);
|
||||
expect_value(ulzman, srcn, TEST_DATA_2_SIZE);
|
||||
expect_value(ulzman, dstn, TEST_DATA_2_SIZE);
|
||||
mapping = cbfs_map(TEST_DATA_2_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_2_SIZE, size_out);
|
||||
assert_memory_equal(test_data_2, mapping, TEST_DATA_2_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 3);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_3_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_3.header.offset));
|
||||
will_return(cbfs_find_attr, &test_file_int_3.attrs_and_data);
|
||||
expect_value(ulz4fn, srcn, TEST_DATA_INT_3_SIZE);
|
||||
expect_value(ulz4fn, dstn, TEST_DATA_INT_3_SIZE);
|
||||
mapping = cbfs_map(TEST_DATA_INT_3_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_3_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_3, mapping, TEST_DATA_INT_3_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 4);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_2_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_2.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_map(TEST_DATA_INT_2_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_2_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_2, mapping, TEST_DATA_INT_2_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 7);
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_1_SIZE, size_out);
|
||||
assert_memory_equal(test_data_1, mapping, TEST_DATA_1_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
expect_cbfs_lookup("invalid_file", CB_CBFS_NOT_FOUND, 0, 0);
|
||||
if (s->ex.init_rw && CONFIG(LP_ENABLE_CBFS_FALLBACK))
|
||||
expect_cbfs_lookup("invalid_file", CB_CBFS_NOT_FOUND, 0, 0);
|
||||
mapping = cbfs_map("invalid_file", &size_out);
|
||||
assert_null(mapping);
|
||||
}
|
||||
|
||||
static void test_cbfs_invalid_compression_algo(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
void *mapping = NULL;
|
||||
size_t size_out = 0;
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
struct cbfs_test_file *f;
|
||||
struct cbfs_file_attr_compression *comp;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_2,
|
||||
};
|
||||
|
||||
setup_cbfs_boot_device(s);
|
||||
cbfs_buf = s->cbfs_rw_buf;
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_rw_buf, s->cbfs_rw_size);
|
||||
|
||||
f = (struct cbfs_test_file *)cbfs_buf;
|
||||
comp = (struct cbfs_file_attr_compression *)&f->attrs_and_data[0];
|
||||
comp->compression = 0xFFFFFFF0;
|
||||
|
||||
size_out = 0;
|
||||
expect_cbfs_lookup(TEST_DATA_2_FILENAME, CB_SUCCESS, (const union cbfs_mdata *)cbfs_buf,
|
||||
be32toh(test_file_1.header.offset));
|
||||
will_return(cbfs_find_attr, comp);
|
||||
mapping = cbfs_map(TEST_DATA_2_FILENAME, &size_out);
|
||||
assert_null(mapping);
|
||||
}
|
||||
|
||||
static void test_cbfs_io_error(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
setup_cbfs_boot_device(s);
|
||||
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_CBFS_IO, 0, 0);
|
||||
assert_null(cbfs_map(TEST_DATA_1_FILENAME, NULL));
|
||||
}
|
||||
|
||||
static void test_cbfs_successful_fallback_to_ro(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
void *mapping = NULL;
|
||||
size_t size_out = 0;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_1, &test_file_2, &test_file_int_1,
|
||||
&test_file_int_1, &test_file_int_2, &test_file_int_3,
|
||||
};
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
size_t foffset = 0;
|
||||
|
||||
if (!CONFIG(LP_ENABLE_CBFS_FALLBACK)) {
|
||||
print_message("Skipping test, because LP_ENABLE_CBFS_FALLBACK == 0\n");
|
||||
skip();
|
||||
}
|
||||
|
||||
setup_cbfs_boot_device(s);
|
||||
cbfs_buf = s->cbfs_ro_buf;
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_ro_buf, s->cbfs_ro_size);
|
||||
if (s->ex.init_rw)
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files) - 2, s->cbfs_rw_buf,
|
||||
s->cbfs_rw_size);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 1);
|
||||
expect_cbfs_lookup(TEST_DATA_2_FILENAME, CB_CBFS_NOT_FOUND, 0, 0);
|
||||
expect_cbfs_lookup(TEST_DATA_2_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_2.header.offset));
|
||||
will_return(cbfs_find_attr, &test_file_2.attrs_and_data);
|
||||
expect_value(ulzman, srcn, TEST_DATA_2_SIZE);
|
||||
expect_value(ulzman, dstn, TEST_DATA_2_SIZE);
|
||||
mapping = cbfs_map(TEST_DATA_2_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_2_SIZE, size_out);
|
||||
assert_memory_equal(test_data_2, mapping, TEST_DATA_2_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 5);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_3_FILENAME, CB_CBFS_NOT_FOUND, 0, 0);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_3_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_3.header.offset));
|
||||
will_return(cbfs_find_attr, &test_file_int_3.attrs_and_data);
|
||||
expect_value(ulz4fn, srcn, TEST_DATA_INT_3_SIZE);
|
||||
expect_value(ulz4fn, dstn, TEST_DATA_INT_3_SIZE);
|
||||
mapping = cbfs_map(TEST_DATA_INT_3_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_3_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_3, mapping, TEST_DATA_INT_3_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
}
|
||||
|
||||
static void test_cbfs_load(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
size_t size_out = 0;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_int_1, &test_file_2, NULL, &test_file_int_3,
|
||||
&test_file_int_2, NULL, NULL, &test_file_1,
|
||||
};
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
uint8_t load_buf[1 * KiB];
|
||||
size_t foffset = 0;
|
||||
|
||||
setup_cbfs_boot_device(s);
|
||||
cbfs_buf = s->cbfs_rw_buf;
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_rw_buf, s->cbfs_rw_size);
|
||||
|
||||
/* Successful load */
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 0);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
size_out = cbfs_load(TEST_DATA_INT_1_FILENAME, load_buf, sizeof(load_buf));
|
||||
assert_int_equal(TEST_DATA_INT_1_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_1, load_buf, TEST_DATA_INT_1_SIZE);
|
||||
|
||||
/* Buffer too small */
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 7);
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
size_out = cbfs_load(TEST_DATA_1_FILENAME, load_buf, TEST_DATA_1_SIZE / 2);
|
||||
assert_int_equal(0, size_out);
|
||||
}
|
||||
|
||||
static void test_cbfs_map_with_mcache(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
void *mapping = NULL;
|
||||
size_t size_out = 0;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_int_2, &test_file_1, NULL,
|
||||
&test_file_int_3, &test_file_int_1, &test_file_2,
|
||||
};
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
size_t foffset = 0;
|
||||
|
||||
/* Will not be accessed, just needs to be valid. */
|
||||
s->mcache_ro_offset = ALIGN_UP(0x1000, CBFS_MCACHE_ALIGNMENT);
|
||||
s->mcache_ro_size = ALIGN_UP(0x500, CBFS_MCACHE_ALIGNMENT);
|
||||
s->mcache_rw_offset = ALIGN_UP(0x3000, CBFS_MCACHE_ALIGNMENT);
|
||||
s->mcache_rw_size = ALIGN_UP(0x600, CBFS_MCACHE_ALIGNMENT);
|
||||
setup_cbfs_boot_device(s);
|
||||
cbfs_buf = s->cbfs_rw_buf;
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_rw_buf, s->cbfs_rw_size);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 4);
|
||||
expect_cbfs_mcache_lookup(TEST_DATA_INT_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_map(TEST_DATA_INT_1_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_1_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_1, mapping, TEST_DATA_INT_1_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
}
|
||||
|
||||
static void test_cbfs_boot_device_read_failure(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
void *mapping = NULL;
|
||||
size_t size_out = 0;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_int_3, &test_file_1, NULL,
|
||||
&test_file_int_3, &test_file_int_1, &test_file_2,
|
||||
};
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
size_t foffset = 0;
|
||||
|
||||
setup_cbfs_boot_device(s);
|
||||
cbfs_buf = s->cbfs_rw_buf;
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_rw_buf, s->cbfs_rw_size);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 1);
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
force_single_boot_device_size_failure = true;
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, &size_out);
|
||||
assert_null(mapping);
|
||||
}
|
||||
|
||||
/* This test uses RW CBFS only */
|
||||
static void test_cbfs_unverified_area_map(void **state)
|
||||
{
|
||||
struct cbfs_test_state *s = *state;
|
||||
void *mapping = NULL;
|
||||
size_t size_out = 0;
|
||||
const struct cbfs_test_file *cbfs_files[] = {
|
||||
&test_file_int_1, &test_file_2, NULL, &test_file_int_3,
|
||||
&test_file_int_2, NULL, NULL, &test_file_1,
|
||||
};
|
||||
uint8_t *cbfs_buf = NULL;
|
||||
size_t foffset = 0;
|
||||
|
||||
cbfs_buf = s->cbfs_rw_buf;
|
||||
set_fmap_locate_area_results((size_t)cbfs_buf, s->cbfs_rw_size, CB_SUCCESS);
|
||||
create_cbfs(cbfs_files, ARRAY_SIZE(cbfs_files), s->cbfs_rw_buf, s->cbfs_rw_size);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 0);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_unverified_area_map("TEST_AREA", TEST_DATA_INT_1_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_1_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_1, mapping, TEST_DATA_INT_1_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 1);
|
||||
expect_cbfs_lookup(TEST_DATA_2_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_2.header.offset));
|
||||
will_return(cbfs_find_attr, &test_file_2.attrs_and_data);
|
||||
expect_value(ulzman, srcn, TEST_DATA_2_SIZE);
|
||||
expect_value(ulzman, dstn, TEST_DATA_2_SIZE);
|
||||
mapping = cbfs_unverified_area_map("TEST_AREA", TEST_DATA_2_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_2_SIZE, size_out);
|
||||
assert_memory_equal(test_data_2, mapping, TEST_DATA_2_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 3);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_3_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_3.header.offset));
|
||||
will_return(cbfs_find_attr, &test_file_int_3.attrs_and_data);
|
||||
expect_value(ulz4fn, srcn, TEST_DATA_INT_3_SIZE);
|
||||
expect_value(ulz4fn, dstn, TEST_DATA_INT_3_SIZE);
|
||||
mapping = cbfs_unverified_area_map("TEST_AREA", TEST_DATA_INT_3_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_3_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_3, mapping, TEST_DATA_INT_3_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 4);
|
||||
expect_cbfs_lookup(TEST_DATA_INT_2_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_int_2.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_unverified_area_map("TEST_AREA", TEST_DATA_INT_2_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_INT_2_SIZE, size_out);
|
||||
assert_memory_equal(test_data_int_2, mapping, TEST_DATA_INT_2_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
foffset = get_created_cbfs_file_start_offset(cbfs_files, 7);
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&cbfs_buf[foffset],
|
||||
foffset + be32toh(test_file_1.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
mapping = cbfs_unverified_area_map("TEST_AREA", TEST_DATA_1_FILENAME, &size_out);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_1_SIZE, size_out);
|
||||
assert_memory_equal(test_data_1, mapping, TEST_DATA_1_SIZE);
|
||||
cbfs_unmap(mapping);
|
||||
|
||||
size_out = 0;
|
||||
expect_cbfs_lookup("invalid_file", CB_CBFS_NOT_FOUND, 0, 0);
|
||||
mapping = cbfs_unverified_area_map("TEST_AREA", "invalid_file", &size_out);
|
||||
assert_null(mapping);
|
||||
}
|
||||
|
||||
#define TEST_CBFS_NAME_ALIGN_RO_RW(fn, test_name, enable_unaligned, enable_init_ro, \
|
||||
enable_init_rw) \
|
||||
((struct CMUnitTest){ \
|
||||
.name = (test_name), \
|
||||
.test_func = (fn), \
|
||||
.setup_func = setup_cbfs_test, \
|
||||
.teardown_func = teardown_cbfs_test, \
|
||||
.initial_state = \
|
||||
&(struct cbfs_test_setup){ \
|
||||
.unaligned = enable_unaligned, \
|
||||
.init_ro = enable_init_ro, \
|
||||
.init_rw = enable_init_rw, \
|
||||
}, \
|
||||
})
|
||||
|
||||
#define TEST_CBFS_LOOKUP(fn) \
|
||||
EMPTY_WRAP(TEST_CBFS_NAME_ALIGN_RO_RW(fn, #fn ", RW, aligned", false, false, true), \
|
||||
TEST_CBFS_NAME_ALIGN_RO_RW(fn, #fn ", RW, unaligned", true, false, true))
|
||||
|
||||
#define TEST_CBFS_RO_FALLBACK(fn) \
|
||||
EMPTY_WRAP(TEST_CBFS_NAME_ALIGN_RO_RW(fn, #fn ", RW+RO, aligned", false, true, true), \
|
||||
TEST_CBFS_NAME_ALIGN_RO_RW(fn, #fn ", RW+RO, unaligned", true, true, true), \
|
||||
TEST_CBFS_NAME_ALIGN_RO_RW(fn, #fn ", RO, aligned", false, true, false), \
|
||||
TEST_CBFS_NAME_ALIGN_RO_RW(fn, #fn ", RO, unaligned", true, true, false))
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test(test_cbfs_boot_device_init),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_map),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_invalid_compression_algo),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_io_error),
|
||||
TEST_CBFS_RO_FALLBACK(test_cbfs_successful_fallback_to_ro),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_load),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_map_with_mcache),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_boot_device_read_failure),
|
||||
TEST_CBFS_LOOKUP(test_cbfs_unverified_area_map),
|
||||
};
|
||||
|
||||
return lp_run_group_tests(tests, NULL, NULL);
|
||||
}
|
247
payloads/libpayload/tests/libcbfs/cbfs-verification-test.c
Normal file
247
payloads/libpayload/tests/libcbfs/cbfs-verification-test.c
Normal file
@@ -0,0 +1,247 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <cbfs.h>
|
||||
#include <cbfs_glue.h>
|
||||
#include <string.h>
|
||||
#include <mocks/cbfs_util.h>
|
||||
#include <tests/test.h>
|
||||
|
||||
#include "../libcbfs/cbfs.c"
|
||||
|
||||
/* Mocks */
|
||||
|
||||
unsigned long virtual_offset = 0;
|
||||
struct sysinfo_t lib_sysinfo;
|
||||
|
||||
size_t vb2_digest_size(enum vb2_hash_algorithm hash_alg)
|
||||
{
|
||||
if (hash_alg != VB2_HASH_SHA256) {
|
||||
fail_msg("Unsupported hash algorithm: %d\n", hash_alg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return VB2_SHA256_DIGEST_SIZE;
|
||||
}
|
||||
|
||||
vb2_error_t vb2_hash_verify(const void *buf, uint32_t size, const struct vb2_hash *hash)
|
||||
{
|
||||
check_expected_ptr(buf);
|
||||
check_expected(size);
|
||||
|
||||
assert_int_equal(hash->algo, VB2_HASH_SHA256);
|
||||
|
||||
if (!memcmp(hash->sha256, good_hash, sizeof(good_hash)))
|
||||
return VB2_SUCCESS;
|
||||
|
||||
if (!memcmp(hash->sha256, bad_hash, sizeof(bad_hash)))
|
||||
return VB2_ERROR_SHA_MISMATCH;
|
||||
|
||||
fail_msg("%s called with bad hash", __func__);
|
||||
return VB2_ERROR_SHA_MISMATCH;
|
||||
}
|
||||
|
||||
unsigned long ulzman(const unsigned char *src, unsigned long srcn, unsigned char *dst,
|
||||
unsigned long dstn)
|
||||
{
|
||||
fail_msg("Unexpected call to %s", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
|
||||
{
|
||||
fail_msg("Unexpected call to %s", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name,
|
||||
union cbfs_mdata *mdata_out, size_t *data_offset_out)
|
||||
{
|
||||
return CB_CBFS_CACHE_FULL;
|
||||
}
|
||||
|
||||
cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out,
|
||||
size_t *data_offset_out, struct vb2_hash *metadata_hash)
|
||||
{
|
||||
assert_non_null(dev);
|
||||
check_expected(name);
|
||||
|
||||
cb_err_t ret = mock_type(cb_err_t);
|
||||
if (ret != CB_SUCCESS)
|
||||
return ret;
|
||||
|
||||
memcpy(mdata_out, mock_ptr_type(const union cbfs_mdata *), sizeof(union cbfs_mdata));
|
||||
*data_offset_out = mock_type(size_t);
|
||||
return CB_SUCCESS;
|
||||
}
|
||||
|
||||
static void expect_cbfs_lookup(const char *name, cb_err_t err, const union cbfs_mdata *mdata,
|
||||
size_t data_offset_out)
|
||||
{
|
||||
expect_string(cbfs_lookup, name, name);
|
||||
will_return(cbfs_lookup, err);
|
||||
|
||||
if (err == CB_SUCCESS) {
|
||||
will_return(cbfs_lookup, mdata);
|
||||
will_return(cbfs_lookup, data_offset_out);
|
||||
}
|
||||
}
|
||||
|
||||
const void *cbfs_find_attr(const union cbfs_mdata *mdata, uint32_t attr_tag, size_t size_check)
|
||||
{
|
||||
return mock_ptr_type(void *);
|
||||
}
|
||||
|
||||
cb_err_t fmap_locate_area(const char *name, size_t *offset, size_t *size)
|
||||
{
|
||||
*offset = 0;
|
||||
*size = 0;
|
||||
return CB_SUCCESS;
|
||||
}
|
||||
|
||||
ssize_t boot_device_read(void *buf, size_t offset, size_t size)
|
||||
{
|
||||
/* Offset should be based on an address from lib_sysinfo.cbfs_offset */
|
||||
memcpy(buf, (void *)offset, size);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
const struct vb2_hash *cbfs_file_hash(const union cbfs_mdata *mdata)
|
||||
{
|
||||
return mock_ptr_type(const struct vb2_hash *);
|
||||
}
|
||||
|
||||
/* Utils */
|
||||
|
||||
static void clear_cbfs_boot_devices(void)
|
||||
{
|
||||
lib_sysinfo.cbfs_ro_mcache_offset = 0;
|
||||
lib_sysinfo.cbfs_ro_mcache_size = 0;
|
||||
lib_sysinfo.cbfs_offset = 0;
|
||||
lib_sysinfo.cbfs_size = 0;
|
||||
lib_sysinfo.cbfs_rw_mcache_offset = 0;
|
||||
lib_sysinfo.cbfs_rw_mcache_size = 0;
|
||||
memset((void *)cbfs_get_boot_device(true), 0, sizeof(struct cbfs_boot_device));
|
||||
memset((void *)cbfs_get_boot_device(false), 0, sizeof(struct cbfs_boot_device));
|
||||
}
|
||||
|
||||
void set_cbfs(uint64_t offset, size_t size)
|
||||
{
|
||||
clear_cbfs_boot_devices();
|
||||
lib_sysinfo.cbfs_offset = offset;
|
||||
lib_sysinfo.cbfs_size = size;
|
||||
}
|
||||
|
||||
/* Tests */
|
||||
|
||||
static int setup_test_cbfs(void **state)
|
||||
{
|
||||
clear_cbfs_boot_devices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_cbfs_map_no_hash(void **state)
|
||||
{
|
||||
void *mapping = NULL;
|
||||
size_t size = 0;
|
||||
|
||||
set_cbfs((uint64_t)&file_no_hash, sizeof(file_no_hash));
|
||||
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&file_no_hash,
|
||||
be32toh(file_no_hash.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
|
||||
if (CONFIG(LP_CBFS_VERIFICATION)) {
|
||||
/* File with no hash. No hash causes hash mismatch by default,
|
||||
so mapping will not be completed successfully. */
|
||||
will_return(cbfs_file_hash, NULL);
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, NULL);
|
||||
assert_null(mapping);
|
||||
} else {
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, &size);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_1_SIZE, size);
|
||||
assert_memory_equal(test_data_1, mapping, size);
|
||||
cbfs_unmap(mapping);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_cbfs_map_valid_hash(void **state)
|
||||
{
|
||||
void *mapping = NULL;
|
||||
size_t size = 0;
|
||||
struct vb2_hash hash = {
|
||||
.algo = VB2_HASH_SHA256,
|
||||
};
|
||||
memcpy(&hash.sha256, good_hash, VB2_SHA256_DIGEST_SIZE);
|
||||
|
||||
set_cbfs((uint64_t)&file_valid_hash, sizeof(file_valid_hash));
|
||||
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&file_valid_hash,
|
||||
be32toh(file_valid_hash.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
|
||||
|
||||
if (CONFIG(LP_CBFS_VERIFICATION)) {
|
||||
will_return(cbfs_file_hash, &hash);
|
||||
expect_memory(vb2_hash_verify, buf,
|
||||
&file_valid_hash.attrs_and_data[HASH_ATTR_SIZE], HASH_ATTR_SIZE);
|
||||
expect_value(vb2_hash_verify, size, TEST_DATA_1_SIZE);
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, &size);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_1_SIZE, size);
|
||||
assert_memory_equal(mapping, &file_valid_hash.attrs_and_data[HASH_ATTR_SIZE],
|
||||
size);
|
||||
} else {
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, &size);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_1_SIZE, size);
|
||||
assert_memory_equal(test_data_1, mapping, size);
|
||||
cbfs_unmap(mapping);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_cbfs_map_invalid_hash(void **state)
|
||||
{
|
||||
void *mapping = NULL;
|
||||
size_t size = 0;
|
||||
struct vb2_hash hash = {
|
||||
.algo = VB2_HASH_SHA256,
|
||||
};
|
||||
memcpy(&hash.sha256, bad_hash, VB2_SHA256_DIGEST_SIZE);
|
||||
|
||||
set_cbfs((uint64_t)&file_broken_hash, sizeof(file_broken_hash));
|
||||
|
||||
expect_cbfs_lookup(TEST_DATA_1_FILENAME, CB_SUCCESS,
|
||||
(const union cbfs_mdata *)&file_broken_hash,
|
||||
be32toh(file_broken_hash.header.offset));
|
||||
will_return(cbfs_find_attr, NULL);
|
||||
|
||||
if (CONFIG(LP_CBFS_VERIFICATION)) {
|
||||
will_return(cbfs_file_hash, &hash);
|
||||
expect_memory(vb2_hash_verify, buf,
|
||||
&file_broken_hash.attrs_and_data[HASH_ATTR_SIZE], HASH_ATTR_SIZE);
|
||||
expect_value(vb2_hash_verify, size, TEST_DATA_1_SIZE);
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, NULL);
|
||||
assert_null(mapping);
|
||||
} else {
|
||||
mapping = cbfs_map(TEST_DATA_1_FILENAME, &size);
|
||||
assert_non_null(mapping);
|
||||
assert_int_equal(TEST_DATA_1_SIZE, size);
|
||||
assert_memory_equal(test_data_1, mapping, size);
|
||||
cbfs_unmap(mapping);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test_setup(test_cbfs_map_no_hash, setup_test_cbfs),
|
||||
cmocka_unit_test_setup(test_cbfs_map_valid_hash, setup_test_cbfs),
|
||||
cmocka_unit_test_setup(test_cbfs_map_invalid_hash, setup_test_cbfs),
|
||||
};
|
||||
|
||||
return lp_run_group_tests(tests, NULL, NULL);
|
||||
}
|
95
payloads/libpayload/tests/mocks/cbfs_file_mock.c
Normal file
95
payloads/libpayload/tests/mocks/cbfs_file_mock.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <mocks/cbfs_util.h>
|
||||
|
||||
|
||||
const u8 test_data_1[TEST_DATA_1_SIZE] = { TEST_DATA_1 };
|
||||
const u8 test_data_2[TEST_DATA_2_SIZE] = { TEST_DATA_2 };
|
||||
const u8 test_data_int_1[TEST_DATA_INT_1_SIZE] = { LE64(TEST_DATA_INT_1) };
|
||||
const u8 test_data_int_2[TEST_DATA_INT_2_SIZE] = { LE64(TEST_DATA_INT_2) };
|
||||
const u8 test_data_int_3[TEST_DATA_INT_3_SIZE] = { LE64(TEST_DATA_INT_3) };
|
||||
|
||||
const u8 good_hash[VB2_SHA256_DIGEST_SIZE] = { TEST_SHA256 };
|
||||
const u8 bad_hash[VB2_SHA256_DIGEST_SIZE] = { INVALID_SHA256 };
|
||||
|
||||
const struct cbfs_test_file file_no_hash = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, 0, TEST_DATA_1_SIZE),
|
||||
.filename = TEST_DATA_1_FILENAME,
|
||||
.attrs_and_data = {
|
||||
TEST_DATA_1,
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file file_valid_hash = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, HASH_ATTR_SIZE, TEST_DATA_1_SIZE),
|
||||
.filename = TEST_DATA_1_FILENAME,
|
||||
.attrs_and_data = {
|
||||
BE32(CBFS_FILE_ATTR_TAG_HASH),
|
||||
BE32(HASH_ATTR_SIZE),
|
||||
BE32(VB2_HASH_SHA256),
|
||||
TEST_SHA256,
|
||||
TEST_DATA_1,
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file file_broken_hash = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, HASH_ATTR_SIZE, TEST_DATA_1_SIZE),
|
||||
.filename = TEST_DATA_1_FILENAME,
|
||||
.attrs_and_data = {
|
||||
BE32(CBFS_FILE_ATTR_TAG_HASH),
|
||||
BE32(HASH_ATTR_SIZE),
|
||||
BE32(VB2_HASH_SHA256),
|
||||
INVALID_SHA256,
|
||||
TEST_DATA_1,
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file test_file_1 = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, 0, TEST_DATA_1_SIZE),
|
||||
.filename = TEST_DATA_1_FILENAME,
|
||||
.attrs_and_data = {
|
||||
TEST_DATA_1,
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file test_file_2 = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, sizeof(struct cbfs_file_attr_compression),
|
||||
TEST_DATA_2_SIZE),
|
||||
.filename = TEST_DATA_2_FILENAME,
|
||||
.attrs_and_data = {
|
||||
BE32(CBFS_FILE_ATTR_TAG_COMPRESSION),
|
||||
BE32(sizeof(struct cbfs_file_attr_compression)),
|
||||
BE32(CBFS_COMPRESS_LZMA),
|
||||
BE32(TEST_DATA_2_SIZE),
|
||||
TEST_DATA_2,
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file test_file_int_1 = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, 0, TEST_DATA_INT_1_SIZE),
|
||||
.filename = TEST_DATA_INT_1_FILENAME,
|
||||
.attrs_and_data = {
|
||||
LE64(TEST_DATA_INT_1),
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file test_file_int_2 = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, 0, TEST_DATA_INT_2_SIZE),
|
||||
.filename = TEST_DATA_INT_2_FILENAME,
|
||||
.attrs_and_data = {
|
||||
LE64(TEST_DATA_INT_2),
|
||||
},
|
||||
};
|
||||
|
||||
const struct cbfs_test_file test_file_int_3 = {
|
||||
.header = HEADER_INITIALIZER(CBFS_TYPE_RAW, sizeof(struct cbfs_file_attr_compression),
|
||||
TEST_DATA_INT_3_SIZE),
|
||||
.filename = TEST_DATA_INT_3_FILENAME,
|
||||
.attrs_and_data = {
|
||||
BE32(CBFS_FILE_ATTR_TAG_COMPRESSION),
|
||||
BE32(sizeof(struct cbfs_file_attr_compression)),
|
||||
BE32(CBFS_COMPRESS_LZ4),
|
||||
BE32(TEST_DATA_INT_3_SIZE),
|
||||
LE64(TEST_DATA_INT_3),
|
||||
},
|
||||
};
|
16
payloads/libpayload/tests/mocks/die.c
Normal file
16
payloads/libpayload/tests/mocks/die.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <tests/test.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void die_work(const char *file, const char *func, int line, const char *fmt, ...)
|
||||
{
|
||||
/* Failing asserts are jumping to the user code (test) if expect_assert_failed() was
|
||||
previously called. Otherwise it jumps to the cmocka code and fails the test. */
|
||||
mock_assert(false, "Mock assetion called", file, line);
|
||||
|
||||
/* Should never be reached */
|
||||
print_error("%s() called...\n", __func__);
|
||||
while (1)
|
||||
;
|
||||
}
|
25
payloads/libpayload/vboot/Kconfig
Normal file
25
payloads/libpayload/vboot/Kconfig
Normal file
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
config VBOOT_LIB
|
||||
bool "Compile verified boot (vboot) library"
|
||||
default n
|
||||
help
|
||||
This option enables compiling and building vboot libraries vboot_fw and tlcl.
|
||||
|
||||
if VBOOT_LIB
|
||||
|
||||
config VBOOT_TPM2_MODE
|
||||
bool "TPM2 Mode"
|
||||
default y
|
||||
help
|
||||
This option enables TPM 2.0 support in vboot. Disabling it allows using TPM 1.2.
|
||||
|
||||
config VBOOT_X86_SHA_EXT
|
||||
bool "x86 SHA Extension"
|
||||
default n
|
||||
depends on ARCH_X86
|
||||
help
|
||||
This option enables SHA256 implementation using x86 SHA processor extension
|
||||
instructions: sha256msg1, sha256msg2, sha256rnds2.
|
||||
|
||||
endif
|
46
payloads/libpayload/vboot/Makefile.inc
Normal file
46
payloads/libpayload/vboot/Makefile.inc
Normal file
@@ -0,0 +1,46 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
VBOOT_BUILD_DIR ?= $(abspath $(obj)/external/vboot)
|
||||
VBOOT_FW_LIB = $(VBOOT_BUILD_DIR)/vboot_fw.a
|
||||
TLCL_LIB = $(VBOOT_BUILD_DIR)/tlcl.a
|
||||
|
||||
vboot_fw-objs += $(VBOOT_FW_LIB)
|
||||
tlcl-objs += $(TLCL_LIB)
|
||||
|
||||
kconfig-to-binary=$(if $(1),1,0)
|
||||
vboot-fixup-includes = $(patsubst -I%,-I$(top)/%,\
|
||||
$(patsubst include/%.h,$(top)/include/%.h,\
|
||||
$(filter-out -I$(obj),$(1))))
|
||||
|
||||
ifeq ($(CONFIG_LP_ARCH_MOCK),)
|
||||
VBOOT_CFLAGS += $(call vboot-fixup-includes,$(CFLAGS))
|
||||
VBOOT_CFLAGS += -I$(abspath $(obj))
|
||||
endif
|
||||
|
||||
# Enable vboot debug by default
|
||||
VBOOT_CFLAGS += -DVBOOT_DEBUG
|
||||
|
||||
VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM) := arm
|
||||
VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_X86) := x86
|
||||
VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64
|
||||
|
||||
ifeq ($(CONFIG_LP_ARCH_MOCK)$(VBOOT_FIRMWARE_ARCH-y),)
|
||||
$(error vboot requires architecture to be set in the configuration)
|
||||
endif
|
||||
|
||||
$(VBOOT_FW_LIB): $(obj)/libpayload-config.h
|
||||
@printf " MAKE $(subst $(obj)/,,$(@))\n"
|
||||
+$(Q) FIRMWARE_ARCH=$(VBOOT_FIRMWARE_ARCH-y) \
|
||||
CC=$(CC) \
|
||||
CFLAGS="$(VBOOT_CFLAGS)" \
|
||||
$(MAKE) -C "$(VBOOT_SOURCE)" \
|
||||
TPM2_MODE=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_TPM2_MODE)) \
|
||||
X86_SHA_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_SHA_EXT)) \
|
||||
UNROLL_LOOPS=1 \
|
||||
BUILD=$(VBOOT_BUILD_DIR) \
|
||||
V=$(V) \
|
||||
$(VBOOT_BUILD_DIR)/vboot_fw.a tlcl
|
||||
|
||||
$(TLCL_LIB): $(VBOOT_FW_LIB)
|
||||
|
||||
.PHONY: $(VBOOT_FW_LIB) $(TLCL_LIB)
|
@@ -29,6 +29,26 @@
|
||||
"ranksPerChannel": 2,
|
||||
"speedMbps": 6400
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "K3LKBKB0BM-MGCP",
|
||||
"attribs": {
|
||||
"densityPerDieGb": 16,
|
||||
"diesPerPackage": 2,
|
||||
"bitWidthPerChannel": 16,
|
||||
"ranksPerChannel": 1,
|
||||
"speedMbps": 6400
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "H9JCNNNBK3MLYR-N6E",
|
||||
"attribs": {
|
||||
"densityPerDieGb": 8,
|
||||
"diesPerPackage": 2,
|
||||
"bitWidthPerChannel": 16,
|
||||
"ranksPerChannel": 1,
|
||||
"speedMbps": 6400
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -2,3 +2,4 @@
|
||||
# util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5
|
||||
|
||||
ADL,set-0
|
||||
SBR,set-1
|
||||
|
@@ -4,3 +4,5 @@
|
||||
MT62F512M32D2DR-031 WT:B,spd-1.hex
|
||||
MT62F1G32D4DR-031 WT:B,spd-2.hex
|
||||
H9JCNNNCP3MLYR-N6E,spd-2.hex
|
||||
K3LKBKB0BM-MGCP,spd-3.hex
|
||||
H9JCNNNBK3MLYR-N6E,spd-1.hex
|
||||
|
32
spd/lp5/set-0/spd-3.hex
Normal file
32
spd/lp5/set-0/spd-3.hex
Normal file
@@ -0,0 +1,32 @@
|
||||
23 10 13 0E 16 22 95 08 00 00 00 00 02 01 00 00
|
||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 C0 08 60
|
||||
04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20
|
||||
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
8
spd/lp5/set-1/parts_spd_manifest.generated.txt
Normal file
8
spd/lp5/set-1/parts_spd_manifest.generated.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
# Generated by:
|
||||
# util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5
|
||||
|
||||
MT62F512M32D2DR-031 WT:B,spd-1.hex
|
||||
MT62F1G32D4DR-031 WT:B,spd-2.hex
|
||||
H9JCNNNCP3MLYR-N6E,spd-2.hex
|
||||
K3LKBKB0BM-MGCP,spd-3.hex
|
||||
H9JCNNNBK3MLYR-N6E,spd-1.hex
|
32
spd/lp5/set-1/spd-1.hex
Normal file
32
spd/lp5/set-1/spd-1.hex
Normal file
@@ -0,0 +1,32 @@
|
||||
23 11 13 0E 85 19 95 18 00 40 00 00 02 02 00 00
|
||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
|
||||
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20
|
||||
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
32
spd/lp5/set-1/spd-2.hex
Normal file
32
spd/lp5/set-1/spd-2.hex
Normal file
@@ -0,0 +1,32 @@
|
||||
23 11 13 0E 85 19 B5 18 00 40 00 00 0A 02 00 00
|
||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
|
||||
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20
|
||||
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
32
spd/lp5/set-1/spd-3.hex
Normal file
32
spd/lp5/set-1/spd-3.hex
Normal file
@@ -0,0 +1,32 @@
|
||||
23 11 13 0E 86 21 95 18 00 40 00 00 02 02 00 00
|
||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 C0 08 60
|
||||
04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20
|
||||
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
32
spd/lp5/set-1/spd-empty.hex
Normal file
32
spd/lp5/set-1/spd-empty.hex
Normal file
@@ -0,0 +1,32 @@
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
@@ -1577,6 +1577,17 @@ unsigned long __weak fw_cfg_acpi_tables(unsigned long start)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void preload_acpi_dsdt(void)
|
||||
{
|
||||
const char *file = CONFIG_CBFS_PREFIX "/dsdt.aml";
|
||||
|
||||
if (!CONFIG(CBFS_PRELOAD))
|
||||
return;
|
||||
|
||||
printk(BIOS_DEBUG, "Preloading %s\n", file);
|
||||
cbfs_preload(file);
|
||||
}
|
||||
|
||||
unsigned long write_acpi_tables(unsigned long start)
|
||||
{
|
||||
unsigned long current;
|
||||
|
@@ -10,8 +10,6 @@
|
||||
|
||||
#define ACPIGEN_MAXLEN 0xfffff
|
||||
|
||||
#define CPPC_PACKAGE_NAME "GCPC"
|
||||
|
||||
#include <lib.h>
|
||||
#include <string.h>
|
||||
#include <acpi/acpigen.h>
|
||||
@@ -1785,7 +1783,7 @@ void acpigen_write_CPPC_package(const struct cppc_config *config)
|
||||
max = CPPC_MAX_FIELDS_VER_3;
|
||||
break;
|
||||
default:
|
||||
printk(BIOS_ERR, "ERROR: CPPC version %u is not implemented\n",
|
||||
printk(BIOS_ERR, "CPPC version %u is not implemented\n",
|
||||
config->version);
|
||||
return;
|
||||
}
|
||||
|
@@ -70,6 +70,8 @@ static const char *namestring_of(enum dptf_participant participant)
|
||||
return "TSR2";
|
||||
case DPTF_TEMP_SENSOR_3:
|
||||
return "TSR3";
|
||||
case DPTF_TEMP_SENSOR_4:
|
||||
return "TSR4";
|
||||
case DPTF_TPCH:
|
||||
return "TPCH";
|
||||
default:
|
||||
|
@@ -11,7 +11,3 @@
|
||||
External (GNVS, OpRegionObj)
|
||||
External (DNVS, OpRegionObj)
|
||||
#endif
|
||||
|
||||
#if CONFIG(CHROMEOS_NVS)
|
||||
External (CNVS, OpRegionObj)
|
||||
#endif
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_ps2_keybd.h>
|
||||
#include <console/console.h>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acpi_device.h>
|
||||
#include <acpi/acpi_pld.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_usb.h>
|
||||
|
||||
@@ -132,5 +132,8 @@ void acpigen_write_typec_connector(const struct typec_connector_class_config *co
|
||||
add_custom_dsd_property(dsd, port_number);
|
||||
acpi_dp_write(dsd);
|
||||
|
||||
/* Add PLD */
|
||||
acpigen_write_pld(config->pld);
|
||||
|
||||
acpigen_pop_len(); /* Device */
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
#if CONFIG(CHROMEOS_NVS)
|
||||
/* Chrome OS specific */
|
||||
#include <vendorcode/google/chromeos/acpi/gnvs.asl>
|
||||
#include <vendorcode/google/chromeos/acpi/chromeos.asl>
|
||||
#endif
|
||||
|
||||
|
@@ -5,7 +5,6 @@
|
||||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <soc/nvs.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <types.h>
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpi_sata.h>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user