mb/google/brya: Switch to using device pointers using alias names

This change replaces the device tree walks with device pointers by
adding alias for dptf_policy generic device in the tree.

Change-Id: I8fd5476a9cea84ab8b2678167b3e0504eecacf6c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57739
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Furquan Shaikh 2021-09-20 10:51:45 -07:00
parent 364aa76b9d
commit 4aba7395b7
6 changed files with 8 additions and 12 deletions

View File

@ -11,18 +11,14 @@
#define MILLIWATTS_TO_WATTS 1000
WEAK_DEV_PTR(dptf_policy);
void variant_update_power_limits(const struct cpu_power_limits *limits, size_t num_entries)
{
if (!num_entries)
return;
const struct device_path policy_path[] = {
{ .type = DEVICE_PATH_PCI, .pci.devfn = SA_DEVFN_DPTF},
{ .type = DEVICE_PATH_GENERIC, .generic.id = 0}
};
const struct device *policy_dev = find_dev_nested_path(pci_root_bus(),
policy_path, ARRAY_SIZE(policy_path));
const struct device *policy_dev = DEV_PTR(dptf_policy);
if (!policy_dev)
return;

View File

@ -137,7 +137,7 @@ chip soc/intel/alderlake
register "options.fan.fine_grained_control" = "1"
register "options.fan.step_size" = "2"
device generic 0 on end
device generic 0 alias dptf_policy on end
end
end
device ref ipu on

View File

@ -72,7 +72,7 @@ chip soc/intel/alderlake
[2] = { 16, 1000 },
[3] = { 8, 500 }
}"
device generic 0 on end
device generic 0 alias dptf_policy on end
end
end
device ref cnvi_wifi on

View File

@ -100,7 +100,7 @@ chip soc/intel/alderlake
register "options.fan.fine_grained_control" = "1"
register "options.fan.step_size" = "2"
device generic 0 on end
device generic 0 alias dptf_policy on end
end
end
device ref ipu on

View File

@ -107,7 +107,7 @@ chip soc/intel/alderlake
[2] = { 16, 1000 },
[3] = { 8, 500 }
}"
device generic 0 on end
device generic 0 alias dptf_policy on end
end
end
device ref cnvi_wifi on

View File

@ -113,7 +113,7 @@ chip soc/intel/alderlake
[2] = { 16, 1000 },
[3] = { 8, 500 }
}"
device generic 0 on end
device generic 0 alias dptf_policy on end
end
end
device ref ipu on