Author: mmel
Date: Tue Oct 18 12:26:22 2016
New Revision: 307557
URL: https://svnweb.freebsd.org/changeset/base/307557

Log:
  TEGRA: Attach cpufreq and coretemp drivers only on tegra124 SoC.
  It's needed by GENERIC kernel.
  
  MFC after: 2 weeks

Modified:
  head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
  head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c

Modified: head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
==============================================================================
--- head/sys/arm/nvidia/tegra124/tegra124_coretemp.c    Tue Oct 18 12:21:45 
2016        (r307556)
+++ head/sys/arm/nvidia/tegra124/tegra124_coretemp.c    Tue Oct 18 12:26:22 
2016        (r307557)
@@ -178,10 +178,14 @@ tegra124_coretemp_ofw_parse(struct tegra
 static void
 tegra124_coretemp_identify(driver_t *driver, device_t parent)
 {
+       phandle_t root;
 
-       if (device_find_child(parent, "coretemp", -1) != NULL)
+       root = OF_finddevice("/");
+       if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124"))
                return;
-       if (BUS_ADD_CHILD(parent, 0, "coretemp", -1) == NULL)
+       if (device_find_child(parent, "tegra124_coretemp", -1) != NULL)
+               return;
+       if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", -1) == NULL)
                device_printf(parent, "add child failed\n");
 }
 
@@ -262,7 +266,7 @@ static device_method_t tegra124_coretemp
 };
 
 static devclass_t tegra124_coretemp_devclass;
-static DEFINE_CLASS_0(coretemp, tegra124_coretemp_driver,
+static DEFINE_CLASS_0(tegra124_coretemp, tegra124_coretemp_driver,
     tegra124_coretemp_methods, sizeof(struct tegra124_coretemp_softc));
 DRIVER_MODULE(tegra124_coretemp, cpu, tegra124_coretemp_driver,
     tegra124_coretemp_devclass, NULL, NULL);

Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
==============================================================================
--- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c     Tue Oct 18 12:21:45 
2016        (r307556)
+++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c     Tue Oct 18 12:26:22 
2016        (r307557)
@@ -475,6 +475,11 @@ get_fdt_resources(struct tegra124_cpufre
 static void
 tegra124_cpufreq_identify(driver_t *driver, device_t parent)
 {
+       phandle_t root;
+
+       root = OF_finddevice("/");
+       if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124"))
+               return;
 
        if (device_get_unit(parent) != 0)
                return;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to