blob: 782c1c3a6ee3acad0f08f811ca137abb02ff999d [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Martin Roth5c354b92019-04-22 14:55:16 -06002
Fred Reitberger31e62982022-10-31 14:18:20 -04003#include <amdblocks/data_fabric.h>
Furquan Shaikh5df9a042020-04-15 22:52:35 -07004#include <console/console.h>
Martin Roth5c354b92019-04-22 14:55:16 -06005#include <device/device.h>
6#include <device/pci.h>
7#include <drivers/i2c/designware/dw_i2c.h>
Martin Roth5c354b92019-04-22 14:55:16 -06008#include <soc/acpi.h>
9#include <soc/cpu.h>
Furquan Shaikh46637492020-06-03 16:22:20 -070010#include <soc/iomap.h>
Martin Roth5c354b92019-04-22 14:55:16 -060011#include <soc/pci_devs.h>
12#include <soc/southbridge.h>
Martin Roth5c354b92019-04-22 14:55:16 -060013#include "chip.h"
Marshall Dawson00a22082020-01-20 23:05:31 -070014#include <fsp/api.h>
Martin Roth5c354b92019-04-22 14:55:16 -060015
Felix Held61e60d12021-02-16 23:23:00 +010016static const char *soc_acpi_name(const struct device *dev)
Martin Roth5c354b92019-04-22 14:55:16 -060017{
18 if (dev->path.type == DEVICE_PATH_DOMAIN)
19 return "PCI0";
20
Martin Roth5c354b92019-04-22 14:55:16 -060021 if (dev->path.type != DEVICE_PATH_PCI)
22 return NULL;
23
Furquan Shaikh5df9a042020-04-15 22:52:35 -070024 printk(BIOS_WARNING, "Unknown PCI device: dev: %d, fn: %d\n",
25 PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
26 return NULL;
Martin Roth5c354b92019-04-22 14:55:16 -060027};
28
Arthur Heymans7f380772022-09-20 14:03:28 +020029struct device_operations picasso_pci_domain_ops = {
Martin Roth5c354b92019-04-22 14:55:16 -060030 .read_resources = pci_domain_read_resources,
Raul E Rangel5cb34e22020-05-04 16:41:22 -060031 .set_resources = pci_domain_set_resources,
Martin Roth5c354b92019-04-22 14:55:16 -060032 .scan_bus = pci_domain_scan_bus,
33 .acpi_name = soc_acpi_name,
34};
35
Martin Roth5c354b92019-04-22 14:55:16 -060036static void soc_init(void *chip_info)
37{
Matt Papageorgea21eae02019-11-13 17:00:12 -060038 default_dev_ops_root.write_acpi_tables = agesa_write_acpi_tables;
39
Kyösti Mälkkicc93c6e2021-01-09 22:53:52 +020040 fsp_silicon_init();
Marshall Dawson00a22082020-01-20 23:05:31 -070041
Raul E Rangel789aefc2020-05-11 16:26:35 -060042 data_fabric_set_mmio_np();
Felix Heldfaaafb42021-01-28 23:19:40 +010043 fch_init(chip_info);
Martin Roth5c354b92019-04-22 14:55:16 -060044}
45
46static void soc_final(void *chip_info)
47{
Felix Heldfaaafb42021-01-28 23:19:40 +010048 fch_final(chip_info);
Martin Roth5c354b92019-04-22 14:55:16 -060049}
50
Marshall Dawsonbc4c9032019-06-11 12:18:20 -060051struct chip_operations soc_amd_picasso_ops = {
52 CHIP_NAME("AMD Picasso SOC")
Martin Roth5c354b92019-04-22 14:55:16 -060053 .init = soc_init,
54 .final = soc_final
55};