	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ftgmac100_setup_mdio
_ftgmac100_setup_mdio:                  ## @ftgmac100_setup_mdio
	.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, -48(%rbp)                 ## 8-byte Spill
	callq	_netdev_priv
	movq	%rax, %r15
	movl	8(%rax), %edi
	callq	_to_platform_device
	movq	%rax, %rbx
	movq	_PHY_INTERFACE_MODE_RGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	16(%rbx), %r13
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_mdiobus_alloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_of_device_is_compatible
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_of_device_is_compatible
	testq	%rax, %rax
	je	LBB0_5
LBB0_4:
	movq	_FTGMAC100_OFFSET_REVR@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	24(%r15), %rdi
	callq	_ioread32
	movq	_FTGMAC100_REVR_NEW_MDIO_INTERFACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%r12), %rsi
	addq	24(%r15), %rsi
	callq	_iowrite32
LBB0_5:
	testq	%r13, %r13
	je	LBB0_13
## %bb.6:
	movq	%r13, %rdi
	callq	_of_get_phy_mode
	movl	%eax, %r14d
	testl	%eax, %eax
	movq	_PHY_INTERFACE_MODE_RGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmovsl	%eax, %r14d
	cmpq	$0, 16(%r15)
	je	LBB0_13
## %bb.7:
	movq	_PHY_INTERFACE_MODE_RMII@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	je	LBB0_13
## %bb.8:
	cmpl	%eax, %r14d
	je	LBB0_13
## %bb.9:
	movq	_PHY_INTERFACE_MODE_RGMII_ID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_13
## %bb.10:
	movq	_PHY_INTERFACE_MODE_RGMII_RXID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_13
## %bb.11:
	movq	_PHY_INTERFACE_MODE_RGMII_TXID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_13
## %bb.12:
	movl	%r14d, %edi
	callq	_phy_modes
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_netdev_warn
LBB0_13:
	movq	(%r15), %rax
	leaq	L_.str.3(%rip), %rcx
	movq	%rcx, (%rax)
	movl	32(%rax), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rcx
	movl	8(%rbx), %r8d
	leaq	L_.str.4(%rip), %rdx
	callq	_snprintf
	movl	8(%r15), %eax
	movq	(%r15), %rdi
	movl	%eax, 28(%rdi)
	movl	12(%r15), %eax
	movl	%eax, 24(%rdi)
	movq	_ftgmac100_mdiobus_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rdi)
	movq	_ftgmac100_mdiobus_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rdi)
	movq	_PHY_MAX_ADDR@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.14:
	movq	8(%rdi), %rcx
	xorl	%edx, %edx
	movq	_PHY_POLL@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %ebx
	movl	%ebx, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rbx
	cmpq	%rbx, %rdx
	jl	LBB0_15
