xref: /freebsd/sys/dev/firmware/xilinx/zynqmp_firmware_if.m (revision a4e5e0106ac7145f56eb39a691e302cabb4635be)
1#-
2# SPDX-License-Identifier: BSD-2-Clause
3#
4# Copyright (c) 2023 Beckhoff Automation GmbH & Co. KG
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
12#    notice, this list of conditions and the following disclaimer in the
13#    documentation and/or other materials provided with the distribution.
14#
15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26
27INTERFACE zynqmp_firmware;
28
29METHOD int clock_enable {
30	device_t dev;
31	uint32_t clkid;
32};
33
34METHOD int clock_disable {
35	device_t dev;
36	uint32_t clkid;
37};
38
39METHOD int clock_getstate {
40	device_t dev;
41	uint32_t clkid;
42	bool *enabled;
43};
44
45METHOD int clock_setdivider {
46	device_t dev;
47	uint32_t clkid;
48	uint32_t div;
49};
50
51METHOD int clock_getdivider {
52	device_t dev;
53	uint32_t clkid;
54	uint32_t *div;
55};
56
57METHOD int clock_setparent {
58	device_t dev;
59	uint32_t clkid;
60	uint32_t parentid;
61};
62
63METHOD int clock_getparent {
64	device_t dev;
65	uint32_t clkid;
66	uint32_t *parentid;
67};
68
69METHOD int pll_get_mode {
70	device_t dev;
71	uint32_t pllid;
72	uint32_t *mode;
73};
74
75METHOD int pll_get_frac_data {
76	device_t dev;
77	uint32_t pllid;
78	uint32_t *data;
79};
80
81METHOD int clock_get_fixedfactor {
82	device_t dev;
83	uint32_t clkid;
84	uint32_t *mult;
85	uint32_t *div;
86};
87
88METHOD int query_data {
89	device_t dev;
90	uint32_t qid;
91	uint32_t arg1;
92	uint32_t arg2;
93	uint32_t arg3;
94	uint32_t *data;
95};
96
97METHOD int reset_assert {
98	device_t dev;
99	uint32_t resetid;
100	bool enable;
101};
102
103METHOD int reset_get_status {
104	device_t dev;
105	uint32_t resetid;
106	bool *status;
107};
108