[PATCH rtems-net-legacy] leon3: Replace ambapp_plb with ambapp_plb()

Vijay Kumar Banerjee vijay at rtems.org
Fri Mar 31 00:20:49 UTC 2023


RTEMS commit 2c07f24af210c4738fbe6f75a53c58fbd80fb658 removed the ambapp_plb
global variable
---
 bsps/sparc/leon3/net/leon_greth.c    |  3 ++-
 bsps/sparc/leon3/net/leon_open_eth.c |  5 +++--
 bsps/sparc/leon3/net/leon_smc91111.c | 11 ++++++-----
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/bsps/sparc/leon3/net/leon_greth.c b/bsps/sparc/leon3/net/leon_greth.c
index 5b0c99d..934728f 100644
--- a/bsps/sparc/leon3/net/leon_greth.c
+++ b/bsps/sparc/leon3/net/leon_greth.c
@@ -13,6 +13,7 @@
 
 #include <bsp.h>
 #include <libchip/greth.h>
+#include <grlib/ambapp.h>
 /*#if (GRETH_DEBUG & GRETH_DEBUG_PRINT_REGISTERS)*/
 #include <stdio.h>
 /*#endif*/
@@ -36,7 +37,7 @@ int rtems_leon_greth_driver_attach(
   struct ambapp_apb_info *apb;
 
   /* Scan for MAC AHB slave interface */
-  adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),
+  adev = (void *)ambapp_for_each(ambapp_plb(), (OPTIONS_ALL|OPTIONS_APB_SLVS),
                                  VENDOR_GAISLER, GAISLER_ETHMAC,
                                  ambapp_find_by_idx, NULL);
   if (adev) {
diff --git a/bsps/sparc/leon3/net/leon_open_eth.c b/bsps/sparc/leon3/net/leon_open_eth.c
index 2b386f8..315f6b7 100644
--- a/bsps/sparc/leon3/net/leon_open_eth.c
+++ b/bsps/sparc/leon3/net/leon_open_eth.c
@@ -17,6 +17,7 @@
 
 #include <bsp.h>
 #include <libchip/open_eth.h>
+#include <leon.h>
 #if (OPEN_ETH_DEBUG & OPEN_ETH_DEBUG_PRINT_REGISTERS)
 #include <stdio.h>
 #endif
@@ -40,11 +41,11 @@ int rtems_leon_open_eth_driver_attach(
   struct ambapp_ahb_info *ahb;
 
   /* Scan for MAC AHB slave interface */
-  adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_AHB_SLVS),
+  adev = (void *)ambapp_for_each(ambapp_plb(), (OPTIONS_ALL|OPTIONS_AHB_SLVS),
                                  VENDOR_OPENCORES, OPENCORES_ETHMAC,
                                  ambapp_find_by_idx, NULL);
   if (!adev) {
-    adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_AHB_SLVS),
+    adev = (void *)ambapp_for_each(ambapp_plb(), (OPTIONS_ALL|OPTIONS_AHB_SLVS),
                                    VENDOR_GAISLER, GAISLER_ETHAHB,
                                    ambapp_find_by_idx, NULL);
   }
diff --git a/bsps/sparc/leon3/net/leon_smc91111.c b/bsps/sparc/leon3/net/leon_smc91111.c
index 70b2dcc..6577f28 100644
--- a/bsps/sparc/leon3/net/leon_smc91111.c
+++ b/bsps/sparc/leon3/net/leon_smc91111.c
@@ -19,6 +19,7 @@
 #include <libchip/smc91111exp.h>
 #include <rtems/bspIo.h>
 #include <grlib/ambapp.h>
+#include <grlib/grlib.h>
 
 #define SMC91111_BASE_ADDR (void*)0x20000300
 #define SMC91111_BASE_IRQ  4
@@ -45,7 +46,7 @@ rtems_smc91111_driver_attach_leon3 (struct rtems_bsdnet_ifconfig *config,
   struct ambapp_apb_info apbpio;
   struct ambapp_apb_info apbmctrl;
 
-  if (ambapp_find_apbslv(&ambapp_plb, VENDOR_GAISLER, GAISLER_GPIO, &apbpio)
+  if (ambapp_find_apbslv(ambapp_plb(), VENDOR_GAISLER, GAISLER_GPIO, &apbpio)
       != 1) {
     printk("SMC9111_leon3: didn't find PIO\n");
     return 0;
@@ -54,12 +55,12 @@ rtems_smc91111_driver_attach_leon3 (struct rtems_bsdnet_ifconfig *config,
   /* In order to access the SMC controller the memory controller must have
    * I/O bus enabled. Find first memory controller.
    */
-  if (ambapp_find_apbslv(&ambapp_plb, VENDOR_ESA, ESA_MCTRL, &apbmctrl) != 1) {
-    if (ambapp_find_apbslv(&ambapp_plb, VENDOR_GAISLER, GAISLER_FTMCTRL,
+  if (ambapp_find_apbslv(ambapp_plb(), VENDOR_ESA, ESA_MCTRL, &apbmctrl) != 1) {
+    if (ambapp_find_apbslv(ambapp_plb(), VENDOR_GAISLER, GAISLER_FTMCTRL,
                            &apbmctrl) != 1) {
-      if (ambapp_find_apbslv(&ambapp_plb, VENDOR_GAISLER, GAISLER_FTSRCTRL,
+      if (ambapp_find_apbslv(ambapp_plb(), VENDOR_GAISLER, GAISLER_FTSRCTRL,
                              &apbmctrl) != 1) {
-        if (ambapp_find_apbslv(&ambapp_plb, VENDOR_GAISLER, GAISLER_FTSRCTRL8,
+        if (ambapp_find_apbslv(ambapp_plb(), VENDOR_GAISLER, GAISLER_FTSRCTRL8,
                                &apbmctrl) != 1) {
           printk("SMC9111_leon3: didn't find any memory controller\n");
           return 0;
-- 
2.34.3



More information about the devel mailing list