openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

sdk5675.asm (2121B)


      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 ; Adapted from sdk5670.asm
     10 ; February 27, 2004
     11 ;
     12 ; This is the default program for the 5675 SDK.
     13 ; To start it, use the following commands from BCM:
     14 ;
     15 ;	led load sdk5675.hex
     16 ;	led auto on
     17 ;	led start
     18 ;
     19 ; The BCM5675 SDK has 10 columns of 4 LEDs each as shown below:
     20 ;
     21 ;       E1 E2   E3 E4   E5 E6   E7 E8   U1 U5
     22 ;       L1 L2   L3 L4   L5 L6   L7 L8   U2 U6
     23 ;       T1 T2   T3 T4   T5 T6   T7 T8   U3 U7
     24 ;       R1 R2   R3 R4   R5 R6   R7 R8   U4 U8
     25 ;
     26 ; There is one bit per LED with the following colors:
     27 ;
     28 ;	ZERO		Green
     29 ;	ONE		Black
     30 ;
     31 ; The bits are shifted out in the following order:
     32 ;	E1, L1, T1, R1, E2, L2, T2, R2,
     33 ;	E3, L3, T3, R3, E4, L4, T4, R4,
     34 ;	E5, L5, T5, R5, E6, L6, T6, R6,
     35 ;	E7, L7, T7, R7, E8, L8, T8, R8,
     36 ;	U1, U2, U3, U4, U5, U6, U7, U8
     37 ;
     38 ; Current implementation:
     39 ;
     40 ;	E1 reflects port 1 higig link enable
     41 ;	L1 reflects port 1 higig link up
     42 ;	T1 reflects port 1 higig transmit activity
     43 ;	R1 reflects port 1 higig receive activity
     44 ;
     45 ;	U1 through U8 are user-defined LEDs and
     46 ;	just display a chasing LED pattern.
     47 ;
     48 
     49 	ld	a,1		; Start with first column
     50 up1:
     51 	port	a
     52 
     53 	pushst	LINKEN
     54 	tinv
     55 	pack
     56 	pushst	LINKUP
     57 	tinv
     58 	pack
     59 	pushst	TX
     60 	tinv
     61 	pack
     62 	pushst	RX
     63 	tinv
     64 	pack
     65 
     66 	inc	a		; Next column
     67 	cmp	a,9
     68 	jnz	up1
     69 
     70 ;
     71 ; Put out 8 more values to user LEDs.
     72 ; In this case it is a cycling pattern.
     73 ;
     74 
     75 	inc	(0x7f)
     76 	ld	a,(0x7f)
     77 	and	a,7
     78 	jnz	up2
     79 	inc	(0x7e)
     80 up2:
     81 
     82 	ld	b,(0x7e)
     83 	and	b,0x07
     84 	sub	a,a
     85 	stc
     86 	bit	a,b
     87 	ld	b,0x08
     88 up3:
     89 	ror	a
     90 	push	cy
     91 	tinv
     92 	pack
     93 	dec	b
     94 	jnz	up3
     95 
     96 	send	0x28
     97 
     98 ;
     99 ; Symbolic names for the bits of the port status fields
    100 ;
    101 
    102 RX		equ	0x0	; received packet
    103 TX		equ	0x1	; transmitted packet
    104 COLL		equ	0x2	; collision indicator
    105 SPEED_C		equ	0x3	; 100 Mbps
    106 SPEED_M		equ	0x4	; 1000 Mbps
    107 DUPLEX		equ	0x5	; half/full duplex
    108 FLOW		equ	0x6	; flow control capable
    109 LINKUP		equ	0x7	; link down/up status
    110 LINKEN		equ	0x8	; link disabled/enabled status
    111 ZERO		equ	0xE	; always 0
    112 ONE		equ	0xF	; always 1