	.file	"extr_spi-bcm-qspi.c_bcm_qspi_bspi_exec_mem_op.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"bspi xfr addr 0x%x len 0x%x"
.LC1:
	.string	"timeout waiting for BSPI\n"
	.text
	.p2align 4
	.type	bcm_qspi_bspi_exec_mem_op, @function
bcm_qspi_bspi_exec_mem_op:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rsi
	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, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR 4[rdi]
	mov	QWORD PTR [rsp], rsi
	call	spi_master_get_devdata@PLT
	mov	edi, 100
	mov	rbx, rax
	call	msecs_to_jiffies@PLT
	mov	rdi, rbx
	mov	r14, QWORD PTR 24[rbx]
	mov	QWORD PTR 8[rsp], rax
	call	bcm_qspi_bspi_ver_three@PLT
	test	eax, eax
	je	.L2
	mov	r12d, DWORD PTR EIO[rip]
	mov	rax, QWORD PTR BSPI_ADDRLEN_4BYTES[rip]
	neg	r12d
	cmp	QWORD PTR 8[r15], rax
	je	.L1
.L2:
	mov	rax, QWORD PTR [rsp]
	mov	esi, DWORD PTR 0[rbp]
	mov	rdi, rbx
	mov	r13d, DWORD PTR 16[rax]
	call	bcm_qspi_chip_select@PLT
	mov	edx, DWORD PTR MSPI_WRITE_LOCK[rip]
	xor	ecx, ecx
	mov	rdi, rbx
	mov	esi, DWORD PTR MSPI[rip]
	call	bcm_qspi_write@PLT
	mov	rdi, rbx
	call	bcm_qspi_bspi_ver_three@PLT
	test	eax, eax
	je	.L16
.L4:
	mov	eax, DWORD PTR 56[rbx]
	test	eax, eax
	jne	.L17
.L5:
	mov	rdi, rbx
	lea	r15, 16[rbx]
	call	bcm_qspi_bspi_ver_three@PLT
	mov	r8d, eax
	lea	eax, 12582912[r13]
	and	eax, 16777215
	cmp	r8d, 1
	cmove	r13d, eax
	mov	rax, QWORD PTR [rsp]
	mov	r12d, DWORD PTR [rax]
	mov	QWORD PTR 48[rbx], 0
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	add	r13d, ebp
	sub	r12d, ebp
	je	.L1
.L9:
	mov	rdi, r15
	cmp	DWORD PTR BSPI_READ_LENGTH[rip], r12d
	mov	ebp, r12d
	cmovle	ebp, DWORD PTR BSPI_READ_LENGTH[rip]
	call	reinit_completion@PLT
	mov	rdi, rbx
	call	bcm_qspi_enable_bspi@PLT
	mov	rax, QWORD PTR [rsp]
	mov	DWORD PTR [rbx], ebp
	mov	ecx, ebp
	mov	QWORD PTR 32[rbx], 0
	mov	rdi, QWORD PTR 8[rbx]
	mov	edx, r13d
	lea	rsi, .LC0[rip]
	mov	QWORD PTR 40[rbx], rax
	call	dev_dbg@PLT
	mov	edx, DWORD PTR BSPI_RAF_START_ADDR[rip]
	mov	ecx, r13d
	mov	rdi, rbx
	mov	esi, DWORD PTR BSPI[rip]
	call	bcm_qspi_write@PLT
	mov	edx, DWORD PTR BSPI_RAF_NUM_WORDS[rip]
	lea	ecx, 3[rbp]
	mov	rdi, rbx
	mov	esi, DWORD PTR BSPI[rip]
	sar	ecx, 2
	call	bcm_qspi_write@PLT
	mov	edx, DWORD PTR BSPI_RAF_WATERMARK[rip]
	xor	ecx, ecx
	mov	rdi, rbx
	mov	esi, DWORD PTR BSPI[rip]
	call	bcm_qspi_write@PLT
	cmp	QWORD PTR 24[rbx], 0
	je	.L7
	mov	esi, DWORD PTR MSPI_BSPI_DONE[rip]
	mov	rdi, r14
	call	[QWORD PTR 8[r14]]
	mov	esi, DWORD PTR BSPI_DONE[rip]
	mov	edx, 1
	mov	rdi, r14
	call	[QWORD PTR [r14]]
