[rtems commit] PR2052: LEON3: fix open_eth interrupt initialization bug

gedare at rtems.org gedare at rtems.org
Tue Apr 10 19:12:28 UTC 2012


Module:    rtems
Branch:    master
Commit:    7afcb2619bc2b413c6f082c2bcc8d281dba8fa33
Changeset: http://git.rtems.org/rtems/commit/?id=7afcb2619bc2b413c6f082c2bcc8d281dba8fa33

Author:    Daniel Hellstrom <daniel at gaisler.com>
Date:      Tue Apr 10 15:12:23 2012 -0400

PR2052: LEON3: fix open_eth interrupt initialization bug

Fixed a bug where the vector number is used to clean and unmask
the IRQ at the IRQ controller, the irq number must be used.

Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>

---

 .../sparc/leon3/leon_open_eth/leon_open_eth.c      |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c b/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c
index 3d42d9f..5799f83 100644
--- a/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c
+++ b/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c
@@ -47,7 +47,7 @@ int rtems_leon_open_eth_driver_attach(
     {
       iobar = amba_ahb_get_membar(amba_conf.ahbslv, i, 0);
       base_addr = amba_iobar_start(LEON3_IO_AREA, iobar);
-      eth_irq = amba_irq(conf) + 0x10;
+      eth_irq = amba_irq(conf);
       device_found = 1;
       break;
     }
@@ -61,14 +61,14 @@ int rtems_leon_open_eth_driver_attach(
     *(volatile int *) base_addr = 0x800;
     *(volatile int *) base_addr = 0;
     leon_open_eth_configuration.base_address = base_addr;
-    leon_open_eth_configuration.vector = eth_irq;
+    leon_open_eth_configuration.vector = eth_irq + 0x10;
     leon_open_eth_configuration.txd_count = TDA_COUNT;
     leon_open_eth_configuration.rxd_count = RDA_COUNT;
     /* enable 100 MHz operation only if cpu frequency >= 50 MHz */
     if (LEON3_Timer_Regs->scaler_reload >= 49) leon_open_eth_configuration.en100MHz = 1;
     if (rtems_open_eth_driver_attach( config, &leon_open_eth_configuration )) {
-      LEON_Clear_interrupt(leon_open_eth_configuration.vector);
-      LEON_Unmask_interrupt(leon_open_eth_configuration.vector);
+      LEON_Clear_interrupt(eth_irq);
+      LEON_Unmask_interrupt(eth_irq);
     }
   }
   return 0;




More information about the vc mailing list