LBB0_16:
	callq	_mdiobus_register
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r12d
	movl	8(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_21
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_22
LBB0_18:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ftgmac100_mii_probe
	testl	%eax, %eax
	je	LBB0_19
## %bb.20:
	movl	%eax, %r12d
	movl	8(%r15), %edi
	leaq	L_.str.6(%rip), %rsi
	callq	_dev_err
	movq	(%r15), %rdi
	callq	_mdiobus_unregister
LBB0_21:
	movq	(%r15), %rdi
	callq	_mdiobus_free
LBB0_22:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	xorl	%r12d, %r12d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_INTERFACE_MODE_RGMII,4,2   ## @PHY_INTERFACE_MODE_RGMII
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"aspeed,ast2400-mac"

L_.str.1:                               ## @.str.1
	.asciz	"aspeed,ast2500-mac"

	.comm	_FTGMAC100_OFFSET_REVR,8,3      ## @FTGMAC100_OFFSET_REVR
	.comm	_FTGMAC100_REVR_NEW_MDIO_INTERFACE,4,2 ## @FTGMAC100_REVR_NEW_MDIO_INTERFACE
	.comm	_PHY_INTERFACE_MODE_RMII,4,2    ## @PHY_INTERFACE_MODE_RMII
	.comm	_PHY_INTERFACE_MODE_RGMII_ID,4,2 ## @PHY_INTERFACE_MODE_RGMII_ID
	.comm	_PHY_INTERFACE_MODE_RGMII_RXID,4,2 ## @PHY_INTERFACE_MODE_RGMII_RXID
	.comm	_PHY_INTERFACE_MODE_RGMII_TXID,4,2 ## @PHY_INTERFACE_MODE_RGMII_TXID
L_.str.2:                               ## @.str.2
	.asciz	"Unsupported PHY mode %s !\n"

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

	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"%s-%d"

	.comm	_ftgmac100_mdiobus_read,4,2     ## @ftgmac100_mdiobus_read
	.comm	_ftgmac100_mdiobus_write,4,2    ## @ftgmac100_mdiobus_write
	.comm	_PHY_MAX_ADDR,4,2               ## @PHY_MAX_ADDR
	.comm	_PHY_POLL,4,2                   ## @PHY_POLL
L_.str.5:                               ## @.str.5
	.asciz	"Cannot register MDIO bus!\n"

L_.str.6:                               ## @.str.6
	.asciz	"MII Probe failed!\n"

	.no_dead_strip	_ftgmac100_setup_mdio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ftgmac100_setup_mdio
_ftgmac100_setup_mdio:                  ; @ftgmac100_setup_mdio
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x0
	bl	_netdev_priv
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_to_platform_device
	mov	x21, x0
Lloh0:
	adrp	x24, _PHY_INTERFACE_MODE_RGMII@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PHY_INTERFACE_MODE_RGMII@GOTPAGEOFF]
	ldr	w20, [x24]
	ldr	x23, [x0, #16]
	bl	_mdiobus_alloc
	str	x0, [x19]
	cbz	x0, LBB0_13
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_of_device_is_compatible
	cbnz	x0, LBB0_3
; %bb.2:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_of_device_is_compatible
	cbz	x0, LBB0_4
LBB0_3:
	ldr	x8, [x19, #24]
Lloh6:
	adrp	x25, _FTGMAC100_OFFSET_REVR@GOTPAGE
Lloh7:
	ldr	x25, [x25, _FTGMAC100_OFFSET_REVR@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_ioread32
Lloh8:
	adrp	x8, _FTGMAC100_REVR_NEW_MDIO_INTERFACE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FTGMAC100_REVR_NEW_MDIO_INTERFACE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	bic	w0, w0, w8
	ldr	x8, [x19, #24]
	ldr	x9, [x25]
	add	x1, x9, x8
	bl	_iowrite32
LBB0_4:
	cbz	x23, LBB0_8
; %bb.5:
	mov	x0, x23
	bl	_of_get_phy_mode
	ldr	w8, [x24]
	cmp	w0, #0
	csel	w20, w8, w0, lt
	ldr	x9, [x19, #16]
	cbz	x9, LBB0_8
; %bb.6:
Lloh11:
	adrp	x9, _PHY_INTERFACE_MODE_RMII@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_RMII@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _PHY_INTERFACE_MODE_RGMII_ID@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PHY_INTERFACE_MODE_RGMII_ID@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
Lloh17:
	adrp	x11, _PHY_INTERFACE_MODE_RGMII_RXID@GOTPAGE
Lloh18:
	ldr	x11, [x11, _PHY_INTERFACE_MODE_RGMII_RXID@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
Lloh20:
	adrp	x12, _PHY_INTERFACE_MODE_RGMII_TXID@GOTPAGE
Lloh21:
	ldr	x12, [x12, _PHY_INTERFACE_MODE_RGMII_TXID@GOTPAGEOFF]
Lloh22:
	ldr	w12, [x12]
	cmp	w20, w9
	ccmp	w20, w8, #4, ne
	ccmp	w20, w10, #4, ne
	ccmp	w20, w11, #4, ne
	ccmp	w20, w12, #4, ne
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_phy_modes
	mov	x2, x0
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_netdev_warn
LBB0_8:
	ldr	x8, [x19]
Lloh25:
	adrp	x9, l_.str.3@PAGE
Lloh26:
	add	x9, x9, l_.str.3@PAGEOFF
	str	x9, [x8]
	ldr	w0, [x8, #32]
Lloh27:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	ldr	x3, [x21]
	ldr	w4, [x21, #8]
Lloh30:
	adrp	x2, l_.str.4@PAGE
Lloh31:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_snprintf
	ldr	x0, [x19]
	ldr	d0, [x19, #8]
	rev64.2s	v0, v0
	str	d0, [x0, #24]
Lloh32:
	adrp	x8, _ftgmac100_mdiobus_read@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ftgmac100_mdiobus_read@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, _ftgmac100_mdiobus_write@GOTPAGE
Lloh36:
	ldr	x9, [x9, _ftgmac100_mdiobus_write@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #16]
Lloh38:
	adrp	x8, _PHY_MAX_ADDR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _PHY_MAX_ADDR@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.9:
	mov	x9, #0
	ldr	x10, [x0, #8]
Lloh40:
	adrp	x11, _PHY_POLL@GOTPAGE
Lloh41:
	ldr	x11, [x11, _PHY_POLL@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	str	w12, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_10
LBB0_11:
	bl	_mdiobus_register
	cbz	w0, LBB0_14
; %bb.12:
	mov	x21, x0
	ldr	w0, [x19, #8]
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	b	LBB0_16
LBB0_13:
Lloh44:
	adrp	x8, _EIO@GOTPAGE
Lloh45:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_14:
	mov	x0, x19
	mov	x1, x20
	bl	_ftgmac100_mii_probe
	mov	x21, x0
	cbz	w0, LBB0_17
; %bb.15:
	ldr	w0, [x19, #8]
Lloh47:
	adrp	x1, l_.str.6@PAGE
Lloh48:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19]
	bl	_mdiobus_unregister
LBB0_16:
	ldr	x0, [x19]
	bl	_mdiobus_free
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_INTERFACE_MODE_RGMII,4,2   ; @PHY_INTERFACE_MODE_RGMII
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"aspeed,ast2400-mac"

l_.str.1:                               ; @.str.1
	.asciz	"aspeed,ast2500-mac"

	.comm	_FTGMAC100_OFFSET_REVR,8,3      ; @FTGMAC100_OFFSET_REVR
	.comm	_FTGMAC100_REVR_NEW_MDIO_INTERFACE,4,2 ; @FTGMAC100_REVR_NEW_MDIO_INTERFACE
	.comm	_PHY_INTERFACE_MODE_RMII,4,2    ; @PHY_INTERFACE_MODE_RMII
	.comm	_PHY_INTERFACE_MODE_RGMII_ID,4,2 ; @PHY_INTERFACE_MODE_RGMII_ID
	.comm	_PHY_INTERFACE_MODE_RGMII_RXID,4,2 ; @PHY_INTERFACE_MODE_RGMII_RXID
	.comm	_PHY_INTERFACE_MODE_RGMII_TXID,4,2 ; @PHY_INTERFACE_MODE_RGMII_TXID
l_.str.2:                               ; @.str.2
	.asciz	"Unsupported PHY mode %s !\n"

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

	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"%s-%d"

	.comm	_ftgmac100_mdiobus_read,4,2     ; @ftgmac100_mdiobus_read
	.comm	_ftgmac100_mdiobus_write,4,2    ; @ftgmac100_mdiobus_write
	.comm	_PHY_MAX_ADDR,4,2               ; @PHY_MAX_ADDR
	.comm	_PHY_POLL,4,2                   ; @PHY_POLL
l_.str.5:                               ; @.str.5
	.asciz	"Cannot register MDIO bus!\n"

l_.str.6:                               ; @.str.6
	.asciz	"MII Probe failed!\n"

	.no_dead_strip	_ftgmac100_setup_mdio
.subsections_via_symbols
