]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
Enable ethernet interrupts for all platforms
authorJakub NejedlĂ˝ <nejedjak@fel.cvut.cz>
Mon, 19 Aug 2019 12:53:30 +0000 (14:53 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 29 Aug 2019 15:09:51 +0000 (17:09 +0200)
Due code multiplication was notification
file moved to folder common for all platforms.

To notification was copyed code providing
ethernet interrupts.
Interrupts vector was updated for all platforms.

Makefile.var
rpp/src/sys/.gitattributes
rpp/src/sys/_rm48_hdk/.gitattributes
rpp/src/sys/_rm48_hdk/sys_startup.c
rpp/src/sys/_tms570_hdk/notification.c [deleted file]
rpp/src/sys/_tms570_hdk/sys_startup.c
rpp/src/sys/_tms570_hydctr/notification.c [deleted file]
rpp/src/sys/_tms570_hydctr/sys_startup.c
rpp/src/sys/notification.c [moved from rpp/src/sys/_rm48_hdk/notification.c with 60% similarity]

index d1536e306ef61fd44e6682e8cd34f9a1d167f194..116051b7631576863efbae5e16fd5ce34ff07122 100644 (file)
@@ -49,7 +49,7 @@ rpp_lib_SOURCES +=                                                            \
        rpp/src/sys/asm/sys_intvecs.asm                 \
        rpp/src/sys/asm/sys_mpu.asm                             \
        rpp/src/sys/asm/sys_pmu.asm                             \
-       rpp/src/sys/_$(TARGET)/notification.c   \
+       $(call target_or_common,rpp/src/sys/notification.c) \
        rpp/src/sys/phy_dp83848h.c                              \
        rpp/src/sys/sys_phantom.c                               \
        $(call target_or_common,rpp/src/sys/sys_pinmux.c) \
index 8c0bc182afa4ada4c70233db0b0ec5b048e20573..1e40a09a7940f811fe6d2b41759bc27e938b1122 100644 (file)
@@ -1,3 +1,4 @@
+/notification.c        eaton
 /phy_dp83848h.c        eaton
 /sys_phantom.c eaton
 /sys_pinmux.c  eaton
index 4a3995b2a5264d5d50c528474571761b5587bfa1..087160c4a210379931262d9bdd30ef432d43c489 100644 (file)
@@ -1,3 +1,2 @@
-/notification.c        eaton
 /sys_startup.c eaton
 /ti_drv_adc.c  eaton
index c288dd535596b9bd81968d6324be96648f1a9f12..9ff974b628dd2d71b3d43ebbbaad5e2fd54f7c79 100644 (file)
@@ -163,10 +163,10 @@ static const t_isrFuncPTR s_vim_init[] =
     &phantomInterrupt,
     &phantomInterrupt,
     &phantomInterrupt,      // 75
-    &phantomInterrupt,      //MDIOMiscInt
-    &phantomInterrupt,   //EMACCore0TxIsr
+    &MDIOMiscInt,      //MDIOMiscInt
+    &EMACCore0TxIsr,   //EMACCore0TxIsr
     &phantomInterrupt,
-    &phantomInterrupt,   //EMACCore0RxIsr
+    &EMACCore0RxIsr,   //EMACCore0RxIsr
     &phantomInterrupt,      // 80
     &phantomInterrupt,
     &phantomInterrupt,
diff --git a/rpp/src/sys/_tms570_hdk/notification.c b/rpp/src/sys/_tms570_hdk/notification.c
deleted file mode 100644 (file)
index 2fa5b0a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file notification.c
- *   @brief User Notification Definition File
- *   @date 15.Mar.2012
- *   @version 03.01.00
- *
- *   This file  defines  empty  notification  routines.
- *   The user needs to remove the while loop and define
- *   the sequence.
- *
- */
-
-/* Include Files */
-
-#include "sys/sys.h"
-#include "sys/ti_drv_can.h"
-
-void esmGroup1Notification(uint32_t channel)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void esmGroup2Notification(uint32_t channel)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void memoryPort0TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-/** @brief Semaphore blocking task when it waits for interrupt signaling message receive
- *
- */
-void canErrorNotification(canBASE_t *node, uint32_t notification)
-{}
-
-void canMessageNotification(canBASE_t *node, uint32_t messageBox)
-{}
-
-void gioNotification(int bit)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void i2cNotification(i2cBASE_t *i2c, uint32_t flags)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void mibspiNotification(mibspiBASE_t *mibspi, uint32_t flags)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32_t group)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void pwmNotification(hetBASE_t *hetREG,uint32_t pwm, uint32_t notification)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void edgeNotification(hetBASE_t *hetREG,uint32_t edge)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void hetNotification(hetBASE_t *het, uint32_t offset)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
index 838eac81205804f2578d9b6e65d20c65d904e7b5..98936ed7078c0a61c2f9c7150d32053534750b64 100644 (file)
@@ -163,10 +163,10 @@ static const t_isrFuncPTR s_vim_init[] =
     &phantomInterrupt,
     &phantomInterrupt,
     &phantomInterrupt,      // 75
-    &phantomInterrupt,      //MDIOMiscInt
-    &phantomInterrupt,   //EMACCore0TxIsr
+    &MDIOMiscInt,      //MDIOMiscInt
+    &EMACCore0TxIsr,   //EMACCore0TxIsr
     &phantomInterrupt,
