blob: 452d50fe4076c04aeaca93f32e1ce4eb072772f2 [file] [log] [blame]
Scott Duplichana649a962011-02-24 05:00:33 +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.
Scott Duplichana649a962011-02-24 05:00:33 +000014 */
15
16#include <console/console.h>
17#include <device/device.h>
18#include <device/pci.h>
19#include <arch/io.h>
Scott Duplichana649a962011-02-24 05:00:33 +000020#include <cpu/x86/msr.h>
21#include <cpu/amd/mtrr.h>
22#include <device/pci_def.h>
Paul Menzel22bbb692013-03-29 15:39:54 +010023#include <southbridge/amd/cimx/cimx_util.h>
Felix Helddfb53ef2015-10-11 13:24:40 +020024#include "SBPLATFORM.h"
Scott Duplichana649a962011-02-24 05:00:33 +000025
26//#define SMBUS_IO_BASE 0x6000
Paul Menzela4b802c2013-03-06 18:42:02 +010027void set_pcie_reset(void);
28void set_pcie_dereset(void);
Scott Duplichana649a962011-02-24 05:00:33 +000029
30/**
31 * TODO
32 * SB CIMx callback
33 */
34void set_pcie_reset(void)
35{
36}
37
38/**
39 * TODO
40 * mainboard specific SB CIMx callback
41 */
42void set_pcie_dereset(void)
43{
44}
45
Scott Duplichana649a962011-02-24 05:00:33 +000046
Jens Rottmann5e707662013-02-26 15:56:11 +010047/**********************************************
48 * Enable the dedicated functions of the board.
49 **********************************************/
Paul Menzel528640d2013-02-23 21:31:23 +010050static void mainboard_enable(device_t dev)
Scott Duplichana649a962011-02-24 05:00:33 +000051{
Scott Duplichan63896e72011-02-26 17:49:49 +000052 printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
Jens Rottmanndb6c5bf2013-03-21 22:21:28 +010053
Felix Helddfb53ef2015-10-11 13:24:40 +020054 /* 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 Rottmanndb6c5bf2013-03-21 22:21:28 +010068 /*
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 Duplichana649a962011-02-24 05:00:33 +000076}
77
Scott Duplichana649a962011-02-24 05:00:33 +000078struct chip_operations mainboard_ops = {
Paul Menzel528640d2013-02-23 21:31:23 +010079 .enable_dev = mainboard_enable,
Scott Duplichana649a962011-02-24 05:00:33 +000080};