Linux Audio

Check our new training course

Loading...
v3.1
 
  1/* linux/drivers/spi/spi_s3c24xx_fiq.S
  2 *
  3 * Copyright 2009 Simtec Electronics
  4 *	Ben Dooks <ben@simtec.co.uk>
  5 *
  6 * S3C24XX SPI - FIQ pseudo-DMA transfer code
  7 *
  8 * This program is free software; you can redistribute it and/or modify
  9 * it under the terms of the GNU General Public License version 2 as
 10 * published by the Free Software Foundation.
 11*/
 12
 13#include <linux/linkage.h>
 14#include <asm/assembler.h>
 15
 16#include <mach/map.h>
 17#include <mach/regs-irq.h>
 18#include <plat/regs-spi.h>
 19
 20#include "spi-s3c24xx-fiq.h"
 21
 22	.text
 23
 24	@ entry to these routines is as follows, with the register names
 25	@ defined in fiq.h so that they can be shared with the C files which
 26	@ setup the calling registers.
 27	@
 28	@ fiq_rirq	The base of the IRQ registers to find S3C2410_SRCPND
 29	@ fiq_rtmp	Temporary register to hold tx/rx data
 30	@ fiq_rspi	The base of the SPI register block
 31	@ fiq_rtx	The tx buffer pointer
 32	@ fiq_rrx	The rx buffer pointer
 33	@ fiq_rcount	The number of bytes to move
 34
 35	@ each entry starts with a word entry of how long it is
 36	@ and an offset to the irq acknowledgment word
 37
 38ENTRY(s3c24xx_spi_fiq_rx)
 39s3c24xx_spi_fix_rx:
 40	.word	fiq_rx_end - fiq_rx_start
 41	.word	fiq_rx_irq_ack - fiq_rx_start
 42fiq_rx_start:
 43	ldr	fiq_rtmp, fiq_rx_irq_ack
 44	str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
 45
 46	ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
 47	strb	fiq_rtmp, [ fiq_rrx ], #1
 48
 49	mov	fiq_rtmp, #0xff
 50	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 51
 52	subs	fiq_rcount, fiq_rcount, #1
 53	subnes	pc, lr, #4		@@ return, still have work to do
 54
 55	@@ set IRQ controller so that next op will trigger IRQ
 56	mov	fiq_rtmp, #0
 57	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
 58	subs	pc, lr, #4
 59
 60fiq_rx_irq_ack:
 61	.word	0
 62fiq_rx_end:
 63
 64ENTRY(s3c24xx_spi_fiq_txrx)
 65s3c24xx_spi_fiq_txrx:
 66	.word	fiq_txrx_end - fiq_txrx_start
 67	.word	fiq_txrx_irq_ack - fiq_txrx_start
 68fiq_txrx_start:
 69
 70	ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
 71	strb	fiq_rtmp, [ fiq_rrx ], #1
 72
 73	ldr	fiq_rtmp, fiq_txrx_irq_ack
 74	str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
 75
 76	ldrb	fiq_rtmp, [ fiq_rtx ], #1
 77	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 78
 79	subs	fiq_rcount, fiq_rcount, #1
 80	subnes	pc, lr, #4		@@ return, still have work to do
 81
 82	mov	fiq_rtmp, #0
 83	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
 84	subs	pc, lr, #4
 85
 86fiq_txrx_irq_ack:
 87	.word	0
 88
 89fiq_txrx_end:
 90
 91ENTRY(s3c24xx_spi_fiq_tx)
 92s3c24xx_spi_fix_tx:
 93	.word	fiq_tx_end - fiq_tx_start
 94	.word	fiq_tx_irq_ack - fiq_tx_start
 95fiq_tx_start:
 96	ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
 97
 98	ldr	fiq_rtmp, fiq_tx_irq_ack
 99	str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
