]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Support for 2 extra linflex modules for 5604b
authorjcar <devnull@localhost>
Wed, 15 Feb 2012 12:16:42 +0000 (13:16 +0100)
committerjcar <devnull@localhost>
Wed, 15 Feb 2012 12:16:42 +0000 (13:16 +0100)
arch/ppc/mpc55xx/drivers/LinFlex.c

index bc284bcc662767ccca3caaf6fd69a7b02e6aabd1..0144747172a3438534c10ac4a5e9a3f4aa0a387b 100644 (file)
@@ -94,24 +94,8 @@ typedef volatile union {
 \r
 static void ResyncDriver(uint8 Channel)\r
 {\r
-       volatile struct LINFLEX_tag * LINFLEXHw = LINFLEX(Channel);\r
-\r
-        /* Disable tx irq */\r
-        /* Disable Rx Interrupt */\r
-        /* Disable Rx Interrupt */\r
-\r
-       /* Disable transmitter and receiver. */\r
-\r
-       /* Clear flags  */\r
-\r
-       /* Prepare module for resynchronization. */\r
-        /* LIN Resynchronize. First set then cleared. */\r
-       /* Resynchronize module. */\r
-        /* LIN Resynchronize. First set then cleared. */\r
-\r
-       /* Enable transmitter and receiver. */\r
-\r
-       /* Clear set flags again */\r
+       /* volatile struct LINFLEX_tag * LINFLEXHw = LINFLEX(Channel); */\r
+    /* In case we need to re-init or re-sync driver because of error or hangup it should be done here */\r
 }\r
 \r
 \r
@@ -182,6 +166,16 @@ static void LinInterruptRxB(){LinInterruptRx(LIN_CTRL_B);}
 static void LinInterruptTxB(){LinInterruptTx(LIN_CTRL_B);}\r
 static void LinInterruptErrB(){LinInterruptErr(LIN_CTRL_B);}\r
 \r
+#if defined (CFG_MPC5604B)\r
+static void LinInterruptRxC(){LinInterruptRx(LIN_CTRL_C);}\r
+static void LinInterruptTxC(){LinInterruptTx(LIN_CTRL_C);}\r
+static void LinInterruptErrC(){LinInterruptErr(LIN_CTRL_C);}\r
+\r
+static void LinInterruptRxD(){LinInterruptRx(LIN_CTRL_D);}\r
+static void LinInterruptTxD(){LinInterruptTx(LIN_CTRL_D);}\r
+static void LinInterruptErrD(){LinInterruptErr(LIN_CTRL_D);}\r
+#endif\r
+\r
 void Lin_Init( const Lin_ConfigType* Config )\r
 {\r
        (void)Config;\r
@@ -236,6 +230,18 @@ void Lin_InitChannel(  uint8 Channel,   const Lin_ChannelConfigType* Config )
                ISR_INSTALL_ISR2("LinIsrTxB", LinInterruptTxB, (IrqType)(LINFLEX_1_TXI),LIN_PRIO, 0);\r
                ISR_INSTALL_ISR2("LinIsrErrB", LinInterruptErrB, (IrqType)(LINFLEX_1_ERR),LIN_PRIO, 0);\r
                break;\r
+#if defined (CFG_MPC5604B)\r
+       case 2:\r
+               ISR_INSTALL_ISR2("LinIsrRxC", LinInterruptRxC, (IrqType)(LINFLEX_2_RXI),LIN_PRIO, 0);\r
+               ISR_INSTALL_ISR2("LinIsrTxC", LinInterruptTxC, (IrqType)(LINFLEX_2_TXI),LIN_PRIO, 0);\r
+               ISR_INSTALL_ISR2("LinIsrErrC", LinInterruptErrC, (IrqType)(LINFLEX_2_ERR),LIN_PRIO, 0);\r
+               break;\r
+       case 3:\r
+               ISR_INSTALL_ISR2("LinIsrRxD", LinInterruptRxD, (IrqType)(LINFLEX_3_RXI),LIN_PRIO, 0);\r
+               ISR_INSTALL_ISR2("LinIsrTxD", LinInterruptTxD, (IrqType)(LINFLEX_3_TXI),LIN_PRIO, 0);\r
+               ISR_INSTALL_ISR2("LinIsrErrD", LinInterruptErrD, (IrqType)(LINFLEX_3_ERR),LIN_PRIO, 0);\r
+               break;\r
+#endif\r
        default:\r
                break;\r
        }\r