	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function awg_setup_phy
_awg_setup_phy:                         ## @awg_setup_phy
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r12d
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%r12d, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	leaq	-56(%rbp), %rdx
	movl	%eax, %edi
	callq	_OF_getprop_alloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	cmpq	$0, 16(%r15)
	jne	LBB0_3
## %bb.2:
	movq	8(%r15), %rax
	movq	__RES_SYSCON@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_18
LBB0_3:
	xorl	%ebx, %ebx
LBB0_4:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	-56(%rbp), %rdx
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	testb	%bl, %bl
	cmovneq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_6:
	testb	%bl, %bl
	je	LBB0_11
## %bb.7:
	movq	-56(%rbp), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	$5, %edx
	callq	_strncmp
	testq	%rax, %rax
	leaq	L_.str.8(%rip), %rax
	leaq	L_.str.9(%rip), %r14
	cmoveq	%rax, %r14
	leaq	L_.str.10(%rip), %rdx
	leaq	-44(%rbp), %rcx
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_clk_get_by_ofw_name
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.11(%rip), %rsi
LBB0_9:
	movl	%r12d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_31
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_32
LBB0_11:
	movl	%r12d, %edi
	callq	_syscon_read_emac_clk_reg
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	_EMAC_CLK_PIT@GOTPCREL(%rip), %rax
	movq	_EMAC_CLK_SRC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movq	_EMAC_CLK_RMII_EN@GOTPCREL(%rip), %rbx
	orl	(%rbx), %r13d
	movq	-56(%rbp), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	$5, %edx
	callq	_strncmp
	testq	%rax, %rax
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	je	LBB0_16
## %bb.12:
	movq	-56(%rbp), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_19
## %bb.13:
	movq	_EMAC_CLK_PIT_MII@GOTPCREL(%rip), %rax
	movq	_EMAC_CLK_SRC_MII@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_14:
	leaq	-48(%rbp), %rdx
	movl	%r12d, %edi
	movq	%r14, %rsi
	callq	_clk_get_by_name
	testl	%eax, %eax
	je	LBB0_24
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.12(%rip), %rsi
	movl	%r12d, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_31
LBB0_16:
	movq	_EMAC_CLK_PIT_RGMII@GOTPCREL(%rip), %rax
	movq	_EMAC_CLK_SRC_RGMII@GOTPCREL(%rip), %rcx
LBB0_17:
	movl	(%rcx), %r14d
	orl	(%rax), %r14d
	jmp	LBB0_20
LBB0_18:
	movb	$1, %bl
	jmp	LBB0_4
LBB0_19:
	movl	(%rbx), %r14d
LBB0_20:
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movl	%r12d, %edi
	callq	_awg_parse_delay
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_31
## %bb.21:
	notl	%r13d
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	andl	%r13d, %eax
	orl	%eax, %r14d
	movq	_EMAC_CLK_ETXDC@GOTPCREL(%rip), %rcx
	movq	_EMAC_CLK_ERXDC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	notl	%eax
	andl	%r14d, %eax
	movl	-44(%rbp), %edx
	movq	_EMAC_CLK_ETXDC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%edx, %esi
	shll	%cl, %esi
	xorl	%edi, %edi
	testl	%edx, %edx
	cmovlel	%edi, %esi
	movl	-48(%rbp), %edx
	movq	_EMAC_CLK_ERXDC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%edx, %ebx
	shll	%cl, %ebx
	testl	%edx, %edx
	cmovlel	%edi, %ebx
	orl	%esi, %ebx
	orl	%eax, %ebx
	movq	(%r15), %rax
	movq	_EMAC_H3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_27
## %bb.22:
	movl	%r12d, %edi
	callq	_awg_has_internal_phy
	movq	_EMAC_CLK_EPHY_SELECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testq	%rax, %rax
	je	LBB0_26
## %bb.23:
	orl	%ebx, %ecx
	movq	_EMAC_CLK_EPHY_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	andl	%ecx, %ebx
	leaq	L_.str.6(%rip), %rsi
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_OF_hasprop
	movq	_EMAC_CLK_EPHY_LED_POL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	orl	%ebx, %edx
	notl	%ecx
	andl	%ebx, %ecx
	testq	%rax, %rax
	cmovnel	%edx, %ecx
	movq	_EMAC_CLK_EPHY_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	andl	%ecx, %ebx
	movq	_EMAC_CLK_EPHY_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	btsl	%eax, %ebx
	jmp	LBB0_27
