⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pm5337_core_xc_masu.tcl

📁 用于EOS芯片的驱动程序, 供参考 参考
💻 TCL
📖 第 1 页 / 共 5 页
字号:
#------------------------------------------------------------------------------# FILE NAME: PM5337_CORE_XC_MASU.tcl## DESCRIPTION: 	This file includes the following procedures:#               1) CORE_XC_LOME_Config#               2) CORE_XC_LOMP_Config#               3) CORE_XC_LOSU_Config#               4) CORE_XC_CM_Switchover#               5) CORE_XC_LOME_MAPS_Config#               6) CORE_XC_LOMP_MAPS_Config#               7) CORE_XC_LOSU_MAPS_Config#			# NOTES:## REVISION History:# Preliminary 1 - Script created#------------------------------------------------------------------------------#------------------------------------------------------------------# SCRIPT NAME:	CORE_XC_LOME_Config## DESCRIPTION: This procedure initializes the LOME block in#		the ADM622 device when MAPS is DISABLED.  #		# PARAMETERS: devID   - This parameter is used to specify the device #                       under configuration##             link    - 1, 2  ##             payload - STS-1, STS-3c, STS-12c, VT15, VT2, VT3, VT6,#                       AU3/C3, AU4/C4, AU4-4c, AU3/TU11, AU3/TU12,#                       AU3/TU2, AU4/TU11, AU4/TU12, AU4/TU2,#                       AU4/TU3##             mode - This parameter is used to reduce the configuration#                    steps when some connections in the STM-16 frame are #                    unused.  When set to:##                    1 - Only STM-4 #1 is configured#                    2 - Only STM-4 #1, STM-4 #2 are configured#                    3 - Only STM-4 #1, STM-4 #2, STM-4#3 are configured#                    4 - STM4 #1, STM-4 #2, STM-4 #3 and STM-4#4 are configured##                    Important Note:  When payload type is TU2 or VT12, mode must be#                                     set to 4# # NOTES: 1. The following script assumes the hardware CMPS and#           CMP_TRIG pins are pull low.  ##        2. The following script assumes CM2 is the active page and #           CM1 is the standby page, and the incremental mode is#           used.##        3. The settings on CM1 has not been activiated yet.  The #           procedure CORE_XC_CM_Switchover can be used to copy the#           new settings on CM1 to CM2.##-------------------------------------------------------------------proc CORE_XC_LOME_Config {devID link payload mode} {      source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl      ####################################  ##### 1. Disable MAPS function #####  ####################################        admwrb $devID 0x4800 0 0  admwrb $devID 0x6800 0 0        ##################################################################  ##### 2. Configuring the TUG3TUG2EN_x_[y] bit to enable      #####        #####    AU4 to AU3 conversion                               #####  ##################################################################    if {$payload == "AU4/TU11" || $payload == "AU4/TU12" ||      $payload == "AU4/TU2"} {        if {$link == 1} {      # Link 1      admwr $devID 0x4801 0x0000FFFF ;# TUG3TUG2EN_1_[16..1]      admwr $devID 0x4802 0x0000FFFF ;# TUG3TUG2EN_2_[16..1]      admwr $devID 0x4803 0x0000FFFF ;# TUG3TUG2EN_3_[16..1]    }    if {$link == 2} {      # Link 2      admwr $devID 0x6801 0x0000FFFF ;# TUG3TUG2EN_1_[16..1]      admwr $devID 0x6802 0x0000FFFF ;# TUG3TUG2EN_2_[16..1]      admwr $devID 0x6803 0x0000FFFF ;# TUG3TUG2EN_3_[16..1]    }  } else {    # Turn off all conversion        if {$link == 1} {      # Link 1 in LOME block $slice_num      admwr $devID 0x4801 0x00000000 ;# TUG3TUG2EN_1_[16..1]      admwr $devID 0x4802 0x00000000 ;# TUG3TUG2EN_2_[16..1]      admwr $devID 0x4803 0x00000000 ;# TUG3TUG2EN_3_[16..1]    }    if {$link == 2} {       # Link 2 in LOME block $slice_num      admwr $devID 0x6801 0x00000000 ;# TUG3TUG2EN_1_[16..1]      admwr $devID 0x6802 0x00000000 ;# TUG3TUG2EN_2_[16..1]      admwr $devID 0x6803 0x00000000 ;# TUG3TUG2EN_3_[16..1]    }  }    ##################################################################  ###### 3. Configuring the Ingress Connection Memory (CM)     #####  ######    to declare ingress traffic payload size.           #####  ##################################################################    # Define the number of STM1 needs to be configure  # mode 1 - STM1#1 to STM1#4 are configured  # mode 2 - STM1#1 to STM1#8 are configured  # mode 3 - STM1#1 to STM1#12 are configured  # mode 4 - STM1#1 to STM1#16 are configured        if {$mode == 1} {    set max_STM1 0x3  } elseif {$mode == 2} {    set max_STM1 0x7  } elseif {$mode == 3} {    set max_STM1 0xB  } elseif {$mode == 4} {    set max_STM1 0xF  }              # The following lines setup the LOME CM using the Incremental  # Mode with CM Page 2 active and CM Page 1 standby.     # Set SW_CMP_MODE to 1 and SW_CMPS to 0  admwrb $devID 0x0817 2 1  admwrb $devID 0x0817 0 0      ### Configuring CM Page 1 for different payload types for     ###  ### link 1   ### Note: All paths are configured to the same payload types. ###  if {$link == 1} {    if {$payload == "VT15" || $payload == "AU3/TU11" ||$payload == "AU4/TU11"} {      for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                  # Defining CM1 register address offset          set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]]          # For each of 48 STS1 path, set PLSIZE[2..0] = 000b              admwr $devID $addr_CM1 0x00000000        }      }    }      if {$payload == "VT2" || $payload == "AU3/TU12" || $payload == "AU4/TU12"} {      for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                # Defining CM1 register address offset          set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]]          # For each of 48 STS1 path, set PLSIZE[2..0] = 001b          admwr $devID $addr_CM1 0x01111111        }      }    }      if {$payload == "VT3"} {                     for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                                             # Defining CM1 register address offset          set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]]                # For each of 48 STS1 path, set PLSIZE[2..0] = 010b            admwr $devID $addr_CM1 0x02222222             }      }    }      if {$payload == "VT6" || $payload == "AU3/TU2" || $payload == "AU4/TU2"} {                   for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                               # Defining CM1 register address offset          set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]]                  # For each of 48 STS1 path, set PLSIZE[2..0] = 011b              admwr $devID $addr_CM1 0x03333333         }        }             }      if {$payload == "STS-1" || $payload == "STS-3c" || $payload == "STS-12c" || $payload == "AU4-4c" || $payload == "AU4/C4" || $payload == "AU3/C3" || $payload == "AU4/TU3"} {                                         for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                               # Defining CM1 register address offset          set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]]                  # For each of 48 STS1 path, set PLSIZE[2..0] = 1XXb,          # ie 100b          admwr $devID $addr_CM1 0x04444444                     }        }                       }        }  ### Configuring CM Page 1 for different payload types for LINK 2  ### Note: All paths are configured to the same payload types.    if {$link == 2} {    if {$payload == "VT15" || $payload == "AU3/TU11" ||        $payload == "AU4/TU11"} {      for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                  # Defining CM1 register address offset          set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]]          # For each of 48 STS1 path, set PLSIZE[2..0] = 000b              admwr $devID $addr_CM1 0x00000000        }      }    }      if {$payload == "VT2" || $payload == "AU3/TU12" ||        $payload == "AU4/TU12"} {      for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                # Defining CM1 register address offset          set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]]          # For each of 48 STS1 path, set PLSIZE[2..0] = 001b          admwr $devID $addr_CM1 0x01111111        }      }    }      if {$payload == "VT3"} {                     for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                                             # Defining CM1 register address offset          set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]]                # For each of 48 STS1 path, set PLSIZE[2..0] = 010b            admwr $devID $addr_CM1 0x02222222             }      }    }      if {$payload == "VT6" || $payload == "AU3/TU2" || $payload == "AU4/TU2"} {                   for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                               # Defining CM1 register address offset          set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]]                  # For each of 48 STS1 path, set PLSIZE[2..0] = 011b              admwr $devID $addr_CM1 0x03333333         }        }             }      if {$payload == "STS-1" || $payload == "STS-3c" || $payload == "STS-12c" || $payload == "AU4-4c" || $payload == "AU4/C4" || $payload == "AU3/C3" || $payload == "AU4/TU3"} {                                         for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} {        for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} {                               # Defining CM1 register address offset          set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]]                  # For each of 48 STS1 path, set PLSIZE[2..0] = 1XXb,          # ie 100b          admwr $devID $addr_CM1 0x04444444                     }        }                                            }          }}#------------------------------------------------------------------# SCRIPT NAME: 	CORE_XC_LOMP_Config## DESCRIPTION: 	This procedure initializes the LOMP block in#		the Core Cross-Connect when MAPS is DISABLED.  ## PARAMETERS: 	#		devID## NOTES: 	#------------------------------------------------------------------proc CORE_XC_LOMP_Config {devID} {    source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl      ### Disable MAPS ###  # When the LOMP HALTB bit is set to logic 0, the LOMP is held in    # a halted state. In the halted state, the LOMP does not process    # any of the protection groups. It is recommended to initialize    # the LOMP before unhalting it.    admwrb $devID 0x8009 0 0   }#------------------------------------------------------------------# SCRIPT NAME: CORE_XC_LOSU_Config# DESCRIPTION: 	This procedure initializes the LOSU block in#		the ADM622 device when MAPS is ***DISABLED***.  # PARAMETERS: 	devID   - This parameter is used to specify the device #                         under configuration##		payload	- STS-1, STS-3c, STS-12c, VT15, VT2, VT3,  # 			  VT6, AU3/C3, AU4/C4, AU4-4c, AU3/TU11,  #			  AU3/TU12, AU3/TU2, AU4/TU11, AU4/TU12, #			  AU4/TU2, AU4/TU3##                mode - This parameter is used to reduce the configuration#                       steps when some connections in the STM-16 frame are #                       unused.  When set to:##                    1 - Only STM-4 #1 is configured#                    2 - Only STM-4 #1, STM-4 #2 are configured#                    3 - Only STM-4 #1, STM-4 #2, STM-4#3 are configured#                    4 - STM4 #1, STM-4 #2, STM-4 #3 and STM-4#4 are configured##                      Important Note:  When payload type is TU2 or VT12, mode must be#                                       set to 4## NOTES: 1. The following script assumes the hardware CMPS and #	    CMP_TRIG  pins are pull low.  ##	 2. The following script assumes CM2 is the active page  #	    and CM1 is the standby page, and the incremental mode #	    is used.##	 3. The settings on CM1 has not been activiated yet##	 4. This script assumes all payload types are identical.  #	    This script needs to be modify to switch mixture of #	    payloads.##        5. The default mapping is straigh-through, the code will #           need to be modified for other mappings.    ##-------------------------------------------------------------------proc CORE_XC_LOSU_Config {devID payload mode} {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -