blob: 4fa33c4715c91fd54fb2b308444154ca374a25a0 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Wenyou Yang9e5935c2016-07-20 17:55:12 +08002/*
3 * Copyright (C) 2016 Atmel Corporation
4 * Wenyou.Yang <wenyou.yang@atmel.com>
Wenyou Yang9e5935c2016-07-20 17:55:12 +08005 */
6
7#include <common.h>
8#include <clk-uclass.h>
Simon Glass9d922452017-05-17 17:18:03 -06009#include <dm.h>
Wenyou Yang9e5935c2016-07-20 17:55:12 +080010
11DECLARE_GLOBAL_DATA_PTR;
12
13static ulong at91_master_clk_get_rate(struct clk *clk)
14{
15 return gd->arch.mck_rate_hz;
16}
17
18static struct clk_ops at91_master_clk_ops = {
19 .get_rate = at91_master_clk_get_rate,
20};
21
22static const struct udevice_id at91_master_clk_match[] = {
Wenyou Yanga9513d42017-04-14 14:53:23 +080023 { .compatible = "atmel,at91rm9200-clk-master" },
Wenyou Yang9e5935c2016-07-20 17:55:12 +080024 { .compatible = "atmel,at91sam9x5-clk-master" },
25 {}
26};
27
28U_BOOT_DRIVER(at91_master_clk) = {
29 .name = "at91-master-clk",
30 .id = UCLASS_CLK,
31 .of_match = at91_master_clk_match,
32 .ops = &at91_master_clk_ops,
33};