| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
/* |
| 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: |
| 6 |
* 2xUART, |
| 7 |
* PS/2 Mouse, Keyboard |
| 8 |
* Two PM Channels |
| 9 |
* |
| 10 |
* It allows the change of IO ports, IRQs and DMA settings on the devices |
| 11 |
* and disabling and reenabling logical devices. |
| 12 |
* |
| 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 |
| 17 |
* pm channel |
| 18 |
* IT8516E_FIRST_SC I/o address of the EC_SC register on the first |
| 19 |
* pm channel |
| 20 |
* IT8516E_SECOND_DATA I/o address of the EC_DATA register on the second |
| 21 |
* pm channel |
| 22 |
* IT8516E_SECOND_SC I/o address of the EC_SC register on the second |
| 23 |
* pm channel |
| 24 |
*/ |
| 25 |
|
| 26 |
#undef SUPERIO_CHIP_NAME |
| 27 |
#define SUPERIO_CHIP_NAME IT8516E |
| 28 |
#include <superio/acpi/pnp.asl> |
| 29 |
|
| 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,)) |
| 34 |
|
| 35 |
/* SuperIO configuration ports */ |
| 36 |
OperationRegion (CREG, SystemIO, SUPERIO_PNP_BASE, 0x02) |
| 37 |
Field (CREG, ByteAcc, NoLock, Preserve) |
| 38 |
{ |
| 39 |
ADDR, 8, |
| 40 |
DATA, 8 |
| 41 |
} |
| 42 |
IndexField (ADDR, DATA, ByteAcc, NoLock, Preserve) |
| 43 |
{ |
| 44 |
Offset (0x07), |
| 45 |
PNP_LOGICAL_DEVICE, 8, /* Logical device selector */ |
| 46 |
|
| 47 |
Offset (0x30), |
| 48 |
PNP_DEVICE_ACTIVE, 1, /* Logical device activation */ |
| 49 |
|
| 50 |
Offset (0x60), |
| 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 */ |
| 55 |
|
| 56 |
Offset (0x70), |
| 57 |
PNP_IRQ0, 8, /* First IRQ */ |
| 58 |
} |
| 59 |
|
| 60 |
Method (_CRS) |
| 61 |
{ |
| 62 |
/* Announce the used i/o ports to the OS */ |
| 63 |
Return (ResourceTemplate () { |
| 64 |
IO (Decode16, SUPERIO_PNP_BASE, SUPERIO_PNP_BASE, 0x01, 0x02) |
| 65 |
}) |
| 66 |
} |
| 67 |
|
| 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> |
| 76 |
|
| 77 |
Method (_PSC) |
| 78 |
{ |
| 79 |
/* No PM: always in C0 */ |
| 80 |
Return (0) |
| 81 |
} |
| 82 |
|
| 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> |
| 88 |
|
| 89 |
#undef SUPERIO_UART_LDN |
| 90 |
#define SUPERIO_UART_LDN 2 |
| 91 |
#include <superio/acpi/pnp_uart.asl> |
| 92 |
|
| 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> |
| 99 |
|
| 100 |
#include "pm_channels.asl" |
| 101 |
} |