Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * Chrome OS Embedded Controller interface |
| 18 | * |
| 19 | * Constants that should be defined: |
| 20 | * |
| 21 | * SIO_EC_MEMMAP_ENABLE : Enable EC LPC memory map resources |
| 22 | * EC_LPC_ADDR_MEMMAP : Base address of memory map range |
| 23 | * EC_MEMMAP_SIZE : Size of memory map range |
| 24 | * |
| 25 | * SIO_EC_HOST_ENABLE : Enable EC host command interface resources |
| 26 | * EC_LPC_ADDR_HOST_DATA : EC host command interface data port |
| 27 | * EC_LPC_ADDR_HOST_CMD : EC host command interface command port |
Bill Richardson | e221aad | 2013-06-12 10:50:41 -0700 | [diff] [blame] | 28 | * EC_HOST_CMD_REGION0 : EC host command buffer |
| 29 | * EC_HOST_CMD_REGION1 : EC host command buffer |
| 30 | * EC_HOST_CMD_REGION_SIZE : EC host command buffer size |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 31 | */ |
| 32 | |
| 33 | // Scope is \_SB.PCI0.LPCB |
| 34 | |
| 35 | Device (SIO) { |
| 36 | Name (_UID, 0) |
| 37 | Name (_ADR, 0) |
| 38 | |
| 39 | #ifdef SIO_EC_MEMMAP_ENABLE |
| 40 | Device (ECMM) { |
| 41 | Name (_HID, EISAID ("PNP0C02")) |
| 42 | Name (_UID, 1) |
| 43 | Name (_ADR, 0) |
| 44 | |
| 45 | Method (_STA, 0, NotSerialized) { |
| 46 | Return (0x0F) |
| 47 | } |
| 48 | |
| 49 | Name (_CRS, ResourceTemplate () |
| 50 | { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 51 | IO (Decode16, EC_LPC_ADDR_MEMMAP, EC_LPC_ADDR_MEMMAP, |
| 52 | 0x08, EC_MEMMAP_SIZE) |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 53 | }) |
| 54 | |
| 55 | Name (_PRS, ResourceTemplate () |
| 56 | { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 57 | IO (Decode16, EC_LPC_ADDR_MEMMAP, EC_LPC_ADDR_MEMMAP, |
| 58 | 0x08, EC_MEMMAP_SIZE) |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 59 | }) |
| 60 | } |
| 61 | #endif |
| 62 | |
| 63 | #ifdef SIO_EC_HOST_ENABLE |
| 64 | Device (ECUI) { |
| 65 | Name (_HID, EISAID ("PNP0C02")) |
| 66 | Name (_UID, 3) |
| 67 | Name (_ADR, 0) |
| 68 | |
| 69 | Method (_STA, 0, NotSerialized) { |
| 70 | Return (0x0F) |
| 71 | } |
| 72 | |
| 73 | Name (_CRS, ResourceTemplate () |
| 74 | { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 75 | IO (Decode16, |
| 76 | EC_LPC_ADDR_HOST_DATA, EC_LPC_ADDR_HOST_DATA, |
| 77 | 0x01, 0x01) |
| 78 | IO (Decode16, |
| 79 | EC_LPC_ADDR_HOST_CMD, EC_LPC_ADDR_HOST_CMD, |
| 80 | 0x01, 0x01) |
| 81 | IO (Decode16, |
| 82 | EC_HOST_CMD_REGION0, EC_HOST_CMD_REGION0, 0x08, |
| 83 | EC_HOST_CMD_REGION_SIZE) |
| 84 | IO (Decode16, |
| 85 | EC_HOST_CMD_REGION1, EC_HOST_CMD_REGION0, 0x08, |
| 86 | EC_HOST_CMD_REGION_SIZE) |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 87 | }) |
| 88 | |
| 89 | Name (_PRS, ResourceTemplate () |
| 90 | { |
| 91 | StartDependentFn (0, 0) { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 92 | IO (Decode16, EC_LPC_ADDR_HOST_DATA, |
| 93 | EC_LPC_ADDR_HOST_DATA, 0x01, 0x01) |
| 94 | IO (Decode16, EC_LPC_ADDR_HOST_CMD, |
| 95 | EC_LPC_ADDR_HOST_CMD, 0x01, 0x01) |
| 96 | IO (Decode16, |
| 97 | EC_HOST_CMD_REGION0, EC_HOST_CMD_REGION0, |
| 98 | 0x08, EC_HOST_CMD_REGION_SIZE) |
| 99 | IO (Decode16, |
| 100 | EC_HOST_CMD_REGION1, EC_HOST_CMD_REGION1, |
| 101 | 0x08, EC_HOST_CMD_REGION_SIZE) |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 102 | } |
| 103 | EndDependentFn () |
| 104 | }) |
| 105 | } |
| 106 | #endif |
| 107 | |
| 108 | #ifdef SIO_EC_ENABLE_COM1 |
| 109 | Device (COM1) { |
| 110 | Name (_HID, EISAID ("PNP0501")) |
| 111 | Name (_UID, 1) |
| 112 | Name (_ADR, 0) |
| 113 | |
| 114 | Method (_STA, 0, NotSerialized) { |
| 115 | Return (0x0F) |
| 116 | } |
| 117 | |
| 118 | Name (_CRS, ResourceTemplate () |
| 119 | { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 120 | IO (Decode16, 0x03F8, 0x3F8, 0x08, 0x08) |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 121 | IRQNoFlags () {4} |
| 122 | }) |
| 123 | |
| 124 | Name (_PRS, ResourceTemplate () |
| 125 | { |
| 126 | StartDependentFn (0, 0) { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 127 | IO (Decode16, 0x03F8, 0x3F8, 0x08, 0x08) |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 128 | IRQNoFlags () {4} |
| 129 | } |
| 130 | EndDependentFn () |
| 131 | }) |
| 132 | } |
| 133 | #endif |
| 134 | |
| 135 | #ifdef SIO_EC_ENABLE_PS2K |
| 136 | Device (PS2K) // Keyboard |
| 137 | { |
| 138 | Name (_UID, 0) |
| 139 | Name (_ADR, 0) |
| 140 | Name (_HID, EISAID("PNP0303")) |
| 141 | Name (_CID, EISAID("PNP030B")) |
| 142 | |
| 143 | Method (_STA, 0, NotSerialized) { |
| 144 | Return (0x0F) |
| 145 | } |
| 146 | |
| 147 | Name (_CRS, ResourceTemplate() |
| 148 | { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 149 | IO (Decode16, 0x60, 0x60, 0x01, 0x01) |
| 150 | IO (Decode16, 0x64, 0x64, 0x01, 0x01) |
Aaron Durbin | 2f6402c | 2013-11-20 15:18:24 -0600 | [diff] [blame] | 151 | #ifdef SIO_EC_PS2K_IRQ |
| 152 | SIO_EC_PS2K_IRQ |
| 153 | #else |
Duncan Laurie | f611fcf | 2015-09-21 15:00:20 -0700 | [diff] [blame] | 154 | IRQ (Edge, ActiveHigh, ExclusiveAndWake) {1} |
Aaron Durbin | 2f6402c | 2013-11-20 15:18:24 -0600 | [diff] [blame] | 155 | #endif |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 156 | }) |
| 157 | |
| 158 | Name (_PRS, ResourceTemplate() |
| 159 | { |
| 160 | StartDependentFn (0, 0) { |
Duncan Laurie | 58867b1 | 2013-10-24 12:37:48 -0700 | [diff] [blame] | 161 | IO (Decode16, 0x60, 0x60, 0x01, 0x01) |
| 162 | IO (Decode16, 0x64, 0x64, 0x01, 0x01) |
Aaron Durbin | 2f6402c | 2013-11-20 15:18:24 -0600 | [diff] [blame] | 163 | #ifdef SIO_EC_PS2K_IRQ |
| 164 | SIO_EC_PS2K_IRQ |
| 165 | #else |
Duncan Laurie | f611fcf | 2015-09-21 15:00:20 -0700 | [diff] [blame] | 166 | IRQ (Edge, ActiveHigh, ExclusiveAndWake) {1} |
Aaron Durbin | 2f6402c | 2013-11-20 15:18:24 -0600 | [diff] [blame] | 167 | #endif |
Stefan Reinauer | d6682e8 | 2013-02-21 15:39:35 -0800 | [diff] [blame] | 168 | } |
| 169 | EndDependentFn () |
| 170 | }) |
| 171 | } |
| 172 | #endif |
| 173 | } |