diff options
author | Furquan Shaikh <furquan@google.com> | 2021-09-20 10:51:45 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2021-09-20 23:08:34 +0000 |
commit | 4aba7395b705725c5e441cce2fd269e734994939 (patch) | |
tree | 1eba10a6466f3295d870015e498e94998107e398 /src | |
parent | 364aa76b9de5150399a8da3ce46b4f96b94e31ba (diff) |
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>
Diffstat (limited to 'src')
6 files changed, 8 insertions, 12 deletions
diff --git a/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c b/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c index 46e73a5ff1..1328213e29 100644 --- a/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c +++ b/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c @@ -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; diff --git a/src/mainboard/google/brya/variants/brya0/overridetree.cb b/src/mainboard/google/brya/variants/brya0/overridetree.cb index d032a047b9..41d1018727 100644 --- a/src/mainboard/google/brya/variants/brya0/overridetree.cb +++ b/src/mainboard/google/brya/variants/brya0/overridetree.cb @@ -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 diff --git a/src/mainboard/google/brya/variants/gimble/overridetree.cb b/src/mainboard/google/brya/variants/gimble/overridetree.cb index b20524a5bc..c2949c4877 100644 --- a/src/mainboard/google/brya/variants/gimble/overridetree.cb +++ b/src/mainboard/google/brya/variants/gimble/overridetree.cb @@ -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 diff --git a/src/mainboard/google/brya/variants/kano/overridetree.cb b/src/mainboard/google/brya/variants/kano/overridetree.cb index 5fc0c6b3a6..e6da3bbaf4 100644 --- a/src/mainboard/google/brya/variants/kano/overridetree.cb +++ b/src/mainboard/google/brya/variants/kano/overridetree.cb @@ -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 diff --git a/src/mainboard/google/brya/variants/primus/overridetree.cb b/src/mainboard/google/brya/variants/primus/overridetree.cb index 8f4549534d..21be1c8073 100644 --- a/src/mainboard/google/brya/variants/primus/overridetree.cb +++ b/src/mainboard/google/brya/variants/primus/overridetree.cb @@ -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 diff --git a/src/mainboard/google/brya/variants/redrix/overridetree.cb b/src/mainboard/google/brya/variants/redrix/overridetree.cb index b87e4c4082..dbe71860c2 100644 --- a/src/mainboard/google/brya/variants/redrix/overridetree.cb +++ b/src/mainboard/google/brya/variants/redrix/overridetree.cb @@ -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 |