	.file	"extr_tg3.c_tg3_setup_fiber_phy.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tg3_setup_fiber_phy, @function
tg3_setup_fiber_phy:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	esi, DWORD PTR HW_AUTONEG[rip]
	mov	r13, QWORD PTR 32[rdi]
	mov	r14, QWORD PTR 40[rdi]
	mov	r15, QWORD PTR 48[rdi]
	call	tg3_flag@PLT
	test	rax, rax
	jne	.L2
	cmp	QWORD PTR 80[rbp], 0
	jne	.L28
.L2:
	mov	edi, DWORD PTR MAC_TX_AUTO_NEG[rip]
	xor	esi, esi
	call	tw32_f@PLT
	mov	esi, DWORD PTR MAC_MODE_PORT_MODE_MASK[rip]
	or	esi, DWORD PTR MAC_MODE_HALF_DUPLEX[rip]
	not	esi
	and	esi, DWORD PTR 0[rbp]
	or	esi, DWORD PTR MAC_MODE_PORT_MODE_TBI[rip]
	mov	DWORD PTR 0[rbp], esi
	mov	edi, DWORD PTR MAC_MODE[rip]
	movsx	rsi, esi
	call	tw32_f@PLT
	mov	edi, 40
	call	udelay@PLT
	mov	rax, QWORD PTR TG3_PHY_ID_BCM8002[rip]
	cmp	QWORD PTR 8[rbp], rax
	je	.L29
.L4:
	mov	rsi, QWORD PTR MAC_EVENT_LNKSTATE_CHANGED[rip]
	mov	edi, DWORD PTR MAC_EVENT[rip]
	call	tw32_f@PLT
	mov	edi, 40
	call	udelay@PLT
	mov	QWORD PTR 64[rbp], 0
	mov	edi, DWORD PTR MAC_STATUS[rip]
	call	tr32@PLT
	mov	esi, DWORD PTR HW_AUTONEG[rip]
	mov	rdi, rbp
	mov	r12, rax
	call	tg3_flag@PLT
	mov	rsi, r12
	mov	rdi, rbp
	test	rax, rax
	jne	.L30
	call	tg3_setup_fiber_by_hand@PLT
	mov	r12d, eax
.L6:
	mov	rax, QWORD PTR 72[rbp]
	mov	rsi, QWORD PTR MAC_STATUS_SYNC_CHANGED[rip]
	mov	ebx, 100
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR SD_STATUS_LINK_CHG[rip]
	not	eax
	and	eax, DWORD PTR [rdx]
	or	eax, DWORD PTR SD_STATUS_UPDATED[rip]
	mov	DWORD PTR [rdx], eax
	mov	rdx, QWORD PTR MAC_STATUS_CFG_CHANGED[rip]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L31:
	sub	ebx, 1
	je	.L7
.L8:
	mov	edi, DWORD PTR MAC_STATUS[rip]
	or	rsi, rdx
	call	tw32_f@PLT
	mov	edi, 5
	call	udelay@PLT
	mov	edi, DWORD PTR MAC_STATUS[rip]
	call	tr32@PLT
	mov	rsi, QWORD PTR MAC_STATUS_SYNC_CHANGED[rip]
	mov	rdx, QWORD PTR MAC_STATUS_CFG_CHANGED[rip]
	mov	r8, rax
	mov	rax, rsi
	or	rax, rdx
	or	rax, QWORD PTR MAC_STATUS_LNKSTATE_CHANGED[rip]
	test	rax, r8
	jne	.L31
.L7:
	mov	edi, DWORD PTR MAC_STATUS[rip]
	call	tr32@PLT
	test	QWORD PTR MAC_STATUS_PCS_SYNCED[rip], rax
	jne	.L9
	mov	rax, QWORD PTR AUTONEG_ENABLE[rip]
	cmp	QWORD PTR 56[rbp], rax
	je	.L32
