clk-master.c 746 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2016 Atmel Corporation
  4. * Wenyou.Yang <wenyou.yang@atmel.com>
  5. */
  6. #include <common.h>
  7. #include <clk-uclass.h>
  8. #include <dm.h>
  9. DECLARE_GLOBAL_DATA_PTR;
  10. static ulong at91_master_clk_get_rate(struct clk *clk)
  11. {
  12. return gd->arch.mck_rate_hz;
  13. }
  14. static struct clk_ops at91_master_clk_ops = {
  15. .get_rate = at91_master_clk_get_rate,
  16. };
  17. static const struct udevice_id at91_master_clk_match[] = {
  18. { .compatible = "atmel,at91rm9200-clk-master" },
  19. { .compatible = "atmel,at91sam9x5-clk-master" },
  20. {}
  21. };
  22. U_BOOT_DRIVER(atmel_at91rm9200_clk_master) = {
  23. .name = "atmel_at91rm9200_clk_master",
  24. .id = UCLASS_CLK,
  25. .of_match = at91_master_clk_match,
  26. .ops = &at91_master_clk_ops,
  27. };