[rtems-libbsd commit] Change the Nexus bus to defines and have the BSP declare them.

Chris Johns chrisj at rtems.org
Tue Jun 28 03:33:01 UTC 2016


Module:    rtems-libbsd
Branch:    master
Commit:    f5883253906566e7d9e5eaa9a5845e3581e1c817
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=f5883253906566e7d9e5eaa9a5845e3581e1c817

Author:    Chris Johns <chrisj at rtems.org>
Date:      Tue Jun 28 13:30:44 2016 +1000

Change the Nexus bus to defines and have the BSP declare them.

---

 rtemsbsd/include/bsp/nexus-devices.h           |  63 ++---
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 332 ++++++++++++-------------
 2 files changed, 182 insertions(+), 213 deletions(-)

diff --git a/rtemsbsd/include/bsp/nexus-devices.h b/rtemsbsd/include/bsp/nexus-devices.h
index e717690..45beb30 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -34,56 +34,53 @@
 #if !defined(BSP_NEXUS_DEVICES_h)
 #define BSP_NEXUS_DEVICES_h
 
+#include <bsp.h>
+
 #include <rtems/bsd/bsd.h>
+#include <machine/rtems-bsd-nexus-bus.h>
 
-#include <bsp.h>
 
 #if defined(LIBBSP_ARM_REALVIEW_PBX_A9_BSP_H)
 
 #include <bsp/irq.h>
 
-#define RTEMS_BSD_DRIVER_SMC0
-#define RTEMS_BSD_DRIVER_SMC0_BASE_ADDR 0x4e000000
-#define RTEMS_BSD_DRIVER_SMC0_IRQ       RVPBXA9_IRQ_ETHERNET
+RTEMS_BSD_DRIVER_SMC0(0x4e000000,  RVPBXA9_IRQ_ETHERNET);
 
 #elif defined(LIBBSP_M68K_GENMCF548X_BSP_H)
 
-#define RTEMS_BSD_DRIVER_FEC
+RTEMS_BSD_DRIVER_FEC;
 
 #elif defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H)
 
 #include <bsp/irq.h>
 
-#define RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0
-#define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0
-#define RTEMS_BSD_DRIVER_CGEM0_IRQ         ZYNQ_IRQ_ETHERNET_0
-#define RTEMS_BSD_DRIVER_E1000PHY
+RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0;
+RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
+RTEMS_BSD_DRIVER_E1000PHY;
 
 #elif defined(LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H)
 
 #include <bsp/socal/hps.h>
 #include <bsp/irq.h>
 
-#define RTEMS_BSD_DRIVER_DWC0
-#define RTEMS_BSD_DRIVER_DWC0_BASE_ADDR    (unsigned long) ALT_EMAC1_ADDR
-#define RTEMS_BSD_DRIVER_DWC0_IRQ          ALT_INT_INTERRUPT_EMAC1_IRQ
-#define RTEMS_BSD_DRIVER_MIPHY
-#define RTEMS_BSD_DRIVER_DWCOTG0
-#define RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR (unsigned long) ALT_USB1_ADDR
-#define RTEMS_BSD_DRIVER_DWCOTG0_IRQ       ALT_INT_INTERRUPT_USB1_IRQ
-#define RTEMS_BSD_DRIVER_DWC_MMC
-#define RTEMS_BSD_DRIVER_MMC
-#define RTEMS_BSD_DRIVER_USB
-#define RTEMS_BSD_DRIVER_USB_MASS
+RTEMS_BSD_DRIVER_DWC0((unsigned long) ALT_EMAC1_ADDR,
+		      ALT_INT_INTERRUPT_EMAC1_IRQ);
+RTEMS_BSD_DRIVER_MIPHY;
+RTEMS_BSD_DRIVER_DWCOTG0((unsigned long) ALT_USB1_ADDR,
+			 ALT_INT_INTERRUPT_USB1_IRQ);
+RTEMS_BSD_DRIVER_DWC_MMC;
+RTEMS_BSD_DRIVER_MMC;
+RTEMS_BSD_DRIVER_USB;
+RTEMS_BSD_DRIVER_USB_MASS;
 
 #elif defined(LIBBSP_I386_PC386_BSP_H)
 
