	.file	"extr_marvell.c_m88e1111_config_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	m88e1111_config_init, @function
m88e1111_config_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_SR[rip]
	mov	rbp, rdi
	call	phy_read@PLT
	mov	edx, DWORD PTR MII_M1111_HWCFG_FIBER_COPPER_AUTO[rip]
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_SR[rip]
	mov	rdi, rbp
	not	edx
	and	edx, eax
	call	phy_write@PLT
	mov	esi, DWORD PTR MII_BMCR[rip]
	mov	rdi, rbp
	call	phy_read@PLT
	mov	esi, DWORD PTR MII_BMCR[rip]
	or	eax, DWORD PTR BMCR_RESET[rip]
	mov	rdi, rbp
	mov	edx, eax
	call	phy_write@PLT
	mov	rax, QWORD PTR 0[rbp]
	cmp	rax, QWORD PTR PHY_INTERFACE_MODE_RGMII[rip]
	je	.L2
	cmp	rax, QWORD PTR PHY_INTERFACE_MODE_RGMII_ID[rip]
	je	.L2
	cmp	rax, QWORD PTR PHY_INTERFACE_MODE_RGMII_RXID[rip]
	je	.L2
	cmp	rax, QWORD PTR PHY_INTERFACE_MODE_RGMII_TXID[rip]
	je	.L2
	cmp	QWORD PTR PHY_INTERFACE_MODE_SGMII[rip], rax
	je	.L10
.L11:
	mov	edx, DWORD PTR BMCR_RESET[rip]
	mov	esi, DWORD PTR MII_BMCR[rip]
	mov	rdi, rbp
	call	phy_write@PLT
	mov	edx, 0
	test	eax, eax
	cmovg	eax, edx
.L1:
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_CR[rip]
	mov	rdi, rbp
	call	phy_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 0[rbp]
	cmp	rdx, QWORD PTR PHY_INTERFACE_MODE_RGMII_ID[rip]
	je	.L14
	cmp	rdx, QWORD PTR PHY_INTERFACE_MODE_RGMII_RXID[rip]
	je	.L15
	cmp	rdx, QWORD PTR PHY_INTERFACE_MODE_RGMII_TXID[rip]
	je	.L16
.L6:
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_CR[rip]
	mov	edx, eax
	mov	rdi, rbp
	call	phy_write@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_SR[rip]
	mov	rdi, rbp
	call	phy_read@PLT
	test	eax, eax
	js	.L1
	mov	edx, DWORD PTR MII_M1111_HWCFG_MODE_MASK[rip]
	not	edx
	and	eax, edx
	test	DWORD PTR MII_M1111_HWCFG_FIBER_COPPER_RES[rip], eax
	jne	.L17
	or	eax, DWORD PTR MII_M1111_HWCFG_MODE_COPPER_RGMII[rip]
	mov	edx, eax
.L9:
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_SR[rip]
	mov	rdi, rbp
	call	phy_write@PLT
	test	eax, eax
	js	.L1
	mov	rax, QWORD PTR 0[rbp]
	cmp	QWORD PTR PHY_INTERFACE_MODE_SGMII[rip], rax
	jne	.L11
