From 8f2e5c90e44c6d846a6367bb4051818fdcd577ea Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 16 Jan 2023 20:06:31 +0100 Subject: soc/amd: introduce and use common amd_cpu_bus_ops struct The device operations for the CPU bus are identical for all AMD SoCs, so introduce a common device operations struct for this and use it in all AMD SoC's chipset devicetrees as ops for the CPU cluster. Signed-off-by: Felix Held Change-Id: Id32f89b8a33db8dbb747b917eeac3009fbae6631 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71998 Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas Reviewed-by: Fred Reitberger --- src/soc/amd/common/block/cpu/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/soc/amd/common/block/cpu/cpu.c') diff --git a/src/soc/amd/common/block/cpu/cpu.c b/src/soc/amd/common/block/cpu/cpu.c index 7c1daf96f1..1e1915f98f 100644 --- a/src/soc/amd/common/block/cpu/cpu.c +++ b/src/soc/amd/common/block/cpu/cpu.c @@ -1,9 +1,18 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include +#include int get_cpu_count(void) { return 1 + (cpuid_ecx(0x80000008) & 0xff); } + +struct device_operations amd_cpu_bus_ops = { + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, + .init = mp_cpu_bus_init, + .acpi_fill_ssdt = generate_cpu_entries, +}; -- cgit v1.2.3