-#define RTEMS_BSD_DRIVER_PC_LEGACY
-#define RTEMS_BSD_DRIVER_PCI_LEM
-#define RTEMS_BSD_DRIVER_PCI_IGB
-#define RTEMS_BSD_DRIVER_PCI_EM
-#define RTEMS_BSD_DRIVER_PCI_RE
-#define RTEMS_BSD_DRIVER_REPHY
+RTEMS_BSD_DRIVER_PC_LEGACY;
+RTEMS_BSD_DRIVER_PCI_LEM;
+RTEMS_BSD_DRIVER_PCI_IGB;
+RTEMS_BSD_DRIVER_PCI_EM;
+RTEMS_BSD_DRIVER_PCI_RE;
+RTEMS_BSD_DRIVER_REPHY;
 
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
@@ -91,19 +88,13 @@
 
 #include <bsp/irq.h>
 
-#define RTEMS_BSD_DRIVER_TSEC
-#define RTEMS_BSD_DRIVER_TSEC_BASE_ADDR 0xffeb0000
-#define RTEMS_BSD_DRIVER_TSEC_TX_IRQ    QORIQ_IRQ_ETSEC_TX_1
-#define RTEMS_BSD_DRIVER_TSEC_RX_IRQ    QORIQ_IRQ_ETSEC_RX_1
-#define RTEMS_BSD_DRIVER_TSEC_ER_IRQ    QORIQ_IRQ_ETSEC_ER_1
+RTEMS_BSD_DRIVER_TSEC(0xffeb0000,
+		      QORIQ_IRQ_ETSEC_TX_1,
+		      QORIQ_IRQ_ETSEC_RX_1,
+		      QORIQ_IRQ_ETSEC_ER_1);
 
 #endif /* !QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT) */
 
 #endif
 
-/*
- * Include the supported Nexus bus devices.
- */
-#include <machine/rtems-bsd-nexus-bus.h>
-
 #endif
diff --git a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
index 898da30..5a3458c 100644
--- a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
+++ b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
@@ -98,20 +98,21 @@ extern "C" {
 /*
  * Xilinx Zynq System Level Control Core 0 (SLCR0).
  */
-#if defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0)
-/*
- * Hard IP part of the Zynq so a fixed address.
- */
-static const rtems_bsd_device_resource zy7_slcr0_res[] = {
-  {
-    .type = RTEMS_BSD_RES_MEMORY,
-    .start_request = 0,
-    .start_actual = 0xf8000000
-  }
-};
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(zy7_slcr, 0,
-			      RTEMS_ARRAY_SIZE(zy7_slcr0_res),
-			      &zy7_slcr0_res[0]);
+#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR)
+  /*
+   * Hard IP part of the Zynq so a fixed address.
+   */
+  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0                            \
+    static const rtems_bsd_device_resource zy7_slcr0_res[] = {          \
+      {                                                                 \
+        .type = RTEMS_BSD_RES_MEMORY,                                   \
+        .start_request = 0,                                             \
+        .start_actual = 0xf8000000                                      \
+      }                                                                 \
+    };                                                                  \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(zy7_slcr, 0,                          \
+                                  RTEMS_ARRAY_SIZE(zy7_slcr0_res),      \
+                                  &zy7_slcr0_res[0])
 #endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0 */
 
 /**
@@ -121,11 +122,11 @@ RTEMS_BSD_DEFINE_NEXUS_DEVICE(zy7_slcr, 0,
 /*
  * PC legacy bus.
  */
-#if defined(RTEMS_BSD_DRIVER_PC_LEGACY)
-#define RTEMS_BSD_DRIVER_HAS_PCI
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(legacy, 0, 0, NULL);
-SYSINIT_DRIVER_REFERENCE(pcib, legacy);
-SYSINIT_DRIVER_REFERENCE(pci, pcib);
+#if !defined(RTEMS_BSD_DRIVER_PC_LEGACY)
+  #define RTEMS_BSD_DRIVER_PC_LEGACY                      \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(legacy, 0, 0, NULL);    \
+    SYSINIT_DRIVER_REFERENCE(pcib, legacy);               \
+    SYSINIT_DRIVER_REFERENCE(pci, pcib)
 #endif /* RTEMS_BSD_DRIVER_PC_LEGACY */
 
 /**
@@ -135,59 +136,56 @@ SYSINIT_DRIVER_REFERENCE(pci, pcib);
 /*
  * Designware/Synopsys OTG USB Controller.
  */
-#if defined(RTEMS_BSD_DRIVER_DWCOTG0)
-#define RTEMS_BSD_DRIVER_USB
-#if !defined(RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR)
- #error DWCOTG0 base address not defined (RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR)
-#endif
-#if !defined(RTEMS_BSD_DRIVER_DWC0_IRQ)
- #error DWCOTG0 IRQ not defined (RTEMS_BSD_DRIVER_DWCOTG0_IRQ)
-#endif
-static const rtems_bsd_device_resource dwcotg0_res[] = {
-  {
-    .type = RTEMS_BSD_RES_MEMORY,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_DWCOTG0_IRQ
-  }
-};
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwcotg, 0,
-			      RTEMS_ARRAY_SIZE(dwcotg0_res),
-			      &dwcotg0_res[0]);
+#if !defined(RTEMS_BSD_DRIVER_DWCOTG0)
+  #define RTEMS_BSD_DRIVER_DWCOTG0(_base, _irq)                  \
+    static const rtems_bsd_device_resource dwcotg0_res[] = {     \
+      {                                                          \
+        .type = RTEMS_BSD_RES_MEMORY,                            \
+        .start_request = 0,                                      \
+        .start_actual = (_base)                                  \
+      }, {                                                       \
+        .type = RTEMS_BSD_RES_IRQ,                               \
+        .start_request = 0,                                      \
+        .start_actual = (_irq)                                   \
+      }                                                          \
+    };                                                           \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwcotg, 0,                     \
+                                  RTEMS_ARRAY_SIZE(dwcotg0_res), \
+                                  &dwcotg0_res[0])
 #endif /* RTEMS_BSD_DRIVER_DWCOTG0 */
 
 /*
  * Designware/Synopsys MMC.
  */
