Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 4 | #include <acpi/acpi_gnvs.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 5 | #include <acpi/acpigen.h> |
Angel Pons | 18edd00 | 2021-01-28 12:22:52 +0100 | [diff] [blame] | 6 | #include <arch/ioapic.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 7 | #include <arch/smp/mpspec.h> |
Angel Pons | 18edd00 | 2021-01-28 12:22:52 +0100 | [diff] [blame] | 8 | #include <device/mmio.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 9 | #include <console/console.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 10 | #include <cpu/intel/turbo.h> |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 11 | #include <cpu/x86/msr.h> |
| 12 | #include <cpu/x86/smm.h> |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 13 | #include <device/pci.h> |
Patrick Rudolph | c7edf18 | 2017-09-26 19:34:35 +0200 | [diff] [blame] | 14 | #include <drivers/intel/gma/opregion.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 15 | #include <soc/acpi.h> |
Kyösti Mälkki | 4bd9187 | 2021-03-16 19:02:26 +0200 | [diff] [blame] | 16 | #include <soc/device_nvs.h> |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 17 | #include <soc/gfx.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 18 | #include <soc/iomap.h> |
| 19 | #include <soc/irq.h> |
| 20 | #include <soc/msr.h> |
Kyösti Mälkki | d6c5714 | 2020-12-21 15:17:01 +0200 | [diff] [blame] | 21 | #include <soc/nvs.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 22 | #include <soc/pattrs.h> |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 23 | #include <soc/pci_devs.h> |
| 24 | #include <soc/pm.h> |
| 25 | #include <string.h> |
| 26 | #include <types.h> |
Felix Durairaj | 15184e0 | 2015-11-23 14:07:40 -0800 | [diff] [blame] | 27 | #include <wrdd.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 28 | |
Angel Pons | 8d5b674 | 2021-09-27 13:04:28 +0200 | [diff] [blame] | 29 | #include "chip.h" |
| 30 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 31 | #define MWAIT_RES(state, sub_state) \ |
| 32 | { \ |
| 33 | .addrl = (((state) << 4) | (sub_state)), \ |
| 34 | .space_id = ACPI_ADDRESS_SPACE_FIXED, \ |
| 35 | .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, \ |
| 36 | .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, \ |
| 37 | .access_size = ACPI_FFIXEDHW_FLAG_HW_COORD, \ |
| 38 | } |
| 39 | |
| 40 | /* C-state map without S0ix */ |
Angel Pons | d2794ce | 2021-10-17 12:59:43 +0200 | [diff] [blame] | 41 | static const acpi_cstate_t cstate_map[] = { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 42 | { |
| 43 | /* C1 */ |
| 44 | .ctype = 1, /* ACPI C1 */ |
| 45 | .latency = 1, |
| 46 | .power = 1000, |
| 47 | .resource = MWAIT_RES(0, 0), |
| 48 | }, |
| 49 | { |
| 50 | /* C6NS with no L2 shrink */ |
| 51 | /* NOTE: this substate is above CPUID limit */ |
| 52 | .ctype = 2, /* ACPI C2 */ |
| 53 | .latency = 500, |
| 54 | .power = 10, |
| 55 | .resource = MWAIT_RES(5, 1), |
| 56 | }, |
| 57 | { |
| 58 | /* C6FS with full L2 shrink */ |
| 59 | .ctype = 3, /* ACPI C3 */ |
| 60 | .latency = 1500, /* 1.5ms worst case */ |
| 61 | .power = 1, |
| 62 | .resource = MWAIT_RES(5, 2), |
| 63 | } |
| 64 | }; |
| 65 | |
Kyösti Mälkki | 4bd9187 | 2021-03-16 19:02:26 +0200 | [diff] [blame] | 66 | size_t size_of_dnvs(void) |
| 67 | { |
| 68 | return sizeof(struct device_nvs); |
| 69 | } |
| 70 | |
Kyösti Mälkki | 999e441 | 2020-06-28 21:56:46 +0300 | [diff] [blame] | 71 | void soc_fill_gnvs(struct global_nvs *gnvs) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 72 | { |
Angel Pons | 8d5b674 | 2021-09-27 13:04:28 +0200 | [diff] [blame] | 73 | const struct soc_intel_braswell_config *config = config_of_soc(); |
| 74 | |
| 75 | gnvs->dpte = config->dptf_enable; |
| 76 | |
Kyösti Mälkki | 46e37c6 | 2020-06-29 02:47:45 +0300 | [diff] [blame] | 77 | /* Fill in the Wi-Fi Region ID */ |
| 78 | if (CONFIG(HAVE_REGULATORY_DOMAIN)) |
| 79 | gnvs->cid1 = wifi_regulatory_domain(); |
| 80 | else |
| 81 | gnvs->cid1 = WRDD_DEFAULT_REGULATORY_DOMAIN; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Kyösti Mälkki | ae1b2d4 | 2023-04-10 16:45:39 +0300 | [diff] [blame] | 84 | static u8 soc_madt_sci_irq_polarity(u8 sci_irq) |
| 85 | { |
| 86 | if (sci_irq >= 20) |
| 87 | return MP_IRQ_POLARITY_LOW; |
| 88 | else |
| 89 | return MP_IRQ_POLARITY_HIGH; |
| 90 | } |
| 91 | |
| 92 | #define ACPI_SCI_IRQ 9 |
| 93 | |
| 94 | void ioapic_get_sci_pin(u8 *gsi, u8 *irq, u8 *flags) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 95 | { |
| 96 | u32 *actl = (u32 *)(ILB_BASE_ADDRESS + ACTL); |
Kyösti Mälkki | ae1b2d4 | 2023-04-10 16:45:39 +0300 | [diff] [blame] | 97 | int sci_irq = ACPI_SCI_IRQ; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 98 | int scis; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 99 | |
| 100 | /* Determine how SCI is routed. */ |
| 101 | scis = read32(actl) & SCIS_MASK; |
| 102 | switch (scis) { |
| 103 | case SCIS_IRQ9: |
| 104 | case SCIS_IRQ10: |
| 105 | case SCIS_IRQ11: |
| 106 | sci_irq = scis - SCIS_IRQ9 + 9; |
| 107 | break; |
| 108 | case SCIS_IRQ20: |
| 109 | case SCIS_IRQ21: |
| 110 | case SCIS_IRQ22: |
| 111 | case SCIS_IRQ23: |
| 112 | sci_irq = scis - SCIS_IRQ20 + 20; |
| 113 | break; |
| 114 | default: |
Kyösti Mälkki | ae1b2d4 | 2023-04-10 16:45:39 +0300 | [diff] [blame] | 115 | printk(BIOS_DEBUG, "Invalid SCI route! Defaulting to IRQ%d.\n", sci_irq); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 116 | break; |
| 117 | } |
| 118 | |
Kyösti Mälkki | ae1b2d4 | 2023-04-10 16:45:39 +0300 | [diff] [blame] | 119 | *gsi = sci_irq; |
| 120 | *irq = (sci_irq < 16) ? sci_irq : ACPI_SCI_IRQ; |
| 121 | *flags = MP_IRQ_TRIGGER_LEVEL | soc_madt_sci_irq_polarity(sci_irq); |
| 122 | |
| 123 | printk(BIOS_DEBUG, "SCI is IRQ %d, GSI %d\n", *irq, *gsi); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 124 | } |
| 125 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 126 | static acpi_tstate_t soc_tss_table[] = { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 127 | { 100, 1000, 0, 0x00, 0 }, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 128 | { 88, 875, 0, 0x1e, 0 }, |
| 129 | { 75, 750, 0, 0x1c, 0 }, |
| 130 | { 63, 625, 0, 0x1a, 0 }, |
| 131 | { 50, 500, 0, 0x18, 0 }, |
| 132 | { 38, 375, 0, 0x16, 0 }, |
| 133 | { 25, 250, 0, 0x14, 0 }, |
| 134 | { 13, 125, 0, 0x12, 0 }, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 135 | }; |
| 136 | |
Lee Leahy | acb9c0b | 2015-07-02 11:55:18 -0700 | [diff] [blame] | 137 | static void generate_t_state_entries(int core, int cores_per_package) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 138 | { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 139 | /* Indicate SW_ALL coordination for T-states */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 140 | acpigen_write_TSD_package(core, cores_per_package, SW_ALL); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 141 | |
| 142 | /* Indicate FFixedHW so OS will use MSR */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 143 | acpigen_write_empty_PTC(); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 144 | |
| 145 | /* Set NVS controlled T-state limit */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 146 | acpigen_write_TPC("\\TLVL"); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 147 | |
| 148 | /* Write TSS table for MSR access */ |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 149 | acpigen_write_TSS_package(ARRAY_SIZE(soc_tss_table), soc_tss_table); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | static int calculate_power(int tdp, int p1_ratio, int ratio) |
| 153 | { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 154 | u32 m, power; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 155 | |
| 156 | /* |
| 157 | * M = ((1.1 - ((p1_ratio - ratio) * 0.00625)) / 1.1) ^ 2 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 158 | */ |
| 159 | |
| 160 | m = (110000 - ((p1_ratio - ratio) * 625)) / 11; |
| 161 | m = (m * m) / 1000; |
| 162 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 163 | /* |
| 164 | * Power = (ratio / p1_ratio) * m * TDP |
| 165 | */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 166 | power = ((ratio * 100000 / p1_ratio) / 100); |
| 167 | power *= (m / 100) * (tdp / 1000); |
| 168 | power /= 1000; |
| 169 | |
| 170 | return (int)power; |
| 171 | } |
| 172 | |
Kyösti Mälkki | d521b96 | 2023-04-12 21:44:49 +0300 | [diff] [blame] | 173 | static void generate_p_state_entries(int core) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 174 | { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 175 | int ratio_min, ratio_max, ratio_turbo, ratio_step, ratio_range_2; |
| 176 | int coord_type, power_max, power_unit, num_entries; |
| 177 | int ratio, power, clock, clock_max; |
| 178 | int vid, vid_turbo, vid_min, vid_max, vid_range_2; |
| 179 | u32 control_status; |
| 180 | const struct pattrs *pattrs = pattrs_get(); |
| 181 | msr_t msr; |
| 182 | |
| 183 | /* Inputs from CPU attributes */ |
| 184 | ratio_max = pattrs->iacore_ratios[IACORE_MAX]; |
| 185 | ratio_min = pattrs->iacore_ratios[IACORE_LFM]; |
| 186 | vid_max = pattrs->iacore_vids[IACORE_MAX]; |
| 187 | vid_min = pattrs->iacore_vids[IACORE_LFM]; |
| 188 | |
| 189 | /* Set P-states coordination type based on MSR disable bit */ |
| 190 | coord_type = (pattrs->num_cpus > 2) ? SW_ALL : HW_ALL; |
| 191 | |
| 192 | /* Max Non-Turbo Frequency */ |
| 193 | clock_max = (ratio_max * pattrs->bclk_khz) / 1000; |
| 194 | |
| 195 | /* Calculate CPU TDP in mW */ |
| 196 | msr = rdmsr(MSR_PKG_POWER_SKU_UNIT); |
| 197 | power_unit = 1 << (msr.lo & 0xf); |
| 198 | msr = rdmsr(MSR_PKG_POWER_LIMIT); |
| 199 | power_max = ((msr.lo & 0x7fff) / power_unit) * 1000; |
| 200 | |
| 201 | /* Write _PCT indicating use of FFixedHW */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 202 | acpigen_write_empty_PCT(); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 203 | |
| 204 | /* Write _PPC with NVS specified limit on supported P-state */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 205 | acpigen_write_PPC_NVS(); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 206 | |
| 207 | /* Write PSD indicating configured coordination type */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 208 | acpigen_write_PSD_package(core, 1, coord_type); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 209 | |
| 210 | /* Add P-state entries in _PSS table */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 211 | acpigen_write_name("_PSS"); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 212 | |
| 213 | /* Determine ratio points */ |
| 214 | ratio_step = 1; |
| 215 | num_entries = (ratio_max - ratio_min) / ratio_step; |
| 216 | while (num_entries > 15) { /* ACPI max is 15 ratios */ |
| 217 | ratio_step <<= 1; |
| 218 | num_entries >>= 1; |
| 219 | } |
| 220 | |
| 221 | /* P[T] is Turbo state if enabled */ |
| 222 | if (get_turbo_state() == TURBO_ENABLED) { |
| 223 | /* _PSS package count including Turbo */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 224 | acpigen_write_package(num_entries + 2); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 225 | |
| 226 | ratio_turbo = pattrs->iacore_ratios[IACORE_TURBO]; |
| 227 | vid_turbo = pattrs->iacore_vids[IACORE_TURBO]; |
| 228 | control_status = (ratio_turbo << 8) | vid_turbo; |
| 229 | |
| 230 | /* Add entry for Turbo ratio */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 231 | acpigen_write_PSS_package( |
| 232 | clock_max + 1, /* MHz */ |
| 233 | power_max, /* mW */ |
| 234 | 10, /* lat1 */ |
| 235 | 10, /* lat2 */ |
| 236 | control_status, /* control */ |
| 237 | control_status); /* status */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 238 | } else { |
| 239 | /* _PSS package count without Turbo */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 240 | acpigen_write_package(num_entries + 1); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 241 | ratio_turbo = ratio_max; |
| 242 | vid_turbo = vid_max; |
| 243 | } |
| 244 | |
| 245 | /* First regular entry is max non-turbo ratio */ |
| 246 | control_status = (ratio_max << 8) | vid_max; |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 247 | acpigen_write_PSS_package( |
| 248 | clock_max, /* MHz */ |
| 249 | power_max, /* mW */ |
| 250 | 10, /* lat1 */ |
| 251 | 10, /* lat2 */ |
| 252 | control_status, /* control */ |
| 253 | control_status); /* status */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 254 | |
| 255 | /* Set up ratio and vid ranges for VID calculation */ |
| 256 | ratio_range_2 = (ratio_turbo - ratio_min) * 2; |
| 257 | vid_range_2 = (vid_turbo - vid_min) * 2; |
| 258 | |
| 259 | /* Generate the remaining entries */ |
| 260 | for (ratio = ratio_min + ((num_entries - 1) * ratio_step); |
| 261 | ratio >= ratio_min; ratio -= ratio_step) { |
| 262 | |
| 263 | /* Calculate VID for this ratio */ |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 264 | vid = ((ratio - ratio_min) * vid_range_2) / ratio_range_2 + vid_min; |
| 265 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 266 | /* Round up if remainder */ |
| 267 | if (((ratio - ratio_min) * vid_range_2) % ratio_range_2) |
| 268 | vid++; |
| 269 | |
| 270 | /* Calculate power at this ratio */ |
| 271 | power = calculate_power(power_max, ratio_max, ratio); |
| 272 | clock = (ratio * pattrs->bclk_khz) / 1000; |
| 273 | control_status = (ratio << 8) | (vid & 0xff); |
| 274 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 275 | acpigen_write_PSS_package( |
| 276 | clock, /* MHz */ |
| 277 | power, /* mW */ |
| 278 | 10, /* lat1 */ |
| 279 | 10, /* lat2 */ |
| 280 | control_status, /* control */ |
| 281 | control_status); /* status */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | /* Fix package length */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 285 | acpigen_pop_len(); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 286 | } |
| 287 | |
Kyösti Mälkki | d521b96 | 2023-04-12 21:44:49 +0300 | [diff] [blame] | 288 | static void generate_cpu_entry(int core, int cores_per_package) |
| 289 | { |
| 290 | /* Generate Scope(\_SB) { Device(CPUx */ |
| 291 | acpigen_write_processor_device(core); |
| 292 | |
| 293 | /* Generate P-state tables */ |
| 294 | generate_p_state_entries(core); |
| 295 | |
| 296 | /* Generate C-state tables */ |
| 297 | acpigen_write_CST_package(cstate_map, ARRAY_SIZE(cstate_map)); |
| 298 | |
| 299 | /* Generate T-state tables */ |
| 300 | generate_t_state_entries(core, cores_per_package); |
| 301 | |
| 302 | acpigen_write_processor_device_end(); |
| 303 | } |
| 304 | |
Furquan Shaikh | 7536a39 | 2020-04-24 21:59:21 -0700 | [diff] [blame] | 305 | void generate_cpu_entries(const struct device *device) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 306 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 307 | int core; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 308 | const struct pattrs *pattrs = pattrs_get(); |
| 309 | |
Kyösti Mälkki | d521b96 | 2023-04-12 21:44:49 +0300 | [diff] [blame] | 310 | for (core = 0; core < pattrs->num_cpus; core++) |
| 311 | generate_cpu_entry(core, pattrs->num_cpus); |
Arthur Heymans | 1a9efe3 | 2018-11-28 12:20:43 +0100 | [diff] [blame] | 312 | |
| 313 | /* PPKG is usually used for thermal management |
| 314 | of the first and only package. */ |
| 315 | acpigen_write_processor_package("PPKG", 0, pattrs->num_cpus); |
| 316 | |
| 317 | /* Add a method to notify processor nodes */ |
| 318 | acpigen_write_processor_cnot(pattrs->num_cpus); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 319 | } |
| 320 | |
Furquan Shaikh | 0f007d8 | 2020-04-24 06:41:18 -0700 | [diff] [blame] | 321 | unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, |
Lee Leahy | 2bc9cee | 2015-06-30 15:25:44 -0700 | [diff] [blame] | 322 | struct acpi_rsdp *rsdp) |
| 323 | { |
| 324 | acpi_header_t *ssdt2; |
| 325 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 326 | if (!CONFIG(DISABLE_HPET)) { |
Frans Hendriks | f2af702 | 2018-11-16 12:08:41 +0100 | [diff] [blame] | 327 | current = acpi_write_hpet(device, current, rsdp); |
| 328 | current = acpi_align_current(current); |
| 329 | } |
Lee Leahy | 2bc9cee | 2015-06-30 15:25:44 -0700 | [diff] [blame] | 330 | |
Lee Leahy | 2bc9cee | 2015-06-30 15:25:44 -0700 | [diff] [blame] | 331 | ssdt2 = (acpi_header_t *)current; |
| 332 | memset(ssdt2, 0, sizeof(acpi_header_t)); |
| 333 | acpi_create_serialio_ssdt(ssdt2); |
| 334 | if (ssdt2->length) { |
| 335 | current += ssdt2->length; |
| 336 | acpi_add_table(rsdp, ssdt2); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 337 | printk(BIOS_DEBUG, "ACPI: * SSDT2 @ %p Length %x\n", ssdt2, ssdt2->length); |
Aaron Durbin | 07a1b28 | 2015-12-10 17:07:38 -0600 | [diff] [blame] | 338 | current = acpi_align_current(current); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 339 | |
Lee Leahy | 2bc9cee | 2015-06-30 15:25:44 -0700 | [diff] [blame] | 340 | } else { |
| 341 | ssdt2 = NULL; |
| 342 | printk(BIOS_DEBUG, "ACPI: * SSDT2 not generated.\n"); |
| 343 | } |
| 344 | |
| 345 | printk(BIOS_DEBUG, "current = %lx\n", current); |
| 346 | |
| 347 | return current; |
| 348 | } |
| 349 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 350 | __weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt) |
Lee Leahy | 2bc9cee | 2015-06-30 15:25:44 -0700 | [diff] [blame] | 351 | { |
| 352 | } |