blob: 941ba26afec216817b303e01e0139ed6adb4fb61 [file] [log] [blame]
QingPei Wangcc66d972011-09-13 17:54:12 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 QingPei Wang <wangqingpei@gmail.com>
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.
QingPei Wangcc66d972011-09-13 17:54:12 +080014 */
15
16#include <console/console.h>
17#include <device/device.h>
18#include <device/pci.h>
19#include <arch/io.h>
QingPei Wangcc66d972011-09-13 17:54:12 +080020#include <cpu/x86/msr.h>
21#include <cpu/amd/mtrr.h>
22#include <device/pci_def.h>
23#include "SBPLATFORM.h"
QingPei Wangcc66d972011-09-13 17:54:12 +080024
QingPei Wangcc66d972011-09-13 17:54:12 +080025
26u8 is_dev3_present(void);
27void set_pcie_dereset(void);
28void set_pcie_reset(void);
29void enable_int_gfx(void);
30
31/* GPIO6. */
32void enable_int_gfx(void)
33{
34 volatile u8 *gpio_reg;
35
QingPei Wangcc66d972011-09-13 17:54:12 +080036 /* make sure the MMIO(fed80000) is accessible */
37 RWPMIO(SB_PMIOA_REG24, AccWidthUint8, ~(BIT0), BIT0);
38
39 gpio_reg = (volatile u8 *)ACPI_MMIO_BASE + 0xD00; /* IoMux Register */
40
41 *(gpio_reg + 0x6) = 0x1; /* Int_vga_en */
42 *(gpio_reg + 170) = 0x1; /* gpio_gate */
43
44 gpio_reg = (volatile u8 *)ACPI_MMIO_BASE + 0x100; /* GPIO Registers */
45
46 *(gpio_reg + 0x6) = 0x8;
47 *(gpio_reg + 170) = 0x0;
48}
49
50void set_pcie_dereset()
51{
52}
53
54void set_pcie_reset(void)
55{
56}
57
58u8 is_dev3_present(void)
59{
60 return 0;
61}
62
63
64/*************************************************
65* enable the dedicated function in M5A88-V board.
66* This function called early than rs780_enable.
67*************************************************/
Paul Menzel528640d2013-02-23 21:31:23 +010068static void mainboard_enable(device_t dev)
QingPei Wangcc66d972011-09-13 17:54:12 +080069{
70
71 printk(BIOS_INFO, "Mainboard ASUS M5A88-V Enable. dev=0x%p\n", dev);
72
QingPei Wangcc66d972011-09-13 17:54:12 +080073 set_pcie_dereset();
74 enable_int_gfx();
75}
76
QingPei Wangcc66d972011-09-13 17:54:12 +080077struct chip_operations mainboard_ops = {
Paul Menzel528640d2013-02-23 21:31:23 +010078 .enable_dev = mainboard_enable,
QingPei Wangcc66d972011-09-13 17:54:12 +080079};