-#if defined(RTEMS_BSD_DRIVER_DWC_MMC)
-#define RTEMS_BSD_DRIVER_MMC
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(dw_mmc, 0, 0, NULL);
-SYSINIT_DRIVER_REFERENCE(mmc, dw_mmc);
+#if !defined(RTEMS_BSD_DRIVER_DWC_MMC)
+  #define RTEMS_BSD_DRIVER_DWC_MMC                                \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(dw_mmc, 0, 0, NULL);            \
+    SYSINIT_DRIVER_REFERENCE(mmc, dw_mmc)
 #endif /* RTEMS_BSD_DRIVER_DWC_MMC */
 
 /*
  * MMC Driver.
  */
-#if defined(RTEMS_BSD_DRIVER_MMC)
-SYSINIT_DRIVER_REFERENCE(mmcsd, mmc);
+#if !defined(RTEMS_BSD_DRIVER_MMC)
+  #define RTEMS_BSD_DRIVER_MMC                    \
+    SYSINIT_DRIVER_REFERENCE(mmcsd, mmc)
 #endif /* RTEMS_BSD_DRIVER_MMC */
 
 /*
  * USB Drivers.
  */
-#if defined(RTEMS_BSD_DRIVER_USB)
-SYSINIT_REFERENCE(usb_quirk_init);
-SYSINIT_DRIVER_REFERENCE(uhub, usbus);
+#if !defined(RTEMS_BSD_DRIVER_USB)
+  #define RTEMS_BSD_DRIVER_USB                    \
+    SYSINIT_REFERENCE(usb_quirk_init);            \
+    SYSINIT_DRIVER_REFERENCE(uhub, usbus)
 #endif /* RTEMS_BSD_DRIVER_USB */
 
 /*
  * USB Mass Storage Class driver.
  */
-#if defined(RTEMS_BSD_DRIVER_USB_MASS)
-SYSINIT_DRIVER_REFERENCE(umass, uhub);
+#if !defined(RTEMS_BSD_DRIVER_USB_MASS)
+  #define RTEMS_BSD_DRIVER_USB_MASS               \
+    SYSINIT_DRIVER_REFERENCE(umass, uhub)
 #endif /* RTEMS_BSD_DRIVER_USB_MASS */
 
 /**
@@ -197,164 +195,141 @@ SYSINIT_DRIVER_REFERENCE(umass, uhub);
 /*
  * SMC0 driver
  */
