blob: d51b9cd81ba17a23c88c0b2df75d95c8abb49ab1 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
2-- Copyright (C) 2016 secunet Security Networks AG
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
Nico Huber125a29e2016-10-18 00:23:54 +02006-- the Free Software Foundation; either version 2 of the License, or
7-- (at your option) any later version.
Nico Huber83693c82016-10-08 22:17:55 +02008--
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
15with HW.GFX.GMA.Registers;
16
17package body HW.GFX.GMA.PLLs.DPLL_0 is
18
19 DPLL_CTRL1_DPLL0_LINK_RATE_MASK : constant := 7 * 2 ** 1;
20 DPLL_CTRL1_DPLL0_LINK_RATE_2700MHZ : constant := 0 * 2 ** 1;
21 DPLL_CTRL1_DPLL0_LINK_RATE_1350MHZ : constant := 1 * 2 ** 1;
22 DPLL_CTRL1_DPLL0_LINK_RATE_810MHZ : constant := 2 * 2 ** 1;
23 DPLL_CTRL1_DPLL0_LINK_RATE_1620MHZ : constant := 3 * 2 ** 1;
24 DPLL_CTRL1_DPLL0_LINK_RATE_1080MHZ : constant := 4 * 2 ** 1;
25 DPLL_CTRL1_DPLL0_LINK_RATE_2160MHZ : constant := 5 * 2 ** 1;
26 DPLL_CTRL1_DPLL0_OVERRIDE : constant := 1 * 2 ** 0;
27
28 procedure Check_Link_Rate
29 (Link_Rate : in DP_Bandwidth;
30 Success : out Boolean)
31 is
32 DPLL_Ctrl1 : Word32;
33 begin
34 Registers.Read (Registers.DPLL_CTRL1, DPLL_Ctrl1);
35
36 case DPLL_Ctrl1 and DPLL_CTRL1_DPLL0_LINK_RATE_MASK is
37 when DPLL_CTRL1_DPLL0_LINK_RATE_2700MHZ =>
38 Success := Link_Rate = DP_Bandwidth_5_4;
39 when DPLL_CTRL1_DPLL0_LINK_RATE_1350MHZ =>
40 Success := Link_Rate = DP_Bandwidth_2_7;
41 when DPLL_CTRL1_DPLL0_LINK_RATE_810MHZ =>
42 Success := Link_Rate = DP_Bandwidth_1_62;
43 when others =>
44 Success := False;
45 end case;
46 Success := Success and (DPLL_Ctrl1 and DPLL_CTRL1_DPLL0_OVERRIDE) /= 0;
47 end Check_Link_Rate;
48
49end HW.GFX.GMA.PLLs.DPLL_0;