	.file	"extr_a5xx_power.c_a5xx_gpmu_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%s: Unable to load GPMU firmware. GPMU will not be active\n"
	.align 8
.LC1:
	.string	"%s: GPMU firmware initialization timed out\n"
	.align 8
.LC2:
	.string	"%s: GPMU firmware initialization failed: %d\n"
	.text
	.p2align 4
	.type	a5xx_gpmu_init, @function
a5xx_gpmu_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	to_adreno_gpu@PLT
	mov	rdi, rax
	mov	r13, rax
	call	to_a5xx_gpu@PLT
	mov	edx, DWORD PTR [rax]
	test	edx, edx
	jne	.L2
.L18:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rbp, rax
	mov	rax, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR CP_SET_PROTECTED_MODE[rip]
	mov	edx, 1
	mov	r12, QWORD PTR [rax]
	mov	rdi, r12
	call	OUT_PKT7@PLT
	xor	esi, esi
	mov	rdi, r12
	call	OUT_RING@PLT
	mov	esi, DWORD PTR CP_INDIRECT_BUFFER_PFE[rip]
	mov	edx, 3
	mov	rdi, r12
	call	OUT_PKT7@PLT
	mov	edi, DWORD PTR 4[rbp]
	call	lower_32_bits@PLT
	mov	rdi, r12
	mov	esi, eax
	call	OUT_RING@PLT
	mov	edi, DWORD PTR 4[rbp]
	call	upper_32_bits@PLT
	mov	rdi, r12
	mov	esi, eax
	call	OUT_RING@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	rdi, r12
	call	OUT_RING@PLT
	mov	esi, DWORD PTR CP_SET_PROTECTED_MODE[rip]
	mov	edx, 1
	mov	rdi, r12
	call	OUT_PKT7@PLT
	mov	esi, 1
	mov	rdi, r12
	call	OUT_RING@PLT
	mov	rax, QWORD PTR 8[rbx]
	mov	rsi, r12
	mov	rdi, rbx
	call	[QWORD PTR [rax]]
	mov	rsi, r12
	mov	rdi, rbx
	call	a5xx_idle@PLT
	test	eax, eax
	je	.L20
	mov	rdi, r13
	call	adreno_is_a530@PLT
	test	rax, rax
	jne	.L21
.L5:
	mov	esi, DWORD PTR REG_A5XX_GPMU_CM3_SYSRESET[rip]
	xor	edx, edx
	mov	rdi, rbx
	call	gpu_write@PLT
	mov	edx, DWORD PTR REG_A5XX_GPMU_GENERAL_0[rip]
	mov	r8d, -1161889074
	mov	rdi, rbx
	mov	ecx, -1
	mov	esi, 25
	call	spin_usecs@PLT
	test	rax, rax
	jne	.L22
.L6:
	mov	rdi, r13
	call	adreno_is_a530@PLT
	test	rax, rax
	jne	.L18
	mov	esi, DWORD PTR REG_A5XX_GPMU_GENERAL_1[rip]
	mov	rdi, rbx
	call	gpu_read@PLT
	test	rax, rax
	je	.L18
	mov	esi, DWORD PTR [rbx]
	mov	rdx, rax
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	DRM_ERROR@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	mov	esi, DWORD PTR [rbx]
	lea	rdi, .LC0[rip]
	call	DRM_ERROR@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	esi, DWORD PTR [rbx]
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	DRM_ERROR@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	esi, DWORD PTR REG_A5XX_GPMU_WFI_CONFIG[rip]
	mov	edx, 16404
	mov	rdi, rbx
	call	gpu_write@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	a5xx_gpmu_init, .-a5xx_gpmu_init
	.comm	REG_A5XX_GPMU_WFI_CONFIG,4,4
	.comm	REG_A5XX_GPMU_GENERAL_1,4,4
	.comm	REG_A5XX_GPMU_GENERAL_0,4,4
	.comm	REG_A5XX_GPMU_CM3_SYSRESET,4,4
	.comm	EINVAL,4,4
	.comm	CP_SET_PROTECTED_MODE,4,4
	.comm	CP_INDIRECT_BUFFER_PFE,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_a5xx_power.c_a5xx_gpmu_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s: Unable to load GPMU firmware. GPMU will not be "
	.ascii	"active\012\000"
	.align	2