-#if defined(RTEMS_BSD_DRIVER_SMC0)
-#if !defined(RTEMS_BSD_DRIVER_SMC0_BASE_ADDR)
- #error SMC base address not defined (RTEMS_BSD_DRIVER_SMC0_BASE_ADDR)
-#endif
-#if !defined(RTEMS_BSD_DRIVER_SMC0_IRQ)
- #error SMC IRQ not defined (RTEMS_BSD_DRIVER_SMC0_IRQ)
-#endif
-static const rtems_bsd_device_resource smc0_res[] = {
-  {
-    .type = RTEMS_BSD_RES_MEMORY,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_SMC0_BASE_ADDR
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_SMC0_IRQ
-  }
-};
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(smc, 0,
-			      RTEMS_ARRAY_SIZE(smc0_res),
-			      &smc0_res[0]);
+#if !defined(RTEMS_BSD_DRIVER_SMC0)
+  #define RTEMS_BSD_DRIVER_SMC0(_base, _irq)                     \
+    static const rtems_bsd_device_resource smc0_res[] = {        \
+      {                                                          \
+        .type = RTEMS_BSD_RES_MEMORY,                            \
+        .start_request = 0,                                      \
+        .start_actual = (_base)                                  \
+      }, {                                                       \
+        .type = RTEMS_BSD_RES_IRQ,                               \
+        .start_request = 0,                                      \
+        .start_actual = (_irq)                                   \
+      }                                                          \
+    };                                                           \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(smc, 0,                        \
+                                  RTEMS_ARRAY_SIZE(smc0_res),    \
+                                  &smc0_res[0])
 #endif /* RTEMS_BSD_DRIVER_SMC */
 
 /*
  * Coldfire Fast Ethernet Controller (FEC) driver.
  */
-#if defined(RTEMS_BSD_DRIVER_FEC)
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(fec, 0, 0, NULL);
+#if !defined(RTEMS_BSD_DRIVER_FEC)
+  #define RTEMS_BSD_DRIVER_FEC                            \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(fec, 0, 0, NULL);
 #endif /* RTEMS_BSD_DRIVER_FEC */
 
 /*
- * Xilinx Zynq Cadence Gigbit Ethernet MAC 0 (CGEM0).
+ * Xilinx Zynq Cadence Gigbit Ethernet MAC (CGEM).
  */
-#if defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0)
-#if !defined(RTEMS_BSD_DRIVER_CGEM0_IRQ)
- #error Zynq CGEM0 IRQ not defined (RTEMS_BSD_DRIVER_CGEM0_IRQ)
-#endif
-static const rtems_bsd_device_resource cgem0_res[] = {
-  {
-    .type = RTEMS_BSD_RES_MEMORY,
-    .start_request = 0,
-    .start_actual = 0xe000b000
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_CGEM0_IRQ
-  }
-};
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(cgem, 0,
-			      RTEMS_ARRAY_SIZE(cgem0_res),
-			      &cgem0_res[0]);
+#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM)
+  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(_num, _base, _irq)              \
+    static const rtems_bsd_device_resource cgem ## _num ## _res[] = {       \
+      {                                                                     \
+        .type = RTEMS_BSD_RES_MEMORY,                                       \
+        .start_request = 0,                                                 \
+        .start_actual = (_base)                                             \
+      }, {                                                                  \
+        .type = RTEMS_BSD_RES_IRQ,                                          \
+        .start_request = 0,                                                 \
+        .start_actual = (_irq)                                              \
+      }                                                                     \
+    };                                                                      \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(cgem, _num,                               \
+                                  RTEMS_ARRAY_SIZE(cgem ## _num ## _res),   \
+                                  &cgem ## _num ## _res[0])
+#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM */
+#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0)
+  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(_irq)                \
+    RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(0, 0xe000b000, _irq)
 #endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0 */
+#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM1)
+  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM1(_irq)       \
+    RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(1, 0xe000c000, _irq)
+#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM1 */
 
 /*
  * Designware/Synopsys Ethernet MAC Controller.
  */
-#if defined(RTEMS_BSD_DRIVER_DWC0)
-#define RTEMS_BSD_DRIVER_USB
-#if !defined(RTEMS_BSD_DRIVER_DWC0_BASE_ADDR)
- #error DWC0 base address not defined (RTEMS_BSD_DRIVER_DWC0_BASE_ADDR)
-#endif
-#if !defined(RTEMS_BSD_DRIVER_DWC0_IRQ)
- #error DWC0 IRQ not defined (RTEMS_BSD_DRIVER_DWC0_IRQ)
-#endif
-static const rtems_bsd_device_resource dwc0_res[] = {
-  {
-    .type = RTEMS_BSD_RES_MEMORY,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_DWC0_BASE_ADDR
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_DWC0_IRQ
-  }
-};
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwc, 0,
-			      RTEMS_ARRAY_SIZE(dwc0_res),
-			      &dwc0_res[0]);
+#if !defined(RTEMS_BSD_DRIVER_DWC0)
+  #define RTEMS_BSD_DRIVER_DWC0(_base, _irq)                     \
+    static const rtems_bsd_device_resource dwc0_res[] = {        \
+      {                                                          \
+        .type = RTEMS_BSD_RES_MEMORY,                            \
+        .start_request = 0,                                      \
+        .start_actual = (_base)                                  \
+      }, {                                                       \
+        .type = RTEMS_BSD_RES_IRQ,                               \
+        .start_request = 0,                                      \
+        .start_actual = (_irq)                                   \
+      }                                                          \
+    };                                                           \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwc, 0,                        \
+                                  RTEMS_ARRAY_SIZE(dwc0_res),    \
+                                  &dwc0_res[0])
 #endif /* RTEMS_BSD_DRIVER_DWC0 */
 
 /*
  * NXP QorIQ Network Driver.
  */
