	.file	"extr_brcmnand.c_brcmnand_waitfunc.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"wait on native cmd %d\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"timeout waiting for command %#02x\n"
	.section	.rodata.str1.1
.LC2:
	.string	"intfc status %08x\n"
	.text
	.p2align 4
	.type	brcmnand_waitfunc, @function
brcmnand_waitfunc:
.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, 8
	.cfi_def_cfa_offset 32
	call	nand_get_controller_data@PLT
	lea	rsi, .LC0[rip]
	mov	rbp, QWORD PTR [rax]
	mov	edi, DWORD PTR 8[rbp]
	mov	rdx, QWORD PTR 0[rbp]
	call	dev_dbg@PLT
	cmp	QWORD PTR 0[rbp], 0
	jne	.L10
.L3:
	mov	QWORD PTR 0[rbp], 0
	mov	esi, DWORD PTR BRCMNAND_INTFC_STATUS[rip]
	mov	rdi, rbp
	call	brcmnand_read_reg@PLT
	and	eax, DWORD PTR INTFC_FLASH_STATUS[rip]
	add	rsp, 8
	.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
.L10:
	.cfi_restore_state
	mov	rdi, r12
	call	brcmstb_nand_wait_for_completion@PLT
	test	eax, eax
	je	.L3
	mov	esi, DWORD PTR BRCMNAND_CMD_START[rip]
	mov	rdi, rbp
	call	brcmnand_read_reg@PLT
	mov	rdi, rbp
	mov	r12d, eax
	call	brcmnand_cmd_shift@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	mov	ecx, eax
	sar	edx, cl
	call	dev_err_ratelimited@PLT
	mov	esi, DWORD PTR BRCMNAND_INTFC_STATUS[rip]
	mov	rdi, rbp
	call	brcmnand_read_reg@PLT
	mov	edi, DWORD PTR 8[rbp]
	lea	rsi, .LC2[rip]
	mov	edx, eax
	call	dev_err_ratelimited@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	brcmnand_waitfunc, .-brcmnand_waitfunc
	.comm	INTFC_FLASH_STATUS,4,4
	.comm	BRCMNAND_INTFC_STATUS,4,4
	.comm	BRCMNAND_CMD_START,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_brcmnand.c_brcmnand_waitfunc.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"wait on native cmd %d\012\000"
	.align	2
.LC1:
	.ascii	"timeout waiting for command %#02x\012\000"
	.align	2
.LC2:
	.ascii	"intfc status %08x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	brcmnand_waitfunc, %function
brcmnand_waitfunc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	bl	nand_get_controller_data
	ldr	r4, [r0]
	ldr	r1, .L11
	ldr	r2, [r4]
	ldr	r0, [r4, #4]
	bl	dev_dbg
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L2
.L9:
	ldr	r5, .L11+4
.L3:
	mov	r3, #0
	ldr	r1, [r5]
	mov	r0, r4
	str	r3, [r4]
	bl	brcmnand_read_reg
	ldr	r3, .L11+8
	ldr	r3, [r3]
	and	r0, r0, r3
	pop	{r4, r5, r6, pc}
.L2:
	mov	r0, r5
	bl	brcmstb_nand_wait_for_completion
	cmp	r0, #0
	beq	.L9
	ldr	r3, .L11+12
	mov	r0, r4
	ldr	r1, [r3]
	bl	brcmnand_read_reg
	mov	r5, r0
	mov	r0, r4
	bl	brcmnand_cmd_shift
	asr	r2, r5, r0
	ldr	r5, .L11+4
	ldr	r1, .L11+16
	ldr	r0, [r4, #4]
	bl	dev_err_ratelimited
	ldr	r1, [r5]
	mov	r0, r4
	ldr	r6, [r4, #4]
	bl	brcmnand_read_reg
	ldr	r1, .L11+20
	mov	r2, r0
	mov	r0, r6
	bl	dev_err_ratelimited
	b	.L3
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	BRCMNAND_INTFC_STATUS
	.word	INTFC_FLASH_STATUS
	.word	BRCMNAND_CMD_START
	.word	.LC1
	.word	.LC2
	.size	brcmnand_waitfunc, .-brcmnand_waitfunc
	.comm	INTFC_FLASH_STATUS,4,4
	.comm	BRCMNAND_INTFC_STATUS,4,4
	.comm	BRCMNAND_CMD_START,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
