sdk56636.asm (4944B)
1 ; 2 ; 3 ; 4 ; This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 ; 6 ; Copyright 2007-2019 Broadcom Inc. All rights reserved. 7 ; 8 ; 9 ; This is the default program for the (25 GE + 6 XE/HG port) BCM56636 SDKs. 10 ; To start it, use the following commands from BCM: 11 ; 12 ; led load sdk56636.hex 13 ; led auto on 14 ; led start 15 ; 16 ; The is 1 LEDs per XE port. 17 ; 18 ; There is one bit per 10 gigabit Ethernet LED with the following colors: 19 ; ONE Black 20 ; ZERO Green 21 ; 22 ; Each chip drives only its own LEDs and needs to write them in the order: 23 ; A05/L05,L06/A06,A01/L01,L02/A02,A03/L03,L04/A04 24 ; 25 ; Link up/down info cannot be derived from LINKEN or LINKUP, as the LED 26 ; processor does not always have access to link status. This program 27 ; assumes link status is kept current in bit 0 of RAM byte (0xA0 + portnum). 28 ; Generally, a program running on the main CPU must update these 29 ; locations on link change; see linkscan callback in 30 ; $SDK/src/appl/diag/ledproc.c. 31 ; 32 ; Current implementation: 33 ; 34 ; L01/A01 reflects port 1 link status: 35 ; Black: no link 36 ; Green: Link/Activity 37 ; 38 ; 39 MAX_XE_PORT EQU 31 40 41 NUM_PORT EQU 8 42 43 ; Device ports 44 ;xe4( 42) 45 ;xe0( 26) 46 ;xe1( 27) 47 ;xe2( 28) 48 ;xe3( 29) 49 ;xe5( 50) 50 51 PORT_XE4 EQU 42 52 PORT_XE5 EQU 50 53 PORT_XE0 EQU 26 54 PORT_XE1 EQU 27 55 PORT_XE2 EQU 28 56 PORT_XE3 EQU 29 57 58 ; The TX/RX activity lights will be extended for ACT_EXT_TICKS 59 ; so they will be more visible. 60 TICKS EQU 1 61 SECOND_TICKS EQU (30*TICKS) 62 ACT_EXT_TICKS EQU (SECOND_TICKS/3) 63 TXRX_ALT_TICKS EQU (SECOND_TICKS/6) 64 65 ; 66 ; Main Update Routine 67 ; 68 ; This routine is called once per tick. 69 ; 70 update: 71 ld a, PORT_XE4 72 port a 73 call link_activity ; Off if no link 74 75 ld a, PORT_XE5 76 port a 77 call link_activity ; Off if no link 78 79 ld a, PORT_XE0 80 port a 81 call link_activity ; Off if no link 82 83 ld a, PORT_XE1 84 port a 85 call link_activity ; Off if no link 86 87 ld a, PORT_XE2 88 port a 89 call link_activity ; Off if no link 90 91 ld a, PORT_XE3 92 port a 93 call link_activity ; Off if no link 94 95 96 ; Update various timers 97 inc (TXRX_ALT_COUNT) 98 99 send NUM_PORT * 1 100 101 ; 102 ; link_activity 103 ; 104 ; This routine calculates the activity LED for the current port. 105 ; It extends the activity lights using timers (new activity overrides 106 ; and resets the timers). 107 ; 108 ; Inputs: (PORT_NUM) 109 ; Outputs: one bit sent to LED stream 110 ; 111 112 link_activity: 113 ;jmp led_green ;DEBUG ONLY 114 call get_link 115 jnc led_black 116 port a 117 pushst RX 118 pushst TX 119 tor 120 pop 121 122 jnc led_green ; Always green Link up, No Activity 123 124 ;jmp led_green ;DEBUG ONLY 125 126 ld b, (TXRX_ALT_COUNT) 127 and b, TXRX_ALT_TICKS 128 jnz led_green 129 jmp led_black 130 131 link_status: 132 ;jmp led_black ;DEBUG ONLY 133 call get_link 134 jnc led_black 135 jmp led_green 136 137 ; 138 ; get_link 139 ; 140 ; This routine finds the link status LED for a port. 141 ; Link info is in bit 0 of the byte read from PORTDATA[port] 142 ; 143 ; Inputs: Port number in a 144 ; Outputs: Carry flag set if link is up, clear if link is down. 145 ; Destroys: a, b 146 ; 147 148 get_link: 149 ld b,PORTDATA 150 add b,a 151 ld b,(b) 152 tst b,0 153 ret 154 155 ; 156 ; led_black, led_green 157 ; 158 ; Inputs: None 159 ; Outputs: one bit to the LED stream indicating color 160 ; Destroys: None 161 ; 162 163 led_black: 164 pushst ONE 165 pack 166 ret 167 168 led_green: 169 pushst ZERO 170 pack 171 ret 172 173 ; 174 ; Variables (SDK software initializes LED memory from 0xa0-0xff to 0) 175 ; 176 177 TXRX_ALT_COUNT equ 0xe0 178 PORT_NUM equ 0xe1 179 180 ; 181 ; Port data, which must be updated continually by main CPU's 182 ; linkscan task. See $SDK/src/appl/diag/ledproc.c for examples. 183 ; In this program, bit 0 is assumed to contain the link up/down status. 184 ; 185 186 ;Offset 0x1e00 - 0x80 187 ;LED scan chain assembly area 188 189 ;Offset 0x1e80 - 0xa0 190 PORTDATA equ 0xa0 ; Size 48 + 1 + 4 bytes 191 192 ; 193 ; Symbolic names for the bits of the port status fields 194 ; 195 196 RX equ 0x0 ; received packet 197 TX equ 0x1 ; transmitted packet 198 COLL equ 0x2 ; collision indicator 199 SPEED_C equ 0x3 ; 100 Mbps 200 SPEED_M equ 0x4 ; 1000 Mbps 201 DUPLEX equ 0x5 ; half/full duplex 202 FLOW equ 0x6 ; flow control capable 203 LINKUP equ 0x7 ; link down/up status 204 LINKEN equ 0x8 ; link disabled/enabled status 205 ZERO equ 0xE ; always 0 206 ONE equ 0xF ; always 1