Simon Glass | 18d4a11 | 2024-10-23 15:20:12 +0200 | [diff] [blame] | 1 | /** @file |
| 2 | * |
| 3 | * [DSDT] RHProxy device to enable WinRT API (RHPX) |
| 4 | * |
| 5 | * Copyright (c) 2018, Andrey Warkentin <andrey.warkentin@gmail.com> |
| 6 | * Copyright (c) Microsoft Corporation. All rights reserved. |
| 7 | * |
| 8 | * SPDX-License-Identifier: BSD-2-Clause-Patent |
| 9 | * |
| 10 | **/ |
| 11 | |
| 12 | Device (RHPX) |
| 13 | { |
| 14 | Name (_HID, "MSFT8000") |
| 15 | Name (_CID, "MSFT8000") |
| 16 | Name (_UID, 1) |
| 17 | |
| 18 | Name(_CRS, ResourceTemplate () |
| 19 | { |
| 20 | // Index 0 |
| 21 | SPISerialBus ( // SCKL - GPIO 11 - Pin 23 |
| 22 | // MOSI - GPIO 10 - Pin 19 |
| 23 | // MISO - GPIO 9 - Pin 21 |
| 24 | // CE0 - GPIO 8 - Pin 24 |
| 25 | 0, // Device selection (CE0) |
| 26 | PolarityLow, // Device selection polarity |
| 27 | FourWireMode, // WireMode |
| 28 | 8, // DataBit len |
| 29 | ControllerInitiated, // Slave mode |
| 30 | 4000000, // Connection speed |
| 31 | ClockPolarityLow, // Clock polarity |
| 32 | ClockPhaseFirst, // Clock phase |
| 33 | "\\_SB.GDV0.SPI0", // ResourceSource: SPI bus controller name |
| 34 | 0, // ResourceSourceIndex |
| 35 | // Resource usage |
| 36 | // DescriptorName: creates name for offset of resource descriptor |
| 37 | ) // Vendor Data |
| 38 | |
| 39 | // Index 1 |
| 40 | SPISerialBus ( // SCKL - GPIO 11 - Pin 23 |
| 41 | // MOSI - GPIO 10 - Pin 19 |
| 42 | // MISO - GPIO 9 - Pin 21 |
| 43 | // CE1 - GPIO 7 - Pin 26 |
| 44 | 1, // Device selection (CE1) |
| 45 | PolarityLow, // Device selection polarity |
| 46 | FourWireMode, // WireMode |
| 47 | 8, // DataBit len |
| 48 | ControllerInitiated, // Slave mode |
| 49 | 4000000, // Connection speed |
| 50 | ClockPolarityLow, // Clock polarity |
| 51 | ClockPhaseFirst, // Clock phase |
| 52 | "\\_SB.GDV0.SPI0", // ResourceSource: SPI bus controller name |
| 53 | 0, // ResourceSourceIndex |
| 54 | // Resource usage |
| 55 | // DescriptorName: creates name for offset of resource descriptor |
| 56 | ) // Vendor Data |
| 57 | |
| 58 | // Index 2 |
| 59 | I2CSerialBus ( // Pin 3 (GPIO2, SDA1), 5 (GPIO3, SCL1) |
| 60 | 0xFFFF, // SlaveAddress: placeholder |
| 61 | , // SlaveMode: default to ControllerInitiated |
| 62 | 0, // ConnectionSpeed: placeholder |
| 63 | , // Addressing Mode: default to 7 bit |
| 64 | "\\_SB.GDV0.I2C1", // ResourceSource: I2C bus controller name |
| 65 | , |
| 66 | , |
| 67 | , // Descriptor Name: creates name for offset of resource descriptor |
| 68 | ) // Vendor Data |
| 69 | |
| 70 | // Index 3 |
| 71 | SPISerialBus ( // SPI1_SCLK - GPIO21 |
| 72 | // SPI1_MOSI - GPIO20 |
| 73 | // SPI1_MISO - GPIO19 |
| 74 | // SPI1_CE2_N - GPIO16 |
| 75 | 2, // Device selection (CE2) |
| 76 | PolarityLow, // Device selection polarity |
| 77 | FourWireMode, // WireMode |
| 78 | 8, // DataBit len |
| 79 | ControllerInitiated, // Slave mode |
| 80 | 4000000, // Connection speed |
| 81 | ClockPolarityLow, // Clock polarity |
| 82 | ClockPhaseFirst, // Clock phase |
| 83 | "\\_SB.GDV0.SPI1", // ResourceSource: SPI bus controller name |
| 84 | 0, // ResourceSourceIndex |
| 85 | // Resource usage |
| 86 | // DescriptorName: creates name for offset of resource descriptor |
| 87 | ) // Vendor Data |
| 88 | |
| 89 | // GPIO 2 |
| 90 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 2 } |
| 91 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 2 } |
| 92 | // GPIO 3 |
| 93 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 3 } |
| 94 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 3 } |
| 95 | // GPIO 4 |
| 96 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 4 } |
| 97 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 4 } |
| 98 | // GPIO 5 |
| 99 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 5 } |
| 100 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 5 } |
| 101 | // GPIO 6 |
| 102 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 6 } |
| 103 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 6 } |
| 104 | // GPIO 7 |
| 105 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 7 } |
| 106 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 7 } |
| 107 | // GPIO 8 |
| 108 | GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 8 } |
| 109 | GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GDV0.GPI0",) { 8 } |
| 110 | // GPIO 9 |
| 111 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 9 } |
| 112 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 9 } |
| 113 | // GPIO 10 |
| 114 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 10 } |
| 115 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 10 } |
| 116 | // GPIO 11 |
| 117 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 11 } |
| 118 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 11 } |
| 119 | // GPIO 12 |
| 120 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 12 } |
| 121 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 12 } |
| 122 | // GPIO 13 |
| 123 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 13 } |
| 124 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 13 } |
| 125 | // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing |
| 126 | // until a proper solution can be created for the dmap conflict |
| 127 | // GPIO 14 - UART TX |
| 128 | // GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 14 } |
| 129 | // GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 14 } |
| 130 | // GPIO 15 - UART RX |
| 131 | // GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 15 } |
| 132 | // GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 15 } |
| 133 | // GPIO 16 |
| 134 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 16 } |
| 135 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 16 } |
| 136 | // GPIO 17 |
| 137 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 17 } |
| 138 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 17 } |
| 139 | // GPIO 18 |
| 140 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 18 } |
| 141 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 18 } |
| 142 | // GPIO 19 |
| 143 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 19 } |
| 144 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 19 } |
| 145 | // GPIO 20 |
| 146 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 20 } |
| 147 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 20 } |
| 148 | // GPIO 21 |
| 149 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 21 } |
| 150 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 21 } |
| 151 | // GPIO 22 |
| 152 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 22 } |
| 153 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 22 } |
| 154 | // GPIO 23 |
| 155 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 23 } |
| 156 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 23 } |
| 157 | // GPIO 24 |
| 158 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 24 } |
| 159 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 24 } |
| 160 | // GPIO 25 |
| 161 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 25 } |
| 162 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 25 } |
| 163 | // GPIO 26 |
| 164 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 26 } |
| 165 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 26 } |
| 166 | // GPIO 27 |
| 167 | GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GDV0.GPI0", 0, ResourceConsumer,,) { 27 } |
| 168 | GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GDV0.GPI0",) { 27 } |
| 169 | }) |
| 170 | |
| 171 | Name (_DSD, Package() |
| 172 | { |
| 173 | ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 174 | Package () |
| 175 | { |
| 176 | // Reference http://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md |
| 177 | // SPI 0 |
| 178 | Package (2) { "bus-SPI-SPI0", Package() { 0, 1 } }, // Index 0 & 1 |
| 179 | Package (2) { "SPI0-MinClockInHz", 7629 }, // 7629 Hz |
| 180 | Package (2) { "SPI0-MaxClockInHz", 125000000 }, // 125 MHz |
| 181 | Package (2) { "SPI0-SupportedDataBitLengths", Package() { 8 } }, // Data Bit Length |
| 182 | // I2C1 |
| 183 | Package (2) { "bus-I2C-I2C1", Package() { 2 } }, |
| 184 | // GPIO Pin Count and supported drive modes |
| 185 | Package (2) { "GPIO-PinCount", 54 }, |
| 186 | Package (2) { "GPIO-UseDescriptorPinNumbers", 1 }, |
| 187 | Package (2) { "GPIO-SupportedDriveModes", 0xf }, // InputHighImpedance, InputPullUp, InputPullDown, OutputCmos |
| 188 | // SPI 1 |
| 189 | Package (2) { "bus-SPI-SPI1", Package() { 3 }}, // Index 3 |
| 190 | Package (2) { "SPI1-MinClockInHz", 30511 }, // 30.5 kHz |
| 191 | Package (2) { "SPI1-MaxClockInHz", 20000000 }, // 20 MHz |
| 192 | Package (2) { "SPI1-SupportedDataBitLengths", Package() { 8 } }, // Data Bit Length |
| 193 | } |
| 194 | }) |
| 195 | } |