Sdhc.asl 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /** @file
  2. *
  3. * [DSDT] SD controller/card definition (SDHC)
  4. *
  5. * Copyright (c) 2020, Pete Batard <pete@akeo.ie>
  6. * Copyright (c) 2018, Andrey Warkentin <andrey.warkentin@gmail.com>
  7. * Copyright (c) Microsoft Corporation. All rights reserved.
  8. *
  9. * SPDX-License-Identifier: BSD-2-Clause-Patent
  10. *
  11. **/
  12. #include <IndustryStandard/Bcm2836SdHost.h>
  13. #include <IndustryStandard/Bcm2836Sdio.h>
  14. #include "AcpiTables.h"
  15. //
  16. // Note: UEFI can use either SDHost or Arasan. We expose both to the OS.
  17. //
  18. // ArasanSD 3.0 SD Host Controller. (brcm,bcm2835-sdhci)
  19. Device (SDC1)
  20. {
  21. Name (_HID, "BCM2847")
  22. Name (_CID, "BCM2847")
  23. Name (_UID, 0x0)
  24. Name (_CCA, 0x0)
  25. Name (_S1D, 0x1)
  26. Name (_S2D, 0x1)
  27. Name (_S3D, 0x1)
  28. Name (_S4D, 0x1)
  29. Method (_STA)
  30. {
  31. Return(0xf)
  32. }
  33. Name (RBUF, ResourceTemplate ()
  34. {
  35. MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM)
  36. Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MMCHS1_INTERRUPT }
  37. })
  38. Method (_CRS, 0x0, Serialized)
  39. {
  40. MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS1_OFFSET)
  41. Return (^RBUF)
  42. }
  43. // The standard CAPs registers on this controller
  44. // appear to be 0, lets set some minimal defaults
  45. // Since this cap doesn't indicate DMA capability
  46. // we don't need a _DMA()
  47. Name (_DSD, Package () {
  48. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  49. Package () {
  50. Package () { "sdhci-caps", 0x0120fa81 },
  51. }
  52. })
  53. //
  54. // A child device that represents the
  55. // sd card, which is marked as non-removable.
  56. //
  57. Device (SDMM)
  58. {
  59. Method (_ADR)
  60. {
  61. Return (0)
  62. }
  63. Method (_RMV) // Is removable
  64. {
  65. Return (0) // 0 - fixed
  66. }
  67. }
  68. }
  69. #if (RPI_MODEL < 4)
  70. // Broadcom SDHost 2.0 SD Host Controller
  71. Device (SDC2)
  72. {
  73. Name (_HID, "BCM2855")
  74. Name (_CID, "BCM2855")
  75. Name (_UID, 0x0)
  76. Name (_CCA, 0x0)
  77. Name (_S1D, 0x1)
  78. Name (_S2D, 0x1)
  79. Name (_S3D, 0x1)
  80. Name (_S4D, 0x1)
  81. Method (_STA)
  82. {
  83. Return (0xf)
  84. }
  85. Name (RBUF, ResourceTemplate ()
  86. {
  87. MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM)
  88. Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_SDHOST_INTERRUPT }
  89. })
  90. Method (_CRS, 0x0, Serialized)
  91. {
  92. MEMORY32SETBASE (RBUF, RMEM, RBAS, SDHOST_OFFSET)
  93. Return (^RBUF)
  94. }
  95. //
  96. // A child device that represents the
  97. // sd card, which is marked as non-removable.
  98. //
  99. Device (SDMM)
  100. {
  101. Method (_ADR)
  102. {
  103. Return (0)
  104. }
  105. Method (_RMV) // Is removable
  106. {
  107. Return (0) // 0 - fixed
  108. }
  109. }
  110. }
  111. #endif // !RPI4