common.c 717 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
  4. */
  5. #include <linux/of.h>
  6. #include <soc/tegra/common.h>
  7. static const struct of_device_id tegra_machine_match[] = {
  8. { .compatible = "nvidia,tegra20", },
  9. { .compatible = "nvidia,tegra30", },
  10. { .compatible = "nvidia,tegra114", },
  11. { .compatible = "nvidia,tegra124", },
  12. { .compatible = "nvidia,tegra132", },
  13. { .compatible = "nvidia,tegra210", },
  14. { }
  15. };
  16. bool soc_is_tegra(void)
  17. {
  18. const struct of_device_id *match;
  19. struct device_node *root;
  20. root = of_find_node_by_path("/");
  21. if (!root)
  22. return false;
  23. match = of_match_node(tegra_machine_match, root);
  24. of_node_put(root);
  25. return match != NULL;
  26. }