blob: 6ad334efafe9cf43316930f0524b1d4a67c1b02a [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
2-- Copyright (C) 2015-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
6-- the Free Software Foundation; version 2 of the License.
7--
8-- This program is distributed in the hope that it will be useful,
9-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-- GNU General Public License for more details.
12--
13
14with HW.GFX.GMA.Config;
15with HW.GFX.GMA.Registers;
16
17with HW.Debug;
18with GNAT.Source_Info;
19
20package body HW.GFX.GMA.PCH.LVDS is
21
22 PCH_LVDS_ENABLE : constant := 1 * 2 ** 31;
23 PCH_LVDS_TWO_CHANNEL : constant := 15 * 2 ** 2;
24
25 PCH_LVDS_MASK : constant Word32 :=
26 PCH_TRANSCODER_SELECT_MASK or
27 PCH_LVDS_ENABLE or
28 PCH_LVDS_TWO_CHANNEL;
29
30 ----------------------------------------------------------------------------
31
32 procedure On (Port_Cfg : Port_Config; FDI_Port : FDI_Port_Type)
33 is
34 Two_Channel : constant Word32 :=
35 (if Port_Cfg.Mode.Dotclock >= Config.LVDS_Dual_Threshold then
36 PCH_LVDS_TWO_CHANNEL else 0);
37 begin
38 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
39
40 Registers.Unset_And_Set_Mask
41 (Register => Registers.PCH_LVDS,
42 Mask_Unset => PCH_LVDS_MASK,
43 Mask_Set => PCH_LVDS_ENABLE or
44 PCH_TRANSCODER_SELECT (FDI_Port) or
45 Two_Channel);
46 end On;
47
48 ----------------------------------------------------------------------------
49
50 procedure Off
51 is
52 begin
53 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
54
55 Registers.Unset_Mask (Registers.PCH_LVDS, PCH_LVDS_ENABLE);
56 end Off;
57
58end HW.GFX.GMA.PCH.LVDS;