diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 17:52:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 17:52:44 -0400 |
commit | 7235dd74a4733d4b3651349b5261d2e06996427d (patch) | |
tree | 737d4141e77fdd6bfd8c9878ed4f7fe293e7b629 /drivers/spi/spi-s3c24xx-fiq.S | |
parent | c7c8518498e82591d7784452f5674c3aeb4d079c (diff) | |
parent | 22a85e4cd51b49ec99703ddfdff8686d5442a093 (diff) |
Merge branch 'spi/next' of git://git.secretlab.ca/git/linux-2.6
* 'spi/next' of git://git.secretlab.ca/git/linux-2.6: (34 commits)
spi/imx: add device tree probe support
spi/imx: copy gpio number passed by platform data into driver private data
spi/imx: use soc name in spi device type naming scheme
spi/imx: merge type SPI_IMX_VER_0_7 into SPI_IMX_VER_0_4
spi/imx: do not use spi_imx2_3 to name SPI_IMX_VER_2_3 function and macro
spi/imx: use mx21 to name SPI_IMX_VER_0_0 function and macro
spi/imx: do not make copy of spi_imx_devtype_data
spi/dw: Add spi number into spi irq desc
spi/tegra: Use engineering names in DT compatible property
spi/fsl_spi: fix CPM spi driver
mach-s3c2410: remove unused spi-gpio.h file
spi: remove obsolete spi-s3c24xx-gpio driver
mach-gta2: remove unused spi-gpio.h include
mach-qt2410: convert to spi_gpio
mach-jive: convert to spi_gpio
spi/pxa2xx: Remove unavailable ssp_type from documentation
spi/bfin_spi: uninline fat queue funcs
spi/bfin_spi: constify pin array
spi/bfin_spi: use structs for accessing hardware regs
spi/topcliff-pch: Support new device ML7223 IOH
...
Fix up trivial conflict in arch/arm/mach-ep93xx/Makefile
Diffstat (limited to 'drivers/spi/spi-s3c24xx-fiq.S')
-rw-r--r-- | drivers/spi/spi-s3c24xx-fiq.S | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/drivers/spi/spi-s3c24xx-fiq.S b/drivers/spi/spi-s3c24xx-fiq.S new file mode 100644 index 000000000000..059f2dc1fda2 --- /dev/null +++ b/drivers/spi/spi-s3c24xx-fiq.S | |||
@@ -0,0 +1,116 @@ | |||
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 | |||
38 | ENTRY(s3c24xx_spi_fiq_rx) | ||
39 | s3c24xx_spi_fix_rx: | ||
40 | .word fiq_rx_end - fiq_rx_start | ||
41 | .word fiq_rx_irq_ack - fiq_rx_start | ||
42 | fiq_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 | |||
60 | fiq_rx_irq_ack: | ||
61 | .word 0 | ||
62 | fiq_rx_end: | ||
63 | |||
64 | ENTRY(s3c24xx_spi_fiq_txrx) | ||
65 | s3c24xx_spi_fiq_txrx: | ||
66 | .word fiq_txrx_end - fiq_txrx_start | ||
67 | .word fiq_txrx_irq_ack - fiq_txrx_start | ||
68 | fiq_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 | |||
86 | fiq_txrx_irq_ack: | ||
87 | .word 0 | ||
88 | |||
89 | fiq_txrx_end: | ||
90 | |||
91 | ENTRY(s3c24xx_spi_fiq_tx) | ||
92 | s3c24xx_spi_fix_tx: | ||
93 | .word fiq_tx_end - fiq_tx_start | ||
94 | .word fiq_tx_irq_ack - fiq_tx_start | ||
95 | fiq_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 | |||
111 | fiq_tx_irq_ack: | ||
112 | .word 0 | ||
113 | |||
114 | fiq_tx_end: | ||
115 | |||
116 | .end | ||