mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 07:15:58 +08:00
Enable NEW_PCIB
This commit is contained in:

committed by
Christian Mauderer

parent
398c5f6952
commit
0e2d6b8819
@@ -45,5 +45,6 @@
|
|||||||
#define SYS_RES_MEMORY 3
|
#define SYS_RES_MEMORY 3
|
||||||
#define SYS_RES_IOPORT 4
|
#define SYS_RES_IOPORT 4
|
||||||
#define SYS_RES_GPIO 5
|
#define SYS_RES_GPIO 5
|
||||||
|
#define PCI_RES_BUS 6
|
||||||
|
|
||||||
#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */
|
#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */
|
||||||
|
@@ -247,6 +247,14 @@ dev_t rtems_bsd__makedev(int _M, int _m);
|
|||||||
struct dirent;
|
struct dirent;
|
||||||
void dirent_terminate(struct dirent *dp);
|
void dirent_terminate(struct dirent *dp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enable the "new" PCI-PCI bridge driver, since this is going to be the future
|
||||||
|
* FreeBSD driver:
|
||||||
|
*
|
||||||
|
* https://reviews.freebsd.org/D32954
|
||||||
|
*/
|
||||||
|
#define NEW_PCIB 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
@@ -57,6 +57,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/bsd/modules.h>
|
||||||
#include <rtems/irq-extension.h>
|
#include <rtems/irq-extension.h>
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
@@ -103,6 +104,10 @@ static struct rman mem_rman;
|
|||||||
|
|
||||||
static struct rman irq_rman;
|
static struct rman irq_rman;
|
||||||
|
|
||||||
|
#ifdef RTEMS_BSD_MODULE_PCI
|
||||||
|
static struct rman pci_rman;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(RTEMS_BSP_PCI_IO_REGION_BASE)
|
#if defined(RTEMS_BSP_PCI_IO_REGION_BASE)
|
||||||
static struct rman port_rman;
|
static struct rman port_rman;
|
||||||
#endif
|
#endif
|
||||||
@@ -137,6 +142,17 @@ nexus_probe(device_t dev)
|
|||||||
err = rman_manage_region(&irq_rman, irq_rman.rm_start, irq_rman.rm_end);
|
err = rman_manage_region(&irq_rman, irq_rman.rm_start, irq_rman.rm_end);
|
||||||
BSD_ASSERT(err == 0);
|
BSD_ASSERT(err == 0);
|
||||||
|
|
||||||
|
#ifdef RTEMS_BSD_MODULE_PCI
|
||||||
|
pci_rman.rm_start = 0;
|
||||||
|
pci_rman.rm_end = ~0UL;
|
||||||
|
pci_rman.rm_type = RMAN_ARRAY;
|
||||||
|
pci_rman.rm_descr = "PCI bus";
|
||||||
|
err = rman_init(&pci_rman) != 0;
|
||||||
|
BSD_ASSERT(err == 0);
|
||||||
|
err = rman_manage_region(&pci_rman, pci_rman.rm_start, pci_rman.rm_end);
|
||||||
|
BSD_ASSERT(err == 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(RTEMS_BSP_PCI_IO_REGION_BASE)
|
#if defined(RTEMS_BSP_PCI_IO_REGION_BASE)
|
||||||
port_rman.rm_start = 0;
|
port_rman.rm_start = 0;
|
||||||
port_rman.rm_end = ~0UL;
|
port_rman.rm_end = ~0UL;
|
||||||
@@ -191,6 +207,11 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
|||||||
case SYS_RES_IRQ:
|
case SYS_RES_IRQ:
|
||||||
rm = &irq_rman;
|
rm = &irq_rman;
|
||||||
break;
|
break;
|
||||||
|
#ifdef RTEMS_BSD_MODULE_PCI
|
||||||
|
case PCI_RES_BUS:
|
||||||
|
rm = &pci_rman;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#if defined(RTEMS_BSP_PCI_IO_REGION_BASE)
|
#if defined(RTEMS_BSP_PCI_IO_REGION_BASE)
|
||||||
case SYS_RES_IOPORT:
|
case SYS_RES_IOPORT:
|
||||||
rm = &port_rman;
|
rm = &port_rman;
|
||||||
|
Reference in New Issue
Block a user