.L10:
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_SR[rip]
	mov	rdi, rbp
	call	phy_read@PLT
	test	eax, eax
	js	.L1
	mov	edx, DWORD PTR MII_M1111_HWCFG_MODE_MASK[rip]
	mov	esi, DWORD PTR MII_M1111_PHY_EXT_SR[rip]
	mov	rdi, rbp
	not	edx
	and	eax, edx
	mov	edx, DWORD PTR MII_M1111_HWCFG_MODE_SGMII_NO_CLK[rip]
	or	edx, DWORD PTR MII_M1111_HWCFG_FIBER_COPPER_AUTO[rip]
	or	edx, eax
	call	phy_write@PLT
	test	eax, eax
	jns	.L11
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	edx, DWORD PTR MII_M1111_RX_DELAY[rip]
	or	edx, DWORD PTR MII_M1111_TX_DELAY[rip]
	or	eax, edx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	or	eax, DWORD PTR MII_M1111_HWCFG_MODE_FIBER_RGMII[rip]
	mov	edx, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edx, DWORD PTR MII_M1111_RX_DELAY[rip]
	not	edx
	and	eax, edx
	or	eax, DWORD PTR MII_M1111_TX_DELAY[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edx, DWORD PTR MII_M1111_TX_DELAY[rip]
	not	edx
	and	eax, edx
	or	eax, DWORD PTR MII_M1111_RX_DELAY[rip]
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	m88e1111_config_init, .-m88e1111_config_init
	.comm	PHY_INTERFACE_MODE_SGMII,8,8
	.comm	PHY_INTERFACE_MODE_RGMII_TXID,8,8
	.comm	PHY_INTERFACE_MODE_RGMII_RXID,8,8
	.comm	PHY_INTERFACE_MODE_RGMII_ID,8,8
	.comm	PHY_INTERFACE_MODE_RGMII,8,8
	.comm	MII_M1111_TX_DELAY,4,4
	.comm	MII_M1111_RX_DELAY,4,4
	.comm	MII_M1111_PHY_EXT_SR,4,4
	.comm	MII_M1111_PHY_EXT_CR,4,4
	.comm	MII_M1111_HWCFG_MODE_SGMII_NO_CLK,4,4
	.comm	MII_M1111_HWCFG_MODE_MASK,4,4
	.comm	MII_M1111_HWCFG_MODE_FIBER_RGMII,4,4
	.comm	MII_M1111_HWCFG_MODE_COPPER_RGMII,4,4
	.comm	MII_M1111_HWCFG_FIBER_COPPER_RES,4,4
	.comm	MII_M1111_HWCFG_FIBER_COPPER_AUTO,4,4
	.comm	MII_BMCR,4,4
	.comm	BMCR_RESET,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_marvell.c_m88e1111_config_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	m88e1111_config_init, %function
m88e1111_config_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r5, .L17
	mov	r4, r0
	ldr	r1, [r5]
	bl	phy_read
	mov	r3, r0
	ldr	r8, .L17+4
	ldr	r6, .L17+8
	ldr	r2, [r8]
	ldr	r1, [r5]
	bic	r2, r3, r2
	mov	r0, r4
	bl	phy_write
	ldr	r1, [r6]
	mov	r0, r4
	bl	phy_read
	mov	r2, r0
	ldr	r7, .L17+12
	mov	r0, r4
	ldr	r3, [r7]
	ldr	r1, [r6]
	orr	r2, r2, r3
	bl	phy_write
	ldr	r2, .L17+16
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r2, .L17+20
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r2, .L17+24
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r2, .L17+28
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r2, .L17+32
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L10
.L11:
	mov	r0, r4
	ldr	r2, [r7]
	ldr	r1, [r6]
	bl	phy_write
	and	r0, r0, r0, asr #31
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r9, .L17+36
	mov	r0, r4
	ldr	r1, [r9]
	bl	phy_read
	cmp	r0, #0
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r2, .L17+20
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L14
	ldr	r2, .L17+24
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L15
	ldr	r2, .L17+28
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L16
.L6:
	mov	r2, r0
	ldr	r1, [r9]
	mov	r0, r4
	bl	phy_write
	cmp	r0, #0
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, r4
	ldr	r1, [r5]
	bl	phy_read
	cmp	r0, #0
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r2, .L17+40
	ldr	r3, .L17+44
	ldr	r2, [r2]
	ldr	r3, [r3]
	bic	r0, r0, r2
	tst	r0, r3
	ldrne	r3, .L17+48
	ldreq	r3, .L17+52
	ldr	r1, [r5]
	ldr	r2, [r3]
	orr	r2, r0, r2
	mov	r0, r4
	bl	phy_write
	cmp	r0, #0
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r2, .L17+32
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r2, r3
	bne	.L11
.L10:
	mov	r0, r4
	ldr	r1, [r5]
	bl	phy_read
	cmp	r0, #0
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r2, .L17+56
	ldr	r3, .L17+40
	ldr	r1, [r8]
	ldr	r2, [r2]
	ldr	r3, [r3]
	orr	r2, r2, r1
	bic	r0, r0, r3
	orr	r2, r2, r0
	ldr	r1, [r5]
	mov	r0, r4
	bl	phy_write
	cmp	r0, #0
	bge	.L11
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	ldr	r3, .L17+60
	ldr	r2, .L17+64
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	orr	r0, r0, r3
	b	.L6
.L16:
	ldr	r2, .L17+60
	ldr	r3, .L17+64
	ldr	r2, [r2]
	ldr	r3, [r3]
	bic	r0, r0, r2
	orr	r0, r0, r3
	b	.L6
.L15:
	ldr	r2, .L17+64
	ldr	r3, .L17+60
	ldr	r2, [r2]
	ldr	r3, [r3]
	bic	r0, r0, r2
	orr	r0, r0, r3
	b	.L6
.L18:
	.align	2
.L17:
	.word	MII_M1111_PHY_EXT_SR
	.word	MII_M1111_HWCFG_FIBER_COPPER_AUTO
	.word	MII_BMCR
	.word	BMCR_RESET
	.word	PHY_INTERFACE_MODE_RGMII
	.word	PHY_INTERFACE_MODE_RGMII_ID
	.word	PHY_INTERFACE_MODE_RGMII_RXID
	.word	PHY_INTERFACE_MODE_RGMII_TXID
	.word	PHY_INTERFACE_MODE_SGMII
	.word	MII_M1111_PHY_EXT_CR
	.word	MII_M1111_HWCFG_MODE_MASK
	.word	MII_M1111_HWCFG_FIBER_COPPER_RES
	.word	MII_M1111_HWCFG_MODE_FIBER_RGMII
	.word	MII_M1111_HWCFG_MODE_COPPER_RGMII
	.word	MII_M1111_HWCFG_MODE_SGMII_NO_CLK
	.word	MII_M1111_RX_DELAY
	.word	MII_M1111_TX_DELAY
	.size	m88e1111_config_init, .-m88e1111_config_init
	.comm	PHY_INTERFACE_MODE_SGMII,4,4
	.comm	PHY_INTERFACE_MODE_RGMII_TXID,4,4
	.comm	PHY_INTERFACE_MODE_RGMII_RXID,4,4
	.comm	PHY_INTERFACE_MODE_RGMII_ID,4,4
	.comm	PHY_INTERFACE_MODE_RGMII,4,4
	.comm	MII_M1111_TX_DELAY,4,4
	.comm	MII_M1111_RX_DELAY,4,4
	.comm	MII_M1111_PHY_EXT_SR,4,4
	.comm	MII_M1111_PHY_EXT_CR,4,4
	.comm	MII_M1111_HWCFG_MODE_SGMII_NO_CLK,4,4
	.comm	MII_M1111_HWCFG_MODE_MASK,4,4
	.comm	MII_M1111_HWCFG_MODE_FIBER_RGMII,4,4
	.comm	MII_M1111_HWCFG_MODE_COPPER_RGMII,4,4
	.comm	MII_M1111_HWCFG_FIBER_COPPER_RES,4,4
	.comm	MII_M1111_HWCFG_FIBER_COPPER_AUTO,4,4
	.comm	MII_BMCR,4,4
	.comm	BMCR_RESET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
