@@ -9,6 +9,7 @@
#include <linux/of.h>
#include <soc/tegra/common.h>
+#include <soc/tegra/fuse.h>
static const struct of_device_id tegra_machine_match[] = {
{ .compatible = "nvidia,tegra20", },
@@ -34,3 +35,25 @@ bool soc_is_tegra(void)
return match != NULL;
}
+
+static const struct of_device_id tegra_machine_match_auto[] = {
+ { .compatible = "nvidia,tegra20auto", },
+ { .compatible = "nvidia,tegra30auto", },
+ { },
+};
+
+bool soc_is_tegra_auto(void)
+{
+ struct device_node *root;
+ bool id_match = false;
+
+ root = of_find_node_by_path("/");
+
+ if (root && of_match_node(tegra_machine_match_auto, root))
+ id_match = true;
+
+ pr_debug("%s of_device_id match %d, tegra_sku_info.is_automotive %d\n",
+ __func__, id_match, tegra_sku_info.is_automotive);
+
+ return id_match || tegra_sku_info.is_automotive;
+}
@@ -110,6 +110,8 @@ void __init tegra_init_revision(void)
tegra_sku_info.revision = rev;
+ tegra_sku_info.is_automotive = false;
+
tegra_sku_info.sku_id = tegra_fuse_read_early(FUSE_SKU_INFO);
}
@@ -10,5 +10,6 @@
#define __SOC_TEGRA_COMMON_H__
bool soc_is_tegra(void);
+bool soc_is_tegra_auto(void);
#endif /* __SOC_TEGRA_COMMON_H__ */
@@ -56,6 +56,7 @@ struct tegra_sku_info {
int gpu_speedo_id;
int gpu_speedo_value;
enum tegra_revision revision;
+ bool is_automotive;
};
u32 tegra_read_straps(void);