Simon Glass | 2f3b679 | 2024-10-23 15:20:12 +0200 | [diff] [blame] | 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 | |
| 13 | #include <asm/arch/acpi/bcm2836_sdhost.h> |
| 14 | #include <asm/arch/acpi/bcm2836_sdio.h> |
| 15 | |
| 16 | #include "acpitables.h" |
| 17 | |
| 18 | // |
| 19 | // Note: UEFI can use either SDHost or Arasan. We expose both to the OS. |
| 20 | // |
| 21 | |
| 22 | // ArasanSD 3.0 SD Host Controller. (brcm,bcm2835-sdhci) |
| 23 | Device (SDC1) |
| 24 | { |
| 25 | Name (_HID, "BCM2847") |
| 26 | Name (_CID, "BCM2847") |
| 27 | Name (_UID, 0x0) |
| 28 | Name (_CCA, 0x0) |
| 29 | Name (_S1D, 0x1) |
| 30 | Name (_S2D, 0x1) |
| 31 | Name (_S3D, 0x1) |
| 32 | Name (_S4D, 0x1) |
| 33 | |
| 34 | Name (RBUF, ResourceTemplate () |
| 35 | { |
| 36 | MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) |
| 37 | Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MMCHS1_INTERRUPT } |
| 38 | }) |
| 39 | Method (_CRS, 0x0, Serialized) |
| 40 | { |
| 41 | MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS1_OFFSET) |
| 42 | Return (^RBUF) |
| 43 | } |
| 44 | |
| 45 | // The standard CAPs registers on this controller |
| 46 | // appear to be 0, lets set some minimal defaults |
| 47 | // Since this cap doesn't indicate DMA capability |
| 48 | // we don't need a _DMA() |
| 49 | Name (_DSD, Package () { |
| 50 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 51 | Package () { |
| 52 | Package () { "sdhci-caps", 0x0120fa81 }, |
| 53 | } |
| 54 | }) |
| 55 | |
| 56 | // |
| 57 | // A child device that represents the |
| 58 | // sd card, which is marked as non-removable. |
| 59 | // |
| 60 | Device (SDMM) |
| 61 | { |
| 62 | Method (_ADR) |
| 63 | { |
| 64 | Return (0) |
| 65 | } |
| 66 | Method (_RMV) // Is removable |
| 67 | { |
| 68 | Return (0) // 0 - fixed |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // Broadcom SDHost 2.0 SD Host Controller |
| 74 | Device (SDC2) |
| 75 | { |
| 76 | Name (_HID, "BCM2855") |
| 77 | Name (_CID, "BCM2855") |
| 78 | Name (_UID, 0x0) |
| 79 | Name (_CCA, 0x0) |
| 80 | Name (_S1D, 0x1) |
| 81 | Name (_S2D, 0x1) |
| 82 | Name (_S3D, 0x1) |
| 83 | Name (_S4D, 0x1) |
| 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 | // |
| 97 | // A child device that represents the |
| 98 | // sd card, which is marked as non-removable. |
| 99 | // |
| 100 | Device (SDMM) |
| 101 | { |
| 102 | Method (_ADR) |
| 103 | { |
| 104 | Return (0) |
| 105 | } |
| 106 | Method (_RMV) // Is removable |
| 107 | { |
| 108 | Return (0) // 0 - fixed |
| 109 | } |
| 110 | } |
| 111 | } |