[coreboot-gerrit] New patch to review for coreboot: soc/apollolake: Prevent PMC BAR reassignment during resource allocation

Hannah Williams (hannah.williams@intel.com) gerrit at coreboot.org
Mon Apr 11 19:02:24 CEST 2016


Hannah Williams (hannah.williams at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14315

-gerrit

commit 3494fbf5d4ed827e499f71b1a5f3100019d55333
Author: Hannah Williams <hannah.williams at intel.com>
Date:   Thu Feb 11 13:46:28 2016 -0800

    soc/apollolake: Prevent PMC BAR reassignment during resource allocation
    
    Change-Id: Ie8e21e62ecd25f3c620a57c24948411c14c1e111
    Signed-off-by: Hannah Williams <hannah.williams at intel.com>
---
 src/soc/intel/apollolake/Makefile.inc          |  1 +
 src/soc/intel/apollolake/include/soc/pci_ids.h |  1 +
 src/soc/intel/apollolake/pmc.c                 | 56 ++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 70ab515..e585bd3 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -38,6 +38,7 @@ ramstage-y += memmap.c
 ramstage-y += mmap_boot.c
 ramstage-y += uart.c
 ramstage-y += northbridge.c
+ramstage-y += pmc.c
 
 postcar-y += exit_car.S
 postcar-y += memmap.c
diff --git a/src/soc/intel/apollolake/include/soc/pci_ids.h b/src/soc/intel/apollolake/include/soc/pci_ids.h
index f5bb667..f62a48e 100644
--- a/src/soc/intel/apollolake/include/soc/pci_ids.h
+++ b/src/soc/intel/apollolake/include/soc/pci_ids.h
@@ -16,6 +16,7 @@
 #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_P2SB		0x5a92		/* 00:0d.0 */
+#define PCI_DEV_ID_APOLLOLAKE_PMC               0x5a94		/* 00:0d.1 */
 #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_SATA		0x5ae0		/* 00:12.0 */
diff --git a/src/soc/intel/apollolake/pmc.c b/src/soc/intel/apollolake/pmc.c
new file mode 100644
index 0000000..3c76f76
--- /dev/null
+++ b/src/soc/intel/apollolake/pmc.c
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+#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_enable_dev(device_t dev)
+{
+        struct resource *res;
+	res = new_resource(dev, PCI_BASE_ADDRESS_0);
+	res->base = PMC_BAR0;
+	res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED |
+                      IORESOURCE_FIXED;
+	res = new_resource(dev, PCI_BASE_ADDRESS_2);
+	res->base = PMC_BAR1;
+	res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED |
+                      IORESOURCE_FIXED;
+	res = new_resource(dev, PCI_BASE_ADDRESS_4);
+	res->base = ACPI_PMIO_BASE;
+	res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+}
+
+static struct device_operations device_ops = {
+        .read_resources         = DEVICE_NOOP,
+        .set_resources          = DEVICE_NOOP,
+        .enable_resources       = DEVICE_NOOP,
+        .init                   = pmc_init,
+        .enable                 = pmc_enable_dev,
+};
+
+static const struct pci_driver pmc __pci_driver = {
+        .ops            = &device_ops,
+        .vendor         = PCI_VENDOR_ID_INTEL,
+        .device         = PCI_DEV_ID_APOLLOLAKE_PMC,
+};
+
+



More information about the coreboot-gerrit mailing list