	.file	"extr_nand_micron.c_micron_nand_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"On-die ECC forcefully enabled, not supported\n"
	.align 8
.LC1:
	.string	"On-die ECC selected but not supported\n"
	.text
	.p2align 4
	.type	micron_nand_init, @function
micron_nand_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	call	nand_to_mtd@PLT
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, 16
	mov	r14, rax
	call	kzalloc@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	test	rax, rax
	je	.L1
	mov	rsi, rax
	mov	rdi, rbx
	mov	rbp, rax
	call	nand_set_manufacturer_data@PLT
	mov	rdi, rbx
	call	micron_nand_onfi_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L4
	cmp	DWORD PTR [r14], 2048
	jne	.L5
	mov	eax, DWORD PTR NAND_BBM_FIRSTPAGE[rip]
	or	eax, DWORD PTR NAND_BBM_SECONDPAGE[rip]
	or	DWORD PTR [rbx], eax
.L5:
	mov	rdi, rbx
	call	micron_supports_on_die_ecc@PLT
	mov	r13d, eax
	cmp	DWORD PTR MICRON_ON_DIE_MANDATORY[rip], r13d
	mov	rax, QWORD PTR NAND_ECC_ON_DIE[rip]
	je	.L20
	cmp	QWORD PTR 8[rbx], rax
	je	.L21
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rbp]
.L8:
	call	kfree@PLT
	mov	rdi, rbp
	call	kfree@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	cmp	QWORD PTR 8[rbx], rax
	jne	.L22
	cmp	r13d, DWORD PTR MICRON_ON_DIE_UNSUPPORTED[rip]
	jne	.L23
.L14:
	lea	rdi, .LC1[rip]
	call	pr_err@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	mov	rdi, QWORD PTR 8[rbp]
	neg	r12d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	lea	rdi, .LC0[rip]
	call	pr_err@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	mov	rdi, QWORD PTR 8[rbp]
	neg	r12d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	cmp	r13d, DWORD PTR MICRON_ON_DIE_UNSUPPORTED[rip]
	je	.L14
.L16:
	cmp	DWORD PTR 48[rbx], 4
	je	.L24
.L10:
	lea	rsi, micron_nand_on_die_8_ooblayout_ops[rip]
	mov	rdi, r14
	call	mtd_set_ooblayout@PLT
