	.file	"extr_qla_nx.c_qla82xx_load_fw.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Error during CRB initialization.\n"
	.align 8
.LC1:
	.string	"Attempting to load firmware from flash.\n"
	.align 8
.LC2:
	.string	"Firmware loaded successfully from flash.\n"
	.align 8
.LC3:
	.string	"Firmware load from flash failed.\n"
	.align 8
.LC4:
	.string	"Attempting to load firmware from blob.\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"Firmware image not present.\n"
	.section	.rodata.str1.8
	.align 8
.LC6:
	.string	"No valid firmware image found.\n"
	.align 8
.LC7:
	.string	"Firmware loaded successfully from binary blob.\n"
	.align 8
.LC8:
	.string	"Firmware load failed for binary blob.\n"
	.text
	.p2align 4
	.type	qla82xx_load_fw, @function
qla82xx_load_fw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	r12, QWORD PTR [rdi]
	call	qla82xx_pinit_from_rom@PLT
	cmp	rax, QWORD PTR QLA_SUCCESS[rip]
	je	.L2
	mov	edi, DWORD PTR ql_log_fatal[rip]
	lea	rcx, .LC0[rip]
	mov	edx, 159
	mov	rsi, rbp
	call	ql_log@PLT
	mov	eax, DWORD PTR QLA_FUNCTION_FAILED[rip]
.L1:
	pop	rbx
	.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	edi, 500
	call	udelay@PLT
	mov	esi, DWORD PTR QLA82XX_ROMUSB_GLB_SW_RESET[rip]
	mov	rdi, r12
	call	qla82xx_rd_32@PLT
	mov	esi, DWORD PTR QLA82XX_ROMUSB_GLB_SW_RESET[rip]
	mov	rdi, r12
	and	eax, -285212673
	mov	edx, eax
	call	qla82xx_wr_32@PLT
	cmp	DWORD PTR ql2xfwloadbin[rip], 2
	je	.L4
	mov	edi, DWORD PTR ql_log_info[rip]
	lea	rcx, .LC1[rip]
	mov	edx, 160
	mov	rsi, rbp
	call	ql_log@PLT
	mov	rdi, r12
	call	qla82xx_fw_load_from_flash@PLT
	cmp	rax, QWORD PTR QLA_SUCCESS[rip]
	je	.L18
	mov	edi, DWORD PTR ql_log_warn[rip]
	lea	rcx, .LC3[rip]
	mov	edx, 264
	mov	rsi, rbp
	call	ql_log@PLT
.L4:
	mov	edi, DWORD PTR ql_log_info[rip]
	lea	rcx, .LC4[rip]
	mov	edx, 162
	mov	rsi, rbp
	call	ql_log@PLT
	mov	rdi, rbp
	call	qla2x00_request_firmware@PLT
	mov	QWORD PTR [r12], rax
	mov	rbx, rax
	test	rax, rax
	je	.L19
	mov	esi, DWORD PTR QLA82XX_FLASH_ROMIMAGE[rip]
	mov	rdi, rbp
	call	qla82xx_validate_firmware_blob@PLT
	test	rax, rax
	jne	.L20
.L8:
	mov	rdi, r12
	call	qla82xx_fw_load_from_blob@PLT
	cmp	rax, QWORD PTR QLA_SUCCESS[rip]
	je	.L21
	mov	edi, DWORD PTR ql_log_fatal[rip]
	lea	rcx, .LC8[rip]
	mov	edx, 166
	mov	rsi, rbp
	call	ql_log@PLT
	mov	QWORD PTR [rbx], 0
