Attach Tegra124 DVFS to /cpus/cpu0 now that another driver is claiming the

/cpus node.
This commit is contained in:
jmcneill 2017-06-02 00:09:56 +00:00
parent ffb2c722ea
commit b7a940d982
3 changed files with 15 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.tegra,v 1.39 2017/05/30 22:55:26 jmcneill Exp $
# $NetBSD: files.tegra,v 1.40 2017/06/02 00:09:56 jmcneill Exp $
#
# Configuration info for NVIDIA Tegra ARM Peripherals
#
@ -21,7 +21,7 @@ file arch/arm/nvidia/tegra_cpufreq.c
# Tegra T124 (32-bit K1) support
file arch/arm/nvidia/soc_tegra124.c soc_tegra124
device tegra124cpu
attach tegra124cpu at fdt with tegra124_cpu
attach tegra124cpu at cpu with tegra124_cpu
file arch/arm/nvidia/tegra124_cpu.c tegra124_cpu
# Tegra T210 (X1) support

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra124_cpu.c,v 1.3 2017/04/29 23:00:42 jmcneill Exp $ */
/* $NetBSD: tegra124_cpu.c,v 1.4 2017/06/02 00:09:56 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -30,7 +30,7 @@
#include "opt_multiprocessor.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra124_cpu.c,v 1.3 2017/04/29 23:00:42 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra124_cpu.c,v 1.4 2017/06/02 00:09:56 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -70,7 +70,7 @@ static size_t tegra124_cpufreq_get_available(u_int *, size_t);
static int tegra124_cpu_match(device_t, cfdata_t, void *);
static void tegra124_cpu_attach(device_t, device_t, void *);
static void tegra124_cpu_init_cpufreq(device_t);
static int tegra124_cpu_init_cpufreq(device_t);
CFATTACH_DECL_NEW(tegra124_cpu, 0, tegra124_cpu_match, tegra124_cpu_attach,
NULL, NULL);
@ -125,7 +125,7 @@ tegra124_cpu_match(device_t parent, cfdata_t cf, void *aux)
const char * const compatible[] = { "nvidia,tegra124", NULL };
struct fdt_attach_args *faa = aux;
if (OF_finddevice("/cpus") != faa->faa_phandle)
if (OF_finddevice("/cpus/cpu@0") != faa->faa_phandle)
return 0;
return of_match_compatible(OF_finddevice("/"), compatible);
@ -135,12 +135,12 @@ static void
tegra124_cpu_attach(device_t parent, device_t self, void *aux)
{
aprint_naive("\n");
aprint_normal(": CPU complex\n");
aprint_normal(": DVFS\n");
config_defer(self, tegra124_cpu_init_cpufreq);
config_finalize_register(self, tegra124_cpu_init_cpufreq);
}
static void
static int
tegra124_cpu_init_cpufreq(device_t dev)
{
tegra124_speedo_init();
@ -153,14 +153,16 @@ tegra124_cpu_init_cpufreq(device_t dev)
}
if (tegra124_clk_pllx == NULL) {
aprint_error_dev(dev, "couldn't find clock pll_x\n");
return;
return 0;
}
if (tegra124_reg_vddcpu == NULL) {
aprint_error_dev(dev, "couldn't find voltage regulator\n");
return;
return 0;
}
tegra_cpufreq_register(&tegra124_cpufreq_func);
return 0;
}
static void

View File

@ -1,5 +1,5 @@
#
# $NetBSD: TEGRA,v 1.22 2017/05/29 23:22:00 jmcneill Exp $
# $NetBSD: TEGRA,v 1.23 2017/06/02 00:09:56 jmcneill Exp $
#
# NVIDIA Tegra K1 (T124)
#
@ -36,7 +36,7 @@ cpus* at fdt? pass 0
cpu* at cpus?
# CPU frequency scaling
tegra124cpu* at fdt?
tegra124cpu* at cpu?
fclock* at fdt? pass 4
fregulator* at fdt? pass 4