29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * CDDL HEADER START
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * The contents of this file are subject to the terms of the
29949e866e40b95795203f3ee46f44a197c946e4stevel * Common Development and Distribution License (the "License").
29949e866e40b95795203f3ee46f44a197c946e4stevel * You may not use this file except in compliance with the License.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
29949e866e40b95795203f3ee46f44a197c946e4stevel * or http://www.opensolaris.org/os/licensing.
29949e866e40b95795203f3ee46f44a197c946e4stevel * See the License for the specific language governing permissions
29949e866e40b95795203f3ee46f44a197c946e4stevel * and limitations under the License.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * When distributing Covered Code, include this CDDL HEADER in each
29949e866e40b95795203f3ee46f44a197c946e4stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
29949e866e40b95795203f3ee46f44a197c946e4stevel * If applicable, add the following below this CDDL HEADER, with the
29949e866e40b95795203f3ee46f44a197c946e4stevel * fields enclosed by brackets "[]" replaced with your own identifying
29949e866e40b95795203f3ee46f44a197c946e4stevel * information: Portions Copyright [yyyy] [name of copyright owner]
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * CDDL HEADER END
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Use is subject to license terms.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifndef _SYS_AC_H
29949e866e40b95795203f3ee46f44a197c946e4stevel#define _SYS_AC_H
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#pragma ident "%Z%%M% %I% %E% SMI"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifdef __cplusplus
29949e866e40b95795203f3ee46f44a197c946e4stevelextern "C" {
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* useful debugging stuff */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_ATTACH_DEBUG 0x1
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_REGISTERS_DEBUG 0x2
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * OBP supplies us with two register sets for the AC nodes. They are:
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0 miscellaneous regs
29949e866e40b95795203f3ee46f44a197c946e4stevel * 1 Cache tags
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * We do not use the cache tags for anything in the kernel, so we
29949e866e40b95795203f3ee46f44a197c946e4stevel * do not map them in.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Macros for physical acccess, fhc.h has to be present */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFFSET 0x00001000000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_CENTRAL 0x80000000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_ARB_FAST 0x00002000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BCSR(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_OFFSET + AC_OFF_BCSR)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Register set 0 Offsets */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_BRCS 0x10
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_BCSR 0x20
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_ESR 0x30
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_EMR 0x40
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_MEMCTL 0x60
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_MEMDEC0 0x70
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_MEMDEC1 0x80
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_UPA0 0x2000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_UPA1 0x4000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_CNTR 0x6000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OFF_MCCR 0x6020
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Use predefined strings to name the kstats from this driver. */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_KSTAT_NAME "address_controller"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MEMCTL_KSTAT_NAMED "acmemctl"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MEMDECODE0_KSTAT_NAMED "acmemdecode0"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MEMDECODE1_KSTAT_NAMED "acmemdecode1"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CNTR_KSTAT_NAMED "accounter"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MCCR_KSTAT_NAMED "acmccr"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BANK_0_KSTAT_NAMED "acbank0"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BANK_1_KSTAT_NAMED "acbank1"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* used for the picN kstats */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_NUM_PICS 2
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_COUNTER_TO_PIC0(CNTR) ((CNTR) & 0xFFFFFFFFULL)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_COUNTER_TO_PIC1(CNTR) ((CNTR) >> 32)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* used to clear/set the pcr */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_CLEAR_PCR(PCR) ((PCR) & ~(0x3F3F))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_SET_HOT_PLUG(PCR) ((PCR) | (0x3F3F))
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* used for programming the pic */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_SET_PIC_BUS_PAUSE(BRD) (0x80000000LL - 0x9ac4 - ((BRD) << 3))
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* defines for AC Board Configuration and Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define NO_CACHE 0
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CACHE_512K 2
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CACHE_1M 3
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CACHE_2M 4
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CACHE_4M 5
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CACHE_8M 6
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CACHE_16M 7
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define ARB_MASTER 0x8000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define ARB_INIT 0x4000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define ARB_FAST 0x2000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FTC_CPAR 0x0200
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_CSR_REFEN (1ULL << 27)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* defines for Memory decode registers */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_VALID 0x8000000000000000ULL
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* size of a memory SIMM group */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define RASIZE0(memctl) (8 << ((((memctl) >> 8) & 0x7) << 1))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define RASIZE1(memctl) (8 << ((((memctl) >> 11) & 0x7) << 1))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define RATBL0(memctl) (((memctl) >> 8) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define RATBL1(memctl) (((memctl) >> 11) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Interleave factor of a memory SIMM group.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Possible values are 1, 2, 4, 8, and 16. 1 means not interleaved.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Larger groups can be interleaved with smaller groups. Groups
29949e866e40b95795203f3ee46f44a197c946e4stevel * on the same board can be interleaved as well.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define INTLV0(memctl) (1 << ((memctl) & 0x7))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define INTLV1(memctl) (1 << (((memctl) >> 3) & 0x7))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define INTVAL0(memctl) ((memctl) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define INTVAL1(memctl) (((memctl) >> 3) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Physical base mask of a memory SIMM group. Note that this is
29949e866e40b95795203f3ee46f44a197c946e4stevel * not the real physical base, and is just used to match up the
29949e866e40b95795203f3ee46f44a197c946e4stevel * interleaving of groups. The mask bits (UK) are used to mask
29949e866e40b95795203f3ee46f44a197c946e4stevel * out the match (UM) field so that the bases can be compared.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_UK(memdec) (((memdec) >> 39) & 0xFFF)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_UM(memdec) (((memdec) >> 12) & 0x7FFF)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_BASE(memdec) (GRP_UM(memdec) & ~(GRP_UK(memdec)))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_LK(memdec) (((memdec) >> 6) & 0xf)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_LM(memdec) ((memdec) & 0xf)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_LBASE(memdec) (GRP_LM(memdec) & ~(GRP_LK(memdec)))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_REALBASE(m) ((GRP_BASE(m) << 26) | (GRP_LBASE(m) << 6))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_UK2SPAN(memdec) ((GRP_UK(memdec) + 1) << 26)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_SPANMB(memdec) (GRP_UK2SPAN(memdec) >> 20)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * memory states and conditions for sunfire memory system
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum ac_bank_id { Bank0 = 0, Bank1 = 1 };
29949e866e40b95795203f3ee46f44a197c946e4stevelenum ac_bank_status { StUnknown = 0, StNoMem, StBad, StActive, StSpare };
29949e866e40b95795203f3ee46f44a197c946e4stevelenum ac_bank_condition { ConUnknown = 0, ConOK, ConFailing, ConFailed,
29949e866e40b95795203f3ee46f44a197c946e4stevel ConTest, ConBad };
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * AC memory bank ioctl interface.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* 'G' (for gigabytes!) does not appear to be used elsewhere in the kernel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_IOC ('G'<<8)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * For all AC_MEM_ ioctls the arg pointer points to a sysc_cfga_cmd_t
29949e866e40b95795203f3ee46f44a197c946e4stevel * except for AC_MEM_ADMIN_VER. The private pointer then points to a
29949e866e40b95795203f3ee46f44a197c946e4stevel * structure of the appropriate type, if required.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_ADMIN_VER (AC_IOC|0) /* arg is &ac_mem_version_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_CONFIGURE (AC_IOC|1) /* private == NULL */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_UNCONFIGURE (AC_IOC|2) /* private == NULL */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_STAT (AC_IOC|3) /* ac_stat_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_TEST_START (AC_IOC|4) /* ac_mem_test_start_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_TEST_STOP (AC_IOC|5) /* ac_mem_test_stop_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_TEST_READ (AC_IOC|6) /* ac_mem_test_read_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_TEST_WRITE (AC_IOC|7) /* ac_mem_test_write_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_EXERCISE (AC_IOC|128) /* various */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_OUTPUT_LEN MAXPATHLEN /* output str len */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum {
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_DEFAULT = 0, /* generic errors */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_INTRANS, /* hardware in transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_UTHREAD, /* can't stop user thread */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KTHREAD, /* can't stop kernel thread */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_SUSPEND, /* can't suspend a device */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_RESUME, /* can't resume a device */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_POWER, /* not enough power for slot */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_COOLING, /* not enough cooling for slot */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_PRECHARGE, /* not enough precharge for slot */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_HOTPLUG, /* Hot Plug Unavailable */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_HW_COMPAT, /* incompatible hardware found during dr */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_NON_DR_PROM, /* prom not support Dynamic Reconfiguration */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_CORE_RESOURCE, /* core resource cannot be removed */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_PROM, /* error encountered in OBP/POST */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_DR_INIT, /* error encountered in sysc_dr_init op */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_NDI_ATTACH, /* error encountered in NDI attach operations */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_NDI_DETACH, /* error encountered in NDI detach operations */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_RSTATE, /* wrong receptacle state */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_OSTATE, /* wrong occupant state */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_COND, /* invalid condition */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_BD, /* invalid board id */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_BD_TYPE, /* invalid board type */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_BD_STATE, /* invalid board state */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_MEM_PERM, /* no write permission */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_MEM_BK, /* invalid memory bank */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_MEM_TEST, /* invalid memory test id */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_MEM_TEST_PAR, /* invalid memory test parameter(s) */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_CANCELLED, /* kphysm_del_cancel (for complete) */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_REFUSED, /* kphysm_pre_del failed (for complete) */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_SPAN, /* memory already in use (add) */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_DUP, /* memory span duplicate (delete) */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_FAULT, /* memory access test failed (add) */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_RESOURCE, /* some resource was not available */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NOTSUP, /* operation not supported */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NOHANDLES, /* cannot allocate any more handles */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NONRELOC, /* non-relocatable pages in span */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_HANDLE, /* bad handle supplied */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_BUSY, /* memory in span is being deleted */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NOTVIABLE, /* vM viability test failed */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_SEQUENCE, /* function called out of sequence */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NOWORK, /* no pages to delete */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NOTFINISHED, /* thread not finished */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_KPM_NOTRUNNING, /* thread not running */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_VMEM, /* insufficient virtual memory */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_INTR, /* delete interrupt by user */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_TIMEOUT, /* delete timed out */
29949e866e40b95795203f3ee46f44a197c946e4stevel AC_ERR_MEM_DEINTLV /* could not de-interleave memory */
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_err_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Config admin command structure for AC_MEM ioctls.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct ac_cfga_cmd {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t force:1; /* force this state transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t test:1; /* Need to test hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevel int arg; /* generic data for test */
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_err_t errtype; /* error code returned */
29949e866e40b95795203f3ee46f44a197c946e4stevel char *outputstr; /* output returned from ioctl */
29949e866e40b95795203f3ee46f44a197c946e4stevel void *private; /* command private data */
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_cfga_cmd_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct ac_cfga_cmd32 {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t force:1; /* force this state transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t test:1; /* Need to test hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevel int arg; /* generic data for test */
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_err_t errtype; /* error code returned */
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr32_t outputstr; /* output returned from ioctl */
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr32_t private; /* command private data */
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_cfga_cmd32_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef uint_t ac_mem_version_t; /* platform interface rev */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEM_ADMIN_VERSION 1
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef uint_t mem_test_handle_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t module_id;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t afsr;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t afar;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t udbh_error_reg;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t udbl_error_reg;
29949e866e40b95795203f3ee46f44a197c946e4stevel} sunfire_processor_error_regs_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * page_size gives the requires size for the read or write buffer.
29949e866e40b95795203f3ee46f44a197c946e4stevel * A read can be restricted to one or more line_size units starting
29949e866e40b95795203f3ee46f44a197c946e4stevel * at a multiple of line_size units from the start of the page.
29949e866e40b95795203f3ee46f44a197c946e4stevel * afar_base is the physical base of the bank being tested so
29949e866e40b95795203f3ee46f44a197c946e4stevel * that the afar value can be translated to an offset into the bank.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel mem_test_handle_t handle;
29949e866e40b95795203f3ee46f44a197c946e4stevel pid_t tester_pid; /* PID of test starter */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cond_t prev_condition;
29949e866e40b95795203f3ee46f44a197c946e4stevel u_longlong_t bank_size; /* bytes */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t page_size; /* bytes */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t line_size; /* bytes */
29949e866e40b95795203f3ee46f44a197c946e4stevel u_longlong_t afar_base;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_mem_test_start_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel mem_test_handle_t handle;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cond_t condition;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_mem_test_stop_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * line_offset is in the range 0 - (page_size/line_size)-1
29949e866e40b95795203f3ee46f44a197c946e4stevel * line_count is in the range 1 - (page_size/line_size)
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel u_longlong_t page_num;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t line_offset;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t line_count;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_test_addr_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Data will be transferred in/out of the buffer at:
29949e866e40b95795203f3ee46f44a197c946e4stevel * (page_buf + (line_offset*line_size))
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel mem_test_handle_t handle;
29949e866e40b95795203f3ee46f44a197c946e4stevel void *page_buf;
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_test_addr_t address;
29949e866e40b95795203f3ee46f44a197c946e4stevel sunfire_processor_error_regs_t *error_buf;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_mem_test_read_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel mem_test_handle_t handle;
29949e866e40b95795203f3ee46f44a197c946e4stevel void *page_buf;
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_test_addr_t address;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_mem_test_write_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifdef _SYSCALL32
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Kernel's view of ILP32 structure version. */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel mem_test_handle_t handle;
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr32_t page_buf; /* void * */
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_test_addr_t address;
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr32_t error_buf; /* sunfire_processor_error_regs_t */
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_mem_test_read32_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel mem_test_handle_t handle;
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr32_t page_buf; /* void * */
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_test_addr_t address;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_mem_test_write32_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _SYSCALL32 */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* structure returned from AC_MEM_STAT ioctl */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_rstate_t rstate;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_ostate_t ostate;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cond_t condition;
29949e866e40b95795203f3ee46f44a197c946e4stevel time_t status_time;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t board;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t real_size;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t use_size;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t busy; /* add/delete in progress */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t page_size; /* bytes */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t phys_pages;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t managed;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t nonrelocatable;
29949e866e40b95795203f3ee46f44a197c946e4stevel /* to supply address, group, info */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t ac_memctl;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t ac_decode0;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t ac_decode1;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_stat_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifdef _SYSCALL32
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Kernel's view of ILP32 structure version. */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_rstate_t rstate;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_ostate_t ostate;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cond_t condition;
29949e866e40b95795203f3ee46f44a197c946e4stevel time32_t status_time;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t board;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t real_size;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t use_size;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t busy; /* add/delete in progress */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t page_size; /* bytes */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t phys_pages;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t managed;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t nonrelocatable;
29949e866e40b95795203f3ee46f44a197c946e4stevel /* to supply address, group, info */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t ac_memctl;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t ac_decode0;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint64_t ac_decode1;
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_stat32_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _SYSCALL32 */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Command values in cmd_cfga.arg for the AC_MEM_EXERCISE ioctl. */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_MEMX_RELOCATE_ALL 0
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Stats structure for AC_MEMX_RELOCATE_ALL (cmd_cfga.private != NULL). */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct ac_memx_relocate_stats {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t base;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t npgs;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t nopaget;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t nolock;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t isfree;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t reloc;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t noreloc;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* End of ioctl interface. */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#if defined(_KERNEL)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel ac_cfga_cmd_t cmd_cfga;
29949e866e40b95795203f3ee46f44a197c946e4stevel char *errbuf; /* internal error buffer */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct ac_soft_state *softsp;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t bank; /* Decoded bank number. */
29949e866e40b95795203f3ee46f44a197c946e4stevel} ac_cfga_pkt_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_ERR_SET(pkt, err) (pkt)->cmd_cfga.errtype = (err)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MEM_BOARD_VISIBLE(BD) \
29949e866e40b95795203f3ee46f44a197c946e4stevel ((BD)->sc.rstate == SYSC_CFGA_RSTATE_CONNECTED && \
29949e866e40b95795203f3ee46f44a197c946e4stevel (BD)->sc.ostate == SYSC_CFGA_OSTATE_CONFIGURED)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifndef TRUE
29949e866e40b95795203f3ee46f44a197c946e4stevel#define TRUE (1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifndef FALSE
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FALSE (0)
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BANK0_STATUS "bank-0-status"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BANK1_STATUS "bank-1-status"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BANK_NOMEM "nomem"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BANK_OK "ok"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BANK_SPARE "spare"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_BANK_FAILED "failed"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Test for a valid size setting. The size must be set as
29949e866e40b95795203f3ee46f44a197c946e4stevel * a contiguous number of bits starting at the least significant bit.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Adding one to such a number causes a carry to be propagated to
29949e866e40b95795203f3ee46f44a197c946e4stevel * the first zero bit, eg 00111 -> 01000. Thus for a correctly
29949e866e40b95795203f3ee46f44a197c946e4stevel * formed value, the AND of the two numbers is 0.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define GRP_SIZE_IS_SET(memdec) ((GRP_UK(memdec) & (GRP_UK(memdec) + 1)) == 0)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* set the decode register bits according to the desired bank layout */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SETUP_DECODE(addr, mb, intlv, group) \
29949e866e40b95795203f3ee46f44a197c946e4stevel ((((addr) >> 26) & 0x7fffULL) << 12) | /* UM */ \
29949e866e40b95795203f3ee46f44a197c946e4stevel ((((mb) >> 6) - 1ULL) << 39) | /* UK */ \
29949e866e40b95795203f3ee46f44a197c946e4stevel ((group) & 0xfULL) | /* LM */ \
29949e866e40b95795203f3ee46f44a197c946e4stevel ((0xfULL << (intlv) & 0xfULL) << 6) /* LK */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Driver minor number macros.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_GETINSTANCE(M) ((M) >> 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_GETBANK(M) ((M) & 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define AC_PUTINSTANCE(I) ((I) << 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Attachment point names.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define NAME_BANK0 "bank0"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define NAME_BANK1 "bank1"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Memory Database
29949e866e40b95795203f3ee46f44a197c946e4stevel * This information is generally accessed through the bd_list so we will
29949e866e40b95795203f3ee46f44a197c946e4stevel * just protect it by that for now.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct ac_mem_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int busy; /* A bank is in transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel time_t status_change; /* Time of last change */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_rstate_t rstate;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_ostate_t ostate;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cond_t condition;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t real_size; /* Real size in MB of bank */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t use_size; /* In use size in MB */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Structures used in the driver to manage the hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct ac_soft_state {
29949e866e40b95795203f3ee46f44a197c946e4stevel dev_info_t *dip; /* dev info of myself */
29949e866e40b95795203f3ee46f44a197c946e4stevel dev_info_t *pdip; /* dev info of my parent */
29949e866e40b95795203f3ee46f44a197c946e4stevel int board; /* Board number for this AC */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel /* fields protected by bd_list lock */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct ac_mem_info bank[2]; /* memory bank information */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Mapped addresses of registers */
29949e866e40b95795203f3ee46f44a197c946e4stevel void *ac_base; /* Base address of Address Controller */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint32_t *ac_id; /* ID register */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint64_t *ac_memctl; /* Memory Control */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint64_t *ac_memdecode0; /* Memory Decode 0 */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint64_t *ac_memdecode1; /* Memory Decode 1 */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint64_t *ac_counter; /* AC counter register */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint32_t *ac_mccr; /* AC Counter control */
29949e866e40b95795203f3ee46f44a197c946e4stevel kstat_t *ac_ksp;
29949e866e40b95795203f3ee46f44a197c946e4stevel kstat_t *ac_counters_ksp; /* performance counter kstat */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelextern void ac_blkcopy(caddr_t, caddr_t, uint_t, uint_t);
29949e866e40b95795203f3ee46f44a197c946e4stevelextern void ac_mapin(uint64_t, caddr_t);
29949e866e40b95795203f3ee46f44a197c946e4stevelextern void ac_unmap(caddr_t);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* kstat structure used by ac to pass data to user programs. */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct ac_kstat {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_memctl; /* AC Memory control */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_memdecode0; /* AC Memory Decode Bank 0 */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_memdecode1; /* AC Memory Decode Bank 1 */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_mccr; /* AC Mem Counter Control */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_counter; /* AC Counter */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_bank0_status;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named ac_bank1_status;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _KERNEL */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifdef __cplusplus
29949e866e40b95795203f3ee46f44a197c946e4stevel}
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _SYS_AC_H */