.L7:
	xor	eax, eax
	call	mb@PLT
	mov	rdi, rbx
	call	bcm_qspi_bspi_lr_start@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, r15
	call	wait_for_completion_timeout@PLT
	test	eax, eax
	jne	.L8
	mov	rdi, QWORD PTR 8[rbx]
	lea	rsi, .LC1[rip]
	call	dev_err@PLT
	mov	r12d, DWORD PTR ETIMEDOUT[rip]
	neg	r12d
.L1:
	add	rsp, 24
	.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
.L17:
	.cfi_restore_state
	and	r13d, 16777215
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	mov	ecx, r13d
	mov	edx, DWORD PTR BSPI_BSPI_FLASH_UPPER_ADDR_BYTE[rip]
	mov	esi, DWORD PTR BSPI[rip]
	mov	rdi, rbx
	and	ecx, -16777216
	call	bcm_qspi_write@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	bcm_qspi_bspi_exec_mem_op, .-bcm_qspi_bspi_exec_mem_op
	.comm	MSPI_WRITE_LOCK,4,4
	.comm	MSPI_BSPI_DONE,4,4
	.comm	MSPI,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EIO,4,4
	.comm	BSPI_READ_LENGTH,4,4
	.comm	BSPI_RAF_WATERMARK,4,4
	.comm	BSPI_RAF_START_ADDR,4,4
	.comm	BSPI_RAF_NUM_WORDS,4,4
	.comm	BSPI_DONE,4,4
	.comm	BSPI_BSPI_FLASH_UPPER_ADDR_BYTE,4,4
	.comm	BSPI_ADDRLEN_4BYTES,8,8
	.comm	BSPI,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_spi-bcm-qspi.c_bcm_qspi_bspi_exec_mem_op.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"bspi xfr addr 0x%x len 0x%x\000"
	.align	2
.LC1:
	.ascii	"timeout waiting for BSPI\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bcm_qspi_bspi_exec_mem_op, %function
