	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_iommu_hw_init
_mtk_iommu_hw_init:                     ## @mtk_iommu_hw_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	12(%rdi), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_4
LBB0_2:
	movq	_F_MMU_CTRL_COHERENT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$2, %edi
	callq	_F_MMU_TF_PROTECT_SEL
	orl	%eax, %ebx
	movq	_REG_MMU_CTRL_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	movq	_F_INT_TRANSLATION_FAULT@GOTPCREL(%rip), %rax
	movq	_F_INT_MAIN_MULTI_HIT_FAULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_F_INT_INVALID_PA_FAULT@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_F_INT_ENTRY_REPLACEMENT_FAULT@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_F_INT_TABLE_WALK_FAULT@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_F_INT_TLB_MISS_FAULT@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_F_INT_PFH_DMA_FIFO_OVERFLOW@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_F_INT_MISS_DMA_FIFO_OVERFLOW@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_REG_MMU_INT_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r14), %rsi
	callq	_writel_relaxed
	movl	(%r14), %edi
	movq	_REG_MMU_IVRP_PADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r14), %rsi
	callq	_writel_relaxed
	movq	_F_MMU_DCM_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_REG_MMU_DCM@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r14), %rsi
	callq	_writel_relaxed
	movl	4(%r14), %r15d
	movl	8(%r14), %r12d
	movq	_mtk_iommu_isr@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r12d, %edi
	callq	_dev_name
	xorl	%ebx, %ebx
	movl	%r12d, %edi
	movl	%r15d, %esi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	movq	%r14, %r9
	callq	_devm_request_irq
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_REG_MMU_PT_BASE_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r14), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_writel_relaxed
	movl	12(%r14), %edi
	callq	_clk_disable_unprepare
	movl	4(%r14), %edx
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to enable iommu bclk(%d)\n"

	.comm	_F_MMU_CTRL_COHERENT_EN,4,2     ## @F_MMU_CTRL_COHERENT_EN
	.comm	_REG_MMU_CTRL_REG,8,3           ## @REG_MMU_CTRL_REG
	.comm	_F_INT_TRANSLATION_FAULT,4,2    ## @F_INT_TRANSLATION_FAULT
	.comm	_F_INT_MAIN_MULTI_HIT_FAULT,4,2 ## @F_INT_MAIN_MULTI_HIT_FAULT
	.comm	_F_INT_INVALID_PA_FAULT,4,2     ## @F_INT_INVALID_PA_FAULT
	.comm	_F_INT_ENTRY_REPLACEMENT_FAULT,4,2 ## @F_INT_ENTRY_REPLACEMENT_FAULT
	.comm	_F_INT_TABLE_WALK_FAULT,4,2     ## @F_INT_TABLE_WALK_FAULT
	.comm	_F_INT_TLB_MISS_FAULT,4,2       ## @F_INT_TLB_MISS_FAULT
	.comm	_F_INT_PFH_DMA_FIFO_OVERFLOW,4,2 ## @F_INT_PFH_DMA_FIFO_OVERFLOW
	.comm	_F_INT_MISS_DMA_FIFO_OVERFLOW,4,2 ## @F_INT_MISS_DMA_FIFO_OVERFLOW
	.comm	_REG_MMU_INT_CONTROL,8,3        ## @REG_MMU_INT_CONTROL
	.comm	_REG_MMU_IVRP_PADDR,8,3         ## @REG_MMU_IVRP_PADDR
	.comm	_F_MMU_DCM_ON,4,2               ## @F_MMU_DCM_ON
	.comm	_REG_MMU_DCM,8,3                ## @REG_MMU_DCM
	.comm	_mtk_iommu_isr,4,2              ## @mtk_iommu_isr
	.comm	_REG_MMU_PT_BASE_ADDR,8,3       ## @REG_MMU_PT_BASE_ADDR
L_.str.1:                               ## @.str.1
	.asciz	"Failed @ IRQ-%d Request\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_mtk_iommu_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_iommu_hw_init
