Debian Codegraph @

src/soc/intel/common/acpi/pcie_clk.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /* PCH clock by P2SB */
4 #include <soc/intel/common/acpi/pch_clk.asl>
5
6 /* IOE clock by P2SB */
7 #include <soc/intel/common/acpi/ioe_clk.asl>
8
9 /*
10 * CLKM (Clock Manager): Helper Method to manage clock enable/disable
11 * This method handles the enabling or disabling of clocks for either the
12 * Integrated Controller (ICLK) or the IOE Die (ECLK) based on the provided
13 * parameters.
14 *
15 * Arg0: Clock number
16 * Arg1: Clock source, IOE Die Clock (1)/Integrated Controller Clock (0)
17 * Arg2: Enable(1)/Disable(0) Clock
18 */
19 Method (CLKM, 3, Serialized) {
20 If (LEqual (Arg1, 1)) {
21 If (LEqual (Arg2, 1)) {
22 \_SB.ECLK.CLKE (Arg0)
23 } Else {
24 \_SB.ECLK.CLKD (Arg0)
25 }
26 } Else {
27 If (LEqual (Arg2, 1)) {
28 \_SB.ICLK.CLKE (Arg0)
29 } Else {
30 \_SB.ICLK.CLKD (Arg0)
31 }
32 }
33 }
34
35 /*
36 * Configure PCIe ClkReq Override
37 * Arg0: Clock number
38 * Arg1: Enable(1)/Disable(0) Clock
39 */
40 Method (SPCO, 2, Serialized) {
41 /* Flag to indicate presence of IOE Die (1 = Present, 0 = Not Present) */
42 Local0 = CONFIG(SOC_INTEL_COMMON_BLOCK_IOE_P2SB)
43 /* Clock start index */
44 Local1 = 0
45
46 /* Override clock start index if SOC_INTEL_COMMON_BLOCK_IOE_P2SB Kconfig is present. */
47 If (LEqual (Local0, 1)) {
48 Local1 = CONFIG_IOE_DIE_CLOCK_START
49 }
50
51 /* Clock number */
52 Local2 = Arg0
53 If (LGreaterEqual (Arg0, Local1)) {
54 Local2 = Subtract (Arg0, Local1)
55 } Else {
56 /*
57 * Override IOE die indicator if clock number is less than the IOE die clock
58 * start index. Refer as clock number from non-IOE die.
59 */
60 Local0 = 0;
61 }
62
63 CLKM (Local2, Local0, Arg1)
64 }