.L12:
	mov	eax, DWORD PTR 48[rbx]
	cmp	DWORD PTR MICRON_ON_DIE_MANDATORY[rip], r13d
	mov	DWORD PTR 20[rbx], 512
	lea	edx, [rax+rax]
	mov	DWORD PTR 24[rbx], eax
	mov	eax, DWORD PTR NAND_ECC_BCH[rip]
	mov	DWORD PTR 16[rbx], edx
	mov	DWORD PTR 44[rbx], eax
	mov	eax, DWORD PTR micron_nand_read_page_on_die_ecc[rip]
	mov	DWORD PTR 40[rbx], eax
	mov	eax, DWORD PTR micron_nand_write_page_on_die_ecc[rip]
	mov	DWORD PTR 36[rbx], eax
	je	.L25
	mov	eax, DWORD PTR nand_read_page_raw[rip]
	mov	DWORD PTR 32[rbx], eax
	mov	eax, DWORD PTR nand_write_page_raw[rip]
	mov	DWORD PTR 28[rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	movabs	rax, 4294967297
	mov	QWORD PTR 0[rbp], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L25:
	mov	eax, DWORD PTR nand_read_page_raw_notsupp[rip]
	mov	DWORD PTR 32[rbx], eax
	mov	eax, DWORD PTR nand_write_page_raw_notsupp[rip]
	mov	DWORD PTR 28[rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L24:
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	movsx	rdi, DWORD PTR [r14]
	add	rdi, QWORD PTR 8[r14]
	call	kmalloc@PLT
	mov	QWORD PTR 8[rbp], rax
	mov	rdi, rax
	test	rax, rax
	je	.L26
	cmp	DWORD PTR 48[rbx], 4
	jne	.L10
	lea	rsi, micron_nand_on_die_4_ooblayout_ops[rip]
	mov	rdi, r14
	call	mtd_set_ooblayout@PLT
	jmp	.L12
.L26:
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	micron_nand_init, .-micron_nand_init
	.comm	nand_write_page_raw_notsupp,4,4
	.comm	nand_write_page_raw,4,4
	.comm	nand_read_page_raw_notsupp,4,4
	.comm	nand_read_page_raw,4,4
	.comm	micron_nand_write_page_on_die_ecc,4,4
	.comm	micron_nand_read_page_on_die_ecc,4,4
	.comm	micron_nand_on_die_8_ooblayout_ops,4,4
	.comm	micron_nand_on_die_4_ooblayout_ops,4,4
	.comm	NAND_ECC_ON_DIE,8,8
	.comm	NAND_ECC_BCH,4,4
	.comm	NAND_BBM_SECONDPAGE,4,4
	.comm	NAND_BBM_FIRSTPAGE,4,4
	.comm	MICRON_ON_DIE_UNSUPPORTED,4,4
	.comm	MICRON_ON_DIE_MANDATORY,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_nand_micron.c_micron_nand_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"On-die ECC forcefully enabled, not supported\012\000"
	.align	2
.LC1:
	.ascii	"On-die ECC selected but not supported\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	micron_nand_init, %function
micron_nand_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	bl	nand_to_mtd
	ldr	r8, .L26
	mov	r9, r0
	ldr	r1, [r8]
	mov	r0, #12
	bl	kzalloc
	subs	r5, r0, #0
	beq	.L21
	mov	r1, r5
	mov	r0, r4
	bl	nand_set_manufacturer_data
	mov	r0, r4
	bl	micron_nand_onfi_init
	subs	r7, r0, #0
	bne	.L4
	ldr	r3, [r9]
	cmp	r3, #2048
	bne	.L5
	ldr	r3, .L26+4
	ldr	r2, .L26+8
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r3, [r4]
	orr	r2, r2, r1
	orr	r3, r3, r2
	str	r3, [r4]
.L5:
	mov	r0, r4
	bl	micron_supports_on_die_ecc
	ldr	r10, .L26+12
	mov	r6, r0
	ldr	r3, [r10]
	ldr	r2, [r4, #4]
	cmp	r3, r0
	ldr	r3, .L26+16
	ldr	r3, [r3]
	beq	.L22
	cmp	r2, r3
	bne	.L1
	ldr	r3, .L26+20
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L14
.L16:
	ldr	r3, [r4, #40]
	cmp	r3, #4
	beq	.L23
.L10:
	mov	r0, r9
	ldr	r1, .L26+24
	bl	mtd_set_ooblayout
.L12:
	mov	r2, #512
	ldr	r0, .L26+28
	ldr	r3, [r10]
	ldr	r1, .L26+32
	ldr	ip, [r0]
	ldr	r0, .L26+36
	cmp	r3, r6
	ldr	r1, [r1]
	ldr	r3, [r4, #40]
	ldr	r0, [r0]
	str	r3, [r4, #16]
	str	r2, [r4, #12]
	str	r1, [r4, #32]
	ldreq	r2, .L26+40
	lsl	r1, r3, #1
	ldrne	r2, .L26+44
	ldreq	r3, .L26+48
	ldrne	r3, .L26+52
	str	r0, [r4, #28]
	str	ip, [r4, #36]
	str	r1, [r4, #8]
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, r7
	str	r2, [r4, #24]
	str	r3, [r4, #20]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	ldr	r0, [r5, #8]
.L8:
	bl	kfree
	mov	r0, r5
	bl	kfree
.L1:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L21:
	ldr	r3, .L26+56
	ldr	r0, [r3]
	rsb	r7, r0, #0
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	cmp	r2, r3
	ldrne	r0, .L26+60
	bne	.L19
	ldr	r3, .L26+20
	ldr	r3, [r3]
	cmp	r6, r3
	bne	.L24
.L14:
	ldr	r0, .L26+64
.L19:
	bl	pr_err
	ldr	r3, .L26+68
	ldr	r0, [r5, #8]
	ldr	r7, [r3]
	rsb	r7, r7, #0
	b	.L8
.L24:
	mov	r3, #1
	str	r3, [r5]
	str	r3, [r5, #4]
	b	.L16
.L23:
	ldm	r9, {r0, r3}
	ldr	r1, [r8]
	add	r0, r0, r3
	bl	kmalloc
	cmp	r0, #0
	str	r0, [r5, #8]
	beq	.L25
	ldr	r3, [r4, #40]
	cmp	r3, #4
	bne	.L10
	mov	r0, r9
	ldr	r1, .L26+72
	bl	mtd_set_ooblayout
	b	.L12
.L25:
	ldr	r3, .L26+56
	ldr	r7, [r3]
	rsb	r7, r7, #0
	b	.L8
.L27:
	.align	2
.L26:
	.word	GFP_KERNEL
	.word	NAND_BBM_SECONDPAGE
	.word	NAND_BBM_FIRSTPAGE
	.word	MICRON_ON_DIE_MANDATORY
	.word	NAND_ECC_ON_DIE
	.word	MICRON_ON_DIE_UNSUPPORTED
	.word	micron_nand_on_die_8_ooblayout_ops
	.word	NAND_ECC_BCH
	.word	micron_nand_read_page_on_die_ecc
	.word	micron_nand_write_page_on_die_ecc
	.word	nand_read_page_raw_notsupp
	.word	nand_read_page_raw
	.word	nand_write_page_raw_notsupp
	.word	nand_write_page_raw
	.word	ENOMEM
	.word	.LC0
	.word	.LC1
	.word	EINVAL
	.word	micron_nand_on_die_4_ooblayout_ops
	.size	micron_nand_init, .-micron_nand_init
	.comm	nand_write_page_raw_notsupp,4,4
	.comm	nand_write_page_raw,4,4
	.comm	nand_read_page_raw_notsupp,4,4
	.comm	nand_read_page_raw,4,4
	.comm	micron_nand_write_page_on_die_ecc,4,4
	.comm	micron_nand_read_page_on_die_ecc,4,4
	.comm	micron_nand_on_die_8_ooblayout_ops,4,4
	.comm	micron_nand_on_die_4_ooblayout_ops,4,4
	.comm	NAND_ECC_ON_DIE,4,4
	.comm	NAND_ECC_BCH,4,4
	.comm	NAND_BBM_SECONDPAGE,4,4
	.comm	NAND_BBM_FIRSTPAGE,4,4
	.comm	MICRON_ON_DIE_UNSUPPORTED,4,4
	.comm	MICRON_ON_DIE_MANDATORY,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
