The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-mips64/mv64340_dep.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright 2002 Momentum Computer Inc.
    3  * Author: Matthew Dharm <mdharm@momenco.com>
    4  *
    5  * include/asm-mips/mv64340-dep.h
    6  *     Board-dependent definitions for MV-64340 chip.
    7  *
    8  * This program is free software; you can redistribute  it and/or modify it
    9  * under  the terms of  the GNU General  Public License as published by the
   10  * Free Software Foundation;  either version 2 of the  License, or (at your
   11  * option) any later version.
   12  */
   13 
   14 #ifndef __MV64340_DEP_H__
   15 #define __MV64340_DEP_H__
   16 
   17 #include <asm/addrspace.h>              /* for KSEG1ADDR() */
   18 #include <asm/byteorder.h>              /* for cpu_to_le32() */
   19 
   20 extern unsigned long mv64340_base;
   21 
   22 #define MV64340_BASE       (mv64340_base)
   23 
   24 /*
   25  * Because of an error/peculiarity in the Galileo chip, we need to swap the
   26  * bytes when running bigendian.
   27  */
   28 
   29 #define MV_WRITE(ofs, data)  \
   30         *(volatile u32 *)(MV64340_BASE+(ofs)) = cpu_to_le32(data)
   31 #define MV_READ(ofs, data)   \
   32         *(data) = le32_to_cpu(*(volatile u32 *)(MV64340_BASE+(ofs)))
   33 #define MV_READ_DATA(ofs)    \
   34         le32_to_cpu(*(volatile u32 *)(MV64340_BASE+(ofs)))
   35 
   36 #define MV_WRITE_16(ofs, data)  \
   37         *(volatile u16 *)(MV64340_BASE+(ofs)) = cpu_to_le16(data)
   38 #define MV_READ_16(ofs, data)   \
   39         *(data) = le16_to_cpu(*(volatile u16 *)(MV64340_BASE+(ofs)))
   40 
   41 #define MV_WRITE_8(ofs, data)  \
   42         *(volatile u8 *)(MV64340_BASE+(ofs)) = data
   43 #define MV_READ_8(ofs, data)   \
   44         *(data) = *(volatile u8 *)(MV64340_BASE+(ofs))
   45 
   46 #define MV_SET_REG_BITS(ofs,bits) \
   47         (*((volatile u32 *)(MV64340_BASE+(ofs)))) |= ((u32)cpu_to_le32(bits))
   48 #define MV_RESET_REG_BITS(ofs,bits) \
   49         (*((volatile u32 *)(MV64340_BASE+(ofs)))) &= ~((u32)cpu_to_le32(bits))
   50 
   51 #endif

Cache object: 969f2e855332395768e8ec5c1da4011b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.