mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
pci: add pci endpoint test driver
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
This commit is contained in:
@@ -54,6 +54,10 @@ if(CONFIG_PCI_ENDPOINT)
|
|||||||
list(APPEND SRCS pci_epf_test.c)
|
list(APPEND SRCS pci_epf_test.c)
|
||||||
endif() # CONFIG_PCI_EPF_TEST
|
endif() # CONFIG_PCI_EPF_TEST
|
||||||
|
|
||||||
|
if(CONFIG_PCI_EP_TEST)
|
||||||
|
list(APPEND SRCS pci_ep_test.c)
|
||||||
|
endif() # CONFIG_PCI_ENDPOINT_TEST
|
||||||
|
|
||||||
target_sources(drivers PRIVATE ${SRCS})
|
target_sources(drivers PRIVATE ${SRCS})
|
||||||
|
|
||||||
endif() # CONFIG_PCI_ENDPOINT
|
endif() # CONFIG_PCI_ENDPOINT
|
||||||
|
|||||||
@@ -95,5 +95,10 @@ config PCI_EPF_TEST
|
|||||||
---help---
|
---help---
|
||||||
pci epf test driver
|
pci epf test driver
|
||||||
|
|
||||||
|
config PCI_EP_TEST
|
||||||
|
bool "PCI endpoint test"
|
||||||
|
---help---
|
||||||
|
pci endpoint test driver
|
||||||
|
|
||||||
endif # PCI_ENDPOINT
|
endif # PCI_ENDPOINT
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ ifeq ($(CONFIG_PCI_EPF_TEST),y)
|
|||||||
CSRCS += pci_epf_test.c
|
CSRCS += pci_epf_test.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_PCI_EP_TEST),y)
|
||||||
|
CSRCS += pci_ep_test.c
|
||||||
|
endif
|
||||||
|
|
||||||
# Include PCI device driver build support
|
# Include PCI device driver build support
|
||||||
|
|
||||||
DEPPATH += --dep-path pci
|
DEPPATH += --dep-path pci
|
||||||
|
|||||||
@@ -132,6 +132,14 @@ int pci_register_drivers(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_EP_TEST
|
||||||
|
ret = pci_register_ep_test_driver();
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
pcierr("pci_register_ep_test_driver failed, ret=%d\n", ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialization e1000 driver */
|
/* Initialization e1000 driver */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_E1000
|
#ifdef CONFIG_NET_E1000
|
||||||
|
|||||||
@@ -79,4 +79,16 @@ int pci_register_qemu_epc_driver(void);
|
|||||||
int pci_register_epf_test_driver(void);
|
int pci_register_epf_test_driver(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: pci_register_ep_test_driver
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Register endpoint test device pci driver
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_EP_TEST
|
||||||
|
int pci_register_ep_test_driver(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __DRIVERS_PCI_PCI_DRIVERS_H */
|
#endif /* __DRIVERS_PCI_PCI_DRIVERS_H */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -209,6 +209,9 @@
|
|||||||
|
|
||||||
#define pci_map_region(dev, start, size) pci_bus_map_region((dev)->bus, start, size)
|
#define pci_map_region(dev, start, size) pci_bus_map_region((dev)->bus, start, size)
|
||||||
|
|
||||||
|
#define pci_is_bridge(dev) ((dev)->hdr_type == PCI_HEADER_TYPE_BRIDGE || \
|
||||||
|
(dev)->hdr_type == PCI_HEADER_TYPE_CARDBUS)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/fs/ioctl.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -42,4 +44,29 @@
|
|||||||
int pci_register_epf_test_device(FAR const char *epc_name);
|
int pci_register_epf_test_device(FAR const char *epc_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define PCITEST_BAR _PCIIOC(0x1)
|
||||||
|
#define PCITEST_LEGACY_IRQ _PCIIOC(0x2)
|
||||||
|
#define PCITEST_MSI _PCIIOC(0x3)
|
||||||
|
#define PCITEST_WRITE _PCIIOC(0x4)
|
||||||
|
#define PCITEST_READ _PCIIOC(0x5)
|
||||||
|
#define PCITEST_COPY _PCIIOC(0x6)
|
||||||
|
#define PCITEST_MSIX _PCIIOC(0x7)
|
||||||
|
#define PCITEST_SET_IRQTYPE _PCIIOC(0x8)
|
||||||
|
#define PCITEST_GET_IRQTYPE _PCIIOC(0x9)
|
||||||
|
#define PCITEST_CLEAR_IRQ _PCIIOC(0x10)
|
||||||
|
|
||||||
|
#define PCITEST_FLAGS_USE_DMA 0x00000001
|
||||||
|
|
||||||
|
/* struct pci_ep_test_param_s - Params config by user
|
||||||
|
*
|
||||||
|
* size: xfer data length
|
||||||
|
* flag: xfer mode flag
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct pci_ep_test_param_s
|
||||||
|
{
|
||||||
|
unsigned int size;
|
||||||
|
unsigned int flags;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __INCLUDE_NUTTX_PCI_EP_TEST_H */
|
#endif /* __INCLUDE_NUTTX_PCI_EP_TEST_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user