blob: d8e4f057908cd37cf6661dff0137487837e0384f [file] [log] [blame]
Frank Vibrans69da1b62011-02-14 19:04:45 +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.
Frank Vibrans69da1b62011-02-14 19:04:45 +000014 */
15
16#include <console/console.h>
17#include <device/device.h>
18#include <device/pci.h>
19#include <arch/io.h>
Frank Vibrans69da1b62011-02-14 19:04:45 +000020#include <cpu/x86/msr.h>
21#include <cpu/amd/mtrr.h>
22#include <device/pci_def.h>
Kimarie Hoot31c5e072013-03-06 16:18:09 -070023#include <southbridge/amd/sb800/sb800.h>
Kerry Sheh19329c92012-01-19 13:18:36 +080024#include "SBPLATFORM.h" /* Platfrom Specific Definitions */
Frank Vibrans69da1b62011-02-14 19:04:45 +000025
Jens Rottmann27a1be92013-04-03 10:12:55 +020026void broadcom_init(void);
Kerry Sheh01f7ab92012-01-19 13:18:36 +080027void set_pcie_reset(void);
28void set_pcie_dereset(void);
Frank Vibrans69da1b62011-02-14 19:04:45 +000029
30/**
31 * TODO
32 * SB CIMx callback
33 */
34void set_pcie_reset(void)
35{
36}
37
38/**
Frank Vibrans69da1b62011-02-14 19:04:45 +000039 * mainboard specific SB CIMx callback
40 */
41void set_pcie_dereset(void)
42{
Kerry Sheh19329c92012-01-19 13:18:36 +080043 /**
44 * GPIO32 Pcie Device DeAssert for APU
45 * GPIO25 Pcie LAN, APU GPP2
46 * GPIO02 MINIPCIE SLOT1, APU GPP3
47 * GPIO50 Pcie Device DeAssert for Hudson Southbridge
48 * GPIO05 Express Card, SB GPP0
49 * GPIO26 NEC USB3.0GPPUSB, SB GPP1
50 * GPIO00 MINIPCIE SLOT2, SB GPP2
51 * GPIO05 Pcie X1 Slot, SB GPP3
52 */
53
54 /* Multi-function pins switch to GPIO0-35, these pins are shared with
55 * PCI pins, make sure Husson PCI device is disabled.
56 */
57 RWMEM(ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEA, AccWidthUint8, ~BIT0, 1);
58
59 /* select IOMux to function1/2, corresponds to GPIO */
60 RWMEM(ACPI_MMIO_BASE + IOMUX_BASE + SB_GPIO_REG32, AccWidthUint8, ~(BIT0 | BIT1), 1);
61 RWMEM(ACPI_MMIO_BASE + IOMUX_BASE + SB_GPIO_REG50, AccWidthUint8, ~(BIT0 | BIT1), 2);
62
63
64 /* output low */
65 RWMEM(ACPI_MMIO_BASE + GPIO_BASE + SB_GPIO_REG32, AccWidthUint8, ~(0xFF), 0x48);
66 RWMEM(ACPI_MMIO_BASE + GPIO_BASE + SB_GPIO_REG50, AccWidthUint8, ~(0xFF), 0x48);
Frank Vibrans69da1b62011-02-14 19:04:45 +000067}
68
Frank Vibrans69da1b62011-02-14 19:04:45 +000069
Jens Rottmann5e707662013-02-26 15:56:11 +010070/**********************************************
71 * Enable the dedicated functions of the board.
72 **********************************************/
Paul Menzel528640d2013-02-23 21:31:23 +010073static void mainboard_enable(device_t dev)
Frank Vibrans69da1b62011-02-14 19:04:45 +000074{
Kerry Sheh01f7ab92012-01-19 13:18:36 +080075 printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
76
Kerry Sheh19329c92012-01-19 13:18:36 +080077 /* Inagua mainboard specific setting */
78 set_pcie_dereset();
Kimarie Hoot31c5e072013-03-06 16:18:09 -070079
80 /*
81 * Initialize ASF registers to an arbitrary address because someone
82 * long ago set things up this way inside the SPD read code. The
83 * SPD read code has been made generic and moved out of the board
84 * directory, so the ASF init is being done here.
85 */
86 pm_iowrite(0x29, 0x80);
87 pm_iowrite(0x28, 0x61);
Jens Rottmann3926b4c2013-03-01 19:41:41 +010088
89 /* Upload AMD A55E GbE 'NV'RAM contents. Still untested on Inagua.
90 * After anyone can confirm it works please uncomment the call. */
91 //broadcom_init();
Frank Vibrans69da1b62011-02-14 19:04:45 +000092}
93
Frank Vibrans69da1b62011-02-14 19:04:45 +000094struct chip_operations mainboard_ops = {
Jens Rottmann5e707662013-02-26 15:56:11 +010095 .enable_dev = mainboard_enable,
Frank Vibrans69da1b62011-02-14 19:04:45 +000096};