.L7:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR QLA_FUNCTION_FAILED[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	mov	esi, DWORD PTR QLA82XX_UNIFIED_ROMIMAGE[rip]
	mov	rdi, rbp
	call	qla82xx_validate_firmware_blob@PLT
	test	rax, rax
	je	.L8
	mov	edi, DWORD PTR ql_log_fatal[rip]
	lea	rcx, .LC6[rip]
	mov	edx, 164
	mov	rsi, rbp
	call	ql_log@PLT
	mov	eax, DWORD PTR QLA_FUNCTION_FAILED[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, DWORD PTR ql_log_info[rip]
	mov	rsi, rbp
	mov	edx, 165
	lea	rcx, .LC7[rip]
	call	ql_log@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR QLA_SUCCESS[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	edi, DWORD PTR ql_log_fatal[rip]
	lea	rcx, .LC5[rip]
	mov	edx, 163
	mov	rsi, rbp
	call	ql_log@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edi, DWORD PTR ql_log_info[rip]
	lea	rcx, .LC2[rip]
	mov	edx, 161
	mov	rsi, rbp
	call	ql_log@PLT
	mov	eax, DWORD PTR QLA_SUCCESS[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	qla82xx_load_fw, .-qla82xx_load_fw
	.comm	ql_log_warn,4,4
	.comm	ql_log_info,4,4
	.comm	ql_log_fatal,4,4
	.comm	ql2xfwloadbin,4,4
	.comm	QLA_SUCCESS,8,8
	.comm	QLA_FUNCTION_FAILED,4,4
	.comm	QLA82XX_UNIFIED_ROMIMAGE,4,4
	.comm	QLA82XX_ROMUSB_GLB_SW_RESET,4,4
	.comm	QLA82XX_FLASH_ROMIMAGE,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_load_fw.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Error during CRB initialization.\012\000"
	.align	2
.LC1:
	.ascii	"Attempting to load firmware from flash.\012\000"
	.align	2
.LC2:
	.ascii	"Firmware loaded successfully from flash.\012\000"
	.align	2
.LC3:
	.ascii	"Firmware load from flash failed.\012\000"
	.align	2
.LC4:
	.ascii	"Attempting to load firmware from blob.\012\000"
	.align	2
.LC5:
	.ascii	"Firmware image not present.\012\000"
	.align	2
.LC6:
	.ascii	"No valid firmware image found.\012\000"
	.align	2
.LC7:
	.ascii	"Firmware loaded successfully from binary blob.\012\000"
	.align	2
.LC8:
	.ascii	"Firmware load failed for binary blob.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qla82xx_load_fw, %function
qla82xx_load_fw:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r6, [r0]
	bl	qla82xx_pinit_from_rom
	ldr	r7, .L25
	ldr	r3, [r7]
	cmp	r0, r3
	beq	.L2
	ldr	r3, .L25+4
	mov	r1, r4
	mov	r2, #159
	ldr	r0, [r3]
	ldr	r3, .L25+8
	bl	ql_log
	ldr	r3, .L25+12
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r5, .L25+16
	mov	r0, #500
	bl	udelay
	ldr	r1, [r5]
	mov	r0, r6
	bl	qla82xx_rd_32
	ldr	r1, [r5]
	bic	r2, r0, #285212672
	mov	r0, r6
	bl	qla82xx_wr_32
	ldr	r3, .L25+20
	ldr	r8, .L25+24
	ldr	r3, [r3]
	cmp	r3, #2
	beq	.L4
	ldr	r3, .L25+28
	mov	r2, #160
	mov	r1, r4
	ldr	r0, [r8]
	bl	ql_log
	mov	r0, r6
	bl	qla82xx_fw_load_from_flash
	ldr	r3, [r7]
	cmp	r0, r3
	beq	.L21
	ldr	r2, .L25+32
	mov	r1, r4
	ldr	r0, [r2]
	ldr	r3, .L25+36
	mov	r2, #264
	bl	ql_log
.L4:
	mov	r2, #162
	mov	r1, r4
	ldr	r3, .L25+40
	ldr	r0, [r8]
	bl	ql_log
	mov	r0, r4
	bl	qla2x00_request_firmware
	cmp	r0, #0
	mov	r5, r0
	str	r0, [r6]
	beq	.L22
	ldr	r3, .L25+44
	mov	r0, r4
	ldr	r1, [r3]
	bl	qla82xx_validate_firmware_blob
	cmp	r0, #0
	bne	.L23
.L8:
	mov	r0, r6
	bl	qla82xx_fw_load_from_blob
	ldr	r3, [r7]
	cmp	r0, r3
	beq	.L24
	ldr	r3, .L25+4
	mov	r1, r4
	ldr	r0, [r3]
	mov	r2, #166
	ldr	r3, .L25+48
	bl	ql_log
	mov	r3, #0
	str	r3, [r5]
.L7:
	ldr	r3, .L25+12
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L23:
	ldr	r3, .L25+52
	mov	r0, r4
	ldr	r1, [r3]
	bl	qla82xx_validate_firmware_blob
	cmp	r0, #0
	beq	.L8
	ldr	r3, .L25+4
	mov	r1, r4
	mov	r2, #164
	ldr	r0, [r3]
	ldr	r3, .L25+56
	bl	ql_log
	ldr	r3, .L25+12
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L24:
	mov	r1, r4
	mov	r2, #165
	ldr	r0, [r8]
	ldr	r3, .L25+60
	bl	ql_log
	ldr	r0, [r7]
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	ldr	r3, .L25+4
	mov	r1, r4
	mov	r2, #163
	ldr	r0, [r3]
	ldr	r3, .L25+64
	bl	ql_log
	b	.L7
.L21:
	mov	r1, r4
	mov	r2, #161
	ldr	r0, [r8]
	ldr	r3, .L25+68
	bl	ql_log
	ldr	r0, [r7]
	pop	{r4, r5, r6, r7, r8, pc}
.L26:
	.align	2
.L25:
	.word	QLA_SUCCESS
	.word	ql_log_fatal
	.word	.LC0
	.word	QLA_FUNCTION_FAILED
	.word	QLA82XX_ROMUSB_GLB_SW_RESET
	.word	ql2xfwloadbin
	.word	ql_log_info
	.word	.LC1
	.word	ql_log_warn
	.word	.LC3
	.word	.LC4
	.word	QLA82XX_FLASH_ROMIMAGE
	.word	.LC8
	.word	QLA82XX_UNIFIED_ROMIMAGE
	.word	.LC6
	.word	.LC7
	.word	.LC5
	.word	.LC2
	.size	qla82xx_load_fw, .-qla82xx_load_fw
	.comm	ql_log_warn,4,4
	.comm	ql_log_info,4,4
	.comm	ql_log_fatal,4,4
	.comm	ql2xfwloadbin,4,4
	.comm	QLA_SUCCESS,4,4
	.comm	QLA_FUNCTION_FAILED,4,4
	.comm	QLA82XX_UNIFIED_ROMIMAGE,4,4
	.comm	QLA82XX_ROMUSB_GLB_SW_RESET,4,4
	.comm	QLA82XX_FLASH_ROMIMAGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
