	.file	"extr_rt2860.c_rt5390_rf_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rt5390_rf_init, @function
rt5390_rf_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	esi, 2
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	rt3090_rf_read@PLT
	mov	edx, DWORD PTR RT3593_RESCAL[rip]
	mov	esi, 2
	mov	rdi, rbp
	mov	ebx, eax
	or	edx, eax
	call	rt3090_rf_write@PLT
	mov	edi, 1000
	call	DELAY@PLT
	mov	edx, DWORD PTR RT3593_RESCAL[rip]
	mov	esi, 2
	mov	rdi, rbp
	not	edx
	and	edx, ebx
	xor	ebx, ebx
	call	rt3090_rf_write@PLT
	cmp	DWORD PTR 0[rbp], 21394
	jne	.L3
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR rt5390_def_rf[rip]
	mov	rdi, rbp
	lea	rax, [rax+rbx*8]
	add	rbx, 1
	mov	edx, DWORD PTR 4[rax]
	mov	esi, DWORD PTR [rax]
	call	rt3090_rf_write@PLT
.L3:
	mov	rdi, QWORD PTR rt5390_def_rf[rip]
	call	nitems@PLT
	cmp	eax, ebx
	jg	.L7
.L8:
	movabs	rax, 201863462943
	cmp	DWORD PTR 12[rbp], 528
	mov	QWORD PTR 4[rbp], rax
	jle	.L16