LBB0_24:
	movl	-44(%rbp), %edi
	movl	-48(%rbp), %esi
	callq	_clk_set_parent_by_clk
	testl	%eax, %eax
	je	LBB0_33
## %bb.25:
	movl	%eax, %ebx
	leaq	L_.str.13(%rip), %rsi
	jmp	LBB0_9
LBB0_26:
	notl	%ecx
	andl	%ecx, %ebx
LBB0_27:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_29
## %bb.28:
	leaq	L_.str.7(%rip), %rsi
	movl	%r12d, %edi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_29:
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_syscon_write_emac_clk_reg
LBB0_30:
	xorl	%ebx, %ebx
LBB0_31:
	movq	-56(%rbp), %rdi
	callq	_OF_prop_free
LBB0_32:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_33:
	movl	-44(%rbp), %edi
	callq	_clk_enable
	testl	%eax, %eax
	je	LBB0_30
## %bb.34:
	movl	%eax, %ebx
	leaq	L_.str.14(%rip), %rsi
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy-mode"

	.comm	__RES_SYSCON,8,3                ## @_RES_SYSCON
	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.1:                               ## @.str.1
	.asciz	"PHY type: %s, conf mode: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"reg"

L_.str.3:                               ## @.str.3
	.asciz	"clk"

	.comm	_EMAC_CLK_PIT,4,2               ## @EMAC_CLK_PIT
	.comm	_EMAC_CLK_SRC,4,2               ## @EMAC_CLK_SRC
	.comm	_EMAC_CLK_RMII_EN,4,2           ## @EMAC_CLK_RMII_EN
L_.str.4:                               ## @.str.4
	.asciz	"rgmii"

	.comm	_EMAC_CLK_PIT_RGMII,4,2         ## @EMAC_CLK_PIT_RGMII
	.comm	_EMAC_CLK_SRC_RGMII,4,2         ## @EMAC_CLK_SRC_RGMII
L_.str.5:                               ## @.str.5
	.asciz	"rmii"

	.comm	_EMAC_CLK_PIT_MII,4,2           ## @EMAC_CLK_PIT_MII
	.comm	_EMAC_CLK_SRC_MII,4,2           ## @EMAC_CLK_SRC_MII
	.comm	_EMAC_CLK_ETXDC,4,2             ## @EMAC_CLK_ETXDC
	.comm	_EMAC_CLK_ERXDC,4,2             ## @EMAC_CLK_ERXDC
	.comm	_EMAC_CLK_ETXDC_SHIFT,4,2       ## @EMAC_CLK_ETXDC_SHIFT
	.comm	_EMAC_CLK_ERXDC_SHIFT,4,2       ## @EMAC_CLK_ERXDC_SHIFT
	.comm	_EMAC_H3,8,3                    ## @EMAC_H3
	.comm	_EMAC_CLK_EPHY_SELECT,4,2       ## @EMAC_CLK_EPHY_SELECT
	.comm	_EMAC_CLK_EPHY_SHUTDOWN,4,2     ## @EMAC_CLK_EPHY_SHUTDOWN
L_.str.6:                               ## @.str.6
	.asciz	"allwinner,leds-active-low"

	.comm	_EMAC_CLK_EPHY_LED_POL,4,2      ## @EMAC_CLK_EPHY_LED_POL
	.comm	_EMAC_CLK_EPHY_ADDR,4,2         ## @EMAC_CLK_EPHY_ADDR
	.comm	_EMAC_CLK_EPHY_ADDR_SHIFT,4,2   ## @EMAC_CLK_EPHY_ADDR_SHIFT
L_.str.7:                               ## @.str.7
	.asciz	"EMAC clock: 0x%08x\n"

L_.str.8:                               ## @.str.8
	.asciz	"emac_int_tx"

L_.str.9:                               ## @.str.9
	.asciz	"mii_phy_tx"

L_.str.10:                              ## @.str.10
	.asciz	"tx"

L_.str.11:                              ## @.str.11
	.asciz	"cannot get tx clock\n"

L_.str.12:                              ## @.str.12
	.asciz	"cannot get clock '%s'\n"

L_.str.13:                              ## @.str.13
	.asciz	"cannot set tx clock parent\n"

L_.str.14:                              ## @.str.14
	.asciz	"cannot enable tx clock\n"

	.no_dead_strip	_awg_setup_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function awg_setup_phy