.L26:
	mov	esi, DWORD PTR 24[rbp]
	mov	eax, DWORD PTR LED_CTRL_LNKLED_OVERRIDE[rip]
	mov	edi, DWORD PTR MAC_LED_CTRL[rip]
.L12:
	mov	rdx, QWORD PTR SPEED_UNKNOWN[rip]
	or	esi, eax
	or	esi, DWORD PTR LED_CTRL_TRAFFIC_OVERRIDE[rip]
	xor	r12d, r12d
	mov	QWORD PTR 40[rbp], rdx
	mov	rdx, QWORD PTR DUPLEX_UNKNOWN[rip]
	mov	QWORD PTR 48[rbp], rdx
	call	tw32@PLT
.L13:
	mov	esi, r12d
	mov	rdi, rbp
	call	tg3_test_and_report_link_chg@PLT
	test	eax, eax
	jne	.L3
	cmp	r13, QWORD PTR 32[rbp]
	jne	.L14
	cmp	QWORD PTR 40[rbp], r14
	je	.L33
.L14:
	mov	rdi, rbp
	call	tg3_link_report@PLT
.L3:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	call	tg3_setup_fiber_hw_autoneg@PLT
	mov	r12d, eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	mov	esi, DWORD PTR INIT_COMPLETE[rip]
	mov	rdi, rbp
	call	tg3_flag@PLT
	test	rax, rax
	je	.L2
	mov	edi, DWORD PTR MAC_STATUS[rip]
	call	tr32@PLT
	mov	rcx, QWORD PTR MAC_STATUS_CFG_CHANGED[rip]
	mov	rdx, QWORD PTR MAC_STATUS_PCS_SYNCED[rip]
	mov	r8, rax
	mov	rax, QWORD PTR MAC_STATUS_RCVD_CFG[rip]
	or	rdx, QWORD PTR MAC_STATUS_SIGNAL_DET[rip]
	or	rax, rcx
	or	rax, rdx
	and	rax, r8
	cmp	rdx, rax
	jne	.L2
	or	rcx, QWORD PTR MAC_STATUS_SYNC_CHANGED[rip]
	mov	edi, DWORD PTR MAC_STATUS[rip]
	mov	rsi, rcx
	call	tw32_f@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR 24[rbp]
	mov	eax, DWORD PTR LED_CTRL_LNKLED_OVERRIDE[rip]
	mov	edi, DWORD PTR MAC_LED_CTRL[rip]
	test	r12d, r12d
	je	.L12
	mov	rdx, QWORD PTR SPEED_1000[rip]
	or	eax, DWORD PTR LED_CTRL_1000MBPS_ON[rip]
	or	esi, eax
	mov	QWORD PTR 40[rbp], rdx
	mov	rdx, QWORD PTR DUPLEX_FULL[rip]
	mov	QWORD PTR 48[rbp], rdx
	call	tw32@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdi, rbp
	call	tg3_init_bcm8002@PLT
	jmp	.L4
.L33:
	cmp	QWORD PTR 48[rbp], r15
	jne	.L14
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	cmp	QWORD PTR 16[rbp], 0
	jne	.L26
	mov	edi, DWORD PTR MAC_MODE[rip]
	movsx	rsi, DWORD PTR 0[rbp]
	or	rsi, QWORD PTR MAC_MODE_SEND_CONFIGS[rip]
	call	tw32_f@PLT
	mov	edi, 1
	call	udelay@PLT
	movsx	rsi, DWORD PTR 0[rbp]
	mov	edi, DWORD PTR MAC_MODE[rip]
	call	tw32_f@PLT
	jmp	.L26
	.cfi_endproc
