mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-30 05:38:38 +08:00
leon, GR-CPCI-GR740: Added peripheral PCI driver
This commit is contained in:
committed by
Daniel Hellstrom
parent
6b42018eb6
commit
61788e76b9
@@ -57,6 +57,7 @@ EXTRA_DIST += shared/include/gr_rasta_spw_router.h
|
||||
EXTRA_DIST += shared/include/gr_rasta_tmtc.h
|
||||
EXTRA_DIST += shared/include/gr_tmtc_1553.h
|
||||
EXTRA_DIST += shared/include/gr_leon4_n2x.h
|
||||
EXTRA_DIST += shared/include/gr_cpci_gr740.h
|
||||
EXTRA_DIST += shared/pci/gr_701.c
|
||||
EXTRA_DIST += shared/pci/gr_rasta_adcdac.c
|
||||
EXTRA_DIST += shared/pci/gr_rasta_io.c
|
||||
@@ -64,6 +65,7 @@ EXTRA_DIST += shared/pci/gr_rasta_spw_router.c
|
||||
EXTRA_DIST += shared/pci/gr_rasta_tmtc.c
|
||||
EXTRA_DIST += shared/pci/gr_tmtc_1553.c
|
||||
EXTRA_DIST += shared/pci/gr_leon4_n2x.c
|
||||
EXTRA_DIST += shared/pci/gr_cpci_gr740.c
|
||||
|
||||
# DEBUG
|
||||
EXTRA_DIST += shared/include/debug_defs.h
|
||||
|
||||
@@ -112,12 +112,14 @@ include_bsp_HEADERS += ../../sparc/shared/include/gr_rasta_io.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_rasta_spw_router.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_rasta_tmtc.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_leon4_n2x.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_cpci_gr740.h
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_701.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_adcdac.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_io.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_spw_router.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_tmtc.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_leon4_n2x.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_cpci_gr740.c
|
||||
|
||||
# B1553BRM
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/b1553brm.h
|
||||
|
||||
@@ -161,6 +161,10 @@ $(PROJECT_INCLUDE)/bsp/gr_leon4_n2x.h: ../../sparc/shared/include/gr_leon4_n2x.h
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/gr_leon4_n2x.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/gr_leon4_n2x.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/gr_cpci_gr740.h: ../../sparc/shared/include/gr_cpci_gr740.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/gr_cpci_gr740.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/gr_cpci_gr740.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/b1553brm.h: ../../sparc/shared/include/b1553brm.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/b1553brm.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/b1553brm.h
|
||||
|
||||
@@ -124,6 +124,7 @@ include_bsp_HEADERS += ../../sparc/shared/include/gr_rasta_spw_router.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_rasta_tmtc.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_tmtc_1553.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_leon4_n2x.h
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/gr_cpci_gr740.h
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_701.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_adcdac.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_io.c
|
||||
@@ -131,6 +132,7 @@ libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_spw_router.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_rasta_tmtc.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_tmtc_1553.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_leon4_n2x.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_cpci_gr740.c
|
||||
|
||||
# B1553BRM
|
||||
include_bsp_HEADERS += ../../sparc/shared/include/b1553brm.h
|
||||
|
||||
@@ -181,6 +181,10 @@ $(PROJECT_INCLUDE)/bsp/gr_leon4_n2x.h: ../../sparc/shared/include/gr_leon4_n2x.h
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/gr_leon4_n2x.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/gr_leon4_n2x.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/gr_cpci_gr740.h: ../../sparc/shared/include/gr_cpci_gr740.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/gr_cpci_gr740.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/gr_cpci_gr740.h
|
||||
|
||||
$(PROJECT_INCLUDE)/bsp/b1553brm.h: ../../sparc/shared/include/b1553brm.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/b1553brm.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/b1553brm.h
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/* GR-CPCI-GR740 PCI Peripheral driver
|
||||
*
|
||||
* COPYRIGHT (c) 2017.
|
||||
* Cobham Gaisler AB.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.org/license/LICENSE.
|
||||
*
|
||||
* Configures the GR-CPIC-GR740 interface PCI board in peripheral
|
||||
* mode. This driver provides a AMBA PnP bus by using the general part
|
||||
* of the AMBA PnP bus driver (ambapp_bus.c).
|
||||
*
|
||||
*
|
||||
* Driver resource options:
|
||||
* NAME DEFAULT VALUE
|
||||
* ahbmst2pci _RAM_START AMBA->PCI translation PCI base address
|
||||
* ambaFreq 250000000 (250MHz) AMBA system frequency of GR740
|
||||
* cgEnMask 0x1f (all) Clock gating enable mask
|
||||
*
|
||||
* TODO/UNTESTED
|
||||
* Interrupt testing
|
||||
* bar0 RESOURCE 0x00000000 L2-Cache SDRAM memory
|
||||
* bar1 RESOURCE 0xf0000000 L2-Cache registers
|
||||
*/
|
||||
|
||||
#ifndef __GR_CPCI_GR740_H__
|
||||
#define __GR_CPCI_GR740_H__
|
||||
|
||||
#include <drvmgr/drvmgr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* An array of pointers to GR-CPCI-GR740 resources. The resources will be
|
||||
* used by the drivers controlling the cores on the GR-CPCI-GR740 target
|
||||
* AMBA bus.
|
||||
*
|
||||
* The gr_cpci_gr740_resources is declared weak so that the user can override the
|
||||
* default configuration. The array must be terminated with a NULL resource.
|
||||
*/
|
||||
extern struct drvmgr_bus_res *gr_cpci_gr740_resources[];
|
||||
|
||||
/* Options to gr_cpci_gr740_print function */
|
||||
#define GR_CPCI_GR740_OPTIONS_AMBA 0x01 /* Print AMBA bus devices */
|
||||
|
||||
/* Print information about all GR-CPCI-GR740 PCI boards */
|
||||
void gr_cpci_gr740_print(int options);
|
||||
|
||||
/* Print information about one GR-CPCI-GR740 PCI board */
|
||||
void gr_cpci_gr740_print_dev(struct drvmgr_dev *dev, int options);
|
||||
|
||||
/* Register GR-CPCI-GR740 driver */
|
||||
void gr_cpci_gr740_register_drv(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -72,6 +72,7 @@ extern void gr701_register_drv(void);
|
||||
extern void gr_tmtc_1553_register_drv(void);
|
||||
extern void gr_rasta_spw_router_register_drv(void);
|
||||
extern void gr_cpci_leon4_n2x_register_drv(void);
|
||||
extern void gr_cpci_gr740_register_drv(void);
|
||||
|
||||
|
||||
/* CONFIGURE DRIVER MANAGER */
|
||||
@@ -192,6 +193,9 @@ drvmgr_drv_reg_func drvmgr_drivers[] = {
|
||||
#ifdef CONFIGURE_DRIVER_PCI_GR_LEON4_N2X
|
||||
gr_cpci_leon4_n2x_register_drv,
|
||||
#endif
|
||||
#ifdef CONFIGURE_DRIVER_PCI_GR_CPCI_GR740
|
||||
gr_cpci_gr740_register_drv,
|
||||
#endif
|
||||
|
||||
|
||||
/* Macros for adding custom drivers without needing to recompile
|
||||
|
||||
@@ -19,3 +19,4 @@
|
||||
#define PCIID_DEVICE_GR_RASTA_SPW_RTR 0x0062 /* GR-RASTA-SPW-ROUTER */
|
||||
#define PCIID_DEVICE_GR_LEON4_N2X 0x0061 /* GR-CPCI-LEON4-N2X */
|
||||
#define PCIID_DEVICE_GR_NGMP_PROTO 0x0064 /* GR-NGMP_PROTO */
|
||||
#define PCIID_DEVICE_GR_CPCI_GR740 0x0740 /* GR-CPCI-GR740 */
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define DRIVER_PCI_GAISLER_TMTC_1553_ID DRIVER_PCI_ID(PCIID_VENDOR_GAISLER, PCIID_DEVICE_GR_TMTC_1553)
|
||||
#define DRIVER_PCI_GAISLER_RASTA_SPW_ROUTER_ID DRIVER_PCI_ID(PCIID_VENDOR_GAISLER, PCIID_DEVICE_GR_RASTA_SPW_RTR)
|
||||
#define DRIVER_PCI_GAISLER_LEON4_N2X_ID DRIVER_PCI_ID(PCIID_VENDOR_GAISLER, PCIID_DEVICE_GR_LEON4_N2X)
|
||||
#define DRIVER_PCI_GAISLER_CPCI_GR740_ID DRIVER_PCI_ID(PCIID_VENDOR_GAISLER, PCIID_DEVICE_GR_CPCI_GR740)
|
||||
|
||||
struct pci_dev_id {
|
||||
uint16_t vendor;
|
||||
|
||||
Reference in New Issue
Block a user