	.file	"extr_aic79xx_pci.c_ahd_aic790X_setup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%s: Unable to attach to unsupported chip revision %d\n"
	.text
	.p2align 4
	.type	ahd_aic790X_setup, @function
ahd_aic790X_setup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	esi, DWORD PTR PCIR_REVID[rip]
	mov	edx, 1
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	r13d, DWORD PTR 24[rdi]
	mov	rbp, rdi
	mov	edi, r13d
	call	aic_pci_read_config@PLT
	cmp	QWORD PTR ID_AIC7902_PCI_REV_A4[rip], rax
	mov	r12, rax
	jg	.L12
	mov	edi, r13d
	call	aic_get_pci_function@PLT
	add	rax, 65
	cmp	QWORD PTR ID_AIC7902_PCI_REV_B0[rip], r12
	mov	QWORD PTR 16[rbp], rax
	jg	.L13
	mov	eax, DWORD PTR AHD_RTI[rip]
	mov	edx, DWORD PTR AHD_LQOOVERRUN_BUG[rip]
	or	eax, DWORD PTR AHD_NEW_IOCELL_OPTS[rip]
	or	edx, DWORD PTR AHD_EARLY_REQ_BUG[rip]
	or	eax, DWORD PTR AHD_NEW_DFCNTRL_OPTS[rip]
	or	edx, DWORD PTR 0[rbp]
	or	eax, DWORD PTR AHD_FAST_CDB_DELIVERY[rip]
	or	eax, DWORD PTR 8[rbp]
	mov	DWORD PTR 0[rbp], edx
	mov	DWORD PTR 8[rbp], eax
	test	DWORD PTR AHD_MULTI_FUNC[rip], eax
	je	.L5
	mov	eax, DWORD PTR AHD_INTCOLLISION_BUG[rip]
	or	eax, DWORD PTR AHD_ABORT_LQI_BUG[rip]
	or	eax, DWORD PTR AHD_BUSFREEREV_BUG[rip]
	or	edx, eax
	mov	DWORD PTR 0[rbp], edx
.L5:
	mov	esi, DWORD PTR AHD_PRECOMP_CUTBACK_29[rip]
	mov	rdi, rbp
	xor	r12d, r12d
	call	AHD_SET_PRECOMP@PLT
	mov	esi, DWORD PTR AHD_SLEWRATE_DEF_REVB[rip]
	mov	rdi, rbp
	call	AHD_SET_SLEWRATE@PLT
	mov	esi, DWORD PTR AHD_AMPLITUDE_DEF[rip]
	mov	rdi, rbp
	call	AHD_SET_AMPLITUDE@PLT
	mov	esi, DWORD PTR DEVCONFIG1[rip]
	mov	edx, 1
	mov	edi, r13d
	call	aic_pci_read_config@PLT
	mov	esi, DWORD PTR DEVCONFIG1[rip]
	mov	ecx, 1
	mov	edi, r13d
	or	rax, QWORD PTR PREQDIS[rip]
	mov	rdx, rax
	call	aic_pci_write_config@PLT
	mov	esi, DWORD PTR DEVCONFIG1[rip]
	mov	edx, 1
	mov	edi, r13d
	call	aic_pci_read_config@PLT
