Angel Pons | 08da24e | 2020-04-03 01:21:24 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 2 | |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 3 | /* |
| 4 | Scope (_SB) { |
| 5 | Device(PCI0) { |
| 6 | Device(SATA) { |
| 7 | Name(_ADR, 0x00110000) |
| 8 | #include "sata.asl" |
| 9 | } |
| 10 | } |
| 11 | } |
| 12 | */ |
| 13 | |
| 14 | Name(STTM, Buffer(20) { |
| 15 | 0x78, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, |
| 16 | 0x78, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, |
| 17 | 0x1f, 0x00, 0x00, 0x00 |
| 18 | }) |
| 19 | |
| 20 | /* Start by clearing the PhyRdyChg bits */ |
| 21 | Method(_INI) { |
| 22 | \_GPE._L1F() |
| 23 | } |
| 24 | |
| 25 | Device(PMRY) |
| 26 | { |
| 27 | Name(_ADR, 0) |
| 28 | Method(_GTM, 0x0, NotSerialized) { |
| 29 | Return(STTM) |
| 30 | } |
| 31 | Method(_STM, 0x3, NotSerialized) {} |
| 32 | |
| 33 | Device(PMST) { |
| 34 | Name(_ADR, 0) |
| 35 | Method(_STA,0) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 36 | if (P0IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 37 | return (0x0F) /* sata is visible */ |
| 38 | } |
| 39 | else { |
| 40 | return (0x00) /* sata is missing */ |
| 41 | } |
| 42 | } |
| 43 | }/* end of PMST */ |
| 44 | |
| 45 | Device(PSLA) |
| 46 | { |
| 47 | Name(_ADR, 1) |
| 48 | Method(_STA,0) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 49 | if (P1IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 50 | return (0x0F) /* sata is visible */ |
| 51 | } |
| 52 | else { |
| 53 | return (0x00) /* sata is missing */ |
| 54 | } |
| 55 | } |
| 56 | } /* end of PSLA */ |
| 57 | } /* end of PMRY */ |
| 58 | |
| 59 | Device(SEDY) |
| 60 | { |
| 61 | Name(_ADR, 1) /* IDE Scondary Channel */ |
| 62 | Method(_GTM, 0x0, NotSerialized) { |
| 63 | Return(STTM) |
| 64 | } |
| 65 | Method(_STM, 0x3, NotSerialized) {} |
| 66 | |
| 67 | Device(SMST) |
| 68 | { |
| 69 | Name(_ADR, 0) |
| 70 | Method(_STA,0) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 71 | if (P2IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 72 | return (0x0F) /* sata is visible */ |
| 73 | } |
| 74 | else { |
| 75 | return (0x00) /* sata is missing */ |
| 76 | } |
| 77 | } |
| 78 | } /* end of SMST */ |
| 79 | |
| 80 | Device(SSLA) |
| 81 | { |
| 82 | Name(_ADR, 1) |
| 83 | Method(_STA,0) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 84 | if (P3IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 85 | return (0x0F) /* sata is visible */ |
| 86 | } |
| 87 | else { |
| 88 | return (0x00) /* sata is missing */ |
| 89 | } |
| 90 | } |
| 91 | } /* end of SSLA */ |
| 92 | } /* end of SEDY */ |
| 93 | |
| 94 | /* SATA Hot Plug Support */ |
| 95 | Scope(\_GPE) { |
| 96 | Method(_L1F,0x0,NotSerialized) { |
| 97 | if (\_SB.P0PR) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 98 | if (\_SB.P0IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 99 | sleep(32) |
| 100 | } |
| 101 | Notify(\_SB.PCI0.STCR.PMRY.PMST, 0x01) /* NOTIFY_DEVICE_CHECK */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 102 | \_SB.P0PR = 1 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | if (\_SB.P1PR) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 106 | if (\_SB.P1IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 107 | sleep(32) |
| 108 | } |
| 109 | Notify(\_SB.PCI0.STCR.PMRY.PSLA, 0x01) /* NOTIFY_DEVICE_CHECK */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 110 | \_SB.P1PR = 1 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | if (\_SB.P2PR) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 114 | if (\_SB.P2IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 115 | sleep(32) |
| 116 | } |
| 117 | Notify(\_SB.PCI0.STCR.SEDY.SMST, 0x01) /* NOTIFY_DEVICE_CHECK */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 118 | \_SB.P2PR = 1 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | if (\_SB.P3PR) { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 122 | if (\_SB.P3IS > 0) { |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 123 | sleep(32) |
| 124 | } |
| 125 | Notify(\_SB.PCI0.STCR.SEDY.SSLA, 0x01) /* NOTIFY_DEVICE_CHECK */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 126 | \_SB.P3PR = 1 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 127 | } |
| 128 | } |
| 129 | } |