.LFE0:
	.size	tg3_setup_fiber_phy, .-tg3_setup_fiber_phy
	.comm	TG3_PHY_ID_BCM8002,8,8
	.comm	SPEED_UNKNOWN,8,8
	.comm	SPEED_1000,8,8
	.comm	SD_STATUS_UPDATED,4,4
	.comm	SD_STATUS_LINK_CHG,4,4
	.comm	MAC_TX_AUTO_NEG,4,4
	.comm	MAC_STATUS_SYNC_CHANGED,8,8
	.comm	MAC_STATUS_SIGNAL_DET,8,8
	.comm	MAC_STATUS_RCVD_CFG,8,8
	.comm	MAC_STATUS_PCS_SYNCED,8,8
	.comm	MAC_STATUS_LNKSTATE_CHANGED,8,8
	.comm	MAC_STATUS_CFG_CHANGED,8,8
	.comm	MAC_STATUS,4,4
	.comm	MAC_MODE_SEND_CONFIGS,8,8
	.comm	MAC_MODE_PORT_MODE_TBI,4,4
	.comm	MAC_MODE_PORT_MODE_MASK,4,4
	.comm	MAC_MODE_HALF_DUPLEX,4,4
	.comm	MAC_MODE,4,4
	.comm	MAC_LED_CTRL,4,4
	.comm	MAC_EVENT_LNKSTATE_CHANGED,8,8
	.comm	MAC_EVENT,4,4
	.comm	LED_CTRL_TRAFFIC_OVERRIDE,4,4
	.comm	LED_CTRL_LNKLED_OVERRIDE,4,4
	.comm	LED_CTRL_1000MBPS_ON,4,4
	.comm	INIT_COMPLETE,4,4
	.comm	HW_AUTONEG,4,4
	.comm	DUPLEX_UNKNOWN,8,8
	.comm	DUPLEX_FULL,8,8
	.comm	AUTONEG_ENABLE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_tg3.c_tg3_setup_fiber_phy.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tg3_setup_fiber_phy, %function
