| 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 |
| 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 | |
| 14 | with HW.Time; |
| 15 | with HW.GFX.GMA.Registers; |
| 16 | |
| 17 | package body HW.GFX.GMA.SPLL is |
| 18 | |
| 19 | SPLL_CTL_PLL_ENABLE : constant := 1 * 2 ** 31; |
| 20 | SPLL_CTL_REF_SEL_MASK : constant := 3 * 2 ** 28; |
| 21 | SPLL_CTL_REF_SEL_SSC : constant := 1 * 2 ** 28; |
| 22 | SPLL_CTL_REF_SEL_NON_SSC : constant := 2 * 2 ** 28; |
| 23 | SPLL_CTL_FREQ_SEL_MASK : constant := 3 * 2 ** 26; |
| 24 | SPLL_CTL_FREQ_SEL_810 : constant := 0 * 2 ** 26; |
| 25 | SPLL_CTL_FREQ_SEL_1350 : constant := 1 * 2 ** 26; |
| 26 | |
| 27 | procedure On is |
| 28 | begin |
| 29 | Registers.Write |
| 30 | (Register => Registers.SPLL_CTL, |
| 31 | Value => SPLL_CTL_PLL_ENABLE or |
| 32 | SPLL_CTL_REF_SEL_SSC or |
| 33 | SPLL_CTL_FREQ_SEL_1350); |
| 34 | Registers.Posting_Read (Registers.SPLL_CTL); |
| 35 | Time.U_Delay (20); |
| 36 | end On; |
| 37 | |
| 38 | procedure Off is |
| 39 | begin |
| 40 | Registers.Unset_Mask (Registers.SPLL_CTL, SPLL_CTL_PLL_ENABLE); |
| 41 | end Off; |
| 42 | |
| 43 | end HW.GFX.GMA.SPLL; |