Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 1 | /* |
| 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. |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <device/device.h> |
| 18 | #include <device/pci.h> |
| 19 | #include <arch/io.h> |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 20 | #include <cpu/x86/msr.h> |
| 21 | #include <cpu/amd/mtrr.h> |
| 22 | #include <device/pci_def.h> |
Paul Menzel | 22bbb69 | 2013-03-29 15:39:54 +0100 | [diff] [blame] | 23 | #include <southbridge/amd/cimx/cimx_util.h> |
Felix Held | dfb53ef | 2015-10-11 13:24:40 +0200 | [diff] [blame] | 24 | #include "SBPLATFORM.h" |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 25 | |
| 26 | //#define SMBUS_IO_BASE 0x6000 |
Paul Menzel | a4b802c | 2013-03-06 18:42:02 +0100 | [diff] [blame] | 27 | void set_pcie_reset(void); |
| 28 | void set_pcie_dereset(void); |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * TODO |
| 32 | * SB CIMx callback |
| 33 | */ |
| 34 | void set_pcie_reset(void) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * TODO |
| 40 | * mainboard specific SB CIMx callback |
| 41 | */ |
| 42 | void set_pcie_dereset(void) |
| 43 | { |
| 44 | } |
| 45 | |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 46 | |
Jens Rottmann | 5e70766 | 2013-02-26 15:56:11 +0100 | [diff] [blame] | 47 | /********************************************** |
| 48 | * Enable the dedicated functions of the board. |
| 49 | **********************************************/ |
Paul Menzel | 528640d | 2013-02-23 21:31:23 +0100 | [diff] [blame] | 50 | static void mainboard_enable(device_t dev) |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 51 | { |
Scott Duplichan | 63896e7 | 2011-02-26 17:49:49 +0000 | [diff] [blame] | 52 | printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); |
Jens Rottmann | db6c5bf | 2013-03-21 22:21:28 +0100 | [diff] [blame] | 53 | |
Felix Held | dfb53ef | 2015-10-11 13:24:40 +0200 | [diff] [blame] | 54 | /* Power off unused clock pins of GPP PCIe devices */ |
| 55 | u8 *misc_mem_clk_cntrl = (u8 *)(ACPI_MMIO_BASE + MISC_BASE); |
| 56 | /* |
| 57 | * GPP CLK0 connected to unpopulated mini PCIe slot |
| 58 | * GPP CLK1 connected to ethernet chip |
| 59 | */ |
| 60 | write8(misc_mem_clk_cntrl + 0, 0xFF); |
| 61 | /* GPP CLK2 connected to the external USB3 controller */ |
| 62 | write8(misc_mem_clk_cntrl + 1, 0x0F); |
| 63 | write8(misc_mem_clk_cntrl + 2, 0x00); |
| 64 | write8(misc_mem_clk_cntrl + 3, 0x00); |
| 65 | /* SLT_GFX_CLK connected to PCIe slot */ |
| 66 | write8(misc_mem_clk_cntrl + 4, 0xF0); |
| 67 | |
Jens Rottmann | db6c5bf | 2013-03-21 22:21:28 +0100 | [diff] [blame] | 68 | /* |
| 69 | * Initialize ASF registers to an arbitrary address because someone |
| 70 | * long ago set things up this way inside the SPD read code. The |
| 71 | * SPD read code has been made generic and moved out of the board |
| 72 | * directory, so the ASF init is being done here. |
| 73 | */ |
| 74 | pm_iowrite(0x29, 0x80); |
| 75 | pm_iowrite(0x28, 0x61); |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 78 | struct chip_operations mainboard_ops = { |
Paul Menzel | 528640d | 2013-02-23 21:31:23 +0100 | [diff] [blame] | 79 | .enable_dev = mainboard_enable, |
Scott Duplichan | a649a96 | 2011-02-24 05:00:33 +0000 | [diff] [blame] | 80 | }; |