| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 1 | -- |
| 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 |
| Nico Huber | 125a29e | 2016-10-18 00:23:54 +0200 | [diff] [blame] | 6 | -- the Free Software Foundation; either version 2 of the License, or |
| 7 | -- (at your option) any later version. |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 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 | |
| 15 | with HW.Time; |
| 16 | with HW.GFX.GMA.Registers; |
| 17 | |
| 18 | package body HW.GFX.GMA.SPLL is |
| 19 | |
| 20 | SPLL_CTL_PLL_ENABLE : constant := 1 * 2 ** 31; |
| 21 | SPLL_CTL_REF_SEL_MASK : constant := 3 * 2 ** 28; |
| 22 | SPLL_CTL_REF_SEL_SSC : constant := 1 * 2 ** 28; |
| 23 | SPLL_CTL_REF_SEL_NON_SSC : constant := 2 * 2 ** 28; |
| 24 | SPLL_CTL_FREQ_SEL_MASK : constant := 3 * 2 ** 26; |
| 25 | SPLL_CTL_FREQ_SEL_810 : constant := 0 * 2 ** 26; |
| 26 | SPLL_CTL_FREQ_SEL_1350 : constant := 1 * 2 ** 26; |
| 27 | |
| 28 | procedure On is |
| 29 | begin |
| 30 | Registers.Write |
| 31 | (Register => Registers.SPLL_CTL, |
| 32 | Value => SPLL_CTL_PLL_ENABLE or |
| 33 | SPLL_CTL_REF_SEL_SSC or |
| 34 | SPLL_CTL_FREQ_SEL_1350); |
| 35 | Registers.Posting_Read (Registers.SPLL_CTL); |
| 36 | Time.U_Delay (20); |
| 37 | end On; |
| 38 | |
| 39 | procedure Off is |
| 40 | begin |
| 41 | Registers.Unset_Mask (Registers.SPLL_CTL, SPLL_CTL_PLL_ENABLE); |
| 42 | end Off; |
| 43 | |
| 44 | end HW.GFX.GMA.SPLL; |