	.file	"extr_qla_nx.c_qla82xx_start_firmware.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Error trying to start fw.\n"
.LC1:
	.string	"Error during card handshake.\n"
	.text
	.p2align 4
	.globl	qla82xx_start_firmware
	.type	qla82xx_start_firmware, @function
qla82xx_start_firmware:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rbp, QWORD PTR [rdi]
	mov	edx, DWORD PTR QLA82XX_DMA_SHIFT_VALUE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	esi, DWORD PTR CRB_DMA_SHIFT[rip]
	mov	rdi, rbp
	call	qla82xx_wr_32@PLT
	mov	esi, DWORD PTR CRB_CMDPEG_STATE[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	qla82xx_wr_32@PLT
	mov	esi, DWORD PTR CRB_RCVPEG_STATE[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	qla82xx_wr_32@PLT
	mov	esi, DWORD PTR QLA82XX_PEG_HALT_STATUS1[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	qla82xx_wr_32@PLT
	mov	esi, DWORD PTR QLA82XX_PEG_HALT_STATUS2[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	qla82xx_wr_32@PLT
	mov	rdi, r12
	call	qla82xx_load_fw@PLT
	cmp	rax, QWORD PTR QLA_SUCCESS[rip]
	je	.L2
	mov	edi, DWORD PTR ql_log_fatal[rip]
	lea	rcx, .LC0[rip]
	mov	edx, 167
	mov	rsi, r12
	call	ql_log@PLT
	mov	eax, DWORD PTR QLA_FUNCTION_FAILED[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L8
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	call	qla82xx_check_cmdpeg_state@PLT
	cmp	rax, QWORD PTR QLA_SUCCESS[rip]
	je	.L4
	mov	edi, DWORD PTR ql_log_fatal[rip]
	lea	rcx, .LC1[rip]
	mov	edx, 170
	mov	rsi, r12
	call	ql_log@PLT
	mov	eax, DWORD PTR QLA_FUNCTION_FAILED[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR 4[rbp]
	mov	esi, DWORD PTR PCI_EXP_LNKSTA[rip]
	lea	rdx, 4[rsp]
	call	pcie_capability_read_word@PLT
	mov	eax, DWORD PTR 4[rsp]
	mov	rdi, rbp
	sar	eax, 4
	and	eax, 63
	mov	DWORD PTR 0[rbp], eax
	call	qla82xx_check_rcvpeg_state@PLT
	jmp	.L1
.L8:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	qla82xx_start_firmware, .-qla82xx_start_firmware
	.comm	ql_log_fatal,4,4
	.comm	QLA_SUCCESS,8,8
	.comm	QLA_FUNCTION_FAILED,4,4
	.comm	QLA82XX_PEG_HALT_STATUS2,4,4
	.comm	QLA82XX_PEG_HALT_STATUS1,4,4
	.comm	QLA82XX_DMA_SHIFT_VALUE,4,4
	.comm	PCI_EXP_LNKSTA,4,4
	.comm	CRB_RCVPEG_STATE,4,4
	.comm	CRB_DMA_SHIFT,4,4
	.comm	CRB_CMDPEG_STATE,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_qla_nx.c_qla82xx_start_firmware.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Error trying to start fw.\012\000"
	.align	2
.LC1:
	.ascii	"Error during card handshake.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	qla82xx_start_firmware
	.syntax unified
	.arm
	.fpu softvfp
	.type	qla82xx_start_firmware, %function
qla82xx_start_firmware:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r3, .L9
	ldr	r4, [r0]
	ldr	r2, .L9+4
	ldr	r1, [r3]
	ldr	r3, .L9+8
	sub	sp, sp, #8
	ldr	r2, [r2]
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	qla82xx_wr_32
	ldr	r3, .L9+12
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	qla82xx_wr_32
	ldr	r3, .L9+16
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	qla82xx_wr_32
	ldr	r3, .L9+20
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	qla82xx_wr_32
	ldr	r3, .L9+24
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	qla82xx_wr_32
	mov	r0, r5
	bl	qla82xx_load_fw
	ldr	r6, .L9+28
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L2
	ldr	r3, .L9+32
	mov	r1, r5
	ldr	r0, [r3]
	mov	r2, #167
	ldr	r3, .L9+36
	bl	ql_log
	ldr	r3, .L9+40
	ldr	r0, [r3]
.L1:
	ldr	r3, .L9+8
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L8
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L2:
	mov	r0, r4
	bl	qla82xx_check_cmdpeg_state
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L4
	ldr	r3, .L9+32
	mov	r1, r5
	ldr	r0, [r3]
	mov	r2, #170
	ldr	r3, .L9+44
	bl	ql_log
	ldr	r3, .L9+40
	ldr	r0, [r3]
	b	.L1
.L4:
	ldr	r3, .L9+48
	mov	r2, sp
	ldr	r1, [r3]
	ldr	r0, [r4, #4]
	bl	pcie_capability_read_word
	ldr	r3, [sp]
	mov	r0, r4
	asr	r3, r3, #4
	and	r3, r3, #63
	str	r3, [r4]
	bl	qla82xx_check_rcvpeg_state
	b	.L1
.L8:
	bl	__stack_chk_fail
.L10:
	.align	2
.L9:
	.word	CRB_DMA_SHIFT
	.word	QLA82XX_DMA_SHIFT_VALUE
	.word	.LC2
	.word	CRB_CMDPEG_STATE
	.word	CRB_RCVPEG_STATE
	.word	QLA82XX_PEG_HALT_STATUS1
	.word	QLA82XX_PEG_HALT_STATUS2
	.word	QLA_SUCCESS
	.word	ql_log_fatal
	.word	.LC0
	.word	QLA_FUNCTION_FAILED
	.word	.LC1
	.word	PCI_EXP_LNKSTA
	.size	qla82xx_start_firmware, .-qla82xx_start_firmware
	.comm	ql_log_fatal,4,4
	.comm	QLA_SUCCESS,4,4
	.comm	QLA_FUNCTION_FAILED,4,4
	.comm	QLA82XX_PEG_HALT_STATUS2,4,4
	.comm	QLA82XX_PEG_HALT_STATUS1,4,4
	.comm	QLA82XX_DMA_SHIFT_VALUE,4,4
	.comm	PCI_EXP_LNKSTA,4,4
	.comm	CRB_RCVPEG_STATE,4,4
	.comm	CRB_DMA_SHIFT,4,4
	.comm	CRB_CMDPEG_STATE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