bcm_qspi_bspi_exec_mem_op:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	sub	sp, sp, #12
	ldr	r0, [r0, #4]
	mov	r6, r1
	str	r1, [sp]
	bl	spi_master_get_devdata
	mov	r4, r0
	mov	r0, #100
	bl	msecs_to_jiffies
	mov	r3, r0
	mov	r0, r4
	ldr	r10, [r4, #12]
	str	r3, [sp, #4]
	bl	bcm_qspi_bspi_ver_three
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L25
	ldr	r2, [r6, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L24
.L2:
	ldr	r3, [sp]
	ldr	r1, [r5]
	mov	r0, r4
	ldr	r7, [r3, #8]
	bl	bcm_qspi_chip_select
	ldr	r3, .L25+4
	ldr	r2, .L25+8
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r3, #0
	mov	r0, r4
	bl	bcm_qspi_write
	mov	r0, r4
	bl	bcm_qspi_bspi_ver_three
	cmp	r0, #0
	beq	.L21
	ldr	r8, .L25+12
.L4:
	ldr	r3, [r4, #28]
	mov	r0, r4
	cmp	r3, #0
	bicne	r7, r7, #-16777216
	bl	bcm_qspi_bspi_ver_three
	mov	r3, #0
	cmp	r0, #1
	ldr	r2, [sp]
	addeq	r7, r7, #12582912
	ldr	r6, [r2]
	biceq	r7, r7, #-16777216
	str	r3, [r4, #24]
	add	fp, r4, #8
	b	.L9
.L8:
	subs	r6, r6, r5
	beq	.L1
.L9:
	ldr	r3, .L25+16
	mov	r9, #0
	ldr	r5, [r3]
	mov	r0, fp
	cmp	r6, r5
	movlt	r5, r6
	bl	reinit_completion
	mov	r0, r4
	bl	bcm_qspi_enable_bspi
	ldr	r3, [sp]
	mov	r2, r7
	ldr	r1, .L25+20
	str	r3, [r4, #20]
	ldr	r0, [r4, #4]
	mov	r3, r5
	str	r5, [r4]
	str	r9, [r4, #16]
	bl	dev_dbg
	ldr	r2, .L25+24
	mov	r3, r7
	ldr	r2, [r2]
	ldr	r1, [r8]
	mov	r0, r4
	bl	bcm_qspi_write
	ldr	r2, .L25+28
	add	r3, r5, #3
	ldr	r2, [r2]
	ldr	r1, [r8]
	asr	r3, r3, #2
	mov	r0, r4
	bl	bcm_qspi_write
	ldr	r2, .L25+32
	mov	r3, r9
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r8]
	bl	bcm_qspi_write
	ldr	r3, [r4, #12]
	add	r7, r7, r5
	cmp	r3, r9
	beq	.L7
	ldr	r2, .L25+36
	ldr	r3, [r10, #4]
	ldr	r1, [r2]
	mov	r0, r10
	blx	r3
	ldr	r1, .L25+40
	mov	r2, #1
	mov	r0, r10
	ldr	r3, [r10]
	ldr	r1, [r1]
	blx	r3
.L7:
	bl	mb
	mov	r0, r4
	bl	bcm_qspi_bspi_lr_start
	mov	r0, fp
	ldr	r1, [sp, #4]
	bl	wait_for_completion_timeout
	cmp	r0, #0
	bne	.L8
	ldr	r0, [r4, #4]
	ldr	r1, .L25+44
	bl	dev_err
	ldr	r3, .L25+48
	ldr	r6, [r3]
	rsb	r6, r6, #0
.L1:
	mov	r0, r6
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	ldr	r3, .L25+52
	ldr	r8, .L25+12
	ldr	r2, [r3]
	mov	r0, r4
	ldr	r1, [r8]
	and	r3, r7, #-16777216
	bl	bcm_qspi_write
	b	.L4
.L24:
	ldr	r3, .L25+56
	ldr	r6, [r3]
	rsb	r6, r6, #0
	mov	r0, r6
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	.align	2
.L25:
	.word	BSPI_ADDRLEN_4BYTES
	.word	MSPI
	.word	MSPI_WRITE_LOCK
	.word	BSPI
	.word	BSPI_READ_LENGTH
	.word	.LC0
	.word	BSPI_RAF_START_ADDR
	.word	BSPI_RAF_NUM_WORDS
	.word	BSPI_RAF_WATERMARK
	.word	MSPI_BSPI_DONE
	.word	BSPI_DONE
	.word	.LC1
	.word	ETIMEDOUT
	.word	BSPI_BSPI_FLASH_UPPER_ADDR_BYTE
	.word	EIO
	.size	bcm_qspi_bspi_exec_mem_op, .-bcm_qspi_bspi_exec_mem_op
	.comm	MSPI_WRITE_LOCK,4,4
	.comm	MSPI_BSPI_DONE,4,4
	.comm	MSPI,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EIO,4,4
	.comm	BSPI_READ_LENGTH,4,4
	.comm	BSPI_RAF_WATERMARK,4,4
	.comm	BSPI_RAF_START_ADDR,4,4
	.comm	BSPI_RAF_NUM_WORDS,4,4
	.comm	BSPI_DONE,4,4
	.comm	BSPI_BSPI_FLASH_UPPER_ADDR_BYTE,4,4
	.comm	BSPI_ADDRLEN_4BYTES,4,4
	.comm	BSPI,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
