1*2fba875aSbouyer /* $NetBSD: gcscpcibvar.h,v 1.2 2011/08/29 18:34:42 bouyer Exp $ */ 2efd9548bSbouyer /* $OpenBSD: gcscpcib.c,v 1.6 2007/11/17 17:02:47 mbalmer Exp $ */ 3efd9548bSbouyer 4efd9548bSbouyer /* 5efd9548bSbouyer * Copyright (c) 2008 Yojiro UO <yuo@nui.org> 6efd9548bSbouyer * Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org> 7efd9548bSbouyer * Copyright (c) 2007 Michael Shalayeff 8efd9548bSbouyer * All rights reserved. 9efd9548bSbouyer * 10efd9548bSbouyer * Permission to use, copy, modify, and distribute this software for any 11efd9548bSbouyer * purpose with or without fee is hereby granted, provided that the above 12efd9548bSbouyer * copyright notice and this permission notice appear in all copies. 13efd9548bSbouyer * 14efd9548bSbouyer * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 15efd9548bSbouyer * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 16efd9548bSbouyer * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 17efd9548bSbouyer * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 18efd9548bSbouyer * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN 19efd9548bSbouyer * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 20efd9548bSbouyer * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21efd9548bSbouyer */ 22efd9548bSbouyer 23efd9548bSbouyer struct gcscpcib_softc { 24efd9548bSbouyer struct timecounter sc_timecounter; 25efd9548bSbouyer bus_space_tag_t sc_iot; 26efd9548bSbouyer bus_space_handle_t sc_ioh; 27efd9548bSbouyer 28efd9548bSbouyer /* Watchdog Timer */ 29efd9548bSbouyer struct sysmon_wdog sc_smw; 30efd9548bSbouyer int sc_wdt_mfgpt; 31efd9548bSbouyer 32efd9548bSbouyer /* GPIO interface */ 33efd9548bSbouyer bus_space_tag_t sc_gpio_iot; 34efd9548bSbouyer bus_space_handle_t sc_gpio_ioh; 35efd9548bSbouyer struct gpio_chipset_tag sc_gpio_gc; 36efd9548bSbouyer gpio_pin_t sc_gpio_pins[AMD553X_GPIO_NPINS]; 37efd9548bSbouyer 38efd9548bSbouyer #if 0 39efd9548bSbouyer /* SMbus/i2c interface */ 40efd9548bSbouyer bus_space_tag_t sc_smbus_iot; 41efd9548bSbouyer bus_space_handle_t sc_smbus_ioh; 42efd9548bSbouyer i2c_addr_t sc_smbus_slaveaddr; /* address of smbus slave */ 43efd9548bSbouyer struct i2c_controller sc_i2c; /* i2c controller info */ 44efd9548bSbouyer krwlock_t sc_smbus_rwlock; 45efd9548bSbouyer #endif 46efd9548bSbouyer }; 47efd9548bSbouyer 48*2fba875aSbouyer void gcscpcib_attach(device_t, struct gcscpcib_softc *, bus_space_tag_t, int); 49*2fba875aSbouyer #define GCSCATTACH_NO_WDT 0x0001 /* do not attach watchdog */ 50efd9548bSbouyer 51efd9548bSbouyer uint64_t gcsc_rdmsr(uint); 52efd9548bSbouyer void gcsc_wrmsr(uint, uint64_t); 53