blob: 539a5ea0a802d745e27ceb029b4eb16aa0f29b07 [file] [log] [blame]
Nico Hubera53266b2013-05-02 15:26:08 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 secunet Security Networks AG
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.
Nico Hubera53266b2013-05-02 15:26:08 +020014 */
15
16/*
17 * Include this file into a mainboard's DSDT _SB device tree and it will
18 * expose the IT8516E in the configuration used by Kontron:
19 * 2xUART,
20 * PS/2 Mouse, Keyboard
21 * Two PM Channels
22 *
23 * It allows the change of IO ports, IRQs and DMA settings on the devices
24 * and disabling and reenabling logical devices.
25 *
26 * Controlled by the following preprocessor defines:
27 * IT8516E_EC_DEV Device identifier for this EC (e.g. EC0)
28 * SUPERIO_PNP_BASE I/o address of the first PnP configuration register
29 * IT8516E_FIRST_DATA I/o address of the EC_DATA register on the first
30 * pm channel
31 * IT8516E_FIRST_SC I/o address of the EC_SC register on the first
32 * pm channel
33 * IT8516E_SECOND_DATA I/o address of the EC_DATA register on the second
34 * pm channel
35 * IT8516E_SECOND_SC I/o address of the EC_SC register on the second
36 * pm channel
37 */
38
39#undef SUPERIO_CHIP_NAME
40#define SUPERIO_CHIP_NAME IT8516E
41#include <superio/acpi/pnp.asl>
42
43Device(IT8516E_EC_DEV) {
44 Name (_HID, EisaId("PNP0A05"))
45 Name (_STR, Unicode("Kontron IT8516E Embedded Controller"))
46 Name (_UID, SUPERIO_UID(IT8516E_EC_DEV,))
47
48 /* SuperIO configuration ports */
49 OperationRegion (CREG, SystemIO, SUPERIO_PNP_BASE, 0x02)
50 Field (CREG, ByteAcc, NoLock, Preserve)
51 {
52 ADDR, 8,
53 DATA, 8
54 }
55 IndexField (ADDR, DATA, ByteAcc, NoLock, Preserve)
56 {
57 Offset (0x07),
58 PNP_LOGICAL_DEVICE, 8, /* Logical device selector */
59
60 Offset (0x30),
61 PNP_DEVICE_ACTIVE, 1, /* Logical device activation */
62
63 Offset (0x60),
64 PNP_IO0_HIGH_BYTE, 8, /* First I/O port base - high byte */
65 PNP_IO0_LOW_BYTE, 8, /* First I/O port base - low byte */
66 PNP_IO1_HIGH_BYTE, 8, /* Second I/O port base - high byte */
67 PNP_IO1_LOW_BYTE, 8, /* Second I/O port base - low byte */
68
69 Offset (0x70),
70 PNP_IRQ0, 8, /* First IRQ */
71 }
72
73 Method (_CRS)
74 {
75 /* Announce the used i/o ports to the OS */
76 Return (ResourceTemplate () {
77 IO (Decode16, SUPERIO_PNP_BASE, SUPERIO_PNP_BASE, 0x01, 0x02)
78 })
79 }
80
81 #undef PNP_ENTER_MAGIC_1ST
82 #undef PNP_ENTER_MAGIC_2ND
83 #undef PNP_ENTER_MAGIC_3RD
84 #undef PNP_EXIT_MAGIC_1ST
85 #include <superio/acpi/pnp_config.asl>
86
87 Method (_PSC)
88 {
89 /* No PM: always in C0 */
90 Return (0)
91 }
92
93 #undef SUPERIO_UART_LDN
94 #undef SUPERIO_UART_DDN
95 #undef SUPERIO_UART_PM_REG
96 #define SUPERIO_UART_LDN 1
97 #include <superio/acpi/pnp_uart.asl>
98
99 #undef SUPERIO_UART_LDN
100 #define SUPERIO_UART_LDN 2
101 #include <superio/acpi/pnp_uart.asl>
102
103 #undef SUPERIO_KBC_LDN
104 #undef SUPERIO_KBC_PS2M
105 #undef SUPERIO_KBC_PS2LDN
106 #define SUPERIO_KBC_LDN 6
107 #define SUPERIO_KBC_PS2LDN 5
108 #include <superio/acpi/pnp_kbc.asl>
109
110 #include "pm_channels.asl"
111}