ofw_cpu: Make ext_resources non-optional for arm* and riscv

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.
For RISC-V it was always enabled.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33835
This commit is contained in:
Emmanuel Vadot 2022-01-11 11:08:18 +01:00
parent 85b3794cee
commit 02398e581d

View File

@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/ofw_cpu.h>
#ifdef EXT_RESOURCES
#if defined(__arm__) || defined(__arm64__) || defined(__riscv__)
#include <dev/extres/clk/clk.h>
#endif
@ -207,7 +207,7 @@ ofw_cpu_attach(device_t dev)
phandle_t node;
pcell_t cell;
int rv;
#ifdef EXT_RESOURCES
#if defined(__arm__) || defined(__arm64__) || defined(__riscv__)
clk_t cpuclk;
uint64_t freq;
#endif
@ -277,7 +277,7 @@ ofw_cpu_attach(device_t dev)
sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev));
if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) {
#ifdef EXT_RESOURCES
#if defined(__arm__) || defined(__arm64__) || defined(__riscv__)
rv = clk_get_by_ofw_index(dev, 0, 0, &cpuclk);
if (rv == 0) {
rv = clk_get_freq(cpuclk, &freq);