xref: /aosp_15_r20/external/coreboot/Documentation/superio/common/ssdt.md (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1# SuperIO SSTD generator
2
3This page describes the common SSDT ACPI generator for SuperIO chips that can
4be found in coreboot.
5
6## Functional description
7
8In order to automatically generate ACPI functions you need to add
9a new `chip superio/common` and `device pnp xx.0 on` to your devicetree.
10
11The xx denotes the hexadecimal address of the SuperIO.
12
13Place the regular LDN pnp devices behind those two entries.
14
15The code will automatically guess the function based on the decoded
16I/O range and ISA IRQ number.
17
18## Example devicetree.cb
19
20This example is based on AST2400.
21
22```
23# Add a "container" for proper ACPI code generation
24chip superio/common
25  device pnp 2e.0 on # just for the base device, not for the LDNs
26    chip superio/aspeed/ast2400
27      device pnp 2e.0 off  end
28      device pnp 2e.2 on # SUART1
29        io 0x60 = 0x3f8
30        irq 0x70 = 4
31      end
32      device pnp 2e.3 on # SUART2
33        io 0x60 = 0x2f8
34        irq 0x70 = 3
35      end
36      device pnp 2e.4 on # SWC
37        io 0x60 = 0xa00
38        io 0x62 = 0xa10
39        io 0x64 = 0xa20
40        io 0x66 = 0xa30
41        irq 0x70 = 0
42      end
43    end
44  end
45end
46```
47
48## Automatically generated methods
49
50The following methods are generated for each SuperIO:
51## AMTX()
52Acquire the global mutex and enter config mode.
53It's called this at the beginning of an atomic operation to make sure
54no other ACPI code messes with the config space while working on it.
55
56## RMTX()
57Exit config mode and release the global mutex.
58It's called at the end of an atomic operation.
59
60## SLDN(Arg0)
61Selects the (virtual) LDN given as Arg0.
62This method isn't guarded with the global mutex.
63
64## DLDN(Arg0)
65Disables the (virtual) LDN given as Arg0.
66This method acquires the global mutex.
67
68## QLDN(Arg0)
69Queries the state of the (virtual) LDN given as Arg0.
70This method quires the global mutex.
71
72## TODO
73
741) Add ACPI HIDs to every SuperIO driver
752) Generate support methods that allow
76   * Setting resource settings at runtime
77   * Getting resource settings at runtime
78