	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hisi_spi_nor_dma_transfer
_hisi_spi_nor_dma_transfer:             ## @hisi_spi_nor_dma_transfer
	.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
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movq	8(%r14), %r13
	movq	_FMC_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl
	movq	_FMC_CFG_OP_MODE_MASK@GOTPCREL(%rip), %rcx
	movq	_SPI_NOR_ADDR_MODE_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	orl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	_FMC_CFG_OP_MODE_NORMAL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	cmpl	$4, (%rbx)
	jne	LBB0_1
## %bb.2:
	movq	_SPI_NOR_ADDR_MODE_4BYTES@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_SPI_NOR_ADDR_MODE_3BYTES@GOTPCREL(%rip), %rax
LBB0_3:
	orl	(%rax), %edi
	movq	_FMC_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	callq	_writel
	movq	_FMC_ADDRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	movl	%r12d, %edi
	callq	_writel
	movq	_FMC_DMA_SADDR_D0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	movl	%r15d, %edi
	callq	_writel
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_FMC_DMA_LEN_SET
	movq	_FMC_DMA_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%r13), %rsi
	movl	%eax, %edi
	callq	_writel
	movl	(%r14), %edi
	callq	_OP_CFG_FM_CS
	movl	%eax, %r12d
	movq	_FMC_OP_READ@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	cmpq	%r14, (%rcx)
	sete	%al
	movq	%rbx, %r15
	movl	16(%rbx,%rax,4), %edi
	callq	_hisi_spi_nor_get_if_type
	movq	%rax, %rdi
	callq	_OP_CFG_MEM_IF_TYPE
	movl	%eax, %ebx
	orl	%r12d, %ebx
	movq	_FMC_OP_READ@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	4(%r15), %edi
	sarl	$3, %edi
	callq	_OP_CFG_DUMMY_NUM
	orl	%eax, %ebx
LBB0_5:
	movq	%r15, %r14
	movq	_FMC_OP_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	_FMC_INT_CLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	movl	$255, %edi
	callq	_writel
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_OP_CTRL_RW_OP
	movl	%eax, %r12d
	movq	_OP_CTRL_DMA_OP_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_FMC_OP_READ@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_7
## %bb.6:
	movl	12(%r14), %edi
	callq	_OP_CTRL_RD_OPCODE
	jmp	LBB0_8
LBB0_7:
	movl	8(%r14), %edi
	callq	_OP_CTRL_WR_OPCODE
LBB0_8:
	orl	%r12d, %ebx
	orl	%eax, %ebx
	movq	_FMC_OP_DMA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	%r13, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hisi_spi_nor_wait_op_finish    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FMC_CFG,8,3                    ## @FMC_CFG
	.comm	_FMC_CFG_OP_MODE_MASK,4,2       ## @FMC_CFG_OP_MODE_MASK
	.comm	_SPI_NOR_ADDR_MODE_MASK,4,2     ## @SPI_NOR_ADDR_MODE_MASK
	.comm	_FMC_CFG_OP_MODE_NORMAL,4,2     ## @FMC_CFG_OP_MODE_NORMAL
	.comm	_SPI_NOR_ADDR_MODE_4BYTES,4,2   ## @SPI_NOR_ADDR_MODE_4BYTES
	.comm	_SPI_NOR_ADDR_MODE_3BYTES,4,2   ## @SPI_NOR_ADDR_MODE_3BYTES
	.comm	_FMC_ADDRL,8,3                  ## @FMC_ADDRL
	.comm	_FMC_DMA_SADDR_D0,8,3           ## @FMC_DMA_SADDR_D0
	.comm	_FMC_DMA_LEN,8,3                ## @FMC_DMA_LEN
	.comm	_FMC_OP_READ,8,3                ## @FMC_OP_READ
	.comm	_FMC_OP_CFG,8,3                 ## @FMC_OP_CFG
	.comm	_FMC_INT_CLR,8,3                ## @FMC_INT_CLR
	.comm	_OP_CTRL_DMA_OP_READY,4,2       ## @OP_CTRL_DMA_OP_READY
	.comm	_FMC_OP_DMA,8,3                 ## @FMC_OP_DMA
	.no_dead_strip	_hisi_spi_nor_dma_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hisi_spi_nor_dma_transfer
_hisi_spi_nor_dma_transfer:             ; @hisi_spi_nor_dma_transfer
	.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	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x25, [x0, #24]
	ldr	x19, [x25, #8]
	ldr	x8, [x19]
Lloh0:
	adrp	x26, _FMC_CFG@GOTPAGE
Lloh1:
	ldr	x26, [x26, _FMC_CFG@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl
Lloh2:
	adrp	x8, _FMC_CFG_OP_MODE_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FMC_CFG_OP_MODE_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _SPI_NOR_ADDR_MODE_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SPI_NOR_ADDR_MODE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w0, w8
Lloh8:
	adrp	x9, _FMC_CFG_OP_MODE_NORMAL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FMC_CFG_OP_MODE_NORMAL@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20]
Lloh11:
	adrp	x10, _SPI_NOR_ADDR_MODE_4BYTES@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SPI_NOR_ADDR_MODE_4BYTES@GOTPAGEOFF]
Lloh13:
	adrp	x11, _SPI_NOR_ADDR_MODE_3BYTES@GOTPAGE
Lloh14:
	ldr	x11, [x11, _SPI_NOR_ADDR_MODE_3BYTES@GOTPAGEOFF]
	cmp	w9, #4
	csel	x9, x10, x11, eq
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x19]
	ldr	x9, [x26]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _FMC_ADDRL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FMC_ADDRL@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x24
	bl	_writel
	ldr	x8, [x19]
