^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2016-2018 Xilinx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __LINUX_CLK_ZYNQMP_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __LINUX_CLK_ZYNQMP_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/firmware/xlnx-zynqmp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) enum topology_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) TYPE_INVALID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) TYPE_MUX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) TYPE_PLL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) TYPE_FIXEDFACTOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) TYPE_DIV1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) TYPE_DIV2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) TYPE_GATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * struct clock_topology - Clock topology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * @type: Type of topology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * @flag: Topology flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * @type_flag: Topology type specific flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct clock_topology {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) u32 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) u32 flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) u32 type_flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u8 custom_type_flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) const char * const *parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) u8 num_parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) const struct clock_topology *nodes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) const char * const *parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) u8 num_parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) const struct clock_topology *nodes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct clk_hw *zynqmp_clk_register_divider(const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) u32 clk_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) const char * const *parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) u8 num_parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) const struct clock_topology *nodes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) const char * const *parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) u8 num_parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) const struct clock_topology *nodes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) u32 clk_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) const char * const *parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) u8 num_parents,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) const struct clock_topology *nodes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #endif