blob: 7bfb154d6fa5ebe3ed6a78b38dd5177430801e3a [file] [log] [blame]
Thierry Redinga2686762014-07-16 14:01:44 +02001/*
2 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/of.h>
10
11#include <soc/tegra/common.h>
12
13static const struct of_device_id tegra_machine_match[] = {
14 { .compatible = "nvidia,tegra20", },
15 { .compatible = "nvidia,tegra30", },
16 { .compatible = "nvidia,tegra114", },
17 { .compatible = "nvidia,tegra124", },
Thierry Redingad09c8c2015-03-23 11:28:53 +010018 { .compatible = "nvidia,tegra132", },
Thierry Reding3a369982015-03-23 11:29:25 +010019 { .compatible = "nvidia,tegra210", },
Thierry Redinga2686762014-07-16 14:01:44 +020020 { }
21};
22
23bool soc_is_tegra(void)
24{
Yangtao Li9eb40fa2018-11-21 07:49:12 -050025 const struct of_device_id *match;
Thierry Redinga2686762014-07-16 14:01:44 +020026 struct device_node *root;
27
28 root = of_find_node_by_path("/");
29 if (!root)
30 return false;
31
Yangtao Li9eb40fa2018-11-21 07:49:12 -050032 match = of_match_node(tegra_machine_match, root);
33 of_node_put(root);
34
35 return match != NULL;
Thierry Redinga2686762014-07-16 14:01:44 +020036}