	.file	"extr_aq100x.c_t3_aq100x_phy_prep.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"1000/10GBASE-T"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"PHY%d: reset failed (0x%x, 0x%x).\n"
	.section	.rodata.str1.1
.LC2:
	.string	"PHY%d: reset took %ums\n"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"PHY%d: unsupported firmware %d\n"
	.align 8
.LC4:
	.string	"PHY%d does not start in low power mode.\n"
	.align 8
.LC5:
	.string	"PHY%d: incorrect XAUI settings (0x%x, 0x%x).\n"
	.align 8
.LC6:
	.string	"PHY%d: reset timed out (0x%x).\n"
	.text
	.p2align 4
	.globl	t3_aq100x_phy_prep
	.type	t3_aq100x_phy_prep, @function
t3_aq100x_phy_prep:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r8, rcx
	lea	rcx, aq100x_ops[rip]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	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
	mov	ebx, 500
	sub	rsp, 32
	.cfi_def_cfa_offset 88
	mov	r9d, DWORD PTR SUPPORTED_1000baseT_Full[rip]
	or	r9d, DWORD PTR SUPPORTED_10000baseT_Full[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 16[rsp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	or	r9d, DWORD PTR SUPPORTED_TP[rip]
	or	r9d, DWORD PTR SUPPORTED_Autoneg[rip]
	push	rax
	.cfi_def_cfa_offset 96
	or	r9d, DWORD PTR SUPPORTED_AUI[rip]
	call	cphy_init@PLT
	test	r14d, r14d
	mov	r12d, DWORD PTR F_GPIO10_OUT_VAL[rip]
	pop	rax
	.cfi_def_cfa_offset 88
	cmove	r12d, DWORD PTR F_GPIO6_OUT_VAL[rip]
	mov	esi, DWORD PTR A_T3DBG_GPIO_EN[rip]
	xor	ecx, ecx
	mov	rdi, r13
	pop	rdx
	.cfi_def_cfa_offset 80
	mov	edx, r12d
	call	t3_set_reg_field@PLT
	mov	edi, 1
	call	msleep@PLT
	mov	ecx, r12d
	mov	edx, r12d
	mov	rdi, r13
	mov	esi, DWORD PTR A_T3DBG_GPIO_EN[rip]
	mov	r12, rsp
	call	t3_set_reg_field@PLT
	mov	edi, 1000
	call	msleep@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edx, DWORD PTR MDIO_CTRL1[rip]
	mov	esi, DWORD PTR MDIO_MMD_VEND1[rip]
	mov	rcx, r12
	mov	rdi, rbp
	call	t3_mdio_read@PLT
	mov	r8d, DWORD PTR [rsp]
	mov	r15d, eax
	test	eax, eax
	jne	.L5
	cmp	r8d, 65535
	je	.L5
	and	r8d, DWORD PTR AQ_RESET[rip]
	mov	DWORD PTR [rsp], r8d
	jne	.L36
.L8:
	imul	ecx, ebx, -10
	add	ecx, 6000
	cmp	ecx, 3000
	ja	.L37
.L17:
	mov	edx, DWORD PTR AQ_FW_VERSION[rip]
	mov	esi, DWORD PTR MDIO_MMD_VEND1[rip]
	mov	rcx, r12
	mov	rdi, rbp
	call	t3_mdio_read@PLT
	mov	ecx, DWORD PTR [rsp]
	cmp	ecx, 101
	jne	.L38
.L11:
	mov	edx, DWORD PTR MDIO_CTRL1[rip]
	mov	esi, DWORD PTR MDIO_MMD_VEND1[rip]
	mov	rcx, r12
	mov	rdi, rbp
	call	t3_mdio_read@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L1
	mov	ecx, DWORD PTR AQ_LOWPOWER[rip]
	test	DWORD PTR [rsp], ecx
	jne	.L39
	mov	edx, r14d
	lea	rsi, .LC4[rip]
	mov	rdi, r13
	xor	eax, eax
	call	CH_WARN@PLT
.L13:
	mov	edx, DWORD PTR AQ_XAUI_RX_CFG[rip]
	mov	esi, DWORD PTR MDIO_MMD_PHYXS[rip]
	mov	rcx, r12
	mov	rdi, rbp
	mov	DWORD PTR 4[rsp], 0
	mov	DWORD PTR [rsp], 0
	call	t3_mdio_read@PLT
	mov	edx, DWORD PTR AQ_XAUI_TX_CFG[rip]
	lea	rcx, 4[rsp]
	mov	rdi, rbp
	mov	esi, DWORD PTR MDIO_MMD_PHYXS[rip]
	call	t3_mdio_read@PLT
	mov	ecx, DWORD PTR [rsp]
	mov	r8d, DWORD PTR 4[rsp]
	cmp	ecx, 27
	jne	.L15
	cmp	r8d, 27
	je	.L1
.L15:
	mov	edx, r14d
	lea	rsi, .LC5[rip]
	mov	rdi, r13
	xor	eax, eax
	call	CH_WARN@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L36:
	mov	edi, 10
	call	msleep@PLT
	mov	ecx, DWORD PTR [rsp]
	test	ecx, ecx
	je	.L8
	sub	ebx, 1
	jne	.L9
	mov	edx, r14d
	lea	rsi, .LC6[rip]
	mov	rdi, r13
	xor	eax, eax
	call	CH_WARN@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	ecx, r15d
	mov	edx, r14d
	lea	rsi, .LC1[rip]
	mov	rdi, r13
	xor	eax, eax
	call	CH_WARN@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L40
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L38:
	.cfi_restore_state
	mov	edx, r14d
	lea	rsi, .LC3[rip]
	mov	rdi, r13
	xor	eax, eax
	call	CH_WARN@PLT
	jmp	.L11
.L39:
	mov	edx, DWORD PTR MDIO_CTRL1[rip]
	mov	esi, DWORD PTR MDIO_MMD_VEND1[rip]
	xor	r8d, r8d
	mov	rdi, rbp
	call	t3_mdio_change_bits@PLT
	test	eax, eax
	jne	.L19
	mov	edi, 10
	call	msleep@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L37:
	mov	edx, r14d
	lea	rsi, .LC2[rip]
	mov	rdi, r13
	xor	eax, eax
	call	CH_WARN@PLT
	jmp	.L17
.L19:
	mov	r15d, eax
	jmp	.L1
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	t3_aq100x_phy_prep, .-t3_aq100x_phy_prep
	.comm	aq100x_ops,4,4
	.comm	SUPPORTED_TP,4,4
	.comm	SUPPORTED_Autoneg,4,4
	.comm	SUPPORTED_AUI,4,4
	.comm	SUPPORTED_1000baseT_Full,4,4
	.comm	SUPPORTED_10000baseT_Full,4,4
	.comm	MDIO_MMD_VEND1,4,4
	.comm	MDIO_MMD_PHYXS,4,4
	.comm	MDIO_CTRL1,4,4
	.comm	F_GPIO6_OUT_VAL,4,4
	.comm	F_GPIO10_OUT_VAL,4,4
	.comm	A_T3DBG_GPIO_EN,4,4
	.comm	AQ_XAUI_TX_CFG,4,4
	.comm	AQ_XAUI_RX_CFG,4,4
	.comm	AQ_RESET,4,4
	.comm	AQ_LOWPOWER,4,4
	.comm	AQ_FW_VERSION,4,4
	.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_aq100x.c_t3_aq100x_phy_prep.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"1000/10GBASE-T\000"
	.align	2
.LC1:
	.ascii	"PHY%d: reset failed (0x%x, 0x%x).\012\000"
	.align	2
.LC2:
	.ascii	"PHY%d: reset took %ums\012\000"
	.align	2
.LC3:
	.ascii	"PHY%d: unsupported firmware %d\012\000"
	.align	2
.LC4:
	.ascii	"PHY%d does not start in low power mode.\012\000"
	.align	2
.LC5:
	.ascii	"PHY%d: incorrect XAUI settings (0x%x, 0x%x).\012\000"
	.align	2
.LC6:
	.ascii	"PHY%d: reset timed out (0x%x).\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	t3_aq100x_phy_prep
	.syntax unified
	.arm
	.fpu softvfp
	.type	t3_aq100x_phy_prep, %function
t3_aq100x_phy_prep:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L41
	ldr	lr, .L41+4
	ldr	ip, [ip]
	ldr	r4, [lr]
	ldr	lr, .L41+8
	orr	ip, ip, r4
	ldr	r4, [lr]
	ldr	lr, .L41+12
	orr	ip, ip, r4
	ldr	r4, [lr]
	ldr	lr, .L41+16
	sub	sp, sp, #44
	ldr	lr, [lr]
	orr	ip, ip, r4
	orr	ip, ip, lr
	mov	r5, r2
	str	r3, [sp]
	ldr	r3, .L41+20
	str	ip, [sp, #4]
	ldr	ip, .L41+24
	str	r2, [sp, #20]
	str	r3, [sp, #8]
	ldr	r3, .L41+28
	ldr	ip, [ip]
	str	ip, [sp, #36]
	mov	ip,#0
	mov	fp, r1
	mov	r6, r0
	bl	cphy_init
	cmp	r5, #0
	ldrne	r3, .L41+32
	ldreq	r3, .L41+36
	ldr	r4, .L41+40
	ldr	r5, [r3]
	ldr	r1, [r4]
	mov	r3, #0
	mov	r2, r5
	mov	r0, fp
	bl	t3_set_reg_field
	mov	r0, #1
	bl	msleep
	ldr	r1, [r4]
	mov	r3, r5
	mov	r2, r5
	mov	r0, fp
	bl	t3_set_reg_field
	mov	r0, #1000
	bl	msleep
	mov	r4, #500
	ldr	r8, .L41+44
	ldr	r7, .L41+48
	ldr	r9, .L41+52
	ldr	r10, .L41+56
.L9:
	add	r3, sp, #28
	mov	r0, r6
	ldr	r2, [r8]
	ldr	r1, [r7]
	bl	t3_mdio_read
	subs	r5, r0, #0
	ldr	r3, [sp, #28]
	bne	.L5
	cmp	r3, r9
	beq	.L5
	ldr	r2, [r10]
	and	r3, r3, r2
	cmp	r3, #0
	str	r3, [sp, #28]
	bne	.L36
.L8:
	rsb	r3, r4, r4, lsl #29
	rsb	r3, r4, r3, lsl #2
	lsl	r3, r3, #1
	ldr	r2, .L41+60
	add	r3, r3, #5952
	add	r3, r3, #48
	cmp	r3, r2
	bhi	.L37
.L17:
	ldr	r2, .L41+64
	add	r3, sp, #28
	mov	r0, r6
	ldr	r2, [r2]
	ldr	r1, [r7]
	bl	t3_mdio_read
	ldr	r3, [sp, #28]
	cmp	r3, #101
	bne	.L38
.L11:
	mov	r0, r6
	ldr	r2, [r8]
	ldr	r1, [r7]
	add	r3, sp, #28
	bl	t3_mdio_read
	subs	r5, r0, #0
	bne	.L1
	ldr	r3, .L41+68
	ldr	r2, [sp, #28]
	ldr	r3, [r3]
	tst	r3, r2
	bne	.L39
	mov	r0, fp
	ldr	r2, [sp, #20]
	ldr	r1, .L41+72
	bl	CH_WARN
.L13:
	mov	ip, #0
	ldr	r4, .L41+76
	ldr	r2, .L41+80
	ldr	r1, [r4]
	ldr	r2, [r2]
	add	r3, sp, #28
	mov	r0, r6
	str	ip, [sp, #32]
	str	ip, [sp, #28]
	bl	t3_mdio_read
	ldr	r3, .L41+84
	mov	r0, r6
	ldr	r2, [r3]
	ldr	r1, [r4]
	add	r3, sp, #32
	bl	t3_mdio_read
	ldr	r3, [sp, #28]
	ldr	r2, [sp, #32]
	cmp	r3, #27
	bne	.L15
	cmp	r2, #27
	beq	.L1
.L15:
	str	r2, [sp]
	mov	r0, fp
	ldr	r2, [sp, #20]
	ldr	r1, .L41+88
	bl	CH_WARN
	b	.L1
.L36:
	mov	r0, #10
	bl	msleep
	ldr	r3, [sp, #28]
	cmp	r3, #0
	beq	.L8
	subs	r4, r4, #1
	bne	.L9
	mov	r0, fp
	ldr	r2, [sp, #20]
	ldr	r1, .L41+92
	bl	CH_WARN
	b	.L1
.L5:
	str	r3, [sp]
	mov	r0, fp
	mov	r3, r5
	ldr	r2, [sp, #20]
	ldr	r1, .L41+96
	bl	CH_WARN
.L1:
	ldr	r3, .L41+24
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L40
	mov	r0, r5
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L38:
	mov	r0, fp
	ldr	r2, [sp, #20]
	ldr	r1, .L41+100
	bl	CH_WARN
	b	.L11
.L39:
	str	r5, [sp]
	mov	r0, r6
	ldr	r2, [r8]
	ldr	r1, [r7]
	bl	t3_mdio_change_bits
	cmp	r0, #0
	movne	r5, r0
	bne	.L1
	mov	r0, #10
	bl	msleep
	b	.L13
.L37:
	mov	r0, fp
	ldr	r2, [sp, #20]
	ldr	r1, .L41+104
	bl	CH_WARN
	b	.L17
.L40:
	bl	__stack_chk_fail
.L42:
	.align	2
.L41:
	.word	SUPPORTED_1000baseT_Full
	.word	SUPPORTED_10000baseT_Full
	.word	SUPPORTED_TP
	.word	SUPPORTED_Autoneg
	.word	SUPPORTED_AUI
	.word	.LC0
	.word	.LC7
	.word	aq100x_ops
	.word	F_GPIO10_OUT_VAL
	.word	F_GPIO6_OUT_VAL
	.word	A_T3DBG_GPIO_EN
	.word	MDIO_CTRL1
	.word	MDIO_MMD_VEND1
	.word	65535
	.word	AQ_RESET
	.word	3000
	.word	AQ_FW_VERSION
	.word	AQ_LOWPOWER
	.word	.LC4
	.word	MDIO_MMD_PHYXS
	.word	AQ_XAUI_RX_CFG
	.word	AQ_XAUI_TX_CFG
	.word	.LC5
	.word	.LC6
	.word	.LC1
	.word	.LC3
	.word	.LC2
	.size	t3_aq100x_phy_prep, .-t3_aq100x_phy_prep
	.comm	aq100x_ops,4,4
	.comm	SUPPORTED_TP,4,4
	.comm	SUPPORTED_Autoneg,4,4
	.comm	SUPPORTED_AUI,4,4
	.comm	SUPPORTED_1000baseT_Full,4,4
	.comm	SUPPORTED_10000baseT_Full,4,4
	.comm	MDIO_MMD_VEND1,4,4
	.comm	MDIO_MMD_PHYXS,4,4
	.comm	MDIO_CTRL1,4,4
	.comm	F_GPIO6_OUT_VAL,4,4
	.comm	F_GPIO10_OUT_VAL,4,4
	.comm	A_T3DBG_GPIO_EN,4,4
	.comm	AQ_XAUI_TX_CFG,4,4
	.comm	AQ_XAUI_RX_CFG,4,4
	.comm	AQ_RESET,4,4
	.comm	AQ_LOWPOWER,4,4
	.comm	AQ_FW_VERSION,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