.L6:
	mov	esi, DWORD PTR RT3070_OPT_14[rip]
	mov	rdi, rbp
	call	RAL_READ@PLT
	mov	esi, DWORD PTR RT3070_OPT_14[rip]
	mov	rdi, rbp
	or	eax, 1
	mov	edx, eax
	call	RAL_WRITE@PLT
	mov	esi, DWORD PTR RT2860_TX_SW_CFG1[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	RAL_WRITE@PLT
	mov	esi, DWORD PTR RT2860_TX_SW_CFG2[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	RAL_WRITE@PLT
	cmp	DWORD PTR 0[rbp], 21392
	je	.L17
.L9:
	mov	edx, 19
	mov	esi, 79
	mov	rdi, rbp
	call	rt2860_mcu_bbp_write@PLT
	mov	edx, 5
	mov	esi, 80
	mov	rdi, rbp
	call	rt2860_mcu_bbp_write@PLT
	mov	edx, 51
	mov	esi, 81
	mov	rdi, rbp
	call	rt2860_mcu_bbp_write@PLT
	cmp	DWORD PTR 12[rbp], 528
	jg	.L18
.L10:
	mov	esi, 138
	mov	rdi, rbp
	call	rt2860_mcu_bbp_read@PLT
	cmp	DWORD PTR 16[rbp], 1
	mov	edx, eax
	jne	.L11
	or	edx, 32
.L11:
	cmp	DWORD PTR 20[rbp], 1
	jne	.L12
	and	edx, -3
.L12:
	mov	rdi, rbp
	mov	esi, 138
	call	rt2860_mcu_bbp_write@PLT
	mov	rdi, rbp
	mov	esi, 38
	call	rt3090_rf_read@PLT
	mov	edx, DWORD PTR RT5390_RX_LO1[rip]
	mov	rdi, rbp
	mov	esi, 38
	not	edx
	and	edx, eax
	call	rt3090_rf_write@PLT
	mov	rdi, rbp
	mov	esi, 39
	call	rt3090_rf_read@PLT
	mov	edx, DWORD PTR RT5390_RX_LO2[rip]
	mov	rdi, rbp
	mov	esi, 39
	not	edx
	and	edx, eax
	call	rt3090_rf_write@PLT
	mov	rdi, rbp
	mov	esi, 4
	call	rt2860_mcu_bbp_read@PLT
	or	eax, DWORD PTR RT5390_MAC_IF_CTRL[rip]
	mov	rdi, rbp
	mov	esi, 4
	mov	edx, eax
	call	rt2860_mcu_bbp_write@PLT
	mov	rdi, rbp
	mov	esi, 30
	call	rt3090_rf_read@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	mov	esi, 30
	and	eax, -25
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	mov	edx, eax
	or	edx, 16
	jmp	rt3090_rf_write@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rax, QWORD PTR rt5392_def_rf[rip]
	mov	rdi, rbp
	lea	rax, [rax+rbx*8]
	add	rbx, 1
	mov	edx, DWORD PTR 4[rax]
	mov	esi, DWORD PTR [rax]
	call	rt3090_rf_write@PLT
.L2:
	mov	rdi, QWORD PTR rt5392_def_rf[rip]
	call	nitems@PLT
	cmp	eax, ebx
	jg	.L4
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, 192
	mov	esi, 103
	mov	rdi, rbp
	call	rt2860_mcu_bbp_write@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edx, 3
	mov	esi, 27
	mov	rdi, rbp
	call	rt3090_rf_write@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	xor	esi, esi
	mov	rdi, rbp
	call	rt3090_set_rx_antenna@PLT
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	rt5390_rf_init, .-rt5390_rf_init
	.comm	rt5392_def_rf,8,8
	.comm	rt5390_def_rf,8,8
	.comm	RT5390_RX_LO2,4,4
	.comm	RT5390_RX_LO1,4,4
	.comm	RT5390_MAC_IF_CTRL,4,4
	.comm	RT3593_RESCAL,4,4
	.comm	RT3070_OPT_14,4,4
	.comm	RT2860_TX_SW_CFG2,4,4
	.comm	RT2860_TX_SW_CFG1,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_rt2860.c_rt5390_rf_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rt5390_rf_init, %function
rt5390_rf_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r1, #2
	mov	r4, r0
	bl	rt3090_rf_read
	mov	r5, r0
	ldr	r6, .L19
	mov	r1, #2
	ldr	r2, [r6]
	mov	r0, r4
	orr	r2, r5, r2
	bl	rt3090_rf_write
	mov	r0, #1000
	bl	DELAY
	ldr	r2, [r6]
	mov	r0, r4
	bic	r2, r5, r2
	mov	r1, #2
	bl	rt3090_rf_write
	ldr	r2, [r4]
	ldr	r3, .L19+4
	mov	r5, #0
	cmp	r2, r3
	beq	.L13
	ldr	r6, .L19+8
	b	.L3
.L7:
	ldr	r3, [r6]
	mov	r0, r4
	add	r2, r3, r5, lsl #3
	ldr	r1, [r3, r5, lsl #3]
	ldr	r2, [r2, #4]
	bl	rt3090_rf_write
	add	r5, r5, #1
.L3:
	ldr	r0, [r6]
	bl	nitems
	cmp	r0, r5
	bgt	.L7
.L8:
	mov	r1, #31
	mov	r3, #47
	ldr	r2, [r4, #12]
	str	r1, [r4, #4]
	cmp	r2, #528
	str	r3, [r4, #8]
	ble	.L16
.L6:
	ldr	r3, .L19+12
	mov	r0, r4
	ldr	r5, [r3]
	mov	r1, r5
	bl	RAL_READ
	mov	r1, r5
	orr	r2, r0, #1
	mov	r0, r4
	bl	RAL_WRITE
	ldr	r3, .L19+16
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	RAL_WRITE
	ldr	r3, .L19+20
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	RAL_WRITE
	ldr	r3, .L19+24
	ldr	r2, [r4]
	cmp	r2, r3
	beq	.L17
.L9:
	mov	r2, #19
	mov	r1, #79
	mov	r0, r4
	bl	rt2860_mcu_bbp_write
	mov	r2, #5
	mov	r1, #80
	mov	r0, r4
	bl	rt2860_mcu_bbp_write
	mov	r2, #51
	mov	r1, #81
	mov	r0, r4
	bl	rt2860_mcu_bbp_write
	ldr	r3, [r4, #12]
	cmp	r3, #528
	bgt	.L18
.L10:
	mov	r1, #138
	mov	r0, r4
	bl	rt2860_mcu_bbp_read
	mov	r2, r0
	ldr	r3, [r4, #16]
	mov	r1, #138
	cmp	r3, #1
	ldr	r3, [r4, #20]
	orreq	r2, r0, #32
	cmp	r3, #1
	biceq	r2, r2, #2
	mov	r0, r4
	bl	rt2860_mcu_bbp_write
	mov	r1, #38
	mov	r0, r4
	bl	rt3090_rf_read
	mov	r3, r0
	ldr	r2, .L19+28
	mov	r1, #38
	ldr	r2, [r2]
	mov	r0, r4
	bic	r2, r3, r2
	bl	rt3090_rf_write
	mov	r1, #39
	mov	r0, r4
	bl	rt3090_rf_read
	mov	r3, r0
	ldr	r2, .L19+32
	mov	r1, #39
	ldr	r2, [r2]
	mov	r0, r4
	bic	r2, r3, r2
	bl	rt3090_rf_write
	mov	r1, #4
	mov	r0, r4
	bl	rt2860_mcu_bbp_read
	mov	r2, r0
	ldr	r3, .L19+36
	mov	r1, #4
	ldr	r3, [r3]
	mov	r0, r4
	orr	r2, r2, r3
	bl	rt2860_mcu_bbp_write
	mov	r1, #30
	mov	r0, r4
	bl	rt3090_rf_read
	bic	r2, r0, #24
	mov	r1, #30
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	orr	r2, r2, #16
	b	rt3090_rf_write
.L13:
	ldr	r6, .L19+40
	b	.L2
.L4:
	ldr	r3, [r6]
	mov	r0, r4
	add	r2, r3, r5, lsl #3
	ldr	r1, [r3, r5, lsl #3]
	ldr	r2, [r2, #4]
	bl	rt3090_rf_write
	add	r5, r5, #1
.L2:
	ldr	r0, [r6]
	bl	nitems
	cmp	r0, r5
	bgt	.L4
	b	.L8
.L18:
	mov	r2, #192
	mov	r1, #103
	mov	r0, r4
	bl	rt2860_mcu_bbp_write
	b	.L10
.L16:
	mov	r2, #3
	mov	r1, #27
	mov	r0, r4
	bl	rt3090_rf_write
	b	.L6
.L17:
	mov	r1, #0
	mov	r0, r4
	bl	rt3090_set_rx_antenna
	b	.L9
.L20:
	.align	2
.L19:
	.word	RT3593_RESCAL
	.word	21394
	.word	rt5390_def_rf
	.word	RT3070_OPT_14
	.word	RT2860_TX_SW_CFG1
	.word	RT2860_TX_SW_CFG2
	.word	21392
	.word	RT5390_RX_LO1
	.word	RT5390_RX_LO2
	.word	RT5390_MAC_IF_CTRL
	.word	rt5392_def_rf
	.size	rt5390_rf_init, .-rt5390_rf_init
	.comm	rt5392_def_rf,4,4
	.comm	rt5390_def_rf,4,4
	.comm	RT5390_RX_LO2,4,4
	.comm	RT5390_RX_LO1,4,4
	.comm	RT5390_MAC_IF_CTRL,4,4
	.comm	RT3593_RESCAL,4,4
	.comm	RT3070_OPT_14,4,4
	.comm	RT2860_TX_SW_CFG2,4,4
	.comm	RT2860_TX_SW_CFG1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
