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.
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
)
29 /* Read standard PCI resources. */
30 pci_dev_read_resources(dev
);
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
45 size_k
= 0xc0000 - base_k
;
46 mmio_resource(dev
, index
++, RES_IN_KIB(base_k
), RES_IN_KIB(size_k
));
49 size_k
= 0x100000 - base_k
;
50 reserved_ram_resource(dev
, index
++, RES_IN_KIB(base_k
),
53 /* 0x100000 -> cbmem_top - cacheable and usable */
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 */
60 size_k
= 0xc0000000 - base_k
;
61 reserved_ram_resource(dev
, index
++, RES_IN_KIB(base_k
),
64 /* 0xc0000000 -> 4GiB is mmio. */
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
= {
78 .vendor
= PCI_VENDOR_ID_INTEL
,
79 .device
= QUARK_MC_DEVICE_ID