diff options
Diffstat (limited to 'src')
88 files changed, 20113 insertions, 0 deletions
diff --git a/src/cpu/intel/Kconfig b/src/cpu/intel/Kconfig index c3cf4c9fa3..45071d0c7e 100644 --- a/src/cpu/intel/Kconfig +++ b/src/cpu/intel/Kconfig @@ -16,6 +16,7 @@ source src/cpu/intel/model_f2x/Kconfig source src/cpu/intel/model_f3x/Kconfig source src/cpu/intel/model_f4x/Kconfig source src/cpu/intel/ep80579/Kconfig +source src/cpu/intel/haswell/Kconfig # Sockets/Slots source src/cpu/intel/slot_2/Kconfig source src/cpu/intel/slot_1/Kconfig diff --git a/src/cpu/intel/Makefile.inc b/src/cpu/intel/Makefile.inc index 782c15ab3e..a1733297c1 100644 --- a/src/cpu/intel/Makefile.inc +++ b/src/cpu/intel/Makefile.inc @@ -17,6 +17,7 @@ subdirs-$(CONFIG_CPU_INTEL_SOCKET_PGA370) += socket_PGA370 subdirs-$(CONFIG_CPU_INTEL_SOCKET_RPGA989) += socket_rPGA989 subdirs-$(CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE) += model_206ax subdirs-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += model_206ax +subdirs-$(CONFIG_NORTHBRIDGE_INTEL_HASWELL) += haswell subdirs-$(CONFIG_CPU_INTEL_SLOT_2) += slot_2 subdirs-$(CONFIG_CPU_INTEL_SLOT_1) += slot_1 subdirs-$(CONFIG_CPU_INTEL_SOCKET_LGA771) += socket_LGA771 diff --git a/src/cpu/intel/haswell/Kconfig b/src/cpu/intel/haswell/Kconfig new file mode 100644 index 0000000000..5b24a8bce4 --- /dev/null +++ b/src/cpu/intel/haswell/Kconfig @@ -0,0 +1,33 @@ + +config CPU_INTEL_HASWELL + bool + +if CPU_INTEL_HASWELL + +config CPU_SPECIFIC_OPTIONS + def_bool y + select SMP + select SSE2 + select UDELAY_LAPIC + select SMM_TSEG + select CPU_MICROCODE_IN_CBFS + #select AP_IN_SIPI_WAIT + select TSC_SYNC_MFENCE + +config BOOTBLOCK_CPU_INIT + string + default "cpu/intel/haswell/bootblock.c" + +config SERIAL_CPU_INIT + bool + default n + +config SMM_TSEG_SIZE + hex + default 0x800000 + +config MICROCODE_INCLUDE_PATH + string + default "src/cpu/intel/haswell" + +endif diff --git a/src/cpu/intel/haswell/Makefile.inc b/src/cpu/intel/haswell/Makefile.inc new file mode 100644 index 0000000000..467c948430 --- /dev/null +++ b/src/cpu/intel/haswell/Makefile.inc @@ -0,0 +1,10 @@ +ramstage-y += haswell_init.c +subdirs-y += ../../x86/name + +ramstage-$(CONFIG_GENERATE_ACPI_TABLES) += acpi.c + +cpu_microcode-$(CONFIG_CPU_MICROCODE_CBFS_GENERATE) += microcode_blob.c + +smm-$(CONFIG_HAVE_SMI_HANDLER) += finalize.c + +cpu_incs += $(src)/cpu/intel/haswell/cache_as_ram.inc diff --git a/src/cpu/intel/haswell/acpi.c b/src/cpu/intel/haswell/acpi.c new file mode 100644 index 0000000000..c0df9f6f37 --- /dev/null +++ b/src/cpu/intel/haswell/acpi.c @@ -0,0 +1,364 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009 coresystems GmbH + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <types.h> +#include <console/console.h> +#include <arch/acpi.h> +#include <arch/acpigen.h> +#include <arch/cpu.h> +#include <cpu/x86/msr.h> +#include <cpu/intel/speedstep.h> +#include <cpu/intel/turbo.h> +#include <device/device.h> +#include <device/pci.h> +#include "haswell.h" +#include "chip.h" + +static int get_cores_per_package(void) +{ + struct cpuinfo_x86 c; + struct cpuid_result result; + int cores = 1; + + get_fms(&c, cpuid_eax(1)); + if (c.x86 != 6) + return 1; + + result = cpuid_ext(0xb, 1); + cores = result.ebx & 0xff; + + return cores; +} + +static int generate_cstate_entries(acpi_cstate_t *cstates, + int c1, int c2, int c3) +{ + int length, cstate_count = 0; + + /* Count number of active C-states */ + if (c1 > 0) + ++cstate_count; + if (c2 > 0) + ++cstate_count; + if (c3 > 0) + ++cstate_count; + if (!cstate_count) + return 0; + + length = acpigen_write_package(cstate_count + 1); + length += acpigen_write_byte(cstate_count); + + /* Add an entry if the level is enabled */ + if (c1 > 0) { + cstates[c1].ctype = 1; + length += acpigen_write_CST_package_entry(&cstates[c1]); + } + if (c2 > 0) { + cstates[c2].ctype = 2; + length += acpigen_write_CST_package_entry(&cstates[c2]); + } + if (c3 > 0) { + cstates[c3].ctype = 3; + length += acpigen_write_CST_package_entry(&cstates[c3]); + } + + acpigen_patch_len(length - 1); + return length; +} + +static int generate_C_state_entries(void) +{ + struct cpu_info *info; + struct cpu_driver *cpu; + int len, lenif; + device_t lapic; + struct cpu_intel_haswell_config *conf = NULL; + + /* Find the SpeedStep CPU in the device tree using magic APIC ID */ + lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC); + if (!lapic) + return 0; + conf = lapic->chip_info; + if (!conf) + return 0; + + /* Find CPU map of supported C-states */ + info = cpu_info(); + if (!info) + return 0; + cpu = find_cpu_driver(info->cpu); + if (!cpu || !cpu->cstates) + return 0; + + len = acpigen_emit_byte(0x14); /* MethodOp */ + len += acpigen_write_len_f(); /* PkgLength */ + len += acpigen_emit_namestring("_CST"); + len += acpigen_emit_byte(0x00); /* No Arguments */ + + /* If running on AC power */ + len += acpigen_emit_byte(0xa0); /* IfOp */ + lenif = acpigen_write_len_f(); /* PkgLength */ + lenif += acpigen_emit_namestring("PWRS"); + lenif += acpigen_emit_byte(0xa4); /* ReturnOp */ + lenif += generate_cstate_entries(cpu->cstates, conf->c1_acpower, + conf->c2_acpower, conf->c3_acpower); + acpigen_patch_len(lenif - 1); + len += lenif; + + /* Else on battery power */ + len += acpigen_emit_byte(0xa4); /* ReturnOp */ + len += generate_cstate_entries(cpu->cstates, conf->c1_battery, + conf->c2_battery, conf->c3_battery); + acpigen_patch_len(len - 1); + return len; +} + +static acpi_tstate_t tss_table_fine[] = { + { 100, 1000, 0, 0x00, 0 }, + { 94, 940, 0, 0x1f, 0 }, + { 88, 880, 0, 0x1e, 0 }, + { 82, 820, 0, 0x1d, 0 }, + { 75, 760, 0, 0x1c, 0 }, + { 69, 700, 0, 0x1b, 0 }, + { 63, 640, 0, 0x1a, 0 }, + { 57, 580, 0, 0x19, 0 }, + { 50, 520, 0, 0x18, 0 }, + { 44, 460, 0, 0x17, 0 }, + { 38, 400, 0, 0x16, 0 }, + { 32, 340, 0, 0x15, 0 }, + { 25, 280, 0, 0x14, 0 }, + { 19, 220, 0, 0x13, 0 }, + { 13, 160, 0, 0x12, 0 }, +}; + +static acpi_tstate_t tss_table_coarse[] = { + { 100, 1000, 0, 0x00, 0 }, + { 88, 875, 0, 0x1f, 0 }, + { 75, 750, 0, 0x1e, 0 }, + { 63, 625, 0, 0x1d, 0 }, + { 50, 500, 0, 0x1c, 0 }, + { 38, 375, 0, 0x1b, 0 }, + { 25, 250, 0, 0x1a, 0 }, + { 13, 125, 0, 0x19, 0 }, +}; + +static int generate_T_state_entries(int core, int cores_per_package) +{ + int len; + + /* Indicate SW_ALL coordination for T-states */ + len = acpigen_write_TSD_package(core, cores_per_package, SW_ALL); + + /* Indicate FFixedHW so OS will use MSR */ + len += acpigen_write_empty_PTC(); + + /* Set a T-state limit that can be modified in NVS */ + len += acpigen_write_TPC("\\TLVL"); + + /* + * CPUID.(EAX=6):EAX[5] indicates support + * for extended throttle levels. + */ + if (cpuid_eax(6) & (1 << 5)) + len += acpigen_write_TSS_package( + ARRAY_SIZE(tss_table_fine), tss_table_fine); + else + len += acpigen_write_TSS_package( + ARRAY_SIZE(tss_table_coarse), tss_table_coarse); + + return len; +} + +static int calculate_power(int tdp, int p1_ratio, int ratio) +{ + u32 m; + u32 power; + + /* + * M = ((1.1 - ((p1_ratio - ratio) * 0.00625)) / 1.1) ^ 2 + * + * Power = (ratio / p1_ratio) * m * tdp + */ + + m = (110000 - ((p1_ratio - ratio) * 625)) / 11; + m = (m * m) / 1000; + + power = ((ratio * 100000 / p1_ratio) / 100); + power *= (m / 100) * (tdp / 1000); + power /= 1000; + + return (int)power; +} + +static int generate_P_state_entries(int core, int cores_per_package) +{ + int len, len_pss; + int ratio_min, ratio_max, ratio_turbo, ratio_step; + int coord_type, power_max, power_unit, num_entries; + int ratio, power, clock, clock_max; + msr_t msr; + + /* Determine P-state coordination type from MISC_PWR_MGMT[0] */ + msr = rdmsr(MSR_MISC_PWR_MGMT); + if (msr.lo & MISC_PWR_MGMT_EIST_HW_DIS) + coord_type = SW_ANY; + else + coord_type = HW_ALL; + + /* Get bus ratio limits and calculate clock speeds */ + msr = rdmsr(MSR_PLATFORM_INFO); + ratio_min = (msr.hi >> (40-32)) & 0xff; /* Max Efficiency Ratio */ + + /* Determine if this CPU has configurable TDP */ + if (cpu_config_tdp_levels()) { + /* Set max ratio to nominal TDP ratio */ + msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); + ratio_max = msr.lo & 0xff; + } else { + /* Max Non-Turbo Ratio */ + ratio_max = (msr.lo >> 8) & 0xff; + } + clock_max = ratio_max * HASWELL_BCLK; + + /* Calculate CPU TDP in mW */ + msr = rdmsr(MSR_PKG_POWER_SKU_UNIT); + power_unit = 2 << ((msr.lo & 0xf) - 1); + msr = rdmsr(MSR_PKG_POWER_SKU); + power_max = ((msr.lo & 0x7fff) / power_unit) * 1000; + + /* Write _PCT indicating use of FFixedHW */ + len = acpigen_write_empty_PCT(); + + /* Write _PPC with no limit on supported P-state */ + len += acpigen_write_PPC_NVS(); + + /* Write PSD indicating configured coordination type */ + len += acpigen_write_PSD_package(core, cores_per_package, coord_type); + + /* Add P-state entries in _PSS table */ + len += acpigen_write_name("_PSS"); + + /* Determine ratio points */ + ratio_step = PSS_RATIO_STEP; + num_entries = (ratio_max - ratio_min) / ratio_step; + while (num_entries > PSS_MAX_ENTRIES-1) { + ratio_step <<= 1; + num_entries >>= 1; + } + + /* P[T] is Turbo state if enabled */ + if (get_turbo_state() == TURBO_ENABLED) { + /* _PSS package count including Turbo */ + len_pss = acpigen_write_package(num_entries + 2); + + msr = rdmsr(MSR_TURBO_RATIO_LIMIT); + ratio_turbo = msr.lo & 0xff; + + /* Add entry for Turbo ratio */ + len_pss += acpigen_write_PSS_package( + clock_max + 1, /*MHz*/ + power_max, /*mW*/ + PSS_LATENCY_TRANSITION, /*lat1*/ + PSS_LATENCY_BUSMASTER, /*lat2*/ + ratio_turbo << 8, /*control*/ + ratio_turbo << 8); /*status*/ + } else { + /* _PSS package count without Turbo */ + len_pss = acpigen_write_package(num_entries + 1); + } + + /* First regular entry is max non-turbo ratio */ + len_pss += acpigen_write_PSS_package( + clock_max, /*MHz*/ + power_max, /*mW*/ + PSS_LATENCY_TRANSITION, /*lat1*/ + PSS_LATENCY_BUSMASTER, /*lat2*/ + ratio_max << 8, /*control*/ + ratio_max << 8); /*status*/ + + /* Generate the remaining entries */ + for (ratio = ratio_min + ((num_entries - 1) * ratio_step); + ratio >= ratio_min; ratio -= ratio_step) { + + /* Calculate power at this ratio */ + power = calculate_power(power_max, ratio_max, ratio); + clock = ratio * HASWELL_BCLK; + + len_pss += acpigen_write_PSS_package( + clock, /*MHz*/ + power, /*mW*/ + PSS_LATENCY_TRANSITION, /*lat1*/ + PSS_LATENCY_BUSMASTER, /*lat2*/ + ratio << 8, /*control*/ + ratio << 8); /*status*/ + } + + /* Fix package length */ + len_pss--; + acpigen_patch_len(len_pss); + + return len + len_pss; +} + +void generate_cpu_entries(void) +{ + int len_pr; + int coreID, cpuID, pcontrol_blk = PMB0_BASE, plen = 6; + int totalcores = dev_count_cpu(); + int cores_per_package = get_cores_per_package(); + int numcpus = totalcores/cores_per_package; + + printk(BIOS_DEBUG, "Found %d CPU(s) with %d core(s) each.\n", + numcpus, cores_per_package); + + for (cpuID=1; cpuID <=numcpus; cpuID++) { + for (coreID=1; coreID<=cores_per_package; coreID++) { + if (coreID>1) { + pcontrol_blk = 0; + plen = 0; + } + + /* Generate processor \_PR.CPUx */ + len_pr = acpigen_write_processor( + (cpuID-1)*cores_per_package+coreID-1, + pcontrol_blk, plen); + + /* Generate P-state tables */ + len_pr += generate_P_state_entries( + cpuID-1, cores_per_package); + + /* Generate C-state tables */ + len_pr += generate_C_state_entries(); + + /* Generate T-state tables */ + len_pr += generate_T_state_entries( + cpuID-1, cores_per_package); + + len_pr--; + acpigen_patch_len(len_pr); + } + } +} + +struct chip_operations cpu_intel_haswell_ops = { + CHIP_NAME("Intel Haswell CPU") +}; diff --git a/src/cpu/intel/haswell/acpi/cpu.asl b/src/cpu/intel/haswell/acpi/cpu.asl new file mode 100644 index 0000000000..558a9d3663 --- /dev/null +++ b/src/cpu/intel/haswell/acpi/cpu.asl @@ -0,0 +1,102 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* These devices are created at runtime */ +External (\_PR.CPU0, DeviceObj) +External (\_PR.CPU1, DeviceObj) +External (\_PR.CPU2, DeviceObj) +External (\_PR.CPU3, DeviceObj) +External (\_PR.CPU4, DeviceObj) +External (\_PR.CPU5, DeviceObj) +External (\_PR.CPU6, DeviceObj) +External (\_PR.CPU7, DeviceObj) + +/* Notify OS to re-read CPU tables, assuming ^2 CPU count */ +Method (PNOT) +{ + If (LGreaterEqual (\PCNT, 2)) { + Notify (\_PR.CPU0, 0x81) // _CST + Notify (\_PR.CPU1, 0x81) // _CST + } + If (LGreaterEqual (\PCNT, 4)) { + Notify (\_PR.CPU2, 0x81) // _CST + Notify (\_PR.CPU3, 0x81) // _CST + } + If (LGreaterEqual (\PCNT, 8)) { + Notify (\_PR.CPU4, 0x81) // _CST + Notify (\_PR.CPU5, 0x81) // _CST + Notify (\_PR.CPU6, 0x81) // _CST + Notify (\_PR.CPU7, 0x81) // _CST + } +} + +/* Notify OS to re-read CPU _PPC limit, assuming ^2 CPU count */ +Method (PPCN) +{ + If (LGreaterEqual (\PCNT, 2)) { + Notify (\_PR.CPU0, 0x80) // _PPC + Notify (\_PR.CPU1, 0x80) // _PPC + } + If (LGreaterEqual (\PCNT, 4)) { + Notify (\_PR.CPU2, 0x80) // _PPC + Notify (\_PR.CPU3, 0x80) // _PPC + } + If (LGreaterEqual (\PCNT, 8)) { + Notify (\_PR.CPU4, 0x80) // _PPC + Notify (\_PR.CPU5, 0x80) // _PPC + Notify (\_PR.CPU6, 0x80) // _PPC + Notify (\_PR.CPU7, 0x80) // _PPC + } +} + +/* Notify OS to re-read Throttle Limit tables, assuming ^2 CPU count */ +Method (TNOT) +{ + If (LGreaterEqual (\PCNT, 2)) { + Notify (\_PR.CPU0, 0x82) // _TPC + Notify (\_PR.CPU1, 0x82) // _TPC + } + If (LGreaterEqual (\PCNT, 4)) { + Notify (\_PR.CPU2, 0x82) // _TPC + Notify (\_PR.CPU3, 0x82) // _TPC + } + If (LGreaterEqual (\PCNT, 8)) { + Notify (\_PR.CPU4, 0x82) // _TPC + Notify (\_PR.CPU5, 0x82) // _TPC + Notify (\_PR.CPU6, 0x82) // _TPC + Notify (\_PR.CPU7, 0x82) // _TPC + } +} + +/* Return a package containing enabled processor entries */ +Method (PPKG) +{ + If (LGreaterEqual (\PCNT, 8)) { + Return (Package() {\_PR.CPU0, \_PR.CPU1, \_PR.CPU2, \_PR.CPU3, + \_PR.CPU4, \_PR.CPU5, \_PR.CPU6, \_PR.CPU7}) + } ElseIf (LGreaterEqual (\PCNT, 4)) { + Return (Package() {\_PR.CPU0, \_PR.CPU1, \_PR.CPU2, \_PR.CPU3}) + } ElseIf (LGreaterEqual (\PCNT, 2)) { + Return (Package() {\_PR.CPU0, \_PR.CPU1}) + } Else { + Return (Package() {\_PR.CPU0}) + } +} diff --git a/src/cpu/intel/haswell/bootblock.c b/src/cpu/intel/haswell/bootblock.c new file mode 100644 index 0000000000..f9c3ba8d6f --- /dev/null +++ b/src/cpu/intel/haswell/bootblock.c @@ -0,0 +1,122 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> +#include <arch/cpu.h> +#include <cpu/x86/cache.h> +#include <cpu/x86/msr.h> +#include <cpu/x86/mtrr.h> +#include <arch/io.h> +#include <arch/romcc_io.h> + +#include <cpu/intel/microcode/microcode.c> +#include "haswell.h" + +#if CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT +/* Needed for RCBA access to set Soft Reset Data register */ +#include <southbridge/intel/lynxpoint/pch.h> +#else +#error "CPU must be paired with Intel LynxPoint southbridge" +#endif + +static void set_var_mtrr( + unsigned reg, unsigned base, unsigned size, unsigned type) + +{ + /* Bit Bit 32-35 of MTRRphysMask should be set to 1 */ + /* FIXME: It only support 4G less range */ + msr_t basem, maskm; + basem.lo = base | type; + basem.hi = 0; + wrmsr(MTRRphysBase_MSR(reg), basem); + maskm.lo = ~(size - 1) | MTRRphysMaskValid; + maskm.hi = (1 << (CONFIG_CPU_ADDR_BITS - 32)) - 1; + wrmsr(MTRRphysMask_MSR(reg), maskm); +} + +static void enable_rom_caching(void) +{ + msr_t msr; + + disable_cache(); + /* Why only top 4MiB ? */ + set_var_mtrr(1, 0xffc00000, 4*1024*1024, MTRR_TYPE_WRPROT); + enable_cache(); + + /* Enable Variable MTRRs */ + msr.hi = 0x00000000; + msr.lo = 0x00000800; + wrmsr(MTRRdefType_MSR, msr); +} + +static void set_flex_ratio_to_tdp_nominal(void) +{ + msr_t flex_ratio, msr; + u32 soft_reset; + u8 nominal_ratio; + + /* Check for Flex Ratio support */ + flex_ratio = rdmsr(MSR_FLEX_RATIO); + if (!(flex_ratio.lo & FLEX_RATIO_EN)) + return; + + /* Check for >0 configurable TDPs */ + msr = rdmsr(MSR_PLATFORM_INFO); + if (((msr.hi >> 1) & 3) == 0) + return; + + /* Use nominal TDP ratio for flex ratio */ + msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); + nominal_ratio = msr.lo & 0xff; + + /* See if flex ratio is already set to nominal TDP ratio */ + if (((flex_ratio.lo >> 8) & 0xff) == nominal_ratio) + return; + + /* Set flex ratio to nominal TDP ratio */ + flex_ratio.lo &= ~0xff00; + flex_ratio.lo |= nominal_ratio << 8; + flex_ratio.lo |= FLEX_RATIO_LOCK; + wrmsr(MSR_FLEX_RATIO, flex_ratio); + + /* Set flex ratio in soft reset data register bits 11:6. + * RCBA region is enabled in southbridge bootblock */ + soft_reset = RCBA32(SOFT_RESET_DATA); + soft_reset &= ~(0x3f << 6); + soft_reset |= (nominal_ratio & 0x3f) << 6; + RCBA32(SOFT_RESET_DATA) = soft_reset; + + /* Set soft reset control to use register value */ + RCBA32_OR(SOFT_RESET_CTRL, 1); + + /* Issue warm reset, will be "CPU only" due to soft reset data */ + outb(0x0, 0xcf9); + outb(0x6, 0xcf9); + while (1) { + asm("hlt"); + } +} + +static void bootblock_cpu_init(void) +{ + /* Set flex ratio and reset if needed */ + set_flex_ratio_to_tdp_nominal(); + enable_rom_caching(); + intel_update_microcode_from_cbfs(); +} diff --git a/src/cpu/intel/haswell/cache_as_ram.inc b/src/cpu/intel/haswell/cache_as_ram.inc new file mode 100644 index 0000000000..f5ee82e2d2 --- /dev/null +++ b/src/cpu/intel/haswell/cache_as_ram.inc @@ -0,0 +1,349 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2000,2007 Ronald G. Minnich <rminnich@gmail.com> + * Copyright (C) 2007-2008 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <cpu/x86/stack.h> +#include <cpu/x86/mtrr.h> +#include <cpu/x86/cache.h> +#include <cpu/x86/post_code.h> +#include <cbmem.h> + +#define CACHE_AS_RAM_SIZE CONFIG_DCACHE_RAM_SIZE +#define CACHE_AS_RAM_BASE CONFIG_DCACHE_RAM_BASE + +/* Cache 4GB - MRC_SIZE_KB for MRC */ +#define CACHE_MRC_BYTES ((CONFIG_CACHE_MRC_SIZE_KB << 10) - 1) +#define CACHE_MRC_BASE (0xFFFFFFFF - CACHE_MRC_BYTES) +#define CACHE_MRC_MASK (~CACHE_MRC_BYTES) + +#define CPU_MAXPHYSADDR CONFIG_CPU_ADDR_BITS +#define CPU_PHYSMASK_HI (1 << (CPU_MAXPHYSADDR - 32) - 1) + +#define NoEvictMod_MSR 0x2e0 + + /* Save the BIST result. */ + movl %eax, %ebp + +cache_as_ram: + post_code(0x20) + + /* Send INIT IPI to all excluding ourself. */ + movl $0x000C4500, %eax + movl $0xFEE00300, %esi + movl %eax, (%esi) + + /* All CPUs need to be in Wait for SIPI state */ +wait_for_sipi: + movl (%esi), %eax + bt $12, %eax + jc wait_for_sipi + + post_code(0x21) + /* Zero out all fixed range and variable range MTRRs. */ + movl $mtrr_table, %esi + movl $((mtrr_table_end - mtrr_table) / 2), %edi + xorl %eax, %eax + xorl %edx, %edx +clear_mtrrs: + movw (%esi), %bx + movzx %bx, %ecx + wrmsr + add $2, %esi + dec %edi + jnz clear_mtrrs + + post_code(0x22) + /* Configure the default memory type to uncacheable. */ + movl $MTRRdefType_MSR, %ecx + rdmsr + andl $(~0x00000cff), %eax + wrmsr + + post_code(0x23) + /* Set Cache-as-RAM base address. */ + movl $(MTRRphysBase_MSR(0)), %ecx + movl $(CACHE_AS_RAM_BASE | MTRR_TYPE_WRBACK), %eax + xorl %edx, %edx + wrmsr + + post_code(0x24) + /* Set Cache-as-RAM mask. */ + movl $(MTRRphysMask_MSR(0)), %ecx + movl $(~(CACHE_AS_RAM_SIZE - 1) | MTRRphysMaskValid), %eax + movl $CPU_PHYSMASK_HI, %edx + wrmsr + + post_code(0x25) + + /* Enable MTRR. */ + movl $MTRRdefType_MSR, %ecx + rdmsr + orl $MTRRdefTypeEn, %eax + wrmsr + + /* Enable cache (CR0.CD = 0, CR0.NW = 0). */ + movl %cr0, %eax + andl $(~(CR0_CacheDisable | CR0_NoWriteThrough)), %eax + invd + movl %eax, %cr0 + + /* enable the 'no eviction' mode */ + movl $NoEvictMod_MSR, %ecx + rdmsr + orl $1, %eax + andl $~2, %eax + wrmsr + + /* Clear the cache memory region. This will also fill up the cache */ + movl $CACHE_AS_RAM_BASE, %esi + movl %esi, %edi + movl $(CACHE_AS_RAM_SIZE / 4), %ecx + // movl $0x23322332, %eax + xorl %eax, %eax + rep stosl + + /* enable the 'no eviction run' state */ + movl $NoEvictMod_MSR, %ecx + rdmsr + orl $3, %eax + wrmsr + + post_code(0x26) + /* Enable Cache-as-RAM mode by disabling cache. */ + movl %cr0, %eax + orl $CR0_CacheDisable, %eax + movl %eax, %cr0 + + /* Enable cache for our code in Flash because we do XIP here */ + movl $MTRRphysBase_MSR(1), %ecx + xorl %edx, %edx + /* + * IMPORTANT: The following calculation _must_ be done at runtime. See + * http://www.coreboot.org/pipermail/coreboot/2010-October/060855.html + */ + movl $copy_and_run, %eax + andl $(~(CONFIG_XIP_ROM_SIZE - 1)), %eax + orl $MTRR_TYPE_WRPROT, %eax + wrmsr + + movl $MTRRphysMask_MSR(1), %ecx + movl $CPU_PHYSMASK_HI, %edx + movl $(~(CONFIG_XIP_ROM_SIZE - 1) | MTRRphysMaskValid), %eax + wrmsr + + post_code(0x27) +#if CONFIG_CACHE_MRC_BIN + /* Enable caching for ram init code to run faster */ + movl $MTRRphysBase_MSR(2), %ecx + movl $(CACHE_MRC_BASE | MTRR_TYPE_WRPROT), %eax + xorl %edx, %edx + wrmsr + movl $MTRRphysMask_MSR(2), %ecx + movl $(CACHE_MRC_MASK | MTRRphysMaskValid), %eax + movl $CPU_PHYSMASK_HI, %edx + wrmsr +#endif + + post_code(0x28) + /* Enable cache. */ + movl %cr0, %eax + andl $(~(CR0_CacheDisable | CR0_NoWriteThrough)), %eax + movl %eax, %cr0 + + /* Set up the stack pointer below MRC variable space. */ + movl $(CACHE_AS_RAM_SIZE + CACHE_AS_RAM_BASE - \ + CONFIG_DCACHE_RAM_MRC_VAR_SIZE - 4), %eax + movl %eax, %esp + + /* Restore the BIST result. */ + movl %ebp, %eax + movl %esp, %ebp + pushl %eax + +before_romstage: + post_code(0x29) + /* Call romstage.c main function. */ + call main + + post_code(0x2f) + + /* Copy global variable space (for USBDEBUG) to memory */ +#if CONFIG_USBDEBUG + cld + movl $(CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - 24), %esi + movl $(CONFIG_RAMTOP - 24), %edi + movl $24, %ecx + rep movsb +#endif + + post_code(0x30) + + /* Disable cache. */ + movl %cr0, %eax + orl $CR0_CacheDisable, %eax + movl %eax, %cr0 + + post_code(0x31) + + /* Disable MTRR. */ + movl $MTRRdefType_MSR, %ecx + rdmsr + andl $(~MTRRdefTypeEn), %eax + wrmsr + + post_code(0x31) + + /* Disable the no eviction run state */ + movl $NoEvictMod_MSR, %ecx + rdmsr + andl $~2, %eax + wrmsr + + invd + + /* Disable the no eviction mode */ + rdmsr + andl $~1, %eax + wrmsr + +#if CONFIG_CACHE_MRC_BIN + /* Clear MTRR that was used to cache MRC */ + xorl %eax, %eax + xorl %edx, %edx + movl $MTRRphysBase_MSR(2), %ecx + wrmsr + movl $MTRRphysMask_MSR(2), %ecx + wrmsr +#endif + + post_code(0x33) + + /* Enable cache. */ + movl %cr0, %eax + andl $~(CR0_CacheDisable | CR0_NoWriteThrough), %eax + movl %eax, %cr0 + + post_code(0x36) + + /* Disable cache. */ + movl %cr0, %eax + orl $CR0_CacheDisable, %eax + movl %eax, %cr0 + + post_code(0x38) + + /* Enable Write Back and Speculative Reads for the first MB + * and coreboot_ram. + */ + movl $MTRRphysBase_MSR(0), %ecx + movl $(0x00000000 | MTRR_TYPE_WRBACK), %eax + xorl %edx, %edx + wrmsr + movl $MTRRphysMask_MSR(0), %ecx + movl $(~(CONFIG_RAMTOP - 1) | MTRRphysMaskValid), %eax + movl $CPU_PHYSMASK_HI, %edx // 36bit address space + wrmsr + + /* Enable Caching and speculative Reads for the + * complete ROM now that we actually have RAM. + */ + movl $MTRRphysBase_MSR(1), %ecx + movl $(0xffc00000 | MTRR_TYPE_WRPROT), %eax + xorl %edx, %edx + wrmsr + movl $MTRRphysMask_MSR(1), %ecx + movl $(~(4*1024*1024 - 1) | MTRRphysMaskValid), %eax + movl $CPU_PHYSMASK_HI, %edx + wrmsr + + post_code(0x39) + + /* And enable cache again after setting MTRRs. */ + movl %cr0, %eax + andl $~(CR0_CacheDisable | CR0_NoWriteThrough), %eax + movl %eax, %cr0 + + post_code(0x3a) + + /* Enable MTRR. */ + movl $MTRRdefType_MSR, %ecx + rdmsr + orl $MTRRdefTypeEn, %eax + wrmsr + + post_code(0x3b) + + /* Invalidate the cache again. */ + invd + + post_code(0x3c) + +#if CONFIG_HAVE_ACPI_RESUME + movl CBMEM_BOOT_MODE, %eax + cmpl $0x2, %eax // Resume? + jne __acpi_resume_backup_done + + /* copy 1MB - 64K to high tables ram_base to prevent memory corruption + * through stage 2. We could keep stuff like stack and heap in high + * tables memory completely, but that's a wonderful clean up task for + * another day. + */ + cld + movl $CONFIG_RAMBASE, %esi + movl CBMEM_RESUME_BACKUP, %edi + movl $HIGH_MEMORY_SAVE / 4, %ecx + rep movsl + +__acpi_resume_backup_done: +#endif + + post_code(0x3d) + + /* Clear boot_complete flag. */ + xorl %ebp, %ebp +__main: + post_code(POST_PREPARE_RAMSTAGE) + cld /* Clear direction flag. */ + + movl %ebp, %esi + + movl $ROMSTAGE_STACK, %esp + movl %esp, %ebp + pushl %esi + call copy_and_run + +.Lhlt: + post_code(POST_DEAD_CODE) + hlt + jmp .Lhlt + +mtrr_table: + /* Fixed MTRRs */ + .word 0x250, 0x258, 0x259 + .word 0x268, 0x269, 0x26A + .word 0x26B, 0x26C, 0x26D + .word 0x26E, 0x26F + /* Variable MTRRs */ + .word 0x200, 0x201, 0x202, 0x203 + .word 0x204, 0x205, 0x206, 0x207 + .word 0x208, 0x209, 0x20A, 0x20B + .word 0x20C, 0x20D, 0x20E, 0x20F + .word 0x210, 0x211, 0x212, 0x213 +mtrr_table_end: + diff --git a/src/cpu/intel/haswell/chip.h b/src/cpu/intel/haswell/chip.h new file mode 100644 index 0000000000..52020437f9 --- /dev/null +++ b/src/cpu/intel/haswell/chip.h @@ -0,0 +1,39 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +extern struct chip_operations cpu_intel_haswell_ops; + +/* Magic value used to locate this chip in the device tree */ +#define SPEEDSTEP_APIC_MAGIC 0xACAC + +struct cpu_intel_haswell_config { + u8 disable_acpi; /* Do not generate CPU ACPI tables */ + + u8 pstate_coord_type; /* Processor Coordination Type */ + + int c1_battery; /* ACPI C1 on Battery Power */ + int c2_battery; /* ACPI C2 on Battery Power */ + int c3_battery; /* ACPI C3 on Battery Power */ + + int c1_acpower; /* ACPI C1 on AC Power */ + int c2_acpower; /* ACPI C2 on AC Power */ + int c3_acpower; /* ACPI C3 on AC Power */ + + int tcc_offset; /* TCC Activation Offset */ +}; diff --git a/src/cpu/intel/haswell/finalize.c b/src/cpu/intel/haswell/finalize.c new file mode 100644 index 0000000000..1731322d83 --- /dev/null +++ b/src/cpu/intel/haswell/finalize.c @@ -0,0 +1,76 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> +#include <stdlib.h> +#include <cpu/cpu.h> +#include <cpu/x86/msr.h> +#include "haswell.h" + +#if 0 +static void msr_set_bit(unsigned reg, unsigned bit) +{ + msr_t msr = rdmsr(reg); + + if (bit < 32) { + if (msr.lo & (1 << bit)) + return; + msr.lo |= 1 << bit; + } else { + if (msr.hi & (1 << (bit - 32))) + return; + msr.hi |= 1 << (bit - 32); + } + + wrmsr(reg, msr); +} +#endif + +void intel_cpu_haswell_finalize_smm(void) +{ +#if 0 + msr_set_bit(MSR_PMG_CST_CONFIG_CONTROL, 15); + + /* Lock AES-NI only if supported */ + if (cpuid_ecx(1) & (1 << 25)) + msr_set_bit(MSR_FEATURE_CONFIG, 0); + +#ifdef LOCK_POWER_CONTROL_REGISTERS + /* + * Lock the power control registers. + * + * These registers can be left unlocked if modifying power + * limits from the OS is desirable. Modifying power limits + * from the OS can be especially useful for experimentation + * during early phases of system bringup while the thermal + * power envelope is being proven. + */ + + msr_set_bit(MSR_PP0_CURRENT_CONFIG, 31); + msr_set_bit(MSR_PP1_CURRENT_CONFIG, 31); + msr_set_bit(MSR_PKG_POWER_LIMIT, 63); + msr_set_bit(MSR_PP0_POWER_LIMIT, 31); + msr_set_bit(MSR_PP1_POWER_LIMIT, 31); +#endif + + msr_set_bit(MSR_MISC_PWR_MGMT, 22); + msr_set_bit(MSR_LT_LOCK_MEMORY, 0); +#endif +} diff --git a/src/cpu/intel/haswell/haswell.h b/src/cpu/intel/haswell/haswell.h new file mode 100644 index 0000000000..f5c580ec7e --- /dev/null +++ b/src/cpu/intel/haswell/haswell.h @@ -0,0 +1,113 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _CPU_INTEL_HASWELL_H +#define _CPU_INTEL_HASWELL_H + +/* Haswell bus clock is fixed at 100MHz */ +#define HASWELL_BCLK 100 + +#define IA32_FEATURE_CONTROL 0x3a +#define CPUID_VMX (1 << 5) +#define CPUID_SMX (1 << 6) +#define MSR_FEATURE_CONFIG 0x13c +#define MSR_FLEX_RATIO 0x194 +#define FLEX_RATIO_LOCK (1 << 20) +#define FLEX_RATIO_EN (1 << 16) +#define IA32_PLATFORM_DCA_CAP 0x1f8 +#define IA32_MISC_ENABLE 0x1a0 +#define MSR_TEMPERATURE_TARGET 0x1a2 +#define IA32_PERF_CTL 0x199 +#define IA32_THERM_INTERRUPT 0x19b +#define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0 +#define ENERGY_POLICY_PERFORMANCE 0 +#define ENERGY_POLICY_NORMAL 6 +#define ENERGY_POLICY_POWERSAVE 15 +#define IA32_PACKAGE_THERM_INTERRUPT 0x1b2 +#define MSR_LT_LOCK_MEMORY 0x2e7 +#define IA32_MC0_STATUS 0x401 + +#define MSR_PIC_MSG_CONTROL 0x2e +#define MSR_PLATFORM_INFO 0xce +#define PLATFORM_INFO_SET_TDP (1 << 29) +#define MSR_PMG_CST_CONFIG_CONTROL 0xe2 +#define MSR_PMG_IO_CAPTURE_BASE 0xe4 + +#define MSR_MISC_PWR_MGMT 0x1aa +#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0) +#define MSR_TURBO_RATIO_LIMIT 0x1ad +#define MSR_POWER_CTL 0x1fc + +#define MSR_PKGC3_IRTL 0x60a +#define MSR_PKGC6_IRTL 0x60b +#define MSR_PKGC7_IRTL 0x60c +#define IRTL_VALID (1 << 15) +#define IRTL_1_NS (0 << 10) +#define IRTL_32_NS (1 << 10) +#define IRTL_1024_NS (2 << 10) +#define IRTL_32768_NS (3 << 10) +#define IRTL_1048576_NS (4 << 10) +#define IRTL_33554432_NS (5 << 10) +#define IRTL_RESPONSE_MASK (0x3ff) + +/* long duration in low dword, short duration in high dword */ +#define MSR_PKG_POWER_LIMIT 0x610 +#define PKG_POWER_LIMIT_MASK 0x7fff +#define PKG_POWER_LIMIT_EN (1 << 15) +#define PKG_POWER_LIMIT_CLAMP (1 << 16) +#define PKG_POWER_LIMIT_TIME_SHIFT 17 +#define PKG_POWER_LIMIT_TIME_MASK 0x7f + +#define MSR_PP0_CURRENT_CONFIG 0x601 +#define MSR_VR_CURRENT_CONFIG 0x601 +#define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */ +#define MSR_PP1_CURRENT_CONFIG 0x602 +#define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */ +#define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */ +#define MSR_PKG_POWER_SKU_UNIT 0x606 +#define MSR_PKG_POWER_SKU 0x614 +#define MSR_PP0_POWER_LIMIT 0x638 +#define MSR_PP1_POWER_LIMIT 0x640 + +#define MSR_CONFIG_TDP_NOMINAL 0x648 +#define MSR_CONFIG_TDP_LEVEL1 0x649 +#define MSR_CONFIG_TDP_LEVEL2 0x64a +#define MSR_CONFIG_TDP_CONTROL 0x64b +#define MSR_TURBO_ACTIVATION_RATIO 0x64c + +/* P-state configuration */ +#define PSS_MAX_ENTRIES 8 +#define PSS_RATIO_STEP 2 +#define PSS_LATENCY_TRANSITION 10 +#define PSS_LATENCY_BUSMASTER 10 + +#ifndef __ROMCC__ +#ifdef __SMM__ +/* Lock MSRs */ +void intel_cpu_haswell_finalize_smm(void); +#else +/* Configure power limits for turbo mode */ +void set_power_limits(u8 power_limit_1_time); +int cpu_config_tdp_levels(void); +#endif +#endif + +#endif diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c new file mode 100644 index 0000000000..01d151ee06 --- /dev/null +++ b/src/cpu/intel/haswell/haswell_init.c @@ -0,0 +1,572 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <string.h> +#include <arch/acpi.h> +#include <cpu/cpu.h> +#include <cpu/x86/mtrr.h> +#include <cpu/x86/msr.h> +#include <cpu/x86/lapic.h> +#include <cpu/intel/microcode.h> +#include <cpu/intel/speedstep.h> +#include <cpu/intel/turbo.h> +#include <cpu/x86/cache.h> +#include <cpu/x86/name.h> +#include <pc80/mc146818rtc.h> +#include <usbdebug.h> +#include "haswell.h" +#include "chip.h" + +/* + * List of suported C-states in this processor + * + * Latencies are typical worst-case package exit time in uS + * taken from the SandyBridge BIOS specification. + */ +#if 0 +static acpi_cstate_t cstate_map[] = { + { /* 0: C0 */ + },{ /* 1: C1 */ + .latency = 1, + .power = 1000, + .resource = { + .addrl = 0x00, /* MWAIT State 0 */ + .space_id = ACPI_ADDRESS_SPACE_FIXED, + .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, + .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, + .resv = ACPI_FFIXEDHW_FLAG_HW_COORD, + } + }, + { /* 2: C1E */ + .latency = 1, + .power = 1000, + .resource = { + .addrl = 0x01, /* MWAIT State 0 Sub-state 1 */ + .space_id = ACPI_ADDRESS_SPACE_FIXED, + .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, + .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, + .resv = ACPI_FFIXEDHW_FLAG_HW_COORD, + } + }, + { /* 3: C3 */ + .latency = 63, + .power = 500, + .resource = { + .addrl = 0x10, /* MWAIT State 1 */ + .space_id = ACPI_ADDRESS_SPACE_FIXED, + .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, + .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, + .resv = ACPI_FFIXEDHW_FLAG_HW_COORD, + } + }, + { /* 4: C6 */ + .latency = 87, + .power = 350, + .resource = { + .addrl = 0x20, /* MWAIT State 2 */ + .space_id = ACPI_ADDRESS_SPACE_FIXED, + .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, + .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, + .resv = ACPI_FFIXEDHW_FLAG_HW_COORD, + } + }, + { /* 5: C7 */ + .latency = 90, + .power = 200, + .resource = { + .addrl = 0x30, /* MWAIT State 3 */ + .space_id = ACPI_ADDRESS_SPACE_FIXED, + .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, + .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, + .resv = ACPI_FFIXEDHW_FLAG_HW_COORD, + } + }, + { /* 6: C7S */ + .latency = 90, + .power = 200, + .resource = { + .addrl = 0x31, /* MWAIT State 3 Sub-state 1 */ + .space_id = ACPI_ADDRESS_SPACE_FIXED, + .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, + .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, + .resv = ACPI_FFIXEDHW_FLAG_HW_COORD, + } + }, + { 0 } +}; +#endif + +/* Convert time in seconds to POWER_LIMIT_1_TIME MSR value */ +static const u8 power_limit_time_sec_to_msr[] = { + [0] = 0x00, + [1] = 0x0a, + [2] = 0x0b, + [3] = 0x4b, + [4] = 0x0c, + [5] = 0x2c, + [6] = 0x4c, + [7] = 0x6c, + [8] = 0x0d, + [10] = 0x2d, + [12] = 0x4d, + [14] = 0x6d, + [16] = 0x0e, + [20] = 0x2e, + [24] = 0x4e, + [28] = 0x6e, + [32] = 0x0f, + [40] = 0x2f, + [48] = 0x4f, + [56] = 0x6f, + [64] = 0x10, + [80] = 0x30, + [96] = 0x50, + [112] = 0x70, + [128] = 0x11, +}; + +/* Convert POWER_LIMIT_1_TIME MSR value to seconds */ +static const u8 power_limit_time_msr_to_sec[] = { + [0x00] = 0, + [0x0a] = 1, + [0x0b] = 2, + [0x4b] = 3, + [0x0c] = 4, + [0x2c] = 5, + [0x4c] = 6, + [0x6c] = 7, + [0x0d] = 8, + [0x2d] = 10, + [0x4d] = 12, + [0x6d] = 14, + [0x0e] = 16, + [0x2e] = 20, + [0x4e] = 24, + [0x6e] = 28, + [0x0f] = 32, + [0x2f] = 40, + [0x4f] = 48, + [0x6f] = 56, + [0x10] = 64, + [0x30] = 80, + [0x50] = 96, + [0x70] = 112, + [0x11] = 128, +}; + +int cpu_config_tdp_levels(void) +{ + msr_t platform_info; + + /* Bits 34:33 indicate how many levels supported */ + platform_info = rdmsr(MSR_PLATFORM_INFO); + return (platform_info.hi >> 1) & 3; +} + +/* + * Configure processor power limits if possible + * This must be done AFTER set of BIOS_RESET_CPL + */ +void set_power_limits(u8 power_limit_1_time) +{ + msr_t msr = rdmsr(MSR_PLATFORM_INFO); + msr_t limit; + unsigned power_unit; + unsigned tdp, min_power, max_power, max_time; + u8 power_limit_1_val; + + if (power_limit_1_time > ARRAY_SIZE(power_limit_time_sec_to_msr)) + return; + + if (!(msr.lo & PLATFORM_INFO_SET_TDP)) + return; + + /* Get units */ + msr = rdmsr(MSR_PKG_POWER_SKU_UNIT); + power_unit = 2 << ((msr.lo & 0xf) - 1); + + /* Get power defaults for this SKU */ + msr = rdmsr(MSR_PKG_POWER_SKU); + tdp = msr.lo & 0x7fff; + min_power = (msr.lo >> 16) & 0x7fff; + max_power = msr.hi & 0x7fff; + max_time = (msr.hi >> 16) & 0x7f; + + printk(BIOS_DEBUG, "CPU TDP: %u Watts\n", tdp / power_unit); + + if (power_limit_time_msr_to_sec[max_time] > power_limit_1_time) + power_limit_1_time = power_limit_time_msr_to_sec[max_time]; + + if (min_power > 0 && tdp < min_power) + tdp = min_power; + + if (max_power > 0 && tdp > max_power) + tdp = max_power; + + power_limit_1_val = power_limit_time_sec_to_msr[power_limit_1_time]; + + /* Set long term power limit to TDP */ + limit.lo = 0; + limit.lo |= tdp & PKG_POWER_LIMIT_MASK; + limit.lo |= PKG_POWER_LIMIT_EN; + limit.lo |= (power_limit_1_val & PKG_POWER_LIMIT_TIME_MASK) << + PKG_POWER_LIMIT_TIME_SHIFT; + + /* Set short term power limit to 1.25 * TDP */ + limit.hi = 0; + limit.hi |= ((tdp * 125) / 100) & PKG_POWER_LIMIT_MASK; + limit.hi |= PKG_POWER_LIMIT_EN; + /* Power limit 2 time is only programmable on SNB EP/EX */ + + wrmsr(MSR_PKG_POWER_LIMIT, limit); + + /* Use nominal TDP values for CPUs with configurable TDP */ + if (cpu_config_tdp_levels()) { + msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); + limit.hi = 0; + limit.lo = msr.lo & 0xff; + wrmsr(MSR_TURBO_ACTIVATION_RATIO, limit); + } +} + +#if 0 +static void configure_c_states(void) +{ + msr_t msr; + + msr = rdmsr(MSR_PMG_CST_CONFIG_CONTROL); + msr.lo |= (1 << 28); // C1 Auto Undemotion Enable + msr.lo |= (1 << 27); // C3 Auto Undemotion Enable + msr.lo |= (1 << 26); // C1 Auto Demotion Enable + msr.lo |= (1 << 25); // C3 Auto Demotion Enable + msr.lo &= ~(1 << 10); // Disable IO MWAIT redirection + msr.lo |= 7; // No package C-state limit + wrmsr(MSR_PMG_CST_CONFIG_CONTROL, msr); + + msr = rdmsr(MSR_PMG_IO_CAPTURE_BASE); + msr.lo &= ~0x7ffff; + msr.lo |= (PMB0_BASE + 4); // LVL_2 base address + msr.lo |= (2 << 16); // CST Range: C7 is max C-state + wrmsr(MSR_PMG_IO_CAPTURE_BASE, msr); + + msr = rdmsr(MSR_MISC_PWR_MGMT); + msr.lo &= ~(1 << 0); // Enable P-state HW_ALL coordination + wrmsr(MSR_MISC_PWR_MGMT, msr); + + msr = rdmsr(MSR_POWER_CTL); + msr.lo |= (1 << 18); // Enable Energy Perf Bias MSR 0x1b0 + msr.lo |= (1 << 1); // C1E Enable + msr.lo |= (1 << 0); // Bi-directional PROCHOT# + wrmsr(MSR_POWER_CTL, msr); + + /* C3 Interrupt Response Time Limit */ + msr.hi = 0; + msr.lo = IRTL_VALID | IRTL_1024_NS | 0x50; + wrmsr(MSR_PKGC3_IRTL, msr); + + /* C6 Interrupt Response Time Limit */ + msr.hi = 0; + msr.lo = IRTL_VALID | IRTL_1024_NS | 0x68; + wrmsr(MSR_PKGC6_IRTL, msr); + + /* C7 Interrupt Response Time Limit */ + msr.hi = 0; + msr.lo = IRTL_VALID | IRTL_1024_NS | 0x6D; + wrmsr(MSR_PKGC7_IRTL, msr); + + /* Primary Plane Current Limit */ + msr = rdmsr(MSR_PP0_CURRENT_CONFIG); + msr.lo &= ~0x1fff; + msr.lo |= PP0_CURRENT_LIMIT; + wrmsr(MSR_PP0_CURRENT_CONFIG, msr); + + /* Secondary Plane Current Limit */ + msr = rdmsr(MSR_PP1_CURRENT_CONFIG); + msr.lo &= ~0x1fff; + if (cpuid_eax(1) >= 0x30600) + msr.lo |= PP1_CURRENT_LIMIT_IVB; + else + msr.lo |= PP1_CURRENT_LIMIT_SNB; + wrmsr(MSR_PP1_CURRENT_CONFIG, msr); +} +#endif + +static void configure_thermal_target(void) +{ + struct cpu_intel_haswell_config *conf; + device_t lapic; + msr_t msr; + + /* Find pointer to CPU configuration */ + lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC); + if (!lapic || !lapic->chip_info) + return; + conf = lapic->chip_info; + + /* Set TCC activaiton offset if supported */ + msr = rdmsr(MSR_PLATFORM_INFO); + if ((msr.lo & (1 << 30)) && conf->tcc_offset) { + msr = rdmsr(MSR_TEMPERATURE_TARGET); + msr.lo &= ~(0xf << 24); /* Bits 27:24 */ + msr.lo |= (conf->tcc_offset & 0xf) << 24; + wrmsr(MSR_TEMPERATURE_TARGET, msr); + } +} + +static void configure_misc(void) +{ + msr_t msr; + + msr = rdmsr(IA32_MISC_ENABLE); + msr.lo |= (1 << 0); /* Fast String enable */ + msr.lo |= (1 << 3); /* TM1/TM2/EMTTM enable */ + msr.lo |= (1 << 16); /* Enhanced SpeedStep Enable */ + wrmsr(IA32_MISC_ENABLE, msr); + + /* Disable Thermal interrupts */ + msr.lo = 0; + msr.hi = 0; + wrmsr(IA32_THERM_INTERRUPT, msr); + + /* Enable package critical interrupt only */ + msr.lo = 1 << 4; + msr.hi = 0; + wrmsr(IA32_PACKAGE_THERM_INTERRUPT, msr); +} + +static void enable_lapic_tpr(void) +{ + msr_t msr; + + msr = rdmsr(MSR_PIC_MSG_CONTROL); + msr.lo &= ~(1 << 10); /* Enable APIC TPR updates */ + wrmsr(MSR_PIC_MSG_CONTROL, msr); +} + +static void configure_dca_cap(void) +{ + struct cpuid_result cpuid_regs; + msr_t msr; + + /* Check feature flag in CPUID.(EAX=1):ECX[18]==1 */ + cpuid_regs = cpuid(1); + if (cpuid_regs.ecx & (1 << 18)) { + msr = rdmsr(IA32_PLATFORM_DCA_CAP); + msr.lo |= 1; + wrmsr(IA32_PLATFORM_DCA_CAP, msr); + } +} + +static void set_max_ratio(void) +{ + msr_t msr, perf_ctl; + + perf_ctl.hi = 0; + + /* Check for configurable TDP option */ + if (cpu_config_tdp_levels()) { + /* Set to nominal TDP ratio */ + msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); + perf_ctl.lo = (msr.lo & 0xff) << 8; + } else { + /* Platform Info bits 15:8 give max ratio */ + msr = rdmsr(MSR_PLATFORM_INFO); + perf_ctl.lo = msr.lo & 0xff00; + } + wrmsr(IA32_PERF_CTL, perf_ctl); + + printk(BIOS_DEBUG, "haswell: frequency set to %d\n", + ((perf_ctl.lo >> 8) & 0xff) * HASWELL_BCLK); +} + +static void set_energy_perf_bias(u8 policy) +{ + msr_t msr; + + /* Energy Policy is bits 3:0 */ + msr = rdmsr(IA32_ENERGY_PERFORMANCE_BIAS); + msr.lo &= ~0xf; + msr.lo |= policy & 0xf; + wrmsr(IA32_ENERGY_PERFORMANCE_BIAS, msr); + + printk(BIOS_DEBUG, "haswell: energy policy set to %u\n", + policy); +} + +static void configure_mca(void) +{ + msr_t msr; + int i; + + msr.lo = msr.hi = 0; + /* This should only be done on a cold boot */ + for (i = 0; i < 7; i++) + wrmsr(IA32_MC0_STATUS + (i * 4), msr); +} + +#if CONFIG_USBDEBUG +static unsigned ehci_debug_addr; +#endif + +/* + * Initialize any extra cores/threads in this package. + */ +static void intel_cores_init(device_t cpu) +{ + struct cpuid_result result; + unsigned threads_per_package, threads_per_core, i; + + /* Logical processors (threads) per core */ + result = cpuid_ext(0xb, 0); + threads_per_core = result.ebx & 0xffff; + + /* Logical processors (threads) per package */ + result = cpuid_ext(0xb, 1); + threads_per_package = result.ebx & 0xffff; + + /* Only initialize extra cores from BSP */ + if (cpu->path.apic.apic_id) + return; + + printk(BIOS_DEBUG, "CPU: %u has %u cores, %u threads per core\n", + cpu->path.apic.apic_id, threads_per_package/threads_per_core, + threads_per_core); + + for (i = 1; i < threads_per_package; ++i) { + struct device_path cpu_path; + device_t new; + + /* Build the cpu device path */ + cpu_path.type = DEVICE_PATH_APIC; + cpu_path.apic.apic_id = + cpu->path.apic.apic_id + i; + + /* Update APIC ID if no hyperthreading */ + if (threads_per_core == 1) + cpu_path.apic.apic_id <<= 1; + + /* Allocate the new cpu device structure */ + new = alloc_dev(cpu->bus, &cpu_path); + if (!new) + continue; + + printk(BIOS_DEBUG, "CPU: %u has core %u\n", + cpu->path.apic.apic_id, + new->path.apic.apic_id); + +#if CONFIG_SMP && CONFIG_MAX_CPUS > 1 + /* Start the new cpu */ + if (!start_cpu(new)) { + /* Record the error in cpu? */ + printk(BIOS_ERR, "CPU %u would not start!\n", + new->path.apic.apic_id); + } +#endif + } +} + +static void haswell_init(device_t cpu) +{ + char processor_name[49]; + struct cpuid_result cpuid_regs; + + intel_update_microcode_from_cbfs(); + + /* Turn on caching if we haven't already */ + x86_enable_cache(); + + /* Clear out pending MCEs */ + configure_mca(); + + /* Print processor name */ + fill_processor_name(processor_name); + printk(BIOS_INFO, "CPU: %s.\n", processor_name); + +#if CONFIG_USBDEBUG + // Is this caution really needed? + if(!ehci_debug_addr) + ehci_debug_addr = get_ehci_debug(); + set_ehci_debug(0); +#endif + + /* Setup MTRRs based on physical address size */ + cpuid_regs = cpuid(0x80000008); + x86_setup_fixed_mtrrs(); + x86_setup_var_mtrrs(cpuid_regs.eax & 0xff, 2); + x86_mtrr_check(); + + /* Setup Page Attribute Tables (PAT) */ + // TODO set up PAT + +#if CONFIG_USBDEBUG + set_ehci_debug(ehci_debug_addr); +#endif + + /* Enable the local cpu apics */ + enable_lapic_tpr(); + setup_lapic(); + + /* Configure C States */ + //configure_c_states(); + + /* Configure Enhanced SpeedStep and Thermal Sensors */ + configure_misc(); + + /* Thermal throttle activation offset */ + configure_thermal_target(); + + /* Enable Direct Cache Access */ + configure_dca_cap(); + + /* Set energy policy */ + set_energy_perf_bias(ENERGY_POLICY_NORMAL); + + /* Set Max Ratio */ + set_max_ratio(); + + /* Enable Turbo */ + enable_turbo(); + + /* Start up extra cores */ + intel_cores_init(cpu); +} + +static struct device_operations cpu_dev_ops = { + .init = haswell_init, +}; + +static struct cpu_device_id cpu_table[] = { + { X86_VENDOR_INTEL, 0x306c1 }, /* Intel Haswell 4+2 A0 */ + { X86_VENDOR_INTEL, 0x306c2 }, /* Intel Haswell 4+2 B0 */ + { X86_VENDOR_INTEL, 0x40660 }, /* Intel Haswell 4+3 B0 */ + { 0, 0 }, +}; + +static const struct cpu_driver driver __cpu_driver = { + .ops = &cpu_dev_ops, + .id_table = cpu_table, + /* .cstates = cstate_map, */ +}; + diff --git a/src/cpu/intel/haswell/microcode-M32306c1_ffff000d.h b/src/cpu/intel/haswell/microcode-M32306c1_ffff000d.h new file mode 100644 index 0000000000..1050969fe1 --- /dev/null +++ b/src/cpu/intel/haswell/microcode-M32306c1_ffff000d.h @@ -0,0 +1,1344 @@ +0x00000001, 0xffff000d, 0x03302012, 0x000306c1, +0x1d84a35e, 0x00000001, 0x00000032, 0x000053d0, +0x00005400, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x000000a1, 0x00020001, 0xffff000d, +0x00000000, 0x000014f1, 0x20120330, 0x000014f1, +0x00000001, 0x000306c1, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xc2fd8cab, 0x6fa6fb65, 0xaf3ea15d, 0x725f50dc, +0x658b353e, 0xa1c31b9b, 0xe7243cad, 0xee3e0528, +0xa19308a3, 0x5b19c4b7, 0x4a1b425b, 0x7d6a74f6, +0x81624193, 0x3a559605, 0x5475280b, 0xe7319d58, +0x48624ca7, 0x507af030, 0x3b32d96a, 0x30164068, +0x5284d2f5, 0x725b2915, 0xf63c9280, 0x44b7c142, +0xe67ca7b3, 0xd6f163e7, 0xcdf51f3c, 0x41d180a1, +0xcc3931b1, 0xf7a544a9, 0x7f6bf77d, 0xfc45a45f, +0xf0985836, 0x652d7e2e, 0x0324b1f3, 0x24b9548c, +0x7bcae7a5, 0xdcdebf79, 0x27015922, 0x0c83c606, +0x3d2ceeb7, 0x61c5eec8, 0x6b6899c6, 0x3e500531, +0xf08bfa44, 0xb304a8f4, 0xcee8f713, 0x2912c786, +0xfae6c34c, 0xa5292960, 0x7d63e389, 0xaa257a01, +0x1fb25054, 0x963fc676, 0x5bcb9fd3, 0x58f369a4, +0xf6e3beb2, 0xa58b5eb0, 0x33c7eba4, 0x37fe8b66, +0x00714403, 0xf0fd0c4e, 0xaa122996, 0x9a55b184, +0x00201507, 0xc9fb6e3a, 0x11ab60c8, 0x80ff6e84, +0xc37aabdd, 0x0fc23175, 0xb0b18c34, 0xf1ec806c, +0x00000011, 0x2911790b, 0x220445de, 0x3756bc29, +0xb7080bc8, 0xb610510d, 0xbfe23625, 0xe518d098, +0x6e99b4b4, 0xe7893eb1, 0x0d149ab6, 0x53e17953, +0x4b13580f, 0x82e5b176, 0x497d7196, 0xa003bcb5, +0x912747d7, 0xd825ff22, 0x662988e6, 0x5e5efdec, +0x614a4f7e, 0xbfa071a6, 0x8a06928a, 0x49fdb221, +0xfe508725, 0x6071b89d, 0xa2547b82, 0x980e3a87, +0xd313b690, 0xf83d1ede, 0xe304d098, 0xadcb5f26, +0xd58e50ae, 0xc1c8f03b, 0x2c35798a, 0x87fe877d, +0x0a402c34, 0xe2e66f2f, 0x321e15b4, 0xa3b3c9d4, +0x4e8c1bfb, 0xda693297, 0x7e7a735c, 0x2877c1f3, +0x246dadb5, 0x475e143d, 0x7621476d, 0x3b8ccfbb, +0x8f2cc7b5, 0x5f6f8e93, 0x965b70e2, 0x0ba42e43, +0x9bdbd61e, 0xfe11705c, 0xaecc3b85, 0x1d43b887, +0xd37a07be, 0x681d104c, 0xf29c489e, 0x8de9e8f8, +0x95745344, 0xdc9187cc, 0x9f5a3228, 0x9ba5f60b, +0xd5db93b6, 0x5e6d3487, 0x8356d17a, 0x94d30405, +0xe9f3173b, 0xda6ea416, 0xa6738342, 0x3b443db1, +0x518278ca, 0xf34e925c, 0x00710d25, 0x00bddf6a, +0x06afe3fd, 0xa3ada488, 0x004d3cca, 0x79939fa7, +0x6a43a257, 0xf3927d5e, 0xe1fd1212, 0x562593fc, +0x67f0d174, 0x3839c38b, 0x3cca12c5, 0x387f8352, +0x7045e87c, 0xe165b472, 0xf0a9aac3, 0x88e2c731, +0x401ad4cc, 0x524b362d, 0x7d216b83, 0x6bc1eff0, +0xbab1bed3, 0x6c62d049, 0x23363fb9, 0xb02dc51f, +0x33322777, 0x05347786, 0x4ae86a7d, 0x7e3fd01f, +0x3d15053e, 0xc1e3b8d3, 0x5c1fe742, 0x4c7a75cc, +0x2d194497, 0x1446881b, 0xc877a18c, 0x4dedb782, +0x5b29147f, 0x530a3cc5, 0x21e2f113, 0x42772312, +0x93f856cd, 0xc3f0eefe, 0xc1b0b4b9, 0x1656ba64, +0x6068a0e0, 0xb3e7c373, 0x785ae0ac, 0x04d3ef12, +0x7f1fc4f9, 0x6d06e657, 0xd7923d68, 0x0ccb0f3e, +0x50a63658, 0x0408630a, 0x452864b1, 0x6dcba513, +0xc6b02271, 0xd3ea3e2d, 0x4e061ebc, 0x91e7b83d, +0xbd5663b5, 0xd2ed197c, 0xd89911d7, 0x77559375, +0x0175f9d5, 0x63c5d8f0, 0x50ef4df3, 0x5d500cea, +0x434ace15, 0x6f3747b5, 0xc0e15d56, 0x22c17f15, +0x471a0d73, 0xbbe149e3, 0x63b54989, 0xbe292e53, +0x81fdfe2a, 0x9fcb7736, 0x5ea8c25b, 0x758da67e, +0x64369449, 0x86fda1e0, 0x4fcb0fd3, 0xb4bebda6, +0x0ed42c85, 0x41561212, 0xf770a5d9, 0xdd188df3, +0x216aa88b, 0x9b101e32, 0x62f16a5e, 0xebcc9e92, +0x92419a47, 0x9b581102, 0x77714b52, 0x11110672, +0x5d36f632, 0x9e923f71, 0x3a9041f7, 0x2da8675a, +0xa9b0f311, 0x0bed2b25, 0xdbe656a6, 0x10f5cb8e, +0xdefbbaa2, 0x9bd7ad24, 0x88f169af, 0xed621efc, +0x1831952e, 0x16da28e9, 0x409f94c0, 0x146caa60, +0x629a22cb, 0x4a458f05, 0xbd08bc73, 0x8c909c25, +0x06594441, 0x12eede59, 0x93fdd704, 0xe0368b60, +0x9b1753c3, 0xbdbe2e5a, 0x2df9a57f, 0x9f9c58f3, +0x6a078218, 0xa1915787, 0x18edde10, 0xf249fa7e, +0xb6ed1c75, 0xc0ab601b, 0x19b60ce0, 0x2cb00a43, +0x1edb92ad, 0x434464c6, 0x95f990b4, 0xcad8a584, +0x6f51cd0c, 0xd2e49283, 0xd5f3100b, 0xdeb93fff, +0xf9a11003, 0x098d5f24, 0x5ee44c17, 0x4525c531, +0xaeecd661, 0x6c6eed71, 0x64d78afb, 0x074be2d7, +0xcab5d351, 0x646f68d1, 0xc3e56ca5, 0x56a9188b, +0x327f859f, 0x2fdc1097, 0xdde7a664, 0x84bc9f87, +0xb3e958ea, 0x62759f12, 0xd22f7ba3, 0xc2f35d48, +0x245b2700, 0xc745e303, 0xc2ce4ab8, 0x7f212b51, +0xc4e2fd8b, 0x74e19d3f, 0x64d46973, 0x1a7650e7, +0x84fa8fba, 0x872a28c5, 0xb8d5bb39, 0xaee913d4, +0x71068d6a, 0x8058a9e7, 0xd3c8d5ad, 0xa1ab9866, +0x1fe72e51, 0xbfbd2546, 0x7d2e689a, 0x54487eeb, +0x37b4f05c, 0x50e2c2fd, 0xd139e02a, 0x3e8f32e5, +0xdf520335, 0x4c1cc8a4, 0xdfc57642, 0x45706a71, +0x0a9d8080, 0xa15f8acf, 0x44ee3705, 0x28073fef, +0x7229c0e2, 0x3f3c2e45, 0x84dcb978, 0x5056ea8b, +0x2976439e, 0xad6bb80d, 0xafefde4e, 0x0c9a60a2, +0xadfe1faa, 0xbba270c4, 0x82a02b1b, 0xc357de50, +0xbe813039, 0x5c587027, 0x5b97c5e1, 0xc8f5eac9, +0x31c0eabc, 0x04cc3a44, 0x3c139e15, 0xa77be6d1, +0xfe9a0d3a, 0x100beb6d, 0x93354b4e, 0xdbc5181a, +0x504ba59e, 0xe1e02d60, 0xbe966b54, 0x759ce581, +0x2479cc6e, 0x10dcfdc4, 0x26dea960, 0xb097ad84, +0xc5b23428, 0x1043ceab, 0xe7bc23e4, 0x233482a1, +0x86f17cda, 0x5054f2cb, 0x6c6fed4c, 0xbe57e2c3, +0x63cbc9f9, 0xa2c0c28a, 0xe7e3c0c2, 0x0fbc9fc8, +0xd712edb5, 0xe64445a5, 0x4a8ff4a0, 0xb709260b, +0x1e85db4b, 0xbf795610, 0x4148e521, 0xb6d7b8ef, +0xcb547ef3, 0xeab3aa17, 0xa6da5440, 0x9fc4ec6f, +0x3955068e, 0x6a1c4fa4, 0xa9c43a5c, 0x8e689920, +0x772f96d0, 0x1754416e, 0x1c7d2589, 0x43d3fb04, +0x021044de, 0xbc5aadf5, 0xba9598d8, 0x84dda1e9, +0xfb030354, 0xd9c4763e, 0xebc2978a, 0xc86f1a6f, +0x8fe4f5d3, 0x1955fcd8, 0xbff7a42d, 0x796fe00d, +0x7d34f977, 0x2b28d705, 0x074415f4, 0xf0149539, +0x7cf87e36, 0x75e0a02c, 0xea42978a, 0x5b5644c7, +0x785aaea7, 0x74f8d7c2, 0xccb38924, 0x6fe9c0e0, +0x7f758138, 0xd2d1d66a, 0xae6bf89c, 0x1681282e, +0x34cf76ef, 0x752173bb, 0x3475552f, 0x6cb54989, +0xc22eb443, 0xfb12a8a6, 0x14f14cce, 0xe744005d, +0x2db6f804, 0x2f2d741b, 0x31a73826, 0x738a1bb3, +0xeb2e014b, 0x415356a2, 0xa6c3273f, 0xaa661f0f, +0x9981b9f0, 0xb5aeee63, 0x2530e67a, 0xde5c8244, +0xcc201d9d, 0x91b1334e, 0x1383920d, 0x917f57d4, +0x8417e617, 0x0fa322aa, 0xe189d6ec, 0xe8821b30, +0xc530b1da, 0x22da0b28, 0x7c9d6ab6, 0xdb054639, +0x02b7a845, 0x1f1afbfa, 0x0fd47762, 0x42dd9053, +0x1a858a0f, 0xa5518ac6, 0x9a090813, 0x3aa41cb9, +0xb424f20c, 0x46b7ec99, 0xfc81af92, 0x7ad95854, +0x27272dec, 0x4662d252, 0xa7058894, 0x0557c937, +0xb1306750, 0x1f130309, 0x6b14a1e2, 0x3870776a, +0xb48df3e0, 0x368c8fdc, 0xa3a99e4f, 0xf5c2ef2d, +0x4eb70135, 0x1997f993, 0xfaf2e90d, 0x39536638, +0x594782f8, 0x155a9367, 0x4ea58e8a, 0x71bc8691, +0x3f654b13, 0x8a745d7f, 0x9f4551a4, 0xd01a1c9d, +0x0316afbc, 0xce48e29e, 0x5edcb727, 0x97751ce5, +0x044bed10, 0xbfae5a76, 0xdd1bc019, 0x05f6c7e4, +0x34c3ff13, 0x488315b8, 0x523ceea3, 0x0dd5f7a5, +0xa24fd70d, 0xce8eb6fc, 0xd191a719, 0xd295651b, +0xa909f533, 0x90a6eb7d, 0xd1bfc50b, 0xe5f090ae, +0x73d42e99, 0x78195762, 0x8b674cfe, 0x0a440728, +0x8498629e, 0xc15b5e68, 0x938bea09, 0x8eb80202, +0xb942bdc3, 0xe9753f82, 0xf7584a4e, 0x3c1179d3, +0xfe72f3d9, 0x1efb9911, 0x12a89365, 0xbbdf1873, +0x3cce4841, 0x3d364836, 0x2494446a, 0x6f9331b0, +0x84de569d, 0xa7dca221, 0xb5163bb6, 0x8d854e44, +0xbbf67468, 0x3920ca2c, 0x4873d2dc, 0x4dedd222, +0x0237d22e, 0x2df26e66, 0xe6f96230, 0x45061a66, +0x56733f4d, 0xdb22eb68, 0xc1e2450c, 0x5bb43be4, +0x6f509c3c, 0xd100b77a, 0xa0189b88, 0x16557852, +0x0d3a9b92, 0x8e16aab5, 0x2538c82a, 0x465d5249, +0x96bea7dc, 0x42ae8539, 0xa2438010, 0xaa536691, +0xc062277c, 0xcfeb1744, 0x3f25a727, 0x90f0f357, +0x5bdf7d9d, 0xb3b36fdb, 0x7b26e697, 0xfb79b618, +0xfd179d0d, 0x130a40d6, 0xc58d1efc, 0x17ed54d3, +0x5dd7151b, 0x160484a0, 0xbd82d590, 0x882ac7f2, +0xb1425923, 0x952d3901, 0xf8669d56, 0x306eb2c8, +0x753954c8, 0x4e91e2e2, 0xc657defd, 0x08d7ca9b, +0x4eb1dea1, 0x1f01f85b, 0xc3a5a432, 0x56a1997b, +0xd38331ef, 0x4e58f717, 0x2d5bd837, 0xec41c072, +0x725ddcb0, 0x21a094ab, 0x6af39856, 0xe5beb8f5, +0xe594a652, 0x8349f482, 0x64b6b627, 0x158d3920, +0x1b3b4932, 0xe5d9e247, 0x5283ace8, 0x53c320b6, +0x92582238, 0x37ce2d4f, 0xc24a5564, 0x94762d9b, +0xa2f35d7e, 0x2f6b9bdd, 0x08064b0a, 0x921d7fbf, +0xb4af0273, 0xf88182d3, 0x6cb389e9, 0x97ace86d, +0x9636e118, 0x70e0b558, 0xde28b6a8, 0xdec4de13, +0xb58f98d0, 0xc57917ff, 0x3c76eaf9, 0xb441d1b8, +0x34623de5, 0x1851db1c, 0x1e5943e4, 0x640d56b7, +0xeda5eae5, 0x97b9b745, 0x9a13d5ab, 0x1af48c92, +0xb436bc90, 0x593cad9e, 0xdbff3108, 0x461d0b32, +0x4432bcc4, 0x9ee3dce7, 0x558dcd2d, 0x84092f36, +0x37321f94, 0xdace9236, 0xea8a0fcc, 0xed62e7db, +0x86642ab9, 0xd9512038, 0x50cb9e7d, 0x2d8c3ac8, +0xa97ad442, 0xaac479b3, 0x24c08549, 0x61af5a52, +0xd30aadcc, 0x216f8681, 0xb2ec2127, 0x343eab52, +0x05515c8d, 0x3a1c7625, 0x1d053385, 0xa30ebbd1, +0x779813a0, 0xe18b85ac, 0xee7e4907, 0x9a0c0940, +0x8cc8a461, 0xfd82d0b3, 0x807b1f95, 0x82cbd8d8, +0x4cafb4a3, 0xabaa2eca, 0x0759e4b8, 0x41a6d782, +0xc5d100de, 0x02482d4c, 0x80f9f6e8, 0x7999ea4a, +0x1d9dafa8, 0x622e6df7, 0x0dbbe21c, 0xf031d31e, +0x6bfa2bf2, 0x24e1064b, 0x64b4c4b2, 0x198372c4, +0x071f0e1a, 0x2fe6dd57, 0xf2085803, 0xa790c560, +0x498c10ae, 0xde8b91d2, 0xcc502267, 0xb934850d, +0x9e7f555b, 0x3957038b, 0xa76e1b11, 0x0edecf31, +0xdc32e2d6, 0xefd01b56, 0x4602aa57, 0x0768d5d9, +0x492f2838, 0x6454a32a, 0x935b4937, 0xbbb3c8d2, +0x49dc355f, 0xb091e3a7, 0xdf1c6465, 0x997bf9f2, +0xe4bd3100, 0x5a3aae7e, 0x74d90b7e, 0x11b18734, +0xcd157ca9, 0x59a8cd4a, 0xef21b531, 0xdcbeca37, +0xe3b19a26, 0x9476ad7d, 0x2124a922, 0xc665d502, +0x5e92c2a2, 0x6924bead, 0x67093ddc, 0xfd87b7e5, +0x14627489, 0x510b7d85, 0x252b01f0, 0xeef9f8fc, +0x4f023627, 0x5029536d, 0xe32c9d6f, 0xb160d734, +0xc5fd8019, 0x8c52b162, 0xb62016a6, 0xe174e01f, +0x63255ea4, 0x8e51131f, 0x5b13c027, 0x403919ff, +0x8d819aad, 0xbcf4cf23, 0x42ee0de6, 0xadd49f81, +0xa32a6443, 0x19513428, 0xc97b0288, 0x65bb31e4, +0x6ab26c92, 0x21fa3a90, 0xa4ea6d91, 0x80d3ec0c, +0x716c638e, 0x9cb8c079, 0x779cc058, 0x45c96df2, +0xd94be27b, 0x3b88a219, 0x7d55a5c4, 0x9bfb7c09, +0xad919f74, 0xa8de3c9d, 0xd4532b3f, 0x15b748af, +0x9c6d31b4, 0x9e365eae, 0x0683025a, 0x996d72a7, +0x7ca75780, 0x4288af50, 0xa9762d9a, 0x5a7abe79, +0x798c9cb8, 0x9f9a6918, 0xeadef40c, 0xdb572477, +0x05fe5a39, 0xcce4d24e, 0x9df361c6, 0x40a3e766, +0x4619fc70, 0xc00f502e, 0x4f413317, 0x5afb7c4f, +0x95ff6889, 0xb197aff5, 0xb4a80cd8, 0xb25ad853, +0xff1697a5, 0xb7ef18d0, 0x63e93034, 0x1fafe103, +0xda76fbae, 0x0df20325, 0x1bb2778f, 0x2522e0d7, +0xd528a486, 0x6d5a718d, 0x6598bda5, 0x5edbcf69, +0x03fd42b6, 0x764907a0, 0x5581f54d, 0x70cd644d, +0x8880de51, 0x2ffd0f8b, 0xba8427c5, 0x26a12c5d, +0xb4a7815e, 0x4b501fa2, 0xdde2294a, 0x2a6df749, +0x768e19cc, 0x37045304, 0x3f779c4f, 0x214bec70, +0x2105f3ed, 0xa13c4520, 0x6eaeeb9d, 0xf55137fe, +0x0db8fd36, 0x90570927, 0x7c51a071, 0x3acd1201, +0x471a504f, 0x8f8b4dc8, 0x5fbc5277, 0xd11763c6, +0x3a59ebf7, 0xfae42348, 0xf8ce6b40, 0x32830204, +0x354ff5f1, 0xf0e472bc, 0xe9086fb4, 0x7a589a9b, +0x5039355b, 0x8abf9782, 0x21079bf5, 0x99bcdedd, +0xef43a037, 0x118be1c1, 0x1b345c8c, 0xcecb2ced, +0x7d5dd66d, 0x234d95b0, 0x251a8770, 0x8a25574d, +0x5fafa8ed, 0xe607987a, 0x4a8b244b, 0x819b2037, +0xc9938834, 0xb8d5dd83, 0xa942c68f, 0xc1cdca9e, +0x179aae1c, 0x8588faed, 0xd56205a0, 0x4a0d1430, +0xcbecbab0, 0x24afcc1f, 0x10fcf1a6, 0x46c7d891, +0xd8f2c33a, 0x64568220, 0xcee3c2cb, 0x0a0e2904, +0xa619ad7c, 0xaf912f17, 0x4d8b8901, 0x628e08fb, +0x41535851, 0x702990a4, 0xffe1ec0c, 0xb83f8632, +0x8ba7a6c0, 0x0affa2c5, 0xeff561c8, 0x5ada6fab, +0x4d7d1c74, 0x874cee31, 0x9ae55766, 0x18b85331, +0xb28f32b8, 0xdaf261d8, 0xdfea03ea, 0x73066cda, +0x501cab7f, 0xc64a70d8, 0x35c659f8, 0x7f0e150c, +0x459240b6, 0x5e3da19d, 0x00391a2d, 0xff9beb05, +0x74b39cea, 0x2bcc178e, 0x7982a4b3, 0xa341466d, +0xdebf02c3, 0x1ed15c96, 0x5477aef9, 0xa0cdd8b4, +0xb9bceb4d, 0x69fde3ed, 0x7ff441c4, 0x9d58acae, +0xb004adb2, 0xe295c86e, 0xa3a332ef, 0xf3938efa, +0x76264ff9, 0xdb485914, 0x00c5e26e, 0x87361490, +0xd860f761, 0xc79b7bdb, 0x635dd508, 0x614d610b, +0x770c312e, 0x642be348, 0xd00ab034, 0x902a308b, +0x00856700, 0xfd104ff5, 0x0c0ae30d, 0x77d851e5, +0x69eab04c, 0x9d1c3864, 0x1c1031dc, 0x67eced9c, +0x33ab89e6, 0x3a19c4b1, 0x805f4ceb, 0x716537bc, +0xc5bbebb1, 0x9168badc, 0x4d31a6c4, 0x4139bb6e, +0x648459c7, 0xce6aaf91, 0x7327e4f7, 0x8c8801ba, +0xa6c89080, 0x55bcb114, 0x7bae81ca, 0xe1d7b834, +0xfc2e5fcb, 0x2b4b3208, 0x240768cc, 0xc7178e79, +0xc08895b5, 0xd4b0f83c, 0xed556397, 0xa349157b, +0x04e2bf92, 0x7d0b7188, 0x1587a068, 0x6e72c420, +0x2ca5787f, 0xa6df5e0b, 0xd9b42476, 0x43dbf945, +0xac2bdd9e, 0xfef17a05, 0xb86b5be7, 0x8f776f01, +0x91c33203, 0x04b7791b, 0x108f4c7d, 0x802762c9, +0x06dae0c6, 0x01564de5, 0x71dd7c01, 0xf75b85e0, +0x9a65f630, 0xadcd29c8, 0x29a6d293, 0x4c73c192, +0x38710202, 0x29916786, 0x23ff7c5c, 0xae67e20d, +0x273c3b5d, 0xff25637f, 0x342abe4b, 0xc3c5fcd5, +0xfd362fb9, 0x863abe8e, 0xfa56383a, 0xf72a5080, +0xb8a0d766, 0x7008f212, 0xb6d4885f, 0x8ae2c7b2, +0xf9cd741e, 0x852cebc6, 0x2aadc641, 0x9db1ef5c, +0xcd5c7c05, 0x4117664f, 0x9e7e3104, 0x3f8320c5, +0x617faea7, 0xb8683ef4, 0xc1e4a6fa, 0x62738d0f, +0x685eefe6, 0x32b25f60, 0xe1aeb423, 0x53efff1a, +0x83064777, 0x64ba47f4, 0xdd384e5a, 0x4f52ce8a, +0x6561a959, 0x8b771323, 0x33c833fd, 0x95ef4a29, +0xcb131871, 0xf26bbad9, 0x4b6cf6ae, 0x0b6e3f39, +0x00c36172, 0x1e0ed06f, 0x90a81ccd, 0x009c566d, +0xee041bd5, 0xa4dae53e, 0x707b5b4e, 0x00cd7362, +0x04dd3610, 0x90ed7bbb, 0xd6e00d13, 0x960ee4e3, +0x6cce71ce, 0x57081299, 0x22455bc1, 0xf526f1ca, +0xe5362423, 0x7497d3b7, 0x10cf9ce0, 0xa0158637, +0x2306efbf, 0xb0862b6e, 0xd998974e, 0xcb910973, +0xa1b7f523, 0x77d682b3, 0xe1b89fff, 0x9a3b7cc5, +0x9add1ec6, 0x861f9ff9, 0xcc76e971, 0x55584c9c, +0xb2e654b3, 0x3e1f6c88, 0xf8b871b7, 0xf0402608, +0xdd59d394, 0xc2ed8d35, 0x1f33d6ec, 0x9444fde3, +0xf65d1884, 0x566f724b, 0xff7dd3a8, 0x142b0c81, +0xe6302e1d, 0xbd534337, 0xe9ebc22a, 0xf8fe408f, +0x08a03ec1, 0xfd6caf5f, 0x31f06323, 0xc1326b7f, +0x03e955c4, 0x9aba63b9, 0x64cdea45, 0x873162d2, +0x2baa1191, 0x1149dfcf, 0x860cc723, 0x46173558, +0x6e5c6452, 0x836c1c8d, 0xfb52c2c2, 0xf08f2b6b, +0xff0cdd3c, 0x4c9c2a3f, 0x5fc0bc30, 0x4269316d, +0x150b97a9, 0x26ca1247, 0x317876e5, 0x2efd24ea, +0x28295d49, 0x9283925b, 0xc0cde49d, 0x8fe64fb1, +0x1e16f2e6, 0x4a6b8a82, 0xdfdd2adf, 0x342be252, +0x00d9ec4c, 0x8e32d5fc, 0xd05759a1, 0xae996839, +0x13ea57d1, 0x113b2dcd, 0x2371b16f, 0x666dcdeb, +0x41b2e88c, 0xce58f196, 0xcdd2351a, 0xceb8cb73, +0xc6ec2f7c, 0xede02654, 0x60a0b96c, 0xc3aef4d7, +0x0f7c8726, 0x8d1714d7, 0xef17e6e1, 0xc215e286, +0xb859ba08, 0x7d4adddc, 0x653f790b, 0x369ff867, +0xeea07707, 0x17f37969, 0x55276867, 0x6dda40ab, +0xb64b58e6, 0x7bb39a79, 0x0933336f, 0x9c1e6b21, +0x0a7daa77, 0x784d6d1b, 0xae62505f, 0x07bcd5ae, +0x48837741, 0x2e91ff32, 0x4831d57f, 0xaaba8d16, +0xf13c60a3, 0x923360d5, 0x9c7a2ff0, 0xb4ef7e1c, +0xc957fe85, 0xdd39c913, 0x868bf9b5, 0x3c042e9b, +0x84ae1eea, 0x9aefa052, 0xfd664cda, 0x1b842cf9, +0x042b97d7, 0xf052c1e4, 0x666c83df, 0x619a9070, +0xa3318aac, 0x214324b5, 0x054d663d, 0x5c98cff7, +0xe0dce6fd, 0xe4f0c129, 0xeb63d991, 0x94852375, +0xee0d8ba1, 0x83c25d94, 0x6d4f87a6, 0x23057f9b, +0x23505488, 0xb147c5da, 0xb41e1d53, 0xc4485099, +0xc0547c9a, 0xf334f026, 0x717af0cf, 0xc188352c, +0x8061eb1f, 0xa907543c, 0x317dc700, 0x2a6f586d, +0xa895f76c, 0xb4def1a2, 0xe77d361e, 0x782f76a7, +0x6f393c60, 0xacdbabf4, 0x3769faaa, 0xe62b2cdb, +0x42fab4fc, 0x4b1eeb1f, 0xfbe7b929, 0x17433cc7, +0x2ac1ae15, 0x2566028d, 0xe0afceb9, 0x51ea9013, +0x9a882a63, 0xcbaa9830, 0x984d8b57, 0xbabccce5, +0xeb7450eb, 0x08d47f5e, 0x5b3a2071, 0x17b583b7, +0x3d1296d2, 0xc822b84e, 0x7b774c14, 0x436ac4ce, +0xba6fc544, 0x714dbff2, 0x195e9c44, 0x3fd4394a, +0x1c4c67a2, 0xc36e5232, 0x026b5497, 0xd968e775, +0x179c78d5, 0x71cfce76, 0x6d142dfa, 0xac628504, +0xc8ea5588, 0x6a0f6c4d, 0x8030da8e, 0x260f3563, +0xf37fb710, 0x4bc4280b, 0xdf424ceb, 0xce2d4f07, +0x62c1533b, 0x6f5d886e, 0x5c43a93c, 0x10ce554b, +0xf3344ba2, 0x367baa3a, 0xdf1a41a4, 0xdd72f326, +0xb64b3474, 0x1aa14e77, 0x13ab2b02, 0x2dd1b14c, +0x6251a41f, 0xbc2ad868, 0x1a5a773f, 0x0d182973, +0xf6cf5256, 0xe5de7026, 0xb0c4757a, 0xdf881114, +0x5a709dba, 0x566902c1, 0x774f0b5c, 0x530da677, +0x4dc49063, 0x97b887dc, 0x59014c4e, 0x1ab38f24, +0xca4dbee4, 0xf6328420, 0xfa836855, 0x8455485d, +0xcfcd7bbd, 0xfb2aebcc, 0x94257fe9, 0x29160624, +0x9ae408fd, 0x13e5949a, 0x047d8720, 0xdb09ebb6, +0xc955552c, 0x43da766e, 0x6e123411, 0xff82c678, +0x782664b0, 0xbbb244c1, 0x224c9d74, 0x5c74785e, +0x2df2e197, 0x1e4bd29e, 0xe7b6ddf6, 0x38f26f43, +0x4b93e4be, 0xc6b2bfa3, 0x7ae64abf, 0x452274ff, +0x80a4bcb4, 0xb7687c61, 0xc5099de4, 0xd19170ce, +0x92173852, 0x73b6ad9f, 0xea34de77, 0x86742c64, +0x57f9033a, 0x31577d90, 0x1629df0e, 0x4b55326c, +0xfa067790, 0x2f246b14, 0xdad8f031, 0xd919dc51, +0x9c83d906, 0x6fafdae3, 0x95c6fa4b, 0x9f2dfba9, +0xfd928c9b, 0x55a42802, 0xfd0e3d4c, 0xc6d26a7e, +0x034ac257, 0x1469c23d, 0x4e527b79, 0x90875141, +0x0b252065, 0x7eb81a39, 0xf21e8cdb, 0xca356d2d, +0xa38a8522, 0x8bea3773, 0x97b824f0, 0xbdb671e4, +0x31add380, 0x520d10b0, 0x2e8cfbf5, 0x2f7b0a49, +0x76028c8d, 0x582ddcb7, 0x68dd905c, 0x0594c112, +0x9c4cfed1, 0x66e9fe06, 0x30f7f1c5, 0xd58c83cf, +0x3e6bff0a, 0xc0b05712, 0xacc902b4, 0xcc9cdf7b, +0x16429f5f, 0xd8cf1ea8, 0x649e9a0a, 0xf86391dc, +0xdc7dbbe5, 0x883c9bb5, 0x586c59d4, 0xf68a4425, +0x0effae83, 0x2765f8c7, 0x9dec949a, 0xcd538d98, +0xc323c538, 0xc50cd573, 0xc4e1cdd4, 0xd8574535, +0x438c854c, 0x807c4892, 0x964d2f34, 0xc2d693f1, +0x6b594b23, 0xa961cba4, 0xf8acda81, 0x229129a0, +0xecbaccc9, 0x312e065f, 0xbbd3f413, 0x674b0412, +0x0f8902dd, 0x9588c5f5, 0xd1752877, 0x245a5fe1, +0x9b29c95a, 0x7e05fa35, 0x3323ef77, 0x201eb09f, +0x10fa852c, 0x400ed056, 0x4fc6d12a, 0x5496cc5b, +0x4cb71ab6, 0xad2b0dd4, 0x8ba11dda, 0xfda49e94, +0x573da109, 0xeda3430b, 0xb59f2117, 0x57331908, +0x032a4a58, 0x53affca9, 0x824db8d8, 0xd5af6b36, +0x6a6e93a7, 0x7d78cb00, 0xc40d3c54, 0x7737dd27, +0x9a5ae9da, 0xaa1be2f7, 0xc7c9f6fd, 0xd7fd2c97, +0x3fd85f2c, 0x8a08cdc5, 0xc96eec8f, 0x0cf2aba8, +0x737c5368, 0xa9da9d58, 0x9e7b1ff0, 0x00ce78e7, +0x7fa4f537, 0xb5d36bbb, 0x3e992900, 0xe323924e, +0xa51124b6, 0xcad76991, 0x445c686f, 0xe3551d3e, +0xd40caae7, 0xd39ba25b, 0xc5644458, 0xaf5156a1, +0x9675eb28, 0xd3a63585, 0xe29646ec, 0x485bceb2, +0xe3aa7b27, 0x85ab796c, 0x18043598, 0x044cab22, +0xe9e0d5af, 0x2c93652e, 0x9c80f8a9, 0x13855dee, +0x43ad2500, 0x473bdad8, 0x15bcb641, 0xc12132df, +0x16a01157, 0x2a4b2ea2, 0xfd219cd3, 0x28fcfaa5, +0x5037c59d, 0x5ec5521d, 0x61ccd014, 0xead52fea, +0xcf93f5f9, 0xb0fc61f7, 0xdef9ab10, 0x95a111b6, +0x43e264a7, 0x4c83538a, 0x4254b7d0, 0x44245846, +0xc4d46754, 0xc3e1685b, 0xae68d4f0, 0x63a6f2a3, +0x3c719db5, 0xcf976fe4, 0xf44a89be, 0xecf9ee18, +0x40183aa3, 0x6999bc08, 0x091d2491, 0x39780a3f, +0xc2462fdb, 0x388189fd, 0xc847ce52, 0xf0994a75, +0x995662c1, 0x2bd043c7, 0xb11dfd41, 0x6b898b49, +0x1acb6737, 0x89a2562c, 0x93f28c86, 0x63c2c4eb, +0x6527108f, 0xc5ef600e, 0x73df1a65, 0x11ebb7eb, +0x41856daf, 0x1767bd64, 0xc0025544, 0xea15bd60, +0xc42f19f8, 0xd4d76a01, 0xb8b498d2, 0x871f556b, +0xfb169436, 0x35075801, 0x3d34bfe7, 0xe37f9e78, +0xf92aacce, 0x0337ed67, 0x6f922c19, 0xcb16205d, +0x64de0289, 0x05bf5b29, 0xb5d4f116, 0xc7ab8983, +0x2ea25103, 0x074d9d86, 0xc62aa2d5, 0x54d690ce, +0x1ede6460, 0xeee7d36d, 0x7cd6cdd3, 0x8f4229bc, +0x0570d57b, 0x04ad39a1, 0x7cd15102, 0x91bb5ee3, +0x79f1127b, 0x1be18393, 0xeb08d499, 0x0a129f00, +0x317698c5, 0x51e97db6, 0x43be7184, 0x60f0e1e0, +0x893a4a1b, 0x956b4573, 0x348c2d8e, 0xeb8d44c4, +0x1d882336, 0x570ea9b9, 0xfd2b4840, 0x31d3e4d0, +0x6c847ce6, 0x19a1c156, 0xae486e3f, 0xa561c15a, +0xf6d17240, 0xfdd227ad, 0x68166bc2, 0x1a1833b3, +0xb2ef6b52, 0x9d9e8f96, 0xa32cf0aa, 0x0d842cc4, +0xb043b8f0, 0xf86504bd, 0x3f8b3fab, 0x27be7e49, +0x054514c8, 0xdea56aeb, 0xc9035b88, 0xf7a8fc1f, +0x73474571, 0xa59b9c5e, 0xafac5515, 0x6efd6cf7, +0xf6e5d1f7, 0x9fe7b019, 0x1e803d0a, 0xf41528ea, +0x7e7b9484, 0xc2b9ba08, 0xb06380f9, 0x9f6a1693, +0xd24da7a1, 0x763e743a, 0x31aff904, 0x6002f4b5, +0x29b02418, 0x2d8625ef, 0x81769382, 0xf039c5bc, +0xac9e1b64, 0x13c365bd, 0xf17a6aac, 0x0d9d4a35, +0x9a21f1e8, 0x8f7fd966, 0x198c10b8, 0xdae1dcfe, +0x4bc4554a, 0xc9db11dc, 0xda390633, 0x805d92c3, +0x67587f74, 0x0902e431, 0x3bdc5924, 0xd233b98a, +0xb28d691a, 0xd1a4ccb4, 0xa018da61, 0xee351cca, +0x01a31d48, 0xac4d5d83, 0x8de2b505, 0xc3df3bd9, +0x709c1cd2, 0xaf49caf5, 0x660dbe45, 0xc70a2fee, +0x493d2ce7, 0x690e2074, 0xb09bd9a1, 0x33626427, +0x0aaa5373, 0x8a269cac, 0xca74eb75, 0x606c73af, +0x7444b04a, 0x94bc9fbb, 0x551ff890, 0x17f664d8, +0x3ad5fa10, 0x49b9e14f, 0x233f3df6, 0xfb3d6ad0, +0x16df0f87, 0x315010a0, 0x90e0c20f, 0xeb877c8b, +0x5e2e9d69, 0x4ae2f276, 0xfad68759, 0x868f1ef9, +0x6307e1fe, 0x8330548d, 0x106997c8, 0x19f53052, +0x8f159959, 0x69a47ae8, 0xd6b91095, 0x3abe54d2, +0x70039348, 0x0a1055b1, 0x4dbd0a13, 0xbdde75b6, +0x9d4a8669, 0x3fb0c68e, 0x8b792843, 0x5b14df86, +0x6e8ecbdc, 0x9c1edd91, 0xa7d80f82, 0x942c3c3f, +0xd9772de6, 0x7425da33, 0xa62a6141, 0x4e1719db, +0xc26185fa, 0xbd8568b4, 0x1403fea3, 0xf4eb237a, +0xfcbfe47f, 0xb841a0c1, 0x57417d8c, 0xcfbf38e0, +0xbd26b4ba, 0xd64f1169, 0x3eee5d06, 0xe274eb0a, +0xb2735e64, 0xb302160f, 0x62759cc0, 0x6a16cd81, +0x41ef6cc1, 0x835f059f, 0xd1cd3c8f, 0x3d7af663, +0xf966f8cb, 0x64e575ad, 0xf13eedf5, 0xd0d19ff3, +0xc09cefdc, 0x017427c7, 0xc066a76d, 0xe42e3b00, +0x7bf9367b, 0x8fa16f8e, 0xf9be1858, 0x3189b716, +0xbdc6df76, 0xba194bfc, 0x74826fc1, 0x3b269fe2, +0x31900ae3, 0x1339a812, 0x642fcdd3, 0x647b30bd, +0x79780550, 0xbe542d77, 0xd0bdb213, 0xd761dc24, +0x7e24b208, 0x874cb149, 0xe840ae53, 0x88f58db4, +0x08e8e882, 0x006ba2a3, 0xb907632e, 0x15e40e34, +0x8bc93923, 0xd31b8556, 0x0c50ae4a, 0x5d7a37e2, +0xd09700f5, 0x607dec4a, 0x90beed17, 0x144d0191, +0x28a3204e, 0x8bb15a2a, 0x8f3f98aa, 0xe2f71679, +0x878de460, 0x3eed4d7c, 0xd1b11c96, 0x9c200f58, +0xf47692cc, 0x23f73c42, 0xaed3044a, 0xa2f36643, +0x82f823b3, 0x2056ca6d, 0x4a0b80b7, 0xebca337e, +0x0540b8f1, 0x64bfee30, 0x676d9c73, 0x1e2afe5e, +0x13db7a7d, 0xd0dbafda, 0x8d0be644, 0x1d072f84, +0x633a268b, 0x6f26fa7d, 0xb2029de6, 0xf84deab3, +0x00944d57, 0x9310d2aa, 0x0203b6c5, 0xd07e2ba5, +0x00c769e1, 0xff3cceb2, 0x487668f6, 0x2f9f6129, +0x2c13216d, 0xbfe58443, 0x7bc30ba4, 0x7ac6f34f, +0x6a246d0a, 0xd446aedc, 0xa659417b, 0x3206ddc8, +0x0bc58866, 0x5ae7d216, 0xbc275f5e, 0x1d9a116d, +0x204f0e72, 0x22eab064, 0x6653e417, 0xe716d086, +0x3fbe3cc3, 0xb934a953, 0x85ae194f, 0xff32b1d4, +0x4ba4a9f4, 0xcd21c9b9, 0x9d46b845, 0x6414aea5, +0x4efa5686, 0x4f998f47, 0xfad20069, 0x50e3ccc1, +0x1b9ffbc9, 0xa1e78c02, 0x23edf43c, 0xecfa76df, +0xb47a7750, 0x2424eec6, 0x0003bc2e, 0x25f2f63c, +0x1e956d8d, 0xed4380de, 0xbe13649a, 0xa6164800, +0x1988efec, 0xfb4bc5f8, 0xaf97e560, 0xba9eac66, +0xf1ef36a3, 0x5284be9f, 0xded47e6e, 0x1095248f, +0x13c3df38, 0x76ee77bf, 0x7b66814e, 0x0e76ae00, +0x1e790983, 0xcc9c6fe6, 0x17d6b002, 0xfa3143b6, +0x5d5beee1, 0x2dfca82d, 0xfd5db8a5, 0xaedf9333, +0xc787eacf, 0xb19c427f, 0x2a9287df, 0x175070a2, +0x28cc6661, 0x793ba228, 0x6f9473ce, 0xd332b5f6, +0x2a909fc9, 0x6cf77de4, 0x30c887e2, 0xa402f610, +0x896983a7, 0x099d77a5, 0x8fba6e45, 0xec8d78a7, +0x13bf88a9, 0x29bf13cb, 0x38e3ca8b, 0xee4fce1e, +0x8f76e2c5, 0xc83c13cb, 0xad19ba72, 0xbbf775d1, +0xc3cfd563, 0x8126aa90, 0x08af2a49, 0x66aa129d, +0x1d07d1b8, 0x97a60350, 0x893faa1f, 0x4875b79e, +0xf911da75, 0xf96a9e99, 0xbb8a3983, 0xeea026a1, +0x45254a63, 0x16776dc3, 0xbb5986a4, 0x1125b9da, +0xaf2ebbd2, 0x0bc7ed0b, 0x000b9e39, 0xe8806e4c, +0x9fb5b43b, 0x80f70151, 0x1fbeff99, 0xcc80b937, +0xb4b3cd54, 0xc6f963d6, 0x23f8d84c, 0x5033ef4b, +0xcb4d148b, 0xd0a691de, 0x55cb9dd2, 0x41e2c318, +0x1b7b2a22, 0xa44d832c, 0x29056605, 0xc388c3ae, +0x078cb470, 0x0b0b7ea1, 0x4f1adc1e, 0x02f5e07e, +0xc2b10372, 0xaeda5ef2, 0xc2d37883, 0x76961afc, +0xc04ae911, 0x9e1b39bc, 0xa548c8c5, 0xf948fe3f, +0xf4012a73, 0x47e9dd88, 0x4063004d, 0x9449f465, +0xef3e0109, 0x5e6ec221, 0xcbffab7b, 0x289a2a69, +0x7c59b240, 0x8d78e947, 0x71351c46, 0x443c3f26, +0x8d3f8d00, 0x2166f0bc, 0xe95eba29, 0x3679f59a, +0xe9992e9e, 0xebb86d44, 0x7c66c2fd, 0xe0f6e222, +0x91ec67b3, 0xc012bc99, 0x5271b087, 0xd43af550, +0x14b93b7c, 0xa5074e1e, 0x6d106d75, 0xa386dfd3, +0x2d314352, 0x55753faf, 0xdad16574, 0x4b29f128, +0x33434bcd, 0x84855cd8, 0x0878f099, 0xdc940d15, +0xa9038b3b, 0x3571804b, 0x00192b45, 0x1f0cb558, +0x347418c8, 0x1afa5d3c, 0xf0dbbbe8, 0xef531810, +0x99cc9dd2, 0x51d0a70d, 0xa954bdde, 0x349d5b61, +0xce2bd913, 0xbbae8c1e, 0x66fcc496, 0x4d498d10, +0x10615b04, 0x982b684f, 0xb4cfdcc6, 0x5e29a5ae, +0x223cfbaa, 0xcc8c1882, 0x0ea7575d, 0x0163ad7a, +0x6aa26379, 0x69722935, 0x0af233c0, 0xf51abf64, +0xd452c60f, 0x47ce5397, 0x510c2f99, 0xe32e41f5, +0xf32d012e, 0x0f939ee8, 0x0b6af99a, 0x7539157b, +0x71d3234c, 0x693d6607, 0x5ef52df8, 0xe290a866, +0x8e2acdfd, 0xf189e443, 0x1aacd10c, 0x7d87d702, +0x1fe071b9, 0x5e79779c, 0x80644c2d, 0x1b785e6f, +0x2302c049, 0xe40a80e1, 0x53e2b0bf, 0x6377e3a5, +0xa335f81d, 0x037ed213, 0x39875c67, 0x0b7a6830, +0x94a1e84e, 0x8f07c753, 0x19b09574, 0x61b63f0d, +0x173b7422, 0xef023ba4, 0x6e47d8b6, 0xa79f5bf0, +0x54978e64, 0x90f76944, 0x4b584cd1, 0xf9b79938, +0x3c5998b7, 0xc54351a1, 0x7f2cc803, 0x5af90d76, +0x96301971, 0xd258b360, 0x59a740a7, 0x352c21cf, +0xa16a516b, 0x6692772f, 0xbab65aff, 0x326445e3, +0xa6a7dd91, 0x318103fb, 0x8ebecb0e, 0x859212be, +0x6b3d899b, 0x649e6ba3, 0x3f99033c, 0xf7104cbd, +0xd76bd42f, 0x29e8fef9, 0xef185f4a, 0xb5e5f606, +0x9641851e, 0xb4b32aa3, 0x93e67013, 0xa51ee8aa, +0xecbec470, 0x2581de2c, 0xccb14a7f, 0x06578787, +0x5c911910, 0x7eafd899, 0xb9f271a3, 0x824e44b3, +0xe7c96ca3, 0x32bfd6c4, 0x8e6344b4, 0xce64a014, +0x2ca348bd, 0x8001aa0f, 0x8d0fe42b, 0x036330d2, +0x3d1ce5b8, 0xe4d9e1cf, 0xb7c2d8af, 0x4509d794, +0x11a1ef5d, 0x14ac826d, 0x0b1ecf86, 0xffaf61ed, +0x699de5b1, 0x2e372ca9, 0x6a825d27, 0x3f1187cf, +0xe3e2770f, 0xa6b50360, 0x5031d731, 0xd35a2d2f, +0xf7b7c174, 0xdfe3442b, 0x5a938a6d, 0x2ec4df35, +0x7b8d7b55, 0xca98f78f, 0x65b4d4e3, 0xdd649cfe, +0xcaa7dd73, 0x691898dc, 0x38b67c17, 0xfb39f7ff, +0xcb97de9a, 0x18da4057, 0x948c7d49, 0xbcc4f190, +0xfc385aaf, 0xef8d35b8, 0xc201690d, 0x68d63884, +0x0d17155b, 0xfb3cc86c, 0x0d839a26, 0xe45c60b1, +0xbc05c2cb, 0x97f17b07, 0xd8b16048, 0x0cd273b4, +0xc3eef64b, 0xe1244ac1, 0xa12418fb, 0x32217cef, +0x51ae0bbc, 0x43f7ca50, 0xd18eb62d, 0x160aa215, +0x66fccbd7, 0x5d2574c6, 0xe357f069, 0xa585c6c0, +0xcdfd48b5, 0x5f074612, 0x7600472f, 0x7ec15661, +0x263efb4c, 0xb3313d82, 0x72e030ee, 0x521615b1, +0x08aaa9e2, 0xc17e188b, 0x65ab0257, 0x2ae6a6e8, +0x269dbeb2, 0xc24d1ad8, 0x18b6d8d6, 0x1de37162, +0xd059f3c2, 0x4a3c5b74, 0x95a845a5, 0x1d554557, +0xde2b7e09, 0x2ae5b15c, 0x251d1c05, 0x16697123, +0xf33a05c6, 0x2788c589, 0xa576f5ed, 0xf1f2571a, +0x2103f943, 0x04b9f783, 0x2e1f585a, 0x8abc9f68, +0xb43d2ad7, 0x015ced58, 0x28c119aa, 0x8e98ac2a, +0x4362832a, 0xe1cfb958, 0x521f86f7, 0x832350c5, +0x56b3e81a, 0xfe7c79a2, 0x1d608935, 0xa6f36579, +0x6be29791, 0x60bbab30, 0x2de796e4, 0x235c7698, +0x5cfc2be0, 0x7516c2e9, 0x304cb84d, 0x8f51d682, +0x0c5d32bb, 0x6edb8756, 0xa89ff9bd, 0xf3f9c9ec, +0xd61b8e29, 0x08422ff1, 0x10b41b4d, 0xafa53dc5, +0x3e9dddb1, 0x6aac8acf, 0xf463dda4, 0xd3acb4c2, +0xb0270316, 0x2db6f0aa, 0xb2db4d8f, 0x25ad60bb, +0x3e3f2849, 0x2561c42e, 0x03fde255, 0x74e24fad, +0x558d0175, 0x16ae5d50, 0xc16e3f30, 0x7e6e69c9, +0xcbefe0ab, 0xb198bb6a, 0xbb69ca3f, 0x13fdcb0a, +0x6d36f1eb, 0x345f7d16, 0x47dbd655, 0x96c59cc5, +0x8ba0fdb9, 0xa6ddb284, 0x37662e9d, 0x6a46fe2a, +0xbf23e609, 0x74da2fdc, 0xf8edc79a, 0xa31d8797, +0x6136d1e4, 0xc1dd6658, 0x70c9e751, 0x324ad10c, +0xbb00e16c, 0xb7dd43c3, 0x586f7e53, 0xffffc9ce, +0xe74bb552, 0x6b889bd1, 0xaff0e7a2, 0xa83b3961, +0x478a0b63, 0xe92a339d, 0xe7b39a5b, 0xdc3c89bf, +0xe13e6b7a, 0x65767f2c, 0x760cfd00, 0x6688b656, +0x43a130d7, 0x346f7911, 0x62375268, 0xff65e7ee, +0xdfd6df6e, 0x681c8d83, 0x1378a363, 0xb6a753e7, +0xfa081a75, 0x181e446e, 0xfd0a45ba, 0x7000233e, +0x10585c5d, 0x213c8216, 0xc2d05761, 0x45b5e88e, +0xc1a27127, 0xfcef2bfe, 0x63909be7, 0xc2104eee, +0x05d7efe5, 0x423f6532, 0x47cd9e9e, 0x9a5f92ba, +0x74e300b1, 0xfd373a1b, 0xc2a77188, 0x480ca029, +0xe61790a3, 0x9939f9ec, 0x11675655, 0xd0ca1782, +0x9a20f34e, 0x592a66b9, 0x2a81861f, 0x1e9fff13, +0x6784c871, 0x621a4abf, 0xcba4ff79, 0x341c60f2, +0x2781b1f2, 0x0be8e0a5, 0xd5a9de56, 0x62207038, +0xafce8f1d, 0x82c4d244, 0x157c56ea, 0x91d2bd91, +0x601d5397, 0x8a1c8e62, 0x161442f9, 0xc4849f24, +0xeab3eac3, 0x4da38afd, 0xf8b45959, 0x80721986, +0x323137dc, 0x5dbe6ae0, 0x99f08a9a, 0x2818012b, +0x3dca557d, 0x99b9486d, 0x99127aa6, 0x0e9e0319, +0xe236999e, 0xda488f81, 0xd06cd683, 0x7875c390, +0x8128651f, 0x35a86124, 0x0ac3d1bc, 0xf525016d, +0x6cfe8dd8, 0x3b8c4aed, 0x788d9dd6, 0x07a6dec4, +0x5f1aa876, 0x8d7328a7, 0x137f58b9, 0x95698602, +0x7008f9cd, 0xd8ede6ee, 0x40265bf9, 0x0e8f9061, +0x0574dad3, 0x0c1ecd5c, 0x6d71641a, 0xcee7e50a, +0x46f4f4a6, 0x4c3dd09a, 0xe55eda44, 0x93df7ced, +0xa2a42091, 0x125659fa, 0x1219964b, 0x6d785afa, +0x10e5d708, 0xdda51e82, 0xc0fbc3ab, 0x33fff955, +0x6a911160, 0xe5bd1ea0, 0x7d465772, 0x530222a5, +0x90ccc4f0, 0xa7064a06, 0x67c339c7, 0x74d635cc, +0xf3d92fdd, 0xa5768de6, 0x0069a262, 0xe64b6bc4, +0x3286aef9, 0xb17f1092, 0x88477a1a, 0xe260edce, +0x114492d4, 0x2727b601, 0x6d3cf277, 0xd826a342, +0x4a6d2a40, 0xc5905ec2, 0x8955dd5d, 0xc58f4876, +0xda17efd2, 0x74600aa3, 0x568aea9a, 0x832891f5, +0x81d99890, 0xb22ff0ef, 0x89f69d1f, 0x4e95cfbe, +0xf8b41ec8, 0x034e60e9, 0x909a8e8c, 0x7ced24e4, +0x8536f47d, 0x2faddaa0, 0x56bfc916, 0x67553a95, +0x50a55b9b, 0xa8d14ab0, 0x07db9ec6, 0x4cc70c7f, +0x220f6980, 0xd45b442f, 0x85ea1c39, 0x7b8c27ed, +0xee46ea91, 0x1cd0c518, 0x1c1e6fa0, 0x1cce1b74, +0xc7a08fa3, 0x5be134fc, 0xf44f5d79, 0xa17c82cb, +0xa7f4aff5, 0x067645a0, 0x6e64d30f, 0x2d7ad0dc, +0xc1207c0e, 0xa02f8a43, 0x739cdb46, 0x4619280b, +0x0cb34fa9, 0x16df8b2a, 0x14fe98cb, 0x7e6bb54f, +0x47283e0f, 0xa50e98bf, 0xd886b056, 0x90289e16, +0xe0a64a18, 0x939f1f46, 0x34a5885e, 0x296989c3, +0x49f3048c, 0x555919a6, 0x4e6a9aeb, 0x212c1e35, +0x40d8833a, 0x81ef66e1, 0xfe529852, 0x18930cf1, +0xe3b8e906, 0xef96010c, 0xe40527b2, 0xe899c2a3, +0x050c69a9, 0x0099715a, 0xfdfa66ae, 0x0180a8d4, +0x42040f5a, 0x4d9ec3b0, 0xfca8c81f, 0x3a93f196, +0x73d0ba79, 0x713e0fa4, 0x8517a188, 0x994648f9, +0x27f6658b, 0xdfbf7fee, 0x2309883c, 0x38badc0a, +0x0731df93, 0xabae8f87, 0x6a70fb7c, 0xbf2c2f39, +0x064c3aa6, 0x5b786010, 0xeffdbc67, 0x8e7f687a, +0x6ea63eb4, 0x8958e410, 0x272fa52c, 0x4e089c4e, +0x47423db1, 0xf11e8379, 0x6208a581, 0x516ace10, +0xf4a36a96, 0x09219cdc, 0x6e511f1a, 0x2005c55f, +0xf85639e3, 0x3f8dd13f, 0x165e8ad5, 0x0405dfbc, +0x3b124588, 0xa4269368, 0x84c47161, 0xc48df2d6, +0xd1ba2db1, 0x5764fa62, 0xcc304ad6, 0x413ebbd4, +0x76e49082, 0xd69283ba, 0x32cd1452, 0x388a3680, +0x23bfcac6, 0xb2e16d6a, 0x8e29f85b, 0xedf3551e, +0x4c6a9be5, 0x0bb0ec9c, 0xa4ca854e, 0x88e793de, +0xae75f8d4, 0x1c57b6e7, 0x2e34a6ff, 0x40f82c88, +0x5ebb4468, 0xd1c37226, 0xe395da67, 0xdd9bd3ef, +0x933b870d, 0x0ad81dc0, 0x0b33da0f, 0x3107642d, +0x819ddf23, 0x67b9191c, 0x4ea9bb86, 0x049a52ed, +0xf6b87619, 0xc6dfc0e0, 0x3d0aaef5, 0xc44389ef, +0x7f706325, 0xfa5167b1, 0x1a59c5eb, 0xc1c4de8f, +0xe0465ab9, 0x2c80955f, 0xd5a31e46, 0x33d26e77, +0x0fd8e6d7, 0xa13e3b9d, 0x1f4aa73e, 0xfc20ad58, +0x0568032d, 0x14994e3d, 0x54d7f001, 0x2adf2f4d, +0x5427e76e, 0xda616d64, 0x465adc68, 0x171d65dd, +0xc4179512, 0x9c358332, 0x641fc2b4, 0x93659b99, +0x25cc4905, 0x87f9f666, 0xd250eee9, 0x9df24064, +0x9d21fc45, 0xa5d47fa5, 0xfcb33d5e, 0x4409df27, +0xa6b2e1de, 0x9cf01cdd, 0xf0b88838, 0x910a5c60, +0xcd5c853c, 0xac74d450, 0x75256a9a, 0xa43ae8eb, +0xf7ae18bc, 0xd6643feb, 0x3cf11c7a, 0x7e1f6c23, +0x464d3aef, 0xf6809ae7, 0x402b5758, 0xd7fb46ed, +0xa6849673, 0x87e8390e, 0x4d198746, 0x797cd614, +0xd9c3dead, 0x57f03730, 0xa867c680, 0x9030c443, +0xbfc0aa0b, 0xf39eb1fb, 0x4144e617, 0x3be471cb, +0x784ca067, 0x670204e8, 0x557bdb9b, 0x63f90b47, +0x53dd8ec9, 0xaed83b19, 0xda126c2f, 0x22651b58, +0x139ae568, 0x2e9337d3, 0xa2ab2379, 0xc5cdcae5, +0xa57a86b9, 0x2cfdc006, 0xab4f4522, 0xde8a7ae3, +0xefc20825, 0xed2a96bf, 0xaba884c8, 0xc1835ef3, +0xaf9bce8b, 0xefa6c94a, 0x5aedc8a7, 0x3df70d7f, +0xa809af5a, 0x4c77c381, 0x65da41a9, 0x14aa6c31, +0x5c96c3b3, 0x1b9b8c6f, 0x20d3d700, 0x0cab3cd7, +0xeaedfee6, 0x8bc154e9, 0xe7efeeac, 0xb18bf268, +0x817d0aad, 0xeb679e9c, 0x79a27618, 0xfcff9288, +0x8f3874e8, 0xb675a6af, 0x7ea7e55c, 0x630afb38, +0x3a7c7360, 0x1a6fe439, 0x81fe3602, 0x5baf8f66, +0x8a83d85d, 0xca5776bf, 0x5682aa92, 0x93f7004b, +0x958bdf96, 0xbacb5c3e, 0xf91b0faa, 0x9e602ccc, +0xa9f6bb1e, 0x6c7ca226, 0x531fc333, 0x79e7bc8f, +0x7fb486a8, 0xb9f09da6, 0x978f8813, 0xaea9c7da, +0x518a4815, 0x3c59da4f, 0x6aa478c1, 0x68c203db, +0xbd19b2a9, 0x327b0cbf, 0x101292c7, 0xa264e081, +0x2a31c7fb, 0xebc4a6b9, 0xc65858bb, 0x5b4ddc88, +0x975e3ab9, 0x1faba7ce, 0x025724ef, 0x47fd7878, +0x442963e8, 0x0c9f771b, 0x6be0c726, 0xb8e9f8db, +0x01346870, 0x31680cbf, 0xddeceee7, 0x0ea3c0b3, +0x2ff2ee37, 0x09c5dc1c, 0x5fe6e4ba, 0x20f6c8f1, +0x454f90a8, 0xe68bf7f4, 0xfc1291a0, 0x05c8f04c, +0xd433f3f6, 0xe2bf2378, 0xebda0af9, 0x623d7e32, +0x21c1f72d, 0x02001cd1, 0x2eb3624a, 0xefff3e22, +0xb8e64f02, 0x82d68caf, 0x22b12428, 0x93b55f9a, +0x68683eaf, 0xfc455201, 0xec27ee24, 0x28d9ec4d, +0x6caeff40, 0xc0ea3539, 0x3dec11e7, 0x699711f8, +0x5b26911d, 0xd7ab13fd, 0xaefd9baf, 0x6e8c23f5, +0x0c030b9c, 0x341e117c, 0x8418c5ba, 0xea5ce7c1, +0x1c625cc2, 0xe0ef8e86, 0x520e087c, 0xafe3f070, +0x116dc0a6, 0x48f62e7c, 0x9dca4736, 0xf86da114, +0x246bc04d, 0xa21b2c0f, 0xc4c19068, 0x0e497266, +0x330f8a54, 0xcfdf8850, 0x3daaf48b, 0xdfca0757, +0x055644eb, 0xde93f193, 0xf07c81d0, 0x0d82009e, +0xcc16d2c8, 0xf1bbc24f, 0xdc59aa5d, 0xff1fd475, +0x3bf9a1ee, 0xb2d87746, 0x1cb25b02, 0x61b376a3, +0x8e84c010, 0x4a39e601, 0x29a23f95, 0x9363de96, +0xb11dd901, 0x650dfebc, 0x1a863d94, 0x89663e7f, +0x29ba7269, 0xc8b7bfb0, 0xca59a454, 0xef9b10c9, +0xbb86e7f6, 0x622749d7, 0xded81fd9, 0x78a6f1e6, +0x2d0d45c1, 0xf69524f0, 0x2ee19141, 0xbf80a4ba, +0xdc9d388b, 0x4d17c2aa, 0x3982894a, 0xae3425ef, +0xbb671792, 0xc6c50feb, 0xce6002c5, 0x20cf44cd, +0xc5876dcd, 0xbc3ddf2d, 0x8fa44a29, 0xe6c80f2d, +0x6c21f538, 0xe856dd15, 0x143a47f9, 0xcbb89699, +0x68d2d175, 0x7f7e33c0, 0x4edd2b81, 0xdb4cb2b1, +0xfe969caa, 0x907c8f56, 0x803dc573, 0x9ea61b43, +0xfe05d8ac, 0x86a19cfa, 0x0d4ae0d2, 0x17a1cc04, +0x70370019, 0x01a316b7, 0x305140da, 0xe71c56b2, +0xeb1374e8, 0xa4b666ff, 0x325dab46, 0x21aa313c, +0xa03842a1, 0x87bde18e, 0x8e1c1319, 0xfe51e1c7, +0x2ba5c43b, 0xd7bd49d8, 0x10828786, 0xad65c137, +0x797db05f, 0x90c056cf, 0x0c262d95, 0x859cb356, +0x4ea7c867, 0xc02f29b7, 0xd6fa4fb4, 0xbd0ff5ca, +0xaf5bbe20, 0x7869b109, 0xa4207af8, 0x57debe45, +0xb7f3bbf8, 0x1a70213b, 0x3a2583f6, 0x53d46846, +0x5b5f282b, 0x60392937, 0xb7c63da4, 0xb4ea25b9, +0x4b1c589c, 0x39e57464, 0x8fc1e7ed, 0xedf338ed, +0x8ffcffe3, 0xc8f4b7f6, 0x85855c11, 0x514d043a, +0x85eb0042, 0x00653153, 0x955b95a9, 0x8573e74d, +0x6671e43d, 0x463e1ab3, 0x13afbbdf, 0xb3afe61c, +0x3ba27c08, 0xf2e1aa47, 0x143c6e39, 0x1e874bdd, +0x39ad1e7e, 0x2fa0df3d, 0x5c6a7374, 0x21aa8592, +0xc394c2d4, 0x7baad2f2, 0xc8af3d8e, 0x0ea292f2, +0x4008566d, 0x69f4f782, 0xfa64d502, 0xa4e582e4, +0x0a035c5a, 0x02d3fc93, 0x14a5041b, 0x046d4478, +0x78f9336b, 0x89e6d6b5, 0x2daf9569, 0xaaa07d4a, +0x0a8cdf13, 0x22897ee8, 0x30b24044, 0x02b29fde, +0xc1931380, 0xce1d128c, 0xeda4c606, 0x2c58cf23, +0xcdde68f0, 0xa2575676, 0x8ba3111e, 0x241fe028, +0x6570bdd3, 0xd07aa614, 0x951ca154, 0xe3554eda, +0xbad0a73b, 0x72dbfe53, 0xdaf8397d, 0x342154bb, +0xffc00f1c, 0x261435a4, 0x87f488b3, 0x32a529b2, +0x60fdaa95, 0x2dbf42e3, 0x34673e5c, 0x6a133316, +0x82a0ccd9, 0x494844f8, 0x0969047a, 0xa1227869, +0x667f3a81, 0xee2e8924, 0x35c2eda5, 0x5e25ee7b, +0x157a87cb, 0x6cb96505, 0xb024e4e7, 0xd0507327, +0xb2ddf25c, 0x6c0cd65b, 0x3537a67f, 0x32c9f130, +0x74db6db1, 0x9f9684d8, 0x5ef2fe39, 0x8d3ca568, +0x1ab9d5b6, 0x7961b47b, 0xa751ac16, 0xe430b1e8, +0xd6cd0cab, 0x5762697e, 0xb209bda9, 0xa7345a39, +0x57419fa4, 0xbd815bef, 0x95c28e11, 0xad18d2a4, +0xdded8d65, 0x0747099d, 0x58733131, 0x0282d9dc, +0xb39c5af1, 0xf4b73ca8, 0x39c3b406, 0x3babb40b, +0xd15f80b2, 0x47e8ad8e, 0x8345b330, 0x0a57863b, +0x8ccc6089, 0x0b5f5cfa, 0x00f01434, 0xca73ad1d, +0x5d6fc01b, 0xfc79f989, 0x78976f47, 0x7be61434, +0xdb734362, 0xf73ee4fd, 0x1e355cfd, 0x824b1a8e, +0x59ed5403, 0x8d51482f, 0x1611e6cd, 0x93392bc5, +0x61d796ab, 0x82adaf78, 0xd2c31f18, 0x70a3c893, +0x6d6afbef, 0xa5f92a4f, 0x4ea18e66, 0xb1c180b2, +0x84967af0, 0xfc3db1a8, 0x86110ccf, 0x3f05a192, +0x286ccca4, 0x0631de32, 0xd82700d6, 0x64855648, +0xa5a04035, 0xcc137a49, 0x62b0d6f8, 0x630eb56e, +0x795495fa, 0xc3388be0, 0x601a9e33, 0x79b4bde2, +0x99f2ff6b, 0x7dabfc3b, 0x47b56751, 0xce0ae5f3, +0x1404682e, 0xb2928fb8, 0x5a316d10, 0x49d14cc4, +0x941e98ac, 0x19a36445, 0x0974b0e2, 0x405eb72a, +0x041630b8, 0xd1fb95af, 0x66613fc9, 0xa6483616, +0x733c3aff, 0x85212ca1, 0x5ec20ab8, 0xa00492da, +0xd5453d62, 0xea8e0c43, 0xe3a9c53a, 0xecf664da, +0x4bc54852, 0xc8d7a285, 0xb64c937a, 0x7cf9c7bb, +0x5a5f2794, 0xf95a488b, 0x40aaaf6b, 0xf60a9bed, +0x98bfe412, 0xfd06d08a, 0x88d278a5, 0x0afb39e0, +0xf210253e, 0x07c95769, 0xdf846bfc, 0x14c37e9f, +0xce436e70, 0x9413ece5, 0xcc6f8ebf, 0xefe58ec5, +0x99ecb8b9, 0x7b9aa224, 0x2b05b50d, 0xa6aca50d, +0xbb6d3cb9, 0x09a37003, 0x16088e73, 0xdc3b7717, +0xbbfebe4e, 0x9e05923c, 0x833cd04e, 0x8dc1b901, +0xad454bc6, 0xa0d22920, 0xaae5d2e9, 0xe6c850a4, +0x89148778, 0xab4cf42b, 0x3f9bcc9b, 0xec0d4add, +0x3a8123db, 0x2ed1e5a9, 0xfe89d4ec, 0x398eaadc, +0xf1bcce2f, 0xd39338ff, 0x0779e75c, 0xfe5cd4eb, +0xb7ab007f, 0x4c5ee558, 0x3e3bc037, 0x6eff4bdf, +0xda2cf14a, 0xe7b4a877, 0x279da977, 0xff82cb64, +0x334f0281, 0x177637c6, 0x7bd60d57, 0x75e82f65, +0x11cec2e3, 0xf8bd0678, 0x8b3433dd, 0x503cb9e5, +0xdc28a450, 0x1168d10c, 0x97eed322, 0x92237513, +0x17b4dd4b, 0xc10e383f, 0xe62dc256, 0x66a136c3, +0xea4946a8, 0x30f67dae, 0xac1e4857, 0xac847c89, +0xf201bb60, 0x144157db, 0xd71a3365, 0xc95e8cc5, +0x0c7a3d4e, 0x46408b33, 0x19a8283e, 0xc2c33819, +0x47c4e65d, 0x25357dd3, 0xa26927f7, 0x28a931de, +0x85417e2f, 0xb059a04f, 0x468ee67b, 0xdf439d90, +0x311f8714, 0xe21f1c90, 0x70c7808b, 0xcd64ff7c, +0x7edce917, 0x60152b7d, 0xd91adf78, 0x830797d1, +0xd7532d9f, 0xa3f177f0, 0x594b77f5, 0x4efc8040, +0xd3aabd29, 0x52426e5b, 0x9daeefe3, 0x1995660c, +0x4b6d4bb8, 0xea0e064b, 0xa3f868bf, 0xe8a7c0be, +0xd7193f5a, 0x84e7e6d9, 0x8ced1367, 0x11ffd230, +0x90cfb84e, 0x923ba6eb, 0xbe936615, 0x7cc2713f, +0xfcf17106, 0xc7100a15, 0xe76d1313, 0xf2d365b8, +0x8b28093b, 0xe04b42c4, 0x1a795a81, 0x21e277c0, +0x19b13901, 0x44688420, 0xafdcef56, 0xf20a2c50, +0x8eeb7d11, 0xce7172ce, 0x7712a9ea, 0x47024d24, +0x7585c8ce, 0x651f9fe3, 0xbe7ae4e7, 0x7c731bdb, +0xa8f7b191, 0x3191be03, 0x68cd4ba7, 0x786bc388, +0xc7ccee21, 0xcf14669e, 0xbda2078c, 0xe2f4f16a, +0x6ec02591, 0x2cef2ae6, 0x9616f35e, 0xb01878bd, +0x37934794, 0x6f6d4603, 0xad4344cc, 0x95a77228, +0xa71cb9ff, 0x9ac354b4, 0x1e3390f6, 0x69c0074f, +0x1d5df224, 0x4a9bb174, 0x58808d79, 0x33bdf9a7, +0xda2e64bc, 0xf27e005d, 0xf85bf9e0, 0x703cbefc, +0x5b393512, 0x38ead7b8, 0x7e2fc7d0, 0x4d5acf9a, +0x3fca1ec9, 0xf601a579, 0x371f29a0, 0x77b105bd, +0x0d90d7d0, 0x2d791c53, 0x8e555abb, 0xde2572e8, +0xbb3be8a9, 0x542bd4af, 0xcf2a7722, 0xd387d145, +0x7237c301, 0xcb0eff93, 0xbb647ba3, 0xa098e31f, +0x6baa650b, 0xf37c0660, 0xee0eeb0b, 0xb6663f69, +0xe8d14e2a, 0x58b953d7, 0xda00d209, 0xb0cb0e0a, +0xf51e3a46, 0xa043105c, 0xd52b7cf4, 0x28f8d372, +0xd50aa1ec, 0x36841bad, 0x135d9d4e, 0x5ba46dcd, +0x3af293af, 0x9d30b071, 0xe671a2ca, 0x4d26a16c, +0x675dde08, 0xa3c867c4, 0x42e56994, 0x4d127b3a, +0xbf9e5fc6, 0x1413586f, 0x749d7f68, 0x9d6d443e, +0x6c1cbaed, 0xace6c81c, 0xc039c232, 0xf6c0ea35, +0x0bc8b667, 0x45608cec, 0x4f15d999, 0xea88a34d, +0x0ba708ae, 0x7a44d7e0, 0x5a3962c5, 0xf3ead40d, +0x94947ab3, 0x24c1d3b3, 0x1fff8233, 0x8bcceb18, +0x32d56aa8, 0xc66e4914, 0xb79d38cd, 0xaa16dd9e, +0xdc346103, 0xc95160ff, 0xca5a8509, 0x2db2150c, +0x48c2a7cb, 0xb625b0cc, 0xcd589bf3, 0xb98225e4, +0x9b2968f6, 0xca846f79, 0xa74c0779, 0x223f8819, +0x0eb6f0c3, 0x4be37e4e, 0x09b43ef2, 0x3a800a25, +0x2e3d5e95, 0x6fb02b0b, 0xc1ebc2de, 0xc88904ba, +0x6ab8607d, 0x50938290, 0x2a70c087, 0xc87654eb, +0xc0d31002, 0xe071273a, 0x638776c1, 0x228bb1d2, +0x0f895e64, 0x6da19b27, 0x593ca482, 0xfe6a04cc, +0x61222fe6, 0xc5738a7d, 0x185a904f, 0x37d4d38c, +0x5126e735, 0xef2e400a, 0x2678a752, 0xff345eea, +0xfb186f11, 0xf503069a, 0xf6edd03a, 0xeff94d64, +0x1dccda62, 0x58b42758, 0xb313524d, 0x1ddb3b7d, +0xbe836c71, 0x49616b09, 0xbfaddb9d, 0x1ecfcc0a, +0xbac889aa, 0x63df6f5b, 0xdb138875, 0x389dddfa, +0x1d539fff, 0x0d052c97, 0xb2f9311e, 0x76b170d0, +0x60a76671, 0x1d64bab7, 0x71663d4e, 0x6e8da367, +0xb067a63c, 0x65a802dc, 0xb5595623, 0x25cab438, +0xcf9a71fc, 0x26f5de9b, 0x81d81176, 0x0878f9a8, +0x0c786f67, 0x94ea13d8, 0xce2f7a64, 0xccfddc22, +0xe9f880fc, 0xbb099585, 0xecba3e6c, 0xb247f339, +0x3688cee8, 0x7e2d8664, 0x040f41f5, 0xb44cf82f, +0xf19e1c84, 0x667dfc58, 0xe269f009, 0x22285a60, +0x498f4b76, 0x370daf02, 0xadda54c3, 0x4811b5e4, +0xd791b4f0, 0x249c48e7, 0x0e2904b1, 0x416d84a0, +0xcefe14ca, 0xbd0634c1, 0x2d16413d, 0x95040e8f, +0x54622be2, 0x1293b3fe, 0x1597428b, 0x4fac68c8, +0x696812f1, 0x8e398c5f, 0xfaf087ae, 0x136af2ee, +0x2d23f1ce, 0xd81b241e, 0x33031de3, 0x4a5e98d0, +0x16c91254, 0x95378e44, 0x0bec4cc7, 0x41e5c323, +0x1b3d7080, 0xdf8fe0e7, 0x9782332d, 0x7c783776, +0x1fdd1349, 0xccace4d8, 0x5829a22b, 0xdffb56ee, +0xdaae00ab, 0x0f4c5a7e, 0x467dfc4f, 0x7f7cdb5d, +0xe44bb887, 0xff1faeee, 0x59764f94, 0xceb49a90, +0x7caa6527, 0x1eed12c9, 0x4a3264ce, 0x7de360cb, +0x13798cd1, 0x16b45098, 0xbb1ec286, 0x36b94079, +0x4bbc7791, 0xf536fe0f, 0x969a9c5c, 0x52171418, +0x67c132cf, 0x92e26ac4, 0x606ef579, 0xde159214, +0x8bdab748, 0x719bb210, 0x042e227d, 0x5e0e12d3, +0x1d0d59b1, 0x47c1a01c, 0xb33b34f5, 0xa33821c2, +0xc0f79c88, 0x2398165f, 0xa77a1716, 0x0457ebaa, +0xcd08686d, 0x25bff5bc, 0xec844783, 0xd5fdad87, +0xe9da6e17, 0x532363d9, 0x9cc2eb8c, 0x70150597, +0x54acacd0, 0x68856b47, 0x5da7ac56, 0xb25d6dcf, +0x952a96fa, 0xacc2faa6, 0x5c26561d, 0x7cd9daf4, +0x94726a30, 0x3ad71249, 0xb13160c8, 0xa9b63ff1, +0x616575a3, 0x040451fe, 0x3fe66771, 0x3443d479, +0x5491a784, 0x25334d5c, 0x87307f25, 0xe1c21489, +0xdcb3f1a0, 0x132becf2, 0x17fa544f, 0x1f660a8d, +0x2b41611d, 0xc91d8510, 0x4db08ed5, 0xefff5417, +0xc93d950d, 0x5d7db9fc, 0xeab6d142, 0x253b2ded, +0xe30a0906, 0x1cb83b04, 0xc50caf2c, 0x0fa2a975, +0x3a3521e9, 0x32883899, 0x04c6a538, 0x18a26d1a, +0xe9fd6c92, 0x6a0c374f, 0x0ea31fd9, 0xe1d0c29a, +0xdfdc2004, 0x5fbc762e, 0x5aa9b1a8, 0x975fc4c3, +0x86412f07, 0x81216989, 0xf984d082, 0x01e4851e, +0x1cc00f29, 0x69477142, 0x7997a71c, 0x7015f529, +0x76d37042, 0xa89dc78a, 0xa883f4d8, 0xd1f6b472, +0xdea624d6, 0x3a210bb4, 0x9c583d31, 0x7a2493ec, +0x54f7d53e, 0x31773dec, 0x9e0e7cb5, 0xc3f4078b, +0x871a3a6d, 0x26c261ef, 0xcb3de457, 0xfd55e38f, +0x1f7b7adf, 0x4a957218, 0xc2578514, 0x49a0a264, +0x399a8fb1, 0x54a73f65, 0x81e6312b, 0x309ac51a, +0x6c67caf9, 0x23f96d98, 0x9b039535, 0xd84575f0, +0x14031402, 0x829102ea, 0x8452fc91, 0x6cda01e5, +0xb934896b, 0x46f9f575, 0xe7b980b7, 0xb9f8afcc, +0x50012409, 0x1e076250, 0xfa0f3950, 0x47e03da5, +0xd383c3d0, 0xd811feb2, 0x1fbbced6, 0xdcae0731, +0xf3a4032d, 0xe2969144, 0x5a7d8b4c, 0x9e25edd9, +0x017a88b6, 0xa26cb5d8, 0x8511b773, 0x9f05c44f, +0xa70aa767, 0xcda4fc96, 0xca1463d1, 0x9277edcc, +0xa8b2edd0, 0x8a17f84a, 0x0a7c5088, 0xb4a3b709, +0xac251991, 0x59777b15, 0x2271463a, 0x165b51fd, +0xf23638e8, 0x25ebf9f5, 0x6b37982a, 0x1bad416e, +0xda972811, 0xecbb666d, 0x8dbb1d6c, 0xa2f030ca, +0x1dea1c74, 0x8f0453c8, 0x4863b1a0, 0xd1a8406a, +0x3fc3c126, 0x04080125, 0xe02c889e, 0x01535c7c, +0xa1b3b72c, 0x7fcf4855, 0xbc0e2973, 0xd1e69356, +0x8b6135d2, 0x1fca109a, 0xd2bca957, 0x62a29fad, +0x8c4b6303, 0xc0e24ceb, 0x0b5188da, 0xd77bff95, +0x4e2fd18e, 0xd09f9a66, 0x64479842, 0x10b0b932, +0xfbb14baa, 0xd50e082c, 0xed603381, 0x3011f32e, +0x9a6dfdcc, 0xfc2045c8, 0x92ae279e, 0xe2f8fa1c, +0xe757a822, 0x284982b1, 0x3e064ad9, 0xb1ca5b18, +0xd906fb05, 0x10d63064, 0x446df9ab, 0x1f216e73, +0xbbf63589, 0x53b3abd5, 0x4c597cd9, 0x7af495bc, +0xe8ac1164, 0x9e6bacf3, 0xcfe4691f, 0xef15627b, +0xeb67a474, 0xb3362e7a, 0x5b53115c, 0x3a050dfb, +0xebaf786d, 0xe86eec24, 0xe2270995, 0xc24a6274, +0xeaf83cdb, 0xb61cc1c7, 0x07ab8e21, 0x221d7f8a, +0x1365ed04, 0xeaa4cedd, 0x6270d78e, 0x85106bcc, +0x6890c890, 0x5ac51a89, 0xb1e7ba16, 0x986b48b7, +0xe5608c11, 0xc6267c97, 0x808a90ca, 0x5580fc23, +0x89aec1db, 0xb11cd490, 0x64f91516, 0xb1c7b02a, +0xfca1377d, 0x799e0d29, 0xedd5a738, 0x1234e98a, +0x8b3425ff, 0x30da43fd, 0xe7678272, 0x71589d1a, +0x03c8bc65, 0x68d01f97, 0xc12c528c, 0x485ee1dd, +0x2e31f8bd, 0x8ddfb2d4, 0xca8b35b1, 0x9e27762e, +0x8ee4ace6, 0xbf38f38f, 0xca3e0dd6, 0x4fbc6a3d, +0xed781ff9, 0xdff7af50, 0x072a081a, 0x465e5d62, +0xf8dfae1d, 0xe42cb7d6, 0xf5ff8b90, 0x53c0e710, +0xbc29f798, 0x85702247, 0xb32aec1d, 0x0ee7caa1, +0x8adf0148, 0x91a9d12c, 0xcd3cc20f, 0x2c6deb6e, +0x191830a5, 0x74cf0d26, 0xe1dfdb89, 0xc8f77f76, +0xb82a295b, 0x2f3991a5, 0x6332bfb5, 0x53c9d2af, +0xab737074, 0x9de64606, 0x44421acd, 0x6b017232, +0x533c770f, 0xd35c0199, 0xaa5dcce8, 0x0ae54d50, +0xa9c971ff, 0xca198b50, 0x2424a123, 0xea97389c, +0x4d08471b, 0x635503ad, 0xc454b904, 0x0e6785ea, +0xd0c3dcd0, 0xa3526165, 0x42adc719, 0x4bd7b58e, +0xd872655a, 0x32f88cf5, 0x48dea68a, 0xc0ffb21c, +0xbbdf16d9, 0x62a69c79, 0x6dbbe61a, 0x91df3857, +0x043d5f14, 0xfe764c47, 0x545903c9, 0x847114b2, +0x0abf914b, 0x7c6eea50, 0x7b31f432, 0x38660eb7, +0xd9413e5c, 0x8d5c6503, 0x21b791f9, 0xbc266383, +0x720e1e27, 0x039c671d, 0xfe3d420c, 0xaf5534af, +0xdc4482c8, 0xd10b29da, 0x9d6fe9bd, 0x58a4d913, +0xf694d25e, 0xf42ec1a9, 0x2caa0c7c, 0x40921a4d, +0x8b7876ae, 0xbe863794, 0xf635bd45, 0x16cf2806, +0x61305239, 0x7a6acf4c, 0xf70c9dc7, 0xf5f46bb2, +0xe0e499fc, 0xe6ff0d81, 0x9684a753, 0xcf1a10b3, +0xac908030, 0x8533eb23, 0x70aa1d2c, 0x74b6f861, +0x54c90b0a, 0xa51a4a73, 0x2249b07f, 0x9d9cdbd9, +0x6e20b493, 0x8e4905cf, 0x350fdba0, 0x8fd5698d, +0xd1cf243c, 0xe0739ed2, 0x66083621, 0x30f5bae9, +0x02fbe790, 0x2783b6ce, 0x421382a3, 0x67741255, +0x57162fc0, 0x81b15aae, 0xf7621794, 0x009aa4dc, +0x4f980fcd, 0xb8a53a42, 0x10d361be, 0x93fbe470, +0x8a3c511b, 0x06e5d19e, 0xaa23ea18, 0xef18b5ba, +0x96d1be6d, 0xbae149fe, 0xe25e07a6, 0xce161d3f, +0xbf9616dd, 0x62db069b, 0x99044cdc, 0x9339039a, +0x5421503c, 0x01ddac4e, 0x70aadd4f, 0x2eb271c3, +0xb4a53c7d, 0x6ddfa877, 0xe8e65bec, 0x78e8981b, +0x44c989cd, 0x9a60cead, 0x2a88eb0f, 0xbca6adf9, +0x6b3c36ce, 0x0581e557, 0xca563b32, 0xb9de23cc, +0x50cd6651, 0x461f5c67, 0x533d7c65, 0x91354fc2, +0xf251eabb, 0x46491a8a, 0xde283d1a, 0x859545ca, +0xa4fc8114, 0xd575baf9, 0xef52bfe8, 0x4b710c14, +0xf628aea4, 0x0e1de4db, 0xde96a87c, 0x67ab6090, +0xe1395415, 0xd1827a81, 0xe617c0c8, 0xefaedcd0, +0x46b51668, 0xa11cc485, 0x3d68f6dc, 0xee17d9bc, +0x118fa472, 0x3d91695f, 0x6bd948bb, 0x469a9c75, +0x6bc222d1, 0xd785d9f3, 0xe0a78f9a, 0x8aa68c62, +0xaad97ef7, 0xb77d743c, 0x2204ac50, 0xc428c7c5, +0xfef816bb, 0x168b4055, 0x61ca803e, 0x718acd49, +0x0d22fc0e, 0x7bedec69, 0xda0cc83b, 0x7e17dd84, +0xd4dff06d, 0xab772ffc, 0x9620fb7b, 0x4d2b44e3, +0x4a62a6a7, 0xa1dd0ec9, 0x20b52229, 0xef99aa33, +0x040512cc, 0xe53fe7e5, 0x6f7587f3, 0xf9c2f701, +0x615f57bf, 0xadcc48ff, 0xd959fdc0, 0xae99c0dd, +0x446ebb9f, 0x42bb3a75, 0xd20ed8cd, 0x40f8bd5d, +0x04e85c52, 0xa14f2fb0, 0xf0fbf9a1, 0xcd935d22, +0x35af554d, 0x40e5e3c0, 0x5f68dd3b, 0x49c38e59, +0xa00d0276, 0xc786ca96, 0x946dc5b0, 0x11cda09f, +0x8941b1c3, 0x3423bf25, 0x951d1c75, 0xb3c53adc, +0xc9c9a425, 0xc50e4e16, 0x39c871a2, 0x5d83e686, +0x22fe291f, 0xb1f5aeb1, 0x345ac0b8, 0xe1b89427, +0xbabe0cb9, 0xb1075fa8, 0x8dabb12c, 0x2c8bc298, +0x45e1dae5, 0x2fa7cc08, 0x1d4db266, 0x907393cf, +0x99336ab9, 0xed7f63ed, 0xeea62965, 0x3fcda2de, +0xbd640a3f, 0x8bc54453, 0x28246df1, 0xabf23550, +0x2c90ada0, 0x883c1c0a, 0xdd88a177, 0xa983bb6f, +0x4532a088, 0xaaae7b75, 0xc1955ada, 0x627dc00b, +0x71b7b48f, 0x2dd56a2d, 0x20a9859f, 0xa9d529f5, +0x5c0c9c40, 0xef83f3b5, 0x25ce0edb, 0xc6f5a212, +0x0adaf970, 0x6f4c3cd3, 0x9e0b5f93, 0x44f466e1, +0x8cfe0b2e, 0x96e10a4f, 0x2cc674b6, 0x1b788d91, +0x97ae570b, 0xe657e109, 0x0fcd245a, 0xafbfa613, +0x5aeec575, 0x2c276c9d, 0x1b49b392, 0x80f21ec5, +0xfc609882, 0x96024791, 0x715e9bd8, 0x11abeec5, +0x10316856, 0xf3dba157, 0x7ab5de4a, 0x3501a49e, +0xe1d591c8, 0x05dc8475, 0x2c80df17, 0x99dd6c28, +0xb0803140, 0x160258c8, 0xb63d2cbd, 0x9258c17b, +0x6e1b02b8, 0x064c4a46, 0x564a4b41, 0xa33da6ad, +0xcd45aea1, 0xe48e9857, 0x59b18823, 0xce68a255, +0xf43e9ed3, 0xce9ae3d0, 0x55ddb8a7, 0x4fb90e2f, +0x0bcbf62e, 0x74cd292e, 0xba44025d, 0xe3417b49, +0x19eeabdb, 0x06556609, 0x423639db, 0x40796c0a, +0xc10a1a83, 0x19ab2f52, 0x1b2d10f7, 0xd398964d, +0xf7b10446, 0x9474efec, 0xbb0f7028, 0x40b5ef9b, +0xba953c25, 0x557031f1, 0x5077a370, 0x097de265, +0xa742ce8f, 0x7a2150a9, 0x02b2b62f, 0x27527d8e, +0x55cc9b22, 0xd717683f, 0x5d0224fa, 0x36c9deb3, +0x52673852, 0x10963abb, 0xeaeb87c2, 0xc1cb8719, +0x7e171d34, 0x957bc3d5, 0xb640a0dc, 0x0f5c0314, +0xd2695be2, 0x8a1ea554, 0xe14ffb59, 0xe3279974, +0x5737bf69, 0xcb683952, 0x92994857, 0x7bd6ee9c, +0xbad2b314, 0x0445f7f3, 0x9f6ee240, 0xe0171b5b, +0x1d7f8da0, 0x58676606, 0x7ff09fed, 0x6e03cabe, +0x8c683fd7, 0x1206f8ed, 0x0c7018b6, 0x5891f1ad, +0x9eedc3f4, 0x8edb2bab, 0xd29939d2, 0xfe120e2c, +0xf3b38201, 0x3a7b2cde, 0xa80f03b2, 0x90355d5b, +0xc8f2bc69, 0x0087d684, 0x3901969e, 0xac7d20d9, +0x081702de, 0x63ef4438, 0x7f31d454, 0x8dbfe854, +0x6ca903d3, 0x3c2f0651, 0xf32d70fc, 0xae8d3caa, +0xb79f4587, 0x8620db94, 0x08520c00, 0x8df36d5e, +0x0ca43141, 0x72d01988, 0xfc854594, 0xf37b4674, +0xca3380f7, 0xf779bc61, 0xed45d3be, 0xf7f2f4d8, +0x2860e62c, 0x04050e3c, 0x25223dbe, 0x459aa579, +0x1c1ebb6f, 0x9436bea7, 0x14d9705d, 0xfa8235b9, +0x3389a4eb, 0x5abe5b52, 0x774add8e, 0xf3a9e511, +0x42b5d645, 0x70f323d1, 0xbd9cd00c, 0x062f3edb, +0xbc816f6c, 0xb66136ed, 0x843bb1bc, 0x02ff0458, +0x18f2b478, 0x28db50b5, 0xe31f6b0a, 0x24800a97, +0x355ba5fb, 0x1043cbca, 0xc8ba3d12, 0x862fa313, +0xa75fe342, 0xbe6e1f10, 0x42bbeb3f, 0xd2b7e12c, +0x5f4fe83c, 0xb7b23bd6, 0x6597875a, 0xa5861387, +0x77681f1f, 0xe7d3ab1f, 0x08c45774, 0xc344764f, +0x055a3276, 0x2d0f8fcf, 0x24c555fc, 0x4a951bb9, +0x4023eba1, 0x1e0d25d8, 0xc241403a, 0x09636767, +0x335d014f, 0x135f0a7b, 0x96471043, 0xff892c47, +0x41e5a8a4, 0xa3134cdb, 0x9e063d42, 0xa033a2bb, +0xf11fbb45, 0xb02d7172, 0x8995a8e0, 0x723b47a5, +0x3277ad1f, 0xbb16352f, 0x7ea7c780, 0x4166718e, +0xc91f5a95, 0x0e8acd7c, 0xe6e108f4, 0xba9ccc47, +0xbdad9656, 0xdd80de77, 0xf9bd3421, 0x1a19d3bd, +0xebbcbbb8, 0x1fb64db1, 0x89141987, 0xd7a82e04, +0xc32ce3e2, 0xc3025ee5, 0x4280b120, 0xb60f99b9, +0xf928ea23, 0x0d29e756, 0xde5c5172, 0x167466f9, +0x15876318, 0x7a8fdc74, 0x5153d93b, 0x41e429ba, +0x5dd9212d, 0xf9947b0b, 0xd8afdbde, 0xa4b1874a, +0x3f285c58, 0xb14e81f8, 0x56eb2efa, 0x11bdcbb4, +0x533dbb06, 0xdc57a427, 0x8a9033cf, 0x9b213aa2, +0x5591f4d5, 0x3067d69a, 0xf1c8bc0c, 0x0950d482, +0x1cfa3149, 0x9a8e7e8e, 0x82ffe5fc, 0x00bcc17e, +0x2a6202f5, 0x6c5a19f3, 0x5fe05768, 0x7df1b946, +0xb347bac6, 0x71f49adb, 0x61e6453c, 0xb1574f7f, +0xd6e612fe, 0x37412cd7, 0xdf76cfc3, 0x80edc235, +0x8b5581bb, 0x2ee41224, 0xca2d4998, 0x8676bf38, +0x16119d0d, 0x13a981d5, 0x34e27dc7, 0x1a95b73b, +0xda5b9c04, 0x7e2fee17, 0x3da42174, 0x5d13eed0, +0xa002f914, 0x802b5c9e, 0x853e4eb0, 0xc5a6db47, +0xe36f749e, 0x7ad8657c, 0xefdf8d08, 0x16bbf73b, +0x0d103cc4, 0x2b3566f4, 0x17b0822b, 0x5f290e37, +0x5ccef029, 0xec092638, 0xc97fac95, 0xb45eaef5, +0x027a4e9d, 0x36f2c09d, 0x8346c80b, 0x4a9fe9ea, +0x7e92445e, 0xd2dfb4b8, 0x0ffa0a9a, 0x79be25e7, +0x9cb19323, 0xc4903881, 0xb96526d7, 0xcbcfc5e3, +0x9b0596ef, 0x2cd4aedf, 0x10f5dec1, 0x49b665ec, +0xcf260f16, 0xa8d6ebbb, 0xbce68ee1, 0x004244a4, +0x92224426, 0xbb176436, 0xf4f92299, 0xa42bad7b, +0xfc2460c4, 0xc7c9756f, 0xbfea47dd, 0x93182b7f, +0xc004c9b4, 0x4c1a6794, 0xd16cfe80, 0x7e8bafa4, +0xe1ae225e, 0x26d41a33, 0x7662f06f, 0x9a38bdee, +0xa72d9617, 0x8ef819b3, 0xc1551118, 0x3375b455, +0xc1030928, 0x9427b310, 0x344e51cf, 0x9fd5ef08, +0x43b19943, 0x94f252dd, 0x77927ee7, 0x5a24eed7, +0x5dc4f855, 0x9ab69b51, 0xc04975dc, 0x3053b467, +0x8fc0eb2e, 0x5464b455, 0xac1d6711, 0x3e0e1e6f, +0xff920812, 0x5e0187fb, 0x64537a99, 0xb0bb733f, +0x2dd0a7e9, 0xdfc1b7b8, 0x310027b3, 0xc6814db1, +0x8fc0ada6, 0x7f7da20f, 0x6895ca57, 0xd634d3f2, +0x50b54bb4, 0x236710fd, 0x0d718d96, 0x951c4846, +0x529494f8, 0xbbf091a8, 0x1b3d8c0f, 0x5ebb3acd, +0x6d298bc0, 0x1c741b78, 0x9ecad63c, 0x5f593f51, +0x929f0817, 0x74b0c9cf, 0x8859c885, 0x256c964c, +0x37c9867c, 0xab32404b, 0x0dff3b62, 0x35395087, +0x8597090d, 0x4312fd2c, 0xe2426a8f, 0xd7ddbdd7, +0x00ab0fea, 0xc13e096f, 0x5997bee6, 0x2f6dc9f8, +0x2d52cd70, 0x21cf5d6b, 0x649003f2, 0xa588e161, +0xbfe0dabf, 0x7251830b, 0xdc06555d, 0x1385ae38, +0x5a23edc2, 0x4c922c51, 0xe1a7b0da, 0xfd15a2d3, +0x88cffbeb, 0x99d75030, 0xa1bec337, 0x5ddb6fba, +0xc2ee430e, 0x91a03c1c, 0x6414f484, 0xcea9f9f5, +0x92d221dd, 0x6b4b2bf2, 0x7bddb260, 0x0933f5db, +0xb2281075, 0xe7e45fee, 0x60ecf5b9, 0x6464f02c, +0xbb7ec3f1, 0x615fb526, 0xfe9c32c8, 0x4b145ef0, +0x5028db31, 0xf1212b36, 0x1e5906c7, 0xf3c39ecf, +0xb92590a0, 0xe2dfa8d3, 0x1c9b8294, 0xad01e560, +0x510e4988, 0xd88678d9, 0xf528726d, 0x5aed62dd, +0x75096ace, 0xf59de42a, 0xc466fd7c, 0x607260ff, +0x2bc1b01f, 0xaeb77f9d, 0xed6916e7, 0xe6b6b0f5, +0x2e08e167, 0x192c1112, 0xfc38b229, 0x165a492d, +0xc54c78f7, 0x524baa8f, 0xbde45365, 0xef804e78, +0xf7e86dfa, 0x485e00eb, 0x739a00d4, 0xb5a9fd40, +0xc04336c1, 0x3249685b, 0xe028d900, 0x2985c347, +0x0517c072, 0x413c0b73, 0x5c9498f8, 0xed2a36e8, +0x1558fa5f, 0xbf81c9a0, 0x3578258b, 0x084ed9c4, +0x4b9b9786, 0x4c63c590, 0x48a3b261, 0x569ab786, +0xa009f472, 0x91f84cc3, 0x20226598, 0x9b313bd9, +0xeef61b17, 0xb8a60130, 0x99c438ae, 0xcb3ac779, +0x3e0c4eda, 0xaff7f8d9, 0x112458e1, 0x659f4828, +0xd3ee6d72, 0x07e60a6a, 0x52b4c22c, 0x1a63415d, +0xdf736f12, 0xe8d26911, 0xe696af62, 0x59893127, +0x9ba5d01d, 0x3bb468e6, 0x197b1484, 0xa1089806, +0x09e2a73b, 0x0531ee44, 0x0d42b2a5, 0x8cdb3e01, +0xca2dd11e, 0xbb486581, 0x96f6a04c, 0x106242be, +0xc1601e73, 0x76d736e3, 0xd48f085e, 0x8db7f158, +0xc620edb4, 0x3ff2444f, 0x8461ceb2, 0xbcc4ffef, +0xd6b0ebe3, 0x1689752a, 0x6badc8d4, 0xf601507a, +0x3922d7aa, 0xdd79173b, 0xefb5ba30, 0xd830843c, +0xa32c2b79, 0x269f47a0, 0xfb404a29, 0xbd48f1e0, +0x01718e9b, 0x48b9c4e5, 0x0e74a929, 0x93eb272b, +0x3cc1ca16, 0x65d56bad, 0xeb59f547, 0xa76f4a49, +0x1cf88e1d, 0xc15696b4, 0x5d53e72a, 0x91425681, +0x6aa3e6cd, 0x2ddb5cae, 0x0b4f596a, 0x8a9d0730, +0x66e98eb4, 0x5fe60523, 0x8574e8c7, 0x5abf6679, +0x2281fefa, 0x1823cf52, 0xa6c21899, 0x50a61732, +0x2595e2ba, 0x87c8d0fd, 0xf77e2a4f, 0xbdf4f848, +0x287da506, 0x8dc11e9f, 0x74528f95, 0x0609cd13, +0xf424b585, 0xc9670a98, 0xfe537f9b, 0xc5792d92, +0x0d89b2d4, 0x3c7f24d1, 0x1e761384, 0x2b7d0b44, +0xb68e608e, 0xb2753059, 0x79ce3f6e, 0x71910e79, +0xf21dd096, 0x347b88b2, 0xedca2942, 0x41f8b7c5, +0x59e14564, 0xa1c62fdd, 0xd2a229d8, 0xb2fa83d4, +0x8a2c780c, 0xfcefcb70, 0x86354f2b, 0xc722d726, +0x8ba7da14, 0x91957fad, 0xf203ecec, 0xec42d832, +0xc633b93d, 0x2374d770, 0xbfa05c26, 0xad110f09, +0xd83caae8, 0x713b9f18, 0x066809ed, 0x376f1022, +0xf1ae99b1, 0xb7359085, 0x9ea5d22c, 0xae80d8a4, +0xab282b7a, 0x7592e23c, 0xf6d84bf6, 0xeccd876f, +0x4ac1a90d, 0x0204571f, 0x1cea7fe3, 0x2a459b1e, +0x9d840f18, 0x1395ce90, 0xae830ca5, 0xce1b4628, +0x9303dab9, 0xfafffca9, 0xdfa8f180, 0xf9fa7a22, +0x3d98798d, 0x320a6477, 0x6b8e1ba8, 0xf3e05e48, +0x30f174ed, 0x81b126fb, 0x05d53aaa, 0xa07c1101, +0x3a7861b0, 0x4f978877, 0x6d427f57, 0x4edf514b, +0xa5979b74, 0x9ed8b949, 0x1a4dba13, 0xde6ffdeb, +0x0adb560b, 0x9104c3e4, 0x2de5f089, 0xdeb412bb, +0xc481fe0c, 0x57b2955b, 0xa474e833, 0x219436d2, +0x2eb8b744, 0xda619f9f, 0xb783b00b, 0xb526aba8, +0x872326c6, 0x5c4b8fc0, 0xeb2e6854, 0xa4b86e98, +0x490eb880, 0x29939a57, 0x758f3817, 0x4147772c, +0x1be66b95, 0xb8b2e317, 0x5dac4c14, 0xa9015c6d, +0x8cf93482, 0xf53612d2, 0x263aeeb6, 0x85f9bceb, +0xc89987ea, 0x1a798ff3, 0xd95784a5, 0x7bf9a315, +0xb4c2fa0a, 0x838e0e0c, 0x5eb2c815, 0x420228d6, +0xd6227ba0, 0xaef517d7, 0xb2cb9621, 0x6c89408e, +0xa12183df, 0x8d216a79, 0x0a29a1fb, 0x8868e6c9, +0x783225e6, 0xb32b431e, 0x721bbd37, 0x3d2cf13b, +0x9afb5715, 0xa78a29c7, 0x9e9b36c3, 0x1e303df5, +0xfbfdf9bd, 0x92e81003, 0xd2c70204, 0x6fd3743d, +0x8b2930af, 0x17e4d791, 0x68149143, 0xa7a15a10, +0x7ebbb261, 0x2549ecb2, 0x9f3e3677, 0xa2455399, +0xd4b47956, 0x59a1335c, 0xcf37c7c5, 0x65b7e4da, +0xa019d801, 0x68860c07, 0x360945c8, 0x1b953ad2, +0xc7c7422a, 0x6c158cb1, 0xbbff0e56, 0xf0d6712b, +0xa23da75b, 0x9c2740a9, 0x9d0a493c, 0xb5dc2278, +0x924c3b5a, 0x6e5da499, 0xd936488d, 0x3bc28c01, +0x6d4b128a, 0xd9c91d01, 0x827f9f4a, 0x01f6707d, +0xa8f86998, 0xb6ba5f47, 0x52861cd1, 0xcc4d8814, +0xf199d7e0, 0xa5ab542c, 0x9648cd20, 0x1e26e420, +0x10a21e2c, 0xa9552f24, 0x98363a94, 0x46b880ef, +0x49f77edc, 0x6db49cd6, 0x77821c62, 0x64ccfb5d, +0xe2fdbae7, 0xb5378752, 0x26fa6fdf, 0x134936b1, +0x9c8f0058, 0x4eee166d, 0xcd5034d2, 0x2a3746f9, +0x3f4dd354, 0xe4534072, 0x3d3ff151, 0xe6cd6b36, +0x9daca4e0, 0xf893636d, 0x4f2ef5a4, 0xfcba58ae, +0xcf521e11, 0x1e8f91ef, 0xe883ae95, 0xa4e29d8e, +0x85a76c97, 0x61c68a14, 0x55cb3e03, 0x16c30ec3, +0x0e89fba7, 0x26088caa, 0x9d2f1136, 0x5962ef80, +0xc3d81402, 0x8e802320, 0xbf2e95af, 0xe77702d6, +0xb6ba88d4, 0x3e1539e1, 0xac0079b3, 0x004a1f67, +0x00a6b11d, 0x9941f573, 0x48cfcfaf, 0xa11ca405, +0x3d399975, 0xad26cfed, 0x2a6e261e, 0x950685a0, +0x880afd0d, 0x2e609e4a, 0x9ded0400, 0x46830b80, +0xcc8668b6, 0x49781e43, 0xcaf69e26, 0x5003d88f, +0xfa5d380a, 0xbc2f6c40, 0xdfaf1330, 0x11b33ed4, +0xaea370e7, 0xa28436c9, 0xbd642020, 0x2c09a98b, +0x5930c891, 0xa6523ea2, 0x782b9c3a, 0xc4d0aaee, +0x3a972e96, 0x023164e6, 0x67600763, 0x9d83f57f, +0x0b542a00, 0x114d98cf, 0x1c7737ad, 0x765e729d, +0x726b40e4, 0x43a26972, 0x602f6bfc, 0x481c084b, +0x00d1305f, 0xfb0741bf, 0x6dea7f6f, 0x98ef0692, +0xbcde7134, 0x476c334d, 0x5cd3856c, 0x9095445b, +0x71cc1a6e, 0xbdbf3338, 0x425ff057, 0xd5398242, +0xa8562545, 0xb9df2cdf, 0x853afb2c, 0xd4d4efcb, +0x13e045c8, 0xb6eed0cc, 0x3165963d, 0xf160599f, +0x1f666509, 0x6cb61aa6, 0x0f6a6baf, 0xd2fdf475, +0x1efa1d6e, 0x98488c10, 0xb8f668f5, 0x2df5c770, +0x28cd2d2f, 0x0afeeacf, 0x281d5b93, 0x1597e5c4, +0xf61d799e, 0x03244df1, 0x9e501ee1, 0x5bd1dedf, +0xade0fbb1, 0xfaa5782e, 0x7f13a146, 0xa5aad2db, +0x4d83e15b, 0x74ab6460, 0x1dec7ed6, 0x9108118b, +0x8de4387f, 0x478a89e7, 0x8355d9c6, 0xdca72d92, +0xf34d5f4c, 0xca20a820, 0xd00b4688, 0xd4548d40, +0x68a4d978, 0x6f12b8aa, 0x5baae448, 0x85ce7c59, +0xc17a0e79, 0x57ad9c76, 0x0878421f, 0x76abf479, +0x6cd79141, 0xae93e02c, 0x5d1e9f22, 0x4f7ed641, +0x65d1a70d, 0xff16ced7, 0xa5198150, 0xa39ae34c, +0xd8f496b7, 0x1e4d8c6f, 0xd3328ca6, 0x51fbf9e9, +0x3b6f0034, 0xd43985dd, 0xed545c51, 0x6891a9f2, +0x37914b34, 0x95aee6ca, 0xbe3e88f1, 0x8c081851, +0x0334976b, 0xe7976cfb, 0xd6a99830, 0x32ca2d18, +0xcdaa8600, 0x176d3707, 0xf41b2924, 0x498ee4d4, +0xc4fbc8ba, 0x0a7eeb99, 0x03d12baa, 0xd53c4127, +0xe4a20d1d, 0x21e9f27b, 0xc93b747f, 0x81362c8e, +0x30d4511e, 0x50914eec, 0x1ec00ec6, 0xe0cda769, +0xb6d056f1, 0x7b2a2618, 0x7a466001, 0xf5673969, +0xa45795d5, 0x2c3a4459, 0x19d00f28, 0x86cbb72c, +0x4f892d8d, 0x932832e5, 0x17ef120c, 0x5738d6a4, +0x950a91cf, 0x763994f3, 0x5a639cf8, 0xbfadf3c1, +0x8b6336bc, 0x8cb0587e, 0xbc4d0a5b, 0x242a504e, +0xcfa99d25, 0x641613cd, 0xb8c20ab0, 0x28509bae, +0x7938b4ee, 0x3116aa0c, 0x7fd6eb15, 0xda754baf, +0x3016ee4a, 0x276b8de2, 0x4006455a, 0x85908f25, +0x3498ab4b, 0x9b0e4ab2, 0x721e80bb, 0xb23172e7, +0xeb850a12, 0x06419469, 0x8d11ed10, 0xc173c146, +0x23566335, 0xe4f77d1c, 0x571e7886, 0x9ba798b4, +0xa1c4afba, 0x2329fb10, 0x1c5ab56a, 0x180702d2, +0x21742711, 0xfb615747, 0x0a0e6e6a, 0x418b2481, +0x25f5923b, 0xb6017e44, 0x91280c56, 0x2c4d5cfc, +0x735d765e, 0xea7840c3, 0xbe0e25bc, 0x0665ae5a, +0x588f7c0a, 0x0554df7c, 0x20a71000, 0xcef418cb, +0xa6a2e1d5, 0x9a482e57, 0xb6ce74be, 0xd9017756, +0x5d9a09dc, 0xbc30331f, 0xdd7f356c, 0xe0b9642b, +0x9b104272, 0x7ff96c11, 0x7d196ee9, 0xea09435c, +0x04c3c4dd, 0xa445e93f, 0x53859456, 0x409d4d7d, +0xa834e183, 0xb5e7ae44, 0xb9ecd12a, 0x97d374c5, +0x9da5593e, 0xfbdc5bc8, 0x421e59ce, 0xf1073ec1, +0xe8f16243, 0xc8133042, 0x37072879, 0x74b067ce, +0x97a29089, 0x827cde7c, 0xbf1ee463, 0xf1207288, +0xd264239d, 0x889bb5ed, 0xdd26ad0a, 0x419c9029, +0x837a1d85, 0xa92918e0, 0x4a7caa45, 0x7c718f07, +0x9a9a8ac1, 0xb58458d5, 0x38b1d8c7, 0x7a7528a5, +0x6e809471, 0x39c4505a, 0x8b2de89f, 0xdd488911, +0x7c71475b, 0xbccec2ce, 0x1f0a3cb7, 0x368089e1, +0xf546c873, 0x98915f67, 0x3cde685e, 0xd7af539d, +0xd5345ef9, 0xd89fe631, 0xaf68e6db, 0xd77ce130, +0xf4eb9eb9, 0xb0b90b10, 0x52221daa, 0xdef2fba6, +0x732733df, 0xf3fc3675, 0x6cf5f49c, 0xed8d944c, +0x08798c96, 0x3d586cec, 0x52887076, 0x80038f98, +0x7802751a, 0xfe6a883e, 0x8e4246e4, 0x9ad0b1b2, +0xdf7b7a6f, 0xa6d43d10, 0x60c3bc89, 0xa316d96e, +0xadbe1f03, 0xc5b7f11b, 0x8c02d1f8, 0x71a3a455, +0x8c934d22, 0x186e3dfa, 0x325987ca, 0x30153b09, +0x89bea29f, 0x611f897e, 0x8b912009, 0x272304d5, +0x34a0e222, 0x1f36a1a4, 0x60d0ba6d, 0xb84e9869, +0xb1770707, 0x27d7bfd6, 0xbd82f41e, 0x1ff5fcb9, +0xc39b3c66, 0xafc85927, 0x9fa472db, 0x4ffc0fc6, +0x459dbdc7, 0x4a3ba7d8, 0x7e4e59ce, 0x6906e461, +0xad09ddec, 0x3fb7fd36, 0x92471185, 0x9c3a1a56, +0xd2729393, 0xa797d207, 0x4c40e3a0, 0x26ce5f64, +0x235ed861, 0x27079b15, 0x78da2416, 0xa014962f, +0xa9071722, 0xbe329d45, 0x7ac167b2, 0xac775c3c, +0xd0fe38c3, 0xafc1ca30, 0x15092916, 0xafd01d7f, +0x376b90ee, 0x85976f7f, 0xe3194c27, 0x82315ecf, +0x04c70174, 0x2dd7a902, 0x9cb660a1, 0x4b73ef57, +0x3fdc9634, 0xd154fd0c, 0x502a76d7, 0xfbcc0f26, +0xec92bfbc, 0x5efc8336, 0x4d3aa101, 0xa7ae5fa7, +0x45b01e93, 0xb8ad3946, 0xd25e6474, 0x4be730ac, +0x318f881c, 0x2cdb700e, 0x17fa65e0, 0x5a2c28ba, +0x7bf74562, 0xdf569a0a, 0x70b73d39, 0xbffcaae1, +0xf0cafc19, 0x05d7216b, 0x7fe52fbb, 0x20cdaf91, +0xbb997e15, 0xd33de063, 0x740f84ac, 0x99f8df83, +0xca7873df, 0xb3c4b404, 0xa9f6ef04, 0x1e3ca888, +0x354da772, 0x6abcf01e, 0xfb31b8f9, 0x136dc30f, +0x07b4fb3e, 0xfe02c93a, 0xf6c768ef, 0x61306415, +0xef9b2e91, 0x5916f671, 0xc98dfcd6, 0xb9890c29, +0x7c1991f5, 0x689b34f1, 0x89eaa10e, 0x898d2587, +0x4f91aed2, 0x1de48e3a, 0x68484360, 0x26300f3e, +0x3ae22620, 0xae9cb796, 0x8261da0d, 0xa1073a54, +0x1d20fc8c, 0xfbcac33b, 0x24da2296, 0xa17b56ac, +0x77024c68, 0x06154395, 0xa86eadcb, 0xaa6d0cd3, +0xaea96f37, 0xc17bde9e, 0x40e406f3, 0x390335a3, +0xbe334721, 0x014e2f50, 0xb3c63af3, 0x7f415e47, +0x5c1fe00c, 0xebd013aa, 0xe732d15c, 0x6acdd540, +0x898eeb9c, 0x860ec697, 0x6a84a05a, 0x5bf0ecee, +0x85112a74, 0x43969340, 0x1cde8ced, 0xfb5a0990, +0x5b7c75d6, 0x288328b6, 0x65fb99da, 0x74c98ebd, +0xf60dd7a8, 0x022e3ada, 0x6c230086, 0xb037ba3b, +0xd3d836cb, 0xdca668ca, 0xb6b3aba3, 0x83c3ef0b, +0x6710928d, 0xfdba4378, 0x03bac767, 0x54cec351, +0xd2e3b9be, 0xb6aa98ef, 0xdf287538, 0x61790fe1, +0x533a12e2, 0x33dbcb67, 0x0cc8f931, 0x810bd09f, +0xc61af214, 0x63b5cd33, 0x7ac2b448, 0x33f4d1ba, +0x0a50bae5, 0x27602505, 0x16aa586c, 0x920e6571, +0xccf0c6b5, 0xc51f8395, 0xc35a6439, 0xc4614d06, +0x8ef9873f, 0xa487ff48, 0x2a99c506, 0xc413ac23, +0x1fc82df5, 0xbbccd6ff, 0x5aa56325, 0x73e8e3cb, +0x7eedce1b, 0xf8e24d26, 0xe2c61c5f, 0xb70c0f64, +0x3a05e507, 0xb5e37580, 0xa7e5ef1f, 0xdd612535, +0xfd2010ea, 0xcd02b51e, 0xbeda36f3, 0x4cf61f22, +0x23b69f0b, 0xbbf35eb3, 0xd9c41880, 0x04860fd9, +0x61333ce9, 0x87722946, 0xc952b651, 0x52941d10, +0x64856595, 0xdfbde2f4, 0x1eff8930, 0xc214baa7, +0x0e100773, 0x1f7de202, 0x48401e8c, 0x631ebe0a, +0xe4f74144, 0x410bee40, 0xdafcffda, 0x9863fbc3, +0x29ff025d, 0x73befee2, 0x31a25def, 0x55bdc13e, +0x6953848a, 0xdf9e9126, 0x6fc7543d, 0x2bda5cad, +0x408ad459, 0xceef5177, 0x6ce8e470, 0x5b08a3f3, +0x239e9e13, 0x235bef5d, 0xbf7faee7, 0x695f90a4, +0x397e39e9, 0x60b05c26, 0xf8daa802, 0x86239a3e, +0xcf5fbe6c, 0xaf29ce64, 0x0e69bd79, 0x9b81c4dd, +0x60773dc6, 0x83a3641a, 0x6a96a4a2, 0x1dee9161, +0x11b74f04, 0xac0d174c, 0x9e684e45, 0x685d962c, +0x01b4f8c2, 0xb54dcc23, 0xd186b0c4, 0x9a4576e2, +0x385ba279, 0x3bf1ad85, 0x1363b23b, 0x5457c13b, +0x3c8d4c14, 0x8c7571d4, 0xf24ee9ff, 0x8a6a1e90, +0x68652e59, 0x66f852a9, 0x9f343cee, 0x11a6c25a, +0xabe276b4, 0x62de8e07, 0x9cea453b, 0x591ddc6e, +0x2aa6060c, 0x99bbbe41, 0xd5834d17, 0x6544c474, +0xb6506fd3, 0x05a01209, 0x9b5a45cc, 0x2d526acb, +0x11a46a14, 0x6baf5a76, 0x7aef0244, 0x38fb57b5, +0x25dc57f9, 0x73cf77b3, 0x5ed90dc1, 0x221a5a4f, +0x1c3af5dc, 0x37208f35, 0xb5a371fe, 0x90a97e72, +0xa60cf62c, 0x9facab7b, 0xfcdb4b5b, 0x8d5eaba9, +0x0970fe84, 0x4e1da0b8, 0x98ac07f2, 0x68910cf6, +0x69c9ee67, 0x9ec0a0a2, 0x393b0a64, 0xf99cba85, +0x0f176323, 0x248ad952, 0x231f3f6d, 0x7afa35c8, +0x58717c92, 0x459dceed, 0x126fb328, 0x8416ff53, +0x4363e154, 0x09515f00, 0xdf5f6055, 0x4501a65e, +0xd2aba10d, 0x18bd34f9, 0x8ed05a12, 0x0914f019, +0xf5a9bca7, 0x666f2a0b, 0xee47bf3a, 0x05c77428, +0xfc71f5ec, 0x904420cd, 0xa81a95b6, 0x9d9f4281, +0xc9f7dfbd, 0x0db6e8a2, 0x4b240a04, 0x5b32b78b, +0x2e25b8ab, 0xe3f21033, 0xa17153be, 0x01443202, +0x716e8f06, 0xbd10fe83, 0x3b7c67a6, 0x6be45473, +0xa68764d2, 0xf0ef7e0c, 0xe09fbb4c, 0xf385cbe1, +0x0517ae28, 0x0f681494, 0x0b69ff77, 0x98bea1d5, +0x8d4cc9f3, 0x7a2c336f, 0x717b846c, 0x660dfc4c, +0x1cff8fec, 0xf44a5a8c, 0x6d1405b8, 0x037e0d37, +0x9b0690e6, 0x91bf5f3b, 0xf14006da, 0x9357fcc7, +0x0a604416, 0xb8d97f74, 0x380a5792, 0xd622b034, +0xf2bff4ff, 0xf8260df2, 0xd980ec61, 0x11456e63, +0x90ea6625, 0xa58b58d9, 0x06dcf3f9, 0xca265c6e, +0x644cf469, 0x6d3d3132, 0x67b895dd, 0x5f73ed21, +0x1bbff0c1, 0xdb67e1db, 0x3469b906, 0x472a494c, +0x11ce3913, 0xcc40ba06, 0xd1f9ed8d, 0x199376ce, +0xf1c187dd, 0xe968a2f3, 0x99df8136, 0xc6cd2f5c, +0x0736cf99, 0x67735a24, 0xe3289e49, 0x98993b8b, +0x83c6a63d, 0x82446feb, 0x32990572, 0x69fce8f2, +0x54a4e7b4, 0x082b55c8, 0xced04021, 0x36b4f399, +0x85518b8e, 0xb83a5554, 0x1d98f4c6, 0x690cb8e8, +0x680e81e2, 0x0d423679, 0x956384a8, 0x3b29939c, +0xe1141bea, 0xed6d5c01, 0x6a58f172, 0xb576344d, +0xd1e17d08, 0x3127733d, 0xb4c6c1a1, 0x5398cfb2, +0x132ab640, 0xa43a7405, 0x055c2baa, 0xf4cb5f56, +0xb91aa44b, 0x81908a6d, 0x55f43555, 0x483536e4, +0xd7e14a06, 0x5f4266fc, 0xce695d31, 0xd3b2e86b, +0x2c366b7f, 0xe8eb35f1, 0x1af96dd9, 0x00d5d0ba, +0xba0bb8a8, 0x7e113800, 0xf029dcee, 0x0ce1842b, +0xc71f0e6a, 0xca886800, 0x8d72850a, 0x153c3359, +0x9770b744, 0x9c90f074, 0x0c273436, 0x881dee82, +0x59debdd0, 0x4d67544f, 0x2502ec3a, 0x2359a6b6, +0x3ad8cf3a, 0x5549f7cc, 0x1f6b6cf6, 0x734114d4, +0x382e6e4e, 0xdaf50df3, 0x32d757f4, 0xb9a96957, +0xb4914a40, 0xee0998ed, 0x06579e7e, 0x89099671, +0x774f1ae0, 0x13dcf84b, 0x18f6bbb2, 0xec99b125, +0x47583aef, 0xb7be0893, 0xfb180296, 0x4c444071, +0x56c57e61, 0x413d3c6d, 0x76fe9f90, 0x5ab978b7, +0xbf1d8866, 0x83756707, 0xbe70a35f, 0x0ffbc112, +0xd92fe756, 0x69301a19, 0x86adc471, 0xdb9d616d, diff --git a/src/cpu/intel/haswell/microcode-M32306c2_ffff0003.h b/src/cpu/intel/haswell/microcode-M32306c2_ffff0003.h new file mode 100644 index 0000000000..627297fed0 --- /dev/null +++ b/src/cpu/intel/haswell/microcode-M32306c2_ffff0003.h @@ -0,0 +1,833 @@ +/* 0x306c2 built on 07102012 */ +0x00000001, 0xffff0003, 0x07102012, 0x000306c2, +0xaf97f1f8, 0x00000001, 0x00000032, 0x000033d0, +0x00003400, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x000000a1, 0x00020001, 0xffff0003, +0x00000000, 0x00000cf1, 0x20120710, 0x00000cf1, +0x00000001, 0x000306c2, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xd3ad173b, 0x3a858e7c, 0xbd2a6573, 0x33af95ab, +0xac27ec24, 0x043a80dd, 0x78c629bc, 0xd3b160e0, +0xa19308a3, 0x5b19c4b7, 0x4a1b425b, 0x7d6a74f6, +0x81624193, 0x3a559605, 0x5475280b, 0xe7319d58, +0x48624ca7, 0x507af030, 0x3b32d96a, 0x30164068, +0x5284d2f5, 0x725b2915, 0xf63c9280, 0x44b7c142, +0xe67ca7b3, 0xd6f163e7, 0xcdf51f3c, 0x41d180a1, +0xcc3931b1, 0xf7a544a9, 0x7f6bf77d, 0xfc45a45f, +0xf0985836, 0x652d7e2e, 0x0324b1f3, 0x24b9548c, +0x7bcae7a5, 0xdcdebf79, 0x27015922, 0x0c83c606, +0x3d2ceeb7, 0x61c5eec8, 0x6b6899c6, 0x3e500531, +0xf08bfa44, 0xb304a8f4, 0xcee8f713, 0x2912c786, +0xfae6c34c, 0xa5292960, 0x7d63e389, 0xaa257a01, +0x1fb25054, 0x963fc676, 0x5bcb9fd3, 0x58f369a4, +0xf6e3beb2, 0xa58b5eb0, 0x33c7eba4, 0x37fe8b66, +0x00714403, 0xf0fd0c4e, 0xaa122996, 0x9a55b184, +0x00201507, 0xc9fb6e3a, 0x11ab60c8, 0x80ff6e84, +0xc37aabdd, 0x0fc23175, 0xb0b18c34, 0xf1ec806c, +0x00000011, 0xd7ac04bd, 0x43c47748, 0x8b4d3b0e, +0x37292b60, 0x88f69665, 0xe29ecca3, 0xea58d4ff, +0xc510039d, 0xcf90334c, 0x72613f09, 0x068fb362, +0xba19d1a8, 0xba0b5f4f, 0xf98ea81f, 0x5a149d3d, +0x46b8569a, 0xb1a7bf13, 0x20264bae, 0xd0254070, +0xfbf03ebe, 0x4d257a4c, 0xc6b129cb, 0xe94b010f, +0x1a1bc256, 0xb0627b4d, 0x5d884902, 0x8992f09a, +0xa248ba5d, 0x774ce24e, 0xd18a8e9f, 0x308c2101, +0x654f9f54, 0x48860d0b, 0x20d42d6b, 0xcb21b8af, +0xdae28e34, 0x9eadb1ef, 0x0f63d558, 0x65852c08, +0x2fc9d718, 0x4a7b327e, 0x25da4117, 0xbc9f1a1a, +0x330b88fa, 0x4e88ca00, 0x93a206cf, 0xf1108fa5, +0xb4f994bd, 0xa2788822, 0xf3bd71b9, 0x7a095358, +0xe9ee1f78, 0xdedfb10f, 0xfd805db4, 0x0ad7ecfd, +0x73f6c7f9, 0x05ea6af9, 0x92d19d64, 0x325b6143, +0x65446f10, 0x9d82d963, 0x4e9968d4, 0x9e7f5375, +0x3e4a36df, 0x73c4f910, 0x6042ebab, 0xdaf76fed, +0xda4fa82e, 0xf15de75e, 0x40ddfb97, 0x9bc1c7ca, +0xfd58d90a, 0x4b37269e, 0xf534da12, 0xc9ffbb4d, +0x05d71f15, 0xba506b7a, 0xfb90e223, 0xf46faf4b, +0x0ad694ba, 0x0dc0b857, 0x5b8df4c2, 0x5d6f7f13, +0x32eecd90, 0x7f7f272b, 0x271f0bdb, 0x25bd7819, +0x25f19df4, 0x2a435865, 0x1a28201b, 0x26d186fe, +0x6abad792, 0x3b902d01, 0xf4dbf9c6, 0xe883fb9f, +0xce6233f7, 0xcf34fdc2, 0x8ed7096c, 0x05ad22a6, +0x20ead5b2, 0x9af8e44b, 0x9cbbeb21, 0x1970c013, +0x61089e83, 0x41eb77a3, 0xd05867ab, 0xf6409d11, +0xac007c25, 0x97d78d4b, 0x5af38c3f, 0xed5a972c, +0x3561d959, 0x824b8761, 0x9fc69de4, 0x3094e8b8, +0xcfb81787, 0x35832e8f, 0xa320931f, 0x2b044e78, +0x2ba04a27, 0x87ada1c7, 0xd61b0f91, 0x86f2c5dd, +0xd4a2caa3, 0x6e71cdeb, 0xef8b87fb, 0x329fc815, +0xcd69b570, 0x25c92597, 0xb81139a6, 0x84b35f2c, +0x960bbbb2, 0xd4a1b46f, 0xaa9bd40e, 0x129f9cfc, +0xf2775921, 0xf69c866a, 0x8927ae0c, 0xc297d25f, +0x22eaecba, 0x9289f366, 0xda25f880, 0xaefaf3c2, +0x231fa1c3, 0x022230dc, 0xe4e7f071, 0xf9b77e6b, +0x48cf1fde, 0x1b82d4f9, 0xcf7d150a, 0x5ef46aa1, +0x41ef98b5, 0x45bc0d43, 0xbd2c471b, 0xf227d6ed, +0xfa8070d6, 0xba48ef91, 0x709e2371, 0x0648d521, +0xecb6313b, 0x1823d7e0, 0x88e88325, 0x668f220a, +0x407f5f89, 0xcb3bc4b3, 0xec901d63, 0x1120b657, +0x49b14178, 0xf467509b, 0xe6d035e0, 0xdee2b2ec, +0xfd4b20a2, 0x69866d1f, 0x1bcfeebf, 0x7b76df63, +0x24f86a8b, 0xd2a928e4, 0xab66fc07, 0xb52b4147, +0x35d8ce1a, 0x6c12eece, 0xbc51eda2, 0x1083aaf6, +0x554048f0, 0x3a610276, 0x162dbf03, 0x9eed4230, +0x0c08f581, 0x0a8dddd8, 0x163bce27, 0x221ca5a7, +0x81a234d9, 0x0d7dfce6, 0xd8482f38, 0xe4b508b6, +0x90a2a481, 0x8abad862, 0x2f5c6a32, 0xb84ea6b9, +0x2612f2cf, 0xb77ee692, 0x74fb73ee, 0x1dc96a95, +0xde9cc598, 0x7a61f258, 0xb28245cc, 0xe53e10d0, +0xc11f2f27, 0xaa3e29a6, 0x99fc2781, 0xc8bc6ec7, +0x180ed465, 0xac96f71c, 0xd8bdfa23, 0x184fddc0, +0x53d9d8d0, 0x1511bfbe, 0x13bd1595, 0x5fd6ec7d, +0x015d6a44, 0x6a4c044f, 0xb438479e, 0xf73bba7f, +0xf54f86a3, 0x3d362052, 0x657f0dcf, 0xdf143c5b, +0x4af3bdd1, 0x1e65b6cb, 0xb1fd068d, 0xa97392b5, +0x1605a33f, 0x70c55aeb, 0x84bf9c4c, 0xe995b96d, +0xdfa9e176, 0x97ed1fdb, 0xcc43ff0a, 0x3b315d79, +0xa402aeef, 0x993393cd, 0x50f2d688, 0x480809e9, +0x909b1aba, 0xdb274eae, 0x4e400e34, 0x19f3f7ca, +0x7564b3b7, 0xc3d804b3, 0x35ca3679, 0xc2e81a5c, +0xbd6c617c, 0x2af290e7, 0xa8412361, 0x7b01655e, +0x17bbd80c, 0x487f81a7, 0xd13ca9e9, 0x8bd67724, +0x0b2cb9c3, 0x48308624, 0x09583853, 0xa18b721d, +0x545e982d, 0x01762447, 0x8da01954, 0xc0c41c76, +0xfdbd404f, 0x4b545bf2, 0x3f2dad44, 0x5ee26f3b, +0x785bf016, 0x7c9307d1, 0x24240a70, 0xf7dd20bc, +0x36988994, 0x209bfad5, 0xb71d3f3c, 0xe283c374, +0xc5b2cb67, 0x3b302474, 0xe68684b8, 0x51a90ec5, +0x7aeb6d5f, 0xbfe5da15, 0x0d65ccb8, 0x7f4c99c5, +0x31ee65e3, 0x9487dec1, 0x4f068026, 0xab51e2da, +0x9b732d6c, 0x93299ced, 0x15b3f839, 0x32b05593, +0xe1688aec, 0xdcd09a64, 0xce4eb64e, 0x8e049a34, +0x9b9bf8a6, 0xb0d4764f, 0x00b53355, 0x524f8beb, +0x70e777cd, 0x598fe135, 0x6f525c00, 0x78dda8b5, +0x8d4e92bb, 0xe442880e, 0x911adfe2, 0x43cb5caa, +0x57cc9fad, 0x2eb52866, 0x0186a0ce, 0x45ed00ad, +0xc63d6db6, 0xe73e3dfd, 0xd9e74321, 0x0d64c543, +0x1ec0f665, 0x08a0af93, 0xd31a55fe, 0xb9e04ade, +0x31bb0ba5, 0x395714a3, 0x21107d85, 0x26e23a76, +0x05c54ef3, 0xc6998821, 0x8fd2bdc4, 0xafe6c624, +0x34e26076, 0x5c910540, 0x7b7f781d, 0x1ef22d39, +0x7022d48f, 0x48dfed04, 0x6c2e77cd, 0xdc2aee6a, +0x23d9bbab, 0x11f22581, 0x3eb2111a, 0x88e0bff3, +0xab706776, 0x8a89d9a9, 0xb2df0707, 0xed4d3529, +0x04b8e9fa, 0x1f8fea04, 0x4cc5203e, 0xeb6edd78, +0xbb50848b, 0x983c0557, 0x26143e58, 0xb7e16746, +0xe3cea7a4, 0xfdbbcc0e, 0x0dc480fb, 0x8f7712f3, +0x54e4657d, 0x422fb382, 0xffd64810, 0xfc659d69, +0xfe88fe52, 0x8d3b850d, 0x0a680629, 0xee59771e, +0x3d34f1e0, 0x021501cb, 0xf103673d, 0x99013830, +0xa6bbfd02, 0x724e4d50, 0xb7ae0e47, 0xea4d3701, +0x6a7932cf, 0xf2b1ba1e, 0xd5a44d49, 0x3685d2f6, +0x9870089d, 0x74ea78f6, 0xd61112e0, 0x616eb512, +0xb8775ffe, 0x957934f1, 0x3204598c, 0xe9df2246, +0xcd4abbc4, 0x912a84e5, 0x40be7165, 0xac9754f8, +0x84d3d1f5, 0x4779da25, 0x7ba68cd4, 0x451defa2, +0x87b7cdd8, 0x67dfba93, 0xd2c2b4c3, 0x76084909, +0x138b6516, 0x01c1683f, 0x7e364744, 0x826c0ee6, +0x36ab715c, 0xd29bf0b8, 0xf63e67ff, 0x912887b2, +0xf91e60ca, 0xdae4e24c, 0x9fd92fe4, 0x9897f7a0, +0x56756c58, 0xc7f01eae, 0xaa59f086, 0xebdc5f10, +0xba58f9b2, 0xcaa6322e, 0x5861655f, 0xd99cdabe, +0xe2b6c759, 0xb369dc65, 0xcee7008c, 0x4621a5db, +0x2f2ea3bb, 0xe4537616, 0xcf1814d3, 0xbeb3dcd2, +0xb3545c2c, 0x1b94cf88, 0x85b70493, 0xc10f17e9, +0x55c69d5a, 0x456d0841, 0x8429ff62, 0x628d4444, +0x73b93123, 0x79494923, 0xda158af0, 0x6dbcbc29, +0x20d3c76b, 0x4dd69e35, 0xc6ad2790, 0x05e7563f, +0xd26e07c9, 0x55b5d517, 0x975c3601, 0x3478e0f2, +0xc27a1e75, 0x5038699e, 0x3208b15b, 0x02a266b5, +0xae36852b, 0x7604390d, 0xa5759807, 0x88c30928, +0xe77747d0, 0x11101245, 0x693a6778, 0xaf3bf9d6, +0x34abac1b, 0x1a370639, 0x81b01ea6, 0x09a72d9c, +0xb20cbed4, 0x2bae7772, 0xfe00d576, 0x442e5cf8, +0xeba0278e, 0x4c8d721a, 0x9570e322, 0x241b783d, +0x7b238de1, 0xce269ddb, 0x0867929e, 0x988b1dd3, +0x25942985, 0x5130e3f5, 0x713e37ba, 0x0d8bbb66, +0xf36e6f15, 0xd519ee7e, 0xb8934246, 0xd880d874, +0x020db7e5, 0x736c6c18, 0xdc36a969, 0x8430ff55, +0x4d4e92bf, 0x7643fd2e, 0x70228380, 0xf6554132, +0xe088ee76, 0x45e2dab8, 0x70320758, 0xe6c02af5, +0x2b6db81d, 0x9376f8a4, 0xd75ad499, 0xe764dea6, +0x28867f86, 0x35aa6da1, 0x26fcc15e, 0x62312f4c, +0xb3af9227, 0xbcf2f6bd, 0xf92ba037, 0xbff3eb5b, +0x51560099, 0x6996c080, 0x0df6bc7b, 0x2e7761ac, +0x23c96da7, 0xfbddee75, 0x4dd5590e, 0xa5c9bdce, +0x5e9394d9, 0x5072b1e4, 0x42cd7f66, 0xaa62ea89, +0x7faa4164, 0xa2c95ec7, 0x16f506ac, 0x518512a2, +0xe8e11f8c, 0xf77972c0, 0xfaccf28a, 0x2a03e569, +0xa07fc98d, 0x5cd27cc9, 0x6ff8c67b, 0xe9e976a8, +0x846839d7, 0x0c12dc37, 0x5420940b, 0xea939d23, +0xe40b4812, 0xca4a9bc6, 0x57c994f5, 0x36d0e7fc, +0x38740e1a, 0x8a5644f3, 0xd9017e85, 0xd9cd30f7, +0x69a079d6, 0x5c749841, 0x056de8e6, 0x9b5b2a0b, +0x990c9993, 0xb1c92e35, 0x841ebf2d, 0xfd149e04, +0x195e9d0f, 0x60ffaeb0, 0x71b68c0c, 0xe30de8a3, +0x32972a04, 0x15402d7e, 0x0aa24953, 0xd563748d, +0x672d71ef, 0xa2891354, 0x2d9406b3, 0x622fa5aa, +0x80f63833, 0xe0ff5cea, 0x32d3a493, 0x8d28b4f9, +0x88f5a69e, 0x71f8afc8, 0x77d89011, 0xd2ad4edf, +0xcf279567, 0x0b46c67e, 0xce45a822, 0xedeb1074, +0xb873196d, 0xe4ea5d56, 0x2cde6c71, 0x8b8bc8a9, +0x5edc84b3, 0x4917aefd, 0xeca520d3, 0x7fe0f36a, +0xa511be53, 0x48289ec5, 0x297797f5, 0x1607b7aa, +0x369d13e5, 0x5dd829d1, 0x48470d6f, 0xe41a208b, +0x21521695, 0x25eac644, 0x1bb06c8f, 0x0a58401c, +0xa60dc40e, 0x805ae3c4, 0x1db978c7, 0xda25a394, +0x893bbb3b, 0xacdd222c, 0x0e7d1ed1, 0xb3909e3c, +0x679f78f2, 0xe311bb1b, 0x9e683f43, 0x5296cb02, +0x64ec64e1, 0xa28c5125, 0x92b65a1b, 0x555844fb, +0x5193e3fc, 0x14ab89da, 0x48808c10, 0x233f84c6, +0x188ae123, 0x4263c040, 0xc6ca07cb, 0xef3e3871, +0x29b56cdd, 0x726e8cd2, 0x683814ed, 0x96f3f3e6, +0xe32393c8, 0x6f3af473, 0x4b7cd60a, 0x131cd731, +0xb108f665, 0x7b8c4d97, 0x663b6d0b, 0xc74d8a8f, +0xc0175639, 0x1fe56c43, 0x67524206, 0x799eab33, +0x915cf2e3, 0xb17d6f2b, 0x43e52ee9, 0x5ec3d285, +0x15a3317e, 0x97759add, 0xba4d0415, 0xa7fac8a0, +0xfb6b0328, 0xdd5df817, 0x8a914956, 0x6c2f556d, +0x25233371, 0xa57db457, 0xae9cf773, 0x8bb6a7de, +0xb65ef28b, 0xde25141d, 0x68d748af, 0x0e6b82e7, +0xa1e917eb, 0x5b2868a2, 0xa8c9bb1f, 0x4cef038f, +0xfbb7b5c4, 0x19b7e97e, 0xda0a84ac, 0x0715d256, +0xab1cf391, 0x83e7de23, 0x0c1e354d, 0x87d7ebab, +0x4acf63a9, 0x4c43df27, 0x86b127f8, 0xbf57f0db, +0x8d264119, 0xd3a98e47, 0xc434cb9e, 0x4b07e662, +0xa6fe0cf4, 0xe7bc1370, 0x9d0906f7, 0xb47fe53b, +0x9bc8acab, 0xd16a938f, 0x853ba91c, 0x7f7f8f89, +0xf8eec6f3, 0x3bd26744, 0xa3a9da0f, 0xfec308f3, +0x3c5fd8a2, 0x085ae764, 0x532c1de3, 0x2a7edfb4, +0x668a8b33, 0x2e25f455, 0x1e861e6f, 0x39893759, +0x0b6ec5ab, 0x2fdaa6c3, 0x3684b11b, 0xd6d41e99, +0x947e3a0f, 0x2db7db5a, 0x5ccc0d9e, 0x5ebc6cd2, +0xcf17e9a9, 0x328a0581, 0x76381716, 0xd7aca540, +0xff763393, 0x98aa01f5, 0xa884d961, 0xd9800dd9, +0xcc85c498, 0x14736e19, 0xccd62a03, 0x8c5c409b, +0xc9294b28, 0xc34404b0, 0x394ee46f, 0x47b7a4be, +0x0e49bed5, 0x24715d34, 0x535524a9, 0x478e7dbf, +0xca9aba60, 0x81a79425, 0x01127689, 0xea9a0d72, +0xb22691a0, 0xda0a22a4, 0xd9fbfe7e, 0x09af89e7, +0x1c9ec0c3, 0x2aba2ef0, 0xfe049c48, 0x2d79aee0, +0x9a47a7c2, 0x75574ae4, 0xa2f20379, 0x86b71378, +0x1c00b1cd, 0x5a4dc889, 0x1498aa32, 0x4684d831, +0x8d20bb85, 0xe451e88b, 0xb1b13962, 0x380f90a3, +0x48add03d, 0xe215474d, 0x9f649c93, 0x438b6223, +0x9cb220a4, 0x65de3f9e, 0xfe2d9c84, 0xa4df9ee0, +0x408e6eb8, 0xaa0c012c, 0xb3a520a9, 0xa1f02a65, +0xd9d6da35, 0x9fad7ed1, 0x4a7fdf3c, 0xf25556c7, +0x324f1c48, 0x9ea088bf, 0x36e6dcae, 0x9b35b1b3, +0x9196471d, 0xc712a5e5, 0x76c3d21f, 0x095dca88, +0x5870dd14, 0x58496a3d, 0x59afc05c, 0x4182c37e, +0xd1b26985, 0x498959f7, 0x6b1667b2, 0x11e56e40, +0x457c9af6, 0xe2cd22f6, 0x3a7c85d5, 0xec48f56c, +0x76b469b2, 0xad6fd747, 0x46187900, 0xb431e2fb, +0x797108ac, 0x682f5a37, 0xe6ff6dc9, 0xa032b44b, +0xedd94225, 0x539523bb, 0x014e3485, 0xd80603b2, +0xbb3c8e17, 0x22336bbc, 0xdeb9db84, 0xdd85e385, +0xed525dc7, 0x3cdfdd79, 0x4a141ad9, 0xfb0a9342, +0x79a76d55, 0x1d4daf24, 0xddf62a9c, 0x41b7496e, +0xa251f1f9, 0x77461c1a, 0x811e489a, 0x0e05448b, +0xf3dcc476, 0x965a09c2, 0xd7990d5a, 0xb55b28a7, +0x1da84808, 0x78a742ba, 0x161be658, 0x2b55bd4a, +0x7a8af153, 0x20c141d8, 0x332a03fd, 0x75fa5a93, +0xd5090f31, 0x034cc7e3, 0xaac798bb, 0x4d0cfcc9, +0x4202075b, 0x661996f7, 0xd36c30ad, 0x0fde48ad, +0xa350f0a6, 0x8cc32896, 0x81f969aa, 0xe93c7a2e, +0x168b7344, 0x5b859061, 0x308071bf, 0x476b94fd, +0xafea0602, 0xe955c337, 0x40927e51, 0x12271667, +0xc2ee147b, 0x7f03f946, 0x096d1f1e, 0x41283646, +0x3d11fb73, 0x5c45cf4a, 0x7d8638e6, 0x3064ebf4, +0x2b4a9324, 0x6ce275f6, 0x0488b39d, 0x19aa36a4, +0xa49cea96, 0x28c46cd9, 0x7bea4cd3, 0xdbe580fa, +0x27f79d79, 0xd7da526d, 0x0299a9f0, 0x4ad6bbdf, +0xbc76ea39, 0x5cc79e20, 0x2b78e482, 0xd34cb7f4, +0x38cc1d9b, 0x83d2a644, 0x346c382a, 0x60e5ad0c, +0xdf5f9328, 0x4dc8cabe, 0x53ae3e72, 0x20b116d7, +0x4fa975a7, 0x8d4b38a1, 0x20dae57c, 0x9571d158, +0x0e1756e5, 0x11f34e0c, 0xbd0a0fcf, 0xd0ab0b04, +0x8b9e2b4f, 0x94ca4409, 0x5723ff3b, 0xdede7c31, +0xffce4e48, 0x1ae2d457, 0x74614f6e, 0x9fa7e9d1, +0x01d8b806, 0xed811297, 0x8b54c1b2, 0x2c2ecdfd, +0xe0765947, 0xf602aa5a, 0x9f943dd8, 0xee08e149, +0xefb3a022, 0xa4c7651b, 0x15c3d1a7, 0x0295c27b, +0x190e50d0, 0x8773c5c9, 0x7d712087, 0xe64749ae, +0x2f4ffd61, 0xc48f2ae5, 0x05e0b7ce, 0x23649bb1, +0x7b3ff227, 0x333ce889, 0x5efd604c, 0x7023ca3f, +0x0b1797dc, 0xe38fc37b, 0xed8705f4, 0x49b7a689, +0x403e75dc, 0x280d9ab5, 0x2947481c, 0x5dc61b43, +0x44434998, 0x5061c901, 0xc5b9c69c, 0x3c5a3224, +0x564be2c6, 0x4e6d34db, 0x4707f4ed, 0x7defbac2, +0xf02ea03f, 0xaf2cfb61, 0xe368509b, 0xa625f72f, +0xa016f98a, 0x12ef2ae0, 0x811eb709, 0x0942f83f, +0xf4de8eab, 0x75ebbfe6, 0x27bc1128, 0xd2746703, +0x8f8bbf28, 0x5f6c71b2, 0x963fbabc, 0x85c87248, +0x0cd7a7f1, 0x27917d2c, 0x17891395, 0x01fb88ba, +0x1da89563, 0xee9cb107, 0x4b99cdf0, 0xd390aac0, +0x861bae4d, 0x8f87b5cd, 0x7b566255, 0x70ceda60, +0x3402bf9f, 0xe8e25b59, 0x6331cc86, 0xaeae6b42, +0xbf06ed27, 0x9ed14c98, 0x74bac954, 0xb2168693, +0x5c93d238, 0xc6401825, 0x052d55d4, 0xf3e7f167, +0x55ce1f0b, 0xab8f473e, 0xc45fba37, 0xcaeeb339, +0x89bd98ec, 0x98418c39, 0x4d758dbb, 0x063f29dd, +0x2daf808e, 0x2682f909, 0x745413e8, 0xb5739bff, +0xc99d52f7, 0xe9324c98, 0x75681eca, 0x621d2d86, +0x73d436d5, 0xee94a7a5, 0x13ab7c84, 0x6bd7f43d, +0xf19fadca, 0x18c6811f, 0x3a5e8895, 0x062cebaf, +0xc640ca22, 0xcf6816c9, 0x3850f7cc, 0x4cc7a50f, +0x9db2d4ef, 0x28ffec55, 0x6a3af4e6, 0x3e2cd38a, +0x750c58bb, 0xc555f77c, 0xdf74dedb, 0x2dffee77, +0xa69548d8, 0x873bcae4, 0x612ef74f, 0x1f679443, +0x910228c1, 0xbd9fa6e6, 0x8961adb9, 0xebb22b40, +0xfea01159, 0xbf1be6a8, 0x6c2d1a71, 0x51299aab, +0x7f7c8721, 0xbd75362b, 0xe522c5ec, 0x2bb19c66, +0xff5a1659, 0x56cedfb4, 0x86096b85, 0x324c72e8, +0xa967edb0, 0xbcfb65f9, 0x6a54ad6f, 0x3141e57d, +0x7848fde0, 0x403ffaab, 0x49ad2d9c, 0x0936ef6f, +0x245b47df, 0xbea34eb0, 0x9efc0f92, 0xe275afa1, +0x59d6eec1, 0x8a112018, 0x8410d724, 0xef56a0f7, +0xbde3a486, 0x1d299ae1, 0x48d2fb15, 0xa087d9b0, +0xcc565832, 0x7ba49d19, 0xcf8921d8, 0x8ec34b17, +0xd49a4d1f, 0x08e493ca, 0x072538f9, 0xef05e8d5, +0x44c626b2, 0xd2a142b4, 0xaccd7880, 0x4abe1777, +0x080bb4bc, 0x1324852a, 0x8997350c, 0x9c9ced40, +0x8c8948cd, 0xe3f896b8, 0x7bbb13f7, 0x957abdaf, +0x78143d0a, 0x117cfae4, 0x11c59fe7, 0xfbe3f1db, +0xdc7b7b78, 0x137f1645, 0x98d68a60, 0xc57aaa6d, +0x85ac8534, 0x6d2764f2, 0x10b00643, 0x7d88b02d, +0x614acd50, 0x8b35b369, 0x15582aa6, 0x37f1ea20, +0x6d7395ae, 0x113d8f51, 0x24cfe401, 0x0e9ba567, +0x26ee60d8, 0xc2cbf841, 0x956401dc, 0x0e01171b, +0xe42ea13b, 0x04bc0061, 0x0f557178, 0xe1262888, +0x61e38aa7, 0xe70d77d0, 0xb591ea53, 0xdce69e60, +0x1208176a, 0x4bf75845, 0xacb16e8c, 0x570a361a, +0x388bad28, 0x76cc69e4, 0x639aac4f, 0xa04e718f, +0xfe5ce723, 0xd91f9c4b, 0x1b5e22f1, 0x8ba1d331, +0x0c9de453, 0xe751aa14, 0x1600e58b, 0xe43d1d44, +0xee3b20c9, 0x6c80b888, 0x67719eeb, 0x40542ae8, +0xcb19edaa, 0xb3436ecc, 0x1ebe0404, 0xe1ad40e5, +0xf6bc6d31, 0x8a1b875f, 0x9a659646, 0x4d4e7d50, +0x7cda4f24, 0x9944ab63, 0x19ff1ea4, 0x61bf55f1, +0xae2d9778, 0x002d75c6, 0x9c1eb236, 0x1b36b9a2, +0x0978fedc, 0x1caf0360, 0xf01c1bc3, 0x8e0d9611, +0x5ac927a1, 0xbe743f19, 0x56bc3d7d, 0x83597785, +0x9d4c50df, 0x036d7f0c, 0x1f6a50a8, 0x6ef45810, +0xa73d0c0c, 0x9a76be39, 0x02126b3b, 0xd7cfd3b2, +0x3e16fdf0, 0x967fe547, 0xb6162f4b, 0x365f5433, +0xd63e9b13, 0xc0c0b3f0, 0xae8e63b4, 0x770b1233, +0x7b3f7338, 0x14787761, 0xafe1cc2e, 0x264d868d, +0x2fab30dd, 0x3f6e6e7b, 0x007a2690, 0x73e6f990, +0x36b7144f, 0x04e7bd65, 0x2e19c263, 0x93412869, +0x577aafd6, 0xe386b7f7, 0xfd903bbf, 0x79277407, +0xd83a709c, 0x219b79e3, 0xa84e0f68, 0xaa78cc80, +0x72365c53, 0x287033d6, 0x7cc587e6, 0x966a4abb, +0x55e76904, 0xb77cb8ac, 0x2ee981cd, 0x8edd9387, +0x45ab946a, 0x397b12b8, 0x002855cd, 0xf689102d, +0x707381f2, 0xd127dcf4, 0xa3e4342e, 0x8324d0d1, +0xadb58687, 0x1baf9f0a, 0x5bb7b0f6, 0x34d9f5cb, +0xe58bc4eb, 0x0227a3c0, 0x4c9cc28d, 0xc042a772, +0xcabfac8c, 0xacf7a792, 0x38cb7359, 0x9cec3845, +0xc7c46407, 0x0ab0f97f, 0xd6cc4f7b, 0xe66429c9, +0x6ad90743, 0xc4a2931b, 0x4e327ffe, 0xebb55de7, +0xb926e9c1, 0xcb259448, 0xbaa42dd1, 0xe614da1b, +0xef9e2176, 0x00759245, 0x5c994c7a, 0x7e0a645c, +0x694e743a, 0x36956fd8, 0x010b7c5c, 0xfce78911, +0x73670095, 0x97489b8c, 0x8676257f, 0x52e147a9, +0x14966859, 0x6f91dff7, 0xa0584fdf, 0x9a3de7c9, +0xb8e953ad, 0x41c694c9, 0x831eff3f, 0x6b252a18, +0xb16d088e, 0x0e8a30ba, 0x5137b7eb, 0x1d237547, +0xe5fb36fd, 0xc39d4a3b, 0x0b7e2380, 0xf377cd43, +0x7a5c7e25, 0x3fc7e69f, 0x2efb1984, 0x047bd40b, +0x3ad64bee, 0x90577a2a, 0xd82cee06, 0x3b4490bc, +0xdc492aa1, 0xa25b45c7, 0xa986718e, 0x8007dea8, +0xca0afdad, 0xa9f6c41a, 0x42e5da6c, 0xa5941097, +0xf4b8c827, 0x9f76d9d8, 0xe7896df5, 0x7cf58fc0, +0x4b01befe, 0x1d628634, 0x0e96e0f8, 0x924a1d5f, +0x256036ef, 0xf8e107db, 0xa5ada937, 0x39f3ed3b, +0x208328ca, 0xbccc3570, 0xfbde42d1, 0x64e77252, +0x3f1bc2fc, 0x1575b867, 0xd860cf01, 0xbcb98edf, +0xed3c293e, 0x800394d5, 0xc4bc714a, 0x4efe4c0d, +0x9ee1d7ef, 0xd5e062ab, 0x0843c881, 0xdf019ae4, +0x4af46a6f, 0x8c9fe5c3, 0xdc6c6e77, 0xd75c0cec, +0xcec35564, 0x71334ac2, 0xdf363581, 0x2dfd9830, +0xf84ccf64, 0x1c4aec4a, 0xbeafb14c, 0xdaef481d, +0x2a772efc, 0x93c549f2, 0x4f733c18, 0xd8d82509, +0x0771fe19, 0x11f7c437, 0x3f3cb501, 0x903b6bbf, +0x5021734b, 0x50f80d33, 0x00359bfb, 0x17a80d07, +0x6f536827, 0x3abae18a, 0x553f7174, 0x97bc1306, +0xe455e7c9, 0xab604d4c, 0xa9e03f7e, 0x552f3ce6, +0xaa60b2f9, 0x0745bbc9, 0xc7c81338, 0xbf23308a, +0xeea52e08, 0x9514d445, 0x6e6a66fe, 0x024fad21, +0x060abdf0, 0x20f0ef94, 0xee4ea797, 0xb0383565, +0xf2f070cb, 0x23217be6, 0xab9fdce3, 0xbd228aff, +0x5d62594d, 0x385ace27, 0x855207d3, 0xbaed127c, +0xaf2f3f66, 0xd65d597c, 0x675bd5b1, 0x6f1fa07e, +0x09f907e7, 0x0c491249, 0x52c62ae5, 0x4e6dbdeb, +0xf1c3fd02, 0x7354de5f, 0xce88f882, 0x105c63cb, +0x2f3f2f8c, 0xb6e7751d, 0xdbe8b19e, 0xfa95cb3d, +0xb69fee40, 0x8641913a, 0x526faf61, 0xa4111e19, +0xffdd2674, 0x765cda90, 0xae047dd9, 0x4c7aca5d, +0xf9c19216, 0x78b23edc, 0xc4666945, 0xa383ac51, +0x45768e39, 0xef201541, 0x46800ac1, 0x346bb330, +0xcbf522b4, 0x152100c8, 0xb1af161c, 0x6f4e1fbe, +0x1e1b6e7c, 0xfedb92df, 0xefb672c2, 0x3cb24d1e, +0xf83ddd81, 0x548f9ce4, 0x0fdbf9f5, 0xf3c4815c, +0x4f0d8c68, 0x409d40ac, 0xdfc1bbf0, 0x247e94be, +0x54ab6bf0, 0x91976546, 0x8863afdb, 0x554a959e, +0x41b29a17, 0x8d0cde10, 0xd9dc9fc1, 0x7831dd09, +0xa1a67af5, 0x66285679, 0x8f7f1a69, 0x9609f5c2, +0x8e179d1c, 0x7b47dcc4, 0x158b6591, 0x318f3dbb, +0x06540d35, 0x67781cd8, 0x43170f88, 0x875198bb, +0xb591d790, 0xcc679cb6, 0x64a4dac1, 0xdab79d2a, +0x3f5893f2, 0x19fe090d, 0xaca409f5, 0xd2cf8a6a, +0x01ee9e08, 0x3055ecd6, 0x0ae8b0d8, 0x7ffec46a, +0x997e5778, 0xe3bad2ac, 0x97ce3272, 0x976e3d5b, +0x2fb0e27b, 0x278251e1, 0x29742561, 0x15f05e86, +0x14cbac05, 0xa6642d59, 0x8c528bdd, 0x73cda57b, +0xeb2ff50b, 0xf098bb41, 0x5134d8c6, 0xa3636786, +0x601a6bf6, 0xc0595be4, 0x99b03e85, 0x17c274a5, +0x7145dec3, 0x38654382, 0xdd987f55, 0x6727d497, +0x93b2026f, 0xa2cf1a92, 0xf6f28ad3, 0x86fa6ed0, +0x8667d1d0, 0xdb421974, 0x0459bed0, 0x64b32507, +0x7e340503, 0x0cb9d0b1, 0x04e49074, 0xe35509a3, +0xaf36efef, 0x2bcab7c7, 0x0f1f1258, 0x0c094f1d, +0x3e3272e0, 0x12a64a9c, 0xe0d543de, 0x6161582e, +0xe3fe247a, 0x8c89e84e, 0xbb101ed1, 0x1630a7b0, +0xe2a55f37, 0xf17b9cbb, 0x1ce9907d, 0x45c44178, +0x45f5f19e, 0x89c7240c, 0x94b30494, 0x655fa184, +0xd44c4d6a, 0xb979e586, 0x15f03c34, 0x59d6d976, +0x499d32de, 0x34f1db38, 0xeb1cbeef, 0x62724eb3, +0xad9eaa67, 0x1a2c5ad2, 0x426feeb2, 0xdfb8e03f, +0x986eeede, 0x9530745c, 0x8048c985, 0x072c7a24, +0x3a39a895, 0xa897f332, 0xe02b6525, 0x1740e46f, +0x36c34914, 0xd166b96e, 0xca2afc44, 0xee32043e, +0x0415ae14, 0x85b6eae5, 0x4c32265b, 0xba0e2be5, +0x0f06d460, 0x79ea7c65, 0xc210065f, 0x1d6e24e4, +0xaeff9ea3, 0x84f333c9, 0x0b30efa4, 0x9cc34011, +0x402eb9e3, 0xbaaeb052, 0xcd53cad3, 0xbab26aa3, +0x5712b1af, 0x96ca09ae, 0x6ca8c803, 0x9d1f1829, +0x5b5ee6a0, 0x2e90a3a6, 0xd18dbe03, 0x1e346c59, +0x6dfb82a0, 0xeed26c81, 0x3ca27910, 0xa4bdfce1, +0x12912b2f, 0x3c696487, 0x0b8446f6, 0x78f2346b, +0x0a662cb9, 0x24cb92db, 0xa76cf8c7, 0xe05cc463, +0x58a4ed64, 0x871a8cf7, 0x578154ed, 0xaebb8eaf, +0x43f2aae4, 0xe0ebb4ef, 0xba0436b7, 0xa1f8660a, +0xcdb35e97, 0x9fb8b72e, 0xd0527599, 0xda39a87a, +0xd0924eae, 0x68a7f7da, 0x37522dcb, 0xc781f106, +0x3e1c880d, 0xeed88686, 0x2e40ce6f, 0x77a1a722, +0xd9dec668, 0xf915cc91, 0x828d59ae, 0x4fe1b8a7, +0xd5784888, 0xaaca55d6, 0x3d1f66d8, 0xf9701aa7, +0xffaeac74, 0x5d0f61e4, 0xfb93391e, 0xcca93201, +0xc956ff62, 0xf0130bef, 0x011bc191, 0x22d0e455, +0x85cf6aea, 0xecb52b06, 0xdc158d4f, 0x9c5ca3b1, +0x15e02d07, 0xbcae34f5, 0x12189bab, 0x74c3006b, +0xa1bb6dfc, 0xcf6ffe58, 0x0ef6a615, 0xd6d77e3a, +0x932af360, 0xec75ed24, 0x02b42899, 0x85749119, +0x5afcc6e8, 0x0738bbd2, 0x74abf75c, 0x396e70d1, +0x3d5c08f4, 0x85360c20, 0xbd9fdd00, 0xd691d252, +0x69e8f428, 0x2df1b405, 0x3e26d0a0, 0x2170c376, +0xee5adc06, 0x278135b4, 0x6f985120, 0x8095e749, +0x15083809, 0x32744190, 0xa654721d, 0x0399da46, +0x6bbcdfe1, 0xf2e393bc, 0x79f44da6, 0x331122ee, +0xa7079298, 0x5957bf7d, 0x819c14f9, 0x27cd8fec, +0xce4a2505, 0x0081a803, 0x247f91f9, 0x65707628, +0x666d03f0, 0x2c552c70, 0x1299eb14, 0x4aeb2f5d, +0x91c6788f, 0x3e7eb8b7, 0x8cf87faa, 0xd6ad91d7, +0x09001cb8, 0xbb0e0e9c, 0x69e34cb6, 0x8c327667, +0xb131e466, 0x6cedd8db, 0x6b69897b, 0x912ab8b2, +0x279135c8, 0x47fb76f7, 0xe2d848dd, 0x35eca5c1, +0x36b03a9f, 0x4a78f3e2, 0xb2e7a499, 0x7b8ee42c, +0x92f81ae4, 0xf6211333, 0xddfad07d, 0xd5a29420, +0x975ba3c3, 0x8b45bdde, 0xf87ad6a1, 0x0f6066d0, +0xb4824a98, 0x34302669, 0xd743a21d, 0x75147919, +0x23c3a0a1, 0x2f752dd3, 0xe0a481b1, 0x2ba678a7, +0x0c30c7c8, 0xc1ec3260, 0xac7e1e8f, 0x738818aa, +0xf5296aed, 0x9f18f56b, 0xe45cc378, 0xe246eca2, +0xcd972e4e, 0x130d9f58, 0xe15bed18, 0xe7ac378c, +0xcbb3d474, 0xb8388d61, 0x5eb363c8, 0x5457c619, +0xa9898da8, 0x409d9fdd, 0xbce87977, 0xeaacb859, +0x4b9d9d15, 0x2be4cc15, 0xe551dd92, 0xe746cfc6, +0x7f60048e, 0xcae0aafb, 0xf5f76ca6, 0x1d33b579, +0xc0b76c58, 0xdf8c7b26, 0x04dc16e2, 0xe1d00d31, +0x3af698a4, 0x1af8cda9, 0x396c3a4a, 0x7a8bd6a7, +0x93210650, 0x702d49a9, 0x2407b8e8, 0x7930eaa9, +0xad13dd0f, 0x7b1d18e8, 0x08c47061, 0x1ae4732e, +0xb8d46a2a, 0x0dea5023, 0x367f47b7, 0x9adc07d8, +0x8983aeba, 0x614e7aa7, 0xbe8cbe73, 0x74060785, +0xa4f79b3d, 0xcaf925c3, 0x1a6bba98, 0xfdf5e06d, +0xe6647f81, 0x1b2a587d, 0x38e4d0a6, 0x6f480736, +0x306135ae, 0x35902f8d, 0x46d165db, 0xb6556e05, +0xe2a6e2c4, 0xd792c8b7, 0xa7fbd2ea, 0x70c887d8, +0x41ce31f6, 0xbc25cdcb, 0xc6c38d7c, 0xe423cc5f, +0xff65d1f5, 0x7ba0ed5d, 0x987ca409, 0x2efe6c08, +0x584612ba, 0xecee13fd, 0xc8ff094c, 0x3c515694, +0xb6da8495, 0x8728e5cb, 0x0bb7791c, 0x01423d67, +0xe70065f8, 0x47bf1ea0, 0xf9fa9a2b, 0x0c39dbec, +0x6e868093, 0x34693665, 0x5a72a358, 0x9b5aaf57, +0xe282cb10, 0x3a976445, 0x6310f592, 0xfdcbc3a5, +0x1efce5da, 0x9d7adf5d, 0x8a22bebf, 0x8c74e51d, +0xbb757b08, 0x5e60ebec, 0x8c061c12, 0x1a98bd42, +0x98235386, 0x5b9979e6, 0xa9a1c1d3, 0x74da81b7, +0x26159b04, 0x968f8f3f, 0x5dc721af, 0x38983da1, +0x3081b703, 0xf74afd45, 0xe0d0fdf8, 0x4ca4a5ec, +0xa77f4e5f, 0xbff6e1f9, 0x0d70f10b, 0x2e4d5d65, +0x2c225e52, 0x19cd05b2, 0xab5b9529, 0xa1807897, +0x919b46be, 0xe0af3fb5, 0x677cc373, 0xfd9e8a31, +0x77ca0d01, 0xa6bb4e31, 0xae6ee008, 0x566613a0, +0x868c88d5, 0x86e3b52b, 0xd195e8e2, 0x7ef8442b, +0xe5b38248, 0xc2708612, 0x8866bcf7, 0xc9b33039, +0xccd1d850, 0xa7132d8d, 0x92373757, 0x05850eb6, +0x1f3df27a, 0x1beccda4, 0x5c7ede4e, 0xa7913287, +0xf408ab93, 0xe0ae9332, 0x017640de, 0x59cc83c9, +0x82138281, 0x0f097ee9, 0x3a43f7c1, 0x46d35062, +0x640e440c, 0x4508fcaf, 0x2cb8c0a7, 0xb3c9d9dd, +0x3da51ff0, 0x8d563673, 0xdd827c80, 0x6708ad51, +0x6f5b4e82, 0xcadfcb93, 0xced6d301, 0xe80985a7, +0xafe67077, 0xfb442e94, 0x09f2a88a, 0x29faf1c9, +0x5e8a3aa3, 0xaf44fcc6, 0x2fded4ad, 0x62929f80, +0xd88bf250, 0x7d44fdb6, 0xd36d6d1e, 0xb0e2d07c, +0xe5ad8bb6, 0x14743306, 0x1e57a83c, 0xb1fb5d18, +0xca026cac, 0x2ab941f7, 0x44aa4f4c, 0x392d4f27, +0x7cc7fcc2, 0xed036430, 0x1da2780a, 0xa2a01b7c, +0x16549f66, 0x16e2a3a2, 0x2f3b8d3a, 0x12208183, +0x94d2633c, 0x7a7d1fb5, 0x6e178a39, 0xd683e3bb, +0xb37647b4, 0x789ba594, 0x3abef7e8, 0xa69f6381, +0xb78ac595, 0xd3900aa0, 0xb3dc867c, 0x6723cb3d, +0x5a4b12e1, 0x0d735efd, 0x9e142ca8, 0xde584595, +0x11634809, 0xbc2e720c, 0x15efe632, 0x6291ecad, +0xf7f99dff, 0xebc7f76e, 0xde3c9508, 0xd381cbf3, +0xd0744570, 0x0e10ab17, 0xe4fe8d27, 0xaffe05dc, +0x4c15370d, 0x886c8c2b, 0x78cefe55, 0xfe325ac9, +0x01d2195f, 0x765f26b1, 0x2ef0d1cf, 0xcf200828, +0x0244cfbd, 0x10c10237, 0x79eb25f8, 0xf5264d83, +0xb05b67f4, 0xe6792eb5, 0xb0256f42, 0x2af0ca05, +0xa2e5e041, 0x887fdabf, 0xecc25c92, 0x613f6601, +0xf118f26a, 0xbcd54fd2, 0x9acf5ea1, 0xbc7d6817, +0x9f88abdd, 0xeaa0e4b8, 0x75847573, 0xaacb87f4, +0x06b7acac, 0x1bdebb7e, 0x20515fbc, 0xc819d085, +0x56fa34ec, 0xb0b76726, 0x0eb9d1b5, 0x921f78ea, +0x7635cf33, 0x22d25167, 0x987c51c6, 0xbfe37ace, +0x5ac0a9ce, 0xc8cac00c, 0xbddb09ac, 0xec77e5bd, +0xa103c690, 0x4661a597, 0x96df82fa, 0xf9fa873c, +0xf24ce7a8, 0x102b8383, 0x474aeb90, 0xb8b592aa, +0xae2da94b, 0xf1fc9969, 0x82a0de9f, 0xb3234612, +0x111aa0f1, 0x4b05c3e8, 0x10a6eee0, 0x083d60de, +0x433d293a, 0x973f33eb, 0xb8b7f162, 0x6a786072, +0xa63ba303, 0x27edc82d, 0x577de011, 0x5e6e8be8, +0x27bca55a, 0xff903277, 0xc0495432, 0x2a6780f1, +0x2a70c68b, 0x98c8173e, 0x37235e67, 0xe229c198, +0xc9f86bb0, 0x38c1c747, 0x741118ca, 0x34235cc8, +0x348df0e5, 0x75be60a8, 0xacabc892, 0xf05a762f, +0x451d8c5e, 0x1235810e, 0xa5e0d7da, 0xe8f27cdb, +0x75a6edff, 0x7bff497e, 0x5601e61b, 0xb2fc6d4e, +0x784e35b0, 0xd7efd609, 0xf55b488d, 0xfda1aba7, +0xb926a7e9, 0x236b1409, 0x2a9d4105, 0x86a8df4d, +0x7fc4b36d, 0xcd9f6793, 0x2e15226c, 0x725675f7, +0x483a4e5e, 0xc6fd8b44, 0x7f42a1ac, 0x711e0128, +0x47e8ab80, 0x0f9361e6, 0xfa38a508, 0xd2e7d1c7, +0x91b81a95, 0x1cdf5f80, 0xef86cd65, 0x318a6275, +0xa84585d2, 0xa27c4541, 0xb26d8c5b, 0xf79b336b, +0xb51c2cc1, 0x3422c895, 0x953bf7d8, 0x71466705, +0x4f90f392, 0x402b5a42, 0xce5215c7, 0x5395c520, +0x453427a4, 0x436cf6c2, 0x34c5600c, 0x6899e759, +0x8ad6b901, 0xc31a8122, 0x29e1bc90, 0xd11bf630, +0xcf671862, 0xec095de2, 0x044bba82, 0x67b9abf6, +0xad843a1b, 0xafe02438, 0x4e82a2fd, 0x85e84ed7, +0xd2ba6e66, 0xb5edcfe7, 0x476938fc, 0xa510493f, +0xe2d5c2a8, 0xea169701, 0x13d137dd, 0xe1c4a90b, +0xbe6e83cc, 0x86c7755a, 0x2747766f, 0xbd7e696a, +0xd8f8d213, 0x9d9c88c1, 0xcd516628, 0x173dbc33, +0x0dc00cc1, 0xa763983a, 0x6b63adc9, 0x3ce03a57, +0xa1eb02c0, 0x6ad649c9, 0xcdbf6697, 0x9d46ac43, +0x8032b000, 0x84da2dd1, 0xace559be, 0x64ab986e, +0xedc73cba, 0x47bcb0d6, 0x443f3438, 0x2af218e7, +0xc6d2fab5, 0x02258ebc, 0x9eec17f5, 0xd9a63661, +0x17d027fb, 0x282b006b, 0xbaff339e, 0xe18d91b5, +0x0c57056f, 0xbf10bab6, 0x9fa42084, 0x0e8cb3e0, +0xb93d1786, 0x25b72ab8, 0xa114fe9c, 0x2aa7b034, +0x72b537b9, 0xa63e4832, 0x8ff076d4, 0x7fb2d4ea, +0x87179a17, 0xea0f0d46, 0xf1e110e8, 0x5c93fe68, +0x75e43201, 0x5c2d3a36, 0xc8416b4b, 0x396db131, +0x500817f7, 0x4c427e44, 0x35736e80, 0xd1d85ace, +0x2ba3bf2b, 0x4a80d8d6, 0x425073e2, 0xa10ca5c9, +0xfb6c8f7e, 0xae267a9c, 0xf54920c4, 0xfbfe16ae, +0xb0196135, 0x2888b4b1, 0xc86af3fa, 0x74726fed, +0xb8a1bbcf, 0xe539699f, 0x4946dd3b, 0xb1fab1e9, +0x96424854, 0xf77ee09c, 0x9c42d795, 0x65012123, +0x879a8230, 0xdc0c2308, 0x7636fe4d, 0xf8cd3d9b, +0x24a5e298, 0x0614ac66, 0x8b18098e, 0x6e318b0d, +0xd3fc4440, 0xea11bb94, 0x5e3194b6, 0x74993558, +0xa2bd17da, 0xac24544c, 0x1a24c0bc, 0xf9d81e85, +0xeb0286b3, 0x689ec98f, 0xe94be40e, 0xbc793302, +0x3a202c6e, 0x51c8b8a7, 0x1c817c13, 0xe2afac8a, +0x847e915c, 0x0101fecd, 0x70df24f3, 0x212bb797, +0xdf622044, 0x814605a4, 0x970174f9, 0x4a8a5c8b, +0x9e053110, 0x49edb90b, 0xdba3994d, 0xfbebdd18, +0xc61e9767, 0x4e3ceb12, 0x756d9ff9, 0x3db2631e, +0x4313407f, 0xba3b4043, 0xdee1b661, 0xc273073e, +0x00cfe6e4, 0x369e525b, 0x80feb8d9, 0x29b7fcd3, +0xc084be62, 0xf2e7f774, 0x20522620, 0x5d320b10, +0xe7a6b785, 0xa250e4bb, 0xbe71bfe3, 0x0af7a207, +0x0791dc09, 0x0e76c202, 0xb8cb2a4d, 0x9cd57d0f, +0x4d393bb0, 0x3790c583, 0x91831c50, 0x5812d115, +0x7d592a9e, 0xf305e0ff, 0x96371d40, 0x12c2faae, +0x0e0f1afd, 0x8c8490a2, 0xd5db6db1, 0x00b7c6dd, +0x6f732b4d, 0xcdae2411, 0x54c634be, 0x207446bb, +0x0a7dde92, 0xf2d85bfb, 0x428090de, 0xd1139bf5, +0xa50b8b5a, 0xa4d2c005, 0x9f9224be, 0x33416798, +0xa14404c0, 0x40aa594a, 0xa5c448d3, 0x59bfb22e, +0x74de9761, 0xd45f3c5d, 0x9aed0fa3, 0x9dd057d8, +0x18da8aa6, 0xe36b0c80, 0x992dbe37, 0xeb4a96d1, +0x25c9db94, 0xed264076, 0xb23eab66, 0xc4d983d1, +0x39f11da4, 0x72f5cf3a, 0xa7c4f7ca, 0x43e528b4, +0x9ee87987, 0x68106620, 0x31f52433, 0xcdfbd59d, +0x4c1ec259, 0x510570e6, 0xd3f24f0b, 0x45fc7278, +0xd1dc6833, 0x5769b2af, 0xf8794f53, 0xec5a1b07, +0x839d0fc7, 0x738db681, 0x8d30cfd3, 0x23cbf11c, +0x573e5a15, 0x69a2a49a, 0x5ae58c3a, 0x74005593, +0x051c214a, 0x181f1d1e, 0x4e2cd168, 0xbd176479, +0x3b90eb85, 0x5e82ab25, 0x30f09649, 0xe4a4a736, +0xbbd5c968, 0xb9cf54e3, 0xcadc7c1e, 0x207b64b9, +0xe3a6057b, 0xe7d1f08c, 0x2787e3a2, 0x798629f5, +0x051f5a81, 0x59b89f76, 0x49491246, 0xc23df6d0, +0xe4c785f2, 0x28327e00, 0x248a2099, 0xf8f44d9e, +0x395d82f8, 0x67e93299, 0xb5b0067e, 0xa581fb2c, +0x4578ba11, 0x06422b83, 0xc68e78c1, 0x983cda60, +0xb9f057ec, 0x346d7f8a, 0xd90a1e05, 0x772e1e2e, +0xbf8c507b, 0x06a46ab7, 0x950d09c7, 0xd29b864a, +0x2db02cc1, 0x65c9be52, 0x666a9150, 0x0f31d6d6, +0x7412eedd, 0xb83b1fda, 0xa2b7868a, 0x587c7ad0, +0x12f9b8bb, 0xb846b1a7, 0xba130be2, 0x25c26984, +0x7f91bdda, 0x6d9c1253, 0x5c0062b7, 0x0ae55f41, +0xb5ad74c6, 0xd62de79a, 0x61d10f4d, 0xfeb15e78, +0xcd6622ae, 0xfbd92752, 0x34b07a10, 0x4429304f, +0x96c9efc6, 0x27ddbc89, 0xc1480f76, 0xc2e2398b, +0xd8500033, 0xbfe47bdc, 0x2a55d97d, 0xc12aaa7a, +0xa920363c, 0xda44cd1f, 0x6456c07d, 0xde15b202, +0x984586c6, 0x707d1245, 0x642066a1, 0xc7bed748, +0xae485977, 0x3d6e39d8, 0x12e7454a, 0x7239eca1, +0x10ceabb7, 0x9488eb97, 0xb85787a2, 0xc9ec5005, +0x770cf88e, 0xc20f23eb, 0x2b8a860a, 0x46c87f94, +0x38f436a8, 0x468da8fa, 0x61a329dc, 0xe270b956, +0x0563d46a, 0xdc6863d9, 0x3fcfc28f, 0xa9cfb41b, +0x91a9d820, 0xe1806611, 0xe5cea0d8, 0xe6fd17d9, +0x83a2fc17, 0xf2a23d2f, 0xf274f594, 0x3d584116, +0x5bfca4b1, 0x77349ce9, 0x94665a44, 0x9638147c, +0xefe4666a, 0xd47ccca0, 0x7b6c584a, 0xf90d4861, +0x8cb13847, 0xe3606457, 0x84b2d081, 0xcf77d329, +0x944c6110, 0x0febc362, 0xf435e48e, 0x27248040, +0x41c60da1, 0x55a37a00, 0x3f2035b7, 0x021f31e6, +0xec337da2, 0x4bcb9401, 0xb63f929a, 0xd51260a3, +0x537f8522, 0x1300fb82, 0x7097b8a1, 0x0e08ca19, +0x69f82279, 0x7cd2e9cf, 0x1a0c7ad4, 0x0d1a9210, +0xb4615124, 0x2c1f49c6, 0xeda3bb44, 0xf7b3f356, +0x67bb41ac, 0x70c257e2, 0xad945132, 0x877aedb1, +0x8b0edcf1, 0x2fa629f2, 0x7ac13867, 0x3f80eac6, +0xe2c1875e, 0x29efa006, 0x94355cc5, 0x3b76abd5, +0xf613ab16, 0x4aae5a63, 0xc121c603, 0x44a2fce6, +0x987ec0cb, 0x9bc141ff, 0x3121cd62, 0xce68d88a, +0xa82d3d23, 0x49fe352d, 0x68e08c2a, 0x7024f429, +0x04b95c37, 0x8be76b1b, 0xdd311d8b, 0x4282bc4b, +0xc9738740, 0x6ef42ebd, 0x37091496, 0xc87444d5, +0xf6bd5d31, 0xc0980bed, 0x507d72a4, 0x1f74919a, +0x7dc03f3a, 0xbb3222ca, 0x2d6d7a86, 0x7af0a2f8, +0x1e66e7a8, 0x6b4b8285, 0x881846ea, 0xa246df49, +0x63e13055, 0xb7db2365, 0x21ecd938, 0x0a3ac6f0, +0x9f2ee17d, 0x088c0d47, 0xf9b04b0d, 0x98683310, +0xb902354b, 0xfd9cf22a, 0x8db050ba, 0x8bbee905, +0x441c2b2d, 0x384b0bd7, 0x4a00c41a, 0xe304f920, +0x892c3175, 0x19086e6b, 0x6de06cac, 0xdfc8169e, +0x12ed296d, 0x2d9039ab, 0x9394c630, 0x658b5abf, +0x9f783824, 0x21587a65, 0x25891e90, 0xfb9bed90, +0xd0d6ffb1, 0x2c1e66bd, 0x0f112a57, 0x34337dcd, +0xa30068cb, 0x93c138bf, 0xdc7f7c6c, 0x4362a6a3, +0xb936ceac, 0x8a0c1028, 0xaea2a81e, 0xee0fb25d, +0x16712ac9, 0xf89b6d12, 0x9e5e5d28, 0xbc98707e, +0x0ea6e826, 0x2bd120af, 0x7577aed0, 0x62d13a29, +0xf9c3640a, 0x7199d567, 0x37c30f6b, 0x1db335ea, +0xbbaef1e7, 0xc740c8ca, 0xcfaf939e, 0xa7849807, +0xd36254fa, 0x5bb5b031, 0xfc4e699c, 0x188bf6d9, +0xc9f9e87e, 0xc0125523, 0xcce9222c, 0xfd43e507, +0xa130299f, 0xbf19f542, 0x43a3692c, 0x2cb9a85f, +0x7f747fac, 0x83771d34, 0x87585e97, 0xce99ffed, +0x4a4506cf, 0x5ef49718, 0x36730699, 0x4ec1e2ce, +0x0250bc82, 0xf895d5b5, 0x5eab0bb8, 0x997fc9fd, +0x1d6f614f, 0xdcde28b6, 0x2e29e5b1, 0xc77aa311, +0x3e6aa824, 0xb7a3a3f5, 0xbfb32083, 0x60719177, +0x32fdcf21, 0x7e29c945, 0x61c85e49, 0xe2c04ad3, +0xe456afd4, 0x52d55c02, 0xb85d4a41, 0xe55fe2fd, +0xa395c95d, 0xfb1a728d, 0x094f69e7, 0x20250767, +0xaea6889f, 0x650ffa54, 0x5b51466b, 0x478a3454, +0xbd2ceed9, 0x39ab495e, 0x8f092245, 0xb4722d1e, +0x506c2c3f, 0x67aa7bf4, 0xc2c2cabe, 0x1e188ad0, +0xd2751073, 0x505b7e44, 0xfee01a5d, 0xe0ffb131, +0x1311d587, 0xb3ab6154, 0x4d9756f0, 0x3f367bcc, +0xe546a792, 0x36cffe51, 0xc4d2a996, 0x31794370, +0x9f0cb5c2, 0xca39776e, 0x5c2d32dd, 0x1fca0248, +0xc035fb0d, 0x6aee0bc9, 0xa3d93ba6, 0xdb0ff506, +0x08d63ff1, 0x71133d67, 0x10a4c033, 0x8d2116c6, +0x66fee4c3, 0xfa7a631f, 0xd345d297, 0xefb87306, +0x11557df0, 0x84114e7e, 0xbd816431, 0x69ad949c, +0xb5aafac9, 0x495b2d0d, 0x2b2b0279, 0x4539b4ff, +0x67fe5b60, 0x8c8f1174, 0x7f8f9e9f, 0xd920e38e, +0xe4ae1ac8, 0xadbbd9e3, 0x9aacc619, 0xd156a7a0, +0x14ceea22, 0x6a0eeabc, 0x023be4a2, 0x078f4352, +0xfeda77e1, 0x744e6276, 0xdc146546, 0x3e4be543, +0xb044cc13, 0x7bfc7991, 0x03491235, 0x22b923fa, +0xe2b0b718, 0x4cb87f02, 0x482bb8b1, 0xf807a4e2, +0xc658e36d, 0x3b11eef7, 0x7afe4edb, 0x383c0151, +0x14e47de2, 0xc51a08af, 0x2bc9f8ec, 0x17f852ba, +0x356a6c78, 0xbdd76bf0, 0xa19502a3, 0x9a09afd9, +0x5b1a33b4, 0x445f1ce5, 0x79a81361, 0xf5544d2f, +0xd251f0d7, 0x1a758140, 0x0bb6a973, 0x3f5fb7bf, +0x5baba285, 0x677ef139, 0x8001d2dd, 0x99606495, +0x50ec0e0b, 0x775e796d, 0x0868e5cd, 0x1b60f492, +0x7d4f6260, 0x7a67447d, 0x87c930b6, 0xfcaf741c, +0xff11ff55, 0x1c622538, 0x164f6ce9, 0x6e856371, +0xb2d7b6c4, 0xa0f80375, 0x6b7d49e9, 0xaa9e488c, +0xc3850469, 0x80b448c6, 0xa6e89784, 0x5c5a4e96, +0x9358ebef, 0x394decd4, 0x08e15478, 0xe8581029, +0x4319141d, 0xfd593c25, 0xdc347fa4, 0x71f6e7c2, +0x48828849, 0xb46dcf38, 0xe4339ec5, 0xae14e971, +0x0f8832bc, 0x9cb40b4f, 0xdc9ba687, 0x01ff7574, +0xaf0b2160, 0xfd107997, 0xf1d78414, 0xdb6a7d1e, +0xf59ffc0c, 0x0505b95c, 0x780b725e, 0x6e8e043d, +0x1bdf20ee, 0x7124994a, 0xe3eca6d9, 0x9692aca2, +0xe387d8eb, 0xdc79d557, 0xc5d047cc, 0x1a653c91, +0xa1be4b91, 0xbe192611, 0x67182ca0, 0xf075f297, +0x9c81f763, 0xf7c60f4b, 0xf53ec9da, 0x61ae6d4e, +0x2495a2d8, 0x2fc64a6c, 0x4e1d3b35, 0x5757f5c7, +0x1b0ba2ca, 0xafaa9188, 0xd83f9066, 0xcbc71040, +0x957e50fa, 0xd36b97d9, 0x4057273a, 0xbb389e17, +0x113ffd1e, 0x974aef19, 0x6e0e5989, 0xdf07e637, +0xfa194967, 0x8cc93def, 0xbdd797c1, 0x1e0fc44a, +0xf16113b8, 0x158103be, 0x08778b23, 0x9f1d21cd, +0x2d330d5a, 0x929dbc14, 0x63184ec2, 0x605f5936, +0xe466dbac, 0xd46e1d61, 0xe437b8bb, 0xaa92df5e, +0x3dd9f782, 0xfdea8da2, 0xd70bf2b7, 0xd4df55b6, +0xffb8f224, 0x5bbadb98, 0x94d290d3, 0xda31abff, +0x1d45ad9d, 0x4442fe4c, 0xdbd6aa5a, 0x9c9e0a83, +0xd44a86c9, 0x943ccf0b, 0xc2b91627, 0x03ce9f3c, +0x784649b3, 0x96c092d8, 0x2bb28f75, 0x71f1f877, +0x39fd54ef, 0xa9ca6ae5, 0xe19691e8, 0x18be9fd8, +0xe2dab935, 0xf0918e5a, 0x50d31846, 0x001100c3, +0xd38394aa, 0x862eaaf3, 0x11791dae, 0x543ce194, +0xca12f29b, 0xf449a023, 0xfcba36ff, 0x52c5c796, +0xf34f7c8c, 0x7c8bc949, 0x5b0183b2, 0x06ae31d7, +0x4a22e622, 0x8e76c12a, 0x86c703e3, 0x1e766429, +0x3da80a33, 0x68196ec1, 0x2dbc46a8, 0x49089d68, +0x82965f07, 0x60ade759, 0x5298cd93, 0xdcd961b6, +0x052501f6, 0x8ab4097e, 0x637e12b5, 0xb35173fa, +0x6efc7fb6, 0x1110b4d9, 0xa4638335, 0xffaea7b2, +0xf927f7e6, 0x39df8af6, 0x548e0b32, 0x9f742dd1, +0xf878d3cc, 0xfd3ac505, 0x0525836e, 0xd33de1d5, +0x650297ef, 0x92f5438a, 0xe6cb0953, 0xf3f2b63f, +0x8f54bf00, 0x4011059d, 0x79b9d9a2, 0xa73033d4, +0x11e55055, 0xc72be11c, 0x695d4134, 0xf0953898, +0x25fafaf5, 0x1ca858ab, 0x7235937f, 0xcb61dd9d, +0x79657366, 0x1a731d6f, 0xa10aa30f, 0x52dfcc7b, +0x8d5ad5db, 0xb598c2df, 0xd704213d, 0xaf866a49, +0xe63b0ec4, 0x8326de25, 0x8bdcded7, 0x75a40ea0, +0x2602666c, 0xd464368a, 0xe07f9caf, 0x24460db3, +0xee90dcc7, 0xfc643caf, 0x3c3508be, 0x5f09faed, +0x70855c22, 0xb9a134d2, 0xb25b04b2, 0x8e40af02, +0x4609b329, 0x6ef2f55e, 0xa09e8b58, 0xb13ff72f, +0xbe4e17eb, 0x3e3ab3b9, 0x919b38f0, 0x8b2b703c, +0xca31f456, 0x5d021ebe, 0x9b6a256e, 0x8ef6e0c5, +0xb35b563a, 0x80de5527, 0xe4b5615e, 0x8ed5e6c9, +0x62a09dd0, 0x59baca33, 0xaac7d22a, 0x6568d483, +0xef95b521, 0x96a0640a, 0xf1089bf1, 0xc1ef473b, +0x691ba720, 0x49130c01, 0x0ad790da, 0xe81af68c, +0xfcb52b4e, 0x837a143b, 0x72760eb3, 0xbf31fc9e, +0xd07dfbf8, 0x3c031232, 0x9af5c387, 0xe8255312, +0x2ad84e64, 0x6ef96801, 0xcd2ab3d6, 0x5196fed7, +0x707b3541, 0x9df09da6, 0x32fcb747, 0x5f1d5f3d, +0x56560f0e, 0x2034f476, 0x2e81f398, 0x53112255, +0x45747d57, 0xfe07e507, 0x4bda5881, 0x4a0ce217, +0xb76215a1, 0x6be986a5, 0x92b4859a, 0xf943db06, +0xc9879688, 0xb9d3481a, 0x1af20c9a, 0xbc3f0df8, +0xb5a94516, 0x7fd18e3c, 0xda8e9bbd, 0x8096a507, +0x904c3c2b, 0x1ce388c3, 0x4632c363, 0x5892a25d, +0x0c3b22fd, 0x7a9bee3b, 0xfbcbd4f8, 0xa581b6d0, +0x4987b2d9, 0xa5080ade, 0xcf3f2e7b, 0x464c0bda, +0x32fdc9c4, 0xc2640c5c, 0xeceecc63, 0x7b9bd5c4, +0xedb62743, 0x871da12a, 0x34b3ff91, 0x90772f2d, +0x8f98a6cf, 0x97320213, 0x6be5883f, 0xbca8e8da, +0x0155cdb4, 0xd94cbb20, 0x3189a5ad, 0xd65783e3, +0x80746164, 0x3424bb87, 0xf501c3ad, 0x2a98fb51, +0x3d5f7200, 0xfcbb8aee, 0x6f75d81b, 0xd442025a, +0x06ee6bb4, 0x45eef6ea, 0xedf3d8db, 0x0f1fba17, +0xa7ee72ea, 0x65afbb50, 0x3c7eb38e, 0x68109922, +0x13cca9d5, 0x38c1dc42, 0x5faec1e2, 0xfd91caa6, +0x745fee6e, 0xdc00379a, 0x05e685c3, 0x6859c7e7, +0xe6d534b7, 0xc7cccc7b, 0xb342c1a6, 0x3de96804, +0xabbd6568, 0x21eb6241, 0xc3358305, 0x7012c615, +0x92aa7da0, 0x7d7e2e09, 0xe2404fd5, 0xe39852b4, +0xdb74ab99, 0x26d964e1, 0xb42f1577, 0x3cabb45a, +0x5b9154d7, 0xb8d8850a, 0x97543536, 0xceadb214, +0xb0f33889, 0xde131507, 0xe306de2e, 0xf51c22c5, +0xa4663640, 0xa8932ebb, 0xe1a86c2e, 0x2a4f906c, +0x2e9e9d19, 0x5731d12a, 0x237df77f, 0x46daf350, +0xd4d35764, 0xb5ac8148, 0xa28f00c5, 0xf69ce318, +0x1c8ad0fa, 0x6d533ce1, 0xe01443a4, 0x68ae95ec, +0xa122d1a3, 0xc410de4d, 0xf5d2a74f, 0x81266910, +0x0ac4b751, 0x518b6e30, 0x34761379, 0x5f767d78, +0x9cda2ff4, 0x6aee40f0, 0xbad692f2, 0xd017dc48, +0xe9c5b5b5, 0x19b15b0b, 0xe100d3cb, 0x7c35bacf, +0xa56d3863, 0x26c024f9, 0x71fa158e, 0x6b8fb054, +0xc227b3bb, 0x8ab6772c, 0x9d6a06a4, 0x331294b3, +0x4749bd96, 0x8fa8424c, 0x282a4182, 0x8dd77fdb, +0x9b2c1be2, 0xeee3f207, 0xbd4e91e1, 0x2b5d5939, +0x04e2e376, 0xa291ee1e, 0x471e90e8, 0x9e8375c4, +0x3d03076f, 0x93d1a30d, 0xd37c89a6, 0x39a5544d, +0x2853435f, 0x1e1c99fd, 0xf566b487, 0x6893d339, +0xa88ba5d2, 0xb0e44038, 0xdec733df, 0xc7928a06, +0xcc2a373f, 0x165f38c4, 0x02b8add5, 0x61e47815, +0x116c57d2, 0x6b67c50f, 0xdd8ae800, 0xc1f6a03c, +0x8309af5e, 0x0f2c5b63, 0x779d5019, 0xb616b270, +0xc1a1a1b7, 0x1b1b2661, 0x9927b0fd, 0x07f5f1d1, +0xba22b9fa, 0xa54d7eec, 0xe05cc15f, 0xba960b08, +0x2ff8a219, 0x5dd09b73, 0xd86605e7, 0xcaeeacb2, +0x85a31962, 0x3b921d1f, 0xb2826458, 0x0a1aaef5, +0x2c5ff654, 0xa33d31b0, 0x4ccda15b, 0xcb319e52, +0x1122a597, 0xb843bfe7, 0x458a32ad, 0xa48e3501, +0x6ce0492c, 0xac6df16a, 0x6d1161ef, 0xaebf8bad, +0x161e6c19, 0x7b7d7409, 0xed09d861, 0x7f6b3ff7, +0xceb74158, 0xf4af4d98, 0x243cbfa2, 0x431ac884, +0xa250d7e8, 0x45ba8c96, 0xcbb8328c, 0x3e0025c6, +0x2212bd7f, 0x0b8645d7, 0x982bb115, 0xbb16d79e, +0x6d017fb3, 0xf19eda38, 0x96fa13a3, 0x50c9c6c4, +0x0cde0a16, 0x7d0231e3, 0x50e520fc, 0x068841c0, +0x79c5b7e3, 0xd05c7287, 0x9d24268c, 0xd6c86529, +0x74dd5f2d, 0x5875e945, 0x20a2f564, 0x2e33fce9, +0xa30b53ec, 0x3de3269c, 0xd90773fc, 0x3fe0fd4e, +0x0372211b, 0x759889b9, 0xc11357b0, 0x53ba3a32, +0xbd5b3f61, 0x6f0d8aba, 0x0a1ce4e0, 0x83a2f819, +0x5fee403b, 0xe56905e0, 0x4c3ecbc2, 0xf4942d75, +0xcc765225, 0xff18d629, 0xeedbb175, 0xef0be9c1, +0x3811969b, 0xfa2708be, 0xa06bd4f8, 0x097a718c, +0xcadf6135, 0x41990cf1, 0x5198f34c, 0x88529cb7, +0xe4791ed1, 0x744ad621, 0xd015a1b1, 0x91a1d8eb, +0x5e6ef569, 0x9ebfe89d, 0xc50425e9, 0x27d6f47d, +0x0b0f3360, 0x84ed39bf, 0x49f4a559, 0xd6270a6a, +0x0da209bc, 0x99ca1cc2, 0xa58d1182, 0xae3b8885, +0xef5e7449, 0xe4f73901, 0x4e4117bd, 0x5375cfca, +0x4769238c, 0x2ada151b, 0x5aa7626e, 0x408d6d79, +0x5c820b16, 0xdf021ef9, 0x24e41301, 0xa483c2c8, +0x35cba219, 0x299f9c47, 0x394b6fbf, 0x1c1e4ee1, +0x7ed4a725, 0xa5198ec8, 0x88aa866c, 0x53679e79, +0x1d059636, 0x73deea61, 0xab88d018, 0xf205a6e8, +0x2713f775, 0x0b1ed394, 0x4059b42d, 0x0213ac4a, +0x39085cb6, 0x5600cfe8, 0x52093101, 0x649fbd0e, +0x74c0702a, 0xe7629810, 0xa681aacd, 0x60eaa0a8, +0x72cc508e, 0x9e1d776c, 0x5e408e10, 0xa838335a, +0x2fd49374, 0x8b7b2d59, 0x2f316ab4, 0x75a1e5d9, +0x8f2c0096, 0x79403937, 0x011c00ab, 0x1f2117be, +0x18b9f030, 0x2c1e9b35, 0x4e637614, 0x1087e918, +0x6a880f50, 0xdab80288, 0xfb368f0f, 0x81e49f3f, +0x6d80b329, 0xc8b5bf26, 0x80a78d17, 0xc361dc54, +0xc2868734, 0x7378c8be, 0xb7e6b6de, 0x1f0d7ea3, +0x64f0dca1, 0x0b05acfb, 0x1b2558be, 0x7887ea9a, +0xfd8e6536, 0x60a59aaf, 0x41cbb807, 0xd5aa6d97, +0xd5f292b9, 0x9d881fc1, 0xa9469e79, 0x86032d6d, diff --git a/src/cpu/intel/haswell/microcode-M3240660_ffff000b.h b/src/cpu/intel/haswell/microcode-M3240660_ffff000b.h new file mode 100644 index 0000000000..855b565e5f --- /dev/null +++ b/src/cpu/intel/haswell/microcode-M3240660_ffff000b.h @@ -0,0 +1,1153 @@ +/* 0x40660 built on 07102012 */ +0x00000001, 0xffff000b, 0x07102012, 0x00040660, +0xa882cff8, 0x00000001, 0x00000032, 0x000047d0, +0x00004800, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x000000a1, 0x00020001, 0xffff000b, +0x00000000, 0x000011c1, 0x20120710, 0x000011c1, +0x00000001, 0x00040660, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x1ff7ada1, 0xe67ddf49, 0xd16f59fe, 0x3de7b6b8, +0x977a1339, 0x9b309930, 0x77c11ed6, 0xe1663e0f, +0xa19308a3, 0x5b19c4b7, 0x4a1b425b, 0x7d6a74f6, +0x81624193, 0x3a559605, 0x5475280b, 0xe7319d58, +0x48624ca7, 0x507af030, 0x3b32d96a, 0x30164068, +0x5284d2f5, 0x725b2915, 0xf63c9280, 0x44b7c142, +0xe67ca7b3, 0xd6f163e7, 0xcdf51f3c, 0x41d180a1, +0xcc3931b1, 0xf7a544a9, 0x7f6bf77d, 0xfc45a45f, +0xf0985836, 0x652d7e2e, 0x0324b1f3, 0x24b9548c, +0x7bcae7a5, 0xdcdebf79, 0x27015922, 0x0c83c606, +0x3d2ceeb7, 0x61c5eec8, 0x6b6899c6, 0x3e500531, +0xf08bfa44, 0xb304a8f4, 0xcee8f713, 0x2912c786, +0xfae6c34c, 0xa5292960, 0x7d63e389, 0xaa257a01, +0x1fb25054, 0x963fc676, 0x5bcb9fd3, 0x58f369a4, +0xf6e3beb2, 0xa58b5eb0, 0x33c7eba4, 0x37fe8b66, +0x00714403, 0xf0fd0c4e, 0xaa122996, 0x9a55b184, +0x00201507, 0xc9fb6e3a, 0x11ab60c8, 0x80ff6e84, +0xc37aabdd, 0x0fc23175, 0xb0b18c34, 0xf1ec806c, +0x00000011, 0x480b4ccc, 0xdb6de7d6, 0x000cdf71, +0x1765d536, 0xc4184c2a, 0x685c285b, 0xd2bcb822, +0xeaf8abc0, 0x34cfc49f, 0x78c34792, 0x28b4da5f, +0x3d12c965, 0x4c550491, 0x0506a830, 0x4da70368, +0x5ff5f5b0, 0x1a964986, 0x5809925b, 0xbcfc5f37, +0xba8b3d35, 0x3ad36e1c, 0x0ccfd073, 0x0e3c3aca, +0x68c92c72, 0x9c159ac2, 0xfdce3c9f, 0x34bb6e5f, +0xae6b60cd, 0x2e1f315c, 0xbb18055e, 0x173fe3c5, +0x81c53bb5, 0x472dcb5d, 0x97cd328c, 0x72a38996, +0xa5083145, 0xae2387f9, 0x29c7fedb, 0x10e52ad7, +0xe4177af8, 0x95c54b7d, 0x10876a03, 0xc9d600d7, +0x897d1cf9, 0x8add358d, 0x6c6cfd85, 0xf95ee134, +0xf31f1fa1, 0xbad3734c, 0xe9e58304, 0x9f0f99b0, +0x7103e8cb, 0xc66c6e93, 0xb2df78f3, 0x28081f82, +0xe161acc1, 0xa9e20494, 0x454c52b5, 0xcaa9fd92, +0x12aaa198, 0x2d4df98c, 0x3f867734, 0xe0301e6c, +0x5be1d70c, 0xf8309a0a, 0x6bbf90c3, 0x856a1429, +0xc5244952, 0x9e036d0e, 0xe85891b4, 0x819d3062, +0x7658991b, 0x755df5a9, 0x88521603, 0x3639bbd8, +0xfd51e58a, 0xfbc33e69, 0xcd813bac, 0x0b482ca0, +0x0c7a5d31, 0xc5612d4e, 0xfcdd6828, 0xdcf2d51c, +0xe3adf68b, 0xc60a64c0, 0x960f6a4c, 0x207624a4, +0x604f8610, 0x6d2fc86d, 0xf6fa94c7, 0x68ee2a85, +0xc0b21534, 0xb72fd50e, 0x5f8f27db, 0x6a8f6883, +0xcc97c50a, 0x4fe554f1, 0xc6113bb8, 0xc4df7e17, +0x4b88af55, 0x44267a1b, 0xfcbc5017, 0x4a774e4d, +0xa8da382a, 0x12243bdc, 0x4642f769, 0xae5c03a8, +0xcc619a73, 0xd368baf8, 0xa4c1c1c4, 0x0adaafb2, +0x2e8f5353, 0xd595612b, 0xadff0cfa, 0xa85814f2, +0x95286967, 0xd948bae9, 0x368a9ba9, 0x79e3326d, +0xfc5a6965, 0x58f52c5c, 0x63f450bd, 0xf5e8d91b, +0xd6ce6c2e, 0x2b034b0e, 0xf5f27cc9, 0x279aed70, +0xe4454322, 0xc341cc3b, 0x58170512, 0x5fd0cece, +0x1388d7df, 0x05c42e9f, 0x7142e271, 0xfa905cf0, +0x22c54f35, 0x7186deef, 0xcc0fe959, 0xc9cf2316, +0x90cd756d, 0x9081469b, 0xbce19677, 0x8fb9df2d, +0x921f75b4, 0x7e1ece29, 0xd82dd344, 0x197ae9fb, +0x20008249, 0xf9f9fda6, 0x7f94d730, 0x16357312, +0x277a1edc, 0x5e8e0e30, 0xa5d91c92, 0xf7d5193d, +0xb469da53, 0xb6a1f3de, 0x7cee6da8, 0xd8261c52, +0x884b7eaf, 0xb6137120, 0xa7c12e5b, 0x9500d95f, +0x75d94d37, 0xcd9b917e, 0xbf1862aa, 0x4922ecec, +0xc79efc26, 0xf81eda28, 0xf72d9730, 0x11189de8, +0x5f1cbf69, 0x31d466cb, 0x685da66d, 0x96d1f3f5, +0x5ac24787, 0xb8d1cdbd, 0xe62145f3, 0xb2cc24b6, +0x04b041df, 0xbc87a106, 0x7e1a5d29, 0xc76846c1, +0xbec3cab5, 0xa0b380d5, 0x7e469978, 0x601eee3c, +0x98987ec0, 0x0d540b0f, 0xf5ced019, 0x620f9512, +0x652dd7d0, 0x8942e181, 0xf35f6743, 0x6468c26b, +0xe9d97b6e, 0x25c2c688, 0x64e1bf83, 0x83b0e78d, +0x82ed883f, 0xeecbe555, 0xb5d077dd, 0x1577b1ae, +0x06680dd6, 0x641e0ea4, 0x8d1a1f7b, 0x651a54d0, +0x01d2feef, 0x0a2dec2d, 0x9b64c05e, 0xd9cd30cd, +0xc540a9e3, 0x32ec977a, 0xfb720742, 0x6d3df6ea, +0x0a9b6867, 0xaa5be556, 0x63bc6d2c, 0x987e7d4b, +0x520a2961, 0x7132045a, 0x9f0b0ef9, 0x1319e03d, +0x96117ec8, 0xc870daba, 0x0d0ad2f7, 0xb9aec9be, +0x1993aac9, 0x9c68b56f, 0xb9f87058, 0x7d8fa93c, +0x33338095, 0x8bbfd9b3, 0xbfd27b94, 0x48e0e0e2, +0x8549fa48, 0x788575d2, 0xace94436, 0x5d5f57e8, +0x023fa4eb, 0x7bd1e063, 0x270c4228, 0x11e4f41c, +0x265f6645, 0x718f2c7f, 0x6ebc88d3, 0xd8079739, +0x0019ccd3, 0x67336012, 0x9dbb89f0, 0xe394618d, +0x125ea033, 0xeeba68c4, 0xc1c28a0f, 0x2e2a0a4e, +0x52876a7c, 0x11f32147, 0x27926c85, 0x0ed49218, +0x1e212ebf, 0x027058d9, 0xca271e42, 0x94923f25, +0xfb58ca38, 0xff7ea9e9, 0x10ac83af, 0xa913f9aa, +0x24718089, 0xf7a53cfc, 0xc280b538, 0x81587f94, +0x422c2628, 0x1605193d, 0xbd383667, 0x0a9e3daf, +0x3563c712, 0x2adb6961, 0x35c6658e, 0x9d6279b3, +0x7937ac5d, 0x726ac41d, 0xd927d701, 0x2c81e0da, +0xd330dcf2, 0xab2bff53, 0xb2611be0, 0xfa887e5c, +0xd25d012b, 0xb68ab827, 0x6f956859, 0xfe02af8c, +0x1cb944a3, 0xded6edee, 0x9ea78f4e, 0xa27011c9, +0xd901e55b, 0x7361dd4d, 0x052707ff, 0x56a2f216, +0xde9156f5, 0x1849774f, 0xf163a658, 0xee15f902, +0xae02aac4, 0x445a5fcc, 0xf7ecf535, 0x3dcb4cd5, +0x7ce9bd26, 0x14d87d9b, 0xd99c988c, 0x875023a4, +0x72b36509, 0x27bb98b3, 0xb4785c65, 0xea9830fd, +0x4ca22877, 0x9f7f42e0, 0xfe1b50a4, 0x71c40e18, +0x28d0348f, 0x1520b97d, 0x09f855c0, 0x5df295b6, +0xe72e134d, 0x4afa435a, 0x964f7821, 0x8058e28c, +0x42c7100d, 0x8d6849d9, 0x4268df28, 0x0c93ee17, +0x80dd73b6, 0x97e95429, 0x2348f8c3, 0x82daf2cc, +0x5f7e5bad, 0xca96ce96, 0x70e5a8af, 0x2b39329f, +0x59bb385f, 0xb826195f, 0x50cd51a2, 0x5b851acc, +0x8892c127, 0x687a8d99, 0xf4731404, 0x69bea0c6, +0x75b0b75c, 0xb5e4b785, 0xb7c8d2d5, 0x73ba0e9a, +0x3a311e39, 0x3573befa, 0x62d65719, 0xddacf64b, +0xd5058b2c, 0x167dcaf9, 0xd1069643, 0x47dc9829, +0x4044c6f2, 0x05e2e789, 0x7a9491e6, 0x43bb7e0c, +0x9c7b9648, 0x21aa7168, 0xb0736e68, 0x380a00f3, +0xda6ffd04, 0xabc05138, 0xb4fcd56c, 0x1f3bcfb1, +0x8bd59410, 0x01eb9490, 0x66ef8ddc, 0x5c6e72c4, +0x3e117c9c, 0x61e077dd, 0xea2e96a9, 0xba0936fc, +0x21064541, 0x24fed220, 0xff02e43a, 0xe7f8810c, +0xf3872867, 0x7454f13d, 0xc7b610e9, 0x3d73b8cf, +0x0384cdad, 0x5f7a172d, 0x3b6baaa4, 0x7e677431, +0x8a0b6362, 0xfd8d7823, 0xd8cabfb6, 0x0fb3d552, +0xdebecad2, 0x0b07db05, 0xc0d76c20, 0x1aa7db91, +0x1be9abb1, 0xfa661731, 0x3c8aa273, 0x8e70e00b, +0x6d8a6a25, 0x7d6f38d5, 0x298370fd, 0x0d932b39, +0x1d26b69e, 0x1e8dcfc2, 0x70f2825a, 0x613bd515, +0x74eaa55c, 0x757da6a5, 0x76d06b8a, 0x27e86957, +0xf67d21b6, 0x69944586, 0x09ea4ba5, 0x4e952542, +0x0caec887, 0x795fcfdb, 0xcd290b12, 0x0e249485, +0x6f8a14f9, 0xf7bda988, 0x5b5ef960, 0x0b823488, +0xd88648d7, 0x20f4d220, 0x6f3baac9, 0xe54cb2aa, +0xcd542951, 0x748ee3c7, 0x8668853a, 0x95f5fe78, +0x2ce72653, 0xdcfbbc58, 0x742ad45b, 0x3d2a9a02, +0x065ad857, 0xbe6cea1b, 0x4d81cafc, 0x258d4b2d, +0x7d0b5d61, 0xa01c187f, 0xb6e3934b, 0xa8c5f12e, +0x98eaed95, 0xafbb6f13, 0xa2b5abdb, 0x0fcc93e1, +0xc2d09e18, 0xf82a6c76, 0xed92c7ea, 0x4225f256, +0x55395aaf, 0x2d3418ee, 0x39c764fd, 0x3c1f45da, +0x7ea6df70, 0x9f849b7d, 0xd67b062c, 0x096f0bdc, +0xa12fc63e, 0x6534750c, 0x640afb20, 0xea691235, +0x69b6f5e3, 0xc82f750d, 0x648764f1, 0x23c08ebb, +0x4f61cc48, 0x30dfc6fa, 0x91cca2d1, 0xbf78ff85, +0xc42a6578, 0x94a52d22, 0xe0e661d3, 0x38f38a2c, +0xa1247441, 0xcc629f49, 0xae77f81d, 0xd9ae5b0a, +0xc96df3f2, 0xefdc25be, 0xd20aa371, 0x951acefc, +0xb5c4892d, 0xb48135db, 0x301de6c6, 0x157aa4b5, +0x72c543f3, 0x1b63e2eb, 0xd038986f, 0x80dce4ef, +0xb4624378, 0x1619febf, 0x782ee04b, 0x9a7235d9, +0x89569035, 0xd853958b, 0x8f6a6a4c, 0x6da02ec7, +0xf555a674, 0x03fd0eb7, 0xd388f391, 0x228f9060, +0x084c972d, 0xc5676f44, 0x84995e38, 0x018daa8c, +0xfc22788c, 0x7c6bd63a, 0x8bda5eaa, 0x2b2923f7, +0x59a97616, 0xf8d38ce5, 0x4651996e, 0x0b87bdee, +0x0bf6153d, 0x9891d21c, 0xe99a1295, 0xf145cfe2, +0xfa2dc566, 0x05ec6c2b, 0x26b29f42, 0x66e119f3, +0x7b4f675f, 0xf7eeefba, 0xb2d1650e, 0xadcde98c, +0x12f732bf, 0xae96a355, 0xb1f8fc9a, 0x5ca9700c, +0xca806581, 0x9b14027d, 0xac0ddec8, 0x42371805, +0x6f4e445c, 0x5c999326, 0xdad40547, 0x3725ed58, +0x1c9b9135, 0x6c6d6288, 0x0f3143e0, 0x30c0bbdb, +0x159c9447, 0x17a7db00, 0xb7ed03e7, 0x538673e4, +0x6668c637, 0x1c5e4ca5, 0x223d6250, 0x338359ea, +0x0d458bee, 0xe2886c6c, 0x87f83ee2, 0x8eff181a, +0xbeaeb6ab, 0x40294569, 0x7b6a813e, 0x2594d208, +0xc4bd77eb, 0x4cf2cead, 0x747fa78a, 0xab289d1c, +0x84c7f602, 0x1671a29c, 0xc1717572, 0xd1d946de, +0x80d67719, 0x540604b4, 0x07ea3468, 0x914ca5a4, +0x2ff43018, 0x0c80589d, 0xd7f47a0d, 0x3352a600, +0x45425f2d, 0xcfe236ce, 0x4e1715ab, 0x1a3610fd, +0xe850ed81, 0x853dbfb0, 0x1703a45c, 0xdf419c55, +0x749c3658, 0xce26c629, 0x6bc2d78f, 0xc2bb4dba, +0xbcec7f66, 0x4296d407, 0x99d16376, 0xad1a1137, +0xc5a83a85, 0x7444ec0d, 0xc8bf4c01, 0x54c43ed5, +0x32f9823b, 0x842c9295, 0xa1d8007b, 0x80fa6d42, +0x9bf009b6, 0x5290644c, 0x9a24c075, 0x58f4ca7a, +0x9b699e44, 0x985c751a, 0xbcf9c22e, 0x29dc0d6f, +0x00dc1b8d, 0x643cd9bb, 0x959bdfe1, 0x58dd1c9c, +0x5a4d2b3d, 0x8742f2c7, 0xa03abf55, 0x24403210, +0x6d0d1d5c, 0x45ba1c4d, 0x23117eaf, 0x144a4ea2, +0xbdae7f64, 0x2ad0a8fe, 0x9fa12271, 0x08d31b7c, +0xe7c17533, 0x646726ff, 0x2fff165d, 0xd76895d5, +0xcc23399b, 0x40a4b16b, 0x14135e83, 0x3ac1ac81, +0x8a470059, 0xe5af8f50, 0x4906108a, 0x9fb71659, +0x8634549b, 0xf1edfaeb, 0x6a31016b, 0x1fab821f, +0x290b458b, 0xdf17edc8, 0xa13ad6d1, 0x925e2a12, +0x8e3691ff, 0x95ed2c48, 0x74e7fea3, 0x97d50485, +0x30a808f2, 0x1ec66c84, 0x40a95682, 0x4eb00580, +0xa21795ac, 0x50fd997e, 0x6d2aade2, 0x0227d8e5, +0x9a7eb22d, 0x4d662d28, 0x5c9645fe, 0x29423b8e, +0x49f060aa, 0xc5156127, 0x7e5be0aa, 0xa6d598ad, +0x76e0db63, 0x7af4bad1, 0xb334a96a, 0x51da1618, +0xc2f29f03, 0x04788145, 0x57d34d30, 0x8db7c3f4, +0xf78b0844, 0x96537761, 0xc0fc3015, 0xc3e7667e, +0x289e1b6c, 0x6aceb398, 0xb7692a20, 0x9e28bfb8, +0x0e7e0e9a, 0x28ecddc0, 0xbcb8b089, 0x77fe620f, +0x9423e6bb, 0x06cb2c89, 0x6628b557, 0xcc1790d9, +0x4070469e, 0xf394850d, 0x341b7f86, 0xec2cc87e, +0xb2114219, 0xab7ac4f9, 0x27c93879, 0x5289f102, +0xcfcb33f3, 0xe9b58ac0, 0xb3b31123, 0x1d2a6e5b, +0x230eafc2, 0x62589edb, 0xd91c0c2b, 0xe1866fbe, +0x9e60d14c, 0x4e7b4819, 0x3cc6e5d5, 0x3334772b, +0xf1e373f0, 0x8c73e066, 0x310ec100, 0x3c2cc749, +0x0585154d, 0x796fd427, 0xf816e20d, 0xb5b5aa24, +0x5965971b, 0xd957cebb, 0x5aa3f323, 0x25aed2cd, +0x37bff7ac, 0xf968c785, 0x58ef2bd7, 0xe9ea6eda, +0xa192c587, 0xc5fba9ce, 0x073c146f, 0x18aaa66a, +0x0ba90bb5, 0x4c377a9f, 0xd1db446b, 0x68fae083, +0x239c5dfd, 0x6ebe9948, 0x647c09f9, 0xa6f645c9, +0x09ddd406, 0xe12df688, 0x017ef747, 0x74ba6a3b, +0x5f0d0c64, 0x251d8055, 0x433675eb, 0x2cd3902d, +0x553061f2, 0x90082d1b, 0x25e459fb, 0xdc4cdf96, +0xb2ad8003, 0x01b973f6, 0x9f6e5875, 0x599acc07, +0x5ad0cb40, 0xd3f700c5, 0x53520fb5, 0x22ee453c, +0x5840f1e5, 0xea4be2f6, 0xd801513a, 0xefb59d84, +0x399985b3, 0xd209a092, 0x4d0c5523, 0x2c9120c2, +0x0d4090ce, 0xed1435a0, 0xa9191fde, 0xafdbb23a, +0xd6810614, 0x03193527, 0x54cd993c, 0x29491d1d, +0x2d03d3d4, 0x752ddfae, 0x8583bde3, 0x4964c8fd, +0xd239a20f, 0xa26ef38a, 0x7390c6bf, 0x1ae43299, +0xc9e501ac, 0x975b3630, 0xe3e2c18f, 0x0971337f, +0x4bedd53e, 0x256e7762, 0x4d3a55ec, 0x2801c802, +0xa7075245, 0x7e307fe4, 0x91c8fe80, 0x34c42d14, +0x0445ac9b, 0x34fa86b1, 0x83294a04, 0xb4b4b523, +0xa99bb967, 0x24ec4e38, 0xbba8187d, 0x743897b2, +0x89070501, 0x15ded026, 0x7fa93dc3, 0x49ad7cfa, +0x7518c8fc, 0xb81fc693, 0xa79ae26d, 0xa5236686, +0x8a27549a, 0x5a11ecf8, 0x22e16472, 0xa53efecb, +0x9db8a265, 0xe6483215, 0x685c8466, 0x64d6ffd6, +0x675477ef, 0xa5114a47, 0xa2da79c1, 0x79df741d, +0x499fc37f, 0x5f3318f9, 0x128a6384, 0x6cd0bae5, +0xbeaee48c, 0xfadd301f, 0xfaef11aa, 0x92863078, +0x0f0843fd, 0xb9e351b0, 0x915cfe35, 0xdd231b7b, +0x708a18f6, 0x32cc4fd4, 0xb93d6810, 0xc4e47c2e, +0xa82a3617, 0x1f383ecb, 0xfce70e49, 0xc4b5640b, +0xa4be3953, 0x13188c24, 0xdefca78e, 0x8425168c, +0x2e8ad01a, 0x742e22bc, 0xc7ca0ad5, 0x14d3cdde, +0xcf520003, 0x0bc90fc2, 0xdf155e91, 0x0a14cfc2, +0x8b7fe3d5, 0x76a16332, 0x5edcdfaa, 0x5205109c, +0x5a708b99, 0x956e4f5a, 0xbabdc62a, 0x3dd8f92f, +0x73e086a6, 0x8fcc8c8e, 0xea42a040, 0x339853bc, +0x1ae20d33, 0xf313a0da, 0xb3b4d65a, 0xeb8a5975, +0x95641c80, 0xa66a6371, 0xe452589c, 0x37322d74, +0x7e46498b, 0xcaedae7d, 0x34f3ac63, 0x2208bc0f, +0x829d2644, 0x12d2e901, 0xf8f08bc4, 0xa7681bf8, +0x45ca71fa, 0xc47bfe9d, 0x6f82bdc3, 0x2c159ee4, +0xb6d291e7, 0x715acac7, 0xe3c6f918, 0x93b9a94d, +0x91adb310, 0x41c48e1e, 0x3dd20093, 0x02ba7e2b, +0x4ce11d1c, 0x78a5ca20, 0xe8d20268, 0xedd03d84, +0x9dcf98ed, 0x7b1409c0, 0x9da5a043, 0xfe50acbd, +0xf4a6a432, 0xe0e6d47c, 0x30873750, 0x0032932e, +0x3f1e3105, 0xd62d5451, 0x431027a4, 0x5499b437, +0x4658c557, 0x99c317f5, 0x105dfda4, 0x7ad26d0f, +0xaf1f4416, 0xa24cb379, 0xa290a063, 0x5cf6276e, +0xb8751449, 0xb5d8cc21, 0x31cdbb19, 0x30d89d10, +0xc1678fe1, 0x04b51359, 0x18ee305d, 0x8534f4aa, +0x3109f89c, 0xcdc8e0f6, 0x978dfc74, 0xf2f956e2, +0x66cf957e, 0x0314993c, 0x8f79de5a, 0xb32172fa, +0xb6e008be, 0x7b12e77c, 0xb55a8cae, 0xdcc71206, +0x2028a7c5, 0xa5ad4638, 0xa47f8728, 0x63118abb, +0xfeaa8be9, 0x65afdf3e, 0x3a02fff4, 0x5e7c63c1, +0x931afe0b, 0x27271345, 0x050de5b0, 0xd6df0a34, +0xc339dcb2, 0xa1bb4bd4, 0xcf761f53, 0x0486d8bd, +0x66fcc934, 0xdd8b4f04, 0x4f489769, 0x012a88a8, +0x3401c334, 0xcae5357e, 0x63914c7d, 0x2c69b8aa, +0x2ec37c36, 0xcca9d9fe, 0xe22cf7be, 0xa4aa0fdf, +0xcde7154e, 0xb7554902, 0x0004b521, 0xfacdb25f, +0x25823393, 0x01a94e30, 0x799083fd, 0x0726521d, +0x191df056, 0x143ea696, 0x1269ba77, 0x2f694348, +0x0a777872, 0xd50a4ade, 0x9e47bd14, 0x9325e0ea, +0xff3bb615, 0x4c1fe303, 0x94b2f8a5, 0x3a6e28ff, +0x0042e541, 0x67e091f1, 0x960b2020, 0x5bb60d4a, +0x0808cb11, 0xa8dac46e, 0xc603838a, 0x5a0219a4, +0x55611e2c, 0x0adb6ded, 0xd5914c5c, 0x009b0105, +0x99392032, 0xb6373618, 0x3afe5366, 0x4b12d9e5, +0xc572880c, 0x692551af, 0x5c2c6eac, 0xe6eeaae7, +0x0634a0b8, 0x928a3a53, 0x71200483, 0xf1de94e4, +0x2622fef1, 0xf94b1289, 0xf43f7faf, 0xa8d58974, +0xb11b2ab4, 0x256716a9, 0xb26c6c6c, 0xcaae8fe0, +0x71122858, 0x3bfe4cbe, 0x70e065c8, 0x691c7c92, +0x0f3b0a10, 0x6e065ae5, 0x1095f9f5, 0x8a09e1b2, +0x8cbdb506, 0x379f7764, 0xd3f5414a, 0xbfec6146, +0xec970446, 0x4bbbf0ee, 0x30d5d353, 0x3c650de6, +0xa8f56d7b, 0x8b10c97e, 0x5a9209cb, 0xdba8bfbe, +0xbc76a47c, 0xf3c19b78, 0x3c8a820e, 0x6effedcc, +0x13552c27, 0x2e1908a4, 0x7b5e91cd, 0xd05e5c3e, +0xc2708d9f, 0xc5993476, 0x23d35cc5, 0xaa1c9d52, +0x86c01d34, 0x9bf92b9f, 0x4d96b4c9, 0xdb06e27f, +0xbd21c5bb, 0x963620d3, 0xc8c661ff, 0x5b612ba1, +0x808cb264, 0x72ddf515, 0xf6662467, 0xc22c90f7, +0x004839c1, 0xbf5c895e, 0xe1ca49db, 0x585a65a7, +0x3028a334, 0xd602513d, 0x0317b6c7, 0x3ba1fa56, +0xa39f0631, 0xab6cf8d2, 0x670c9681, 0x70defc45, +0xd3a18bea, 0x9da5ffbd, 0x2d306063, 0x045c2b5d, +0x69a71982, 0xf7ca74db, 0x2fe78418, 0xbb6f735e, +0x24b04a96, 0x26e1d0b8, 0xfb92d449, 0x1d4f1857, +0xc1c1ac73, 0xcdee5fee, 0x7e7280d2, 0x6386c086, +0x8fe85adf, 0xb4326936, 0x70d7ecfa, 0x6834c354, +0x5cea171a, 0x3ef2b327, 0xa8beafa2, 0x455b6695, +0x01e9d92c, 0x9c254e8b, 0x854d761e, 0xe4e6e185, +0x97dddb24, 0xcefb1738, 0x4bf44ed6, 0xea069f6b, +0x50f60c71, 0xe854cf79, 0x97dd386e, 0x14c47592, +0xda69e33e, 0x631b2674, 0x8203dc7a, 0xee936995, +0xa611b097, 0xd845dc86, 0x44d87408, 0x57595efa, +0xfc277d0f, 0x873320f5, 0x52864a92, 0x04e95bb6, +0x281f27df, 0x035f8c80, 0x0533943c, 0x41db6333, +0x0beb6b93, 0x56a18220, 0xcea4f0f1, 0x28218110, +0x9c4605c0, 0x3ba96d2a, 0x25507f2c, 0x1fdbd6f3, +0xcf139f23, 0xff7dbc69, 0x0a74b04f, 0x9282c398, +0x337ba99c, 0xb0821673, 0x33dc447d, 0x1601d357, +0x544954f9, 0x1836e494, 0x9337962f, 0xa4b15e79, +0x3986bdcb, 0xbe92bd3b, 0x5c3e6c94, 0xce43391f, +0x27de5b4f, 0x90e48697, 0x31200e90, 0x80421802, +0xd9dc5d3d, 0x0259f633, 0x1a16f975, 0x5329191b, +0xd1a5a1b0, 0x6882cea2, 0x9203e3a8, 0x21503a83, +0xe14df5ef, 0x475f164e, 0x39e7ca8d, 0x0ccc7549, +0x645a2a32, 0xa0985457, 0xf3b2bfdf, 0x155f8d58, +0x89033bd7, 0x1391cf0a, 0xa6d82934, 0x066b8fc0, +0xcbab0c24, 0x475977b6, 0x088c734f, 0xbe3bdd4a, +0x7e68551d, 0x7c7edd05, 0xbdac56df, 0x446cc683, +0x5565ebcf, 0xe641c29c, 0xe40d6787, 0xbc77b818, +0x8aa88dde, 0x3a538c67, 0xf14675e7, 0x99cad9cd, +0x3c9c8962, 0x1572c8e3, 0xab959d0b, 0xb9ad7922, +0xccfbdf32, 0xc79e7cc6, 0x800b87d9, 0x58a47c27, +0xd4a116e5, 0x16d955c6, 0xaaf366db, 0x14a31f02, +0x305f5461, 0x8eabe1bf, 0x1aa5c7bc, 0x33a347c7, +0xd3870177, 0x87787b15, 0x004ceb8e, 0x099f2f82, +0x9cb1749b, 0xa9eef072, 0xc39a9fc1, 0x05db72a9, +0xba17b1f7, 0x8f06936c, 0xd57dc403, 0x66619f5f, +0xcd8cc4f6, 0xcdc8e455, 0x1aa6ecdb, 0x1583172f, +0x21f09684, 0xd13d03fd, 0x3d732b1e, 0x815d87af, +0x1bb71b45, 0x271f4905, 0x8637ec60, 0x9d2c9663, +0x69c51c1b, 0x7a1dd7f6, 0xae86ff83, 0x0c8d4392, +0x255c5c22, 0x71d58ed6, 0x9f1b4d7f, 0x347ac602, +0xe6d5fed3, 0xec16fad1, 0xc8fb629d, 0x78ee2b78, +0x3b4e3d0e, 0xd2f2da47, 0xa1dd68da, 0x3a2edc13, +0xaad12b75, 0x3dd2ab2d, 0x605da322, 0x034b6403, +0xc3c13d8d, 0xf3fc3d1d, 0x1525a215, 0x5c4baf29, +0x889717e5, 0xba64d67e, 0x74aee738, 0xde2a5cb8, +0xeb4a049a, 0x50c06b1a, 0x08937aac, 0x26b0985a, +0x4da9336f, 0x7f91ebb6, 0x3ba946d2, 0x638dbd6e, +0xe6085824, 0x0f88345f, 0xd2c0b22e, 0x61967c1b, +0xa1876cf2, 0xc389ee83, 0x52527ffd, 0x24089296, +0xa60f8956, 0x9c1b799d, 0x31f4fc58, 0x37654f87, +0x7aae4a17, 0x4551ba2d, 0x00a2358c, 0x4f9e8d7c, +0xe4adddde, 0xe17b0a44, 0x9a5bc702, 0x8c66d5bb, +0x49b2e35e, 0x3f0d1c97, 0x1e6ef8a5, 0x393f4912, +0xde956b07, 0x501da447, 0xe845c46c, 0x4511a88b, +0xc003eaee, 0x412faf3a, 0xd841ccf8, 0x3c7c9fb8, +0x1ca747d7, 0x28f1a551, 0xc6151551, 0x08c7d9b4, +0x928b6cfa, 0x265d50b2, 0x301c590c, 0xf5286162, +0xab87fb38, 0xa2558198, 0x4972b1e0, 0x713679a0, +0x6fc73f80, 0x8dd7d4c0, 0x5a8cf9c6, 0xde13f563, +0x21073ac2, 0xe424e715, 0x189cec63, 0x01839dc0, +0xd5006368, 0x49b5ea70, 0x12179477, 0x148284fa, +0x26d57b26, 0x3deae6fb, 0x923fb56a, 0x59815b0b, +0x16cc6c05, 0xb1a4a2f0, 0x4b7ff133, 0x6c85457d, +0xd1c1c98b, 0xf901db72, 0x7a432bd9, 0x69a87415, +0x739e7b9d, 0x3705e19f, 0x835dd85e, 0x76e8e888, +0x3e9ddc7b, 0xd03b62b5, 0x146aaf80, 0x2cbe9bc1, +0x5d5ea09e, 0xcd7c1f61, 0x43c75e44, 0x7e46a280, +0xa45582c3, 0xd31da71a, 0x452f4a86, 0x650a50e3, +0x08397624, 0xd939f893, 0xffc5ba38, 0xa278b792, +0x9ee3b9e1, 0x38c2f7c9, 0xa869a27d, 0xd2532876, +0x5a72614e, 0x43f7d241, 0x168408a6, 0xfb995d26, +0xeb60459d, 0x5d2017c4, 0x748846be, 0xc78217ec, +0x0ad23c68, 0x882622db, 0x077b7c69, 0x655dde9a, +0x4c77d43b, 0x042c0942, 0x43d300e2, 0xa0507945, +0x2800bff5, 0x26efc8fe, 0xc1aa0bad, 0xa0f6e98d, +0xbd3b05bf, 0x74d12e84, 0xecef9608, 0x210755fc, +0x2415cb08, 0x6d9e34b7, 0x90d2508e, 0xe56f2361, +0xb7cb0707, 0x76db2a19, 0x95401b65, 0x7dca15af, +0x939ea117, 0x8c64109b, 0x64af4486, 0x8623c6d5, +0x88a6be82, 0x11c9ad0c, 0x20321f05, 0x653e2bb7, +0x1077e2c7, 0x0720ed19, 0x66e75bb2, 0xfbeeed39, +0x2b6a0c9b, 0x082e2521, 0x320da980, 0x269948b5, +0x25b4530c, 0x5c069af1, 0x21ed0f63, 0x34993998, +0x3eee1eec, 0x57ede131, 0xfa9f36db, 0x34b9da41, +0x2895750f, 0x08e8eb8b, 0x0389ef72, 0xf19904a1, +0xae119d21, 0xc8017ad6, 0x3d763900, 0xa892c53b, +0xc01714df, 0x62866def, 0x4bf5239b, 0xf7854491, +0xce334910, 0x1f5ffd56, 0x01516a01, 0xf9198eeb, +0xdbee35fc, 0xf58d2e60, 0xf47973fd, 0x7942289a, +0xa79e537b, 0xff6b6b9a, 0x50ba3016, 0x533f3b59, +0x0d77b95c, 0x93458e70, 0x7820b848, 0xb67027ed, +0x7c3992ca, 0x45d3ebad, 0x20fca97c, 0x9d5b6529, +0xa9c560e9, 0xed662f17, 0x1a1bfd78, 0x48199b55, +0x343df526, 0x9519fd03, 0x1bc80935, 0xecf1330c, +0x96cc4060, 0x87b9e914, 0x4b0131dd, 0x01230ce7, +0xe5032b9e, 0xc341c7bb, 0x3df01ffe, 0x50cc0f16, +0xc42ff89b, 0x6332e2a1, 0x57ab32d9, 0x8364fb2b, +0xb91b57a3, 0x67b24787, 0x3bb15629, 0xf92e5899, +0x74ceff5b, 0xacb6730c, 0x08733c5e, 0xb3d5b603, +0x9a7266d5, 0x9bcf01a7, 0xbc657b7b, 0x817fb5ac, +0x07652bdb, 0x4ddc7a59, 0x2ac37dad, 0x9431fc85, +0xec8a4e55, 0x08720df3, 0x6fa78247, 0x99516e9e, +0xbe976005, 0xe8eebf28, 0x1aa862ef, 0x17ddc1f1, +0x0f3d5098, 0x0ac1dc41, 0x040dd08d, 0x32b59242, +0x9750e01e, 0x3cb64763, 0x3c6cf392, 0xf900f158, +0x36039f19, 0xa54cf10e, 0xf021a7b6, 0x2827f985, +0x8b25bd98, 0x436cd88a, 0xaaab7438, 0x8aea74ca, +0x3cdf2bd3, 0x525b65cc, 0x3fc02c2c, 0x7e27b856, +0x3e7fad1c, 0xa270101c, 0x066ac4aa, 0x14510965, +0xd84a9df6, 0x1baf91fc, 0xa13b3bb8, 0x8e8ec408, +0x9b372771, 0xb99139ec, 0xe37e91ec, 0x9a01690c, +0x20ec8b38, 0x906c9821, 0x6d4305bf, 0x9051f3d3, +0x231923e3, 0x2e8792d7, 0xf52cae0d, 0x6e58c18f, +0xfe77cda5, 0xfb59cc6f, 0xcbabce88, 0x42e768d2, +0x29a1d230, 0xe8034ad6, 0x55f221f5, 0xf17665d9, +0x0c97a0ea, 0x6fed401f, 0x4c6b634c, 0x77470ce5, +0x9443ff98, 0x8e3f68d0, 0x038ead49, 0xe5bbcc2a, +0x69113055, 0x0c05fc18, 0x627e7aa2, 0x15543b58, +0x7a1d2606, 0x14762f46, 0x79d7b3e4, 0xb6324a6c, +0x808038e0, 0xeb41bde1, 0xccd59ec2, 0xa7ef75f0, +0x98adddf0, 0x9d19ff1e, 0xd85f8e9a, 0xa45aaa2e, +0x6d034b68, 0xc628e020, 0x7ce3bf63, 0x2f1f5099, +0x15707627, 0xd7066c4f, 0xc08d7fc5, 0xfbe5a3d8, +0xb5859d42, 0x9604c4f8, 0x1fb21674, 0x098bd2a9, +0x605f812f, 0x3721651f, 0x1eca35fd, 0x126ddb46, +0x02bfcd39, 0x64128e9f, 0x52807ca0, 0x9a107b69, +0x720c12fb, 0xc2b258fe, 0x3021f9bf, 0x0cfd9c27, +0x0c5203ff, 0xce28dd42, 0xce42a3a9, 0x0d7caf12, +0x31006109, 0x5c734367, 0xf9e5cdd4, 0x89c7a1de, +0x5360f9c6, 0x8cda8c38, 0x49ef2b99, 0xdb2f5343, +0xbb528452, 0x9bbcb4eb, 0x957a7f05, 0xfc92f9ac, +0x9073c4ed, 0x8c688144, 0x7a478ed3, 0x589501c3, +0xf0708270, 0x42c9bd32, 0x0a69df5f, 0x58c6d8ad, +0xcac41fd6, 0x49963b24, 0x36c969c2, 0xa45fda3c, +0x66664697, 0xb3e53857, 0xe1074c1a, 0xacfca137, +0x1b41e792, 0xd2bb1556, 0x367433d5, 0xdbf58d77, +0xeceb5161, 0x85e99f95, 0x0fda55c1, 0x8f72efc5, +0x58e7c899, 0x9c107876, 0x407a7f89, 0x7161566d, +0x64a450fe, 0xb533d01b, 0x5f17eae0, 0x54684e29, +0xe4459550, 0xa822715a, 0xba4cc98a, 0xdc56f191, +0x3e9569ed, 0xa0c58031, 0xaf382492, 0xc89d6033, +0xdd843340, 0xa76288a8, 0x9204da9b, 0xaf9d079f, +0x60070db5, 0x804a2c0c, 0x314b39c6, 0xb5ec58b3, +0xe259758e, 0xf592bfdf, 0x6ad89c89, 0xf937a080, +0x6b634171, 0x524a0c5d, 0x6299d3a9, 0x6c8058f7, +0xb33a4f4a, 0x826e6f1e, 0x3caac45d, 0xd1f8eb54, +0xb06f9304, 0x5a09ab0a, 0x1c59f414, 0xcfb11ab5, +0xc1f8f01c, 0x89eaa1fb, 0xbf9b27b4, 0xdef4e253, +0x4cc4c9e2, 0x6c7cb2ac, 0xfc9034a6, 0x21633500, +0xccfeb032, 0xdee41572, 0x2a629873, 0x3f702f46, +0x6a389e22, 0x9fdbf3a4, 0x50c23aad, 0x02f0407e, +0x34605366, 0x73ca9628, 0xe176e193, 0x8507e97c, +0xb6ade277, 0xdb3ef83a, 0x730f76a5, 0xa9cd862f, +0xa14784e1, 0x278ffbc2, 0x0659b00c, 0x56fa98a2, +0x3b289678, 0x2880e9aa, 0x2face57d, 0x9ca24ab4, +0xb0a0dce1, 0x4e1ac2fb, 0x96204490, 0x5ee59772, +0x97ec4ce8, 0xc47d0dc3, 0xa2bc6329, 0x9c546d47, +0xedcf9548, 0x515f7396, 0x51ff1f0d, 0xd26e5c1e, +0xf9eb64c0, 0xee179003, 0x10b81ac8, 0x3d85ae59, +0x6e923e70, 0x1a6bd69f, 0x31f8bb7d, 0x9cf3d869, +0xa1b92c33, 0xee292556, 0xdea2fd61, 0xbaabb06f, +0xc87af257, 0x32046e60, 0xcaf1b0f8, 0x241d098c, +0x5b657a23, 0x1a760ba6, 0xa6a66c57, 0x6aa9822a, +0x7cca5b14, 0xcc4bd730, 0x6eb2d9d7, 0x98a53cc0, +0xca349656, 0x5e60825f, 0x2e87ff38, 0xcf9302e4, +0xd52c5aa3, 0xa78e9f1e, 0x41dccee5, 0xf6a071b6, +0xa275ea0a, 0x20a69145, 0xab5b393e, 0xa17babf1, +0xff925400, 0x14cabb8c, 0x3b8eaa6e, 0xda28d9c0, +0x35d1ef18, 0xaf324e9d, 0x6291b037, 0x8c4c7fc9, +0x37572786, 0x072bbb49, 0x40ea398a, 0xc4abda5e, +0xe546a750, 0x3ba676d7, 0x25d53011, 0x5b4a07b2, +0xbac5505f, 0xb863a2ce, 0xc3f13f97, 0x5b420594, +0xf9e2f0f3, 0x876f4323, 0xd2b5efdd, 0xa837feb4, +0x76ff52b6, 0xe01ac88e, 0xc3b89896, 0x03fa9b82, +0x33136e7f, 0xc3707b0c, 0x6f8b3e4e, 0xf04bbd88, +0x27d2b336, 0x0fe4ec08, 0x47576b75, 0x0ce56309, +0x6dba1a3a, 0xe6747bf3, 0xc0ede061, 0x77a3365c, +0x0019b415, 0xb7b89216, 0x8594009f, 0x9859f8bb, +0xcbcd3ee1, 0x0134fc1c, 0x33aaa20b, 0x98b75a68, +0xb68461eb, 0xc97c7083, 0x1d463e76, 0x666a2a6c, +0xd6715847, 0x20386b8b, 0x43f5bcdd, 0x96f314e2, +0x8466a48b, 0x13c238f2, 0x3b6c527e, 0x00d80e8d, +0xd53688c7, 0x1cf82a6f, 0x3e923fea, 0x2a9e3352, +0x6b893719, 0xe53c40c7, 0xcd19b207, 0xaf729fa6, +0x8e37e549, 0x8be2bdb8, 0x995f0904, 0xffeef20b, +0x1a28f489, 0x95189820, 0x338720ef, 0x87209ac2, +0x04a06c79, 0x71972c8a, 0x566aa785, 0xdb38099c, +0x0141b759, 0x8d9382a5, 0x801e6bbb, 0xf55a9215, +0x342ba9aa, 0x87c3375a, 0x4e828c17, 0x0a1f3daa, +0x65c14c2c, 0xff1603f5, 0x417fe165, 0x20f8a6cc, +0x5ca56fb9, 0xd59d06f3, 0xf9eee693, 0x1fa4e58e, +0xb4f33ddd, 0x5794577a, 0x2754f0f0, 0x75d89429, +0xfaa5df85, 0xbdca4a7b, 0x286e4d2d, 0xd607e34d, +0xf8880547, 0xef4b22fa, 0x898331b4, 0x4818e8ac, +0x9ebd2abd, 0x7a8bf8dc, 0x573a75c7, 0x79b840e7, +0x61f058ba, 0x8104d36f, 0xb8f44dfd, 0x46241f61, +0x7d13841b, 0x4af23a76, 0x90ae3504, 0xf822471f, +0x631547ce, 0x1273382f, 0x305dd6df, 0x1e85a6ca, +0xa0571c81, 0xad1a689a, 0xf67806de, 0x57fd6ec1, +0x0dc83c75, 0xc75a7719, 0x655ef75e, 0x79cd55f6, +0x637d5931, 0x6ea2ed6c, 0x09bc0076, 0x8606d70e, +0x50bf2c85, 0x298ae927, 0x127c49d1, 0xf9677e19, +0x0a3296db, 0xdb2da16b, 0x695faab2, 0x8e24dfae, +0x4b304fc7, 0x3660decf, 0x698b987b, 0xcd22a16d, +0x7652dfdf, 0x36d0df37, 0xb251bb0e, 0x14eaab9e, +0xa743e60d, 0x5cd29c8b, 0x38236152, 0xc2962de9, +0x114c4a10, 0x89bf8c67, 0x621c6df3, 0x93a85d6b, +0x08fb48a8, 0x37da454c, 0xb1b7146a, 0xfed9d76b, +0x0e7e9668, 0x88983e0d, 0x124fc627, 0x7816f5cc, +0x28222455, 0x2a0f2101, 0xbd15759f, 0x803993fb, +0x1be92a00, 0xb9e33cd1, 0x78765a80, 0x15367cf4, +0xb973b90b, 0xe58ad45f, 0x7d5bc6df, 0x0826cf5b, +0x95cb2da7, 0xa2e5f811, 0x409f7db3, 0x15fc24d1, +0xf7035d0f, 0x96269603, 0xc475544a, 0x28fa60cf, +0x3ee45f34, 0xaf782807, 0x5c459a07, 0x301bb9a0, +0x15f9a692, 0xfb5663b0, 0xb4fde90d, 0xed13bf39, +0xcdef4356, 0xcb6d9645, 0x90ca4b2a, 0x52256dc1, +0x734e88c8, 0x3634def7, 0xca4eb1af, 0x255126d6, +0xcb1fc7e5, 0x6cf7f32d, 0xbc3fa344, 0x6a43e7e4, +0x66fff604, 0x5d438b17, 0x67b0e07f, 0xd2b3b13a, +0x747c5755, 0x2a4bb9ef, 0x6cad39e7, 0xe332116f, +0x33537785, 0x61f0273f, 0xc1db6278, 0x40c988ec, +0x63fb7e70, 0x6c2932d4, 0xaac12b46, 0xa418ee34, +0x2ec0e675, 0x81349bfe, 0xa252deda, 0x6ee36a08, +0x0e5761e2, 0x3d68080a, 0x78a0f18d, 0x4d8453c1, +0x72aeceed, 0xe2f7e446, 0x7f8faed2, 0x4d692b1d, +0xfaccf25f, 0x9d038478, 0x3a40e996, 0x9e502fe0, +0x07ca235d, 0xd6871be0, 0x54d370f5, 0x7bfeb223, +0xfa92f4fd, 0x9754f179, 0x763a098e, 0x4c3d7e6b, +0xdc06421b, 0xdf1a8c15, 0x864f4022, 0xa1276bf3, +0x299ce8a3, 0x94e6894c, 0x2bebd3b6, 0xd4bd3803, +0x1aa3f65e, 0xc2a5e738, 0x14601a73, 0x2688ae40, +0xb4164619, 0xeeaf553e, 0x7c74bcf8, 0x9e3a40f2, +0xb2578ce5, 0x25b2fdb5, 0xff3b2580, 0x0ea99b95, +0x994818aa, 0x300757bc, 0xe1fef941, 0xde94e2c5, +0x282474c1, 0xec9c409f, 0x82e5598d, 0x8a05a742, +0xd9e4ac6f, 0xaa50a279, 0x6b1eca25, 0xc236d7f9, +0xeded708e, 0x6256db0c, 0x4bf31dd6, 0xa29f6daa, +0x6c313cee, 0xf1c6532e, 0x706b6db4, 0x062d9520, +0xaa07a221, 0x8c1c2014, 0x73380f81, 0x91124468, +0xec17b7a0, 0x427feb66, 0x1326b3ae, 0xd673fe10, +0x639ff711, 0x6ca103af, 0x86f06098, 0x3e27f1e8, +0x40b361ae, 0x23285a2c, 0x7801aa4f, 0xf288558f, +0x97ead999, 0x97bc069d, 0xfb3935c9, 0xa65d057f, +0x4d99cca6, 0xf9effffa, 0x8afebaf5, 0x686181a9, +0xbc38b724, 0x66705111, 0xc825ad6b, 0xfcd6f4c0, +0x5ffdf9ce, 0x64b73ca5, 0x5e60d394, 0xf05571e5, +0x7a674b59, 0x2e6e1127, 0x77411c1f, 0x57e86dd4, +0xf0890101, 0x0203d47e, 0xe94f549c, 0xb0bdf6be, +0xfb893d71, 0x6f401e4d, 0x876c7af5, 0x13b23c0a, +0x1c54187c, 0x034723ca, 0xb5210052, 0x204b5b62, +0x6e68cbc9, 0x1ea704c1, 0xa55d8b45, 0x509e2c7f, +0xe672ccaf, 0x07fa9adb, 0xa4243ed5, 0xd3af2806, +0x26da3fea, 0x610d953b, 0x00c1ca88, 0xaef8a950, +0x96e5a3fc, 0x49e923fe, 0x56858ecc, 0x125ea9d4, +0xe5fb3261, 0xba9525f7, 0xe33d54c4, 0x3b0221c4, +0x72e482cb, 0x0b904068, 0x60ef5c47, 0xf471e6f9, +0x05245b52, 0x87fb10bd, 0x5d74a76b, 0x89701e5c, +0x883cd24d, 0x006b50db, 0x1204a0b5, 0xc77a93f1, +0x1cfdb312, 0x0066dc8d, 0xb1b034bd, 0x22e816dd, +0x183b1bfb, 0xdc1d6f50, 0x03cbe40b, 0x1359002d, +0xdde64ecc, 0xe1c11e0d, 0x931ab87c, 0xc2c12570, +0xb8b92558, 0x06fbf2b1, 0x385c5c69, 0x7afe7b83, +0x65300ef1, 0xf768a65b, 0xe1569428, 0x0d8429cd, +0x0a8b430c, 0xb59f7dbb, 0x101b6d34, 0x45788f7d, +0x1fc181e2, 0xb86792fd, 0xbbcea9ed, 0x64a6bdc5, +0xaf49d3ba, 0x5216f27e, 0x8448f3bb, 0x9ab0faaf, +0x7a4eb276, 0x5d45be7f, 0x19345a83, 0x74f5b452, +0x6c455c8b, 0xd50bafe3, 0xb002e68b, 0x2575163a, +0x730c769b, 0x743d7bfa, 0xaba658d5, 0x69bf4cf1, +0xce493dab, 0x45fe96b6, 0x3e6b3007, 0x1f84a3d9, +0x1f6901cc, 0x54576bbe, 0x443a99c3, 0x8267c9c0, +0x9dfb3c10, 0xb927947a, 0x3e5e3fec, 0xe483700b, +0xcde35446, 0xa5dd0f57, 0x807b501e, 0xebf81486, +0x2c381060, 0xda1fa09f, 0x3ab66f3c, 0x89a5344a, +0x0405a39f, 0x78e84a79, 0x8939e4d1, 0xe4eed9a1, +0x96d191a7, 0x6e32f68e, 0xae1bc6a9, 0x33022fad, +0x3b09f4a3, 0xe85a9af7, 0x4af03ada, 0x101f611d, +0xfacd4f02, 0x213ec956, 0xa38da1ca, 0x5a6d8c5e, +0xab9e4bba, 0x2c454fd7, 0x23b809a4, 0x45ac0083, +0x83009446, 0x88a6f2b1, 0xd8eee46e, 0x53945e48, +0xdf0ee7a8, 0xdbeb7b8f, 0x65ad32fe, 0xd9a09baf, +0x29e6a7b2, 0x254eebf7, 0x2908e1de, 0x6f5f4503, +0xb2e251aa, 0xc559a898, 0xbd15febc, 0x3895a4c1, +0xef04e961, 0x31a8e3bb, 0x1ee2af10, 0x59786b51, +0xe04ae28a, 0x683218fa, 0x2826c70c, 0x8fc7b344, +0x9d8009e0, 0x84bfecbf, 0x7327937d, 0xc580f8b3, +0x0fb4ff82, 0x5f7e8725, 0x5ab50dad, 0x3f595965, +0x64bc58b5, 0x33c958e1, 0x39c59f5a, 0x7b875b86, +0x0d84ae88, 0xc1b0381b, 0xd710f3e9, 0x1df42da0, +0x7dc4fb24, 0x89053ad7, 0x240e5fc6, 0xcdc645f1, +0xbbaa011e, 0xcf7294d6, 0xe85fb3c9, 0xdee0b502, +0x92911fcf, 0xb6c42e12, 0x01c18928, 0xa00da2d3, +0x627028bd, 0x60f3ce11, 0x8d368ccc, 0x8929173d, +0xb41569c6, 0x1b0691a4, 0x63e24027, 0x96d5b005, +0xa8be5782, 0x3b23e7ca, 0xe792f8ef, 0x9c420780, +0x4ed1228a, 0x28a169ca, 0x0a483cb1, 0xcb89121c, +0x30f196e4, 0x57807928, 0x8112aa3b, 0x0409b650, +0x992381c9, 0x350aa31f, 0x7afb27f2, 0xe2d5b906, +0x46b366a3, 0x46261bba, 0x46b84ac3, 0xb6a349b4, +0x7d25843b, 0xe1bfaf84, 0x2e265c1d, 0x2c8e7c40, +0x6ccd42aa, 0x7add2b0b, 0x1ab1fa4e, 0xc454a6b5, +0x2a168dde, 0xdb2caeff, 0x5ece7ba0, 0x2207a6ff, +0x6028bc1d, 0x3f55741d, 0x2304181b, 0x0962f86f, +0xea673cc6, 0xc522dedf, 0x95087e52, 0xadb9217b, +0x4459243e, 0xbd70b3d0, 0x090992cb, 0xef3b6d46, +0x531ef994, 0xbe5d5413, 0xd2128daf, 0x2b94f7f2, +0xd949b935, 0xc9ff5c86, 0xf4e4d516, 0x69c5a927, +0x89524ccc, 0xbc1715c3, 0x98b0d946, 0x442ba13c, +0x51f4f1db, 0xddbffbd9, 0xf5d5d22e, 0x92fab4c0, +0x2b6033ae, 0xe5da0329, 0x3d6d3a21, 0x9deedf1f, +0x54d1e764, 0x479797a5, 0x8ccb865e, 0x39744076, +0xd274ecad, 0xea0c932b, 0xdf6d87b8, 0x5ab255ee, +0x3e4b34bc, 0x2b68a85d, 0x4a70d916, 0x15739259, +0xc42411ab, 0x21ef2705, 0xd4b2b76f, 0x2dff888f, +0xa9fb7f58, 0x283a8306, 0xcc053d72, 0x2565d497, +0x0daa9b12, 0x38be6ff6, 0x9ad61f2c, 0x9aedbbc1, +0xb41abf8b, 0x1d2804e7, 0x4e20cbc0, 0x25d0c3ae, +0x1362492d, 0xae086f09, 0xba32677d, 0x9a8a4a58, +0xed2afd93, 0x5704ce5f, 0x4749fbea, 0x8d8f17ba, +0xef9ccbdf, 0x57e95f8a, 0x4a421313, 0xdbf21d61, +0x67f8582c, 0x00820314, 0x78b99386, 0xb4bf2a6d, +0x7b065b28, 0x1f9bb8a2, 0x4fd67e2b, 0x57fcef0e, +0x7eaa5837, 0x3f1d2d94, 0x42cd31c6, 0x210d321e, +0x4550b1a8, 0x421c8644, 0xd2adca34, 0xbba341e3, +0x14fe7313, 0xc4276633, 0x978ea45a, 0xfef69171, +0xc8b1fa31, 0xf68049f5, 0x3e905d93, 0xf2843b94, +0x5c890b6d, 0x7b959b72, 0x18fe611a, 0x6e2de1d6, +0x2ec93f2b, 0x1b37fb5f, 0xcb0a0340, 0x2dc3308b, +0xe13aba42, 0x21a2b659, 0x1d3f010f, 0xb18a831d, +0xd0c4b840, 0xba52caa1, 0x307a4bd3, 0x20807aa1, +0xb31fdc85, 0x85f3011f, 0xb7ca5830, 0x360f0568, +0x43ac2f3f, 0xae075f39, 0x4e03c178, 0x9086b351, +0x4576210a, 0x7277b230, 0x4163c88c, 0x9f31163f, +0xfae60b8d, 0xae7eb5b0, 0x70cfc84b, 0xa3c58b08, +0x31f1a4ce, 0x6c2867d1, 0xe62a1945, 0xad264747, +0x7a7827dd, 0x8839ed38, 0x6b9b54b0, 0x0a3f6891, +0x79a22999, 0x32f43909, 0x2c4850c2, 0x63bc8da0, +0xc04418f4, 0xe28914ac, 0xc448c1da, 0x621dd967, +0x726fa3c7, 0x59ecb746, 0xbc6f9ad3, 0x3d061231, +0x1ac06c8f, 0x0a485562, 0x3f32fe59, 0x39b8484c, +0xdbff45d1, 0x3f31682b, 0x9de1a4e0, 0x15002c0f, +0x3bc06f9c, 0xc364465e, 0x2699c43a, 0x2c63ead2, +0x1b9268bf, 0x0ca00328, 0x6746382c, 0xaff9a80b, +0x23df311d, 0x99b56754, 0xe52b4e8f, 0x01fe2fc5, +0x4e424365, 0xc2edbd70, 0xcd8c76a7, 0x05ff50f7, +0x759f66f8, 0xf48dddd3, 0x7406a0e4, 0x4415c392, +0x1e153727, 0xcb16a17a, 0x3c54fe8a, 0xad464ccd, +0x24122956, 0xc51e2646, 0x61051b21, 0xf4b5d1f8, +0x0066a517, 0x17a805d8, 0x8ce059f9, 0xee85a985, +0xbe59df33, 0xa37f57c4, 0x1fadbc93, 0xb55928f1, +0xd24ca323, 0x8e95cbd9, 0x6e1afeeb, 0x35cae38c, +0x0277c96d, 0x78155874, 0xd85abf34, 0xf21077eb, +0xd7f29933, 0xc81512c7, 0x38bb9da5, 0x7025c0ad, +0x3e5fb914, 0xac353161, 0xc09c444f, 0xf0dd70f9, +0x2ef6edd9, 0xc1361891, 0x6991053a, 0x2f073c22, +0xe68e4de2, 0xec15b7df, 0x6262c83d, 0x7c7f2035, +0x4aacd5d1, 0xc53c7773, 0x837aad31, 0x6b25385d, +0xe533419a, 0xbab816a7, 0x58e68734, 0x4be584a5, +0x5056421a, 0x43d51976, 0x6bb00261, 0xd75dd495, +0x5d64dfa1, 0x23f6001f, 0xc0e9eb13, 0xfc5a09b7, +0xa4abfaf7, 0xa92656c8, 0xc9eaeeb9, 0xf80f8a26, +0x9d307b88, 0xda6f449f, 0x104a6ee2, 0x15d48da9, +0x10188691, 0x73363560, 0x7c453d8d, 0x76c134db, +0x1744f6a1, 0x39d5657d, 0x7c169be1, 0x3dd8d5d0, +0x969c518d, 0xacd25aa3, 0xdae251e1, 0xf5f00f3c, +0xd404713f, 0xd855f2da, 0x29ce45d4, 0xa6afd9cd, +0xafb3201a, 0x28d9ae00, 0xf54ae42a, 0x5869abd6, +0x4106c55e, 0x1ad017d5, 0x096e94e5, 0x91a567fe, +0x7e718a24, 0x2cde1985, 0xd60bfb7a, 0x72633d3c, +0x84a4e680, 0x271f8abb, 0x5b920d74, 0xcb5ad36f, +0xc5b0eab1, 0x75a24f97, 0x77947f88, 0x120a57c9, +0x4ab5f1ef, 0x596aeaf4, 0xbdc1ac5d, 0x9dafbc69, +0x3ff07c48, 0xfb14da98, 0x114aa611, 0x05fb2d17, +0x5ecf25af, 0xf793de99, 0xdb3e89e3, 0xd2c5a8e9, +0x375ee736, 0x29455fdf, 0x982081a0, 0x05d976e0, +0xad51eb65, 0xb9d39a14, 0x45fc9b8c, 0x7d1e5187, +0xc9855999, 0xfd924c0d, 0x8df1f5e0, 0x05ff1afa, +0x1d7b82d6, 0x22a3b6f7, 0x1b63b5e1, 0x68a21980, +0xab0273ff, 0x12dc22cb, 0x5977ae85, 0x06050e23, +0x918abf00, 0x1cc7329c, 0x55f67934, 0x7014b471, +0x5f589a22, 0xf834e46d, 0x1a380287, 0x4a82b417, +0x161c4e2a, 0x07cc2f3a, 0xae138873, 0x5796ae13, +0x88b8a71f, 0x329dc7a9, 0x35ff69c7, 0xff8a119b, +0x2b7c9360, 0x88cc8bc9, 0x9c8e190b, 0xb5875018, +0x9840c444, 0x041fb1c3, 0x81f683e1, 0x5eea012c, +0x6f31e71e, 0x34d1f40c, 0x7f97e837, 0xbbe62695, +0x621fce06, 0x58220f3d, 0x3d00fe6d, 0x492f53e2, +0x3199317d, 0x503f28da, 0xeb67e139, 0xb3af345c, +0x0784a4ba, 0x5b01203d, 0xb9995d1d, 0x84ead9f7, +0xa4cd0b44, 0xd5b80522, 0x55ac4ce5, 0x3564975a, +0x4dd0b6ba, 0x89a88d7f, 0xdbac1bd5, 0x92db6f41, +0x022d80ca, 0x8125e452, 0x8885c6a6, 0xde4e44bb, +0xcc9d1792, 0x610ef64d, 0x3cf75fa1, 0x824a063e, +0xf7544f38, 0x4be23e2d, 0xd4562df8, 0x2d6dfd67, +0x43180336, 0x20ca3112, 0x1f71747e, 0x5a86b6a8, +0x9f080fc4, 0x5a4d687d, 0x8063d597, 0x5212c65c, +0x68ae46cd, 0x0ab0d6d0, 0x404a6039, 0x47361960, +0xb207fb27, 0xc54a3a84, 0xb628288e, 0xd9149417, +0xb8ef8965, 0x64449901, 0xa534c9f6, 0xa63e98f7, +0x3bff0ced, 0x3b09a0a0, 0x2a62b8c6, 0x4dc40297, +0x4dfb798e, 0x05446baa, 0xec48b41c, 0x5ed53312, +0x3fdd2bae, 0xf7a919b2, 0x81a96aa4, 0xc78fbd91, +0x431e0ef0, 0xe0a0e281, 0x83abe303, 0x1c21d84b, +0x79cecb54, 0x4f1b5ede, 0xbb529cca, 0x9ddbc400, +0x81f76a3f, 0x95b6d35d, 0x8c64b717, 0x22299b18, +0x4ea2070d, 0xc76eab02, 0xd6aa8a68, 0x1571a413, +0x6203a55b, 0x46c60cf7, 0x4ad64bfd, 0xbeddf946, +0x73b3aace, 0x91641083, 0x7d655e20, 0xab5b47a1, +0x39957e8d, 0x6c91f454, 0x38f799c9, 0x902b813f, +0x096efe6d, 0xf0343bdf, 0xfa3f814c, 0x10bcb571, +0x0c2ba921, 0x494c088f, 0x271c2c5f, 0xed244219, +0x4383cbd4, 0x0f12038d, 0xf167c112, 0x50cbe90d, +0x4e48c955, 0xdcd1c399, 0xa1891a91, 0x5070af85, +0x75ad8364, 0xd8a415e3, 0xf8954824, 0x5fc8c0c7, +0x96d7efa8, 0xde1c39de, 0xf7c760de, 0x007f2e12, +0xc369fcfb, 0xa4cf618a, 0x7b06ce57, 0xd4f947db, +0xed3cc319, 0x1af5a745, 0x2031a926, 0x070503bb, +0xe49e6fc7, 0xfdb46374, 0xf6107c8c, 0x38211270, +0x5c7f0ec3, 0x1439ab54, 0x1d1f7965, 0x67c20713, +0xe56c44f5, 0xe9e39cc2, 0xab0542e8, 0x37d26952, +0x68db9959, 0xe78ac9a1, 0x2c5364c4, 0x6336ee96, +0x8a864be6, 0x74ef2fff, 0xe25cfb52, 0x24e7d3c2, +0xc1d7fea6, 0xe1ab2d75, 0x51490873, 0x3456c896, +0x09e3f9ce, 0x16818df7, 0xc21dbcc1, 0xeb73c930, +0x16dc3413, 0x9e0ace50, 0xfd174a5f, 0xa439eabc, +0xf33a8d6e, 0x88ef1420, 0xf6ba6686, 0x9d3dc6d2, +0x8adfd656, 0x2384a4d9, 0xf4013c0f, 0x15846340, +0x08f63ee8, 0x902e0702, 0xda4999d4, 0x514d072e, +0x602f8495, 0x04152fe0, 0xe6994f83, 0x523aac77, +0xf72d079c, 0x08147a0a, 0x23825c17, 0x80d52568, +0x6604379a, 0x0950b453, 0xc348b1a2, 0xaf85efe4, +0x9f232da9, 0x0bf1aa15, 0xe53323b5, 0x3c85746c, +0x96904e48, 0xb30603c3, 0x07f500e6, 0x87f33515, +0xc594dd67, 0x74e8f50b, 0xb0282c59, 0x44b8d343, +0x9f4c7085, 0x88085911, 0x7e2893de, 0xf48719a4, +0xcc2951ad, 0x8ad70f6a, 0xf809b209, 0x6f0f1f17, +0xe0ebff5e, 0x2da38d30, 0x5032b56a, 0xa2f3115f, +0x342ee5ae, 0x7392946e, 0xefd89621, 0xb948b861, +0xf9cbaa7a, 0xeed800b1, 0x09f3d40e, 0x60a3f718, +0x61489572, 0xe07e619a, 0xf65f0b1d, 0xa3010b3e, +0xcf47d549, 0x1bbe6d5e, 0x51f76f95, 0x6050cf43, +0xd69cd656, 0x4b23be3d, 0xbbe80f71, 0x4a4a73bb, +0xd537c2d8, 0x904c7e8d, 0x4ffd408b, 0x6fe62f6d, +0x569c3c94, 0x0e4d3c3d, 0x981b1ac0, 0x356430dd, +0xc4611458, 0xb00084f9, 0x9b0110dd, 0x8d782b9e, +0x9d162a25, 0x12e03b1e, 0xedb5701e, 0x093faa44, +0x1ad845d5, 0xcef3adcf, 0xf41d696f, 0xd43ebd16, +0x40e565cd, 0xd79c0b84, 0x9a5d2433, 0xec29e2b5, +0x2802b70e, 0xb7d43d31, 0x14dca4e3, 0x4ee359e0, +0x68132902, 0x174fc6c0, 0x1472f0e7, 0x22c06708, +0xfe3c2ed4, 0xdcccebdc, 0xd11e5acb, 0xc3b8d94c, +0x2f3d9114, 0x73f20ace, 0xbc6c1503, 0x104833ef, +0xcfe52102, 0x08faf5fc, 0xafe9e566, 0xb1a52884, +0xd3ae79c6, 0x2e910d9c, 0x0d10626d, 0x1beb1f3b, +0x9d627a82, 0x14c034a9, 0x97b89ceb, 0x0570aea2, +0xcc2ff445, 0xc53fd16b, 0x853d7293, 0xb65e559b, +0x295f4b0d, 0x6913496e, 0x998e5526, 0xa6bafdd4, +0x00e9daba, 0xa40420f9, 0xe759ef8c, 0xa960a4c5, +0x19802efa, 0xc2a095b3, 0xaefb40fd, 0xe1a6bde8, +0x2d5e7f2c, 0x744dc489, 0xe5fe3e0c, 0x83087f08, +0x58e41310, 0xb9b7680f, 0xe5ebe51e, 0xf40b5296, +0x937dd43b, 0x2932cdeb, 0xb6fff6ac, 0xc72231e5, +0xff81c8f3, 0xc694ae97, 0xef4fad3f, 0x6b18e688, +0xfeaec6d3, 0x29dc944f, 0x61320545, 0x685e6b30, +0x4c44e8ec, 0xc328297a, 0x8ee9f058, 0xbc0a9580, +0x83d9f824, 0x6f476aab, 0x859f4b17, 0x19abd3fb, +0x023d5f41, 0x1f525a60, 0xaf1c3101, 0xa494dca7, +0x2bfe1586, 0x3bb96b74, 0x0046ac52, 0x4b7ff9d4, +0x0467b744, 0xf2888d3d, 0x10d2c997, 0xdfc0cec6, +0x20500dd3, 0xda904fc2, 0x9245c4b3, 0x5cee56c7, +0x8c4c4a91, 0x7c6c6ea9, 0xca330797, 0xf0201b62, +0xa56c3a55, 0x024c28e2, 0x77503915, 0x26d05486, +0x86c2be28, 0xf26b4c2a, 0x70ab42f2, 0x46981d06, +0xde22e5d7, 0x4083e814, 0x2ee87d3d, 0xeeaf0482, +0xca8cb1bb, 0x3c47d061, 0x83e0c870, 0x398557ca, +0xcff56bb4, 0x1518bede, 0xac563687, 0x71ba4607, +0xb2ddc56d, 0x7675f9fc, 0x4c790423, 0x06d3a9c2, +0xde498967, 0x3fea4c0d, 0x5c9ef953, 0xf8db2408, +0x9609552e, 0x6a848002, 0xcbfc271e, 0xec8e8c8e, +0xfbf94cbd, 0xc8743d1b, 0x14b306b1, 0x8b2d9feb, +0x787fdd74, 0x14e1b69c, 0x2d3591bf, 0x8c8783da, +0xed981fa6, 0xcd0d7d0c, 0xb5db24fe, 0x4f17fd4c, +0x375352ef, 0x35d6f770, 0xa22134f6, 0xae4ff8bf, +0xb4434008, 0xb1dad1ab, 0x7b5d826e, 0x43bd1cdd, +0x419cf379, 0xb534cbc6, 0xd72fd784, 0x56c47d5a, +0xcb96dfdf, 0x3de21417, 0x2a972cc5, 0xfe8d25ce, +0xefd822c4, 0x71087147, 0x8a091176, 0x87c15406, +0x7b00883a, 0x45cedba3, 0x02105666, 0x4e733cf3, +0x14b8bb5b, 0x2ac01d60, 0xff38219f, 0x92316a01, +0x07c75065, 0x375c71f0, 0xa7eecddd, 0x7dbd6509, +0xbd57cf53, 0xb024ae80, 0x0790a19d, 0xd55beb76, +0xc8dc0fcf, 0xfdffbff0, 0xb4d68c01, 0xd648a7aa, +0xcef269a0, 0x0f45147c, 0xadc3fbab, 0xfd8abafa, +0x11311e73, 0x139b118b, 0xde1e10be, 0xb1ed79dd, +0x120db3eb, 0x77dc565a, 0xa7b3e8c3, 0x4fb18ee4, +0x964d2fe8, 0xb5e82588, 0x8d4ad15c, 0x5561ab30, +0x3328828a, 0x7a4754be, 0x5a2b02cb, 0x1ae6eaf9, +0x3fdb82a7, 0x26e3a2f7, 0xcab7ebc9, 0x455ad814, +0xe6066b79, 0x5f3a6653, 0xe926ff8f, 0x65e87bee, +0xf6adb734, 0x5056c2ff, 0xc7b78f83, 0xa9ec39eb, +0xa86fd1b8, 0x912c6b78, 0xb67ed3dd, 0xb646ad7e, +0x64b52f7f, 0xfbf068a5, 0xf7e0d572, 0x89032eae, +0x726adede, 0xd9a4635b, 0x89362869, 0x928bffbb, +0x9385b1a7, 0xc471940e, 0x86c16dc3, 0xb0f2bc4a, +0xe62a7694, 0x1cf1bda1, 0x28d492bb, 0xf9a36a49, +0x0b5e6bd8, 0x525ed667, 0xaf0bf29e, 0x39d845a9, +0xae844e6a, 0x5885e973, 0x64fbe85a, 0xb1f64e67, +0x695c6b93, 0x4ba9ab02, 0x67f3d1bf, 0xc3612d12, +0x4d4b65cc, 0x001fb30d, 0x8b891609, 0x5d12fdad, +0x818ca3cd, 0x705b55c7, 0x7985d1c5, 0xffbf722a, +0x56345707, 0xed39923d, 0xf84068aa, 0xad14dc79, +0xde68dad0, 0x0b83fcb8, 0x8c70ba5e, 0x7bf55eda, +0x0ddf0afe, 0x91945aee, 0xc94e8212, 0x6b580f4c, +0x0c0e0e35, 0x383ec0bc, 0x324a77cc, 0xab15c4b3, +0x8673e174, 0x9da5bb1c, 0x54b31c00, 0xe62f8d5a, +0x95370abf, 0x886cccb5, 0xad5c557c, 0x24564df2, +0xf05bef59, 0xb1dcb988, 0xa59baf61, 0xdb9d692b, +0xca2aa7ee, 0x163bb6a5, 0x6c083c6d, 0xff9fdbf3, +0xdd13299b, 0xead2518d, 0x0b3725ec, 0xa53bbf21, +0xd81b3a2e, 0x7f06d752, 0x3eb5183a, 0x70878980, +0x5f9b9ba8, 0x0b863dc3, 0xff9d294b, 0xc0516d5f, +0x695df44c, 0x506b883f, 0x5d167cc6, 0x7599177c, +0xd4a83675, 0xac48423c, 0x61ef2e19, 0xba98d737, +0xf92bf80c, 0xde1dab47, 0x06eb6d6b, 0x5d2ad0be, +0x456daaba, 0x26947078, 0x51a9ad4a, 0xd89d3839, +0xe1714686, 0x97b3d4d8, 0x832e2731, 0x4741bb2a, +0xf11db249, 0xdee5fc99, 0x7bca170a, 0xe4ba29fe, +0xe45411ec, 0x633da510, 0x52f34035, 0xc8662540, +0x4f6a6769, 0xfd3bf6bd, 0xc9f6cfdf, 0xc2f428b4, +0x93dd431a, 0xfb881b16, 0x5825a278, 0x8b02bf06, +0x059178d5, 0x8649de16, 0xf04922cf, 0xc3435973, +0xf7af1b4f, 0x023a7f48, 0x2d0505a2, 0x62220b89, +0x36f7f16f, 0x73fa932a, 0xc4e0fd43, 0x1f310ff7, +0x0bd57581, 0x2916bdd7, 0x37a9902e, 0x7e64f82e, +0x8dcb866d, 0x639210ea, 0x7bc83069, 0x71ee0066, +0xedacdc8a, 0x313c9aff, 0xfd38d359, 0x8131de57, +0x21c49468, 0xcc93228a, 0x22a2cbf7, 0xad7b7b5f, +0x45d89482, 0x649308c4, 0xf52ca727, 0x32fdbf8c, +0x56bd44a3, 0x94b78dd0, 0xea866493, 0xc3a0fa54, +0x2ea0e5dc, 0xfd9ff1ec, 0x2bc87c2b, 0x2eac86c9, +0x0399c9c0, 0xe4cc8e14, 0xba856d98, 0x9c5c55e0, +0x1f20e1d3, 0x20507661, 0xe49b7b1f, 0x3a100e03, +0x71aecb3a, 0xd386caa8, 0x92a4ad74, 0x9228ebc9, +0x672d5498, 0xfa70a5cb, 0x1df52b96, 0x7f0ba017, +0x636fa3e9, 0x9ca09d1a, 0x5101987d, 0xf210d098, +0xf336f285, 0xbb3519cf, 0xed8da318, 0xb6ce4dbc, +0x7b3de62a, 0xdf9f515b, 0xd35a4fcb, 0xda7a108f, +0x915bc5ea, 0xeaaa4f36, 0x0f97b55b, 0x6e93d7a3, +0x4ae2a371, 0x2e0c8db7, 0x34ace121, 0x19a741c1, +0xdf32be3d, 0x9656eb9c, 0xa0301731, 0x78b7f19e, +0x07d99102, 0x5753e20e, 0xbac539d5, 0xc5fe723e, +0xe2b8ba4e, 0xff9bad2c, 0x2d418954, 0x0e47f930, +0xfc499266, 0x50a79226, 0xa027c4a8, 0x4193d5e1, +0xde1b8859, 0x85a93329, 0xe95bcc51, 0x159000a2, +0x411a291f, 0x5a2d7011, 0x6c6bc508, 0x88117c6b, +0x91b092ae, 0x3d76024b, 0x85642069, 0x802dd647, +0x40d2353c, 0x70cb8c2a, 0xb3dc6510, 0x81b59963, +0x7028133e, 0xc65c1986, 0x7db3f80c, 0x2debaedf, +0x18ff4655, 0x94af0913, 0xaa9b8dd8, 0xc773b56a, +0x35f07e8b, 0xb6e2fc57, 0x4097655b, 0x66cef67b, +0x037fb4ae, 0xb153848b, 0xf840d681, 0x818a0aa3, +0x80c5fa51, 0x278b851e, 0x6a6d137f, 0x384d7fd6, +0xe17802e2, 0x1bd1dd4a, 0x385caadc, 0xce887c9b, +0x421a95fc, 0x155f869c, 0x7c579ba4, 0x788764c1, +0x56440ade, 0xec36a9e9, 0xfd759225, 0xdd610d48, +0x6d97d733, 0xe2c04eee, 0xa67174bb, 0xb88eea7b, +0xd7e270fb, 0x18c2cf78, 0x26b9f90a, 0x577cff37, +0xe6545f8f, 0x8f4bd19d, 0xfe471b1b, 0x032d362a, +0xc8e34959, 0xf8b122f2, 0x830e6efc, 0x02941af0, +0x901250fe, 0x20b45f80, 0x3f015e7b, 0x34a9a7de, +0xa33f98d6, 0x8920db2e, 0x74a4b147, 0xfaf50c47, +0x76c3d556, 0xf9f21fb3, 0x73fdffdf, 0x8a73ffaf, +0x578e8369, 0x9630a258, 0x4c5369ab, 0xd896acc2, +0x6b8166af, 0x5ddfb21e, 0x7e3b45a3, 0x7581723c, +0xfe2a7c6e, 0x0d5c9347, 0x960d2dfc, 0x7eb31dfc, +0x2cc2ff4b, 0x3edb5e2e, 0x883c8227, 0x1a23b33b, +0x93282d70, 0x8d089617, 0xda98f885, 0xdc9defcb, +0x9e5aeb2a, 0xf13ee78b, 0x3a55fbf5, 0x30260eb8, +0x55f3619c, 0xb6e46a1f, 0x7201ab5b, 0x68700519, +0xef4018f4, 0x9c36bbc5, 0xa363e3fa, 0x79345550, +0x54807296, 0xc906e939, 0xca2850cc, 0xd714d66f, +0xf124d10d, 0x32c9e4e5, 0xcc288fd0, 0xdc059361, +0xd56a5848, 0xba088054, 0x07afad40, 0x9f640d06, +0xb5c95710, 0xed32a844, 0x0d2e9884, 0x63eb1fb5, +0xf6b60455, 0x75198e10, 0xa5399c3f, 0xb64f8d87, +0x668eafdc, 0xc5f5b0c4, 0x2e3694ea, 0x8200be84, +0x3bfc6be9, 0x522b1a52, 0x08407042, 0x7cf8ade4, +0x0a23e630, 0x462b6e30, 0xc894247d, 0xdc474647, +0x76d8da70, 0x2f038d2a, 0xf2514c64, 0x0bc9326a, +0x28c4dc97, 0x80e6a006, 0x97805e6e, 0x443c551f, +0xe3353efe, 0x62c21d58, 0x7f1e1f7b, 0xaf2c487c, +0xbf0e2028, 0xb478e302, 0x9c2c3edd, 0x96e9c3b0, +0x1e18bbe6, 0x962d16c4, 0x97862dae, 0x0a50aa80, +0x6f9d5493, 0x9d24be82, 0xb8df2efd, 0x4fead4dc, +0xce4a1fb6, 0xfa1e009f, 0x110579bf, 0x8e97b69e, +0x6b42d540, 0x7bd4f8e4, 0x1d1f5a3b, 0x1e2029e9, +0xac7ccefb, 0x5cd9d444, 0x0535384b, 0x672b90f0, +0xff6c965a, 0xe75f40d2, 0x9a37f4e6, 0xad4f7b62, +0x572d8f16, 0x68c008f2, 0x17113b9e, 0xba8e4828, +0x74af5082, 0xd79d67a6, 0xf5f0e980, 0x179ef730, +0x5983ea6c, 0x2db91c32, 0x89e99222, 0x6587022e, +0x6c38b205, 0x6f23823b, 0x9eebe13a, 0x4c9a43aa, +0x78d044ad, 0x1f4b73f0, 0x88bcbf71, 0x3912cbd1, +0xcfa349c3, 0x59d4dee7, 0xdd74761b, 0x9f67fed0, +0x45e47994, 0x24beae80, 0xe56f87c8, 0x6097c15b, +0x0e353a52, 0xbe6097c1, 0x30cc73ea, 0xea5503cf, +0xd6c2f7c1, 0xbb6cb1fe, 0xdfa0b713, 0x6718dd7c, +0xd63f156e, 0xebd1cc71, 0x5c44cb20, 0x2ff92c20, +0x8af93ba9, 0x24cee703, 0xea3c8688, 0x09270f1a, +0x032a2ad8, 0x8716704e, 0x06c63df7, 0xf4ccc82e, +0x906a92f5, 0x56074384, 0xc6d61670, 0xbb9a7d9c, +0x104098b5, 0x06f6fc61, 0x750d19c6, 0xd5c1c4fc, +0xb19caa8c, 0x9e1f6b75, 0x18ad7f07, 0xbcef9edb, +0xfa005a77, 0xb872bd2b, 0xfcf496ec, 0x8edcb670, +0x8637e71b, 0x87b29eb6, 0x7a09097a, 0x85292762, +0xb9f69f80, 0xc21da735, 0x31c1c5ae, 0x005d99ad, +0x8e2d6a73, 0x5b4aeb27, 0xa27509d3, 0x9cae8000, +0xe256a950, 0x90748cc9, 0x0ca7b824, 0xe480c213, +0xc2c321ce, 0x75b581e6, 0x8cac317d, 0x6bbb526a, +0x5bd706e8, 0x740a63e0, 0x50c5df5f, 0xeab91a2a, +0xc0b34736, 0x05146579, 0xba015919, 0xb9d5a3a4, +0xb43567af, 0x4b9fc0b2, 0xe44e501b, 0x063eccfe, +0x5e87b049, 0x46215970, 0x7bb677c0, 0x194e0a5d, +0x3c9309bd, 0x6505860b, 0xb1ed0f2c, 0x2fb69f21, +0x2f50155c, 0x1a38581a, 0x06856439, 0xc3c4f13f, +0xb94fc6fe, 0x2a260ae5, 0x94e13777, 0x680c22ce, +0x0bda1609, 0xae6d9948, 0x31bfb000, 0xbfd85e04, +0x25f5e71d, 0x87c3ce94, 0x82b82d9f, 0x4a420c12, +0x4e484845, 0x82727577, 0xe1bf0a6d, 0x12ce676a, +0x89eaab6b, 0x01be485f, 0x3104ad1d, 0x2ae72fa2, +0x13403e7d, 0xb9654435, 0xf09bf3e0, 0x1b71fd2d, +0xe307dc02, 0xd260e279, 0xdadfd045, 0xf6ef38ff, +0x6e1abed1, 0x09fc9601, 0x4413697f, 0x8c09e381, +0x2997b44a, 0x0f9352a3, 0x5600460e, 0xa285a3d8, +0xb709bce3, 0xbe388822, 0x5598aca3, 0x5f259dfa, +0xe7507017, 0xcb9c7ea1, 0x1b785584, 0x74b9c827, +0x43ce80e7, 0x2b1102dc, 0xcda147b4, 0x18dd7f9d, +0xc452ad6d, 0x55770ce5, 0x0c04adca, 0x1d0a332f, +0x018d6731, 0xff8336c3, 0x718da250, 0xeb9792b1, +0xecd1a815, 0x39ea7875, 0x89e4ad8c, 0x6a1cf3d0, +0xc3e8c6cd, 0xde1b848a, 0x1cd6a80c, 0x22e28eb4, +0xfb35f8a8, 0xa6b6cd75, 0x7aadd6e1, 0xb827e3bb, +0xfa1c4522, 0x6e851281, 0x3537d0ad, 0xe10d1517, +0xad3589cc, 0xbde8afd8, 0xff94980a, 0x9ea0b789, +0x3977f41b, 0xd9d0ff7b, 0x146229e9, 0x36c282b5, +0x4fb0cf9f, 0x405f6f45, 0xad6b2679, 0x28f01e4f, +0x5062d3f7, 0x1744f670, 0xe632c27e, 0x02ed33b3, +0x74f75321, 0x8af6b4b1, 0xd2d09a1c, 0x53c462b9, +0x8c33f0b1, 0x3c267316, 0x98cf275d, 0xe5cd49c1, +0xc57b59bd, 0xc90aa43a, 0xa7a5a938, 0xddf813d0, +0x65d0f86f, 0x9c4d078a, 0xa0a11002, 0xf9c7b604, +0x0a783ede, 0xcdbba18f, 0x88abe43b, 0xbaf3b0e5, +0x9c38e0c9, 0xfb6e2ba1, 0xfedeffa8, 0x7ccea5fb, +0x0ab3a4c5, 0x609a353b, 0x886c7328, 0x116b01cd, +0xc6183c43, 0xa1159c99, 0x1f01d983, 0xd2ee394a, +0xd9a7803f, 0x491ce6ea, 0xe1bdbeef, 0x0757367c, +0x57ef4f70, 0x6e48dc81, 0x088bae79, 0x83ee62ae, +0xabc8f778, 0x356ba016, 0xd7d37cd0, 0x04ec36eb, +0xe802c532, 0xdc345c53, 0xa5518360, 0xd9040eef, +0xcf1e3bb7, 0x09446848, 0xa741c3ea, 0x3db2d085, +0xec2221ed, 0x3b515159, 0x0e086d2c, 0xed411c01, +0xe9da1b26, 0xf66b499a, 0x674aaded, 0xb4caae41, +0x41e91776, 0x7719da35, 0x9f5190f3, 0x9780013d, +0x9e665eef, 0x94640024, 0xf3569211, 0x25984fef, +0x44d62ab1, 0x1ef771ae, 0x188f4600, 0x39589dbc, +0xbd027a5f, 0xd249677d, 0xb4b25c3f, 0xcd03d547, +0x054f803b, 0xc12dceda, 0xee02573b, 0x1fed1a8d, +0xab33affe, 0x51da04cc, 0x6c727499, 0xe6455ecc, +0x3455e2ef, 0xa38d42a6, 0x01e69ae1, 0x2a69e4b8, +0x0254b23b, 0xdc673c8a, 0x00371ee2, 0xc152e4c3, +0x6c8cf399, 0x65ab1a0e, 0xddbfbdec, 0xa2f044cf, +0xb2384aaa, 0x387eb4cc, 0xc28bf761, 0xc55b8397, +0xc8b4c232, 0xdacc5a37, 0xdb0987e0, 0xef2f813d, +0x8d960e79, 0x69065062, 0xec207994, 0xde363e9a, +0x5909a450, 0x55f69271, 0xdf8d622b, 0x4fb01d69, +0xe2d5dd1c, 0x15007948, 0x6dc144cf, 0xbeb32331, +0x11b15d50, 0x8522a30a, 0xf8acd2d8, 0x8b4a509e, +0x30145e20, 0xc9620809, 0x4109b96a, 0xf43d4b31, +0x221363ab, 0xae7ebccb, 0xe569c304, 0x77205717, +0x3edb158d, 0x746a391b, 0x11021416, 0x45f2442d, +0x3ecf2978, 0xb0d13615, 0xb92f7516, 0x7984c358, +0x2eb5c9b1, 0x265eb3cd, 0x0d9abacb, 0xe430f6e7, +0x6f5ba1eb, 0x5d448872, 0x59f0139d, 0x15d65241, +0x0e499397, 0x58228d41, 0xd1a9b8ae, 0x5786c753, +0xde7c860c, 0x7678f390, 0x574ce95b, 0xff1f9f7b, +0x3f6ef5a2, 0x3dedf7cf, 0x78abb249, 0xe10e3d48, +0x7f1a7007, 0x2f73f397, 0xaf6af35c, 0x4edf9f29, +0x0cda68be, 0xeff72d5b, 0x4fcb5c2f, 0x8ba641a7, +0xba078390, 0xeb571097, 0x27bd42d7, 0x81ec7eaf, +0xb631f55e, 0xda2e4413, 0x108f94cc, 0x72db84c8, +0x39e9588e, 0x75f76cb0, 0x5ba3a4b1, 0x44e6f28d, +0x0164fdb7, 0x95aafec4, 0x1eee0238, 0xb5779daf, +0x38d41aa5, 0x700f194b, 0xf4726edd, 0x1ce2ccaa, +0x82fa5ef6, 0x1822c524, 0xd3daf8e7, 0x6548637b, +0x928a870f, 0x97a9de22, 0x170ed92b, 0x337ef182, +0x71f5024f, 0xc397e451, 0x52815400, 0x0f062e0e, +0xa307f3d4, 0xd6c48d74, 0x003c8317, 0xca0cc1e2, +0xfc8553d9, 0x18a20acd, 0x50f43afa, 0x3b1af119, +0xb47d105d, 0x65832cae, 0xa5c99dca, 0x3cb60507, +0xf6112f93, 0x50959f3a, 0x8ae8d1dd, 0x97d7566a, +0x144162ce, 0x9f48e8b9, 0x73dcb6c4, 0x3c44d2b4, +0xa42f94cc, 0x42015076, 0x5872fb42, 0x54b0519f, +0x6fdf2c0e, 0x072e6c25, 0xed29f44e, 0x8ad09f56, +0xcc01b831, 0x3c9ad598, 0x9d574514, 0xa7990bb1, +0xac11e08d, 0x064592ad, 0xd5241154, 0xf9500b81, +0xc77d6339, 0xec3f0e09, 0x2d47581c, 0xf5d1ab34, +0x59e440d3, 0x4aca9c42, 0xf9ef51a3, 0x68cff6ef, +0x5cfe3dca, 0xe1c219b5, 0x42b8ec95, 0xbbe4badf, +0x72e98a26, 0xd5d4d429, 0x896f62af, 0xbcf07536, +0x4fc4e121, 0x73f4633d, 0x8705834c, 0x3f0ac2f2, +0xb3a5e4dd, 0x6a95db2c, 0x4da9af88, 0xc8aad99b, +0x915927ec, 0xd335ee71, 0x0d3b15d5, 0x7f490e99, +0xba715619, 0x6a30c895, 0x780e87a4, 0xfef6f5d3, +0x6f7b8e26, 0xdf639c47, 0x1949170a, 0xd2dd4523, +0xfa38edfa, 0x4565b63f, 0x2aebfa43, 0xf806f841, +0x42b41b73, 0xeb770e62, 0x3a09c524, 0x9acdc95a, +0x0d7cb245, 0x3fcce197, 0xb9dfa64f, 0x4432c40b, +0x420587d2, 0x4df4c934, 0x04efbc59, 0xe660a708, +0x273fda51, 0x2319d4da, 0x4e40a43b, 0xe6ade642, +0x970c39d6, 0x855aafe9, 0x3bb9ffeb, 0xcc4d83ed, +0x060f1948, 0xe4b0d12a, 0x42c14bcd, 0xb7576eef, +0x9e0a3bdd, 0xbf5b7b3b, 0x771046f7, 0x63de5ec0, +0xc39d2315, 0xa41ab903, 0xecef91e3, 0xe05d5235, +0x1786df7c, 0x4e9db4f4, 0x6d732e32, 0xf3d30a09, +0x5377bb1c, 0xea67ff4d, 0x9dcc5e57, 0xf21adc4a, +0x5df12ebf, 0x674e298a, 0xb37e2289, 0xde7967ae, +0xb777b901, 0x421985e6, 0x307553f1, 0xc001c748, +0x71141a75, 0xf01b3009, 0x9d2f2746, 0x5ca6ab24, +0x6e187b37, 0xde922ad1, 0x01d2a39b, 0xf944eee2, +0x58585a4b, 0x3db21a08, 0x2ef46ffa, 0x47117a4e, +0xf1d84a55, 0x4c318ed3, 0x5878d29d, 0x3bee0f41, +0xa0820b68, 0xd923b2e2, 0x3867f74d, 0x6aaf9280, +0x9816ef5c, 0x90fbbf22, 0xb7fa3313, 0xd04cddb9, +0x8a64ccf9, 0x2a8e39bf, 0x56fb3f48, 0x924931db, +0x04afa245, 0x09a9a5d4, 0xd2f5d41e, 0x347f3f6a, +0x81e93eca, 0x7ddd6834, 0x908d0475, 0xe3de32cc, +0x5218be9e, 0x9aa9fe43, 0xc91de09d, 0x8accbeff, +0x5e99e3d8, 0x94fbae0c, 0x3e25677b, 0xa74c14ad, +0xecd23130, 0x50a9138c, 0x654fa523, 0x35e40d34, +0xc01ff4a7, 0x1f0c1f8a, 0x7822c1c1, 0x63e410f4, +0x6c32b3c2, 0x2d4e8b24, 0xba1f5370, 0x4674eadc, +0xffa120d3, 0x9ac2dc7e, 0x3538dfa4, 0x6163be5b, +0x19e3236b, 0xd09ca77c, 0xc1bcf4ca, 0x8dfad5c0, +0x11443ca1, 0x62024e9a, 0x4abb91c4, 0xd9d09e09, +0xa346088e, 0x636b50e9, 0x49e56df6, 0x6e8ad394, +0x4f4458b3, 0x001e7de1, 0x03187f6f, 0xf93952a5, +0x9a37bb5d, 0xb5a820e7, 0x88987122, 0x46f08735, +0x0210284a, 0xd4cd3f5a, 0x582f7814, 0x101ad726, +0x19cd7801, 0x20ef7bd5, 0xc4e93073, 0x163b39e7, +0xcad2341b, 0x28b876c3, 0xd219d98b, 0xe4df3d8d, +0x6a68422b, 0x62947075, 0x0511c42b, 0xed3873d7, +0x2c069efb, 0x7c261589, 0xb8153d12, 0x43df8fec, +0x4ec62931, 0x4f5112e5, 0xd949713a, 0x1e6b234b, +0x534b3b0c, 0xd5690b83, 0x00e92da8, 0xb1d42af0, +0x069db944, 0x821508b9, 0x5f6144c2, 0x245ef59a, +0x7c8e98a7, 0x03647f4f, 0x3ee896fb, 0xa5bb7c26, +0x1a49fc22, 0xf311ec7a, 0xe9e2b321, 0x78e6076d, +0x7032369e, 0x54b0ddb6, 0xbcc51001, 0xba84edb0, +0x9c24c18b, 0x381d1e2b, 0xb9088323, 0x58e09ae4, +0x8b65a639, 0xb855257e, 0x0c17ec74, 0xdd377fa1, +0xae7ccd3c, 0x3a62844e, 0x60d9d645, 0xebbe32dd, +0x33e1b7dd, 0x58f362fb, 0x222b986f, 0x51826185, +0x14fab93c, 0x22142eac, 0x89debb6f, 0x10cc308f, +0x63f68074, 0xc3f79c86, 0xb962662a, 0x5174f8b9, +0xb93693b2, 0x9089dbec, 0x8a4517c4, 0x9547c337, +0x259e562e, 0xae589ec7, 0x2c320626, 0x62a0d329, +0x218b9119, 0x4e8fff0f, 0xa6048f9d, 0x543dfe02, +0xd02bc778, 0x7ce8391f, 0x757e7a79, 0xe898a009, +0x052cb339, 0x19467ee7, 0xf0cffd4c, 0x9fa140aa, +0xeafedc54, 0x32ddb633, 0xb3472b21, 0xe8bb5e13, +0x3c24f3c9, 0xeaec1326, 0x5ce6dbd1, 0x16bd2268, +0x149c7d10, 0x350a54b7, 0x2d98ff3d, 0xd0cd9a14, +0x66019e7f, 0x83f0b70e, 0x123f8cf0, 0x82df7683, +0xb8729e03, 0x5c3fe09e, 0x68f37eb8, 0x51bdce62, +0x3f7dfdf3, 0x0f3a4117, 0xec660576, 0xb85ad75d, +0x4adc676c, 0x4d379ec2, 0xe207a542, 0x3722ed96, +0x39ed9c01, 0x182b57d7, 0xab5054e8, 0x4dcef5d5, +0xc274dbe9, 0x5fc6a6f6, 0x65c0952d, 0x63afccb1, +0xa2002411, 0xedc5efe9, 0x555d7f59, 0x2d91dc43, +0x441b0446, 0xcf060f48, 0x3772cb49, 0xaf3fff75, +0xc6ac2d17, 0xff43505e, 0xf52162a6, 0x9d666425, +0x427e4cc1, 0xb889488e, 0x7a4a738c, 0x4f977c0e, +0xed3ab0c9, 0x98c80f6f, 0xfe036365, 0x545a6dc4, +0xda82f0c2, 0x9f757293, 0x2864153a, 0xda4c40f7, +0x9037a517, 0x9cf46b31, 0x3cf44aff, 0x95cd8d75, +0xaa02ad77, 0x3472f736, 0x004f6f06, 0xe793bd12, +0xd4e2f208, 0xa605c42b, 0x04645457, 0xe977d3dd, +0xaeb0dba0, 0x7de28e78, 0x40388dd2, 0x31c5dcf9, +0xf855a2d6, 0x25644980, 0x6e795d47, 0x2124ea83, +0xffabb937, 0xa4b5b391, 0xb0e4a265, 0xb3573569, +0x0d76557f, 0x0d0f1e1c, 0x681f5eab, 0x8b9e6f68, +0x2f6a3614, 0xdac41f6c, 0x87802387, 0xcdc0fadb, +0x8469543f, 0x50400d6b, 0x53f743ba, 0x645365af, +0xb81d18f6, 0x6a53b552, 0x67a0059c, 0x95059d41, +0x2e708175, 0x9006327e, 0xd54b1671, 0xe681a786, +0x44b3fe78, 0xdcfbc71f, 0x851f76de, 0x8dfe377d, +0xe8533607, 0xb3103877, 0x9a96c36f, 0xda607cfa, +0xb27b8318, 0x2507df20, 0x7490cd7d, 0xf90a253e, +0x57a8df2e, 0xc5d4a6b1, 0x717a612c, 0x908dfd42, +0x849619d5, 0xd607db53, 0x269178ef, 0x03e872e2, +0x348c18bc, 0xe5e5c9d8, 0x5a0ae798, 0x288bdbb7, +0x4c0ca6da, 0x1d2a1533, 0xcf780189, 0xaf090c79, +0x74275401, 0x4d87cb50, 0x89287b27, 0x4feb9061, +0x364206df, 0x52927761, 0xdfbee957, 0x8e7b9c64, +0x0b1afd13, 0xe358116e, 0x30505f18, 0x1797aa99, +0x97ca7160, 0x341d9269, 0xafca4527, 0xb264c692, +0x7f96d2e0, 0x121202ba, 0xd882a180, 0xed6cd4b5, +0x2f8c306a, 0xdc603798, 0xfdd9a987, 0x96ed8876, +0x3860f303, 0xd4d9c28e, 0x2e364ab1, 0x1e180bb2, +0x7fadf227, 0xad4a2a2f, 0x237172cc, 0x3cc97450, +0x8a87af13, 0x14b88e5e, 0xa58c37ec, 0x824b5a0e, +0x02bf210a, 0x8abd66ed, 0x95692a62, 0xf0c3694e, +0x35d39110, 0x21b61b99, 0x27b84b15, 0xd35645c0, +0xed842281, 0xd921192d, 0xc25b4ec2, 0x9842d449, +0x1edd53ac, 0x980c4df7, 0xead92aed, 0x23ee0251, +0x9f3df112, 0x8e719f2d, 0x1b87391a, 0x206b282a, +0xc9134ad5, 0xd1fa4c21, 0xc86ee4a9, 0x2ed14a8b, +0xb019127d, 0x4ebe0fd5, 0x44c68354, 0xe365cd90, +0x808ba057, 0xaf0cdc18, 0x2c31ed51, 0x3cfce9da, +0xa90ef870, 0xa43ef17b, 0xaa97b6cb, 0x7f5d0b85, +0xedcfea6a, 0xe42abbde, 0x4d6ee0ac, 0x8a5e9375, +0x4246d0d6, 0xad587c3a, 0xd95152a7, 0x3c0f2875, +0x2e1f20e1, 0x1f597032, 0x1d8fa054, 0xbbbaf4b7, +0x59375d90, 0x7837947f, 0x41ec8032, 0xd48c9c8c, +0xd9f5b8b8, 0x32e7c314, 0xd56150bc, 0x7ffa7599, +0x4f02dcd0, 0x54a88813, 0x83bf09e5, 0x8c272c9a, +0x1e37f573, 0x760481c4, 0x71ba6210, 0xc36dcdb6, +0x7bdedcda, 0xf9cb996d, 0xf7d49d46, 0x18118552, +0x2ce1357e, 0x34e8381e, 0xb60dcd52, 0xbd6d1e77, +0x10db6077, 0xe0d7d32b, 0x41207fa4, 0xc88cbb26, +0xa1c81061, 0x29baa407, 0xff130ee3, 0x7190f97a, +0x7f231ba7, 0x78581c8b, 0x3208d076, 0x19b4ed1e, +0x240c3f84, 0x170210d9, 0x1df75907, 0xdb72e3bc, +0xa7c08176, 0x433c31e1, 0x05dd991d, 0xf7d53283, +0xd3b13433, 0x3495c882, 0xa24ca2bb, 0x5736e544, +0xc535a5fe, 0x5fdf7d29, 0x7b9768ca, 0xb3fd44b0, +0x8668f834, 0x22313a94, 0x750686c0, 0x207e4a6e, +0xa4f5d81d, 0x77e1c81c, 0x2d9022c5, 0xaf870cd3, +0xa01ccf5b, 0x7425a497, 0x53974cbf, 0x6f0c43b0, +0x5f7d7c07, 0xdb42b36b, 0xe64f7d6b, 0x2d155999, +0xb850435d, 0x14c1c19c, 0x38beec03, 0x56b925d4, +0x320098aa, 0x9f7786f2, 0xec50f262, 0x7902faa4, +0x051db255, 0x4d7f4dfe, 0xb1539d59, 0x5541d770, +0xc4ff1118, 0xd4094d58, 0xda9416c1, 0xf8349318, +0x855a7d61, 0xf491eda7, 0xd5a8d841, 0xa787e9c6, +0x7f2bd161, 0x442a0aef, 0x738287ae, 0xb60aa175, +0x07c65ff8, 0x6b9f8ca2, 0x314ea5cd, 0xf777daad, +0x308b17b2, 0x81cf18ff, 0x371267e4, 0x5d3c2b3c, +0x83ba613c, 0x9632db28, 0xd399ade1, 0xf7e83f7f, +0x5488c51c, 0x86c70fad, 0xe479bd12, 0xb219ff0a, +0xf3f13ee3, 0xa9de0f7b, 0xe834a5c0, 0x1af639c4, +0x1ee50626, 0xa982dd5b, 0x6fca001b, 0x7f9db2c9, +0x25b87ff2, 0x2b72ce75, 0x443afb46, 0x641df6a0, +0xa00dfd94, 0x85e9c294, 0xdbc78f86, 0x25cdcaa0, diff --git a/src/cpu/intel/haswell/microcode-M7240650_ffff0007.h b/src/cpu/intel/haswell/microcode-M7240650_ffff0007.h new file mode 100644 index 0000000000..b1157d60c7 --- /dev/null +++ b/src/cpu/intel/haswell/microcode-M7240650_ffff0007.h @@ -0,0 +1,897 @@ +/* 0x40650 built on 08132012 */ +0x00000001, 0xffff0007, 0x08132012, 0x00040650, +0xbaeb63c8, 0x00000001, 0x00000072, 0x000037d0, +0x00003800, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x000000a1, 0x00020001, 0xffff0007, +0x00000000, 0x00000dd1, 0x20120813, 0x00000dd1, +0x00000001, 0x00040650, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xde429059, 0x5e47e5f9, 0x4178c7e5, 0xc173f907, +0x7d1b18cc, 0x14d707f5, 0x7cd90b57, 0xb13efbdb, +0xa19308a3, 0x5b19c4b7, 0x4a1b425b, 0x7d6a74f6, +0x81624193, 0x3a559605, 0x5475280b, 0xe7319d58, +0x48624ca7, 0x507af030, 0x3b32d96a, 0x30164068, +0x5284d2f5, 0x725b2915, 0xf63c9280, 0x44b7c142, +0xe67ca7b3, 0xd6f163e7, 0xcdf51f3c, 0x41d180a1, +0xcc3931b1, 0xf7a544a9, 0x7f6bf77d, 0xfc45a45f, +0xf0985836, 0x652d7e2e, 0x0324b1f3, 0x24b9548c, +0x7bcae7a5, 0xdcdebf79, 0x27015922, 0x0c83c606, +0x3d2ceeb7, 0x61c5eec8, 0x6b6899c6, 0x3e500531, +0xf08bfa44, 0xb304a8f4, 0xcee8f713, 0x2912c786, +0xfae6c34c, 0xa5292960, 0x7d63e389, 0xaa257a01, +0x1fb25054, 0x963fc676, 0x5bcb9fd3, 0x58f369a4, +0xf6e3beb2, 0xa58b5eb0, 0x33c7eba4, 0x37fe8b66, +0x00714403, 0xf0fd0c4e, 0xaa122996, 0x9a55b184, +0x00201507, 0xc9fb6e3a, 0x11ab60c8, 0x80ff6e84, +0xc37aabdd, 0x0fc23175, 0xb0b18c34, 0xf1ec806c, +0x00000011, 0xa5f6213d, 0x4c3e7f1f, 0x13a90e88, +0x47b7d6ec, 0xf571bf23, 0x50ddfe65, 0x479fdaf5, +0xcd75485d, 0xbe558d1d, 0x2df5284a, 0x4c97c566, +0x154ba1be, 0xf77aa9e8, 0xc9ca22cd, 0xb83e0b19, +0x7f2153d7, 0x552930e0, 0xf4477e59, 0x75eec500, +0x8d9c0b08, 0xe1c173bb, 0x33569053, 0xff2f1473, +0x71de2e2f, 0xa8f86c8c, 0xde68ce7d, 0x7d2940d6, +0xcfe8c5f0, 0x978e28e8, 0xd23ab801, 0x4acfc2c7, +0xeeaa8b75, 0xf4817f5a, 0xea1664b4, 0x76374ace, +0x3c50dd90, 0x7368b116, 0xd0a10979, 0x428f0221, +0x18ba6453, 0xfafec8b7, 0xb48db289, 0x506e23d6, +0xaabeea21, 0x0c9289a6, 0x14aee813, 0x4a1e6f14, +0xdc2f70b9, 0x7f579faa, 0x1639a925, 0x2afd96e9, +0x38c5bf51, 0x832e7063, 0x973d9697, 0x5fe400f5, +0x46032c71, 0x9e335517, 0x12ee90f6, 0x3b3391ea, +0xdc9cdfe7, 0x804a36f5, 0x5e271bd8, 0x756af6d9, +0x0a17677f, 0x134ebb47, 0xcfc9965d, 0x2594bc24, +0xaa26ea5a, 0xb8ab648e, 0xfa47d751, 0x1ab2e541, +0x536be73e, 0x5e0dff9a, 0xdf0e8762, 0xf1ea6de0, +0x718e58c2, 0x4e566bb8, 0xafe8103f, 0x1bc8fd5d, +0x4a035c53, 0xacba0dc7, 0x45bd0e74, 0xa9b82f72, +0xc52ff600, 0xb8f3ed00, 0x83901bc8, 0xc724165f, +0x37be294c, 0x21458e90, 0xe9e06f27, 0x428aa4ed, +0xdbe671d7, 0xc9e4da8e, 0xa1d035b5, 0xab3cd5f1, +0x321fb426, 0x1504431d, 0x21ce98bb, 0xc36472ca, +0xe48c143b, 0xed0d0dd1, 0x8e902cd1, 0xc8b08e45, +0x438949de, 0xf9cad1f0, 0x85f2e250, 0xf435da99, +0x0227bd81, 0x6b02307a, 0xb2a6167f, 0xe9897016, +0x58c9c43d, 0x58b458e2, 0xadc5d080, 0x3d699203, +0x4742176d, 0xef29c1ab, 0x52a0f932, 0x3e1b23af, +0xab6a31d6, 0xab9ced6d, 0x61340822, 0xc33ba5bc, +0x1bc40c4d, 0xab33fa59, 0xd08d9ddc, 0x484049bf, +0x7a572f4e, 0x3225d01b, 0xaceda13d, 0x1ec90bc3, +0x9f402965, 0x4894c12a, 0x72a120e9, 0x7aadb73f, +0xcba5e444, 0x88d94908, 0x57e241e7, 0xead7fa13, +0x9257d68f, 0x816fd674, 0x1820fa2c, 0xc31e4d24, +0xfe1d36c3, 0xd65dda50, 0xd31fd7ee, 0xb9ca8e69, +0xd3e04c42, 0x6b8bb35c, 0x874c68e0, 0x08e4e24c, +0x612586d4, 0x417952cc, 0xc6351b8a, 0x8682cfbf, +0x5418993b, 0xc85089d9, 0x3e547bad, 0xc904a3ed, +0x679e3bf1, 0xc5e8cf6b, 0x4370a103, 0xba4dab8a, +0x25d0ae4a, 0x79a5cae0, 0x1ade6919, 0x3c915dbb, +0xb1d56d12, 0x94c186d5, 0x6d68313a, 0x0abf1aaf, +0xa937dd41, 0x9eafe75b, 0x54c831d8, 0xcb69c354, +0x3bf4f413, 0xa408f4ad, 0xe669d950, 0xebae6c75, +0x58d289e4, 0x932ed8ac, 0x24fbb89f, 0x09b85d96, +0x0488f4c4, 0x23e706f9, 0xa509821f, 0xc4f728e4, +0x10159886, 0x8ad9abb2, 0x8d60b096, 0x104f9407, +0x0563e5fa, 0x9f2a185c, 0x6b0d5ee9, 0x917f0833, +0x132f62b0, 0x9c9de1af, 0xfb35fecb, 0xa2955743, +0x13556f40, 0x3088c822, 0x2308e4f4, 0x5ea61fed, +0x50cadcf5, 0x0d3fc6f8, 0xd3ec64a6, 0xf31b9b87, +0xc5c15f6f, 0xc28dcdb5, 0xe7ee3298, 0x16059909, +0x8e4137e4, 0xbdd66612, 0xc3e1c984, 0x19b02c18, +0xdf3f56aa, 0xb59509dd, 0x23c0c479, 0xbbcce51c, +0x7817299c, 0x38fa17e0, 0xc065556a, 0x8c7fcce3, +0xf5974dd7, 0xc46f375c, 0x4843d245, 0x766d6bc1, +0xc6a6c95f, 0xeeb43f14, 0xba692967, 0x03d65aef, +0x48d40627, 0x8b5207f6, 0x209a3620, 0x0534affd, +0x73675d8f, 0x6e7da0b3, 0x683dbbd9, 0x258ff122, +0x76fec635, 0x38adb43e, 0x13865990, 0xc63f0be3, +0x8e0faf6c, 0xf4c9bc52, 0x8ba3eec1, 0xbb83ae51, +0x0bcfe7ff, 0x6b0c87e9, 0x62fd054d, 0x58ec7fb7, +0x7ee720af, 0xbe752edc, 0x34a6b393, 0x900beaff, +0x129bca50, 0xf138ec56, 0x19a9c071, 0x509da2e8, +0xb1e93845, 0xa9fada7c, 0xb1ac79c4, 0x89f43cab, +0x41a6ce12, 0xa41e3592, 0xca1a315b, 0xe48953fb, +0x020f5a5b, 0x8429118b, 0xc541b1e5, 0x74699f42, +0x6fb8ba4d, 0xe3bbba41, 0x5978a354, 0x6a0cb98a, +0x1cda611e, 0x712b4dbd, 0xa509df61, 0x170d7f17, +0x4ebc3033, 0xac2fad83, 0x35b30875, 0x373b9ba6, +0xed269abc, 0xed6c6f2d, 0x33d374c3, 0xe270b1d4, +0x98fa18d6, 0x3729a2f8, 0x45d47a16, 0x218ada10, +0x4f3fd842, 0x07b06600, 0x861e257a, 0xbe14066a, +0x2bed0580, 0x6f862fff, 0x4c40cee8, 0x247b9501, +0xfa49656d, 0x32671541, 0x92b1468b, 0x5910423b, +0xb8fa9dc4, 0x2f97339a, 0x1d32034d, 0x569ea757, +0xbbc3a3a7, 0xecb1803a, 0xddbea4d7, 0xde2e65c0, +0x3e3b9cdb, 0x79d50365, 0x445bec79, 0x6d6e9525, +0xdd6cac48, 0x94ec33f0, 0x5c78943d, 0xb87565f2, +0xd149928a, 0xad39bbd8, 0x8a49aaf1, 0x8c503427, +0xb699c8ec, 0xfbef7198, 0xcae17d67, 0x415c8594, +0x089c2f7e, 0xe2b4a22d, 0x17788281, 0x506c50a6, +0xe65e6ff4, 0x0f007e17, 0x3d611dd5, 0xdbdf436b, +0x6224ff7c, 0xfd37b4a1, 0x20fdca9b, 0x93bbe39f, +0x05b6625d, 0x27392f71, 0xc1b29aa5, 0x5af4fc64, +0x98b39b82, 0xfaa95459, 0xd746ece5, 0x07edfe4b, +0x8d376fff, 0x6b6f2676, 0xb8606790, 0x2d97d392, +0x2e2c0cab, 0x8b5e19c6, 0x4e201e48, 0xfffc0942, +0x1623e57e, 0x364f160b, 0x231732b0, 0xbc35e1d2, +0x7a9bac6a, 0x87682488, 0x863ba638, 0x89507dc0, +0x5df119bb, 0x84aededa, 0x38d0bde4, 0x30447148, +0xde21bfb1, 0x637fd2ed, 0x504950d8, 0x28a11edf, +0x601022d2, 0xd5055454, 0x7aa6f597, 0x45076dba, +0xb4144de7, 0x071c3c3f, 0x3ec7dfc2, 0x94dda8ff, +0xcbf010ac, 0xf1756cc9, 0xa1cdf230, 0xd5dcdad0, +0x7b389ccf, 0x5aeca312, 0xea12b3f3, 0x4df41c14, +0xa7a62abe, 0x664aca2b, 0x77c44afc, 0x582360c3, +0x18068ac3, 0x57a8b000, 0xf3d97ae3, 0x65026c78, +0x323bc374, 0xdcc6c805, 0x3132fc2e, 0x3a5fc067, +0x811ae1af, 0xac3eaf2f, 0x906a5019, 0x5d68cd4e, +0xa99f3669, 0x585b5912, 0x3e8f438e, 0xe09a385a, +0x327d27f2, 0xa1f57a36, 0x439b5798, 0xddb57964, +0x9c49c90d, 0xdfb51ced, 0x373d5771, 0xb06368e7, +0x4023e0d8, 0x96541876, 0x00812d9d, 0x9453b8ea, +0x8edce7f8, 0x5f6a3153, 0x6e326bf6, 0x12bdbc11, +0xf6a3ff4a, 0xf9e9895a, 0xf337cb7e, 0x55f63f3f, +0xb286f188, 0x8e66d63d, 0x0c677aae, 0x1ce018bb, +0x794f4210, 0x771ee72b, 0x5230d96a, 0xa61e6308, +0x98c1b0d1, 0xb946302c, 0xbf061220, 0xd906821c, +0xddde4d5e, 0xf0a365d8, 0xe48b38cc, 0x070521e7, +0xa95e1bbf, 0x6960834e, 0x458ff508, 0xae06010f, +0x5bfc3a8c, 0x543464be, 0xd0aa32e0, 0x8e56415d, +0x91ec7ca0, 0x9a45b1e4, 0xf3d4efc3, 0x12f469ae, +0x26a186d8, 0xeafee135, 0xef773153, 0xb8aed6f1, +0x1b8673dc, 0xd797accd, 0x3e53a7f0, 0x22b11fe1, +0x7527e0fe, 0xfa19cc41, 0x8ab0d9a2, 0x8e35bf24, +0x7858c291, 0xe792110c, 0x14108460, 0x96bf4ef2, +0xd45a928e, 0x7ea7c1fa, 0x75ba21c0, 0x7f989da0, +0xc8065224, 0x949a5efd, 0x36f956c5, 0x08507305, +0xf5e33b5a, 0xcf1ef444, 0x9792b9d1, 0x9352e48d, +0xeaf81317, 0xb787a480, 0x2d4b8f78, 0xc3336174, +0x37940cf0, 0x19e0969c, 0x951cdcbd, 0x5ac58c49, +0x75835178, 0x09b9aa85, 0xfff9fe36, 0x8ccdf3de, +0xf7961b8d, 0x3b3c0b54, 0xfdaca8b0, 0xfaf7412a, +0x6af0d993, 0xe52b2d6f, 0xe7020726, 0xca2182a5, +0xa99d1628, 0xd98c538a, 0x209c0503, 0x0f6a9e33, +0xa84394e7, 0x509962ee, 0x9c3b3003, 0x4e9ac79c, +0x8be469e1, 0x64111a88, 0x265d7b21, 0xde93f751, +0x4e2050a4, 0xa7d79c08, 0xeccd6553, 0x75619d71, +0xfe982494, 0x4fa2f243, 0x166f7015, 0x7db76a2c, +0x0832a935, 0xbd967ff7, 0xa908724a, 0x392fbeaa, +0x64108b97, 0x0539c65e, 0x3b6f26a2, 0x92eb0d48, +0x720914cd, 0x4ca6486e, 0xb274acd7, 0xfe19bd38, +0xa40ae91f, 0x2aba2b01, 0xdf2fada7, 0x5960bba7, +0x06473cf5, 0x55a3a150, 0x06fb5eb7, 0x72901380, +0xf868eab5, 0xf9324b56, 0x0df3d887, 0xcd94a107, +0x773b7545, 0x3675fb0e, 0xba884359, 0xbfe0250e, +0x8ddc125e, 0x1f177467, 0x73fd4a4c, 0x3bb2d4ea, +0x9101fc78, 0x35477604, 0x61141387, 0x79e44cb4, +0x0272093d, 0x45e916f4, 0x9d06f5f6, 0x20682b26, +0x60f877b4, 0xc3fa25cf, 0x9db61d8d, 0x1b49af8a, +0xd623c4ed, 0x55623ff0, 0x6ef4d78e, 0xe482ddc0, +0xd3500f1f, 0xfa7ed79d, 0x9aed7258, 0x6f856c74, +0xfa4c7b62, 0x15f7c113, 0x8948fe2a, 0x40c4745b, +0x38ef9301, 0xe9a0d7db, 0x38abc988, 0xee8e94f9, +0x6df8453c, 0x2f095383, 0x9c102a51, 0xb1faa962, +0x7f09fd6d, 0x3ae0a020, 0xa7a30c8c, 0x28c58339, +0x6550ae39, 0xd65ce5f2, 0x7f618152, 0x32d91963, +0xb694b890, 0xc7d54821, 0xc4a32cea, 0xbcf6df28, +0x0e84e7b6, 0x80d37757, 0xa87d4a39, 0x2a136845, +0x6b4fc380, 0x534fe27d, 0x79b69696, 0xdbffccc0, +0xb32e908a, 0xc87e4e4b, 0x325c2d76, 0x4e18cc11, +0x3daed957, 0xd568461d, 0xf605d1be, 0xeb96b221, +0xdc8efe67, 0x35039b61, 0x92d9e355, 0x6b6c6e96, +0x1eeb4a41, 0x0bed14ce, 0x4107eed0, 0xc4dd9c9f, +0x72b1bf6c, 0xfea4c4aa, 0xc02b4421, 0x63a41c17, +0x4abaaab6, 0xb4808bc2, 0xd3b5e7e0, 0xd5bfa9c9, +0x66f141b7, 0x5f84191f, 0x1f67c563, 0xa30ec409, +0xf506b5c8, 0xbda560e2, 0xf2b94ce1, 0x85211dc3, +0x54b1cc32, 0x6657ada1, 0xff0c3ee0, 0x5c0746ea, +0x33bc2add, 0xc39a7f7e, 0xd985aab2, 0x9a433594, +0x8973cb53, 0xc21a12f8, 0x63ab735e, 0x15a535d7, +0xf664efdf, 0xb5c30af2, 0x9b076c42, 0x72cc8ed5, +0x2d9c35f2, 0xfcc2dfeb, 0x98686cad, 0x5a072110, +0xdadd31c5, 0xe4bbff27, 0x6471c3e7, 0xbb98bedd, +0x61787352, 0x47f104db, 0x92acbe47, 0xddeaca48, +0xb1baa422, 0xd2003f0c, 0x934c8332, 0xa13bd139, +0x0a53f050, 0x28b9e29a, 0xf2805626, 0xff72ceca, +0x2a9fff32, 0x64a1c61d, 0x15b46d88, 0x7d691a3a, +0x207eab86, 0xc6135eff, 0x75492f20, 0xd3b52545, +0x0c2e9fe8, 0x5485d9ef, 0x1e8ab4be, 0x27d05867, +0x131c267c, 0xe8cd4671, 0x401948f4, 0x5b0828ba, +0x4ccc4bba, 0x4b4700c6, 0xcf3b8644, 0x9a918fbf, +0xdb98e32d, 0x97596448, 0x0099a549, 0xce39add0, +0x75389738, 0xf3bcd5d8, 0x248d5d98, 0x303e6e02, +0x67babb7a, 0xe56329f1, 0xdf357cdc, 0xbdb7d37c, +0x12b7e3f6, 0x93e53741, 0xe5cc9521, 0x6babe88c, +0x91ad446a, 0xf18086cc, 0x07f8e7ac, 0x50ecd2a6, +0x99e61646, 0x4d4e38c6, 0x261c631c, 0x2c400ebb, +0x30557dac, 0x39d4f0be, 0x382ef33b, 0x24a6ebba, +0x2598dd33, 0x6e845989, 0x048e7903, 0x54a89db7, +0xd9f152cf, 0x36ca3c0e, 0xac795a57, 0x54f2f4e5, +0x84c0c8a9, 0x383fc1c5, 0x854dc524, 0x38f965c4, +0xaf0e677d, 0x1815b8ca, 0x3453f1a6, 0x8b64b707, +0x01c98d2f, 0x96c23c92, 0x869e3c9b, 0x1143a985, +0xc842d306, 0xada14f62, 0xce22a7ec, 0xbc33513a, +0x5d0d789c, 0xe7937c9e, 0x447b7527, 0xba9ba3c8, +0x3352712b, 0x8ff63bae, 0xdc56f11e, 0x5e2496c1, +0xd92fa227, 0xb8c69ba0, 0x74433f43, 0x2cfeab35, +0xe49b3e9e, 0xc544b469, 0xaf18996f, 0x026908ca, +0x60344cc4, 0x73e4b024, 0x73437e57, 0x7132f5e1, +0x5724337f, 0x677506e6, 0x0950399d, 0x4ece3b52, +0x32add7e1, 0x055d8162, 0xa39f67e6, 0x3348899f, +0x7278f636, 0x675ffd16, 0x9d2d33b8, 0x5d9c515f, +0x19daf00e, 0xcf66b1ff, 0x30f1727a, 0xc7df633a, +0x83eba3a8, 0x8910fc86, 0xc6d76ba4, 0x826041a6, +0xda6b8432, 0x51ffaf2b, 0xc07d915c, 0xb6f95bc0, +0x9cdbb6d6, 0x8e6ebeab, 0x333ff03d, 0x79f2c99d, +0x18a4c0a8, 0xfbd34b9f, 0xab5fa858, 0xabb1d966, +0xd472f56c, 0x847faedf, 0x22a91bec, 0xb1045a74, +0xd09a6fe4, 0x23a4e880, 0x741ea413, 0x9ddde4a7, +0x81663975, 0xeea1250d, 0x48f55c5c, 0x2fa3f17b, +0x572bd3cb, 0xcc83348b, 0xf99bcc06, 0xa59ea87f, +0xd7d6d37a, 0xdf746837, 0x654f2a82, 0x451e5ca6, +0x408ffca5, 0xd2a3434b, 0xe120e977, 0x1080f88c, +0x8811bec9, 0xf8baec4f, 0x6de14a7a, 0x81d98d10, +0x1ef5b3da, 0x82b84aaf, 0x9ff60b97, 0xfa308331, +0x287daf66, 0x73818874, 0x5fc72450, 0x46b3288a, +0x469c6728, 0xe3f856d9, 0x7b7d15c3, 0x3a3db8de, +0x53caa8ee, 0x39796010, 0x1282d8bc, 0x26a6faae, +0xe5eb7bfc, 0xba970e07, 0x5ce7222d, 0x836fcc6f, +0x47552daf, 0xe6b96c1a, 0xbce8c8bf, 0x41d5c842, +0x27b549c6, 0xf275da2e, 0x17f0a253, 0x82a19aac, +0xcd9bd725, 0x35dc5f28, 0x32848ecf, 0xf9253975, +0x4510ff5d, 0xc204cae5, 0xb5ace948, 0x58f70df8, +0xe3ccf2dd, 0x15de06f3, 0x210518f8, 0x416cd1f5, +0xc2265501, 0xcfe45c4d, 0x46a4adf2, 0xfe3366c5, +0xc38df9ca, 0x8f7cf525, 0xa5befbb0, 0x9a1cc142, +0x3c3213af, 0x357c661c, 0x688ffc94, 0x5e255280, +0x81b832dc, 0x6a929938, 0x2843a2ef, 0x2738d966, +0xbe7d4e68, 0x0ea0da50, 0x9e367677, 0x15869b6d, +0x6a8bf8f0, 0x8cb5ab04, 0x178a3bb4, 0x6a489016, +0x5641e16c, 0xefd83a04, 0x0254ab14, 0x793d023b, +0x21bf097d, 0xe5dafa58, 0x0120d4ef, 0x254985cb, +0xa2cee1bd, 0xdf76a90a, 0xe8b575da, 0x28f7ce7d, +0xd9a69ee5, 0xce14ea48, 0xb3eacfd4, 0x483fb10c, +0xecf0cc45, 0x76f5497e, 0x612ff242, 0x0f4ce06c, +0x05f7a80a, 0x3ea82992, 0x271498c8, 0xd487bdda, +0x4e7145a3, 0x43c3c48b, 0x394e6842, 0x9f238f96, +0x78b48d77, 0xa58db9e7, 0x7f15a293, 0xfe6e09f4, +0xd78219b4, 0x79009bb8, 0x9b5d6a24, 0x6581ec99, +0xa6362565, 0x059abf42, 0x807f1b28, 0xc9502be6, +0xec335b9a, 0xb6780ec3, 0x8774b89f, 0x51385d66, +0xbd3b2ef7, 0xc2855f62, 0x6b7e2c2f, 0x61462296, +0x842b32ed, 0xf3a9e021, 0xa243fb0b, 0x562ee25b, +0x1541d636, 0x6392c8d7, 0xb78ebae5, 0x5af7f6ac, +0xccb007aa, 0xb5d5d133, 0xe4ae76b0, 0xbae67706, +0x0609ae4d, 0xd06d1d82, 0x8954cae7, 0x683b54a4, +0x775db847, 0xb6161b3e, 0x2248aa92, 0x730eb89f, +0x30584613, 0xd5d586c9, 0x66263b92, 0xa90de2ef, +0x62e7bf9d, 0xc5a3d9a8, 0x4fff043a, 0xb6d68f63, +0xd3c0ead3, 0x8ee93ff7, 0x6a5742f9, 0xa05f2192, +0xbea5c212, 0x81464c92, 0x4e06369d, 0x39ef7135, +0xa0d37406, 0xcf637a52, 0x07635149, 0x6c19041c, +0x1561428a, 0x5ef6162f, 0x1f619a76, 0xaaf7eaf8, +0x68e8891f, 0xd67d5bb2, 0x612d521c, 0x2831d562, +0x322a194a, 0xc6e1b8f7, 0xc989a3c3, 0xec4a0d93, +0x31c8d0ea, 0x7e7ee329, 0xa5669eb6, 0xe4ef524e, +0xedf044cc, 0x224acd19, 0xd092f9ac, 0x25ca9a14, +0xdfb6590b, 0xec5c6975, 0xbd5af94a, 0x21b903ab, +0x2f5eeede, 0x39cea920, 0x33859ef0, 0xcd741a38, +0x83c1e9fe, 0x5b1ebe88, 0xe41b0ff4, 0xc959c601, +0x83ccde42, 0xd2c068d8, 0xcb982dd0, 0x16c75cce, +0xd4c872a5, 0xa0614d0b, 0x144c89cd, 0x9893b7f9, +0xa6a55d1b, 0x8c0004c7, 0x07bba402, 0x0b227a73, +0xfa1f8b32, 0xfdf455e4, 0x7d01ceb2, 0x62365188, +0x001e8e8f, 0x8e438632, 0x01c776b1, 0x80e1fb9e, +0xcaf6a34a, 0xe5c0bb3a, 0x954a4da2, 0xe42c9fb3, +0x8149e997, 0x4dba6722, 0xd49ba02d, 0x8a3f7ff6, +0xb26bcdf8, 0x16232861, 0x90ce9c28, 0x4b6b1988, +0xf45fde12, 0x58bf7536, 0x15915f4d, 0x2424f729, +0x483d43ce, 0x7a593f58, 0xa475394f, 0x04aa58c6, +0xb954bb35, 0x2e628cc5, 0x79b9d726, 0xea5f2966, +0x04ff5455, 0x3dcafdda, 0xbb05013f, 0x719d1824, +0x07c7f7d3, 0xa5a0400d, 0x41dbf191, 0x180c91f6, +0xc7f35e99, 0xdc27a8d8, 0x9414543b, 0x1766a6c1, +0xc1316646, 0x8a691aaa, 0xa9e3101c, 0x3a58eaf4, +0x7127666b, 0xa75be8c4, 0xd897eb0e, 0xbe4e9230, +0xc673ba94, 0xaa6d7148, 0x305696f2, 0x9972c910, +0x047056d3, 0x7a639f8a, 0xae975f0f, 0xeda19d94, +0x6288593f, 0x532a32ce, 0x1d30cd3c, 0x0ef67e86, +0x9891753e, 0x61e98495, 0x010318d0, 0xc198df9e, +0x9892182a, 0x4340af0e, 0x0994054b, 0x42dde903, +0x89b68aab, 0x90903eef, 0xb4b39356, 0x81c18df6, +0xaaa21941, 0x1f284ff0, 0x70fd0f7e, 0x56e12ade, +0x490801a2, 0xae7e79f0, 0x6da55d5b, 0x21d13d46, +0x76a68958, 0xf73a3696, 0x0aca6ecc, 0x1e88b6dc, +0x0de13a13, 0xf0331c37, 0xd3d4928f, 0xc0f3071d, +0x7ccf6011, 0xbcfef9c2, 0x879cbb61, 0x24dd21c1, +0x85bfd290, 0x71d2a010, 0x3d3eb664, 0x8b32fb07, +0xd52d3ac1, 0x79ee96f8, 0x1baa91a0, 0xc8dd006b, +0x13182ca0, 0x629e5d1c, 0x8405125c, 0xe387f699, +0xf6bd5726, 0xa3f50303, 0xa5ebb79d, 0x22ff0c16, +0x9ca73285, 0x647626b2, 0xecc1bc1a, 0x18d56873, +0xfed64203, 0xcd4c59ad, 0xdfe54c72, 0x3ad0a41e, +0x4103c18a, 0xc60516a2, 0x6fe48e36, 0xb00e12c3, +0x17370419, 0x1c04c263, 0xa8836a1a, 0x902e1df0, +0x35569071, 0x3fcbbd86, 0x0a6c9399, 0x3025e41f, +0xe045368b, 0x8981a2f8, 0xa13d0cb7, 0x0ce370a5, +0x7551d6cc, 0x6b7eaca0, 0x5c4786a5, 0x8d40c59f, +0x07b4136c, 0x16335de6, 0xcada5818, 0x0f6eb289, +0x3d848d4f, 0x38164081, 0xd10a5866, 0x26f29393, +0x028bce88, 0xc6f366cf, 0x01c02a2a, 0x4f76e408, +0xc50f4622, 0xf49e7654, 0xb77fc4d0, 0xaa2daa09, +0x7a9389e4, 0xa5e8cdc6, 0x308b79b2, 0x4bf07f85, +0xb569588c, 0x6923ee1f, 0x406f0f20, 0x22ddab96, +0x432ff769, 0x4ed474fd, 0x1e9f4d48, 0x0b197342, +0x83aa1aa8, 0x291f1a1a, 0x42c1b562, 0xec317cab, +0x5a7eb2d2, 0x9987ef90, 0x4c5319c6, 0x362e1289, +0x1abb4113, 0x423a4199, 0x0dc84a78, 0x28cef4ae, +0x43f68a34, 0x023dd600, 0xa9ccb767, 0xf7fc5d21, +0x2f4f170c, 0x0309eba5, 0x4a7b373b, 0xcc77d81d, +0x9e19ad6d, 0x2a9142d8, 0x03c68597, 0xce9eb30a, +0x605b306b, 0x3cea5d2d, 0x227ae687, 0x00bd0cea, +0xeb770bc6, 0xf214831b, 0x061676ea, 0x2c705f57, +0x32f58afc, 0x00033b1a, 0x42707052, 0xb962a3e4, +0x45ba3b11, 0xd170d334, 0x0f4bf100, 0x6299f494, +0xc0ec4cab, 0x8d66e82d, 0x9d0aa5f7, 0x3b9fd00f, +0x29e402bd, 0x70a4c1af, 0xe335f520, 0x0be0b62e, +0x30910f74, 0x871f1ca6, 0xc6acd99e, 0xc48e0c48, +0x8b516259, 0xa3ac0873, 0x40e30c20, 0x47638905, +0x0f503663, 0xc0cc4802, 0x1ad733df, 0xe97326e2, +0xf97e21ed, 0x14335882, 0x7a8aee61, 0x19044349, +0xfe18cfc3, 0xf2ec13a9, 0x556d3e7c, 0x06877d77, +0x120f11d3, 0x18548953, 0xc2148652, 0x81163e83, +0xe39e58fd, 0xf91ec6e5, 0x1754a075, 0x05908f4c, +0x4bb5dbb5, 0x6fc30543, 0x61410f76, 0x24821ef4, +0xf03a53b2, 0xcb92c41f, 0x32780356, 0x51194075, +0x5e58c002, 0x66c3adbe, 0xe6364f0c, 0x6a7774a6, +0x0eb7eefa, 0xcc0a77db, 0xc3c03dc3, 0x115ce8a2, +0x9f8cdf6d, 0x1cfc1006, 0x34328bd9, 0xb92487c5, +0xec1b9935, 0x400e17c7, 0x2d523a5a, 0x2d0516a8, +0xff0dc7bf, 0x73394159, 0x9a0e3975, 0x579732d1, +0x945d2362, 0x95774278, 0xd9dff40a, 0x70b0a41c, +0xf435d6ca, 0xeebb8f92, 0xa40f3178, 0xb1bd4095, +0xbd4514cf, 0x308177e4, 0x7de10f90, 0x74579a52, +0xc818ce0f, 0x8a08dc3b, 0xb083bcac, 0x017b42e3, +0x7bae8d34, 0x3ed00cf3, 0xd1eb6af3, 0x98262788, +0xcfe4de05, 0xdc9b5136, 0x349a90d0, 0xc7db3fc5, +0xcddd9963, 0x763fad40, 0xbd1c92d2, 0x63375307, +0xc4e3d446, 0x84a2777a, 0x9849c7fd, 0xc1f5b8ba, +0xc464dff7, 0x6161c7a9, 0x2ffde421, 0xace1bc52, +0xdcf593f9, 0x82dd587b, 0x3d4d48e9, 0xc5fbe7d7, +0x9ad637ac, 0x2981e689, 0xd76d6681, 0x0cc6bf8a, +0x342155be, 0xe0e75291, 0xad67d025, 0xe6b79f76, +0x21ea40f6, 0xd80481ce, 0xb4cddbb1, 0xda982803, +0xef8d225f, 0xc50d523b, 0xbd0c2e63, 0xa47f3062, +0xaea8f322, 0xc9d7a3f9, 0x08d3b183, 0x7e18521c, +0x665cc414, 0x41c6fad0, 0xbd42a791, 0x81c217a5, +0x8c5251c1, 0x11f1f4d9, 0xd2a56761, 0x435c95ef, +0xd060a3c2, 0xc2dcfe06, 0xe43afb4a, 0x51e18104, +0x33a8ed25, 0xb109f7d0, 0xbe1f97b1, 0x6032481c, +0x881c03a5, 0x9f5c74e2, 0xe28ea4b1, 0x2689f794, +0x5c7ddee1, 0xed6b8e8c, 0x7d3d7aee, 0xfd26dc8a, +0xd84f7472, 0xeb5542dc, 0xf2b9eee3, 0xa284df1c, +0xfdb24726, 0x887514f8, 0x31145808, 0x1b41ca73, +0x20b56128, 0x504675a1, 0x45590f66, 0x69054020, +0x4356b18f, 0xff63e1b4, 0xa5abe700, 0xc9415f64, +0x6fc4baa5, 0xc40faceb, 0xeeb98799, 0xe62fac67, +0xbda750bc, 0x98a273b8, 0xd71703ca, 0xe6bff735, +0x4ef25298, 0x9a87ff54, 0xfef63549, 0x02d83509, +0x84b38ef8, 0xc89cd191, 0xb0b2dce7, 0xd0370709, +0xa2bacc1a, 0x3acecdb0, 0x97731182, 0x46294a67, +0x73b077c5, 0x5c0a160e, 0xb2aa90c4, 0x13d3c40b, +0x95007a16, 0x9d80951a, 0xd90953c7, 0x5e0a7367, +0x5df90d83, 0xc9e1ffb6, 0xfa7a85eb, 0x32539875, +0x91f6b9e6, 0x70cd44b8, 0xafca3f0b, 0x4744d208, +0xfc9e8bd7, 0xdb5e594c, 0x73f04f32, 0x95a6ea64, +0xc0bfa7f7, 0x8aed70f5, 0xa8100034, 0xd981e0f5, +0x9756ac3f, 0xef58f2aa, 0x512427cf, 0xeffecf63, +0x366beff0, 0xad8e72ed, 0xb9250a8b, 0xa3236370, +0x1eab4a6e, 0x8cbfb5e1, 0x48d0fee4, 0xa6275b54, +0x386a6a3d, 0xdb38c45a, 0x25c58ca5, 0x43083e40, +0xb798accd, 0x336137d5, 0x6993f8b0, 0x1acab41f, +0xb14f512d, 0xd2ea59cc, 0xf24c4f55, 0x7997b69f, +0xd9b57dd1, 0x0c97cc4e, 0x4a788660, 0x32d00a83, +0x684726d9, 0xd9023bd3, 0x68dc8057, 0xbda21dfb, +0x2bb86b86, 0xc117ede9, 0x635d49e0, 0x2b24d2eb, +0xa863992f, 0x5f7e2758, 0x2c2ffc6e, 0x12484b9b, +0x9c32666f, 0x0cf8ad95, 0x4b4315cf, 0xed87fd6e, +0x936396a1, 0x94000934, 0xf11f81ab, 0xeed90980, +0xae8bfe3b, 0x4c533652, 0xe7bd7fae, 0x16f4af50, +0xec13f599, 0x967a6b9b, 0xdba2bd75, 0xe1ab178a, +0x418a33d6, 0x6d46b5e4, 0x81a42881, 0x7f8fc36b, +0x9285c321, 0x4777c7c7, 0x0339a171, 0x03e2e45f, +0x53c2b510, 0xb7535822, 0xed2feb7e, 0x0ee29371, +0x16763bcd, 0x134720b0, 0x4d28f3a2, 0xe8c02570, +0xfa5a7ca9, 0x9d3270d9, 0xa0e243bb, 0x155fc54a, +0x1ff416d3, 0x867082d6, 0x54976c7c, 0x89c8368e, +0xf37c863a, 0xa3a10cf3, 0x1b1bce3f, 0x3927ddcc, +0x942cc944, 0x75b80a24, 0x3275fce0, 0xd21a37b8, +0x628ea322, 0x119f2c54, 0xa186425c, 0xf929709b, +0x3fc6cb82, 0x60adf7ef, 0x3650a4f9, 0x40cbf952, +0x98216739, 0x93536880, 0x67a3b014, 0xed3937a5, +0xfac0d506, 0x907ea90a, 0xba708e0c, 0xd97bca19, +0x963a9aee, 0xaf16ed8d, 0xd92aa44d, 0x7dd65ba4, +0xfc0ec940, 0x8bb7a1ae, 0xe31f55ad, 0xa849cef9, +0xd3322e20, 0x9ea8abb4, 0x7d54a2a5, 0xb16a7d31, +0x825fb59f, 0x78990926, 0xa942c46f, 0xc2c52a3d, +0xef6d6428, 0x3a176364, 0x912a2b02, 0x71d64c9e, +0x9f239fdf, 0x900557fe, 0x6a40aa63, 0x4765ade4, +0xfb5783ee, 0xf0ec9eac, 0xf872503f, 0xfe39e539, +0x7646a63f, 0xb97d5016, 0xe1ea549c, 0x54165ceb, +0x37120967, 0x607e7e9f, 0x6237c0d2, 0x91904eef, +0xf4609089, 0xbc92bd36, 0x4d5321f9, 0x65530cb7, +0xa1a82019, 0xc0261dec, 0xeda45298, 0x4983de02, +0xd6fc24ef, 0x05695092, 0x76da24a6, 0x48c0dc47, +0xe1dbee6b, 0x37d89c68, 0x5fcedb9e, 0xd02070e4, +0x5a958218, 0xb558c7ab, 0xaaef15e5, 0x8b66ce25, +0x41633dad, 0xae48db67, 0x10577481, 0x35a659ca, +0x34586a37, 0x64159b97, 0xe51ff4cf, 0xde9f25d2, +0x0f9b9fae, 0x949bb1e1, 0xdffa73d0, 0x4cf46cea, +0x758aafe0, 0x9f967973, 0xf7bc14a2, 0x36b4b278, +0x725c4ac2, 0x2a2f7ca5, 0x7877f212, 0xc9e31e08, +0x5a50cdca, 0xb5a8c0e4, 0x72e9a76e, 0x0877aa5a, +0x247d44fc, 0xb4a24225, 0xfac33e36, 0xeeb3bcf8, +0x5087f5db, 0xc3d3d6f7, 0x71fbf2e7, 0x53713e6c, +0xa8c549d8, 0xa0144279, 0x18bee63b, 0x158c6a42, +0xdb356d9e, 0xb85d8648, 0x138e100b, 0x914dfa59, +0x0e8c2982, 0x528cc080, 0x75805354, 0x614c8069, +0x6857079c, 0x24041b9d, 0xd1eca8b6, 0xda897ca0, +0x658fedb6, 0x6332f11a, 0x13b759f8, 0xc6b27dc2, +0x6238ae5f, 0xc83c8116, 0x70cbbd45, 0x98263fbb, +0x83d7329a, 0x336011d2, 0xb311739b, 0xb26c4d37, +0x68d1ca46, 0xb1190f09, 0xc516c148, 0xf0a39f50, +0xdb0fa4b4, 0x37a78b45, 0xc3672e4e, 0x87e88921, +0x7300fd6c, 0xf5c61a27, 0x1600cdec, 0x57667530, +0xb5f715ea, 0x2b015743, 0x9461541d, 0x77df5559, +0x998f7e4d, 0x9f38916b, 0x07facc62, 0xf0b72c54, +0x731f6271, 0x236716ed, 0xb2df24a7, 0x3ba8bd0f, +0x42112bc6, 0x842f52c4, 0xb5b19e2f, 0x05032b47, +0x4115f355, 0x4d6478c2, 0x42642b41, 0x3362accf, +0xb029b6d3, 0x18a32fc6, 0xe6958269, 0xe32b913e, +0xa03f39ba, 0xece0bd2f, 0xd112f93b, 0x3dd500b2, +0xfe40601e, 0xdb17b7ee, 0xb0998d30, 0x41207210, +0x019cc506, 0x8028f18a, 0x0b76393f, 0xb2c6d9b6, +0x501e155f, 0x25e7c843, 0x1ff71529, 0x626272fd, +0xd6c562d4, 0xe8972e26, 0x2dbe5865, 0xd4717a81, +0x2020a1a5, 0x6609d3d5, 0x395c2f83, 0x1adc33e8, +0x10aefe54, 0x2a60f6f5, 0x3c939a05, 0xa5a498a2, +0x4f194d1c, 0x5f1f2f20, 0x846794f8, 0x420746f9, +0xe8203cde, 0x3b97a39c, 0x3b37b0b4, 0x61b76676, +0xdee8f0e7, 0x99d3d3ce, 0xee56e0ac, 0xa463614b, +0x8f79e3a6, 0x313aca85, 0xa9690fed, 0x0fbc3325, +0x1d532abc, 0x4c2a3d4b, 0x8f112e0b, 0x68805f2a, +0x7d30188c, 0x0599fcd4, 0x6a8fc726, 0xe364d20d, +0x0cefd583, 0x9bbd6029, 0x5dbab7f9, 0x9998d816, +0x31cd57f2, 0x78a358b2, 0x6598fae5, 0xa83330e9, +0x0659f9f8, 0x2a7aa7ca, 0x150120f3, 0x04de1735, +0x7c522690, 0x6725b323, 0x0b400f97, 0x05b2d775, +0xc6455634, 0xb16c897d, 0xd754a2f1, 0x48dc0ca3, +0x16c899a8, 0x49835895, 0x93d26917, 0x28b99551, +0x258523f2, 0x0805da3f, 0xa72bd53c, 0x40352553, +0x1cc9f556, 0xf7d9ab2f, 0xbb9ebfc6, 0x00edf6e7, +0x1a6b078c, 0xccb55605, 0x58205939, 0x68040bfc, +0x06606f63, 0xb7d303a7, 0xd2b14e96, 0x625b29c0, +0x4350002b, 0x004729c9, 0xdbd9db42, 0x909087e3, +0x0987de20, 0x2aab688c, 0x30e1ab12, 0x78df8856, +0x43adec5d, 0xd17d6090, 0x40e74112, 0x2fa63a2a, +0xa5f64f08, 0x2bcc13db, 0x265e3552, 0x7f7c3134, +0x7a90de85, 0xe7e7380f, 0x0040f327, 0x631e7df8, +0xbece702b, 0x838327b4, 0xd17455c1, 0x39b3f4ad, +0xccda2ebf, 0x24cde995, 0xe4c8167d, 0xd4e75936, +0x89ec4fbd, 0x7453092d, 0x3caf28f1, 0x24933ea8, +0xbb4e8492, 0xb5cc1965, 0xbbbfbcf8, 0xd5b25a90, +0xb9004799, 0x89f0c0a0, 0xa94a5f84, 0xa1b3cff9, +0x7546662c, 0xe7762da4, 0x0da2edcb, 0x99dcadc3, +0x465c5203, 0x7524fe88, 0x1481e000, 0xf24f4ac3, +0x11d006c0, 0x1330c08c, 0x90628008, 0x3635ebe8, +0x19d334fd, 0xfc2db733, 0x380860c2, 0x1a4f00ca, +0x15431a3f, 0x9d022bcc, 0x1bf54400, 0x661875c1, +0xebbfc9d8, 0x8c6afc42, 0xf904e97f, 0x804cc692, +0x4e31bdee, 0xc7b2b02d, 0x5a0eb761, 0x1b2e733b, +0xc76f51db, 0x7580f529, 0x8b7c2186, 0x897285fa, +0xc38df5e3, 0x7b887fd4, 0x4b6f05b5, 0x11c4ef7c, +0x5571eae3, 0x7f9217b6, 0x7eefd80f, 0x74b3566e, +0x63e60fdb, 0x446e17ea, 0xf0af2a36, 0x9e80b268, +0x03c6178b, 0xa68e2d4c, 0x05dcc3e1, 0x7c3dcb02, +0x685d680c, 0xae925e6f, 0x88e0127b, 0x8609203a, +0x71490ccc, 0xe6d814aa, 0x9f9c82e6, 0xf030e9bb, +0x8d562484, 0x6d671daf, 0xe5ce8565, 0x5ba3902f, +0x8242b602, 0xf85cb369, 0x44df5676, 0xfc5825e8, +0x8bd23407, 0x38ab1fe1, 0x67aee59f, 0x0ea9d0c4, +0x6585259a, 0x2eae7533, 0x529e05b6, 0x536f530e, +0x0d25f730, 0x67861bc2, 0x7600c586, 0xb619059f, +0x64fcb6cf, 0xe6ca49c2, 0x1b436767, 0x8a175973, +0x433b329e, 0x2548cb6b, 0x01e66227, 0x94a3a8f0, +0x5dbd70e7, 0xbc92aac1, 0xc434e06c, 0x8a22e875, +0x50b3ea7f, 0x1e45a5ec, 0x0b6e247a, 0xa00cbfea, +0xf51053d7, 0xf5018c5d, 0x39131147, 0xfd255ab1, +0x047b5580, 0xfbb69159, 0x2f2880ed, 0xcbc56105, +0xb9f260a2, 0xdb024de4, 0xb6a5b66a, 0xde7f0ab3, +0x11946311, 0xabc3b4b9, 0x90c412a1, 0xc10be39b, +0xc78700d7, 0x507b6829, 0x82033056, 0x9cd4805b, +0xe3a9e178, 0x88384d4a, 0x47189250, 0x7eb2fc9b, +0xca24f83a, 0x512d9252, 0xd7fb70bd, 0x2e17a9ce, +0xc11413db, 0x78291023, 0x8a7c2fcb, 0xe93477f9, +0xe7af44e4, 0xf67bb16e, 0x1c47d11c, 0x5b78b3fe, +0xc7cebed6, 0x986755de, 0x195b828e, 0xbaba25bc, +0x7c2fa0f3, 0x59d437c3, 0x4ad6e0ab, 0xd08e4342, +0x342e7258, 0x247db19d, 0x73e468e9, 0xd54ad7fd, +0x6a7d9b43, 0x4d6283c6, 0x82a04531, 0xb4101cf5, +0xbd38f543, 0x790508ef, 0xf7d5d0f2, 0xc07b3f7c, +0xeebe70a9, 0x6d772fcd, 0xe0d53be9, 0x9f9a795f, +0xa2371c3a, 0x04a89ce8, 0xcb8f94cd, 0x9f91fec0, +0x0cbe830a, 0xeb5b6a17, 0xe966fb53, 0xca8d48e8, +0x36de5e12, 0x5e8e2db5, 0x686c0816, 0x1a28b54f, +0x1f3468d1, 0x138f6fa0, 0x66b95a5e, 0xef3dfc2d, +0xe635a0a9, 0x843d4a5a, 0x52d8aad7, 0xa059cbf8, +0x380bb651, 0x4b5a9561, 0x5195d65d, 0x91c59a57, +0xdf043c36, 0x092b1547, 0x67ba8504, 0xda451e4f, +0x1047614c, 0x4a5c9ff9, 0x7361c7c5, 0xb588dd39, +0x401bad18, 0x77938dee, 0x5303a303, 0xbfd6024f, +0xff6c5735, 0xb183a3f5, 0x5dda5aae, 0x4bf647b9, +0xd6dc95f1, 0x062d7822, 0x81c5628c, 0x0d6b4dbf, +0xb1ff1bea, 0x925d7cfc, 0xe614a16e, 0xcf788541, +0x38a2850d, 0x4527db66, 0xd022188b, 0xbc3b69d4, +0x9e3a4a98, 0x7914b1ee, 0xc4c4176b, 0x6657a55d, +0x060af607, 0xf9faa697, 0xc4445785, 0x75832309, +0x55e7c659, 0xf1fdaebc, 0x2d9d9672, 0x368e2550, +0xa6311fe7, 0x7241bc3f, 0x13a6467c, 0xd74ba65c, +0x6c3bbcf3, 0x6211c9d0, 0x67236e6e, 0xf316c3dd, +0xe0d2ff08, 0x17b82387, 0x9cd864ac, 0x8b6b11eb, +0xb7a46782, 0x862bcc69, 0x1b2e466b, 0x16d04fae, +0x4c0e5023, 0x1c2a280b, 0xdfa53d3d, 0x0a4c734c, +0x4640bd52, 0xc4761876, 0xc15b8adb, 0x43b643ce, +0x6e3f9f0b, 0x9c27d71b, 0x73f7159f, 0xc9690ea9, +0x5cd1b43f, 0x4a05f7b9, 0x142002ee, 0x991ae1fe, +0xa3e010d1, 0x8376e41d, 0x9cb6725d, 0xee0039af, +0xa88fc591, 0x7b29e4b0, 0x25c5bcd1, 0x586b09f7, +0x160d783f, 0xc8490b6e, 0xaeefab1f, 0x153579e6, +0x9b6bbc71, 0xdf74c783, 0x4d89d74f, 0xfa980d8b, +0x51e84a88, 0xfb1f4f2e, 0x26cbc6ac, 0x94516296, +0x03ed186d, 0x2626ad8e, 0xc2425a4c, 0xfd1a95f0, +0xb76329e5, 0x10f29dfd, 0xce9be355, 0xb726398c, +0x5c2cc790, 0xccc5dde6, 0xcde701de, 0xb11cfb99, +0xb6be1a0d, 0x117e3eec, 0x01724d68, 0xbbdda00a, +0x5cb034e7, 0x2fe2be86, 0x4180056d, 0xd4fc8a3d, +0xdce7dfdb, 0x892689b8, 0xbd04765a, 0x018633f9, +0x8f86af7d, 0xb05fe5b4, 0x4f32bdab, 0x593d9017, +0x473764c2, 0x9b55d650, 0xbc41d13a, 0x77ad0741, +0xd41100c2, 0xd6ae019f, 0x7dbde64e, 0x0fc6ed4c, +0xd3959711, 0x8013c424, 0x500f6866, 0x27191553, +0x5eabb9bf, 0xde9bd1a8, 0xe9d60721, 0xe4bd75ff, +0x13245d30, 0x4c47a02d, 0x38f874f7, 0xc031b82b, +0x8a458911, 0x645df7f7, 0xe99ce120, 0x922786c3, +0x979ec430, 0x2ed277bd, 0xd457d07e, 0x4f7ee3df, +0x30bedae7, 0x5422d610, 0x12be1925, 0xe1a03275, +0x4c10b26e, 0x9a4a7ea4, 0x57280c4b, 0xe92d4552, +0xd9045f17, 0xe2599e31, 0x974dfcd0, 0x8027af83, +0x2402877e, 0x62ba0998, 0x855da60f, 0x6f542e2a, +0x4ba0c13e, 0x69765738, 0x1059b21b, 0xdd0554cb, +0x53450161, 0x04daf9c5, 0x32c3cb87, 0x80b4494d, +0x9b2c798f, 0x4fb2f985, 0xa4482140, 0x9fffe6e2, +0x5ee069c0, 0x390d30ec, 0x7ea565bc, 0x8b3d2707, +0x3d5e5339, 0x1a4bed1a, 0x0bd8707c, 0xc9999b2e, +0xa33c9468, 0x525dfae7, 0xad6b7f35, 0xc042f1e2, +0xa471df59, 0xa8c814d3, 0xba988b4d, 0x2b07a004, +0xef693382, 0xff762ccf, 0xbf036828, 0xacbe12d1, +0x43a5ba1e, 0xd1e38691, 0x93e40465, 0xebd7e040, +0xb9227607, 0xddf2bf09, 0x17a12949, 0x1df3e013, +0xa1806c20, 0xf25d351b, 0x531b16e8, 0x5c0d43e6, +0x938d2f85, 0x870c6118, 0x91ae0793, 0x70f3404c, +0x5a47d175, 0xbba2a70c, 0xf47ade7f, 0x1df31acf, +0x6bfa5e3c, 0x4a6494cb, 0x33662533, 0x0f534dcd, +0x48a4f041, 0x3bd62a97, 0xadae0bb5, 0x3902b989, +0x964a0658, 0x24ea3b47, 0xee1b90c5, 0x66ba709b, +0xd07bda6b, 0x06072b03, 0xe8f7e5f0, 0x886a7284, +0x2c1c5d22, 0xdc98055e, 0x44981941, 0x0a9dcaef, +0x9ede1b66, 0x7ee2e22b, 0x77330d3e, 0x8a9af5b9, +0x6e59ad42, 0x3198d990, 0xb9c165c3, 0xc0a1fcb8, +0x82a11acd, 0x9d2d6a5d, 0x7c3d4a6d, 0x59714d40, +0x3cbf3cc2, 0x9959cac8, 0x9d188b8a, 0x31e9142f, +0x08b2a6f8, 0x83bfa230, 0x18ac5f64, 0x0f29429e, +0xa6409870, 0x642b5fc0, 0x37cf4e14, 0x7a55495c, +0x8bde7b3e, 0xefcd1a01, 0xa440abde, 0xd73dc0b3, +0xaf9904fb, 0x505a7f8d, 0x59d358ea, 0xe42e482f, +0x4d36ec2e, 0xd09d55da, 0x3c560a61, 0x36c1de88, +0x70dda8ea, 0x64bd395c, 0x2e2b5bd3, 0x4c92749b, +0xbdaa5e18, 0xff686092, 0x055b1b7d, 0x2bcc7b7a, +0x060da053, 0x9a94d74b, 0x57f113ce, 0x028d68bb, +0x25a0cfac, 0xb0c43a30, 0xdce50b8e, 0x644039f5, +0xdfa2001c, 0xc5fa886c, 0x93258a3f, 0xe47327e4, +0xf722d52d, 0xf01cc963, 0x12be313b, 0x3f4e9a4f, +0x39c45b14, 0xd8da3cf6, 0x8e0b2eff, 0x0ad22cdc, +0x28754b66, 0x854bb92a, 0xcbbc4794, 0xe25db296, +0xc75d9409, 0xb69a2a96, 0x72c2172e, 0x8b0b2fac, +0xd00bdc0c, 0x78d0178c, 0xf00f16ff, 0xc0adbfc4, +0x4ac9cbbc, 0x776a44da, 0x9bc7acee, 0x4d1a0386, +0xfc3eb646, 0x1db91afe, 0xc26dd902, 0xa4441cca, +0x6b8df5a3, 0x3974f5a0, 0x7bea8f21, 0xe998f6f5, +0x9540b5fa, 0xb46c2aa9, 0x0e52fd0f, 0x25658d9f, +0xe4259d80, 0xc85388e5, 0x6bafa3e0, 0x6d93efd7, +0x273fff0c, 0x3989abbd, 0x1834e29b, 0xda629800, +0xe7af0baf, 0x48a3c4f7, 0xdbff8f99, 0xde15e2df, +0x33fa391a, 0x3ffa0ec8, 0x59700d7b, 0x6554fbb2, +0xc5f714e0, 0xeedec712, 0x3fc293c2, 0x569cfc12, +0xa542e13e, 0x9d44d26e, 0x324f965a, 0x9b90be99, +0x397db3d7, 0xa68d4050, 0x31c87852, 0xa7fc5395, +0x142815fd, 0x1b63c4b5, 0x677e4476, 0x10c7230c, +0xfa000265, 0xee37cb0c, 0xa8284b59, 0x66dcbaf9, +0x9b7099ca, 0x943f64d3, 0xb70784fc, 0x0f967a90, +0x0d6a9b74, 0x7fdda54b, 0x02365e7a, 0xaa94a1ce, +0x49f72ae1, 0x8bff97c4, 0xe9b0aa6a, 0x020a49a6, +0x6f0da33f, 0x6934d3b8, 0xbc3ed0d6, 0x3a4ffb86, +0xbf3d1940, 0x57f95e04, 0x038724b4, 0x6bf27689, +0x64484e60, 0x2074b88f, 0x8e2d81e9, 0x856891ca, +0xa3bc4164, 0x9543cc29, 0x0f55642e, 0xfad08b0f, +0x4711feb4, 0xcf588f9f, 0x4042e4e2, 0x27a9dc5c, +0x454d23a0, 0xbb124b4e, 0x7796d298, 0x7c39957b, +0xc3afd1d1, 0xbf3b1453, 0xb1109b67, 0x3f0ca0e5, +0x070ddea6, 0x0cb826f3, 0x99f62e56, 0x7ea0c3fc, +0xe2d81008, 0x15b58116, 0xd9451593, 0x6164d51e, +0xa4024db2, 0x54d77bd4, 0xeae87660, 0xd4a1aefd, +0x0650060a, 0xbbef7780, 0x58cd0acd, 0x26524f84, +0x2e29f7ab, 0xef932b19, 0x4eb2c213, 0x03711037, +0x2a5907f7, 0x8b804b07, 0x13e0bc06, 0xcb14adf2, +0x3e4a94c2, 0x9233205f, 0xc1dd05f2, 0xa4698dc8, +0x41e0e9b3, 0xd3cfea50, 0x7fb55e6f, 0x110edb7a, +0x08793b1e, 0xead0d257, 0xfc316b2a, 0xd4733a1f, +0x7ee6cf3e, 0x8fddd004, 0x98d3d8a4, 0x66e825bb, +0x944afbc1, 0xb9b1ce6f, 0xfeefcb2c, 0xc6d87773, +0x95954f12, 0xa36d819f, 0xd306e8a8, 0x84e7cdef, +0x95fe1c44, 0x96f90ca6, 0x344e1fb5, 0x3b140b85, +0x346ab3a3, 0x42d992a7, 0x6b9f803c, 0x68bd9593, +0x1f7f2e08, 0xe72c5a7d, 0xe507065d, 0xf770db6b, +0x1d4460f9, 0x268d67f5, 0x51a91f56, 0x1ae70686, +0x012e58d5, 0x9f67bfb4, 0xcadb77bf, 0xa4b65aa8, +0x5dd9d491, 0xf2a2ef89, 0xa47dd233, 0x9c3e47f4, +0x8a50bdb9, 0x113366b9, 0x20d28ee4, 0x1cb48c48, +0xcedcd9f8, 0x403ff288, 0x9c505492, 0xfa5b2412, +0x4a2d3d26, 0xefcc1a93, 0x72255fb1, 0x8672cd28, +0xa81bc984, 0x2d0b5cb8, 0x3840f74c, 0xafd455b3, +0xf3f5a4ba, 0x6521cf5f, 0xb65c72d9, 0xb2f81028, +0x936f2d6f, 0xe5c05b13, 0xfed6fc52, 0x4e054aa5, +0x6589e56b, 0x04df2091, 0xb58f6d85, 0x7a92a219, +0x827fc956, 0x5d376e32, 0x0aa885b0, 0x7eb8e9d2, +0xe40d61ea, 0xef3f1bf2, 0x0baa32c7, 0x00564df5, +0xbe61a0df, 0x3f255f31, 0x7ff8e827, 0x7cabd9cd, +0xcbf39620, 0xed07d2fc, 0xb0169c13, 0x1a2a8c23, +0x81e34ce0, 0x9c2c83de, 0x58100df8, 0xb47ac5c2, +0x1e2c1d7b, 0x64e6010d, 0x0802a90b, 0x7db678f4, +0x20e59a23, 0x2240686c, 0x203e3a34, 0x93a22374, +0x93b8f94a, 0x3ad0aec4, 0x397fd6db, 0x7a8007c6, +0x08589020, 0x1cbd45bb, 0x3f4ff79d, 0xf73785f1, +0x901219fc, 0x73a7d54f, 0x42d667de, 0x9cdb3ead, +0xaa3bb34a, 0x753e68b0, 0x642d56c9, 0x0f78c76f, +0x073276c7, 0x0a444a35, 0x23c22810, 0x7bd21532, +0x4c7285e6, 0xd507d459, 0x709bee38, 0x5a025ec2, +0xd42ab81d, 0xf10055bb, 0xb1358b89, 0xad6ab028, +0xcaec73b5, 0x97990be7, 0x00424df3, 0x095f60a8, +0xd14e86ef, 0xe92eba3d, 0x16c56546, 0x037b14f9, +0x25397409, 0x58b43fc7, 0xf5bfdf9c, 0x983e7a5e, +0xa8ff339c, 0x08538aaf, 0x539d6a07, 0x08a5fa17, +0x73ca62a6, 0xb27b2034, 0x857884d8, 0x7c642a5c, +0x31efadb9, 0xcfa3002c, 0x4f85a151, 0x26b0966c, +0x4cbfb2e3, 0xdf82ca61, 0xb86f8ca3, 0xdf63bf93, +0xf04ea187, 0xef06da9e, 0xea26a703, 0xee9fb1ab, +0x6f489763, 0x40a15dac, 0x262fd446, 0x03a2ad1d, +0xabf459cc, 0x3f2f6228, 0xb4b21829, 0xe25c4aee, +0x83974d6c, 0x26b6f1fe, 0xc480925d, 0x1891de28, +0x052035f1, 0x3eaa0c16, 0xda384f6d, 0x94cedefd, +0xc790b48f, 0xf7031c49, 0xe5e89992, 0xb4b02a77, +0x0858d424, 0x2af44294, 0xf4383ec3, 0x96fc2444, +0x148dd54d, 0xe7ea8d88, 0x454db8c2, 0xdaca5f37, +0xbce4c9ab, 0x830cbb2d, 0x0f3989ac, 0x950179fc, +0x2b722a1a, 0xdb192982, 0x809c9ddb, 0x1246a8c4, +0xe4987614, 0x68cb1c29, 0xe9404b43, 0x9f371dc0, +0x31de6186, 0x51b29667, 0xaabea8a6, 0xd4a80b4a, +0x7a45bc2b, 0xfb3c75e1, 0x7e97adfe, 0x3bfdee13, +0xc1e585ce, 0x7d90e87b, 0x6c54a62f, 0x79da0a67, +0xf6d1ac7b, 0xe8481d04, 0x6343d429, 0x56ce7a88, +0x5e94c626, 0x29223681, 0xbc553a44, 0x77487cd8, +0x20c5c0f1, 0xc5787605, 0xc3c0a263, 0x1606cae8, +0x39b95a82, 0xaef75774, 0x3d03fb0b, 0x41749340, +0xebd110b4, 0x52d4c116, 0x63056470, 0x0dd8a579, +0x7b72155b, 0x5e3d3a95, 0x45463e06, 0xb1a294de, +0x2313630d, 0xd8068ed4, 0xeff53cab, 0x7343c1ba, +0x6e11423e, 0xcc1bcc57, 0x56b4a28e, 0x54bc2205, +0x63e05b80, 0xd484b9f5, 0xd560d321, 0x6d0faf20, +0xaafe2e80, 0x189fdffd, 0x31019301, 0xff85372a, +0xce2b9e3b, 0x5bc8e2fc, 0xf26a32c8, 0x698c9ae4, +0x864d9d6d, 0x960894e1, 0x33e07c43, 0x98314169, +0x04f39233, 0x158d72cc, 0x1d139d93, 0x0c714623, +0xc57fa08f, 0xdac380d6, 0xcb0ab156, 0x72e0bfc4, +0x8a475c4a, 0x17210b91, 0xdb23bab9, 0xf43fef3f, +0x4b8f0e27, 0x14f5e8e2, 0x332141f3, 0xca55692c, +0x4aa0a4d6, 0xbfe77269, 0xf2e29b1c, 0xb19a4a9c, +0xd038369d, 0xabfede96, 0x97b9c5c9, 0x02a9d7fc, +0xa22d55ae, 0x27ac7a0f, 0x9d6413ec, 0x93c1b264, +0xf494a81e, 0x9c5aeda1, 0x1f105e88, 0x0a70ab8d, +0x13b030d9, 0x3b823dc7, 0x6b2c7321, 0xab690df7, +0x5f8ceb18, 0x17aaf6d1, 0x19f4c149, 0xfdf4944b, +0xf75b1f98, 0x7a32d1b1, 0x4b8c630b, 0x235d2e49, +0x3288c818, 0x27060736, 0x1be821c8, 0x19484ae3, +0x4d9f0c10, 0x848a6608, 0x3cd837ec, 0x500e1b84, +0xb10df9bb, 0x0ffa6102, 0x3e1ced10, 0x547c808d, +0xd4b8f680, 0x0338e62d, 0x2cf62440, 0xe2039f98, +0xb683f06b, 0x447e034f, 0x6a4a9be7, 0x12800b62, +0x4dbb8610, 0x960c5f26, 0xcc3cdf67, 0xeac8aa44, +0x29147e44, 0xe52489fa, 0x154266b7, 0xdd16d7e2, +0xf5293238, 0x2ec7f232, 0x41f55f3b, 0x08b6dd7d, +0xd5a519e1, 0x9c2d6ac7, 0xbd38dc40, 0xbbf773e1, +0x6c44c8ad, 0x4909704e, 0xcf9c835e, 0xac9f0cf6, +0x02e74db5, 0xa7f9f2f4, 0x9bf17e81, 0xbdd5a357, +0xe4632011, 0xfae2b887, 0x8e671441, 0x28e62ec7, +0xf0600919, 0xc7e8dcbc, 0x84aeb74d, 0x8ad38661, +0x58f15269, 0x1d608461, 0xeddb3ffb, 0x0fe66af5, +0x7b07ddbf, 0xa662ff0f, 0x68dcc083, 0x848d3fbb, +0x99af2ee7, 0x2ddb0548, 0xc493b0aa, 0xf9940ee8, +0x20a5d4db, 0x8ed57bf5, 0x435948ab, 0x97f583e9, +0xdd5dcd4e, 0x30ccecad, 0xdcc95881, 0x23bcfe47, +0xe541ab84, 0xf20d9e5a, 0x670521c8, 0x1546cef5, +0xf29b9947, 0x26c713ec, 0x0deec8c9, 0xc9f7e5bd, +0x9f519c48, 0x5782ad14, 0xec347973, 0x1bd165ea, +0x3f54767d, 0x8db25803, 0x3f1847c1, 0x46c1c17c, +0xae825459, 0x77a00d3e, 0x3838565c, 0x52ca36c4, +0xe956fb60, 0x80b2c01b, 0xdd0f77cb, 0x825b118e, +0xae4bf433, 0x716cda7b, 0x6d69e7f6, 0xc016524c, +0x9a5bb9c4, 0x88720186, 0x5aec39f4, 0x2929f0b6, +0xb4caf654, 0x445b25f2, 0x215c25d3, 0x16137904, +0xfb8b7dcc, 0xf11ddde5, 0x9a6cd8dd, 0xbffd8ae5, +0x6e82a727, 0x3c7b679f, 0x97eaa37c, 0x2693a0fd, +0xb258524e, 0xbc28c52d, 0x13d1915b, 0x37e62bb3, +0xa2421c6d, 0x6eeca6cd, 0xa4c61052, 0x1c0681af, +0xa002f7f4, 0x7e1af034, 0x9870400d, 0xa7aeacdc, +0xdc93b83c, 0x0ea7c1a8, 0xb0b2d5f8, 0x987b2d64, +0x8029bbfa, 0x6dd494cb, 0x5adf2f0e, 0x19f05959, +0x848f6720, 0x85895c26, 0xab1e58b0, 0x520aecd3, +0x53968185, 0x6db5372b, 0xb0c7081c, 0x73f3068e, +0xb69ff767, 0xa1599bd8, 0xd840b629, 0x9e05d61a, +0x98afddcf, 0x2f5c9908, 0xfbb8dab7, 0x7fda7b18, +0xa07c07a1, 0x275bfd1f, 0xf1a8e940, 0xd0e1efa0, +0x1588f564, 0xae172c90, 0x3cf19e63, 0xf66ac7ac, +0x1a082983, 0xeb29faa7, 0xe3ce0951, 0x01a1b56a, +0xb2901c78, 0xb27e27fd, 0x4fd52832, 0x4188d745, +0xe925318d, 0x6ebc66c0, 0x0c0c1573, 0x7d26cd04, +0xbb095fef, 0x1ed71a2c, 0xa6931049, 0x71e91145, +0xc7601147, 0xa19e02ab, 0x95fa4702, 0xfac784d3, +0x6ac76420, 0xe8e1e30f, 0x848a7f96, 0xe5ac2116, +0x624f0147, 0xea992fbe, 0x0b750c31, 0x0e3c210e, +0x8a73688e, 0xa396aa9e, 0x8eece177, 0x649883f8, +0x843b98cd, 0x50fe4476, 0x3dcb97f4, 0x54cbee59, +0x7fa93dc8, 0x54338c09, 0xf5036e89, 0xc6fbe6d3, +0x659b8de0, 0xa5ea7df3, 0x83d01cc3, 0x83276f3b, +0x93c09401, 0xa83f8874, 0x44c29328, 0x48260c03, +0x5f315d0c, 0x7899debd, 0xaaa5b400, 0xc39ae3c2, +0x1e072918, 0xcf53f8ce, 0xcd7a257e, 0x2d70b59c, +0x8a41fa13, 0xfccb706b, 0x214aab96, 0xb675e33b, +0x769eb58d, 0x4fec7b6f, 0xfd880d51, 0xb10e6a07, +0x0cec1401, 0x81bda3af, 0xe6314ee9, 0xdf7dd5ab, +0x690e88e5, 0xc64f7835, 0xe0d4b3d7, 0xdd9af7ba, +0x51dccee8, 0x21cc8429, 0x0602ace7, 0xbb611627, +0xd80cd042, 0x8ce42d08, 0x9bff2200, 0xca318a07, +0xbec576c1, 0xaeed80b9, 0x131a7a07, 0xec17fd04, +0x9a8c78d1, 0x130a0e10, 0xb7c19b6f, 0xfb285ad2, +0xe901a213, 0x242bd250, 0xee2910d0, 0xd482528d, +0x0f8c198b, 0x53233b3b, 0xacd3a847, 0x4ed9bd76, +0xdfff18c7, 0xf3ea0160, 0xd259fe1c, 0x1206c799, +0xc202fb96, 0xd3afe4fb, 0xa65aefe3, 0xd6cbe7ba, +0x3c902f88, 0xa2e9e272, 0x0668ec72, 0xd43ccf92, +0x162fe3e5, 0x110a128e, 0x9e8ce5e6, 0x3602702d, +0x3367e096, 0x5b6929ba, 0x4aa22359, 0x6a9c5cec, +0xa0e37b04, 0x98449956, 0xc334045d, 0x86ba286e, +0x9ff57b22, 0x475c91f2, 0x77bb0b35, 0xea00d5a1, +0x225126b2, 0x6f40458c, 0x6a8e803f, 0x68536c58, +0xc7f132b9, 0x384cbd95, 0x397b85dc, 0xd0c0c04f, +0xa7676ee8, 0xef1f4b17, 0x97cbcd0d, 0x000d34a9, +0x821bf9cd, 0xbfcd1dcf, 0x75769ad7, 0xe5a07180, +0x6ebaeac8, 0xf98b5734, 0xa7e21853, 0x6b0adbcf, +0x7ce7227d, 0xdbfb4e26, 0x7258b1d4, 0x33485f8f, +0x39c3f013, 0xf3a75342, 0xca99f689, 0xdac1a6b1, +0x060d7a22, 0x8dec26b4, 0x7340e3c8, 0xb6efbaa8, +0xabed9bb3, 0x565200ff, 0x46cb2b57, 0xabea0635, +0x6d3a9072, 0x8f036549, 0x0e0ca034, 0x0936d4eb, +0xbf26ab33, 0x95630b18, 0x43d7add1, 0xcbcb6047, +0xdf21f1b2, 0x0dc8bd6f, 0x9ab49f62, 0xeb0505cc, +0x3abe8b84, 0xb0952016, 0x39dd57dd, 0x6fc0d392, +0x5c0f9218, 0x0bda02b3, 0xdc6b4d4b, 0x6c843ff1, +0xabc628d8, 0x6c82823f, 0xf324370d, 0x3fae5261, +0x9c3988e5, 0x82227173, 0x5631e8a3, 0x8ffe2941, +0x0a9d8e07, 0x35cec1ad, 0x2086a0c0, 0xb67b505a, +0x6607a079, 0x4829e991, 0x5e7622f3, 0x87018e34, +0x8184dd45, 0x6694f40c, 0x9129f8af, 0xc1150659, +0xc845ad79, 0x0dbe10f8, 0xe3c01bfc, 0x4727e946, +0x9007f7d7, 0xe858cabb, 0x0a77f5ae, 0xed94e1db, +0x29f62b6e, 0xae17cad6, 0x5e95456b, 0xb8ff6d0e, +0xb1fe6f18, 0x221b734d, 0x4168d5f7, 0x926aeaa7, +0xebfed78e, 0x8130ef84, 0x196586e9, 0xa419723d, +0x5ac0aadf, 0xe2dc8fa1, 0xa962fc99, 0xde71a0a0, +0x0e16c3b1, 0x9b0b8305, 0x53cc3587, 0xb48cac6d, +0xd230a47f, 0xc052bf9b, 0x8c8a3cbe, 0x48b5881f, +0x3f4b9e2f, 0x18abb452, 0x2dee35f9, 0x79c9a085, +0x0e3740d9, 0x95be5a93, 0xa46e0a24, 0xa19228db, +0xf9a6d8d5, 0x260158f3, 0x43742638, 0x86f3e7b1, +0x53a873c7, 0x4c3bbde4, 0x3a125a19, 0x183be282, +0xd5d472eb, 0x4a9c635d, 0xe49e80c9, 0xa2c6661d, +0x4967c618, 0xac9daf4b, 0x4919131a, 0x369f78eb, +0x9bde7c9c, 0x553d5d0b, 0xc59a73d1, 0xff837337, +0xe5ec7273, 0x1c8599b4, 0x696dc179, 0x9815ee07, +0xe4df1239, 0x38e1c469, 0x6b794569, 0xa032785e, +0x1acc0925, 0xf536cdd6, 0xebc5c6c2, 0x2a5d11d3, +0x04a03d39, 0x633bced1, 0xa2001784, 0xf78c6b48, +0xe072c5a1, 0xb1eaa433, 0xd7ced3b6, 0xf2c07440, +0x4ffd6e7b, 0xaf2b878b, 0x60d7bc8e, 0x2b89dc5c, +0xe117be9e, 0xc8ea7f6a, 0x865bbc9c, 0x304e977a, +0x25a5d74b, 0x49a6fbec, 0xc0470ff4, 0xd83890fa, +0x58f22c45, 0x077790b4, 0xd6402b4e, 0x719eaf0a, +0x8ab72534, 0xec1a1894, 0x81f797c3, 0x1ecf65ab, +0x37fe8f9e, 0x9481c873, 0x744d691b, 0xd9a6d1d4, +0x6ee7a90e, 0x5bdc7a57, 0xc560c85f, 0x75124495, +0x134501fe, 0x2fbdea57, 0xc1fe407f, 0x36828ba0, +0x3da4c8d7, 0xa0006170, 0x81a4577d, 0xdc8e8a44, +0xfc94a762, 0xe9b6be77, 0x7d7c04f7, 0x29c8276b, +0xaa12fb03, 0xa6d27825, 0x9922dd69, 0x0e178d6e, +0x449c8109, 0x4c827048, 0x35d3f205, 0x538eafc3, +0x8bf248f1, 0x3130b9ec, 0x27a6b08d, 0xfef0100b, +0xbcc85298, 0x2080ecdc, 0x39fdfb05, 0x62f7c480, +0x19de60a6, 0xe2204f0f, 0x39ca59ea, 0xabdc7f01, +0x81f5067b, 0x215857e5, 0x1b9b044f, 0x55db132d, +0x716b8212, 0x81c3acbe, 0xdff0c9a1, 0xc60ad938, +0xc8facc32, 0xaf6a82c0, 0x8018ee73, 0x0f722d8d, +0x7ab0bbab, 0x06f44c6d, 0xc9bce017, 0xef88fba0, +0xc65c84ec, 0xaec583f2, 0x9d2aca45, 0xd9836e2b, +0xa4cb385c, 0xf59cd694, 0x409f5465, 0x37ce2de9, +0x5366f8ab, 0x460fe096, 0x476cbd07, 0xf42481db, +0xddba009f, 0xc679613a, 0x7165e0ed, 0x212ba7bb, +0xaeea5527, 0x75397d7d, 0x368e0b80, 0xf0a1c5d4, +0xe2e7a01f, 0x223b6d47, 0x0b006f6f, 0x5f42f904, +0x76cb0e41, 0x4ff6b0ab, 0x90683eee, 0xc5f01511, +0x11b563f0, 0x13a0b7f4, 0x247e667e, 0xd11bf6ea, +0x285d4466, 0xd2dbfde5, 0x7b73744e, 0x8234b88d, +0xd9c2a4a5, 0xf6efab9f, 0x2808dde0, 0x7655864b, +0xa1b20c4f, 0x1d6ba18a, 0xc79a70c0, 0x7bf27476, +0x9083f611, 0x8d9c7045, 0x6c0a8ca2, 0x1860df39, +0xeb8e513b, 0x9adf5af9, 0x3a39fd75, 0x2c2d578f, +0x0040c101, 0xf24719c2, 0xf7438575, 0xc642fa2d, +0x195d6265, 0xb0f5f6d7, 0x9baed4fe, 0x496e9348, +0x12f8158c, 0x20840886, 0xcb0d9354, 0xa2f7e0e8, +0xfa4b7005, 0xc919bf15, 0xe8b19712, 0x5223fa2b, +0x0a1435d4, 0xbd9daf74, 0x998a2d38, 0xa90eceb8, +0x2796c980, 0x9ff72c53, 0x052fc633, 0x67165b0c, +0x98f4291d, 0x4ccfa97c, 0xc0911676, 0x5d7233ad, +0x57efc358, 0xe82361f5, 0x6cdcb7d8, 0x20288c6f, +0x4bf05857, 0x59cc64ec, 0x984f354a, 0xdd1fa6d4, +0x6fecf3ae, 0x6b22cbf5, 0x4aa15f77, 0xf306d041, +0xed945e46, 0xcd9fe0b9, 0x234f4ae8, 0xc6fd791e, +0xecd580cd, 0xe3de77ac, 0xa1031368, 0x15774eb8, +0xa89a83a5, 0x67066915, 0xd73f2dee, 0xeeed86fe, +0x714221a8, 0x48fa6cc3, 0x98f9e936, 0xc362fc00, +0xc0d792c2, 0x751cc992, 0x4ee2902c, 0xb6f3648b, +0xc766b9c2, 0xcc146335, 0x7870d73e, 0xc2e331e9, +0x3a06414e, 0x43fec1c1, 0x8a69cc7c, 0x241be529, +0x6697c6a9, 0x50bdb278, 0x2bd31bc9, 0x284d0b68, +0x4c4f6fd7, 0x3d309a3c, 0x3f44ae0d, 0x3d5f323e, +0x1018208b, 0x64eeebd4, 0xbf940e84, 0x1bdeb048, +0x8959ce21, 0xb3e30da5, 0x086d9c68, 0x6e554b51, +0xf4796046, 0x6a194705, 0x77d86ae8, 0xb23fe0cd, +0xdfc1e29b, 0x53e92324, 0xbe41b2bd, 0xfaa02c03, +0xe0362c1e, 0x7dbc10ba, 0x491d2567, 0xa44c023e, +0x47c5f3f8, 0xdaa509f7, 0x1ee4214c, 0x40297c03, +0x8cd29257, 0x8100c5ce, 0x481a3303, 0x93c360da, +0xae1b0e83, 0x00eb3656, 0x5ff0fa97, 0xddcf7a1d, +0x7c8c47fc, 0xbe3e8645, 0x450a395e, 0x18686d02, +0xbfc53cdf, 0xaf084ade, 0xfc288cd9, 0xbb285f9f, +0xddaf6201, 0xa40183d6, 0x41500319, 0x7e9e2a92, +0xa5332190, 0xfda7abf6, 0x98be91ad, 0x76b15b7f, +0x2db9446f, 0x1a60d2e2, 0x193e376c, 0x4932c9ac, +0xeb87058a, 0x17a19742, 0x021df546, 0xde353932, +0x795d5cf4, 0x86d450fb, 0xf660d67f, 0x6493b35a, +0x174fc138, 0x3e98a209, 0x3b7d5903, 0x21684400, +0x426ec5a9, 0xbebf63dc, 0xaab0f029, 0xc22dddae, +0x4f306545, 0x4759cf34, 0x356b6f0c, 0x349884c1, +0xaca3058a, 0x5e76e9dd, 0x806b7e27, 0x9cef8c14, +0x451f90d5, 0xee50a4c5, 0x3a994015, 0x87d3cbc2, +0x0bf9ef61, 0x3da7d552, 0xe9a5e121, 0x050a61da, +0x6853fbb8, 0xd8420180, 0xf3f7036e, 0xe6ecb9ab, +0xf336fe6d, 0x82deb26b, 0x56afafb0, 0x7b4cd669, diff --git a/src/cpu/intel/haswell/microcode_blob.c b/src/cpu/intel/haswell/microcode_blob.c new file mode 100644 index 0000000000..18a1327633 --- /dev/null +++ b/src/cpu/intel/haswell/microcode_blob.c @@ -0,0 +1,23 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +unsigned microcode[] = { +#include "microcode_blob.h" +}; + diff --git a/src/cpu/intel/haswell/microcode_blob.h b/src/cpu/intel/haswell/microcode_blob.h new file mode 100644 index 0000000000..1752e73e32 --- /dev/null +++ b/src/cpu/intel/haswell/microcode_blob.h @@ -0,0 +1,28 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "microcode-M32306c1_ffff000d.h" +#include "microcode-M32306c2_ffff0003.h" +#include "microcode-M3240660_ffff000b.h" +#include "microcode-M7240650_ffff0007.h" + /* Dummy terminator */ + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, diff --git a/src/cpu/x86/smm/smmhandler_tseg.S b/src/cpu/x86/smm/smmhandler_tseg.S index c61a611757..eb5d63ca8f 100644 --- a/src/cpu/x86/smm/smmhandler_tseg.S +++ b/src/cpu/x86/smm/smmhandler_tseg.S @@ -60,6 +60,9 @@ #if CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE || CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE #include <northbridge/intel/sandybridge/sandybridge.h> #define TSEG_BAR (DEFAULT_PCIEXBAR | TSEG) +#elif CONFIG_NORTHBRIDGE_INTEL_HASWELL +#include <northbridge/intel/haswell/haswell.h> +#define TSEG_BAR (DEFAULT_PCIEXBAR | TSEG) #else #error "Northbridge must define TSEG_BAR." #endif diff --git a/src/cpu/x86/smm/smmrelocate.S b/src/cpu/x86/smm/smmrelocate.S index 16d4b9fde0..a6379ccc00 100644 --- a/src/cpu/x86/smm/smmrelocate.S +++ b/src/cpu/x86/smm/smmrelocate.S @@ -39,6 +39,8 @@ #include "../../../southbridge/intel/bd82x6x/pch.h" #elif CONFIG_SOUTHBRIDGE_INTEL_I82801IX #include "../../../southbridge/intel/i82801ix/i82801ix.h" +#elif CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT +#include "../../../southbridge/intel/lynxpoint/pch.h" #else #error "Southbridge needs SMM handler support." #endif @@ -48,6 +50,9 @@ #if CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE || CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE #include <northbridge/intel/sandybridge/sandybridge.h> #define TSEG_BAR (DEFAULT_PCIEXBAR | TSEG) +#elif CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT +#include <northbridge/intel/haswell/haswell.h> +#define TSEG_BAR (DEFAULT_PCIEXBAR | TSEG) #else #error "Northbridge must define TSEG_BAR." #endif diff --git a/src/northbridge/intel/Kconfig b/src/northbridge/intel/Kconfig index f2d745a634..a20f7b0ec3 100644 --- a/src/northbridge/intel/Kconfig +++ b/src/northbridge/intel/Kconfig @@ -13,3 +13,4 @@ source src/northbridge/intel/gm45/Kconfig source src/northbridge/intel/sch/Kconfig source src/northbridge/intel/i5000/Kconfig source src/northbridge/intel/sandybridge/Kconfig +source src/northbridge/intel/haswell/Kconfig diff --git a/src/northbridge/intel/Makefile.inc b/src/northbridge/intel/Makefile.inc index 5888c652e5..62e427dd75 100644 --- a/src/northbridge/intel/Makefile.inc +++ b/src/northbridge/intel/Makefile.inc @@ -14,3 +14,4 @@ subdirs-$(CONFIG_NORTHBRIDGE_INTEL_SCH) += sch subdirs-$(CONFIG_NORTHBRIDGE_INTEL_I5000) += i5000 subdirs-$(CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE) += sandybridge subdirs-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += sandybridge +subdirs-$(CONFIG_NORTHBRIDGE_INTEL_HASWELL) += haswell diff --git a/src/northbridge/intel/haswell/Kconfig b/src/northbridge/intel/haswell/Kconfig new file mode 100644 index 0000000000..7e27cfd118 --- /dev/null +++ b/src/northbridge/intel/haswell/Kconfig @@ -0,0 +1,95 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2010 Google Inc. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; version 2 of the License. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## + +config NORTHBRIDGE_INTEL_HASWELL + bool + select CACHE_MRC_BIN + select CPU_INTEL_HASWELL + select REQUIRES_BLOB + +if NORTHBRIDGE_INTEL_HASWELL + +config VGA_BIOS_ID + string + default "8086,0166" + +config EXTERNAL_MRC_BLOB + bool + default n + +config CACHE_MRC_SIZE_KB + int + default 512 + +# FIXME: build from rom size +config MRC_CACHE_BASE + hex + default 0xff800000 + +config MRC_CACHE_LOCATION + hex + depends on !CHROMEOS + default 0x370000 + +config MRC_CACHE_SIZE + hex + depends on !CHROMEOS + default 0x10000 + +config DCACHE_RAM_BASE + hex + default 0xff7e0000 + +config DCACHE_RAM_SIZE + hex + default 0x20000 + +config DCACHE_RAM_MRC_VAR_SIZE + hex + default 0x4000 + +config HAVE_MRC + bool "Add a System Agent binary" + help + Select this option to add a System Agent binary to + the resulting coreboot image. + + Note: Without this binary coreboot will not work + +config MRC_FILE + string "Intel System Agent path and filename" + depends on HAVE_MRC + default "mrc.bin" + help + The path and filename of the file to use as System Agent + binary. + +config CBFS_SIZE + hex "Size of CBFS filesystem in ROM" + default 0x100000 + help + On Haswell systems the firmware image has to store a lot more + than just coreboot, including: + - a firmware descriptor + - Intel Management Engine firmware + - MRC cache information + This option allows to limit the size of the CBFS portion in the + firmware image. + +endif diff --git a/src/northbridge/intel/haswell/Makefile.inc b/src/northbridge/intel/haswell/Makefile.inc new file mode 100644 index 0000000000..896360d9ec --- /dev/null +++ b/src/northbridge/intel/haswell/Makefile.inc @@ -0,0 +1,41 @@ +# +# This file is part of the coreboot project. +# +# Copyright (C) 2010 Google Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +ramstage-y += northbridge.c +ramstage-y += gma.c + +ramstage-$(CONFIG_GENERATE_ACPI_TABLES) += acpi.c +ramstage-y += mrccache.c + +romstage-y += raminit.c +romstage-y += mrccache.c +romstage-y += early_init.c +romstage-y += report_platform.c +romstage-y += ../../../arch/x86/lib/walkcbfs.S + +smm-$(CONFIG_HAVE_SMI_HANDLER) += udelay.c +smm-$(CONFIG_HAVE_SMI_HANDLER) += finalize.c + +# We don't ship that, but booting without it is bound to fail +cbfs-files-$(CONFIG_HAVE_MRC) += mrc.bin +mrc.bin-file := $(call strip_quotes,$(CONFIG_MRC_FILE)) +mrc.bin-position := 0xfffa0000 +mrc.bin-type := 0xab + +$(obj)/northbridge/intel/haswell/acpi.ramstage.o : $(obj)/build.h diff --git a/src/northbridge/intel/haswell/acpi.c b/src/northbridge/intel/haswell/acpi.c new file mode 100644 index 0000000000..c61669995d --- /dev/null +++ b/src/northbridge/intel/haswell/acpi.c @@ -0,0 +1,202 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2012 The Chromium OS Authors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <types.h> +#include <string.h> +#include <console/console.h> +#include <arch/io.h> +#include <arch/acpi.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include <build.h> +#include "haswell.h" + +unsigned long acpi_fill_mcfg(unsigned long current) +{ + device_t dev; + u32 pciexbar = 0; + u32 pciexbar_reg; + int max_buses; + + dev = dev_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_SB, 0); + if (!dev) + dev = dev_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_IB, 0); + if (!dev) + return current; + + pciexbar_reg=pci_read_config32(dev, PCIEXBAR); + + // MMCFG not supported or not enabled. + if (!(pciexbar_reg & (1 << 0))) + return current; + + switch ((pciexbar_reg >> 1) & 3) { + case 0: // 256MB + pciexbar = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)); + max_buses = 256; + break; + case 1: // 128M + pciexbar = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)); + max_buses = 128; + break; + case 2: // 64M + pciexbar = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)|(1 << 26)); + max_buses = 64; + break; + default: // RSVD + return current; + } + + if (!pciexbar) + return current; + + current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current, + pciexbar, 0x0, 0x0, max_buses - 1); + + return current; +} + +static void *get_intel_vbios(void) +{ + /* This should probably be looking at CBFS or we should always + * deploy the VBIOS on Intel systems, even if we don't run it + * in coreboot (e.g. SeaBIOS only scenarios). + */ + u8 *vbios = (u8 *)0xc0000; + + optionrom_header_t *oprom = (optionrom_header_t *)vbios; + optionrom_pcir_t *pcir = (optionrom_pcir_t *)(vbios + + oprom->pcir_offset); + + + printk(BIOS_DEBUG, "GET_VBIOS: %x %x %x %x %x\n", + oprom->signature, pcir->vendor, pcir->classcode[0], + pcir->classcode[1], pcir->classcode[2]); + + + if ((oprom->signature == OPROM_SIGNATURE) && + (pcir->vendor == PCI_VENDOR_ID_INTEL) && + (pcir->classcode[0] == 0x00) && + (pcir->classcode[1] == 0x00) && + (pcir->classcode[2] == 0x03)) + return (void *)vbios; + + return NULL; +} + +static int init_opregion_vbt(igd_opregion_t *opregion) +{ + void *vbios; + vbios = get_intel_vbios(); + if (!vbios) { + printk(BIOS_DEBUG, "VBIOS not found.\n"); + return 1; + } + + printk(BIOS_DEBUG, " ... VBIOS found at %p\n", vbios); + optionrom_header_t *oprom = (optionrom_header_t *)vbios; + optionrom_vbt_t *vbt = (optionrom_vbt_t *)(vbios + + oprom->vbt_offset); + + if (read32((unsigned long)vbt->hdr_signature) != VBT_SIGNATURE) { + printk(BIOS_DEBUG, "VBT not found!\n"); + return 1; + } + + memcpy(opregion->header.vbios_version, vbt->coreblock_biosbuild, 4); + memcpy(opregion->vbt.gvd1, vbt, vbt->hdr_vbt_size < 7168 ? + vbt->hdr_vbt_size : 7168); + + return 0; +} + + +/* Initialize IGD OpRegion, called from ACPI code */ +int init_igd_opregion(igd_opregion_t *opregion) +{ + device_t igd; + u16 reg16; + + memset((void *)opregion, 0, sizeof(igd_opregion_t)); + + // FIXME if IGD is disabled, we should exit here. + + memcpy(&opregion->header.signature, IGD_OPREGION_SIGNATURE, + sizeof(IGD_OPREGION_SIGNATURE)); + + /* 8kb */ + opregion->header.size = sizeof(igd_opregion_t) / 1024; + opregion->header.version = IGD_OPREGION_VERSION; + + // FIXME We just assume we're mobile for now + opregion->header.mailboxes = MAILBOXES_MOBILE; + + // TODO Initialize Mailbox 1 + + // TODO Initialize Mailbox 3 + opregion->mailbox3.bclp = IGD_BACKLIGHT_BRIGHTNESS; + opregion->mailbox3.pfit = IGD_FIELD_VALID | IGD_PFIT_STRETCH; + opregion->mailbox3.pcft = 0; // should be (IMON << 1) & 0x3e + opregion->mailbox3.cblv = IGD_FIELD_VALID | IGD_INITIAL_BRIGHTNESS; + opregion->mailbox3.bclm[0] = IGD_WORD_FIELD_VALID + 0x0000; + opregion->mailbox3.bclm[1] = IGD_WORD_FIELD_VALID + 0x0a19; + opregion->mailbox3.bclm[2] = IGD_WORD_FIELD_VALID + 0x1433; + opregion->mailbox3.bclm[3] = IGD_WORD_FIELD_VALID + 0x1e4c; + opregion->mailbox3.bclm[4] = IGD_WORD_FIELD_VALID + 0x2866; + opregion->mailbox3.bclm[5] = IGD_WORD_FIELD_VALID + 0x327f; + opregion->mailbox3.bclm[6] = IGD_WORD_FIELD_VALID + 0x3c99; + opregion->mailbox3.bclm[7] = IGD_WORD_FIELD_VALID + 0x46b2; + opregion->mailbox3.bclm[8] = IGD_WORD_FIELD_VALID + 0x50cc; + opregion->mailbox3.bclm[9] = IGD_WORD_FIELD_VALID + 0x5ae5; + opregion->mailbox3.bclm[10] = IGD_WORD_FIELD_VALID + 0x64ff; + + init_opregion_vbt(opregion); + + /* TODO This needs to happen in S3 resume, too. + * Maybe it should move to the finalize handler + */ + igd = dev_find_slot(0, PCI_DEVFN(0x2, 0)); + + pci_write_config32(igd, ASLS, (u32)opregion); + reg16 = pci_read_config16(igd, SWSCI); + reg16 &= ~(1 << 0); + reg16 |= (1 << 15); + pci_write_config16(igd, SWSCI, reg16); + + /* clear dmisci status */ + reg16 = inw(DEFAULT_PMBASE + TCO1_STS); + reg16 |= DMISCI_STS; // reference code does an &= + outw(DEFAULT_PMBASE + TCO1_STS, reg16); + + /* clear acpi tco status */ + outl(DEFAULT_PMBASE + GPE0_STS, TCOSCI_STS); + + /* enable acpi tco scis */ + reg16 = inw(DEFAULT_PMBASE + GPE0_EN); + reg16 |= TCOSCI_EN; + outw(DEFAULT_PMBASE + GPE0_EN, reg16); + + return 0; +} + + diff --git a/src/northbridge/intel/haswell/acpi/haswell.asl b/src/northbridge/intel/haswell/acpi/haswell.asl new file mode 100644 index 0000000000..49d55e7388 --- /dev/null +++ b/src/northbridge/intel/haswell/acpi/haswell.asl @@ -0,0 +1,60 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include "../haswell.h" +#include "hostbridge.asl" + +/* PCI Device Resource Consumption */ +Device (PDRC) +{ + Name (_HID, EISAID("PNP0C02")) + Name (_UID, 1) + + Name (PDRS, ResourceTemplate() { + Memory32Fixed(ReadWrite, 0xfed1c000, 0x00004000) // RCBA + Memory32Fixed(ReadWrite, DEFAULT_MCHBAR, 0x00004000) + Memory32Fixed(ReadWrite, DEFAULT_DMIBAR, 0x00001000) + Memory32Fixed(ReadWrite, DEFAULT_EPBAR, 0x00001000) + Memory32Fixed(ReadWrite, DEFAULT_PCIEXBAR, 0x04000000) + Memory32Fixed(ReadWrite, 0xfed20000, 0x00020000) // Misc ICH + Memory32Fixed(ReadWrite, 0xfed40000, 0x00005000) // Misc ICH + Memory32Fixed(ReadWrite, 0xfed45000, 0x0004b000) // Misc ICH + +#if CONFIG_CHROMEOS_RAMOOPS + Memory32Fixed(ReadWrite, CONFIG_CHROMEOS_RAMOOPS_RAM_START, + CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE) +#endif + + /* Required for SandyBridge sighting 3715511 */ + /* FIXME: Is this still required? */ + Memory32Fixed(ReadWrite, 0x20000000, 0x00200000) + Memory32Fixed(ReadWrite, 0x40000000, 0x00200000) + }) + + // Current Resource Settings + Method (_CRS, 0, Serialized) + { + Return(PDRS) + } +} + +// Integrated graphics 0:2.0 +#include "igd.asl" diff --git a/src/northbridge/intel/haswell/acpi/hostbridge.asl b/src/northbridge/intel/haswell/acpi/hostbridge.asl new file mode 100644 index 0000000000..681f6dc1fd --- /dev/null +++ b/src/northbridge/intel/haswell/acpi/hostbridge.asl @@ -0,0 +1,385 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + + +Name(_HID,EISAID("PNP0A08")) // PCIe +Name(_CID,EISAID("PNP0A03")) // PCI + +Name(_ADR, 0) +Name(_BBN, 0) + +Device (MCHC) +{ + Name(_ADR, 0x00000000) // 0:0.0 + + OperationRegion(MCHP, PCI_Config, 0x00, 0x100) + Field (MCHP, DWordAcc, NoLock, Preserve) + { + Offset (0x40), // EPBAR + EPEN, 1, // Enable + , 11, // + EPBR, 24, // EPBAR + + Offset (0x48), // MCHBAR + MHEN, 1, // Enable + , 13, // + MHBR, 22, // MCHBAR + + Offset (0x60), // PCIe BAR + PXEN, 1, // Enable + PXSZ, 2, // BAR size + , 23, // + PXBR, 10, // PCIe BAR + + Offset (0x68), // DMIBAR + DMEN, 1, // Enable + , 11, // + DMBR, 24, // DMIBAR + + Offset (0x70), // ME Base Address + MEBA, 64, + + // ... + + Offset (0x80), // PAM0 + , 4, + PM0H, 2, + , 2, + Offset (0x81), // PAM1 + PM1L, 2, + , 2, + PM1H, 2, + , 2, + Offset (0x82), // PAM2 + PM2L, 2, + , 2, + PM2H, 2, + , 2, + Offset (0x83), // PAM3 + PM3L, 2, + , 2, + PM3H, 2, + , 2, + Offset (0x84), // PAM4 + PM4L, 2, + , 2, + PM4H, 2, + , 2, + Offset (0x85), // PAM5 + PM5L, 2, + , 2, + PM5H, 2, + , 2, + Offset (0x86), // PAM6 + PM6L, 2, + , 2, + PM6H, 2, + , 2, + + Offset (0xa0), // Top of Used Memory + TOM, 64, + + Offset (0xbc), // Top of Low Used Memory + TLUD, 32, + } + + Mutex (CTCM, 1) /* CTDP Switch Mutex (sync level 1) */ + Name (CTCC, 0) /* CTDP Current Selection */ + Name (CTCN, 0) /* CTDP Nominal Select */ + Name (CTCD, 1) /* CTDP Down Select */ + Name (CTCU, 2) /* CTDP Up Select */ + + OperationRegion (MCHB, SystemMemory, DEFAULT_MCHBAR, 0x8000) + Field (MCHB, DWordAcc, Lock, Preserve) + { + Offset (0x5930), + CTDN, 15, /* CTDP Nominal PL1 */ + Offset (0x59a0), + PL1V, 15, /* Power Limit 1 Value */ + PL1E, 1, /* Power Limit 1 Enable */ + PL1C, 1, /* Power Limit 1 Clamp */ + PL1T, 7, /* Power Limit 1 Time */ + Offset (0x59a4), + PL2V, 15, /* Power Limit 2 Value */ + PL2E, 1, /* Power Limit 2 Enable */ + PL2C, 1, /* Power Limit 2 Clamp */ + PL2T, 7, /* Power Limit 2 Time */ + Offset (0x5f3c), + TARN, 8, /* CTDP Nominal Turbo Activation Ratio */ + Offset (0x5f40), + CTDD, 15, /* CTDP Down PL1 */ + , 1, + TARD, 8, /* CTDP Down Turbo Activation Ratio */ + Offset (0x5f48), + CTDU, 15, /* CTDP Up PL1 */ + , 1, + TARU, 8, /* CTDP Up Turbo Activation Ratio */ + Offset (0x5f50), + CTCS, 2, /* CTDP Select */ + Offset (0x5f54), + TARS, 8, /* Turbo Activation Ratio Select */ + } + + /* + * Search CPU0 _PSS looking for control=arg0 and then + * return previous P-state entry number for new _PPC + * + * Format of _PSS: + * Name (_PSS, Package () { + * Package (6) { freq, power, tlat, blat, control, status } + * } + */ + External (\_PR.CPU0._PSS) + Method (PSSS, 1, NotSerialized) + { + Store (One, Local0) /* Start at P1 */ + Store (SizeOf (\_PR.CPU0._PSS), Local1) + + While (LLess (Local0, Local1)) { + /* Store _PSS entry Control value to Local2 */ + ShiftRight (DeRefOf (Index (DeRefOf (Index + (\_PR.CPU0._PSS, Local0)), 4)), 8, Local2) + If (LEqual (Local2, Arg0)) { + Return (Subtract (Local0, 1)) + } + Increment (Local0) + } + + Return (0) + } + + /* Set TDP Down */ + Method (STND, 0, Serialized) + { + If (Acquire (CTCM, 100)) { + Return (0) + } + If (LEqual (CTCD, CTCC)) { + Release (CTCM) + Return (0) + } + + Store ("Set TDP Down", Debug) + + /* Set CTC */ + Store (CTCD, CTCS) + + /* Set TAR */ + Store (TARD, TARS) + + /* Set PPC limit and notify OS */ + Store (PSSS (TARD), PPCM) + PPCN () + + /* Set PL2 to 1.25 * PL1 */ + Divide (Multiply (CTDD, 125), 100, Local0, PL2V) + + /* Set PL1 */ + Store (CTDD, PL1V) + + /* Store the new TDP Down setting */ + Store (CTCD, CTCC) + + Release (CTCM) + Return (1) + } + + /* Set TDP Nominal from Down */ + Method (STDN, 0, Serialized) + { + If (Acquire (CTCM, 100)) { + Return (0) + } + If (LEqual (CTCN, CTCC)) { + Release (CTCM) + Return (0) + } + + Store ("Set TDP Nominal", Debug) + + /* Set PL1 */ + Store (CTDN, PL1V) + + /* Set PL2 to 1.25 * PL1 */ + Divide (Multiply (CTDN, 125), 100, Local0, PL2V) + + /* Set PPC limit and notify OS */ + Store (PSSS (TARN), PPCM) + PPCN () + + /* Set TAR */ + Store (TARN, TARS) + + /* Set CTC */ + Store (CTCN, CTCS) + + /* Store the new TDP Nominal setting */ + Store (CTCN, CTCC) + + Release (CTCM) + Return (1) + } +} + +// Current Resource Settings + +Method (_CRS, 0, Serialized) +{ + Name (MCRS, ResourceTemplate() + { + // Bus Numbers + WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, + 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00) + + // IO Region 0 + DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, + 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00) + + // PCI Config Space + Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008) + + // IO Region 1 + DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, + 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01) + + // VGA memory (0xa0000-0xbffff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000a0000, 0x000bffff, 0x00000000, + 0x00020000,,, ASEG) + + // OPROM reserved (0xc0000-0xc3fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000, + 0x00004000,,, OPR0) + + // OPROM reserved (0xc4000-0xc7fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000, + 0x00004000,,, OPR1) + + // OPROM reserved (0xc8000-0xcbfff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000, + 0x00004000,,, OPR2) + + // OPROM reserved (0xcc000-0xcffff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000cc000, 0x000cffff, 0x00000000, + 0x00004000,,, OPR3) + + // OPROM reserved (0xd0000-0xd3fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000, + 0x00004000,,, OPR4) + + // OPROM reserved (0xd4000-0xd7fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000, + 0x00004000,,, OPR5) + + // OPROM reserved (0xd8000-0xdbfff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000, + 0x00004000,,, OPR6) + + // OPROM reserved (0xdc000-0xdffff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000dc000, 0x000dffff, 0x00000000, + 0x00004000,,, OPR7) + + // BIOS Extension (0xe0000-0xe3fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000, + 0x00004000,,, ESG0) + + // BIOS Extension (0xe4000-0xe7fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000, + 0x00004000,,, ESG1) + + // BIOS Extension (0xe8000-0xebfff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000, + 0x00004000,,, ESG2) + + // BIOS Extension (0xec000-0xeffff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000ec000, 0x000effff, 0x00000000, + 0x00004000,,, ESG3) + + // System BIOS (0xf0000-0xfffff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x000f0000, 0x000fffff, 0x00000000, + 0x00010000,,, FSEG) + + // PCI Memory Region (Top of memory-0xfebfffff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0x00000000, 0xfebfffff, 0x00000000, + 0xfec00000,,, PM01) + + // TPM Area (0xfed40000-0xfed44fff) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, + Cacheable, ReadWrite, + 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000, + 0x00005000,,, TPMR) + }) + + // Find PCI resource area in MCRS + CreateDwordField(MCRS, PM01._MIN, PMIN) + CreateDwordField(MCRS, PM01._MAX, PMAX) + CreateDwordField(MCRS, PM01._LEN, PLEN) + + // Fix up PCI memory region + // Start with Top of Lower Usable DRAM + Store (^MCHC.TLUD, Local0) + Store (^MCHC.MEBA, Local1) + + // Check if ME base is equal + If (LEqual (Local0, Local1)) { + // Use Top Of Memory instead + Store (^MCHC.TOM, Local0) + } + + Store (Local0, PMIN) + Add(Subtract(PMAX, PMIN), 1, PLEN) + + Return (MCRS) +} + +/* IRQ assignment is mainboard specific. Get it from mainboard ACPI code */ +#include "acpi/haswell_pci_irqs.asl" + + diff --git a/src/northbridge/intel/haswell/acpi/igd.asl b/src/northbridge/intel/haswell/acpi/igd.asl new file mode 100644 index 0000000000..a6804adb5e --- /dev/null +++ b/src/northbridge/intel/haswell/acpi/igd.asl @@ -0,0 +1,324 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +Device (GFX0) +{ + Name (_ADR, 0x00020000) + + /* Display Output Switching */ + Method (_DOS, 1) + { + /* Windows 2000 and Windows XP call _DOS to enable/disable + * Display Output Switching during init and while a switch + * is already active + */ + Store (And(Arg0, 7), DSEN) + } + + /* We try to support as many i945 systems as possible, + * so keep the number of DIDs flexible. + */ + Method (_DOD, 0) + { + If (LEqual(NDID, 1)) { + Name(DOD1, Package() { + 0xffffffff + }) + Store (Or(0x00010000, DID1), Index(DOD1, 0)) + Return(DOD1) + } + + If (LEqual(NDID, 2)) { + Name(DOD2, Package() { + 0xffffffff, + 0xffffffff + }) + Store (Or(0x00010000, DID2), Index(DOD2, 0)) + Store (Or(0x00010000, DID2), Index(DOD2, 1)) + Return(DOD2) + } + + If (LEqual(NDID, 3)) { + Name(DOD3, Package() { + 0xffffffff, + 0xffffffff, + 0xffffffff + }) + Store (Or(0x00010000, DID3), Index(DOD3, 0)) + Store (Or(0x00010000, DID3), Index(DOD3, 1)) + Store (Or(0x00010000, DID3), Index(DOD3, 2)) + Return(DOD3) + } + + If (LEqual(NDID, 4)) { + Name(DOD4, Package() { + 0xffffffff, + 0xffffffff, + 0xffffffff, + 0xffffffff + }) + Store (Or(0x00010000, DID4), Index(DOD4, 0)) + Store (Or(0x00010000, DID4), Index(DOD4, 1)) + Store (Or(0x00010000, DID4), Index(DOD4, 2)) + Store (Or(0x00010000, DID4), Index(DOD4, 3)) + Return(DOD4) + } + + If (LGreater(NDID, 4)) { + Name(DOD5, Package() { + 0xffffffff, + 0xffffffff, + 0xffffffff, + 0xffffffff, + 0xffffffff + }) + Store (Or(0x00010000, DID5), Index(DOD5, 0)) + Store (Or(0x00010000, DID5), Index(DOD5, 1)) + Store (Or(0x00010000, DID5), Index(DOD5, 2)) + Store (Or(0x00010000, DID5), Index(DOD5, 3)) + Store (Or(0x00010000, DID5), Index(DOD5, 4)) + Return(DOD5) + } + + /* Some error happened, but we have to return something */ + Return (Package() {0x00000400}) + } + + Device(DD01) + { + /* Device Unique ID */ + Method(_ADR, 0, Serialized) + { + If(LEqual(DID1, 0)) { + Return (1) + } Else { + Return (And(0xffff, DID1)) + } + } + + /* Device Current Status */ + Method(_DCS, 0) + { + TRAP(1) + If (And(CSTE, 1)) { + Return (0x1f) + } + Return(0x1d) + } + + /* Query Device Graphics State */ + Method(_DGS, 0) + { + If (And(NSTE, 1)) { + Return(1) + } + Return(0) + } + + /* Device Set State */ + Method(_DSS, 1) + { + /* If Parameter Arg0 is (1 << 31) | (1 << 30), the + * display switch was completed + */ + If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { + Store (NSTE, CSTE) + } + } + } + + Device(DD02) + { + /* Device Unique ID */ + Method(_ADR, 0, Serialized) + { + If(LEqual(DID2, 0)) { + Return (2) + } Else { + Return (And(0xffff, DID2)) + } + } + + /* Device Current Status */ + Method(_DCS, 0) + { + TRAP(1) + If (And(CSTE, 2)) { + Return (0x1f) + } + Return(0x1d) + } + + /* Query Device Graphics State */ + Method(_DGS, 0) + { + If (And(NSTE, 2)) { + Return(1) + } + Return(0) + } + + /* Device Set State */ + Method(_DSS, 1) + { + /* If Parameter Arg0 is (1 << 31) | (1 << 30), the + * display switch was completed + */ + If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { + Store (NSTE, CSTE) + } + } + } + + + Device(DD03) + { + /* Device Unique ID */ + Method(_ADR, 0, Serialized) + { + If(LEqual(DID3, 0)) { + Return (3) + } Else { + Return (And(0xffff, DID3)) + } + } + + /* Device Current Status */ + Method(_DCS, 0) + { + TRAP(1) + If (And(CSTE, 4)) { + Return (0x1f) + } + Return(0x1d) + } + + /* Query Device Graphics State */ + Method(_DGS, 0) + { + If (And(NSTE, 4)) { + Return(1) + } + Return(0) + } + + /* Device Set State */ + Method(_DSS, 1) + { + /* If Parameter Arg0 is (1 << 31) | (1 << 30), the + * display switch was completed + */ + If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { + Store (NSTE, CSTE) + } + } + } + + + Device(DD04) + { + /* Device Unique ID */ + Method(_ADR, 0, Serialized) + { + If(LEqual(DID4, 0)) { + Return (4) + } Else { + Return (And(0xffff, DID4)) + } + } + + /* Device Current Status */ + Method(_DCS, 0) + { + TRAP(1) + If (And(CSTE, 8)) { + Return (0x1f) + } + Return(0x1d) + } + + /* Query Device Graphics State */ + Method(_DGS, 0) + { + If (And(NSTE, 4)) { + Return(1) + } + Return(0) + } + + /* Device Set State */ + Method(_DSS, 1) + { + /* If Parameter Arg0 is (1 << 31) | (1 << 30), the + * display switch was completed + */ + If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { + Store (NSTE, CSTE) + } + } + } + + + Device(DD05) + { + /* Device Unique ID */ + Method(_ADR, 0, Serialized) + { + If(LEqual(DID5, 0)) { + Return (5) + } Else { + Return (And(0xffff, DID5)) + } + } + + /* Device Current Status */ + Method(_DCS, 0) + { + TRAP(1) + If (And(CSTE, 16)) { + Return (0x1f) + } + Return(0x1d) + } + + /* Query Device Graphics State */ + Method(_DGS, 0) + { + If (And(NSTE, 4)) { + Return(1) + } + Return(0) + } + + /* Device Set State */ + Method(_DSS, 1) + { + /* If Parameter Arg0 is (1 << 31) | (1 << 30), the + * display switch was completed + */ + If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { + Store (NSTE, CSTE) + } + } + } + +} + diff --git a/src/northbridge/intel/haswell/chip.h b/src/northbridge/intel/haswell/chip.h new file mode 100644 index 0000000000..d60504c60a --- /dev/null +++ b/src/northbridge/intel/haswell/chip.h @@ -0,0 +1,43 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2008 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * Digital Port Hotplug Enable: + * 0x04 = Enabled, 2ms short pulse + * 0x05 = Enabled, 4.5ms short pulse + * 0x06 = Enabled, 6ms short pulse + * 0x07 = Enabled, 100ms short pulse + */ +struct northbridge_intel_haswell_config { + u8 gpu_dp_b_hotplug; /* Digital Port B Hotplug Config */ + u8 gpu_dp_c_hotplug; /* Digital Port C Hotplug Config */ + u8 gpu_dp_d_hotplug; /* Digital Port D Hotplug Config */ + + u8 gpu_panel_port_select; /* 0=LVDS 1=DP_B 2=DP_C 3=DP_D */ + u8 gpu_panel_power_cycle_delay; /* T4 time sequence */ + u16 gpu_panel_power_up_delay; /* T1+T2 time sequence */ + u16 gpu_panel_power_down_delay; /* T3 time sequence */ + u16 gpu_panel_power_backlight_on_delay; /* T5 time sequence */ + u16 gpu_panel_power_backlight_off_delay; /* Tx time sequence */ + + u32 gpu_cpu_backlight; /* CPU Backlight PWM value */ + u32 gpu_pch_backlight; /* PCH Backlight PWM value */ +}; + +extern struct chip_operations northbridge_intel_haswell_ops; diff --git a/src/northbridge/intel/haswell/early_init.c b/src/northbridge/intel/haswell/early_init.c new file mode 100644 index 0000000000..b524f2ec3e --- /dev/null +++ b/src/northbridge/intel/haswell/early_init.c @@ -0,0 +1,167 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2010 coresystems GmbH + * Copyright (C) 2011 Google Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> +#include <stdlib.h> +#include <console/console.h> +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <device/pci_def.h> +#include <elog.h> +#include "haswell.h" +#include "pcie_config.c" + +static void haswell_setup_bars(void) +{ + /* Setting up Southbridge. In the northbridge code. */ + printk(BIOS_DEBUG, "Setting up static southbridge registers..."); + pci_write_config32(PCI_DEV(0, 0x1f, 0), RCBA, DEFAULT_RCBA | 1); + + pci_write_config32(PCI_DEV(0, 0x1f, 0), PMBASE, DEFAULT_PMBASE | 1); + pci_write_config8(PCI_DEV(0, 0x1f, 0), 0x44 /* ACPI_CNTL */ , 0x80); /* Enable ACPI BAR */ + + printk(BIOS_DEBUG, " done.\n"); + + printk(BIOS_DEBUG, "Disabling Watchdog reboot..."); + RCBA32(GCS) = RCBA32(GCS) | (1 << 5); /* No reset */ + outw((1 << 11), DEFAULT_PMBASE | 0x60 | 0x08); /* halt timer */ + printk(BIOS_DEBUG, " done.\n"); + + printk(BIOS_DEBUG, "Setting up static northbridge registers..."); + /* Set up all hardcoded northbridge BARs */ + pci_write_config32(PCI_DEV(0, 0x00, 0), EPBAR, DEFAULT_EPBAR | 1); + pci_write_config32(PCI_DEV(0, 0x00, 0), EPBAR + 4, (0LL+DEFAULT_EPBAR) >> 32); + pci_write_config32(PCI_DEV(0, 0x00, 0), MCHBAR, DEFAULT_MCHBAR | 1); + pci_write_config32(PCI_DEV(0, 0x00, 0), MCHBAR + 4, (0LL+DEFAULT_MCHBAR) >> 32); + pci_write_config32(PCI_DEV(0, 0x00, 0), PCIEXBAR, DEFAULT_PCIEXBAR | 5); /* 64MB - busses 0-63 */ + pci_write_config32(PCI_DEV(0, 0x00, 0), PCIEXBAR + 4, (0LL+DEFAULT_PCIEXBAR) >> 32); + pci_write_config32(PCI_DEV(0, 0x00, 0), DMIBAR, DEFAULT_DMIBAR | 1); + pci_write_config32(PCI_DEV(0, 0x00, 0), DMIBAR + 4, (0LL+DEFAULT_DMIBAR) >> 32); + + /* Set C0000-FFFFF to access RAM on both reads and writes */ + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM0, 0x30); + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM1, 0x33); + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM2, 0x33); + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM3, 0x33); + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM4, 0x33); + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM5, 0x33); + pci_write_config8(PCI_DEV(0, 0x00, 0), PAM6, 0x33); + + printk(BIOS_DEBUG, " done.\n"); + +#if CONFIG_ELOG_BOOT_COUNT + /* Increment Boot Counter except when resuming from S3 */ + if ((inw(DEFAULT_PMBASE + PM1_STS) & WAK_STS) && + ((inl(DEFAULT_PMBASE + PM1_CNT) >> 10) & 7) == SLP_TYP_S3) + return; + boot_count_increment(); +#endif +} + +static void haswell_setup_graphics(void) +{ + u32 reg32; + u16 reg16; + u8 reg8; + + reg16 = pci_read_config16(PCI_DEV(0,2,0), PCI_DEVICE_ID); + switch (reg16) { + case 0x0102: /* GT1 Desktop */ + case 0x0106: /* GT1 Mobile */ + case 0x010a: /* GT1 Server */ + case 0x0112: /* GT2 Desktop */ + case 0x0116: /* GT2 Mobile */ + case 0x0122: /* GT2 Desktop >=1.3GHz */ + case 0x0126: /* GT2 Mobile >=1.3GHz */ + case 0x0166: /* IvyBridge ??? */ + break; + default: + printk(BIOS_DEBUG, "Graphics not supported by this CPU/chipset.\n"); + return; + } + + printk(BIOS_DEBUG, "Initializing Graphics...\n"); + + /* Setup IGD memory by setting GGC[7:3] = 1 for 32MB */ + reg16 = pci_read_config16(PCI_DEV(0,0,0), GGC); + reg16 &= ~0x00f8; + reg16 |= 1 << 3; + /* Program GTT memory by setting GGC[9:8] = 2MB */ + reg16 &= ~0x0300; + reg16 |= 2 << 8; + /* Enable VGA decode */ + reg16 &= ~0x0002; + pci_write_config16(PCI_DEV(0,0,0), GGC, reg16); + + /* Enable 256MB aperture */ + reg8 = pci_read_config8(PCI_DEV(0, 2, 0), MSAC); + reg8 &= ~0x06; + reg8 |= 0x02; + pci_write_config8(PCI_DEV(0, 2, 0), MSAC, reg8); + + /* Erratum workarounds */ + reg32 = MCHBAR32(0x5f00); + reg32 |= (1 << 9)|(1 << 10); + MCHBAR32(0x5f00) = reg32; + + /* Enable SA Clock Gating */ + reg32 = MCHBAR32(0x5f00); + MCHBAR32(0x5f00) = reg32 | 1; + + /* GPU RC6 workaround for sighting 366252 */ + reg32 = MCHBAR32(0x5d14); + reg32 |= (1 << 31); + MCHBAR32(0x5d14) = reg32; + + /* VLW */ + reg32 = MCHBAR32(0x6120); + reg32 &= ~(1 << 0); + MCHBAR32(0x6120) = reg32; + + reg32 = MCHBAR32(0x5418); + reg32 |= (1 << 4) | (1 << 5); + MCHBAR32(0x5418) = reg32; +} + +void haswell_early_initialization(int chipset_type) +{ + u32 capid0_a; + u8 reg8; + + /* Device ID Override Enable should be done very early */ + capid0_a = pci_read_config32(PCI_DEV(0, 0, 0), 0xe4); + if (capid0_a & (1 << 10)) { + reg8 = pci_read_config8(PCI_DEV(0, 0, 0), 0xf3); + reg8 &= ~7; /* Clear 2:0 */ + + if (chipset_type == HASWELL_MOBILE) + reg8 |= 1; /* Set bit 0 */ + + pci_write_config8(PCI_DEV(0, 0, 0), 0xf3, reg8); + } + + /* Setup all BARs required for early PCIe and raminit */ + haswell_setup_bars(); + + /* Device Enable */ + pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, DEVEN_HOST | DEVEN_IGD); + + haswell_setup_graphics(); +} diff --git a/src/northbridge/intel/haswell/finalize.c b/src/northbridge/intel/haswell/finalize.c new file mode 100644 index 0000000000..01843c9fee --- /dev/null +++ b/src/northbridge/intel/haswell/finalize.c @@ -0,0 +1,58 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <stdlib.h> +#include "pcie_config.c" +#include "haswell.h" + +#define PCI_DEV_SNB PCI_DEV(0, 0, 0) + +void intel_northbridge_haswell_finalize_smm(void) +{ + pcie_or_config16(PCI_DEV_SNB, 0x50, 1 << 0); /* GGC */ + pcie_or_config32(PCI_DEV_SNB, 0x5c, 1 << 0); /* DPR */ + pcie_or_config32(PCI_DEV_SNB, 0x78, 1 << 10); /* ME */ + pcie_or_config32(PCI_DEV_SNB, 0x90, 1 << 0); /* REMAPBASE */ + pcie_or_config32(PCI_DEV_SNB, 0x98, 1 << 0); /* REMAPLIMIT */ + pcie_or_config32(PCI_DEV_SNB, 0xa0, 1 << 0); /* TOM */ + pcie_or_config32(PCI_DEV_SNB, 0xa8, 1 << 0); /* TOUUD */ + pcie_or_config32(PCI_DEV_SNB, 0xb0, 1 << 0); /* BDSM */ + pcie_or_config32(PCI_DEV_SNB, 0xb4, 1 << 0); /* BGSM */ + pcie_or_config32(PCI_DEV_SNB, 0xb8, 1 << 0); /* TSEGMB */ + pcie_or_config32(PCI_DEV_SNB, 0xbc, 1 << 0); /* TOLUD */ + + MCHBAR32_OR(0x5500, 1 << 0); /* PAVP */ + MCHBAR32_OR(0x5f00, 1 << 31); /* SA PM */ + MCHBAR32_OR(0x6020, 1 << 0); /* UMA GFX */ + MCHBAR32_OR(0x63fc, 1 << 0); /* VTDTRK */ + MCHBAR32_OR(0x6800, 1 << 31); + MCHBAR32_OR(0x7000, 1 << 31); + MCHBAR32_OR(0x77fc, 1 << 0); + + /* Memory Controller Lockdown */ + MCHBAR8(0x50fc) = 0x8f; + + /* Read+write the following */ + MCHBAR32(0x6030) = MCHBAR32(0x6030); + MCHBAR32(0x6034) = MCHBAR32(0x6034); + MCHBAR32(0x6008) = MCHBAR32(0x6008); +} diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c new file mode 100644 index 0000000000..08c13df8bc --- /dev/null +++ b/src/northbridge/intel/haswell/gma.c @@ -0,0 +1,670 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Chromium OS Authors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <console/console.h> +#include <delay.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> + +#include "chip.h" +#include "haswell.h" + +struct gt_powermeter { + u16 reg; + u32 value; +}; + +static const struct gt_powermeter snb_pm_gt1[] = { + { 0xa200, 0xcc000000 }, + { 0xa204, 0x07000040 }, + { 0xa208, 0x0000fe00 }, + { 0xa20c, 0x00000000 }, + { 0xa210, 0x17000000 }, + { 0xa214, 0x00000021 }, + { 0xa218, 0x0817fe19 }, + { 0xa21c, 0x00000000 }, + { 0xa220, 0x00000000 }, + { 0xa224, 0xcc000000 }, + { 0xa228, 0x07000040 }, + { 0xa22c, 0x0000fe00 }, + { 0xa230, 0x00000000 }, + { 0xa234, 0x17000000 }, + { 0xa238, 0x00000021 }, + { 0xa23c, 0x0817fe19 }, + { 0xa240, 0x00000000 }, + { 0xa244, 0x00000000 }, + { 0xa248, 0x8000421e }, + { 0 } +}; + +static const struct gt_powermeter snb_pm_gt2[] = { + { 0xa200, 0x330000a6 }, + { 0xa204, 0x402d0031 }, + { 0xa208, 0x00165f83 }, + { 0xa20c, 0xf1000000 }, + { 0xa210, 0x00000000 }, + { 0xa214, 0x00160016 }, + { 0xa218, 0x002a002b }, + { 0xa21c, 0x00000000 }, + { 0xa220, 0x00000000 }, + { 0xa224, 0x330000a6 }, + { 0xa228, 0x402d0031 }, + { 0xa22c, 0x00165f83 }, + { 0xa230, 0xf1000000 }, + { 0xa234, 0x00000000 }, + { 0xa238, 0x00160016 }, + { 0xa23c, 0x002a002b }, + { 0xa240, 0x00000000 }, + { 0xa244, 0x00000000 }, + { 0xa248, 0x8000421e }, + { 0 } +}; + +static const struct gt_powermeter ivb_pm_gt1[] = { + { 0xa800, 0x00000000 }, + { 0xa804, 0x00021c00 }, + { 0xa808, 0x00000403 }, + { 0xa80c, 0x02001700 }, + { 0xa810, 0x05000200 }, + { 0xa814, 0x00000000 }, + { 0xa818, 0x00690500 }, + { 0xa81c, 0x0000007f }, + { 0xa820, 0x01002501 }, + { 0xa824, 0x00000300 }, + { 0xa828, 0x01000331 }, + { 0xa82c, 0x0000000c }, + { 0xa830, 0x00010016 }, + { 0xa834, 0x01100101 }, + { 0xa838, 0x00010103 }, + { 0xa83c, 0x00041300 }, + { 0xa840, 0x00000b30 }, + { 0xa844, 0x00000000 }, + { 0xa848, 0x7f000000 }, + { 0xa84c, 0x05000008 }, + { 0xa850, 0x00000001 }, + { 0xa854, 0x00000004 }, + { 0xa858, 0x00000007 }, + { 0xa85c, 0x00000000 }, + { 0xa860, 0x00010000 }, + { 0xa248, 0x0000221e }, + { 0xa900, 0x00000000 }, + { 0xa904, 0x00001c00 }, + { 0xa908, 0x00000000 }, + { 0xa90c, 0x06000000 }, + { 0xa910, 0x09000200 }, + { 0xa914, 0x00000000 }, + { 0xa918, 0x00590000 }, + { 0xa91c, 0x00000000 }, + { 0xa920, 0x04002501 }, + { 0xa924, 0x00000100 }, + { 0xa928, 0x03000410 }, + { 0xa92c, 0x00000000 }, + { 0xa930, 0x00020000 }, + { 0xa934, 0x02070106 }, + { 0xa938, 0x00010100 }, + { 0xa93c, 0x00401c00 }, + { 0xa940, 0x00000000 }, + { 0xa944, 0x00000000 }, + { 0xa948, 0x10000e00 }, + { 0xa94c, 0x02000004 }, + { 0xa950, 0x00000001 }, + { 0xa954, 0x00000004 }, + { 0xa960, 0x00060000 }, + { 0xaa3c, 0x00001c00 }, + { 0xaa54, 0x00000004 }, + { 0xaa60, 0x00060000 }, + { 0 } +}; + +static const struct gt_powermeter ivb_pm_gt2[] = { + { 0xa800, 0x10000000 }, + { 0xa804, 0x00033800 }, + { 0xa808, 0x00000902 }, + { 0xa80c, 0x0c002f00 }, + { 0xa810, 0x12000400 }, + { 0xa814, 0x00000000 }, + { 0xa818, 0x00d20800 }, + { 0xa81c, 0x00000002 }, + { 0xa820, 0x03004b02 }, + { 0xa824, 0x00000600 }, + { 0xa828, 0x07000773 }, + { 0xa82c, 0x00000000 }, + { 0xa830, 0x00010032 }, + { 0xa834, 0x1520040d }, + { 0xa838, 0x00020105 }, + { 0xa83c, 0x00083700 }, + { 0xa840, 0x0000151d }, + { 0xa844, 0x00000000 }, + { 0xa848, 0x20001b00 }, + { 0xa84c, 0x0a000010 }, + { 0xa850, 0x00000000 }, + { 0xa854, 0x00000008 }, + { 0xa858, 0x00000008 }, + { 0xa85c, 0x00000000 }, + { 0xa860, 0x00020000 }, + { 0xa248, 0x0000221e }, + { 0xa900, 0x00000000 }, + { 0xa904, 0x00003500 }, + { 0xa908, 0x00000000 }, + { 0xa90c, 0x0c000000 }, + { 0xa910, 0x12000500 }, + { 0xa914, 0x00000000 }, + { 0xa918, 0x00b20000 }, + { 0xa91c, 0x00000000 }, + { 0xa920, 0x08004b02 }, + { 0xa924, 0x00000200 }, + { 0xa928, 0x07000820 }, + { 0xa92c, 0x00000000 }, + { 0xa930, 0x00030000 }, + { 0xa934, 0x050f020d }, + { 0xa938, 0x00020300 }, + { 0xa93c, 0x00903900 }, + { 0xa940, 0x00000000 }, + { 0xa944, 0x00000000 }, + { 0xa948, 0x20001b00 }, + { 0xa94c, 0x0a000010 }, + { 0xa950, 0x00000000 }, + { 0xa954, 0x00000008 }, + { 0xa960, 0x00110000 }, + { 0xaa3c, 0x00003900 }, + { 0xaa54, 0x00000008 }, + { 0xaa60, 0x00110000 }, + { 0 } +}; + +static const struct gt_powermeter ivb_pm_gt2_17w[] = { + { 0xa800, 0x20000000 }, + { 0xa804, 0x000e3800 }, + { 0xa808, 0x00000806 }, + { 0xa80c, 0x0c002f00 }, + { 0xa810, 0x0c000800 }, + { 0xa814, 0x00000000 }, + { 0xa818, 0x00d20d00 }, + { 0xa81c, 0x000000ff }, + { 0xa820, 0x03004b02 }, + { 0xa824, 0x00000600 }, + { 0xa828, 0x07000773 }, + { 0xa82c, 0x00000000 }, + { 0xa830, 0x00020032 }, + { 0xa834, 0x1520040d }, + { 0xa838, 0x00020105 }, + { 0xa83c, 0x00083700 }, + { 0xa840, 0x000016ff }, + { 0xa844, 0x00000000 }, + { 0xa848, 0xff000000 }, + { 0xa84c, 0x0a000010 }, + { 0xa850, 0x00000002 }, + { 0xa854, 0x00000008 }, + { 0xa858, 0x0000000f }, + { 0xa85c, 0x00000000 }, + { 0xa860, 0x00020000 }, + { 0xa248, 0x0000221e }, + { 0xa900, 0x00000000 }, + { 0xa904, 0x00003800 }, + { 0xa908, 0x00000000 }, + { 0xa90c, 0x0c000000 }, + { 0xa910, 0x12000800 }, + { 0xa914, 0x00000000 }, + { 0xa918, 0x00b20000 }, + { 0xa91c, 0x00000000 }, + { 0xa920, 0x08004b02 }, + { 0xa924, 0x00000300 }, + { 0xa928, 0x01000820 }, + { 0xa92c, 0x00000000 }, + { 0xa930, 0x00030000 }, + { 0xa934, 0x15150406 }, + { 0xa938, 0x00020300 }, + { 0xa93c, 0x00903900 }, + { 0xa940, 0x00000000 }, + { 0xa944, 0x00000000 }, + { 0xa948, 0x20001b00 }, + { 0xa94c, 0x0a000010 }, + { 0xa950, 0x00000000 }, + { 0xa954, 0x00000008 }, + { 0xa960, 0x00110000 }, + { 0xaa3c, 0x00003900 }, + { 0xaa54, 0x00000008 }, + { 0xaa60, 0x00110000 }, + { 0 } +}; + +static const struct gt_powermeter ivb_pm_gt2_35w[] = { + { 0xa800, 0x00000000 }, + { 0xa804, 0x00030400 }, + { 0xa808, 0x00000806 }, + { 0xa80c, 0x0c002f00 }, + { 0xa810, 0x0c000300 }, + { 0xa814, 0x00000000 }, + { 0xa818, 0x00d20d00 }, + { 0xa81c, 0x000000ff }, + { 0xa820, 0x03004b02 }, + { 0xa824, 0x00000600 }, + { 0xa828, 0x07000773 }, + { 0xa82c, 0x00000000 }, + { 0xa830, 0x00020032 }, + { 0xa834, 0x1520040d }, + { 0xa838, 0x00020105 }, + { 0xa83c, 0x00083700 }, + { 0xa840, 0x000016ff }, + { 0xa844, 0x00000000 }, + { 0xa848, 0xff000000 }, + { 0xa84c, 0x0a000010 }, + { 0xa850, 0x00000001 }, + { 0xa854, 0x00000008 }, + { 0xa858, 0x00000008 }, + { 0xa85c, 0x00000000 }, + { 0xa860, 0x00020000 }, + { 0xa248, 0x0000221e }, + { 0xa900, 0x00000000 }, + { 0xa904, 0x00003800 }, + { 0xa908, 0x00000000 }, + { 0xa90c, 0x0c000000 }, + { 0xa910, 0x12000800 }, + { 0xa914, 0x00000000 }, + { 0xa918, 0x00b20000 }, + { 0xa91c, 0x00000000 }, + { 0xa920, 0x08004b02 }, + { 0xa924, 0x00000300 }, + { 0xa928, 0x01000820 }, + { 0xa92c, 0x00000000 }, + { 0xa930, 0x00030000 }, + { 0xa934, 0x15150406 }, + { 0xa938, 0x00020300 }, + { 0xa93c, 0x00903900 }, + { 0xa940, 0x00000000 }, + { 0xa944, 0x00000000 }, + { 0xa948, 0x20001b00 }, + { 0xa94c, 0x0a000010 }, + { 0xa950, 0x00000000 }, + { 0xa954, 0x00000008 }, + { 0xa960, 0x00110000 }, + { 0xaa3c, 0x00003900 }, + { 0xaa54, 0x00000008 }, + { 0xaa60, 0x00110000 }, + { 0 } +}; + +/* some vga option roms are used for several chipsets but they only have one + * PCI ID in their header. If we encounter such an option rom, we need to do + * the mapping ourselfes + */ + +u32 map_oprom_vendev(u32 vendev) +{ + u32 new_vendev=vendev; + + switch (vendev) { + case 0x80860102: /* GT1 Desktop */ + case 0x8086010a: /* GT1 Server */ + case 0x80860112: /* GT2 Desktop */ + case 0x80860116: /* GT2 Mobile */ + case 0x80860122: /* GT2 Desktop >=1.3GHz */ + case 0x80860126: /* GT2 Mobile >=1.3GHz */ + case 0x80860166: /* IVB */ + new_vendev=0x80860106; /* GT1 Mobile */ + break; + } + + return new_vendev; +} + +static struct resource *gtt_res = NULL; + +static inline u32 gtt_read(u32 reg) +{ + return read32(gtt_res->base + reg); +} + +static inline void gtt_write(u32 reg, u32 data) +{ + write32(gtt_res->base + reg, data); +} + +static inline void gtt_write_powermeter(const struct gt_powermeter *pm) +{ + for (; pm && pm->reg; pm++) + gtt_write(pm->reg, pm->value); +} + +#define GTT_RETRY 1000 +static int gtt_poll(u32 reg, u32 mask, u32 value) +{ + unsigned try = GTT_RETRY; + u32 data; + + while (try--) { + data = gtt_read(reg); + if ((data & mask) == value) + return 1; + udelay(10); + } + + printk(BIOS_ERR, "GT init timeout\n"); + return 0; +} + +static void gma_pm_init_pre_vbios(struct device *dev) +{ + u32 reg32; + + printk(BIOS_DEBUG, "GT Power Management Init\n"); + + gtt_res = find_resource(dev, PCI_BASE_ADDRESS_0); + if (!gtt_res || !gtt_res->base) + return; + + if (bridge_silicon_revision() < IVB_STEP_C0) { + /* 1: Enable force wake */ + gtt_write(0xa18c, 0x00000001); + gtt_poll(0x130090, (1 << 0), (1 << 0)); + } else { + gtt_write(0xa180, 1 << 5); + gtt_write(0xa188, 0xffff0001); + gtt_poll(0x130040, (1 << 0), (1 << 0)); + } + + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_SNB) { + /* 1d: Set GTT+0x42004 [15:14]=11 (SnB C1+) */ + reg32 = gtt_read(0x42004); + reg32 |= (1 << 14) | (1 << 15); + gtt_write(0x42004, reg32); + } + + if (bridge_silicon_revision() >= IVB_STEP_A0) { + /* Display Reset Acknowledge Settings */ + reg32 = gtt_read(0x45010); + reg32 |= (1 << 1) | (1 << 0); + gtt_write(0x45010, reg32); + } + + /* 2: Get GT SKU from GTT+0x911c[13] */ + reg32 = gtt_read(0x911c); + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_SNB) { + if (reg32 & (1 << 13)) { + printk(BIOS_DEBUG, "SNB GT1 Power Meter Weights\n"); + gtt_write_powermeter(snb_pm_gt1); + } else { + printk(BIOS_DEBUG, "SNB GT2 Power Meter Weights\n"); + gtt_write_powermeter(snb_pm_gt2); + } + } else { + u32 unit = MCHBAR32(0x5938) & 0xf; + + if (reg32 & (1 << 13)) { + /* GT1 SKU */ + printk(BIOS_DEBUG, "IVB GT1 Power Meter Weights\n"); + gtt_write_powermeter(ivb_pm_gt1); + } else { + /* GT2 SKU */ + u32 tdp = MCHBAR32(0x5930) & 0x7fff; + tdp /= (1 << unit); + + if (tdp <= 17) { + /* <=17W ULV */ + printk(BIOS_DEBUG, "IVB GT2 17W " + "Power Meter Weights\n"); + gtt_write_powermeter(ivb_pm_gt2_17w); + } else if ((tdp >= 25) && (tdp <= 35)) { + /* 25W-35W */ + printk(BIOS_DEBUG, "IVB GT2 25W-35W " + "Power Meter Weights\n"); + gtt_write_powermeter(ivb_pm_gt2_35w); + } else { + /* All others */ + printk(BIOS_DEBUG, "IVB GT2 35W " + "Power Meter Weights\n"); + gtt_write_powermeter(ivb_pm_gt2_35w); + } + } + } + + /* 3: Gear ratio map */ + gtt_write(0xa004, 0x00000010); + + /* 4: GFXPAUSE */ + gtt_write(0xa000, 0x00070020); + + /* 5: Dynamic EU trip control */ + gtt_write(0xa080, 0x00000004); + + /* 6: ECO bits */ + reg32 = gtt_read(0xa180); + reg32 |= (1 << 26) | (1 << 31); + /* (bit 20=1 for SNB step D1+ / IVB A0+) */ + if (bridge_silicon_revision() >= SNB_STEP_D1) + reg32 |= (1 << 20); + gtt_write(0xa180, reg32); + + /* 6a: for SnB step D2+ only */ + if (((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_SNB) && + (bridge_silicon_revision() >= SNB_STEP_D2)) { + reg32 = gtt_read(0x9400); + reg32 |= (1 << 7); + gtt_write(0x9400, reg32); + + reg32 = gtt_read(0x941c); + reg32 &= 0xf; + reg32 |= (1 << 1); + gtt_write(0x941c, reg32); + gtt_poll(0x941c, (1 << 1), (0 << 1)); + } + + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_IVB) { + reg32 = gtt_read(0x907c); + reg32 |= (1 << 16); + gtt_write(0x907c, reg32); + + /* 6b: Clocking reset controls */ + gtt_write(0x9424, 0x00000001); + } else { + /* 6b: Clocking reset controls */ + gtt_write(0x9424, 0x00000000); + } + + /* 7 */ + if (gtt_poll(0x138124, (1 << 31), (0 << 31))) { + gtt_write(0x138128, 0x00000029); /* Mailbox Data */ + gtt_write(0x138124, 0x80000004); /* Mailbox Cmd for RC6 VID */ + if (gtt_poll(0x138124, (1 << 31), (0 << 31))) + gtt_write(0x138124, 0x8000000a); + gtt_poll(0x138124, (1 << 31), (0 << 31)); + } + + /* 8 */ + gtt_write(0xa090, 0x00000000); /* RC Control */ + gtt_write(0xa098, 0x03e80000); /* RC1e Wake Rate Limit */ + gtt_write(0xa09c, 0x0028001e); /* RC6/6p Wake Rate Limit */ + gtt_write(0xa0a0, 0x0000001e); /* RC6pp Wake Rate Limit */ + gtt_write(0xa0a8, 0x0001e848); /* RC Evaluation Interval */ + gtt_write(0xa0ac, 0x00000019); /* RC Idle Hysteresis */ + + /* 9 */ + gtt_write(0x2054, 0x0000000a); /* Render Idle Max Count */ + gtt_write(0x12054,0x0000000a); /* Video Idle Max Count */ + gtt_write(0x22054,0x0000000a); /* Blitter Idle Max Count */ + + /* 10 */ + gtt_write(0xa0b0, 0x00000000); /* Unblock Ack to Busy */ + gtt_write(0xa0b4, 0x000003e8); /* RC1e Threshold */ + gtt_write(0xa0b8, 0x0000c350); /* RC6 Threshold */ + gtt_write(0xa0bc, 0x000186a0); /* RC6p Threshold */ + gtt_write(0xa0c0, 0x0000fa00); /* RC6pp Threshold */ + + /* 11 */ + gtt_write(0xa010, 0x000f4240); /* RP Down Timeout */ + gtt_write(0xa014, 0x12060000); /* RP Interrupt Limits */ + gtt_write(0xa02c, 0x00015f90); /* RP Up Threshold */ + gtt_write(0xa030, 0x000186a0); /* RP Down Threshold */ + gtt_write(0xa068, 0x000186a0); /* RP Up EI */ + gtt_write(0xa06c, 0x000493e0); /* RP Down EI */ + gtt_write(0xa070, 0x0000000a); /* RP Idle Hysteresis */ + + /* 11a: Enable Render Standby (RC6) */ + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_IVB) { + /* + * IvyBridge should also support DeepRenderStandby. + * + * Unfortunately it does not work reliably on all SKUs so + * disable it here and it can be enabled by the kernel. + */ + gtt_write(0xa090, 0x88040000); /* HW RC Control */ + } else { + gtt_write(0xa090, 0x88040000); /* HW RC Control */ + } + + /* 12: Normal Frequency Request */ + /* RPNFREQ_VAL comes from MCHBAR 0x5998 23:16 (8 bits!? use 7) */ + reg32 = MCHBAR32(0x5998); + reg32 >>= 16; + reg32 &= 0xef; + reg32 <<= 25; + gtt_write(0xa008, reg32); + + /* 13: RP Control */ + gtt_write(0xa024, 0x00000592); + + /* 14: Enable PM Interrupts */ + gtt_write(0x4402c, 0x03000076); + + /* Clear 0x6c024 [8:6] */ + reg32 = gtt_read(0x6c024); + reg32 &= ~0x000001c0; + gtt_write(0x6c024, reg32); +} + +static void gma_pm_init_post_vbios(struct device *dev) +{ + struct northbridge_intel_haswell_config *conf = dev->chip_info; + u32 reg32; + + printk(BIOS_DEBUG, "GT Power Management Init (post VBIOS)\n"); + + /* 15: Deassert Force Wake */ + if (bridge_silicon_revision() < IVB_STEP_C0) { + gtt_write(0xa18c, gtt_read(0xa18c) & ~1); + gtt_poll(0x130090, (1 << 0), (0 << 0)); + } else { + gtt_write(0xa188, 0x1fffe); + if (gtt_poll(0x130040, (1 << 0), (0 << 0))) + gtt_write(0xa188, gtt_read(0xa188) | 1); + } + + /* 16: SW RC Control */ + gtt_write(0xa094, 0x00060000); + + /* Setup Digital Port Hotplug */ + reg32 = gtt_read(0xc4030); + if (!reg32) { + reg32 = (conf->gpu_dp_b_hotplug & 0x7) << 2; + reg32 |= (conf->gpu_dp_c_hotplug & 0x7) << 10; + reg32 |= (conf->gpu_dp_d_hotplug & 0x7) << 18; + gtt_write(0xc4030, reg32); + } + + /* Setup Panel Power On Delays */ + reg32 = gtt_read(0xc7208); + if (!reg32) { + reg32 = (conf->gpu_panel_port_select & 0x3) << 30; + reg32 |= (conf->gpu_panel_power_up_delay & 0x1fff) << 16; + reg32 |= (conf->gpu_panel_power_backlight_on_delay & 0x1fff); + gtt_write(0xc7208, reg32); + } + + /* Setup Panel Power Off Delays */ + reg32 = gtt_read(0xc720c); + if (!reg32) { + reg32 = (conf->gpu_panel_power_down_delay & 0x1fff) << 16; + reg32 |= (conf->gpu_panel_power_backlight_off_delay & 0x1fff); + gtt_write(0xc720c, reg32); + } + + /* Setup Panel Power Cycle Delay */ + if (conf->gpu_panel_power_cycle_delay) { + reg32 = gtt_read(0xc7210); + reg32 &= ~0xff; + reg32 |= conf->gpu_panel_power_cycle_delay & 0xff; + gtt_write(0xc7210, reg32); + } + + /* Enable Backlight if needed */ + if (conf->gpu_cpu_backlight) { + gtt_write(0x48250, (1 << 31)); + gtt_write(0x48254, conf->gpu_cpu_backlight); + } + if (conf->gpu_pch_backlight) { + gtt_write(0xc8250, (1 << 31)); + gtt_write(0xc8254, conf->gpu_pch_backlight); + } +} + +static void gma_func0_init(struct device *dev) +{ + u32 reg32; + + /* IGD needs to be Bus Master */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO; + pci_write_config32(dev, PCI_COMMAND, reg32); + + /* Init graphics power management */ + gma_pm_init_pre_vbios(dev); + + /* PCI Init, will run VBIOS */ + pci_dev_init(dev); + + /* Post VBIOS init */ + gma_pm_init_post_vbios(dev); +} + +static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations gma_pci_ops = { + .set_subsystem = gma_set_subsystem, +}; + +static struct device_operations gma_func0_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = gma_func0_init, + .scan_bus = 0, + .enable = 0, + .ops_pci = &gma_pci_ops, +}; + +static const unsigned short pci_device_ids[] = { 0x0102, 0x0106, 0x010a, 0x0112, + 0x0116, 0x0122, 0x0126, 0x0166, + 0 }; + +static const struct pci_driver pch_lpc __pci_driver = { + .ops = &gma_func0_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; diff --git a/src/northbridge/intel/haswell/gma.h b/src/northbridge/intel/haswell/gma.h new file mode 100644 index 0000000000..bfa43efcae --- /dev/null +++ b/src/northbridge/intel/haswell/gma.h @@ -0,0 +1,168 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 Chromium OS Authors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* mailbox 0: header */ +typedef struct { + u8 signature[16]; + u32 size; + u32 version; + u8 sbios_version[32]; + u8 vbios_version[16]; + u8 driver_version[16]; + u32 mailboxes; + u8 reserved[164]; +} __attribute__((packed)) opregion_header_t; + +#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem" +#define IGD_OPREGION_VERSION 2 + +#define IGD_MBOX1 (1 << 0) +#define IGD_MBOX2 (1 << 1) +#define IGD_MBOX3 (1 << 2) +#define IGD_MBOX4 (1 << 3) +#define IGD_MBOX5 (1 << 4) + +#define MAILBOXES_MOBILE (IGD_MBOX1 | IGD_MBOX2 | IGD_MBOX3 | \ + IGD_MBOX4 | IGD_MBOX5) +#define MAILBOXES_DESKTOP (IGD_MBOX2 | IGD_MBOX4) + +#define SBIOS_VERSION_SIZE 32 + +/* mailbox 1: public acpi methods */ +typedef struct { + u32 drdy; + u32 csts; + u32 cevt; + u8 reserved1[20]; + u32 didl[8]; + u32 cpdl[8]; + u32 cadl[8]; + u32 nadl[8]; + u32 aslp; + u32 tidx; + u32 chpd; + u32 clid; + u32 cdck; + u32 sxsw; + u32 evts; + u32 cnot; + u32 nrdy; + u8 reserved2[60]; +} __attribute__((packed)) opregion_mailbox1_t; + +/* mailbox 2: software sci interface */ +typedef struct { + u32 scic; + u32 parm; + u32 dslp; + u8 reserved[244]; +} __attribute__((packed)) opregion_mailbox2_t; + +/* mailbox 3: power conservation */ +typedef struct { + u32 ardy; + u32 aslc; + u32 tche; + u32 alsi; + u32 bclp; + u32 pfit; + u32 cblv; + u16 bclm[20]; + u32 cpfm; + u32 epfm; + u8 plut[74]; + u32 pfmb; + u32 ccdv; + u32 pcft; + u8 reserved[94]; +} __attribute__((packed)) opregion_mailbox3_t; + +#define IGD_BACKLIGHT_BRIGHTNESS 0xff +#define IGD_INITIAL_BRIGHTNESS 0x64 + +#define IGD_FIELD_VALID (1 << 31) +#define IGD_WORD_FIELD_VALID (1 << 15) +#define IGD_PFIT_STRETCH 6 + +/* mailbox 4: vbt */ +typedef struct { + u8 gvd1[7168]; +} __attribute__((packed)) opregion_vbt_t; + +/* IGD OpRegion */ +typedef struct { + opregion_header_t header; + opregion_mailbox1_t mailbox1; + opregion_mailbox2_t mailbox2; + opregion_mailbox3_t mailbox3; + opregion_vbt_t vbt; +} __attribute__((packed)) igd_opregion_t; + +/* Intel Video BIOS (Option ROM) */ +typedef struct { + u16 signature; + u8 size; + u8 reserved[21]; + u16 pcir_offset; + u16 vbt_offset; +} __attribute__((packed)) optionrom_header_t; + +#define OPROM_SIGNATURE 0xaa55 + +typedef struct { + u32 signature; + u16 vendor; + u16 device; + u16 reserved1; + u16 length; + u8 revision; + u8 classcode[3]; + u16 imagelength; + u16 coderevision; + u8 codetype; + u8 indicator; + u16 reserved2; +} __attribute__((packed)) optionrom_pcir_t; + +typedef struct { + u8 hdr_signature[20]; + u16 hdr_version; + u16 hdr_size; + u16 hdr_vbt_size; + u8 hdr_vbt_checksum; + u8 hdr_reserved; + u32 hdr_vbt_datablock; + u32 hdr_aim[4]; + u8 datahdr_signature[16]; + u16 datahdr_version; + u16 datahdr_size; + u16 datahdr_datablocksize; + u8 coreblock_id; + u16 coreblock_size; + u16 coreblock_biossize; + u8 coreblock_biostype; + u8 coreblock_releasestatus; + u8 coreblock_hwsupported; + u8 coreblock_integratedhw; + u8 coreblock_biosbuild[4]; + u8 coreblock_biossignon[155]; +} __attribute__((packed)) optionrom_vbt_t; + +#define VBT_SIGNATURE 0x54425624 + diff --git a/src/northbridge/intel/haswell/haswell.h b/src/northbridge/intel/haswell/haswell.h new file mode 100644 index 0000000000..967a186e81 --- /dev/null +++ b/src/northbridge/intel/haswell/haswell.h @@ -0,0 +1,243 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2008 coresystems GmbH + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ +#define __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ 1 + +/* Chipset types */ +#define HASWELL_MOBILE 0 +#define HASWELL_DESKTOP 1 +#define HASWELL_SERVER 2 + +/* Device ID for SandyBridge and IvyBridge */ +#define BASE_REV_SNB 0x00 +#define BASE_REV_IVB 0x50 +#define BASE_REV_MASK 0x50 + +/* SandyBridge CPU stepping */ +#define SNB_STEP_D0 (BASE_REV_SNB + 5) /* Also J0 */ +#define SNB_STEP_D1 (BASE_REV_SNB + 6) +#define SNB_STEP_D2 (BASE_REV_SNB + 7) /* Also J1/Q0 */ + +/* IvyBridge CPU stepping */ +#define IVB_STEP_A0 (BASE_REV_IVB + 0) +#define IVB_STEP_B0 (BASE_REV_IVB + 2) +#define IVB_STEP_C0 (BASE_REV_IVB + 4) +#define IVB_STEP_K0 (BASE_REV_IVB + 5) +#define IVB_STEP_D0 (BASE_REV_IVB + 6) + +/* Intel Enhanced Debug region must be 4MB */ +#define IED_SIZE 0x400000 + +/* Northbridge BARs */ +#define DEFAULT_PCIEXBAR CONFIG_MMCONF_BASE_ADDRESS /* 4 KB per PCIe device */ +#define DEFAULT_MCHBAR 0xfed10000 /* 16 KB */ +#define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */ +#define DEFAULT_EPBAR 0xfed19000 /* 4 KB */ + +#include <southbridge/intel/lynxpoint/pch.h> + +/* Everything below this line is ignored in the DSDT */ +#ifndef __ACPI__ + +/* Device 0:0.0 PCI configuration space (Host Bridge) */ + +#define EPBAR 0x40 +#define MCHBAR 0x48 +#define PCIEXBAR 0x60 +#define DMIBAR 0x68 +#define X60BAR 0x60 + +#define GGC 0x50 /* GMCH Graphics Control */ + +#define DEVEN 0x54 /* Device Enable */ +#define DEVEN_PEG60 (1 << 13) +#define DEVEN_IGD (1 << 4) +#define DEVEN_PEG10 (1 << 3) +#define DEVEN_PEG11 (1 << 2) +#define DEVEN_PEG12 (1 << 1) +#define DEVEN_HOST (1 << 0) + +#define PAM0 0x80 +#define PAM1 0x81 +#define PAM2 0x82 +#define PAM3 0x83 +#define PAM4 0x84 +#define PAM5 0x85 +#define PAM6 0x86 + +#define LAC 0x87 /* Legacy Access Control */ +#define SMRAM 0x88 /* System Management RAM Control */ +#define D_OPEN (1 << 6) +#define D_CLS (1 << 5) +#define D_LCK (1 << 4) +#define G_SMRAME (1 << 3) +#define C_BASE_SEG ((0 << 2) | (1 << 1) | (0 << 0)) + +#define TOM 0xa0 +#define TOUUD 0xa8 /* Top of Upper Usable DRAM */ +#define TSEG 0xb8 /* TSEG base */ +#define TOLUD 0xbc /* Top of Low Used Memory */ + +#define SKPAD 0xdc /* Scratchpad Data */ + +/* Device 0:1.0 PCI configuration space (PCI Express) */ + +#define BCTRL1 0x3e /* 16bit */ + + +/* Device 0:2.0 PCI configuration space (Graphics Device) */ + +#define MSAC 0x62 /* Multi Size Aperture Control */ +#define SWSCI 0xe8 /* SWSCI enable */ +#define ASLS 0xfc /* OpRegion Base */ + +/* + * MCHBAR + */ + +#define MCHBAR8(x) *((volatile u8 *)(DEFAULT_MCHBAR + x)) +#define MCHBAR16(x) *((volatile u16 *)(DEFAULT_MCHBAR + x)) +#define MCHBAR32(x) *((volatile u32 *)(DEFAULT_MCHBAR + x)) +#define MCHBAR32_OR(x, or) MCHBAR32(x) = (MCHBAR32(x) | (or)) + +#define SSKPD 0x5d14 /* 16bit (scratchpad) */ +#define BIOS_RESET_CPL 0x5da8 /* 8bit */ + +/* + * EPBAR - Egress Port Root Complex Register Block + */ + +#define EPBAR8(x) *((volatile u8 *)(DEFAULT_EPBAR + x)) +#define EPBAR16(x) *((volatile u16 *)(DEFAULT_EPBAR + x)) +#define EPBAR32(x) *((volatile u32 *)(DEFAULT_EPBAR + x)) + +#define EPPVCCAP1 0x004 /* 32bit */ +#define EPPVCCAP2 0x008 /* 32bit */ + +#define EPVC0RCAP 0x010 /* 32bit */ +#define EPVC0RCTL 0x014 /* 32bit */ +#define EPVC0RSTS 0x01a /* 16bit */ + +#define EPVC1RCAP 0x01c /* 32bit */ +#define EPVC1RCTL 0x020 /* 32bit */ +#define EPVC1RSTS 0x026 /* 16bit */ + +#define EPVC1MTS 0x028 /* 32bit */ +#define EPVC1IST 0x038 /* 64bit */ + +#define EPESD 0x044 /* 32bit */ + +#define EPLE1D 0x050 /* 32bit */ +#define EPLE1A 0x058 /* 64bit */ +#define EPLE2D 0x060 /* 32bit */ +#define EPLE2A 0x068 /* 64bit */ + +#define PORTARB 0x100 /* 256bit */ + +/* + * DMIBAR + */ + +#define DMIBAR8(x) *((volatile u8 *)(DEFAULT_DMIBAR + x)) +#define DMIBAR16(x) *((volatile u16 *)(DEFAULT_DMIBAR + x)) +#define DMIBAR32(x) *((volatile u32 *)(DEFAULT_DMIBAR + x)) + +#define DMIVCECH 0x000 /* 32bit */ +#define DMIPVCCAP1 0x004 /* 32bit */ +#define DMIPVCCAP2 0x008 /* 32bit */ + +#define DMIPVCCCTL 0x00c /* 16bit */ + +#define DMIVC0RCAP 0x010 /* 32bit */ +#define DMIVC0RCTL0 0x014 /* 32bit */ +#define DMIVC0RSTS 0x01a /* 16bit */ + +#define DMIVC1RCAP 0x01c /* 32bit */ +#define DMIVC1RCTL 0x020 /* 32bit */ +#define DMIVC1RSTS 0x026 /* 16bit */ + +#define DMILE1D 0x050 /* 32bit */ +#define DMILE1A 0x058 /* 64bit */ +#define DMILE2D 0x060 /* 32bit */ +#define DMILE2A 0x068 /* 64bit */ + +#define DMILCAP 0x084 /* 32bit */ +#define DMILCTL 0x088 /* 16bit */ +#define DMILSTS 0x08a /* 16bit */ + +#define DMICTL1 0x0f0 /* 32bit */ +#define DMICTL2 0x0fc /* 32bit */ + +#define DMICC 0x208 /* 32bit */ + +#define DMIDRCCFG 0xeb4 /* 32bit */ + +#ifndef __ASSEMBLER__ +static inline void barrier(void) { asm("" ::: "memory"); } + +struct ied_header { + char signature[10]; + u32 size; + u8 reserved[34]; +} __attribute__ ((packed)); + +#define PCI_DEVICE_ID_SB 0x0104 +#define PCI_DEVICE_ID_IB 0x0154 + +#ifdef __SMM__ +void intel_northbridge_haswell_finalize_smm(void); +#else /* !__SMM__ */ +int bridge_silicon_revision(void); +void haswell_early_initialization(int chipset_type); +void haswell_late_initialization(void); + +/* debugging functions */ +void print_pci_devices(void); +void dump_pci_device(unsigned dev); +void dump_pci_devices(void); +void dump_spd_registers(void); +void dump_mem(unsigned start, unsigned end); +void report_platform_info(void); +#endif /* !__SMM__ */ + + +#define MRC_DATA_ALIGN 0x1000 +#define MRC_DATA_SIGNATURE (('M'<<0)|('R'<<8)|('C'<<16)|('D'<<24)) + +struct mrc_data_container { + u32 mrc_signature; // "MRCD" + u32 mrc_data_size; // Actual total size of this structure + u32 mrc_checksum; // IP style checksum + u32 reserved; // For header alignment + u8 mrc_data[0]; // Variable size, platform/run time dependent. +} __attribute__ ((packed)); + +struct mrc_data_container *find_current_mrc_cache(void); +#if !defined(__PRE_RAM__) +void update_mrc_cache(void); + +#include "gma.h" +int init_igd_opregion(igd_opregion_t *igd_opregion); +#endif + +#endif +#endif +#endif diff --git a/src/northbridge/intel/haswell/mrccache.c b/src/northbridge/intel/haswell/mrccache.c new file mode 100644 index 0000000000..032bae4131 --- /dev/null +++ b/src/northbridge/intel/haswell/mrccache.c @@ -0,0 +1,245 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> +#include <string.h> +#include <console/console.h> +#include <cbfs.h> +#include <ip_checksum.h> +#include <device/device.h> +#include <cbmem.h> +#include "pei_data.h" +#include "haswell.h" +#include <spi-generic.h> +#include <spi_flash.h> +#if CONFIG_CHROMEOS +#include <vendorcode/google/chromeos/fmap.h> +#endif + +/* convert a pointer to flash area into the offset inside the flash */ +static inline u32 to_flash_offset(void *p) { + return ((u32)p + CONFIG_ROM_SIZE); +} + +static struct mrc_data_container *next_mrc_block( + struct mrc_data_container *mrc_cache) +{ + /* MRC data blocks are aligned within the region */ + u32 mrc_size = sizeof(*mrc_cache) + mrc_cache->mrc_data_size; + if (mrc_size & (MRC_DATA_ALIGN - 1UL)) { + mrc_size &= ~(MRC_DATA_ALIGN - 1UL); + mrc_size += MRC_DATA_ALIGN; + } + + u8 *region_ptr = (u8*)mrc_cache; + region_ptr += mrc_size; + return (struct mrc_data_container *)region_ptr; +} + +static int is_mrc_cache(struct mrc_data_container *mrc_cache) +{ + return (!!mrc_cache) && (mrc_cache->mrc_signature == MRC_DATA_SIGNATURE); +} + +/* Right now, the offsets for the MRC cache area are hard-coded in the + * northbridge Kconfig if CONFIG_CHROMEOS is not set. In order to make + * this more flexible, there are two of options: + * - Have each mainboard Kconfig supply a hard-coded offset + * - Use CBFS + */ +static u32 get_mrc_cache_region(struct mrc_data_container **mrc_region_ptr) +{ + u32 region_size; +#if CONFIG_CHROMEOS + region_size = find_fmap_entry("RW_MRC_CACHE", (void **)mrc_region_ptr); +#else + region_size = CONFIG_MRC_CACHE_SIZE; + *mrc_region_ptr = (struct mrc_data_container *) + (CONFIG_MRC_CACHE_BASE + CONFIG_MRC_CACHE_LOCATION); +#endif + + return region_size; +} + +/* + * Find the largest index block in the MRC cache. Return NULL if non is + * found. + */ +static struct mrc_data_container *find_current_mrc_cache_local + (struct mrc_data_container *mrc_cache, u32 region_size) +{ + u32 region_end; + u32 entry_id = 0; + struct mrc_data_container *mrc_next = mrc_cache; + + region_end = (u32) mrc_cache + region_size; + + /* Search for the last filled entry in the region */ + while (is_mrc_cache(mrc_next)) { + entry_id++; + mrc_cache = mrc_next; + mrc_next = next_mrc_block(mrc_next); + if ((u32)mrc_next >= region_end) { + /* Stay in the MRC data region */ + break; + } + } + + if (entry_id == 0) { + printk(BIOS_ERR, "%s: No valid MRC cache found.\n", __func__); + return NULL; + } + + /* Verify checksum */ + if (mrc_cache->mrc_checksum != + compute_ip_checksum(mrc_cache->mrc_data, + mrc_cache->mrc_data_size)) { + printk(BIOS_ERR, "%s: MRC cache checksum mismatch\n", __func__); + return NULL; + } + + printk(BIOS_DEBUG, "%s: picked entry %u from cache block\n", __func__, + entry_id - 1); + + return mrc_cache; +} + +/* SPI code needs malloc/free. + * Also unknown if writing flash from XIP-flash code is a good idea + */ +#if !defined(__PRE_RAM__) +/* find the first empty block in the MRC cache area. + * If there's none, return NULL. + * + * @mrc_cache_base - base address of the MRC cache area + * @mrc_cache - current entry (for which we need to find next) + * @region_size - total size of the MRC cache area + */ +static struct mrc_data_container *find_next_mrc_cache + (struct mrc_data_container *mrc_cache_base, + struct mrc_data_container *mrc_cache, + u32 region_size) +{ + u32 region_end = (u32) mrc_cache_base + region_size; + + mrc_cache = next_mrc_block(mrc_cache); + if ((u32)mrc_cache >= region_end) { + /* Crossed the boundary */ + mrc_cache = NULL; + printk(BIOS_DEBUG, "%s: no available entries found\n", + __func__); + } else { + printk(BIOS_DEBUG, + "%s: picked next entry from cache block at %p\n", + __func__, mrc_cache); + } + + return mrc_cache; +} + +void update_mrc_cache(void) +{ + printk(BIOS_DEBUG, "Updating MRC cache data.\n"); + struct mrc_data_container *current = cbmem_find(CBMEM_ID_MRCDATA); + struct mrc_data_container *cache, *cache_base; + u32 cache_size; + + if (!current) { + printk(BIOS_ERR, "No MRC cache in cbmem. Can't update flash.\n"); + return; + } + if (current->mrc_data_size == -1) { + printk(BIOS_ERR, "MRC cache data in cbmem invalid.\n"); + return; + } + + cache_size = get_mrc_cache_region(&cache_base); + if (cache_base == NULL) { + printk(BIOS_ERR, "%s: could not find MRC cache area\n", + __func__); + return; + } + + /* + * we need to: + */ + // 0. compare MRC data to last mrc-cache block (exit if same) + cache = find_current_mrc_cache_local(cache_base, cache_size); + + if (cache && (cache->mrc_data_size == current->mrc_data_size) && + (memcmp(cache, current, cache->mrc_data_size) == 0)) { + printk(BIOS_DEBUG, + "MRC data in flash is up to date. No update.\n"); + return; + } + + // 1. use spi_flash_probe() to find the flash, then + spi_init(); + struct spi_flash *flash = spi_flash_probe(0, 0, 1000000, SPI_MODE_3); + if (!flash) { + printk(BIOS_DEBUG, "Could not find SPI device\n"); + return; + } + + // 2. look up the first unused block + if (cache) + cache = find_next_mrc_cache(cache_base, cache, cache_size); + + /* + * 3. if no such place exists, erase entire mrc-cache range & use + * block 0. First time around the erase is not needed, but this is a + * small overhead for simpler code. + */ + if (!cache) { + printk(BIOS_DEBUG, + "Need to erase the MRC cache region of %d bytes at %p\n", + cache_size, cache_base); + + flash->erase(flash, to_flash_offset(cache_base), cache_size); + + /* we will start at the beginning again */ + cache = cache_base; + } + // 4. write mrc data with flash->write() + printk(BIOS_DEBUG, "Finally: write MRC cache update to flash at %p\n", + cache); + flash->write(flash, to_flash_offset(cache), + current->mrc_data_size + sizeof(*current), current); +} +#endif + +struct mrc_data_container *find_current_mrc_cache(void) +{ + struct mrc_data_container *cache_base; + u32 cache_size; + + cache_size = get_mrc_cache_region(&cache_base); + if (cache_base == NULL) { + printk(BIOS_ERR, "%s: could not find MRC cache area\n", + __func__); + return NULL; + } + + /* + * we need to: + */ + // 0. compare MRC data to last mrc-cache block (exit if same) + return find_current_mrc_cache_local(cache_base, cache_size); +} + diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c new file mode 100644 index 0000000000..1c6a8fce8b --- /dev/null +++ b/src/northbridge/intel/haswell/northbridge.c @@ -0,0 +1,512 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <arch/acpi.h> +#include <arch/io.h> +#include <stdint.h> +#include <delay.h> +#include <cpu/intel/haswell/haswell.h> +#include <cpu/x86/msr.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include <device/hypertransport.h> +#include <stdlib.h> +#include <string.h> +#include <cpu/cpu.h> +#include <boot/tables.h> +#include <cbmem.h> +#include "chip.h" +#include "haswell.h" + +static int bridge_revision_id = -1; + +int bridge_silicon_revision(void) +{ + if (bridge_revision_id < 0) { + uint8_t stepping = cpuid_eax(1) & 0xf; + uint8_t bridge_id = pci_read_config16( + dev_find_slot(0, PCI_DEVFN(0, 0)), + PCI_DEVICE_ID) & 0xf0; + bridge_revision_id = bridge_id | stepping; + } + return bridge_revision_id; +} + +/* Reserve everything between A segment and 1MB: + * + * 0xa0000 - 0xbffff: legacy VGA + * 0xc0000 - 0xcffff: VGA OPROM (needed by kernel) + * 0xe0000 - 0xfffff: SeaBIOS, if used, otherwise DMI + */ +static const int legacy_hole_base_k = 0xa0000 / 1024; +static const int legacy_hole_size_k = 384; + +void cbmem_post_handling(void) +{ + update_mrc_cache(); +} + +static int get_pcie_bar(u32 *base, u32 *len) +{ + device_t dev; + u32 pciexbar_reg; + + *base = 0; + *len = 0; + + dev = dev_find_slot(0, PCI_DEVFN(0, 0)); + if (!dev) + return 0; + + pciexbar_reg = pci_read_config32(dev, PCIEXBAR); + + if (!(pciexbar_reg & (1 << 0))) + return 0; + + switch ((pciexbar_reg >> 1) & 3) { + case 0: // 256MB + *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)); + *len = 256 * 1024 * 1024; + return 1; + case 1: // 128M + *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)); + *len = 128 * 1024 * 1024; + return 1; + case 2: // 64M + *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)|(1 << 26)); + *len = 64 * 1024 * 1024; + return 1; + } + + return 0; +} + +static void add_fixed_resources(struct device *dev, int index) +{ + struct resource *resource; + u32 pcie_config_base, pcie_config_size; + + printk(BIOS_DEBUG, "Adding UMA memory area base=0x%llx " + "size=0x%llx\n", uma_memory_base, uma_memory_size); + resource = new_resource(dev, index); + resource->base = (resource_t) uma_memory_base; + resource->size = (resource_t) uma_memory_size; + resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE | + IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED; + + /* Clear these values here so they don't get used by MTRR code */ + uma_memory_base = 0; + uma_memory_size = 0; + + if (get_pcie_bar(&pcie_config_base, &pcie_config_size)) { + printk(BIOS_DEBUG, "Adding PCIe config bar base=0x%08x " + "size=0x%x\n", pcie_config_base, pcie_config_size); + resource = new_resource(dev, index+1); + resource->base = (resource_t) pcie_config_base; + resource->size = (resource_t) pcie_config_size; + resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE | + IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED; + } + + mmio_resource(dev, index++, legacy_hole_base_k, legacy_hole_size_k); + +#if CONFIG_CHROMEOS_RAMOOPS + mmio_resource(dev, index++, CONFIG_CHROMEOS_RAMOOPS_RAM_START >> 10, + CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE >> 10); +#endif + + /* Required for SandyBridge sighting 3715511 */ + bad_ram_resource(dev, index++, 0x20000000 >> 10, 0x00200000 >> 10); + bad_ram_resource(dev, index++, 0x40000000 >> 10, 0x00200000 >> 10); +} + +static void pci_domain_set_resources(device_t dev) +{ + uint64_t tom, me_base, touud; + uint32_t tseg_base, uma_size, tolud; + uint16_t ggc; + unsigned long long tomk; + + /* Total Memory 2GB example: + * + * 00000000 0000MB-1992MB 1992MB RAM (writeback) + * 7c800000 1992MB-2000MB 8MB TSEG (SMRR) + * 7d000000 2000MB-2002MB 2MB GFX GTT (uncached) + * 7d200000 2002MB-2034MB 32MB GFX UMA (uncached) + * 7f200000 2034MB TOLUD + * 7f800000 2040MB MEBASE + * 7f800000 2040MB-2048MB 8MB ME UMA (uncached) + * 80000000 2048MB TOM + * 100000000 4096MB-4102MB 6MB RAM (writeback) + * + * Total Memory 4GB example: + * + * 00000000 0000MB-2768MB 2768MB RAM (writeback) + * ad000000 2768MB-2776MB 8MB TSEG (SMRR) + * ad800000 2776MB-2778MB 2MB GFX GTT (uncached) + * ada00000 2778MB-2810MB 32MB GFX UMA (uncached) + * afa00000 2810MB TOLUD + * ff800000 4088MB MEBASE + * ff800000 4088MB-4096MB 8MB ME UMA (uncached) + * 100000000 4096MB TOM + * 100000000 4096MB-5374MB 1278MB RAM (writeback) + * 14fe00000 5368MB TOUUD + */ + + /* Top of Upper Usable DRAM, including remap */ + touud = pci_read_config32(dev, TOUUD+4); + touud <<= 32; + touud |= pci_read_config32(dev, TOUUD); + + /* Top of Lower Usable DRAM */ + tolud = pci_read_config32(dev, TOLUD); + + /* Top of Memory - does not account for any UMA */ + tom = pci_read_config32(dev, 0xa4); + tom <<= 32; + tom |= pci_read_config32(dev, 0xa0); + + printk(BIOS_DEBUG, "TOUUD 0x%llx TOLUD 0x%08x TOM 0x%llx\n", + touud, tolud, tom); + + /* ME UMA needs excluding if total memory <4GB */ + me_base = pci_read_config32(dev, 0x74); + me_base <<= 32; + me_base |= pci_read_config32(dev, 0x70); + + printk(BIOS_DEBUG, "MEBASE 0x%llx\n", me_base); + + tomk = tolud >> 10; + if (me_base == tolud) { + /* ME is from MEBASE-TOM */ + uma_size = (tom - me_base) >> 10; + /* Increment TOLUD to account for ME as RAM */ + tolud += uma_size << 10; + /* UMA starts at old TOLUD */ + uma_memory_base = tomk * 1024ULL; + uma_memory_size = uma_size * 1024ULL; + printk(BIOS_DEBUG, "ME UMA base 0x%llx size %uM\n", + me_base, uma_size >> 10); + } + + /* Graphics memory comes next */ + ggc = pci_read_config16(dev, GGC); + if (!(ggc & 2)) { + printk(BIOS_DEBUG, "IGD decoded, subtracting "); + + /* Graphics memory */ + uma_size = ((ggc >> 3) & 0x1f) * 32 * 1024ULL; + printk(BIOS_DEBUG, "%uM UMA", uma_size >> 10); + tomk -= uma_size; + uma_memory_base = tomk * 1024ULL; + uma_memory_size += uma_size * 1024ULL; + + /* GTT Graphics Stolen Memory Size (GGMS) */ + uma_size = ((ggc >> 8) & 0x3) * 1024ULL; + tomk -= uma_size; + uma_memory_base = tomk * 1024ULL; + uma_memory_size += uma_size * 1024ULL; + printk(BIOS_DEBUG, " and %uM GTT\n", uma_size >> 10); + } + + /* Calculate TSEG size from its base which must be below GTT */ + tseg_base = pci_read_config32(dev, 0xb8); + uma_size = (uma_memory_base - tseg_base) >> 10; + tomk -= uma_size; + uma_memory_base = tomk * 1024ULL; + uma_memory_size += uma_size * 1024ULL; + printk(BIOS_DEBUG, "TSEG base 0x%08x size %uM\n", + tseg_base, uma_size >> 10); + + printk(BIOS_INFO, "Available memory below 4GB: %lluM\n", tomk >> 10); + + /* Report the memory regions */ + ram_resource(dev, 3, 0, legacy_hole_base_k); + ram_resource(dev, 4, legacy_hole_base_k + legacy_hole_size_k, + (tomk - (legacy_hole_base_k + legacy_hole_size_k))); + + /* + * If >= 4GB installed then memory from TOLUD to 4GB + * is remapped above TOM, TOUUD will account for both + */ + touud >>= 10; /* Convert to KB */ + if (touud > 4096 * 1024) { + ram_resource(dev, 5, 4096 * 1024, touud - (4096 * 1024)); + printk(BIOS_INFO, "Available memory above 4GB: %lluM\n", + (touud >> 10) - 4096); + } + + add_fixed_resources(dev, 6); + + assign_resources(dev->link_list); + + /* Leave some space for ACPI, PIRQ and MP tables */ + high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE; + high_tables_size = HIGH_MEMORY_SIZE; +} + + /* TODO We could determine how many PCIe busses we need in + * the bar. For now that number is hardcoded to a max of 64. + * See e7525/northbridge.c for an example. + */ +static struct device_operations pci_domain_ops = { + .read_resources = pci_domain_read_resources, + .set_resources = pci_domain_set_resources, + .enable_resources = NULL, + .init = NULL, + .scan_bus = pci_domain_scan_bus, +#if CONFIG_MMCONF_SUPPORT_DEFAULT + .ops_pci_bus = &pci_ops_mmconf, +#else + .ops_pci_bus = &pci_cf8_conf1, +#endif +}; + +static void mc_read_resources(device_t dev) +{ + struct resource *resource; + + pci_dev_read_resources(dev); + + /* So, this is one of the big mysteries in the coreboot resource + * allocator. This resource should make sure that the address space + * of the PCIe memory mapped config space bar. But it does not. + */ + + /* We use 0xcf as an unused index for our PCIe bar so that we find it again */ + resource = new_resource(dev, 0xcf); + resource->base = DEFAULT_PCIEXBAR; + resource->size = 64 * 1024 * 1024; /* 64MB hard coded PCIe config space */ + resource->flags = + IORESOURCE_MEM | IORESOURCE_FIXED | IORESOURCE_STORED | + IORESOURCE_ASSIGNED; + printk(BIOS_DEBUG, "Adding PCIe enhanced config space BAR 0x%08lx-0x%08lx.\n", + (unsigned long)(resource->base), (unsigned long)(resource->base + resource->size)); +} + +static void mc_set_resources(device_t dev) +{ + struct resource *resource; + + /* Report the PCIe BAR */ + resource = find_resource(dev, 0xcf); + if (resource) { + report_resource_stored(dev, resource, "<mmconfig>"); + } + + /* And call the normal set_resources */ + pci_dev_set_resources(dev); +} + +static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static void northbridge_dmi_init(struct device *dev) +{ + u32 reg32; + + /* Clear error status bits */ + DMIBAR32(0x1c4) = 0xffffffff; + DMIBAR32(0x1d0) = 0xffffffff; + + /* Steps prior to DMI ASPM */ + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_SNB) { + reg32 = DMIBAR32(0x250); + reg32 &= ~((1 << 22)|(1 << 20)); + reg32 |= (1 << 21); + DMIBAR32(0x250) = reg32; + } + + reg32 = DMIBAR32(0x238); + reg32 |= (1 << 29); + DMIBAR32(0x238) = reg32; + + if (bridge_silicon_revision() >= SNB_STEP_D0) { + reg32 = DMIBAR32(0x1f8); + reg32 |= (1 << 16); + DMIBAR32(0x1f8) = reg32; + } else if (bridge_silicon_revision() >= SNB_STEP_D1) { + reg32 = DMIBAR32(0x1f8); + reg32 &= ~(1 << 26); + reg32 |= (1 << 16); + DMIBAR32(0x1f8) = reg32; + + reg32 = DMIBAR32(0x1fc); + reg32 |= (1 << 12) | (1 << 23); + DMIBAR32(0x1fc) = reg32; + } + + /* Enable ASPM on SNB link, should happen before PCH link */ + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_SNB) { + reg32 = DMIBAR32(0xd04); + reg32 |= (1 << 4); + DMIBAR32(0xd04) = reg32; + } + + reg32 = DMIBAR32(0x88); + reg32 |= (1 << 1) | (1 << 0); + DMIBAR32(0x88) = reg32; +} + +static void northbridge_init(struct device *dev) +{ + u8 bios_reset_cpl; + u32 bridge_type; + + northbridge_dmi_init(dev); + + bridge_type = MCHBAR32(0x5f10); + bridge_type &= ~0xff; + + if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_IVB) { + /* Enable Power Aware Interrupt Routing */ + u8 pair = MCHBAR8(0x5418); + pair &= ~0xf; /* Clear 3:0 */ + pair |= 0x4; /* Fixed Priority */ + MCHBAR8(0x5418) = pair; + + /* 30h for IvyBridge */ + bridge_type |= 0x30; + } else { + /* 20h for Sandybridge */ + bridge_type |= 0x20; + } + MCHBAR32(0x5f10) = bridge_type; + + /* + * Set bit 0 of BIOS_RESET_CPL to indicate to the CPU + * that BIOS has initialized memory and power management + */ + bios_reset_cpl = MCHBAR8(BIOS_RESET_CPL); + bios_reset_cpl |= 1; + MCHBAR8(BIOS_RESET_CPL) = bios_reset_cpl; + printk(BIOS_DEBUG, "Set BIOS_RESET_CPL\n"); + + /* Configure turbo power limits 1ms after reset complete bit */ + mdelay(1); + set_power_limits(28); + + /* + * CPUs with configurable TDP also need power limits set + * in MCHBAR. Use same values from MSR_PKG_POWER_LIMIT. + */ + if (cpu_config_tdp_levels()) { + msr_t msr = rdmsr(MSR_PKG_POWER_LIMIT); + MCHBAR32(0x59A0) = msr.lo; + MCHBAR32(0x59A4) = msr.hi; + } + + /* Set here before graphics PM init */ + MCHBAR32(0x5500) = 0x00100001; +} + +static void northbridge_enable(device_t dev) +{ +#if CONFIG_HAVE_ACPI_RESUME + switch (pci_read_config32(dev, SKPAD)) { + case 0xcafebabe: + printk(BIOS_DEBUG, "Normal boot.\n"); + acpi_slp_type=0; + break; + case 0xcafed00d: + printk(BIOS_DEBUG, "S3 Resume.\n"); + acpi_slp_type=3; + break; + default: + printk(BIOS_DEBUG, "Unknown boot method, assuming normal.\n"); + acpi_slp_type=0; + break; + } +#endif +} + +static struct pci_operations intel_pci_ops = { + .set_subsystem = intel_set_subsystem, +}; + +static struct device_operations mc_ops = { + .read_resources = mc_read_resources, + .set_resources = mc_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = northbridge_init, + .enable = northbridge_enable, + .scan_bus = 0, + .ops_pci = &intel_pci_ops, +}; + +static const struct pci_driver mc_driver_0100 __pci_driver = { + .ops = &mc_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x0100, +}; + +static const struct pci_driver mc_driver __pci_driver = { + .ops = &mc_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x0104, /* Sandy bridge */ +}; + +static const struct pci_driver mc_driver_1 __pci_driver = { + .ops = &mc_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x0154, /* Ivy bridge */ +}; + +static void cpu_bus_init(device_t dev) +{ + initialize_cpus(dev->link_list); +} + +static void cpu_bus_noop(device_t dev) +{ +} + +static struct device_operations cpu_bus_ops = { + .read_resources = cpu_bus_noop, + .set_resources = cpu_bus_noop, + .enable_resources = cpu_bus_noop, + .init = cpu_bus_init, + .scan_bus = 0, +}; + +static void enable_dev(device_t dev) +{ + /* Set the operations if it is a special bus type */ + if (dev->path.type == DEVICE_PATH_DOMAIN) { + dev->ops = &pci_domain_ops; + } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { + dev->ops = &cpu_bus_ops; + } +} + +struct chip_operations northbridge_intel_haswell_ops = { + CHIP_NAME("Intel i7 (Haswell) integrated Northbridge") + .enable_dev = enable_dev, +}; diff --git a/src/northbridge/intel/haswell/pcie_config.c b/src/northbridge/intel/haswell/pcie_config.c new file mode 100644 index 0000000000..d96854e739 --- /dev/null +++ b/src/northbridge/intel/haswell/pcie_config.c @@ -0,0 +1,89 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "haswell.h" + +static inline __attribute__ ((always_inline)) +u8 pcie_read_config8(device_t dev, unsigned int where) +{ + unsigned long addr; + addr = DEFAULT_PCIEXBAR | dev | where; + return read8(addr); +} + +static inline __attribute__ ((always_inline)) +u16 pcie_read_config16(device_t dev, unsigned int where) +{ + unsigned long addr; + addr = DEFAULT_PCIEXBAR | dev | where; + return read16(addr); +} + +static inline __attribute__ ((always_inline)) +u32 pcie_read_config32(device_t dev, unsigned int where) +{ + unsigned long addr; + addr = DEFAULT_PCIEXBAR | dev | where; + return read32(addr); +} + +static inline __attribute__ ((always_inline)) +void pcie_write_config8(device_t dev, unsigned int where, u8 value) +{ + unsigned long addr; + addr = DEFAULT_PCIEXBAR | dev | where; + write8(addr, value); +} + +static inline __attribute__ ((always_inline)) +void pcie_write_config16(device_t dev, unsigned int where, u16 value) +{ + unsigned long addr; + addr = DEFAULT_PCIEXBAR | dev | where; + write16(addr, value); +} + +static inline __attribute__ ((always_inline)) +void pcie_write_config32(device_t dev, unsigned int where, u32 value) +{ + unsigned long addr; + addr = DEFAULT_PCIEXBAR | dev | where; + write32(addr, value); +} + +static inline __attribute__ ((always_inline)) +void pcie_or_config8(device_t dev, unsigned int where, u8 ormask) +{ + u8 value = pcie_read_config8(dev, where); + pcie_write_config8(dev, where, value | ormask); +} + +static inline __attribute__ ((always_inline)) +void pcie_or_config16(device_t dev, unsigned int where, u16 ormask) +{ + u16 value = pcie_read_config16(dev, where); + pcie_write_config16(dev, where, value | ormask); +} + +static inline __attribute__ ((always_inline)) +void pcie_or_config32(device_t dev, unsigned int where, u32 ormask) +{ + u32 value = pcie_read_config32(dev, where); + pcie_write_config32(dev, where, value | ormask); +} diff --git a/src/northbridge/intel/haswell/pei_data.h b/src/northbridge/intel/haswell/pei_data.h new file mode 100644 index 0000000000..8c907c1db8 --- /dev/null +++ b/src/northbridge/intel/haswell/pei_data.h @@ -0,0 +1,115 @@ +/* + * coreboot UEFI PEI wrapper + * + * Copyright (c) 2011, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Google Inc. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef PEI_DATA_H +#define PEI_DATA_H + +typedef void (*tx_byte_func)(unsigned char byte); +#define PEI_VERSION 4 +struct pei_data +{ + uint32_t pei_version; + uint32_t mchbar; + uint32_t dmibar; + uint32_t epbar; + uint32_t pciexbar; + uint16_t smbusbar; + uint32_t wdbbar; + uint32_t wdbsize; + uint32_t hpet_address; + uint32_t rcba; + uint32_t pmbase; + uint32_t gpiobase; + uint32_t thermalbase; + uint32_t system_type; // 0 Mobile, 1 Desktop/Server + uint32_t tseg_size; + uint8_t spd_addresses[4]; + uint8_t ts_addresses[4]; + int boot_mode; + int ec_present; + // 0 = leave channel enabled + // 1 = disable dimm 0 on channel + // 2 = disable dimm 1 on channel + // 3 = disable dimm 0+1 on channel + int dimm_channel0_disabled; + int dimm_channel1_disabled; + /* Seed values saved in CMOS */ + uint32_t scrambler_seed; + uint32_t scrambler_seed_s3; + /* Data read from flash and passed into MRC */ + unsigned char *mrc_input; + unsigned int mrc_input_len; + /* Data from MRC that should be saved to flash */ + unsigned char *mrc_output; + unsigned int mrc_output_len; + /* + * Max frequency DDR3 could be ran at. Could be one of four values: + * 800, 1067, 1333, 1600 + */ + uint32_t max_ddr3_freq; + /* + * USB Port Configuration: + * [0] = enable + * [1] = overcurrent pin + * [2] = length + * + * Ports 0-7 can be mapped to OC0-OC3 + * Ports 8-13 can be mapped to OC4-OC7 + * + * Port Length + * MOBILE: + * < 0x050 = Setting 1 (back panel, 1-5in, lowest tx amplitude) + * < 0x140 = Setting 2 (back panel, 5-14in, highest tx amplitude) + * DESKTOP: + * < 0x080 = Setting 1 (front/back panel, <8in, lowest tx amplitude) + * < 0x130 = Setting 2 (back panel, 8-13in, higher tx amplitude) + * < 0x150 = Setting 3 (back panel, 13-15in, higest tx amplitude) + */ + uint16_t usb_port_config[16][3]; + /* SPD data array for onboard RAM. Specify address 0xf0, + * 0xf1, 0xf2, 0xf3 to index one of the 4 slots in + * spd_address for a given "DIMM". + */ + uint8_t spd_data[4][256]; + tx_byte_func tx_byte; + int ddr3lv_support; + /* pcie_init needs to be set to 1 to have the system agent initialize + * PCIe. Note: This should only be required if your system has Gen3 devices + * and it will increase your boot time by at least 100ms. + */ + int pcie_init; + /* N mode functionality. Leave this setting at 0. + * 0 Auto + * 1 1N + * 2 2N + */ + int nmode; +} __attribute__((packed)); + +#endif diff --git a/src/northbridge/intel/haswell/raminit.c b/src/northbridge/intel/haswell/raminit.c new file mode 100644 index 0000000000..b45682596e --- /dev/null +++ b/src/northbridge/intel/haswell/raminit.c @@ -0,0 +1,307 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <string.h> +#include <arch/hlt.h> +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <cbmem.h> +#include <arch/cbfs.h> +#include <cbfs.h> +#include <ip_checksum.h> +#include <pc80/mc146818rtc.h> +#include <device/pci_def.h> +#include "raminit.h" +#include "pei_data.h" +#include "haswell.h" + +/* Management Engine is in the southbridge */ +#include "southbridge/intel/lynxpoint/me.h" +#if CONFIG_CHROMEOS +#include <vendorcode/google/chromeos/chromeos.h> +#else +#define recovery_mode_enabled(x) 0 +#endif + +/* + * MRC scrambler seed offsets should be reserved in + * mainboard cmos.layout and not covered by checksum. + */ +#if CONFIG_USE_OPTION_TABLE +#include "option_table.h" +#define CMOS_OFFSET_MRC_SEED (CMOS_VSTART_mrc_scrambler_seed >> 3) +#define CMOS_OFFSET_MRC_SEED_S3 (CMOS_VSTART_mrc_scrambler_seed_s3 >> 3) +#define CMOS_OFFSET_MRC_SEED_CHK (CMOS_VSTART_mrc_scrambler_seed_chk >> 3) +#else +#define CMOS_OFFSET_MRC_SEED 152 +#define CMOS_OFFSET_MRC_SEED_S3 156 +#define CMOS_OFFSET_MRC_SEED_CHK 160 +#endif + +static void save_mrc_data(struct pei_data *pei_data) +{ + u16 c1, c2, checksum; + +#if CONFIG_EARLY_CBMEM_INIT + struct mrc_data_container *mrcdata; + int output_len = ALIGN(pei_data->mrc_output_len, 16); + + /* Save the MRC S3 restore data to cbmem */ + cbmem_initialize(); + mrcdata = cbmem_add + (CBMEM_ID_MRCDATA, + output_len + sizeof(struct mrc_data_container)); + + printk(BIOS_DEBUG, "Relocate MRC DATA from %p to %p (%u bytes)\n", + pei_data->mrc_output, mrcdata, output_len); + + mrcdata->mrc_signature = MRC_DATA_SIGNATURE; + mrcdata->mrc_data_size = output_len; + mrcdata->reserved = 0; + memcpy(mrcdata->mrc_data, pei_data->mrc_output, + pei_data->mrc_output_len); + + /* Zero the unused space in aligned buffer. */ + if (output_len > pei_data->mrc_output_len) + memset(mrcdata->mrc_data+pei_data->mrc_output_len, 0, + output_len - pei_data->mrc_output_len); + + mrcdata->mrc_checksum = compute_ip_checksum(mrcdata->mrc_data, + mrcdata->mrc_data_size); +#endif + + /* Save the MRC seed values to CMOS */ + cmos_write32(CMOS_OFFSET_MRC_SEED, pei_data->scrambler_seed); + printk(BIOS_DEBUG, "Save scrambler seed 0x%08x to CMOS 0x%02x\n", + pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); + + cmos_write32(CMOS_OFFSET_MRC_SEED_S3, pei_data->scrambler_seed_s3); + printk(BIOS_DEBUG, "Save s3 scrambler seed 0x%08x to CMOS 0x%02x\n", + pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); + + /* Save a simple checksum of the seed values */ + c1 = compute_ip_checksum((u8*)&pei_data->scrambler_seed, + sizeof(u32)); + c2 = compute_ip_checksum((u8*)&pei_data->scrambler_seed_s3, + sizeof(u32)); + checksum = add_ip_checksums(sizeof(u32), c1, c2); + + cmos_write(checksum & 0xff, CMOS_OFFSET_MRC_SEED_CHK); + cmos_write((checksum >> 8) & 0xff, CMOS_OFFSET_MRC_SEED_CHK+1); +} + +static void prepare_mrc_cache(struct pei_data *pei_data) +{ + struct mrc_data_container *mrc_cache; + u16 c1, c2, checksum, seed_checksum; + + // preset just in case there is an error + pei_data->mrc_input = NULL; + pei_data->mrc_input_len = 0; + + /* Read scrambler seeds from CMOS */ + pei_data->scrambler_seed = cmos_read32(CMOS_OFFSET_MRC_SEED); + printk(BIOS_DEBUG, "Read scrambler seed 0x%08x from CMOS 0x%02x\n", + pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); + + pei_data->scrambler_seed_s3 = cmos_read32(CMOS_OFFSET_MRC_SEED_S3); + printk(BIOS_DEBUG, "Read S3 scrambler seed 0x%08x from CMOS 0x%02x\n", + pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); + + /* Compute seed checksum and compare */ + c1 = compute_ip_checksum((u8*)&pei_data->scrambler_seed, + sizeof(u32)); + c2 = compute_ip_checksum((u8*)&pei_data->scrambler_seed_s3, + sizeof(u32)); + checksum = add_ip_checksums(sizeof(u32), c1, c2); + + seed_checksum = cmos_read(CMOS_OFFSET_MRC_SEED_CHK); + seed_checksum |= cmos_read(CMOS_OFFSET_MRC_SEED_CHK+1) << 8; + + if (checksum != seed_checksum) { + printk(BIOS_ERR, "%s: invalid seed checksum\n", __func__); + pei_data->scrambler_seed = 0; + pei_data->scrambler_seed_s3 = 0; + return; + } + + if ((mrc_cache = find_current_mrc_cache()) == NULL) { + /* error message printed in find_current_mrc_cache */ + return; + } + + pei_data->mrc_input = mrc_cache->mrc_data; + pei_data->mrc_input_len = mrc_cache->mrc_data_size; + + printk(BIOS_DEBUG, "%s: at %p, size %x checksum %04x\n", + __func__, pei_data->mrc_input, + pei_data->mrc_input_len, mrc_cache->mrc_checksum); +} + +static const char* ecc_decoder[] = { + "inactive", + "active on IO", + "disabled on IO", + "active" +}; + +/* + * Dump in the log memory controller configuration as read from the memory + * controller registers. + */ +static void report_memory_config(void) +{ + u32 addr_decoder_common, addr_decode_ch[2]; + int i; + + addr_decoder_common = MCHBAR32(0x5000); + addr_decode_ch[0] = MCHBAR32(0x5004); + addr_decode_ch[1] = MCHBAR32(0x5008); + + printk(BIOS_DEBUG, "memcfg DDR3 clock %d MHz\n", + (MCHBAR32(0x5e04) * 13333 * 2 + 50)/100); + printk(BIOS_DEBUG, "memcfg channel assignment: A: %d, B % d, C % d\n", + addr_decoder_common & 3, + (addr_decoder_common >> 2) & 3, + (addr_decoder_common >> 4) & 3); + + for (i = 0; i < ARRAY_SIZE(addr_decode_ch); i++) { + u32 ch_conf = addr_decode_ch[i]; + printk(BIOS_DEBUG, "memcfg channel[%d] config (%8.8x):\n", + i, ch_conf); + printk(BIOS_DEBUG, " ECC %s\n", + ecc_decoder[(ch_conf >> 24) & 3]); + printk(BIOS_DEBUG, " enhanced interleave mode %s\n", + ((ch_conf >> 22) & 1) ? "on" : "off"); + printk(BIOS_DEBUG, " rank interleave %s\n", + ((ch_conf >> 21) & 1) ? "on" : "off"); + printk(BIOS_DEBUG, " DIMMA %d MB width x%d %s rank%s\n", + ((ch_conf >> 0) & 0xff) * 256, + ((ch_conf >> 19) & 1) ? 16 : 8, + ((ch_conf >> 17) & 1) ? "dual" : "single", + ((ch_conf >> 16) & 1) ? "" : ", selected"); + printk(BIOS_DEBUG, " DIMMB %d MB width x%d %s rank%s\n", + ((ch_conf >> 8) & 0xff) * 256, + ((ch_conf >> 20) & 1) ? 16 : 8, + ((ch_conf >> 18) & 1) ? "dual" : "single", + ((ch_conf >> 16) & 1) ? ", selected" : ""); + } +} + +/** + * Find PEI executable in coreboot filesystem and execute it. + * + * @param pei_data: configuration data for UEFI PEI reference code + */ +void sdram_initialize(struct pei_data *pei_data) +{ + struct sys_info sysinfo; + unsigned long entry; + + report_platform_info(); + + /* Wait for ME to be ready */ + intel_early_me_init(); + intel_early_me_uma_size(); + + printk(BIOS_DEBUG, "Starting UEFI PEI System Agent\n"); + + memset(&sysinfo, 0, sizeof(sysinfo)); + + sysinfo.boot_path = pei_data->boot_mode; + + /* + * Do not pass MRC data in for recovery mode boot, + * Always pass it in for S3 resume. + */ + if (!recovery_mode_enabled() || pei_data->boot_mode == 2) + prepare_mrc_cache(pei_data); + + /* If MRC data is not found we cannot continue S3 resume. */ + if (pei_data->boot_mode == 2 && !pei_data->mrc_input) { + printk(BIOS_DEBUG, "Giving up in sdram_initialize: No MRC data\n"); + outb(0x6, 0xcf9); + while(1) { + hlt(); + } + } + + /* Pass console handler in pei_data */ + pei_data->tx_byte = console_tx_byte; + + /* Locate and call UEFI System Agent binary. */ + entry = (unsigned long)cbfs_get_file_content( + CBFS_DEFAULT_MEDIA, "mrc.bin", 0xab); + if (entry) { + int rv; + asm volatile ( + "call *%%ecx\n\t" + :"=a" (rv) : "c" (entry), "a" (pei_data)); + if (rv) { + switch (rv) { + case -1: + printk(BIOS_ERR, "PEI version mismatch.\n"); + break; + case -2: + printk(BIOS_ERR, "Invalid memory frequency.\n"); + break; + default: + printk(BIOS_ERR, "MRC returned %x.\n", rv); + } + die("Nonzero MRC return value.\n"); + } + } else { + die("UEFI PEI System Agent not found.\n"); + } + + /* For reference print the System Agent version + * after executing the UEFI PEI stage. + */ + u32 version = MCHBAR32(0x5034); + printk(BIOS_DEBUG, "System Agent Version %d.%d.%d Build %d\n", + version >> 24 , (version >> 16) & 0xff, + (version >> 8) & 0xff, version & 0xff); + + /* Send ME init done for SandyBridge here. This is done + * inside the SystemAgent binary on IvyBridge. */ + if (BASE_REV_SNB == + (pci_read_config16(PCI_CPU_DEVICE, PCI_DEVICE_ID) & BASE_REV_MASK)) + intel_early_me_init_done(ME_INIT_STATUS_SUCCESS); + else + intel_early_me_status(); + + report_memory_config(); + + /* S3 resume: don't save scrambler seed or MRC data */ + if (pei_data->boot_mode != 2) + save_mrc_data(pei_data); +} + +struct cbmem_entry *get_cbmem_toc(void) +{ + return (struct cbmem_entry *)(get_top_of_ram() - HIGH_MEMORY_SIZE); +} + +unsigned long get_top_of_ram(void) +{ + /* Base of TSEG is top of usable DRAM */ + u32 tom = pci_read_config32(PCI_DEV(0,0,0), TSEG); + return (unsigned long) tom; +} diff --git a/src/northbridge/intel/haswell/raminit.h b/src/northbridge/intel/haswell/raminit.h new file mode 100644 index 0000000000..958e983243 --- /dev/null +++ b/src/northbridge/intel/haswell/raminit.h @@ -0,0 +1,36 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2010 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef RAMINIT_H +#define RAMINIT_H + +#include "pei_data.h" + +struct sys_info { + u8 boot_path; +#define BOOT_PATH_NORMAL 0 +#define BOOT_PATH_RESET 1 +#define BOOT_PATH_RESUME 2 +} __attribute__ ((packed)); + +void sdram_initialize(struct pei_data *pei_data); +unsigned long get_top_of_ram(void); +int fixup_haswell_errata(void); + +#endif /* RAMINIT_H */ diff --git a/src/northbridge/intel/haswell/report_platform.c b/src/northbridge/intel/haswell/report_platform.c new file mode 100644 index 0000000000..c65bbe5faa --- /dev/null +++ b/src/northbridge/intel/haswell/report_platform.c @@ -0,0 +1,112 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <arch/cpu.h> +#include <string.h> +#include "southbridge/intel/lynxpoint/pch.h" +#include <arch/io.h> +#include <arch/io.h> +#include <cpu/x86/msr.h> +#include <arch/romcc_io.h> +#include "haswell.h" + +static void report_cpu_info(void) +{ + struct cpuid_result cpuidr; + u32 i, index; + char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */ + int vt, txt, aes; + msr_t microcode_ver; + const char *mode[] = {"NOT ", ""}; + + index = 0x80000000; + cpuidr = cpuid(index); + if (cpuidr.eax < 0x80000004) { + strcpy(cpu_string, "Platform info not available"); + } else { + u32 *p = (u32*) cpu_string; + for (i = 2; i <= 4 ; i++) { + cpuidr = cpuid(index + i); + *p++ = cpuidr.eax; + *p++ = cpuidr.ebx; + *p++ = cpuidr.ecx; + *p++ = cpuidr.edx; + } + } + /* Skip leading spaces in CPU name string */ + while (cpu_name[0] == ' ') + cpu_name++; + + microcode_ver.lo = 0; + microcode_ver.hi = 0; + wrmsr(0x8B, microcode_ver); + cpuidr = cpuid(1); + microcode_ver = rdmsr(0x8b); + printk(BIOS_DEBUG, "CPU id(%x) ucode:%08x %s\n", cpuidr.eax, microcode_ver.hi, cpu_name); + aes = (cpuidr.ecx & (1 << 25)) ? 1 : 0; + txt = (cpuidr.ecx & (1 << 6)) ? 1 : 0; + vt = (cpuidr.ecx & (1 << 5)) ? 1 : 0; + printk(BIOS_DEBUG, "AES %ssupported, TXT %ssupported, VT %ssupported\n", + mode[aes], mode[txt], mode[vt]); +} + +/* The PCI id name match comes from Intel document 472178 */ +static struct { + u16 dev_id; + const char *dev_name; +} pch_table [] = { + {0x8c41, "Mobile Engineering Sample"}, + {0x8c42, "Desktop Engineering Sample"}, + {0x8c46, "Z87"}, + {0x8c49, "Z85"}, + {0x8c4a, "HM86"}, + {0x8c4b, "H87"}, + {0x8c4c, "Q85"}, + {0x8c4e, "Q87"}, + {0x8c4f, "QM87"}, + {0x8c50, "B85"}, + {0x8c52, "C222"}, + {0x8c54, "C224"}, + {0x8c56, "C226"}, + {0x8c5c, "H81"}, +}; + +static void report_pch_info(void) +{ + int i; + u16 dev_id = pci_read_config16(PCH_LPC_DEV, 2); + + + const char *pch_type = "Unknown"; + for (i = 0; i < ARRAY_SIZE(pch_table); i++) { + if (pch_table[i].dev_id == dev_id) { + pch_type = pch_table[i].dev_name; + break; + } + } + printk (BIOS_DEBUG, "PCH type: %s, device id: %x, rev id %x\n", + pch_type, dev_id, pci_read_config8(PCH_LPC_DEV, 8)); +} + +void report_platform_info(void) +{ + report_cpu_info(); + report_pch_info(); +} diff --git a/src/northbridge/intel/haswell/udelay.c b/src/northbridge/intel/haswell/udelay.c new file mode 100644 index 0000000000..864e83915c --- /dev/null +++ b/src/northbridge/intel/haswell/udelay.c @@ -0,0 +1,66 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2008 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <delay.h> +#include <stdint.h> +#include <cpu/x86/tsc.h> +#include <cpu/x86/msr.h> + +/** + * Intel SandyBridge/IvyBridge CPUs always run the TSC at BCLK=100MHz + */ + +/* Simple 32- to 64-bit multiplication. Uses 16-bit words to avoid overflow. */ +static inline void multiply_to_tsc(tsc_t *const tsc, const u32 a, const u32 b) +{ + tsc->lo = (a & 0xffff) * (b & 0xffff); + tsc->hi = ((tsc->lo >> 16) + + ((a & 0xffff) * (b >> 16)) + + ((b & 0xffff) * (a >> 16))); + tsc->lo = ((tsc->hi & 0xffff) << 16) | (tsc->lo & 0xffff); + tsc->hi = ((a >> 16) * (b >> 16)) + (tsc->hi >> 16); +} + +void udelay(u32 us) +{ + u32 dword; + tsc_t tsc, tsc1, tscd; + msr_t msr; + u32 fsb = 100, divisor; + u32 d; /* ticks per us */ + + msr = rdmsr(0xce); + divisor = (msr.lo >> 8) & 0xff; + + d = fsb * divisor; /* On Core/Core2 this is divided by 4 */ + multiply_to_tsc(&tscd, us, d); + + tsc1 = rdtsc(); + dword = tsc1.lo + tscd.lo; + if ((dword < tsc1.lo) || (dword < tscd.lo)) { + tsc1.hi++; + } + tsc1.lo = dword; + tsc1.hi += tscd.hi; + + do { + tsc = rdtsc(); + } while ((tsc.hi < tsc1.hi) + || ((tsc.hi == tsc1.hi) && (tsc.lo <= tsc1.lo))); +} diff --git a/src/southbridge/intel/Kconfig b/src/southbridge/intel/Kconfig index bb539ad604..5637c4ac1b 100644 --- a/src/southbridge/intel/Kconfig +++ b/src/southbridge/intel/Kconfig @@ -12,3 +12,4 @@ source src/southbridge/intel/i82870/Kconfig source src/southbridge/intel/pxhd/Kconfig source src/southbridge/intel/sch/Kconfig source src/southbridge/intel/bd82x6x/Kconfig +source src/southbridge/intel/lynxpoint/Kconfig diff --git a/src/southbridge/intel/Makefile.inc b/src/southbridge/intel/Makefile.inc index 75f4322574..ba3b1d4d39 100644 --- a/src/southbridge/intel/Makefile.inc +++ b/src/southbridge/intel/Makefile.inc @@ -13,3 +13,4 @@ subdirs-$(CONFIG_SOUTHBRIDGE_INTEL_PXHD) += pxhd subdirs-$(CONFIG_SOUTHBRIDGE_INTEL_SCH) += sch subdirs-$(CONFIG_SOUTHBRIDGE_INTEL_BD82X6X) += bd82x6x subdirs-$(CONFIG_SOUTHBRIDGE_INTEL_C216) += bd82x6x +subdirs-$(CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT) += lynxpoint diff --git a/src/southbridge/intel/lynxpoint/Kconfig b/src/southbridge/intel/lynxpoint/Kconfig new file mode 100644 index 0000000000..e1d0e3591d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/Kconfig @@ -0,0 +1,54 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2011 Google Inc. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; version 2 of the License. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## + +config SOUTHBRIDGE_INTEL_LYNXPOINT + bool + +if SOUTHBRIDGE_INTEL_LYNXPOINT + +config SOUTH_BRIDGE_OPTIONS # dummy + def_bool y + select IOAPIC + select HAVE_HARD_RESET + select HAVE_USBDEBUG + select USE_WATCHDOG_ON_BOOT + select PCIEXP_ASPM + select PCIEXP_COMMON_CLOCK + select SPI_FLASH + +config EHCI_BAR + hex + default 0xfef00000 + +config EHCI_DEBUG_OFFSET + hex + default 0xa0 + +config BOOTBLOCK_SOUTHBRIDGE_INIT + string + default "southbridge/intel/lynxpoint/bootblock.c" + +config SERIRQ_CONTINUOUS_MODE + bool + default n + help + If you set this option to y, the serial IRQ machine will be + operated in continuous mode. + +endif diff --git a/src/southbridge/intel/lynxpoint/Makefile.inc b/src/southbridge/intel/lynxpoint/Makefile.inc new file mode 100644 index 0000000000..d4522c35fd --- /dev/null +++ b/src/southbridge/intel/lynxpoint/Makefile.inc @@ -0,0 +1,71 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2010 Google Inc. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; version 2 of the License. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## + +# Run an intermediate step when producing coreboot.rom +# that adds additional components to the final firmware +# image outside of CBFS +# FIXME, uncomment as soon as we have ME firmware in the blobs repo +# INTERMEDIATE:=lynxpoint_add_me + +ramstage-y += pch.c +ramstage-y += azalia.c +ramstage-y += lpc.c +ramstage-y += pci.c +ramstage-y += pcie.c +ramstage-y += sata.c +ramstage-y += usb_ehci.c +ramstage-y += me_9.x.c +ramstage-y += smbus.c + +ramstage-y += me_status.c +ramstage-y += reset.c +ramstage-y += watchdog.c +ramstage-y += acpi.c + +ramstage-$(CONFIG_ELOG) += elog.c +ramstage-y += spi.c +smm-$(CONFIG_SPI_FLASH_SMM) += spi.c + +ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c +smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c me_9.x.c finalize.c + +romstage-y += early_usb.c early_smbus.c early_me.c me_status.c gpio.c +romstage-$(CONFIG_USBDEBUG) += usb_debug.c +romstage-y += reset.c early_spi.c + +lynxpoint_add_me: $(obj)/coreboot.pre $(IFDTOOL) + printf " DD Adding Intel Firmware Descriptor\n" + dd if=3rdparty/mainboard/$(MAINBOARDDIR)/descriptor.bin \ + of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1 + printf " IFDTOOL me.bin -> coreboot.pre\n" + $(objutil)/ifdtool/ifdtool \ + -i ME:3rdparty/mainboard/$(MAINBOARDDIR)/me.bin \ + $(obj)/coreboot.pre + mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre +ifeq ($(CONFIG_LOCK_MANAGEMENT_ENGINE),y) + printf " IFDTOOL Locking Management Engine\n" + $(objutil)/ifdtool/ifdtool -l $(obj)/coreboot.pre + mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre +else + printf " IFDTOOL Unlocking Management Engine\n" + $(objutil)/ifdtool/ifdtool -u $(obj)/coreboot.pre + mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre +endif + +PHONY += lynxpoint_add_me diff --git a/src/southbridge/intel/lynxpoint/acpi.c b/src/southbridge/intel/lynxpoint/acpi.c new file mode 100644 index 0000000000..4118b9df6d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi.c @@ -0,0 +1,55 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2012 Chromium OS Authors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <types.h> +#include <string.h> +#include "pch.h" + +void acpi_create_intel_hpet(acpi_hpet_t * hpet) +{ + acpi_header_t *header = &(hpet->header); + acpi_addr_t *addr = &(hpet->addr); + + memset((void *) hpet, 0, sizeof(acpi_hpet_t)); + + /* fill out header fields */ + memcpy(header->signature, "HPET", 4); + memcpy(header->oem_id, OEM_ID, 6); + memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8); + memcpy(header->asl_compiler_id, ASLC, 4); + + header->length = sizeof(acpi_hpet_t); + header->revision = 1; + + /* fill out HPET address */ + addr->space_id = 0; /* Memory */ + addr->bit_width = 64; + addr->bit_offset = 0; + addr->addrl = (unsigned long long)HPET_ADDR & 0xffffffff; + addr->addrh = (unsigned long long)HPET_ADDR >> 32; + + hpet->id = 0x8086a201; /* Intel */ + hpet->number = 0x00; + hpet->min_tick = 0x0080; + + header->checksum = + acpi_checksum((void *) hpet, sizeof(acpi_hpet_t)); +} + diff --git a/src/southbridge/intel/lynxpoint/acpi/audio.asl b/src/southbridge/intel/lynxpoint/acpi/audio.asl new file mode 100644 index 0000000000..a4553289f2 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/audio.asl @@ -0,0 +1,36 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* Intel PCH HDA */ + +// Intel High Definition Audio (Azalia) 0:1b.0 + +Device (HDEF) +{ + Name (_ADR, 0x001b0000) + + // Power Resources for Wake + Name (_PRW, Package(){ + 13, // Bit 13 of GPE + 4 // Can wake from S4 state. + }) +} + diff --git a/src/southbridge/intel/lynxpoint/acpi/globalnvs.asl b/src/southbridge/intel/lynxpoint/acpi/globalnvs.asl new file mode 100644 index 0000000000..2fe092d952 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/globalnvs.asl @@ -0,0 +1,287 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2012 The Chromium OS Authors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* Global Variables */ + +Name(\PICM, 0) // IOAPIC/8259 +Name(\DSEN, 1) // Display Output Switching Enable + +/* Global ACPI memory region. This region is used for passing information + * between coreboot (aka "the system bios"), ACPI, and the SMI handler. + * Since we don't know where this will end up in memory at ACPI compile time, + * we have to fix it up in coreboot's ACPI creation phase. + */ + + +OperationRegion (GNVS, SystemMemory, 0xC0DEBABE, 0xf00) +Field (GNVS, ByteAcc, NoLock, Preserve) +{ + /* Miscellaneous */ + Offset (0x00), + OSYS, 16, // 0x00 - Operating System + SMIF, 8, // 0x02 - SMI function + PRM0, 8, // 0x03 - SMI function parameter + PRM1, 8, // 0x04 - SMI function parameter + SCIF, 8, // 0x05 - SCI function + PRM2, 8, // 0x06 - SCI function parameter + PRM3, 8, // 0x07 - SCI function parameter + LCKF, 8, // 0x08 - Global Lock function for EC + PRM4, 8, // 0x09 - Lock function parameter + PRM5, 8, // 0x0a - Lock function parameter + P80D, 32, // 0x0b - Debug port (IO 0x80) value + LIDS, 8, // 0x0f - LID state (open = 1) + PWRS, 8, // 0x10 - Power State (AC = 1) + /* Thermal policy */ + Offset (0x11), + TLVL, 8, // 0x11 - Throttle Level Limit + FLVL, 8, // 0x12 - Current FAN Level + TCRT, 8, // 0x13 - Critical Threshold + TPSV, 8, // 0x14 - Passive Threshold + TMAX, 8, // 0x15 - CPU Tj_max + F0OF, 8, // 0x16 - FAN 0 OFF Threshold + F0ON, 8, // 0x17 - FAN 0 ON Threshold + F0PW, 8, // 0x18 - FAN 0 PWM value + F1OF, 8, // 0x19 - FAN 1 OFF Threshold + F1ON, 8, // 0x1a - FAN 1 ON Threshold + F1PW, 8, // 0x1b - FAN 1 PWM value + F2OF, 8, // 0x1c - FAN 2 OFF Threshold + F2ON, 8, // 0x1d - FAN 2 ON Threshold + F2PW, 8, // 0x1e - FAN 2 PWM value + F3OF, 8, // 0x1f - FAN 3 OFF Threshold + F3ON, 8, // 0x20 - FAN 3 ON Threshold + F3PW, 8, // 0x21 - FAN 3 PWM value + F4OF, 8, // 0x22 - FAN 4 OFF Threshold + F4ON, 8, // 0x23 - FAN 4 ON Threshold + F4PW, 8, // 0x24 - FAN 4 PWM value + TMPS, 8, // 0x25 - Temperature Sensor ID + /* Processor Identification */ + Offset (0x28), + APIC, 8, // 0x28 - APIC Enabled by coreboot + MPEN, 8, // 0x29 - Multi Processor Enable + PCP0, 8, // 0x2a - PDC CPU/CORE 0 + PCP1, 8, // 0x2b - PDC CPU/CORE 1 + PPCM, 8, // 0x2c - Max. PPC state + PCNT, 8, // 0x2d - Processor count + /* Super I/O & CMOS config */ + Offset (0x32), + NATP, 8, // 0x32 - + S5U0, 8, // 0x33 - Enable USB0 in S5 + S5U1, 8, // 0x34 - Enable USB1 in S5 + S3U0, 8, // 0x35 - Enable USB0 in S3 + S3U1, 8, // 0x36 - Enable USB1 in S3 + S33G, 8, // 0x37 - Enable 3G in S3 + CMEM, 32, // 0x38 - CBMEM TOC + /* Integrated Graphics Device */ + Offset (0x3c), + IGDS, 8, // 0x3c - IGD state (primary = 1) + TLST, 8, // 0x3d - Display Toggle List pointer + CADL, 8, // 0x3e - Currently Attached Devices List + PADL, 8, // 0x3f - Previously Attached Devices List + CSTE, 16, // 0x40 - Current display state + NSTE, 16, // 0x42 - Next display state + SSTE, 16, // 0x44 - Set display state + Offset (0x46), + NDID, 8, // 0x46 - Number of Device IDs + DID1, 32, // 0x47 - Device ID 1 + DID2, 32, // 0x4b - Device ID 2 + DID3, 32, // 0x4f - Device ID 3 + DID4, 32, // 0x53 - Device ID 4 + DID5, 32, // 0x57 - Device ID 5 + /* Backlight Control */ + Offset (0x64), + BLCS, 8, // 0x64 - Backlight control possible? + BRTL, 8, // 0x65 - Brightness Level + ODDS, 8, // 0x66 + /* Ambient Light Sensors */ + Offset (0x6e), + ALSE, 8, // 0x6e - ALS enable + ALAF, 8, // 0x6f - Ambient light adjustment factor + LLOW, 8, // 0x70 - LUX Low + LHIH, 8, // 0x71 - LUX High + /* EMA */ + Offset (0x78), + EMAE, 8, // 0x78 - EMA enable + EMAP, 16, // 0x79 - EMA pointer + EMAL, 16, // 0x7b - EMA length + /* MEF */ + Offset (0x82), + MEFE, 8, // 0x82 - MEF enable + /* TPM support */ + Offset (0x8c), + TPMP, 8, // 0x8c - TPM + TPME, 8, // 0x8d - TPM enable + /* SATA */ + Offset (0x96), + GTF0, 56, // 0x96 - GTF task file buffer for port 0 + GTF1, 56, // 0x9d - GTF task file buffer for port 1 + GTF2, 56, // 0xa4 - GTF task file buffer for port 2 + IDEM, 8, // 0xab - IDE mode (compatible / enhanced) + IDET, 8, // 0xac - IDE + /* IGD OpRegion */ + Offset (0xb4), + ASLB, 32, // 0xb4 - IGD OpRegion Base Address + IBTT, 8, // 0xb8 - IGD boot panel device + IPAT, 8, // 0xb9 - IGD panel type cmos option + ITVF, 8, // 0xba - IGD TV format cmos option + ITVM, 8, // 0xbb - IGD TV minor format option + IPSC, 8, // 0xbc - IGD panel scaling + IBLC, 8, // 0xbd - IGD BLC config + IBIA, 8, // 0xbe - IGD BIA config + ISSC, 8, // 0xbf - IGD SSC config + I409, 8, // 0xc0 - IGD 0409 modified settings + I509, 8, // 0xc1 - IGD 0509 modified settings + I609, 8, // 0xc2 - IGD 0609 modified settings + I709, 8, // 0xc3 - IGD 0709 modified settings + IDMM, 8, // 0xc4 - IGD Power conservation feature + IDMS, 8, // 0xc5 - IGD DVMT memory size + IF1E, 8, // 0xc6 - IGD function 1 enable + HVCO, 8, // 0xc7 - IGD HPLL VCO + NXD1, 32, // 0xc8 - IGD _DGS next DID1 + NXD2, 32, // 0xcc - IGD _DGS next DID2 + NXD3, 32, // 0xd0 - IGD _DGS next DID3 + NXD4, 32, // 0xd4 - IGD _DGS next DID4 + NXD5, 32, // 0xd8 - IGD _DGS next DID5 + NXD6, 32, // 0xdc - IGD _DGS next DID6 + NXD7, 32, // 0xe0 - IGD _DGS next DID7 + NXD8, 32, // 0xe4 - IGD _DGS next DID8 + + ISCI, 8, // 0xe8 - IGD SMI/SCI mode (0: SCI) + PAVP, 8, // 0xe9 - IGD PAVP data + Offset (0xeb), + OSCC, 8, // 0xeb - PCIe OSC control + NPCE, 8, // 0xec - native pcie support + PLFL, 8, // 0xed - platform flavor + BREV, 8, // 0xee - board revision + DPBM, 8, // 0xef - digital port b mode + DPCM, 8, // 0xf0 - digital port c mode + DPDM, 8, // 0xf1 - digital port d mode + ALFP, 8, // 0xf2 - active lfp + IMON, 8, // 0xf3 - current graphics turbo imon value + MMIO, 8, // 0xf4 - 64bit mmio support + + /* ChromeOS specific */ + Offset (0x100), + #include <vendorcode/google/chromeos/acpi/gnvs.asl> +} + +/* Set flag to enable USB charging in S3 */ +Method (S3UE) +{ + Store (One, \S3U0) + Store (One, \S3U1) +} + +/* Set flag to disable USB charging in S3 */ +Method (S3UD) +{ + Store (Zero, \S3U0) + Store (Zero, \S3U1) +} + +/* Set flag to enable USB charging in S5 */ +Method (S5UE) +{ + Store (One, \S5U0) + Store (One, \S5U1) +} + +/* Set flag to disable USB charging in S5 */ +Method (S5UD) +{ + Store (Zero, \S5U0) + Store (Zero, \S5U1) +} + +/* Set flag to enable 3G module in S3 */ +Method (S3GE) +{ + Store (One, \S33G) +} + +/* Set flag to disable 3G module in S3 */ +Method (S3GD) +{ + Store (Zero, \S33G) +} + +External (\_TZ.THRM) +External (\_TZ.SKIN) + +Method (TZUP) +{ + /* Update Primary Thermal Zone */ + If (CondRefOf (\_TZ.THRM, Local0)) { + Notify (\_TZ.THRM, 0x81) + } + + /* Update Secondary Thermal Zone */ + If (CondRefOf (\_TZ.SKIN, Local0)) { + Notify (\_TZ.SKIN, 0x81) + } +} + +/* Update Fan 0 thresholds */ +Method (F0UT, 2) +{ + Store (Arg0, \F0OF) + Store (Arg1, \F0ON) + TZUP () +} + +/* Update Fan 1 thresholds */ +Method (F1UT, 2) +{ + Store (Arg0, \F1OF) + Store (Arg1, \F1ON) + TZUP () +} + +/* Update Fan 2 thresholds */ +Method (F2UT, 2) +{ + Store (Arg0, \F2OF) + Store (Arg1, \F2ON) + TZUP () +} + +/* Update Fan 3 thresholds */ +Method (F3UT, 2) +{ + Store (Arg0, \F3OF) + Store (Arg1, \F3ON) + TZUP () +} + +/* Update Fan 4 thresholds */ +Method (F4UT, 2) +{ + Store (Arg0, \F4OF) + Store (Arg1, \F4ON) + TZUP () +} + +/* Update Temperature Sensor ID */ +Method (TMPU, 1) +{ + Store (Arg0, \TMPS) + TZUP () +} diff --git a/src/southbridge/intel/lynxpoint/acpi/irqlinks.asl b/src/southbridge/intel/lynxpoint/acpi/irqlinks.asl new file mode 100644 index 0000000000..5fcee45f29 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/irqlinks.asl @@ -0,0 +1,493 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +Device (LNKA) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 1) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTA) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 10, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLA, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLA, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTA + ShiftLeft(1, And(PRTA, 0x0f), IRQ0) + + Return (RTLA) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTA) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTA, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKB) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 2) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTB) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 11, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLB, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLB, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTB + ShiftLeft(1, And(PRTB, 0x0f), IRQ0) + + Return (RTLB) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTB) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTB, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKC) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 3) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTC) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 10, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLC, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLC, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTC + ShiftLeft(1, And(PRTC, 0x0f), IRQ0) + + Return (RTLC) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTC) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTC, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKD) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 4) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTD) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 11, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLD, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLD, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTD + ShiftLeft(1, And(PRTD, 0x0f), IRQ0) + + Return (RTLD) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTD) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTD, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKE) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 5) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTE) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 10, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLE, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLE, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTE + ShiftLeft(1, And(PRTE, 0x0f), IRQ0) + + Return (RTLE) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTE) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTE, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKF) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 6) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTF) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 11, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLF, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLF, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTF + ShiftLeft(1, And(PRTF, 0x0f), IRQ0) + + Return (RTLF) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTF) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTF, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKG) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 7) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTG) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 10, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLG, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLG, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTG + ShiftLeft(1, And(PRTG, 0x0f), IRQ0) + + Return (RTLG) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTG) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTG, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + +Device (LNKH) +{ + Name (_HID, EISAID("PNP0C0F")) + Name (_UID, 8) + + // Disable method + Method (_DIS, 0, Serialized) + { + Store (0x80, PRTH) + } + + // Possible Resource Settings for this Link + Name (_PRS, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) + { 1, 3, 4, 5, 6, 7, 11, 12, 14, 15 } + }) + + // Current Resource Settings for this link + Method (_CRS, 0, Serialized) + { + Name (RTLH, ResourceTemplate() + { + IRQ(Level, ActiveLow, Shared) {} + }) + CreateWordField(RTLH, 1, IRQ0) + + // Clear the WordField + Store (Zero, IRQ0) + + // Set the bit from PRTH + ShiftLeft(1, And(PRTH, 0x0f), IRQ0) + + Return (RTLH) + } + + // Set Resource Setting for this IRQ link + Method (_SRS, 1, Serialized) + { + CreateWordField(Arg0, 1, IRQ0) + + // Which bit is set? + FindSetRightBit(IRQ0, Local0) + + Decrement(Local0) + Store(Local0, PRTH) + } + + // Status + Method (_STA, 0, Serialized) + { + If(And(PRTH, 0x80)) { + Return (0x9) + } Else { + Return (0xb) + } + } +} + diff --git a/src/southbridge/intel/lynxpoint/acpi/lpc.asl b/src/southbridge/intel/lynxpoint/acpi/lpc.asl new file mode 100644 index 0000000000..cc59850ec4 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/lpc.asl @@ -0,0 +1,248 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +// Intel LPC Bus Device - 0:1f.0 + +Device (LPCB) +{ + Name(_ADR, 0x001f0000) + + OperationRegion(LPC0, PCI_Config, 0x00, 0x100) + Field (LPC0, AnyAcc, NoLock, Preserve) + { + Offset (0x40), + PMBS, 16, // PMBASE + Offset (0x60), // Interrupt Routing Registers + PRTA, 8, + PRTB, 8, + PRTC, 8, + PRTD, 8, + Offset (0x68), + PRTE, 8, + PRTF, 8, + PRTG, 8, + PRTH, 8, + + Offset (0x80), // IO Decode Ranges + IOD0, 8, + IOD1, 8, + + Offset (0xb8), // GPIO Routing Control + GR00, 2, + GR01, 2, + GR02, 2, + GR03, 2, + GR04, 2, + GR05, 2, + GR06, 2, + GR07, 2, + GR08, 2, + GR09, 2, + GR10, 2, + GR11, 2, + GR12, 2, + GR13, 2, + GR14, 2, + GR15, 2, + + Offset (0xf0), // RCBA + RCEN, 1, + , 13, + RCBA, 18, + } + + #include "irqlinks.asl" + + #include "acpi/ec.asl" + + Device (DMAC) // DMA Controller + { + Name(_HID, EISAID("PNP0200")) + Name(_CRS, ResourceTemplate() + { + IO (Decode16, 0x00, 0x00, 0x01, 0x20) + IO (Decode16, 0x81, 0x81, 0x01, 0x11) + IO (Decode16, 0x93, 0x93, 0x01, 0x0d) + IO (Decode16, 0xc0, 0xc0, 0x01, 0x20) + DMA (Compatibility, NotBusMaster, Transfer8_16) { 4 } + }) + } + + Device (FWH) // Firmware Hub + { + Name (_HID, EISAID("INT0800")) + Name (_CRS, ResourceTemplate() + { + Memory32Fixed(ReadOnly, 0xff000000, 0x01000000) + }) + } + + Device (HPET) + { + Name (_HID, EISAID("PNP0103")) + Name (_CID, 0x010CD041) + + Name(BUF0, ResourceTemplate() + { + Memory32Fixed(ReadOnly, 0xfed00000, 0x400, FED0) + }) + + Method (_STA, 0) // Device Status + { + If (HPTE) { + // Note: Ancient versions of Windows don't want + // to see the HPET in order to work right + If (LGreaterEqual(OSYS, 2001)) { + Return (0xf) // Enable and show device + } Else { + Return (0xb) // Enable and don't show device + } + } + + Return (0x0) // Not enabled, don't show. + } + + Method (_CRS, 0, Serialized) // Current resources + { + If (HPTE) { + CreateDWordField(BUF0, \_SB.PCI0.LPCB.HPET.FED0._BAS, HPT0) + If (Lequal(HPAS, 1)) { + Store(0xfed01000, HPT0) + } + + If (Lequal(HPAS, 2)) { + Store(0xfed02000, HPT0) + } + + If (Lequal(HPAS, 3)) { + Store(0xfed03000, HPT0) + } + } + + Return (BUF0) + } + } + + Device(PIC) // 8259 Interrupt Controller + { + Name(_HID,EISAID("PNP0000")) + Name(_CRS, ResourceTemplate() + { + IO (Decode16, 0x20, 0x20, 0x01, 0x02) + IO (Decode16, 0x24, 0x24, 0x01, 0x02) + IO (Decode16, 0x28, 0x28, 0x01, 0x02) + IO (Decode16, 0x2c, 0x2c, 0x01, 0x02) + IO (Decode16, 0x30, 0x30, 0x01, 0x02) + IO (Decode16, 0x34, 0x34, 0x01, 0x02) + IO (Decode16, 0x38, 0x38, 0x01, 0x02) + IO (Decode16, 0x3c, 0x3c, 0x01, 0x02) + IO (Decode16, 0xa0, 0xa0, 0x01, 0x02) + IO (Decode16, 0xa4, 0xa4, 0x01, 0x02) + IO (Decode16, 0xa8, 0xa8, 0x01, 0x02) + IO (Decode16, 0xac, 0xac, 0x01, 0x02) + IO (Decode16, 0xb0, 0xb0, 0x01, 0x02) + IO (Decode16, 0xb4, 0xb4, 0x01, 0x02) + IO (Decode16, 0xb8, 0xb8, 0x01, 0x02) + IO (Decode16, 0xbc, 0xbc, 0x01, 0x02) + IO (Decode16, 0x4d0, 0x4d0, 0x01, 0x02) + IRQNoFlags () { 2 } + }) + } + + Device(MATH) // FPU + { + Name (_HID, EISAID("PNP0C04")) + Name (_CRS, ResourceTemplate() + { + IO (Decode16, 0xf0, 0xf0, 0x01, 0x01) + IRQNoFlags() { 13 } + }) + } + + Device(LDRC) // LPC device: Resource consumption + { + Name (_HID, EISAID("PNP0C02")) + Name (_UID, 2) + Name (_CRS, ResourceTemplate() + { + IO (Decode16, 0x2e, 0x2e, 0x1, 0x02) // First SuperIO + IO (Decode16, 0x4e, 0x4e, 0x1, 0x02) // Second SuperIO + IO (Decode16, 0x61, 0x61, 0x1, 0x01) // NMI Status + IO (Decode16, 0x63, 0x63, 0x1, 0x01) // CPU Reserved + IO (Decode16, 0x65, 0x65, 0x1, 0x01) // CPU Reserved + IO (Decode16, 0x67, 0x67, 0x1, 0x01) // CPU Reserved + IO (Decode16, 0x80, 0x80, 0x1, 0x01) // Port 80 Post + IO (Decode16, 0x92, 0x92, 0x1, 0x01) // CPU Reserved + IO (Decode16, 0xb2, 0xb2, 0x1, 0x02) // SWSMI + //IO (Decode16, 0x800, 0x800, 0x1, 0x10) // ACPI I/O trap + IO (Decode16, DEFAULT_PMBASE, DEFAULT_PMBASE, 0x1, 0x80) // ICH7-M ACPI + IO (Decode16, DEFAULT_GPIOBASE, DEFAULT_GPIOBASE, 0x1, 0x40) // ICH7-M GPIO + }) + } + + Device (RTC) // Real Time Clock + { + Name (_HID, EISAID("PNP0B00")) + Name (_CRS, ResourceTemplate() + { + IO (Decode16, 0x70, 0x70, 1, 8) +// Disable as Windows doesn't like it, and systems don't seem to use it. +// IRQNoFlags() { 8 } + }) + } + + Device (TIMR) // Intel 8254 timer + { + Name(_HID, EISAID("PNP0100")) + Name(_CRS, ResourceTemplate() + { + IO (Decode16, 0x40, 0x40, 0x01, 0x04) + IO (Decode16, 0x50, 0x50, 0x10, 0x04) + IRQNoFlags() {0} + }) + } + + #include "acpi/superio.asl" + +#ifdef ENABLE_TPM + Device (TPM) // Trusted Platform Module + { + Name(_HID, EISAID("IFX0102")) + Name(_CID, 0x310cd041) + Name(_UID, 1) + + Method(_STA, 0) + { + If (TPMP) { + Return (0xf) + } + Return (0x0) + } + + Name(_CRS, ResourceTemplate() { + IO (Decode16, 0x2e, 0x2e, 0x01, 0x02) + IO (Decode16, 0x6f0, 0x6f0, 0x01, 0x10) + Memory32Fixed (ReadWrite, 0xfed40000, 0x5000) + IRQ (Edge, Activehigh, Exclusive) { 6 } + }) + } +#endif +} diff --git a/src/southbridge/intel/lynxpoint/acpi/pch.asl b/src/southbridge/intel/lynxpoint/acpi/pch.asl new file mode 100644 index 0000000000..8632ad849e --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/pch.asl @@ -0,0 +1,275 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* Intel Cougar Point PCH support */ + +Scope(\) +{ + // IO-Trap at 0x800. This is the ACPI->SMI communication interface. + + OperationRegion(IO_T, SystemIO, 0x800, 0x10) + Field(IO_T, ByteAcc, NoLock, Preserve) + { + Offset(0x8), + TRP0, 8 // IO-Trap at 0x808 + } + + // PCH Power Management Registers, located at PMBASE (0x1f.0 0x40.l) + OperationRegion(PMIO, SystemIO, DEFAULT_PMBASE, 0x80) + Field(PMIO, ByteAcc, NoLock, Preserve) + { + Offset(0x20), // GPE0_STS + , 16, + GS00, 1, // GPIO00 SCI/Wake Status + GS01, 1, // GPIO01 SCI/Wake Status + GS02, 1, // GPIO02 SCI/Wake Status + GS03, 1, // GPIO03 SCI/Wake Status + GS04, 1, // GPIO04 SCI/Wake Status + GS05, 1, // GPIO05 SCI/Wake Status + GS06, 1, // GPIO06 SCI/Wake Status + GS07, 1, // GPIO07 SCI/Wake Status + GS08, 1, // GPIO08 SCI/Wake Status + GS09, 1, // GPIO09 SCI/Wake Status + GS10, 1, // GPIO10 SCI/Wake Status + GS11, 1, // GPIO11 SCI/Wake Status + GS12, 1, // GPIO12 SCI/Wake Status + GS13, 1, // GPIO13 SCI/Wake Status + GS14, 1, // GPIO14 SCI/Wake Status + GS15, 1, // GPIO15 SCI/Wake Status + Offset(0x28), // GPE0_EN + , 16, + GE00, 1, // GPIO00 SCI/Wake Enable + GE01, 1, // GPIO01 SCI/Wake Enable + GE02, 1, // GPIO02 SCI/Wake Enable + GE03, 1, // GPIO03 SCI/Wake Enable + GE04, 1, // GPIO04 SCI/Wake Enable + GE05, 1, // GPIO05 SCI/Wake Enable + GE06, 1, // GPIO06 SCI/Wake Enable + GE07, 1, // GPIO07 SCI/Wake Enable + GE08, 1, // GPIO08 SCI/Wake Enable + GE09, 1, // GPIO09 SCI/Wake Enable + GE10, 1, // GPIO10 SCI/Wake Enable + GE11, 1, // GPIO11 SCI/Wake Enable + GE12, 1, // GPIO12 SCI/Wake Enable + GE13, 1, // GPIO13 SCI/Wake Enable + GE14, 1, // GPIO14 SCI/Wake Enable + GE15, 1, // GPIO15 SCI/Wake Enable + Offset(0x42), // General Purpose Control + , 1, // skip 1 bit + GPEC, 1, // SWGPE_CTRL + } + + // GPIO IO mapped registers (0x1f.0 reg 0x48.l) + OperationRegion(GPIO, SystemIO, DEFAULT_GPIOBASE, 0x6c) + Field(GPIO, ByteAcc, NoLock, Preserve) + { + Offset(0x00), // GPIO Use Select + GU00, 8, + GU01, 8, + GU02, 8, + GU03, 8, + Offset(0x04), // GPIO IO Select + GIO0, 8, + GIO1, 8, + GIO2, 8, + GIO3, 8, + Offset(0x0c), // GPIO Level + GL00, 1, + GP01, 1, + GP02, 1, + GP0e, 1, + GP04, 1, + GP05, 1, + GP06, 1, + GP07, 1, + GP08, 1, + GP09, 1, + GP10, 1, + GP11, 1, + GP12, 1, + GP13, 1, + GP14, 1, + GP15, 1, + GP16, 1, + GP17, 1, + GP18, 1, + GP19, 1, + GP20, 1, + GP21, 1, + GP22, 1, + GP23, 1, + GP24, 1, + GP25, 1, + GP26, 1, + GP27, 1, + GP28, 1, + GP29, 1, + GP30, 1, + GP31, 1, + Offset(0x18), // GPIO Blink + GB00, 8, + GB01, 8, + GB02, 8, + GB03, 8, + Offset(0x2c), // GPIO Invert + GIV0, 8, + GIV1, 8, + GIV2, 8, + GIV3, 8, + Offset(0x30), // GPIO Use Select 2 + GU04, 8, + GU05, 8, + GU06, 8, + GU07, 8, + Offset(0x34), // GPIO IO Select 2 + GIO4, 8, + GIO5, 8, + GIO6, 8, + GIO7, 8, + Offset(0x38), // GPIO Level 2 + GP32, 1, + GP33, 1, + GP34, 1, + GP35, 1, + GP36, 1, + GP37, 1, + GP38, 1, + GP39, 1, + GP40, 1, + GP41, 1, + GP42, 1, + GP43, 1, + GP44, 1, + GP45, 1, + GP46, 1, + GP47, 1, + GP48, 1, + GP49, 1, + GP50, 1, + GP51, 1, + GP52, 1, + GP53, 1, + GP54, 1, + GP55, 1, + GP56, 1, + GP57, 1, + GP58, 1, + GP59, 1, + GP60, 1, + GP61, 1, + GP62, 1, + GP63, 1, + Offset(0x40), // GPIO Use Select 3 + GU08, 8, + GU09, 4, + Offset(0x44), // GPIO IO Select 3 + GIO8, 8, + GIO9, 4, + Offset(0x48), // GPIO Level 3 + GP64, 1, + GP65, 1, + GP66, 1, + GP67, 1, + GP68, 1, + GP69, 1, + GP70, 1, + GP71, 1, + GP72, 1, + GP73, 1, + GP74, 1, + GP75, 1, + } + + + // ICH7 Root Complex Register Block. Memory Mapped through RCBA) + OperationRegion(RCRB, SystemMemory, DEFAULT_RCBA, 0x4000) + Field(RCRB, DWordAcc, Lock, Preserve) + { + Offset(0x0000), // Backbone + Offset(0x1000), // Chipset + Offset(0x3000), // Legacy Configuration Registers + Offset(0x3404), // High Performance Timer Configuration + HPAS, 2, // Address Select + , 5, + HPTE, 1, // Address Enable + Offset(0x3418), // FD (Function Disable) + , 1, // Reserved + PCID, 1, // PCI bridge disable + SA1D, 1, // SATA1 disable + SMBD, 1, // SMBUS disable + HDAD, 1, // Azalia disable + , 8, // Reserved + EH2D, 1, // EHCI #2 disable + LPBD, 1, // LPC bridge disable + EH1D, 1, // EHCI #1 disable + RP1D, 1, // Root Port 1 disable + RP2D, 1, // Root Port 2 disable + RP3D, 1, // Root Port 3 disable + RP4D, 1, // Root Port 4 disable + RP5D, 1, // Root Port 5 disable + RP6D, 1, // Root Port 6 disable + RP7D, 1, // Root Port 7 disable + RP8D, 1, // Root Port 8 disable + TTRD, 1, // Thermal sensor registers disable + SA2D, 1, // SATA2 disable + Offset(0x3428), // FD2 (Function Disable 2) + BDFD, 1, // Display BDF + ME1D, 1, // ME Interface 1 disable + ME2D, 1, // ME Interface 2 disable + IDRD, 1, // IDE redirect disable + KTCT, 1, // Keyboard Text redirect disable + } +} + +// High Definition Audio (Azalia) 0:1b.0 +#include "audio.asl" + +// PCI Express Ports 0:1c.x +#include "pcie.asl" + +// USB 0:1d.0 and 0:1a.0 +#include "usb.asl" + +// LPC Bridge 0:1f.0 +#include "lpc.asl" + +// SATA 0:1f.2, 0:1f.5 +#include "sata.asl" + +// SMBus 0:1f.3 +#include "smbus.asl" + +Method (_OSC, 4) +{ + /* Check for proper GUID */ + If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) + { + /* Let OS control everything */ + Return (Arg3) + } + Else + { + /* Unrecognized UUID */ + CreateDWordField (Arg3, 0, CDW1) + Or (CDW1, 4, CDW1) + Return (Arg3) + } +} diff --git a/src/southbridge/intel/lynxpoint/acpi/pcie.asl b/src/southbridge/intel/lynxpoint/acpi/pcie.asl new file mode 100644 index 0000000000..934cf782e9 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/pcie.asl @@ -0,0 +1,218 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2012 The Chromium OS Authors. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* Intel 6/7 Series PCH PCIe support */ + +// PCI Express Ports + +Method (IRQM, 1, Serialized) { + + /* Interrupt Map INTA->INTA, INTB->INTB, INTC->INTC, INTD->INTD */ + Name (IQAA, Package() { + Package() { 0x0000ffff, 0, 0, 16 }, + Package() { 0x0000ffff, 1, 0, 17 }, + Package() { 0x0000ffff, 2, 0, 18 }, + Package() { 0x0000ffff, 3, 0, 19 } }) + Name (IQAP, Package() { + Package() { 0x0000ffff, 0, \_SB.PCI0.LPCB.LNKA, 0 }, + Package() { 0x0000ffff, 1, \_SB.PCI0.LPCB.LNKB, 0 }, + Package() { 0x0000ffff, 2, \_SB.PCI0.LPCB.LNKC, 0 }, + Package() { 0x0000ffff, 3, \_SB.PCI0.LPCB.LNKD, 0 } }) + + /* Interrupt Map INTA->INTB, INTB->INTC, INTC->INTD, INTD->INTA */ + Name (IQBA, Package() { + Package() { 0x0000ffff, 0, 0, 17 }, + Package() { 0x0000ffff, 1, 0, 18 }, + Package() { 0x0000ffff, 2, 0, 19 }, + Package() { 0x0000ffff, 3, 0, 16 } }) + Name (IQBP, Package() { + Package() { 0x0000ffff, 0, \_SB.PCI0.LPCB.LNKB, 0 }, + Package() { 0x0000ffff, 1, \_SB.PCI0.LPCB.LNKC, 0 }, + Package() { 0x0000ffff, 2, \_SB.PCI0.LPCB.LNKD, 0 }, + Package() { 0x0000ffff, 3, \_SB.PCI0.LPCB.LNKA, 0 } }) + + /* Interrupt Map INTA->INTC, INTB->INTD, INTC->INTA, INTD->INTB */ + Name (IQCA, Package() { + Package() { 0x0000ffff, 0, 0, 18 }, + Package() { 0x0000ffff, 1, 0, 19 }, + Package() { 0x0000ffff, 2, 0, 16 }, + Package() { 0x0000ffff, 3, 0, 17 } }) + Name (IQCP, Package() { + Package() { 0x0000ffff, 0, \_SB.PCI0.LPCB.LNKC, 0 }, + Package() { 0x0000ffff, 1, \_SB.PCI0.LPCB.LNKD, 0 }, + Package() { 0x0000ffff, 2, \_SB.PCI0.LPCB.LNKA, 0 }, + Package() { 0x0000ffff, 3, \_SB.PCI0.LPCB.LNKB, 0 } }) + + /* Interrupt Map INTA->INTD, INTB->INTA, INTC->INTB, INTD->INTC */ + Name (IQDA, Package() { + Package() { 0x0000ffff, 0, 0, 19 }, + Package() { 0x0000ffff, 1, 0, 16 }, + Package() { 0x0000ffff, 2, 0, 17 }, + Package() { 0x0000ffff, 3, 0, 18 } }) + Name (IQDP, Package() { + Package() { 0x0000ffff, 0, \_SB.PCI0.LPCB.LNKD, 0 }, + Package() { 0x0000ffff, 1, \_SB.PCI0.LPCB.LNKA, 0 }, + Package() { 0x0000ffff, 2, \_SB.PCI0.LPCB.LNKB, 0 }, + Package() { 0x0000ffff, 3, \_SB.PCI0.LPCB.LNKC, 0 } }) + + Switch (ToInteger (Arg0)) { + /* PCIe Root Port 1 and 5 */ + Case (Package() { 1, 5 }) { + If (PICM) { + Return (IQAA) + } Else { + Return (IQAP) + } + } + + /* PCIe Root Port 2 and 6 */ + Case (Package() { 2, 6 }) { + If (PICM) { + Return (IQBA) + } Else { + Return (IQBP) + } + } + + /* PCIe Root Port 3 and 7 */ + Case (Package() { 3, 7 }) { + If (PICM) { + Return (IQCA) + } Else { + Return (IQCP) + } + } + + /* PCIe Root Port 4 and 8 */ + Case (Package() { 4, 8 }) { + If (PICM) { + Return (IQDA) + } Else { + Return (IQDP) + } + } + + Default { + If (PICM) { + Return (IQDA) + } Else { + Return (IQDP) + } + } + } +} + +Device (RP01) +{ + Name (_ADR, 0x001c0000) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP02) +{ + Name (_ADR, 0x001c0001) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP03) +{ + Name (_ADR, 0x001c0002) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP04) +{ + Name (_ADR, 0x001c0003) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP05) +{ + Name (_ADR, 0x001c0004) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP06) +{ + Name (_ADR, 0x001c0005) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP07) +{ + Name (_ADR, 0x001c0006) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} + +Device (RP08) +{ + Name (_ADR, 0x001c0007) + + #include "pcie_port.asl" + + Method (_PRT) + { + Return (IRQM (RPPN)) + } +} diff --git a/src/southbridge/intel/lynxpoint/acpi/pcie_port.asl b/src/southbridge/intel/lynxpoint/acpi/pcie_port.asl new file mode 100644 index 0000000000..fedd9c97c6 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/pcie_port.asl @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 The Chromium OS Authors. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* Included in each PCIe Root Port device */ + +OperationRegion (RPCS, PCI_Config, 0x00, 0xFF) +Field (RPCS, AnyAcc, NoLock, Preserve) +{ + Offset (0x4c), // Link Capabilities + , 24, + RPPN, 8, // Root Port Number +} diff --git a/src/southbridge/intel/lynxpoint/acpi/sata.asl b/src/southbridge/intel/lynxpoint/acpi/sata.asl new file mode 100644 index 0000000000..e0c336ac5d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/sata.asl @@ -0,0 +1,83 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +// Intel SATA Controller 0:1f.2 + +// Note: Some BIOSes put the S-ATA code into an SSDT to make it easily +// pluggable + +Device (SATA) +{ + Name (_ADR, 0x001f0002) + + Device (PRID) + { + Name (_ADR, 0) + + // Get Timing Mode + Method (_GTM) + { + Name(PBUF, Buffer(20) { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00 }) + + CreateDwordField (PBUF, 0, PIO0) + CreateDwordField (PBUF, 4, DMA0) + CreateDwordField (PBUF, 8, PIO1) + CreateDwordField (PBUF, 12, DMA1) + CreateDwordField (PBUF, 16, FLAG) + + // TODO fill return structure + + Return (PBUF) + } + + // Set Timing Mode + Method (_STM, 3) + { + CreateDwordField (Arg0, 0, PIO0) + CreateDwordField (Arg0, 4, DMA0) + CreateDwordField (Arg0, 8, PIO1) + CreateDwordField (Arg0, 12, DMA1) + CreateDwordField (Arg0, 16, FLAG) + + // TODO: Do the deed + } + + Device (DSK0) + { + Name (_ADR, 0) + // TODO: _RMV ? + // TODO: _GTF ? + } + + Device (DSK1) + { + Name (_ADR, 1) + + // TODO: _RMV ? + // TODO: _GTF ? + } + + } +} + diff --git a/src/southbridge/intel/lynxpoint/acpi/sleepstates.asl b/src/southbridge/intel/lynxpoint/acpi/sleepstates.asl new file mode 100644 index 0000000000..06bfcb6a58 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/sleepstates.asl @@ -0,0 +1,27 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +Name(\_S0, Package(){0x0,0x0,0x0,0x0}) +// Name(\_S1, Package(){0x1,0x1,0x0,0x0}) +Name(\_S3, Package(){0x5,0x5,0x0,0x0}) +Name(\_S4, Package(){0x6,0x6,0x0,0x0}) +Name(\_S5, Package(){0x7,0x7,0x0,0x0}) + diff --git a/src/southbridge/intel/lynxpoint/acpi/smbus.asl b/src/southbridge/intel/lynxpoint/acpi/smbus.asl new file mode 100644 index 0000000000..4409308325 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/smbus.asl @@ -0,0 +1,242 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +// Intel SMBus Controller 0:1f.3 + +Device (SBUS) +{ + Name (_ADR, 0x001f0003) + +#ifdef ENABLE_SMBUS_METHODS + OperationRegion (SMBP, PCI_Config, 0x00, 0x100) + Field(SMBP, DWordAcc, NoLock, Preserve) + { + Offset(0x40), + , 2, + I2CE, 1 + } + + OperationRegion (SMBI, SystemIO, SMBUS_IO_BASE, 0x20) + Field (SMBI, ByteAcc, NoLock, Preserve) + { + HSTS, 8, // Host Status + , 8, + HCNT, 8, // Host Control + HCMD, 8, // Host Command + TXSA, 8, // Transmit Slave Address + DAT0, 8, // Host Data 0 + DAT1, 8, // Host Data 1 + HBDB, 8, // Host Block Data Byte + PECK, 8, // Packet Error Check + RXSA, 8, // Receive Slave Address + RXDA, 16, // Receive Slave Data + AUXS, 8, // Auxiliary Status + AUXC, 8, // Auxiliary Control + SLPC, 8, // SMLink Pin Control + SBPC, 8, // SMBus Pin Control + SSTS, 8, // Slave Status + SCMD, 8, // Slave Command + NADR, 8, // Notify Device Address + NDLB, 8, // Notify Data Low Byte + NDLH, 8, // Notify Data High Byte + } + + // Kill all SMBus communication + Method (KILL, 0, Serialized) + { + Or (HCNT, 0x02, HCNT) // Send Kill + Or (HSTS, 0xff, HSTS) // Clean Status + } + + // Check if last operation completed + // return Failure = 0, Success = 1 + Method (CMPL, 0, Serialized) + { + Store (4000, Local0) // Timeout 200ms in 50us steps + While (Local0) { + If (And(HSTS, 0x02)) { // Completion Status? + Return (1) // Operation Completed + } Else { + Stall (50) + Decrement (Local0) + If (LEqual(Local0, 0)) { + KILL() + } + } + } + + Return (0) // Failure + } + + + // Wait for SMBus to become ready + Method (SRDY, 0, Serialized) + { + Store (200, Local0) // Timeout 200ms + While (Local0) { + If (And(HSTS, 0x40)) { // IN_USE? + Sleep(1) // Wait 1ms + Decrement(Local0) // timeout-- + If (LEqual(Local0, 0)) { + Return (1) + } + } Else { + Store (0, Local0) // We're ready + } + } + + Store (4000, Local0) // Timeout 200ms (50us * 4000) + While (Local0) { + If (And (HSTS, 0x01)) { // Host Busy? + Stall(50) // Wait 50us + Decrement(Local0) // timeout-- + If (LEqual(Local0, 0)) { + KILL() + } + } Else { + Return (0) // Success + } + } + + Return (1) // Failure + } + + // SMBus Send Byte + // Arg0: Address + // Arg1: Data + // Return: 1 = Success, 0=Failure + + Method (SSXB, 2, Serialized) + { + + // Is the SMBus Controller Ready? + If (SRDY()) { + Return (0) + } + + // Send Byte + Store (0, I2CE) // SMBus Enable + Store (0xbf, HSTS) + Store (Arg0, TXSA) // Write Address + Store (Arg1, HCMD) // Write Data + + Store (0x48, HCNT) // Start + Byte Data Protocol + + If (CMPL()) { + Or (HSTS, 0xff, HSTS) // Clean up + Return (1) // Success + } + + Return (0) + } + + + // SMBus Receive Byte + // Arg0: Address + // Return: 0xffff = Failure, Data (8bit) = Success + + Method (SRXB, 2, Serialized) + { + + // Is the SMBus Controller Ready? + If (SRDY()) { + Return (0xffff) + } + + // Receive Byte + Store (0, I2CE) // SMBus Enable + Store (0xbf, HSTS) + Store (Or (Arg0, 1), TXSA) // Write Address + + Store (0x44, HCNT) // Start + + If (CMPL()) { + Or (HSTS, 0xff, HSTS) // Clean up + Return (DAT0) // Success + } + + Return (0xffff) + } + + + // SMBus Write Byte + // Arg0: Address + // Arg1: Command + // Arg2: Data + // Return: 1 = Success, 0=Failure + + Method (SWRB, 3, Serialized) + { + + // Is the SMBus Controller Ready? + If (SRDY()) { + Return (0) + } + + // Send Byte + Store (0, I2CE) // SMBus Enable + Store (0xbf, HSTS) + Store (Arg0, TXSA) // Write Address + Store (Arg1, HCMD) // Write Command + Store (Arg2, DAT0) // Write Data + + Store (0x48, HCNT) // Start + Byte Protocol + + If (CMPL()) { + Or (HSTS, 0xff, HSTS) // Clean up + Return (1) // Success + } + + Return (0) + } + + + // SMBus Read Byte + // Arg0: Address + // Arg1: Command + // Return: 0xffff = Failure, Data (8bit) = Success + + Method (SRDB, 2, Serialized) + { + + // Is the SMBus Controller Ready? + If (SRDY()) { + Return (0xffff) + } + + // Receive Byte + Store (0, I2CE) // SMBus Enable + Store (0xbf, HSTS) + Store (Or (Arg0, 1), TXSA) // Write Address + Store (Arg1, HCMD) // Command + + Store (0x48, HCNT) // Start + + If (CMPL()) { + Or (HSTS, 0xff, HSTS) // Clean up + Return (DAT0) // Success + } + + Return (0xffff) + } +#endif +} + diff --git a/src/southbridge/intel/lynxpoint/acpi/usb.asl b/src/southbridge/intel/lynxpoint/acpi/usb.asl new file mode 100644 index 0000000000..cf3e6a049f --- /dev/null +++ b/src/southbridge/intel/lynxpoint/acpi/usb.asl @@ -0,0 +1,91 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* Intel Cougar Point USB support */ + +// EHCI Controller 0:1d.0 + +Device (EHC1) +{ + Name(_ADR, 0x001d0000) + + Name (_PRW, Package(){ 13, 4 }) // Power Resources for Wake + + // Leave USB ports on for to allow Wake from USB + + Method(_S3D,0) // Highest D State in S3 State + { + Return (2) + } + + Method(_S4D,0) // Highest D State in S4 State + { + Return (2) + } + + Device (HUB7) + { + Name (_ADR, 0x00000000) + + // How many are there? + Device (PRT1) { Name (_ADR, 1) } // USB Port 0 + Device (PRT2) { Name (_ADR, 2) } // USB Port 1 + Device (PRT3) { Name (_ADR, 3) } // USB Port 2 + Device (PRT4) { Name (_ADR, 4) } // USB Port 3 + Device (PRT5) { Name (_ADR, 5) } // USB Port 4 + Device (PRT6) { Name (_ADR, 6) } // USB Port 5 + } +} + +// EHCI #2 Controller 0:1a.0 + +Device (EHC2) +{ + Name(_ADR, 0x001a0000) + + Name (_PRW, Package(){ 13, 4 }) // Power Resources for Wake + + // Leave USB ports on for to allow Wake from USB + + Method(_S3D,0) // Highest D State in S3 State + { + Return (2) + } + + Method(_S4D,0) // Highest D State in S4 State + { + Return (2) + } + + Device (HUB7) + { + Name (_ADR, 0x00000000) + + // How many are there? + Device (PRT1) { Name (_ADR, 1) } // USB Port 0 + Device (PRT2) { Name (_ADR, 2) } // USB Port 1 + Device (PRT3) { Name (_ADR, 3) } // USB Port 2 + Device (PRT4) { Name (_ADR, 4) } // USB Port 3 + Device (PRT5) { Name (_ADR, 5) } // USB Port 4 + Device (PRT6) { Name (_ADR, 6) } // USB Port 5 + } +} + diff --git a/src/southbridge/intel/lynxpoint/azalia.c b/src/southbridge/intel/lynxpoint/azalia.c new file mode 100644 index 0000000000..7b51671d7e --- /dev/null +++ b/src/southbridge/intel/lynxpoint/azalia.c @@ -0,0 +1,375 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008 Advanced Micro Devices, Inc. + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include <device/pci_ops.h> +#include <arch/io.h> +#include <delay.h> +#include "pch.h" + +#define HDA_ICII_REG 0x68 +#define HDA_ICII_BUSY (1 << 0) +#define HDA_ICII_VALID (1 << 1) + +typedef struct southbridge_intel_bd82x6x_config config_t; + +static int set_bits(u32 port, u32 mask, u32 val) +{ + u32 reg32; + int count; + + /* Write (val & mask) to port */ + val &= mask; + reg32 = read32(port); + reg32 &= ~mask; + reg32 |= val; + write32(port, reg32); + + /* Wait for readback of register to + * match what was just written to it + */ + count = 50; + do { + /* Wait 1ms based on BKDG wait time */ + mdelay(1); + reg32 = read32(port); + reg32 &= mask; + } while ((reg32 != val) && --count); + + /* Timeout occurred */ + if (!count) + return -1; + return 0; +} + +static int codec_detect(u32 base) +{ + u8 reg8; + + /* Set Bit 0 to 1 to exit reset state (BAR + 0x8)[0] */ + if (set_bits(base + 0x08, 1, 1) == -1) + goto no_codec; + + /* Write back the value once reset bit is set. */ + write16(base + 0x0, read16(base + 0x0)); + + /* Read in Codec location (BAR + 0xe)[2..0]*/ + reg8 = read8(base + 0xe); + reg8 &= 0x0f; + if (!reg8) + goto no_codec; + + return reg8; + +no_codec: + /* Codec Not found */ + /* Put HDA back in reset (BAR + 0x8) [0] */ + set_bits(base + 0x08, 1, 0); + printk(BIOS_DEBUG, "Azalia: No codec!\n"); + return 0; +} + +const u32 * cim_verb_data = NULL; +u32 cim_verb_data_size = 0; +const u32 * pc_beep_verbs = NULL; +u32 pc_beep_verbs_size = 0; + +static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb) +{ + int idx=0; + + while (idx < (cim_verb_data_size / sizeof(u32))) { + u32 verb_size = 4 * cim_verb_data[idx+2]; // in u32 + if (cim_verb_data[idx] != viddid) { + idx += verb_size + 3; // skip verb + header + continue; + } + *verb = &cim_verb_data[idx+3]; + return verb_size; + } + + /* Not all codecs need to load another verb */ + return 0; +} + +/** + * Wait 50usec for the codec to indicate it is ready + * no response would imply that the codec is non-operative + */ + +static int wait_for_ready(u32 base) +{ + /* Use a 50 usec timeout - the Linux kernel uses the + * same duration */ + + int timeout = 50; + + while(timeout--) { + u32 reg32 = read32(base + HDA_ICII_REG); + if (!(reg32 & HDA_ICII_BUSY)) + return 0; + udelay(1); + } + + return -1; +} + +/** + * Wait 50usec for the codec to indicate that it accepted + * the previous command. No response would imply that the code + * is non-operative + */ + +static int wait_for_valid(u32 base) +{ + u32 reg32; + + /* Send the verb to the codec */ + reg32 = read32(base + HDA_ICII_REG); + reg32 |= HDA_ICII_BUSY | HDA_ICII_VALID; + write32(base + HDA_ICII_REG, reg32); + + /* Use a 50 usec timeout - the Linux kernel uses the + * same duration */ + + int timeout = 50; + while(timeout--) { + reg32 = read32(base + HDA_ICII_REG); + if ((reg32 & (HDA_ICII_VALID | HDA_ICII_BUSY)) == + HDA_ICII_VALID) + return 0; + udelay(1); + } + + return -1; +} + +static void codec_init(struct device *dev, u32 base, int addr) +{ + u32 reg32; + const u32 *verb; + u32 verb_size; + int i; + + printk(BIOS_DEBUG, "Azalia: Initializing codec #%d\n", addr); + + /* 1 */ + if (wait_for_ready(base) == -1) { + printk(BIOS_DEBUG, " codec not ready.\n"); + return; + } + + reg32 = (addr << 28) | 0x000f0000; + write32(base + 0x60, reg32); + + if (wait_for_valid(base) == -1) { + printk(BIOS_DEBUG, " codec not valid.\n"); + return; + } + + reg32 = read32(base + 0x64); + + /* 2 */ + printk(BIOS_DEBUG, "Azalia: codec viddid: %08x\n", reg32); + verb_size = find_verb(dev, reg32, &verb); + + if (!verb_size) { + printk(BIOS_DEBUG, "Azalia: No verb!\n"); + return; + } + printk(BIOS_DEBUG, "Azalia: verb_size: %d\n", verb_size); + + /* 3 */ + for (i = 0; i < verb_size; i++) { + if (wait_for_ready(base) == -1) + return; + + write32(base + 0x60, verb[i]); + + if (wait_for_valid(base) == -1) + return; + } + printk(BIOS_DEBUG, "Azalia: verb loaded.\n"); +} + +static void codecs_init(struct device *dev, u32 base, u32 codec_mask) +{ + int i; + for (i = 3; i >= 0; i--) { + if (codec_mask & (1 << i)) + codec_init(dev, base, i); + } + + for (i = 0; i < pc_beep_verbs_size; i++) { + if (wait_for_ready(base) == -1) + return; + + write32(base + 0x60, pc_beep_verbs[i]); + + if (wait_for_valid(base) == -1) + return; + } +} + +static void azalia_init(struct device *dev) +{ + u32 base; + struct resource *res; + u32 codec_mask; + u8 reg8; + u16 reg16; + u32 reg32; + + /* Find base address */ + res = find_resource(dev, PCI_BASE_ADDRESS_0); + if (!res) + return; + + // NOTE this will break as soon as the Azalia get's a bar above + // 4G. Is there anything we can do about it? + base = (u32)res->base; + printk(BIOS_DEBUG, "Azalia: base = %08x\n", (u32)base); + + if (RCBA32(0x2030) & (1 << 31)) { + reg32 = pci_mmio_read_config32(dev, 0x120); + reg32 &= 0xf8ffff01; + reg32 |= (1 << 24); // 25 for server + reg32 |= RCBA32(0x2030) & 0xfe; + pci_mmio_write_config32(dev, 0x120, reg32); + + reg16 = pci_mmio_read_config16(dev, 0x78); + reg16 &= ~(1 << 11); + pci_mmio_write_config16(dev, 0x78, reg16); + } else + printk(BIOS_DEBUG, "Azalia: V1CTL disabled.\n"); + + reg32 = pci_mmio_read_config32(dev, 0x114); + reg32 &= ~0xfe; + pci_mmio_write_config32(dev, 0x114, reg32); + + // Set VCi enable bit + if (pci_mmio_read_config32(dev, 0x120) & ((1 << 24) | + (1 << 25) | (1 << 26))) { + reg32 = pci_mmio_read_config32(dev, 0x120); + reg32 |= (1 << 31); + pci_mmio_write_config32(dev, 0x120, reg32); + } + + // Enable HDMI codec: + reg32 = pci_read_config32(dev, 0xc4); + reg32 |= (1 << 1); + pci_write_config32(dev, 0xc4, reg32); + + reg8 = pci_read_config8(dev, 0x43); + reg8 |= (1 << 6); + pci_write_config8(dev, 0x43, reg8); + + /* Additional programming steps */ + reg32 = pci_read_config32(dev, 0xc4); + reg32 |= (1 << 13) | (1 << 10); + pci_write_config32(dev, 0xc4, reg32); + + reg32 = pci_read_config32(dev, 0xd0); + reg32 &= ~(1 << 31); + pci_write_config32(dev, 0xd0, reg32); + + /* Additional programming steps */ + reg32 = pci_read_config32(dev, 0xc4); + reg32 |= (1 << 13); + pci_write_config32(dev, 0xc4, reg32); + + reg32 = pci_read_config32(dev, 0xc4); + reg32 |= (1 << 10); + pci_write_config32(dev, 0xc4, reg32); + + reg32 = pci_read_config32(dev, 0xd0); + reg32 &= ~(1 << 31); + pci_write_config32(dev, 0xd0, reg32); + + /* Set Bus Master */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER); + + pci_write_config8(dev, 0x3c, 0x0a); // unused? + + /* Codec Initialization Programming Sequence */ + reg32 = read32(base + 0x08); + reg32 |= (1 << 0); + write32(base + 0x08, reg32); + + // + reg8 = pci_read_config8(dev, 0x40); // Audio Control + reg8 |= 1; // Select Azalia mode. This needs to be controlled via devicetree.cb + pci_write_config8(dev, 0x40, reg8); + + reg8 = pci_read_config8(dev, 0x4d); // Docking Status + reg8 &= ~(1 << 7); // Docking not supported + pci_write_config8(dev, 0x4d, reg8); + + codec_mask = codec_detect(base); + + if (codec_mask) { + printk(BIOS_DEBUG, "Azalia: codec_mask = %02x\n", codec_mask); + codecs_init(dev, base, codec_mask); + } + + /* Enable dynamic clock gating */ + reg8 = pci_read_config8(dev, 0x43); + reg8 &= ~0x7; + reg8 |= (1 << 2) | (1 << 0); + pci_write_config8(dev, 0x43, reg8); +} + +static void azalia_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations azalia_pci_ops = { + .set_subsystem = azalia_set_subsystem, +}; + +static struct device_operations azalia_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = azalia_init, + .scan_bus = 0, + .ops_pci = &azalia_pci_ops, +}; + +static const unsigned short pci_device_ids[] = { 0x1c20, 0x1e20, 0 }; + +static const struct pci_driver pch_azalia __pci_driver = { + .ops = &azalia_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; + diff --git a/src/southbridge/intel/lynxpoint/bootblock.c b/src/southbridge/intel/lynxpoint/bootblock.c new file mode 100644 index 0000000000..2770d55cad --- /dev/null +++ b/src/southbridge/intel/lynxpoint/bootblock.c @@ -0,0 +1,101 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <cpu/x86/tsc.h> +#include "pch.h" + +static void store_initial_timestamp(void) +{ + /* On Cougar Point we have two 32bit scratchpad registers available: + * D0:F0 0xdc (SKPAD) + * D31:F2 0xd0 (SATA SP) + */ + tsc_t tsc = rdtsc(); + pci_write_config32(PCI_DEV(0, 0x00, 0), 0xdc, tsc.lo); + pci_write_config32(PCI_DEV(0, 0x1f, 2), 0xd0, tsc.hi); +} + +/* + * Enable Prefetching and Caching. + */ +static void enable_spi_prefetch(void) +{ + u8 reg8; + device_t dev; + + dev = PCI_DEV(0, 0x1f, 0); + + reg8 = pci_read_config8(dev, 0xdc); + reg8 &= ~(3 << 2); + reg8 |= (2 << 2); /* Prefetching and Caching Enabled */ + pci_write_config8(dev, 0xdc, reg8); +} + + +static void map_rcba(void) +{ + device_t dev = PCI_DEV(0, 0x1f, 0); + + pci_write_config32(dev, RCBA, DEFAULT_RCBA | 1); +} + +static void enable_port80_on_lpc(void) +{ + /* Enable port 80 POST on LPC. The chipset does this by deafult, + * but it doesn't appear to hurt anything. */ + u32 gcs = RCBA32(GCS); + gcs = gcs & ~0x4; + RCBA32(GCS) = gcs; +} + +static void set_spi_speed(void) +{ + u32 fdod; + u8 ssfc; + + /* Observe SPI Descriptor Component Section 0 */ + SPIBAR32(FDOC) = 0x1000; + + /* Extract the Write/Erase SPI Frequency from descriptor */ + fdod = SPIBAR32(FDOD); + fdod >>= 24; + fdod &= 7; + + /* Set Software Sequence frequency to match */ + ssfc = SPIBAR8(SSFC + 2); + ssfc &= ~7; + ssfc |= fdod; + SPIBAR8(SSFC + 2) = ssfc; +} + +static void bootblock_southbridge_init(void) +{ +#if CONFIG_COLLECT_TIMESTAMPS + store_initial_timestamp(); +#endif + map_rcba(); + enable_spi_prefetch(); + enable_port80_on_lpc(); + set_spi_speed(); + + /* Enable upper 128bytes of CMOS */ + RCBA32(RC) = (1 << 2); +} diff --git a/src/southbridge/intel/lynxpoint/chip.h b/src/southbridge/intel/lynxpoint/chip.h new file mode 100644 index 0000000000..1e6195bb62 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/chip.h @@ -0,0 +1,84 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SOUTHBRIDGE_INTEL_LYNXPOINT_CHIP_H +#define SOUTHBRIDGE_INTEL_LYNXPOINT_CHIP_H + +struct southbridge_intel_lynxpoint_config { + /** + * Interrupt Routing configuration + * If bit7 is 1, the interrupt is disabled. + */ + uint8_t pirqa_routing; + uint8_t pirqb_routing; + uint8_t pirqc_routing; + uint8_t pirqd_routing; + uint8_t pirqe_routing; + uint8_t pirqf_routing; + uint8_t pirqg_routing; + uint8_t pirqh_routing; + + /** + * GPI Routing configuration + * + * Only the lower two bits have a meaning: + * 00: No effect + * 01: SMI# (if corresponding ALT_GPI_SMI_EN bit is also set) + * 10: SCI (if corresponding GPIO_EN bit is also set) + * 11: reserved + */ + uint8_t gpi0_routing; + uint8_t gpi1_routing; + uint8_t gpi2_routing; + uint8_t gpi3_routing; + uint8_t gpi4_routing; + uint8_t gpi5_routing; + uint8_t gpi6_routing; + uint8_t gpi7_routing; + uint8_t gpi8_routing; + uint8_t gpi9_routing; + uint8_t gpi10_routing; + uint8_t gpi11_routing; + uint8_t gpi12_routing; + uint8_t gpi13_routing; + uint8_t gpi14_routing; + uint8_t gpi15_routing; + + uint32_t gpe0_en; + uint16_t alt_gp_smi_en; + + /* IDE configuration */ + uint32_t ide_legacy_combined; + uint32_t sata_ahci; + uint8_t sata_port_map; + uint32_t sata_port0_gen3_tx; + uint32_t sata_port1_gen3_tx; + + uint32_t gen1_dec; + uint32_t gen2_dec; + uint32_t gen3_dec; + uint32_t gen4_dec; + + /* Enable linear PCIe Root Port function numbers starting at zero */ + uint8_t pcie_port_coalesce; +}; + +extern struct chip_operations southbridge_intel_lynxpoint_ops; + +#endif /* SOUTHBRIDGE_INTEL_LYNXPOINT_CHIP_H */ diff --git a/src/southbridge/intel/lynxpoint/early_me.c b/src/southbridge/intel/lynxpoint/early_me.c new file mode 100644 index 0000000000..5b266cc10c --- /dev/null +++ b/src/southbridge/intel/lynxpoint/early_me.c @@ -0,0 +1,201 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <arch/hlt.h> +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/console.h> +#include <delay.h> +#include <device/pci_ids.h> +#include <string.h> +#include "me.h" +#include "pch.h" + +static const char *me_ack_values[] = { + [ME_HFS_ACK_NO_DID] = "No DID Ack received", + [ME_HFS_ACK_RESET] = "Non-power cycle reset", + [ME_HFS_ACK_PWR_CYCLE] = "Power cycle reset", + [ME_HFS_ACK_S3] = "Go to S3", + [ME_HFS_ACK_S4] = "Go to S4", + [ME_HFS_ACK_S5] = "Go to S5", + [ME_HFS_ACK_GBL_RESET] = "Global Reset", + [ME_HFS_ACK_CONTINUE] = "Continue to boot" +}; + +static inline void pci_read_dword_ptr(void *ptr, int offset) +{ + u32 dword = pci_read_config32(PCH_ME_DEV, offset); + memcpy(ptr, &dword, sizeof(dword)); +} + +static inline void pci_write_dword_ptr(void *ptr, int offset) +{ + u32 dword = 0; + memcpy(&dword, ptr, sizeof(dword)); + pci_write_config32(PCH_ME_DEV, offset, dword); +} + +void intel_early_me_status(void) +{ + struct me_hfs hfs; + struct me_gmes gmes; + + pci_read_dword_ptr(&hfs, PCI_ME_HFS); + pci_read_dword_ptr(&gmes, PCI_ME_GMES); + + intel_me_status(&hfs, &gmes); +} + +int intel_early_me_init(void) +{ + int count; + struct me_uma uma; + struct me_hfs hfs; + + printk(BIOS_INFO, "Intel ME early init\n"); + + /* Wait for ME UMA SIZE VALID bit to be set */ + for (count = ME_RETRY; count > 0; --count) { + pci_read_dword_ptr(&uma, PCI_ME_UMA); + if (uma.valid) + break; + udelay(ME_DELAY); + } + if (!count) { + printk(BIOS_ERR, "ERROR: ME is not ready!\n"); + return -1; + } + + /* Check for valid firmware */ + pci_read_dword_ptr(&hfs, PCI_ME_HFS); + if (hfs.fpt_bad) { + printk(BIOS_WARNING, "WARNING: ME has bad firmware\n"); + return -1; + } + + printk(BIOS_INFO, "Intel ME firmware is ready\n"); + return 0; +} + +int intel_early_me_uma_size(void) +{ + struct me_uma uma; + + pci_read_dword_ptr(&uma, PCI_ME_UMA); + if (uma.valid) { + printk(BIOS_DEBUG, "ME: Requested %uMB UMA\n", uma.size); + return uma.size; + } + + printk(BIOS_DEBUG, "ME: Invalid UMA size\n"); + return 0; +} + +static inline void set_global_reset(int enable) +{ + u32 etr3 = pci_read_config32(PCH_LPC_DEV, ETR3); + + /* Clear CF9 Without Resume Well Reset Enable */ + etr3 &= ~ETR3_CWORWRE; + + /* CF9GR indicates a Global Reset */ + if (enable) + etr3 |= ETR3_CF9GR; + else + etr3 &= ~ETR3_CF9GR; + + pci_write_config32(PCH_LPC_DEV, ETR3, etr3); +} + +int intel_early_me_init_done(u8 status) +{ + u8 reset; + int count; + u32 mebase_l, mebase_h; + struct me_hfs hfs; + struct me_did did = { + .init_done = ME_INIT_DONE, + .status = status + }; + + /* MEBASE from MESEG_BASE[35:20] */ + mebase_l = pci_read_config32(PCI_CPU_DEVICE, PCI_CPU_MEBASE_L); + mebase_h = pci_read_config32(PCI_CPU_DEVICE, PCI_CPU_MEBASE_H) & 0xf; + did.uma_base = (mebase_l >> 20) | (mebase_h << 12); + + /* Send message to ME */ + printk(BIOS_DEBUG, "ME: Sending Init Done with status: %d, " + "UMA base: 0x%04x\n", status, did.uma_base); + + pci_write_dword_ptr(&did, PCI_ME_H_GS); + + /* Must wait for ME acknowledgement */ + for (count = ME_RETRY; count > 0; --count) { + pci_read_dword_ptr(&hfs, PCI_ME_HFS); + if (hfs.bios_msg_ack) + break; + udelay(ME_DELAY); + } + if (!count) { + printk(BIOS_ERR, "ERROR: ME failed to respond\n"); + return -1; + } + + /* Return the requested BIOS action */ + printk(BIOS_NOTICE, "ME: Requested BIOS Action: %s\n", + me_ack_values[hfs.ack_data]); + + /* Check status after acknowledgement */ + intel_early_me_status(); + + reset = 0; + switch (hfs.ack_data) { + case ME_HFS_ACK_CONTINUE: + /* Continue to boot */ + return 0; + case ME_HFS_ACK_RESET: + /* Non-power cycle reset */ + set_global_reset(0); + reset = 0x06; + break; + case ME_HFS_ACK_PWR_CYCLE: + /* Power cycle reset */ + set_global_reset(0); + reset = 0x0e; + break; + case ME_HFS_ACK_GBL_RESET: + /* Global reset */ + set_global_reset(1); + reset = 0x0e; + break; + case ME_HFS_ACK_S3: + case ME_HFS_ACK_S4: + case ME_HFS_ACK_S5: + break; + } + + /* Perform the requested reset */ + if (reset) { + outb(reset, 0xcf9); + hlt(); + } + return -1; +} diff --git a/src/southbridge/intel/lynxpoint/early_smbus.c b/src/southbridge/intel/lynxpoint/early_smbus.c new file mode 100644 index 0000000000..a626649e2b --- /dev/null +++ b/src/southbridge/intel/lynxpoint/early_smbus.c @@ -0,0 +1,63 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/console.h> +#include <device/pci_ids.h> +#include <device/pci_def.h> +#include "pch.h" +#include "smbus.h" + +void enable_smbus(void) +{ + device_t dev; + + /* Set the SMBus device statically. */ + dev = PCI_DEV(0x0, 0x1f, 0x3); + + /* Check to make sure we've got the right device. */ + if (pci_read_config16(dev, 0x0) != 0x8086) { + die("SMBus controller not found!"); + } + + /* Set SMBus I/O base. */ + pci_write_config32(dev, SMB_BASE, + SMBUS_IO_BASE | PCI_BASE_ADDRESS_SPACE_IO); + + /* Set SMBus enable. */ + pci_write_config8(dev, HOSTC, HST_EN); + + /* Set SMBus I/O space enable. */ + pci_write_config16(dev, PCI_COMMAND, PCI_COMMAND_IO); + + /* Disable interrupt generation. */ + outb(0, SMBUS_IO_BASE + SMBHSTCTL); + + /* Clear any lingering errors, so transactions can run. */ + outb(inb(SMBUS_IO_BASE + SMBHSTSTAT), SMBUS_IO_BASE + SMBHSTSTAT); + print_debug("SMBus controller enabled.\n"); +} + +int smbus_read_byte(unsigned device, unsigned address) +{ + return do_smbus_read_byte(SMBUS_IO_BASE, device, address); +} + diff --git a/src/southbridge/intel/lynxpoint/early_spi.c b/src/southbridge/intel/lynxpoint/early_spi.c new file mode 100644 index 0000000000..ddfc4c2261 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/early_spi.c @@ -0,0 +1,115 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/console.h> +#include <device/pci_ids.h> +#include <device/pci_def.h> +#include <delay.h> +#include "pch.h" + +#define SPI_DELAY 10 /* 10us */ +#define SPI_RETRY 200000 /* 2s */ + +static int early_spi_read_block(u32 offset, u8 size, u8 *buffer) +{ + u32 *ptr32 = (u32*)buffer; + u32 i; + + /* Clear status bits */ + RCBA16(SPIBAR_HSFS) |= SPIBAR_HSFS_AEL | SPIBAR_HSFS_FCERR | + SPIBAR_HSFS_FDONE; + + if (RCBA16(SPIBAR_HSFS) & SPIBAR_HSFS_SCIP) { + printk(BIOS_ERR, "SPI ERROR: transaction in progress\n"); + return -1; + } + + /* Set flash address */ + RCBA32(SPIBAR_FADDR) = offset; + + /* Setup read transaction */ + RCBA16(SPIBAR_HSFC) = SPIBAR_HSFC_BYTE_COUNT(size) | + SPIBAR_HSFC_CYCLE_READ; + + /* Start transactinon */ + RCBA16(SPIBAR_HSFC) |= SPIBAR_HSFC_GO; + + /* Wait for completion */ + for (i = 0; i < SPI_RETRY; i++) { + if (RCBA16(SPIBAR_HSFS) & SPIBAR_HSFS_SCIP) { + /* Cycle in progress, wait 1ms */ + udelay(SPI_DELAY); + continue; + } + + if (RCBA16(SPIBAR_HSFS) & SPIBAR_HSFS_AEL) { + printk(BIOS_ERR, "SPI ERROR: Access Error\n"); + return -1; + + } + + if (RCBA16(SPIBAR_HSFS) & SPIBAR_HSFS_FCERR) { + printk(BIOS_ERR, "SPI ERROR: Flash Cycle Error\n"); + return -1; + } + break; + } + + if (i >= SPI_RETRY) { + printk(BIOS_ERR, "SPI ERROR: Timeout\n"); + return -1; + } + + /* Read the data */ + for (i = 0; i < size; i+=sizeof(u32)) { + if (size-i >= 4) { + /* reading >= dword */ + *ptr32++ = RCBA32(SPIBAR_FDATA(i/sizeof(u32))); + } else { + /* reading < dword */ + u8 j, *ptr8 = (u8*)ptr32; + u32 temp = RCBA32(SPIBAR_FDATA(i/sizeof(u32))); + for (j = 0; j < (size-i); j++) { + *ptr8++ = temp & 0xff; + temp >>= 8; + } + } + } + + return size; +} + +int early_spi_read(u32 offset, u32 size, u8 *buffer) +{ + u32 current = 0; + + while (size > 0) { + u8 count = (size < 64) ? size : 64; + if (early_spi_read_block(offset + current, count, + buffer + current) < 0) + return -1; + size -= count; + current += count; + } + + return 0; +} diff --git a/src/southbridge/intel/lynxpoint/early_usb.c b/src/southbridge/intel/lynxpoint/early_usb.c new file mode 100644 index 0000000000..b2e009123e --- /dev/null +++ b/src/southbridge/intel/lynxpoint/early_usb.c @@ -0,0 +1,57 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/console.h> +#include <device/pci_ids.h> +#include <device/pci_def.h> +#include "pch.h" + +#define PCH_EHCI1_TEMP_BAR0 0xe8000000 +#define PCH_EHCI2_TEMP_BAR0 0xe8000400 + +/* + * Setup USB controller MMIO BAR to prevent the + * reference code from resetting the controller. + * + * The BAR will be re-assigned during device + * enumeration so these are only temporary. + */ +void enable_usb_bar(void) +{ + device_t usb0 = PCH_EHCI1_DEV; + device_t usb1 = PCH_EHCI2_DEV; + u32 cmd; + + /* USB Controller 1 */ + pci_write_config32(usb0, PCI_BASE_ADDRESS_0, + PCH_EHCI1_TEMP_BAR0); + cmd = pci_read_config32(usb0, PCI_COMMAND); + cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; + pci_write_config32(usb0, PCI_COMMAND, cmd); + + /* USB Controller 1 */ + pci_write_config32(usb1, PCI_BASE_ADDRESS_0, + PCH_EHCI1_TEMP_BAR0); + cmd = pci_read_config32(usb1, PCI_COMMAND); + cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; + pci_write_config32(usb1, PCI_COMMAND, cmd); +} diff --git a/src/southbridge/intel/lynxpoint/elog.c b/src/southbridge/intel/lynxpoint/elog.c new file mode 100644 index 0000000000..09dfcdbc2c --- /dev/null +++ b/src/southbridge/intel/lynxpoint/elog.c @@ -0,0 +1,114 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/acpi.h> +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ops.h> +#include <stdint.h> +#include <string.h> +#include <elog.h> +#include "pch.h" + +void pch_log_state(void) +{ + u16 pm1_sts, gen_pmcon_3, tco2_sts; + u32 gpe0_sts, gpe0_en; + u8 gen_pmcon_2; + int i; + struct device *lpc = dev_find_slot(0, PCI_DEVFN(0x1f, 0)); + if (!lpc) + return; + + pm1_sts = inw(DEFAULT_PMBASE + PM1_STS); + gpe0_sts = inl(DEFAULT_PMBASE + GPE0_STS); + gpe0_en = inl(DEFAULT_PMBASE + GPE0_EN); + tco2_sts = inw(DEFAULT_PMBASE + TCO2_STS); + gen_pmcon_2 = pci_read_config8(lpc, GEN_PMCON_2); + gen_pmcon_3 = pci_read_config16(lpc, GEN_PMCON_3); + + /* PWR_FLR Power Failure */ + if (gen_pmcon_2 & (1 << 0)) + elog_add_event(ELOG_TYPE_POWER_FAIL); + + /* SUS Well Power Failure */ + if (gen_pmcon_3 & (1 << 14)) + elog_add_event(ELOG_TYPE_SUS_POWER_FAIL); + + /* SYS_PWROK Failure */ + if (gen_pmcon_2 & (1 << 1)) + elog_add_event(ELOG_TYPE_SYS_PWROK_FAIL); + + /* PWROK Failure */ + if (gen_pmcon_2 & (1 << 0)) + elog_add_event(ELOG_TYPE_PWROK_FAIL); + + /* Second TCO Timeout */ + if (tco2_sts & (1 << 1)) + elog_add_event(ELOG_TYPE_TCO_RESET); + + /* Power Button Override */ + if (pm1_sts & (1 << 11)) + elog_add_event(ELOG_TYPE_POWER_BUTTON_OVERRIDE); + + /* System Reset Status (reset button pushed) */ + if (gen_pmcon_2 & (1 << 4)) + elog_add_event(ELOG_TYPE_RESET_BUTTON); + + /* General Reset Status */ + if (gen_pmcon_3 & (1 << 9)) + elog_add_event(ELOG_TYPE_SYSTEM_RESET); + + /* ACPI Wake */ + if (pm1_sts & (1 << 15)) + elog_add_event_byte(ELOG_TYPE_ACPI_WAKE, + acpi_slp_type == 3 ? 3 : 5); + + /* + * Wake sources + */ + + /* RTC */ + if (pm1_sts & (1 << 10)) + elog_add_event_wake(ELOG_WAKE_SOURCE_RTC, 0); + + /* PCI Express (TODO: determine wake device) */ + if (pm1_sts & (1 << 14)) + elog_add_event_wake(ELOG_WAKE_SOURCE_PCIE, 0); + + /* PME (TODO: determine wake device) */ + if (gpe0_sts & (1 << 13)) + elog_add_event_wake(ELOG_WAKE_SOURCE_PME, 0); + + /* Internal PME (TODO: determine wake device) */ + if (gpe0_sts & (1 << 13)) + elog_add_event_wake(ELOG_WAKE_SOURCE_PME_INTERNAL, 0); + + /* GPIO 0-15 */ + for (i = 0; i < 16; i++) { + if ((gpe0_sts & (1 << (16+i))) && (gpe0_en & (1 << (16+i)))) + elog_add_event_wake(ELOG_WAKE_SOURCE_GPIO, i); + } + + /* SMBUS Wake */ + if (gpe0_sts & (1 << 7)) + elog_add_event_wake(ELOG_WAKE_SOURCE_SMBUS, 0); +} diff --git a/src/southbridge/intel/lynxpoint/finalize.c b/src/southbridge/intel/lynxpoint/finalize.c new file mode 100644 index 0000000000..796633d024 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/finalize.c @@ -0,0 +1,66 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/post_codes.h> +#include <northbridge/intel/haswell/pcie_config.c> +#include <spi-generic.h> +#include "pch.h" + +void intel_pch_finalize_smm(void) +{ + /* Set SPI opcode menu */ + RCBA16(0x3894) = SPI_OPPREFIX; + RCBA16(0x3896) = SPI_OPTYPE; + RCBA32(0x3898) = SPI_OPMENU_LOWER; + RCBA32(0x389c) = SPI_OPMENU_UPPER; + + /* Lock SPIBAR */ + RCBA32_OR(0x3804, (1 << 15)); + +#if CONFIG_SPI_FLASH_SMM + /* Re-init SPI driver to handle locked BAR */ + spi_init(); +#endif + + /* TCLOCKDN: TC Lockdown */ + RCBA32_OR(0x0050, (1 << 31)); + + /* BIOS Interface Lockdown */ + RCBA32_OR(0x3410, (1 << 0)); + + /* Function Disable SUS Well Lockdown */ + RCBA_AND_OR(8, 0x3420, ~0U, (1 << 7)); + + /* Global SMI Lock */ + pcie_or_config16(PCH_LPC_DEV, 0xa0, 1 << 4); + + /* GEN_PMCON Lock */ + pcie_or_config8(PCH_LPC_DEV, 0xa6, (1 << 1) | (1 << 2)); + + /* R/WO registers */ + RCBA32(0x21a4) = RCBA32(0x21a4); + pcie_write_config32(PCI_DEV(0, 27, 0), 0x74, + pcie_read_config32(PCI_DEV(0, 27, 0), 0x74)); + + /* Indicate finalize step with post code */ + outb(POST_OS_BOOT, 0x80); +} diff --git a/src/southbridge/intel/lynxpoint/gpio.c b/src/southbridge/intel/lynxpoint/gpio.c new file mode 100644 index 0000000000..25eda9a74c --- /dev/null +++ b/src/southbridge/intel/lynxpoint/gpio.c @@ -0,0 +1,101 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> +#include <string.h> +#include <arch/io.h> +#include <arch/romcc_io.h> + +#include "pch.h" +#include "gpio.h" + +#define MAX_GPIO_NUMBER 75 /* zero based */ + +void setup_pch_gpios(const struct pch_gpio_map *gpio) +{ + u16 gpiobase = pci_read_config16(PCH_LPC_DEV, GPIO_BASE) & 0xfffc; + + /* GPIO Set 1 */ + if (gpio->set1.level) + outl(*((u32*)gpio->set1.level), gpiobase + GP_LVL); + if (gpio->set1.mode) + outl(*((u32*)gpio->set1.mode), gpiobase + GPIO_USE_SEL); + if (gpio->set1.direction) + outl(*((u32*)gpio->set1.direction), gpiobase + GP_IO_SEL); + if (gpio->set1.reset) + outl(*((u32*)gpio->set1.reset), gpiobase + GP_RST_SEL1); + if (gpio->set1.invert) + outl(*((u32*)gpio->set1.invert), gpiobase + GPI_INV); + if (gpio->set1.blink) + outl(*((u32*)gpio->set1.blink), gpiobase + GPO_BLINK); + + /* GPIO Set 2 */ + if (gpio->set2.level) + outl(*((u32*)gpio->set2.level), gpiobase + GP_LVL2); + if (gpio->set2.mode) + outl(*((u32*)gpio->set2.mode), gpiobase + GPIO_USE_SEL2); + if (gpio->set2.direction) + outl(*((u32*)gpio->set2.direction), gpiobase + GP_IO_SEL2); + if (gpio->set2.reset) + outl(*((u32*)gpio->set2.reset), gpiobase + GP_RST_SEL2); + + /* GPIO Set 3 */ + if (gpio->set3.level) + outl(*((u32*)gpio->set3.level), gpiobase + GP_LVL3); + if (gpio->set3.mode) + outl(*((u32*)gpio->set3.mode), gpiobase + GPIO_USE_SEL3); + if (gpio->set3.direction) + outl(*((u32*)gpio->set3.direction), gpiobase + GP_IO_SEL3); + if (gpio->set3.reset) + outl(*((u32*)gpio->set3.reset), gpiobase + GP_RST_SEL3); +} + +int get_gpio(int gpio_num) +{ + static const int gpio_reg_offsets[] = {0xc, 0x38, 0x48}; + u16 gpio_base = pci_read_config16(PCH_LPC_DEV, GPIO_BASE) & 0xfffc; + int index, bit; + + if (gpio_num > MAX_GPIO_NUMBER) + return 0; /* Just ignore wrong gpio numbers. */ + + index = gpio_num / 32; + bit = gpio_num % 32; + + return (inl(gpio_base + gpio_reg_offsets[index]) >> bit) & 1; +} + +/* + * get a number comprised of multiple GPIO values. gpio_num_array points to + * the array of gpio pin numbers to scan, terminated by -1. + */ +unsigned get_gpios(const int *gpio_num_array) +{ + int gpio; + unsigned bitmask = 1; + unsigned vector = 0; + + while (bitmask && + ((gpio = *gpio_num_array++) != -1)) { + if (get_gpio(gpio)) + vector |= bitmask; + bitmask <<= 1; + } + return vector; +} diff --git a/src/southbridge/intel/lynxpoint/gpio.h b/src/southbridge/intel/lynxpoint/gpio.h new file mode 100644 index 0000000000..a6f99f681d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/gpio.h @@ -0,0 +1,161 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef INTEL_LYNXPOINT_GPIO_H +#define INTEL_LYNXPOINT_GPIO_H + +#define GPIO_MODE_NATIVE 0 +#define GPIO_MODE_GPIO 1 +#define GPIO_MODE_NONE 1 + +#define GPIO_DIR_OUTPUT 0 +#define GPIO_DIR_INPUT 1 + +#define GPIO_NO_INVERT 0 +#define GPIO_INVERT 1 + +#define GPIO_LEVEL_LOW 0 +#define GPIO_LEVEL_HIGH 1 + +#define GPIO_NO_BLINK 0 +#define GPIO_BLINK 1 + +#define GPIO_RESET_PWROK 0 +#define GPIO_RESET_RSMRST 1 + +struct pch_gpio_set1 { + u32 gpio0 : 1; + u32 gpio1 : 1; + u32 gpio2 : 1; + u32 gpio3 : 1; + u32 gpio4 : 1; + u32 gpio5 : 1; + u32 gpio6 : 1; + u32 gpio7 : 1; + u32 gpio8 : 1; + u32 gpio9 : 1; + u32 gpio10 : 1; + u32 gpio11 : 1; + u32 gpio12 : 1; + u32 gpio13 : 1; + u32 gpio14 : 1; + u32 gpio15 : 1; + u32 gpio16 : 1; + u32 gpio17 : 1; + u32 gpio18 : 1; + u32 gpio19 : 1; + u32 gpio20 : 1; + u32 gpio21 : 1; + u32 gpio22 : 1; + u32 gpio23 : 1; + u32 gpio24 : 1; + u32 gpio25 : 1; + u32 gpio26 : 1; + u32 gpio27 : 1; + u32 gpio28 : 1; + u32 gpio29 : 1; + u32 gpio30 : 1; + u32 gpio31 : 1; +} __attribute__ ((packed)); + +struct pch_gpio_set2 { + u32 gpio32 : 1; + u32 gpio33 : 1; + u32 gpio34 : 1; + u32 gpio35 : 1; + u32 gpio36 : 1; + u32 gpio37 : 1; + u32 gpio38 : 1; + u32 gpio39 : 1; + u32 gpio40 : 1; + u32 gpio41 : 1; + u32 gpio42 : 1; + u32 gpio43 : 1; + u32 gpio44 : 1; + u32 gpio45 : 1; + u32 gpio46 : 1; + u32 gpio47 : 1; + u32 gpio48 : 1; + u32 gpio49 : 1; + u32 gpio50 : 1; + u32 gpio51 : 1; + u32 gpio52 : 1; + u32 gpio53 : 1; + u32 gpio54 : 1; + u32 gpio55 : 1; + u32 gpio56 : 1; + u32 gpio57 : 1; + u32 gpio58 : 1; + u32 gpio59 : 1; + u32 gpio60 : 1; + u32 gpio61 : 1; + u32 gpio62 : 1; + u32 gpio63 : 1; +} __attribute__ ((packed)); + +struct pch_gpio_set3 { + u32 gpio64 : 1; + u32 gpio65 : 1; + u32 gpio66 : 1; + u32 gpio67 : 1; + u32 gpio68 : 1; + u32 gpio69 : 1; + u32 gpio70 : 1; + u32 gpio71 : 1; + u32 gpio72 : 1; + u32 gpio73 : 1; + u32 gpio74 : 1; + u32 gpio75 : 1; +} __attribute__ ((packed)); + +struct pch_gpio_map { + struct { + const struct pch_gpio_set1 *mode; + const struct pch_gpio_set1 *direction; + const struct pch_gpio_set1 *level; + const struct pch_gpio_set1 *reset; + const struct pch_gpio_set1 *invert; + const struct pch_gpio_set1 *blink; + } set1; + struct { + const struct pch_gpio_set2 *mode; + const struct pch_gpio_set2 *direction; + const struct pch_gpio_set2 *level; + const struct pch_gpio_set2 *reset; + } set2; + struct { + const struct pch_gpio_set3 *mode; + const struct pch_gpio_set3 *direction; + const struct pch_gpio_set3 *level; + const struct pch_gpio_set3 *reset; + } set3; +}; + +/* Configure GPIOs with mainboard provided settings */ +void setup_pch_gpios(const struct pch_gpio_map *gpio); + +/* get GPIO pin value */ +int get_gpio(int gpio_num); +/* + * get a number comprised of multiple GPIO values. gpio_num_array points to + * the array of gpio pin numbers to scan, terminated by -1. + */ +unsigned get_gpios(const int *gpio_num_array); + +#endif diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c new file mode 100644 index 0000000000..55c2f5aaa0 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -0,0 +1,667 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include <pc80/mc146818rtc.h> +#include <pc80/isa-dma.h> +#include <pc80/i8259.h> +#include <arch/io.h> +#include <arch/ioapic.h> +#include <arch/acpi.h> +#include <cpu/cpu.h> +#include <elog.h> +#include "pch.h" + +#define NMI_OFF 0 + +#define ENABLE_ACPI_MODE_IN_COREBOOT 0 +#define TEST_SMM_FLASH_LOCKDOWN 0 + +typedef struct southbridge_intel_lynxpoint_config config_t; + +static void pch_enable_apic(struct device *dev) +{ + int i; + u32 reg32; + volatile u32 *ioapic_index = (volatile u32 *)(IO_APIC_ADDR); + volatile u32 *ioapic_data = (volatile u32 *)(IO_APIC_ADDR + 0x10); + + /* Enable ACPI I/O and power management. + * Set SCI IRQ to IRQ9 + */ + pci_write_config8(dev, ACPI_CNTL, 0x80); + + *ioapic_index = 0; + *ioapic_data = (1 << 25); + + /* affirm full set of redirection table entries ("write once") */ + *ioapic_index = 1; + reg32 = *ioapic_data; + *ioapic_index = 1; + *ioapic_data = reg32; + + *ioapic_index = 0; + reg32 = *ioapic_data; + printk(BIOS_DEBUG, "Southbridge APIC ID = %x\n", (reg32 >> 24) & 0x0f); + if (reg32 != (1 << 25)) + die("APIC Error\n"); + + printk(BIOS_SPEW, "Dumping IOAPIC registers\n"); + for (i=0; i<3; i++) { + *ioapic_index = i; + printk(BIOS_SPEW, " reg 0x%04x:", i); + reg32 = *ioapic_data; + printk(BIOS_SPEW, " 0x%08x\n", reg32); + } + + *ioapic_index = 3; /* Select Boot Configuration register. */ + *ioapic_data = 1; /* Use Processor System Bus to deliver interrupts. */ +} + +static void pch_enable_serial_irqs(struct device *dev) +{ + /* Set packet length and toggle silent mode bit for one frame. */ + pci_write_config8(dev, SERIRQ_CNTL, + (1 << 7) | (1 << 6) | ((21 - 17) << 2) | (0 << 0)); +#if !CONFIG_SERIRQ_CONTINUOUS_MODE + pci_write_config8(dev, SERIRQ_CNTL, + (1 << 7) | (0 << 6) | ((21 - 17) << 2) | (0 << 0)); +#endif +} + +/* PIRQ[n]_ROUT[3:0] - PIRQ Routing Control + * 0x00 - 0000 = Reserved + * 0x01 - 0001 = Reserved + * 0x02 - 0010 = Reserved + * 0x03 - 0011 = IRQ3 + * 0x04 - 0100 = IRQ4 + * 0x05 - 0101 = IRQ5 + * 0x06 - 0110 = IRQ6 + * 0x07 - 0111 = IRQ7 + * 0x08 - 1000 = Reserved + * 0x09 - 1001 = IRQ9 + * 0x0A - 1010 = IRQ10 + * 0x0B - 1011 = IRQ11 + * 0x0C - 1100 = IRQ12 + * 0x0D - 1101 = Reserved + * 0x0E - 1110 = IRQ14 + * 0x0F - 1111 = IRQ15 + * PIRQ[n]_ROUT[7] - PIRQ Routing Control + * 0x80 - The PIRQ is not routed. + */ + +static void pch_pirq_init(device_t dev) +{ + device_t irq_dev; + /* Get the chip configuration */ + config_t *config = dev->chip_info; + + pci_write_config8(dev, PIRQA_ROUT, config->pirqa_routing); + pci_write_config8(dev, PIRQB_ROUT, config->pirqb_routing); + pci_write_config8(dev, PIRQC_ROUT, config->pirqc_routing); + pci_write_config8(dev, PIRQD_ROUT, config->pirqd_routing); + + pci_write_config8(dev, PIRQE_ROUT, config->pirqe_routing); + pci_write_config8(dev, PIRQF_ROUT, config->pirqf_routing); + pci_write_config8(dev, PIRQG_ROUT, config->pirqg_routing); + pci_write_config8(dev, PIRQH_ROUT, config->pirqh_routing); + + /* Eric Biederman once said we should let the OS do this. + * I am not so sure anymore he was right. + */ + + for(irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) { + u8 int_pin=0, int_line=0; + + if (!irq_dev->enabled || irq_dev->path.type != DEVICE_PATH_PCI) + continue; + + int_pin = pci_read_config8(irq_dev, PCI_INTERRUPT_PIN); + + switch (int_pin) { + case 1: /* INTA# */ int_line = config->pirqa_routing; break; + case 2: /* INTB# */ int_line = config->pirqb_routing; break; + case 3: /* INTC# */ int_line = config->pirqc_routing; break; + case 4: /* INTD# */ int_line = config->pirqd_routing; break; + } + + if (!int_line) + continue; + + pci_write_config8(irq_dev, PCI_INTERRUPT_LINE, int_line); + } +} + +static void pch_gpi_routing(device_t dev) +{ + /* Get the chip configuration */ + config_t *config = dev->chip_info; + u32 reg32 = 0; + + /* An array would be much nicer here, or some + * other method of doing this. + */ + reg32 |= (config->gpi0_routing & 0x03) << 0; + reg32 |= (config->gpi1_routing & 0x03) << 2; + reg32 |= (config->gpi2_routing & 0x03) << 4; + reg32 |= (config->gpi3_routing & 0x03) << 6; + reg32 |= (config->gpi4_routing & 0x03) << 8; + reg32 |= (config->gpi5_routing & 0x03) << 10; + reg32 |= (config->gpi6_routing & 0x03) << 12; + reg32 |= (config->gpi7_routing & 0x03) << 14; + reg32 |= (config->gpi8_routing & 0x03) << 16; + reg32 |= (config->gpi9_routing & 0x03) << 18; + reg32 |= (config->gpi10_routing & 0x03) << 20; + reg32 |= (config->gpi11_routing & 0x03) << 22; + reg32 |= (config->gpi12_routing & 0x03) << 24; + reg32 |= (config->gpi13_routing & 0x03) << 26; + reg32 |= (config->gpi14_routing & 0x03) << 28; + reg32 |= (config->gpi15_routing & 0x03) << 30; + + pci_write_config32(dev, 0xb8, reg32); +} + +static void pch_power_options(device_t dev) +{ + u8 reg8; + u16 reg16, pmbase; + u32 reg32; + const char *state; + /* Get the chip configuration */ + config_t *config = dev->chip_info; + + int pwr_on=CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL; + int nmi_option; + + /* Which state do we want to goto after g3 (power restored)? + * 0 == S0 Full On + * 1 == S5 Soft Off + * + * If the option is not existent (Laptops), use Kconfig setting. + */ + get_option(&pwr_on, "power_on_after_fail"); + + reg16 = pci_read_config16(dev, GEN_PMCON_3); + reg16 &= 0xfffe; + switch (pwr_on) { + case MAINBOARD_POWER_OFF: + reg16 |= 1; + state = "off"; + break; + case MAINBOARD_POWER_ON: + reg16 &= ~1; + state = "on"; + break; + case MAINBOARD_POWER_KEEP: + reg16 &= ~1; + state = "state keep"; + break; + default: + state = "undefined"; + } + + reg16 &= ~(3 << 4); /* SLP_S4# Assertion Stretch 4s */ + reg16 |= (1 << 3); /* SLP_S4# Assertion Stretch Enable */ + + reg16 &= ~(1 << 10); + reg16 |= (1 << 11); /* SLP_S3# Min Assertion Width 50ms */ + + reg16 |= (1 << 12); /* Disable SLP stretch after SUS well */ + + pci_write_config16(dev, GEN_PMCON_3, reg16); + printk(BIOS_INFO, "Set power %s after power failure.\n", state); + + /* Set up NMI on errors. */ + reg8 = inb(0x61); + reg8 &= 0x0f; /* Higher Nibble must be 0 */ + reg8 &= ~(1 << 3); /* IOCHK# NMI Enable */ + // reg8 &= ~(1 << 2); /* PCI SERR# Enable */ + reg8 |= (1 << 2); /* PCI SERR# Disable for now */ + outb(reg8, 0x61); + + reg8 = inb(0x70); + nmi_option = NMI_OFF; + get_option(&nmi_option, "nmi"); + if (nmi_option) { + printk(BIOS_INFO, "NMI sources enabled.\n"); + reg8 &= ~(1 << 7); /* Set NMI. */ + } else { + printk(BIOS_INFO, "NMI sources disabled.\n"); + reg8 |= ( 1 << 7); /* Can't mask NMI from PCI-E and NMI_NOW */ + } + outb(reg8, 0x70); + + /* Enable CPU_SLP# and Intel Speedstep, set SMI# rate down */ + reg16 = pci_read_config16(dev, GEN_PMCON_1); + reg16 &= ~(3 << 0); // SMI# rate 1 minute + reg16 &= ~(1 << 10); // Disable BIOS_PCI_EXP_EN for native PME +#if DEBUG_PERIODIC_SMIS + /* Set DEBUG_PERIODIC_SMIS in pch.h to debug using + * periodic SMIs. + */ + reg16 |= (3 << 0); // Periodic SMI every 8s +#endif + pci_write_config16(dev, GEN_PMCON_1, reg16); + + // Set the board's GPI routing. + pch_gpi_routing(dev); + + pmbase = pci_read_config16(dev, 0x40) & 0xfffe; + + outl(config->gpe0_en, pmbase + GPE0_EN); + outw(config->alt_gp_smi_en, pmbase + ALT_GP_SMI_EN); + + /* Set up power management block and determine sleep mode */ + reg32 = inl(pmbase + 0x04); // PM1_CNT + reg32 &= ~(7 << 10); // SLP_TYP + reg32 |= (1 << 0); // SCI_EN + outl(reg32, pmbase + 0x04); + + /* Clear magic status bits to prevent unexpected wake */ + reg32 = RCBA32(0x3310); + reg32 |= (1 << 4)|(1 << 5)|(1 << 0); + RCBA32(0x3310) = reg32; + + reg32 = RCBA32(0x3f02); + reg32 &= ~0xf; + RCBA32(0x3f02) = reg32; +} + +static void pch_rtc_init(struct device *dev) +{ + u8 reg8; + int rtc_failed; + + reg8 = pci_read_config8(dev, GEN_PMCON_3); + rtc_failed = reg8 & RTC_BATTERY_DEAD; + if (rtc_failed) { + reg8 &= ~RTC_BATTERY_DEAD; + pci_write_config8(dev, GEN_PMCON_3, reg8); +#if CONFIG_ELOG + elog_add_event(ELOG_TYPE_RTC_RESET); +#endif + } + printk(BIOS_DEBUG, "rtc_failed = 0x%x\n", rtc_failed); + + rtc_init(rtc_failed); +} + +/* CougarPoint PCH Power Management init */ +#if 0 +static void cpt_pm_init(struct device *dev) +{ + printk(BIOS_DEBUG, "CougarPoint PM init\n"); + pci_write_config8(dev, 0xa9, 0x47); + RCBA32_AND_OR(0x2238, ~0UL, (1 << 6)|(1 << 0)); + RCBA32_AND_OR(0x228c, ~0UL, (1 << 0)); + RCBA16_AND_OR(0x1100, ~0UL, (1 << 13)|(1 << 14)); + RCBA16_AND_OR(0x0900, ~0UL, (1 << 14)); + RCBA32(0x2304) = 0xc0388400; + RCBA32_AND_OR(0x2314, ~0UL, (1 << 5)|(1 << 18)); + RCBA32_AND_OR(0x2320, ~0UL, (1 << 15)|(1 << 1)); + RCBA32_AND_OR(0x3314, ~0x1f, 0xf); + RCBA32(0x3318) = 0x050f0000; + RCBA32(0x3324) = 0x04000000; + RCBA32_AND_OR(0x3340, ~0UL, 0xfffff); + RCBA32_AND_OR(0x3344, ~0UL, (1 << 1)); + RCBA32(0x3360) = 0x0001c000; + RCBA32(0x3368) = 0x00061100; + RCBA32(0x3378) = 0x7f8fdfff; + RCBA32(0x337c) = 0x000003fc; + RCBA32(0x3388) = 0x00001000; + RCBA32(0x3390) = 0x0001c000; + RCBA32(0x33a0) = 0x00000800; + RCBA32(0x33b0) = 0x00001000; + RCBA32(0x33c0) = 0x00093900; + RCBA32(0x33cc) = 0x24653002; + RCBA32(0x33d0) = 0x062108fe; + RCBA32_AND_OR(0x33d4, 0xf000f000, 0x00670060); + RCBA32(0x3a28) = 0x01010000; + RCBA32(0x3a2c) = 0x01010404; + RCBA32(0x3a80) = 0x01041041; + RCBA32_AND_OR(0x3a84, ~0x0000ffff, 0x00001001); + RCBA32_AND_OR(0x3a84, ~0UL, (1 << 24)); /* SATA 2/3 disabled */ + RCBA32_AND_OR(0x3a88, ~0UL, (1 << 0)); /* SATA 4/5 disabled */ + RCBA32(0x3a6c) = 0x00000001; + RCBA32_AND_OR(0x2344, 0x00ffff00, 0xff00000c); + RCBA32_AND_OR(0x80c, ~(0xff << 20), 0x11 << 20); + RCBA32(0x33c8) = 0; + RCBA32_AND_OR(0x21b0, ~0UL, 0xf); +} +#endif + +static void enable_hpet(void) +{ + u32 reg32; + + /* Move HPET to default address 0xfed00000 and enable it */ + reg32 = RCBA32(HPTC); + reg32 |= (1 << 7); // HPET Address Enable + reg32 &= ~(3 << 0); + RCBA32(HPTC) = reg32; + /* Read it back to stick. It's affected by posted write syndrome. */ + reg32 = RCBA32(HPTC); +} + +static void enable_clock_gating(device_t dev) +{ + u32 reg32; + u16 reg16; + + RCBA32_AND_OR(0x2234, ~0UL, 0xf); + + reg16 = pci_read_config16(dev, GEN_PMCON_1); + reg16 |= (1 << 2) | (1 << 11); + pci_write_config16(dev, GEN_PMCON_1, reg16); + + pch_iobp_update(0xEB007F07, ~0UL, (1 << 31)); + pch_iobp_update(0xEB004000, ~0UL, (1 << 7)); + pch_iobp_update(0xEC007F07, ~0UL, (1 << 31)); + pch_iobp_update(0xEC004000, ~0UL, (1 << 7)); + + reg32 = RCBA32(CG); + reg32 |= (1 << 31); + reg32 |= (1 << 29) | (1 << 28); + reg32 |= (1 << 27) | (1 << 26) | (1 << 25) | (1 << 24); + reg32 |= (1 << 16); + reg32 |= (1 << 17); + reg32 |= (1 << 18); + reg32 |= (1 << 22); + reg32 |= (1 << 23); + reg32 &= ~(1 << 20); + reg32 |= (1 << 19); + reg32 |= (1 << 0); + reg32 |= (0xf << 1); + RCBA32(CG) = reg32; + + RCBA32_OR(0x38c0, 0x7); + RCBA32_OR(0x36d4, 0x6680c004); + RCBA32_OR(0x3564, 0x3); +} + +#if CONFIG_HAVE_SMI_HANDLER +static void pch_lock_smm(struct device *dev) +{ +#if TEST_SMM_FLASH_LOCKDOWN + u8 reg8; +#endif + + if (acpi_slp_type != 3) { +#if ENABLE_ACPI_MODE_IN_COREBOOT + printk(BIOS_DEBUG, "Enabling ACPI via APMC:\n"); + outb(0xe1, 0xb2); // Enable ACPI mode + printk(BIOS_DEBUG, "done.\n"); +#else + printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n"); + outb(0x1e, 0xb2); // Disable ACPI mode + printk(BIOS_DEBUG, "done.\n"); +#endif + } + + /* Don't allow evil boot loaders, kernels, or + * userspace applications to deceive us: + */ + smm_lock(); + +#if TEST_SMM_FLASH_LOCKDOWN + /* Now try this: */ + printk(BIOS_DEBUG, "Locking BIOS to RO... "); + reg8 = pci_read_config8(dev, 0xdc); /* BIOS_CNTL */ + printk(BIOS_DEBUG, " BLE: %s; BWE: %s\n", (reg8&2)?"on":"off", + (reg8&1)?"rw":"ro"); + reg8 &= ~(1 << 0); /* clear BIOSWE */ + pci_write_config8(dev, 0xdc, reg8); + reg8 |= (1 << 1); /* set BLE */ + pci_write_config8(dev, 0xdc, reg8); + printk(BIOS_DEBUG, "ok.\n"); + reg8 = pci_read_config8(dev, 0xdc); /* BIOS_CNTL */ + printk(BIOS_DEBUG, " BLE: %s; BWE: %s\n", (reg8&2)?"on":"off", + (reg8&1)?"rw":"ro"); + + printk(BIOS_DEBUG, "Writing:\n"); + *(volatile u8 *)0xfff00000 = 0x00; + printk(BIOS_DEBUG, "Testing:\n"); + reg8 |= (1 << 0); /* set BIOSWE */ + pci_write_config8(dev, 0xdc, reg8); + + reg8 = pci_read_config8(dev, 0xdc); /* BIOS_CNTL */ + printk(BIOS_DEBUG, " BLE: %s; BWE: %s\n", (reg8&2)?"on":"off", + (reg8&1)?"rw":"ro"); + printk(BIOS_DEBUG, "Done.\n"); +#endif +} +#endif + +static void pch_disable_smm_only_flashing(struct device *dev) +{ + u8 reg8; + + printk(BIOS_SPEW, "Enabling BIOS updates outside of SMM... "); + reg8 = pci_read_config8(dev, 0xdc); /* BIOS_CNTL */ + reg8 &= ~(1 << 5); + pci_write_config8(dev, 0xdc, reg8); +} + +static void pch_fixups(struct device *dev) +{ + u8 gen_pmcon_2; + + /* Indicate DRAM init done for MRC S3 to know it can resume */ + gen_pmcon_2 = pci_read_config8(dev, GEN_PMCON_2); + gen_pmcon_2 |= (1 << 7); + pci_write_config8(dev, GEN_PMCON_2, gen_pmcon_2); + + /* + * Enable DMI ASPM in the PCH + */ + RCBA32_AND_OR(0x2304, ~(1 << 10), 0); + RCBA32_OR(0x21a4, (1 << 11)|(1 << 10)); + RCBA32_OR(0x21a8, 0x3); +} + +static void pch_decode_init(struct device *dev) +{ + config_t *config = dev->chip_info; + + printk(BIOS_DEBUG, "pch_decode_init\n"); + + pci_write_config32(dev, LPC_GEN1_DEC, config->gen1_dec); + pci_write_config32(dev, LPC_GEN2_DEC, config->gen2_dec); + pci_write_config32(dev, LPC_GEN3_DEC, config->gen3_dec); + pci_write_config32(dev, LPC_GEN4_DEC, config->gen4_dec); +} + +static void lpc_init(struct device *dev) +{ + printk(BIOS_DEBUG, "pch: lpc_init\n"); + + /* Set the value for PCI command register. */ + pci_write_config16(dev, PCI_COMMAND, 0x000f); + + /* IO APIC initialization. */ + pch_enable_apic(dev); + + pch_enable_serial_irqs(dev); + + /* Setup the PIRQ. */ + pch_pirq_init(dev); + + /* Setup power options. */ + pch_power_options(dev); + + /* Initialize power management */ + switch (pch_silicon_type()) { + default: + printk(BIOS_ERR, "Unknown Chipset: 0x%04x\n", dev->device); + } + + /* Set the state of the GPIO lines. */ + //gpio_init(dev); + + /* Initialize the real time clock. */ + pch_rtc_init(dev); + + /* Initialize ISA DMA. */ + isa_dma_init(); + + /* Initialize the High Precision Event Timers, if present. */ + enable_hpet(); + + /* Initialize Clock Gating */ + enable_clock_gating(dev); + + setup_i8259(); + + /* The OS should do this? */ + /* Interrupt 9 should be level triggered (SCI) */ + i8259_configure_irq_trigger(9, 1); + + pch_disable_smm_only_flashing(dev); + +#if CONFIG_HAVE_SMI_HANDLER + pch_lock_smm(dev); +#endif + + pch_fixups(dev); +} + +static void pch_lpc_read_resources(device_t dev) +{ + struct resource *res; + config_t *config = dev->chip_info; + u8 io_index = 0; + + /* Get the normal PCI resources of this device. */ + pci_dev_read_resources(dev); + + /* Add an extra subtractive resource for both memory and I/O. */ + res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0)); + res->base = 0; + res->size = 0x1000; + res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | + IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + + res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0)); + res->base = 0xff800000; + res->size = 0x00800000; /* 8 MB for flash */ + res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | + IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + + res = new_resource(dev, 3); /* IOAPIC */ + res->base = IO_APIC_ADDR; + res->size = 0x00001000; + res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + + /* Set PCH IO decode ranges if required.*/ + if ((config->gen1_dec & 0xFFFC) > 0x1000) { + res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0)); + res->base = config->gen1_dec & 0xFFFC; + res->size = (config->gen1_dec >> 16) & 0xFC; + res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | + IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + } + + if ((config->gen2_dec & 0xFFFC) > 0x1000) { + res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0)); + res->base = config->gen2_dec & 0xFFFC; + res->size = (config->gen2_dec >> 16) & 0xFC; + res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | + IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + } + + if ((config->gen3_dec & 0xFFFC) > 0x1000) { + res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0)); + res->base = config->gen3_dec & 0xFFFC; + res->size = (config->gen3_dec >> 16) & 0xFC; + res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | + IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + } + + if ((config->gen4_dec & 0xFFFC) > 0x1000) { + res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0)); + res->base = config->gen4_dec & 0xFFFC; + res->size = (config->gen4_dec >> 16) & 0xFC; + res->flags = IORESOURCE_IO| IORESOURCE_SUBTRACTIVE | + IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + } +} + +static void pch_lpc_enable_resources(device_t dev) +{ + pch_decode_init(dev); + return pci_dev_enable_resources(dev); +} + +static void pch_lpc_enable(device_t dev) +{ + /* Enable PCH Display Port */ + RCBA16(DISPBDF) = 0x0010; + RCBA32_OR(FD2, PCH_ENABLE_DBDF); + + pch_enable(dev); +} + +static void set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations pci_ops = { + .set_subsystem = set_subsystem, +}; + +static struct device_operations device_ops = { + .read_resources = pch_lpc_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pch_lpc_enable_resources, + .init = lpc_init, + .enable = pch_lpc_enable, + .scan_bus = scan_static_bus, + .ops_pci = &pci_ops, +}; + + +/* IDs for LPC device of Intel 6 Series Chipset, Intel 7 Series Chipset, and + * Intel C200 Series Chipset + */ + +static const unsigned short pci_device_ids[] = { 0x1c46, 0x1c47, 0x1c49, 0x1c4a, + 0x1c4b, 0x1c4c, 0x1c4d, 0x1c4e, + 0x1c4f, 0x1c50, 0x1c52, 0x1c54, + 0x1e55, 0x1c56, 0x1e57, 0x1c5c, + 0x1e5d, 0x1e5e, 0x1e5f, + 0 }; + +static const struct pci_driver pch_lpc __pci_driver = { + .ops = &device_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; + + diff --git a/src/southbridge/intel/lynxpoint/me.h b/src/southbridge/intel/lynxpoint/me.h new file mode 100644 index 0000000000..aaeb24d65d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/me.h @@ -0,0 +1,373 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _INTEL_ME_H +#define _INTEL_ME_H + +#define ME_RETRY 100000 /* 1 second */ +#define ME_DELAY 10 /* 10 us */ + +/* + * Management Engine PCI registers + */ + +#define PCI_CPU_DEVICE PCI_DEV(0,0,0) +#define PCI_CPU_MEBASE_L 0x70 /* Set by MRC */ +#define PCI_CPU_MEBASE_H 0x74 /* Set by MRC */ + +#define PCI_ME_HFS 0x40 +#define ME_HFS_CWS_RESET 0 +#define ME_HFS_CWS_INIT 1 +#define ME_HFS_CWS_REC 2 +#define ME_HFS_CWS_NORMAL 5 +#define ME_HFS_CWS_WAIT 6 +#define ME_HFS_CWS_TRANS 7 +#define ME_HFS_CWS_INVALID 8 +#define ME_HFS_STATE_PREBOOT 0 +#define ME_HFS_STATE_M0_UMA 1 +#define ME_HFS_STATE_M3 4 +#define ME_HFS_STATE_M0 5 +#define ME_HFS_STATE_BRINGUP 6 +#define ME_HFS_STATE_ERROR 7 +#define ME_HFS_ERROR_NONE 0 +#define ME_HFS_ERROR_UNCAT 1 +#define ME_HFS_ERROR_IMAGE 3 +#define ME_HFS_ERROR_DEBUG 4 +#define ME_HFS_MODE_NORMAL 0 +#define ME_HFS_MODE_DEBUG 2 +#define ME_HFS_MODE_DIS 3 +#define ME_HFS_MODE_OVER_JMPR 4 +#define ME_HFS_MODE_OVER_MEI 5 +#define ME_HFS_BIOS_DRAM_ACK 1 +#define ME_HFS_ACK_NO_DID 0 +#define ME_HFS_ACK_RESET 1 +#define ME_HFS_ACK_PWR_CYCLE 2 +#define ME_HFS_ACK_S3 3 +#define ME_HFS_ACK_S4 4 +#define ME_HFS_ACK_S5 5 +#define ME_HFS_ACK_GBL_RESET 6 +#define ME_HFS_ACK_CONTINUE 7 + +struct me_hfs { + u32 working_state: 4; + u32 mfg_mode: 1; + u32 fpt_bad: 1; + u32 operation_state: 3; + u32 fw_init_complete: 1; + u32 ft_bup_ld_flr: 1; + u32 update_in_progress: 1; + u32 error_code: 4; + u32 operation_mode: 4; + u32 reserved: 4; + u32 boot_options_present: 1; + u32 ack_data: 3; + u32 bios_msg_ack: 4; +} __attribute__ ((packed)); + +#define PCI_ME_UMA 0x44 + +struct me_uma { + u32 size: 6; + u32 reserved_1: 10; + u32 valid: 1; + u32 reserved_0: 14; + u32 set_to_one: 1; +} __attribute__ ((packed)); + +#define PCI_ME_H_GS 0x4c +#define ME_INIT_DONE 1 +#define ME_INIT_STATUS_SUCCESS 0 +#define ME_INIT_STATUS_NOMEM 1 +#define ME_INIT_STATUS_ERROR 2 + +struct me_did { + u32 uma_base: 16; + u32 reserved: 8; + u32 status: 4; + u32 init_done: 4; +} __attribute__ ((packed)); + +#define PCI_ME_GMES 0x48 +#define ME_GMES_PHASE_ROM 0 +#define ME_GMES_PHASE_BUP 1 +#define ME_GMES_PHASE_UKERNEL 2 +#define ME_GMES_PHASE_POLICY 3 +#define ME_GMES_PHASE_MODULE 4 +#define ME_GMES_PHASE_UNKNOWN 5 +#define ME_GMES_PHASE_HOST 6 + +struct me_gmes { + u32 bist_in_prog : 1; + u32 icc_prog_sts : 2; + u32 invoke_mebx : 1; + u32 cpu_replaced_sts : 1; + u32 mbp_rdy : 1; + u32 mfs_failure : 1; + u32 warm_rst_req_for_df : 1; + u32 cpu_replaced_valid : 1; + u32 reserved_1 : 2; + u32 fw_upd_ipu : 1; + u32 reserved_2 : 4; + u32 current_state: 8; + u32 current_pmevent: 4; + u32 progress_code: 4; +} __attribute__ ((packed)); + +#define PCI_ME_HERES 0xbc +#define PCI_ME_EXT_SHA1 0x00 +#define PCI_ME_EXT_SHA256 0x02 +#define PCI_ME_HER(x) (0xc0+(4*(x))) + +struct me_heres { + u32 extend_reg_algorithm: 4; + u32 reserved: 26; + u32 extend_feature_present: 1; + u32 extend_reg_valid: 1; +} __attribute__ ((packed)); + +/* + * Management Engine MEI registers + */ + +#define MEI_H_CB_WW 0x00 +#define MEI_H_CSR 0x04 +#define MEI_ME_CB_RW 0x08 +#define MEI_ME_CSR_HA 0x0c + +struct mei_csr { + u32 interrupt_enable: 1; + u32 interrupt_status: 1; + u32 interrupt_generate: 1; + u32 ready: 1; + u32 reset: 1; + u32 reserved: 3; + u32 buffer_read_ptr: 8; + u32 buffer_write_ptr: 8; + u32 buffer_depth: 8; +} __attribute__ ((packed)); + +#define MEI_ADDRESS_CORE 0x01 +#define MEI_ADDRESS_AMT 0x02 +#define MEI_ADDRESS_RESERVED 0x03 +#define MEI_ADDRESS_WDT 0x04 +#define MEI_ADDRESS_MKHI 0x07 +#define MEI_ADDRESS_ICC 0x08 +#define MEI_ADDRESS_THERMAL 0x09 + +#define MEI_HOST_ADDRESS 0 + +struct mei_header { + u32 client_address: 8; + u32 host_address: 8; + u32 length: 9; + u32 reserved: 6; + u32 is_complete: 1; +} __attribute__ ((packed)); + +#define MKHI_GROUP_ID_CBM 0x00 +#define MKHI_GROUP_ID_FWCAPS 0x03 +#define MKHI_GROUP_ID_MDES 0x08 +#define MKHI_GROUP_ID_GEN 0xff + +#define MKHI_GLOBAL_RESET 0x0b + +#define MKHI_FWCAPS_GET_RULE 0x02 + +#define MKHI_MDES_ENABLE 0x09 + +#define MKHI_GET_FW_VERSION 0x02 +#define MKHI_END_OF_POST 0x0c +#define MKHI_FEATURE_OVERRIDE 0x14 + +struct mkhi_header { + u32 group_id: 8; + u32 command: 7; + u32 is_response: 1; + u32 reserved: 8; + u32 result: 8; +} __attribute__ ((packed)); + +struct me_fw_version { + u16 code_minor; + u16 code_major; + u16 code_build_number; + u16 code_hot_fix; + u16 recovery_minor; + u16 recovery_major; + u16 recovery_build_number; + u16 recovery_hot_fix; +} __attribute__ ((packed)); + + +#define HECI_EOP_STATUS_SUCCESS 0x0 +#define HECI_EOP_PERFORM_GLOBAL_RESET 0x1 + +#define CBM_RR_GLOBAL_RESET 0x01 + +#define GLOBAL_RESET_BIOS_MRC 0x01 +#define GLOBAL_RESET_BIOS_POST 0x02 +#define GLOBAL_RESET_MEBX 0x03 + +struct me_global_reset { + u8 request_origin; + u8 reset_type; +} __attribute__ ((packed)); + +typedef enum { + ME_NORMAL_BIOS_PATH, + ME_S3WAKE_BIOS_PATH, + ME_ERROR_BIOS_PATH, + ME_RECOVERY_BIOS_PATH, + ME_DISABLE_BIOS_PATH, + ME_FIRMWARE_UPDATE_BIOS_PATH, +} me_bios_path; + +/* Defined in me_status.c for both romstage and ramstage */ +void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes); + +#ifdef __PRE_RAM__ +void intel_early_me_status(void); +int intel_early_me_init(void); +int intel_early_me_uma_size(void); +int intel_early_me_init_done(u8 status); +#endif + +#ifdef __SMM__ +void intel_me_finalize_smm(void); +void intel_me8_finalize_smm(void); +#endif +typedef struct { + u32 major_version : 16; + u32 minor_version : 16; + u32 hotfix_version : 16; + u32 build_version : 16; +} __attribute__ ((packed)) mbp_fw_version_name; + +typedef struct { + u8 num_icc_profiles; + u8 icc_profile_soft_strap; + u8 icc_profile_index; + u8 reserved; + u32 register_lock_mask[3]; +} __attribute__ ((packed)) mbp_icc_profile; + +typedef struct { + u32 full_net : 1; + u32 std_net : 1; + u32 manageability : 1; + u32 small_business : 1; + u32 l3manageability : 1; + u32 intel_at : 1; + u32 intel_cls : 1; + u32 reserved : 3; + u32 intel_mpc : 1; + u32 icc_over_clocking : 1; + u32 pavp : 1; + u32 reserved_1 : 4; + u32 ipv6 : 1; + u32 kvm : 1; + u32 och : 1; + u32 vlan : 1; + u32 tls : 1; + u32 reserved_4 : 1; + u32 wlan : 1; + u32 reserved_5 : 8; +} __attribute__ ((packed)) mefwcaps_sku; + +typedef struct { + u16 lock_state : 1; + u16 authenticate_module : 1; + u16 s3authentication : 1; + u16 flash_wear_out : 1; + u16 flash_variable_security : 1; + u16 wwan3gpresent : 1; + u16 wwan3goob : 1; + u16 reserved : 9; +} __attribute__ ((packed)) tdt_state_flag; + +typedef struct { + u8 state; + u8 last_theft_trigger; + tdt_state_flag flags; +} __attribute__ ((packed)) tdt_state_info; + +typedef struct { + u32 platform_target_usage_type : 4; + u32 platform_target_market_type : 2; + u32 super_sku : 1; + u32 reserved : 1; + u32 intel_me_fw_image_type : 4; + u32 platform_brand : 4; + u32 reserved_1 : 16; +} __attribute__ ((packed)) platform_type_rule_data; + +typedef struct { + mefwcaps_sku fw_capabilities; + u8 available; +} mbp_fw_caps; + +typedef struct { + u16 device_id; + u16 fuse_test_flags; + u32 umchid[4]; +} __attribute__ ((packed)) mbp_rom_bist_data; + +typedef struct { + u32 key[8]; +} mbp_platform_key; + +typedef struct { + platform_type_rule_data rule_data; + u8 available; +} mbp_plat_type; + +typedef struct { + mbp_fw_version_name fw_version_name; + mbp_fw_caps fw_caps_sku; + mbp_rom_bist_data rom_bist_data; + mbp_platform_key platform_key; + mbp_plat_type fw_plat_type; + mbp_icc_profile icc_profile; + tdt_state_info at_state; + u32 mfsintegrity; +} me_bios_payload; + +typedef struct { + u32 mbp_size : 8; + u32 num_entries : 8; + u32 rsvd : 16; +} __attribute__ ((packed)) mbp_header; + +typedef struct { + u32 app_id : 8; + u32 item_id : 8; + u32 length : 8; + u32 rsvd : 8; +} __attribute__ ((packed)) mbp_item_header; + +struct me_fwcaps { + u32 id; + u8 length; + mefwcaps_sku caps_sku; + u8 reserved[3]; +} __attribute__ ((packed)); + +#endif /* _INTEL_ME_H */ diff --git a/src/southbridge/intel/lynxpoint/me_9.x.c b/src/southbridge/intel/lynxpoint/me_9.x.c new file mode 100644 index 0000000000..e691cf340e --- /dev/null +++ b/src/southbridge/intel/lynxpoint/me_9.x.c @@ -0,0 +1,936 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/* + * This is a ramstage driver for the Intel Management Engine found in the + * 6-series chipset. It handles the required boot-time messages over the + * MMIO-based Management Engine Interface to tell the ME that the BIOS is + * finished with POST. Additional messages are defined for debug but are + * not used unless the console loglevel is high enough. + */ + +#include <arch/acpi.h> +#include <arch/hlt.h> +#include <arch/io.h> +#include <console/console.h> +#include <device/pci_ids.h> +#include <device/pci_def.h> +#include <string.h> +#include <delay.h> +#include <elog.h> + +#ifdef __SMM__ +# include <arch/romcc_io.h> +# include <northbridge/intel/haswell/pcie_config.c> +#else +# include <device/device.h> +# include <device/pci.h> +#endif + +#include "me.h" +#include "pch.h" + +#if CONFIG_CHROMEOS +#include <vendorcode/google/chromeos/chromeos.h> +#include <vendorcode/google/chromeos/gnvs.h> +#endif + +#ifndef __SMM__ +/* Path that the BIOS should take based on ME state */ +static const char *me_bios_path_values[] = { + [ME_NORMAL_BIOS_PATH] = "Normal", + [ME_S3WAKE_BIOS_PATH] = "S3 Wake", + [ME_ERROR_BIOS_PATH] = "Error", + [ME_RECOVERY_BIOS_PATH] = "Recovery", + [ME_DISABLE_BIOS_PATH] = "Disable", + [ME_FIRMWARE_UPDATE_BIOS_PATH] = "Firmware Update", +}; +static int intel_me_read_mbp(me_bios_payload *mbp_data); +#endif + +/* MMIO base address for MEI interface */ +static u32 mei_base_address; + +#if CONFIG_DEBUG_INTEL_ME +static void mei_dump(void *ptr, int dword, int offset, const char *type) +{ + struct mei_csr *csr; + + printk(BIOS_SPEW, "%-9s[%02x] : ", type, offset); + + switch (offset) { + case MEI_H_CSR: + case MEI_ME_CSR_HA: + csr = ptr; + if (!csr) { + printk(BIOS_SPEW, "ERROR: 0x%08x\n", dword); + break; + } + printk(BIOS_SPEW, "cbd=%u cbrp=%02u cbwp=%02u ready=%u " + "reset=%u ig=%u is=%u ie=%u\n", csr->buffer_depth, + csr->buffer_read_ptr, csr->buffer_write_ptr, + csr->ready, csr->reset, csr->interrupt_generate, + csr->interrupt_status, csr->interrupt_enable); + break; + case MEI_ME_CB_RW: + case MEI_H_CB_WW: + printk(BIOS_SPEW, "CB: 0x%08x\n", dword); + break; + default: + printk(BIOS_SPEW, "0x%08x\n", offset); + break; + } +} +#else +# define mei_dump(ptr,dword,offset,type) do {} while (0) +#endif + +/* + * ME/MEI access helpers using memcpy to avoid aliasing. + */ + +static inline void mei_read_dword_ptr(void *ptr, int offset) +{ + u32 dword = read32(mei_base_address + offset); + memcpy(ptr, &dword, sizeof(dword)); + mei_dump(ptr, dword, offset, "READ"); +} + +static inline void mei_write_dword_ptr(void *ptr, int offset) +{ + u32 dword = 0; + memcpy(&dword, ptr, sizeof(dword)); + write32(mei_base_address + offset, dword); + mei_dump(ptr, dword, offset, "WRITE"); +} + +#ifndef __SMM__ +static inline void pci_read_dword_ptr(device_t dev, void *ptr, int offset) +{ + u32 dword = pci_read_config32(dev, offset); + memcpy(ptr, &dword, sizeof(dword)); + mei_dump(ptr, dword, offset, "PCI READ"); +} +#endif + +static inline void read_host_csr(struct mei_csr *csr) +{ + mei_read_dword_ptr(csr, MEI_H_CSR); +} + +static inline void write_host_csr(struct mei_csr *csr) +{ + mei_write_dword_ptr(csr, MEI_H_CSR); +} + +static inline void read_me_csr(struct mei_csr *csr) +{ + mei_read_dword_ptr(csr, MEI_ME_CSR_HA); +} + +static inline void write_cb(u32 dword) +{ + write32(mei_base_address + MEI_H_CB_WW, dword); + mei_dump(NULL, dword, MEI_H_CB_WW, "WRITE"); +} + +static inline u32 read_cb(void) +{ + u32 dword = read32(mei_base_address + MEI_ME_CB_RW); + mei_dump(NULL, dword, MEI_ME_CB_RW, "READ"); + return dword; +} + +/* Wait for ME ready bit to be asserted */ +static int mei_wait_for_me_ready(void) +{ + struct mei_csr me; + unsigned try = ME_RETRY; + + while (try--) { + read_me_csr(&me); + if (me.ready) + return 0; + udelay(ME_DELAY); + } + + printk(BIOS_ERR, "ME: failed to become ready\n"); + return -1; +} + +static void mei_reset(void) +{ + struct mei_csr host; + + if (mei_wait_for_me_ready() < 0) + return; + + /* Reset host and ME circular buffers for next message */ + read_host_csr(&host); + host.reset = 1; + host.interrupt_generate = 1; + write_host_csr(&host); + + if (mei_wait_for_me_ready() < 0) + return; + + /* Re-init and indicate host is ready */ + read_host_csr(&host); + host.interrupt_generate = 1; + host.ready = 1; + host.reset = 0; + write_host_csr(&host); +} + +static int mei_send_msg(struct mei_header *mei, struct mkhi_header *mkhi, + void *req_data) +{ + struct mei_csr host; + unsigned ndata, n; + u32 *data; + + /* Number of dwords to write, ignoring MKHI */ + ndata = mei->length >> 2; + + /* Pad non-dword aligned request message length */ + if (mei->length & 3) + ndata++; + if (!ndata) { + printk(BIOS_DEBUG, "ME: request does not include MKHI\n"); + return -1; + } + ndata++; /* Add MEI header */ + + /* + * Make sure there is still room left in the circular buffer. + * Reset the buffer pointers if the requested message will not fit. + */ + read_host_csr(&host); + if ((host.buffer_depth - host.buffer_write_ptr) < ndata) { + printk(BIOS_ERR, "ME: circular buffer full, resetting...\n"); + mei_reset(); + read_host_csr(&host); + } + + /* + * This implementation does not handle splitting large messages + * across multiple transactions. Ensure the requested length + * will fit in the available circular buffer depth. + */ + if ((host.buffer_depth - host.buffer_write_ptr) < ndata) { + printk(BIOS_ERR, "ME: message (%u) too large for buffer (%u)\n", + ndata + 2, host.buffer_depth); + return -1; + } + + /* Write MEI header */ + mei_write_dword_ptr(mei, MEI_H_CB_WW); + ndata--; + + /* Write MKHI header */ + mei_write_dword_ptr(mkhi, MEI_H_CB_WW); + ndata--; + + /* Write message data */ + data = req_data; + for (n = 0; n < ndata; ++n) + write_cb(*data++); + + /* Generate interrupt to the ME */ + read_host_csr(&host); + host.interrupt_generate = 1; + write_host_csr(&host); + + /* Make sure ME is ready after sending request data */ + return mei_wait_for_me_ready(); +} + +static int mei_recv_msg(struct mkhi_header *mkhi, + void *rsp_data, int rsp_bytes) +{ + struct mei_header mei_rsp; + struct mkhi_header mkhi_rsp; + struct mei_csr me, host; + unsigned ndata, n/*, me_data_len*/; + unsigned expected; + u32 *data; + + /* Total number of dwords to read from circular buffer */ + expected = (rsp_bytes + sizeof(mei_rsp) + sizeof(mkhi_rsp)) >> 2; + if (rsp_bytes & 3) + expected++; + + /* + * The interrupt status bit does not appear to indicate that the + * message has actually been received. Instead we wait until the + * expected number of dwords are present in the circular buffer. + */ + for (n = ME_RETRY; n; --n) { + read_me_csr(&me); + if ((me.buffer_write_ptr - me.buffer_read_ptr) >= expected) + break; + udelay(ME_DELAY); + } + if (!n) { + printk(BIOS_ERR, "ME: timeout waiting for data: expected " + "%u, available %u\n", expected, + me.buffer_write_ptr - me.buffer_read_ptr); + return -1; + } + + /* Read and verify MEI response header from the ME */ + mei_read_dword_ptr(&mei_rsp, MEI_ME_CB_RW); + if (!mei_rsp.is_complete) { + printk(BIOS_ERR, "ME: response is not complete\n"); + return -1; + } + + /* Handle non-dword responses and expect at least MKHI header */ + ndata = mei_rsp.length >> 2; + if (mei_rsp.length & 3) + ndata++; + if (ndata != (expected - 1)) { + printk(BIOS_ERR, "ME: response is missing data %d != %d\n", + ndata, (expected - 1)); + return -1; + } + + /* Read and verify MKHI response header from the ME */ + mei_read_dword_ptr(&mkhi_rsp, MEI_ME_CB_RW); + if (!mkhi_rsp.is_response || + mkhi->group_id != mkhi_rsp.group_id || + mkhi->command != mkhi_rsp.command) { + printk(BIOS_ERR, "ME: invalid response, group %u ?= %u," + "command %u ?= %u, is_response %u\n", mkhi->group_id, + mkhi_rsp.group_id, mkhi->command, mkhi_rsp.command, + mkhi_rsp.is_response); + return -1; + } + ndata--; /* MKHI header has been read */ + + /* Make sure caller passed a buffer with enough space */ + if (ndata != (rsp_bytes >> 2)) { + printk(BIOS_ERR, "ME: not enough room in response buffer: " + "%u != %u\n", ndata, rsp_bytes >> 2); + return -1; + } + + /* Read response data from the circular buffer */ + data = rsp_data; + for (n = 0; n < ndata; ++n) + *data++ = read_cb(); + + /* Tell the ME that we have consumed the response */ + read_host_csr(&host); + host.interrupt_status = 1; + host.interrupt_generate = 1; + write_host_csr(&host); + + return mei_wait_for_me_ready(); +} + +static inline int mei_sendrecv(struct mei_header *mei, struct mkhi_header *mkhi, + void *req_data, void *rsp_data, int rsp_bytes) +{ + if (mei_send_msg(mei, mkhi, req_data) < 0) + return -1; + if (mei_recv_msg(mkhi, rsp_data, rsp_bytes) < 0) + return -1; + return 0; +} + +#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) && !defined(__SMM__) +static inline void print_cap(const char *name, int state) +{ + printk(BIOS_DEBUG, "ME Capability: %-41s : %sabled\n", + name, state ? " en" : "dis"); +} + +static void me_print_fw_version(mbp_fw_version_name *vers_name) +{ + if (!vers_name->major_version) { + printk(BIOS_ERR, "ME: mbp missing version report\n"); + return; + } + + printk(BIOS_DEBUG, "ME: found version %d.%d.%d.%d\n", + vers_name->major_version, vers_name->minor_version, + vers_name->hotfix_version, vers_name->build_version); +} + +/* Get ME Firmware Capabilities */ +static int mkhi_get_fwcaps(mefwcaps_sku *cap) +{ + u32 rule_id = 0; + struct me_fwcaps cap_msg; + struct mkhi_header mkhi = { + .group_id = MKHI_GROUP_ID_FWCAPS, + .command = MKHI_FWCAPS_GET_RULE, + }; + struct mei_header mei = { + .is_complete = 1, + .host_address = MEI_HOST_ADDRESS, + .client_address = MEI_ADDRESS_MKHI, + .length = sizeof(mkhi) + sizeof(rule_id), + }; + + /* Send request and wait for response */ + if (mei_sendrecv(&mei, &mkhi, &rule_id, &cap_msg, sizeof(cap_msg)) + < 0) { + printk(BIOS_ERR, "ME: GET FWCAPS message failed\n"); + return -1; + } + *cap = cap_msg.caps_sku; + return 0; +} + +/* Get ME Firmware Capabilities */ +static void me_print_fwcaps(mbp_fw_caps *caps_section) +{ + mefwcaps_sku *cap = &caps_section->fw_capabilities; + if (!caps_section->available) { + printk(BIOS_ERR, "ME: mbp missing fwcaps report\n"); + if (mkhi_get_fwcaps(cap)) + return; + } + + print_cap("Full Network manageability", cap->full_net); + print_cap("Regular Network manageability", cap->std_net); + print_cap("Manageability", cap->manageability); + print_cap("Small business technology", cap->small_business); + print_cap("Level III manageability", cap->l3manageability); + print_cap("IntelR Anti-Theft (AT)", cap->intel_at); + print_cap("IntelR Capability Licensing Service (CLS)", cap->intel_cls); + print_cap("IntelR Power Sharing Technology (MPC)", cap->intel_mpc); + print_cap("ICC Over Clocking", cap->icc_over_clocking); + print_cap("Protected Audio Video Path (PAVP)", cap->pavp); + print_cap("IPV6", cap->ipv6); + print_cap("KVM Remote Control (KVM)", cap->kvm); + print_cap("Outbreak Containment Heuristic (OCH)", cap->och); + print_cap("Virtual LAN (VLAN)", cap->vlan); + print_cap("TLS", cap->tls); + print_cap("Wireless LAN (WLAN)", cap->wlan); +} +#endif + +#if CONFIG_CHROMEOS && 0 /* DISABLED */ +/* Tell ME to issue a global reset */ +static int mkhi_global_reset(void) +{ + struct me_global_reset reset = { + .request_origin = GLOBAL_RESET_BIOS_POST, + .reset_type = CBM_RR_GLOBAL_RESET, + }; + struct mkhi_header mkhi = { + .group_id = MKHI_GROUP_ID_CBM, + .command = MKHI_GLOBAL_RESET, + }; + struct mei_header mei = { + .is_complete = 1, + .length = sizeof(mkhi) + sizeof(reset), + .host_address = MEI_HOST_ADDRESS, + .client_address = MEI_ADDRESS_MKHI, + }; + + /* Send request and wait for response */ + printk(BIOS_NOTICE, "ME: %s\n", __FUNCTION__); + if (mei_sendrecv(&mei, &mkhi, &reset, NULL, 0) < 0) { + /* No response means reset will happen shortly... */ + hlt(); + } + + /* If the ME responded it rejected the reset request */ + printk(BIOS_ERR, "ME: Global Reset failed\n"); + return -1; +} +#endif + +#ifdef __SMM__ + +/* Send END OF POST message to the ME */ +static int mkhi_end_of_post(void) +{ + struct mkhi_header mkhi = { + .group_id = MKHI_GROUP_ID_GEN, + .command = MKHI_END_OF_POST, + }; + struct mei_header mei = { + .is_complete = 1, + .host_address = MEI_HOST_ADDRESS, + .client_address = MEI_ADDRESS_MKHI, + .length = sizeof(mkhi), + }; + + u32 eop_ack; + + /* Send request and wait for response */ + printk(BIOS_NOTICE, "ME: %s\n", __FUNCTION__); + if (mei_sendrecv(&mei, &mkhi, NULL, &eop_ack, sizeof(eop_ack)) < 0) { + printk(BIOS_ERR, "ME: END OF POST message failed\n"); + return -1; + } + + printk(BIOS_INFO, "ME: END OF POST message successful (%d)\n", eop_ack); + return 0; +} + +void intel_me_finalize_smm(void) +{ + struct me_hfs hfs; + u32 reg32; + + mei_base_address = + pcie_read_config32(PCH_ME_DEV, PCI_BASE_ADDRESS_0) & ~0xf; + + /* S3 path will have hidden this device already */ + if (!mei_base_address || mei_base_address == 0xfffffff0) + return; + + /* Make sure ME is in a mode that expects EOP */ + reg32 = pcie_read_config32(PCH_ME_DEV, PCI_ME_HFS); + memcpy(&hfs, ®32, sizeof(u32)); + + /* Abort and leave device alone if not normal mode */ + if (hfs.fpt_bad || + hfs.working_state != ME_HFS_CWS_NORMAL || + hfs.operation_mode != ME_HFS_MODE_NORMAL) + return; + + /* Try to send EOP command so ME stops accepting other commands */ + mkhi_end_of_post(); + + /* Make sure IO is disabled */ + reg32 = pcie_read_config32(PCH_ME_DEV, PCI_COMMAND); + reg32 &= ~(PCI_COMMAND_MASTER | + PCI_COMMAND_MEMORY | PCI_COMMAND_IO); + pcie_write_config32(PCH_ME_DEV, PCI_COMMAND, reg32); + + /* Hide the PCI device */ + RCBA32_OR(FD2, PCH_DISABLE_MEI1); +} + +#else /* !__SMM__ */ + +/* Determine the path that we should take based on ME status */ +static me_bios_path intel_me_path(device_t dev) +{ + me_bios_path path = ME_DISABLE_BIOS_PATH; + struct me_hfs hfs; + struct me_gmes gmes; + +#if CONFIG_HAVE_ACPI_RESUME + /* S3 wake skips all MKHI messages */ + if (acpi_slp_type == 3) { + return ME_S3WAKE_BIOS_PATH; + } +#endif + + pci_read_dword_ptr(dev, &hfs, PCI_ME_HFS); + pci_read_dword_ptr(dev, &gmes, PCI_ME_GMES); + + /* Check and dump status */ + intel_me_status(&hfs, &gmes); + + /* Check Current Working State */ + switch (hfs.working_state) { + case ME_HFS_CWS_NORMAL: + path = ME_NORMAL_BIOS_PATH; + break; + case ME_HFS_CWS_REC: + path = ME_RECOVERY_BIOS_PATH; + break; + default: + path = ME_DISABLE_BIOS_PATH; + break; + } + + /* Check Current Operation Mode */ + switch (hfs.operation_mode) { + case ME_HFS_MODE_NORMAL: + break; + case ME_HFS_MODE_DEBUG: + case ME_HFS_MODE_DIS: + case ME_HFS_MODE_OVER_JMPR: + case ME_HFS_MODE_OVER_MEI: + default: + path = ME_DISABLE_BIOS_PATH; + break; + } + + /* Check for any error code and valid firmware and MBP */ + if (hfs.error_code || hfs.fpt_bad) + path = ME_ERROR_BIOS_PATH; + + /* Check if the MBP is ready */ + if (!gmes.mbp_rdy) { + printk(BIOS_CRIT, "%s: mbp is not ready!\n", + __FUNCTION__); + path = ME_ERROR_BIOS_PATH; + } + +#if CONFIG_ELOG + if (path != ME_NORMAL_BIOS_PATH) { + struct elog_event_data_me_extended data = { + .current_working_state = hfs.working_state, + .operation_state = hfs.operation_state, + .operation_mode = hfs.operation_mode, + .error_code = hfs.error_code, + .progress_code = gmes.progress_code, + .current_pmevent = gmes.current_pmevent, + .current_state = gmes.current_state, + }; + elog_add_event_byte(ELOG_TYPE_MANAGEMENT_ENGINE, path); + elog_add_event_raw(ELOG_TYPE_MANAGEMENT_ENGINE_EXT, + &data, sizeof(data)); + } +#endif + + return path; +} + +/* Prepare ME for MEI messages */ +static int intel_mei_setup(device_t dev) +{ + struct resource *res; + struct mei_csr host; + u32 reg32; + + /* Find the MMIO base for the ME interface */ + res = find_resource(dev, PCI_BASE_ADDRESS_0); + if (!res || res->base == 0 || res->size == 0) { + printk(BIOS_DEBUG, "ME: MEI resource not present!\n"); + return -1; + } + mei_base_address = res->base; + + /* Ensure Memory and Bus Master bits are set */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; + pci_write_config32(dev, PCI_COMMAND, reg32); + + /* Clean up status for next message */ + read_host_csr(&host); + host.interrupt_generate = 1; + host.ready = 1; + host.reset = 0; + write_host_csr(&host); + + return 0; +} + +/* Read the Extend register hash of ME firmware */ +static int intel_me_extend_valid(device_t dev) +{ + struct me_heres status; + u32 extend[8] = {0}; + int i, count = 0; + + pci_read_dword_ptr(dev, &status, PCI_ME_HERES); + if (!status.extend_feature_present) { + printk(BIOS_ERR, "ME: Extend Feature not present\n"); + return -1; + } + + if (!status.extend_reg_valid) { + printk(BIOS_ERR, "ME: Extend Register not valid\n"); + return -1; + } + + switch (status.extend_reg_algorithm) { + case PCI_ME_EXT_SHA1: + count = 5; + printk(BIOS_DEBUG, "ME: Extend SHA-1: "); + break; + case PCI_ME_EXT_SHA256: + count = 8; + printk(BIOS_DEBUG, "ME: Extend SHA-256: "); + break; + default: + printk(BIOS_ERR, "ME: Extend Algorithm %d unknown\n", + status.extend_reg_algorithm); + return -1; + } + + for (i = 0; i < count; ++i) { + extend[i] = pci_read_config32(dev, PCI_ME_HER(i)); + printk(BIOS_DEBUG, "%08x", extend[i]); + } + printk(BIOS_DEBUG, "\n"); + +#if CONFIG_CHROMEOS + /* Save hash in NVS for the OS to verify */ + chromeos_set_me_hash(extend, count); +#endif + + return 0; +} + +/* Hide the ME virtual PCI devices */ +static void intel_me_hide(device_t dev) +{ + dev->enabled = 0; + pch_enable(dev); +} + +/* Check whether ME is present and do basic init */ +static void intel_me_init(device_t dev) +{ + me_bios_path path = intel_me_path(dev); + me_bios_payload mbp_data; + + /* Do initial setup and determine the BIOS path */ + printk(BIOS_NOTICE, "ME: BIOS path: %s\n", me_bios_path_values[path]); + + switch (path) { + case ME_S3WAKE_BIOS_PATH: + intel_me_hide(dev); + break; + + case ME_NORMAL_BIOS_PATH: + /* Validate the extend register */ + if (intel_me_extend_valid(dev) < 0) + break; /* TODO: force recovery mode */ + + /* Prepare MEI MMIO interface */ + if (intel_mei_setup(dev) < 0) + break; + + if(intel_me_read_mbp(&mbp_data)) + break; + +#if CONFIG_CHROMEOS && 0 /* DISABLED */ + /* + * Unlock ME in recovery mode. + */ + if (recovery_mode_enabled()) { + /* Unlock ME flash region */ + mkhi_hmrfpo_enable(); + + /* Issue global reset */ + mkhi_global_reset(); + return; + } +#endif + +#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) + me_print_fw_version(&mbp_data.fw_version_name); + me_print_fwcaps(&mbp_data.fw_caps_sku); +#endif + + /* + * Leave the ME unlocked in this path. + * It will be locked via SMI command later. + */ + break; + + case ME_ERROR_BIOS_PATH: + case ME_RECOVERY_BIOS_PATH: + case ME_DISABLE_BIOS_PATH: + case ME_FIRMWARE_UPDATE_BIOS_PATH: + break; + } +} + +static void set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations pci_ops = { + .set_subsystem = set_subsystem, +}; + +static struct device_operations device_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = intel_me_init, + .scan_bus = scan_static_bus, + .ops_pci = &pci_ops, +}; + +static const struct pci_driver intel_me __pci_driver = { + .ops = &device_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x1e3a, +}; + +/****************************************************************************** + * */ +static u32 me_to_host_words_pending(void) +{ + struct mei_csr me; + read_me_csr(&me); + if (!me.ready) + return 0; + return (me.buffer_write_ptr - me.buffer_read_ptr) & + (me.buffer_depth - 1); +} + +#if 0 +/* This function is not yet being used, keep it in for the future. */ +static u32 host_to_me_words_room(void) +{ + struct mei_csr csr; + + read_me_csr(&csr); + if (!csr.ready) + return 0; + + read_host_csr(&csr); + return (csr.buffer_read_ptr - csr.buffer_write_ptr - 1) & + (csr.buffer_depth - 1); +} +#endif +/* + * mbp seems to be following its own flow, let's retrieve it in a dedicated + * function. + */ +static int intel_me_read_mbp(me_bios_payload *mbp_data) +{ + mbp_header mbp_hdr; + mbp_item_header mbp_item_hdr; + u32 me2host_pending; + u32 mbp_item_id; + struct mei_csr host; + + me2host_pending = me_to_host_words_pending(); + if (!me2host_pending) { + printk(BIOS_ERR, "ME: no mbp data!\n"); + return -1; + } + + /* we know for sure that at least the header is there */ + mei_read_dword_ptr(&mbp_hdr, MEI_ME_CB_RW); + + if ((mbp_hdr.num_entries > (mbp_hdr.mbp_size / 2)) || + (me2host_pending < mbp_hdr.mbp_size)) { + printk(BIOS_ERR, "ME: mbp of %d entries, total size %d words" + " buffer contains %d words\n", + mbp_hdr.num_entries, mbp_hdr.mbp_size, + me2host_pending); + return -1; + } + + me2host_pending--; + memset(mbp_data, 0, sizeof(*mbp_data)); + + while (mbp_hdr.num_entries--) { + u32* copy_addr; + u32 copy_size, buffer_room; + void *p; + + if (!me2host_pending) { + printk(BIOS_ERR, "ME: no mbp data %d entries to go!\n", + mbp_hdr.num_entries + 1); + return -1; + } + + mei_read_dword_ptr(&mbp_item_hdr, MEI_ME_CB_RW); + + if (mbp_item_hdr.length > me2host_pending) { + printk(BIOS_ERR, "ME: insufficient mbp data %d " + "entries to go!\n", + mbp_hdr.num_entries + 1); + return -1; + } + + me2host_pending -= mbp_item_hdr.length; + + mbp_item_id = (((u32)mbp_item_hdr.item_id) << 8) + + mbp_item_hdr.app_id; + + copy_size = mbp_item_hdr.length - 1; + +#define SET_UP_COPY(field) { copy_addr = (u32 *)&mbp_data->field; \ + buffer_room = sizeof(mbp_data->field) / sizeof(u32); \ + break; \ + } + + p = &mbp_item_hdr; + printk(BIOS_INFO, "ME: MBP item header %8.8x\n", *((u32*)p)); + + switch(mbp_item_id) { + case 0x101: + SET_UP_COPY(fw_version_name); + + case 0x102: + SET_UP_COPY(icc_profile); + + case 0x103: + SET_UP_COPY(at_state); + + case 0x201: + mbp_data->fw_caps_sku.available = 1; + SET_UP_COPY(fw_caps_sku.fw_capabilities); + + case 0x301: + SET_UP_COPY(rom_bist_data); + + case 0x401: + SET_UP_COPY(platform_key); + + case 0x501: + mbp_data->fw_plat_type.available = 1; + SET_UP_COPY(fw_plat_type.rule_data); + + case 0x601: + SET_UP_COPY(mfsintegrity); + + default: + printk(BIOS_ERR, "ME: unknown mbp item id 0x%x!!!\n", + mbp_item_id); + return -1; + } + + if (buffer_room != copy_size) { + printk(BIOS_ERR, "ME: buffer room %d != %d copy size" + " for item 0x%x!!!\n", + buffer_room, copy_size, mbp_item_id); + return -1; + } + while(copy_size--) + *copy_addr++ = read_cb(); + } + + read_host_csr(&host); + host.interrupt_generate = 1; + write_host_csr(&host); + + { + int cntr = 0; + while(host.interrupt_generate) { + read_host_csr(&host); + cntr++; + } + printk(BIOS_SPEW, "ME: mbp read OK after %d cycles\n", cntr); + } + + return 0; +} + +#endif /* !__SMM__ */ diff --git a/src/southbridge/intel/lynxpoint/me_status.c b/src/southbridge/intel/lynxpoint/me_status.c new file mode 100644 index 0000000000..b2f38d635f --- /dev/null +++ b/src/southbridge/intel/lynxpoint/me_status.c @@ -0,0 +1,213 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <stdlib.h> +#include <console/console.h> +#include "me.h" + +#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) +/* HFS1[3:0] Current Working State Values */ +static const char *me_cws_values[] = { + [ME_HFS_CWS_RESET] = "Reset", + [ME_HFS_CWS_INIT] = "Initializing", + [ME_HFS_CWS_REC] = "Recovery", + [ME_HFS_CWS_NORMAL] = "Normal", + [ME_HFS_CWS_WAIT] = "Platform Disable Wait", + [ME_HFS_CWS_TRANS] = "OP State Transition", + [ME_HFS_CWS_INVALID] = "Invalid CPU Plugged In" +}; + +/* HFS1[8:6] Current Operation State Values */ +static const char *me_opstate_values[] = { + [ME_HFS_STATE_PREBOOT] = "Preboot", + [ME_HFS_STATE_M0_UMA] = "M0 with UMA", + [ME_HFS_STATE_M3] = "M3 without UMA", + [ME_HFS_STATE_M0] = "M0 without UMA", + [ME_HFS_STATE_BRINGUP] = "Bring up", + [ME_HFS_STATE_ERROR] = "M0 without UMA but with error" +}; + +/* HFS[19:16] Current Operation Mode Values */ +static const char *me_opmode_values[] = { + [ME_HFS_MODE_NORMAL] = "Normal", + [ME_HFS_MODE_DEBUG] = "Debug", + [ME_HFS_MODE_DIS] = "Soft Temporary Disable", + [ME_HFS_MODE_OVER_JMPR] = "Security Override via Jumper", + [ME_HFS_MODE_OVER_MEI] = "Security Override via MEI Message" +}; + +/* HFS[15:12] Error Code Values */ +static const char *me_error_values[] = { + [ME_HFS_ERROR_NONE] = "No Error", + [ME_HFS_ERROR_UNCAT] = "Uncategorized Failure", + [ME_HFS_ERROR_IMAGE] = "Image Failure", + [ME_HFS_ERROR_DEBUG] = "Debug Failure" +}; + +/* GMES[31:28] ME Progress Code */ +static const char *me_progress_values[] = { + [ME_GMES_PHASE_ROM] = "ROM Phase", + [ME_GMES_PHASE_BUP] = "BUP Phase", + [ME_GMES_PHASE_UKERNEL] = "uKernel Phase", + [ME_GMES_PHASE_POLICY] = "Policy Module", + [ME_GMES_PHASE_MODULE] = "Module Loading", + [ME_GMES_PHASE_UNKNOWN] = "Unknown", + [ME_GMES_PHASE_HOST] = "Host Communication" +}; + +/* GMES[27:24] Power Management Event */ +static const char *me_pmevent_values[] = { + [0x00] = "Clean Moff->Mx wake", + [0x01] = "Moff->Mx wake after an error", + [0x02] = "Clean global reset", + [0x03] = "Global reset after an error", + [0x04] = "Clean Intel ME reset", + [0x05] = "Intel ME reset due to exception", + [0x06] = "Pseudo-global reset", + [0x07] = "S0/M0->Sx/M3", + [0x08] = "Sx/M3->S0/M0", + [0x09] = "Non-power cycle reset", + [0x0a] = "Power cycle reset through M3", + [0x0b] = "Power cycle reset through Moff", + [0x0c] = "Sx/Mx->Sx/Moff" +}; + +/* Progress Code 0 states */ +static const char *me_progress_rom_values[] = { + [0x00] = "BEGIN", + [0x06] = "DISABLE" +}; + +/* Progress Code 1 states */ +static const char *me_progress_bup_values[] = { + [0x00] = "Initialization starts", + [0x01] = "Disable the host wake event", + [0x04] = "Flow determination start process", + [0x08] = "Error reading/matching the VSCC table in the descriptor", + [0x0a] = "Check to see if straps say ME DISABLED", + [0x0b] = "Timeout waiting for PWROK", + [0x0d] = "Possibly handle BUP manufacturing override strap", + [0x11] = "Bringup in M3", + [0x12] = "Bringup in M0", + [0x13] = "Flow detection error", + [0x15] = "M3 clock switching error", + [0x18] = "M3 kernel load", + [0x1c] = "T34 missing - cannot program ICC", + [0x1f] = "Waiting for DID BIOS message", + [0x20] = "Waiting for DID BIOS message failure", + [0x21] = "DID reported an error", + [0x22] = "Enabling UMA", + [0x23] = "Enabling UMA error", + [0x24] = "Sending DID Ack to BIOS", + [0x25] = "Sending DID Ack to BIOS error", + [0x26] = "Switching clocks in M0", + [0x27] = "Switching clocks in M0 error", + [0x28] = "ME in temp disable", + [0x32] = "M0 kernel load", +}; + +/* Progress Code 3 states */ +static const char *me_progress_policy_values[] = { + [0x00] = "Entery into Policy Module", + [0x03] = "Received S3 entry", + [0x04] = "Received S4 entry", + [0x05] = "Received S5 entry", + [0x06] = "Received UPD entry", + [0x07] = "Received PCR entry", + [0x08] = "Received NPCR entry", + [0x09] = "Received host wake", + [0x0a] = "Received AC<>DC switch", + [0x0b] = "Received DRAM Init Done", + [0x0c] = "VSCC Data not found for flash device", + [0x0d] = "VSCC Table is not valid", + [0x0e] = "Flash Partition Boundary is outside address space", + [0x0f] = "ME cannot access the chipset descriptor region", + [0x10] = "Required VSCC values for flash parts do not match", +}; +#endif + +void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes) +{ +#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) + /* Check Current States */ + printk(BIOS_DEBUG, "ME: FW Partition Table : %s\n", + hfs->fpt_bad ? "BAD" : "OK"); + printk(BIOS_DEBUG, "ME: Bringup Loader Failure : %s\n", + hfs->ft_bup_ld_flr ? "YES" : "NO"); + printk(BIOS_DEBUG, "ME: Firmware Init Complete : %s\n", + hfs->fw_init_complete ? "YES" : "NO"); + printk(BIOS_DEBUG, "ME: Manufacturing Mode : %s\n", + hfs->mfg_mode ? "YES" : "NO"); + printk(BIOS_DEBUG, "ME: Boot Options Present : %s\n", + hfs->boot_options_present ? "YES" : "NO"); + printk(BIOS_DEBUG, "ME: Update In Progress : %s\n", + hfs->update_in_progress ? "YES" : "NO"); + printk(BIOS_DEBUG, "ME: Current Working State : %s\n", + me_cws_values[hfs->working_state]); + printk(BIOS_DEBUG, "ME: Current Operation State : %s\n", + me_opstate_values[hfs->operation_state]); + printk(BIOS_DEBUG, "ME: Current Operation Mode : %s\n", + me_opmode_values[hfs->operation_mode]); + printk(BIOS_DEBUG, "ME: Error Code : %s\n", + me_error_values[hfs->error_code]); + printk(BIOS_DEBUG, "ME: Progress Phase : %s\n", + me_progress_values[gmes->progress_code]); + printk(BIOS_DEBUG, "ME: Power Management Event : %s\n", + me_pmevent_values[gmes->current_pmevent]); + + printk(BIOS_DEBUG, "ME: Progress Phase State : "); + switch (gmes->progress_code) { + case ME_GMES_PHASE_ROM: /* ROM Phase */ + printk(BIOS_DEBUG, "%s", + me_progress_rom_values[gmes->current_state]); + break; + + case ME_GMES_PHASE_BUP: /* Bringup Phase */ + if (gmes->current_state < ARRAY_SIZE(me_progress_bup_values) + && me_progress_bup_values[gmes->current_state]) + printk(BIOS_DEBUG, "%s", + me_progress_bup_values[gmes->current_state]); + else + printk(BIOS_DEBUG, "0x%02x", gmes->current_state); + break; + + case ME_GMES_PHASE_POLICY: /* Policy Module Phase */ + if (gmes->current_state < ARRAY_SIZE(me_progress_policy_values) + && me_progress_policy_values[gmes->current_state]) + printk(BIOS_DEBUG, "%s", + me_progress_policy_values[gmes->current_state]); + else + printk(BIOS_DEBUG, "0x%02x", gmes->current_state); + break; + + case ME_GMES_PHASE_HOST: /* Host Communication Phase */ + if (!gmes->current_state) + printk(BIOS_DEBUG, "Host communication established"); + else + printk(BIOS_DEBUG, "0x%02x", gmes->current_state); + break; + + default: + printk(BIOS_DEBUG, "Unknown 0x%02x", gmes->current_state); + } + printk(BIOS_DEBUG, "\n"); +#endif +} diff --git a/src/southbridge/intel/lynxpoint/nvs.h b/src/southbridge/intel/lynxpoint/nvs.h new file mode 100644 index 0000000000..b8506d4db4 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/nvs.h @@ -0,0 +1,158 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2011 Google Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "vendorcode/google/chromeos/gnvs.h" +typedef struct { + /* Miscellaneous */ + u16 osys; /* 0x00 - Operating System */ + u8 smif; /* 0x02 - SMI function call ("TRAP") */ + u8 prm0; /* 0x03 - SMI function call parameter */ + u8 prm1; /* 0x04 - SMI function call parameter */ + u8 scif; /* 0x05 - SCI function call (via _L00) */ + u8 prm2; /* 0x06 - SCI function call parameter */ + u8 prm3; /* 0x07 - SCI function call parameter */ + u8 lckf; /* 0x08 - Global Lock function for EC */ + u8 prm4; /* 0x09 - Lock function parameter */ + u8 prm5; /* 0x0a - Lock function parameter */ + u32 p80d; /* 0x0b - Debug port (IO 0x80) value */ + u8 lids; /* 0x0f - LID state (open = 1) */ + u8 pwrs; /* 0x10 - Power state (AC = 1) */ + /* Thermal policy */ + u8 tlvl; /* 0x11 - Throttle Level Limit */ + u8 flvl; /* 0x12 - Current FAN Level */ + u8 tcrt; /* 0x13 - Critical Threshold */ + u8 tpsv; /* 0x14 - Passive Threshold */ + u8 tmax; /* 0x15 - CPU Tj_max */ + u8 f0of; /* 0x16 - FAN 0 OFF Threshold */ + u8 f0on; /* 0x17 - FAN 0 ON Threshold */ + u8 f0pw; /* 0x18 - FAN 0 PWM value */ + u8 f1of; /* 0x19 - FAN 1 OFF Threshold */ + u8 f1on; /* 0x1a - FAN 1 ON Threshold */ + u8 f1pw; /* 0x1b - FAN 1 PWM value */ + u8 f2of; /* 0x1c - FAN 2 OFF Threshold */ + u8 f2on; /* 0x1d - FAN 2 ON Threshold */ + u8 f2pw; /* 0x1e - FAN 2 PWM value */ + u8 f3of; /* 0x1f - FAN 3 OFF Threshold */ + u8 f3on; /* 0x20 - FAN 3 ON Threshold */ + u8 f3pw; /* 0x21 - FAN 3 PWM value */ + u8 f4of; /* 0x22 - FAN 4 OFF Threshold */ + u8 f4on; /* 0x23 - FAN 4 ON Threshold */ + u8 f4pw; /* 0x24 - FAN 4 PWM value */ + u8 tmps; /* 0x25 - Temperature Sensor ID */ + u8 rsvd3[2]; + /* Processor Identification */ + u8 apic; /* 0x28 - APIC enabled */ + u8 mpen; /* 0x29 - MP capable/enabled */ + u8 pcp0; /* 0x2a - PDC CPU/CORE 0 */ + u8 pcp1; /* 0x2b - PDC CPU/CORE 1 */ + u8 ppcm; /* 0x2c - Max. PPC state */ + u8 pcnt; /* 0x2d - Processor Count */ + u8 rsvd4[4]; + /* Super I/O & CMOS config */ + u8 natp; /* 0x32 - SIO type */ + u8 s5u0; /* 0x33 - Enable USB0 in S5 */ + u8 s5u1; /* 0x34 - Enable USB1 in S5 */ + u8 s3u0; /* 0x35 - Enable USB0 in S3 */ + u8 s3u1; /* 0x36 - Enable USB1 in S3 */ + u8 s33g; /* 0x37 - Enable S3 in 3G */ + u32 cmem; /* 0x38 - CBMEM TOC */ + /* Integrated Graphics Device */ + u8 igds; /* 0x3c - IGD state */ + u8 tlst; /* 0x3d - Display Toggle List Pointer */ + u8 cadl; /* 0x3e - currently attached devices */ + u8 padl; /* 0x3f - previously attached devices */ + u16 cste; /* 0x40 - current display state */ + u16 nste; /* 0x42 - next display state */ + u16 sste; /* 0x44 - set display state */ + u8 ndid; /* 0x46 - number of device ids */ + u32 did[5]; /* 0x47 - 5b device id 1..5 */ + u8 rsvd5[0x9]; + /* Backlight Control */ + u8 blcs; /* 0x64 - Backlight Control possible */ + u8 brtl; + u8 odds; + u8 rsvd6[0x7]; + /* Ambient Light Sensors*/ + u8 alse; /* 0x6e - ALS enable */ + u8 alaf; + u8 llow; + u8 lhih; + u8 rsvd7[0x6]; + /* Extended Mobile Access */ + u8 emae; /* 0x78 - EMA enable */ + u16 emap; /* 0x79 - EMA pointer */ + u16 emal; /* 0x7a - EMA Length */ + u8 rsvd8[0x5]; + /* MEF */ + u8 mefe; /* 0x82 - MEF enable */ + u8 rsvd9[0x9]; + /* TPM support */ + u8 tpmp; /* 0x8c - TPM */ + u8 tpme; + u8 rsvd10[8]; + /* SATA */ + u8 gtf0[7]; /* 0x96 - GTF task file buffer for port 0 */ + u8 gtf1[7]; + u8 gtf2[7]; + u8 idem; + u8 idet; + u8 rsvd11[7]; + /* IGD OpRegion (not implemented yet) */ + u32 aslb; /* 0xb4 - IGD OpRegion Base Address */ + u8 ibtt; /* 0xb8 - IGD boot type */ + u8 ipat; /* 0xb9 - IGD panel type */ + u8 itvf; /* 0xba - IGD TV format */ + u8 itvm; /* 0xbb - IGD TV minor format */ + u8 ipsc; /* 0xbc - IGD Panel Scaling */ + u8 iblc; /* 0xbd - IGD BLC configuration */ + u8 ibia; /* 0xbe - IGD BIA configuration */ + u8 issc; /* 0xbf - IGD SSC configuration */ + u8 i409; /* 0xc0 - IGD 0409 modified settings */ + u8 i509; /* 0xc1 - IGD 0509 modified settings */ + u8 i609; /* 0xc2 - IGD 0609 modified settings */ + u8 i709; /* 0xc3 - IGD 0709 modified settings */ + u8 idmm; /* 0xc4 - IGD Power Conservation */ + u8 idms; /* 0xc5 - IGD DVMT memory size */ + u8 if1e; /* 0xc6 - IGD Function 1 Enable */ + u8 hvco; /* 0xc7 - IGD HPLL VCO */ + u32 nxd[8]; /* 0xc8 - IGD next state DIDx for _DGS */ + u8 isci; /* 0xe8 - IGD SMI/SCI mode (0: SCI) */ + u8 pavp; /* 0xe9 - IGD PAVP data */ + u8 rsvd12; /* 0xea - rsvd */ + u8 oscc; /* 0xeb - PCIe OSC control */ + u8 npce; /* 0xec - native pcie support */ + u8 plfl; /* 0xed - platform flavor */ + u8 brev; /* 0xee - board revision */ + u8 dpbm; /* 0xef - digital port b mode */ + u8 dpcm; /* 0xf0 - digital port c mode */ + u8 dpdm; /* 0xf1 - digital port c mode */ + u8 alfp; /* 0xf2 - active lfp */ + u8 imon; /* 0xf3 - current graphics turbo imon value */ + u8 mmio; /* 0xf4 - 64bit mmio support */ + u8 rsvd13[11]; /* 0xf5 - rsvd */ + + /* ChromeOS specific (starts at 0x100)*/ + chromeos_acpi_t chromeos; +} __attribute__((packed)) global_nvs_t; + +#ifdef __SMM__ +/* Used in SMM to find the ACPI GNVS address */ +global_nvs_t *smm_get_gnvs(void); +#endif diff --git a/src/southbridge/intel/lynxpoint/pch.c b/src/southbridge/intel/lynxpoint/pch.c new file mode 100644 index 0000000000..c4a3acf8b6 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/pch.c @@ -0,0 +1,383 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <delay.h> +#include <device/device.h> +#include <device/pci.h> +#include "pch.h" + +static int pch_revision_id = -1; +static int pch_type = -1; + +int pch_silicon_revision(void) +{ + if (pch_revision_id < 0) + pch_revision_id = pci_read_config8( + dev_find_slot(0, PCI_DEVFN(0x1f, 0)), + PCI_REVISION_ID); + return pch_revision_id; +} + +int pch_silicon_type(void) +{ + if (pch_type < 0) + pch_type = pci_read_config8( + dev_find_slot(0, PCI_DEVFN(0x1f, 0)), + PCI_DEVICE_ID + 1); + return pch_type; +} + +int pch_silicon_supported(int type, int rev) +{ + return 1; +} + +/* Set bit in Function Disble register to hide this device */ +static void pch_hide_devfn(unsigned devfn) +{ + switch (devfn) { + case PCI_DEVFN(22, 0): /* MEI #1 */ + RCBA32_OR(FD2, PCH_DISABLE_MEI1); + break; + case PCI_DEVFN(22, 1): /* MEI #2 */ + RCBA32_OR(FD2, PCH_DISABLE_MEI2); + break; + case PCI_DEVFN(22, 2): /* IDE-R */ + RCBA32_OR(FD2, PCH_DISABLE_IDER); + break; + case PCI_DEVFN(22, 3): /* KT */ + RCBA32_OR(FD2, PCH_DISABLE_KT); + break; + case PCI_DEVFN(25, 0): /* Gigabit Ethernet */ + RCBA32_OR(BUC, PCH_DISABLE_GBE); + break; + case PCI_DEVFN(26, 0): /* EHCI #2 */ + RCBA32_OR(FD, PCH_DISABLE_EHCI2); + break; + case PCI_DEVFN(27, 0): /* HD Audio Controller */ + RCBA32_OR(FD, PCH_DISABLE_HD_AUDIO); + break; + case PCI_DEVFN(28, 0): /* PCI Express Root Port 1 */ + case PCI_DEVFN(28, 1): /* PCI Express Root Port 2 */ + case PCI_DEVFN(28, 2): /* PCI Express Root Port 3 */ + case PCI_DEVFN(28, 3): /* PCI Express Root Port 4 */ + case PCI_DEVFN(28, 4): /* PCI Express Root Port 5 */ + case PCI_DEVFN(28, 5): /* PCI Express Root Port 6 */ + case PCI_DEVFN(28, 6): /* PCI Express Root Port 7 */ + case PCI_DEVFN(28, 7): /* PCI Express Root Port 8 */ + RCBA32_OR(FD, PCH_DISABLE_PCIE(PCI_FUNC(devfn))); + break; + case PCI_DEVFN(29, 0): /* EHCI #1 */ + RCBA32_OR(FD, PCH_DISABLE_EHCI1); + break; + case PCI_DEVFN(30, 0): /* PCI-to-PCI Bridge */ + RCBA32_OR(FD, PCH_DISABLE_P2P); + break; + case PCI_DEVFN(31, 0): /* LPC */ + RCBA32_OR(FD, PCH_DISABLE_LPC); + break; + case PCI_DEVFN(31, 2): /* SATA #1 */ + RCBA32_OR(FD, PCH_DISABLE_SATA1); + break; + case PCI_DEVFN(31, 3): /* SMBUS */ + RCBA32_OR(FD, PCH_DISABLE_SMBUS); + break; + case PCI_DEVFN(31, 5): /* SATA #22 */ + RCBA32_OR(FD, PCH_DISABLE_SATA2); + break; + case PCI_DEVFN(31, 6): /* Thermal Subsystem */ + RCBA32_OR(FD, PCH_DISABLE_THERMAL); + break; + } +} + +#define IOBP_RETRY 1000 +static inline int iobp_poll(void) +{ + unsigned try = IOBP_RETRY; + u32 data; + + while (try--) { + data = RCBA32(IOBPS); + if ((data & 1) == 0) + return 1; + udelay(10); + } + + printk(BIOS_ERR, "IOBP timeout\n"); + return 0; +} + +void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue) +{ + u32 data; + + /* Set the address */ + RCBA32(IOBPIRI) = address; + + /* READ OPCODE */ + RCBA32(IOBPS) = IOBPS_RW_BX; + if (!iobp_poll()) + return; + + /* Read IOBP data */ + data = RCBA32(IOBPD); + if (!iobp_poll()) + return; + + /* Check for successful transaction */ + if ((RCBA32(IOBPS) & 0x6) != 0) { + printk(BIOS_ERR, "IOBP read 0x%08x failed\n", address); + return; + } + + /* Update the data */ + data &= andvalue; + data |= orvalue; + + /* WRITE OPCODE */ + RCBA32(IOBPS) = IOBPS_RW_BX; + if (!iobp_poll()) + return; + + /* Write IOBP data */ + RCBA32(IOBPD) = data; + if (!iobp_poll()) + return; +} + +/* Check if any port in set X to X+3 is enabled */ +static int pch_pcie_check_set_enabled(device_t dev) +{ + device_t port; + int port_func; + int dev_func = PCI_FUNC(dev->path.pci.devfn); + + printk(BIOS_DEBUG, "%s: check set enabled\n", dev_path(dev)); + + /* Go through static device tree list of devices + * because enumeration is still in progress */ + for (port = all_devices; port; port = port->next) { + /* Only care about PCIe root ports */ + if (PCI_SLOT(port->path.pci.devfn) != + PCI_SLOT(dev->path.pci.devfn)) + continue; + + /* Check if port is in range and enabled */ + port_func = PCI_FUNC(port->path.pci.devfn); + if (port_func >= dev_func && + port_func < (dev_func + 4) && + port->enabled) + return 1; + } + + /* None of the ports in this set are enabled */ + return 0; +} + +/* RPFN is a write-once register so keep a copy until it is written */ +static u32 new_rpfn; + +/* Swap function numbers assigned to two PCIe Root Ports */ +static void pch_pcie_function_swap(u8 old_fn, u8 new_fn) +{ + u32 old_rpfn = new_rpfn; + + printk(BIOS_DEBUG, "PCH: Remap PCIe function %d to %d\n", + old_fn, new_fn); + + new_rpfn &= ~(RPFN_FNMASK(old_fn) | RPFN_FNMASK(new_fn)); + + /* Old function set to new function and disabled */ + new_rpfn |= RPFN_FNSET(old_fn, RPFN_FNGET(old_rpfn, new_fn)); + new_rpfn |= RPFN_FNSET(new_fn, RPFN_FNGET(old_rpfn, old_fn)); +} + +/* Update devicetree with new Root Port function number assignment */ +static void pch_pcie_devicetree_update(void) +{ + device_t dev; + + /* Update the function numbers in the static devicetree */ + for (dev = all_devices; dev; dev = dev->next) { + u8 new_devfn; + + /* Only care about PCH PCIe root ports */ + if (PCI_SLOT(dev->path.pci.devfn) != + PCH_PCIE_DEV_SLOT) + continue; + + /* Determine the new devfn for this port */ + new_devfn = PCI_DEVFN(PCH_PCIE_DEV_SLOT, + RPFN_FNGET(new_rpfn, + PCI_FUNC(dev->path.pci.devfn))); + + if (dev->path.pci.devfn != new_devfn) { + printk(BIOS_DEBUG, + "PCH: PCIe map %02x.%1x -> %02x.%1x\n", + PCI_SLOT(dev->path.pci.devfn), + PCI_FUNC(dev->path.pci.devfn), + PCI_SLOT(new_devfn), PCI_FUNC(new_devfn)); + + dev->path.pci.devfn = new_devfn; + } + } +} + +/* Special handling for PCIe Root Port devices */ +static void pch_pcie_enable(device_t dev) +{ + struct southbridge_intel_lynxpoint_config *config = dev->chip_info; + u32 reg32; + + /* + * Save a copy of the Root Port Function Number map when + * starting to walk the list of PCIe Root Ports so it can + * be updated locally and written out when the last port + * has been processed. + */ + if (PCI_FUNC(dev->path.pci.devfn) == 0) { + new_rpfn = RCBA32(RPFN); + + /* + * Enable Root Port coalescing if the first port is disabled + * or the other devices will not be enumerated by the OS. + */ + if (!dev->enabled) + config->pcie_port_coalesce = 1; + + if (config->pcie_port_coalesce) + printk(BIOS_INFO, + "PCH: PCIe Root Port coalescing is enabled\n"); + } + + if (!dev->enabled) { + printk(BIOS_DEBUG, "%s: Disabling device\n", dev_path(dev)); + + /* + * PCIE Power Savings for PantherPoint and CougarPoint/B1+ + * + * If PCIe 0-3 disabled set Function 0 0xE2[0] = 1 + * If PCIe 4-7 disabled set Function 4 0xE2[0] = 1 + * + * This check is done here instead of pcie driver + * because the pcie driver enable() handler is not + * called unless the device is enabled. + */ + if ((PCI_FUNC(dev->path.pci.devfn) == 0 || + PCI_FUNC(dev->path.pci.devfn) == 4)) { + /* Handle workaround for PPT and CPT/B1+ */ + if (!pch_pcie_check_set_enabled(dev)) { + u8 reg8 = pci_read_config8(dev, 0xe2); + reg8 |= 1; + pci_write_config8(dev, 0xe2, reg8); + } + + /* + * Enable Clock Gating for shared PCIe resources + * before disabling this particular port. + */ + pci_write_config8(dev, 0xe1, 0x3c); + } + + /* Ensure memory, io, and bus master are all disabled */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 &= ~(PCI_COMMAND_MASTER | + PCI_COMMAND_MEMORY | PCI_COMMAND_IO); + pci_write_config32(dev, PCI_COMMAND, reg32); + + /* Do not claim downstream transactions for PCIe ports */ + new_rpfn |= RPFN_HIDE(PCI_FUNC(dev->path.pci.devfn)); + + /* Hide this device if possible */ + pch_hide_devfn(dev->path.pci.devfn); + } else { + int fn; + + /* + * Check if there is a lower disabled port to swap with this + * port in order to maintain linear order starting at zero. + */ + if (config->pcie_port_coalesce) { + for (fn=0; fn < PCI_FUNC(dev->path.pci.devfn); fn++) { + if (!(new_rpfn & RPFN_HIDE(fn))) + continue; + + /* Swap places with this function */ + pch_pcie_function_swap( + PCI_FUNC(dev->path.pci.devfn), fn); + break; + } + } + + /* Enable SERR */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 |= PCI_COMMAND_SERR; + pci_write_config32(dev, PCI_COMMAND, reg32); + } + + /* + * When processing the last PCIe root port we can now + * update the Root Port Function Number and Hide register. + */ + if (PCI_FUNC(dev->path.pci.devfn) == 7) { + printk(BIOS_SPEW, "PCH: RPFN 0x%08x -> 0x%08x\n", + RCBA32(RPFN), new_rpfn); + RCBA32(RPFN) = new_rpfn; + + /* Update static devictree with new function numbers */ + if (config->pcie_port_coalesce) + pch_pcie_devicetree_update(); + } +} + +void pch_enable(device_t dev) +{ + u32 reg32; + + /* PCH PCIe Root Ports get special handling */ + if (PCI_SLOT(dev->path.pci.devfn) == PCH_PCIE_DEV_SLOT) + return pch_pcie_enable(dev); + + if (!dev->enabled) { + printk(BIOS_DEBUG, "%s: Disabling device\n", dev_path(dev)); + + /* Ensure memory, io, and bus master are all disabled */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 &= ~(PCI_COMMAND_MASTER | + PCI_COMMAND_MEMORY | PCI_COMMAND_IO); + pci_write_config32(dev, PCI_COMMAND, reg32); + + /* Hide this device if possible */ + pch_hide_devfn(dev->path.pci.devfn); + } else { + /* Enable SERR */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 |= PCI_COMMAND_SERR; + pci_write_config32(dev, PCI_COMMAND, reg32); + } +} + +struct chip_operations southbridge_intel_lynxpoint_ops = { + CHIP_NAME("Intel Series 8 (Lynx Point) Southbridge") + .enable_dev = pch_enable, +}; diff --git a/src/southbridge/intel/lynxpoint/pch.h b/src/southbridge/intel/lynxpoint/pch.h new file mode 100644 index 0000000000..d00ee621f6 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/pch.h @@ -0,0 +1,591 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SOUTHBRIDGE_INTEL_LYNXPOINT_PCH_H +#define SOUTHBRIDGE_INTEL_LYNXPOINT_PCH_H + + +/* + * Lynx Point PCH PCI Devices: + * + * Bus 0:Device 31:Function 0 LPC Controller1 + * Bus 0:Device 31:Function 2 SATA Controller #1 + * Bus 0:Device 31:Function 3 SMBus Controller + * Bus 0:Device 31:Function 5 SATA Controller #22 + * Bus 0:Device 31:Function 6 Thermal Subsystem + * Bus 0:Device 29:Function 03 USB EHCI Controller #1 + * Bus 0:Device 26:Function 03 USB EHCI Controller #2 + * Bus 0:Device 28:Function 0 PCI Express* Port 1 + * Bus 0:Device 28:Function 1 PCI Express Port 2 + * Bus 0:Device 28:Function 2 PCI Express Port 3 + * Bus 0:Device 28:Function 3 PCI Express Port 4 + * Bus 0:Device 28:Function 4 PCI Express Port 5 + * Bus 0:Device 28:Function 5 PCI Express Port 6 + * Bus 0:Device 28:Function 6 PCI Express Port 7 + * Bus 0:Device 28:Function 7 PCI Express Port 8 + * Bus 0:Device 27:Function 0 IntelĀ® High Definition Audio Controller + * Bus 0:Device 25:Function 0 Gigabit Ethernet Controller + * Bus 0:Device 22:Function 0 IntelĀ® Management Engine Interface #1 + * Bus 0:Device 22:Function 1 Intel Management Engine Interface #2 + * Bus 0:Device 22:Function 2 IDE-R + * Bus 0:Device 22:Function 3 KT + * Bus 0:Device 20:Function 0 xHCI Controller +*/ + +/* PCH types */ + +/* PCH stepping values for LPC device */ + +/* + * It does not matter where we put the SMBus I/O base, as long as we + * keep it consistent and don't interfere with other devices. Stage2 + * will relocate this anyways. + * Our solution is to have SMB initialization move the I/O to SMBUS_IO_BASE + * again. But handling static BARs is a generic problem that should be + * solved in the device allocator. + */ +#define SMBUS_IO_BASE 0x0400 +#define SMBUS_SLAVE_ADDR 0x24 +/* TODO Make sure these don't get changed by stage2 */ +#define DEFAULT_GPIOBASE 0x0480 +#define DEFAULT_PMBASE 0x0500 + +#define HPET_ADDR 0xfed00000 +#define DEFAULT_RCBA 0xfed1c000 + +#ifndef __ACPI__ +#define DEBUG_PERIODIC_SMIS 0 + +#if defined (__SMM__) && !defined(__ASSEMBLER__) +void intel_pch_finalize_smm(void); +#endif + +#if !defined(__ASSEMBLER__) && !defined(__ROMCC__) +#if !defined(__PRE_RAM__) && !defined(__SMM__) +#include <device/device.h> +#include <arch/acpi.h> +#include "chip.h" +int pch_silicon_revision(void); +int pch_silicon_type(void); +int pch_silicon_supported(int type, int rev); +void pch_enable(device_t dev); +void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue); +#if CONFIG_ELOG +void pch_log_state(void); +#endif +void acpi_create_intel_hpet(acpi_hpet_t * hpet); +#else +void enable_smbus(void); +void enable_usb_bar(void); +int smbus_read_byte(unsigned device, unsigned address); +int early_spi_read(u32 offset, u32 size, u8 *buffer); +#endif +#endif + +#define MAINBOARD_POWER_OFF 0 +#define MAINBOARD_POWER_ON 1 +#define MAINBOARD_POWER_KEEP 2 + +#ifndef CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL +#define CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL MAINBOARD_POWER_ON +#endif + +/* PCI Configuration Space (D30:F0): PCI2PCI */ +#define PSTS 0x06 +#define SMLT 0x1b +#define SECSTS 0x1e +#define INTR 0x3c +#define BCTRL 0x3e +#define SBR (1 << 6) +#define SEE (1 << 1) +#define PERE (1 << 0) + +#define PCH_EHCI1_DEV PCI_DEV(0, 0x1d, 0) +#define PCH_EHCI2_DEV PCI_DEV(0, 0x1a, 0) +#define PCH_ME_DEV PCI_DEV(0, 0x16, 0) +#define PCH_PCIE_DEV_SLOT 28 + +/* PCI Configuration Space (D31:F0): LPC */ +#define PCH_LPC_DEV PCI_DEV(0, 0x1f, 0) +#define SERIRQ_CNTL 0x64 + +#define GEN_PMCON_1 0xa0 +#define GEN_PMCON_2 0xa2 +#define GEN_PMCON_3 0xa4 +#define ETR3 0xac +#define ETR3_CWORWRE (1 << 18) +#define ETR3_CF9GR (1 << 20) + +/* GEN_PMCON_3 bits */ +#define RTC_BATTERY_DEAD (1 << 2) +#define RTC_POWER_FAILED (1 << 1) +#define SLEEP_AFTER_POWER_FAIL (1 << 0) + +#define PMBASE 0x40 +#define ACPI_CNTL 0x44 +#define BIOS_CNTL 0xDC +#define GPIO_BASE 0x48 /* LPC GPIO Base Address Register */ +#define GPIO_CNTL 0x4C /* LPC GPIO Control Register */ +#define GPIO_ROUT 0xb8 + +#define PIRQA_ROUT 0x60 +#define PIRQB_ROUT 0x61 +#define PIRQC_ROUT 0x62 +#define PIRQD_ROUT 0x63 +#define PIRQE_ROUT 0x68 +#define PIRQF_ROUT 0x69 +#define PIRQG_ROUT 0x6A +#define PIRQH_ROUT 0x6B + +#define LPC_IO_DEC 0x80 /* IO Decode Ranges Register */ +#define LPC_EN 0x82 /* LPC IF Enables Register */ +#define CNF2_LPC_EN (1 << 13) /* 0x4e/0x4f */ +#define CNF1_LPC_EN (1 << 12) /* 0x2e/0x2f */ +#define MC_LPC_EN (1 << 11) /* 0x62/0x66 */ +#define KBC_LPC_EN (1 << 10) /* 0x60/0x64 */ +#define GAMEH_LPC_EN (1 << 9) /* 0x208/0x20f */ +#define GAMEL_LPC_EN (1 << 8) /* 0x200/0x207 */ +#define FDD_LPC_EN (1 << 3) /* LPC_IO_DEC[12] */ +#define LPT_LPC_EN (1 << 2) /* LPC_IO_DEC[9:8] */ +#define COMB_LPC_EN (1 << 1) /* LPC_IO_DEC[6:4] */ +#define COMA_LPC_EN (1 << 0) /* LPC_IO_DEC[2:0] */ +#define LPC_GEN1_DEC 0x84 /* LPC IF Generic Decode Range 1 */ +#define LPC_GEN2_DEC 0x88 /* LPC IF Generic Decode Range 2 */ +#define LPC_GEN3_DEC 0x8c /* LPC IF Generic Decode Range 3 */ +#define LPC_GEN4_DEC 0x90 /* LPC IF Generic Decode Range 4 */ + +/* PCI Configuration Space (D31:F1): IDE */ +#define PCH_IDE_DEV PCI_DEV(0, 0x1f, 1) +#define PCH_SATA_DEV PCI_DEV(0, 0x1f, 2) +#define PCH_SATA2_DEV PCI_DEV(0, 0x1f, 5) +#define INTR_LN 0x3c +#define IDE_TIM_PRI 0x40 /* IDE timings, primary */ +#define IDE_DECODE_ENABLE (1 << 15) +#define IDE_SITRE (1 << 14) +#define IDE_ISP_5_CLOCKS (0 << 12) +#define IDE_ISP_4_CLOCKS (1 << 12) +#define IDE_ISP_3_CLOCKS (2 << 12) +#define IDE_RCT_4_CLOCKS (0 << 8) +#define IDE_RCT_3_CLOCKS (1 << 8) +#define IDE_RCT_2_CLOCKS (2 << 8) +#define IDE_RCT_1_CLOCKS (3 << 8) +#define IDE_DTE1 (1 << 7) +#define IDE_PPE1 (1 << 6) +#define IDE_IE1 (1 << 5) +#define IDE_TIME1 (1 << 4) +#define IDE_DTE0 (1 << 3) +#define IDE_PPE0 (1 << 2) +#define IDE_IE0 (1 << 1) +#define IDE_TIME0 (1 << 0) +#define IDE_TIM_SEC 0x42 /* IDE timings, secondary */ + +#define IDE_SDMA_CNT 0x48 /* Synchronous DMA control */ +#define IDE_SSDE1 (1 << 3) +#define IDE_SSDE0 (1 << 2) +#define IDE_PSDE1 (1 << 1) +#define IDE_PSDE0 (1 << 0) + +#define IDE_SDMA_TIM 0x4a + +#define IDE_CONFIG 0x54 /* IDE I/O Configuration Register */ +#define SIG_MODE_SEC_NORMAL (0 << 18) +#define SIG_MODE_SEC_TRISTATE (1 << 18) +#define SIG_MODE_SEC_DRIVELOW (2 << 18) +#define SIG_MODE_PRI_NORMAL (0 << 16) +#define SIG_MODE_PRI_TRISTATE (1 << 16) +#define SIG_MODE_PRI_DRIVELOW (2 << 16) +#define FAST_SCB1 (1 << 15) +#define FAST_SCB0 (1 << 14) +#define FAST_PCB1 (1 << 13) +#define FAST_PCB0 (1 << 12) +#define SCB1 (1 << 3) +#define SCB0 (1 << 2) +#define PCB1 (1 << 1) +#define PCB0 (1 << 0) + +#define SATA_SIRI 0xa0 /* SATA Indexed Register Index */ +#define SATA_SIRD 0xa4 /* SATA Indexed Register Data */ +#define SATA_SP 0xd0 /* Scratchpad */ + +/* SATA IOBP Registers */ +#define SATA_IOBP_SP0G3IR 0xea000151 +#define SATA_IOBP_SP1G3IR 0xea000051 + +/* PCI Configuration Space (D31:F3): SMBus */ +#define PCH_SMBUS_DEV PCI_DEV(0, 0x1f, 3) +#define SMB_BASE 0x20 +#define HOSTC 0x40 +#define SMB_RCV_SLVA 0x09 + +/* HOSTC bits */ +#define I2C_EN (1 << 2) +#define SMB_SMI_EN (1 << 1) +#define HST_EN (1 << 0) + +/* SMBus I/O bits. */ +#define SMBHSTSTAT 0x0 +#define SMBHSTCTL 0x2 +#define SMBHSTCMD 0x3 +#define SMBXMITADD 0x4 +#define SMBHSTDAT0 0x5 +#define SMBHSTDAT1 0x6 +#define SMBBLKDAT 0x7 +#define SMBTRNSADD 0x9 +#define SMBSLVDATA 0xa +#define SMLINK_PIN_CTL 0xe +#define SMBUS_PIN_CTL 0xf + +#define SMBUS_TIMEOUT (10 * 1000 * 100) + + +/* Southbridge IO BARs */ + +#define GPIOBASE 0x48 + +#define PMBASE 0x40 + +/* Root Complex Register Block */ +#define RCBA 0xf0 + +#define RCBA8(x) *((volatile u8 *)(DEFAULT_RCBA + x)) +#define RCBA16(x) *((volatile u16 *)(DEFAULT_RCBA + x)) +#define RCBA32(x) *((volatile u32 *)(DEFAULT_RCBA + x)) + +#define RCBA_AND_OR(bits, x, and, or) \ + RCBA##bits(x) = ((RCBA##bits(x) & (and)) | (or)) +#define RCBA8_AND_OR(x, and, or) RCBA_AND_OR(8, x, and, or) +#define RCBA16_AND_OR(x, and, or) RCBA_AND_OR(16, x, and, or) +#define RCBA32_AND_OR(x, and, or) RCBA_AND_OR(32, x, and, or) +#define RCBA32_OR(x, or) RCBA_AND_OR(32, x, ~0UL, or) + +#define VCH 0x0000 /* 32bit */ +#define VCAP1 0x0004 /* 32bit */ +#define VCAP2 0x0008 /* 32bit */ +#define PVC 0x000c /* 16bit */ +#define PVS 0x000e /* 16bit */ + +#define V0CAP 0x0010 /* 32bit */ +#define V0CTL 0x0014 /* 32bit */ +#define V0STS 0x001a /* 16bit */ + +#define V1CAP 0x001c /* 32bit */ +#define V1CTL 0x0020 /* 32bit */ +#define V1STS 0x0026 /* 16bit */ + +#define RCTCL 0x0100 /* 32bit */ +#define ESD 0x0104 /* 32bit */ +#define ULD 0x0110 /* 32bit */ +#define ULBA 0x0118 /* 64bit */ + +#define RP1D 0x0120 /* 32bit */ +#define RP1BA 0x0128 /* 64bit */ +#define RP2D 0x0130 /* 32bit */ +#define RP2BA 0x0138 /* 64bit */ +#define RP3D 0x0140 /* 32bit */ +#define RP3BA 0x0148 /* 64bit */ +#define RP4D 0x0150 /* 32bit */ +#define RP4BA 0x0158 /* 64bit */ +#define HDD 0x0160 /* 32bit */ +#define HDBA 0x0168 /* 64bit */ +#define RP5D 0x0170 /* 32bit */ +#define RP5BA 0x0178 /* 64bit */ +#define RP6D 0x0180 /* 32bit */ +#define RP6BA 0x0188 /* 64bit */ + +#define RPFN 0x0404 /* 32bit */ + +/* Root Port configuratinon space hide */ +#define RPFN_HIDE(port) (1 << (((port) * 4) + 3)) +/* Get the function number assigned to a Root Port */ +#define RPFN_FNGET(reg,port) (((reg) >> ((port) * 4)) & 7) +/* Set the function number for a Root Port */ +#define RPFN_FNSET(port,func) (((func) & 7) << ((port) * 4)) +/* Root Port function number mask */ +#define RPFN_FNMASK(port) (7 << ((port) * 4)) + +#define TRSR 0x1e00 /* 8bit */ +#define TRCR 0x1e10 /* 64bit */ +#define TWDR 0x1e18 /* 64bit */ + +#define IOTR0 0x1e80 /* 64bit */ +#define IOTR1 0x1e88 /* 64bit */ +#define IOTR2 0x1e90 /* 64bit */ +#define IOTR3 0x1e98 /* 64bit */ + +#define TCTL 0x3000 /* 8bit */ + +#define NOINT 0 +#define INTA 1 +#define INTB 2 +#define INTC 3 +#define INTD 4 + +#define DIR_IDR 12 /* Interrupt D Pin Offset */ +#define DIR_ICR 8 /* Interrupt C Pin Offset */ +#define DIR_IBR 4 /* Interrupt B Pin Offset */ +#define DIR_IAR 0 /* Interrupt A Pin Offset */ + +#define PIRQA 0 +#define PIRQB 1 +#define PIRQC 2 +#define PIRQD 3 +#define PIRQE 4 +#define PIRQF 5 +#define PIRQG 6 +#define PIRQH 7 + +/* IO Buffer Programming */ +#define IOBPIRI 0x2330 +#define IOBPD 0x2334 +#define IOBPS 0x2338 +#define IOBPS_RW_BX ((1 << 9)|(1 << 10)) +#define IOBPS_WRITE_AX ((1 << 9)|(1 << 10)) +#define IOBPS_READ_AX ((1 << 8)|(1 << 9)|(1 << 10)) + +#define D31IP 0x3100 /* 32bit */ +#define D31IP_TTIP 24 /* Thermal Throttle Pin */ +#define D31IP_SIP2 20 /* SATA Pin 2 */ +#define D31IP_SMIP 12 /* SMBUS Pin */ +#define D31IP_SIP 8 /* SATA Pin */ +#define D30IP 0x3104 /* 32bit */ +#define D30IP_PIP 0 /* PCI Bridge Pin */ +#define D29IP 0x3108 /* 32bit */ +#define D29IP_E1P 0 /* EHCI #1 Pin */ +#define D28IP 0x310c /* 32bit */ +#define D28IP_P8IP 28 /* PCI Express Port 8 */ +#define D28IP_P7IP 24 /* PCI Express Port 7 */ +#define D28IP_P6IP 20 /* PCI Express Port 6 */ +#define D28IP_P5IP 16 /* PCI Express Port 5 */ +#define D28IP_P4IP 12 /* PCI Express Port 4 */ +#define D28IP_P3IP 8 /* PCI Express Port 3 */ +#define D28IP_P2IP 4 /* PCI Express Port 2 */ +#define D28IP_P1IP 0 /* PCI Express Port 1 */ +#define D27IP 0x3110 /* 32bit */ +#define D27IP_ZIP 0 /* HD Audio Pin */ +#define D26IP 0x3114 /* 32bit */ +#define D26IP_E2P 0 /* EHCI #2 Pin */ +#define D25IP 0x3118 /* 32bit */ +#define D25IP_LIP 0 /* GbE LAN Pin */ +#define D22IP 0x3124 /* 32bit */ +#define D22IP_KTIP 12 /* KT Pin */ +#define D22IP_IDERIP 8 /* IDE-R Pin */ +#define D22IP_MEI2IP 4 /* MEI #2 Pin */ +#define D22IP_MEI1IP 0 /* MEI #1 Pin */ +#define D31IR 0x3140 /* 16bit */ +#define D30IR 0x3142 /* 16bit */ +#define D29IR 0x3144 /* 16bit */ +#define D28IR 0x3146 /* 16bit */ +#define D27IR 0x3148 /* 16bit */ +#define D26IR 0x314c /* 16bit */ +#define D25IR 0x3150 /* 16bit */ +#define D22IR 0x315c /* 16bit */ +#define OIC 0x31fe /* 16bit */ +#define SOFT_RESET_CTRL 0x38f4 +#define SOFT_RESET_DATA 0x38f8 + +#define DIR_ROUTE(x,a,b,c,d) \ + RCBA32(x) = (((d) << DIR_IDR) | ((c) << DIR_ICR) | \ + ((b) << DIR_IBR) | ((a) << DIR_IAR)) + +#define RC 0x3400 /* 32bit */ +#define HPTC 0x3404 /* 32bit */ +#define GCS 0x3410 /* 32bit */ +#define BUC 0x3414 /* 32bit */ +#define PCH_DISABLE_GBE (1 << 5) +#define FD 0x3418 /* 32bit */ +#define DISPBDF 0x3424 /* 16bit */ +#define FD2 0x3428 /* 32bit */ +#define CG 0x341c /* 32bit */ + +/* Function Disable 1 RCBA 0x3418 */ +#define PCH_DISABLE_ALWAYS ((1 << 0)|(1 << 26)|(1 << 27)) +#define PCH_DISABLE_P2P (1 << 1) +#define PCH_DISABLE_SATA1 (1 << 2) +#define PCH_DISABLE_SMBUS (1 << 3) +#define PCH_DISABLE_HD_AUDIO (1 << 4) +#define PCH_DISABLE_EHCI2 (1 << 13) +#define PCH_DISABLE_LPC (1 << 14) +#define PCH_DISABLE_EHCI1 (1 << 15) +#define PCH_DISABLE_PCIE(x) (1 << (16 + x)) +#define PCH_DISABLE_THERMAL (1 << 24) +#define PCH_DISABLE_SATA2 (1 << 25) + +/* Function Disable 2 RCBA 0x3428 */ +#define PCH_DISABLE_KT (1 << 4) +#define PCH_DISABLE_IDER (1 << 3) +#define PCH_DISABLE_MEI2 (1 << 2) +#define PCH_DISABLE_MEI1 (1 << 1) +#define PCH_ENABLE_DBDF (1 << 0) + +/* ICH7 GPIOBASE */ +#define GPIO_USE_SEL 0x00 +#define GP_IO_SEL 0x04 +#define GP_LVL 0x0c +#define GPO_BLINK 0x18 +#define GPI_INV 0x2c +#define GPIO_USE_SEL2 0x30 +#define GP_IO_SEL2 0x34 +#define GP_LVL2 0x38 +#define GPIO_USE_SEL3 0x40 +#define GP_IO_SEL3 0x44 +#define GP_LVL3 0x48 +#define GP_RST_SEL1 0x60 +#define GP_RST_SEL2 0x64 +#define GP_RST_SEL3 0x68 + +/* ICH7 PMBASE */ +#define PM1_STS 0x00 +#define WAK_STS (1 << 15) +#define PCIEXPWAK_STS (1 << 14) +#define PRBTNOR_STS (1 << 11) +#define RTC_STS (1 << 10) +#define PWRBTN_STS (1 << 8) +#define GBL_STS (1 << 5) +#define BM_STS (1 << 4) +#define TMROF_STS (1 << 0) +#define PM1_EN 0x02 +#define PCIEXPWAK_DIS (1 << 14) +#define RTC_EN (1 << 10) +#define PWRBTN_EN (1 << 8) +#define GBL_EN (1 << 5) +#define TMROF_EN (1 << 0) +#define PM1_CNT 0x04 +#define SLP_EN (1 << 13) +#define SLP_TYP (7 << 10) +#define SLP_TYP_S0 0 +#define SLP_TYP_S1 1 +#define SLP_TYP_S3 5 +#define SLP_TYP_S4 6 +#define SLP_TYP_S5 7 +#define GBL_RLS (1 << 2) +#define BM_RLD (1 << 1) +#define SCI_EN (1 << 0) +#define PM1_TMR 0x08 +#define PROC_CNT 0x10 +#define LV2 0x14 +#define LV3 0x15 +#define LV4 0x16 +#define PM2_CNT 0x50 // mobile only +#define GPE0_STS 0x20 +#define PME_B0_STS (1 << 13) +#define PME_STS (1 << 11) +#define BATLOW_STS (1 << 10) +#define PCI_EXP_STS (1 << 9) +#define RI_STS (1 << 8) +#define SMB_WAK_STS (1 << 7) +#define TCOSCI_STS (1 << 6) +#define SWGPE_STS (1 << 2) +#define HOT_PLUG_STS (1 << 1) +#define GPE0_EN 0x28 +#define PME_B0_EN (1 << 13) +#define PME_EN (1 << 11) +#define TCOSCI_EN (1 << 6) +#define SMI_EN 0x30 +#define INTEL_USB2_EN (1 << 18) // Intel-Specific USB2 SMI logic +#define LEGACY_USB2_EN (1 << 17) // Legacy USB2 SMI logic +#define PERIODIC_EN (1 << 14) // SMI on PERIODIC_STS in SMI_STS +#define TCO_EN (1 << 13) // Enable TCO Logic (BIOSWE et al) +#define MCSMI_EN (1 << 11) // Trap microcontroller range access +#define BIOS_RLS (1 << 7) // asserts SCI on bit set +#define SWSMI_TMR_EN (1 << 6) // start software smi timer on bit set +#define APMC_EN (1 << 5) // Writes to APM_CNT cause SMI# +#define SLP_SMI_EN (1 << 4) // Write to SLP_EN in PM1_CNT asserts SMI# +#define LEGACY_USB_EN (1 << 3) // Legacy USB circuit SMI logic +#define BIOS_EN (1 << 2) // Assert SMI# on setting GBL_RLS bit +#define EOS (1 << 1) // End of SMI (deassert SMI#) +#define GBL_SMI_EN (1 << 0) // SMI# generation at all? +#define SMI_STS 0x34 +#define ALT_GP_SMI_EN 0x38 +#define ALT_GP_SMI_STS 0x3a +#define GPE_CNTL 0x42 +#define DEVACT_STS 0x44 +#define SS_CNT 0x50 +#define C3_RES 0x54 +#define TCO1_STS 0x64 +#define DMISCI_STS (1 << 9) +#define TCO2_STS 0x66 + +/* + * SPI Opcode Menu setup for SPIBAR lockdown + * should support most common flash chips. + */ + +#define SPIBAR_OFFSET 0x3800 +#define SPIBAR8(x) RCBA8(x + SPIBAR_OFFSET) +#define SPIBAR16(x) RCBA16(x + SPIBAR_OFFSET) +#define SPIBAR32(x) RCBA32(x + SPIBAR_OFFSET) + +/* Reigsters within the SPIBAR */ +#define SSFC 0x91 +#define FDOC 0xb0 +#define FDOD 0xb4 + +#define SPI_OPMENU_0 0x01 /* WRSR: Write Status Register */ +#define SPI_OPTYPE_0 0x01 /* Write, no address */ + +#define SPI_OPMENU_1 0x02 /* BYPR: Byte Program */ +#define SPI_OPTYPE_1 0x03 /* Write, address required */ + +#define SPI_OPMENU_2 0x03 /* READ: Read Data */ +#define SPI_OPTYPE_2 0x02 /* Read, address required */ + +#define SPI_OPMENU_3 0x05 /* RDSR: Read Status Register */ +#define SPI_OPTYPE_3 0x00 /* Read, no address */ + +#define SPI_OPMENU_4 0x20 /* SE20: Sector Erase 0x20 */ +#define SPI_OPTYPE_4 0x03 /* Write, address required */ + +#define SPI_OPMENU_5 0x9f /* RDID: Read ID */ +#define SPI_OPTYPE_5 0x00 /* Read, no address */ + +#define SPI_OPMENU_6 0xd8 /* BED8: Block Erase 0xd8 */ +#define SPI_OPTYPE_6 0x03 /* Write, address required */ + +#define SPI_OPMENU_7 0x0b /* FAST: Fast Read */ +#define SPI_OPTYPE_7 0x02 /* Read, address required */ + +#define SPI_OPMENU_UPPER ((SPI_OPMENU_7 << 24) | (SPI_OPMENU_6 << 16) | \ + (SPI_OPMENU_5 << 8) | SPI_OPMENU_4) +#define SPI_OPMENU_LOWER ((SPI_OPMENU_3 << 24) | (SPI_OPMENU_2 << 16) | \ + (SPI_OPMENU_1 << 8) | SPI_OPMENU_0) + +#define SPI_OPTYPE ((SPI_OPTYPE_7 << 14) | (SPI_OPTYPE_6 << 12) | \ + (SPI_OPTYPE_5 << 10) | (SPI_OPTYPE_4 << 8) | \ + (SPI_OPTYPE_3 << 6) | (SPI_OPTYPE_2 << 4) | \ + (SPI_OPTYPE_1 << 2) | (SPI_OPTYPE_0)) + +#define SPI_OPPREFIX ((0x50 << 8) | 0x06) /* EWSR and WREN */ + +#define SPIBAR_HSFS 0x3804 /* SPI hardware sequence status */ +#define SPIBAR_HSFS_SCIP (1 << 5) /* SPI Cycle In Progress */ +#define SPIBAR_HSFS_AEL (1 << 2) /* SPI Access Error Log */ +#define SPIBAR_HSFS_FCERR (1 << 1) /* SPI Flash Cycle Error */ +#define SPIBAR_HSFS_FDONE (1 << 0) /* SPI Flash Cycle Done */ +#define SPIBAR_HSFC 0x3806 /* SPI hardware sequence control */ +#define SPIBAR_HSFC_BYTE_COUNT(c) (((c - 1) & 0x3f) << 8) +#define SPIBAR_HSFC_CYCLE_READ (0 << 1) /* Read cycle */ +#define SPIBAR_HSFC_CYCLE_WRITE (2 << 1) /* Write cycle */ +#define SPIBAR_HSFC_CYCLE_ERASE (3 << 1) /* Erase cycle */ +#define SPIBAR_HSFC_GO (1 << 0) /* GO: start SPI transaction */ +#define SPIBAR_FADDR 0x3808 /* SPI flash address */ +#define SPIBAR_FDATA(n) (0x3810 + (4 * n)) /* SPI flash data */ + +#endif /* __ACPI__ */ +#endif /* SOUTHBRIDGE_INTEL_LYNXPOINT_PCH_H */ diff --git a/src/southbridge/intel/lynxpoint/pci.c b/src/southbridge/intel/lynxpoint/pci.c new file mode 100644 index 0000000000..306e7d58e3 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/pci.c @@ -0,0 +1,145 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include "pch.h" + +static void pci_init(struct device *dev) +{ + u16 reg16; + u8 reg8; + + printk(BIOS_DEBUG, "PCI init.\n"); + /* Enable Bus Master */ + reg16 = pci_read_config16(dev, PCI_COMMAND); + reg16 |= PCI_COMMAND_MASTER; + pci_write_config16(dev, PCI_COMMAND, reg16); + + /* This device has no interrupt */ + pci_write_config8(dev, INTR, 0xff); + + /* disable parity error response and SERR */ + reg16 = pci_read_config16(dev, BCTRL); + reg16 &= ~(1 << 0); + reg16 &= ~(1 << 1); + pci_write_config16(dev, BCTRL, reg16); + + /* Master Latency Count must be set to 0x04! */ + reg8 = pci_read_config8(dev, SMLT); + reg8 &= 0x07; + reg8 |= (0x04 << 3); + pci_write_config8(dev, SMLT, reg8); + + /* Will this improve throughput of bus masters? */ + pci_write_config8(dev, PCI_MIN_GNT, 0x06); + + /* Clear errors in status registers */ + reg16 = pci_read_config16(dev, PSTS); + //reg16 |= 0xf900; + pci_write_config16(dev, PSTS, reg16); + + reg16 = pci_read_config16(dev, SECSTS); + // reg16 |= 0xf900; + pci_write_config16(dev, SECSTS, reg16); +} + +#undef PCI_BRIDGE_UPDATE_COMMAND +static void ich_pci_dev_enable_resources(struct device *dev) +{ + const struct pci_operations *ops; + uint16_t command; + + /* Set the subsystem vendor and device id for mainboard devices */ + ops = ops_pci(dev); + if (dev->on_mainboard && ops && ops->set_subsystem) { + printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n", + dev_path(dev), + CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, + CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + ops->set_subsystem(dev, + CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, + CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + } + + command = pci_read_config16(dev, PCI_COMMAND); + command |= dev->command; +#ifdef PCI_BRIDGE_UPDATE_COMMAND + /* If we write to PCI_COMMAND, on some systems + * this will cause the ROM and APICs not being visible + * anymore. + */ + printk(BIOS_DEBUG, "%s cmd <- %02x\n", dev_path(dev), command); + pci_write_config16(dev, PCI_COMMAND, command); +#else + printk(BIOS_DEBUG, "%s cmd <- %02x (NOT WRITTEN!)\n", dev_path(dev), command); +#endif +} + +static void ich_pci_bus_enable_resources(struct device *dev) +{ + uint16_t ctrl; + /* enable IO in command register if there is VGA card + * connected with (even it does not claim IO resource) + */ + if (dev->link_list->bridge_ctrl & PCI_BRIDGE_CTL_VGA) + dev->command |= PCI_COMMAND_IO; + ctrl = pci_read_config16(dev, PCI_BRIDGE_CONTROL); + ctrl |= dev->link_list->bridge_ctrl; + ctrl |= (PCI_BRIDGE_CTL_PARITY + PCI_BRIDGE_CTL_SERR); /* error check */ + printk(BIOS_DEBUG, "%s bridge ctrl <- %04x\n", dev_path(dev), ctrl); + pci_write_config16(dev, PCI_BRIDGE_CONTROL, ctrl); + + /* This is the reason we need our own pci_bus_enable_resources */ + ich_pci_dev_enable_resources(dev); +} + +static void set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + /* NOTE: This is not the default position! */ + if (!vendor || !device) { + pci_write_config32(dev, 0x54, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, 0x54, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations pci_ops = { + .set_subsystem = set_subsystem, +}; + +static struct device_operations device_ops = { + .read_resources = pci_bus_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = ich_pci_bus_enable_resources, + .init = pci_init, + .scan_bus = pci_scan_bridge, + .ops_pci = &pci_ops, +}; + +static const struct pci_driver pch_pci __pci_driver = { + .ops = &device_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x2448, +}; diff --git a/src/southbridge/intel/lynxpoint/pcie.c b/src/southbridge/intel/lynxpoint/pcie.c new file mode 100644 index 0000000000..80cd3550e1 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/pcie.c @@ -0,0 +1,273 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pciexp.h> +#include <device/pci_ids.h> +#include "pch.h" + +static void pch_pcie_pm_early(struct device *dev) +{ +/* RPC has been moved. It is in PCI config space now. */ +#if 0 + u16 link_width_p0, link_width_p4; + u8 slot_power_limit = 10; /* 10W for x1 */ + u32 reg32; + u8 reg8; + + reg32 = RCBA32(RPC); + + /* Port 0-3 link aggregation from PCIEPCS1[1:0] soft strap */ + switch (reg32 & 3) { + case 3: + link_width_p0 = 4; + break; + case 1: + case 2: + link_width_p0 = 2; + break; + case 0: + default: + link_width_p0 = 1; + } + + /* Port 4-7 link aggregation from PCIEPCS2[1:0] soft strap */ + switch ((reg32 >> 2) & 3) { + case 3: + link_width_p4 = 4; + break; + case 1: + case 2: + link_width_p4 = 2; + break; + case 0: + default: + link_width_p4 = 1; + } + + /* Enable dynamic clock gating where needed */ + reg8 = pci_read_config8(dev, 0xe1); + switch (PCI_FUNC(dev->path.pci.devfn)) { + case 0: /* Port 0 */ + if (link_width_p0 == 4) + slot_power_limit = 40; /* 40W for x4 */ + else if (link_width_p0 == 2) + slot_power_limit = 20; /* 20W for x2 */ + reg8 |= 0x3f; + break; + case 4: /* Port 4 */ + if (link_width_p4 == 4) + slot_power_limit = 40; /* 40W for x4 */ + else if (link_width_p4 == 2) + slot_power_limit = 20; /* 20W for x2 */ + reg8 |= 0x3f; + break; + case 1: /* Port 1 only if Port 0 is x1 */ + if (link_width_p0 == 1) + reg8 |= 0x3; + break; + case 2: /* Port 2 only if Port 0 is x1 or x2 */ + case 3: /* Port 3 only if Port 0 is x1 or x2 */ + if (link_width_p0 <= 2) + reg8 |= 0x3; + break; + case 5: /* Port 5 only if Port 4 is x1 */ + if (link_width_p4 == 1) + reg8 |= 0x3; + break; + case 6: /* Port 7 only if Port 4 is x1 or x2 */ + case 7: /* Port 7 only if Port 4 is x1 or x2 */ + if (link_width_p4 <= 2) + reg8 |= 0x3; + break; + } + pci_write_config8(dev, 0xe1, reg8); + + /* Set 0xE8[0] = 1 */ + reg32 = pci_read_config32(dev, 0xe8); + reg32 |= 1; + pci_write_config32(dev, 0xe8, reg32); + + /* Adjust Common Clock exit latency */ + reg32 = pci_read_config32(dev, 0xd8); + reg32 &= ~(1 << 17); + reg32 |= (1 << 16) | (1 << 15); + reg32 &= ~(1 << 31); /* Disable PME# SCI for native PME handling */ + pci_write_config32(dev, 0xd8, reg32); + + /* Adjust ASPM L1 exit latency */ + reg32 = pci_read_config32(dev, 0x4c); + reg32 &= ~((1 << 17) | (1 << 16) | (1 << 15)); + if (RCBA32(0x2320) & (1 << 16)) { + /* If RCBA+2320[15]=1 set ASPM L1 to 8-16us */ + reg32 |= (1 << 17); + } else { + /* Else set ASPM L1 to 2-4us */ + reg32 |= (1 << 16); + } + pci_write_config32(dev, 0x4c, reg32); + + /* Set slot power limit as configured above */ + reg32 = pci_read_config32(dev, 0x54); + reg32 &= ~((1 << 15) | (1 << 16)); /* 16:15 = Slot power scale */ + reg32 &= ~(0xff << 7); /* 14:7 = Slot power limit */ + reg32 |= (slot_power_limit << 7); + pci_write_config32(dev, 0x54, reg32); +#endif +} + +static void pch_pcie_pm_late(struct device *dev) +{ + enum aspm_type apmc; + u32 reg32; + + /* Set 0x314 = 0x743a361b */ + pci_mmio_write_config32(dev, 0x314, 0x743a361b); + + /* Set 0x318[31:16] = 0x1414 */ + reg32 = pci_mmio_read_config32(dev, 0x318); + reg32 &= 0x0000ffff; + reg32 |= 0x14140000; + pci_mmio_write_config32(dev, 0x318, reg32); + + /* Set 0x324[5] = 1 */ + reg32 = pci_mmio_read_config32(dev, 0x324); + reg32 |= (1 << 5); + pci_mmio_write_config32(dev, 0x324, reg32); + + /* Set 0x330[7:0] = 0x40 */ + reg32 = pci_mmio_read_config32(dev, 0x330); + reg32 &= ~(0xff); + reg32 |= 0x40; + pci_mmio_write_config32(dev, 0x330, reg32); + + /* Set 0x33C[24:0] = 0x854c74 */ + reg32 = pci_mmio_read_config32(dev, 0x33c); + reg32 &= 0xff000000; + reg32 |= 0x00854c74; + pci_mmio_write_config32(dev, 0x33c, reg32); + + /* No IO-APIC, Disable EOI forwarding */ + reg32 = pci_read_config32(dev, 0xd4); + reg32 |= (1 << 1); + pci_write_config32(dev, 0xd4, reg32); + + /* Get configured ASPM state */ + apmc = pci_read_config32(dev, 0x50) & 3; + + /* If both L0s and L1 enabled then set root port 0xE8[1]=1 */ + if (apmc == PCIE_ASPM_BOTH) { + reg32 = pci_read_config32(dev, 0xe8); + reg32 |= (1 << 1); + pci_write_config32(dev, 0xe8, reg32); + } +} + +static void pci_init(struct device *dev) +{ + u16 reg16; + u32 reg32; + + printk(BIOS_DEBUG, "Initializing PCH PCIe bridge.\n"); + + /* Enable Bus Master */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 |= PCI_COMMAND_MASTER; + pci_write_config32(dev, PCI_COMMAND, reg32); + + /* Set Cache Line Size to 0x10 */ + // This has no effect but the OS might expect it + pci_write_config8(dev, 0x0c, 0x10); + + reg16 = pci_read_config16(dev, 0x3e); + reg16 &= ~(1 << 0); /* disable parity error response */ + // reg16 &= ~(1 << 1); /* disable SERR */ + reg16 |= (1 << 2); /* ISA enable */ + pci_write_config16(dev, 0x3e, reg16); + +#ifdef EVEN_MORE_DEBUG + reg32 = pci_read_config32(dev, 0x20); + printk(BIOS_SPEW, " MBL = 0x%08x\n", reg32); + reg32 = pci_read_config32(dev, 0x24); + printk(BIOS_SPEW, " PMBL = 0x%08x\n", reg32); + reg32 = pci_read_config32(dev, 0x28); + printk(BIOS_SPEW, " PMBU32 = 0x%08x\n", reg32); + reg32 = pci_read_config32(dev, 0x2c); + printk(BIOS_SPEW, " PMLU32 = 0x%08x\n", reg32); +#endif + + /* Clear errors in status registers */ + reg16 = pci_read_config16(dev, 0x06); + //reg16 |= 0xf900; + pci_write_config16(dev, 0x06, reg16); + + reg16 = pci_read_config16(dev, 0x1e); + //reg16 |= 0xf900; + pci_write_config16(dev, 0x1e, reg16); + + /* Power Management init after enumeration */ + pch_pcie_pm_late(dev); +} + +static void pch_pcie_enable(device_t dev) +{ + /* Power Management init before enumeration */ + pch_pcie_pm_early(dev); +} + +static void pcie_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + /* NOTE: This is not the default position! */ + if (!vendor || !device) { + pci_write_config32(dev, 0x94, + pci_read_config32(dev, 0)); + } else { + pci_write_config32(dev, 0x94, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations pci_ops = { + .set_subsystem = pcie_set_subsystem, +}; + +static struct device_operations device_ops = { + .read_resources = pci_bus_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_bus_enable_resources, + .init = pci_init, + .enable = pch_pcie_enable, + .scan_bus = pciexp_scan_bridge, + .ops_pci = &pci_ops, +}; + +static const unsigned short pci_device_ids[] = { 0x1c10, 0x1c12, 0x1c14, 0x1c16, + 0x1c18, 0x1c1a, 0x1c1c, 0x1c1e, + 0x1e10, 0x1e12, 0x1e14, 0x1e16, + 0x1e18, 0x1e1a, 0x1e1c, 0x1e1e, + 0 }; + +static const struct pci_driver pch_pcie __pci_driver = { + .ops = &device_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; diff --git a/src/southbridge/intel/lynxpoint/reset.c b/src/southbridge/intel/lynxpoint/reset.c new file mode 100644 index 0000000000..429aad0ccc --- /dev/null +++ b/src/southbridge/intel/lynxpoint/reset.c @@ -0,0 +1,32 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <reset.h> + +void soft_reset(void) +{ + outb(0x04, 0xcf9); +} + +void hard_reset(void) +{ + outb(0x06, 0xcf9); +} diff --git a/src/southbridge/intel/lynxpoint/sata.c b/src/southbridge/intel/lynxpoint/sata.c new file mode 100644 index 0000000000..0761323179 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/sata.c @@ -0,0 +1,290 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <arch/io.h> +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include "pch.h" + +typedef struct southbridge_intel_lynxpoint_config config_t; + +static inline u32 sir_read(struct device *dev, int idx) +{ + pci_write_config32(dev, SATA_SIRI, idx); + return pci_read_config32(dev, SATA_SIRD); +} + +static inline void sir_write(struct device *dev, int idx, u32 value) +{ + pci_write_config32(dev, SATA_SIRI, idx); + pci_write_config32(dev, SATA_SIRD, value); +} + +static void sata_init(struct device *dev) +{ + u32 reg32; + u16 reg16; + /* Get the chip configuration */ + config_t *config = dev->chip_info; + + printk(BIOS_DEBUG, "SATA: Initializing...\n"); + + if (config == NULL) { + printk(BIOS_ERR, "SATA: ERROR: Device not in devicetree.cb!\n"); + return; + } + + /* SATA configuration */ + + /* Enable BARs */ + pci_write_config16(dev, PCI_COMMAND, 0x0007); + + if (config->ide_legacy_combined) { + printk(BIOS_DEBUG, "SATA: Controller in combined mode.\n"); + + /* No AHCI: clear AHCI base */ + pci_write_config32(dev, 0x24, 0x00000000); + /* And without AHCI BAR no memory decoding */ + reg16 = pci_read_config16(dev, PCI_COMMAND); + reg16 &= ~PCI_COMMAND_MEMORY; + pci_write_config16(dev, PCI_COMMAND, reg16); + + pci_write_config8(dev, 0x09, 0x80); + + /* Set timings */ + pci_write_config16(dev, IDE_TIM_PRI, IDE_DECODE_ENABLE | + IDE_ISP_5_CLOCKS | IDE_RCT_4_CLOCKS); + pci_write_config16(dev, IDE_TIM_SEC, IDE_DECODE_ENABLE | + IDE_ISP_3_CLOCKS | IDE_RCT_1_CLOCKS | + IDE_PPE0 | IDE_IE0 | IDE_TIME0); + + /* Sync DMA */ + pci_write_config16(dev, IDE_SDMA_CNT, IDE_SSDE0); + pci_write_config16(dev, IDE_SDMA_TIM, 0x0200); + + /* Set IDE I/O Configuration */ + reg32 = SIG_MODE_PRI_NORMAL | FAST_PCB1 | FAST_PCB0 | PCB1 | PCB0; + pci_write_config32(dev, IDE_CONFIG, reg32); + + /* Port enable */ + reg16 = pci_read_config16(dev, 0x92); + reg16 &= ~0x3f; + reg16 |= config->sata_port_map; + pci_write_config16(dev, 0x92, reg16); + + /* SATA Initialization register */ + pci_write_config32(dev, 0x94, + ((config->sata_port_map ^ 0x3f) << 24) | 0x183); + } else if(config->sata_ahci) { + u32 abar; + + printk(BIOS_DEBUG, "SATA: Controller in AHCI mode.\n"); + + /* Set Interrupt Line */ + /* Interrupt Pin is set by D31IP.PIP */ + pci_write_config8(dev, INTR_LN, 0x0a); + + /* Set timings */ + pci_write_config16(dev, IDE_TIM_PRI, IDE_DECODE_ENABLE | + IDE_ISP_3_CLOCKS | IDE_RCT_1_CLOCKS | + IDE_PPE0 | IDE_IE0 | IDE_TIME0); + pci_write_config16(dev, IDE_TIM_SEC, IDE_DECODE_ENABLE | + IDE_ISP_5_CLOCKS | IDE_RCT_4_CLOCKS); + + /* Sync DMA */ + pci_write_config16(dev, IDE_SDMA_CNT, IDE_PSDE0); + pci_write_config16(dev, IDE_SDMA_TIM, 0x0001); + + /* Set IDE I/O Configuration */ + reg32 = SIG_MODE_PRI_NORMAL | FAST_PCB1 | FAST_PCB0 | PCB1 | PCB0; + pci_write_config32(dev, IDE_CONFIG, reg32); + + /* for AHCI, Port Enable is managed in memory mapped space */ + reg16 = pci_read_config16(dev, 0x92); + reg16 &= ~0x3f; /* 6 ports SKU + ORM */ + reg16 |= 0x8000 | config->sata_port_map; + pci_write_config16(dev, 0x92, reg16); + + /* SATA Initialization register */ + pci_write_config32(dev, 0x94, + ((config->sata_port_map ^ 0x3f) << 24) | 0x183); + + /* Initialize AHCI memory-mapped space */ + abar = pci_read_config32(dev, PCI_BASE_ADDRESS_5); + printk(BIOS_DEBUG, "ABAR: %08X\n", abar); + /* CAP (HBA Capabilities) : enable power management */ + reg32 = read32(abar + 0x00); + reg32 |= 0x0c006000; // set PSC+SSC+SALP+SSS + reg32 &= ~0x00020060; // clear SXS+EMS+PMS + write32(abar + 0x00, reg32); + /* PI (Ports implemented) */ + write32(abar + 0x0c, config->sata_port_map); + (void) read32(abar + 0x0c); /* Read back 1 */ + (void) read32(abar + 0x0c); /* Read back 2 */ + /* CAP2 (HBA Capabilities Extended)*/ + reg32 = read32(abar + 0x24); + reg32 &= ~0x00000002; + write32(abar + 0x24, reg32); + /* VSP (Vendor Specific Register */ + reg32 = read32(abar + 0xa0); + reg32 &= ~0x00000005; + write32(abar + 0xa0, reg32); + } else { + printk(BIOS_DEBUG, "SATA: Controller in plain mode.\n"); + + /* No AHCI: clear AHCI base */ + pci_write_config32(dev, 0x24, 0x00000000); + + /* And without AHCI BAR no memory decoding */ + reg16 = pci_read_config16(dev, PCI_COMMAND); + reg16 &= ~PCI_COMMAND_MEMORY; + pci_write_config16(dev, PCI_COMMAND, reg16); + + /* Native mode capable on both primary and secondary (0xa) + * or'ed with enabled (0x50) = 0xf + */ + pci_write_config8(dev, 0x09, 0x8f); + + /* Set Interrupt Line */ + /* Interrupt Pin is set by D31IP.PIP */ + pci_write_config8(dev, INTR_LN, 0xff); + + /* Set timings */ + pci_write_config16(dev, IDE_TIM_PRI, IDE_DECODE_ENABLE | + IDE_ISP_3_CLOCKS | IDE_RCT_1_CLOCKS | + IDE_PPE0 | IDE_IE0 | IDE_TIME0); + pci_write_config16(dev, IDE_TIM_SEC, IDE_DECODE_ENABLE | + IDE_SITRE | IDE_ISP_3_CLOCKS | + IDE_RCT_1_CLOCKS | IDE_IE0 | IDE_TIME0); + + /* Sync DMA */ + pci_write_config16(dev, IDE_SDMA_CNT, IDE_SSDE0 | IDE_PSDE0); + pci_write_config16(dev, IDE_SDMA_TIM, 0x0201); + + /* Set IDE I/O Configuration */ + reg32 = SIG_MODE_PRI_NORMAL | FAST_PCB1 | FAST_PCB0 | PCB1 | PCB0; + pci_write_config32(dev, IDE_CONFIG, reg32); + + /* Port enable */ + reg16 = pci_read_config16(dev, 0x92); + reg16 &= ~0x3f; + reg16 |= config->sata_port_map; + pci_write_config16(dev, 0x92, reg16); + + /* SATA Initialization register */ + pci_write_config32(dev, 0x94, + ((config->sata_port_map ^ 0x3f) << 24) | 0x183); + } + + /* Set Gen3 Transmitter settings if needed */ + if (config->sata_port0_gen3_tx) + pch_iobp_update(SATA_IOBP_SP0G3IR, 0, + config->sata_port0_gen3_tx); + + if (config->sata_port1_gen3_tx) + pch_iobp_update(SATA_IOBP_SP1G3IR, 0, + config->sata_port1_gen3_tx); + + /* Additional Programming Requirements */ + sir_write(dev, 0x04, 0x00001600); + sir_write(dev, 0x28, 0xa0000033); + reg32 = sir_read(dev, 0x54); + reg32 &= 0xff000000; + reg32 |= 0x5555aa; + sir_write(dev, 0x54, reg32); + sir_write(dev, 0x64, 0xcccc8484); + reg32 = sir_read(dev, 0x68); + reg32 &= 0xffff0000; + reg32 |= 0xcccc; + sir_write(dev, 0x68, reg32); + reg32 = sir_read(dev, 0x78); + reg32 &= 0x0000ffff; + reg32 |= 0x88880000; + sir_write(dev, 0x78, reg32); + sir_write(dev, 0x84, 0x001c7000); + sir_write(dev, 0x88, 0x88338822); + sir_write(dev, 0xa0, 0x001c7000); + // a4 + sir_write(dev, 0xc4, 0x0c0c0c0c); + sir_write(dev, 0xc8, 0x0c0c0c0c); + sir_write(dev, 0xd4, 0x10000000); + + pch_iobp_update(0xea004001, 0x3fffffff, 0xc0000000); + pch_iobp_update(0xea00408a, 0xfffffcff, 0x00000100); +} + +static void sata_enable(device_t dev) +{ + /* Get the chip configuration */ + config_t *config = dev->chip_info; + u16 map = 0; + + if (!config) + return; + + /* + * Set SATA controller mode early so the resource allocator can + * properly assign IO/Memory resources for the controller. + */ + if (config->sata_ahci) + map = 0x0060; + + map |= (config->sata_port_map ^ 0x3f) << 8; + + pci_write_config16(dev, 0x90, map); +} + +static void sata_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations sata_pci_ops = { + .set_subsystem = sata_set_subsystem, +}; + +static struct device_operations sata_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = sata_init, + .enable = sata_enable, + .scan_bus = 0, + .ops_pci = &sata_pci_ops, +}; + +static const unsigned short pci_device_ids[] = { 0x1c00, 0x1c01, 0x1c02, 0x1c03, + 0x1e00, 0x1e01, 0x1e02, 0x1e03, + 0 }; + +static const struct pci_driver pch_sata __pci_driver = { + .ops = &sata_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; + diff --git a/src/southbridge/intel/lynxpoint/smbus.c b/src/southbridge/intel/lynxpoint/smbus.c new file mode 100644 index 0000000000..4786d8b6c9 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/smbus.c @@ -0,0 +1,109 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/path.h> +#include <device/smbus.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include <device/pci_ops.h> +#include <arch/io.h> +#include "pch.h" +#include "smbus.h" + +static void pch_smbus_init(device_t dev) +{ + struct resource *res; + u16 reg16; + + /* Enable clock gating */ + reg16 = pci_read_config32(dev, 0x80); + reg16 &= ~((1 << 8)|(1 << 10)|(1 << 12)|(1 << 14)); + pci_write_config32(dev, 0x80, reg16); + + /* Set Receive Slave Address */ + res = find_resource(dev, PCI_BASE_ADDRESS_4); + if (res) + outb(SMBUS_SLAVE_ADDR, res->base + SMB_RCV_SLVA); +} + +static int lsmbus_read_byte(device_t dev, u8 address) +{ + u16 device; + struct resource *res; + struct bus *pbus; + + device = dev->path.i2c.device; + pbus = get_pbus_smbus(dev); + res = find_resource(pbus->dev, 0x20); + + return do_smbus_read_byte(res->base, device, address); +} + +static struct smbus_bus_operations lops_smbus_bus = { + .read_byte = lsmbus_read_byte, +}; + +static void smbus_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } +} + +static struct pci_operations smbus_pci_ops = { + .set_subsystem = smbus_set_subsystem, +}; + +static void smbus_read_resources(device_t dev) +{ + struct resource *res = new_resource(dev, PCI_BASE_ADDRESS_4); + res->base = SMBUS_IO_BASE; + res->size = 32; + res->limit = res->base + res->size - 1; + res->flags = IORESOURCE_IO | IORESOURCE_FIXED | IORESOURCE_RESERVE | + IORESOURCE_STORED | IORESOURCE_ASSIGNED; + + /* Also add MMIO resource */ + res = pci_get_resource(dev, PCI_BASE_ADDRESS_0); +} + +static struct device_operations smbus_ops = { + .read_resources = smbus_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .scan_bus = scan_static_bus, + .init = pch_smbus_init, + .ops_smbus_bus = &lops_smbus_bus, + .ops_pci = &smbus_pci_ops, +}; + +static const unsigned short pci_device_ids[] = { 0x1c22, 0x1e22, 0 }; + +static const struct pci_driver pch_smbus __pci_driver = { + .ops = &smbus_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; diff --git a/src/southbridge/intel/lynxpoint/smbus.h b/src/southbridge/intel/lynxpoint/smbus.h new file mode 100644 index 0000000000..81e594942d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/smbus.h @@ -0,0 +1,100 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2005 Yinghai Lu <yinghailu@gmail.com> + * Copyright (C) 2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <device/smbus_def.h> +#include "pch.h" + +static void smbus_delay(void) +{ + inb(0x80); +} + +static int smbus_wait_until_ready(u16 smbus_base) +{ + unsigned loops = SMBUS_TIMEOUT; + unsigned char byte; + do { + smbus_delay(); + if (--loops == 0) + break; + byte = inb(smbus_base + SMBHSTSTAT); + } while (byte & 1); + return loops ? 0 : -1; +} + +static int smbus_wait_until_done(u16 smbus_base) +{ + unsigned loops = SMBUS_TIMEOUT; + unsigned char byte; + do { + smbus_delay(); + if (--loops == 0) + break; + byte = inb(smbus_base + SMBHSTSTAT); + } while ((byte & 1) || (byte & ~((1 << 6) | (1 << 0))) == 0); + return loops ? 0 : -1; +} + +static int do_smbus_read_byte(unsigned smbus_base, unsigned device, unsigned address) +{ + unsigned char global_status_register; + unsigned char byte; + + if (smbus_wait_until_ready(smbus_base) < 0) { + return SMBUS_WAIT_UNTIL_READY_TIMEOUT; + } + /* Setup transaction */ + /* Disable interrupts */ + outb(inb(smbus_base + SMBHSTCTL) & (~1), smbus_base + SMBHSTCTL); + /* Set the device I'm talking too */ + outb(((device & 0x7f) << 1) | 1, smbus_base + SMBXMITADD); + /* Set the command/address... */ + outb(address & 0xff, smbus_base + SMBHSTCMD); + /* Set up for a byte data read */ + outb((inb(smbus_base + SMBHSTCTL) & 0xe3) | (0x2 << 2), + (smbus_base + SMBHSTCTL)); + /* Clear any lingering errors, so the transaction will run */ + outb(inb(smbus_base + SMBHSTSTAT), smbus_base + SMBHSTSTAT); + + /* Clear the data byte... */ + outb(0, smbus_base + SMBHSTDAT0); + + /* Start the command */ + outb((inb(smbus_base + SMBHSTCTL) | 0x40), + smbus_base + SMBHSTCTL); + + /* Poll for transaction completion */ + if (smbus_wait_until_done(smbus_base) < 0) { + return SMBUS_WAIT_UNTIL_DONE_TIMEOUT; + } + + global_status_register = inb(smbus_base + SMBHSTSTAT); + + /* Ignore the "In Use" status... */ + global_status_register &= ~(3 << 5); + + /* Read results of transaction */ + byte = inb(smbus_base + SMBHSTDAT0); + if (global_status_register != (1 << 1)) { + return SMBUS_ERROR; + } + return byte; +} + diff --git a/src/southbridge/intel/lynxpoint/smi.c b/src/southbridge/intel/lynxpoint/smi.c new file mode 100644 index 0000000000..0bb98813ed --- /dev/null +++ b/src/southbridge/intel/lynxpoint/smi.c @@ -0,0 +1,416 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + + +#include <device/device.h> +#include <device/pci.h> +#include <console/console.h> +#include <arch/io.h> +#include <cpu/cpu.h> +#include <cpu/x86/cache.h> +#include <cpu/x86/smm.h> +#include <string.h> +#include "pch.h" + +#if CONFIG_NORTHBRIDGE_INTEL_HASWELL +#include "northbridge/intel/haswell/haswell.h" +#endif + +extern unsigned char _binary_smm_start; +extern unsigned char _binary_smm_size; + +/* While we read PMBASE dynamically in case it changed, let's + * initialize it with a sane value + */ +static u16 pmbase = DEFAULT_PMBASE; + +/** + * @brief read and clear PM1_STS + * @return PM1_STS register + */ +static u16 reset_pm1_status(void) +{ + u16 reg16; + + reg16 = inw(pmbase + PM1_STS); + /* set status bits are cleared by writing 1 to them */ + outw(reg16, pmbase + PM1_STS); + + return reg16; +} + +static void dump_pm1_status(u16 pm1_sts) +{ + printk(BIOS_DEBUG, "PM1_STS: "); + if (pm1_sts & (1 << 15)) printk(BIOS_DEBUG, "WAK "); + if (pm1_sts & (1 << 14)) printk(BIOS_DEBUG, "PCIEXPWAK "); + if (pm1_sts & (1 << 11)) printk(BIOS_DEBUG, "PRBTNOR "); + if (pm1_sts & (1 << 10)) printk(BIOS_DEBUG, "RTC "); + if (pm1_sts & (1 << 8)) printk(BIOS_DEBUG, "PWRBTN "); + if (pm1_sts & (1 << 5)) printk(BIOS_DEBUG, "GBL "); + if (pm1_sts & (1 << 4)) printk(BIOS_DEBUG, "BM "); + if (pm1_sts & (1 << 0)) printk(BIOS_DEBUG, "TMROF "); + printk(BIOS_DEBUG, "\n"); +} + +/** + * @brief read and clear SMI_STS + * @return SMI_STS register + */ +static u32 reset_smi_status(void) +{ + u32 reg32; + + reg32 = inl(pmbase + SMI_STS); + /* set status bits are cleared by writing 1 to them */ + outl(reg32, pmbase + SMI_STS); + + return reg32; +} + +static void dump_smi_status(u32 smi_sts) +{ + printk(BIOS_DEBUG, "SMI_STS: "); + if (smi_sts & (1 << 26)) printk(BIOS_DEBUG, "SPI "); + if (smi_sts & (1 << 25)) printk(BIOS_DEBUG, "EL_SMI "); + if (smi_sts & (1 << 21)) printk(BIOS_DEBUG, "MONITOR "); + if (smi_sts & (1 << 20)) printk(BIOS_DEBUG, "PCI_EXP_SMI "); + if (smi_sts & (1 << 18)) printk(BIOS_DEBUG, "INTEL_USB2 "); + if (smi_sts & (1 << 17)) printk(BIOS_DEBUG, "LEGACY_USB2 "); + if (smi_sts & (1 << 16)) printk(BIOS_DEBUG, "SMBUS_SMI "); + if (smi_sts & (1 << 15)) printk(BIOS_DEBUG, "SERIRQ_SMI "); + if (smi_sts & (1 << 14)) printk(BIOS_DEBUG, "PERIODIC "); + if (smi_sts & (1 << 13)) printk(BIOS_DEBUG, "TCO "); + if (smi_sts & (1 << 12)) printk(BIOS_DEBUG, "DEVMON "); + if (smi_sts & (1 << 11)) printk(BIOS_DEBUG, "MCSMI "); + if (smi_sts & (1 << 10)) printk(BIOS_DEBUG, "GPI "); + if (smi_sts & (1 << 9)) printk(BIOS_DEBUG, "GPE0 "); + if (smi_sts & (1 << 8)) printk(BIOS_DEBUG, "PM1 "); + if (smi_sts & (1 << 6)) printk(BIOS_DEBUG, "SWSMI_TMR "); + if (smi_sts & (1 << 5)) printk(BIOS_DEBUG, "APM "); + if (smi_sts & (1 << 4)) printk(BIOS_DEBUG, "SLP_SMI "); + if (smi_sts & (1 << 3)) printk(BIOS_DEBUG, "LEGACY_USB "); + if (smi_sts & (1 << 2)) printk(BIOS_DEBUG, "BIOS "); + printk(BIOS_DEBUG, "\n"); +} + + +/** + * @brief read and clear GPE0_STS + * @return GPE0_STS register + */ +static u32 reset_gpe0_status(void) +{ + u32 reg32; + + reg32 = inl(pmbase + GPE0_STS); + /* set status bits are cleared by writing 1 to them */ + outl(reg32, pmbase + GPE0_STS); + + return reg32; +} + +static void dump_gpe0_status(u32 gpe0_sts) +{ + int i; + printk(BIOS_DEBUG, "GPE0_STS: "); + for (i=31; i<= 16; i--) { + if (gpe0_sts & (1 << i)) printk(BIOS_DEBUG, "GPIO%d ", (i-16)); + } + if (gpe0_sts & (1 << 14)) printk(BIOS_DEBUG, "USB4 "); + if (gpe0_sts & (1 << 13)) printk(BIOS_DEBUG, "PME_B0 "); + if (gpe0_sts & (1 << 12)) printk(BIOS_DEBUG, "USB3 "); + if (gpe0_sts & (1 << 11)) printk(BIOS_DEBUG, "PME "); + if (gpe0_sts & (1 << 10)) printk(BIOS_DEBUG, "EL_SCI/BATLOW "); + if (gpe0_sts & (1 << 9)) printk(BIOS_DEBUG, "PCI_EXP "); + if (gpe0_sts & (1 << 8)) printk(BIOS_DEBUG, "RI "); + if (gpe0_sts & (1 << 7)) printk(BIOS_DEBUG, "SMB_WAK "); + if (gpe0_sts & (1 << 6)) printk(BIOS_DEBUG, "TCO_SCI "); + if (gpe0_sts & (1 << 5)) printk(BIOS_DEBUG, "AC97 "); + if (gpe0_sts & (1 << 4)) printk(BIOS_DEBUG, "USB2 "); + if (gpe0_sts & (1 << 3)) printk(BIOS_DEBUG, "USB1 "); + if (gpe0_sts & (1 << 2)) printk(BIOS_DEBUG, "HOT_PLUG "); + if (gpe0_sts & (1 << 0)) printk(BIOS_DEBUG, "THRM "); + printk(BIOS_DEBUG, "\n"); +} + + +/** + * @brief read and clear ALT_GP_SMI_STS + * @return ALT_GP_SMI_STS register + */ +static u16 reset_alt_gp_smi_status(void) +{ + u16 reg16; + + reg16 = inl(pmbase + ALT_GP_SMI_STS); + /* set status bits are cleared by writing 1 to them */ + outl(reg16, pmbase + ALT_GP_SMI_STS); + + return reg16; +} + +static void dump_alt_gp_smi_status(u16 alt_gp_smi_sts) +{ + int i; + printk(BIOS_DEBUG, "ALT_GP_SMI_STS: "); + for (i=15; i<= 0; i--) { + if (alt_gp_smi_sts & (1 << i)) printk(BIOS_DEBUG, "GPI%d ", (i-16)); + } + printk(BIOS_DEBUG, "\n"); +} + + + +/** + * @brief read and clear TCOx_STS + * @return TCOx_STS registers + */ +static u32 reset_tco_status(void) +{ + u32 tcobase = pmbase + 0x60; + u32 reg32; + + reg32 = inl(tcobase + 0x04); + /* set status bits are cleared by writing 1 to them */ + outl(reg32 & ~(1<<18), tcobase + 0x04); // Don't clear BOOT_STS before SECOND_TO_STS + if (reg32 & (1 << 18)) + outl(reg32 & (1<<18), tcobase + 0x04); // clear BOOT_STS + + return reg32; +} + + +static void dump_tco_status(u32 tco_sts) +{ + printk(BIOS_DEBUG, "TCO_STS: "); + if (tco_sts & (1 << 20)) printk(BIOS_DEBUG, "SMLINK_SLV "); + if (tco_sts & (1 << 18)) printk(BIOS_DEBUG, "BOOT "); + if (tco_sts & (1 << 17)) printk(BIOS_DEBUG, "SECOND_TO "); + if (tco_sts & (1 << 16)) printk(BIOS_DEBUG, "INTRD_DET "); + if (tco_sts & (1 << 12)) printk(BIOS_DEBUG, "DMISERR "); + if (tco_sts & (1 << 10)) printk(BIOS_DEBUG, "DMISMI "); + if (tco_sts & (1 << 9)) printk(BIOS_DEBUG, "DMISCI "); + if (tco_sts & (1 << 8)) printk(BIOS_DEBUG, "BIOSWR "); + if (tco_sts & (1 << 7)) printk(BIOS_DEBUG, "NEWCENTURY "); + if (tco_sts & (1 << 3)) printk(BIOS_DEBUG, "TIMEOUT "); + if (tco_sts & (1 << 2)) printk(BIOS_DEBUG, "TCO_INT "); + if (tco_sts & (1 << 1)) printk(BIOS_DEBUG, "SW_TCO "); + if (tco_sts & (1 << 0)) printk(BIOS_DEBUG, "NMI2SMI "); + printk(BIOS_DEBUG, "\n"); +} + + + +/** + * @brief Set the EOS bit + */ +static void smi_set_eos(void) +{ + u8 reg8; + + reg8 = inb(pmbase + SMI_EN); + reg8 |= EOS; + outb(reg8, pmbase + SMI_EN); +} + +extern uint8_t smm_relocation_start, smm_relocation_end; + +static void smm_relocate(void) +{ + u32 smi_en; + u16 pm1_en; + u32 gpe0_en; + + printk(BIOS_DEBUG, "Initializing SMM handler..."); + + pmbase = pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x1f, 0)), + PMBASE) & 0xff80; + + printk(BIOS_SPEW, " ... pmbase = 0x%04x\n", pmbase); + + smi_en = inl(pmbase + SMI_EN); + if (smi_en & APMC_EN) { + printk(BIOS_INFO, "SMI# handler already enabled?\n"); + return; + } + + /* copy the SMM relocation code */ + memcpy((void *)0x38000, &smm_relocation_start, + &smm_relocation_end - &smm_relocation_start); + + printk(BIOS_DEBUG, "\n"); + dump_smi_status(reset_smi_status()); + dump_pm1_status(reset_pm1_status()); + dump_gpe0_status(reset_gpe0_status()); + dump_alt_gp_smi_status(reset_alt_gp_smi_status()); + dump_tco_status(reset_tco_status()); + + /* Disable GPE0 PME_B0 */ + gpe0_en = inl(pmbase + GPE0_EN); + gpe0_en &= ~PME_B0_EN; + outl(gpe0_en, pmbase + GPE0_EN); + + pm1_en = 0; + pm1_en |= PWRBTN_EN; + pm1_en |= GBL_EN; + outw(pm1_en, pmbase + PM1_EN); + + /* Enable SMI generation: + * - on TCO events + * - on APMC writes (io 0xb2) + * - on writes to SLP_EN (sleep states) + * - on writes to GBL_RLS (bios commands) + * No SMIs: + * - on microcontroller writes (io 0x62/0x66) + */ + + smi_en = 0; /* reset SMI enables */ + +#if 0 + smi_en |= LEGACY_USB2_EN | LEGACY_USB_EN; +#endif + smi_en |= TCO_EN; + smi_en |= APMC_EN; +#if DEBUG_PERIODIC_SMIS + /* Set DEBUG_PERIODIC_SMIS in pch.h to debug using + * periodic SMIs. + */ + smi_en |= PERIODIC_EN; +#endif + smi_en |= SLP_SMI_EN; +#if 0 + smi_en |= BIOS_EN; +#endif + + /* The following need to be on for SMIs to happen */ + smi_en |= EOS | GBL_SMI_EN; + + outl(smi_en, pmbase + SMI_EN); + + /** + * There are several methods of raising a controlled SMI# via + * software, among them: + * - Writes to io 0xb2 (APMC) + * - Writes to the Local Apic ICR with Delivery mode SMI. + * + * Using the local apic is a bit more tricky. According to + * AMD Family 11 Processor BKDG no destination shorthand must be + * used. + * The whole SMM initialization is quite a bit hardware specific, so + * I'm not too worried about the better of the methods at the moment + */ + + /* raise an SMI interrupt */ + printk(BIOS_SPEW, " ... raise SMI#\n"); + outb(0x00, 0xb2); +} + +static int smm_handler_copied = 0; + +static void smm_install(void) +{ + device_t dev = dev_find_slot(0, PCI_DEVFN(0, 0)); + u32 smm_base = 0xa0000; + struct ied_header ied = { + .signature = "INTEL RSVD", + .size = IED_SIZE, + .reserved = {0}, + }; + + /* The first CPU running this gets to copy the SMM handler. But not all + * of them. + */ + if (smm_handler_copied) + return; + smm_handler_copied = 1; + + /* enable the SMM memory window */ + pci_write_config8(dev, SMRAM, D_OPEN | G_SMRAME | C_BASE_SEG); + +#if CONFIG_SMM_TSEG + smm_base = pci_read_config32(dev, TSEG) & ~1; +#endif + + /* copy the real SMM handler */ + printk(BIOS_DEBUG, "Installing SMM handler to 0x%08x\n", smm_base); + memcpy((void *)smm_base, &_binary_smm_start, (size_t)&_binary_smm_size); + + /* copy the IED header into place */ + if (CONFIG_SMM_TSEG_SIZE > IED_SIZE) { + /* Top of TSEG region */ + smm_base += CONFIG_SMM_TSEG_SIZE - IED_SIZE; + printk(BIOS_DEBUG, "Installing IED header to 0x%08x\n", + smm_base); + memcpy((void *)smm_base, &ied, sizeof(ied)); + } + wbinvd(); + + /* close the SMM memory window and enable normal SMM */ + pci_write_config8(dev, SMRAM, G_SMRAME | C_BASE_SEG); +} + +void smm_init(void) +{ +#if CONFIG_ELOG + /* Log events from chipset before clearing */ + pch_log_state(); +#endif + + /* Put SMM code to 0xa0000 */ + smm_install(); + + /* Put relocation code to 0x38000 and relocate SMBASE */ + smm_relocate(); + + /* We're done. Make sure SMIs can happen! */ + smi_set_eos(); +} + +void smm_lock(void) +{ + /* LOCK the SMM memory window and enable normal SMM. + * After running this function, only a full reset can + * make the SMM registers writable again. + */ + printk(BIOS_DEBUG, "Locking SMM.\n"); + pci_write_config8(dev_find_slot(0, PCI_DEVFN(0, 0)), SMRAM, + D_LCK | G_SMRAME | C_BASE_SEG); +} + +void smm_setup_structures(void *gnvs, void *tcg, void *smi1) +{ + /* + * Issue SMI to set the gnvs pointer in SMM. + * tcg and smi1 are unused. + * + * EAX = APM_CNT_GNVS_UPDATE + * EBX = gnvs pointer + * EDX = APM_CNT + */ + asm volatile ( + "outb %%al, %%dx\n\t" + : /* ignore result */ + : "a" (APM_CNT_GNVS_UPDATE), + "b" ((u32)gnvs), + "d" (APM_CNT) + ); +} diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c new file mode 100644 index 0000000000..c5c2c3ec15 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/smihandler.c @@ -0,0 +1,801 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <types.h> +#include <arch/hlt.h> +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/console.h> +#include <cpu/x86/cache.h> +#include <device/pci_def.h> +#include <cpu/x86/smm.h> +#include <elog.h> +#include <pc80/mc146818rtc.h> +#include "pch.h" + +#include "nvs.h" + +/* We are using PCIe accesses for now + * 1. the chipset can do it + * 2. we don't need to worry about how we leave 0xcf8/0xcfc behind + */ +#include <northbridge/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/pcie_config.c> + +/* While we read PMBASE dynamically in case it changed, let's + * initialize it with a sane value + */ +static u16 pmbase = DEFAULT_PMBASE; +u16 smm_get_pmbase(void) +{ + return pmbase; +} + +static u8 smm_initialized = 0; + +/* GNVS needs to be updated by an 0xEA PM Trap (B2) after it has been located + * by coreboot. + */ +static global_nvs_t *gnvs = (global_nvs_t *)0x0; +global_nvs_t *smm_get_gnvs(void) +{ + return gnvs; +} + +#if CONFIG_SMM_TSEG +static u32 tseg_base = 0; +u32 smi_get_tseg_base(void) +{ + if (!tseg_base) + tseg_base = pcie_read_config32(PCI_DEV(0, 0, 0), TSEG) & ~1; + return tseg_base; +} +void tseg_relocate(void **ptr) +{ + /* Adjust pointer with TSEG base */ + if (*ptr && *ptr < (void*)smi_get_tseg_base()) + *ptr = (void *)(((u8*)*ptr) + smi_get_tseg_base()); +} +#endif + +/** + * @brief read and clear PM1_STS + * @return PM1_STS register + */ +static u16 reset_pm1_status(void) +{ + u16 reg16; + + reg16 = inw(pmbase + PM1_STS); + /* set status bits are cleared by writing 1 to them */ + outw(reg16, pmbase + PM1_STS); + + return reg16; +} + +static void dump_pm1_status(u16 pm1_sts) +{ + printk(BIOS_SPEW, "PM1_STS: "); + if (pm1_sts & (1 << 15)) printk(BIOS_SPEW, "WAK "); + if (pm1_sts & (1 << 14)) printk(BIOS_SPEW, "PCIEXPWAK "); + if (pm1_sts & (1 << 11)) printk(BIOS_SPEW, "PRBTNOR "); + if (pm1_sts & (1 << 10)) printk(BIOS_SPEW, "RTC "); + if (pm1_sts & (1 << 8)) printk(BIOS_SPEW, "PWRBTN "); + if (pm1_sts & (1 << 5)) printk(BIOS_SPEW, "GBL "); + if (pm1_sts & (1 << 4)) printk(BIOS_SPEW, "BM "); + if (pm1_sts & (1 << 0)) printk(BIOS_SPEW, "TMROF "); + printk(BIOS_SPEW, "\n"); + int reg16 = inw(pmbase + PM1_EN); + printk(BIOS_SPEW, "PM1_EN: %x\n", reg16); +} + +/** + * @brief read and clear SMI_STS + * @return SMI_STS register + */ +static u32 reset_smi_status(void) +{ + u32 reg32; + + reg32 = inl(pmbase + SMI_STS); + /* set status bits are cleared by writing 1 to them */ + outl(reg32, pmbase + SMI_STS); + + return reg32; +} + +static void dump_smi_status(u32 smi_sts) +{ + printk(BIOS_DEBUG, "SMI_STS: "); + if (smi_sts & (1 << 26)) printk(BIOS_DEBUG, "SPI "); + if (smi_sts & (1 << 21)) printk(BIOS_DEBUG, "MONITOR "); + if (smi_sts & (1 << 20)) printk(BIOS_DEBUG, "PCI_EXP_SMI "); + if (smi_sts & (1 << 18)) printk(BIOS_DEBUG, "INTEL_USB2 "); + if (smi_sts & (1 << 17)) printk(BIOS_DEBUG, "LEGACY_USB2 "); + if (smi_sts & (1 << 16)) printk(BIOS_DEBUG, "SMBUS_SMI "); + if (smi_sts & (1 << 15)) printk(BIOS_DEBUG, "SERIRQ_SMI "); + if (smi_sts & (1 << 14)) printk(BIOS_DEBUG, "PERIODIC "); + if (smi_sts & (1 << 13)) printk(BIOS_DEBUG, "TCO "); + if (smi_sts & (1 << 12)) printk(BIOS_DEBUG, "DEVMON "); + if (smi_sts & (1 << 11)) printk(BIOS_DEBUG, "MCSMI "); + if (smi_sts & (1 << 10)) printk(BIOS_DEBUG, "GPI "); + if (smi_sts & (1 << 9)) printk(BIOS_DEBUG, "GPE0 "); + if (smi_sts & (1 << 8)) printk(BIOS_DEBUG, "PM1 "); + if (smi_sts & (1 << 6)) printk(BIOS_DEBUG, "SWSMI_TMR "); + if (smi_sts & (1 << 5)) printk(BIOS_DEBUG, "APM "); + if (smi_sts & (1 << 4)) printk(BIOS_DEBUG, "SLP_SMI "); + if (smi_sts & (1 << 3)) printk(BIOS_DEBUG, "LEGACY_USB "); + if (smi_sts & (1 << 2)) printk(BIOS_DEBUG, "BIOS "); + printk(BIOS_DEBUG, "\n"); +} + + +/** + * @brief read and clear GPE0_STS + * @return GPE0_STS register + */ +static u32 reset_gpe0_status(void) +{ + u32 reg32; + + reg32 = inl(pmbase + GPE0_STS); + /* set status bits are cleared by writing 1 to them */ + outl(reg32, pmbase + GPE0_STS); + + return reg32; +} + +static void dump_gpe0_status(u32 gpe0_sts) +{ + int i; + printk(BIOS_DEBUG, "GPE0_STS: "); + for (i=31; i<= 16; i--) { + if (gpe0_sts & (1 << i)) printk(BIOS_DEBUG, "GPIO%d ", (i-16)); + } + if (gpe0_sts & (1 << 14)) printk(BIOS_DEBUG, "USB4 "); + if (gpe0_sts & (1 << 13)) printk(BIOS_DEBUG, "PME_B0 "); + if (gpe0_sts & (1 << 12)) printk(BIOS_DEBUG, "USB3 "); + if (gpe0_sts & (1 << 11)) printk(BIOS_DEBUG, "PME "); + if (gpe0_sts & (1 << 10)) printk(BIOS_DEBUG, "BATLOW "); + if (gpe0_sts & (1 << 9)) printk(BIOS_DEBUG, "PCI_EXP "); + if (gpe0_sts & (1 << 8)) printk(BIOS_DEBUG, "RI "); + if (gpe0_sts & (1 << 7)) printk(BIOS_DEBUG, "SMB_WAK "); + if (gpe0_sts & (1 << 6)) printk(BIOS_DEBUG, "TCO_SCI "); + if (gpe0_sts & (1 << 5)) printk(BIOS_DEBUG, "AC97 "); + if (gpe0_sts & (1 << 4)) printk(BIOS_DEBUG, "USB2 "); + if (gpe0_sts & (1 << 3)) printk(BIOS_DEBUG, "USB1 "); + if (gpe0_sts & (1 << 2)) printk(BIOS_DEBUG, "SWGPE "); + if (gpe0_sts & (1 << 1)) printk(BIOS_DEBUG, "HOTPLUG "); + if (gpe0_sts & (1 << 0)) printk(BIOS_DEBUG, "THRM "); + printk(BIOS_DEBUG, "\n"); +} + + +/** + * @brief read and clear TCOx_STS + * @return TCOx_STS registers + */ +static u32 reset_tco_status(void) +{ + u32 tcobase = pmbase + 0x60; + u32 reg32; + + reg32 = inl(tcobase + 0x04); + /* set status bits are cleared by writing 1 to them */ + outl(reg32 & ~(1<<18), tcobase + 0x04); // Don't clear BOOT_STS before SECOND_TO_STS + if (reg32 & (1 << 18)) + outl(reg32 & (1<<18), tcobase + 0x04); // clear BOOT_STS + + return reg32; +} + + +static void dump_tco_status(u32 tco_sts) +{ + printk(BIOS_DEBUG, "TCO_STS: "); + if (tco_sts & (1 << 20)) printk(BIOS_DEBUG, "SMLINK_SLV "); + if (tco_sts & (1 << 18)) printk(BIOS_DEBUG, "BOOT "); + if (tco_sts & (1 << 17)) printk(BIOS_DEBUG, "SECOND_TO "); + if (tco_sts & (1 << 16)) printk(BIOS_DEBUG, "INTRD_DET "); + if (tco_sts & (1 << 12)) printk(BIOS_DEBUG, "DMISERR "); + if (tco_sts & (1 << 10)) printk(BIOS_DEBUG, "DMISMI "); + if (tco_sts & (1 << 9)) printk(BIOS_DEBUG, "DMISCI "); + if (tco_sts & (1 << 8)) printk(BIOS_DEBUG, "BIOSWR "); + if (tco_sts & (1 << 7)) printk(BIOS_DEBUG, "NEWCENTURY "); + if (tco_sts & (1 << 3)) printk(BIOS_DEBUG, "TIMEOUT "); + if (tco_sts & (1 << 2)) printk(BIOS_DEBUG, "TCO_INT "); + if (tco_sts & (1 << 1)) printk(BIOS_DEBUG, "SW_TCO "); + if (tco_sts & (1 << 0)) printk(BIOS_DEBUG, "NMI2SMI "); + printk(BIOS_DEBUG, "\n"); +} + +int southbridge_io_trap_handler(int smif) +{ + switch (smif) { + case 0x32: + printk(BIOS_DEBUG, "OS Init\n"); + /* gnvs->smif: + * On success, the IO Trap Handler returns 0 + * On failure, the IO Trap Handler returns a value != 0 + */ + gnvs->smif = 0; + return 1; /* IO trap handled */ + } + + /* Not handled */ + return 0; +} + +/** + * @brief Set the EOS bit + */ +void southbridge_smi_set_eos(void) +{ + u8 reg8; + + reg8 = inb(pmbase + SMI_EN); + reg8 |= EOS; + outb(reg8, pmbase + SMI_EN); +} + +static void busmaster_disable_on_bus(int bus) +{ + int slot, func; + unsigned int val; + unsigned char hdr; + + for (slot = 0; slot < 0x20; slot++) { + for (func = 0; func < 8; func++) { + u32 reg32; + device_t dev = PCI_DEV(bus, slot, func); + + val = pci_read_config32(dev, PCI_VENDOR_ID); + + if (val == 0xffffffff || val == 0x00000000 || + val == 0x0000ffff || val == 0xffff0000) + continue; + + /* Disable Bus Mastering for this one device */ + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 &= ~PCI_COMMAND_MASTER; + pci_write_config32(dev, PCI_COMMAND, reg32); + + /* If this is a bridge, then follow it. */ + hdr = pci_read_config8(dev, PCI_HEADER_TYPE); + hdr &= 0x7f; + if (hdr == PCI_HEADER_TYPE_BRIDGE || + hdr == PCI_HEADER_TYPE_CARDBUS) { + unsigned int buses; + buses = pci_read_config32(dev, PCI_PRIMARY_BUS); + busmaster_disable_on_bus((buses >> 8) & 0xff); + } + } + } +} + +/* + * Drive GPIO 60 low to gate memory reset in S3. + * + * Intel reference designs all use GPIO 60 but it is + * not a requirement and boards could use a different pin. + */ +static void southbridge_gate_memory_reset(void) +{ + u32 reg32; + u16 gpiobase; + + gpiobase = pcie_read_config16(PCI_DEV(0, 0x1f, 0), GPIOBASE) & 0xfffc; + if (!gpiobase) + return; + + /* Make sure it is set as GPIO */ + reg32 = inl(gpiobase + GPIO_USE_SEL2); + if (!(reg32 & (1 << 28))) { + reg32 |= (1 << 28); + outl(reg32, gpiobase + GPIO_USE_SEL2); + } + + /* Make sure it is set as output */ + reg32 = inl(gpiobase + GP_IO_SEL2); + if (reg32 & (1 << 28)) { + reg32 &= ~(1 << 28); + outl(reg32, gpiobase + GP_IO_SEL2); + } + + /* Drive the output low */ + reg32 = inl(gpiobase + GP_LVL2); + reg32 &= ~(1 << 28); + outl(reg32, gpiobase + GP_LVL2); +} + +static void southbridge_smi_sleep(unsigned int node, smm_state_save_area_t *state_save) +{ + u8 reg8; + u32 reg32; + u8 slp_typ; + u8 s5pwr = CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL; + + // save and recover RTC port values + u8 tmp70, tmp72; + tmp70 = inb(0x70); + tmp72 = inb(0x72); + get_option(&s5pwr, "power_on_after_fail"); + outb(tmp70, 0x70); + outb(tmp72, 0x72); + + void (*mainboard_sleep)(u8 slp_typ) = mainboard_smi_sleep; + + /* First, disable further SMIs */ + reg8 = inb(pmbase + SMI_EN); + reg8 &= ~SLP_SMI_EN; + outb(reg8, pmbase + SMI_EN); + + /* Figure out SLP_TYP */ + reg32 = inl(pmbase + PM1_CNT); + printk(BIOS_SPEW, "SMI#: SLP = 0x%08x\n", reg32); + slp_typ = (reg32 >> 10) & 7; + + /* Do any mainboard sleep handling */ + tseg_relocate((void **)&mainboard_sleep); + if (mainboard_sleep) + mainboard_sleep(slp_typ-2); + +#if CONFIG_ELOG_GSMI + /* Log S3, S4, and S5 entry */ + if (slp_typ >= 5) + elog_add_event_byte(ELOG_TYPE_ACPI_ENTER, slp_typ-2); +#endif + + /* Next, do the deed. + */ + + switch (slp_typ) { + case 0: printk(BIOS_DEBUG, "SMI#: Entering S0 (On)\n"); break; + case 1: printk(BIOS_DEBUG, "SMI#: Entering S1 (Assert STPCLK#)\n"); break; + case 5: + printk(BIOS_DEBUG, "SMI#: Entering S3 (Suspend-To-RAM)\n"); + + /* Gate memory reset */ + southbridge_gate_memory_reset(); + + /* Invalidate the cache before going to S3 */ + wbinvd(); + break; + case 6: printk(BIOS_DEBUG, "SMI#: Entering S4 (Suspend-To-Disk)\n"); break; + case 7: + printk(BIOS_DEBUG, "SMI#: Entering S5 (Soft Power off)\n"); + + outl(0, pmbase + GPE0_EN); + + /* Always set the flag in case CMOS was changed on runtime. For + * "KEEP", switch to "OFF" - KEEP is software emulated + */ + reg8 = pcie_read_config8(PCI_DEV(0, 0x1f, 0), GEN_PMCON_3); + if (s5pwr == MAINBOARD_POWER_ON) { + reg8 &= ~1; + } else { + reg8 |= 1; + } + pcie_write_config8(PCI_DEV(0, 0x1f, 0), GEN_PMCON_3, reg8); + + /* also iterates over all bridges on bus 0 */ + busmaster_disable_on_bus(0); + break; + default: printk(BIOS_DEBUG, "SMI#: ERROR: SLP_TYP reserved\n"); break; + } + + /* Write back to the SLP register to cause the originally intended + * event again. We need to set BIT13 (SLP_EN) though to make the + * sleep happen. + */ + outl(reg32 | SLP_EN, pmbase + PM1_CNT); + + /* Make sure to stop executing code here for S3/S4/S5 */ + if (slp_typ > 1) + hlt(); + + /* In most sleep states, the code flow of this function ends at + * the line above. However, if we entered sleep state S1 and wake + * up again, we will continue to execute code in this function. + */ + reg32 = inl(pmbase + PM1_CNT); + if (reg32 & SCI_EN) { + /* The OS is not an ACPI OS, so we set the state to S0 */ + reg32 &= ~(SLP_EN | SLP_TYP); + outl(reg32, pmbase + PM1_CNT); + } +} + +/* + * Look for Synchronous IO SMI and use save state from that + * core in case we are not running on the same core that + * initiated the IO transaction. + */ +/* FIXME: Confirm Haswell's SMM save state area structure. */ +static em64t101_smm_state_save_area_t *smi_apmc_find_state_save(u8 cmd) +{ + em64t101_smm_state_save_area_t *state; + u32 base = smi_get_tseg_base() + 0x8000 + 0x7d00; + int node; + + /* Check all nodes looking for the one that issued the IO */ + for (node = 0; node < CONFIG_MAX_CPUS; node++) { + state = (em64t101_smm_state_save_area_t *) + (base - (node * 0x400)); + + /* Check for Synchronous IO (bit0==1) */ + if (!(state->io_misc_info & (1 << 0))) + continue; + + /* Make sure it was a write (bit4==0) */ + if (state->io_misc_info & (1 << 4)) + continue; + + /* Check for APMC IO port */ + if (((state->io_misc_info >> 16) & 0xff) != APM_CNT) + continue; + + /* Check AX against the requested command */ + if ((state->rax & 0xff) != cmd) + continue; + + return state; + } + + return NULL; +} + +#if CONFIG_ELOG_GSMI +static void southbridge_smi_gsmi(void) +{ + u32 *ret, *param; + u8 sub_command; + em64t101_smm_state_save_area_t *io_smi = + smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); + + if (!io_smi) + return; + + /* Command and return value in EAX */ + ret = (u32*)&io_smi->rax; + sub_command = (u8)(*ret >> 8); + + /* Parameter buffer in EBX */ + param = (u32*)&io_smi->rbx; + + /* drivers/elog/gsmi.c */ + *ret = gsmi_exec(sub_command, param); +} +#endif + +static void southbridge_smi_apmc(unsigned int node, smm_state_save_area_t *state_save) +{ + u32 pmctrl; + u8 reg8; + int (*mainboard_apmc)(u8 apmc) = mainboard_smi_apmc; + em64t101_smm_state_save_area_t *state; + + /* Emulate B2 register as the FADT / Linux expects it */ + + reg8 = inb(APM_CNT); + switch (reg8) { + case APM_CNT_CST_CONTROL: + /* Calling this function seems to cause + * some kind of race condition in Linux + * and causes a kernel oops + */ + printk(BIOS_DEBUG, "C-state control\n"); + break; + case APM_CNT_PST_CONTROL: + /* Calling this function seems to cause + * some kind of race condition in Linux + * and causes a kernel oops + */ + printk(BIOS_DEBUG, "P-state control\n"); + break; + case APM_CNT_ACPI_DISABLE: + pmctrl = inl(pmbase + PM1_CNT); + pmctrl &= ~SCI_EN; + outl(pmctrl, pmbase + PM1_CNT); + printk(BIOS_DEBUG, "SMI#: ACPI disabled.\n"); + break; + case APM_CNT_ACPI_ENABLE: + pmctrl = inl(pmbase + PM1_CNT); + pmctrl |= SCI_EN; + outl(pmctrl, pmbase + PM1_CNT); + printk(BIOS_DEBUG, "SMI#: ACPI enabled.\n"); + break; + case APM_CNT_GNVS_UPDATE: + if (smm_initialized) { + printk(BIOS_DEBUG, "SMI#: SMM structures already initialized!\n"); + return; + } + state = smi_apmc_find_state_save(reg8); + if (state) { + /* EBX in the state save contains the GNVS pointer */ + gnvs = (global_nvs_t *)((u32)state->rbx); + smm_initialized = 1; + printk(BIOS_DEBUG, "SMI#: Setting GNVS to %p\n", gnvs); + } + break; +#if CONFIG_ELOG_GSMI + case ELOG_GSMI_APM_CNT: + southbridge_smi_gsmi(); + break; +#endif + } + + tseg_relocate((void **)&mainboard_apmc); + if (mainboard_apmc) + mainboard_apmc(reg8); +} + +static void southbridge_smi_pm1(unsigned int node, smm_state_save_area_t *state_save) +{ + u16 pm1_sts; + + pm1_sts = reset_pm1_status(); + dump_pm1_status(pm1_sts); + + /* While OSPM is not active, poweroff immediately + * on a power button event. + */ + if (pm1_sts & PWRBTN_STS) { + // power button pressed + u32 reg32; + reg32 = (7 << 10) | (1 << 13); +#if CONFIG_ELOG_GSMI + elog_add_event(ELOG_TYPE_POWER_BUTTON); +#endif + outl(reg32, pmbase + PM1_CNT); + } +} + +static void southbridge_smi_gpe0(unsigned int node, smm_state_save_area_t *state_save) +{ + u32 gpe0_sts; + + gpe0_sts = reset_gpe0_status(); + dump_gpe0_status(gpe0_sts); +} + +static void southbridge_smi_gpi(unsigned int node, smm_state_save_area_t *state_save) +{ + void (*mainboard_gpi)(u16 gpi_sts) = mainboard_smi_gpi; + u16 reg16; + reg16 = inw(pmbase + ALT_GP_SMI_STS); + outw(reg16, pmbase + ALT_GP_SMI_STS); + + reg16 &= inw(pmbase + ALT_GP_SMI_EN); + + tseg_relocate((void **)&mainboard_gpi); + if (mainboard_gpi) { + mainboard_gpi(reg16); + } else { + if (reg16) + printk(BIOS_DEBUG, "GPI (mask %04x)\n",reg16); + } + + outw(reg16, pmbase + ALT_GP_SMI_STS); +} + +static void southbridge_smi_mc(unsigned int node, smm_state_save_area_t *state_save) +{ + u32 reg32; + + reg32 = inl(pmbase + SMI_EN); + + /* Are periodic SMIs enabled? */ + if ((reg32 & MCSMI_EN) == 0) + return; + + printk(BIOS_DEBUG, "Microcontroller SMI.\n"); +} + + + +static void southbridge_smi_tco(unsigned int node, smm_state_save_area_t *state_save) +{ + u32 tco_sts; + + tco_sts = reset_tco_status(); + + /* Any TCO event? */ + if (!tco_sts) + return; + + if (tco_sts & (1 << 8)) { // BIOSWR + u8 bios_cntl; + + bios_cntl = pcie_read_config16(PCI_DEV(0, 0x1f, 0), 0xdc); + + if (bios_cntl & 1) { + /* BWE is RW, so the SMI was caused by a + * write to BWE, not by a write to the BIOS + */ + + /* This is the place where we notice someone + * is trying to tinker with the BIOS. We are + * trying to be nice and just ignore it. A more + * resolute answer would be to power down the + * box. + */ + printk(BIOS_DEBUG, "Switching back to RO\n"); + pcie_write_config32(PCI_DEV(0, 0x1f, 0), 0xdc, (bios_cntl & ~1)); + } /* No else for now? */ + } else if (tco_sts & (1 << 3)) { /* TIMEOUT */ + /* Handle TCO timeout */ + printk(BIOS_DEBUG, "TCO Timeout.\n"); + } else if (!tco_sts) { + dump_tco_status(tco_sts); + } +} + +static void southbridge_smi_periodic(unsigned int node, smm_state_save_area_t *state_save) +{ + u32 reg32; + + reg32 = inl(pmbase + SMI_EN); + + /* Are periodic SMIs enabled? */ + if ((reg32 & PERIODIC_EN) == 0) + return; + + printk(BIOS_DEBUG, "Periodic SMI.\n"); +} + +static void southbridge_smi_monitor(unsigned int node, smm_state_save_area_t *state_save) +{ +#define IOTRAP(x) (trap_sts & (1 << x)) + u32 trap_sts, trap_cycle; + u32 data, mask = 0; + int i; + + trap_sts = RCBA32(0x1e00); // TRSR - Trap Status Register + RCBA32(0x1e00) = trap_sts; // Clear trap(s) in TRSR + + trap_cycle = RCBA32(0x1e10); + for (i=16; i<20; i++) { + if (trap_cycle & (1 << i)) + mask |= (0xff << ((i - 16) << 2)); + } + + + /* IOTRAP(3) SMI function call */ + if (IOTRAP(3)) { + if (gnvs && gnvs->smif) + io_trap_handler(gnvs->smif); // call function smif + return; + } + + /* IOTRAP(2) currently unused + * IOTRAP(1) currently unused */ + + /* IOTRAP(0) SMIC */ + if (IOTRAP(0)) { + if (!(trap_cycle & (1 << 24))) { // It's a write + printk(BIOS_DEBUG, "SMI1 command\n"); + data = RCBA32(0x1e18); + data &= mask; + // if (smi1) + // southbridge_smi_command(data); + // return; + } + // Fall through to debug + } + + printk(BIOS_DEBUG, " trapped io address = 0x%x\n", trap_cycle & 0xfffc); + for (i=0; i < 4; i++) if(IOTRAP(i)) printk(BIOS_DEBUG, " TRAPĀ = %d\n", i); + printk(BIOS_DEBUG, " AHBE = %x\n", (trap_cycle >> 16) & 0xf); + printk(BIOS_DEBUG, " MASK = 0x%08x\n", mask); + printk(BIOS_DEBUG, " read/write: %s\n", (trap_cycle & (1 << 24)) ? "read" : "write"); + + if (!(trap_cycle & (1 << 24))) { + /* Write Cycle */ + data = RCBA32(0x1e18); + printk(BIOS_DEBUG, " iotrap written data = 0x%08x\n", data); + } +#undef IOTRAP +} + +typedef void (*smi_handler_t)(unsigned int node, + smm_state_save_area_t *state_save); + +static smi_handler_t southbridge_smi[32] = { + NULL, // [0] reserved + NULL, // [1] reserved + NULL, // [2] BIOS_STS + NULL, // [3] LEGACY_USB_STS + southbridge_smi_sleep, // [4] SLP_SMI_STS + southbridge_smi_apmc, // [5] APM_STS + NULL, // [6] SWSMI_TMR_STS + NULL, // [7] reserved + southbridge_smi_pm1, // [8] PM1_STS + southbridge_smi_gpe0, // [9] GPE0_STS + southbridge_smi_gpi, // [10] GPI_STS + southbridge_smi_mc, // [11] MCSMI_STS + NULL, // [12] DEVMON_STS + southbridge_smi_tco, // [13] TCO_STS + southbridge_smi_periodic, // [14] PERIODIC_STS + NULL, // [15] SERIRQ_SMI_STS + NULL, // [16] SMBUS_SMI_STS + NULL, // [17] LEGACY_USB2_STS + NULL, // [18] INTEL_USB2_STS + NULL, // [19] reserved + NULL, // [20] PCI_EXP_SMI_STS + southbridge_smi_monitor, // [21] MONITOR_STS + NULL, // [22] reserved + NULL, // [23] reserved + NULL, // [24] reserved + NULL, // [25] EL_SMI_STS + NULL, // [26] SPI_STS + NULL, // [27] reserved + NULL, // [28] reserved + NULL, // [29] reserved + NULL, // [30] reserved + NULL // [31] reserved +}; + +/** + * @brief Interrupt handler for SMI# + * + * @param smm_revision revision of the smm state save map + */ + +void southbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save) +{ + int i, dump = 0; + u32 smi_sts; + + /* Update global variable pmbase */ + pmbase = pcie_read_config16(PCI_DEV(0, 0x1f, 0), 0x40) & 0xfffc; + + /* We need to clear the SMI status registers, or we won't see what's + * happening in the following calls. + */ + smi_sts = reset_smi_status(); + + /* Call SMI sub handler for each of the status bits */ + for (i = 0; i < 31; i++) { + if (smi_sts & (1 << i)) { + if (southbridge_smi[i]) { +#if CONFIG_SMM_TSEG + smi_handler_t handler = (smi_handler_t) + ((u8*)southbridge_smi[i] + + smi_get_tseg_base()); + if (handler) + handler(node, state_save); +#else + southbridge_smi[i](node, state_save); +#endif + } else { + printk(BIOS_DEBUG, "SMI_STS[%d] occured, but no " + "handler available.\n", i); + dump = 1; + } + } + } + + if(dump) { + dump_smi_status(smi_sts); + } + +} diff --git a/src/southbridge/intel/lynxpoint/spi.c b/src/southbridge/intel/lynxpoint/spi.c new file mode 100644 index 0000000000..2050412345 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/spi.c @@ -0,0 +1,746 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but without any warranty; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* This file is derived from the flashrom project. */ +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <delay.h> +#include <arch/io.h> +#include <console/console.h> +#include <device/pci_ids.h> + +#include <spi-generic.h> + +#define min(a, b) ((a)<(b)?(a):(b)) + +#ifdef __SMM__ +#include <arch/romcc_io.h> +#include <northbridge/intel/haswell/pcie_config.c> +#define pci_read_config_byte(dev, reg, targ)\ + *(targ) = pcie_read_config8(dev, reg) +#define pci_read_config_word(dev, reg, targ)\ + *(targ) = pcie_read_config16(dev, reg) +#define pci_read_config_dword(dev, reg, targ)\ + *(targ) = pcie_read_config32(dev, reg) +#define pci_write_config_byte(dev, reg, val)\ + pcie_write_config8(dev, reg, val) +#define pci_write_config_word(dev, reg, val)\ + pcie_write_config16(dev, reg, val) +#define pci_write_config_dword(dev, reg, val)\ + pcie_write_config32(dev, reg, val) +#else /* !__SMM__ */ +#include <device/device.h> +#include <device/pci.h> +#define pci_read_config_byte(dev, reg, targ)\ + *(targ) = pci_read_config8(dev, reg) +#define pci_read_config_word(dev, reg, targ)\ + *(targ) = pci_read_config16(dev, reg) +#define pci_read_config_dword(dev, reg, targ)\ + *(targ) = pci_read_config32(dev, reg) +#define pci_write_config_byte(dev, reg, val)\ + pci_write_config8(dev, reg, val) +#define pci_write_config_word(dev, reg, val)\ + pci_write_config16(dev, reg, val) +#define pci_write_config_dword(dev, reg, val)\ + pci_write_config32(dev, reg, val) +#endif /* !__SMM__ */ + +typedef struct spi_slave ich_spi_slave; + +static int ichspi_lock = 0; + +typedef struct ich7_spi_regs { + uint16_t spis; + uint16_t spic; + uint32_t spia; + uint64_t spid[8]; + uint64_t _pad; + uint32_t bbar; + uint16_t preop; + uint16_t optype; + uint8_t opmenu[8]; +} __attribute__((packed)) ich7_spi_regs; + +typedef struct ich9_spi_regs { + uint32_t bfpr; + uint16_t hsfs; + uint16_t hsfc; + uint32_t faddr; + uint32_t _reserved0; + uint32_t fdata[16]; + uint32_t frap; + uint32_t freg[5]; + uint32_t _reserved1[3]; + uint32_t pr[5]; + uint32_t _reserved2[2]; + uint8_t ssfs; + uint8_t ssfc[3]; + uint16_t preop; + uint16_t optype; + uint8_t opmenu[8]; + uint32_t bbar; + uint8_t _reserved3[12]; + uint32_t fdoc; + uint32_t fdod; + uint8_t _reserved4[8]; + uint32_t afc; + uint32_t lvscc; + uint32_t uvscc; + uint8_t _reserved5[4]; + uint32_t fpb; + uint8_t _reserved6[28]; + uint32_t srdl; + uint32_t srdc; + uint32_t srd; +} __attribute__((packed)) ich9_spi_regs; + +typedef struct ich_spi_controller { + int locked; + + uint8_t *opmenu; + int menubytes; + uint16_t *preop; + uint16_t *optype; + uint32_t *addr; + uint8_t *data; + unsigned databytes; + uint8_t *status; + uint16_t *control; + uint32_t *bbar; +} ich_spi_controller; + +static ich_spi_controller cntlr; + +enum { + SPIS_SCIP = 0x0001, + SPIS_GRANT = 0x0002, + SPIS_CDS = 0x0004, + SPIS_FCERR = 0x0008, + SSFS_AEL = 0x0010, + SPIS_LOCK = 0x8000, + SPIS_RESERVED_MASK = 0x7ff0, + SSFS_RESERVED_MASK = 0x7fe2 +}; + +enum { + SPIC_SCGO = 0x000002, + SPIC_ACS = 0x000004, + SPIC_SPOP = 0x000008, + SPIC_DBC = 0x003f00, + SPIC_DS = 0x004000, + SPIC_SME = 0x008000, + SSFC_SCF_MASK = 0x070000, + SSFC_RESERVED = 0xf80000 +}; + +enum { + HSFS_FDONE = 0x0001, + HSFS_FCERR = 0x0002, + HSFS_AEL = 0x0004, + HSFS_BERASE_MASK = 0x0018, + HSFS_BERASE_SHIFT = 3, + HSFS_SCIP = 0x0020, + HSFS_FDOPSS = 0x2000, + HSFS_FDV = 0x4000, + HSFS_FLOCKDN = 0x8000 +}; + +enum { + HSFC_FGO = 0x0001, + HSFC_FCYCLE_MASK = 0x0006, + HSFC_FCYCLE_SHIFT = 1, + HSFC_FDBC_MASK = 0x3f00, + HSFC_FDBC_SHIFT = 8, + HSFC_FSMIE = 0x8000 +}; + +enum { + SPI_OPCODE_TYPE_READ_NO_ADDRESS = 0, + SPI_OPCODE_TYPE_WRITE_NO_ADDRESS = 1, + SPI_OPCODE_TYPE_READ_WITH_ADDRESS = 2, + SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS = 3 +}; + +#if CONFIG_DEBUG_SPI_FLASH + +static u8 readb_(const void *addr) +{ + u8 v = read8((unsigned long)addr); + printk(BIOS_DEBUG, "read %2.2x from %4.4x\n", + v, ((unsigned) addr & 0xffff) - 0xf020); + return v; +} + +static u16 readw_(const void *addr) +{ + u16 v = read16((unsigned long)addr); + printk(BIOS_DEBUG, "read %4.4x from %4.4x\n", + v, ((unsigned) addr & 0xffff) - 0xf020); + return v; +} + +static u32 readl_(const void *addr) +{ + u32 v = read32((unsigned long)addr); + printk(BIOS_DEBUG, "read %8.8x from %4.4x\n", + v, ((unsigned) addr & 0xffff) - 0xf020); + return v; +} + +static void writeb_(u8 b, const void *addr) +{ + write8((unsigned long)addr, b); + printk(BIOS_DEBUG, "wrote %2.2x to %4.4x\n", + b, ((unsigned) addr & 0xffff) - 0xf020); +} + +static void writew_(u16 b, const void *addr) +{ + write16((unsigned long)addr, b); + printk(BIOS_DEBUG, "wrote %4.4x to %4.4x\n", + b, ((unsigned) addr & 0xffff) - 0xf020); +} + +static void writel_(u32 b, const void *addr) +{ + write32((unsigned long)addr, b); + printk(BIOS_DEBUG, "wrote %8.8x to %4.4x\n", + b, ((unsigned) addr & 0xffff) - 0xf020); +} + +#else /* CONFIG_DEBUG_SPI_FLASH ^^^ enabled vvv NOT enabled */ + +#define readb_(a) read8((uint32_t)a) +#define readw_(a) read16((uint32_t)a) +#define readl_(a) read32((uint32_t)a) +#define writeb_(val, addr) write8((uint32_t)addr, val) +#define writew_(val, addr) write16((uint32_t)addr, val) +#define writel_(val, addr) write32((uint32_t)addr, val) + +#endif /* CONFIG_DEBUG_SPI_FLASH ^^^ NOT enabled */ + +static void write_reg(const void *value, void *dest, uint32_t size) +{ + const uint8_t *bvalue = value; + uint8_t *bdest = dest; + + while (size >= 4) { + writel_(*(const uint32_t *)bvalue, bdest); + bdest += 4; bvalue += 4; size -= 4; + } + while (size) { + writeb_(*bvalue, bdest); + bdest++; bvalue++; size--; + } +} + +static void read_reg(const void *src, void *value, uint32_t size) +{ + const uint8_t *bsrc = src; + uint8_t *bvalue = value; + + while (size >= 4) { + *(uint32_t *)bvalue = readl_(bsrc); + bsrc += 4; bvalue += 4; size -= 4; + } + while (size) { + *bvalue = readb_(bsrc); + bsrc++; bvalue++; size--; + } +} + +static void ich_set_bbar(uint32_t minaddr) +{ + const uint32_t bbar_mask = 0x00ffff00; + uint32_t ichspi_bbar; + + minaddr &= bbar_mask; + ichspi_bbar = readl_(cntlr.bbar) & ~bbar_mask; + ichspi_bbar |= minaddr; + writel_(ichspi_bbar, cntlr.bbar); +} + +int spi_cs_is_valid(unsigned int bus, unsigned int cs) +{ + printk(BIOS_DEBUG, "spi_cs_is_valid used but not implemented\n"); + return 0; +} + +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, + unsigned int max_hz, unsigned int mode) +{ + ich_spi_slave *slave = malloc(sizeof(*slave)); + + if (!slave) { + printk(BIOS_DEBUG, "ICH SPI: Bad allocation\n"); + return NULL; + } + + memset(slave, 0, sizeof(*slave)); + + slave->bus = bus; + slave->cs = cs; + return slave; +} + +/* + * Check if this device ID matches one of supported Intel PCH devices. + * + * Return the ICH version if there is a match, or zero otherwise. + */ +static inline int get_ich_version(uint16_t device_id) +{ + if (device_id == PCI_DEVICE_ID_INTEL_TGP_LPC) + return 7; + + if ((device_id >= PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN && + device_id <= PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX) || + (device_id >= PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MIN && + device_id <= PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MAX)) + return 9; + + return 0; +} + +void spi_init(void) +{ + int ich_version = 0; + + uint8_t *rcrb; /* Root Complex Register Block */ + uint32_t rcba; /* Root Complex Base Address */ + uint8_t bios_cntl; + device_t dev; + uint32_t ids; + uint16_t vendor_id, device_id; + +#ifdef __SMM__ + dev = PCI_DEV(0, 31, 0); +#else + dev = dev_find_slot(0, PCI_DEVFN(31, 0)); +#endif + pci_read_config_dword(dev, 0, &ids); + vendor_id = ids; + device_id = (ids >> 16); + + if (vendor_id != PCI_VENDOR_ID_INTEL) { + printk(BIOS_DEBUG, "ICH SPI: No ICH found.\n"); + return; + } + + ich_version = get_ich_version(device_id); + + if (!ich_version) { + printk(BIOS_DEBUG, "ICH SPI: No known ICH found.\n"); + return; + } + + pci_read_config_dword(dev, 0xf0, &rcba); + /* Bits 31-14 are the base address, 13-1 are reserved, 0 is enable. */ + rcrb = (uint8_t *)(rcba & 0xffffc000); + switch (ich_version) { + case 7: + { + const uint16_t ich7_spibar_offset = 0x3020; + ich7_spi_regs *ich7_spi = + (ich7_spi_regs *)(rcrb + ich7_spibar_offset); + + ichspi_lock = readw_(&ich7_spi->spis) & SPIS_LOCK; + cntlr.opmenu = ich7_spi->opmenu; + cntlr.menubytes = sizeof(ich7_spi->opmenu); + cntlr.optype = &ich7_spi->optype; + cntlr.addr = &ich7_spi->spia; + cntlr.data = (uint8_t *)ich7_spi->spid; + cntlr.databytes = sizeof(ich7_spi->spid); + cntlr.status = (uint8_t *)&ich7_spi->spis; + cntlr.control = &ich7_spi->spic; + cntlr.bbar = &ich7_spi->bbar; + cntlr.preop = &ich7_spi->preop; + break; + } + case 9: + { + const uint16_t ich9_spibar_offset = 0x3800; + ich9_spi_regs *ich9_spi = + (ich9_spi_regs *)(rcrb + ich9_spibar_offset); + ichspi_lock = readw_(&ich9_spi->hsfs) & HSFS_FLOCKDN; + cntlr.opmenu = ich9_spi->opmenu; + cntlr.menubytes = sizeof(ich9_spi->opmenu); + cntlr.optype = &ich9_spi->optype; + cntlr.addr = &ich9_spi->faddr; + cntlr.data = (uint8_t *)ich9_spi->fdata; + cntlr.databytes = sizeof(ich9_spi->fdata); + cntlr.status = &ich9_spi->ssfs; + cntlr.control = (uint16_t *)ich9_spi->ssfc; + cntlr.bbar = &ich9_spi->bbar; + cntlr.preop = &ich9_spi->preop; + break; + } + default: + printk(BIOS_DEBUG, "ICH SPI: Unrecognized ICH version %d.\n", ich_version); + } + + ich_set_bbar(0); + + /* Disable the BIOS write protect so write commands are allowed. */ + pci_read_config_byte(dev, 0xdc, &bios_cntl); + switch (ich_version) { + case 9: + /* Deassert SMM BIOS Write Protect Disable. */ + bios_cntl &= ~(1 << 5); + break; + + default: + break; + } + pci_write_config_byte(dev, 0xdc, bios_cntl | 0x1); +} + +int spi_claim_bus(struct spi_slave *slave) +{ + /* Handled by ICH automatically. */ + return 0; +} + +void spi_release_bus(struct spi_slave *slave) +{ + /* Handled by ICH automatically. */ +} + +void spi_cs_activate(struct spi_slave *slave) +{ + /* Handled by ICH automatically. */ +} + +void spi_cs_deactivate(struct spi_slave *slave) +{ + /* Handled by ICH automatically. */ +} + +typedef struct spi_transaction { + const uint8_t *out; + uint32_t bytesout; + uint8_t *in; + uint32_t bytesin; + uint8_t type; + uint8_t opcode; + uint32_t offset; +} spi_transaction; + +static inline void spi_use_out(spi_transaction *trans, unsigned bytes) +{ + trans->out += bytes; + trans->bytesout -= bytes; +} + +static inline void spi_use_in(spi_transaction *trans, unsigned bytes) +{ + trans->in += bytes; + trans->bytesin -= bytes; +} + +static void spi_setup_type(spi_transaction *trans) +{ + trans->type = 0xFF; + + /* Try to guess spi type from read/write sizes. */ + if (trans->bytesin == 0) { + if (trans->bytesout > 4) + /* + * If bytesin = 0 and bytesout > 4, we presume this is + * a write data operation, which is accompanied by an + * address. + */ + trans->type = SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS; + else + trans->type = SPI_OPCODE_TYPE_WRITE_NO_ADDRESS; + return; + } + + if (trans->bytesout == 1) { /* and bytesin is > 0 */ + trans->type = SPI_OPCODE_TYPE_READ_NO_ADDRESS; + return; + } + + if (trans->bytesout == 4) { /* and bytesin is > 0 */ + trans->type = SPI_OPCODE_TYPE_READ_WITH_ADDRESS; + } + + /* Fast read command is called with 5 bytes instead of 4 */ + if (trans->out[0] == SPI_OPCODE_FAST_READ && trans->bytesout == 5) { + trans->type = SPI_OPCODE_TYPE_READ_WITH_ADDRESS; + --trans->bytesout; + } +} + +static int spi_setup_opcode(spi_transaction *trans) +{ + uint16_t optypes; + uint8_t opmenu[cntlr.menubytes]; + + trans->opcode = trans->out[0]; + spi_use_out(trans, 1); + if (!ichspi_lock) { + /* The lock is off, so just use index 0. */ + writeb_(trans->opcode, cntlr.opmenu); + optypes = readw_(cntlr.optype); + optypes = (optypes & 0xfffc) | (trans->type & 0x3); + writew_(optypes, cntlr.optype); + return 0; + } else { + /* The lock is on. See if what we need is on the menu. */ + uint8_t optype; + uint16_t opcode_index; + + /* Write Enable is handled as atomic prefix */ + if (trans->opcode == SPI_OPCODE_WREN) + return 0; + + read_reg(cntlr.opmenu, opmenu, sizeof(opmenu)); + for (opcode_index = 0; opcode_index < cntlr.menubytes; + opcode_index++) { + if (opmenu[opcode_index] == trans->opcode) + break; + } + + if (opcode_index == cntlr.menubytes) { + printk(BIOS_DEBUG, "ICH SPI: Opcode %x not found\n", + trans->opcode); + return -1; + } + + optypes = readw_(cntlr.optype); + optype = (optypes >> (opcode_index * 2)) & 0x3; + if (trans->type == SPI_OPCODE_TYPE_WRITE_NO_ADDRESS && + optype == SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS && + trans->bytesout >= 3) { + /* We guessed wrong earlier. Fix it up. */ + trans->type = optype; + } + if (optype != trans->type) { + printk(BIOS_DEBUG, "ICH SPI: Transaction doesn't fit type %d\n", + optype); + return -1; + } + return opcode_index; + } +} + +static int spi_setup_offset(spi_transaction *trans) +{ + /* Separate the SPI address and data. */ + switch (trans->type) { + case SPI_OPCODE_TYPE_READ_NO_ADDRESS: + case SPI_OPCODE_TYPE_WRITE_NO_ADDRESS: + return 0; + case SPI_OPCODE_TYPE_READ_WITH_ADDRESS: + case SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS: + trans->offset = ((uint32_t)trans->out[0] << 16) | + ((uint32_t)trans->out[1] << 8) | + ((uint32_t)trans->out[2] << 0); + spi_use_out(trans, 3); + return 1; + default: + printk(BIOS_DEBUG, "Unrecognized SPI transaction type %#x\n", trans->type); + return -1; + } +} + +/* + * Wait for up to 60ms til status register bit(s) turn 1 (in case wait_til_set + * below is True) or 0. In case the wait was for the bit(s) to set - write + * those bits back, which would cause resetting them. + * + * Return the last read status value on success or -1 on failure. + */ +static int ich_status_poll(u16 bitmask, int wait_til_set) +{ + int timeout = 6000; /* This will result in 60 ms */ + u16 status = 0; + + while (timeout--) { + status = readw_(cntlr.status); + if (wait_til_set ^ ((status & bitmask) == 0)) { + if (wait_til_set) + writew_((status & bitmask), cntlr.status); + return status; + } + udelay(10); + } + + printk(BIOS_DEBUG, "ICH SPI: SCIP timeout, read %x, expected %x\n", + status, bitmask); + return -1; +} + +int spi_xfer(struct spi_slave *slave, const void *dout, + unsigned int bitsout, void *din, unsigned int bitsin) +{ + uint16_t control; + int16_t opcode_index; + int with_address; + int status; + + spi_transaction trans = { + dout, bitsout / 8, + din, bitsin / 8, + 0xff, 0xff, 0 + }; + + /* There has to always at least be an opcode. */ + if (!bitsout || !dout) { + printk(BIOS_DEBUG, "ICH SPI: No opcode for transfer\n"); + return -1; + } + /* Make sure if we read something we have a place to put it. */ + if (bitsin != 0 && !din) { + printk(BIOS_DEBUG, "ICH SPI: Read but no target buffer\n"); + return -1; + } + /* Right now we don't support writing partial bytes. */ + if (bitsout % 8 || bitsin % 8) { + printk(BIOS_DEBUG, "ICH SPI: Accessing partial bytes not supported\n"); + return -1; + } + + if (ich_status_poll(SPIS_SCIP, 0) == -1) + return -1; + + writew_(SPIS_CDS | SPIS_FCERR, cntlr.status); + + spi_setup_type(&trans); + if ((opcode_index = spi_setup_opcode(&trans)) < 0) + return -1; + if ((with_address = spi_setup_offset(&trans)) < 0) + return -1; + + if (trans.opcode == SPI_OPCODE_WREN) { + /* + * Treat Write Enable as Atomic Pre-Op if possible + * in order to prevent the Management Engine from + * issuing a transaction between WREN and DATA. + */ + if (!ichspi_lock) + writew_(trans.opcode, cntlr.preop); + return 0; + } + + /* Preset control fields */ + control = SPIC_SCGO | ((opcode_index & 0x07) << 4); + + /* Issue atomic preop cycle if needed */ + if (readw_(cntlr.preop)) + control |= SPIC_ACS; + + if (!trans.bytesout && !trans.bytesin) { + /* SPI addresses are 24 bit only */ + if (with_address) + writel_(trans.offset & 0x00FFFFFF, cntlr.addr); + + /* + * This is a 'no data' command (like Write Enable), its + * bitesout size was 1, decremented to zero while executing + * spi_setup_opcode() above. Tell the chip to send the + * command. + */ + writew_(control, cntlr.control); + + /* wait for the result */ + status = ich_status_poll(SPIS_CDS | SPIS_FCERR, 1); + if (status == -1) + return -1; + + if (status & SPIS_FCERR) { + printk(BIOS_DEBUG, "ICH SPI: Command transaction error\n"); + return -1; + } + + return 0; + } + + /* + * Check if this is a write command atempting to transfer more bytes + * than the controller can handle. Iterations for writes are not + * supported here because each SPI write command needs to be preceded + * and followed by other SPI commands, and this sequence is controlled + * by the SPI chip driver. + */ + if (trans.bytesout > cntlr.databytes) { + printk(BIOS_DEBUG, "ICH SPI: Too much to write. Does your SPI chip driver use" + " CONTROLLER_PAGE_LIMIT?\n"); + return -1; + } + + /* + * Read or write up to databytes bytes at a time until everything has + * been sent. + */ + while (trans.bytesout || trans.bytesin) { + uint32_t data_length; + + /* SPI addresses are 24 bit only */ + writel_(trans.offset & 0x00FFFFFF, cntlr.addr); + + if (trans.bytesout) + data_length = min(trans.bytesout, cntlr.databytes); + else + data_length = min(trans.bytesin, cntlr.databytes); + + /* Program data into FDATA0 to N */ + if (trans.bytesout) { + write_reg(trans.out, cntlr.data, data_length); + spi_use_out(&trans, data_length); + if (with_address) + trans.offset += data_length; + } + + /* Add proper control fields' values */ + control &= ~((cntlr.databytes - 1) << 8); + control |= SPIC_DS; + control |= (data_length - 1) << 8; + + /* write it */ + writew_(control, cntlr.control); + + /* Wait for Cycle Done Status or Flash Cycle Error. */ + status = ich_status_poll(SPIS_CDS | SPIS_FCERR, 1); + if (status == -1) + return -1; + + if (status & SPIS_FCERR) { + printk(BIOS_DEBUG, "ICH SPI: Data transaction error\n"); + return -1; + } + + if (trans.bytesin) { + read_reg(cntlr.data, trans.in, data_length); + spi_use_in(&trans, data_length); + if (with_address) + trans.offset += data_length; + } + } + + /* Clear atomic preop now that xfer is done */ + writew_(0, cntlr.preop); + + return 0; +} diff --git a/src/southbridge/intel/lynxpoint/usb_debug.c b/src/southbridge/intel/lynxpoint/usb_debug.c new file mode 100644 index 0000000000..1cee353e2d --- /dev/null +++ b/src/southbridge/intel/lynxpoint/usb_debug.c @@ -0,0 +1,51 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> +#include <arch/io.h> +#include <arch/romcc_io.h> +#include <console/console.h> +#include <usbdebug.h> +#include <device/pci_def.h> +#include "pch.h" + +/* Required for successful build, but currently empty. */ +void set_debug_port(unsigned int port) +{ + /* Not needed, the ICH* southbridges hardcode physical USB port 1. */ +} + +void enable_usbdebug(unsigned int port) +{ + u32 dbgctl; + device_t dev = PCI_DEV(0, 0x1d, 7); /* USB EHCI, D29:F7 */ + + /* Set the EHCI BAR address. */ + pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR); + + /* Enable access to the EHCI memory space registers. */ + pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY); + + /* Force ownership of the Debug Port to the EHCI controller. */ + printk(BIOS_DEBUG, "Enabling OWNER_CNT\n"); + dbgctl = read32(CONFIG_EHCI_BAR + CONFIG_EHCI_DEBUG_OFFSET); + dbgctl |= (1 << 30); + write32(CONFIG_EHCI_BAR + CONFIG_EHCI_DEBUG_OFFSET, dbgctl); +} + diff --git a/src/southbridge/intel/lynxpoint/usb_ehci.c b/src/southbridge/intel/lynxpoint/usb_ehci.c new file mode 100644 index 0000000000..aec230cf85 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/usb_ehci.c @@ -0,0 +1,112 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include "pch.h" +#include <usbdebug.h> +#include <arch/io.h> + +static void usb_ehci_init(struct device *dev) +{ + u32 reg32; + + /* Disable Wake on Disconnect in RMH */ + reg32 = RCBA32(0x35b0); + reg32 |= 0x22; + RCBA32(0x35b0) = reg32; + + printk(BIOS_DEBUG, "EHCI: Setting up controller.. "); + reg32 = pci_read_config32(dev, PCI_COMMAND); + reg32 |= PCI_COMMAND_MASTER; + //reg32 |= PCI_COMMAND_SERR; + pci_write_config32(dev, PCI_COMMAND, reg32); + + printk(BIOS_DEBUG, "done.\n"); +} + +static void usb_ehci_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + u8 access_cntl; + + access_cntl = pci_read_config8(dev, 0x80); + + /* Enable writes to protected registers. */ + pci_write_config8(dev, 0x80, access_cntl | 1); + + if (!vendor || !device) { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + pci_read_config32(dev, PCI_VENDOR_ID)); + } else { + pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, + ((device & 0xffff) << 16) | (vendor & 0xffff)); + } + + /* Restore protection. */ + pci_write_config8(dev, 0x80, access_cntl); +} + +static void usb_ehci_set_resources(struct device *dev) +{ +#if CONFIG_USBDEBUG + struct resource *res; + u32 base; + u32 usb_debug; + + usb_debug = get_ehci_debug(); + set_ehci_debug(0); +#endif + pci_dev_set_resources(dev); + +#if CONFIG_USBDEBUG + res = find_resource(dev, 0x10); + set_ehci_debug(usb_debug); + if (!res) return; + base = res->base; + set_ehci_base(base); + report_resource_stored(dev, res, ""); +#endif +} + + + +static struct pci_operations lops_pci = { + .set_subsystem = &usb_ehci_set_subsystem, +}; + +static struct device_operations usb_ehci_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = usb_ehci_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = usb_ehci_init, + .scan_bus = 0, + .ops_pci = &lops_pci, +}; + +static const unsigned short pci_device_ids[] = { 0x1c26, 0x1c2d, 0x1e26, 0x1e2d, + 0 }; + +static const struct pci_driver pch_usb_ehci __pci_driver = { + .ops = &usb_ehci_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .devices = pci_device_ids, +}; diff --git a/src/southbridge/intel/lynxpoint/watchdog.c b/src/southbridge/intel/lynxpoint/watchdog.c new file mode 100644 index 0000000000..b6d9223113 --- /dev/null +++ b/src/southbridge/intel/lynxpoint/watchdog.c @@ -0,0 +1,59 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <console/console.h> +#include <arch/io.h> +#include <device/device.h> +#include <device/pci.h> +#include <watchdog.h> + + // + // Disable PCH Watchdog timer at SB_RCBA+0x3410 + // + // Mmio32((MmPci32(0, 0, 0x1F, 0, 0xF0) & ~BIT0), 0x3410) |= 0x20; + // +void watchdog_off(void) +{ + device_t dev; + unsigned long value, base; + + /* Turn off the ICH7 watchdog. */ + dev = dev_find_slot(0, PCI_DEVFN(0x1f, 0)); + + /* Enable I/O space. */ + value = pci_read_config16(dev, 0x04); + value |= (1 << 10); + pci_write_config16(dev, 0x04, value); + + /* Get TCO base. */ + base = (pci_read_config32(dev, 0x40) & 0x0fffe) + 0x60; + + /* Disable the watchdog timer. */ + value = inw(base + 0x08); + value |= 1 << 11; + outw(value, base + 0x08); + + /* Clear TCO timeout status. */ + outw(0x0008, base + 0x04); + outw(0x0002, base + 0x06); + + printk(BIOS_DEBUG, "PCH watchdog disabled\n"); +} |