Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:42

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*  B1553RT driver interface
0004  *
0005  *  COPYRIGHT (c) 2009.
0006  *  Aeroflex Gaisler AB
0007  *
0008  * Redistribution and use in source and binary forms, with or without
0009  * modification, are permitted provided that the following conditions
0010  * are met:
0011  * 1. Redistributions of source code must retain the above copyright
0012  *    notice, this list of conditions and the following disclaimer.
0013  * 2. Redistributions in binary form must reproduce the above copyright
0014  *    notice, this list of conditions and the following disclaimer in the
0015  *    documentation and/or other materials provided with the distribution.
0016  *
0017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0027  * POSSIBILITY OF SUCH DAMAGE.
0028  */
0029 
0030 #ifndef __B1553RT_H__
0031 #define __B1553RT_H__
0032 
0033 #include <drvmgr/drvmgr.h>
0034 
0035 #ifdef __cplusplus
0036 extern "C" {
0037 #endif
0038 
0039 struct rt_reg {
0040     volatile unsigned int stat;            /* 0x00 */
0041     volatile unsigned int ctrl;            /* 0x04 */
0042     volatile unsigned int vword;           /* 0x08 */
0043     volatile unsigned int irq;             /* 0x0C */
0044     volatile unsigned int addr;            /* 0x10 */
0045         volatile unsigned int ipm;             /* 0x14 */
0046 };
0047 
0048 
0049 struct rt_msg {
0050     unsigned short miw;
0051     unsigned short time;
0052     unsigned short data[32];
0053     unsigned short desc;
0054 };
0055 
0056 #define RT_FREQ_12MHZ 0
0057 #define RT_FREQ_16MHZ 1
0058 #define RT_FREQ_20MHZ 2
0059 #define RT_FREQ_24MHZ 3
0060 #define RT_FREQ_MASK 0x3
0061 
0062 /* IOCTLs */
0063 #define RT_SET_ADDR    3
0064 #define RT_SET_BCE     5
0065 #define RT_RX_BLOCK    8
0066 #define RT_CLR_STATUS  12
0067 #define RT_GET_STATUS  13
0068 #define RT_SET_EVENTID 14
0069 
0070 #define RT_SET_VECTORW 32
0071 #define RT_SET_EXTMDATA 33
0072 
0073 #define RT_ILLCMD_IRQ  128   
0074 #define RT_MERR_IRQ       2048
0075 #define RT_DMAF_IRQ       32768                /* DMA Fail irq */
0076 
0077 #define RT_TSW_OK  (1<<14)
0078 #define RT_TSW_BUS (1<<13)
0079 #define RT_TSW_BC  (1<<12)
0080 #define RT_TSW_LPBKERRB  (1<<11)
0081 #define RT_TSW_LPBKERRA  (1<<10)
0082 #define RT_TSW_ILL  (1<<9)
0083 #define RT_TSW_MEM  (1<<8)
0084 #define RT_TSW_MAN  (1<<7)
0085 #define RT_TSW_PAR  (1<<6)
0086 #define RT_TSW_WC   (1<<5)
0087 
0088 void b1553rt_print_dev(struct drvmgr_dev *dev, int options);
0089 void b1553rt_print(int options);
0090 
0091 void b1553rt_register_drv(void);
0092 
0093 #ifdef __cplusplus
0094 }
0095 #endif
0096 
0097 #endif /* __RT_H__ */
0098