[PATCH rtems-libbsd 5-freebsd-12 2/2] bsp/motorola_powerpc: Add dc, ukphy and legacy PCI support
chrisj at rtems.org
chrisj at rtems.org
Tue Sep 21 01:14:13 UTC 2021
From: Chris Johns <chrisj at rtems.org>
- Add the dc net dev to the BSP
- Add the ukphy support
- Add PCI Legacy bus support to the PowerPC
Closes #4514
---
freebsd/sys/dev/dc/if_dc.c | 7 +++++++
freebsd/sys/dev/dc/if_dcreg.h | 7 +++++++
libbsd.py | 2 +-
rtemsbsd/include/bsp/nexus-devices.h | 8 +++++++-
rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 17 +++++++++++++++++
rtemsbsd/powerpc/include/machine/legacyvar.h | 2 ++
rtemsbsd/powerpc/include/machine/pci_cfgreg.h | 2 ++
7 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 rtemsbsd/powerpc/include/machine/legacyvar.h
create mode 100644 rtemsbsd/powerpc/include/machine/pci_cfgreg.h
diff --git a/freebsd/sys/dev/dc/if_dc.c b/freebsd/sys/dev/dc/if_dc.c
index 7fc0ef54..b36967da 100644
--- a/freebsd/sys/dev/dc/if_dc.c
+++ b/freebsd/sys/dev/dc/if_dc.c
@@ -156,6 +156,10 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1);
* Various supported device vendors/types and their names.
*/
static const struct dc_type dc_devs[] = {
+#ifdef __rtems__
+ { DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21140A), 0,
+ "Intel 21140A 10/100BaseTX" },
+#endif /* __rtems__ */
{ DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0,
"Intel 21143 10/100BaseTX" },
{ DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0,
@@ -2076,6 +2080,9 @@ dc_attach(device_t dev)
dc_eeprom_width(sc);
switch (sc->dc_info->dc_devid) {
+#ifdef __rtems__
+ case DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21140A):
+#endif /* __rtems__ */
case DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143):
sc->dc_type = DC_TYPE_21143;
sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR;
diff --git a/freebsd/sys/dev/dc/if_dcreg.h b/freebsd/sys/dev/dc/if_dcreg.h
index 9ae26cc6..1c5d39a0 100644
--- a/freebsd/sys/dev/dc/if_dcreg.h
+++ b/freebsd/sys/dev/dc/if_dcreg.h
@@ -824,6 +824,13 @@ struct dc_softc {
*/
#define DC_VENDORID_DEC 0x1011
+#ifdef __rtems__
+/*
+ * DEC/Intel 21140 PCI device ID
+ */
+#define DC_DEVICEID_21140A 0x0009
+
+#endif /* __rtems__ */
/*
* DEC/Intel 21143 PCI device ID
*/
diff --git a/libbsd.py b/libbsd.py
index ea54d1c2..cab130cf 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -2639,7 +2639,7 @@ class pci(builder.Module):
]
)
self.addCPUDependentFreeBSDSourceFiles(
- [ 'i386' ],
+ [ 'i386', 'powerpc' ],
[
'sys/x86/x86/legacy.c',
'sys/x86/pci/pci_bus.c',
diff --git a/rtemsbsd/include/bsp/nexus-devices.h b/rtemsbsd/include/bsp/nexus-devices.h
index d2ceab8e..86305e9c 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -197,6 +197,12 @@ SYSINIT_DRIVER_REFERENCE(ukphy, miibus);
RTEMS_BSD_DEFINE_NEXUS_DEVICE(fec, 0, 0, NULL);
SYSINIT_DRIVER_REFERENCE(ukphy, miibus);
-#endif
+#elif defined(LIBBSP_POWERPC_MOTOROLA_POWERPC_BSP_H)
+
+RTEMS_BSD_DRIVER_PC_LEGACY;
+RTEMS_BSD_DRIVER_PCI_DC;
+RTEMS_BSD_DRIVER_UKPHY;
+
+#endif /* LIBBSP_POWERPC_MOTOROLA_POWERPC_BSP_H */
#endif
diff --git a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
index ff545dc0..c2d71eed 100644
--- a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
+++ b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
@@ -77,6 +77,7 @@
* RTEMS_BSD_DRIVER_ICSPHY
* RTEMS_BSD_DRIVER_REPHY
* RTEMS_BSD_DRIVER_PHY_MIC
+ * RTEMS_BSD_DRIVER_UKPHY
*/
#if !defined(RTEMS_BSD_NEXUS_BUS_h)
@@ -441,6 +442,14 @@ extern "C" {
SYSINIT_DRIVER_REFERENCE(re, pci);
#endif /* RTEMS_BSD_DRIVER_PCI_RE */
+/*
+ * DEC Tulip Driver
+ */
+#if !defined(RTEMS_BSD_DRIVER_PCI_DC)
+ #define RTEMS_BSD_DRIVER_PCI_DC \
+ SYSINIT_DRIVER_REFERENCE(dc, pci);
+#endif /* RTEMS_BSD_DRIVER_PCI_DC */
+
/**
** MMI Physical Layer Support.
**/
@@ -477,6 +486,14 @@ extern "C" {
SYSINIT_DRIVER_REFERENCE(micphy, miibus);
#endif /* RTEMS_BSD_DRIVER_PHY_MIC */
+/*
+ * UK PHY (for unknown PHY devices)
+ */
+#if !defined(RTEMS_BSD_DRIVER_UKPHY)
+ #define RTEMS_BSD_DRIVER_UKPHY \
+ SYSINIT_DRIVER_REFERENCE(ukphy, miibus);
+#endif /* RTEMS_BSD_DRIVER_UKPHY */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/rtemsbsd/powerpc/include/machine/legacyvar.h b/rtemsbsd/powerpc/include/machine/legacyvar.h
new file mode 100644
index 00000000..8683a0e5
--- /dev/null
+++ b/rtemsbsd/powerpc/include/machine/legacyvar.h
@@ -0,0 +1,2 @@
+/* See freebsd/sys/x86/include/machine/legacyvar.h */
+#include <x86/include/machine/legacyvar.h>
diff --git a/rtemsbsd/powerpc/include/machine/pci_cfgreg.h b/rtemsbsd/powerpc/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..1bfa468e
--- /dev/null
+++ b/rtemsbsd/powerpc/include/machine/pci_cfgreg.h
@@ -0,0 +1,2 @@
+/* See freebsd/sys/x86/include/machine/pci_cfgreg.h */
+#include <x86/include/machine/pci_cfgreg.h>
--
2.24.1
More information about the devel
mailing list