	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_dsaf_get_cfg
_hns_dsaf_get_cfg:                      ## @hns_dsaf_get_cfg
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	$0, -48(%rbp)
	movq	8(%rdi), %rdi
	movq	8(%rdi), %r15
	callq	_to_platform_device
	movq	%rax, %r14
	movq	8(%r12), %rdi
	callq	_dev_of_node
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_of_device_is_compatible
	testq	%rax, %rax
	jne	LBB0_5
LBB0_2:
	movq	_AE_VERSION_2@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	movq	8(%r12), %rax
	movl	(%rax), %edi
	callq	_is_acpi_node
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	movq	_hns_dsaf_acpi_match@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_acpi_dev_found
	testq	%rax, %rax
	je	LBB0_23
LBB0_5:
	movq	_AE_VERSION_1@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %rax
	movq	%rax, 112(%r12)
	movq	8(%r12), %rdi
	leaq	L_.str.2(%rip), %rsi
	leaq	-72(%rbp), %rdx
	callq	_device_property_read_string
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	%eax, %ebx
	movq	8(%r12), %rdi
	leaq	L_.str.3(%rip), %rsi
LBB0_8:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_73
LBB0_9:
	movq	_DSAF_MODE_MAX@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	testl	%ecx, %ecx
	jle	LBB0_16
## %bb.10:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_g_dsaf_mode_match@GOTPCREL(%rip), %r14
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movslq	%ecx, %rax
	cmpq	%rax, %rbx
	jge	LBB0_14
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-72(%rbp), %rdi
	callq	_strcmp
	movl	(%r13), %ecx
	testl	%eax, %eax
	jne	LBB0_11
LBB0_14:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	cmpl	%ecx, %ebx
	jl	LBB0_17
	jmp	LBB0_21
