2016-07-20 09:55:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Atmel Corporation
|
|
|
|
* Wenyou.Yang <wenyou.yang@atmel.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <clk-uclass.h>
|
2017-05-17 23:18:03 +00:00
|
|
|
#include <dm.h>
|
2016-07-20 09:55:12 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
static ulong at91_master_clk_get_rate(struct clk *clk)
|
|
|
|
{
|
|
|
|
return gd->arch.mck_rate_hz;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct clk_ops at91_master_clk_ops = {
|
|
|
|
.get_rate = at91_master_clk_get_rate,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct udevice_id at91_master_clk_match[] = {
|
2017-04-14 06:53:23 +00:00
|
|
|
{ .compatible = "atmel,at91rm9200-clk-master" },
|
2016-07-20 09:55:12 +00:00
|
|
|
{ .compatible = "atmel,at91sam9x5-clk-master" },
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
|
|
|
U_BOOT_DRIVER(at91_master_clk) = {
|
|
|
|
.name = "at91-master-clk",
|
|
|
|
.id = UCLASS_CLK,
|
|
|
|
.of_match = at91_master_clk_match,
|
|
|
|
.ops = &at91_master_clk_ops,
|
|
|
|
};
|