blob: 3dc54f59cafee1d72dc2f2dd852c18f70b9326e3 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-only
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#include <linux/of.h>
7
8#include <soc/tegra/common.h>
9
10static const struct of_device_id tegra_machine_match[] = {
11 { .compatible = "nvidia,tegra20", },
12 { .compatible = "nvidia,tegra30", },
13 { .compatible = "nvidia,tegra114", },
14 { .compatible = "nvidia,tegra124", },
15 { .compatible = "nvidia,tegra132", },
16 { .compatible = "nvidia,tegra210", },
17 { }
18};
19
20bool soc_is_tegra(void)
21{
David Brazdil0f672f62019-12-10 10:32:29 +000022 const struct of_device_id *match;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000023 struct device_node *root;
24
25 root = of_find_node_by_path("/");
26 if (!root)
27 return false;
28
David Brazdil0f672f62019-12-10 10:32:29 +000029 match = of_match_node(tegra_machine_match, root);
30 of_node_put(root);
31
32 return match != NULL;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000033}