blob: bf04d302cee5c8b4006694bf77825b6fce39c6cb [file] [log] [blame]
zbao323a9232012-07-19 16:39:01 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 Advanced Micro Devices, Inc.
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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <console/console.h>
21#include <device/device.h>
22#include <device/pci.h>
23#include <arch/io.h>
24#include <boot/tables.h>
25#include <cpu/x86/msr.h>
26#include <cpu/amd/mtrr.h>
27#include <device/pci_def.h>
28#include <arch/acpi.h>
29#include "BiosCallOuts.h"
30#include <cpu/amd/agesa/s3_resume.h>
31#include "chip.h"
32#include "agesawrapper.h"
33
34/*************************************************
35 * enable the dedicated function in parmer board.
36 *************************************************/
37static void parmer_enable(device_t dev)
38{
39 printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
40 /*
41 * The mainboard is the first place that we get control in ramstage. Check
42 * for S3 resume and call the approriate AGESA/CIMx resume functions.
43 */
44#if CONFIG_HAVE_ACPI_RESUME == 1
45 acpi_slp_type = acpi_get_sleep_type();
46 if (acpi_slp_type == 3)
47 agesawrapper_fchs3earlyrestore();
48
49#endif
50 setup_uma_memory();
51}
52
53int add_mainboard_resources(struct lb_memory *mem)
54{
55 /* UMA is removed from system memory in the northbridge code, but
56 * in some circumstances we want the memory mentioned as reserved.
57 */
zbaod59d6242012-07-23 19:41:03 +080058 /* TODO: Check out why it was commented. */
59#if CONFIG_GFXUMA
zbao323a9232012-07-19 16:39:01 +080060 printk(BIOS_INFO, "uma_memory_start=0x%llx, uma_memory_size=0x%llx \n",
61 uma_memory_base, uma_memory_size);
62 lb_add_memory_range(mem, LB_MEM_RESERVED, uma_memory_base,
63 uma_memory_size);
64#endif
65 return 0;
66}
67struct chip_operations mainboard_ops = {
68 CHIP_NAME(CONFIG_MAINBOARD_VENDOR " " CONFIG_MAINBOARD_PART_NUMBER " Mainboard")
69 .enable_dev = parmer_enable,
70};