1235073Sjmallett/*- 2235073Sjmallett * Copyright (c) 2008-2012 Juli Mallett <jmallett@FreeBSD.org> 3235073Sjmallett * All rights reserved. 4235073Sjmallett * 5235073Sjmallett * Redistribution and use in source and binary forms, with or without 6235073Sjmallett * modification, are permitted provided that the following conditions 7235073Sjmallett * are met: 8235073Sjmallett * 1. Redistributions of source code must retain the above copyright 9235073Sjmallett * notice, this list of conditions and the following disclaimer. 10235073Sjmallett * 2. Redistributions in binary form must reproduce the above copyright 11235073Sjmallett * notice, this list of conditions and the following disclaimer in the 12235073Sjmallett * documentation and/or other materials provided with the distribution. 13235073Sjmallett * 14235073Sjmallett * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15235073Sjmallett * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16235073Sjmallett * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17235073Sjmallett * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18235073Sjmallett * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19235073Sjmallett * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20235073Sjmallett * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21235073Sjmallett * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22235073Sjmallett * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23235073Sjmallett * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24235073Sjmallett * SUCH DAMAGE. 25235073Sjmallett * 26235073Sjmallett * $FreeBSD: releng/10.2/sys/dev/gxemul/disk/gxemul_diskreg.h 255212 2013-09-04 20:34:36Z gonzo $ 27235073Sjmallett */ 28235073Sjmallett 29235073Sjmallett#ifndef _DEV_GXEMUL_DISK_GXEMUL_DISK_H_ 30235073Sjmallett#define _DEV_GXEMUL_DISK_GXEMUL_DISK_H_ 31235073Sjmallett 32235073Sjmallett#define GXEMUL_DISK_DEV_BASE (0x13000000) 33235073Sjmallett 34235073Sjmallett#define GXEMUL_DISK_DEV_BLOCKSIZE (0x0200) 35235073Sjmallett 36235073Sjmallett#define GXEMUL_DISK_DEV_ID_START (0x0000) 37235073Sjmallett#define GXEMUL_DISK_DEV_ID_END (0x0100) 38235073Sjmallett 39255212Sgonzo#ifdef _LP64 40255212Sgonzo#define GXEMUL_DISK_DEV_OFFSET (0x0000) 41255212Sgonzo#else 42255212Sgonzo#define GXEMUL_DISK_DEV_OFFSET_LO (0x0000) 43255212Sgonzo#define GXEMUL_DISK_DEV_OFFSET_HI (0x0008) 44255212Sgonzo#endif 45235073Sjmallett#define GXEMUL_DISK_DEV_DISKID (0x0010) 46235073Sjmallett#define GXEMUL_DISK_DEV_START (0x0020) 47235073Sjmallett#define GXEMUL_DISK_DEV_STATUS (0x0030) 48235073Sjmallett#define GXEMUL_DISK_DEV_BLOCK (0x4000) 49235073Sjmallett 50255212Sgonzo#ifdef _LP64 51235073Sjmallett#define GXEMUL_DISK_DEV_FUNCTION(f) \ 52235073Sjmallett (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_DISK_DEV_BASE + (f)) 53235073Sjmallett#define GXEMUL_DISK_DEV_READ(f) \ 54235073Sjmallett (volatile uint64_t)*GXEMUL_DISK_DEV_FUNCTION(f) 55255212Sgonzo#else 56255212Sgonzo#define GXEMUL_DISK_DEV_FUNCTION(f) \ 57255212Sgonzo (volatile uint32_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_DISK_DEV_BASE + (f)) 58255212Sgonzo#define GXEMUL_DISK_DEV_READ(f) \ 59255212Sgonzo (volatile uint32_t)*GXEMUL_DISK_DEV_FUNCTION(f) 60255212Sgonzo#endif 61235073Sjmallett#define GXEMUL_DISK_DEV_WRITE(f, v) \ 62235073Sjmallett *GXEMUL_DISK_DEV_FUNCTION(f) = (v) 63235073Sjmallett 64235073Sjmallett#define GXEMUL_DISK_DEV_START_READ (0x00) 65235073Sjmallett#define GXEMUL_DISK_DEV_START_WRITE (0x01) 66235073Sjmallett 67235073Sjmallett#define GXEMUL_DISK_DEV_STATUS_FAILURE (0x00) 68235073Sjmallett 69235073Sjmallett#endif /* !_DEV_GXEMUL_DISK_GXEMUL_DISK_H_ */ 70