	.file	"extr_isp1760-core.c_isp1760_init_core.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"analog"
.LC1:
	.string	"digital"
.LC2:
	.string	"bus width: %u, oc: %s\n"
	.text
	.p2align 4
	.type	isp1760_init_core, @function
isp1760_init_core:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rdi, QWORD PTR 16[rdi]
	test	rdi, rdi
	jne	.L46
.L2:
	mov	edi, DWORD PTR 8[rbx]
	mov	edx, DWORD PTR SW_RESET_RESET_ALL[rip]
	mov	r12d, 0
	mov	esi, DWORD PTR HC_RESET_REG[rip]
	call	isp1760_write32@PLT
	mov	edi, 100
	call	msleep@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR ISP1760_FLAG_BUS_WIDTH_16[rip], eax
	cmove	r12d, DWORD PTR HW_DATA_BUS_32BIT[rip]
	test	DWORD PTR ISP1760_FLAG_ANALOG_OC[rip], eax
	je	.L4
	or	r12d, DWORD PTR HW_ANA_DIGI_OC[rip]
.L4:
	test	DWORD PTR ISP1760_FLAG_DACK_POL_HIGH[rip], eax
	je	.L5
	or	r12d, DWORD PTR HW_DACK_POL_HIGH[rip]
.L5:
	test	DWORD PTR ISP1760_FLAG_DREQ_POL_HIGH[rip], eax
	je	.L6
	or	r12d, DWORD PTR HW_DREQ_POL_HIGH[rip]
.L6:
	test	DWORD PTR ISP1760_FLAG_INTR_POL_HIGH[rip], eax
	je	.L7
	or	r12d, DWORD PTR HW_INTR_HIGH_ACT[rip]
.L7:
	test	DWORD PTR ISP1760_FLAG_INTR_EDGE_TRIG[rip], eax
	je	.L8
	or	r12d, DWORD PTR HW_INTR_EDGE_TRIG[rip]
.L8:
	mov	edi, DWORD PTR 8[rbx]
	test	DWORD PTR ISP1760_FLAG_ISP1761[rip], eax
	jne	.L47
.L9:
	mov	esi, DWORD PTR HC_HW_MODE_CTRL[rip]
	mov	edx, r12d
	call	isp1760_write32@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR HC_HW_MODE_CTRL[rip]
	mov	edx, r12d
	call	isp1760_write32@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR ISP1760_FLAG_ISP1761[rip], eax
	je	.L10
	test	DWORD PTR ISP1760_FLAG_OTG_EN[rip], eax
	jne	.L48
.L10:
	mov	eax, DWORD PTR HW_SW_SEL_HC_DC[rip]
	mov	edx, DWORD PTR HW_VBUS_DRV[rip]
	or	edx, DWORD PTR HW_SEL_CP_EXT[rip]
	sal	eax, 16
	or	edx, eax
