/***************************************************************************** * %LICENSE_DUAL% * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * Copyright(c) 2007 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * The full GNU General Public License is included in this distribution * in the file called LICENSE.GPL. * * Contact Information: * Intel Corporation * * BSD LICENSE * * Copyright(c) 2007 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 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. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "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 THE COPYRIGHT * OWNER OR CONTRIBUTORS 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. * *****************************************************************************/ /** ***************************************************************************** * @file icp_can_regs.h * * @defgroup icp_CanAcc_Regs Registers for CAN I/O Unit. * * @description * This file contains the defition of the CAN device memory * mapped registers. * *****************************************************************************/ #ifndef __ICP_CAN_REGS_H__ #define __ICP_CAN_REGS_H__ /***************************************************************************** * Device characteristics *****************************************************************************/ #define MM_REG_SIZE 0x29c /**< All CAN regs */ #define NUM_RX_BUFFS 16 /**< Num CAN Rx buffers */ #define NUM_TX_BUFFS 8 /**< Num CAN Tx buffers */ /***************************************************************************** * Memory map offset definitions *****************************************************************************/ #define MM_INTSTAT 0x000 /**< Interrupt status */ #define MM_INTENBL 0x004 /**< Interrupt enables */ #define MM_BUFFSTAT 0x008 /**< Buffer status */ #define MM_ERRSTAT 0x00c /**< Error status */ #define MM_CMD 0x010 /**< Command reg */ #define MM_CFG 0x014 /**< Config reg */ #define MM_TX0 0x020 /**< Tx reg 0 */ #define MM_TX1 0x030 /**< Tx reg 1 */ #define MM_TX2 0x040 /**< Tx reg 2 */ #define MM_TX3 0x050 /**< Tx reg 3 */ #define MM_TX4 0x060 /**< Tx reg 4 */ #define MM_TX5 0x070 /**< Tx reg 5 */ #define MM_TX6 0x080 /**< Tx reg 6 */ #define MM_TX7 0x090 /**< Tx reg 7 */ #define MM_RX0 0x0a0 /**< Rx reg 0 */ #define MM_RX1 0x0c0 /**< Tx reg 1 */ #define MM_RX2 0x0e0 /**< Tx reg 2 */ #define MM_RX3 0x100 /**< Tx reg 3 */ #define MM_RX4 0x120 /**< Tx reg 4 */ #define MM_RX5 0x140 /**< Tx reg 5 */ #define MM_RX6 0x160 /**< Tx reg 6 */ #define MM_RX7 0x180 /**< Tx reg 7 */ #define MM_RX8 0x1a0 /**< Tx reg 8 */ #define MM_RX9 0x1c0 /**< Tx reg 9 */ #define MM_RX10 0x1e0 /**< Tx reg 10 */ #define MM_RX11 0x200 /**< Tx reg 11 */ #define MM_RX12 0x220 /**< Tx reg 12 */ #define MM_RX13 0x240 /**< Tx reg 13 */ #define MM_RX14 0x260 /**< Tx reg 14 */ #define MM_RX15 0x280 /**< Tx reg 15 */ /* * Tx message register offsets. These offsets corresponds * to offsets within each of the MM_TXx registers */ #define MM_TXCTL 0x00 /**< Tx control */ #define MM_TXCMD 0x00 /**< Tx command */ #define MM_TXID 0x04 /**< Tx ID */ #define MM_TXDATAH 0x08 /**< Tx data high */ #define MM_TXDATAL 0x0c /**< Tx data low */ /* * Rx message register offsets.These offsets corresponds * to offsets withing each of the MM_RXx registers */ #define MM_RXCTL 0x00 /**< Rx conrol */ #define MM_RXCMD 0x00 /**< Rx command */ #define MM_RXID 0x04 /**< Rx ID */ #define MM_RXDATAH 0x08 /**< Rx data high */ #define MM_RXDATAL 0x0c /**< Rx data low */ #define MM_RXAMR 0x10 /**< Rx acceptance mask */ #define MM_RXACR 0x14 /**< Rx acceptance control */ #define MM_RXAMRDATA 0x18 /**< Rx AMR data */ #define MM_RXACRDATA 0x1c /**< Rx ACR data */ /***************************************************************************** * Register mask and bit definitions *****************************************************************************/ /* Interrupt Status Bits */ #define MSK_IS_ARLOSS (1<= 96 */ #define MSK_ES_RXGTE96 (1<= 96 */ #define BIT_ES_TXERRCNT 0 #define BIT_ES_RXERRCNT 8 #define BIT_ES_ERRSTAT 16 #define BIT_ES_TXGTE96 18 #define BIT_ES_RXGTE96 19 /* Command */ #define MSK_CMD_RUN (1<