-#if defined(RTEMS_BSD_DRIVER_TSEC)
-#if !defined(RTEMS_BSD_DRIVER_TSEC_BASE_ADDR)
- #error TSEC base address not defined (RTEMS_BSD_DRIVER_TSEC_BASE_ADDR)
-#endif
-#if !defined(RTEMS_BSD_DRIVER_TSEC_TX_IRQ)
- #error TSEC TX IRQ not defined (RTEMS_BSD_DRIVER_TSEC_TX_IRQ)
-#endif
-#if !defined(RTEMS_BSD_DRIVER_TSEC_RX_IRQ)
- #error TSEC RX IRQ not defined (RTEMS_BSD_DRIVER_TSEC_RX_IRQ)
-#endif
-#if !defined(RTEMS_BSD_DRIVER_TSEC_ER_IRQ)
- #error TSEC ER IRQ not defined (RTEMS_BSD_DRIVER_TSEC_ER_IRQ)
-#endif
-static const rtems_bsd_device_resource tsec0_res[] = {
-  {
-    .type = RTEMS_BSD_RES_MEMORY,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_TSEC_BASE_ADDR
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 0,
-    .start_actual = RTEMS_BSD_DRIVER_TSEC_TX_IRQ
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 1,
-    .start_actual = RTEMS_BSD_DRIVER_TSEC_RX_IRQ
-  }, {
-    .type = RTEMS_BSD_RES_IRQ,
-    .start_request = 2,
-    .start_actual = RTEMS_BSD_DRIVER_TSEC_ER_IRQ
-  }
-};
-RTEMS_BSD_DEFINE_NEXUS_DEVICE(tsec, 0,
-			      RTEMS_ARRAY_SIZE(tsec0_res),
-			      &tsec0_res[0]);
+#if !defined(RTEMS_BSD_DRIVER_TSEC)
+  #define RTEMS_BSD_DRIVER_TSEC(_base, _tx_irq, _rx_irq, _er_irq)   \
+    static const rtems_bsd_device_resource tsec0_res[] = {          \
+      {                                                             \
+        .type = RTEMS_BSD_RES_MEMORY,                               \
+        .start_request = 0,                                         \
+        .start_actual = (_base)                                     \
+      }, {                                                          \
+        .type = RTEMS_BSD_RES_IRQ,                                  \
+        .start_request = 0,                                         \
+        .start_actual = (_tx_irq)                                   \
+      }, {                                                          \
+        .type = RTEMS_BSD_RES_IRQ,                                  \
+        .start_request = 1,                                         \
+        .start_actual = (_rx_irq)                                   \
+      }, {                                                          \
+        .type = RTEMS_BSD_RES_IRQ,                                  \
+        .start_request = 2,                                         \
+        .start_actual = (_er_irq)                                   \
+      }                                                             \
+    };                                                              \
+    RTEMS_BSD_DEFINE_NEXUS_DEVICE(tsec, 0,                          \
+                                  RTEMS_ARRAY_SIZE(tsec0_res),      \
+                                  &tsec0_res[0])
 #endif /* RTEMS_BSD_DRIVER_TSEC */
 
 /*
  * Intel's Legacy EM driver.
  */
