	.file	"extr_cadence_wdt.c_cdns_wdt_start.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cdns_wdt_start, @function
cdns_wdt_start:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	call	watchdog_get_drvdata@PLT
	mov	edi, DWORD PTR 24[rax]
	mov	rbp, rax
	lea	r12, 12[rbp]
	call	clk_get_rate@PLT
	xor	edx, edx
	mov	rdi, r12
	div	QWORD PTR 0[rbp]
	xor	edx, edx
	imul	rax, QWORD PTR [rbx]
	div	QWORD PTR CDNS_WDT_COUNTER_VALUE_DIVISOR[rip]
	add	eax, 1
	cmp	WORD PTR CDNS_WDT_COUNTER_MAX[rip], ax
	cmovbe	ax, WORD PTR CDNS_WDT_COUNTER_MAX[rip]
	mov	ebx, eax
	call	spin_lock@PLT
	mov	edx, DWORD PTR CDNS_WDT_ZMR_ZKEY_VAL[rip]
	mov	esi, DWORD PTR CDNS_WDT_ZMR_OFFSET[rip]
	mov	rdi, rbp
	call	cdns_wdt_writereg@PLT
	movzx	edx, WORD PTR CDNS_WDT_REGISTER_ACCESS_KEY[rip]
	or	dx, WORD PTR 8[rbp]
	mov	rdi, rbp
	lea	eax, 0[0+rbx*4]
	and	ax, WORD PTR CDNS_WDT_CCR_CRV_MASK[rip]
	mov	esi, DWORD PTR CDNS_WDT_CCR_OFFSET[rip]
	or	eax, edx
	movzx	edx, ax
	call	cdns_wdt_writereg@PLT
	mov	eax, DWORD PTR CDNS_WDT_ZMR_ZKEY_VAL[rip]
	mov	edx, DWORD PTR CDNS_WDT_ZMR_WDEN_MASK[rip]
	or	edx, DWORD PTR CDNS_WDT_ZMR_RSTLEN_16[rip]
	or	eax, edx
	cmp	QWORD PTR 16[rbp], 0
	je	.L2
	mov	edx, DWORD PTR CDNS_WDT_ZMR_IRQEN_MASK[rip]
	or	eax, DWORD PTR CDNS_WDT_ZMR_RSTEN_MASK[rip]
	not	edx
	and	edx, eax
.L3:
	mov	esi, DWORD PTR CDNS_WDT_ZMR_OFFSET[rip]
	mov	rdi, rbp
	call	cdns_wdt_writereg@PLT
	mov	edx, DWORD PTR CDNS_WDT_RESTART_KEY[rip]
	mov	esi, DWORD PTR CDNS_WDT_RESTART_OFFSET[rip]
	mov	rdi, rbp
	call	cdns_wdt_writereg@PLT
	mov	rdi, r12
	call	spin_unlock@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edx, DWORD PTR CDNS_WDT_ZMR_RSTEN_MASK[rip]
	not	edx
	and	edx, eax
	or	edx, DWORD PTR CDNS_WDT_ZMR_IRQEN_MASK[rip]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	cdns_wdt_start, .-cdns_wdt_start
	.comm	CDNS_WDT_ZMR_ZKEY_VAL,4,4
	.comm	CDNS_WDT_ZMR_WDEN_MASK,4,4
	.comm	CDNS_WDT_ZMR_RSTLEN_16,4,4
	.comm	CDNS_WDT_ZMR_RSTEN_MASK,4,4
	.comm	CDNS_WDT_ZMR_OFFSET,4,4
	.comm	CDNS_WDT_ZMR_IRQEN_MASK,4,4
	.comm	CDNS_WDT_RESTART_OFFSET,4,4
	.comm	CDNS_WDT_RESTART_KEY,4,4
	.comm	CDNS_WDT_REGISTER_ACCESS_KEY,2,2
	.comm	CDNS_WDT_COUNTER_VALUE_DIVISOR,8,8
	.comm	CDNS_WDT_COUNTER_MAX,2,2
	.comm	CDNS_WDT_CCR_OFFSET,4,4
	.comm	CDNS_WDT_CCR_CRV_MASK,2,2
	.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_cadence_wdt.c_cdns_wdt_start.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cdns_wdt_start, %function