.L1:
	mov	eax, r12d
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	eax, DWORD PTR AHD_SENT_SCB_UPDATE_BUG[rip]
	or	eax, DWORD PTR AHD_ABORT_LQI_BUG[rip]
	mov	rdi, rbp
	or	eax, DWORD PTR AHD_PKT_BITBUCKET_BUG[rip]
	or	eax, DWORD PTR AHD_LONG_SETIMO_BUG[rip]
	or	eax, DWORD PTR AHD_NLQICRC_DELAYED_BUG[rip]
	or	eax, DWORD PTR AHD_SCSIRST_BUG[rip]
	or	eax, DWORD PTR AHD_LQO_ATNO_BUG[rip]
	or	eax, DWORD PTR AHD_AUTOFLUSH_BUG[rip]
	or	eax, DWORD PTR AHD_CLRLQO_AUTOCLR_BUG[rip]
	or	eax, DWORD PTR AHD_PCIX_MMAPIO_BUG[rip]
	or	eax, DWORD PTR AHD_PCIX_CHIPRST_BUG[rip]
	or	eax, DWORD PTR AHD_PCIX_SCBRAM_RD_BUG[rip]
	or	eax, DWORD PTR AHD_PKTIZED_STATUS_BUG[rip]
	or	eax, DWORD PTR AHD_PKT_LUN_BUG[rip]
	or	eax, DWORD PTR AHD_MDFF_WSCBPTR_BUG[rip]
	or	eax, DWORD PTR AHD_REG_SLOW_SETTLE_BUG[rip]
	or	eax, DWORD PTR AHD_SET_MODE_BUG[rip]
	or	eax, DWORD PTR AHD_BUSFREEREV_BUG[rip]
	or	eax, DWORD PTR AHD_NONPACKFIFO_BUG[rip]
	or	eax, DWORD PTR AHD_PACED_NEGTABLE_BUG[rip]
	or	eax, DWORD PTR AHD_FAINT_LED_BUG[rip]
	or	DWORD PTR 0[rbp], eax
	mov	esi, DWORD PTR AHD_PRECOMP_CUTBACK_29[rip]
	call	AHD_SET_PRECOMP@PLT
	mov	r12d, DWORD PTR 4[rbp]
	and	r12d, DWORD PTR AHD_HP_BOARD[rip]
	je	.L14
	xor	r12d, r12d
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rdi, rbp
	call	ahd_name@PLT
	mov	rdx, r12
	lea	rdi, .LC0[rip]
	mov	rsi, rax
	call	printf@PLT
	mov	esi, DWORD PTR PCIR_COMMAND[rip]
	mov	edi, r13d
	xor	edx, edx
	mov	ecx, 2
	call	aic_pci_write_config@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	esi, DWORD PTR AHD_SLEWRATE_DEF_REVA[rip]
	mov	rdi, rbp
	call	AHD_SET_SLEWRATE@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ahd_aic790X_setup, .-ahd_aic790X_setup
	.comm	PREQDIS,8,8
	.comm	PCIR_REVID,4,4
	.comm	PCIR_COMMAND,4,4
	.comm	ID_AIC7902_PCI_REV_B0,8,8
	.comm	ID_AIC7902_PCI_REV_A4,8,8
	.comm	ENXIO,4,4
	.comm	DEVCONFIG1,4,4
	.comm	AHD_SLEWRATE_DEF_REVB,4,4
	.comm	AHD_SLEWRATE_DEF_REVA,4,4
	.comm	AHD_SET_MODE_BUG,4,4
	.comm	AHD_SENT_SCB_UPDATE_BUG,4,4
	.comm	AHD_SCSIRST_BUG,4,4
	.comm	AHD_RTI,4,4
	.comm	AHD_REG_SLOW_SETTLE_BUG,4,4
	.comm	AHD_PRECOMP_CUTBACK_29,4,4
	.comm	AHD_PKT_LUN_BUG,4,4
	.comm	AHD_PKT_BITBUCKET_BUG,4,4
	.comm	AHD_PKTIZED_STATUS_BUG,4,4
	.comm	AHD_PCIX_SCBRAM_RD_BUG,4,4
	.comm	AHD_PCIX_MMAPIO_BUG,4,4
	.comm	AHD_PCIX_CHIPRST_BUG,4,4
	.comm	AHD_PACED_NEGTABLE_BUG,4,4
	.comm	AHD_NONPACKFIFO_BUG,4,4
	.comm	AHD_NLQICRC_DELAYED_BUG,4,4
	.comm	AHD_NEW_IOCELL_OPTS,4,4
	.comm	AHD_NEW_DFCNTRL_OPTS,4,4
	.comm	AHD_MULTI_FUNC,4,4
	.comm	AHD_MDFF_WSCBPTR_BUG,4,4
	.comm	AHD_LQO_ATNO_BUG,4,4
	.comm	AHD_LQOOVERRUN_BUG,4,4
	.comm	AHD_LONG_SETIMO_BUG,4,4
	.comm	AHD_INTCOLLISION_BUG,4,4
	.comm	AHD_HP_BOARD,4,4
	.comm	AHD_FAST_CDB_DELIVERY,4,4
	.comm	AHD_FAINT_LED_BUG,4,4
	.comm	AHD_EARLY_REQ_BUG,4,4
	.comm	AHD_CLRLQO_AUTOCLR_BUG,4,4
	.comm	AHD_BUSFREEREV_BUG,4,4
	.comm	AHD_AUTOFLUSH_BUG,4,4
	.comm	AHD_AMPLITUDE_DEF,4,4
	.comm	AHD_ABORT_LQI_BUG,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_aic79xx_pci.c_ahd_aic790X_setup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s: Unable to attach to unsupported chip revision %"
	.ascii	"d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ahd_aic790X_setup, %function
