arch/arm/mach-imx/ssi-fiq.S

Source file repositories/reference/linux-study-clean/arch/arm/mach-imx/ssi-fiq.S

File Facts

System
Linux kernel
Corpus path
arch/arm/mach-imx/ssi-fiq.S
Extension
.S
Size
2864 bytes
Lines
145
Domain
Architecture Layer
Bucket
arch/arm
Inferred role
Architecture Layer: arch/arm
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/linkage.h>
#include <asm/assembler.h>

/*
 * r8  = bit 0-15: tx offset, bit 16-31: tx buffer size
 * r9  = bit 0-15: rx offset, bit 16-31: rx buffer size
 */

#define SSI_STX0	0x00
#define SSI_SRX0	0x08
#define SSI_SISR	0x14
#define SSI_SIER	0x18
#define SSI_SACNT	0x38

#define SSI_SACNT_AC97EN	(1 << 0)

#define SSI_SIER_TFE0_EN	(1 << 0)
#define SSI_SISR_TFE0		(1 << 0)
#define SSI_SISR_RFF0		(1 << 2)
#define SSI_SIER_RFF0_EN	(1 << 2)

		.text
		.global	imx_ssi_fiq_start
		.global	imx_ssi_fiq_end
		.global imx_ssi_fiq_base
		.global imx_ssi_fiq_rx_buffer
		.global imx_ssi_fiq_tx_buffer

/*
 * imx_ssi_fiq_start is _intentionally_ not marked as a function symbol
 * using ENDPROC().  imx_ssi_fiq_start and imx_ssi_fiq_end are used to
 * mark the function body so that it can be copied to the FIQ vector in
 * the vectors page.  imx_ssi_fiq_start should only be called as the result
 * of an FIQ: calling it directly will not work.
 */
imx_ssi_fiq_start:
		ldr r12, .L_imx_ssi_fiq_base

		/* TX */
		ldr r13, .L_imx_ssi_fiq_tx_buffer

		/* shall we send? */
		ldr r11, [r12, #SSI_SIER]
		tst r11, #SSI_SIER_TFE0_EN
		beq 1f

		/* TX FIFO empty? */
		ldr r11, [r12, #SSI_SISR]
		tst r11, #SSI_SISR_TFE0
		beq 1f

		mov r10, #0x10000
		sub r10, #1
		and r10, r10, r8	/* r10: current buffer offset */

		add r13, r13, r10

		ldrh r11, [r13]
		strh r11, [r12, #SSI_STX0]

		ldrh r11, [r13, #2]
		strh r11, [r12, #SSI_STX0]

		ldrh r11, [r13, #4]
		strh r11, [r12, #SSI_STX0]

		ldrh r11, [r13, #6]
		strh r11, [r12, #SSI_STX0]

		add r10, #8

Annotation

Implementation Notes