Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Wenyou Yang | 9e5935c | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Atmel Corporation |
| 4 | * Wenyou.Yang <wenyou.yang@atmel.com> |
Wenyou Yang | 9e5935c | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <clk-uclass.h> |
Simon Glass | 9d92245 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 9 | #include <dm.h> |
Wenyou Yang | 9e5935c | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 10 | |
| 11 | DECLARE_GLOBAL_DATA_PTR; |
| 12 | |
| 13 | static ulong at91_master_clk_get_rate(struct clk *clk) |
| 14 | { |
| 15 | return gd->arch.mck_rate_hz; |
| 16 | } |
| 17 | |
| 18 | static struct clk_ops at91_master_clk_ops = { |
| 19 | .get_rate = at91_master_clk_get_rate, |
| 20 | }; |
| 21 | |
| 22 | static const struct udevice_id at91_master_clk_match[] = { |
Wenyou Yang | a9513d4 | 2017-04-14 14:53:23 +0800 | [diff] [blame] | 23 | { .compatible = "atmel,at91rm9200-clk-master" }, |
Wenyou Yang | 9e5935c | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 24 | { .compatible = "atmel,at91sam9x5-clk-master" }, |
| 25 | {} |
| 26 | }; |
| 27 | |
| 28 | U_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 | }; |