-    &phantomInterrupt,   //EMACCore0RxIsr
+    &EMACCore0RxIsr,   //EMACCore0RxIsr
     &phantomInterrupt,      // 80
     &phantomInterrupt,
     &phantomInterrupt,
diff --git a/rpp/src/sys/_tms570_hydctr/notification.c b/rpp/src/sys/_tms570_hydctr/notification.c
deleted file mode 100644 (file)
index 2fa5b0a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file notification.c
- *   @brief User Notification Definition File
- *   @date 15.Mar.2012
- *   @version 03.01.00
- *
- *   This file  defines  empty  notification  routines.
- *   The user needs to remove the while loop and define
- *   the sequence.
- *
- */
-
-/* Include Files */
-
-#include "sys/sys.h"
-#include "sys/ti_drv_can.h"
-
-void esmGroup1Notification(uint32_t channel)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void esmGroup2Notification(uint32_t channel)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void memoryPort0TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-/** @brief Semaphore blocking task when it waits for interrupt signaling message receive
- *
- */
-void canErrorNotification(canBASE_t *node, uint32_t notification)
-{}
-
-void canMessageNotification(canBASE_t *node, uint32_t messageBox)
-{}
-
-void gioNotification(int bit)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void i2cNotification(i2cBASE_t *i2c, uint32_t flags)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void mibspiNotification(mibspiBASE_t *mibspi, uint32_t flags)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32_t group)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void pwmNotification(hetBASE_t *hetREG,uint32_t pwm, uint32_t notification)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void edgeNotification(hetBASE_t *hetREG,uint32_t edge)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
-
-void hetNotification(hetBASE_t *het, uint32_t offset)
-{
-/*  enter user code and remove the while loop... */
-       while (1) ;
-}
index 705651eda93047904ce0c39f0ad1a1eae03ba8af..dae8dcc98a955d2e1fadf30f77aaca6ff516a141 100644 (file)
@@ -163,10 +163,10 @@ static const t_isrFuncPTR s_vim_init[] =
     &phantomInterrupt,
     &phantomInterrupt,
     &phantomInterrupt,      // 75
-    &phantomInterrupt,      //MDIOMiscInt
-    &phantomInterrupt,   //EMACCore0TxIsr
+    &MDIOMiscInt,      //MDIOMiscInt
+    &EMACCore0TxIsr,   //EMACCore0TxIsr
     &phantomInterrupt,
-    &phantomInterrupt,   //EMACCore0RxIsr
+    &EMACCore0RxIsr,   //EMACCore0RxIsr
     &phantomInterrupt,      // 80
     &phantomInterrupt,
     &phantomInterrupt,
similarity index 60%
rename from rpp/src/sys/_rm48_hdk/notification.c
rename to rpp/src/sys/notification.c
index 2fa5b0aaaa46e3f9c8e56e866c113d1fc77315e8..bd16549edc63e0848de57ad364e8f47bfe156fba 100644 (file)
@@ -12,6 +12,7 @@
 /* Include Files */
 
 #include "sys/sys.h"
+#include "rpp/eth.h"
 #include "sys/ti_drv_can.h"
 
 void esmGroup1Notification(uint32_t channel)
@@ -87,3 +88,53 @@ void hetNotification(hetBASE_t *het, uint32_t offset)
 /*  enter user code and remove the while loop... */
        while (1) ;
 }
+
+#ifndef FREERTOS_POSIX
+extern boolean_t HostPendErrHandler(void);
+#if PHY_LINK_MONITOR_INT
+extern boolean_t LinkIntHandler(void);
+#endif
+#pragma INTERRUPT(MDIOMiscInt, IRQ)
+void MDIOMiscInt(void)
+{
+       if (HostPendErrHandler()) return;
+#if PHY_LINK_MONITOR_INT
+       if (LinkIntHandler()) return;
+#endif
+}
+
+extern void RxIntHandler(uint32_t instNum);
+extern void TxIntHandler(uint32_t instNum);
+
+volatile int countEMACCore0RxIsr = 0;
+#pragma INTERRUPT(EMACCore0RxIsr, IRQ)
+void EMACCore0RxIsr(void)
+{
+       countEMACCore0RxIsr++;
+       RxIntHandler(0);
+       /* FIXME was in emac_cmd.c/eth.c and should move somewhere else.
+          rx_irq_cnt++;
+
+          // We know we have only one RX Packet Buffer descriptor --
+          // so we write it in CP to disable interrupt
+          EMACRxCPWrite(emacBase, channel, (unsigned int)rx_desc);
+          EMACCoreIntAck(emacBase, EMAC_INT_CORE0_RX);
+        */
+}
+
+volatile int countEMACCore0TxIsr = 0;
+#pragma INTERRUPT(EMACCore0TxIsr, IRQ)
+void EMACCore0TxIsr(void)
+{
+       countEMACCore0TxIsr++;
+       TxIntHandler(0);
+       /* FIXME Was in emac_cmd.c/eth.c and should move somewhere else
+          tx_irq_cnt++;
+          // If is not being processed by the EMAC anymore
+          if (!(fr1.PktFlgLen & EMAC_DSC_FLAG_OWNER)) {
+          EMACTxCPWrite(emacBase, channel, (unsigned int)&fr1);
+          EMACCoreIntAck(emacBase, EMAC_INT_CORE0_TX);
+          }
+        */
+}
+#endif /* ifndef FREERTOS_POSIX */
\ No newline at end of file