	.file	"extr_s3c2410.c_s3c2410_nand_attach_chip.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ECC disabled\n"
.LC1:
	.string	"soft ECC\n"
.LC2:
	.string	"chip %p => page shift %d\n"
.LC3:
	.string	"hardware ECC\n"
.LC4:
	.string	"invalid ECC mode!\n"
	.text
	.p2align 4
	.type	s3c2410_nand_attach_chip, @function
s3c2410_nand_attach_chip:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	nand_to_mtd@PLT
	mov	rdi, rax
	call	s3c2410_nand_mtd_toinfo@PLT
	mov	rbp, rax
	mov	eax, DWORD PTR 16[rbx]
	cmp	eax, 132
	je	.L2
	cmp	eax, 133
	je	.L3
	cmp	eax, 131
	je	.L20
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC4[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC0[rip]
	call	dev_info@PLT
.L6:
	mov	eax, DWORD PTR 4[rbx]
	and	eax, DWORD PTR NAND_BBT_USE_FLASH[rip]
	je	.L1
	mov	eax, DWORD PTR NAND_SKIP_BBTSCAN[rip]
	or	DWORD PTR 8[rbx], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	mov	eax, DWORD PTR NAND_ECC_HAMMING[rip]
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC1[rip]
	mov	DWORD PTR 48[rbx], eax
	call	dev_info@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR s3c2410_nand_calculate_ecc[rip]
	mov	DWORD PTR 20[rbx], 1
	mov	QWORD PTR 32[rbx], rax
	mov	eax, DWORD PTR s3c2410_nand_correct_data[rip]
	mov	DWORD PTR 44[rbx], eax
	mov	eax, DWORD PTR 4[rbp]
	cmp	eax, 129
	je	.L7
	cmp	eax, 130
	je	.L8
	cmp	eax, 128
	je	.L21
.L10:
	mov	ecx, DWORD PTR [rbx]
	mov	edi, DWORD PTR 0[rbp]
	mov	rdx, rbx
	lea	rsi, .LC2[rip]
	call	dev_dbg@PLT
	cmp	DWORD PTR [rbx], 10
	jle	.L11
	movabs	rax, 12884902144
	mov	QWORD PTR 24[rbx], rax
.L12:
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC3[rip]
	call	dev_info@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	eax, DWORD PTR s3c2440_nand_enable_hwecc[rip]
	mov	DWORD PTR 40[rbx], eax
	mov	rax, QWORD PTR s3c2440_nand_calculate_ecc[rip]
	mov	QWORD PTR 32[rbx], rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	mov	eax, DWORD PTR s3c2410_nand_enable_hwecc[rip]
	mov	DWORD PTR 40[rbx], eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movabs	rax, 12884902400
	mov	rdi, rbx
	mov	QWORD PTR 24[rbx], rax
	call	nand_to_mtd@PLT
	lea	rsi, s3c2410_ooblayout_ops[rip]
	mov	rdi, rax
	call	mtd_set_ooblayout@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR s3c2412_nand_enable_hwecc[rip]
	mov	DWORD PTR 40[rbx], eax
	mov	rax, QWORD PTR s3c2412_nand_calculate_ecc[rip]
	mov	QWORD PTR 32[rbx], rax
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	s3c2410_nand_attach_chip, .-s3c2410_nand_attach_chip
	.comm	s3c2440_nand_enable_hwecc,4,4
	.comm	s3c2440_nand_calculate_ecc,8,8
	.comm	s3c2412_nand_enable_hwecc,4,4
	.comm	s3c2412_nand_calculate_ecc,8,8
	.comm	s3c2410_ooblayout_ops,4,4
	.comm	s3c2410_nand_enable_hwecc,4,4
	.comm	s3c2410_nand_correct_data,4,4
	.comm	s3c2410_nand_calculate_ecc,8,8
	.comm	NAND_SKIP_BBTSCAN,4,4
	.comm	NAND_ECC_HAMMING,4,4
	.comm	NAND_BBT_USE_FLASH,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_s3c2410.c_s3c2410_nand_attach_chip.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ECC disabled\012\000"
	.align	2
.LC1:
	.ascii	"soft ECC\012\000"
	.align	2
.LC2:
	.ascii	"chip %p => page shift %d\012\000"
	.align	2
.LC3:
	.ascii	"hardware ECC\012\000"
	.align	2
.LC4:
	.ascii	"invalid ECC mode!\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	s3c2410_nand_attach_chip, %function
s3c2410_nand_attach_chip:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	bl	nand_to_mtd
	bl	s3c2410_nand_mtd_toinfo
	ldr	r3, [r4, #12]
	mov	r5, r0
	cmp	r3, #132
	beq	.L2
	cmp	r3, #133
	beq	.L3
	cmp	r3, #131
	beq	.L20
	ldr	r1, .L22
	ldr	r0, [r0]
	bl	dev_err
	ldr	r3, .L22+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r0, [r0]
	ldr	r1, .L22+8
	bl	dev_info
.L6:
	ldr	r3, .L22+12
	ldr	r0, [r4, #4]
	ldr	r3, [r3]
	ands	r0, r0, r3
	popeq	{r4, r5, r6, pc}
	ldr	r2, .L22+16
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	mov	r0, #0
	orr	r3, r3, r2
	str	r3, [r4, #8]
	pop	{r4, r5, r6, pc}
.L20:
	ldr	r3, .L22+20
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r1, .L22+24
	str	r3, [r4, #40]
	bl	dev_info
	b	.L6
.L3:
	mov	r2, #1
	ldr	r0, .L22+28
	ldr	r1, .L22+32
	ldr	r3, [r5, #4]
	ldr	r0, [r0]
	ldr	r1, [r1]
	cmp	r3, #129
	str	r0, [r4, #28]
	str	r1, [r4, #36]
	str	r2, [r4, #16]
	beq	.L7
	cmp	r3, #130
	beq	.L8
	cmp	r3, #128
	beq	.L21
.L10:
	ldr	r3, [r4]
	mov	r2, r4
	ldr	r1, .L22+36
	ldr	r0, [r5]
	bl	dev_dbg
	ldr	r3, [r4]
	cmp	r3, #10
	ble	.L11
	mov	r2, #256
	mov	r3, #3
	str	r2, [r4, #20]
	str	r3, [r4, #24]
.L12:
	ldr	r0, [r5]
	ldr	r1, .L22+40
	bl	dev_info
	b	.L6
.L21:
	ldr	r2, .L22+44
	ldr	r3, .L22+48
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r4, #32]
	str	r3, [r4, #28]
	b	.L10
.L8:
	ldr	r3, .L22+52
	ldr	r3, [r3]
	str	r3, [r4, #32]
	b	.L10
.L11:
	mov	r2, #512
	mov	r3, #3
	mov	r0, r4
	str	r2, [r4, #20]
	str	r3, [r4, #24]
	bl	nand_to_mtd
	ldr	r1, .L22+56
	bl	mtd_set_ooblayout
	b	.L12
.L7:
	ldr	r2, .L22+60
	ldr	r3, .L22+64
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r4, #32]
	str	r3, [r4, #28]
	b	.L10
.L23:
	.align	2
.L22:
	.word	.LC4
	.word	EINVAL
	.word	.LC0
	.word	NAND_BBT_USE_FLASH
	.word	NAND_SKIP_BBTSCAN
	.word	NAND_ECC_HAMMING
	.word	.LC1
	.word	s3c2410_nand_calculate_ecc
	.word	s3c2410_nand_correct_data
	.word	.LC2
	.word	.LC3
	.word	s3c2440_nand_enable_hwecc
	.word	s3c2440_nand_calculate_ecc
	.word	s3c2410_nand_enable_hwecc
	.word	s3c2410_ooblayout_ops
	.word	s3c2412_nand_enable_hwecc
	.word	s3c2412_nand_calculate_ecc
	.size	s3c2410_nand_attach_chip, .-s3c2410_nand_attach_chip
	.comm	s3c2440_nand_enable_hwecc,4,4
	.comm	s3c2440_nand_calculate_ecc,4,4
	.comm	s3c2412_nand_enable_hwecc,4,4
	.comm	s3c2412_nand_calculate_ecc,4,4
	.comm	s3c2410_ooblayout_ops,4,4
	.comm	s3c2410_nand_enable_hwecc,4,4
	.comm	s3c2410_nand_correct_data,4,4
	.comm	s3c2410_nand_calculate_ecc,4,4
	.comm	NAND_SKIP_BBTSCAN,4,4
	.comm	NAND_ECC_HAMMING,4,4
	.comm	NAND_BBT_USE_FLASH,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
