/*-
* Copyright (c) 2005 David Young. All rights reserved.
*
* This code was written by David Young.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
* YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
/*
* Register definitions for the AMD Geode SC1100.
*/
/* AMD Geode SC1100 X-Bus PCI Configuration Register: General
* Configuration Block Scratchpad. Set to 0x00000000 after chip reset.
* The BIOS writes the base address of the General Configuration
* Block to this register.
*/
#define SC1100_XBUS_CBA_SCRATCHPAD 0x64
/* 32kHz clock power-down, 0: clock is enabled, 1: clock is disabled. */
#define SC1100_WDCNFG_WD32KPD __BIT(8)
/* Watchdog event type 1, and type 2
*
* 00: no action (default after POR# is asserted)
* 01: interrupt
* 10: SMI
* 11: system reset
*/
#define SC1100_WDCNFG_WDTYPE2_MASK __BITS(7,6)
#define SC1100_WDCNFG_WDTYPE1_MASK __BITS(5,4)
/* Watchdog timer prescaler
*
* The prescaler divisor is 2**WDPRES. 1110 (0xe) and 1111 (0xf) are
* reserved values.
*/
#define SC1100_WDCNFG_WDPRES_MASK __BITS(3,0)
#define SC1100_WDCNFG_WDPRES_MAX 0xd
/* Watchdog status register, 8 bits. */
#define SC1100_GCB_WDSTS 0x04
#define SC1100_WDSTS_RESERVED __BIT(7,4) /* write as read */
/* Set to 1 when watchdog reset is asserted. Read-only. Reset either by
* POR# (power-on reset) or by writing 0 to WDOVF.
*/
#define SC1100_WDSTS_WDRST __BIT(3)
/* Set to 1 when watchdog SMI is asserted. Read-only. Reset either by
* POR# (power-on reset) or by writing 0 to WDOVF.
*/
#define SC1100_WDSTS_WDSMI __BIT(2)
/* Set to 1 when watchdog interrupt is asserted. Read-only. Reset either by
* POR# (power-on reset) or by writing 0 to WDOVF.
*/
#define SC1100_WDSTS_WDINT __BIT(1)
/* Set to 1 when watchdog overflow is asserted. Reset either by
* POR# (power-on reset) or by writing 1 to this bit.
*/
#define SC1100_WDSTS_WDOVF __BIT(0)
/*
* Helpful constants
*/
/* maximum watchdog interval in seconds */
#define SC1100_WDIVL_MAX ((1 << SC1100_WDCNFG_WDPRES_MAX) * \
UINT16_MAX / SC1100_WDCLK_HZ)
/* watchdog clock rate in Hertz */
#define SC1100_WDCLK_HZ 32000
/*
* high resolution timer
*/
#define SC1100_GCB_TMVALUE_L 0x08 /* timer value */