1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2016 Atmel Corporation
4 * Wenyou.Yang <wenyou.yang@atmel.com>
11 #include <linux/bitops.h>
14 /* Keep a range of 256 available clocks for every clock type. */
15 #define AT91_TO_CLK_ID(_t, _i) (((_t) << 8) | ((_i) & 0xff))
16 #define AT91_CLK_ID_TO_DID(_i) ((_i) & 0xff)
19 struct at91_pmc *reg_base;
20 struct regmap *regmap_sfr;
23 int at91_pmc_core_probe(struct udevice *dev);
24 int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name);
26 int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args);
27 int at91_clk_probe(struct udevice *dev);
29 int at91_clk_mux_val_to_index(const u32 *table, u32 num_parents, u32 val);
30 int at91_clk_mux_index_to_val(const u32 *table, u32 num_parents, u32 index);
32 void pmc_read(void __iomem *base, unsigned int off, unsigned int *val);
33 void pmc_write(void __iomem *base, unsigned int off, unsigned int val);
34 void pmc_update_bits(void __iomem *base, unsigned int off, unsigned int mask,