summaryrefslogtreecommitdiff
path: root/drivers/clk/at91/clk-main.c
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2020-09-07 17:46:39 +0300
committerEugen Hristev <eugen.hristev@microchip.com>2020-09-22 11:27:18 +0300
commit653bcce4085a5816a9fee560412fbfaa171db7bb (patch)
tree3d183896dde351144870a21f30bc39012c896ecd /drivers/clk/at91/clk-main.c
parent5d729f96299321af2c132fae4b56306e19a3f52b (diff)
downloadu-boot-653bcce4085a5816a9fee560412fbfaa171db7bb.tar.gz
clk: at91: move clock code to compat.c
Move clock code to compat.c to allow switching to CCF without mixing CCF code with non CCF code. This prepares the field for next commits. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Diffstat (limited to 'drivers/clk/at91/clk-main.c')
-rw-r--r--drivers/clk/at91/clk-main.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c
deleted file mode 100644
index b31a1cb682..0000000000
--- a/drivers/clk/at91/clk-main.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2016 Atmel Corporation
- * Wenyou.Yang <wenyou.yang@atmel.com>
- */
-
-#include <common.h>
-#include <clk-uclass.h>
-#include <dm.h>
-#include <linux/io.h>
-#include <mach/at91_pmc.h>
-#include "pmc.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static int main_osc_clk_enable(struct clk *clk)
-{
- struct pmc_platdata *plat = dev_get_platdata(clk->dev);
- struct at91_pmc *pmc = plat->reg_base;
-
- if (readl(&pmc->sr) & AT91_PMC_MOSCSELS)
- return 0;
-
- return -EINVAL;
-}
-
-static ulong main_osc_clk_get_rate(struct clk *clk)
-{
- return gd->arch.main_clk_rate_hz;
-}
-
-static struct clk_ops main_osc_clk_ops = {
- .enable = main_osc_clk_enable,
- .get_rate = main_osc_clk_get_rate,
-};
-
-static int main_osc_clk_probe(struct udevice *dev)
-{
- return at91_pmc_core_probe(dev);
-}
-
-static const struct udevice_id main_osc_clk_match[] = {
- { .compatible = "atmel,at91sam9x5-clk-main" },
- {}
-};
-
-U_BOOT_DRIVER(at91sam9x5_main_osc_clk) = {
- .name = "at91sam9x5-main-osc-clk",
- .id = UCLASS_CLK,
- .of_match = main_osc_clk_match,
- .probe = main_osc_clk_probe,
- .platdata_auto_alloc_size = sizeof(struct pmc_platdata),
- .ops = &main_osc_clk_ops,
-};