100
101	ldrb	fiq_rtmp, [ fiq_rtx ], #1
102	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
103
104	subs	fiq_rcount, fiq_rcount, #1
105	subnes	pc, lr, #4		@@ return, still have work to do
106
107	mov	fiq_rtmp, #0
108	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
109	subs	pc, lr, #4
110
111fiq_tx_irq_ack:
112	.word	0
113
114fiq_tx_end:
115
116	.end
v5.4
  1/* SPDX-License-Identifier: GPL-2.0-only */
  2/* linux/drivers/spi/spi_s3c24xx_fiq.S
  3 *
  4 * Copyright 2009 Simtec Electronics
  5 *	Ben Dooks <ben@simtec.co.uk>
  6 *
  7 * S3C24XX SPI - FIQ pseudo-DMA transfer code
 
 
 
 
  8*/
  9
 10#include <linux/linkage.h>
 11#include <asm/assembler.h>
 12
 13#include <mach/map.h>
 14#include <mach/regs-irq.h>
 15#include <plat/regs-spi.h>
 16
 17#include "spi-s3c24xx-fiq.h"
 18
 19	.text
 20
 21	@ entry to these routines is as follows, with the register names
 22	@ defined in fiq.h so that they can be shared with the C files which
 23	@ setup the calling registers.
 24	@
 25	@ fiq_rirq	The base of the IRQ registers to find S3C2410_SRCPND
 26	@ fiq_rtmp	Temporary register to hold tx/rx data
 27	@ fiq_rspi	The base of the SPI register block
 28	@ fiq_rtx	The tx buffer pointer
 29	@ fiq_rrx	The rx buffer pointer
 30	@ fiq_rcount	The number of bytes to move
 31
 32	@ each entry starts with a word entry of how long it is
 33	@ and an offset to the irq acknowledgment word
 34
 35ENTRY(s3c24xx_spi_fiq_rx)
 36s3c24xx_spi_fix_rx:
 37	.word	fiq_rx_end - fiq_rx_start
 38	.word	fiq_rx_irq_ack - fiq_rx_start
 39fiq_rx_start:
 40	ldr	fiq_rtmp, fiq_rx_irq_ack
 41	str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
 42
 43	ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
 44	strb	fiq_rtmp, [ fiq_rrx ], #1
 45
 46	mov	fiq_rtmp, #0xff
 47	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 48
 49	subs	fiq_rcount, fiq_rcount, #1
 50	subnes	pc, lr, #4		@@ return, still have work to do
 51
 52	@@ set IRQ controller so that next op will trigger IRQ
 53	mov	fiq_rtmp, #0
 54	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
 55	subs	pc, lr, #4
 56
 57fiq_rx_irq_ack:
 58	.word	0
 59fiq_rx_end:
 60
 61ENTRY(s3c24xx_spi_fiq_txrx)
 62s3c24xx_spi_fiq_txrx:
 63	.word	fiq_txrx_end - fiq_txrx_start
 64	.word	fiq_txrx_irq_ack - fiq_txrx_start
 65fiq_txrx_start:
 66
 67	ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
 68	strb	fiq_rtmp, [ fiq_rrx ], #1
 69
 70	ldr	fiq_rtmp, fiq_txrx_irq_ack
 71	str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
 72
 73	ldrb	fiq_rtmp, [ fiq_rtx ], #1
 74	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 75
 76	subs	fiq_rcount, fiq_rcount, #1
 77	subnes	pc, lr, #4		@@ return, still have work to do
 78
 79	mov	fiq_rtmp, #0
 80	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
 81	subs	pc, lr, #4
 82
 83fiq_txrx_irq_ack:
 84	.word	0
 85
 86fiq_txrx_end:
 87
 88ENTRY(s3c24xx_spi_fiq_tx)
 89s3c24xx_spi_fix_tx:
 90	.word	fiq_tx_end - fiq_tx_start
 91	.word	fiq_tx_irq_ack - fiq_tx_start
 92fiq_tx_start:
 93	ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
 94
 95	ldr	fiq_rtmp, fiq_tx_irq_ack
 96	str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
 97
 98	ldrb	fiq_rtmp, [ fiq_rtx ], #1
 99	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
100
101	subs	fiq_rcount, fiq_rcount, #1
102	subnes	pc, lr, #4		@@ return, still have work to do
103
104	mov	fiq_rtmp, #0
105	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
106	subs	pc, lr, #4
107
108fiq_tx_irq_ack:
109	.word	0
110
111fiq_tx_end:
112
113	.end