mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
src/amd/stoneyridge: Add devicetree ACPI names
This commit adds device name to ACPI name bindings for various entries in the devicetree. BUG=b:72121803 Change-Id: I5564e4a7e56fdd1bc9f34497bdb78383093a2ba3 Signed-off-by: Justin TerAvest <teravest@chromium.org> Reviewed-on: https://review.coreboot.org/23417 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
8787f24952
commit
949d666b5c
2 changed files with 37 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include <device/pci.h>
|
#include <device/pci.h>
|
||||||
#include <soc/cpu.h>
|
#include <soc/cpu.h>
|
||||||
#include <soc/northbridge.h>
|
#include <soc/northbridge.h>
|
||||||
|
#include <soc/pci_devs.h>
|
||||||
#include <soc/southbridge.h>
|
#include <soc/southbridge.h>
|
||||||
#include <amdblocks/psp.h>
|
#include <amdblocks/psp.h>
|
||||||
#include <amdblocks/agesawrapper.h>
|
#include <amdblocks/agesawrapper.h>
|
||||||
|
@ -35,12 +36,38 @@ struct device_operations cpu_bus_ops = {
|
||||||
.acpi_fill_ssdt_generator = generate_cpu_entries,
|
.acpi_fill_ssdt_generator = generate_cpu_entries,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *soc_acpi_name(const struct device *dev)
|
||||||
|
{
|
||||||
|
if (dev->path.type == DEVICE_PATH_DOMAIN)
|
||||||
|
return "PCI0";
|
||||||
|
if (dev->path.type != DEVICE_PATH_PCI)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
switch (dev->path.pci.devfn) {
|
||||||
|
case EHCI1_DEVFN:
|
||||||
|
return "EHC0";
|
||||||
|
case LPC_DEVFN:
|
||||||
|
return "LPCB";
|
||||||
|
case SATA_DEVFN:
|
||||||
|
return "STCR";
|
||||||
|
case SD_DEVFN:
|
||||||
|
return "SDCN";
|
||||||
|
case SMBUS_DEVFN:
|
||||||
|
return "SBUS";
|
||||||
|
case XHCI_DEVFN:
|
||||||
|
return "XHC0";
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct device_operations pci_domain_ops = {
|
struct device_operations pci_domain_ops = {
|
||||||
.read_resources = domain_read_resources,
|
.read_resources = domain_read_resources,
|
||||||
.set_resources = domain_set_resources,
|
.set_resources = domain_set_resources,
|
||||||
.enable_resources = domain_enable_resources,
|
.enable_resources = domain_enable_resources,
|
||||||
.scan_bus = pci_domain_scan_bus,
|
.scan_bus = pci_domain_scan_bus,
|
||||||
.ops_pci_bus = pci_bus_default_ops,
|
.ops_pci_bus = pci_bus_default_ops,
|
||||||
|
.acpi_name = soc_acpi_name,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void enable_dev(device_t dev)
|
static void enable_dev(device_t dev)
|
||||||
|
|
|
@ -96,3 +96,13 @@ void gpio_output(gpio_t gpio_num, int value)
|
||||||
reg |= GPIO_OUTPUT_ENABLE;
|
reg |= GPIO_OUTPUT_ENABLE;
|
||||||
write32((void *)(uintptr_t)gpio_num, reg);
|
write32((void *)(uintptr_t)gpio_num, reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *gpio_acpi_path(gpio_t gpio)
|
||||||
|
{
|
||||||
|
return "\\SB.GPIO";
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t gpio_acpi_pin(gpio_t gpio)
|
||||||
|
{
|
||||||
|
return gpio;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue