Stefan Reinauer | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008-2009 coresystems GmbH |
| 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 | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <arch/io.h> |
Stefan Reinauer | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 17 | #include <console/console.h> |
| 18 | #include <cpu/x86/smm.h> |
| 19 | #include <southbridge/intel/bd82x6x/nvs.h> |
| 20 | #include <southbridge/intel/bd82x6x/pch.h> |
| 21 | #include <southbridge/intel/bd82x6x/me.h> |
| 22 | #include <northbridge/intel/sandybridge/sandybridge.h> |
| 23 | #include <cpu/intel/model_206ax/model_206ax.h> |
| 24 | |
| 25 | /* Include EC functions */ |
| 26 | #include <ec/quanta/ene_kb3940q/ec.h> |
| 27 | #include "ec.h" |
| 28 | |
Duncan Laurie | 0edc224 | 2013-04-29 15:04:30 -0700 | [diff] [blame] | 29 | void mainboard_smi_gpi(u32 gpi_sts) |
Stefan Reinauer | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 30 | { |
| 31 | printk(BIOS_DEBUG, "warn: unknown mainboard_smi_gpi: %x\n", gpi_sts); |
| 32 | } |
| 33 | |
| 34 | void mainboard_smi_sleep(u8 slp_typ) |
| 35 | { |
| 36 | printk(BIOS_DEBUG, "mainboard_smi_sleep: %x\n", slp_typ); |
| 37 | |
| 38 | /* Tell the EC to Enable USB power for S3 if requested */ |
| 39 | if (smm_get_gnvs()->s3u0 != 0 || smm_get_gnvs()->s3u1 != 0) |
| 40 | ec_mem_write(EC_EC_PSW, ec_mem_read(EC_EC_PSW) | EC_PSW_USB); |
| 41 | |
| 42 | /* Disable wake on USB, LAN & RTC */ |
| 43 | /* Enable Wake from Keyboard */ |
| 44 | if ((slp_typ == 4) || (slp_typ == 5)) { |
| 45 | printk(BIOS_DEBUG, "Disabling wake on RTC\n"); |
| 46 | ec_mem_write(EC_EC_PSW, EC_PSW_IKB); |
| 47 | } |
| 48 | } |
| 49 | |
Stefan Reinauer | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 50 | #define APMC_ACPI_EN 0xe1 |
| 51 | #define APMC_ACPI_DIS 0x1e |
| 52 | |
Stefan Reinauer | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 53 | int mainboard_smi_apmc(u8 apmc) |
| 54 | { |
| 55 | printk(BIOS_DEBUG, "mainboard_smi_apmc: %x\n", apmc); |
| 56 | switch (apmc) { |
Stefan Reinauer | d7bd4eb | 2013-02-11 11:11:36 -0800 | [diff] [blame] | 57 | case APMC_ACPI_EN: |
| 58 | printk(BIOS_DEBUG, "APMC: ACPI_EN\n"); |
| 59 | /* Clear all pending events and enable SCI */ |
| 60 | ec_write_cmd(EC_CMD_ENABLE_ACPI_MODE); |
| 61 | break; |
| 62 | |
| 63 | case APMC_ACPI_DIS: |
| 64 | printk(BIOS_DEBUG, "APMC: ACPI_DIS\n"); |
| 65 | /* Clear all pending events and tell the EC that ACPI is disabled */ |
| 66 | ec_write_cmd(EC_CMD_DISABLE_ACPI_MODE); |
| 67 | break; |
| 68 | } |
| 69 | return 0; |
| 70 | } |