	.file	"extr_r600.c_r600_startup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Failed to load firmware!\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"failed blitter (%d) falling back to memcpy\n"
	.align 8
.LC2:
	.string	"failed initializing CP fences (%d).\n"
	.align 8
.LC3:
	.string	"failed initializing DMA fences (%d).\n"
	.section	.rodata.str1.1
.LC4:
	.string	"radeon: IH init failed (%d).\n"
	.section	.rodata.str1.8
	.align 8
.LC5:
	.string	"IB initialization failed (%d).\n"
	.section	.rodata.str1.1
.LC6:
	.string	"radeon: audio init failed\n"
	.text
	.p2align 4
	.type	r600_startup, @function
r600_startup:
.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
	mov	rbp, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	r600_pcie_gen2_enable@PLT
	mov	esi, DWORD PTR 40[rbp]
	test	esi, esi
	je	.L2
	mov	ecx, DWORD PTR 36[rbp]
	test	ecx, ecx
	jne	.L27
.L2:
	mov	rdi, rbp
	call	r600_init_microcode@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L28
.L3:
	mov	rdi, rbp
	call	r600_vram_scratch_init@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L29
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	mov	rdi, rbp
	call	r600_mc_program@PLT
	mov	eax, DWORD PTR 0[rbp]
	mov	rdi, rbp
	test	DWORD PTR RADEON_IS_AGP[rip], eax
	je	.L5
	call	r600_agp_enable@PLT
.L6:
	mov	rdi, rbp
	call	r600_gpu_init@PLT
	mov	rdi, rbp
	call	r600_blit_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L30
.L7:
	mov	rdi, rbp
	call	radeon_wb_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rsi, QWORD PTR RADEON_RING_TYPE_GFX_INDEX[rip]
	mov	rdi, rbp
	call	radeon_fence_driver_start_ring@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L31
	mov	rsi, QWORD PTR R600_RING_TYPE_DMA_INDEX[rip]
	mov	rdi, rbp
	call	radeon_fence_driver_start_ring@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L32
	mov	eax, DWORD PTR 16[rbp]
	test	eax, eax
	jne	.L13
	mov	rdi, rbp
	call	radeon_irq_kms_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
.L13:
	mov	rdi, rbp
	call	r600_irq_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L33
	mov	rdi, rbp
	call	r600_irq_set@PLT
	mov	rax, QWORD PTR 8[rbp]
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	mov	rdx, QWORD PTR RADEON_RING_TYPE_GFX_INDEX[rip]
	mov	r9d, DWORD PTR R600_CP_RB_WPTR[rip]
	mov	r8d, DWORD PTR R600_CP_RB_RPTR[rip]
	mov	ecx, DWORD PTR RADEON_WB_CP_RPTR_OFFSET[rip]
	lea	rsi, [rax+rdx*4]
	mov	eax, DWORD PTR RADEON_CP_PACKET2[rip]
	push	rax
	.cfi_def_cfa_offset 48
	push	1048575
	.cfi_def_cfa_offset 56
	push	0
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR [rsi]
	call	radeon_ring_init@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 32
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rdx, QWORD PTR R600_RING_TYPE_DMA_INDEX[rip]
	mov	rax, QWORD PTR 8[rbp]
	xor	ecx, ecx
	xor	esi, esi
	mov	edi, DWORD PTR DMA_PACKET_NOP[rip]
	lea	r12, [rax+rdx*4]
	xor	edx, edx
	call	DMA_PACKET@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	rsi, r12
	mov	rdi, rbp
	mov	r9d, DWORD PTR DMA_RB_WPTR[rip]
	mov	r8d, DWORD PTR DMA_RB_RPTR[rip]
	push	rax
	.cfi_def_cfa_offset 48
	push	262140
	.cfi_def_cfa_offset 56
	mov	ecx, DWORD PTR R600_WB_DMA_RPTR_OFFSET[rip]
	push	2
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR [r12]
	call	radeon_ring_init@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 32
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rdi, rbp
	call	r600_cp_load_microcode@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rdi, rbp
	call	r600_cp_resume@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rdi, rbp
	call	r600_dma_resume@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rdi, rbp
	call	radeon_ib_pool_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L34
	mov	rdi, rbp
	call	r600_audio_init@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L1
	lea	rdi, .LC6[rip]
	xor	eax, eax
	call	DRM_ERROR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	mov	edx, DWORD PTR 32[rbp]
	test	edx, edx
	jne	.L3
	mov	rdi, rbp
	call	r600_init_microcode@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L3
