1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Include this file into a mainboard's DSDT _SB device tree and it will
5 * expose the IT8516E in the configuration used by Kontron:
10 * It allows the change of IO ports, IRQs and DMA settings on the devices
11 * and disabling and reenabling logical devices.
13 * Controlled by the following preprocessor defines:
14 * IT8516E_EC_DEV Device identifier for this EC (e.g. EC0)
15 * SUPERIO_PNP_BASE I/o address of the first PnP configuration register
16 * IT8516E_FIRST_DATA I/o address of the EC_DATA register on the first
18 * IT8516E_FIRST_SC I/o address of the EC_SC register on the first
20 * IT8516E_SECOND_DATA I/o address of the EC_DATA register on the second
22 * IT8516E_SECOND_SC I/o address of the EC_SC register on the second
26 #undef SUPERIO_CHIP_NAME
27 #define SUPERIO_CHIP_NAME IT8516E
28 #include <superio/acpi/pnp.asl>
30 Device(IT8516E_EC_DEV) {
31 Name (_HID, EisaId("PNP0A05"))
32 Name (_STR, Unicode("Kontron IT8516E Embedded Controller"))
33 Name (_UID, SUPERIO_UID(IT8516E_EC_DEV,))
35 /* SuperIO configuration ports */
36 OperationRegion (CREG, SystemIO, SUPERIO_PNP_BASE, 0x02)
37 Field (CREG, ByteAcc, NoLock, Preserve)
42 IndexField (ADDR, DATA, ByteAcc, NoLock, Preserve)
45 PNP_LOGICAL_DEVICE, 8, /* Logical device selector */
48 PNP_DEVICE_ACTIVE, 1, /* Logical device activation */
51 PNP_IO0_HIGH_BYTE, 8, /* First I/O port base - high byte */
52 PNP_IO0_LOW_BYTE, 8, /* First I/O port base - low byte */
53 PNP_IO1_HIGH_BYTE, 8, /* Second I/O port base - high byte */
54 PNP_IO1_LOW_BYTE, 8, /* Second I/O port base - low byte */
57 PNP_IRQ0, 8, /* First IRQ */
62 /* Announce the used i/o ports to the OS */
63 Return (ResourceTemplate () {
64 IO (Decode16, SUPERIO_PNP_BASE, SUPERIO_PNP_BASE, 0x01, 0x02)
68 #undef PNP_ENTER_MAGIC_1ST
69 #undef PNP_ENTER_MAGIC_2ND
70 #undef PNP_ENTER_MAGIC_3RD
71 #undef PNP_ENTER_MAGIC_4TH
72 #undef PNP_EXIT_MAGIC_1ST
73 #undef PNP_EXIT_SPECIAL_REG
74 #undef PNP_EXIT_SPECIAL_VAL
75 #include <superio/acpi/pnp_config.asl>
79 /* No PM: always in C0 */
83 #undef SUPERIO_UART_LDN
84 #undef SUPERIO_UART_DDN
85 #undef SUPERIO_UART_PM_REG
86 #define SUPERIO_UART_LDN 1
87 #include <superio/acpi/pnp_uart.asl>
89 #undef SUPERIO_UART_LDN
90 #define SUPERIO_UART_LDN 2
91 #include <superio/acpi/pnp_uart.asl>
93 #undef SUPERIO_KBC_LDN
94 #undef SUPERIO_KBC_PS2M
95 #undef SUPERIO_KBC_PS2LDN
96 #define SUPERIO_KBC_LDN 6
97 #define SUPERIO_KBC_PS2LDN 5
98 #include <superio/acpi/pnp_kbc.asl>
100 #include "pm_channels.asl"