	.file	"extr_sli4.c_sli_fw_reset.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"FW status is NOT ready\n"
.LC1:
	.string	"Unexpected iftype %d\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Failed to become ready after firmware reset\n"
	.text
	.p2align 4
	.globl	sli_fw_reset
	.type	sli_fw_reset, @function
sli_fw_reset:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	esi, DWORD PTR SLI4_FW_READY_TIMEOUT_MSEC[rip]
	mov	rbx, rdi
	call	sli_wait_for_fw_ready@PLT
	test	rax, rax
	je	.L10
	mov	edx, DWORD PTR [rbx]
	cmp	edx, 128
	je	.L4
	mov	edi, DWORD PTR 4[rbx]
	cmp	edx, 129
	jne	.L5
	mov	esi, DWORD PTR SLI4_PCI_SOFT_RESET_CSR[rip]
	call	ocs_config_read32@PLT
	mov	edi, DWORD PTR 4[rbx]
	or	rax, QWORD PTR SLI4_PCI_SOFT_RESET_MASK[rip]
	mov	esi, DWORD PTR SLI4_PCI_SOFT_RESET_CSR[rip]
	mov	rdx, rax
	call	ocs_config_write32@PLT
.L6:
	mov	esi, DWORD PTR SLI4_FW_READY_TIMEOUT_MSEC[rip]
	mov	rdi, rbx
	call	sli_wait_for_fw_ready@PLT
	test	rax, rax
	je	.L11
	xor	eax, eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
	call	ocs_log_test@PLT
	mov	eax, -1
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rdx, QWORD PTR SLI4_PHYDEV_CONTROL_FRST[rip]
	mov	esi, DWORD PTR SLI4_REG_PHYSDEV_CONTROL[rip]
	mov	rdi, rbx
	call	sli_reg_write@PLT
	jmp	.L6
.L10:
	mov	edi, DWORD PTR 4[rbx]
	lea	rsi, .LC0[rip]
	call	ocs_log_crit@PLT
	mov	eax, -1
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbx]
	lea	rsi, .LC2[rip]
	call	ocs_log_crit@PLT
	mov	eax, -1
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	sli_fw_reset, .-sli_fw_reset
	.comm	SLI4_REG_PHYSDEV_CONTROL,4,4
	.comm	SLI4_PHYDEV_CONTROL_FRST,8,8
	.comm	SLI4_PCI_SOFT_RESET_MASK,8,8
	.comm	SLI4_PCI_SOFT_RESET_CSR,4,4
	.comm	SLI4_FW_READY_TIMEOUT_MSEC,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_sli4.c_sli_fw_reset.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"FW status is NOT ready\012\000"
	.align	2
.LC1:
	.ascii	"Unexpected iftype %d\012\000"
	.align	2
.LC2:
	.ascii	"Failed to become ready after firmware reset\012\000"
	.text
	.align	2
	.global	sli_fw_reset
	.syntax unified
	.arm
	.fpu softvfp
	.type	sli_fw_reset, %function
sli_fw_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, .L12
	mov	r4, r0
	ldr	r1, [r5]
	bl	sli_wait_for_fw_ready
	cmp	r0, #0
	beq	.L10
	ldr	r2, [r4]
	cmp	r2, #128
	beq	.L4
	cmp	r2, #129
	bne	.L5
	ldr	r6, .L12+4
	ldr	r0, [r4, #4]
	ldr	r1, [r6]
	bl	ocs_config_read32
	mov	r2, r0
	ldr	r3, .L12+8
	ldr	r1, [r6]
	ldr	r3, [r3]
	ldr	r0, [r4, #4]
	orr	r2, r2, r3
	bl	ocs_config_write32
.L6:
	mov	r0, r4
	ldr	r1, [r5]
	bl	sli_wait_for_fw_ready
	cmp	r0, #0
	beq	.L11
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L5:
	ldr	r0, [r4, #4]
	ldr	r1, .L12+12
	bl	ocs_log_test
	mvn	r0, #0
	pop	{r4, r5, r6, pc}
.L4:
	ldr	r3, .L12+16
	ldr	r2, .L12+20
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	sli_reg_write
	b	.L6
.L10:
	ldr	r0, [r4, #4]
	ldr	r1, .L12+24
	bl	ocs_log_crit
	mvn	r0, #0
	pop	{r4, r5, r6, pc}
.L11:
	ldr	r0, [r4, #4]
	ldr	r1, .L12+28
	bl	ocs_log_crit
	mvn	r0, #0
	pop	{r4, r5, r6, pc}
.L13:
	.align	2
.L12:
	.word	SLI4_FW_READY_TIMEOUT_MSEC
	.word	SLI4_PCI_SOFT_RESET_CSR
	.word	SLI4_PCI_SOFT_RESET_MASK
	.word	.LC1
	.word	SLI4_REG_PHYSDEV_CONTROL
	.word	SLI4_PHYDEV_CONTROL_FRST
	.word	.LC0
	.word	.LC2
	.size	sli_fw_reset, .-sli_fw_reset
	.comm	SLI4_REG_PHYSDEV_CONTROL,4,4
	.comm	SLI4_PHYDEV_CONTROL_FRST,4,4
	.comm	SLI4_PCI_SOFT_RESET_MASK,4,4
	.comm	SLI4_PCI_SOFT_RESET_CSR,4,4
	.comm	SLI4_FW_READY_TIMEOUT_MSEC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
