herculynx.asm (2218B)
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 HercuLynx (BCM95673P8) 10 ; 11 ; To start it, use the following commands from BCM: 12 ; 13 ; 1:led load herculynx.hex 14 ; 2:led load herculynx.hex 15 ; 3:led load herculynx.hex 16 ; 4:led load herculynx.hex 17 ; 5:led load herculynx.hex 18 ; 6:led load herculynx.hex 19 ; 7:led load herculynx.hex 20 ; 8:led load herculynx.hex 21 ; *:led start 22 ; 23 ; On the HercuLynx board, there are eight Lynx chips (unit 1 to unit 8). 24 ; Each is connected to its own scan chain of 4 bits long. 25 ; 26 ; The HercuLynx board has 8 columns of 4 LEDs each, as shown below: 27 ; 28 ; E1 E2 E3 E4 E5 E6 E7 E8 29 ; R1 R2 R3 R4 R5 R6 R7 R8 30 ; T1 T2 T3 T4 T5 T6 T7 T8 31 ; L1 L2 L3 L4 L5 L6 L7 L8 32 ; 33 ; There is one bit per LED with the following colors: 34 ; ZERO Green 35 ; ONE Black 36 ; 37 ; The bits are shifted out in the following order: 38 ; E1, R1, T1, L1 39 ; 40 ; Current implementation: 41 ; E1 reflects port 1 xe link enable 42 ; R1 reflects port 1 xe receive activity 43 ; T1 reflects port 1 xe transmit activity 44 ; L1 reflects port 1 xe link up 45 ; 46 47 TICKS EQU 1 48 SECOND_TICKS EQU (30*TICKS) 49 TGIG_BLINK_TICKS EQU (SECOND_TICKS/10) 50 51 ld b,TGIG_BLINK_COUNT 52 inc (b) 53 ld a,(b) 54 cmp a,TGIG_BLINK_TICKS 55 jc up 56 ld (b),0 57 up: 58 port 0 59 call put 60 send 4 61 62 put: 63 pushst LINKEN 64 tinv 65 pack 66 ld a,(TGIG_BLINK_COUNT) 67 cmp a,TGIG_BLINK_TICKS/2 68 jc led_on 69 led_off: 70 pushst ONE 71 pack 72 pushst ONE 73 pack 74 jmp led_link 75 led_on: 76 pushst RX 77 tinv 78 pack 79 pushst TX 80 tinv 81 pack 82 led_link: 83 pushst LINKUP 84 tinv 85 pack 86 ret 87 88 ; 89 ; Symbolic names for the bits of the port status fields 90 ; 91 92 RX equ 0x0 ; received packet 93 TX equ 0x1 ; transmitted packet 94 COLL equ 0x2 ; collision indicator 95 SPEED_C equ 0x3 ; 100 Mbps 96 SPEED_M equ 0x4 ; 1000 Mbps 97 DUPLEX equ 0x5 ; half/full duplex 98 FLOW equ 0x6 ; flow control capable 99 LINKUP equ 0x7 ; link down/up status 100 LINKEN equ 0x8 ; link disabled/enabled status 101 ZERO equ 0xE ; always 0 102 ONE equ 0xF ; always 1 103 PORTDATA equ 0x80 ; Size 2 bytes 104 TGIG_BLINK_COUNT equ 0xc0