soc/apollolake: Prevent PMC BAR reassignment during resource allocation
Change-Id: Ie8e21e62ecd25f3c620a57c24948411c14c1e111 Signed-off-by: Hannah Williams <hannah.williams@intel.com> Reviewed-on: https://review.coreboot.org/14315 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
80a3df2607
commit
733b39aed4
3 changed files with 60 additions and 0 deletions
|
@ -45,6 +45,7 @@ ramstage-y += northbridge.c
|
||||||
ramstage-y += spi.c
|
ramstage-y += spi.c
|
||||||
ramstage-y += tsc_freq.c
|
ramstage-y += tsc_freq.c
|
||||||
ramstage-y += pmutil.c
|
ramstage-y += pmutil.c
|
||||||
|
ramstage-y += pmc.c
|
||||||
|
|
||||||
postcar-y += exit_car.S
|
postcar-y += exit_car.S
|
||||||
postcar-y += memmap.c
|
postcar-y += memmap.c
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define PCI_DEVICE_ID_APOLLOLAKE_NB 0x5af0 /* 00:00.0 */
|
#define PCI_DEVICE_ID_APOLLOLAKE_NB 0x5af0 /* 00:00.0 */
|
||||||
#define PCI_DEVICE_ID_APOLLOLAKE_IGD 0x5a84 /* 00:02.0 */
|
#define PCI_DEVICE_ID_APOLLOLAKE_IGD 0x5a84 /* 00:02.0 */
|
||||||
#define PCI_DEVICE_ID_APOLLOLAKE_P2SB 0x5a92 /* 00:0d.0 */
|
#define PCI_DEVICE_ID_APOLLOLAKE_P2SB 0x5a92 /* 00:0d.0 */
|
||||||
|
#define PCI_DEVICE_ID_APOLLOLAKE_PMC 0x5a94 /* 00:0d.1 */
|
||||||
#define PCI_DEVICE_ID_APOLLOLAKE_HWSEQ_SPI 0x5a96 /* 00:0d.2 */
|
#define PCI_DEVICE_ID_APOLLOLAKE_HWSEQ_SPI 0x5a96 /* 00:0d.2 */
|
||||||
#define PCI_DEVICE_ID_APOLLOLAKE_AUDIO 0x5a98 /* 00:0e.0 */
|
#define PCI_DEVICE_ID_APOLLOLAKE_AUDIO 0x5a98 /* 00:0e.0 */
|
||||||
#define PCI_DEVICE_ID_APOLLOLAKE_SATA 0x5ae0 /* 00:12.0 */
|
#define PCI_DEVICE_ID_APOLLOLAKE_SATA 0x5ae0 /* 00:12.0 */
|
||||||
|
|
58
src/soc/intel/apollolake/pmc.c
Normal file
58
src/soc/intel/apollolake/pmc.c
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the coreboot project.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015-2016 Intel Corp.
|
||||||
|
*
|
||||||
|
* 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; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <console/console.h>
|
||||||
|
#include <cpu/cpu.h>
|
||||||
|
#include <device/device.h>
|
||||||
|
#include <device/pci.h>
|
||||||
|
#include <device/pci_ids.h>
|
||||||
|
#include <soc/iomap.h>
|
||||||
|
#include <soc/pci_ids.h>
|
||||||
|
|
||||||
|
static void pmc_init(device_t dev)
|
||||||
|
{
|
||||||
|
printk(BIOS_SPEW, "%s/%s ( %s )\n",
|
||||||
|
__FILE__, __func__, dev_name(dev));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pmc_read_resources(device_t dev)
|
||||||
|
{
|
||||||
|
struct resource *res;
|
||||||
|
|
||||||
|
mmio_resource(dev, PCI_BASE_ADDRESS_0, PMC_BAR0/KiB, 1);
|
||||||
|
mmio_resource(dev, PCI_BASE_ADDRESS_2, PMC_BAR1/KiB, 2);
|
||||||
|
|
||||||
|
res = new_resource(dev, PCI_BASE_ADDRESS_4);
|
||||||
|
res->base = ACPI_PMIO_BASE;
|
||||||
|
res->size = KiB;
|
||||||
|
res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct device_operations device_ops = {
|
||||||
|
.read_resources = pmc_read_resources,
|
||||||
|
.set_resources = DEVICE_NOOP,
|
||||||
|
.enable_resources = DEVICE_NOOP,
|
||||||
|
.init = pmc_init,
|
||||||
|
.enable = DEVICE_NOOP,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct pci_driver pmc __pci_driver = {
|
||||||
|
.ops = &device_ops,
|
||||||
|
.vendor = PCI_VENDOR_ID_INTEL,
|
||||||
|
.device = PCI_DEVICE_ID_APOLLOLAKE_PMC,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue