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

📄 pm5337_line_sonet.tcl

📁 用于EOS芯片的驱动程序, 供参考 参考
💻 TCL
📖 第 1 页 / 共 2 页
字号:
#------------------------------------------------------------------------------# FILE NAME: PM5337_LINE_SONET.tcl## DESCRIPTION: 	This file includes the following procedures:#		1) LINE_SONET_Init#		2) LINE_SONET_Line_Intf_Config#               3) LINE_SONET_Timing_Config#               4) LINE_SONET_PGMCLK_Config#			# NOTES:## REVISION History:# Preliminary 1 - Script created#------------------------------------------------------------------------------#------------------------------------------------------------------------------# SCRIPT NAME:	LINE_SONET_Init## DESCRIPTION:	This procedure enable or disable the #		LINE_SONET subsystem. #		# PARAMETERS:	devID  - This parameter is used to specify the device #                        under configuration#		enable - 0 (disable), 1 (enable)## NOTES: The LINE_SONET block must be enable in the following sequence #	 1) Enable the LINE_SONET block #	 2) De-assert the LINE_SONET block reset##	 The LINE_SONET block must be disabled in the following sequence#	 1) Assert the LINE_SONET block reset#	 2) Disable the LINE_SONET block#------------------------------------------------------------------------------proc LINE_SONET_Init {devID enable} {    source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl        ################################################  #####     Enabling Line SONET Subsystem    #####  ################################################      if {$enable == 1} {     # Enable the digital logic in Line SONET     admwrb $devID 0x000A 4 0    # Reset the digital logic in Line SONET    admwrb $devID 0x0009 4 0  } else {    # Reset the digital logic in Line SONET    admwrb $devID 0x0009 4 1    # Enable the digital logic in Line SONET    admwrb $devID 0x000A 4 1  }    #############################################################  #####     Enabling all block in LINE_SONET Subsystem    #####  #############################################################    # Enable all SLP, HOPP, LOPP, LINEIF  admwr $devID 0x1001 0x00000000    ##########################################################  #####    Set RESERVED bit to recommended settings    #####  ##########################################################    # Set RESERVED_0 in LINE_SONET subsystem to 0  admwrb $devID 0x10C0 4 0   admwrb $devID 0x10C0 5 0   admwrb $devID 0x10E0 4 0   admwrb $devID 0x10E0 5 0   admwrb $devID 0x1100 1 0   admwrb $devID 0x1180 1 0     # Set RESERVED_1 in LINE_SONET subsystem to 1  admwrb $devID 0x10C0 2 1     admwrb $devID 0x10E0 2 1   admwrb $devID 0x1662 4 1  admwrb $devID 0x1862 4 1    # Configure HOPP 1/2 to source traffic from CORE_XC  admwr $devID 0x102C 0x00000000  admwr $devID 0x102D 0x00000000      # Fixes for ADM 622 Reference Design Board  # Set SD_INV bit to 1  admwrb $devID 0x1320 0 1  admwrb $devID 0x13A0 0 1  }#------------------------------------------------------------------------------# SCRIPT NAME: LINE_SONET_Line_Intf_Config## DESCRIPTION: This procedure configures the line interface of the LINE_SONET #              subsystem. #		# PARAMETERS: devID          - This parameter is used to specify the device #                              under configuration#             #             intf           - 0 (interface 1), 1 (interface 2)##             mode           - 0 (Line Interface is Enabled)#                              1 (Line Interface is Disabled, and the Line SONET #                                 slice is used by Auxilary port connected to the SLP)#                              2 (Line Interface is Disabled, and the  Line SONET #                                 slice is used by Auxilary port connected to the HOPP)#                              3 (Line Interface is Disabled, and the Line SONET slice#                                 is unused)##             rate           - 0 (OC-3), 1 (OC-12)##             rx_eq          - 0 (disable), 1 (low), 2 (high) ##             txmode4_0       - Valid values are from 01000 to 10100.  See Hardware#                              Specification for details.## NOTE: 1. When mode is set to 1 to 3, the following values should be used#          for these parameters:#        #          - rate = 0#          - rx_eq = 0#          - txmode4_0 = 00000# #------------------------------------------------------------------------------proc LINE_SONET_Line_Intf_Config {devID intf mode rate rx_eq txmode4_0} {        source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl       ########################################  ##### Configure Line Interface #1  #####  ########################################    if {$intf == 0} {        if {$mode == 0} {             ##### 1. Set LINE_MODE[1][2:1] to 00 #####      admwrb $devID 0x1000 1 0      admwrb $devID 0x1000 0 0                                   ##### 2. Line Rate Configuration #####            # rate = 0 for OC-3, rate = 1 for OC-12      admwrb $devID 0x0000 22 $rate            if {$rate == 1} {        # Set DCRU_MODE[1] to 0        admwrb $devID 0x1000 4 0 ;# set this to low for OC-12      }      if {$rate == 0} {        # Set DCRU_MODE[1] to 1        admwrb $devID 0x1000 4 1 ;# set this to high for OC-3                # Configure DCRU        admwrb $devID 0x10C0 5 0        admwrb $devID 0x10C0 4 0        admwrb $devID 0x10C0 2 0                  # Enable DCRU        admwr $devID 0x10C3 0x0      }                    ##### 3. RX and Tx Analog Configuration #####            # Enable analog receiver      admwrb $devID 0x1030 11 1      admwrb $devID 0x1030 15 1            # Enable analog transmitter      admwrb $devID 0x1036 15 1            # Enable DJAT      admwr $devID 0x10D3 0x0                  # RX Equalization #      if {$rx_eq == 2} {              # Configure Rx Equalization to High        admwrb $devID 0x1033 9 1        admwrb $devID 0x1033 8 0  		      } elseif {$rx_eq == 1} {        # Configure Rx Equalization to Low        admwrb $devID 0x1033 9 0        admwrb $devID 0x1033 8 1  		      } elseif {$rx_eq == 0} {        # Disable Rx Equalization        admwrb $devID 0x1033 9 0        admwrb $devID 0x1033 8 0  		      }  	      # Configure Tx Swing Level #      set txmode4 [string index $txmode4_0 0]      set txmode3 [string index $txmode4_0 1]      set txmode2 [string index $txmode4_0 2]      set txmode1 [string index $txmode4_0 3]      set txmode0 [string index $txmode4_0 4]            admwrb $devID 0x1036 4 $txmode4      admwrb $devID 0x1036 3 $txmode3      admwrb $devID 0x1036 2 $txmode2      admwrb $devID 0x1036 1 $txmode1      admwrb $devID 0x1036 0 $txmode0       } elseif {$mode == 1} {          ##### Configure Auxilliary Port input to SLP #####      # 10: The Line Receive and Transmit interfaces #x are unused and the System ESSI/P-TCB      # are used as line interface. The Section and Line Processor #x processes the receive data and      # generate the transmit data through the subsystem auxiliary interfaces connected to the      # CORE_XC subsystem. The line rate is automatically STS-12/STM-4.            admwrb $devID 0x1000 1 1      admwrb $devID 0x1000 0 0            ##### Disable Line Interface  #####      # Disable analog receiver      admwrb $devID 0x1030 11 0      admwrb $devID 0x1030 15 0            # Disable analog transmitter      admwrb $devID 0x1036 15 0   		    } elseif {$mode == 2} {          ##### Configure Auxilliary Port input to HOPP #####      # 11: The Line Receive and Transmit interfaces #x are unused and the System ESSI/P-TCB      # are used as line interface. The High-Order Path Processor #x processes the receive data and      # generate the transmit data through the subsystem auxiliary interfaces connected to the      # CORE_XC subsystem. The line rate is automatically STS-12/STM-4.  		            admwrb $devID 0x1000 1 1      admwrb $devID 0x1000 0 1            ##### Disable Line Interface  #####      # Disable analog receiver      admwrb $devID 0x1030 11 0      admwrb $devID 0x1030 15 0            # Disable analog transmitter      admwrb $devID 0x1036 15 0                   } elseif {$mode == 3} {          ##### Set default LINE_MODE ####       # 00 or 01: The Line Receive and Transmit interfaces #x are used as the line interface. The      # line rate is controlled by the LINE_SONET Device Configuration register LINE_622[2:1]      # bits (STS-12/STM-4 or STS-3/STM-1).  	            admwrb $devID 0x1000 1 0      admwrb $devID 0x1000 0 0                    ##### Disable Line Interface  #####      # Disable analog receiver      admwrb $devID 0x1030 11 0      admwrb $devID 0x1030 15 0            # Disable analog transmitter      admwrb $devID 0x1036 15 0            }  }              ########################################  ##### Configure Line Interface #2  #####  ########################################    if {$intf == 1} {        if {$mode == 0} {             ##### Set LINE_MODE[2][2:1] to 00 #####

⌨️ 快捷键说明

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