blob: 60b7dca6f55b08849f3746f796468ad6545314bb [file] [log] [blame]
Tim Wawrzynczak605660b2022-06-08 12:48:19 -06001--
2-- Copyright (C) 2022 Google, LLC
3--
4-- This program is free software; you can redistribute it and/or modify
5-- it under the terms of the GNU General Public License as published by
6-- the Free Software Foundation; either version 2 of the License, or
7-- (at your option) any later version.
8--
9-- This program is distributed in the hope that it will be useful,
10-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-- GNU General Public License for more details.
13--
14
15private package HW.GFX.GMA.PLLs
16with
17 Abstract_State => (State with Part_Of => GMA.State)
18is
19
20 -- XXX: Types should be private (but that triggers a bug in SPARK GPL 2016)
Tim Wawrzynczak68deeb42022-09-09 10:59:08 -060021 type T is (Invalid_PLL, DPLL0, DPLL1, TCPLL1, TCPLL2, TCPLL3, TCPLL4, TCPLL5, TCPLL6);
22 subtype Configurable_DPLLs is T range T'Succ (Invalid_PLL) .. T'Last;
23 subtype Combo_DPLLs is T range DPLL0 .. DPLL1;
24 subtype DKL_DPLLs is T range TCPLL1 .. TCPLL6;
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060025 Invalid : constant T := Invalid_PLL;
26
27 procedure Initialize
28 with
29 Global => (Output => State);
30
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060031 procedure Alloc
32 (Port_Cfg : in Port_Config;
33 PLL : out T;
34 Success : out Boolean);
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060035
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060036 procedure Free (PLL : T);
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060037
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060038 procedure All_Off;
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060039
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060040 function Register_Value (PLL : T) return Word32;
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060041
42end HW.GFX.GMA.PLLs;