Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:08

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSBSPsSPARCLEON3
0007  *
0008  * @brief This header file provides interfaces of the
0009  *   GR-CPCI-LEON4-N2X (NGFP) PCI Peripheral driver.
0010  */
0011 
0012 /*
0013  *  COPYRIGHT (c) 2013.
0014  *  Cobham Gaisler AB.
0015  *
0016  * Redistribution and use in source and binary forms, with or without
0017  * modification, are permitted provided that the following conditions
0018  * are met:
0019  * 1. Redistributions of source code must retain the above copyright
0020  *    notice, this list of conditions and the following disclaimer.
0021  * 2. Redistributions in binary form must reproduce the above copyright
0022  *    notice, this list of conditions and the following disclaimer in the
0023  *    documentation and/or other materials provided with the distribution.
0024  *
0025  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0026  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0027  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0028  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0029  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0030  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0031  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0032  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0033  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0034  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0035  * POSSIBILITY OF SUCH DAMAGE.
0036  *
0037  *  Configures the GR-CPIC-LEON4-N2X interface PCI board in peripheral
0038  *  mode. This driver provides a AMBA PnP bus by using the general part
0039  *  of the AMBA PnP bus driver (ambapp_bus.c).
0040  *
0041  *
0042  *  Driver resource options:
0043  *   NAME          DEFAULT VALUE
0044  *   ahbmst2pci    _RAM_START            AMBA->PCI translation PCI base address
0045  *   ambaFreq      200000000 (200MHz)    AMBA system frequency of LEON4-N2X
0046  *   cgEnMask      0x1f (all)            Clock gating enable mask
0047  *
0048  * TODO/UNTESTED
0049  *   Interrupt testing
0050  *   bar0 RESOURCE 0x00000000            L2-Cache SDRAM memory
0051  *   bar1 RESOURCE 0xf0000000            L2-Cache registers
0052  */
0053 
0054 #ifndef __GR_CPCI_LEON4_N2X_H__
0055 #define __GR_CPCI_LEON4_N2X_H__
0056 
0057 #include <drvmgr/drvmgr.h>
0058 
0059 #ifdef __cplusplus
0060 extern "C" {
0061 #endif
0062 
0063 /* An array of pointers to GR-CPCI-LEON4-N2X resources. The resources will be
0064  * used by the drivers controlling the cores on the GR-CPCI-LEON4-N2X target
0065  * AMBA bus.
0066  *
0067  * The gr_leon4_n2x_resources is declared weak so that the user can override the
0068  * default configuration. The array must be terminated with a NULL resource.
0069  */
0070 extern struct drvmgr_bus_res *gr_leon4_n2x_resources[];
0071 
0072 /* Options to gr_cpci_leon4_n2x_print function */
0073 #define GR_LEON4_N2X_OPTIONS_AMBA   0x01 /* Print AMBA bus devices */
0074 
0075 /* Print information about all GR-CPCI-LEON4-N2X PCI boards */
0076 void gr_leon4_n2x_print(int options);
0077 
0078 /* Print information about one GR-CPCI-LEON4-N2X PCI board */
0079 void gr_cpci_leon4_n2x_print_dev(struct drvmgr_dev *dev, int options);
0080 
0081 /* Register GR-CPCI-LEON4-N2X driver */
0082 void gr_cpci_leon4_n2x_register_drv(void);
0083 
0084 #ifdef __cplusplus
0085 }
0086 #endif
0087 
0088 #endif