Aaron Durbin | 97651c5 | 2013-11-01 14:36:03 -0500 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 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 <console/console.h> |
| 21 | #include <device/device.h> |
| 22 | #include <device/pci.h> |
| 23 | #include <device/pci_ids.h> |
| 24 | |
| 25 | #include <baytrail/iosf.h> |
| 26 | #include <baytrail/ramstage.h> |
| 27 | |
| 28 | static void lpe_init(device_t dev) |
| 29 | { |
| 30 | uint32_t reg; |
| 31 | |
| 32 | /* Work around for Audio Clock. */ |
| 33 | reg = iosf_ccu_read(PLT_CLK_CTRL_3); |
| 34 | reg &= ~0xff; |
| 35 | reg |= PLT_CLK_CTRL_25MHZ_FREQ | PLT_CLK_CTRL_SELECT_FREQ; |
| 36 | iosf_ccu_write(PLT_CLK_CTRL_3, reg); |
| 37 | } |
| 38 | |
| 39 | static const struct device_operations device_ops = { |
| 40 | .read_resources = pci_dev_read_resources, |
| 41 | .set_resources = pci_dev_set_resources, |
| 42 | .enable_resources = NULL, |
| 43 | .init = lpe_init, |
| 44 | .enable = NULL, |
| 45 | .scan_bus = NULL, |
| 46 | .ops_pci = &soc_pci_ops, |
| 47 | }; |
| 48 | |
| 49 | static const struct pci_driver southcluster __pci_driver = { |
| 50 | .ops = &device_ops, |
| 51 | .vendor = PCI_VENDOR_ID_INTEL, |
| 52 | .device = LPE_DEVID, |
| 53 | }; |