	.file	"extr_dwmac-oxnas.c_oxnas_dwmac_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	oxnas_dwmac_init, @function
oxnas_dwmac_init:
.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, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	edi, DWORD PTR 8[rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	device_reset@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L7
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L8
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L7:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbp]
	call	clk_prepare_enable@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	esi, DWORD PTR OXNAS_DWMAC_CTRL_REGOFFSET[rip]
	mov	edi, DWORD PTR 0[rbp]
	lea	rdx, 20[rsp]
	call	regmap_read@PLT
	mov	ebx, eax
	test	eax, eax
	js	.L9
	mov	edi, DWORD PTR DWMAC_CKEN_GTX[rip]
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_SIMPLE_MUX[rip]
	mov	ebx, eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_AUTO_TX_SOURCE[rip]
	or	ebx, eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_CKEN_TX_OUT[rip]
	mov	r15d, eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_CKEN_TXN_OUT[rip]
	mov	r14d, eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_CKEN_TX_IN[rip]
	mov	r13d, eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_CKEN_RX_OUT[rip]
	mov	DWORD PTR 4[rsp], eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_CKEN_RXN_OUT[rip]
	mov	DWORD PTR 8[rsp], eax
	call	BIT@PLT
	mov	edi, DWORD PTR DWMAC_CKEN_RX_IN[rip]
	mov	DWORD PTR 12[rsp], eax
	call	BIT@PLT
	or	ebx, DWORD PTR 20[rsp]
	mov	esi, DWORD PTR OXNAS_DWMAC_CTRL_REGOFFSET[rip]
	mov	edx, ebx
	mov	edi, DWORD PTR 0[rbp]
	or	edx, r15d
	or	edx, r14d
	or	edx, r13d
	or	edx, DWORD PTR 4[rsp]
	or	edx, DWORD PTR 8[rsp]
	or	edx, DWORD PTR 12[rsp]
	or	edx, eax
	mov	DWORD PTR 20[rsp], edx
	call	regmap_write@PLT
	mov	edi, 4
	call	DWMAC_TX_VARDELAY@PLT
	mov	edi, 2
	mov	ebx, eax
	call	DWMAC_TXN_VARDELAY@PLT
	mov	edi, 10
	or	ebx, eax
	call	DWMAC_RX_VARDELAY@PLT
	mov	edi, 8
	or	ebx, eax
	call	DWMAC_RXN_VARDELAY@PLT
	mov	esi, DWORD PTR OXNAS_DWMAC_DELAY_REGOFFSET[rip]
	mov	edi, DWORD PTR 0[rbp]
	or	ebx, eax
	mov	edx, ebx
	mov	DWORD PTR 20[rsp], ebx
	call	regmap_write@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, DWORD PTR 4[rbp]
	mov	r12d, ebx
	call	clk_disable_unprepare@PLT
	jmp	.L1
.L8:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	oxnas_dwmac_init, .-oxnas_dwmac_init
	.comm	OXNAS_DWMAC_DELAY_REGOFFSET,4,4
	.comm	OXNAS_DWMAC_CTRL_REGOFFSET,4,4
	.comm	DWMAC_SIMPLE_MUX,4,4
	.comm	DWMAC_CKEN_TX_OUT,4,4
	.comm	DWMAC_CKEN_TX_IN,4,4
	.comm	DWMAC_CKEN_TXN_OUT,4,4
	.comm	DWMAC_CKEN_RX_OUT,4,4
	.comm	DWMAC_CKEN_RX_IN,4,4
	.comm	DWMAC_CKEN_RXN_OUT,4,4
	.comm	DWMAC_CKEN_GTX,4,4
	.comm	DWMAC_AUTO_TX_SOURCE,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_dwmac-oxnas.c_oxnas_dwmac_init.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	oxnas_dwmac_init, %function
