PDK-5000: Board: Enabled CAN diagnostic test for tpr12 evm
authorM V Pratap Reddy <x0257344@ti.com>
Wed, 2 Dec 2020 06:18:03 +0000 (11:48 +0530)
committerM V Pratap Reddy <x0257344@ti.com>
Wed, 2 Dec 2020 06:18:03 +0000 (11:48 +0530)
packages/ti/board/diag/mcan/src/mcan_test.c
packages/ti/board/diag/mcan/src/mcan_test.h

index 9e1cd6937e9a5836d04a51c97e22bc7838f87198..6a0e86152c87c5fc8ae5014366c7b2d3f38db1a2 100755 (executable)
@@ -42,9 +42,9 @@
  *  Operation: MCAN operational mode is set to CAN-FD. This test will need
  *  two MCAN ports.
  *
- *  Supported SoCs: AM65XX, J721E, J7200,AM64x.
+ *  Supported SoCs: AM65XX, J721E, J7200,AM64x, TPR12.
  *
- *  Supported Platforms: am65xx_idk, j721e_evm, j7200_evm, am64x_evm.
+ *  Supported Platforms: am65xx_idk, j721e_evm, j7200_evm, am64x_evm & tpr12_evm.
  *
  */
 
@@ -83,6 +83,10 @@ BoardDiag_McanPortInfo_t  gMcanDiagPortInfo[MCAN_MAX_PORTS] = {{CSL_MCAN0_MSGMEM
                                                        {CSL_MCAN1_MSGMEM_RAM_BASE,     1, MAIN_MCAN1_TX_INT_NUM, MAIN_MCAN1_RX_INT_NUM, MAIN_MCAN1_TS_INT_NUM},
                                                       };
 
+#elif defined(tpr12_evm)
+BoardDiag_McanPortInfo_t  gMcanDiagPortInfo[MCAN_MAX_PORTS] = {{CSL_MSS_MCANA_MSG_RAM_U_BASE,     0, MAIN_MCAN0_TX_INT_NUM, MAIN_MCAN0_RX_INT_NUM, MAIN_MCAN0_TS_INT_NUM},
+                                                       {CSL_MSS_MCANB_MSG_RAM_U_BASE,     1, MAIN_MCAN1_TX_INT_NUM, MAIN_MCAN1_RX_INT_NUM, MAIN_MCAN1_TS_INT_NUM},
+                                                      };
 #else
 BoardDiag_McanPortInfo_t gMcanDiagPortInfo[MCAN_MAX_PORTS_EXP] =
 {{CSL_MCU_MCAN0_MSGMEM_RAM_BASE, 0, MCU_MCAN0_TX_INT_NUM,  MCU_MCAN0_RX_INT_NUM,  MCU_MCAN0_TS_INT_NUM},
@@ -811,7 +815,7 @@ static void BoardDiag_mcanMainconfigs(void)
 }
 #endif  /* #if defined(SOC_J721E) || defined(SOC_J7200) */
 
-#if !defined(SOC_AM64X)
+#if !defined(SOC_AM64X) && !defined(SOC_TPR12)
 
 /**
  * \brief   This API Initializes the GPIO module
@@ -865,6 +869,7 @@ void BoardDiag_McanMuxEnable(i2cIoExpPinNumber_t pinNum,
 }
 #endif
 
+#if !defined(SOC_TPR12)
 /**
  * \brief   This API enables the CAN transceivers by setting the STB pins
  *
@@ -967,6 +972,7 @@ static void BoardDiag_mcanEnable(void)
     }
 #endif
 }
+#endif /* ifndef SOC_TPR12 */
 
 /**
  * \brief  This function executes MCAN Diagnostic test
@@ -996,8 +1002,10 @@ int32_t BoardDiag_mcanTest(void)
     UART_printf  ("***********************************************\n");
 #endif
 
+#if !defined(SOC_TPR12)
     BoardDiag_mcanEnable();
-#if defined(am65xx_idk) || defined(am64x_evm)
+#endif
+#if defined(am65xx_idk) || defined(am64x_evm) || defined(SOC_TPR12)
     mcanMaxPorts = MCAN_MAX_PORTS;
 #else
     if(expBoardDetect)
index 1d35aa07c48e3c118021085f3036c620cf894ce1..de5a092b6b73b254817f19c88ba76511d92599ef 100755 (executable)
@@ -71,7 +71,7 @@
 #include "board_pinmux.h"
 #include "board_control.h"
 #endif
-#if !defined(am65xx_idk)
+#if !defined(am65xx_idk) && !defined(SOC_TPR12)
 #include "board_i2c_io_exp.h"
 #endif
 
@@ -196,6 +196,19 @@ extern "C" {
 #define MAIN_MCAN1_RX_INT_NUM   (CSLR_R5FSS0_CORE0_INTR_MCAN1_MCANSS_MCAN_LVL_INT_1)
 #define MAIN_MCAN1_TS_INT_NUM   (CSLR_R5FSS0_CORE0_INTR_MCAN1_MCANSS_EXT_TS_ROLLOVER_LVL_INT_0)
 
+#elif defined(SOC_TPR12)
+#define MCAN_MAX_PORTS    (2U)
+
+/* Interrupt configurations */
+
+#define MAIN_MCAN0_TX_INT_NUM   (CSL_MSS_INTR_MSS_MCANA_INT0)
+#define MAIN_MCAN0_RX_INT_NUM   (CSL_MSS_INTR_MSS_MCANA_INT1)
+#define MAIN_MCAN0_TS_INT_NUM   (ESMG1_MCANA_TS_ERR)
+
+#define MAIN_MCAN1_TX_INT_NUM   (CSL_MSS_INTR_MSS_MCANB_INT0)
+#define MAIN_MCAN1_RX_INT_NUM   (CSL_MSS_INTR_MSS_MCANB_INT1)
+#define MAIN_MCAN1_TS_INT_NUM   (ESMG1_MCANB_TS_ERR)
+
 #else
 #define MCAN_MAX_PORTS    (2U)
 #endif /* #if defined(j721e_evm) || defined(j7200_evm) */