	.file	"extr_socfpga.c_socfpga_fpga_reset.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	socfpga_fpga_reset, @function
socfpga_fpga_reset:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rbp, QWORD PTR [rdi]
	mov	rdi, rbp
	call	socfpga_fpga_cfg_mode_set@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L8
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L8:
	.cfi_restore_state
	mov	edx, DWORD PTR SOCFPGA_FPGMGR_CTL_EN[rip]
	mov	esi, DWORD PTR SOCFPGA_FPGMGR_CTL_OFST[rip]
	mov	rdi, rbp
	call	socfpga_fpga_set_bitsl@PLT
	mov	esi, DWORD PTR SOCFPGA_FPGMGR_CTL_OFST[rip]
	mov	rdi, rbp
	call	socfpga_fpga_readl@PLT
	mov	esi, DWORD PTR SOCFPGA_FPGMGR_CTL_OFST[rip]
	or	rax, QWORD PTR SOCFPGA_FPGMGR_CTL_NCFGPULL[rip]
	mov	rdi, rbp
	mov	rdx, rax
	mov	rbx, rax
	call	socfpga_fpga_writel@PLT
	mov	esi, DWORD PTR SOCFPGA_FPGMGR_STAT_RESET[rip]
	mov	rdi, rbp
	call	socfpga_fpga_wait_for_state@PLT
	mov	rdx, QWORD PTR SOCFPGA_FPGMGR_CTL_NCFGPULL[rip]
	mov	esi, DWORD PTR SOCFPGA_FPGMGR_CTL_OFST[rip]
	mov	rdi, rbp
	mov	r13, rax
	not	rdx
	and	rdx, rbx
	call	socfpga_fpga_writel@PLT
	test	r13, r13
	je	.L1
	mov	r12d, DWORD PTR ETIMEDOUT[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	socfpga_fpga_reset, .-socfpga_fpga_reset
	.comm	SOCFPGA_FPGMGR_STAT_RESET,4,4
	.comm	SOCFPGA_FPGMGR_CTL_OFST,4,4
	.comm	SOCFPGA_FPGMGR_CTL_NCFGPULL,8,8
	.comm	SOCFPGA_FPGMGR_CTL_EN,4,4
	.comm	ETIMEDOUT,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_socfpga.c_socfpga_fpga_reset.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	socfpga_fpga_reset, %function
socfpga_fpga_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, [r0]
	mov	r0, r5
	bl	socfpga_fpga_cfg_mode_set
	subs	r4, r0, #0
	bne	.L1
	ldr	r3, .L8
	ldr	r7, .L8+4
	ldr	r2, [r3]
	ldr	r1, [r7]
	mov	r0, r5
	bl	socfpga_fpga_set_bitsl
	ldr	r1, [r7]
	mov	r0, r5
	bl	socfpga_fpga_readl
	mov	r6, r0
	ldr	r8, .L8+8
	ldr	r1, [r7]
	ldr	r2, [r8]
	mov	r0, r5
	orr	r6, r6, r2
	mov	r2, r6
	bl	socfpga_fpga_writel
	ldr	r3, .L8+12
	mov	r0, r5
	ldr	r1, [r3]
	bl	socfpga_fpga_wait_for_state
	ldr	r2, [r8]
	mov	r4, r0
	ldr	r1, [r7]
	mov	r0, r5
	bic	r2, r6, r2
	bl	socfpga_fpga_writel
	cmp	r4, #0
	ldrne	r3, .L8+16
	ldrne	r4, [r3]
	rsbne	r4, r4, #0
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	.align	2
.L8:
	.word	SOCFPGA_FPGMGR_CTL_EN
	.word	SOCFPGA_FPGMGR_CTL_OFST
	.word	SOCFPGA_FPGMGR_CTL_NCFGPULL
	.word	SOCFPGA_FPGMGR_STAT_RESET
	.word	ETIMEDOUT
	.size	socfpga_fpga_reset, .-socfpga_fpga_reset
	.comm	SOCFPGA_FPGMGR_STAT_RESET,4,4
	.comm	SOCFPGA_FPGMGR_CTL_OFST,4,4
	.comm	SOCFPGA_FPGMGR_CTL_NCFGPULL,4,4
	.comm	SOCFPGA_FPGMGR_CTL_EN,4,4
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
