	.file	"extr_if_mge.c_mv_read_ext_phy.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Timeout while reading from PHY\n"
	.text
	.p2align 4
	.type	mv_read_ext_phy, @function
mv_read_ext_phy:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, edi
	sal	r13d, 21
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	device_get_softc@PLT
	mov	rbp, rax
	xor	eax, eax
	call	MGE_SMI_LOCK@PLT
	mov	edx, ebx
	mov	esi, DWORD PTR MGE_REG_SMI[rip]
	mov	edi, DWORD PTR 0[rbp]
	sal	edx, 16
	or	edx, DWORD PTR MGE_SMI_READ[rip]
	or	edx, r13d
	and	edx, DWORD PTR MGE_SMI_MASK[rip]
	call	MGE_WRITE@PLT
	mov	rbx, QWORD PTR MGE_SMI_READ_RETRIES[rip]
	sub	rbx, 1
	jne	.L2
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR MGE_SMI_READ_DELAY[rip]
	call	DELAY@PLT
	sub	rbx, 1
	je	.L3
.L2:
	mov	esi, DWORD PTR MGE_REG_SMI[rip]
	mov	edi, DWORD PTR 0[rbp]
	call	MGE_READ@PLT
	test	QWORD PTR MGE_SMI_READVALID[rip], rax
	je	.L4
.L5:
	mov	edi, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR MGE_REG_SMI[rip]
	call	MGE_READ@PLT
	and	rax, QWORD PTR MGE_SMI_DATA_MASK[rip]
	mov	rbx, rax
	xor	eax, eax
	call	MGE_SMI_UNLOCK@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, ebx
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	device_printf@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	mv_read_ext_phy, .-mv_read_ext_phy
	.comm	MGE_SMI_READ_RETRIES,8,8
	.comm	MGE_SMI_READ_DELAY,4,4
	.comm	MGE_SMI_READVALID,8,8
	.comm	MGE_SMI_READ,4,4
	.comm	MGE_SMI_MASK,4,4
	.comm	MGE_SMI_DATA_MASK,8,8
	.comm	MGE_REG_SMI,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_if_mge.c_mv_read_ext_phy.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Timeout while reading from PHY\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mv_read_ext_phy, %function
mv_read_ext_phy:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r2
	mov	r6, r1
	mov	r8, r0
	bl	device_get_softc
	mov	r5, r0
	bl	MGE_SMI_LOCK
	ldr	r3, .L13
	ldr	r2, .L13+4
	ldr	r3, [r3]
	ldr	r0, [r2]
	orr	r1, r3, r6, lsl #16
	ldr	r6, .L13+8
	orr	r2, r1, r4, lsl #21
	and	r2, r2, r0
	ldr	r1, [r6]
	ldr	r0, [r5]
	bl	MGE_WRITE
	ldr	r3, .L13+12
	ldr	r4, [r3]
	subs	r4, r4, #1
	beq	.L3
	ldr	r7, .L13+16
	ldr	r9, .L13+20
	b	.L2
.L4:
	ldr	r0, [r9]
	bl	DELAY
	subs	r4, r4, #1
	beq	.L3
.L2:
	ldr	r1, [r6]
	ldr	r0, [r5]
	bl	MGE_READ
	ldr	r3, [r7]
	tst	r0, r3
	beq	.L4
.L5:
	ldr	r1, [r6]
	ldr	r0, [r5]
	bl	MGE_READ
	ldr	r3, .L13+24
	ldr	r4, [r3]
	and	r4, r4, r0
	bl	MGE_SMI_UNLOCK
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	mov	r0, r8
	ldr	r1, .L13+28
	bl	device_printf
	b	.L5
.L14:
	.align	2
.L13:
	.word	MGE_SMI_READ
	.word	MGE_SMI_MASK
	.word	MGE_REG_SMI
	.word	MGE_SMI_READ_RETRIES
	.word	MGE_SMI_READVALID
	.word	MGE_SMI_READ_DELAY
	.word	MGE_SMI_DATA_MASK
	.word	.LC0
	.size	mv_read_ext_phy, .-mv_read_ext_phy
	.comm	MGE_SMI_READ_RETRIES,4,4
	.comm	MGE_SMI_READ_DELAY,4,4
	.comm	MGE_SMI_READVALID,4,4
	.comm	MGE_SMI_READ,4,4
	.comm	MGE_SMI_MASK,4,4
	.comm	MGE_SMI_DATA_MASK,4,4
	.comm	MGE_REG_SMI,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