_awg_setup_phy:                         ; @awg_setup_phy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_device_get_softc
	mov	x21, x0
	mov	x0, x19
	bl	_ofw_bus_get_node
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #16
	bl	_OF_getprop_alloc
	cbz	x0, LBB0_9
; %bb.1:
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x21, #8]
Lloh2:
	adrp	x9, __RES_SYSCON@GOTPAGE
Lloh3:
	ldr	x9, [x9, __RES_SYSCON@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_17
LBB0_3:
	mov	w22, #0
LBB0_4:
Lloh5:
	adrp	x24, _bootverbose@GOTPAGE
Lloh6:
	ldr	x24, [x24, _bootverbose@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	x8, [sp, #16]
Lloh7:
	adrp	x9, l_.str.2@PAGE
Lloh8:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh9:
	adrp	x10, l_.str.3@PAGE
Lloh10:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	w22, #0
	csel	x9, x10, x9, ne
	stp	x8, x9, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_6:
	tbz	w22, #0, LBB0_10
; %bb.7:
	ldr	x0, [sp, #16]
Lloh13:
	adrp	x1, l_.str.4@PAGE
Lloh14:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w2, #5
	bl	_strncmp
Lloh15:
	adrp	x8, l_.str.9@PAGE
Lloh16:
	add	x8, x8, l_.str.9@PAGEOFF
Lloh17:
	adrp	x9, l_.str.8@PAGE
Lloh18:
	add	x9, x9, l_.str.8@PAGEOFF
	cmp	x0, #0
	csel	x20, x9, x8, eq
Lloh19:
	adrp	x2, l_.str.10@PAGE
Lloh20:
	add	x2, x2, l_.str.10@PAGEOFF
	add	x3, sp, #28
	mov	x0, x19
	mov	w1, #0
	bl	_clk_get_by_ofw_name
	cbz	w0, LBB0_13
; %bb.8:
	mov	x22, x0
Lloh21:
	adrp	x1, l_.str.11@PAGE
Lloh22:
	add	x1, x1, l_.str.11@PAGEOFF
	b	LBB0_31
LBB0_9:
	mov	w22, #0
	b	LBB0_33
LBB0_10:
	mov	x0, x19
	bl	_syscon_read_emac_clk_reg
	mov	x23, x0
Lloh23:
	adrp	x8, _EMAC_CLK_PIT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EMAC_CLK_PIT@GOTPAGEOFF]
Lloh25:
	adrp	x9, _EMAC_CLK_SRC@GOTPAGE
Lloh26:
	ldr	x9, [x9, _EMAC_CLK_SRC@GOTPAGEOFF]
Lloh27:
	ldr	w25, [x8]
Lloh28:
	ldr	w26, [x9]
Lloh29:
	adrp	x22, _EMAC_CLK_RMII_EN@GOTPAGE
Lloh30:
	ldr	x22, [x22, _EMAC_CLK_RMII_EN@GOTPAGEOFF]
	ldr	w27, [x22]
	ldr	x0, [sp, #16]
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w2, #5
	bl	_strncmp
	cbz	x0, LBB0_15
; %bb.11:
	ldr	x0, [sp, #16]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_18
; %bb.12:
Lloh35:
	adrp	x8, _EMAC_CLK_PIT_MII@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EMAC_CLK_PIT_MII@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _EMAC_CLK_SRC_MII@GOTPAGE
Lloh39:
	ldr	x9, [x9, _EMAC_CLK_SRC_MII@GOTPAGEOFF]
	b	LBB0_16
LBB0_13:
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x20
	bl	_clk_get_by_name
	cbz	w0, LBB0_26
; %bb.14:
	mov	x22, x0
	str	x20, [sp]
Lloh40:
	adrp	x1, l_.str.12@PAGE
Lloh41:
	add	x1, x1, l_.str.12@PAGEOFF
	b	LBB0_31
LBB0_15:
Lloh42:
	adrp	x8, _EMAC_CLK_PIT_RGMII@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EMAC_CLK_PIT_RGMII@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
Lloh45:
	adrp	x9, _EMAC_CLK_SRC_RGMII@GOTPAGE
Lloh46:
	ldr	x9, [x9, _EMAC_CLK_SRC_RGMII@GOTPAGEOFF]
LBB0_16:
	ldr	w9, [x9]
	orr	w28, w9, w8
	b	LBB0_19
LBB0_17:
	mov	w22, #1
	b	LBB0_4
LBB0_18:
	ldr	w28, [x22]
LBB0_19:
	add	x1, sp, #28
	add	x2, sp, #24
	mov	x0, x19
	bl	_awg_parse_delay
	mov	x22, x0
	cbnz	w0, LBB0_32
; %bb.20:
	orr	w8, w26, w25
	orr	w8, w8, w27
	bic	w8, w23, w8
	orr	w8, w28, w8
Lloh47:
	adrp	x9, _EMAC_CLK_ETXDC@GOTPAGE
Lloh48:
	ldr	x9, [x9, _EMAC_CLK_ETXDC@GOTPAGEOFF]
Lloh49:
	ldr	w9, [x9]
Lloh50:
	adrp	x10, _EMAC_CLK_ERXDC@GOTPAGE
Lloh51:
	ldr	x10, [x10, _EMAC_CLK_ERXDC@GOTPAGEOFF]
Lloh52:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bic	w8, w8, w9
	ldr	w9, [sp, #28]
Lloh53:
	adrp	x10, _EMAC_CLK_ETXDC_SHIFT@GOTPAGE
Lloh54:
	ldr	x10, [x10, _EMAC_CLK_ETXDC_SHIFT@GOTPAGEOFF]
Lloh55:
	ldr	w10, [x10]
	lsl	w10, w9, w10
	cmp	w9, #0
	csel	w9, w10, wzr, gt
	orr	w8, w9, w8
	ldr	w9, [sp, #24]
Lloh56:
	adrp	x10, _EMAC_CLK_ERXDC_SHIFT@GOTPAGE
Lloh57:
	ldr	x10, [x10, _EMAC_CLK_ERXDC_SHIFT@GOTPAGEOFF]
Lloh58:
	ldr	w10, [x10]
	lsl	w10, w9, w10
	cmp	w9, #0
	csel	w9, w10, wzr, gt
	orr	w22, w8, w9
	ldr	x8, [x21]
Lloh59:
	adrp	x9, _EMAC_H3@GOTPAGE
Lloh60:
	ldr	x9, [x9, _EMAC_H3@GOTPAGEOFF]
Lloh61:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_23
; %bb.21:
	mov	x0, x19
	bl	_awg_has_internal_phy
Lloh62:
	adrp	x8, _EMAC_CLK_EPHY_SELECT@GOTPAGE
Lloh63:
	ldr	x8, [x8, _EMAC_CLK_EPHY_SELECT@GOTPAGEOFF]
Lloh64:
	ldr	w8, [x8]
	cbz	x0, LBB0_28
; %bb.22:
	orr	w8, w8, w22
Lloh65:
	adrp	x9, _EMAC_CLK_EPHY_SHUTDOWN@GOTPAGE
Lloh66:
	ldr	x9, [x9, _EMAC_CLK_EPHY_SHUTDOWN@GOTPAGEOFF]
Lloh67:
	ldr	w9, [x9]
	bic	w21, w8, w9
Lloh68:
	adrp	x1, l_.str.6@PAGE
Lloh69:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_OF_hasprop
Lloh70:
	adrp	x8, _EMAC_CLK_EPHY_LED_POL@GOTPAGE
Lloh71:
	ldr	x8, [x8, _EMAC_CLK_EPHY_LED_POL@GOTPAGEOFF]
Lloh72:
	ldr	w8, [x8]
	orr	w9, w8, w21
	bic	w8, w21, w8
	cmp	x0, #0
	csel	w8, w8, w9, eq
Lloh73:
	adrp	x9, _EMAC_CLK_EPHY_ADDR@GOTPAGE
Lloh74:
	ldr	x9, [x9, _EMAC_CLK_EPHY_ADDR@GOTPAGEOFF]
Lloh75:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh76:
	adrp	x9, _EMAC_CLK_EPHY_ADDR_SHIFT@GOTPAGE
Lloh77:
	ldr	x9, [x9, _EMAC_CLK_EPHY_ADDR_SHIFT@GOTPAGEOFF]
Lloh78:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	orr	w22, w9, w8
LBB0_23:
	ldr	x8, [x24]
	cbz	x8, LBB0_25
LBB0_24:
	str	x22, [sp]
Lloh79:
	adrp	x1, l_.str.7@PAGE
Lloh80:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_25:
	mov	x0, x19
	mov	x1, x22
	bl	_syscon_write_emac_clk_reg
	mov	w22, #0
	b	LBB0_32
LBB0_26:
	ldp	w1, w0, [sp, #24]
	bl	_clk_set_parent_by_clk
	cbz	w0, LBB0_29
; %bb.27:
	mov	x22, x0
Lloh81:
	adrp	x1, l_.str.13@PAGE
Lloh82:
	add	x1, x1, l_.str.13@PAGEOFF
	b	LBB0_31
LBB0_28:
	bic	w22, w22, w8
	ldr	x8, [x24]
	cbnz	x8, LBB0_24
	b	LBB0_25
LBB0_29:
	ldr	w0, [sp, #28]
	bl	_clk_enable
	mov	x22, x0
	cbz	w0, LBB0_32
; %bb.30:
Lloh83:
	adrp	x1, l_.str.14@PAGE
Lloh84:
	add	x1, x1, l_.str.14@PAGEOFF
LBB0_31:
	mov	x0, x19
	bl	_device_printf
LBB0_32:
	ldr	x0, [sp, #16]
	bl	_OF_prop_free
LBB0_33:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh76, Lloh77, Lloh78
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpAdd	Lloh79, Lloh80
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpAdd	Lloh83, Lloh84
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy-mode"

	.comm	__RES_SYSCON,8,3                ; @_RES_SYSCON
	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.1:                               ; @.str.1
	.asciz	"PHY type: %s, conf mode: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"reg"

l_.str.3:                               ; @.str.3
	.asciz	"clk"

	.comm	_EMAC_CLK_PIT,4,2               ; @EMAC_CLK_PIT
	.comm	_EMAC_CLK_SRC,4,2               ; @EMAC_CLK_SRC
	.comm	_EMAC_CLK_RMII_EN,4,2           ; @EMAC_CLK_RMII_EN
l_.str.4:                               ; @.str.4
	.asciz	"rgmii"

	.comm	_EMAC_CLK_PIT_RGMII,4,2         ; @EMAC_CLK_PIT_RGMII
	.comm	_EMAC_CLK_SRC_RGMII,4,2         ; @EMAC_CLK_SRC_RGMII
l_.str.5:                               ; @.str.5
	.asciz	"rmii"

	.comm	_EMAC_CLK_PIT_MII,4,2           ; @EMAC_CLK_PIT_MII
	.comm	_EMAC_CLK_SRC_MII,4,2           ; @EMAC_CLK_SRC_MII
	.comm	_EMAC_CLK_ETXDC,4,2             ; @EMAC_CLK_ETXDC
	.comm	_EMAC_CLK_ERXDC,4,2             ; @EMAC_CLK_ERXDC
	.comm	_EMAC_CLK_ETXDC_SHIFT,4,2       ; @EMAC_CLK_ETXDC_SHIFT
	.comm	_EMAC_CLK_ERXDC_SHIFT,4,2       ; @EMAC_CLK_ERXDC_SHIFT
	.comm	_EMAC_H3,8,3                    ; @EMAC_H3
	.comm	_EMAC_CLK_EPHY_SELECT,4,2       ; @EMAC_CLK_EPHY_SELECT
	.comm	_EMAC_CLK_EPHY_SHUTDOWN,4,2     ; @EMAC_CLK_EPHY_SHUTDOWN
l_.str.6:                               ; @.str.6
	.asciz	"allwinner,leds-active-low"

	.comm	_EMAC_CLK_EPHY_LED_POL,4,2      ; @EMAC_CLK_EPHY_LED_POL
	.comm	_EMAC_CLK_EPHY_ADDR,4,2         ; @EMAC_CLK_EPHY_ADDR
	.comm	_EMAC_CLK_EPHY_ADDR_SHIFT,4,2   ; @EMAC_CLK_EPHY_ADDR_SHIFT
l_.str.7:                               ; @.str.7
	.asciz	"EMAC clock: 0x%08x\n"

l_.str.8:                               ; @.str.8
	.asciz	"emac_int_tx"

l_.str.9:                               ; @.str.9
	.asciz	"mii_phy_tx"

l_.str.10:                              ; @.str.10
	.asciz	"tx"

l_.str.11:                              ; @.str.11
	.asciz	"cannot get tx clock\n"

l_.str.12:                              ; @.str.12
	.asciz	"cannot get clock '%s'\n"

l_.str.13:                              ; @.str.13
	.asciz	"cannot set tx clock parent\n"

l_.str.14:                              ; @.str.14
	.asciz	"cannot enable tx clock\n"

	.no_dead_strip	_awg_setup_phy
.subsections_via_symbols
