socfpga_common.h revision 271186
1271186Sbr/*- 2271186Sbr * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> 3271186Sbr * All rights reserved. 4271186Sbr * 5271186Sbr * This software was developed by SRI International and the University of 6271186Sbr * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 7271186Sbr * ("CTSRD"), as part of the DARPA CRASH research programme. 8271186Sbr * 9271186Sbr * Redistribution and use in source and binary forms, with or without 10271186Sbr * modification, are permitted provided that the following conditions 11271186Sbr * are met: 12271186Sbr * 1. Redistributions of source code must retain the above copyright 13271186Sbr * notice, this list of conditions and the following disclaimer. 14271186Sbr * 2. Redistributions in binary form must reproduce the above copyright 15271186Sbr * notice, this list of conditions and the following disclaimer in the 16271186Sbr * documentation and/or other materials provided with the distribution. 17271186Sbr * 18271186Sbr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19271186Sbr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20271186Sbr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21271186Sbr * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22271186Sbr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23271186Sbr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24271186Sbr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25271186Sbr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26271186Sbr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27271186Sbr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28271186Sbr * SUCH DAMAGE. 29271186Sbr * 30271186Sbr * $FreeBSD: head/sys/arm/altera/socfpga/socfpga_common.h 271186 2014-09-06 08:48:57Z br $ 31271186Sbr */ 32271186Sbr 33271186Sbr#define READ4(_sc, _reg) \ 34271186Sbr bus_space_read_4(_sc->bst, _sc->bsh, _reg) 35271186Sbr#define WRITE4(_sc, _reg, _val) \ 36271186Sbr bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) 37271186Sbr#define READ2(_sc, _reg) \ 38271186Sbr bus_space_read_2(_sc->bst, _sc->bsh, _reg) 39271186Sbr#define WRITE2(_sc, _reg, _val) \ 40271186Sbr bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) 41271186Sbr#define READ1(_sc, _reg) \ 42271186Sbr bus_space_read_1(_sc->bst, _sc->bsh, _reg) 43271186Sbr#define WRITE1(_sc, _reg, _val) \ 44271186Sbr bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) 45