14 #include <soc/iomap.h>
15 #include <soc/pci_devs.h>
16 #include <soc/ramstage.h>
17 #include <soc/systemagent.h>
21 #define WAITING_STEP 100
33 if (!(pciexbar_reg & (1 << 0)))
36 switch ((pciexbar_reg >> 1) & 3) {
38 *
base = pciexbar_reg &
39 ((1 << 31) | (1 << 30) | (1 << 29) | (1 << 28));
40 *len = 256 * 1024 * 1024;
43 *
base = pciexbar_reg & ((1 << 31) | (1 << 30) | (1 << 29) |
44 (1 << 28) | (1 << 27));
45 *len = 128 * 1024 * 1024;
48 *
base = pciexbar_reg & ((1 << 31) | (1 << 30) | (1 << 29) |
49 (1 << 28) | (1 << 27) | (1 << 26));
50 *len = 64 * 1024 * 1024;
132 mask = ((1ULL << 20) - 1);
151 #define MAP_ENTRY(reg_, is_64_, is_limit_, desc_) \
153 .reg = reg_, .is_64_bit = is_64_, .is_limit = is_limit_, \
154 .description = desc_, \
157 #define MAP_ENTRY_BASE_64(reg_, desc_) MAP_ENTRY(reg_, 1, 0, desc_)
158 #define MAP_ENTRY_LIMIT_64(reg_, desc_) MAP_ENTRY(reg_, 1, 1, desc_)
159 #define MAP_ENTRY_BASE_32(reg_, desc_) MAP_ENTRY(reg_, 0, 0, desc_)
193 unsigned long base_k, size_k;
194 unsigned long touud_k;
240 size_k = (0xa0000 >> 10) - base_k;
244 base_k = 0x100000 >> 10;
245 size_k = (top_of_ram >> 10) - base_k;
264 "SMM memory location: 0x%llx SMM memory size: 0x%llx\n",
268 base_k = 4096 * 1024;
270 size_k = touud_k - base_k;
271 if (touud_k > base_k)
282 (0x100000 - 0xc0000) >> 10);
300 void *bios_reset_cpl =
329 #if CONFIG(HAVE_ACPI_TABLES)
341 static const struct pci_driver systemagent_driver
__pci_driver = {
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
#define printk(level,...)
#define MCH_BAR_BIOS_RESET_CPL
static struct map_entry memory_map[NUM_MAP_ENTRIES]
static void systemagent_init(struct device *dev)
static struct device_operations systemagent_ops
static const struct pci_driver systemagent_driver __pci_driver
static void mc_report_map_entries(struct device *dev, uint64_t *values)
static void mc_add_fixed_mmio_resources(struct device *dev)
#define MAP_ENTRY_BASE_64(reg_, desc_)
static void mc_read_map_entries(struct device *dev, uint64_t *values)
#define MAP_ENTRY_BASE_32(reg_, desc_)
static void mc_add_dram_resources(struct device *dev)
static void read_map_entry(struct device *dev, struct map_entry *entry, uint64_t *result)
static int get_pcie_bar(struct device *dev, unsigned int index, u32 *base, u32 *len)
static void systemagent_read_resources(struct device *dev)
struct fixed_mmio_descriptor mc_fixed_resources[]
static int get_bar(struct device *dev, unsigned int index, u32 *base, u32 *len)
static const unsigned short systemagent_ids[]
struct resource * new_resource(struct device *dev, unsigned int index)
See if a resource structure already exists for a given index and if not allocate one.
#define ram_resource(dev, idx, basek, sizek)
#define mmio_resource(dev, idx, basek, sizek)
#define reserved_ram_resource(dev, idx, basek, sizek)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static int stopwatch_expired(struct stopwatch *sw)
static void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
void pci_dev_enable_resources(struct device *dev)
void pci_dev_read_resources(struct device *dev)
void pci_dev_set_resources(struct device *dev)
#define PCI_DID_INTEL_DNVAD_SA
#define PCI_DID_INTEL_DNV_SA
#define IORESOURCE_RESERVE
#define IORESOURCE_CACHEABLE
#define IORESOURCE_STORED
#define IORESOURCE_ASSIGNED
struct pci_operations soc_pci_ops
unsigned long systemagent_write_acpi_tables(const struct device *dev, unsigned long current, struct acpi_rsdp *const rsdp)
unsigned long long uint64_t
void(* read_resources)(struct device *dev)
int(* get_resource)(struct device *dev, unsigned int index, u32 *base, u32 *size)