QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 1 | /* |
| 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 Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <device/device.h> |
| 18 | #include <device/pci.h> |
| 19 | #include <arch/io.h> |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 20 | #include <cpu/x86/msr.h> |
| 21 | #include <cpu/amd/mtrr.h> |
| 22 | #include <device/pci_def.h> |
| 23 | #include "SBPLATFORM.h" |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 24 | |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 25 | |
| 26 | u8 is_dev3_present(void); |
| 27 | void set_pcie_dereset(void); |
| 28 | void set_pcie_reset(void); |
| 29 | void enable_int_gfx(void); |
| 30 | |
| 31 | /* GPIO6. */ |
| 32 | void enable_int_gfx(void) |
| 33 | { |
| 34 | volatile u8 *gpio_reg; |
| 35 | |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 36 | /* 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 | |
| 50 | void set_pcie_dereset() |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | void set_pcie_reset(void) |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | u8 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 Menzel | 528640d | 2013-02-23 21:31:23 +0100 | [diff] [blame] | 68 | static void mainboard_enable(device_t dev) |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 69 | { |
| 70 | |
| 71 | printk(BIOS_INFO, "Mainboard ASUS M5A88-V Enable. dev=0x%p\n", dev); |
| 72 | |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 73 | set_pcie_dereset(); |
| 74 | enable_int_gfx(); |
| 75 | } |
| 76 | |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 77 | struct chip_operations mainboard_ops = { |
Paul Menzel | 528640d | 2013-02-23 21:31:23 +0100 | [diff] [blame] | 78 | .enable_dev = mainboard_enable, |
QingPei Wang | cc66d97 | 2011-09-13 17:54:12 +0800 | [diff] [blame] | 79 | }; |