-#if defined(RTEMS_BSD_DRIVER_PCI_LEM)
-#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
- #error PCI bus not found, check BSP bus support.
-#endif
-SYSINIT_DRIVER_REFERENCE(lem, pci);
+#if !defined(RTEMS_BSD_DRIVER_PCI_LEM)
+  #define RTEMS_BSD_DRIVER_PCI_LEM                \
+    SYSINIT_DRIVER_REFERENCE(lem, pci);
 #endif /* RTEMS_BSD_DRIVER_PCI_LEM */
 
 /*
  * Intel's Gigabit Driver.
  */
-#if defined(RTEMS_BSD_DRIVER_PCI_IGB)
-#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
- #error PCI bus not found, check BSP bus support.
-#endif
-SYSINIT_DRIVER_REFERENCE(igb, pci);
+#if !defined(RTEMS_BSD_DRIVER_PCI_IGB)
+  #define RTEMS_BSD_DRIVER_PCI_IGB                \
+    SYSINIT_DRIVER_REFERENCE(igb, pci);
 #endif /* RTEMS_BSD_DRIVER_PCI_IGB */
 
 /*
  * Intel's EM Driver.
  */
-#if defined(RTEMS_BSD_DRIVER_PCI_EM)
-#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
- #error PCI bus not found, check BSP bus support.
-#endif
-SYSINIT_DRIVER_REFERENCE(em, pci);
+#if !defined(RTEMS_BSD_DRIVER_PCI_EM)
+  #define RTEMS_BSD_DRIVER_PCI_EM                 \
+    SYSINIT_DRIVER_REFERENCE(em, pci);
 #endif /* RTEMS_BSD_DRIVER_PCI_EM */
 
 /*
  * Realtek Driver
  */
-#if defined(RTEMS_BSD_DRIVER_PCI_RE)
-#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
- #error PCI bus not found, check BSP bus support.
-#endif
-SYSINIT_DRIVER_REFERENCE(re, pci);
+#if !defined(RTEMS_BSD_DRIVER_PCI_RE)
+  #define RTEMS_BSD_DRIVER_PCI_RE                 \
+    SYSINIT_DRIVER_REFERENCE(re, pci);
 #endif /* RTEMS_BSD_DRIVER_PCI_RE */
 
 /**
@@ -364,22 +339,25 @@ SYSINIT_DRIVER_REFERENCE(re, pci);
 /*
  * E1000 PHY
  */
-#if defined(RTEMS_BSD_DRIVER_E1000PHY)
-SYSINIT_DRIVER_REFERENCE(e1000phy, miibus);
+#if !defined(RTEMS_BSD_DRIVER_E1000PHY)
+  #define RTEMS_BSD_DRIVER_E1000PHY               \
+    SYSINIT_DRIVER_REFERENCE(e1000phy, miibus);
 #endif /* RTEMS_BSD_DRIVER_E1000PHY */
 
 /*
  * Reltek PHY
  */
-#if defined(RTEMS_BSD_DRIVER_REPHY)
-SYSINIT_DRIVER_REFERENCE(rgephy, miibus);
+#if !defined(RTEMS_BSD_DRIVER_REPHY)
+  #define RTEMS_BSD_DRIVER_REPHY                  \
+    SYSINIT_DRIVER_REFERENCE(rgephy, miibus);
 #endif /* RTEMS_BSD_DRIVER_REPHY */
 
 /*
  * MI PHY.
  */
-#if defined(RTEMS_BSD_DRIVER_MIPHY)
-SYSINIT_DRIVER_REFERENCE(micphy, miibus);
+#if !defined(RTEMS_BSD_DRIVER_MIPHY)
+  #define RTEMS_BSD_DRIVER_MIPHY                  \
+    SYSINIT_DRIVER_REFERENCE(micphy, miibus);
 #endif /* RTEMS_BSD_DRIVER_MIPHY */
 
 #ifdef __cplusplus




More information about the vc mailing list