Duncan Laurie | 9fd7c0f | 2014-01-16 09:47:39 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Google Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <arch/io.h> |
| 22 | #include <bootstate.h> |
| 23 | #include <console/console.h> |
| 24 | #include <reg_script.h> |
| 25 | #include <baytrail/iosf.h> |
| 26 | |
| 27 | static const struct reg_script dptf_init_settings[] = { |
| 28 | /* SocThermInit */ |
| 29 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PTMC, 0x00030708), |
| 30 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_GFXT, 0x0000C000), |
| 31 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_VEDT, 0x00000004), |
| 32 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_ISPT, 0x00000004), |
Shawn Nematbakhsh | 51d787a | 2014-01-16 17:52:21 -0800 | [diff] [blame] | 33 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PTPS, 0x00000000), |
Duncan Laurie | 9fd7c0f | 2014-01-16 09:47:39 -0800 | [diff] [blame] | 34 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_TE_AUX3, 0x00061029), |
| 35 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_TTE_VRIccMax, 0x00061029), |
| 36 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_TTE_VRHot, 0x00061029), |
| 37 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_TTE_XXPROCHOT, 0x00061029), |
| 38 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_TTE_SLM0, 0x00001029), |
| 39 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_TTE_SLM1, 0x00001029), |
Shawn Nematbakhsh | 51d787a | 2014-01-16 17:52:21 -0800 | [diff] [blame] | 40 | /* ratio 11 = 1466mhz for mid and entry celeron */ |
| 41 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_SOC_POWER_BUDGET, 0x00000B00), |
Duncan Laurie | 9fd7c0f | 2014-01-16 09:47:39 -0800 | [diff] [blame] | 42 | REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_SOC_ENERGY_CREDIT, 0x00000002), |
| 43 | REG_SCRIPT_END, |
| 44 | }; |
| 45 | |
| 46 | static void dptf_init(void *unused) |
| 47 | { |
| 48 | printk(BIOS_DEBUG, "Applying SOC Thermal settings for DPTF.\n"); |
| 49 | reg_script_run(dptf_init_settings); |
| 50 | } |
| 51 | |
Aaron Durbin | 9ef9d85 | 2015-03-16 17:30:09 -0500 | [diff] [blame^] | 52 | BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_ENTRY, dptf_init, NULL); |