	.file	"extr_cvmx-l2c.c_cvmx_l2c_set_core_way_partition.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cvmx_l2c_set_core_way_partition
	.type	cvmx_l2c_set_core_way_partition, @function
cvmx_l2c_set_core_way_partition:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	eax, eax
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	cvmx_l2c_get_num_assoc@PLT
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	lea	eax, -1[rdx]
	and	ebp, eax
	cmp	eax, ebp
	je	.L2
.L5:
	xor	eax, eax
	call	cvmx_octeon_num_cores@PLT
	cmp	eax, r12d
	jle	.L3
	mov	edi, DWORD PTR OCTEON_CN63XX[rip]
	call	OCTEON_IS_MODEL@PLT
	test	rax, rax
	jne	.L17
	mov	ebx, r12d
	and	r12d, 12
	and	ebx, 3
	sal	ebx, 3
	cmp	r12d, 8
	je	.L8
	jg	.L9
	test	r12d, r12d
	je	.L10
	cmp	r12d, 4
	jne	.L15
	mov	edi, DWORD PTR CVMX_L2C_SPAR1[rip]
	xor	r12d, r12d
	call	cvmx_read_csr@PLT
	mov	edx, 255
	mov	ecx, ebx
	mov	esi, ebp
	mov	r8d, eax
	mov	eax, edx
	sal	esi, cl
	mov	edi, DWORD PTR CVMX_L2C_SPAR1[rip]
	sal	eax, cl
	not	eax
	and	eax, r8d
	or	esi, eax
	call	cvmx_write_csr@PLT
.L1:
	mov	eax, r12d
	pop	rbx
	.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
.L9:
	.cfi_restore_state
	cmp	r12d, 12
	jne	.L15
	mov	edi, DWORD PTR CVMX_L2C_SPAR3[rip]
	call	cvmx_read_csr@PLT
	mov	ecx, ebx
	mov	edx, 255
	mov	edi, DWORD PTR CVMX_L2C_SPAR3[rip]
	sal	edx, cl
	sal	ebp, cl
	mov	esi, edx
	not	esi
	and	esi, eax
	or	esi, ebp
	call	cvmx_write_csr@PLT
.L15:
	xor	r12d, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR OCTEON_CN63XX[rip]
	call	OCTEON_IS_MODEL@PLT
	test	rax, rax
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	r12d, -1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, DWORD PTR CVMX_L2C_SPAR0[rip]
	call	cvmx_read_csr@PLT
	mov	edx, 255
	mov	ecx, ebx
	mov	esi, ebp
	mov	r8d, eax
	mov	eax, edx
	sal	esi, cl
	mov	edi, DWORD PTR CVMX_L2C_SPAR0[rip]
	sal	eax, cl
	not	eax
	and	eax, r8d
	or	esi, eax
	call	cvmx_write_csr@PLT
	mov	eax, r12d
	pop	rbx
	.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
.L17:
	.cfi_restore_state
	mov	edi, r12d
	xor	r12d, r12d
	call	CVMX_L2C_WPAR_PPX@PLT
	mov	esi, ebp
	mov	edi, eax
	call	cvmx_write_csr@PLT
	mov	eax, r12d
	pop	rbx
	.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
.L8:
	.cfi_restore_state
	mov	edi, DWORD PTR CVMX_L2C_SPAR2[rip]
	xor	r12d, r12d
	call	cvmx_read_csr@PLT
	mov	edx, 255
	mov	ecx, ebx
	mov	esi, ebp
	mov	r8d, eax
	mov	eax, edx
	sal	esi, cl
	mov	edi, DWORD PTR CVMX_L2C_SPAR2[rip]
	sal	eax, cl
	not	eax
	and	eax, r8d
	or	esi, eax
	call	cvmx_write_csr@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	cvmx_l2c_set_core_way_partition, .-cvmx_l2c_set_core_way_partition
	.comm	OCTEON_CN63XX,4,4
	.comm	CVMX_L2C_SPAR3,4,4
	.comm	CVMX_L2C_SPAR2,4,4
	.comm	CVMX_L2C_SPAR1,4,4
	.comm	CVMX_L2C_SPAR0,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-l2c.c_cvmx_l2c_set_core_way_partition.c"
	.text
	.align	2
	.global	cvmx_l2c_set_core_way_partition
	.syntax unified
	.arm
	.fpu softvfp
	.type	cvmx_l2c_set_core_way_partition, %function
cvmx_l2c_set_core_way_partition:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	mov	r4, r0
	bl	cvmx_l2c_get_num_assoc
	mvn	r1, #0
	mvn	r0, r1, lsl r0
	bics	r3, r0, r5
	and	r5, r5, r0
	beq	.L2
.L5:
	bl	cvmx_octeon_num_cores
	cmp	r0, r4
	ble	.L3
	ldr	r3, .L18
	ldr	r0, [r3]
	bl	OCTEON_IS_MODEL
	subs	r7, r0, #0
	bne	.L17
	and	r6, r4, #3
	and	r4, r4, #12
	lsl	r6, r6, #3
	cmp	r4, #12
	ldrls	pc, [pc, r4, asl #2]
	b	.L1
.L9:
	.word	.L12
	.word	.L1
	.word	.L1
	.word	.L1
	.word	.L11
	.word	.L1
	.word	.L1
	.word	.L1
	.word	.L10
	.word	.L1
	.word	.L1
	.word	.L1
	.word	.L8
.L8:
	ldr	r3, .L18+4
.L15:
	ldr	r4, [r3]
	mov	r0, r4
	bl	cvmx_read_csr
	mov	r1, #255
	bic	r1, r0, r1, lsl r6
	orr	r1, r1, r5, lsl r6
	mov	r0, r4
	bl	cvmx_write_csr
.L1:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r3, .L18
	ldr	r0, [r3]
	bl	OCTEON_IS_MODEL
	cmp	r0, #0
	bne	.L5
.L3:
	mvn	r7, #0
	b	.L1
.L12:
	mov	r7, r4
	ldr	r3, .L18+8
	b	.L15
.L11:
	ldr	r3, .L18+12
	b	.L15
.L10:
	ldr	r3, .L18+16
	b	.L15
.L17:
	mov	r7, #0
	mov	r0, r4
	bl	CVMX_L2C_WPAR_PPX
	mov	r1, r5
	bl	cvmx_write_csr
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	.align	2
.L18:
	.word	OCTEON_CN63XX
	.word	CVMX_L2C_SPAR3
	.word	CVMX_L2C_SPAR0
	.word	CVMX_L2C_SPAR1
	.word	CVMX_L2C_SPAR2
	.size	cvmx_l2c_set_core_way_partition, .-cvmx_l2c_set_core_way_partition
	.comm	OCTEON_CN63XX,4,4
	.comm	CVMX_L2C_SPAR3,4,4
	.comm	CVMX_L2C_SPAR2,4,4
	.comm	CVMX_L2C_SPAR1,4,4
	.comm	CVMX_L2C_SPAR0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