_mtk_iommu_hw_init:                     ; @mtk_iommu_hw_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	w0, [x0, #12]
	bl	_clk_prepare_enable
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_5
LBB0_2:
Lloh2:
	adrp	x8, _F_MMU_CTRL_COHERENT_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _F_MMU_CTRL_COHERENT_EN@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
	mov	w0, #2
	bl	_F_MMU_TF_PROTECT_SEL
	orr	w0, w0, w20
	ldr	x8, [x19, #16]
Lloh5:
	adrp	x9, _REG_MMU_CTRL_REG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _REG_MMU_CTRL_REG@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
Lloh8:
	adrp	x8, _F_INT_TRANSLATION_FAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _F_INT_TRANSLATION_FAULT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _F_INT_MAIN_MULTI_HIT_FAULT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _F_INT_MAIN_MULTI_HIT_FAULT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _F_INT_INVALID_PA_FAULT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _F_INT_INVALID_PA_FAULT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _F_INT_ENTRY_REPLACEMENT_FAULT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _F_INT_ENTRY_REPLACEMENT_FAULT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh19:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _F_INT_TABLE_WALK_FAULT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _F_INT_TABLE_WALK_FAULT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh23:
	adrp	x9, _F_INT_TLB_MISS_FAULT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _F_INT_TLB_MISS_FAULT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
Lloh26:
	adrp	x10, _F_INT_PFH_DMA_FIFO_OVERFLOW@GOTPAGE
Lloh27:
	ldr	x10, [x10, _F_INT_PFH_DMA_FIFO_OVERFLOW@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh28:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh29:
	adrp	x9, _F_INT_MISS_DMA_FIFO_OVERFLOW@GOTPAGE
Lloh30:
	ldr	x9, [x9, _F_INT_MISS_DMA_FIFO_OVERFLOW@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x19, #16]
Lloh32:
	adrp	x9, _REG_MMU_INT_CONTROL@GOTPAGE
Lloh33:
	ldr	x9, [x9, _REG_MMU_INT_CONTROL@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldr	w0, [x19]
	ldr	x8, [x19, #16]
Lloh35:
	adrp	x9, _REG_MMU_IVRP_PADDR@GOTPAGE
Lloh36:
	ldr	x9, [x9, _REG_MMU_IVRP_PADDR@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
Lloh38:
	adrp	x8, _F_MMU_DCM_ON@GOTPAGE
Lloh39:
	ldr	x8, [x8, _F_MMU_DCM_ON@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	ldr	x8, [x19, #16]
Lloh41:
	adrp	x9, _REG_MMU_DCM@GOTPAGE
Lloh42:
	ldr	x9, [x9, _REG_MMU_DCM@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldp	w21, w20, [x19, #4]
Lloh44:
	adrp	x8, _mtk_iommu_isr@GOTPAGE
Lloh45:
	ldr	x8, [x8, _mtk_iommu_isr@GOTPAGEOFF]
Lloh46:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_dev_name
	mov	x4, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	mov	w3, #0
	mov	x5, x19
	bl	_devm_request_irq
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #16]
Lloh47:
	adrp	x9, _REG_MMU_PT_BASE_ADDR@GOTPAGE
Lloh48:
	ldr	x9, [x9, _REG_MMU_PT_BASE_ADDR@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel_relaxed
	ldr	w0, [x19, #12]
	bl	_clk_disable_unprepare
	ldp	w2, w0, [x19, #4]
Lloh50:
	adrp	x1, l_.str.1@PAGE
Lloh51:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh52:
	adrp	x8, _ENODEV@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
	mov	w20, #0
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to enable iommu bclk(%d)\n"

	.comm	_F_MMU_CTRL_COHERENT_EN,4,2     ; @F_MMU_CTRL_COHERENT_EN
	.comm	_REG_MMU_CTRL_REG,8,3           ; @REG_MMU_CTRL_REG
	.comm	_F_INT_TRANSLATION_FAULT,4,2    ; @F_INT_TRANSLATION_FAULT
	.comm	_F_INT_MAIN_MULTI_HIT_FAULT,4,2 ; @F_INT_MAIN_MULTI_HIT_FAULT
	.comm	_F_INT_INVALID_PA_FAULT,4,2     ; @F_INT_INVALID_PA_FAULT
	.comm	_F_INT_ENTRY_REPLACEMENT_FAULT,4,2 ; @F_INT_ENTRY_REPLACEMENT_FAULT
	.comm	_F_INT_TABLE_WALK_FAULT,4,2     ; @F_INT_TABLE_WALK_FAULT
	.comm	_F_INT_TLB_MISS_FAULT,4,2       ; @F_INT_TLB_MISS_FAULT
	.comm	_F_INT_PFH_DMA_FIFO_OVERFLOW,4,2 ; @F_INT_PFH_DMA_FIFO_OVERFLOW
	.comm	_F_INT_MISS_DMA_FIFO_OVERFLOW,4,2 ; @F_INT_MISS_DMA_FIFO_OVERFLOW
	.comm	_REG_MMU_INT_CONTROL,8,3        ; @REG_MMU_INT_CONTROL
	.comm	_REG_MMU_IVRP_PADDR,8,3         ; @REG_MMU_IVRP_PADDR
	.comm	_F_MMU_DCM_ON,4,2               ; @F_MMU_DCM_ON
	.comm	_REG_MMU_DCM,8,3                ; @REG_MMU_DCM
	.comm	_mtk_iommu_isr,4,2              ; @mtk_iommu_isr
	.comm	_REG_MMU_PT_BASE_ADDR,8,3       ; @REG_MMU_PT_BASE_ADDR
l_.str.1:                               ; @.str.1
	.asciz	"Failed @ IRQ-%d Request\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_mtk_iommu_hw_init
.subsections_via_symbols
