	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xenon_emmc_phy_init
_xenon_emmc_phy_init:                   ## @xenon_emmc_phy_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_sdhci_priv
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	(%rax), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_sdhci_readl
	movl	%eax, %ebx
	movq	_XENON_PHY_INITIALIZAION@GOTPCREL(%rip), %r12
	orl	(%r12), %ebx
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_sdhci_writel
	movq	_XENON_FC_SYNC_RST_DURATION_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	sarl	%cl, %eax
	movq	_XENON_FC_SYNC_RST_DURATION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_XENON_FC_SYNC_RST_EN_DURATION_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%ebx, %edx
	sarl	%cl, %edx
	movq	_XENON_FC_SYNC_RST_EN_DURATION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	addl	%eax, %edx
	movq	_XENON_FC_SYNC_EN_DURATION_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	sarl	%cl, %eax
	movq	_XENON_FC_SYNC_EN_DURATION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	addl	%edx, %eax
	movq	_XENON_WAIT_CYCLE_BEFORE_USING_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %ebx
	movq	_XENON_WAIT_CYCLE_BEFORE_USING_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	addl	%eax, %ebx
	shll	$20, %ebx
	addl	$8388608, %ebx                  ## imm = 0x800000
	movl	(%r14), %ecx
	testl	%ecx, %ecx
	jne	LBB0_2
## %bb.1:
	movq	_XENON_LOWEST_SDCLK_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_2:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	incl	%ebx
	movl	%ebx, %edi
	callq	_udelay
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_sdhci_readl
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.4:
	movl	4(%r14), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XENON_PHY_INITIALIZAION,4,2    ## @XENON_PHY_INITIALIZAION
	.comm	_XENON_FC_SYNC_RST_DURATION_SHIFT,4,2 ## @XENON_FC_SYNC_RST_DURATION_SHIFT
	.comm	_XENON_FC_SYNC_RST_DURATION_MASK,4,2 ## @XENON_FC_SYNC_RST_DURATION_MASK
	.comm	_XENON_FC_SYNC_RST_EN_DURATION_SHIFT,4,2 ## @XENON_FC_SYNC_RST_EN_DURATION_SHIFT
	.comm	_XENON_FC_SYNC_RST_EN_DURATION_MASK,4,2 ## @XENON_FC_SYNC_RST_EN_DURATION_MASK
	.comm	_XENON_FC_SYNC_EN_DURATION_SHIFT,4,2 ## @XENON_FC_SYNC_EN_DURATION_SHIFT
	.comm	_XENON_FC_SYNC_EN_DURATION_MASK,4,2 ## @XENON_FC_SYNC_EN_DURATION_MASK
	.comm	_XENON_WAIT_CYCLE_BEFORE_USING_SHIFT,4,2 ## @XENON_WAIT_CYCLE_BEFORE_USING_SHIFT
	.comm	_XENON_WAIT_CYCLE_BEFORE_USING_MASK,4,2 ## @XENON_WAIT_CYCLE_BEFORE_USING_MASK
	.comm	_XENON_LOWEST_SDCLK_FREQ,4,2    ## @XENON_LOWEST_SDCLK_FREQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"eMMC PHY init cannot complete after %d us\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_xenon_emmc_phy_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xenon_emmc_phy_init
_xenon_emmc_phy_init:                   ; @xenon_emmc_phy_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
	bl	_sdhci_priv
	bl	_sdhci_pltfm_priv
	ldr	x21, [x0]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sdhci_readl
Lloh0:
	adrp	x22, _XENON_PHY_INITIALIZAION@GOTPAGE
Lloh1:
	ldr	x22, [x22, _XENON_PHY_INITIALIZAION@GOTPAGEOFF]
	ldr	w8, [x22]
	orr	w20, w8, w0
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_sdhci_writel
Lloh2:
	adrp	x8, _XENON_FC_SYNC_RST_DURATION_SHIFT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XENON_FC_SYNC_RST_DURATION_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	asr	w8, w20, w8
Lloh5:
	adrp	x9, _XENON_FC_SYNC_RST_DURATION_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _XENON_FC_SYNC_RST_DURATION_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _XENON_FC_SYNC_RST_EN_DURATION_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _XENON_FC_SYNC_RST_EN_DURATION_SHIFT@GOTPAGEOFF]
	and	w8, w8, w9
