soc: Remove copyright notices
[coreboot.git] / src / soc / intel / quark / northcluster.c
blobdda702e82759d1076f3dc8fccb45ca856f929eaa
1 /*
2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <cbmem.h>
16 #include <device/pci.h>
17 #include <device/pci_ids.h>
18 #include <soc/iomap.h>
19 #include <soc/ramstage.h>
21 #define RES_IN_KIB(r) ((r) >> 10)
23 static void nc_read_resources(struct device *dev)
25 unsigned long base_k;
26 int index = 0;
27 unsigned long size_k;
29 /* Read standard PCI resources. */
30 pci_dev_read_resources(dev);
32 /* 0 -> 0xa0000 */
33 base_k = 0;
34 size_k = 0xa0000 - base_k;
35 ram_resource(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
38 * Reserve everything between A segment and 1MB:
40 * 0xa0000 - 0xbffff: legacy VGA
41 * 0xc0000 - 0xdffff: RAM
42 * 0xe0000 - 0xfffff: ROM shadow
44 base_k += size_k;
45 size_k = 0xc0000 - base_k;
46 mmio_resource(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
48 base_k += size_k;
49 size_k = 0x100000 - base_k;
50 reserved_ram_resource(dev, index++, RES_IN_KIB(base_k),
51 RES_IN_KIB(size_k));
53 /* 0x100000 -> cbmem_top - cacheable and usable */
54 base_k += size_k;
55 size_k = (unsigned long)cbmem_top() - base_k;
56 ram_resource(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
58 /* cbmem_top -> 0xc0000000 - reserved */
59 base_k += size_k;
60 size_k = 0xc0000000 - base_k;
61 reserved_ram_resource(dev, index++, RES_IN_KIB(base_k),
62 RES_IN_KIB(size_k));
64 /* 0xc0000000 -> 4GiB is mmio. */
65 base_k += size_k;
66 size_k = 0x100000000ull - base_k;
67 mmio_resource(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
70 static struct device_operations nc_ops = {
71 .read_resources = nc_read_resources,
72 .set_resources = pci_dev_set_resources,
73 .enable_resources = pci_dev_enable_resources,
76 static const struct pci_driver systemagent_driver __pci_driver = {
77 .ops = &nc_ops,
78 .vendor = PCI_VENDOR_ID_INTEL,
79 .device = QUARK_MC_DEVICE_ID