blob: 5c5d0de48c4ef9a3679d726ed570509e9924bc1b [file] [log] [blame]
Ricardo Martins892d8d22012-08-06 05:40:07 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 Ricardo Martins <rasmartins@gmail.com>
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Ricardo Martins892d8d22012-08-06 05:40:07 +010015 */
16
17#include <arch/io.h>
18#include <console/console.h>
19#include <device/pci.h>
20#include <device/device.h>
21#include <boot/tables.h>
22
23/* SCH3114 runtime register (RTR) address. */
24#define SCH3114_RTR_ADDR (0x400)
25/* H/W Monitoring register block index. */
26#define SCH3114_RTR_HWM_IDX (SCH3114_RTR_ADDR + 0x70)
27/* H/W Monitoring register block data. */
28#define SCH3114_RTR_HWM_DAT (SCH3114_RTR_ADDR + 0x71)
29/* H/W Monitoring Ready/Lock/Start register. */
30#define SCH3114_HWM_RLS_REG (0x40)
31
32static void init(struct device *dev)
33{
34 /* SCH3114: enable hardware monitor. */
35 printk(BIOS_INFO, "Enabling SCH3114 hardware monitor\n");
36 outb(SCH3114_HWM_RLS_REG, SCH3114_RTR_HWM_IDX);
37 outb(inb(SCH3114_RTR_HWM_DAT) | 0x01, SCH3114_RTR_HWM_DAT);
38}
39
Paul Menzel528640d2013-02-23 21:31:23 +010040static void mainboard_enable(struct device *dev)
Ricardo Martins892d8d22012-08-06 05:40:07 +010041{
42 dev->ops->init = init;
43}
44
45struct chip_operations mainboard_ops = {
Paul Menzel528640d2013-02-23 21:31:23 +010046 .enable_dev = mainboard_enable,
Ricardo Martins892d8d22012-08-06 05:40:07 +010047};