	.file	"extr_cvmx-mgmt-port.c_cvmx_mgmt_port_enable.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cvmx_mgmt_port_enable
	.type	cvmx_mgmt_port_enable, @function
cvmx_mgmt_port_enable:
.LFB0:
	.cfi_startproc
	endbr64
	test	edi, edi
	js	.L13
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	eax, eax
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	__cvmx_mgmt_port_num_ports@PLT
	cmp	eax, ebp
	jg	.L14
	mov	eax, DWORD PTR CVMX_MGMT_PORT_INVALID_PARAM[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	rdx, QWORD PTR cvmx_mgmt_port_state_ptr[rip]
	movsx	rax, ebp
	lea	r12, [rdx+rax*4]
	mov	rdi, r12
	call	cvmx_spinlock_lock@PLT
	mov	edi, ebp
	call	CVMX_AGL_GMX_RXX_FRM_CTL@PLT
	xor	esi, esi
	mov	edi, eax
	call	cvmx_write_csr@PLT
	mov	edi, DWORD PTR OCTEON_CN5XXX[rip]
	call	OCTEON_IS_MODEL@PLT
	test	rax, rax
	jne	.L15
.L5:
	mov	edi, ebp
	call	cvmx_mgmt_port_link_get@PLT
	mov	edi, ebp
	mov	esi, eax
	call	cvmx_mgmt_port_link_set@PLT
	mov	rdi, r12
	call	cvmx_spinlock_unlock@PLT
	mov	eax, DWORD PTR CVMX_MGMT_PORT_SUCCESS[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore 6
	.cfi_restore 12
	mov	eax, DWORD PTR CVMX_MGMT_PORT_INVALID_PARAM[rip]
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -24
	.cfi_offset 12, -16
	mov	edi, DWORD PTR CVMX_AGL_GMX_INF_MODE[rip]
	xor	esi, esi
	call	cvmx_write_csr@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	cvmx_mgmt_port_enable, .-cvmx_mgmt_port_enable
	.comm	cvmx_mgmt_port_state_ptr,8,8
	.comm	OCTEON_CN5XXX,4,4
	.comm	CVMX_MGMT_PORT_SUCCESS,4,4
	.comm	CVMX_MGMT_PORT_INVALID_PARAM,4,4
	.comm	CVMX_AGL_GMX_INF_MODE,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_cvmx-mgmt-port.c_cvmx_mgmt_port_enable.c"
	.text
	.align	2
	.global	cvmx_mgmt_port_enable
	.syntax unified
	.arm
	.fpu softvfp
	.type	cvmx_mgmt_port_enable, %function
cvmx_mgmt_port_enable:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r4, r0, #0
	blt	.L4
	bl	__cvmx_mgmt_port_num_ports
	cmp	r0, r4
	bgt	.L11
.L4:
	ldr	r3, .L13
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L11:
	ldr	r3, .L13+4
	ldr	r5, [r3]
	add	r5, r5, r4, lsl #2
	mov	r0, r5
	bl	cvmx_spinlock_lock
	mov	r0, r4
	bl	CVMX_AGL_GMX_RXX_FRM_CTL
	mov	r1, #0
	bl	cvmx_write_csr
	ldr	r3, .L13+8
	ldr	r0, [r3]
	bl	OCTEON_IS_MODEL
	cmp	r0, #0
	bne	.L12
.L5:
	mov	r0, r4
	bl	cvmx_mgmt_port_link_get
	mov	r1, r0
	mov	r0, r4
	bl	cvmx_mgmt_port_link_set
	mov	r0, r5
	bl	cvmx_spinlock_unlock
	ldr	r3, .L13+12
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L12:
	ldr	r3, .L13+16
	mov	r1, #0
	ldr	r0, [r3]
	bl	cvmx_write_csr
	b	.L5
.L14:
	.align	2
.L13:
	.word	CVMX_MGMT_PORT_INVALID_PARAM
	.word	cvmx_mgmt_port_state_ptr
	.word	OCTEON_CN5XXX
	.word	CVMX_MGMT_PORT_SUCCESS
	.word	CVMX_AGL_GMX_INF_MODE
	.size	cvmx_mgmt_port_enable, .-cvmx_mgmt_port_enable
	.comm	cvmx_mgmt_port_state_ptr,4,4
	.comm	OCTEON_CN5XXX,4,4
	.comm	CVMX_MGMT_PORT_SUCCESS,4,4
	.comm	CVMX_MGMT_PORT_INVALID_PARAM,4,4
	.comm	CVMX_AGL_GMX_INF_MODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