.LC1:
	.ascii	"%s: GPMU firmware initialization timed out\012\000"
	.align	2
.LC2:
	.ascii	"%s: GPMU firmware initialization failed: %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	a5xx_gpmu_init, %function
a5xx_gpmu_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	sub	sp, sp, #8
	mov	r4, r0
	bl	to_adreno_gpu
	mov	r7, r0
	bl	to_a5xx_gpu
	ldr	r3, [r0]
	cmp	r3, #0
	bne	.L2
.L7:
	mov	r5, #0
.L1:
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r5, r0
	ldr	r3, [r4, #8]
	ldr	r8, .L22
	ldr	r6, [r3]
	mov	r2, #1
	ldr	r1, [r8]
	mov	r0, r6
	bl	OUT_PKT7
	mov	r1, #0
	mov	r0, r6
	bl	OUT_RING
	ldr	r3, .L22+4
	mov	r2, #3
	ldr	r1, [r3]
	mov	r0, r6
	bl	OUT_PKT7
	ldr	r0, [r5, #4]
	bl	lower_32_bits
	mov	r1, r0
	mov	r0, r6
	bl	OUT_RING
	ldr	r0, [r5, #4]
	bl	upper_32_bits
	mov	r1, r0
	mov	r0, r6
	bl	OUT_RING
	ldr	r1, [r5]
	mov	r0, r6
	bl	OUT_RING
	mov	r2, #1
	ldr	r1, [r8]
	mov	r0, r6
	bl	OUT_PKT7
	mov	r1, #1
	mov	r0, r6
	bl	OUT_RING
	ldr	r3, [r4, #4]
	mov	r1, r6
	ldr	r3, [r3]
	mov	r0, r4
	blx	r3
	mov	r1, r6
	mov	r0, r4
	bl	a5xx_idle
	cmp	r0, #0
	beq	.L19
	mov	r0, r7
	bl	adreno_is_a530
	cmp	r0, #0
	bne	.L20
.L5:
	ldr	r3, .L22+8
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	gpu_write
	ldr	r3, .L22+12
	ldr	r2, .L22+16
	mov	r1, #25
	ldr	r2, [r2]
	mov	r0, r4
	str	r3, [sp]
	mvn	r3, #0
	bl	spin_usecs
	cmp	r0, #0
	bne	.L21
.L6:
	mov	r0, r7
	bl	adreno_is_a530
	subs	r5, r0, #0
	bne	.L7
	ldr	r3, .L22+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	gpu_read
	subs	r2, r0, #0
	beq	.L7
	ldr	r1, [r4]
	ldr	r0, .L22+24
	bl	DRM_ERROR
	b	.L1
.L19:
	ldr	r1, [r4]
	ldr	r0, .L22+28
	bl	DRM_ERROR
	ldr	r3, .L22+32
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L21:
	ldr	r1, [r4]
	ldr	r0, .L22+36
	bl	DRM_ERROR
	b	.L6
.L20:
	ldr	r3, .L22+40
	mov	r0, r4
	ldr	r2, .L22+44
	ldr	r1, [r3]
	bl	gpu_write
	b	.L5
.L23:
	.align	2
.L22:
	.word	CP_SET_PROTECTED_MODE
	.word	CP_INDIRECT_BUFFER_PFE
	.word	REG_A5XX_GPMU_CM3_SYSRESET
	.word	-1161889074
	.word	REG_A5XX_GPMU_GENERAL_0
	.word	REG_A5XX_GPMU_GENERAL_1
	.word	.LC2
	.word	.LC0
	.word	EINVAL
	.word	.LC1
	.word	REG_A5XX_GPMU_WFI_CONFIG
	.word	16404
	.size	a5xx_gpmu_init, .-a5xx_gpmu_init
	.comm	REG_A5XX_GPMU_WFI_CONFIG,4,4
	.comm	REG_A5XX_GPMU_GENERAL_1,4,4
	.comm	REG_A5XX_GPMU_GENERAL_0,4,4
	.comm	REG_A5XX_GPMU_CM3_SYSRESET,4,4
	.comm	EINVAL,4,4
	.comm	CP_SET_PROTECTED_MODE,4,4
	.comm	CP_INDIRECT_BUFFER_PFE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