.L28:
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	DRM_ERROR@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	call	r600_pcie_gart_enable@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L6
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	mov	rdi, rbp
	call	r600_blit_fini@PLT
	mov	rax, QWORD PTR 24[rbp]
	mov	edi, DWORD PTR 4[rbp]
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	mov	QWORD PTR [rax], 0
	call	dev_warn@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L31:
	mov	edi, DWORD PTR 4[rbp]
	mov	edx, eax
	lea	rsi, .LC2[rip]
	call	dev_err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L33:
	mov	esi, eax
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	DRM_ERROR@PLT
	mov	rdi, rbp
	call	radeon_irq_kms_fini@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edi, DWORD PTR 4[rbp]
	mov	edx, eax
	lea	rsi, .LC3[rip]
	call	dev_err@PLT
	jmp	.L1
.L34:
	mov	edi, DWORD PTR 4[rbp]
	mov	edx, eax
	lea	rsi, .LC5[rip]
	call	dev_err@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	r600_startup, .-r600_startup
	.comm	RADEON_WB_CP_RPTR_OFFSET,4,4
	.comm	RADEON_RING_TYPE_GFX_INDEX,8,8
	.comm	RADEON_IS_AGP,4,4
	.comm	RADEON_CP_PACKET2,4,4
	.comm	R600_WB_DMA_RPTR_OFFSET,4,4
	.comm	R600_RING_TYPE_DMA_INDEX,8,8
	.comm	R600_CP_RB_WPTR,4,4
	.comm	R600_CP_RB_RPTR,4,4
	.comm	DMA_RB_WPTR,4,4
	.comm	DMA_RB_RPTR,4,4
	.comm	DMA_PACKET_NOP,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_r600.c_r600_startup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed to load firmware!\012\000"
	.align	2
.LC1:
	.ascii	"failed blitter (%d) falling back to memcpy\012\000"
	.align	2
.LC2:
	.ascii	"failed initializing CP fences (%d).\012\000"
	.align	2
.LC3:
	.ascii	"failed initializing DMA fences (%d).\012\000"
	.align	2
.LC4:
	.ascii	"radeon: IH init failed (%d).\012\000"
	.align	2
.LC5:
	.ascii	"IB initialization failed (%d).\012\000"
	.align	2
.LC6:
	.ascii	"radeon: audio init failed\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	r600_startup, %function