ahd_aic790X_setup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L14
	ldr	r6, [r0, #16]
	ldr	r1, [r3]
	mov	r4, r0
	mov	r2, #1
	mov	r0, r6
	bl	aic_pci_read_config
	ldr	r3, .L14+4
	mov	r5, r0
	ldr	r3, [r3]
	cmp	r3, r0
	bgt	.L12
	mov	r0, r6
	bl	aic_get_pci_function
	ldr	r3, .L14+8
	add	r0, r0, #65
	ldr	r3, [r3]
	str	r0, [r4, #12]
	cmp	r3, r5
	bgt	.L13
	ldr	r3, .L14+12
	ldr	r2, .L14+16
	ldr	r1, .L14+20
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r0, .L14+24
	orr	r3, r3, r2
	ldr	r0, [r0]
	orr	r3, r3, r1
	ldr	r2, .L14+28
	ldr	r1, .L14+32
	ldr	r2, [r2]
	ldr	r1, [r1]
	orr	r3, r3, r0
	ldr	r0, .L14+36
	ldr	ip, [r4, #8]
	ldr	r0, [r0]
	orr	r2, r2, r1
	ldr	r1, [r4]
	orr	r3, r3, ip
	orr	r2, r2, r1
	tst	r3, r0
	str	r3, [r4, #8]
	str	r2, [r4]
	beq	.L5
	ldr	r3, .L14+40
	ldr	r0, .L14+44
	ldr	r1, .L14+48
	ldr	r3, [r3]
	ldr	r0, [r0]
	ldr	r1, [r1]
	orr	r3, r3, r0
	orr	r3, r3, r1
	orr	r2, r3, r2
	str	r2, [r4]
.L5:
	ldr	r3, .L14+52
	mov	r0, r4
	ldr	r1, [r3]
	bl	AHD_SET_PRECOMP
	ldr	r3, .L14+56
	mov	r0, r4
	ldr	r1, [r3]
	bl	AHD_SET_SLEWRATE
	ldr	r3, .L14+60
	ldr	r5, .L14+64
	ldr	r1, [r3]
	mov	r0, r4
	bl	AHD_SET_AMPLITUDE
	ldr	r1, [r5]
	mov	r2, #1
	mov	r0, r6
	bl	aic_pci_read_config
	ldr	r3, .L14+68
	ldr	r1, [r5]
	ldr	r2, [r3]
	mov	r3, #1
	orr	r2, r0, r2
	mov	r0, r6
	bl	aic_pci_write_config
	ldr	r1, [r5]
	mov	r0, r6
	mov	r2, #1
	bl	aic_pci_read_config
	mov	r5, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L13:
	ldr	r2, .L14+44
	ldr	r3, .L14+72
	ldr	r1, .L14+76
	ldr	ip, [r2]
	ldr	r3, [r3]
	ldr	r2, .L14+80
	ldr	r0, [r1]
	ldr	r1, .L14+84
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+88
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+92
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+96
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+100
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+104
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+108
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+112
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+116
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+120
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+124
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+128
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+132
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+48
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+136
	orr	r3, r3, ip
	ldr	ip, [r2]
	ldr	r2, .L14+140
	orr	r3, r3, r0
	ldr	r0, [r1]
	ldr	r1, .L14+144
	ldr	r2, [r2]
	orr	r3, r3, ip
	ldr	r1, [r1]
	orr	r3, r3, r0
	orr	r3, r3, r2
	ldr	r2, [r4]
	orr	r3, r3, r1
	ldr	r1, .L14+52
	orr	r3, r2, r3
	str	r3, [r4]
	mov	r0, r4
	ldr	r1, [r1]
	bl	AHD_SET_PRECOMP
	ldr	r3, .L14+148
	ldr	r5, [r4, #4]
	ldr	r3, [r3]
	ands	r5, r5, r3
	movne	r5, #0
	bne	.L1
	ldr	r3, .L14+152
	mov	r0, r4
	ldr	r1, [r3]
	bl	AHD_SET_SLEWRATE
	b	.L1
.L12:
	mov	r0, r4
	bl	ahd_name
	mov	r2, r5
	mov	r1, r0
	ldr	r0, .L14+156
	bl	printf
	ldr	r3, .L14+160
	mov	r0, r6
	ldr	r1, [r3]
	mov	r2, #0
	mov	r3, #2
	bl	aic_pci_write_config
	ldr	r3, .L14+164
	ldr	r5, [r3]
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L15:
	.align	2
.L14:
	.word	PCIR_REVID
	.word	ID_AIC7902_PCI_REV_A4
	.word	ID_AIC7902_PCI_REV_B0
	.word	AHD_RTI
	.word	AHD_NEW_IOCELL_OPTS
	.word	AHD_NEW_DFCNTRL_OPTS
	.word	AHD_FAST_CDB_DELIVERY
	.word	AHD_LQOOVERRUN_BUG
	.word	AHD_EARLY_REQ_BUG
	.word	AHD_MULTI_FUNC
	.word	AHD_INTCOLLISION_BUG
	.word	AHD_ABORT_LQI_BUG
	.word	AHD_BUSFREEREV_BUG
	.word	AHD_PRECOMP_CUTBACK_29
	.word	AHD_SLEWRATE_DEF_REVB
	.word	AHD_AMPLITUDE_DEF
	.word	DEVCONFIG1
	.word	PREQDIS
	.word	AHD_SENT_SCB_UPDATE_BUG
	.word	AHD_PKT_BITBUCKET_BUG
	.word	AHD_LONG_SETIMO_BUG
	.word	AHD_NLQICRC_DELAYED_BUG
	.word	AHD_SCSIRST_BUG
	.word	AHD_LQO_ATNO_BUG
	.word	AHD_AUTOFLUSH_BUG
	.word	AHD_CLRLQO_AUTOCLR_BUG
	.word	AHD_PCIX_MMAPIO_BUG
	.word	AHD_PCIX_CHIPRST_BUG
	.word	AHD_PCIX_SCBRAM_RD_BUG
	.word	AHD_PKTIZED_STATUS_BUG
	.word	AHD_PKT_LUN_BUG
	.word	AHD_MDFF_WSCBPTR_BUG
	.word	AHD_REG_SLOW_SETTLE_BUG
	.word	AHD_SET_MODE_BUG
	.word	AHD_NONPACKFIFO_BUG
	.word	AHD_PACED_NEGTABLE_BUG
	.word	AHD_FAINT_LED_BUG
	.word	AHD_HP_BOARD
	.word	AHD_SLEWRATE_DEF_REVA
	.word	.LC0
	.word	PCIR_COMMAND
	.word	ENXIO
	.size	ahd_aic790X_setup, .-ahd_aic790X_setup
	.comm	PREQDIS,4,4
	.comm	PCIR_REVID,4,4
	.comm	PCIR_COMMAND,4,4
	.comm	ID_AIC7902_PCI_REV_B0,4,4
	.comm	ID_AIC7902_PCI_REV_A4,4,4
	.comm	ENXIO,4,4
	.comm	DEVCONFIG1,4,4
	.comm	AHD_SLEWRATE_DEF_REVB,4,4
	.comm	AHD_SLEWRATE_DEF_REVA,4,4
	.comm	AHD_SET_MODE_BUG,4,4
	.comm	AHD_SENT_SCB_UPDATE_BUG,4,4
	.comm	AHD_SCSIRST_BUG,4,4
	.comm	AHD_RTI,4,4
	.comm	AHD_REG_SLOW_SETTLE_BUG,4,4
	.comm	AHD_PRECOMP_CUTBACK_29,4,4
	.comm	AHD_PKT_LUN_BUG,4,4
	.comm	AHD_PKT_BITBUCKET_BUG,4,4
	.comm	AHD_PKTIZED_STATUS_BUG,4,4
	.comm	AHD_PCIX_SCBRAM_RD_BUG,4,4
	.comm	AHD_PCIX_MMAPIO_BUG,4,4
	.comm	AHD_PCIX_CHIPRST_BUG,4,4
	.comm	AHD_PACED_NEGTABLE_BUG,4,4
	.comm	AHD_NONPACKFIFO_BUG,4,4
	.comm	AHD_NLQICRC_DELAYED_BUG,4,4
	.comm	AHD_NEW_IOCELL_OPTS,4,4
	.comm	AHD_NEW_DFCNTRL_OPTS,4,4
	.comm	AHD_MULTI_FUNC,4,4
	.comm	AHD_MDFF_WSCBPTR_BUG,4,4
	.comm	AHD_LQO_ATNO_BUG,4,4
	.comm	AHD_LQOOVERRUN_BUG,4,4
	.comm	AHD_LONG_SETIMO_BUG,4,4
	.comm	AHD_INTCOLLISION_BUG,4,4
	.comm	AHD_HP_BOARD,4,4
	.comm	AHD_FAST_CDB_DELIVERY,4,4
	.comm	AHD_FAINT_LED_BUG,4,4
	.comm	AHD_EARLY_REQ_BUG,4,4
	.comm	AHD_CLRLQO_AUTOCLR_BUG,4,4
	.comm	AHD_BUSFREEREV_BUG,4,4
	.comm	AHD_AUTOFLUSH_BUG,4,4
	.comm	AHD_AMPLITUDE_DEF,4,4
	.comm	AHD_ABORT_LQI_BUG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
