northbridge/amd/agesa/family15rl: Provide Richland support
Provide our current development support for Richland. We would however like to see a unification of 'northbridge/amd/agesa' instead of another copy-paste merged. Change-Id: I88005939844d1132cfd3531a9d47389320026814 Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/7536 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
parent
d305aa6fc4
commit
12bb8f97b6
|
@ -24,7 +24,9 @@
|
|||
#include "Porting.h"
|
||||
#include "AGESA.h"
|
||||
|
||||
#if CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN || CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
|
||||
#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN) || \
|
||||
IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_RL) || \
|
||||
IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY16_KB)
|
||||
|
||||
#define BIOS_HEAP_START_ADDRESS 0x010000000
|
||||
#define BIOS_HEAP_SIZE 0x30000
|
||||
|
|
|
@ -36,6 +36,7 @@ source src/northbridge/amd/agesa/family12/Kconfig
|
|||
source src/northbridge/amd/agesa/family14/Kconfig
|
||||
source src/northbridge/amd/agesa/family15/Kconfig
|
||||
source src/northbridge/amd/agesa/family15tn/Kconfig
|
||||
source src/northbridge/amd/agesa/family15rl/Kconfig
|
||||
source src/northbridge/amd/agesa/family16kb/Kconfig
|
||||
|
||||
# TODO: Reservation for heap seems excessive
|
||||
|
|
|
@ -21,6 +21,7 @@ subdirs-$(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY12) += family12
|
|||
subdirs-$(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY14) += family14
|
||||
subdirs-$(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15) += family15
|
||||
subdirs-$(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN) += family15tn
|
||||
subdirs-$(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_RL) += family15rl
|
||||
subdirs-$(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY16_KB) += family16kb
|
||||
|
||||
romstage-y += def_callouts.c
|
||||
|
|
|
@ -104,7 +104,9 @@ AGESA_STATUS agesa_RunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
|
|||
return Status;
|
||||
}
|
||||
|
||||
#if CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN || CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
|
||||
#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN) || \
|
||||
IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_RL) || \
|
||||
IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY16_KB)
|
||||
/* FIXME: we would like GFX disable for fam14 too for headless systems. */
|
||||
AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINT32 FchData, VOID *ConfigPrt)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
##
|
||||
## This file is part of the coreboot project.
|
||||
##
|
||||
## Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; version 2 of the License.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
config NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
||||
bool
|
||||
select MMCONF_SUPPORT
|
||||
select PER_DEVICE_ACPI_TABLES
|
||||
|
||||
if NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
||||
|
||||
config HW_MEM_HOLE_SIZEK
|
||||
hex
|
||||
default 0x100000
|
||||
|
||||
config HW_MEM_HOLE_SIZE_AUTO_INC
|
||||
bool
|
||||
default n
|
||||
|
||||
config MMCONF_BASE_ADDRESS
|
||||
hex
|
||||
default 0xF8000000
|
||||
|
||||
config MMCONF_BUS_NUMBER
|
||||
int
|
||||
default 64
|
||||
|
||||
endif # NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# This file is part of the coreboot project.
|
||||
#
|
||||
# Copyright (C) 2012 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
romstage-y += dimmSpd.c
|
||||
|
||||
ramstage-y += iommu.c
|
||||
ramstage-y += northbridge.c
|
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2013 Sage Electronic Engineering, LLC
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* Note: Only need HID on Primary Bus */
|
||||
External (TOM1)
|
||||
External (TOM2)
|
||||
Name(_HID, EISAID("PNP0A03")) /* PCI Express Root Bridge */
|
||||
Name(_ADR, 0x00180000) /* Dev# = BSP Dev#, Func# = 0 */
|
||||
|
||||
/* Describe the Northbridge devices */
|
||||
|
||||
Method (_BBN, 0, NotSerialized)
|
||||
{
|
||||
Return (Zero)
|
||||
}
|
||||
|
||||
Method (_STA, 0, NotSerialized)
|
||||
{
|
||||
Return (0x0B)
|
||||
}
|
||||
|
||||
Method (_PRT, 0, NotSerialized)
|
||||
{
|
||||
If (PMOD)
|
||||
{
|
||||
Return (APR0)
|
||||
}
|
||||
|
||||
Return (PR0)
|
||||
}
|
||||
|
||||
Device(AMRT) {
|
||||
Name(_ADR, 0x00000000)
|
||||
} /* end AMRT */
|
||||
|
||||
/* Dev2 is also an external GFX bridge */
|
||||
Device(PBR2) {
|
||||
Name(_ADR, 0x00020000)
|
||||
Name(_PRW, Package() {0x18, 4})
|
||||
Method(_PRT,0) {
|
||||
If(PMOD){ Return(APS2) } /* APIC mode */
|
||||
Return (PS2) /* PIC Mode */
|
||||
} /* end _PRT */
|
||||
} /* end PBR2 */
|
||||
|
||||
/* Dev4 GPP0 Root Port Bridge */
|
||||
Device(PBR4) {
|
||||
Name(_ADR, 0x00040000)
|
||||
Name(_PRW, Package() {0x18, 4})
|
||||
Method(_PRT,0) {
|
||||
If(PMOD){ Return(APS4) } /* APIC mode */
|
||||
Return (PS4) /* PIC Mode */
|
||||
} /* end _PRT */
|
||||
} /* end PBR4 */
|
||||
|
||||
/* Dev5 GPP1 Root Port Bridge */
|
||||
Device(PBR5) {
|
||||
Name(_ADR, 0x00050000)
|
||||
Name(_PRW, Package() {0x18, 4})
|
||||
Method(_PRT,0) {
|
||||
If(PMOD){ Return(APS5) } /* APIC mode */
|
||||
Return (PS5) /* PIC Mode */
|
||||
} /* end _PRT */
|
||||
} /* end PBR5 */
|
||||
|
||||
/* Dev6 GPP2 Root Port Bridge */
|
||||
Device(PBR6) {
|
||||
Name(_ADR, 0x00060000)
|
||||
Name(_PRW, Package() {0x18, 4})
|
||||
Method(_PRT,0) {
|
||||
If(PMOD){ Return(APS6) } /* APIC mode */
|
||||
Return (PS6) /* PIC Mode */
|
||||
} /* end _PRT */
|
||||
} /* end PBR6 */
|
||||
|
||||
/* The onboard EtherNet chip */
|
||||
Device(PBR7) {
|
||||
Name(_ADR, 0x00070000)
|
||||
Name(_PRW, Package() {0x18, 4})
|
||||
Method(_PRT,0) {
|
||||
If(PMOD){ Return(APS7) } /* APIC mode */
|
||||
Return (PS7) /* PIC Mode */
|
||||
} /* end _PRT */
|
||||
} /* end PBR7 */
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _NB_AGESA_CHIP_H_
|
||||
#define _NB_AGESA_CHIP_H_
|
||||
|
||||
struct northbridge_amd_agesa_family15rl_config
|
||||
{
|
||||
u8 spdAddrLookup[2][2][4];
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2012 Advanced Micro Devices, Inc.
|
||||
* Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <device/pci_def.h>
|
||||
#include <device/device.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* warning: Porting.h includes an open #pragma pack(1) */
|
||||
#include "Porting.h"
|
||||
#include "AGESA.h"
|
||||
#include "amdlib.h"
|
||||
#include "chip.h"
|
||||
|
||||
#include <northbridge/amd/agesa/dimmSpd.h>
|
||||
|
||||
/**
|
||||
* Gets the SMBus address for an SPD from the array in devicetree.cb
|
||||
* then read the SPD into the supplied buffer.
|
||||
*/
|
||||
AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINT32 unused2, AGESA_READ_SPD_PARAMS *info)
|
||||
{
|
||||
UINT8 spdAddress;
|
||||
|
||||
ROMSTAGE_CONST struct device *dev = dev_find_slot(0, PCI_DEVFN(0x18, 2));
|
||||
if (dev == NULL)
|
||||
return AGESA_ERROR;
|
||||
|
||||
ROMSTAGE_CONST struct northbridge_amd_agesa_family15rl_config *config = dev->chip_info;
|
||||
if (config == NULL)
|
||||
return AGESA_ERROR;
|
||||
|
||||
if (info->SocketId >= ARRAY_SIZE(config->spdAddrLookup))
|
||||
return AGESA_ERROR;
|
||||
if (info->MemChannelId >= ARRAY_SIZE(config->spdAddrLookup[0]))
|
||||
return AGESA_ERROR;
|
||||
if (info->DimmId >= ARRAY_SIZE(config->spdAddrLookup[0][0]))
|
||||
return AGESA_ERROR;
|
||||
|
||||
spdAddress = config->spdAddrLookup
|
||||
[info->SocketId][info->MemChannelId][info->DimmId];
|
||||
|
||||
if (spdAddress == 0)
|
||||
return AGESA_ERROR;
|
||||
|
||||
int err = hudson_readSpd(spdAddress, (void *) info->Buffer, 128);
|
||||
if (err)
|
||||
return AGESA_ERROR;
|
||||
return AGESA_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2013 Rudolf Marek <r.marek@assembler.cz>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include <lib.h>
|
||||
|
||||
static void iommu_read_resources(device_t dev)
|
||||
{
|
||||
struct resource *res;
|
||||
|
||||
/* Get the normal pci resources of this device */
|
||||
pci_dev_read_resources(dev);
|
||||
|
||||
/* Add an extra subtractive resource for both memory and I/O. */
|
||||
res = new_resource(dev, 0x44);
|
||||
res->size = 512 * 1024;
|
||||
res->align = log2(res->size);
|
||||
res->gran = log2(res->size);
|
||||
res->limit = 0xffffffff; /* 4G */
|
||||
res->flags = IORESOURCE_MEM;
|
||||
}
|
||||
|
||||
static void iommu_set_resources(device_t dev)
|
||||
{
|
||||
struct resource *res;
|
||||
|
||||
pci_dev_set_resources(dev);
|
||||
|
||||
res = find_resource(dev, 0x44);
|
||||
/* Remember this resource has been stored */
|
||||
res->flags |= IORESOURCE_STORED;
|
||||
/* For now, do only 32-bit space allocation */
|
||||
pci_write_config32(dev, 0x48, 0x0);
|
||||
pci_write_config32(dev, 0x44, res->base | (1 << 0));
|
||||
}
|
||||
|
||||
static struct pci_operations lops_pci = {
|
||||
.set_subsystem = pci_dev_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations iommu_ops = {
|
||||
.read_resources = iommu_read_resources,
|
||||
.set_resources = iommu_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = 0,
|
||||
.scan_bus = 0,
|
||||
.ops_pci = &lops_pci,
|
||||
};
|
||||
|
||||
static const struct pci_driver iommu_driver __pci_driver = {
|
||||
.ops = &iommu_ops,
|
||||
.vendor = PCI_VENDOR_ID_AMD,
|
||||
.device = PCI_DEVICE_ID_AMD_15H_NB_IOMMU,
|
||||
};
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue