summaryrefslogtreecommitdiff
path: root/Platform/RaspberryPi/AcpiTables/Sdhc.asl
blob: 42776e33bbc66df7a6d1d59f64479ec215246b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/** @file
 *
 *  [DSDT] SD controller/card definition (SDHC)
 *
 *  Copyright (c) 2020, Pete Batard <pete@akeo.ie>
 *  Copyright (c) 2018, Andrey Warkentin <andrey.warkentin@gmail.com>
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
 **/

#include <IndustryStandard/Bcm2836SdHost.h>
#include <IndustryStandard/Bcm2836Sdio.h>

#include "AcpiTables.h"

//
// Note: UEFI can use either SDHost or Arasan. We expose both to the OS.
//

// ArasanSD 3.0 SD Host Controller. (brcm,bcm2835-sdhci)
Device (SDC1)
{
  Name (_HID, "BCM2847")
  Name (_CID, "ARASAN")
  Name (_UID, 0x0)
  Name (_CCA, 0x0)
  Name (_S1D, 0x1)
  Name (_S2D, 0x1)
  Name (_S3D, 0x1)
  Name (_S4D, 0x1)
  Method (_STA)
  {
    Return(0xf)
  }
  Name (RBUF, ResourceTemplate ()
  {
    MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM)
    Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MMCHS1_INTERRUPT }
  })
  Method (_CRS, 0x0, Serialized)
  {
    MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS1_OFFSET)
    Return (^RBUF)
  }

  // The standard CAPs registers on this controller
  // appear to be 0, lets set some minimal defaults
  // Since this cap doesn't indicate DMA capability
  // we don't need a _DMA()
  Name (_DSD, Package () {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
      Package () { "sdhci-caps", 0x0120fa81 },
    }
  })

  //
  // A child device that represents the
  // sd card, which is marked as non-removable.
  //
  Device (SDMM)
  {
    Method (_ADR)
    {
      Return (0)
    }
    Method (_RMV) // Is removable
    {
      Return (0) // 0 - fixed
    }
  }
}

#if (RPI_MODEL < 4)
// Broadcom SDHost 2.0 SD Host Controller
Device (SDC2)
{
  Name (_HID, "BCM2855")
  Name (_CID, "SDHST")
  Name (_UID, 0x0)
  Name (_CCA, 0x0)
  Name (_S1D, 0x1)
  Name (_S2D, 0x1)
  Name (_S3D, 0x1)
  Name (_S4D, 0x1)
  Method (_STA)
  {
    Return (0xf)
  }
  Name (RBUF, ResourceTemplate ()
  {
    MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM)
    Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_SDHOST_INTERRUPT }
  })
  Method (_CRS, 0x0, Serialized)
  {
    MEMORY32SETBASE (RBUF, RMEM, RBAS, SDHOST_OFFSET)
    Return (^RBUF)
  }

  //
  // A child device that represents the
  // sd card, which is marked as non-removable.
  //
  Device (SDMM)
  {
    Method (_ADR)
    {
      Return (0)
    }
    Method (_RMV) // Is removable
    {
      Return (0) // 0 - fixed
    }
  }
}
#endif // !RPI4