UpdateDsdt.c 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. /** @file
  2. Acpi Gnvs Init Library.
  3. Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #include <Uefi.h>
  7. #include <Library/IoLib.h>
  8. #include <Library/PciLib.h>
  9. #include <Library/DebugLib.h>
  10. #include <Library/BaseMemoryLib.h>
  11. #include <Library/UefiBootServicesTableLib.h>
  12. #include <Protocol/GlobalNvsArea.h>
  13. extern GLOBAL_REMOVE_IF_UNREFERENCED EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
  14. VOID
  15. UpdateDsdt (
  16. IN VOID *Table
  17. )
  18. {
  19. UINT8 *CurrPtr;
  20. UINT8 *TmpDsdtPointer;
  21. UINT8 *DsdtPointer;
  22. UINT32 *Signature;
  23. UINT8 *Operation;
  24. UINT32 *Address;
  25. UINT8 *Value;
  26. UINT16 *Size;
  27. BOOLEAN EnterDock = FALSE;
  28. UINT8 MaximumDsdtPointLength;
  29. MaximumDsdtPointLength = 20;
  30. //
  31. // Fix up the AML code in the DSDT affected by end user options.
  32. // Fix up the following ASL Code:
  33. // (1) ACPI Global NVS Memory Base and Size.
  34. // (2) ACPI Graphics NVS Memory Base and Size.
  35. // (3) SMBus I/O Base.
  36. // (4) Thermal Management Methods.
  37. //
  38. //
  39. // Loop through the ASL looking for values that we must fix up.
  40. //
  41. CurrPtr = (UINT8 *) Table;
  42. for (DsdtPointer = CurrPtr;
  43. DsdtPointer <= (CurrPtr + ((EFI_ACPI_COMMON_HEADER *) CurrPtr)->Length);
  44. DsdtPointer++
  45. ) {
  46. Signature = (UINT32 *) DsdtPointer;
  47. switch (*Signature) {
  48. //
  49. // GNVS operation region
  50. //
  51. case (SIGNATURE_32 ('G', 'N', 'V', 'S')):
  52. //
  53. // Conditional match. For Region Objects, the Operator will always be the
  54. // byte immediately before the specific name. Therefore, subtract 1 to check
  55. // the Operator.
  56. //
  57. Operation = DsdtPointer - 1;
  58. if (*Operation == AML_EXT_REGION_OP) {
  59. Address = (UINT32 *) (DsdtPointer + 6);
  60. *Address = (UINT32) (UINTN) mGlobalNvsArea.Area;
  61. Size = (UINT16 *) (DsdtPointer + 11);
  62. *Size = sizeof (EFI_GLOBAL_NVS_AREA);
  63. }
  64. break;
  65. //
  66. // _AC0 method
  67. //
  68. case (SIGNATURE_32 ('_', 'A', 'C', '0')):
  69. //
  70. // Conditional match. _AC0 is >63 and <4095 bytes, so the package length is 2 bytes.
  71. // Therefore, subtract 3 to check the Operator.
  72. //
  73. Operation = DsdtPointer - 3;
  74. if (*Operation == AML_METHOD_OP) {
  75. //
  76. // Check if we want _AC0 enabled
  77. //
  78. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  79. Signature = (UINT32 *) DsdtPointer;
  80. *Signature = SIGNATURE_32 ('X', 'A', 'C', '0');
  81. }
  82. }
  83. break;
  84. //
  85. // _AL0 method
  86. //
  87. case (SIGNATURE_32 ('_', 'A', 'L', '0')):
  88. //
  89. // Conditional match. For Name Objects, the Operator will always be the byte
  90. // immediately before the specific name. Therefore, subtract 1 to check the
  91. // Operator.
  92. //
  93. Operation = DsdtPointer - 1;
  94. if (*Operation == AML_NAME_OP) {
  95. //
  96. // Check if we want _AL0 enabled
  97. //
  98. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  99. Signature = (UINT32 *) DsdtPointer;
  100. *Signature = SIGNATURE_32 ('X', 'A', 'L', '0');
  101. }
  102. }
  103. break;
  104. //
  105. // _AC1 method
  106. //
  107. case (SIGNATURE_32 ('_', 'A', 'C', '1')):
  108. //
  109. // Conditional match. _AC1 is < 63 bytes, so the package length is 1 byte.
  110. // Therefore, subtract 2 to check the Operator.
  111. //
  112. Operation = DsdtPointer - 2;
  113. if (*Operation == AML_METHOD_OP) {
  114. //
  115. // Check if we want _AC1 enabled
  116. //
  117. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  118. Signature = (UINT32 *) DsdtPointer;
  119. *Signature = SIGNATURE_32 ('X', 'A', 'C', '1');
  120. }
  121. }
  122. break;
  123. //
  124. // _AL1 method
  125. //
  126. case (SIGNATURE_32 ('_', 'A', 'L', '1')):
  127. //
  128. // Conditional match. For Name Objects, the Operator will always be the byte
  129. // immediately before the specific name. Therefore, subtract 1 to check the
  130. // Operator.
  131. //
  132. Operation = DsdtPointer - 1;
  133. if (*Operation == AML_NAME_OP) {
  134. //
  135. // Check if we want _AL1 enabled
  136. //
  137. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  138. Signature = (UINT32 *) DsdtPointer;
  139. *Signature = SIGNATURE_32 ('X', 'A', 'L', '1');
  140. }
  141. }
  142. break;
  143. //
  144. // _AC2 method
  145. //
  146. case (SIGNATURE_32 ('_', 'A', 'C', '2')):
  147. //
  148. // Conditional match. _AC2 is < 63 bytes, so the package length is 1 byte.
  149. // Therefore, subtract 2 to check the Operator.
  150. //
  151. Operation = DsdtPointer - 2;
  152. if (*Operation == AML_METHOD_OP) {
  153. //
  154. // Check if we want _AC2 enabled
  155. //
  156. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  157. Signature = (UINT32 *) DsdtPointer;
  158. *Signature = SIGNATURE_32 ('X', 'A', 'C', '2');
  159. }
  160. }
  161. break;
  162. //
  163. // _AL2 method
  164. //
  165. case (SIGNATURE_32 ('_', 'A', 'L', '2')):
  166. //
  167. // Conditional match. For Name Objects, the Operator will always be the byte
  168. // immediately before the specific name. Therefore, subtract 1 to check the
  169. // Operator.
  170. //
  171. Operation = DsdtPointer - 1;
  172. if (*Operation == AML_NAME_OP) {
  173. //
  174. // Check if we want _AL2 enabled
  175. //
  176. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  177. Signature = (UINT32 *) DsdtPointer;
  178. *Signature = SIGNATURE_32 ('X', 'A', 'L', '2');
  179. }
  180. }
  181. break;
  182. //
  183. // _AC3 method
  184. //
  185. case (SIGNATURE_32 ('_', 'A', 'C', '3')):
  186. //
  187. // Conditional match. _AC3 is < 63 bytes, so the package length is 1 byte.
  188. // Therefore, subtract 2 to check the Operator.
  189. //
  190. Operation = DsdtPointer - 2;
  191. if (*Operation == AML_METHOD_OP) {
  192. //
  193. // Check if we want _AC3 enabled
  194. //
  195. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  196. Signature = (UINT32 *) DsdtPointer;
  197. *Signature = SIGNATURE_32 ('X', 'A', 'C', '3');
  198. }
  199. }
  200. break;
  201. //
  202. // _AL3 method
  203. //
  204. case (SIGNATURE_32 ('_', 'A', 'L', '3')):
  205. //
  206. // Conditional match. For Name Objects, the Operator will always be the byte
  207. // immediately before the specific name. Therefore, subtract 1 to check the
  208. // Operator.
  209. //
  210. Operation = DsdtPointer - 1;
  211. if (*Operation == AML_NAME_OP) {
  212. //
  213. // Check if we want _AL3 enabled
  214. //
  215. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  216. Signature = (UINT32 *) DsdtPointer;
  217. *Signature = SIGNATURE_32 ('X', 'A', 'L', '3');
  218. }
  219. }
  220. break;
  221. //
  222. // _AC4 method
  223. //
  224. case (SIGNATURE_32 ('_', 'A', 'C', '4')):
  225. //
  226. // Conditional match. _AC4 is < 63 bytes, so the package length is 1 byte.
  227. // Therefore, subtract 2 to check the Operator.
  228. //
  229. Operation = DsdtPointer - 2;
  230. if (*Operation == AML_METHOD_OP) {
  231. //
  232. // Check if we want _AC4 enabled
  233. //
  234. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  235. Signature = (UINT32 *) DsdtPointer;
  236. *Signature = SIGNATURE_32 ('X', 'A', 'C', '4');
  237. }
  238. }
  239. break;
  240. //
  241. // _AL4 method
  242. //
  243. case (SIGNATURE_32 ('_', 'A', 'L', '4')):
  244. //
  245. // Conditional match. For Name Objects, the Operator will always be the byte
  246. // immediately before the specific name. Therefore, subtract 1 to check the
  247. // Operator.
  248. //
  249. Operation = DsdtPointer - 1;
  250. if (*Operation == AML_NAME_OP) {
  251. //
  252. // Check if we want _AL4 enabled
  253. //
  254. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  255. Signature = (UINT32 *) DsdtPointer;
  256. *Signature = SIGNATURE_32 ('X', 'A', 'L', '4');
  257. }
  258. }
  259. break;
  260. //
  261. // _AC5 method
  262. //
  263. case (SIGNATURE_32 ('_', 'A', 'C', '5')):
  264. //
  265. // Conditional match. _AC5 is < 63 bytes, so the package length is 1 byte.
  266. // Therefore, subtract 2 to check the Operator.
  267. //
  268. Operation = DsdtPointer - 2;
  269. if (*Operation == AML_METHOD_OP) {
  270. //
  271. // Check if we want _AC5 enabled
  272. //
  273. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  274. Signature = (UINT32 *) DsdtPointer;
  275. *Signature = SIGNATURE_32 ('X', 'A', 'C', '5');
  276. }
  277. }
  278. break;
  279. //
  280. // _AL5 method
  281. //
  282. case (SIGNATURE_32 ('_', 'A', 'L', '5')):
  283. //
  284. // Conditional match. For Name Objects, the Operator will always be the byte
  285. // immediately before the specific name. Therefore, subtract 1 to check the
  286. // Operator.
  287. //
  288. Operation = DsdtPointer - 1;
  289. if (*Operation == AML_NAME_OP) {
  290. //
  291. // Check if we want _AL5 enabled
  292. //
  293. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  294. Signature = (UINT32 *) DsdtPointer;
  295. *Signature = SIGNATURE_32 ('X', 'A', 'L', '5');
  296. }
  297. }
  298. break;
  299. //
  300. // _AC6 method
  301. //
  302. case (SIGNATURE_32 ('_', 'A', 'C', '6')):
  303. //
  304. // Conditional match. _AC6 is < 63 bytes, so the package length is 1 byte.
  305. // Therefore, subtract 2 to check the Operator.
  306. //
  307. Operation = DsdtPointer - 2;
  308. if (*Operation == AML_METHOD_OP) {
  309. //
  310. // Check if we want _AC6 enabled
  311. //
  312. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  313. Signature = (UINT32 *) DsdtPointer;
  314. *Signature = SIGNATURE_32 ('X', 'A', 'C', '6');
  315. }
  316. }
  317. break;
  318. //
  319. // _AL6 method
  320. //
  321. case (SIGNATURE_32 ('_', 'A', 'L', '6')):
  322. //
  323. // Conditional match. For Name Objects, the Operator will always be the byte
  324. // immediately before the specific name. Therefore, subtract 1 to check the
  325. // Operator.
  326. //
  327. Operation = DsdtPointer - 1;
  328. if (*Operation == AML_NAME_OP) {
  329. //
  330. // Check if we want _AL6 enabled
  331. //
  332. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  333. Signature = (UINT32 *) DsdtPointer;
  334. *Signature = SIGNATURE_32 ('X', 'A', 'L', '6');
  335. }
  336. }
  337. break;
  338. //
  339. // _AC7 method
  340. //
  341. case (SIGNATURE_32 ('_', 'A', 'C', '7')):
  342. //
  343. // Conditional match. _AC7 is < 63 bytes, so the package length is 1 byte.
  344. // Therefore, subtract 2 to check the Operator.
  345. //
  346. Operation = DsdtPointer - 2;
  347. if (*Operation == AML_METHOD_OP) {
  348. //
  349. // Check if we want _AC7 enabled
  350. //
  351. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  352. Signature = (UINT32 *) DsdtPointer;
  353. *Signature = SIGNATURE_32 ('X', 'A', 'C', '7');
  354. }
  355. }
  356. break;
  357. //
  358. // _AL7 method
  359. //
  360. case (SIGNATURE_32 ('_', 'A', 'L', '7')):
  361. //
  362. // Conditional match. For Name Objects, the Operator will always be the byte
  363. // immediately before the specific name. Therefore, subtract 1 to check the
  364. // Operator.
  365. //
  366. Operation = DsdtPointer - 1;
  367. if (*Operation == AML_NAME_OP) {
  368. //
  369. // Check if we want _AL7 enabled
  370. //
  371. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  372. Signature = (UINT32 *) DsdtPointer;
  373. *Signature = SIGNATURE_32 ('X', 'A', 'L', '7');
  374. }
  375. }
  376. break;
  377. //
  378. // _AC8 method
  379. //
  380. case (SIGNATURE_32 ('_', 'A', 'C', '8')):
  381. //
  382. // Conditional match. _AC8 is < 63 bytes, so the package length is 1 byte.
  383. // Therefore, subtract 2 to check the Operator.
  384. //
  385. Operation = DsdtPointer - 2;
  386. if (*Operation == AML_METHOD_OP) {
  387. //
  388. // Check if we want _AC8 enabled
  389. //
  390. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  391. Signature = (UINT32 *) DsdtPointer;
  392. *Signature = SIGNATURE_32 ('X', 'A', 'C', '8');
  393. }
  394. }
  395. break;
  396. //
  397. // _AL8 method
  398. //
  399. case (SIGNATURE_32 ('_', 'A', 'L', '8')):
  400. //
  401. // Conditional match. For Name Objects, the Operator will always be the byte
  402. // immediately before the specific name. Therefore, subtract 1 to check the
  403. // Operator.
  404. //
  405. Operation = DsdtPointer - 1;
  406. if (*Operation == AML_NAME_OP) {
  407. //
  408. // Check if we want _AL8 enabled
  409. //
  410. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  411. Signature = (UINT32 *) DsdtPointer;
  412. *Signature = SIGNATURE_32 ('X', 'A', 'L', '8');
  413. }
  414. }
  415. break;
  416. //
  417. // _AC9 method
  418. //
  419. case (SIGNATURE_32 ('_', 'A', 'C', '9')):
  420. //
  421. // Conditional match. _AC9 is < 63 bytes, so the package length is 1 byte.
  422. // Therefore, subtract 2 to check the Operator.
  423. //
  424. Operation = DsdtPointer - 2;
  425. if (*Operation == AML_METHOD_OP) {
  426. //
  427. // Check if we want _AC9 enabled
  428. //
  429. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  430. Signature = (UINT32 *) DsdtPointer;
  431. *Signature = SIGNATURE_32 ('X', 'A', 'C', '9');
  432. }
  433. }
  434. break;
  435. //
  436. // _AL9 method
  437. //
  438. case (SIGNATURE_32 ('_', 'A', 'L', '9')):
  439. //
  440. // Conditional match. For Name Objects, the Operator will always be the byte
  441. // immediately before the specific name. Therefore, subtract 1 to check the
  442. // Operator.
  443. //
  444. Operation = DsdtPointer - 1;
  445. if (*Operation == AML_NAME_OP) {
  446. //
  447. // Check if we want _AL9 enabled
  448. //
  449. if (PcdGet8 (PcdDisableActiveTripPoints) == 0) {
  450. Signature = (UINT32 *) DsdtPointer;
  451. *Signature = SIGNATURE_32 ('X', 'A', 'L', '9');
  452. }
  453. }
  454. break;
  455. //
  456. // _PSL method
  457. //
  458. case (SIGNATURE_32 ('_', 'P', 'S', 'L')):
  459. //
  460. // Conditional match. _PSL is < 256 bytes, so the package length is 1 byte.
  461. // Therefore, subtract 2 to check the Operator.
  462. //
  463. Operation = DsdtPointer - 3;
  464. if (*Operation == AML_METHOD_OP) {
  465. //
  466. // Check if we want _PSL enabled
  467. //
  468. if (PcdGet8 (PcdDisablePassiveTripPoints) == 0) {
  469. Signature = (UINT32 *) DsdtPointer;
  470. *Signature = SIGNATURE_32 ('X', 'P', 'S', 'L');
  471. }
  472. }
  473. break;
  474. //
  475. // _PSV method
  476. //
  477. case (SIGNATURE_32 ('_', 'P', 'S', 'V')):
  478. //
  479. // Conditional match. _PSV is < 256 bytes, so the package length is 1 byte.
  480. // Therefore, subtract 2 to check the Operator.
  481. //
  482. Operation = DsdtPointer - 3;
  483. if (*Operation == AML_METHOD_OP) {
  484. //
  485. // Check if we want _PSV enabled
  486. //
  487. if (PcdGet8 (PcdDisablePassiveTripPoints) == 0) {
  488. Signature = (UINT32 *) DsdtPointer;
  489. *Signature = SIGNATURE_32 ('X', 'P', 'S', 'V');
  490. }
  491. }
  492. break;
  493. //
  494. // _CRT method
  495. //
  496. case (SIGNATURE_32 ('_', 'C', 'R', 'T')):
  497. //
  498. // Conditional match. _CRT is < 256 bytes, so the package length is 1 byte.
  499. // Subtract 3 to check the Operator for CRB, subract 2 for Harris Beach.
  500. //
  501. Operation = DsdtPointer - 3;
  502. if (*Operation == AML_METHOD_OP) {
  503. //
  504. // Check if we want _CRT enabled
  505. //
  506. if (PcdGet8 (PcdDisableCriticalTripPoints) == 0) {
  507. Signature = (UINT32 *) DsdtPointer;
  508. *Signature = SIGNATURE_32 ('X', 'C', 'R', 'T');
  509. }
  510. }
  511. break;
  512. //
  513. // _TC1 method
  514. //
  515. case (SIGNATURE_32 ('_', 'T', 'C', '1')):
  516. //
  517. // Conditional match. _TC1 is < 256 bytes, so the package length is 1 byte.
  518. // Therefore, subtract 2 to check the Operator.
  519. //
  520. Operation = DsdtPointer - 2;
  521. if (*Operation == AML_METHOD_OP) {
  522. //
  523. // Check if we want _TC1 enabled
  524. //
  525. if (PcdGet8 (PcdDisablePassiveTripPoints) == 0) {
  526. Signature = (UINT32 *) DsdtPointer;
  527. *Signature = SIGNATURE_32 ('X', 'T', 'C', '1');
  528. }
  529. }
  530. break;
  531. //
  532. // _TC2 method
  533. //
  534. case (SIGNATURE_32 ('_', 'T', 'C', '2')):
  535. //
  536. // Conditional match. _TC2 is < 256 bytes, so the package length is 1 byte.
  537. // Therefore, subtract 2 to check the Operator.
  538. //
  539. Operation = DsdtPointer - 2;
  540. if (*Operation == AML_METHOD_OP) {
  541. //
  542. // Check if we want _TC2 enabled
  543. //
  544. if (PcdGet8 (PcdDisablePassiveTripPoints) == 0) {
  545. Signature = (UINT32 *) DsdtPointer;
  546. *Signature = SIGNATURE_32 ('X', 'T', 'C', '2');
  547. }
  548. }
  549. break;
  550. //
  551. // _TSP method
  552. //
  553. case (SIGNATURE_32 ('_', 'T', 'S', 'P')):
  554. //
  555. // Conditional match. _TSP is < 256 bytes, so the package length is 1 byte.
  556. // Therefore, subtract 2 to check the Operator.
  557. //
  558. Operation = DsdtPointer - 2;
  559. if (*Operation == AML_METHOD_OP) {
  560. //
  561. // Check if we want _TSP enabled
  562. //
  563. if (PcdGet8 (PcdDisablePassiveTripPoints) == 0) {
  564. Signature = (UINT32 *) DsdtPointer;
  565. *Signature = SIGNATURE_32 ('X', 'T', 'S', 'P');
  566. }
  567. }
  568. break;
  569. //
  570. // Update SS3 Name with Setup value
  571. //
  572. case (SIGNATURE_32 ('S', 'S', '3', '_')):
  573. Operation = DsdtPointer - 1;
  574. if (*Operation == AML_NAME_OP) {
  575. Value = (UINT8 *) DsdtPointer + 4;
  576. *Value = PcdGet8 (PcdAcpiSleepState);
  577. }
  578. break;
  579. //
  580. // Update SS4 Name with Setup value
  581. //
  582. case (SIGNATURE_32 ('S', 'S', '4', '_')):
  583. Operation = DsdtPointer - 1;
  584. if (*Operation == AML_NAME_OP) {
  585. Value = (UINT8 *) DsdtPointer + 4;
  586. *Value = PcdGet8 (PcdAcpiHibernate);
  587. }
  588. break;
  589. //
  590. // _EJ0 method
  591. //
  592. case (SIGNATURE_32 ('_', 'E', 'J', '0')):
  593. if (PcdGet8 (PcdLowPowerS0Idle)) {
  594. //
  595. // Remove _EJ0 for SOC
  596. //
  597. if (*(DsdtPointer-3) == AML_METHOD_OP) {
  598. Signature = (UINT32 *) DsdtPointer;
  599. *Signature = SIGNATURE_32 ('X', 'E', 'J', '0');
  600. EnterDock = TRUE;
  601. }
  602. }
  603. break;
  604. //
  605. // _STA method for Device (\_SB.PCI0.DOCK)
  606. //
  607. case (SIGNATURE_32 ('_', 'S', 'T', 'A')):
  608. if (PcdGet8 (PcdLowPowerS0Idle)) {
  609. //
  610. // Remove _STA in (\_SB.PCI0.DOCK) for SOC
  611. //
  612. if ((*(DsdtPointer-3) == AML_METHOD_OP) && (EnterDock)) {
  613. Signature = (UINT32 *) DsdtPointer;
  614. *Signature = SIGNATURE_32 ('X', 'S', 'T', 'A');
  615. EnterDock = FALSE;
  616. }
  617. }
  618. break;
  619. //
  620. // _UPC method for Device (\_SB.PCI0.XHC.RHUB)
  621. //
  622. case (SIGNATURE_32('H', 'S', '1', '3')):
  623. for (TmpDsdtPointer = DsdtPointer;
  624. TmpDsdtPointer <= DsdtPointer + MaximumDsdtPointLength;
  625. TmpDsdtPointer++){
  626. Signature = (UINT32 *) TmpDsdtPointer;
  627. switch (*Signature) {
  628. case(SIGNATURE_32('U', 'P', 'C', 'P')):
  629. Value = (UINT8 *)((UINT32 *)TmpDsdtPointer + 2);
  630. break;
  631. default:
  632. //
  633. // Do nothing.
  634. //
  635. break;
  636. }
  637. }
  638. break;
  639. //
  640. // _DCK method
  641. //
  642. case (SIGNATURE_32 ('_', 'D', 'C', 'K')):
  643. if (PcdGet8 (PcdLowPowerS0Idle)) {
  644. //
  645. // Remove _DCK for SOC
  646. //
  647. if (*(DsdtPointer-3) == AML_METHOD_OP) {
  648. Signature = (UINT32 *) DsdtPointer;
  649. *Signature = SIGNATURE_32 ('X', 'D', 'C', 'K');
  650. }
  651. }
  652. break;
  653. //
  654. // mask _DEP from CPU's scope if CS disabled.
  655. //
  656. case (SIGNATURE_32 ('P', 'R', '0', '0')):
  657. case (SIGNATURE_32 ('P', 'R', '0', '1')):
  658. case (SIGNATURE_32 ('P', 'R', '0', '2')):
  659. case (SIGNATURE_32 ('P', 'R', '0', '3')):
  660. case (SIGNATURE_32 ('P', 'R', '0', '4')):
  661. case (SIGNATURE_32 ('P', 'R', '0', '5')):
  662. case (SIGNATURE_32 ('P', 'R', '0', '6')):
  663. case (SIGNATURE_32 ('P', 'R', '0', '7')):
  664. case (SIGNATURE_32 ('P', 'R', '0', '8')):
  665. case (SIGNATURE_32 ('P', 'R', '0', '9')):
  666. case (SIGNATURE_32 ('P', 'R', '1', '0')):
  667. case (SIGNATURE_32 ('P', 'R', '1', '1')):
  668. case (SIGNATURE_32 ('P', 'R', '1', '2')):
  669. case (SIGNATURE_32 ('P', 'R', '1', '3')):
  670. case (SIGNATURE_32 ('P', 'R', '1', '4')):
  671. case (SIGNATURE_32 ('P', 'R', '1', '5')):
  672. if (PcdGet8 (PcdLowPowerS0Idle) == 0) {
  673. for (TmpDsdtPointer = DsdtPointer; TmpDsdtPointer <= DsdtPointer + MaximumDsdtPointLength; TmpDsdtPointer++){
  674. Signature = (UINT32 *) TmpDsdtPointer;
  675. switch (*Signature) {
  676. case(SIGNATURE_32('_', 'D', 'E', 'P')):
  677. *(UINT8 *) TmpDsdtPointer = 'X';
  678. break;
  679. default:
  680. //
  681. // Do nothing.
  682. //
  683. break;
  684. }
  685. }
  686. }
  687. break;
  688. //
  689. // _EDL name
  690. //
  691. case (SIGNATURE_32 ('_', 'E', 'D', 'L')):
  692. if (PcdGet8 (PcdLowPowerS0Idle)) {
  693. //
  694. // Remove _EDL for SOC
  695. //
  696. if (*(DsdtPointer-1) == AML_NAME_OP) {
  697. Signature = (UINT32 *) DsdtPointer;
  698. *Signature = SIGNATURE_32 ('X', 'E', 'D', 'L');
  699. }
  700. }
  701. break;
  702. default:
  703. //
  704. // Do nothing.
  705. //
  706. break;
  707. }
  708. }
  709. }