r600_startup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r0
	sub	sp, sp, #28
	bl	r600_pcie_gen2_enable
	ldr	r3, [r5, #28]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [r5, #24]
	cmp	r3, #0
	bne	.L33
.L2:
	mov	r0, r5
	bl	r600_init_microcode
	subs	r4, r0, #0
	bne	.L34
.L3:
	mov	r0, r5
	bl	r600_vram_scratch_init
	subs	r4, r0, #0
	beq	.L35
.L1:
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L35:
	mov	r0, r5
	bl	r600_mc_program
	ldr	r3, .L41
	ldr	r2, [r5]
	ldr	r3, [r3]
	mov	r0, r5
	tst	r2, r3
	beq	.L5
	bl	r600_agp_enable
.L6:
	mov	r0, r5
	bl	r600_gpu_init
	mov	r0, r5
	bl	r600_blit_init
	subs	r4, r0, #0
	bne	.L36
.L7:
	mov	r0, r5
	bl	radeon_wb_init
	subs	r4, r0, #0
	bne	.L1
	ldr	r6, .L41+4
	mov	r0, r5
	ldr	r1, [r6]
	bl	radeon_fence_driver_start_ring
	subs	r4, r0, #0
	bne	.L37
	ldr	r7, .L41+8
	mov	r0, r5
	ldr	r1, [r7]
	bl	radeon_fence_driver_start_ring
	subs	r4, r0, #0
	bne	.L38
	ldr	r3, [r5, #12]
	cmp	r3, #0
	bne	.L13
	mov	r0, r5
	bl	radeon_irq_kms_init
	subs	r4, r0, #0
	bne	.L1
.L13:
	mov	r0, r5
	bl	r600_irq_init
	subs	r4, r0, #0
	bne	.L39
	mov	r0, r5
	bl	r600_irq_set
	ldr	ip, .L41+12
	ldr	r0, .L41+16
	ldr	lr, [ip]
	ldr	ip, .L41+20
	ldr	r3, [r5, #8]
	ldr	r1, [r6]
	ldr	r0, [r0]
	ldr	ip, [ip]
	ldr	r2, [r3, r1, lsl #2]
	str	r0, [sp, #4]
	add	r1, r3, r1, lsl #2
	ldr	r0, .L41+24
	ldr	r3, .L41+28
	str	r4, [sp, #8]
	str	lr, [sp, #16]
	str	ip, [sp]
	ldr	r3, [r3]
	str	r0, [sp, #12]
	mov	r0, r5
	bl	radeon_ring_init
	subs	r4, r0, #0
	bne	.L1
	ldr	r3, .L41+32
	ldr	lr, [r7]
	ldr	ip, [r5, #8]
	ldr	r7, .L41+36
	ldr	r8, .L41+40
	ldr	r9, .L41+44
	mov	r2, r4
	mov	r1, r4
	ldr	r0, [r3]
	mov	r3, r4
	ldr	r6, [ip, lr, lsl #2]
	add	r4, ip, lr, lsl #2
	ldr	r7, [r7]
	ldr	r8, [r8]
	ldr	r9, [r9]
	bl	DMA_PACKET
	mov	lr, #2
	ldr	ip, .L41+48
	mov	r1, r4
	str	r0, [sp, #16]
	mov	r3, r7
	mov	r2, r6
	mov	r0, r5
	stm	sp, {r8, r9}
	str	lr, [sp, #8]
	str	ip, [sp, #12]
	bl	radeon_ring_init
	subs	r4, r0, #0
	bne	.L1
	mov	r0, r5
	bl	r600_cp_load_microcode
	subs	r4, r0, #0
	bne	.L1
	mov	r0, r5
	bl	r600_cp_resume
	subs	r4, r0, #0
	bne	.L1
	mov	r0, r5
	bl	r600_dma_resume
	subs	r4, r0, #0
	bne	.L1
	mov	r0, r5
	bl	radeon_ib_pool_init
	subs	r4, r0, #0
	bne	.L40
	mov	r0, r5
	bl	r600_audio_init
	subs	r4, r0, #0
	beq	.L1
	ldr	r0, .L41+52
	bl	DRM_ERROR
	b	.L1
.L33:
	ldr	r3, [r5, #20]
	cmp	r3, #0
	bne	.L3
	mov	r0, r5
	bl	r600_init_microcode
	subs	r4, r0, #0
	beq	.L3
.L34:
	ldr	r0, .L41+56
	bl	DRM_ERROR
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L5:
	bl	r600_pcie_gart_enable
	subs	r4, r0, #0
	beq	.L6
	b	.L1
.L36:
	mov	r0, r5
	bl	r600_blit_fini
	mov	r1, #0
	ldr	r3, [r5, #16]
	mov	r2, r4
	str	r1, [r3]
	ldr	r0, [r5, #4]
	ldr	r1, .L41+60
	bl	dev_warn
	b	.L7
.L37:
	mov	r2, r4
	ldr	r0, [r5, #4]
	ldr	r1, .L41+64
	bl	dev_err
	b	.L1
.L39:
	mov	r1, r4
	ldr	r0, .L41+68
	bl	DRM_ERROR
	mov	r0, r5
	bl	radeon_irq_kms_fini
	b	.L1
.L38:
	mov	r2, r4
	ldr	r0, [r5, #4]
	ldr	r1, .L41+72
	bl	dev_err
	b	.L1
.L40:
	mov	r2, r4
	ldr	r0, [r5, #4]
	ldr	r1, .L41+76
	bl	dev_err
	b	.L1
.L42:
	.align	2
.L41:
	.word	RADEON_IS_AGP
	.word	RADEON_RING_TYPE_GFX_INDEX
	.word	R600_RING_TYPE_DMA_INDEX
	.word	RADEON_CP_PACKET2
	.word	R600_CP_RB_WPTR
	.word	R600_CP_RB_RPTR
	.word	1048575
	.word	RADEON_WB_CP_RPTR_OFFSET
	.word	DMA_PACKET_NOP
	.word	R600_WB_DMA_RPTR_OFFSET
	.word	DMA_RB_RPTR
	.word	DMA_RB_WPTR
	.word	262140
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC4
	.word	.LC3
	.word	.LC5
	.size	r600_startup, .-r600_startup
	.comm	RADEON_WB_CP_RPTR_OFFSET,4,4
	.comm	RADEON_RING_TYPE_GFX_INDEX,4,4
	.comm	RADEON_IS_AGP,4,4
	.comm	RADEON_CP_PACKET2,4,4
	.comm	R600_WB_DMA_RPTR_OFFSET,4,4
	.comm	R600_RING_TYPE_DMA_INDEX,4,4
	.comm	R600_CP_RB_WPTR,4,4
	.comm	R600_CP_RB_RPTR,4,4
	.comm	DMA_RB_WPTR,4,4
	.comm	DMA_RB_RPTR,4,4
	.comm	DMA_PACKET_NOP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