oxnas_dwmac_init:
	@ 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, .L10
	sub	sp, sp, #20
	ldr	r0, [r1, #8]
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	device_reset
	subs	r4, r0, #0
	beq	.L7
.L1:
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L8
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r0, [r5, #4]
	bl	clk_prepare_enable
	subs	r4, r0, #0
	bne	.L1
	ldr	fp, .L10+4
	ldr	r0, [r5]
	ldr	r1, [fp]
	add	r2, sp, #8
	bl	regmap_read
	subs	r6, r0, #0
	blt	.L9
	ldr	r3, .L10+8
	ldr	r0, [r3]
	bl	BIT
	ldr	r3, .L10+12
	mov	r6, r0
	ldr	r0, [r3]
	bl	BIT
	ldr	r3, .L10+16
	orr	r6, r6, r0
	ldr	r0, [r3]
	bl	BIT
	ldr	r2, .L10+20
	str	r0, [sp]
	ldr	r0, [r2]
	bl	BIT
	ldr	r2, .L10+24
	str	r0, [sp, #4]
	ldr	r0, [r2]
	bl	BIT
	ldr	r1, .L10+28
	mov	r10, r0
	ldr	r0, [r1]
	bl	BIT
	ldr	r1, .L10+32
	mov	r9, r0
	ldr	r0, [r1]
	bl	BIT
	ldr	r1, .L10+36
	mov	r8, r0
	ldr	r0, [r1]
	bl	BIT
	ldr	r1, .L10+40
	mov	r7, r0
	ldr	r0, [r1]
	bl	BIT
	ldr	r2, [sp, #8]
	ldr	r3, [sp]
	orr	r2, r6, r2
	orr	r2, r2, r3
	ldr	r3, [sp, #4]
	ldr	r1, [fp]
	orr	r2, r2, r3
	orr	r2, r2, r10
	orr	r2, r2, r9
	orr	r2, r2, r8
	orr	r2, r2, r7
	orr	r2, r2, r0
	ldr	r0, [r5]
	str	r2, [sp, #8]
	bl	regmap_write
	mov	r0, #4
	bl	DWMAC_TX_VARDELAY
	mov	r6, r0
	mov	r0, #2
	bl	DWMAC_TXN_VARDELAY
	mov	r2, r0
	mov	r0, #10
	orr	r6, r6, r2
	bl	DWMAC_RX_VARDELAY
	mov	r2, r0
	mov	r0, #8
	orr	r6, r6, r2
	bl	DWMAC_RXN_VARDELAY
	ldr	r3, .L10+44
	orr	r2, r6, r0
	ldr	r1, [r3]
	ldr	r0, [r5]
	str	r2, [sp, #8]
	bl	regmap_write
	b	.L1
.L9:
	ldr	r0, [r5, #4]
	bl	clk_disable_unprepare
	mov	r4, r6
	b	.L1
.L8:
	bl	__stack_chk_fail
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	OXNAS_DWMAC_CTRL_REGOFFSET
	.word	DWMAC_CKEN_GTX
	.word	DWMAC_SIMPLE_MUX
	.word	DWMAC_AUTO_TX_SOURCE
	.word	DWMAC_CKEN_TX_OUT
	.word	DWMAC_CKEN_TXN_OUT
	.word	DWMAC_CKEN_TX_IN
	.word	DWMAC_CKEN_RX_OUT
	.word	DWMAC_CKEN_RXN_OUT
	.word	DWMAC_CKEN_RX_IN
	.word	OXNAS_DWMAC_DELAY_REGOFFSET
	.size	oxnas_dwmac_init, .-oxnas_dwmac_init
	.comm	OXNAS_DWMAC_DELAY_REGOFFSET,4,4
	.comm	OXNAS_DWMAC_CTRL_REGOFFSET,4,4
	.comm	DWMAC_SIMPLE_MUX,4,4
	.comm	DWMAC_CKEN_TX_OUT,4,4
	.comm	DWMAC_CKEN_TX_IN,4,4
	.comm	DWMAC_CKEN_TXN_OUT,4,4
	.comm	DWMAC_CKEN_RX_OUT,4,4
	.comm	DWMAC_CKEN_RX_IN,4,4
	.comm	DWMAC_CKEN_RXN_OUT,4,4
	.comm	DWMAC_CKEN_GTX,4,4
	.comm	DWMAC_AUTO_TX_SOURCE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