cdns_wdt_start:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	bl	watchdog_get_drvdata
	mov	r5, r0
	mov	r4, r0
	ldr	r0, [r0, #16]
	bl	clk_get_rate
	ldr	r1, [r5], #8
	bl	__aeabi_uidiv
	ldr	r2, [r6]
	ldr	r3, .L6
	mul	r0, r2, r0
	ldr	r1, [r3]
	bl	__aeabi_uidiv
	ldr	r3, .L6+4
	add	r0, r0, #1
	ldrh	r2, [r3]
	lsl	r0, r0, #16
	lsr	r0, r0, #16
	cmp	r2, r0
	movcc	r8, r2
	movcs	r8, r0
	ldr	r7, .L6+8
	ldr	r6, .L6+12
	mov	r0, r5
	bl	spin_lock
	ldr	r2, [r7]
	ldr	r1, [r6]
	mov	r0, r4
	bl	cdns_wdt_writereg
	ldr	r2, .L6+16
	ldr	r3, .L6+20
	ldrh	r0, [r4, #4]
	ldrh	r2, [r2]
	ldrh	r3, [r3]
	ldr	r1, .L6+24
	orr	r3, r3, r0
	and	r2, r2, r8, lsl #2
	orr	r2, r2, r3
	mov	r0, r4
	ldr	r1, [r1]
	bl	cdns_wdt_writereg
	ldr	r2, .L6+28
	ldr	r3, .L6+32
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, [r7]
	ldr	r1, [r4, #12]
	orr	r3, r3, r0
	orr	r3, r3, r2
	ldr	r2, .L6+36
	cmp	r1, #0
	ldr	r1, .L6+40
	ldr	r2, [r2]
	ldr	r1, [r1]
	orrne	r2, r3, r2
	biceq	r2, r3, r2
	bicne	r2, r2, r1
	orreq	r2, r2, r1
	mov	r0, r4
	ldr	r1, [r6]
	bl	cdns_wdt_writereg
	ldr	r3, .L6+44
	ldr	r2, .L6+48
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	bl	cdns_wdt_writereg
	mov	r0, r5
	bl	spin_unlock
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L7:
	.align	2
.L6:
	.word	CDNS_WDT_COUNTER_VALUE_DIVISOR
	.word	CDNS_WDT_COUNTER_MAX
	.word	CDNS_WDT_ZMR_ZKEY_VAL
	.word	CDNS_WDT_ZMR_OFFSET
	.word	CDNS_WDT_CCR_CRV_MASK
	.word	CDNS_WDT_REGISTER_ACCESS_KEY
	.word	CDNS_WDT_CCR_OFFSET
	.word	CDNS_WDT_ZMR_RSTLEN_16
	.word	CDNS_WDT_ZMR_WDEN_MASK
	.word	CDNS_WDT_ZMR_RSTEN_MASK
	.word	CDNS_WDT_ZMR_IRQEN_MASK
	.word	CDNS_WDT_RESTART_OFFSET
	.word	CDNS_WDT_RESTART_KEY
	.size	cdns_wdt_start, .-cdns_wdt_start
	.comm	CDNS_WDT_ZMR_ZKEY_VAL,4,4
	.comm	CDNS_WDT_ZMR_WDEN_MASK,4,4
	.comm	CDNS_WDT_ZMR_RSTLEN_16,4,4
	.comm	CDNS_WDT_ZMR_RSTEN_MASK,4,4
	.comm	CDNS_WDT_ZMR_OFFSET,4,4
	.comm	CDNS_WDT_ZMR_IRQEN_MASK,4,4
	.comm	CDNS_WDT_RESTART_OFFSET,4,4
	.comm	CDNS_WDT_RESTART_KEY,4,4
	.comm	CDNS_WDT_REGISTER_ACCESS_KEY,2,2
	.comm	CDNS_WDT_COUNTER_VALUE_DIVISOR,4,4
	.comm	CDNS_WDT_COUNTER_MAX,2,2
	.comm	CDNS_WDT_CCR_OFFSET,4,4
	.comm	CDNS_WDT_CCR_CRV_MASK,2,2
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
