Back to home page

LXR

 
 

    


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

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*  GR-CPCI-GR740 PCI Peripheral driver
0004  *
0005  *  COPYRIGHT (c) 2017.
0006  *  Cobham 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  *  Configures the GR-CPIC-GR740 interface PCI board in peripheral
0030  *  mode. This driver provides a AMBA PnP bus by using the general part
0031  *  of the AMBA PnP bus driver (ambapp_bus.c).
0032  *
0033  *
0034  *  Driver resource options:
0035  *   NAME          DEFAULT VALUE
0036  *   ahbmst2pci    _RAM_START            AMBA->PCI translation PCI base address
0037  *   ambaFreq      250000000 (250MHz)    AMBA system frequency of GR740
0038  *   cgEnMask      0x1f (all)            Clock gating enable mask
0039  *
0040  * TODO/UNTESTED
0041  *   Interrupt testing
0042  *   bar0 RESOURCE 0x00000000            L2-Cache SDRAM memory
0043  *   bar1 RESOURCE 0xf0000000            L2-Cache registers
0044  */
0045 
0046 #ifndef __GR_CPCI_GR740_H__
0047 #define __GR_CPCI_GR740_H__
0048 
0049 #include <drvmgr/drvmgr.h>
0050 
0051 #ifdef __cplusplus
0052 extern "C" {
0053 #endif
0054 
0055 /* An array of pointers to GR-CPCI-GR740 resources. The resources will be
0056  * used by the drivers controlling the cores on the GR-CPCI-GR740 target
0057  * AMBA bus.
0058  *
0059  * The gr_cpci_gr740_resources is declared weak so that the user can override the
0060  * default configuration. The array must be terminated with a NULL resource.
0061  */
0062 extern struct drvmgr_bus_res *gr_cpci_gr740_resources[];
0063 
0064 /* Options to gr_cpci_gr740_print function */
0065 #define GR_CPCI_GR740_OPTIONS_AMBA   0x01 /* Print AMBA bus devices */
0066 
0067 /* Print information about all GR-CPCI-GR740 PCI boards */
0068 void gr_cpci_gr740_print(int options);
0069 
0070 /* Print information about one GR-CPCI-GR740 PCI board */
0071 void gr_cpci_gr740_print_dev(struct drvmgr_dev *dev, int options);
0072 
0073 /* Register GR-CPCI-GR740 driver */
0074 void gr_cpci_gr740_register_drv(void);
0075 
0076 #ifdef __cplusplus
0077 }
0078 #endif
0079 
0080 #endif