Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[linux/fpc-iii.git] / arch / arm / mach-s3c / irq-s3c24xx-fiq.S
blobb54cbd0122413c09a4d71beba2bc72350647c33d
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 */
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
13 #include "map.h"
14 #include "regs-irq.h"
16 #include <linux/spi/s3c24xx-fiq.h>
18 #define S3C2410_SPTDAT           (0x10)
19 #define S3C2410_SPRDAT           (0x14)
21         .text
23         @ entry to these routines is as follows, with the register names
24         @ defined in fiq.h so that they can be shared with the C files which
25         @ setup the calling registers.
26         @
27         @ fiq_rirq      The base of the IRQ registers to find S3C2410_SRCPND
28         @ fiq_rtmp      Temporary register to hold tx/rx data
29         @ fiq_rspi      The base of the SPI register block
30         @ fiq_rtx       The tx buffer pointer
31         @ fiq_rrx       The rx buffer pointer
32         @ fiq_rcount    The number of bytes to move
34         @ each entry starts with a word entry of how long it is
35         @ and an offset to the irq acknowledgment word
37 ENTRY(s3c24xx_spi_fiq_rx)
38 s3c24xx_spi_fix_rx:
39         .word   fiq_rx_end - fiq_rx_start
40         .word   fiq_rx_irq_ack - fiq_rx_start
41 fiq_rx_start:
42         ldr     fiq_rtmp, fiq_rx_irq_ack
43         str     fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
45         ldrb    fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
46         strb    fiq_rtmp, [ fiq_rrx ], #1
48         mov     fiq_rtmp, #0xff
49         strb    fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
51         subs    fiq_rcount, fiq_rcount, #1
52         subnes  pc, lr, #4              @@ return, still have work to do
54         @@ set IRQ controller so that next op will trigger IRQ
55         mov     fiq_rtmp, #0
56         str     fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
57         subs    pc, lr, #4
59 fiq_rx_irq_ack:
60         .word   0
61 fiq_rx_end:
63 ENTRY(s3c24xx_spi_fiq_txrx)
64 s3c24xx_spi_fiq_txrx:
65         .word   fiq_txrx_end - fiq_txrx_start
66         .word   fiq_txrx_irq_ack - fiq_txrx_start
67 fiq_txrx_start:
69         ldrb    fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
70         strb    fiq_rtmp, [ fiq_rrx ], #1
72         ldr     fiq_rtmp, fiq_txrx_irq_ack
73         str     fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
75         ldrb    fiq_rtmp, [ fiq_rtx ], #1
76         strb    fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
78         subs    fiq_rcount, fiq_rcount, #1
79         subnes  pc, lr, #4              @@ return, still have work to do
81         mov     fiq_rtmp, #0
82         str     fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
83         subs    pc, lr, #4
85 fiq_txrx_irq_ack:
86         .word   0
88 fiq_txrx_end:
90 ENTRY(s3c24xx_spi_fiq_tx)
91 s3c24xx_spi_fix_tx:
92         .word   fiq_tx_end - fiq_tx_start
93         .word   fiq_tx_irq_ack - fiq_tx_start
94 fiq_tx_start:
95         ldrb    fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
97         ldr     fiq_rtmp, fiq_tx_irq_ack
98         str     fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
100         ldrb    fiq_rtmp, [ fiq_rtx ], #1
101         strb    fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
103         subs    fiq_rcount, fiq_rcount, #1
104         subnes  pc, lr, #4              @@ return, still have work to do
106         mov     fiq_rtmp, #0
107         str     fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
108         subs    pc, lr, #4
110 fiq_tx_irq_ack:
111         .word   0
113 fiq_tx_end:
115         .end