common.c 716 B

12345678910111213141516171819202122232425262728293031
  1. /*
  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. #include <linux/of.h>
  9. #include <soc/tegra/common.h>
  10. static 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. { }
  16. };
  17. bool soc_is_tegra(void)
  18. {
  19. struct device_node *root;
  20. root = of_find_node_by_path("/");
  21. if (!root)
  22. return false;
  23. return of_match_node(tegra_machine_match, root) != NULL;
  24. }