blob: 0af8ba7518220cc672fe03fa2f23f11944aa18e0 [file] [log] [blame]
Kerry She6401fdb2011-05-07 09:15:02 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 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>
Kerry She6401fdb2011-05-07 09:15:02 +000024#include <cpu/x86/msr.h>
25#include <cpu/amd/mtrr.h>
26#include <device/pci_def.h>
Kerry Shefeed3292011-08-18 18:03:44 +080027#include "SBPLATFORM.h"
Kerry She6401fdb2011-05-07 09:15:02 +000028
Kerry She6401fdb2011-05-07 09:15:02 +000029
30u8 is_dev3_present(void);
31void set_pcie_dereset(void);
32void set_pcie_reset(void);
33void enable_int_gfx(void);
34
35/* GPIO6. */
36void enable_int_gfx(void)
37{
Kerry She6401fdb2011-05-07 09:15:02 +000038 volatile u8 *gpio_reg;
39
Kerry Shefeed3292011-08-18 18:03:44 +080040#ifdef UNUSED_CODE
41 RWPMIO(SB_PMIOA_REGEA, AccWidthUint8, ~(BIT0), BIT0); /* Disable the PCIB */
42 RWPMIO(SB_PMIOA_REGF6, AccWidthUint8, ~(BIT0), BIT0); /* Disable Gec */
43#endif
44 /* make sure the Acpi MMIO(fed80000) is accessible */
45 RWPMIO(SB_PMIOA_REG24, AccWidthUint8, ~(BIT0), BIT0);
Kerry She6401fdb2011-05-07 09:15:02 +000046
Kerry Shefeed3292011-08-18 18:03:44 +080047 gpio_reg = (volatile u8 *)ACPI_MMIO_BASE + 0xD00; /* IoMux Register */
Kerry She6401fdb2011-05-07 09:15:02 +000048
49 *(gpio_reg + 0x6) = 0x1; /* Int_vga_en */
50 *(gpio_reg + 170) = 0x1; /* gpio_gate */
51
Kerry Shefeed3292011-08-18 18:03:44 +080052 gpio_reg = (volatile u8 *)ACPI_MMIO_BASE + 0x100; /* GPIO Registers */
Kerry She6401fdb2011-05-07 09:15:02 +000053
54 *(gpio_reg + 0x6) = 0x8;
55 *(gpio_reg + 170) = 0x0;
56}
57
58void set_pcie_dereset()
59{
60}
61
62void set_pcie_reset(void)
63{
64}
65
66u8 is_dev3_present(void)
67{
68 return 0;
69}
70
71
72/*************************************************
73* enable the dedicated function in A785E-I board.
74* This function called early than rs780_enable.
75*************************************************/
Paul Menzel528640d2013-02-23 21:31:23 +010076static void mainboard_enable(device_t dev)
Kerry She6401fdb2011-05-07 09:15:02 +000077{
Kerry She6401fdb2011-05-07 09:15:02 +000078 printk(BIOS_INFO, "Mainboard A785E-I Enable. dev=0x%p\n", dev);
79
Kerry She6401fdb2011-05-07 09:15:02 +000080 set_pcie_dereset();
81 enable_int_gfx();
82}
83
Kerry She6401fdb2011-05-07 09:15:02 +000084struct chip_operations mainboard_ops = {
Paul Menzel528640d2013-02-23 21:31:23 +010085 .enable_dev = mainboard_enable,
Kerry She6401fdb2011-05-07 09:15:02 +000086};