Lloh10:
	ldr	w9, [x10]
	asr	w9, w20, w9
Lloh11:
	adrp	x10, _XENON_FC_SYNC_RST_EN_DURATION_MASK@GOTPAGE
Lloh12:
	ldr	x10, [x10, _XENON_FC_SYNC_RST_EN_DURATION_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	and	w9, w9, w10
Lloh14:
	adrp	x10, _XENON_FC_SYNC_EN_DURATION_SHIFT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _XENON_FC_SYNC_EN_DURATION_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
Lloh17:
	adrp	x11, _XENON_FC_SYNC_EN_DURATION_MASK@GOTPAGE
Lloh18:
	ldr	x11, [x11, _XENON_FC_SYNC_EN_DURATION_MASK@GOTPAGEOFF]
	asr	w10, w20, w10
Lloh19:
	ldr	w11, [x11]
	and	w10, w10, w11
Lloh20:
	adrp	x11, _XENON_WAIT_CYCLE_BEFORE_USING_SHIFT@GOTPAGE
Lloh21:
	ldr	x11, [x11, _XENON_WAIT_CYCLE_BEFORE_USING_SHIFT@GOTPAGEOFF]
	add	w8, w9, w8
	add	w8, w8, w10
Lloh22:
	ldr	w9, [x11]
	asr	w9, w20, w9
Lloh23:
	adrp	x10, _XENON_WAIT_CYCLE_BEFORE_USING_MASK@GOTPAGE
Lloh24:
	ldr	x10, [x10, _XENON_WAIT_CYCLE_BEFORE_USING_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	and	w9, w9, w10
	add	w8, w8, w9
	lsl	w8, w8, #20
	add	w8, w8, #2048, lsl #12          ; =8388608
Lloh26:
	adrp	x9, _XENON_LOWEST_SDCLK_FREQ@GOTPAGE
Lloh27:
	ldr	x9, [x9, _XENON_LOWEST_SDCLK_FREQ@GOTPAGEOFF]
	ldr	w10, [x19]
Lloh28:
	ldr	w9, [x9]
	cmp	w10, #0
	csel	w9, w9, w10, eq
	sdiv	w8, w8, w9
	add	w20, w8, #1
	mov	x0, x20
	bl	_udelay
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sdhci_readl
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
	bl	_mmc_dev
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh31:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	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 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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_XENON_PHY_INITIALIZAION,4,2    ; @XENON_PHY_INITIALIZAION
	.comm	_XENON_FC_SYNC_RST_DURATION_SHIFT,4,2 ; @XENON_FC_SYNC_RST_DURATION_SHIFT
	.comm	_XENON_FC_SYNC_RST_DURATION_MASK,4,2 ; @XENON_FC_SYNC_RST_DURATION_MASK
	.comm	_XENON_FC_SYNC_RST_EN_DURATION_SHIFT,4,2 ; @XENON_FC_SYNC_RST_EN_DURATION_SHIFT
	.comm	_XENON_FC_SYNC_RST_EN_DURATION_MASK,4,2 ; @XENON_FC_SYNC_RST_EN_DURATION_MASK
	.comm	_XENON_FC_SYNC_EN_DURATION_SHIFT,4,2 ; @XENON_FC_SYNC_EN_DURATION_SHIFT
	.comm	_XENON_FC_SYNC_EN_DURATION_MASK,4,2 ; @XENON_FC_SYNC_EN_DURATION_MASK
	.comm	_XENON_WAIT_CYCLE_BEFORE_USING_SHIFT,4,2 ; @XENON_WAIT_CYCLE_BEFORE_USING_SHIFT
	.comm	_XENON_WAIT_CYCLE_BEFORE_USING_MASK,4,2 ; @XENON_WAIT_CYCLE_BEFORE_USING_MASK
	.comm	_XENON_LOWEST_SDCLK_FREQ,4,2    ; @XENON_LOWEST_SDCLK_FREQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"eMMC PHY init cannot complete after %d us\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_xenon_emmc_phy_init
.subsections_via_symbols
