blob: 6a037cf4e811203458670bc0a9cccaaaf3e80a8b [file] [log] [blame]
Zheng Baod0985752011-01-20 04:45:48 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 Advanced Micro Devices, Inc.
Timothy Pearson83abd812015-06-08 19:35:06 -05005 * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
Zheng Baod0985752011-01-20 04:45:48 +00006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Zheng Baod0985752011-01-20 04:45:48 +000015 */
16
17#ifndef SB800_H
18#define SB800_H
19
20#include <device/pci_ids.h>
21#include "chip.h"
22
23/* Power management index/data registers */
Zheng Baoa4da2542011-01-20 05:59:22 +000024#define BIOSRAM_INDEX 0xcd4
25#define BIOSRAM_DATA 0xcd5
Zheng Baod0985752011-01-20 04:45:48 +000026#define PM_INDEX 0xcd6
27#define PM_DATA 0xcd7
28#define PM2_INDEX 0xcd0
29#define PM2_DATA 0xcd1
30
31#define SB800_ACPI_IO_BASE 0x800
32
33#define ACPI_PM_EVT_BLK (SB800_ACPI_IO_BASE + 0x00) /* 4 bytes */
34#define ACPI_PM1_CNT_BLK (SB800_ACPI_IO_BASE + 0x04) /* 2 bytes */
Timothy Pearson83abd812015-06-08 19:35:06 -050035#define ACPI_PMA_CNT_BLK (SB800_ACPI_IO_BASE + 0x17) /* 1 byte */
36#define ACPI_PM_TMR_BLK (SB800_ACPI_IO_BASE + 0x20) /* 4 bytes */
37#define ACPI_GPE0_BLK (SB800_ACPI_IO_BASE + 0x18) /* 8 bytes */
Zheng Baod0985752011-01-20 04:45:48 +000038#define ACPI_CPU_CONTROL (SB800_ACPI_IO_BASE + 0x08) /* 6 bytes */
Timothy Pearson83abd812015-06-08 19:35:06 -050039#define ACPI_CPU_P_LVL2 (ACPI_CPU_CONTROL + 0x4) /* 1 byte */
Zheng Baod0985752011-01-20 04:45:48 +000040
Stefan Reinauer1c2734f2011-01-28 01:06:39 +000041void pm_iowrite(u8 reg, u8 value);
42u8 pm_ioread(u8 reg);
43void pm2_iowrite(u8 reg, u8 value);
44u8 pm2_ioread(u8 reg);
45void set_sm_enable_bits(device_t sm_dev, u32 reg_pos, u32 mask, u32 val);
Zheng Baod0985752011-01-20 04:45:48 +000046
47#define REV_SB800_A11 0x11
48#define REV_SB800_A12 0x12
49
Zheng Baoa4da2542011-01-20 05:59:22 +000050
Zheng Bao79c04d52011-01-20 05:41:11 +000051#ifdef __PRE_RAM__
52void sb800_lpc_port80(void);
53void sb800_pci_port80(void);
54void sb800_clk_output_48Mhz(void);
Zheng Baod0985752011-01-20 04:45:48 +000055
Zheng Baoa4da2542011-01-20 05:59:22 +000056int s3_save_nvram_early(u32 dword, int size, int nvram_pos);
57int s3_load_nvram_early(int size, u32 *old_dword, int nvram_pos);
58
Stefan Reinauer1c2734f2011-01-28 01:06:39 +000059#else
60void sb800_enable(device_t dev);
Stefan Reinauer1c2734f2011-01-28 01:06:39 +000061#endif
Zheng Baod0985752011-01-20 04:45:48 +000062
63#endif /* SB800_H */