tg3_setup_fiber_phy:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r0, #16]
	sub	sp, sp, #20
	str	r3, [sp, #4]
	ldr	r3, [r0, #20]
	ldr	r4, .L39
	str	r3, [sp, #8]
	ldr	r3, [r0, #24]
	ldr	r1, [r4]
	mov	r6, r0
	str	r3, [sp, #12]
	bl	tg3_flag
	cmp	r0, #0
	bne	.L31
	ldr	r3, [r6, #40]
	cmp	r3, #0
	bne	.L28
.L31:
	ldr	r5, .L39+4
	ldr	fp, .L39+8
	ldr	r7, .L39+12
.L2:
	ldr	r3, .L39+16
	mov	r1, #0
	ldr	r0, [r3]
	bl	tw32_f
	ldr	r2, .L39+20
	ldr	r3, .L39+24
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, .L39+28
	ldr	r1, [r6]
	ldr	r2, [r2]
	orr	r3, r3, r0
	bic	r1, r1, r3
	ldr	r3, .L39+32
	orr	r1, r1, r2
	ldr	r0, [r3]
	str	r1, [r6]
	bl	tw32_f
	mov	r0, #40
	bl	udelay
	ldr	r3, .L39+36
	ldr	r2, [r6, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L34
.L4:
	ldr	r2, .L39+40
	ldr	r3, .L39+44
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	tw32_f
	mov	r0, #40
	bl	udelay
	mov	r3, #0
	ldr	r0, [r5]
	str	r3, [r6, #32]
	bl	tr32
	mov	r3, r0
	ldr	r1, [r4]
	mov	r0, r6
	mov	r4, r3
	bl	tg3_flag
	cmp	r0, #0
	mov	r1, r4
	mov	r0, r6
	bne	.L35
	bl	tg3_setup_fiber_by_hand
	mov	r9, r0
.L6:
	ldr	r3, [r6, #36]
	ldr	r0, .L39+48
	ldr	r2, [r3]
	ldr	r1, .L39+52
	ldr	r3, [r2]
	ldr	r0, [r0]
	ldr	r1, [r1]
	ldr	r8, .L39+56
	bic	r3, r3, r0
	orr	r3, r3, r1
	ldr	r1, [r8]
	str	r3, [r2]
	ldr	r2, [r7]
	mov	r4, #100
	ldr	r10, .L39+60
	orr	r1, r1, r2
	b	.L8
.L36:
	subs	r4, r4, #1
	beq	.L7
.L8:
	ldr	r0, [r5]
	bl	tw32_f
	mov	r0, #5
	bl	udelay
	ldr	r0, [r5]
	bl	tr32
	ldr	r1, [r8]
	ldr	r2, [r7]
	ldr	r3, [r10]
	orr	r1, r1, r2
	orr	r3, r1, r3
	tst	r3, r0
	bne	.L36
.L7:
	ldr	r0, [r5]
	bl	tr32
	ldr	r3, [fp]
	tst	r0, r3
	bne	.L9
	ldr	r3, .L39+64
	ldr	r2, [r6, #28]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L37
.L32:
	ldr	r2, .L39+68
	ldr	r3, .L39+72
	ldr	r0, [r2]
	ldr	r2, [r3]
	ldr	r3, [r6, #12]
.L12:
	orr	r3, r3, r2
	ldr	r1, .L39+76
	ldr	ip, .L39+80
	ldr	r2, .L39+84
	ldr	r1, [r1]
	ldr	ip, [ip]
	ldr	r2, [r2]
	orr	r1, r3, r1
	str	ip, [r6, #20]
	str	r2, [r6, #24]
	bl	tw32
	mov	r9, #0
.L13:
	mov	r1, r9
	mov	r0, r6
	bl	tg3_test_and_report_link_chg
	cmp	r0, #0
	bne	.L3
	ldr	r3, [r6, #16]
	ldr	r2, [sp, #4]
	cmp	r2, r3
	bne	.L14
	ldr	r3, [r6, #20]
	ldr	r2, [sp, #8]
	cmp	r3, r2
	beq	.L38
.L14:
	mov	r0, r6
	bl	tg3_link_report
.L3:
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	bl	tg3_setup_fiber_hw_autoneg
	mov	r9, r0
	b	.L6
.L28:
	ldr	r3, .L39+88
	mov	r0, r6
	ldr	r1, [r3]
	bl	tg3_flag
	cmp	r0, #0
	ldr	r5, .L39+4
	ldr	fp, .L39+8
	bne	.L29
	ldr	r7, .L39+12
	b	.L2
.L9:
	ldr	r2, .L39+68
	ldr	r3, .L39+72
	cmp	r9, #0
	ldr	r0, [r2]
	ldr	r2, [r3]
	ldr	r3, [r6, #12]
	beq	.L12
	ldr	r1, .L39+92
	ldr	lr, .L39+96
	ldr	ip, .L39+100
	ldr	r1, [r1]
	ldr	lr, [lr]
	ldr	ip, [ip]
	orr	r1, r2, r1
	orr	r1, r1, r3
	str	lr, [r6, #20]
	str	ip, [r6, #24]
	bl	tw32
	b	.L13
.L34:
	mov	r0, r6
	bl	tg3_init_bcm8002
	b	.L4
.L38:
	ldr	r3, [r6, #24]
	ldr	r2, [sp, #12]
	cmp	r3, r2
	bne	.L14
	b	.L3
.L29:
	ldr	r0, [r5]
	bl	tr32
	ldr	r7, .L39+12
	ldr	r2, .L39+104
	ldr	r3, .L39+108
	ldr	r1, [r2]
	ldr	ip, [fp]
	ldr	r3, [r3]
	ldr	r2, [r7]
	orr	r1, ip, r1
	orr	r3, r2, r3
	orr	r3, r3, r1
	and	r3, r3, r0
	cmp	r1, r3
	bne	.L2
	ldr	r3, .L39+56
	ldr	r0, [r5]
	ldr	r1, [r3]
	orr	r1, r2, r1
	bl	tw32_f
	b	.L3
.L37:
	ldr	r3, [r6, #8]
	cmp	r3, #0
	bne	.L32
	ldr	r2, .L39+32
	ldr	r3, .L39+112
	mov	r4, r2
	ldr	r3, [r3]
	ldr	r1, [r6]
	ldr	r0, [r2]
	orr	r1, r1, r3
	bl	tw32_f
	mov	r0, #1
	bl	udelay
	ldr	r0, [r4]
	ldr	r1, [r6]
	bl	tw32_f
	b	.L32
.L40:
	.align	2
.L39:
	.word	HW_AUTONEG
	.word	MAC_STATUS
	.word	MAC_STATUS_PCS_SYNCED
	.word	MAC_STATUS_CFG_CHANGED
	.word	MAC_TX_AUTO_NEG
	.word	MAC_MODE_HALF_DUPLEX
	.word	MAC_MODE_PORT_MODE_MASK
	.word	MAC_MODE_PORT_MODE_TBI
	.word	MAC_MODE
	.word	TG3_PHY_ID_BCM8002
	.word	MAC_EVENT_LNKSTATE_CHANGED
	.word	MAC_EVENT
	.word	SD_STATUS_LINK_CHG
	.word	SD_STATUS_UPDATED
	.word	MAC_STATUS_SYNC_CHANGED
	.word	MAC_STATUS_LNKSTATE_CHANGED
	.word	AUTONEG_ENABLE
	.word	MAC_LED_CTRL
	.word	LED_CTRL_LNKLED_OVERRIDE
	.word	LED_CTRL_TRAFFIC_OVERRIDE
	.word	SPEED_UNKNOWN
	.word	DUPLEX_UNKNOWN
	.word	INIT_COMPLETE
	.word	LED_CTRL_1000MBPS_ON
	.word	SPEED_1000
	.word	DUPLEX_FULL
	.word	MAC_STATUS_SIGNAL_DET
	.word	MAC_STATUS_RCVD_CFG
	.word	MAC_MODE_SEND_CONFIGS
	.size	tg3_setup_fiber_phy, .-tg3_setup_fiber_phy
	.comm	TG3_PHY_ID_BCM8002,4,4
	.comm	SPEED_UNKNOWN,4,4
	.comm	SPEED_1000,4,4
	.comm	SD_STATUS_UPDATED,4,4
	.comm	SD_STATUS_LINK_CHG,4,4
	.comm	MAC_TX_AUTO_NEG,4,4
	.comm	MAC_STATUS_SYNC_CHANGED,4,4
	.comm	MAC_STATUS_SIGNAL_DET,4,4
	.comm	MAC_STATUS_RCVD_CFG,4,4
	.comm	MAC_STATUS_PCS_SYNCED,4,4
	.comm	MAC_STATUS_LNKSTATE_CHANGED,4,4
	.comm	MAC_STATUS_CFG_CHANGED,4,4
	.comm	MAC_STATUS,4,4
	.comm	MAC_MODE_SEND_CONFIGS,4,4
	.comm	MAC_MODE_PORT_MODE_TBI,4,4
	.comm	MAC_MODE_PORT_MODE_MASK,4,4
	.comm	MAC_MODE_HALF_DUPLEX,4,4
	.comm	MAC_MODE,4,4
	.comm	MAC_LED_CTRL,4,4
	.comm	MAC_EVENT_LNKSTATE_CHANGED,4,4
	.comm	MAC_EVENT,4,4
	.comm	LED_CTRL_TRAFFIC_OVERRIDE,4,4
	.comm	LED_CTRL_LNKLED_OVERRIDE,4,4
	.comm	LED_CTRL_1000MBPS_ON,4,4
	.comm	INIT_COMPLETE,4,4
	.comm	HW_AUTONEG,4,4
	.comm	DUPLEX_UNKNOWN,4,4
	.comm	DUPLEX_FULL,4,4
	.comm	AUTONEG_ENABLE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