Lloh18:
	adrp	x9, _FMC_DMA_SADDR_D0@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FMC_DMA_SADDR_D0@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel
	mov	x0, x22
	bl	_FMC_DMA_LEN_SET
	ldr	x8, [x19]
Lloh21:
	adrp	x9, _FMC_DMA_LEN@GOTPAGE
Lloh22:
	ldr	x9, [x9, _FMC_DMA_LEN@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x25]
	bl	_OP_CFG_FM_CS
	mov	x22, x0
Lloh24:
	adrp	x23, _FMC_OP_READ@GOTPAGE
Lloh25:
	ldr	x23, [x23, _FMC_OP_READ@GOTPAGEOFF]
	ldr	x8, [x23]
	mov	w9, #16
	mov	w10, #20
	cmp	x8, x21
	csel	x8, x10, x9, eq
	ldr	w0, [x20, x8]
	bl	_hisi_spi_nor_get_if_type
	bl	_OP_CFG_MEM_IF_TYPE
	orr	w22, w0, w22
	ldr	x8, [x23]
	cmp	x8, x21
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x20, #4]
	asr	w0, w8, #3
	bl	_OP_CFG_DUMMY_NUM
	orr	w22, w0, w22
LBB0_2:
	ldr	x8, [x19]
Lloh26:
	adrp	x9, _FMC_OP_CFG@GOTPAGE
Lloh27:
	ldr	x9, [x9, _FMC_OP_CFG@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x22
	bl	_writel
	ldr	x8, [x19]
Lloh29:
	adrp	x9, _FMC_INT_CLR@GOTPAGE
Lloh30:
	ldr	x9, [x9, _FMC_INT_CLR@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #255
	bl	_writel
	mov	x0, x21
	bl	_OP_CTRL_RW_OP
	mov	x22, x0
Lloh32:
	adrp	x8, _OP_CTRL_DMA_OP_READY@GOTPAGE
Lloh33:
	ldr	x8, [x8, _OP_CTRL_DMA_OP_READY@GOTPAGEOFF]
Lloh34:
	ldr	w24, [x8]
	ldr	x8, [x23]
	cmp	x8, x21
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x20, #12]
	bl	_OP_CTRL_RD_OPCODE
	b	LBB0_5
LBB0_4:
	ldr	w0, [x20, #8]
	bl	_OP_CTRL_WR_OPCODE
LBB0_5:
	orr	w8, w24, w22
	orr	w0, w8, w0
	ldr	x8, [x19]
Lloh35:
	adrp	x9, _FMC_OP_DMA@GOTPAGE
Lloh36:
	ldr	x9, [x9, _FMC_OP_DMA@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	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
	b	_hisi_spi_nor_wait_op_finish
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_FMC_CFG,8,3                    ; @FMC_CFG
	.comm	_FMC_CFG_OP_MODE_MASK,4,2       ; @FMC_CFG_OP_MODE_MASK
	.comm	_SPI_NOR_ADDR_MODE_MASK,4,2     ; @SPI_NOR_ADDR_MODE_MASK
	.comm	_FMC_CFG_OP_MODE_NORMAL,4,2     ; @FMC_CFG_OP_MODE_NORMAL
	.comm	_SPI_NOR_ADDR_MODE_4BYTES,4,2   ; @SPI_NOR_ADDR_MODE_4BYTES
	.comm	_SPI_NOR_ADDR_MODE_3BYTES,4,2   ; @SPI_NOR_ADDR_MODE_3BYTES
	.comm	_FMC_ADDRL,8,3                  ; @FMC_ADDRL
	.comm	_FMC_DMA_SADDR_D0,8,3           ; @FMC_DMA_SADDR_D0
	.comm	_FMC_DMA_LEN,8,3                ; @FMC_DMA_LEN
	.comm	_FMC_OP_READ,8,3                ; @FMC_OP_READ
	.comm	_FMC_OP_CFG,8,3                 ; @FMC_OP_CFG
	.comm	_FMC_INT_CLR,8,3                ; @FMC_INT_CLR
	.comm	_OP_CTRL_DMA_OP_READY,4,2       ; @OP_CTRL_DMA_OP_READY
	.comm	_FMC_OP_DMA,8,3                 ; @FMC_OP_DMA
	.no_dead_strip	_hisi_spi_nor_dma_transfer
.subsections_via_symbols