.L11:
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR HC_PORT1_CTRL[rip]
	call	isp1760_write32@PLT
	mov	eax, DWORD PTR [rbx]
	lea	rdx, .LC1[rip]
	mov	edi, DWORD PTR 4[rbx]
	test	DWORD PTR ISP1760_FLAG_ANALOG_OC[rip], eax
	lea	rcx, .LC0[rip]
	lea	rsi, .LC2[rip]
	cmove	rcx, rdx
	and	eax, DWORD PTR ISP1760_FLAG_BUS_WIDTH_16[rip]
	cmp	eax, 1
	sbb	edx, edx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	and	edx, 16
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	add	edx, 16
	jmp	dev_info@PLT
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	mov	edx, DWORD PTR HW_DM_PULLDOWN[rip]
	or	edx, DWORD PTR HW_DP_PULLDOWN[rip]
	sal	edx, 16
	or	edx, DWORD PTR HW_OTG_DISABLE[rip]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L47:
	mov	esi, DWORD PTR DC_MODE[rip]
	xor	edx, edx
	call	isp1760_write32@PLT
	mov	edi, DWORD PTR 8[rbx]
	or	r12d, DWORD PTR HW_COMN_IRQ[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L46:
	mov	esi, 1
	call	gpiod_set_value_cansleep@PLT
	mov	edi, 50
	call	msleep@PLT
	mov	rdi, QWORD PTR 16[rbx]
	xor	esi, esi
	call	gpiod_set_value_cansleep@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	isp1760_init_core, .-isp1760_init_core
	.comm	SW_RESET_RESET_ALL,4,4
	.comm	ISP1760_FLAG_OTG_EN,4,4
	.comm	ISP1760_FLAG_ISP1761,4,4
	.comm	ISP1760_FLAG_INTR_POL_HIGH,4,4
	.comm	ISP1760_FLAG_INTR_EDGE_TRIG,4,4
	.comm	ISP1760_FLAG_DREQ_POL_HIGH,4,4
	.comm	ISP1760_FLAG_DACK_POL_HIGH,4,4
	.comm	ISP1760_FLAG_BUS_WIDTH_16,4,4
	.comm	ISP1760_FLAG_ANALOG_OC,4,4
	.comm	HW_VBUS_DRV,4,4
	.comm	HW_SW_SEL_HC_DC,4,4
	.comm	HW_SEL_CP_EXT,4,4
	.comm	HW_OTG_DISABLE,4,4
	.comm	HW_INTR_HIGH_ACT,4,4
	.comm	HW_INTR_EDGE_TRIG,4,4
	.comm	HW_DREQ_POL_HIGH,4,4
	.comm	HW_DP_PULLDOWN,4,4
	.comm	HW_DM_PULLDOWN,4,4
	.comm	HW_DATA_BUS_32BIT,4,4
	.comm	HW_DACK_POL_HIGH,4,4
	.comm	HW_COMN_IRQ,4,4
	.comm	HW_ANA_DIGI_OC,4,4
	.comm	HC_RESET_REG,4,4
	.comm	HC_PORT1_CTRL,4,4
	.comm	HC_HW_MODE_CTRL,4,4
	.comm	DC_MODE,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_isp1760-core.c_isp1760_init_core.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"analog\000"
	.align	2
.LC1:
	.ascii	"digital\000"
	.align	2
.LC2:
	.ascii	"bus width: %u, oc: %s\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	isp1760_init_core, %function
isp1760_init_core:
	@ 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
	ldr	r0, [r0, #12]
	cmp	r0, #0
	bne	.L46
.L2:
	ldr	r3, .L49
	ldr	r2, .L49+4
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r0, [r4, #8]
	ldr	r7, .L49+8
	bl	isp1760_write32
	mov	r0, #100
	bl	msleep
	ldr	r3, [r4]
	ldr	r1, [r7]
	ldr	r2, .L49+12
	tst	r3, r1
	ldr	r5, [r2]
	movne	r5, #0
	ldr	r6, .L49+16
	ldr	r8, .L49+20
	ldr	r2, [r6]
	ldr	r0, [r4, #8]
	tst	r3, r2
	ldrne	r2, .L49+24
	ldrne	r2, [r2]
	orrne	r5, r5, r2
	ldr	r2, .L49+28
	ldr	r2, [r2]
	tst	r3, r2
	ldrne	r2, .L49+32
	ldrne	r2, [r2]
	orrne	r5, r5, r2
	ldr	r2, .L49+36
	ldr	r2, [r2]
	tst	r3, r2
	ldrne	r2, .L49+40
	ldrne	r2, [r2]
	orrne	r5, r5, r2
	ldr	r2, .L49+44
	ldr	r2, [r2]
	tst	r3, r2
	ldrne	r2, .L49+48
	ldrne	r2, [r2]
	orrne	r5, r5, r2
	ldr	r2, .L49+52
	ldr	r2, [r2]
	tst	r3, r2
	ldrne	r2, .L49+56
	ldrne	r2, [r2]
	orrne	r5, r5, r2
	ldr	r2, [r8]
	tst	r3, r2
	bne	.L47
.L9:
	ldr	r9, .L49+60
	mov	r2, r5
	ldr	r1, [r9]
	bl	isp1760_write32
	mov	r2, r5
	ldr	r1, [r9]
	ldr	r0, [r4, #8]
	bl	isp1760_write32
	ldr	r2, [r8]
	ldr	r3, [r4]
	tst	r3, r2
	beq	.L10
	ldr	r2, .L49+64
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L48
.L10:
	ldr	r2, .L49+68
	ldr	r1, .L49+72
	ldr	r3, .L49+76
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r3, [r3]
	orr	r2, r2, r1
	orr	r2, r2, r3, lsl #16
.L11:
	ldr	r3, .L49+80
	ldr	r0, [r4, #8]
	ldr	r1, [r3]
	bl	isp1760_write32
	ldr	r1, [r4]
	ldr	r3, [r7]
	ldr	r0, [r6]
	tst	r1, r3
	ldr	ip, .L49+84
	movne	r2, #16
	moveq	r2, #32
	tst	r1, r0
	ldr	r3, .L49+88
	ldr	r0, [r4, #4]
	movne	r3, ip
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r1, .L49+92
	b	dev_info
.L48:
	ldr	r3, .L49+96
	ldr	r1, .L49+100
	ldr	r2, .L49+104
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r1
	orr	r2, r2, r3, lsl #16
	b	.L11
.L47:
	ldr	r3, .L49+108
	mov	r2, #0
	ldr	r1, [r3]
	bl	isp1760_write32
	ldr	r3, .L49+112
	ldr	r0, [r4, #8]
	ldr	r3, [r3]
	orr	r5, r5, r3
	b	.L9
.L46:
	mov	r1, #1
	bl	gpiod_set_value_cansleep
	mov	r0, #50
	bl	msleep
	mov	r1, #0
	ldr	r0, [r4, #12]
	bl	gpiod_set_value_cansleep
	b	.L2
.L50:
	.align	2
.L49:
	.word	HC_RESET_REG
	.word	SW_RESET_RESET_ALL
	.word	ISP1760_FLAG_BUS_WIDTH_16
	.word	HW_DATA_BUS_32BIT
	.word	ISP1760_FLAG_ANALOG_OC
	.word	ISP1760_FLAG_ISP1761
	.word	HW_ANA_DIGI_OC
	.word	ISP1760_FLAG_DACK_POL_HIGH
	.word	HW_DACK_POL_HIGH
	.word	ISP1760_FLAG_DREQ_POL_HIGH
	.word	HW_DREQ_POL_HIGH
	.word	ISP1760_FLAG_INTR_POL_HIGH
	.word	HW_INTR_HIGH_ACT
	.word	ISP1760_FLAG_INTR_EDGE_TRIG
	.word	HW_INTR_EDGE_TRIG
	.word	HC_HW_MODE_CTRL
	.word	ISP1760_FLAG_OTG_EN
	.word	HW_VBUS_DRV
	.word	HW_SEL_CP_EXT
	.word	HW_SW_SEL_HC_DC
	.word	HC_PORT1_CTRL
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	HW_DM_PULLDOWN
	.word	HW_DP_PULLDOWN
	.word	HW_OTG_DISABLE
	.word	DC_MODE
	.word	HW_COMN_IRQ
	.size	isp1760_init_core, .-isp1760_init_core
	.comm	SW_RESET_RESET_ALL,4,4
	.comm	ISP1760_FLAG_OTG_EN,4,4
	.comm	ISP1760_FLAG_ISP1761,4,4
	.comm	ISP1760_FLAG_INTR_POL_HIGH,4,4
	.comm	ISP1760_FLAG_INTR_EDGE_TRIG,4,4
	.comm	ISP1760_FLAG_DREQ_POL_HIGH,4,4
	.comm	ISP1760_FLAG_DACK_POL_HIGH,4,4
	.comm	ISP1760_FLAG_BUS_WIDTH_16,4,4
	.comm	ISP1760_FLAG_ANALOG_OC,4,4
	.comm	HW_VBUS_DRV,4,4
	.comm	HW_SW_SEL_HC_DC,4,4
	.comm	HW_SEL_CP_EXT,4,4
	.comm	HW_OTG_DISABLE,4,4
	.comm	HW_INTR_HIGH_ACT,4,4
	.comm	HW_INTR_EDGE_TRIG,4,4
	.comm	HW_DREQ_POL_HIGH,4,4
	.comm	HW_DP_PULLDOWN,4,4
	.comm	HW_DM_PULLDOWN,4,4
	.comm	HW_DATA_BUS_32BIT,4,4
	.comm	HW_DACK_POL_HIGH,4,4
	.comm	HW_COMN_IRQ,4,4
	.comm	HW_ANA_DIGI_OC,4,4
	.comm	HC_RESET_REG,4,4
	.comm	HC_PORT1_CTRL,4,4
	.comm	HC_HW_MODE_CTRL,4,4
	.comm	DC_MODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
