mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-29 22:28:21 +08:00
GR-CPCI-LEON4-N2X: added PCI peripheral driver for PCI device
Interrupts have not been test yet
This commit is contained in:
@@ -52,12 +52,14 @@ EXTRA_DIST += shared/include/gr_rasta_adcdac.h
|
||||
EXTRA_DIST += shared/include/gr_rasta_io.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/pci/gr_701.c
|
||||
EXTRA_DIST += shared/pci/gr_rasta_adcdac.c
|
||||
EXTRA_DIST += shared/pci/gr_rasta_io.c
|
||||
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
|
||||
|
||||
# DEBUG
|
||||
EXTRA_DIST += shared/include/debug_defs.h
|
||||
|
||||
@@ -110,11 +110,13 @@ include_HEADERS += ../../sparc/shared/include/gr_701.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_rasta_adcdac.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_rasta_io.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_rasta_tmtc.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_leon4_n2x.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
|
||||
|
||||
# B1553BRM
|
||||
include_HEADERS += ../../sparc/shared/include/b1553brm.h
|
||||
|
||||
@@ -137,6 +137,10 @@ $(PROJECT_INCLUDE)/gr_rasta_tmtc.h: ../../sparc/shared/include/gr_rasta_tmtc.h $
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_rasta_tmtc.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_rasta_tmtc.h
|
||||
|
||||
$(PROJECT_INCLUDE)/gr_leon4_n2x.h: ../../sparc/shared/include/gr_leon4_n2x.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_leon4_n2x.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_leon4_n2x.h
|
||||
|
||||
$(PROJECT_INCLUDE)/b1553brm.h: ../../sparc/shared/include/b1553brm.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/b1553brm.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/b1553brm.h
|
||||
|
||||
@@ -119,12 +119,14 @@ include_HEADERS += ../../sparc/shared/include/gr_rasta_adcdac.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_rasta_io.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_rasta_tmtc.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_tmtc_1553.h
|
||||
include_HEADERS += ../../sparc/shared/include/gr_leon4_n2x.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_tmtc_1553.c
|
||||
libbsp_a_SOURCES += ../../sparc/shared/pci/gr_leon4_n2x.c
|
||||
|
||||
# B1553BRM
|
||||
include_HEADERS += ../../sparc/shared/include/b1553brm.h
|
||||
|
||||
@@ -157,6 +157,10 @@ $(PROJECT_INCLUDE)/gr_tmtc_1553.h: ../../sparc/shared/include/gr_tmtc_1553.h $(P
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_tmtc_1553.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_tmtc_1553.h
|
||||
|
||||
$(PROJECT_INCLUDE)/gr_leon4_n2x.h: ../../sparc/shared/include/gr_leon4_n2x.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_leon4_n2x.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_leon4_n2x.h
|
||||
|
||||
$(PROJECT_INCLUDE)/b1553brm.h: ../../sparc/shared/include/b1553brm.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/b1553brm.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/b1553brm.h
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/* GR-CPCI-LEON4-N2X (NGFP) PCI Peripheral driver
|
||||
*
|
||||
* COPYRIGHT (c) 2013.
|
||||
* 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.com/license/LICENSE.
|
||||
*
|
||||
* Configures the GR-CPIC-LEON4-N2X 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 200000000 (200MHz) AMBA system frequency of LEON4-N2X
|
||||
* 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_LEON4_N2X_H__
|
||||
#define __GR_CPCI_LEON4_N2X_H__
|
||||
|
||||
#include <drvmgr/drvmgr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* An array of pointers to GR-CPCI-LEON4-N2X resources. The resources will be
|
||||
* used by the drivers controlling the cores on the GR-CPCI-LEON4-N2X target
|
||||
* AMBA bus.
|
||||
*
|
||||
* The gr_leon4_n2x_resources is declared weak so that the user can override the
|
||||
* default configuration.
|
||||
*/
|
||||
extern struct drvmgr_bus_res *gr_leon4_n2x_resources[];
|
||||
|
||||
/* Options to gr_cpci_leon4_n2x_print function */
|
||||
#define GR_LEON4_N2X_OPTIONS_AMBA 0x01 /* Print AMBA bus devices */
|
||||
|
||||
/* Print information about GR-CPCI-LEON4-N2X PCI board */
|
||||
void gr_leon4_n2x_print(int options);
|
||||
|
||||
/* Register GR-CPCI-LEON4-N2X driver */
|
||||
void gr_cpci_leon4_n2x_register_drv(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -142,6 +142,9 @@ extern void gr_tmtc_1553_register_drv(void);
|
||||
#define DRIVER_PCI_GR_RASTA_SPW_ROUTER {gr_rasta_spw_router_register_drv}
|
||||
extern void gr_rasta_spw_router_register_drv(void);
|
||||
|
||||
#define DRIVER_PCI_GR_LEON4_N2X {gr_cpci_leon4_n2x_register_drv}
|
||||
extern void gr_cpci_leon4_n2x_register_drv(void);
|
||||
|
||||
|
||||
/* CONFIGURE DRIVER MANAGER */
|
||||
struct drvmgr_drv_reg_func drvmgr_drivers[] = {
|
||||
@@ -258,6 +261,9 @@ struct drvmgr_drv_reg_func drvmgr_drivers[] = {
|
||||
#ifdef CONFIGURE_DRIVER_PCI_GR_RASTA_SPW_ROUTER
|
||||
DRIVER_PCI_GR_RASTA_SPW_ROUTER,
|
||||
#endif
|
||||
#ifdef CONFIGURE_DRIVER_PCI_GR_LEON4_N2X
|
||||
DRIVER_PCI_GR_LEON4_N2X,
|
||||
#endif
|
||||
|
||||
|
||||
/* Macros for adding custom drivers without needing to recompile
|
||||
|
||||
@@ -17,3 +17,4 @@
|
||||
#define PCIID_DEVICE_GR_701 0x0701 /* GR-701 */
|
||||
#define PCIID_DEVICE_GR_TMTC_1553 0x0198 /* GR-TMTC-1553 */
|
||||
#define PCIID_DEVICE_GR_RASTA_SPW_RTR 0x0062 /* GR-RASTA-SPW-ROUTER */
|
||||
#define PCIID_DEVICE_GR_LEON4_N2X 0x0061 /* GR-CPCI-LEON4-N2X */
|
||||
|
||||
@@ -46,6 +46,7 @@ extern "C" {
|
||||
#define DRIVER_PCI_GAISLER_RASTAADCDAC_ID DRIVER_PCI_ID(PCIID_VENDOR_GAISLER, PCIID_DEVICE_GR_RASTA_ADCDAC)
|
||||
#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)
|
||||
|
||||
struct pci_dev_id {
|
||||
uint16_t vendor;
|
||||
|
||||
Reference in New Issue
Block a user