LBB0_15:
	movq	8(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_72
LBB0_16:
	xorl	%ebx, %ebx
	cmpl	%ecx, %ebx
	jge	LBB0_21
LBB0_17:
	movq	_DSAF_MODE_INVALID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_21
## %bb.18:
	movq	_DSAF_MODE_ENABLE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_21
## %bb.19:
	movl	%ebx, (%r12)
	cmpl	(%rax), %ebx
	jle	LBB0_25
## %bb.20:
	movq	_HRD_DSAF_NO_DSAF_MODE@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_21:
	movq	8(%r12), %rdi
	movl	104(%r12), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_72
LBB0_23:
	movq	(%rbx), %rax
	movl	4(%rax), %edi
	callq	_acpi_dev_found
	testq	%rax, %rax
	jne	LBB0_2
## %bb.42:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_43:
	xorl	%ebx, %ebx
	jmp	LBB0_72
LBB0_25:
	movq	_HRD_DSAF_MODE@GOTPCREL(%rip), %rax
LBB0_26:
	movl	(%rax), %eax
	movl	%eax, 100(%r12)
	movq	_DSAF_MODE_ENABLE_16VM@GOTPCREL(%rip), %rax
	movq	_DSAF_MODE_DISABLE_2PORT_8VM@GOTPCREL(%rip), %rsi
	movq	_DSAF_MODE_DISABLE_6PORT_2VM@GOTPCREL(%rip), %rdi
	movq	_HRD_DSAF_8TC_MODE@GOTPCREL(%rip), %rcx
	movq	%rcx, %rdx
	cmpl	(%rdi), %ebx
	je	LBB0_28
## %bb.27:
	movq	_HRD_DSAF_4TC_MODE@GOTPCREL(%rip), %rdx
LBB0_28:
	cmpl	(%rsi), %ebx
	cmoveq	%rcx, %rdx
	cmpl	(%rax), %ebx
	cmoveq	%rcx, %rdx
	movl	(%rdx), %eax
	movl	%eax, 96(%r12)
	movq	8(%r12), %rdi
	callq	_dev_of_node
	testq	%rax, %rax
	je	LBB0_34
## %bb.29:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_of_parse_phandle
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_syscon_node_to_regmap
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_of_node_put
	movq	%r15, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_33
## %bb.30:
	movq	%r14, %r15
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_55
## %bb.31:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, 88(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_57
## %bb.32:
	movq	88(%r12), %rdi
	jmp	LBB0_41
LBB0_33:
	movq	%r15, 72(%r12)
LBB0_34:
	xorl	%r15d, %r15d
LBB0_35:
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	L_.str.8(%rip), %rdx
	movq	%r14, %rdi
	callq	_platform_get_resource_byname
	testq	%rax, %rax
	je	LBB0_37
## %bb.36:
	movq	%rax, %rbx
	jmp	LBB0_39
LBB0_37:
	movl	(%r13), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_60
## %bb.38:
	movq	%rax, %rbx
	incq	%r15
LBB0_39:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, 64(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_44
## %bb.40:
	movq	64(%r12), %rdi
LBB0_41:
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_73
LBB0_44:
	movl	(%rbx), %eax
	movl	%eax, 56(%r12)
	movq	%r12, %rdi
	callq	_HNS_DSAF_IS_DEBUG
	testl	%eax, %eax
	je	LBB0_61
LBB0_45:
	movq	8(%r12), %rdi
	leaq	L_.str.12(%rip), %rsi
	leaq	-80(%rbp), %rdx
	callq	_device_property_read_u32
	movq	-80(%rbp), %rdx
	testl	%eax, %eax
	js	LBB0_56
## %bb.46:
	movq	_HNS_DSAF_MIN_DESC_CNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jb	LBB0_56
## %bb.47:
	movq	_HNS_DSAF_MAX_DESC_CNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	ja	LBB0_56
## %bb.48:
	movq	%rdx, 40(%r12)
	movq	8(%r12), %rdi
	leaq	L_.str.14(%rip), %rsi
	leaq	-48(%rbp), %rdx
	callq	_device_property_read_u32
	testl	%eax, %eax
	jns	LBB0_50
## %bb.49:
	movq	8(%r12), %rdi
	leaq	L_.str.15(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_50:
	movq	-48(%rbp), %rax
	movq	%rax, 32(%r12)
	movq	8(%r12), %rdi
	leaq	L_.str.16(%rip), %rsi
	leaq	-56(%rbp), %rdx
	callq	_device_property_read_u32
	testl	%eax, %eax
	js	LBB0_67
## %bb.51:
	movq	-56(%rbp), %rdi
	movq	%rdi, 24(%r12)
	callq	_hns_rcb_buf_size2type
	movl	%eax, 20(%r12)
	testl	%eax, %eax
	js	LBB0_68
## %bb.52:
	movq	%r12, %rdi
	callq	_hns_misc_op_get
	movl	%eax, 16(%r12)
	testl	%eax, %eax
	je	LBB0_74
## %bb.53:
	movq	8(%r12), %rbx
	movl	$64, %edi
	callq	_DMA_BIT_MASK
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	movq	8(%r12), %rdi
	testl	%eax, %eax
	je	LBB0_75
## %bb.54:
	leaq	L_.str.20(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_73
LBB0_55:
	movq	8(%r12), %rdi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_71
LBB0_56:
	movq	8(%r12), %rdi
	leaq	L_.str.13(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_22
LBB0_57:
	movl	(%r14), %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_65
## %bb.58:
	movq	%r15, %r14
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, 80(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_66
## %bb.59:
	movq	80(%r12), %rdi
	jmp	LBB0_41
LBB0_60:
	movq	8(%r12), %rdi
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_70
LBB0_61:
	movl	(%r13), %esi
	leaq	L_.str.10(%rip), %rdx
	movq	%r14, %rdi
	callq	_platform_get_resource_byname
	testq	%rax, %rax
	jne	LBB0_63
## %bb.62:
	movl	(%r13), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_69
LBB0_63:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, 48(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_45
## %bb.64:
	movq	48(%r12), %rdi
	jmp	LBB0_41
LBB0_65:
	movq	8(%r12), %rdi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_70
LBB0_66:
	movl	$2, %r15d
	jmp	LBB0_35
LBB0_67:
	movl	%eax, %ebx
	movq	8(%r12), %rdi
	leaq	L_.str.17(%rip), %rsi
	jmp	LBB0_8
LBB0_68:
	movq	8(%r12), %rdi
	movq	-56(%rbp), %rdx
	leaq	L_.str.18(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_22
LBB0_69:
	movq	8(%r12), %rdi
	leaq	L_.str.11(%rip), %rsi
LBB0_70:
	xorl	%ebx, %ebx
LBB0_71:
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_72:
	subl	(%rax), %ebx
LBB0_73:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_74:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_43
LBB0_75:
	leaq	L_.str.19(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_73
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hisilicon,hns-dsaf-v1"

	.comm	_AE_VERSION_1,8,3               ## @AE_VERSION_1
	.comm	_AE_VERSION_2,8,3               ## @AE_VERSION_2
	.comm	_hns_dsaf_acpi_match,8,3        ## @hns_dsaf_acpi_match
	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"cannot get cfg data from of or acpi\n"

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

L_.str.3:                               ## @.str.3
	.asciz	"get dsaf mode fail, ret=%d!\n"

	.comm	_DSAF_MODE_MAX,4,2              ## @DSAF_MODE_MAX
	.comm	_g_dsaf_mode_match,8,3          ## @g_dsaf_mode_match
	.comm	_DSAF_MODE_INVALID,4,2          ## @DSAF_MODE_INVALID
	.comm	_DSAF_MODE_ENABLE,4,2           ## @DSAF_MODE_ENABLE
L_.str.4:                               ## @.str.4
	.asciz	"%s prs mode str fail!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HRD_DSAF_NO_DSAF_MODE,4,2      ## @HRD_DSAF_NO_DSAF_MODE
	.comm	_HRD_DSAF_MODE,4,2              ## @HRD_DSAF_MODE
	.comm	_DSAF_MODE_ENABLE_16VM,4,2      ## @DSAF_MODE_ENABLE_16VM
	.comm	_DSAF_MODE_DISABLE_2PORT_8VM,4,2 ## @DSAF_MODE_DISABLE_2PORT_8VM
	.comm	_DSAF_MODE_DISABLE_6PORT_2VM,4,2 ## @DSAF_MODE_DISABLE_6PORT_2VM
	.comm	_HRD_DSAF_8TC_MODE,4,2          ## @HRD_DSAF_8TC_MODE
	.comm	_HRD_DSAF_4TC_MODE,4,2          ## @HRD_DSAF_4TC_MODE
L_.str.5:                               ## @.str.5
	.asciz	"subctrl-syscon"

	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
L_.str.6:                               ## @.str.6
	.asciz	"subctrl info is needed!\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.7:                               ## @.str.7
	.asciz	"serdes-ctrl info is needed!\n"

L_.str.8:                               ## @.str.8
	.asciz	"ppe-base"

L_.str.9:                               ## @.str.9
	.asciz	"ppe-base info is needed!\n"

L_.str.10:                              ## @.str.10
	.asciz	"dsaf-base"

L_.str.11:                              ## @.str.11
	.asciz	"dsaf-base info is needed!\n"

L_.str.12:                              ## @.str.12
	.asciz	"desc-num"

	.comm	_HNS_DSAF_MIN_DESC_CNT,8,3      ## @HNS_DSAF_MIN_DESC_CNT
	.comm	_HNS_DSAF_MAX_DESC_CNT,8,3      ## @HNS_DSAF_MAX_DESC_CNT
L_.str.13:                              ## @.str.13
	.asciz	"get desc-num(%d) fail, ret=%d!\n"

L_.str.14:                              ## @.str.14
	.asciz	"reset-field-offset"

L_.str.15:                              ## @.str.15
	.asciz	"get reset-field-offset fail, ret=%d!\r\n"

L_.str.16:                              ## @.str.16
	.asciz	"buf-size"

L_.str.17:                              ## @.str.17
	.asciz	"get buf-size fail, ret=%d!\r\n"

L_.str.18:                              ## @.str.18
	.asciz	"buf_size(%d) is wrong!\n"

L_.str.19:                              ## @.str.19
	.asciz	"set mask to 64bit\n"

L_.str.20:                              ## @.str.20
	.asciz	"set mask to 64bit fail!\n"

	.no_dead_strip	_hns_dsaf_get_cfg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_dsaf_get_cfg
_hns_dsaf_get_cfg:                      ; @hns_dsaf_get_cfg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
	str	xzr, [sp, #24]
	ldr	x0, [x0, #8]
	ldr	x21, [x0, #8]
	bl	_to_platform_device
	mov	x20, x0
	ldr	x0, [x19, #8]
	bl	_dev_of_node
	cbz	x0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_of_device_is_compatible
Lloh2:
	adrp	x8, _AE_VERSION_1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AE_VERSION_1@GOTPAGEOFF]
Lloh4:
	adrp	x9, _AE_VERSION_2@GOTPAGE
Lloh5:
	ldr	x9, [x9, _AE_VERSION_2@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
LBB0_2:
	ldr	x8, [x8]
	str	x8, [x19, #112]
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #16
	bl	_device_property_read_string
	cbz	w0, LBB0_7
; %bb.3:
	mov	x22, x0
	ldr	x0, [x19, #8]
	str	x22, [sp]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	b	LBB0_63
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_is_acpi_node
	cbz	x0, LBB0_12
; %bb.5:
Lloh10:
	adrp	x22, _hns_dsaf_acpi_match@GOTPAGE
Lloh11:
	ldr	x22, [x22, _hns_dsaf_acpi_match@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w0, [x8]
	bl	_acpi_dev_found
	cbz	x0, LBB0_23
; %bb.6:
Lloh12:
	adrp	x8, _AE_VERSION_1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AE_VERSION_1@GOTPAGEOFF]
	b	LBB0_2
LBB0_7:
Lloh14:
	adrp	x23, _DSAF_MODE_MAX@GOTPAGE
Lloh15:
	ldr	x23, [x23, _DSAF_MODE_MAX@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.8:
	mov	x22, #0
Lloh16:
	adrp	x24, _g_dsaf_mode_match@GOTPAGE
Lloh17:
	ldr	x24, [x24, _g_dsaf_mode_match@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_15
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x24]
	ldr	x1, [x9, x22, lsl #3]
	cbz	x1, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [sp, #16]
	bl	_strcmp
	ldr	w8, [x23]
	cbnz	w0, LBB0_9
	b	LBB0_15
LBB0_12:
	ldr	x0, [x19, #8]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_13:
Lloh20:
	adrp	x8, _ENXIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_62
LBB0_14:
	mov	w22, #0
LBB0_15:
Lloh22:
	adrp	x9, _DSAF_MODE_INVALID@GOTPAGE
Lloh23:
	ldr	x9, [x9, _DSAF_MODE_INVALID@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x9]
Lloh25:
	adrp	x9, _DSAF_MODE_ENABLE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _DSAF_MODE_ENABLE@GOTPAGEOFF]
	ldr	w11, [x9]
	cmp	w22, w8
	ccmp	w22, w10, #4, lt
	ccmp	w22, w11, #4, ne
	b.ne	LBB0_18
; %bb.16:
	ldr	x0, [x19, #8]
	ldr	w8, [x19, #104]
	str	x8, [sp]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_17:
	bl	_dev_err
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_62
LBB0_18:
	str	w22, [x19]
	ldr	w8, [x9]
Lloh31:
	adrp	x9, _HRD_DSAF_NO_DSAF_MODE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _HRD_DSAF_NO_DSAF_MODE@GOTPAGEOFF]
Lloh33:
	adrp	x10, _HRD_DSAF_MODE@GOTPAGE
Lloh34:
	ldr	x10, [x10, _HRD_DSAF_MODE@GOTPAGEOFF]
	cmp	w22, w8
	csel	x8, x9, x10, gt
	ldr	w8, [x8]
	str	w8, [x19, #100]
Lloh35:
	adrp	x8, _DSAF_MODE_ENABLE_16VM@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DSAF_MODE_ENABLE_16VM@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _DSAF_MODE_DISABLE_2PORT_8VM@GOTPAGE
Lloh39:
	ldr	x9, [x9, _DSAF_MODE_DISABLE_2PORT_8VM@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
Lloh41:
	adrp	x10, _DSAF_MODE_DISABLE_6PORT_2VM@GOTPAGE
Lloh42:
	ldr	x10, [x10, _DSAF_MODE_DISABLE_6PORT_2VM@GOTPAGEOFF]
Lloh43:
	ldr	w10, [x10]
	cmp	w22, w10
	ccmp	w22, w9, #4, ne
	ccmp	w22, w8, #4, ne
Lloh44:
	adrp	x8, _HRD_DSAF_8TC_MODE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _HRD_DSAF_8TC_MODE@GOTPAGEOFF]
Lloh46:
	adrp	x9, _HRD_DSAF_4TC_MODE@GOTPAGE
Lloh47:
	ldr	x9, [x9, _HRD_DSAF_4TC_MODE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x19, #96]
	ldr	x0, [x19, #8]
	bl	_dev_of_node
Lloh48:
	adrp	x23, _IORESOURCE_MEM@GOTPAGE
Lloh49:
	ldr	x23, [x23, _IORESOURCE_MEM@GOTPAGEOFF]
	cbz	x0, LBB0_25
; %bb.19:
Lloh50:
	adrp	x1, l_.str.5@PAGE
Lloh51:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	w2, #0
	bl	_of_parse_phandle
	mov	x21, x0
	bl	_syscon_node_to_regmap
	mov	x22, x0
	mov	x0, x21
	bl	_of_node_put
	mov	x0, x22
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_26
; %bb.20:
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, #0
	bl	_platform_get_resource
	cbz	x0, LBB0_45
; %bb.21:
	mov	x1, x0
	mov	x0, x20
	bl	_devm_ioremap_resource
	str	x0, [x19, #88]
	bl	_IS_ERR
	cbz	x0, LBB0_47
; %bb.22:
	ldr	x0, [x19, #88]
	b	LBB0_33
LBB0_23:
	ldr	x8, [x22]
	ldr	w0, [x8, #4]
	bl	_acpi_dev_found
	cbz	x0, LBB0_13
; %bb.24:
Lloh52:
	adrp	x8, _AE_VERSION_2@GOTPAGE
Lloh53:
	ldr	x8, [x8, _AE_VERSION_2@GOTPAGEOFF]
	b	LBB0_2
LBB0_25:
	mov	x21, #0
	b	LBB0_27
LBB0_26:
	mov	x21, #0
	str	x22, [x19, #72]
LBB0_27:
	ldr	w1, [x23]
Lloh54:
	adrp	x2, l_.str.8@PAGE
Lloh55:
	add	x2, x2, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_platform_get_resource_byname
	cbz	x0, LBB0_29
; %bb.28:
	mov	x22, x0
	b	LBB0_31
LBB0_29:
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x21
	bl	_platform_get_resource
	cbz	x0, LBB0_50
; %bb.30:
	mov	x22, x0
	add	x21, x21, #1
LBB0_31:
	mov	x0, x20
	mov	x1, x22
	bl	_devm_ioremap_resource
	str	x0, [x19, #64]
	bl	_IS_ERR
	cbz	x0, LBB0_34
; %bb.32:
	ldr	x0, [x19, #64]
LBB0_33:
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_63
LBB0_34:
	ldr	w8, [x22]
	str	w8, [x19, #56]
	mov	x0, x19
	bl	_HNS_DSAF_IS_DEBUG
	cbz	w0, LBB0_51
LBB0_35:
	ldr	x0, [x19, #8]
Lloh56:
	adrp	x1, l_.str.12@PAGE
Lloh57:
	add	x1, x1, l_.str.12@PAGEOFF
	add	x2, sp, #40
	bl	_device_property_read_u32
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x9, [sp, #40]
	tbnz	w0, #31, LBB0_46
; %bb.36:
Lloh58:
	adrp	x8, _HNS_DSAF_MIN_DESC_CNT@GOTPAGE
Lloh59:
	ldr	x8, [x8, _HNS_DSAF_MIN_DESC_CNT@GOTPAGEOFF]
Lloh60:
	ldr	x8, [x8]
	cmp	x9, x8
	b.lo	LBB0_46
; %bb.37:
Lloh61:
	adrp	x8, _HNS_DSAF_MAX_DESC_CNT@GOTPAGE
Lloh62:
	ldr	x8, [x8, _HNS_DSAF_MAX_DESC_CNT@GOTPAGEOFF]
Lloh63:
	ldr	x8, [x8]
	cmp	x9, x8
	b.hi	LBB0_46
; %bb.38:
	str	x9, [x19, #40]
	ldr	x0, [x19, #8]
Lloh64:
	adrp	x1, l_.str.14@PAGE
Lloh65:
	add	x1, x1, l_.str.14@PAGEOFF
	add	x2, sp, #24
	bl	_device_property_read_u32
                                        ; kill: def $w0 killed $w0 def $x0
	tbz	w0, #31, LBB0_40
; %bb.39:
	ldr	x8, [x19, #8]
	str	x0, [sp]
Lloh66:
	adrp	x1, l_.str.15@PAGE
Lloh67:
	add	x1, x1, l_.str.15@PAGEOFF
	mov	x0, x8
	bl	_dev_dbg
LBB0_40:
	ldr	x8, [sp, #24]
	str	x8, [x19, #32]
	ldr	x0, [x19, #8]
Lloh68:
	adrp	x1, l_.str.16@PAGE
Lloh69:
	add	x1, x1, l_.str.16@PAGEOFF
	add	x2, sp, #32
	bl	_device_property_read_u32
	tbnz	w0, #31, LBB0_57
; %bb.41:
	ldr	x0, [sp, #32]
	str	x0, [x19, #24]
	bl	_hns_rcb_buf_size2type
	str	w0, [x19, #20]
	tbnz	w0, #31, LBB0_58
; %bb.42:
	mov	x0, x19
	bl	_hns_misc_op_get
	str	w0, [x19, #16]
	cbz	w0, LBB0_61
; %bb.43:
	ldr	x20, [x19, #8]
	mov	w0, #64
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x20
	bl	_dma_set_mask_and_coherent
	mov	x8, x0
	ldr	x0, [x19, #8]
	cbz	w8, LBB0_64
; %bb.44:
Lloh70:
	adrp	x1, l_.str.20@PAGE
Lloh71:
	add	x1, x1, l_.str.20@PAGEOFF
	bl	_dev_err
	b	LBB0_65
LBB0_45:
	ldr	x0, [x19, #8]
Lloh72:
	adrp	x1, l_.str.6@PAGE
Lloh73:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_60
LBB0_46:
	ldr	x8, [x19, #8]
	stp	x9, x0, [sp]
Lloh74:
	adrp	x1, l_.str.13@PAGE
Lloh75:
	add	x1, x1, l_.str.13@PAGEOFF
	mov	x0, x8
	b	LBB0_17
LBB0_47:
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #1
	bl	_platform_get_resource
	cbz	x0, LBB0_55
; %bb.48:
	mov	x1, x0
	mov	x0, x20
	bl	_devm_ioremap_resource
	str	x0, [x19, #80]
	bl	_IS_ERR
	cbz	x0, LBB0_56
; %bb.49:
	ldr	x0, [x19, #80]
	b	LBB0_33
LBB0_50:
	ldr	x0, [x19, #8]
Lloh76:
	adrp	x1, l_.str.9@PAGE
Lloh77:
	add	x1, x1, l_.str.9@PAGEOFF
	b	LBB0_60
LBB0_51:
	ldr	w1, [x23]
Lloh78:
	adrp	x2, l_.str.10@PAGE
Lloh79:
	add	x2, x2, l_.str.10@PAGEOFF
	mov	x0, x20
	bl	_platform_get_resource_byname
	mov	x1, x0
	cbnz	x0, LBB0_53
; %bb.52:
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x21
	bl	_platform_get_resource
	mov	x1, x0
	cbz	x0, LBB0_59
LBB0_53:
	mov	x0, x20
	bl	_devm_ioremap_resource
	str	x0, [x19, #48]
	bl	_IS_ERR
	cbz	x0, LBB0_35
; %bb.54:
	ldr	x0, [x19, #48]
	b	LBB0_33
LBB0_55:
	ldr	x0, [x19, #8]
Lloh80:
	adrp	x1, l_.str.7@PAGE
Lloh81:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_60
LBB0_56:
	mov	w21, #2
	b	LBB0_27
LBB0_57:
	mov	x22, x0
	ldr	x0, [x19, #8]
	str	x22, [sp]
Lloh82:
	adrp	x1, l_.str.17@PAGE
Lloh83:
	add	x1, x1, l_.str.17@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_63
LBB0_58:
	ldr	x0, [x19, #8]
	ldr	x8, [sp, #32]
	str	x8, [sp]
Lloh84:
	adrp	x1, l_.str.18@PAGE
Lloh85:
	add	x1, x1, l_.str.18@PAGEOFF
	b	LBB0_17
LBB0_59:
	ldr	x0, [x19, #8]
Lloh86:
	adrp	x1, l_.str.11@PAGE
Lloh87:
	add	x1, x1, l_.str.11@PAGEOFF
LBB0_60:
	bl	_dev_err
LBB0_61:
Lloh88:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh89:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_62:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_63:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_64:
Lloh90:
	adrp	x1, l_.str.19@PAGE
Lloh91:
	add	x1, x1, l_.str.19@PAGEOFF
	bl	_dev_dbg
LBB0_65:
	mov	w22, #0
	b	LBB0_63
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpAdd	Lloh64, Lloh65
	.loh AdrpAdd	Lloh66, Lloh67
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpAdd	Lloh70, Lloh71
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpAdd	Lloh74, Lloh75
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpAdd	Lloh78, Lloh79
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpAdd	Lloh84, Lloh85
	.loh AdrpAdd	Lloh86, Lloh87
	.loh AdrpLdrGot	Lloh88, Lloh89
	.loh AdrpAdd	Lloh90, Lloh91
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hisilicon,hns-dsaf-v1"

	.comm	_AE_VERSION_1,8,3               ; @AE_VERSION_1
	.comm	_AE_VERSION_2,8,3               ; @AE_VERSION_2
	.comm	_hns_dsaf_acpi_match,8,3        ; @hns_dsaf_acpi_match
	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"cannot get cfg data from of or acpi\n"

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

l_.str.3:                               ; @.str.3
	.asciz	"get dsaf mode fail, ret=%d!\n"

	.comm	_DSAF_MODE_MAX,4,2              ; @DSAF_MODE_MAX
	.comm	_g_dsaf_mode_match,8,3          ; @g_dsaf_mode_match
	.comm	_DSAF_MODE_INVALID,4,2          ; @DSAF_MODE_INVALID
	.comm	_DSAF_MODE_ENABLE,4,2           ; @DSAF_MODE_ENABLE
l_.str.4:                               ; @.str.4
	.asciz	"%s prs mode str fail!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HRD_DSAF_NO_DSAF_MODE,4,2      ; @HRD_DSAF_NO_DSAF_MODE
	.comm	_HRD_DSAF_MODE,4,2              ; @HRD_DSAF_MODE
	.comm	_DSAF_MODE_ENABLE_16VM,4,2      ; @DSAF_MODE_ENABLE_16VM
	.comm	_DSAF_MODE_DISABLE_2PORT_8VM,4,2 ; @DSAF_MODE_DISABLE_2PORT_8VM
	.comm	_DSAF_MODE_DISABLE_6PORT_2VM,4,2 ; @DSAF_MODE_DISABLE_6PORT_2VM
	.comm	_HRD_DSAF_8TC_MODE,4,2          ; @HRD_DSAF_8TC_MODE
	.comm	_HRD_DSAF_4TC_MODE,4,2          ; @HRD_DSAF_4TC_MODE
l_.str.5:                               ; @.str.5
	.asciz	"subctrl-syscon"

	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
l_.str.6:                               ; @.str.6
	.asciz	"subctrl info is needed!\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.7:                               ; @.str.7
	.asciz	"serdes-ctrl info is needed!\n"

l_.str.8:                               ; @.str.8
	.asciz	"ppe-base"

l_.str.9:                               ; @.str.9
	.asciz	"ppe-base info is needed!\n"

l_.str.10:                              ; @.str.10
	.asciz	"dsaf-base"

l_.str.11:                              ; @.str.11
	.asciz	"dsaf-base info is needed!\n"

l_.str.12:                              ; @.str.12
	.asciz	"desc-num"

	.comm	_HNS_DSAF_MIN_DESC_CNT,8,3      ; @HNS_DSAF_MIN_DESC_CNT
	.comm	_HNS_DSAF_MAX_DESC_CNT,8,3      ; @HNS_DSAF_MAX_DESC_CNT
l_.str.13:                              ; @.str.13
	.asciz	"get desc-num(%d) fail, ret=%d!\n"

l_.str.14:                              ; @.str.14
	.asciz	"reset-field-offset"

l_.str.15:                              ; @.str.15
	.asciz	"get reset-field-offset fail, ret=%d!\r\n"

l_.str.16:                              ; @.str.16
	.asciz	"buf-size"

l_.str.17:                              ; @.str.17
	.asciz	"get buf-size fail, ret=%d!\r\n"

l_.str.18:                              ; @.str.18
	.asciz	"buf_size(%d) is wrong!\n"

l_.str.19:                              ; @.str.19
	.asciz	"set mask to 64bit\n"

l_.str.20:                              ; @.str.20
	.asciz	"set mask to 64bit fail!\n"

	.no_dead_strip	_hns_dsaf_get_cfg
.subsections_via_symbols
