Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <types.h> |
| 17 | #include <string.h> |
| 18 | #include <cbmem.h> |
| 19 | #include <console/console.h> |
| 20 | #include <arch/acpi.h> |
| 21 | #include <arch/ioapic.h> |
| 22 | #include <arch/acpigen.h> |
| 23 | #include <arch/smp/mpspec.h> |
| 24 | #include <device/device.h> |
| 25 | #include <device/pci.h> |
| 26 | #include <device/pci_ids.h> |
| 27 | #include <cpu/x86/msr.h> |
| 28 | #include <vendorcode/google/chromeos/gnvs.h> |
| 29 | |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 30 | #include "southbridge/intel/bd82x6x/nvs.h" |
| 31 | #include "thermal.h" |
| 32 | |
| 33 | static global_nvs_t *gnvs_; |
| 34 | |
| 35 | static void acpi_update_thermal_table(global_nvs_t *gnvs) |
| 36 | { |
| 37 | gnvs->f4of = FAN4_THRESHOLD_OFF; |
| 38 | gnvs->f4on = FAN4_THRESHOLD_ON; |
| 39 | gnvs->f4pw = FAN4_PWM; |
| 40 | |
| 41 | gnvs->f3of = FAN3_THRESHOLD_OFF; |
| 42 | gnvs->f3on = FAN3_THRESHOLD_ON; |
| 43 | gnvs->f3pw = FAN3_PWM; |
| 44 | |
| 45 | gnvs->f2of = FAN2_THRESHOLD_OFF; |
| 46 | gnvs->f2on = FAN2_THRESHOLD_ON; |
| 47 | gnvs->f2pw = FAN2_PWM; |
| 48 | |
| 49 | gnvs->f1of = FAN1_THRESHOLD_OFF; |
| 50 | gnvs->f1on = FAN1_THRESHOLD_ON; |
| 51 | gnvs->f1pw = FAN1_PWM; |
| 52 | |
| 53 | gnvs->f0of = FAN0_THRESHOLD_OFF; |
| 54 | gnvs->f0on = FAN0_THRESHOLD_ON; |
| 55 | gnvs->f0pw = FAN0_PWM; |
| 56 | |
| 57 | gnvs->tcrt = CRITICAL_TEMPERATURE; |
| 58 | gnvs->tpsv = PASSIVE_TEMPERATURE; |
| 59 | gnvs->tmax = MAX_TEMPERATURE; |
| 60 | } |
| 61 | |
Vladimir Serbinenko | 35c0f43 | 2014-09-02 22:25:36 +0200 | [diff] [blame] | 62 | void acpi_create_gnvs(global_nvs_t *gnvs) |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 63 | { |
| 64 | gnvs_ = gnvs; |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 65 | |
| 66 | /* Enable USB ports in S3 */ |
| 67 | gnvs->s3u0 = 1; |
| 68 | gnvs->s3u1 = 1; |
| 69 | |
| 70 | /* |
| 71 | * Enable Front USB ports in S5 by default |
| 72 | * to be consistent with back port behavior |
| 73 | */ |
| 74 | gnvs->s5u0 = 1; |
| 75 | gnvs->s5u1 = 1; |
| 76 | |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 77 | |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 78 | acpi_update_thermal_table(gnvs); |
| 79 | |
| 80 | // Stumpy has no arms^H^H^H^HEC. |
| 81 | gnvs->chromeos.vbt2 = ACTIVE_ECFW_RO; |
| 82 | } |