diff options
Diffstat (limited to 'include')
100 files changed, 3242 insertions, 1115 deletions
diff --git a/include/asm-arm/arch-at91/at91_lcdc.h b/include/asm-arm/arch-at91/at91_lcdc.h deleted file mode 100644 index ab040a40d37b..000000000000 --- a/include/asm-arm/arch-at91/at91_lcdc.h +++ /dev/null | |||
@@ -1,148 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/at91_lcdc.h | ||
3 | * | ||
4 | * LCD Controller (LCDC). | ||
5 | * Based on AT91SAM9261 datasheet revision E. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef AT91_LCDC_H | ||
14 | #define AT91_LCDC_H | ||
15 | |||
16 | #define AT91_LCDC_DMABADDR1 0x00 /* DMA Base Address Register 1 */ | ||
17 | #define AT91_LCDC_DMABADDR2 0x04 /* DMA Base Address Register 2 */ | ||
18 | #define AT91_LCDC_DMAFRMPT1 0x08 /* DMA Frame Pointer Register 1 */ | ||
19 | #define AT91_LCDC_DMAFRMPT2 0x0c /* DMA Frame Pointer Register 2 */ | ||
20 | #define AT91_LCDC_DMAFRMADD1 0x10 /* DMA Frame Address Register 1 */ | ||
21 | #define AT91_LCDC_DMAFRMADD2 0x14 /* DMA Frame Address Register 2 */ | ||
22 | |||
23 | #define AT91_LCDC_DMAFRMCFG 0x18 /* DMA Frame Configuration Register */ | ||
24 | #define AT91_LCDC_FRSIZE (0x7fffff << 0) /* Frame Size */ | ||
25 | #define AT91_LCDC_BLENGTH (0x7f << 24) /* Burst Length */ | ||
26 | |||
27 | #define AT91_LCDC_DMACON 0x1c /* DMA Control Register */ | ||
28 | #define AT91_LCDC_DMAEN (0x1 << 0) /* DMA Enable */ | ||
29 | #define AT91_LCDC_DMARST (0x1 << 1) /* DMA Reset */ | ||
30 | #define AT91_LCDC_DMABUSY (0x1 << 2) /* DMA Busy */ | ||
31 | |||
32 | #define AT91_LCDC_LCDCON1 0x0800 /* LCD Control Register 1 */ | ||
33 | #define AT91_LCDC_BYPASS (1 << 0) /* Bypass lcd_dotck divider */ | ||
34 | #define AT91_LCDC_CLKVAL (0x1ff << 12) /* Clock Divider */ | ||
35 | #define AT91_LCDC_LINCNT (0x7ff << 21) /* Line Counter */ | ||
36 | |||
37 | #define AT91_LCDC_LCDCON2 0x0804 /* LCD Control Register 2 */ | ||
38 | #define AT91_LCDC_DISTYPE (3 << 0) /* Display Type */ | ||
39 | #define AT91_LCDC_DISTYPE_STNMONO (0 << 0) | ||
40 | #define AT91_LCDC_DISTYPE_STNCOLOR (1 << 0) | ||
41 | #define AT91_LCDC_DISTYPE_TFT (2 << 0) | ||
42 | #define AT91_LCDC_SCANMOD (1 << 2) /* Scan Mode */ | ||
43 | #define AT91_LCDC_SCANMOD_SINGLE (0 << 2) | ||
44 | #define AT91_LCDC_SCANMOD_DUAL (1 << 2) | ||
45 | #define AT91_LCDC_IFWIDTH (3 << 3) /*Interface Width */ | ||
46 | #define AT91_LCDC_IFWIDTH_4 (0 << 3) | ||
47 | #define AT91_LCDC_IFWIDTH_8 (1 << 3) | ||
48 | #define AT91_LCDC_IFWIDTH_16 (2 << 3) | ||
49 | #define AT91_LCDC_PIXELSIZE (7 << 5) /* Bits per pixel */ | ||
50 | #define AT91_LCDC_PIXELSIZE_1 (0 << 5) | ||
51 | #define AT91_LCDC_PIXELSIZE_2 (1 << 5) | ||
52 | #define AT91_LCDC_PIXELSIZE_4 (2 << 5) | ||
53 | #define AT91_LCDC_PIXELSIZE_8 (3 << 5) | ||
54 | #define AT91_LCDC_PIXELSIZE_16 (4 << 5) | ||
55 | #define AT91_LCDC_PIXELSIZE_24 (5 << 5) | ||
56 | #define AT91_LCDC_INVVD (1 << 8) /* LCD Data polarity */ | ||
57 | #define AT91_LCDC_INVVD_NORMAL (0 << 8) | ||
58 | #define AT91_LCDC_INVVD_INVERTED (1 << 8) | ||
59 | #define AT91_LCDC_INVFRAME (1 << 9 ) /* LCD VSync polarity */ | ||
60 | #define AT91_LCDC_INVFRAME_NORMAL (0 << 9) | ||
61 | #define AT91_LCDC_INVFRAME_INVERTED (1 << 9) | ||
62 | #define AT91_LCDC_INVLINE (1 << 10) /* LCD HSync polarity */ | ||
63 | #define AT91_LCDC_INVLINE_NORMAL (0 << 10) | ||
64 | #define AT91_LCDC_INVLINE_INVERTED (1 << 10) | ||
65 | #define AT91_LCDC_INVCLK (1 << 11) /* LCD dotclk polarity */ | ||
66 | #define AT91_LCDC_INVCLK_NORMAL (0 << 11) | ||
67 | #define AT91_LCDC_INVCLK_INVERTED (1 << 11) | ||
68 | #define AT91_LCDC_INVDVAL (1 << 12) /* LCD dval polarity */ | ||
69 | #define AT91_LCDC_INVDVAL_NORMAL (0 << 12) | ||
70 | #define AT91_LCDC_INVDVAL_INVERTED (1 << 12) | ||
71 | #define AT91_LCDC_CLKMOD (1 << 15) /* LCD dotclk mode */ | ||
72 | #define AT91_LCDC_CLKMOD_ACTIVEDISPLAY (0 << 15) | ||
73 | #define AT91_LCDC_CLKMOD_ALWAYSACTIVE (1 << 15) | ||
74 | #define AT91_LCDC_MEMOR (1 << 31) /* Memory Ordering Format */ | ||
75 | #define AT91_LCDC_MEMOR_BIG (0 << 31) | ||
76 | #define AT91_LCDC_MEMOR_LITTLE (1 << 31) | ||
77 | |||
78 | #define AT91_LCDC_TIM1 0x0808 /* LCD Timing Register 1 */ | ||
79 | #define AT91_LCDC_VFP (0xff << 0) /* Vertical Front Porch */ | ||
80 | #define AT91_LCDC_VBP (0xff << 8) /* Vertical Back Porch */ | ||
81 | #define AT91_LCDC_VPW (0x3f << 16) /* Vertical Synchronization Pulse Width */ | ||
82 | #define AT91_LCDC_VHDLY (0xf << 24) /* Vertical to Horizontal Delay */ | ||
83 | |||
84 | #define AT91_LCDC_TIM2 0x080c /* LCD Timing Register 2 */ | ||
85 | #define AT91_LCDC_HBP (0xff << 0) /* Horizontal Back Porch */ | ||
86 | #define AT91_LCDC_HPW (0x3f << 8) /* Horizontal Synchronization Pulse Width */ | ||
87 | #define AT91_LCDC_HFP (0x7ff << 21) /* Horizontal Front Porch */ | ||
88 | |||
89 | #define AT91_LCDC_LCDFRMCFG 0x0810 /* LCD Frame Configuration Register */ | ||
90 | #define AT91_LCDC_LINEVAL (0x7ff << 0) /* Vertical Size of LCD Module */ | ||
91 | #define AT91_LCDC_HOZVAL (0x7ff << 21) /* Horizontal Size of LCD Module */ | ||
92 | |||
93 | #define AT91_LCDC_FIFO 0x0814 /* LCD FIFO Register */ | ||
94 | #define AT91_LCDC_FIFOTH (0xffff) /* FIFO Threshold */ | ||
95 | |||
96 | #define AT91_LCDC_DP1_2 0x081c /* Dithering Pattern DP1_2 Register */ | ||
97 | #define AT91_LCDC_DP4_7 0x0820 /* Dithering Pattern DP4_7 Register */ | ||
98 | #define AT91_LCDC_DP3_5 0x0824 /* Dithering Pattern DP3_5 Register */ | ||
99 | #define AT91_LCDC_DP2_3 0x0828 /* Dithering Pattern DP2_3 Register */ | ||
100 | #define AT91_LCDC_DP5_7 0x082c /* Dithering Pattern DP5_7 Register */ | ||
101 | #define AT91_LCDC_DP3_4 0x0830 /* Dithering Pattern DP3_4 Register */ | ||
102 | #define AT91_LCDC_DP4_5 0x0834 /* Dithering Pattern DP4_5 Register */ | ||
103 | #define AT91_LCDC_DP6_7 0x0838 /* Dithering Pattern DP6_7 Register */ | ||
104 | #define AT91_LCDC_DP1_2_VAL (0xff) | ||
105 | #define AT91_LCDC_DP4_7_VAL (0xfffffff) | ||
106 | #define AT91_LCDC_DP3_5_VAL (0xfffff) | ||
107 | #define AT91_LCDC_DP2_3_VAL (0xfff) | ||
108 | #define AT91_LCDC_DP5_7_VAL (0xfffffff) | ||
109 | #define AT91_LCDC_DP3_4_VAL (0xffff) | ||
110 | #define AT91_LCDC_DP4_5_VAL (0xfffff) | ||
111 | #define AT91_LCDC_DP6_7_VAL (0xfffffff) | ||
112 | |||
113 | #define AT91_LCDC_PWRCON 0x083c /* Power Control Register */ | ||
114 | #define AT91_LCDC_PWR (1 << 0) /* LCD Module Power Control */ | ||
115 | #define AT91_LCDC_GUARDT (0x7f << 1) /* Delay in Frame Period */ | ||
116 | #define AT91_LCDC_BUSY (1 << 31) /* LCD Busy */ | ||
117 | |||
118 | #define AT91_LCDC_CONTRAST_CTR 0x0840 /* Contrast Control Register */ | ||
119 | #define AT91_LCDC_PS (3 << 0) /* Contrast Counter Prescaler */ | ||
120 | #define AT91_LCDC_PS_DIV1 (0 << 0) | ||
121 | #define AT91_LCDC_PS_DIV2 (1 << 0) | ||
122 | #define AT91_LCDC_PS_DIV4 (2 << 0) | ||
123 | #define AT91_LCDC_PS_DIV8 (3 << 0) | ||
124 | #define AT91_LCDC_POL (1 << 2) /* Polarity of output Pulse */ | ||
125 | #define AT91_LCDC_POL_NEGATIVE (0 << 2) | ||
126 | #define AT91_LCDC_POL_POSITIVE (1 << 2) | ||
127 | #define AT91_LCDC_ENA (1 << 3) /* PWM generator Control */ | ||
128 | #define AT91_LCDC_ENA_PWMDISABLE (0 << 3) | ||
129 | #define AT91_LCDC_ENA_PWMENABLE (1 << 3) | ||
130 | |||
131 | #define AT91_LCDC_CONTRAST_VAL 0x0844 /* Contrast Value Register */ | ||
132 | #define AT91_LCDC_CVAL (0xff) /* PWM compare value */ | ||
133 | |||
134 | #define AT91_LCDC_IER 0x0848 /* Interrupt Enable Register */ | ||
135 | #define AT91_LCDC_IDR 0x084c /* Interrupt Disable Register */ | ||
136 | #define AT91_LCDC_IMR 0x0850 /* Interrupt Mask Register */ | ||
137 | #define AT91_LCDC_ISR 0x0854 /* Interrupt Enable Register */ | ||
138 | #define AT91_LCDC_ICR 0x0858 /* Interrupt Clear Register */ | ||
139 | #define AT91_LCDC_LNI (1 << 0) /* Line Interrupt */ | ||
140 | #define AT91_LCDC_LSTLNI (1 << 1) /* Last Line Interrupt */ | ||
141 | #define AT91_LCDC_EOFI (1 << 2) /* DMA End Of Frame Interrupt */ | ||
142 | #define AT91_LCDC_UFLWI (1 << 4) /* FIFO Underflow Interrupt */ | ||
143 | #define AT91_LCDC_OWRI (1 << 5) /* FIFO Overwrite Interrupt */ | ||
144 | #define AT91_LCDC_MERI (1 << 6) /* DMA Memory Error Interrupt */ | ||
145 | |||
146 | #define AT91_LCDC_LUT_(n) (0x0c00 + ((n)*4)) /* Palette Entry 0..255 */ | ||
147 | |||
148 | #endif | ||
diff --git a/include/asm-arm/arch-at91/at91_pmc.h b/include/asm-arm/arch-at91/at91_pmc.h index 33ff5b6798ee..52cd8e5dabc9 100644 --- a/include/asm-arm/arch-at91/at91_pmc.h +++ b/include/asm-arm/arch-at91/at91_pmc.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ | 25 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ |
26 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ | 26 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ |
27 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ | 27 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ |
28 | #define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */ | ||
28 | #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ | 29 | #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ |
29 | #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ | 30 | #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ |
30 | #define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ | 31 | #define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ |
@@ -37,7 +38,9 @@ | |||
37 | #define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ | 38 | #define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ |
38 | #define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ | 39 | #define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ |
39 | 40 | ||
40 | #define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register */ | 41 | #define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [SAM9RL, CAP9] */ |
42 | |||
43 | #define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */ | ||
41 | #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ | 44 | #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ |
42 | #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [AT91SAM926x only] */ | 45 | #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [AT91SAM926x only] */ |
43 | #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ | 46 | #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ |
@@ -52,6 +55,10 @@ | |||
52 | #define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */ | 55 | #define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */ |
53 | #define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */ | 56 | #define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */ |
54 | #define AT91_PMC_MUL (0x7ff << 16) /* PLL Multiplier */ | 57 | #define AT91_PMC_MUL (0x7ff << 16) /* PLL Multiplier */ |
58 | #define AT91_PMC_USBDIV (3 << 28) /* USB Divisor (PLLB only) */ | ||
59 | #define AT91_PMC_USBDIV_1 (0 << 28) | ||
60 | #define AT91_PMC_USBDIV_2 (1 << 28) | ||
61 | #define AT91_PMC_USBDIV_4 (2 << 28) | ||
55 | #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */ | 62 | #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */ |
56 | 63 | ||
57 | #define AT91_PMC_MCKR (AT91_PMC + 0x30) /* Master Clock Register */ | 64 | #define AT91_PMC_MCKR (AT91_PMC + 0x30) /* Master Clock Register */ |
diff --git a/include/asm-arm/arch-at91/at91_rtt.h b/include/asm-arm/arch-at91/at91_rtt.h index bae1103fbbb2..39a32633b275 100644 --- a/include/asm-arm/arch-at91/at91_rtt.h +++ b/include/asm-arm/arch-at91/at91_rtt.h | |||
@@ -13,19 +13,19 @@ | |||
13 | #ifndef AT91_RTT_H | 13 | #ifndef AT91_RTT_H |
14 | #define AT91_RTT_H | 14 | #define AT91_RTT_H |
15 | 15 | ||
16 | #define AT91_RTT_MR (AT91_RTT + 0x00) /* Real-time Mode Register */ | 16 | #define AT91_RTT_MR 0x00 /* Real-time Mode Register */ |
17 | #define AT91_RTT_RTPRES (0xffff << 0) /* Real-time Timer Prescaler Value */ | 17 | #define AT91_RTT_RTPRES (0xffff << 0) /* Real-time Timer Prescaler Value */ |
18 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ | 18 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ |
19 | #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ | 19 | #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ |
20 | #define AT91_RTT_RTTRST (1 << 18) /* Real Time Timer Restart */ | 20 | #define AT91_RTT_RTTRST (1 << 18) /* Real Time Timer Restart */ |
21 | 21 | ||
22 | #define AT91_RTT_AR (AT91_RTT + 0x04) /* Real-time Alarm Register */ | 22 | #define AT91_RTT_AR 0x04 /* Real-time Alarm Register */ |
23 | #define AT91_RTT_ALMV (0xffffffff) /* Alarm Value */ | 23 | #define AT91_RTT_ALMV (0xffffffff) /* Alarm Value */ |
24 | 24 | ||
25 | #define AT91_RTT_VR (AT91_RTT + 0x08) /* Real-time Value Register */ | 25 | #define AT91_RTT_VR 0x08 /* Real-time Value Register */ |
26 | #define AT91_RTT_CRTV (0xffffffff) /* Current Real-time Value */ | 26 | #define AT91_RTT_CRTV (0xffffffff) /* Current Real-time Value */ |
27 | 27 | ||
28 | #define AT91_RTT_SR (AT91_RTT + 0x0c) /* Real-time Status Register */ | 28 | #define AT91_RTT_SR 0x0c /* Real-time Status Register */ |
29 | #define AT91_RTT_ALMS (1 << 0) /* Real-time Alarm Status */ | 29 | #define AT91_RTT_ALMS (1 << 0) /* Real-time Alarm Status */ |
30 | #define AT91_RTT_RTTINC (1 << 1) /* Real-time Timer Increment */ | 30 | #define AT91_RTT_RTTINC (1 << 1) /* Real-time Timer Increment */ |
31 | 31 | ||
diff --git a/include/asm-arm/arch-at91/at91_twi.h b/include/asm-arm/arch-at91/at91_twi.h index ca9a90733456..f9f2e3cd95c5 100644 --- a/include/asm-arm/arch-at91/at91_twi.h +++ b/include/asm-arm/arch-at91/at91_twi.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #define AT91_TWI_STOP (1 << 1) /* Send a Stop Condition */ | 21 | #define AT91_TWI_STOP (1 << 1) /* Send a Stop Condition */ |
22 | #define AT91_TWI_MSEN (1 << 2) /* Master Transfer Enable */ | 22 | #define AT91_TWI_MSEN (1 << 2) /* Master Transfer Enable */ |
23 | #define AT91_TWI_MSDIS (1 << 3) /* Master Transfer Disable */ | 23 | #define AT91_TWI_MSDIS (1 << 3) /* Master Transfer Disable */ |
24 | #define AT91_TWI_SVEN (1 << 4) /* Slave Transfer Enable [SAM9260 only] */ | ||
25 | #define AT91_TWI_SVDIS (1 << 5) /* Slave Transfer Disable [SAM9260 only] */ | ||
24 | #define AT91_TWI_SWRST (1 << 7) /* Software Reset */ | 26 | #define AT91_TWI_SWRST (1 << 7) /* Software Reset */ |
25 | 27 | ||
26 | #define AT91_TWI_MMR 0x04 /* Master Mode Register */ | 28 | #define AT91_TWI_MMR 0x04 /* Master Mode Register */ |
@@ -32,6 +34,9 @@ | |||
32 | #define AT91_TWI_MREAD (1 << 12) /* Master Read Direction */ | 34 | #define AT91_TWI_MREAD (1 << 12) /* Master Read Direction */ |
33 | #define AT91_TWI_DADR (0x7f << 16) /* Device Address */ | 35 | #define AT91_TWI_DADR (0x7f << 16) /* Device Address */ |
34 | 36 | ||
37 | #define AT91_TWI_SMR 0x08 /* Slave Mode Register [SAM9260 only] */ | ||
38 | #define AT91_TWI_SADR (0x7f << 16) /* Slave Address */ | ||
39 | |||
35 | #define AT91_TWI_IADR 0x0c /* Internal Address Register */ | 40 | #define AT91_TWI_IADR 0x0c /* Internal Address Register */ |
36 | 41 | ||
37 | #define AT91_TWI_CWGR 0x10 /* Clock Waveform Generator Register */ | 42 | #define AT91_TWI_CWGR 0x10 /* Clock Waveform Generator Register */ |
@@ -43,9 +48,15 @@ | |||
43 | #define AT91_TWI_TXCOMP (1 << 0) /* Transmission Complete */ | 48 | #define AT91_TWI_TXCOMP (1 << 0) /* Transmission Complete */ |
44 | #define AT91_TWI_RXRDY (1 << 1) /* Receive Holding Register Ready */ | 49 | #define AT91_TWI_RXRDY (1 << 1) /* Receive Holding Register Ready */ |
45 | #define AT91_TWI_TXRDY (1 << 2) /* Transmit Holding Register Ready */ | 50 | #define AT91_TWI_TXRDY (1 << 2) /* Transmit Holding Register Ready */ |
51 | #define AT91_TWI_SVREAD (1 << 3) /* Slave Read [SAM9260 only] */ | ||
52 | #define AT91_TWI_SVACC (1 << 4) /* Slave Access [SAM9260 only] */ | ||
53 | #define AT91_TWI_GACC (1 << 5) /* General Call Access [SAM9260 only] */ | ||
46 | #define AT91_TWI_OVRE (1 << 6) /* Overrun Error [AT91RM9200 only] */ | 54 | #define AT91_TWI_OVRE (1 << 6) /* Overrun Error [AT91RM9200 only] */ |
47 | #define AT91_TWI_UNRE (1 << 7) /* Underrun Error [AT91RM9200 only] */ | 55 | #define AT91_TWI_UNRE (1 << 7) /* Underrun Error [AT91RM9200 only] */ |
48 | #define AT91_TWI_NACK (1 << 8) /* Not Acknowledged */ | 56 | #define AT91_TWI_NACK (1 << 8) /* Not Acknowledged */ |
57 | #define AT91_TWI_ARBLST (1 << 9) /* Arbitration Lost [SAM9260 only] */ | ||
58 | #define AT91_TWI_SCLWS (1 << 10) /* Clock Wait State [SAM9260 only] */ | ||
59 | #define AT91_TWI_EOSACC (1 << 11) /* End of Slave Address [SAM9260 only] */ | ||
49 | 60 | ||
50 | #define AT91_TWI_IER 0x24 /* Interrupt Enable Register */ | 61 | #define AT91_TWI_IER 0x24 /* Interrupt Enable Register */ |
51 | #define AT91_TWI_IDR 0x28 /* Interrupt Disable Register */ | 62 | #define AT91_TWI_IDR 0x28 /* Interrupt Disable Register */ |
diff --git a/include/asm-arm/arch-at91/at91cap9.h b/include/asm-arm/arch-at91/at91cap9.h new file mode 100644 index 000000000000..73e1fcf4a0aa --- /dev/null +++ b/include/asm-arm/arch-at91/at91cap9.h | |||
@@ -0,0 +1,121 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/at91cap9.h | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2007 Atmel Corporation. | ||
7 | * | ||
8 | * Common definitions. | ||
9 | * Based on AT91CAP9 datasheet revision B (Preliminary). | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #ifndef AT91CAP9_H | ||
18 | #define AT91CAP9_H | ||
19 | |||
20 | /* | ||
21 | * Peripheral identifiers/interrupts. | ||
22 | */ | ||
23 | #define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ | ||
24 | #define AT91_ID_SYS 1 /* System Peripherals */ | ||
25 | #define AT91CAP9_ID_PIOABCD 2 /* Parallel IO Controller A, B, C and D */ | ||
26 | #define AT91CAP9_ID_MPB0 3 /* MP Block Peripheral 0 */ | ||
27 | #define AT91CAP9_ID_MPB1 4 /* MP Block Peripheral 1 */ | ||
28 | #define AT91CAP9_ID_MPB2 5 /* MP Block Peripheral 2 */ | ||
29 | #define AT91CAP9_ID_MPB3 6 /* MP Block Peripheral 3 */ | ||
30 | #define AT91CAP9_ID_MPB4 7 /* MP Block Peripheral 4 */ | ||
31 | #define AT91CAP9_ID_US0 8 /* USART 0 */ | ||
32 | #define AT91CAP9_ID_US1 9 /* USART 1 */ | ||
33 | #define AT91CAP9_ID_US2 10 /* USART 2 */ | ||
34 | #define AT91CAP9_ID_MCI0 11 /* Multimedia Card Interface 0 */ | ||
35 | #define AT91CAP9_ID_MCI1 12 /* Multimedia Card Interface 1 */ | ||
36 | #define AT91CAP9_ID_CAN 13 /* CAN */ | ||
37 | #define AT91CAP9_ID_TWI 14 /* Two-Wire Interface */ | ||
38 | #define AT91CAP9_ID_SPI0 15 /* Serial Peripheral Interface 0 */ | ||
39 | #define AT91CAP9_ID_SPI1 16 /* Serial Peripheral Interface 0 */ | ||
40 | #define AT91CAP9_ID_SSC0 17 /* Serial Synchronous Controller 0 */ | ||
41 | #define AT91CAP9_ID_SSC1 18 /* Serial Synchronous Controller 1 */ | ||
42 | #define AT91CAP9_ID_AC97C 19 /* AC97 Controller */ | ||
43 | #define AT91CAP9_ID_TCB 20 /* Timer Counter 0, 1 and 2 */ | ||
44 | #define AT91CAP9_ID_PWMC 21 /* Pulse Width Modulation Controller */ | ||
45 | #define AT91CAP9_ID_EMAC 22 /* Ethernet */ | ||
46 | #define AT91CAP9_ID_AESTDES 23 /* Advanced Encryption Standard, Triple DES */ | ||
47 | #define AT91CAP9_ID_ADC 24 /* Analog-to-Digital Converter */ | ||
48 | #define AT91CAP9_ID_ISI 25 /* Image Sensor Interface */ | ||
49 | #define AT91CAP9_ID_LCDC 26 /* LCD Controller */ | ||
50 | #define AT91CAP9_ID_DMA 27 /* DMA Controller */ | ||
51 | #define AT91CAP9_ID_UDPHS 28 /* USB High Speed Device Port */ | ||
52 | #define AT91CAP9_ID_UHP 29 /* USB Host Port */ | ||
53 | #define AT91CAP9_ID_IRQ0 30 /* Advanced Interrupt Controller (IRQ0) */ | ||
54 | #define AT91CAP9_ID_IRQ1 31 /* Advanced Interrupt Controller (IRQ1) */ | ||
55 | |||
56 | /* | ||
57 | * User Peripheral physical base addresses. | ||
58 | */ | ||
59 | #define AT91CAP9_BASE_UDPHS 0xfff78000 | ||
60 | #define AT91CAP9_BASE_TCB0 0xfff7c000 | ||
61 | #define AT91CAP9_BASE_TC0 0xfff7c000 | ||
62 | #define AT91CAP9_BASE_TC1 0xfff7c040 | ||
63 | #define AT91CAP9_BASE_TC2 0xfff7c080 | ||
64 | #define AT91CAP9_BASE_MCI0 0xfff80000 | ||
65 | #define AT91CAP9_BASE_MCI1 0xfff84000 | ||
66 | #define AT91CAP9_BASE_TWI 0xfff88000 | ||
67 | #define AT91CAP9_BASE_US0 0xfff8c000 | ||
68 | #define AT91CAP9_BASE_US1 0xfff90000 | ||
69 | #define AT91CAP9_BASE_US2 0xfff94000 | ||
70 | #define AT91CAP9_BASE_SSC0 0xfff98000 | ||
71 | #define AT91CAP9_BASE_SSC1 0xfff9c000 | ||
72 | #define AT91CAP9_BASE_AC97C 0xfffa0000 | ||
73 | #define AT91CAP9_BASE_SPI0 0xfffa4000 | ||
74 | #define AT91CAP9_BASE_SPI1 0xfffa8000 | ||
75 | #define AT91CAP9_BASE_CAN 0xfffac000 | ||
76 | #define AT91CAP9_BASE_PWMC 0xfffb8000 | ||
77 | #define AT91CAP9_BASE_EMAC 0xfffbc000 | ||
78 | #define AT91CAP9_BASE_ADC 0xfffc0000 | ||
79 | #define AT91CAP9_BASE_ISI 0xfffc4000 | ||
80 | #define AT91_BASE_SYS 0xffffe200 | ||
81 | |||
82 | /* | ||
83 | * System Peripherals (offset from AT91_BASE_SYS) | ||
84 | */ | ||
85 | #define AT91_ECC (0xffffe200 - AT91_BASE_SYS) | ||
86 | #define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS) | ||
87 | #define AT91_DDRSDRC (0xffffe600 - AT91_BASE_SYS) | ||
88 | #define AT91_SMC (0xffffe800 - AT91_BASE_SYS) | ||
89 | #define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) | ||
90 | #define AT91_CCFG (0xffffeb10 - AT91_BASE_SYS) | ||
91 | #define AT91_DMA (0xffffec00 - AT91_BASE_SYS) | ||
92 | #define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) | ||
93 | #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) | ||
94 | #define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) | ||
95 | #define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) | ||
96 | #define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) | ||
97 | #define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) | ||
98 | #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) | ||
99 | #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) | ||
100 | #define AT91_SHDC (0xfffffd10 - AT91_BASE_SYS) | ||
101 | #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) | ||
102 | #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) | ||
103 | #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) | ||
104 | #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) | ||
105 | |||
106 | /* | ||
107 | * Internal Memory. | ||
108 | */ | ||
109 | #define AT91CAP9_SRAM_BASE 0x00100000 /* Internal SRAM base address */ | ||
110 | #define AT91CAP9_SRAM_SIZE (32 * SZ_1K) /* Internal SRAM size (32Kb) */ | ||
111 | |||
112 | #define AT91CAP9_ROM_BASE 0x00400000 /* Internal ROM base address */ | ||
113 | #define AT91CAP9_ROM_SIZE (32 * SZ_1K) /* Internal ROM size (32Kb) */ | ||
114 | |||
115 | #define AT91CAP9_LCDC_BASE 0x00500000 /* LCD Controller */ | ||
116 | #define AT91CAP9_UDPHS_BASE 0x00600000 /* USB High Speed Device Port */ | ||
117 | #define AT91CAP9_UHP_BASE 0x00700000 /* USB Host controller */ | ||
118 | |||
119 | #define CONFIG_DRAM_BASE AT91_CHIPSELECT_6 | ||
120 | |||
121 | #endif | ||
diff --git a/include/asm-arm/arch-at91/at91cap9_matrix.h b/include/asm-arm/arch-at91/at91cap9_matrix.h new file mode 100644 index 000000000000..a641686b6c3d --- /dev/null +++ b/include/asm-arm/arch-at91/at91cap9_matrix.h | |||
@@ -0,0 +1,132 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/at91cap9_matrix.h | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2006 Atmel Corporation. | ||
7 | * | ||
8 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. | ||
9 | * Based on AT91CAP9 datasheet revision B (Preliminary). | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #ifndef AT91CAP9_MATRIX_H | ||
18 | #define AT91CAP9_MATRIX_H | ||
19 | |||
20 | #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ | ||
21 | #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ | ||
22 | #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ | ||
23 | #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ | ||
24 | #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ | ||
25 | #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ | ||
26 | #define AT91_MATRIX_MCFG6 (AT91_MATRIX + 0x18) /* Master Configuration Register 6 */ | ||
27 | #define AT91_MATRIX_MCFG7 (AT91_MATRIX + 0x1C) /* Master Configuration Register 7 */ | ||
28 | #define AT91_MATRIX_MCFG8 (AT91_MATRIX + 0x20) /* Master Configuration Register 8 */ | ||
29 | #define AT91_MATRIX_MCFG9 (AT91_MATRIX + 0x24) /* Master Configuration Register 9 */ | ||
30 | #define AT91_MATRIX_MCFG10 (AT91_MATRIX + 0x28) /* Master Configuration Register 10 */ | ||
31 | #define AT91_MATRIX_MCFG11 (AT91_MATRIX + 0x2C) /* Master Configuration Register 11 */ | ||
32 | #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ | ||
33 | #define AT91_MATRIX_ULBT_INFINITE (0 << 0) | ||
34 | #define AT91_MATRIX_ULBT_SINGLE (1 << 0) | ||
35 | #define AT91_MATRIX_ULBT_FOUR (2 << 0) | ||
36 | #define AT91_MATRIX_ULBT_EIGHT (3 << 0) | ||
37 | #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) | ||
38 | |||
39 | #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ | ||
40 | #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ | ||
41 | #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ | ||
42 | #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ | ||
43 | #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ | ||
44 | #define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */ | ||
45 | #define AT91_MATRIX_SCFG6 (AT91_MATRIX + 0x58) /* Slave Configuration Register 6 */ | ||
46 | #define AT91_MATRIX_SCFG7 (AT91_MATRIX + 0x5C) /* Slave Configuration Register 7 */ | ||
47 | #define AT91_MATRIX_SCFG8 (AT91_MATRIX + 0x60) /* Slave Configuration Register 8 */ | ||
48 | #define AT91_MATRIX_SCFG9 (AT91_MATRIX + 0x64) /* Slave Configuration Register 9 */ | ||
49 | #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ | ||
50 | #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ | ||
51 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) | ||
52 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) | ||
53 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) | ||
54 | #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ | ||
55 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ | ||
56 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) | ||
57 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) | ||
58 | |||
59 | #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ | ||
60 | #define AT91_MATRIX_PRBS0 (AT91_MATRIX + 0x84) /* Priority Register B for Slave 0 */ | ||
61 | #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ | ||
62 | #define AT91_MATRIX_PRBS1 (AT91_MATRIX + 0x8C) /* Priority Register B for Slave 1 */ | ||
63 | #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ | ||
64 | #define AT91_MATRIX_PRBS2 (AT91_MATRIX + 0x94) /* Priority Register B for Slave 2 */ | ||
65 | #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ | ||
66 | #define AT91_MATRIX_PRBS3 (AT91_MATRIX + 0x9C) /* Priority Register B for Slave 3 */ | ||
67 | #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ | ||
68 | #define AT91_MATRIX_PRBS4 (AT91_MATRIX + 0xA4) /* Priority Register B for Slave 4 */ | ||
69 | #define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */ | ||
70 | #define AT91_MATRIX_PRBS5 (AT91_MATRIX + 0xAC) /* Priority Register B for Slave 5 */ | ||
71 | #define AT91_MATRIX_PRAS6 (AT91_MATRIX + 0xB0) /* Priority Register A for Slave 6 */ | ||
72 | #define AT91_MATRIX_PRBS6 (AT91_MATRIX + 0xB4) /* Priority Register B for Slave 6 */ | ||
73 | #define AT91_MATRIX_PRAS7 (AT91_MATRIX + 0xB8) /* Priority Register A for Slave 7 */ | ||
74 | #define AT91_MATRIX_PRBS7 (AT91_MATRIX + 0xBC) /* Priority Register B for Slave 7 */ | ||
75 | #define AT91_MATRIX_PRAS8 (AT91_MATRIX + 0xC0) /* Priority Register A for Slave 8 */ | ||
76 | #define AT91_MATRIX_PRBS8 (AT91_MATRIX + 0xC4) /* Priority Register B for Slave 8 */ | ||
77 | #define AT91_MATRIX_PRAS9 (AT91_MATRIX + 0xC8) /* Priority Register A for Slave 9 */ | ||
78 | #define AT91_MATRIX_PRBS9 (AT91_MATRIX + 0xCC) /* Priority Register B for Slave 9 */ | ||
79 | #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ | ||
80 | #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ | ||
81 | #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ | ||
82 | #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ | ||
83 | #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ | ||
84 | #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ | ||
85 | #define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */ | ||
86 | #define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */ | ||
87 | #define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */ | ||
88 | #define AT91_MATRIX_M9PR (3 << 4) /* Master 9 Priority (in Register B) */ | ||
89 | #define AT91_MATRIX_M10PR (3 << 8) /* Master 10 Priority (in Register B) */ | ||
90 | #define AT91_MATRIX_M11PR (3 << 12) /* Master 11 Priority (in Register B) */ | ||
91 | |||
92 | #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ | ||
93 | #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ | ||
94 | #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ | ||
95 | #define AT91_MATRIX_RCB2 (1 << 2) | ||
96 | #define AT91_MATRIX_RCB3 (1 << 3) | ||
97 | #define AT91_MATRIX_RCB4 (1 << 4) | ||
98 | #define AT91_MATRIX_RCB5 (1 << 5) | ||
99 | #define AT91_MATRIX_RCB6 (1 << 6) | ||
100 | #define AT91_MATRIX_RCB7 (1 << 7) | ||
101 | #define AT91_MATRIX_RCB8 (1 << 8) | ||
102 | #define AT91_MATRIX_RCB9 (1 << 9) | ||
103 | #define AT91_MATRIX_RCB10 (1 << 10) | ||
104 | #define AT91_MATRIX_RCB11 (1 << 11) | ||
105 | |||
106 | #define AT91_MPBS0_SFR (AT91_MATRIX + 0x114) /* MPBlock Slave 0 Special Function Register */ | ||
107 | #define AT91_MPBS1_SFR (AT91_MATRIX + 0x11C) /* MPBlock Slave 1 Special Function Register */ | ||
108 | |||
109 | #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x120) /* EBI Chip Select Assignment Register */ | ||
110 | #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ | ||
111 | #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) | ||
112 | #define AT91_MATRIX_EBI_CS1A_BCRAMC (1 << 1) | ||
113 | #define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */ | ||
114 | #define AT91_MATRIX_EBI_CS3A_SMC (0 << 3) | ||
115 | #define AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA (1 << 3) | ||
116 | #define AT91_MATRIX_EBI_CS4A (1 << 4) /* Chip Select 4 Assignment */ | ||
117 | #define AT91_MATRIX_EBI_CS4A_SMC (0 << 4) | ||
118 | #define AT91_MATRIX_EBI_CS4A_SMC_CF1 (1 << 4) | ||
119 | #define AT91_MATRIX_EBI_CS5A (1 << 5) /* Chip Select 5 Assignment */ | ||
120 | #define AT91_MATRIX_EBI_CS5A_SMC (0 << 5) | ||
121 | #define AT91_MATRIX_EBI_CS5A_SMC_CF2 (1 << 5) | ||
122 | #define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ | ||
123 | #define AT91_MATRIX_EBI_DQSPDC (1 << 9) /* Data Qualifier Strobe Pull-Down Configuration */ | ||
124 | #define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */ | ||
125 | #define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16) | ||
126 | #define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16) | ||
127 | |||
128 | #define AT91_MPBS2_SFR (AT91_MATRIX + 0x12C) /* MPBlock Slave 2 Special Function Register */ | ||
129 | #define AT91_MPBS3_SFR (AT91_MATRIX + 0x130) /* MPBlock Slave 3 Special Function Register */ | ||
130 | #define AT91_APB_SFR (AT91_MATRIX + 0x134) /* APB Bridge Special Function Register */ | ||
131 | |||
132 | #endif | ||
diff --git a/include/asm-arm/arch-at91/at91sam9260_matrix.h b/include/asm-arm/arch-at91/at91sam9260_matrix.h index aacb1e976422..a8e9fec6c735 100644 --- a/include/asm-arm/arch-at91/at91sam9260_matrix.h +++ b/include/asm-arm/arch-at91/at91sam9260_matrix.h | |||
@@ -67,7 +67,7 @@ | |||
67 | #define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */ | 67 | #define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */ |
68 | #define AT91_MATRIX_CS4A_SMC (0 << 4) | 68 | #define AT91_MATRIX_CS4A_SMC (0 << 4) |
69 | #define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4) | 69 | #define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4) |
70 | #define AT91_MATRIX_CS5A (1 << 5 ) /* Chip Select 5 Assignment */ | 70 | #define AT91_MATRIX_CS5A (1 << 5) /* Chip Select 5 Assignment */ |
71 | #define AT91_MATRIX_CS5A_SMC (0 << 5) | 71 | #define AT91_MATRIX_CS5A_SMC (0 << 5) |
72 | #define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5) | 72 | #define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5) |
73 | #define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ | 73 | #define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ |
diff --git a/include/asm-arm/arch-at91/at91sam9263_matrix.h b/include/asm-arm/arch-at91/at91sam9263_matrix.h index 6fc6e4be624e..72f6e668e414 100644 --- a/include/asm-arm/arch-at91/at91sam9263_matrix.h +++ b/include/asm-arm/arch-at91/at91sam9263_matrix.h | |||
@@ -44,7 +44,7 @@ | |||
44 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) | 44 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) |
45 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) | 45 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) |
46 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) | 46 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) |
47 | #define AT91_MATRIX_FIXED_DEFMSTR (7 << 18) /* Fixed Index of Default Master */ | 47 | #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ |
48 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ | 48 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ |
49 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) | 49 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) |
50 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) | 50 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) |
diff --git a/include/asm-arm/arch-at91/at91sam9rl_matrix.h b/include/asm-arm/arch-at91/at91sam9rl_matrix.h index b15f11b7c08d..84224174e6a1 100644 --- a/include/asm-arm/arch-at91/at91sam9rl_matrix.h +++ b/include/asm-arm/arch-at91/at91sam9rl_matrix.h | |||
@@ -38,7 +38,7 @@ | |||
38 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) | 38 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) |
39 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) | 39 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) |
40 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) | 40 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) |
41 | #define AT91_MATRIX_FIXED_DEFMSTR (7 << 18) /* Fixed Index of Default Master */ | 41 | #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ |
42 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ | 42 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ |
43 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) | 43 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) |
44 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) | 44 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) |
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h index 79054965baa6..55b07bd5316c 100644 --- a/include/asm-arm/arch-at91/board.h +++ b/include/asm-arm/arch-at91/board.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/leds.h> | ||
37 | #include <linux/spi/spi.h> | 38 | #include <linux/spi/spi.h> |
38 | 39 | ||
39 | /* USB Device */ | 40 | /* USB Device */ |
@@ -71,7 +72,7 @@ struct at91_eth_data { | |||
71 | }; | 72 | }; |
72 | extern void __init at91_add_device_eth(struct at91_eth_data *data); | 73 | extern void __init at91_add_device_eth(struct at91_eth_data *data); |
73 | 74 | ||
74 | #if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) | 75 | #if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91CAP9) |
75 | #define eth_platform_data at91_eth_data | 76 | #define eth_platform_data at91_eth_data |
76 | #endif | 77 | #endif |
77 | 78 | ||
@@ -101,13 +102,23 @@ extern void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_de | |||
101 | extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices); | 102 | extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices); |
102 | 103 | ||
103 | /* Serial */ | 104 | /* Serial */ |
105 | #define ATMEL_UART_CTS 0x01 | ||
106 | #define ATMEL_UART_RTS 0x02 | ||
107 | #define ATMEL_UART_DSR 0x04 | ||
108 | #define ATMEL_UART_DTR 0x08 | ||
109 | #define ATMEL_UART_DCD 0x10 | ||
110 | #define ATMEL_UART_RI 0x20 | ||
111 | |||
112 | extern void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins); | ||
113 | extern void __init at91_set_serial_console(unsigned portnr); | ||
114 | |||
104 | struct at91_uart_config { | 115 | struct at91_uart_config { |
105 | unsigned short console_tty; /* tty number of serial console */ | 116 | unsigned short console_tty; /* tty number of serial console */ |
106 | unsigned short nr_tty; /* number of serial tty's */ | 117 | unsigned short nr_tty; /* number of serial tty's */ |
107 | short tty_map[]; /* map UART to tty number */ | 118 | short tty_map[]; /* map UART to tty number */ |
108 | }; | 119 | }; |
109 | extern struct platform_device *atmel_default_console_device; | 120 | extern struct platform_device *atmel_default_console_device; |
110 | extern void __init at91_init_serial(struct at91_uart_config *config); | 121 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); |
111 | 122 | ||
112 | struct atmel_uart_data { | 123 | struct atmel_uart_data { |
113 | short use_dma_tx; /* use transmit DMA? */ | 124 | short use_dma_tx; /* use transmit DMA? */ |
@@ -116,6 +127,23 @@ struct atmel_uart_data { | |||
116 | }; | 127 | }; |
117 | extern void __init at91_add_device_serial(void); | 128 | extern void __init at91_add_device_serial(void); |
118 | 129 | ||
130 | /* | ||
131 | * SSC -- accessed through ssc_request(id). Drivers don't bind to SSC | ||
132 | * platform devices. Their SSC ID is part of their configuration data, | ||
133 | * along with information about which SSC signals they should use. | ||
134 | */ | ||
135 | #define ATMEL_SSC_TK 0x01 | ||
136 | #define ATMEL_SSC_TF 0x02 | ||
137 | #define ATMEL_SSC_TD 0x04 | ||
138 | #define ATMEL_SSC_TX (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD) | ||
139 | |||
140 | #define ATMEL_SSC_RK 0x10 | ||
141 | #define ATMEL_SSC_RF 0x20 | ||
142 | #define ATMEL_SSC_RD 0x40 | ||
143 | #define ATMEL_SSC_RX (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD) | ||
144 | |||
145 | extern void __init at91_add_device_ssc(unsigned id, unsigned pins); | ||
146 | |||
119 | /* LCD Controller */ | 147 | /* LCD Controller */ |
120 | struct atmel_lcdfb_info; | 148 | struct atmel_lcdfb_info; |
121 | extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data); | 149 | extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data); |
@@ -126,10 +154,12 @@ struct atmel_ac97_data { | |||
126 | }; | 154 | }; |
127 | extern void __init at91_add_device_ac97(struct atmel_ac97_data *data); | 155 | extern void __init at91_add_device_ac97(struct atmel_ac97_data *data); |
128 | 156 | ||
157 | /* ISI */ | ||
158 | extern void __init at91_add_device_isi(void); | ||
159 | |||
129 | /* LEDs */ | 160 | /* LEDs */ |
130 | extern u8 at91_leds_cpu; | ||
131 | extern u8 at91_leds_timer; | ||
132 | extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); | 161 | extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); |
162 | extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); | ||
133 | 163 | ||
134 | /* FIXME: this needs a better location, but gets stuff building again */ | 164 | /* FIXME: this needs a better location, but gets stuff building again */ |
135 | extern int at91_suspend_entering_slow_clock(void); | 165 | extern int at91_suspend_entering_slow_clock(void); |
diff --git a/include/asm-arm/arch-at91/cpu.h b/include/asm-arm/arch-at91/cpu.h index 080cbb401a87..7145166826a2 100644 --- a/include/asm-arm/arch-at91/cpu.h +++ b/include/asm-arm/arch-at91/cpu.h | |||
@@ -21,13 +21,13 @@ | |||
21 | #define ARCH_ID_AT91SAM9260 0x019803a0 | 21 | #define ARCH_ID_AT91SAM9260 0x019803a0 |
22 | #define ARCH_ID_AT91SAM9261 0x019703a0 | 22 | #define ARCH_ID_AT91SAM9261 0x019703a0 |
23 | #define ARCH_ID_AT91SAM9263 0x019607a0 | 23 | #define ARCH_ID_AT91SAM9263 0x019607a0 |
24 | #define ARCH_ID_AT91SAM9RL64 0x019b03a0 | ||
25 | #define ARCH_ID_AT91CAP9 0x039A03A0 | ||
24 | 26 | ||
25 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 | 27 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 |
26 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 | 28 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 |
27 | #define ARCH_ID_AT91SAM9XE512 0x329aa3a0 | 29 | #define ARCH_ID_AT91SAM9XE512 0x329aa3a0 |
28 | 30 | ||
29 | #define ARCH_ID_AT91SAM9RL64 0x019b03a0 | ||
30 | |||
31 | #define ARCH_ID_AT91M40800 0x14080044 | 31 | #define ARCH_ID_AT91M40800 0x14080044 |
32 | #define ARCH_ID_AT91R40807 0x44080746 | 32 | #define ARCH_ID_AT91R40807 0x44080746 |
33 | #define ARCH_ID_AT91M40807 0x14080745 | 33 | #define ARCH_ID_AT91M40807 0x14080745 |
@@ -81,6 +81,11 @@ static inline unsigned long at91_arch_identify(void) | |||
81 | #define cpu_is_at91sam9rl() (0) | 81 | #define cpu_is_at91sam9rl() (0) |
82 | #endif | 82 | #endif |
83 | 83 | ||
84 | #ifdef CONFIG_ARCH_AT91CAP9 | ||
85 | #define cpu_is_at91cap9() (at91_cpu_identify() == ARCH_ID_AT91CAP9) | ||
86 | #else | ||
87 | #define cpu_is_at91cap9() (0) | ||
88 | #endif | ||
84 | 89 | ||
85 | /* | 90 | /* |
86 | * Since this is ARM, we will never run on any AVR32 CPU. But these | 91 | * Since this is ARM, we will never run on any AVR32 CPU. But these |
diff --git a/include/asm-arm/arch-at91/entry-macro.S b/include/asm-arm/arch-at91/entry-macro.S index cc1d850a0788..1005eee6219b 100644 --- a/include/asm-arm/arch-at91/entry-macro.S +++ b/include/asm-arm/arch-at91/entry-macro.S | |||
@@ -17,13 +17,13 @@ | |||
17 | .endm | 17 | .endm |
18 | 18 | ||
19 | .macro get_irqnr_preamble, base, tmp | 19 | .macro get_irqnr_preamble, base, tmp |
20 | ldr \base, =(AT91_VA_BASE_SYS + AT91_AIC) @ base virtual address of AIC peripheral | ||
20 | .endm | 21 | .endm |
21 | 22 | ||
22 | .macro arch_ret_to_user, tmp1, tmp2 | 23 | .macro arch_ret_to_user, tmp1, tmp2 |
23 | .endm | 24 | .endm |
24 | 25 | ||
25 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 26 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
26 | ldr \base, =(AT91_VA_BASE_SYS + AT91_AIC) @ base virtual address of AIC peripheral | ||
27 | ldr \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) | 27 | ldr \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) |
28 | ldr \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)] @ read interrupt source number | 28 | ldr \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)] @ read interrupt source number |
29 | teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt | 29 | teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt |
diff --git a/include/asm-arm/arch-at91/hardware.h b/include/asm-arm/arch-at91/hardware.h index 8f1cdd38a969..2c826d8247a3 100644 --- a/include/asm-arm/arch-at91/hardware.h +++ b/include/asm-arm/arch-at91/hardware.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <asm/arch/at91sam9263.h> | 26 | #include <asm/arch/at91sam9263.h> |
27 | #elif defined(CONFIG_ARCH_AT91SAM9RL) | 27 | #elif defined(CONFIG_ARCH_AT91SAM9RL) |
28 | #include <asm/arch/at91sam9rl.h> | 28 | #include <asm/arch/at91sam9rl.h> |
29 | #elif defined(CONFIG_ARCH_AT91CAP9) | ||
30 | #include <asm/arch/at91cap9.h> | ||
29 | #elif defined(CONFIG_ARCH_AT91X40) | 31 | #elif defined(CONFIG_ARCH_AT91X40) |
30 | #include <asm/arch/at91x40.h> | 32 | #include <asm/arch/at91x40.h> |
31 | #else | 33 | #else |
diff --git a/include/asm-arm/arch-at91/timex.h b/include/asm-arm/arch-at91/timex.h index a310698fb4da..f1933b0fa43f 100644 --- a/include/asm-arm/arch-at91/timex.h +++ b/include/asm-arm/arch-at91/timex.h | |||
@@ -42,6 +42,11 @@ | |||
42 | #define AT91SAM9_MASTER_CLOCK 100000000 | 42 | #define AT91SAM9_MASTER_CLOCK 100000000 |
43 | #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) | 43 | #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) |
44 | 44 | ||
45 | #elif defined(CONFIG_ARCH_AT91CAP9) | ||
46 | |||
47 | #define AT91CAP9_MASTER_CLOCK 100000000 | ||
48 | #define CLOCK_TICK_RATE (AT91CAP9_MASTER_CLOCK/16) | ||
49 | |||
45 | #elif defined(CONFIG_ARCH_AT91X40) | 50 | #elif defined(CONFIG_ARCH_AT91X40) |
46 | 51 | ||
47 | #define AT91X40_MASTER_CLOCK 40000000 | 52 | #define AT91X40_MASTER_CLOCK 40000000 |
diff --git a/include/asm-arm/arch-ep93xx/gpio.h b/include/asm-arm/arch-ep93xx/gpio.h index 1ee14a14cba0..9b1864bbd9a8 100644 --- a/include/asm-arm/arch-ep93xx/gpio.h +++ b/include/asm-arm/arch-ep93xx/gpio.h | |||
@@ -5,16 +5,6 @@ | |||
5 | #ifndef __ASM_ARCH_GPIO_H | 5 | #ifndef __ASM_ARCH_GPIO_H |
6 | #define __ASM_ARCH_GPIO_H | 6 | #define __ASM_ARCH_GPIO_H |
7 | 7 | ||
8 | #define GPIO_IN 0 | ||
9 | #define GPIO_OUT 1 | ||
10 | |||
11 | #define EP93XX_GPIO_LOW 0 | ||
12 | #define EP93XX_GPIO_HIGH 1 | ||
13 | |||
14 | extern void gpio_line_config(int line, int direction); | ||
15 | extern int gpio_line_get(int line); | ||
16 | extern void gpio_line_set(int line, int value); | ||
17 | |||
18 | /* GPIO port A. */ | 8 | /* GPIO port A. */ |
19 | #define EP93XX_GPIO_LINE_A(x) ((x) + 0) | 9 | #define EP93XX_GPIO_LINE_A(x) ((x) + 0) |
20 | #define EP93XX_GPIO_LINE_EGPIO0 EP93XX_GPIO_LINE_A(0) | 10 | #define EP93XX_GPIO_LINE_EGPIO0 EP93XX_GPIO_LINE_A(0) |
@@ -38,7 +28,7 @@ extern void gpio_line_set(int line, int value); | |||
38 | #define EP93XX_GPIO_LINE_EGPIO15 EP93XX_GPIO_LINE_B(7) | 28 | #define EP93XX_GPIO_LINE_EGPIO15 EP93XX_GPIO_LINE_B(7) |
39 | 29 | ||
40 | /* GPIO port C. */ | 30 | /* GPIO port C. */ |
41 | #define EP93XX_GPIO_LINE_C(x) ((x) + 16) | 31 | #define EP93XX_GPIO_LINE_C(x) ((x) + 40) |
42 | #define EP93XX_GPIO_LINE_ROW0 EP93XX_GPIO_LINE_C(0) | 32 | #define EP93XX_GPIO_LINE_ROW0 EP93XX_GPIO_LINE_C(0) |
43 | #define EP93XX_GPIO_LINE_ROW1 EP93XX_GPIO_LINE_C(1) | 33 | #define EP93XX_GPIO_LINE_ROW1 EP93XX_GPIO_LINE_C(1) |
44 | #define EP93XX_GPIO_LINE_ROW2 EP93XX_GPIO_LINE_C(2) | 34 | #define EP93XX_GPIO_LINE_ROW2 EP93XX_GPIO_LINE_C(2) |
@@ -71,7 +61,7 @@ extern void gpio_line_set(int line, int value); | |||
71 | #define EP93XX_GPIO_LINE_IDEDA2 EP93XX_GPIO_LINE_E(7) | 61 | #define EP93XX_GPIO_LINE_IDEDA2 EP93XX_GPIO_LINE_E(7) |
72 | 62 | ||
73 | /* GPIO port F. */ | 63 | /* GPIO port F. */ |
74 | #define EP93XX_GPIO_LINE_F(x) ((x) + 40) | 64 | #define EP93XX_GPIO_LINE_F(x) ((x) + 16) |
75 | #define EP93XX_GPIO_LINE_WP EP93XX_GPIO_LINE_F(0) | 65 | #define EP93XX_GPIO_LINE_WP EP93XX_GPIO_LINE_F(0) |
76 | #define EP93XX_GPIO_LINE_MCCD1 EP93XX_GPIO_LINE_F(1) | 66 | #define EP93XX_GPIO_LINE_MCCD1 EP93XX_GPIO_LINE_F(1) |
77 | #define EP93XX_GPIO_LINE_MCCD2 EP93XX_GPIO_LINE_F(2) | 67 | #define EP93XX_GPIO_LINE_MCCD2 EP93XX_GPIO_LINE_F(2) |
@@ -103,5 +93,49 @@ extern void gpio_line_set(int line, int value); | |||
103 | #define EP93XX_GPIO_LINE_DD6 EP93XX_GPIO_LINE_H(6) | 93 | #define EP93XX_GPIO_LINE_DD6 EP93XX_GPIO_LINE_H(6) |
104 | #define EP93XX_GPIO_LINE_DD7 EP93XX_GPIO_LINE_H(7) | 94 | #define EP93XX_GPIO_LINE_DD7 EP93XX_GPIO_LINE_H(7) |
105 | 95 | ||
96 | /* maximum value for gpio line identifiers */ | ||
97 | #define EP93XX_GPIO_LINE_MAX EP93XX_GPIO_LINE_H(7) | ||
98 | |||
99 | /* maximum value for irq capable line identifiers */ | ||
100 | #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) | ||
101 | |||
102 | /* new generic GPIO API - see Documentation/gpio.txt */ | ||
103 | |||
104 | static inline int gpio_request(unsigned gpio, const char *label) | ||
105 | { | ||
106 | if (gpio > EP93XX_GPIO_LINE_MAX) | ||
107 | return -EINVAL; | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | static inline void gpio_free(unsigned gpio) | ||
112 | { | ||
113 | } | ||
114 | |||
115 | int gpio_direction_input(unsigned gpio); | ||
116 | int gpio_direction_output(unsigned gpio, int value); | ||
117 | int gpio_get_value(unsigned gpio); | ||
118 | void gpio_set_value(unsigned gpio, int value); | ||
119 | |||
120 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
121 | |||
122 | /* | ||
123 | * Map GPIO A0..A7 (0..7) to irq 64..71, | ||
124 | * B0..B7 (7..15) to irq 72..79, and | ||
125 | * F0..F7 (16..24) to irq 80..87. | ||
126 | */ | ||
127 | |||
128 | static inline int gpio_to_irq(unsigned gpio) | ||
129 | { | ||
130 | if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ) | ||
131 | return 64 + gpio; | ||
132 | |||
133 | return -EINVAL; | ||
134 | } | ||
135 | |||
136 | static inline int irq_to_gpio(unsigned irq) | ||
137 | { | ||
138 | return irq - gpio_to_irq(0); | ||
139 | } | ||
106 | 140 | ||
107 | #endif | 141 | #endif |
diff --git a/include/asm-arm/arch-ep93xx/irqs.h b/include/asm-arm/arch-ep93xx/irqs.h index 2a8c63638c5e..53d4a68bfc88 100644 --- a/include/asm-arm/arch-ep93xx/irqs.h +++ b/include/asm-arm/arch-ep93xx/irqs.h | |||
@@ -67,12 +67,6 @@ | |||
67 | #define IRQ_EP93XX_SAI 60 | 67 | #define IRQ_EP93XX_SAI 60 |
68 | #define EP93XX_VIC2_VALID_IRQ_MASK 0x1fffffff | 68 | #define EP93XX_VIC2_VALID_IRQ_MASK 0x1fffffff |
69 | 69 | ||
70 | /* | ||
71 | * Map GPIO A0..A7 to irq 64..71, B0..B7 to 72..79, and | ||
72 | * F0..F7 to 80..87. | ||
73 | */ | ||
74 | #define IRQ_EP93XX_GPIO(x) (64 + (((x) + (((x) >> 2) & 8)) & 0x1f)) | ||
75 | |||
76 | #define NR_EP93XX_IRQS (64 + 24) | 70 | #define NR_EP93XX_IRQS (64 + 24) |
77 | 71 | ||
78 | #define EP93XX_BOARD_IRQ(x) (NR_EP93XX_IRQS + (x)) | 72 | #define EP93XX_BOARD_IRQ(x) (NR_EP93XX_IRQS + (x)) |
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index eeeea90cd5a9..9c5d2357aff3 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h | |||
@@ -61,13 +61,13 @@ __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype) | |||
61 | if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff)) | 61 | if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff)) |
62 | return __arm_ioremap(addr, size, mtype); | 62 | return __arm_ioremap(addr, size, mtype); |
63 | 63 | ||
64 | return (void *)addr; | 64 | return (void __iomem *)addr; |
65 | } | 65 | } |
66 | 66 | ||
67 | static inline void | 67 | static inline void |
68 | __ixp4xx_iounmap(void __iomem *addr) | 68 | __ixp4xx_iounmap(void __iomem *addr) |
69 | { | 69 | { |
70 | if ((u32)addr >= VMALLOC_START) | 70 | if ((__force u32)addr >= VMALLOC_START) |
71 | __iounmap(addr); | 71 | __iounmap(addr); |
72 | } | 72 | } |
73 | 73 | ||
@@ -141,9 +141,9 @@ __ixp4xx_writesw(volatile void __iomem *bus_addr, const u16 *vaddr, int count) | |||
141 | static inline void | 141 | static inline void |
142 | __ixp4xx_writel(u32 value, volatile void __iomem *p) | 142 | __ixp4xx_writel(u32 value, volatile void __iomem *p) |
143 | { | 143 | { |
144 | u32 addr = (u32)p; | 144 | u32 addr = (__force u32)p; |
145 | if (addr >= VMALLOC_START) { | 145 | if (addr >= VMALLOC_START) { |
146 | __raw_writel(value, addr); | 146 | __raw_writel(value, p); |
147 | return; | 147 | return; |
148 | } | 148 | } |
149 | 149 | ||
@@ -208,11 +208,11 @@ __ixp4xx_readsw(const volatile void __iomem *bus_addr, u16 *vaddr, u32 count) | |||
208 | static inline unsigned long | 208 | static inline unsigned long |
209 | __ixp4xx_readl(const volatile void __iomem *p) | 209 | __ixp4xx_readl(const volatile void __iomem *p) |
210 | { | 210 | { |
211 | u32 addr = (u32)p; | 211 | u32 addr = (__force u32)p; |
212 | u32 data; | 212 | u32 data; |
213 | 213 | ||
214 | if (addr >= VMALLOC_START) | 214 | if (addr >= VMALLOC_START) |
215 | return __raw_readl(addr); | 215 | return __raw_readl(p); |
216 | 216 | ||
217 | if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data)) | 217 | if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data)) |
218 | return 0xffffffff; | 218 | return 0xffffffff; |
@@ -438,7 +438,7 @@ __ixp4xx_ioread32(const void __iomem *addr) | |||
438 | return (unsigned int)__ixp4xx_inl(port & PIO_MASK); | 438 | return (unsigned int)__ixp4xx_inl(port & PIO_MASK); |
439 | else { | 439 | else { |
440 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 440 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
441 | return le32_to_cpu(__raw_readl((u32)port)); | 441 | return le32_to_cpu((__force __le32)__raw_readl(addr)); |
442 | #else | 442 | #else |
443 | return (unsigned int)__ixp4xx_readl(addr); | 443 | return (unsigned int)__ixp4xx_readl(addr); |
444 | #endif | 444 | #endif |
@@ -523,7 +523,7 @@ __ixp4xx_iowrite32(u32 value, void __iomem *addr) | |||
523 | __ixp4xx_outl(value, port & PIO_MASK); | 523 | __ixp4xx_outl(value, port & PIO_MASK); |
524 | else | 524 | else |
525 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 525 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
526 | __raw_writel(cpu_to_le32(value), port); | 526 | __raw_writel((u32 __force)cpu_to_le32(value), addr); |
527 | #else | 527 | #else |
528 | __ixp4xx_writel(value, addr); | 528 | __ixp4xx_writel(value, addr); |
529 | #endif | 529 | #endif |
diff --git a/include/asm-arm/arch-ks8695/regs-gpio.h b/include/asm-arm/arch-ks8695/regs-gpio.h index 57fcf9fc82e4..6b95d77aea19 100644 --- a/include/asm-arm/arch-ks8695/regs-gpio.h +++ b/include/asm-arm/arch-ks8695/regs-gpio.h | |||
@@ -49,5 +49,7 @@ | |||
49 | #define IOPC_TM_FALLING (4) /* Falling Edge Detection */ | 49 | #define IOPC_TM_FALLING (4) /* Falling Edge Detection */ |
50 | #define IOPC_TM_EDGE (6) /* Both Edge Detection */ | 50 | #define IOPC_TM_EDGE (6) /* Both Edge Detection */ |
51 | 51 | ||
52 | /* Port Data Register */ | ||
53 | #define IOPD_(x) (1 << (x)) /* Signal Level of GPIO Pin x */ | ||
52 | 54 | ||
53 | #endif | 55 | #endif |
diff --git a/include/asm-arm/arch-msm/board.h b/include/asm-arm/arch-msm/board.h new file mode 100644 index 000000000000..763051f8ba14 --- /dev/null +++ b/include/asm-arm/arch-msm/board.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/board.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef __ASM_ARCH_MSM_BOARD_H | ||
18 | #define __ASM_ARCH_MSM_BOARD_H | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | |||
22 | /* platform device data structures */ | ||
23 | |||
24 | struct msm_mddi_platform_data | ||
25 | { | ||
26 | void (*panel_power)(int on); | ||
27 | unsigned has_vsync_irq:1; | ||
28 | }; | ||
29 | |||
30 | /* common init routines for use by arch/arm/mach-msm/board-*.c */ | ||
31 | |||
32 | void __init msm_add_devices(void); | ||
33 | void __init msm_map_common_io(void); | ||
34 | void __init msm_init_irq(void); | ||
35 | void __init msm_init_gpio(void); | ||
36 | |||
37 | #endif | ||
diff --git a/include/asm-arm/arch-msm/debug-macro.S b/include/asm-arm/arch-msm/debug-macro.S new file mode 100644 index 000000000000..393d5272e506 --- /dev/null +++ b/include/asm-arm/arch-msm/debug-macro.S | |||
@@ -0,0 +1,40 @@ | |||
1 | /* include/asm-arm/arch-msm7200/debug-macro.S | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <asm/hardware.h> | ||
18 | #include <asm/arch/msm_iomap.h> | ||
19 | |||
20 | .macro addruart,rx | ||
21 | @ see if the MMU is enabled and select appropriate base address | ||
22 | mrc p15, 0, \rx, c1, c0 | ||
23 | tst \rx, #1 | ||
24 | ldreq \rx, =MSM_UART1_PHYS | ||
25 | ldrne \rx, =MSM_UART1_BASE | ||
26 | .endm | ||
27 | |||
28 | .macro senduart,rd,rx | ||
29 | str \rd, [\rx, #0x0C] | ||
30 | .endm | ||
31 | |||
32 | .macro waituart,rd,rx | ||
33 | @ wait for TX_READY | ||
34 | 1: ldr \rd, [\rx, #0x08] | ||
35 | tst \rd, #0x04 | ||
36 | beq 1b | ||
37 | .endm | ||
38 | |||
39 | .macro busyuart,rd,rx | ||
40 | .endm | ||
diff --git a/include/asm-arm/arch-msm/dma.h b/include/asm-arm/arch-msm/dma.h new file mode 100644 index 000000000000..e4b565b27b35 --- /dev/null +++ b/include/asm-arm/arch-msm/dma.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/dma.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MSM_DMA_H | ||
17 | |||
18 | #include <linux/list.h> | ||
19 | #include <asm/arch/msm_iomap.h> | ||
20 | |||
21 | struct msm_dmov_cmd { | ||
22 | struct list_head list; | ||
23 | unsigned int cmdptr; | ||
24 | void (*complete_func)(struct msm_dmov_cmd *cmd, unsigned int result); | ||
25 | /* void (*user_result_func)(struct msm_dmov_cmd *cmd); */ | ||
26 | }; | ||
27 | |||
28 | void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd); | ||
29 | void msm_dmov_stop_cmd(unsigned id, struct msm_dmov_cmd *cmd); | ||
30 | int msm_dmov_exec_cmd(unsigned id, unsigned int cmdptr); | ||
31 | /* int msm_dmov_exec_cmd_etc(unsigned id, unsigned int cmdptr, int timeout, int interruptible); */ | ||
32 | |||
33 | |||
34 | |||
35 | #define DMOV_SD0(off, ch) (MSM_DMOV_BASE + 0x0000 + (off) + ((ch) << 2)) | ||
36 | #define DMOV_SD1(off, ch) (MSM_DMOV_BASE + 0x0400 + (off) + ((ch) << 2)) | ||
37 | #define DMOV_SD2(off, ch) (MSM_DMOV_BASE + 0x0800 + (off) + ((ch) << 2)) | ||
38 | #define DMOV_SD3(off, ch) (MSM_DMOV_BASE + 0x0C00 + (off) + ((ch) << 2)) | ||
39 | |||
40 | /* only security domain 3 is available to the ARM11 | ||
41 | * SD0 -> mARM trusted, SD1 -> mARM nontrusted, SD2 -> aDSP, SD3 -> aARM | ||
42 | */ | ||
43 | |||
44 | #define DMOV_CMD_PTR(ch) DMOV_SD3(0x000, ch) | ||
45 | #define DMOV_CMD_LIST (0 << 29) /* does not work */ | ||
46 | #define DMOV_CMD_PTR_LIST (1 << 29) /* works */ | ||
47 | #define DMOV_CMD_INPUT_CFG (2 << 29) /* untested */ | ||
48 | #define DMOV_CMD_OUTPUT_CFG (3 << 29) /* untested */ | ||
49 | #define DMOV_CMD_ADDR(addr) ((addr) >> 3) | ||
50 | |||
51 | #define DMOV_RSLT(ch) DMOV_SD3(0x040, ch) | ||
52 | #define DMOV_RSLT_VALID (1 << 31) /* 0 == host has empties result fifo */ | ||
53 | #define DMOV_RSLT_ERROR (1 << 3) | ||
54 | #define DMOV_RSLT_FLUSH (1 << 2) | ||
55 | #define DMOV_RSLT_DONE (1 << 1) /* top pointer done */ | ||
56 | #define DMOV_RSLT_USER (1 << 0) /* command with FR force result */ | ||
57 | |||
58 | #define DMOV_FLUSH0(ch) DMOV_SD3(0x080, ch) | ||
59 | #define DMOV_FLUSH1(ch) DMOV_SD3(0x0C0, ch) | ||
60 | #define DMOV_FLUSH2(ch) DMOV_SD3(0x100, ch) | ||
61 | #define DMOV_FLUSH3(ch) DMOV_SD3(0x140, ch) | ||
62 | #define DMOV_FLUSH4(ch) DMOV_SD3(0x180, ch) | ||
63 | #define DMOV_FLUSH5(ch) DMOV_SD3(0x1C0, ch) | ||
64 | |||
65 | #define DMOV_STATUS(ch) DMOV_SD3(0x200, ch) | ||
66 | #define DMOV_STATUS_RSLT_COUNT(n) (((n) >> 29)) | ||
67 | #define DMOV_STATUS_CMD_COUNT(n) (((n) >> 27) & 3) | ||
68 | #define DMOV_STATUS_RSLT_VALID (1 << 1) | ||
69 | #define DMOV_STATUS_CMD_PTR_RDY (1 << 0) | ||
70 | |||
71 | #define DMOV_ISR DMOV_SD3(0x380, 0) | ||
72 | |||
73 | #define DMOV_CONFIG(ch) DMOV_SD3(0x300, ch) | ||
74 | #define DMOV_CONFIG_FORCE_TOP_PTR_RSLT (1 << 2) | ||
75 | #define DMOV_CONFIG_FORCE_FLUSH_RSLT (1 << 1) | ||
76 | #define DMOV_CONFIG_IRQ_EN (1 << 0) | ||
77 | |||
78 | /* channel assignments */ | ||
79 | |||
80 | #define DMOV_NAND_CHAN 7 | ||
81 | #define DMOV_NAND_CRCI_CMD 5 | ||
82 | #define DMOV_NAND_CRCI_DATA 4 | ||
83 | |||
84 | #define DMOV_SDC1_CHAN 8 | ||
85 | #define DMOV_SDC1_CRCI 6 | ||
86 | |||
87 | #define DMOV_SDC2_CHAN 8 | ||
88 | #define DMOV_SDC2_CRCI 7 | ||
89 | |||
90 | #define DMOV_TSIF_CHAN 10 | ||
91 | #define DMOV_TSIF_CRCI 10 | ||
92 | |||
93 | #define DMOV_USB_CHAN 11 | ||
94 | |||
95 | /* no client rate control ifc (eg, ram) */ | ||
96 | #define DMOV_NONE_CRCI 0 | ||
97 | |||
98 | |||
99 | /* If the CMD_PTR register has CMD_PTR_LIST selected, the data mover | ||
100 | * is going to walk a list of 32bit pointers as described below. Each | ||
101 | * pointer points to a *array* of dmov_s, etc structs. The last pointer | ||
102 | * in the list is marked with CMD_PTR_LP. The last struct in each array | ||
103 | * is marked with CMD_LC (see below). | ||
104 | */ | ||
105 | #define CMD_PTR_ADDR(addr) ((addr) >> 3) | ||
106 | #define CMD_PTR_LP (1 << 31) /* last pointer */ | ||
107 | #define CMD_PTR_PT (3 << 29) /* ? */ | ||
108 | |||
109 | /* Single Item Mode */ | ||
110 | typedef struct { | ||
111 | unsigned cmd; | ||
112 | unsigned src; | ||
113 | unsigned dst; | ||
114 | unsigned len; | ||
115 | } dmov_s; | ||
116 | |||
117 | /* Scatter/Gather Mode */ | ||
118 | typedef struct { | ||
119 | unsigned cmd; | ||
120 | unsigned src_dscr; | ||
121 | unsigned dst_dscr; | ||
122 | unsigned _reserved; | ||
123 | } dmov_sg; | ||
124 | |||
125 | /* bits for the cmd field of the above structures */ | ||
126 | |||
127 | #define CMD_LC (1 << 31) /* last command */ | ||
128 | #define CMD_FR (1 << 22) /* force result -- does not work? */ | ||
129 | #define CMD_OCU (1 << 21) /* other channel unblock */ | ||
130 | #define CMD_OCB (1 << 20) /* other channel block */ | ||
131 | #define CMD_TCB (1 << 19) /* ? */ | ||
132 | #define CMD_DAH (1 << 18) /* destination address hold -- does not work?*/ | ||
133 | #define CMD_SAH (1 << 17) /* source address hold -- does not work? */ | ||
134 | |||
135 | #define CMD_MODE_SINGLE (0 << 0) /* dmov_s structure used */ | ||
136 | #define CMD_MODE_SG (1 << 0) /* untested */ | ||
137 | #define CMD_MODE_IND_SG (2 << 0) /* untested */ | ||
138 | #define CMD_MODE_BOX (3 << 0) /* untested */ | ||
139 | |||
140 | #define CMD_DST_SWAP_BYTES (1 << 14) /* exchange each byte n with byte n+1 */ | ||
141 | #define CMD_DST_SWAP_SHORTS (1 << 15) /* exchange each short n with short n+1 */ | ||
142 | #define CMD_DST_SWAP_WORDS (1 << 16) /* exchange each word n with word n+1 */ | ||
143 | |||
144 | #define CMD_SRC_SWAP_BYTES (1 << 11) /* exchange each byte n with byte n+1 */ | ||
145 | #define CMD_SRC_SWAP_SHORTS (1 << 12) /* exchange each short n with short n+1 */ | ||
146 | #define CMD_SRC_SWAP_WORDS (1 << 13) /* exchange each word n with word n+1 */ | ||
147 | |||
148 | #define CMD_DST_CRCI(n) (((n) & 15) << 7) | ||
149 | #define CMD_SRC_CRCI(n) (((n) & 15) << 3) | ||
150 | |||
151 | #endif | ||
diff --git a/include/asm-arm/arch-msm/entry-macro.S b/include/asm-arm/arch-msm/entry-macro.S new file mode 100644 index 000000000000..ee24aece4cb0 --- /dev/null +++ b/include/asm-arm/arch-msm/entry-macro.S | |||
@@ -0,0 +1,38 @@ | |||
1 | /* include/asm-arm/arch-msm7200/entry-macro.S | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <asm/arch/msm_iomap.h> | ||
18 | |||
19 | .macro disable_fiq | ||
20 | .endm | ||
21 | |||
22 | .macro get_irqnr_preamble, base, tmp | ||
23 | @ enable imprecise aborts | ||
24 | cpsie a | ||
25 | mov \base, #MSM_VIC_BASE | ||
26 | .endm | ||
27 | |||
28 | .macro arch_ret_to_user, tmp1, tmp2 | ||
29 | .endm | ||
30 | |||
31 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
32 | @ 0xD0 has irq# or old irq# if the irq has been handled | ||
33 | @ 0xD4 has irq# or -1 if none pending *but* if you just | ||
34 | @ read 0xD4 you never get the first irq for some reason | ||
35 | ldr \irqnr, [\base, #0xD0] | ||
36 | ldr \irqnr, [\base, #0xD4] | ||
37 | cmp \irqnr, #0xffffffff | ||
38 | .endm | ||
diff --git a/include/asm-arm/arch-msm/hardware.h b/include/asm-arm/arch-msm/hardware.h new file mode 100644 index 000000000000..89af2b70182f --- /dev/null +++ b/include/asm-arm/arch-msm/hardware.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/hardware.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MSM_HARDWARE_H | ||
17 | |||
18 | #endif | ||
diff --git a/include/asm-arm/arch-msm/io.h b/include/asm-arm/arch-msm/io.h new file mode 100644 index 000000000000..4645ae26b62a --- /dev/null +++ b/include/asm-arm/arch-msm/io.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* include/asm-arm/arch-msm/io.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARM_ARCH_IO_H | ||
17 | #define __ASM_ARM_ARCH_IO_H | ||
18 | |||
19 | #define IO_SPACE_LIMIT 0xffffffff | ||
20 | |||
21 | #define __arch_ioremap __msm_ioremap | ||
22 | #define __arch_iounmap __iounmap | ||
23 | |||
24 | void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype); | ||
25 | |||
26 | static inline void __iomem *__io(unsigned long addr) | ||
27 | { | ||
28 | return (void __iomem *)addr; | ||
29 | } | ||
30 | #define __io(a) __io(a) | ||
31 | #define __mem_pci(a) (a) | ||
32 | |||
33 | #endif | ||
diff --git a/include/asm-arm/arch-msm/irqs.h b/include/asm-arm/arch-msm/irqs.h new file mode 100644 index 000000000000..565430cfaa7e --- /dev/null +++ b/include/asm-arm/arch-msm/irqs.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/irqs.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef __ASM_ARCH_MSM_IRQS_H | ||
18 | |||
19 | /* MSM ARM11 Interrupt Numbers */ | ||
20 | /* See 80-VE113-1 A, pp219-221 */ | ||
21 | |||
22 | #define INT_A9_M2A_0 0 | ||
23 | #define INT_A9_M2A_1 1 | ||
24 | #define INT_A9_M2A_2 2 | ||
25 | #define INT_A9_M2A_3 3 | ||
26 | #define INT_A9_M2A_4 4 | ||
27 | #define INT_A9_M2A_5 5 | ||
28 | #define INT_A9_M2A_6 6 | ||
29 | #define INT_GP_TIMER_EXP 7 | ||
30 | #define INT_DEBUG_TIMER_EXP 8 | ||
31 | #define INT_UART1 9 | ||
32 | #define INT_UART2 10 | ||
33 | #define INT_UART3 11 | ||
34 | #define INT_UART1_RX 12 | ||
35 | #define INT_UART2_RX 13 | ||
36 | #define INT_UART3_RX 14 | ||
37 | #define INT_USB_OTG 15 | ||
38 | #define INT_MDDI_PRI 16 | ||
39 | #define INT_MDDI_EXT 17 | ||
40 | #define INT_MDDI_CLIENT 18 | ||
41 | #define INT_MDP 19 | ||
42 | #define INT_GRAPHICS 20 | ||
43 | #define INT_ADM_AARM 21 | ||
44 | #define INT_ADSP_A11 22 | ||
45 | #define INT_ADSP_A9_A11 23 | ||
46 | #define INT_SDC1_0 24 | ||
47 | #define INT_SDC1_1 25 | ||
48 | #define INT_SDC2_0 26 | ||
49 | #define INT_SDC2_1 27 | ||
50 | #define INT_KEYSENSE 28 | ||
51 | #define INT_TCHSCRN_SSBI 29 | ||
52 | #define INT_TCHSCRN1 30 | ||
53 | #define INT_TCHSCRN2 31 | ||
54 | |||
55 | #define INT_GPIO_GROUP1 (32 + 0) | ||
56 | #define INT_GPIO_GROUP2 (32 + 1) | ||
57 | #define INT_PWB_I2C (32 + 2) | ||
58 | #define INT_SOFTRESET (32 + 3) | ||
59 | #define INT_NAND_WR_ER_DONE (32 + 4) | ||
60 | #define INT_NAND_OP_DONE (32 + 5) | ||
61 | #define INT_PBUS_ARM11 (32 + 6) | ||
62 | #define INT_AXI_MPU_SMI (32 + 7) | ||
63 | #define INT_AXI_MPU_EBI1 (32 + 8) | ||
64 | #define INT_AD_HSSD (32 + 9) | ||
65 | #define INT_ARM11_PMU (32 + 10) | ||
66 | #define INT_ARM11_DMA (32 + 11) | ||
67 | #define INT_TSIF_IRQ (32 + 12) | ||
68 | #define INT_UART1DM_IRQ (32 + 13) | ||
69 | #define INT_UART1DM_RX (32 + 14) | ||
70 | #define INT_USB_HS (32 + 15) | ||
71 | #define INT_SDC3_0 (32 + 16) | ||
72 | #define INT_SDC3_1 (32 + 17) | ||
73 | #define INT_SDC4_0 (32 + 18) | ||
74 | #define INT_SDC4_1 (32 + 19) | ||
75 | #define INT_UART2DM_RX (32 + 20) | ||
76 | #define INT_UART2DM_IRQ (32 + 21) | ||
77 | |||
78 | /* 22-31 are reserved */ | ||
79 | |||
80 | #define MSM_IRQ_BIT(irq) (1 << ((irq) & 31)) | ||
81 | |||
82 | #define NR_MSM_IRQS 64 | ||
83 | #define NR_GPIO_IRQS 122 | ||
84 | #define NR_BOARD_IRQS 64 | ||
85 | #define NR_IRQS (NR_MSM_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS) | ||
86 | |||
87 | #define MSM_GPIO_TO_INT(n) (NR_MSM_IRQS + (n)) | ||
88 | |||
89 | #endif | ||
diff --git a/include/asm-arm/arch-msm/memory.h b/include/asm-arm/arch-msm/memory.h new file mode 100644 index 000000000000..b5ce0e9ac86d --- /dev/null +++ b/include/asm-arm/arch-msm/memory.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/memory.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MEMORY_H | ||
17 | #define __ASM_ARCH_MEMORY_H | ||
18 | |||
19 | /* physical offset of RAM */ | ||
20 | #define PHYS_OFFSET UL(0x10000000) | ||
21 | |||
22 | /* bus address and physical addresses are identical */ | ||
23 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
24 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
25 | |||
26 | #endif | ||
27 | |||
diff --git a/include/asm-arm/arch-msm/msm_iomap.h b/include/asm-arm/arch-msm/msm_iomap.h new file mode 100644 index 000000000000..b8955cc26fec --- /dev/null +++ b/include/asm-arm/arch-msm/msm_iomap.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/msm_iomap.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * | ||
16 | * The MSM peripherals are spread all over across 768MB of physical | ||
17 | * space, which makes just having a simple IO_ADDRESS macro to slide | ||
18 | * them into the right virtual location rough. Instead, we will | ||
19 | * provide a master phys->virt mapping for peripherals here. | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef __ASM_ARCH_MSM_IOMAP_H | ||
24 | #define __ASM_ARCH_MSM_IOMAP_H | ||
25 | |||
26 | #include <asm/sizes.h> | ||
27 | |||
28 | /* Physical base address and size of peripherals. | ||
29 | * Ordered by the virtual base addresses they will be mapped at. | ||
30 | * | ||
31 | * MSM_VIC_BASE must be an value that can be loaded via a "mov" | ||
32 | * instruction, otherwise entry-macro.S will not compile. | ||
33 | * | ||
34 | * If you add or remove entries here, you'll want to edit the | ||
35 | * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your | ||
36 | * changes. | ||
37 | * | ||
38 | */ | ||
39 | |||
40 | #define MSM_VIC_BASE 0xE0000000 | ||
41 | #define MSM_VIC_PHYS 0xC0000000 | ||
42 | #define MSM_VIC_SIZE SZ_4K | ||
43 | |||
44 | #define MSM_CSR_BASE 0xE0001000 | ||
45 | #define MSM_CSR_PHYS 0xC0100000 | ||
46 | #define MSM_CSR_SIZE SZ_4K | ||
47 | |||
48 | #define MSM_GPT_PHYS MSM_CSR_PHYS | ||
49 | #define MSM_GPT_BASE MSM_CSR_BASE | ||
50 | #define MSM_GPT_SIZE SZ_4K | ||
51 | |||
52 | #define MSM_DMOV_BASE 0xE0002000 | ||
53 | #define MSM_DMOV_PHYS 0xA9700000 | ||
54 | #define MSM_DMOV_SIZE SZ_4K | ||
55 | |||
56 | #define MSM_UART1_BASE 0xE0003000 | ||
57 | #define MSM_UART1_PHYS 0xA9A00000 | ||
58 | #define MSM_UART1_SIZE SZ_4K | ||
59 | |||
60 | #define MSM_UART2_BASE 0xE0004000 | ||
61 | #define MSM_UART2_PHYS 0xA9B00000 | ||
62 | #define MSM_UART2_SIZE SZ_4K | ||
63 | |||
64 | #define MSM_UART3_BASE 0xE0005000 | ||
65 | #define MSM_UART3_PHYS 0xA9C00000 | ||
66 | #define MSM_UART3_SIZE SZ_4K | ||
67 | |||
68 | #define MSM_I2C_BASE 0xE0006000 | ||
69 | #define MSM_I2C_PHYS 0xA9900000 | ||
70 | #define MSM_I2C_SIZE SZ_4K | ||
71 | |||
72 | #define MSM_GPIO1_BASE 0xE0007000 | ||
73 | #define MSM_GPIO1_PHYS 0xA9200000 | ||
74 | #define MSM_GPIO1_SIZE SZ_4K | ||
75 | |||
76 | #define MSM_GPIO2_BASE 0xE0008000 | ||
77 | #define MSM_GPIO2_PHYS 0xA9300000 | ||
78 | #define MSM_GPIO2_SIZE SZ_4K | ||
79 | |||
80 | #define MSM_HSUSB_BASE 0xE0009000 | ||
81 | #define MSM_HSUSB_PHYS 0xA0800000 | ||
82 | #define MSM_HSUSB_SIZE SZ_4K | ||
83 | |||
84 | #define MSM_CLK_CTL_BASE 0xE000A000 | ||
85 | #define MSM_CLK_CTL_PHYS 0xA8600000 | ||
86 | #define MSM_CLK_CTL_SIZE SZ_4K | ||
87 | |||
88 | #define MSM_PMDH_BASE 0xE000B000 | ||
89 | #define MSM_PMDH_PHYS 0xAA600000 | ||
90 | #define MSM_PMDH_SIZE SZ_4K | ||
91 | |||
92 | #define MSM_EMDH_BASE 0xE000C000 | ||
93 | #define MSM_EMDH_PHYS 0xAA700000 | ||
94 | #define MSM_EMDH_SIZE SZ_4K | ||
95 | |||
96 | #define MSM_MDP_BASE 0xE0010000 | ||
97 | #define MSM_MDP_PHYS 0xAA200000 | ||
98 | #define MSM_MDP_SIZE 0x000F0000 | ||
99 | |||
100 | #define MSM_SHARED_RAM_BASE 0xE0100000 | ||
101 | #define MSM_SHARED_RAM_PHYS 0x01F00000 | ||
102 | #define MSM_SHARED_RAM_SIZE SZ_1M | ||
103 | |||
104 | #endif | ||
diff --git a/include/asm-arm/arch-msm/system.h b/include/asm-arm/arch-msm/system.h new file mode 100644 index 000000000000..7c5544bdd0c7 --- /dev/null +++ b/include/asm-arm/arch-msm/system.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/system.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <asm/hardware.h> | ||
17 | |||
18 | void arch_idle(void); | ||
19 | |||
20 | static inline void arch_reset(char mode) | ||
21 | { | ||
22 | for (;;) ; /* depends on IPC w/ other core */ | ||
23 | } | ||
diff --git a/include/asm-arm/arch-msm/timex.h b/include/asm-arm/arch-msm/timex.h new file mode 100644 index 000000000000..154b23fb3599 --- /dev/null +++ b/include/asm-arm/arch-msm/timex.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/timex.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MSM_TIMEX_H | ||
17 | |||
18 | #define CLOCK_TICK_RATE 1000000 | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-arm/arch-msm/uncompress.h b/include/asm-arm/arch-msm/uncompress.h new file mode 100644 index 000000000000..e91ed786ffec --- /dev/null +++ b/include/asm-arm/arch-msm/uncompress.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/uncompress.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H | ||
17 | |||
18 | #include "hardware.h" | ||
19 | |||
20 | static void putc(int c) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | static inline void flush(void) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | static inline void arch_decomp_setup(void) | ||
29 | { | ||
30 | } | ||
31 | |||
32 | static inline void arch_decomp_wdog(void) | ||
33 | { | ||
34 | } | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-arm/arch-msm/vmalloc.h b/include/asm-arm/arch-msm/vmalloc.h new file mode 100644 index 000000000000..60f8d910e825 --- /dev/null +++ b/include/asm-arm/arch-msm/vmalloc.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/vmalloc.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MSM_VMALLOC_H | ||
17 | #define __ASM_ARCH_MSM_VMALLOC_H | ||
18 | |||
19 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | ||
20 | |||
21 | #endif | ||
22 | |||
diff --git a/include/asm-arm/arch-orion/debug-macro.S b/include/asm-arm/arch-orion/debug-macro.S new file mode 100644 index 000000000000..e2a80641f214 --- /dev/null +++ b/include/asm-arm/arch-orion/debug-macro.S | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-orion/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | .macro addruart,rx | ||
12 | mov \rx, #0xf1000000 | ||
13 | orr \rx, \rx, #0x00012000 | ||
14 | .endm | ||
15 | |||
16 | #define UART_SHIFT 2 | ||
17 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/include/asm-arm/arch-orion/dma.h b/include/asm-arm/arch-orion/dma.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/include/asm-arm/arch-orion/dma.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/include/asm-arm/arch-orion/entry-macro.S b/include/asm-arm/arch-orion/entry-macro.S new file mode 100644 index 000000000000..b76075a7e44b --- /dev/null +++ b/include/asm-arm/arch-orion/entry-macro.S | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for Orion platforms | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <asm/arch/orion.h> | ||
12 | |||
13 | .macro disable_fiq | ||
14 | .endm | ||
15 | |||
16 | .macro arch_ret_to_user, tmp1, tmp2 | ||
17 | .endm | ||
18 | |||
19 | .macro get_irqnr_preamble, base, tmp | ||
20 | ldr \base, =MAIN_IRQ_CAUSE | ||
21 | .endm | ||
22 | |||
23 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
24 | ldr \irqstat, [\base, #0] @ main cause | ||
25 | ldr \tmp, [\base, #(MAIN_IRQ_MASK - MAIN_IRQ_CAUSE)] @ main mask | ||
26 | mov \irqnr, #0 @ default irqnr | ||
27 | @ find cause bits that are unmasked | ||
28 | ands \irqstat, \irqstat, \tmp @ clear Z flag if any | ||
29 | clzne \irqnr, \irqstat @ calc irqnr | ||
30 | rsbne \irqnr, \irqnr, #31 | ||
31 | .endm | ||
diff --git a/include/asm-arm/arch-orion/gpio.h b/include/asm-arm/arch-orion/gpio.h new file mode 100644 index 000000000000..d66284f9a14c --- /dev/null +++ b/include/asm-arm/arch-orion/gpio.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/gpio.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | extern int gpio_request(unsigned pin, const char *label); | ||
10 | extern void gpio_free(unsigned pin); | ||
11 | extern int gpio_direction_input(unsigned pin); | ||
12 | extern int gpio_direction_output(unsigned pin, int value); | ||
13 | extern int gpio_get_value(unsigned pin); | ||
14 | extern void gpio_set_value(unsigned pin, int value); | ||
15 | extern void orion_gpio_set_blink(unsigned pin, int blink); | ||
16 | extern void gpio_display(void); /* debug */ | ||
17 | |||
18 | static inline int gpio_to_irq(int pin) | ||
19 | { | ||
20 | return pin + IRQ_ORION_GPIO_START; | ||
21 | } | ||
22 | |||
23 | static inline int irq_to_gpio(int irq) | ||
24 | { | ||
25 | return irq - IRQ_ORION_GPIO_START; | ||
26 | } | ||
27 | |||
28 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
diff --git a/include/asm-arm/arch-orion/hardware.h b/include/asm-arm/arch-orion/hardware.h new file mode 100644 index 000000000000..8a12d213fbdc --- /dev/null +++ b/include/asm-arm/arch-orion/hardware.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/hardware.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_HARDWARE_H__ | ||
11 | #define __ASM_ARCH_HARDWARE_H__ | ||
12 | |||
13 | #include "orion.h" | ||
14 | |||
15 | #define PCI_MEMORY_VADDR ORION_PCI_SYS_MEM_BASE | ||
16 | #define PCI_IO_VADDR ORION_PCI_SYS_IO_BASE | ||
17 | |||
18 | #define pcibios_assign_all_busses() 1 | ||
19 | |||
20 | #define PCIBIOS_MIN_IO 0x1000 | ||
21 | #define PCIBIOS_MIN_MEM 0x01000000 | ||
22 | #define PCIMEM_BASE PCI_MEMORY_VADDR /* mem base for VGA */ | ||
23 | |||
24 | #endif /* _ASM_ARCH_HARDWARE_H */ | ||
diff --git a/include/asm-arm/arch-orion/io.h b/include/asm-arm/arch-orion/io.h new file mode 100644 index 000000000000..e0b8c39b9167 --- /dev/null +++ b/include/asm-arm/arch-orion/io.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/io.h | ||
3 | * | ||
4 | * Tzachi Perelstein <tzachi@marvell.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | ||
12 | #define __ASM_ARM_ARCH_IO_H | ||
13 | |||
14 | #include "orion.h" | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | #define IO_SPACE_REMAP ORION_PCI_SYS_IO_BASE | ||
18 | |||
19 | static inline void __iomem *__io(unsigned long addr) | ||
20 | { | ||
21 | return (void __iomem *)addr; | ||
22 | } | ||
23 | |||
24 | #define __io(a) __io(a) | ||
25 | #define __mem_pci(a) (a) | ||
26 | |||
27 | #endif | ||
diff --git a/include/asm-arm/arch-orion/irqs.h b/include/asm-arm/arch-orion/irqs.h new file mode 100644 index 000000000000..eea65ca6076a --- /dev/null +++ b/include/asm-arm/arch-orion/irqs.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/irqs.h | ||
3 | * | ||
4 | * IRQ definitions for Orion SoC | ||
5 | * | ||
6 | * Maintainer: Tzachi Perelstein <tzachi@marvell.com> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_IRQS_H__ | ||
14 | #define __ASM_ARCH_IRQS_H__ | ||
15 | |||
16 | #include "orion.h" /* need GPIO_MAX */ | ||
17 | |||
18 | /* | ||
19 | * Orion Main Interrupt Controller | ||
20 | */ | ||
21 | #define IRQ_ORION_BRIDGE 0 | ||
22 | #define IRQ_ORION_DOORBELL_H2C 1 | ||
23 | #define IRQ_ORION_DOORBELL_C2H 2 | ||
24 | #define IRQ_ORION_UART0 3 | ||
25 | #define IRQ_ORION_UART1 4 | ||
26 | #define IRQ_ORION_I2C 5 | ||
27 | #define IRQ_ORION_GPIO_0_7 6 | ||
28 | #define IRQ_ORION_GPIO_8_15 7 | ||
29 | #define IRQ_ORION_GPIO_16_23 8 | ||
30 | #define IRQ_ORION_GPIO_24_31 9 | ||
31 | #define IRQ_ORION_PCIE0_ERR 10 | ||
32 | #define IRQ_ORION_PCIE0_INT 11 | ||
33 | #define IRQ_ORION_USB1_CTRL 12 | ||
34 | #define IRQ_ORION_DEV_BUS_ERR 14 | ||
35 | #define IRQ_ORION_PCI_ERR 15 | ||
36 | #define IRQ_ORION_USB_BR_ERR 16 | ||
37 | #define IRQ_ORION_USB0_CTRL 17 | ||
38 | #define IRQ_ORION_ETH_RX 18 | ||
39 | #define IRQ_ORION_ETH_TX 19 | ||
40 | #define IRQ_ORION_ETH_MISC 20 | ||
41 | #define IRQ_ORION_ETH_SUM 21 | ||
42 | #define IRQ_ORION_ETH_ERR 22 | ||
43 | #define IRQ_ORION_IDMA_ERR 23 | ||
44 | #define IRQ_ORION_IDMA_0 24 | ||
45 | #define IRQ_ORION_IDMA_1 25 | ||
46 | #define IRQ_ORION_IDMA_2 26 | ||
47 | #define IRQ_ORION_IDMA_3 27 | ||
48 | #define IRQ_ORION_CESA 28 | ||
49 | #define IRQ_ORION_SATA 29 | ||
50 | #define IRQ_ORION_XOR0 30 | ||
51 | #define IRQ_ORION_XOR1 31 | ||
52 | |||
53 | /* | ||
54 | * Orion General Purpose Pins | ||
55 | */ | ||
56 | #define IRQ_ORION_GPIO_START 32 | ||
57 | #define NR_GPIO_IRQS GPIO_MAX | ||
58 | |||
59 | #define NR_IRQS (IRQ_ORION_GPIO_START + NR_GPIO_IRQS) | ||
60 | |||
61 | #endif /* __ASM_ARCH_IRQS_H__ */ | ||
diff --git a/include/asm-arm/arch-orion/memory.h b/include/asm-arm/arch-orion/memory.h new file mode 100644 index 000000000000..d954dba87ced --- /dev/null +++ b/include/asm-arm/arch-orion/memory.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/memory.h | ||
3 | * | ||
4 | * Marvell Orion memory definitions | ||
5 | */ | ||
6 | |||
7 | #ifndef __ASM_ARCH_MMU_H | ||
8 | #define __ASM_ARCH_MMU_H | ||
9 | |||
10 | #define PHYS_OFFSET UL(0x00000000) | ||
11 | |||
12 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
13 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
14 | |||
15 | #endif | ||
diff --git a/include/asm-arm/arch-orion/orion.h b/include/asm-arm/arch-orion/orion.h new file mode 100644 index 000000000000..f787f752e58c --- /dev/null +++ b/include/asm-arm/arch-orion/orion.h | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/orion.h | ||
3 | * | ||
4 | * Generic definitions of Orion SoC flavors: | ||
5 | * Orion-1, Orion-NAS, Orion-VoIP, and Orion-2. | ||
6 | * | ||
7 | * Maintainer: Tzachi Perelstein <tzachi@marvell.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_ORION_H__ | ||
15 | #define __ASM_ARCH_ORION_H__ | ||
16 | |||
17 | /******************************************************************************* | ||
18 | * Orion Address Map | ||
19 | * Use the same mapping (1:1 virtual:physical) of internal registers and | ||
20 | * PCI system (PCI+PCIE) for all machines. | ||
21 | * Each machine defines the rest of its mapping (e.g. device bus flashes) | ||
22 | ******************************************************************************/ | ||
23 | #define ORION_REGS_BASE 0xf1000000 | ||
24 | #define ORION_REGS_SIZE SZ_1M | ||
25 | |||
26 | #define ORION_PCI_SYS_MEM_BASE 0xe0000000 | ||
27 | #define ORION_PCIE_MEM_BASE ORION_PCI_SYS_MEM_BASE | ||
28 | #define ORION_PCIE_MEM_SIZE SZ_128M | ||
29 | #define ORION_PCI_MEM_BASE (ORION_PCIE_MEM_BASE + ORION_PCIE_MEM_SIZE) | ||
30 | #define ORION_PCI_MEM_SIZE SZ_128M | ||
31 | |||
32 | #define ORION_PCI_SYS_IO_BASE 0xf2000000 | ||
33 | #define ORION_PCIE_IO_BASE ORION_PCI_SYS_IO_BASE | ||
34 | #define ORION_PCIE_IO_SIZE SZ_1M | ||
35 | #define ORION_PCIE_IO_REMAP (ORION_PCIE_IO_BASE - ORION_PCI_SYS_IO_BASE) | ||
36 | #define ORION_PCI_IO_BASE (ORION_PCIE_IO_BASE + ORION_PCIE_IO_SIZE) | ||
37 | #define ORION_PCI_IO_SIZE SZ_1M | ||
38 | #define ORION_PCI_IO_REMAP (ORION_PCI_IO_BASE - ORION_PCI_SYS_IO_BASE) | ||
39 | /* Relevant only for Orion-NAS */ | ||
40 | #define ORION_PCIE_WA_BASE 0xf0000000 | ||
41 | #define ORION_PCIE_WA_SIZE SZ_16M | ||
42 | |||
43 | /******************************************************************************* | ||
44 | * Supported Devices & Revisions | ||
45 | ******************************************************************************/ | ||
46 | /* Orion-1 (88F5181) */ | ||
47 | #define MV88F5181_DEV_ID 0x5181 | ||
48 | #define MV88F5181_REV_B1 3 | ||
49 | /* Orion-NAS (88F5182) */ | ||
50 | #define MV88F5182_DEV_ID 0x5182 | ||
51 | #define MV88F5182_REV_A2 2 | ||
52 | /* Orion-2 (88F5281) */ | ||
53 | #define MV88F5281_DEV_ID 0x5281 | ||
54 | #define MV88F5281_REV_D1 5 | ||
55 | #define MV88F5281_REV_D2 6 | ||
56 | |||
57 | /******************************************************************************* | ||
58 | * Orion Registers Map | ||
59 | ******************************************************************************/ | ||
60 | #define ORION_DDR_REG_BASE (ORION_REGS_BASE | 0x00000) | ||
61 | #define ORION_DEV_BUS_REG_BASE (ORION_REGS_BASE | 0x10000) | ||
62 | #define ORION_BRIDGE_REG_BASE (ORION_REGS_BASE | 0x20000) | ||
63 | #define ORION_PCI_REG_BASE (ORION_REGS_BASE | 0x30000) | ||
64 | #define ORION_PCIE_REG_BASE (ORION_REGS_BASE | 0x40000) | ||
65 | #define ORION_USB0_REG_BASE (ORION_REGS_BASE | 0x50000) | ||
66 | #define ORION_ETH_REG_BASE (ORION_REGS_BASE | 0x70000) | ||
67 | #define ORION_SATA_REG_BASE (ORION_REGS_BASE | 0x80000) | ||
68 | #define ORION_USB1_REG_BASE (ORION_REGS_BASE | 0xa0000) | ||
69 | |||
70 | #define ORION_DDR_REG(x) (ORION_DDR_REG_BASE | (x)) | ||
71 | #define ORION_DEV_BUS_REG(x) (ORION_DEV_BUS_REG_BASE | (x)) | ||
72 | #define ORION_BRIDGE_REG(x) (ORION_BRIDGE_REG_BASE | (x)) | ||
73 | #define ORION_PCI_REG(x) (ORION_PCI_REG_BASE | (x)) | ||
74 | #define ORION_PCIE_REG(x) (ORION_PCIE_REG_BASE | (x)) | ||
75 | #define ORION_USB0_REG(x) (ORION_USB0_REG_BASE | (x)) | ||
76 | #define ORION_USB1_REG(x) (ORION_USB1_REG_BASE | (x)) | ||
77 | #define ORION_ETH_REG(x) (ORION_ETH_REG_BASE | (x)) | ||
78 | #define ORION_SATA_REG(x) (ORION_SATA_REG_BASE | (x)) | ||
79 | |||
80 | /******************************************************************************* | ||
81 | * Device Bus Registers | ||
82 | ******************************************************************************/ | ||
83 | #define MPP_0_7_CTRL ORION_DEV_BUS_REG(0x000) | ||
84 | #define MPP_8_15_CTRL ORION_DEV_BUS_REG(0x004) | ||
85 | #define MPP_16_19_CTRL ORION_DEV_BUS_REG(0x050) | ||
86 | #define MPP_DEV_CTRL ORION_DEV_BUS_REG(0x008) | ||
87 | #define MPP_RESET_SAMPLE ORION_DEV_BUS_REG(0x010) | ||
88 | #define GPIO_OUT ORION_DEV_BUS_REG(0x100) | ||
89 | #define GPIO_IO_CONF ORION_DEV_BUS_REG(0x104) | ||
90 | #define GPIO_BLINK_EN ORION_DEV_BUS_REG(0x108) | ||
91 | #define GPIO_IN_POL ORION_DEV_BUS_REG(0x10c) | ||
92 | #define GPIO_DATA_IN ORION_DEV_BUS_REG(0x110) | ||
93 | #define GPIO_EDGE_CAUSE ORION_DEV_BUS_REG(0x114) | ||
94 | #define GPIO_EDGE_MASK ORION_DEV_BUS_REG(0x118) | ||
95 | #define GPIO_LEVEL_MASK ORION_DEV_BUS_REG(0x11c) | ||
96 | #define DEV_BANK_0_PARAM ORION_DEV_BUS_REG(0x45c) | ||
97 | #define DEV_BANK_1_PARAM ORION_DEV_BUS_REG(0x460) | ||
98 | #define DEV_BANK_2_PARAM ORION_DEV_BUS_REG(0x464) | ||
99 | #define DEV_BANK_BOOT_PARAM ORION_DEV_BUS_REG(0x46c) | ||
100 | #define DEV_BUS_CTRL ORION_DEV_BUS_REG(0x4c0) | ||
101 | #define DEV_BUS_INT_CAUSE ORION_DEV_BUS_REG(0x4d0) | ||
102 | #define DEV_BUS_INT_MASK ORION_DEV_BUS_REG(0x4d4) | ||
103 | #define I2C_BASE ORION_DEV_BUS_REG(0x1000) | ||
104 | #define UART0_BASE ORION_DEV_BUS_REG(0x2000) | ||
105 | #define UART1_BASE ORION_DEV_BUS_REG(0x2100) | ||
106 | #define GPIO_MAX 32 | ||
107 | |||
108 | /*************************************************************************** | ||
109 | * Orion CPU Bridge Registers | ||
110 | **************************************************************************/ | ||
111 | #define CPU_CONF ORION_BRIDGE_REG(0x100) | ||
112 | #define CPU_CTRL ORION_BRIDGE_REG(0x104) | ||
113 | #define CPU_RESET_MASK ORION_BRIDGE_REG(0x108) | ||
114 | #define CPU_SOFT_RESET ORION_BRIDGE_REG(0x10c) | ||
115 | #define POWER_MNG_CTRL_REG ORION_BRIDGE_REG(0x11C) | ||
116 | #define BRIDGE_CAUSE ORION_BRIDGE_REG(0x110) | ||
117 | #define BRIDGE_MASK ORION_BRIDGE_REG(0x114) | ||
118 | #define MAIN_IRQ_CAUSE ORION_BRIDGE_REG(0x200) | ||
119 | #define MAIN_IRQ_MASK ORION_BRIDGE_REG(0x204) | ||
120 | #define TIMER_CTRL ORION_BRIDGE_REG(0x300) | ||
121 | #define TIMER_VAL(x) ORION_BRIDGE_REG(0x314 + ((x) * 8)) | ||
122 | #define TIMER_VAL_RELOAD(x) ORION_BRIDGE_REG(0x310 + ((x) * 8)) | ||
123 | |||
124 | #ifndef __ASSEMBLY__ | ||
125 | |||
126 | /******************************************************************************* | ||
127 | * Helpers to access Orion registers | ||
128 | ******************************************************************************/ | ||
129 | #include <asm/types.h> | ||
130 | #include <asm/io.h> | ||
131 | |||
132 | #define orion_read(r) __raw_readl(r) | ||
133 | #define orion_write(r, val) __raw_writel(val, r) | ||
134 | |||
135 | /* | ||
136 | * These are not preempt safe. Locks, if needed, must be taken care by caller. | ||
137 | */ | ||
138 | #define orion_setbits(r, mask) orion_write((r), orion_read(r) | (mask)) | ||
139 | #define orion_clrbits(r, mask) orion_write((r), orion_read(r) & ~(mask)) | ||
140 | |||
141 | #endif /* __ASSEMBLY__ */ | ||
142 | |||
143 | #endif /* __ASM_ARCH_ORION_H__ */ | ||
diff --git a/include/asm-arm/arch-orion/platform.h b/include/asm-arm/arch-orion/platform.h new file mode 100644 index 000000000000..143c38e2fa0b --- /dev/null +++ b/include/asm-arm/arch-orion/platform.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * asm-arm/arch-orion/platform.h | ||
3 | * | ||
4 | * Tzachi Perelstein <tzachi@marvell.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_PLATFORM_H__ | ||
12 | #define __ASM_ARCH_PLATFORM_H__ | ||
13 | |||
14 | /* | ||
15 | * Device bus NAND private data | ||
16 | */ | ||
17 | struct orion_nand_data { | ||
18 | struct mtd_partition *parts; | ||
19 | u32 nr_parts; | ||
20 | u8 ale; /* address line number connected to ALE */ | ||
21 | u8 cle; /* address line number connected to CLE */ | ||
22 | u8 width; /* buswidth */ | ||
23 | }; | ||
24 | |||
25 | #endif | ||
diff --git a/include/asm-arm/arch-orion/system.h b/include/asm-arm/arch-orion/system.h new file mode 100644 index 000000000000..17704c68f90e --- /dev/null +++ b/include/asm-arm/arch-orion/system.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/system.h | ||
3 | * | ||
4 | * Tzachi Perelstein <tzachi@marvell.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_SYSTEM_H | ||
12 | #define __ASM_ARCH_SYSTEM_H | ||
13 | |||
14 | #include <asm/arch/hardware.h> | ||
15 | #include <asm/arch/orion.h> | ||
16 | |||
17 | static inline void arch_idle(void) | ||
18 | { | ||
19 | cpu_do_idle(); | ||
20 | } | ||
21 | |||
22 | static inline void arch_reset(char mode) | ||
23 | { | ||
24 | /* | ||
25 | * Enable and issue soft reset | ||
26 | */ | ||
27 | orion_setbits(CPU_RESET_MASK, (1 << 2)); | ||
28 | orion_setbits(CPU_SOFT_RESET, 1); | ||
29 | } | ||
30 | |||
31 | #endif | ||
diff --git a/include/asm-arm/arch-orion/timex.h b/include/asm-arm/arch-orion/timex.h new file mode 100644 index 000000000000..26c2c91eecf0 --- /dev/null +++ b/include/asm-arm/arch-orion/timex.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/timex.h | ||
3 | * | ||
4 | * Tzachi Perelstein <tzachi@marvell.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #define ORION_TCLK 166666667 | ||
12 | #define CLOCK_TICK_RATE ORION_TCLK | ||
diff --git a/include/asm-arm/arch-orion/uncompress.h b/include/asm-arm/arch-orion/uncompress.h new file mode 100644 index 000000000000..a1a222fb438c --- /dev/null +++ b/include/asm-arm/arch-orion/uncompress.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/uncompress.h | ||
3 | * | ||
4 | * Tzachi Perelstein <tzachi@marvell.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <asm/arch/orion.h> | ||
12 | |||
13 | #define MV_UART_LSR ((volatile unsigned char *)(UART0_BASE + 0x14)) | ||
14 | #define MV_UART_THR ((volatile unsigned char *)(UART0_BASE + 0x0)) | ||
15 | |||
16 | #define LSR_THRE 0x20 | ||
17 | |||
18 | static void putc(const char c) | ||
19 | { | ||
20 | int j = 0x1000; | ||
21 | while (--j && !(*MV_UART_LSR & LSR_THRE)) | ||
22 | barrier(); | ||
23 | *MV_UART_THR = c; | ||
24 | } | ||
25 | |||
26 | static void flush(void) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | static void orion_early_putstr(const char *ptr) | ||
31 | { | ||
32 | char c; | ||
33 | while ((c = *ptr++) != '\0') { | ||
34 | if (c == '\n') | ||
35 | putc('\r'); | ||
36 | putc(c); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * nothing to do | ||
42 | */ | ||
43 | #define arch_decomp_setup() | ||
44 | #define arch_decomp_wdog() | ||
diff --git a/include/asm-arm/arch-orion/vmalloc.h b/include/asm-arm/arch-orion/vmalloc.h new file mode 100644 index 000000000000..23e2a102fe0c --- /dev/null +++ b/include/asm-arm/arch-orion/vmalloc.h | |||
@@ -0,0 +1,5 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion/vmalloc.h | ||
3 | */ | ||
4 | |||
5 | #define VMALLOC_END 0xf0000000 | ||
diff --git a/include/asm-arm/arch-pxa/colibri.h b/include/asm-arm/arch-pxa/colibri.h new file mode 100644 index 000000000000..2ae373fb5675 --- /dev/null +++ b/include/asm-arm/arch-pxa/colibri.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef _COLIBRI_H_ | ||
2 | #define _COLIBRI_H_ | ||
3 | |||
4 | /* physical memory regions */ | ||
5 | #define COLIBRI_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */ | ||
6 | #define COLIBRI_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet DM9000 region */ | ||
7 | #define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ | ||
8 | |||
9 | /* virtual memory regions */ | ||
10 | #define COLIBRI_DISK_VIRT 0xF0000000 /* Disk On Chip region */ | ||
11 | |||
12 | /* size of flash */ | ||
13 | #define COLIBRI_FLASH_SIZE 0x02000000 /* Flash size 32 MB */ | ||
14 | |||
15 | /* Ethernet Controller Davicom DM9000 */ | ||
16 | #define GPIO_DM9000 114 | ||
17 | #define COLIBRI_ETH_IRQ IRQ_GPIO(GPIO_DM9000) | ||
18 | |||
19 | #endif /* _COLIBRI_H_ */ | ||
diff --git a/include/asm-arm/arch-pxa/corgi.h b/include/asm-arm/arch-pxa/corgi.h index e554caa0d18b..bf856503baf6 100644 --- a/include/asm-arm/arch-pxa/corgi.h +++ b/include/asm-arm/arch-pxa/corgi.h | |||
@@ -104,7 +104,6 @@ | |||
104 | */ | 104 | */ |
105 | extern struct platform_device corgiscoop_device; | 105 | extern struct platform_device corgiscoop_device; |
106 | extern struct platform_device corgissp_device; | 106 | extern struct platform_device corgissp_device; |
107 | extern struct platform_device corgifb_device; | ||
108 | 107 | ||
109 | #endif /* __ASM_ARCH_CORGI_H */ | 108 | #endif /* __ASM_ARCH_CORGI_H */ |
110 | 109 | ||
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h index b76ee6d1f5b4..c562b972a4a6 100644 --- a/include/asm-arm/arch-pxa/irqs.h +++ b/include/asm-arm/arch-pxa/irqs.h | |||
@@ -180,7 +180,8 @@ | |||
180 | #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) | 180 | #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) |
181 | #elif defined(CONFIG_ARCH_LUBBOCK) || \ | 181 | #elif defined(CONFIG_ARCH_LUBBOCK) || \ |
182 | defined(CONFIG_MACH_LOGICPD_PXA270) || \ | 182 | defined(CONFIG_MACH_LOGICPD_PXA270) || \ |
183 | defined(CONFIG_MACH_MAINSTONE) | 183 | defined(CONFIG_MACH_MAINSTONE) || \ |
184 | defined(CONFIG_MACH_PCM027) | ||
184 | #define NR_IRQS (IRQ_BOARD_END) | 185 | #define NR_IRQS (IRQ_BOARD_END) |
185 | #else | 186 | #else |
186 | #define NR_IRQS (IRQ_BOARD_START) | 187 | #define NR_IRQS (IRQ_BOARD_START) |
@@ -227,6 +228,13 @@ | |||
227 | #define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) | 228 | #define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) |
228 | #define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) | 229 | #define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) |
229 | 230 | ||
231 | /* phyCORE-PXA270 (PCM027) Interrupts */ | ||
232 | #define PCM027_IRQ(x) (IRQ_BOARD_START + (x)) | ||
233 | #define PCM027_BTDET_IRQ PCM027_IRQ(0) | ||
234 | #define PCM027_FF_RI_IRQ PCM027_IRQ(1) | ||
235 | #define PCM027_MMCDET_IRQ PCM027_IRQ(2) | ||
236 | #define PCM027_PM_5V_IRQ PCM027_IRQ(3) | ||
237 | |||
230 | /* ITE8152 irqs */ | 238 | /* ITE8152 irqs */ |
231 | /* add IT8152 IRQs beyond BOARD_END */ | 239 | /* add IT8152 IRQs beyond BOARD_END */ |
232 | #ifdef CONFIG_PCI_HOST_ITE8152 | 240 | #ifdef CONFIG_PCI_HOST_ITE8152 |
diff --git a/include/asm-arm/arch-pxa/littleton.h b/include/asm-arm/arch-pxa/littleton.h new file mode 100644 index 000000000000..79d209b826f4 --- /dev/null +++ b/include/asm-arm/arch-pxa/littleton.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __ASM_ARCH_ZYLONITE_H | ||
2 | #define __ASM_ARCH_ZYLONITE_H | ||
3 | |||
4 | #define LITTLETON_ETH_PHYS 0x30000000 | ||
5 | |||
6 | #endif /* __ASM_ARCH_ZYLONITE_H */ | ||
diff --git a/include/asm-arm/arch-pxa/magician.h b/include/asm-arm/arch-pxa/magician.h new file mode 100644 index 000000000000..337f51f06b3a --- /dev/null +++ b/include/asm-arm/arch-pxa/magician.h | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * GPIO and IRQ definitions for HTC Magician PDA phones | ||
3 | * | ||
4 | * Copyright (c) 2007 Philipp Zabel | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef _MAGICIAN_H_ | ||
13 | #define _MAGICIAN_H_ | ||
14 | |||
15 | #include <asm/arch/pxa-regs.h> | ||
16 | |||
17 | /* | ||
18 | * PXA GPIOs | ||
19 | */ | ||
20 | |||
21 | #define GPIO0_MAGICIAN_KEY_POWER 0 | ||
22 | #define GPIO9_MAGICIAN_UNKNOWN 9 | ||
23 | #define GPIO10_MAGICIAN_GSM_IRQ 10 | ||
24 | #define GPIO11_MAGICIAN_GSM_OUT1 11 | ||
25 | #define GPIO13_MAGICIAN_CPLD_IRQ 13 | ||
26 | #define GPIO18_MAGICIAN_UNKNOWN 18 | ||
27 | #define GPIO22_MAGICIAN_VIBRA_EN 22 | ||
28 | #define GPIO26_MAGICIAN_GSM_POWER 26 | ||
29 | #define GPIO27_MAGICIAN_USBC_PUEN 27 | ||
30 | #define GPIO30_MAGICIAN_nCHARGE_EN 30 | ||
31 | #define GPIO37_MAGICIAN_KEY_HANGUP 37 | ||
32 | #define GPIO38_MAGICIAN_KEY_CONTACTS 38 | ||
33 | #define GPIO40_MAGICIAN_GSM_OUT2 40 | ||
34 | #define GPIO48_MAGICIAN_UNKNOWN 48 | ||
35 | #define GPIO56_MAGICIAN_UNKNOWN 56 | ||
36 | #define GPIO57_MAGICIAN_CAM_RESET 57 | ||
37 | #define GPIO83_MAGICIAN_nIR_EN 83 | ||
38 | #define GPIO86_MAGICIAN_GSM_RESET 86 | ||
39 | #define GPIO87_MAGICIAN_GSM_SELECT 87 | ||
40 | #define GPIO90_MAGICIAN_KEY_CALENDAR 90 | ||
41 | #define GPIO91_MAGICIAN_KEY_CAMERA 91 | ||
42 | #define GPIO93_MAGICIAN_KEY_UP 93 | ||
43 | #define GPIO94_MAGICIAN_KEY_DOWN 94 | ||
44 | #define GPIO95_MAGICIAN_KEY_LEFT 95 | ||
45 | #define GPIO96_MAGICIAN_KEY_RIGHT 96 | ||
46 | #define GPIO97_MAGICIAN_KEY_ENTER 97 | ||
47 | #define GPIO98_MAGICIAN_KEY_RECORD 98 | ||
48 | #define GPIO99_MAGICIAN_HEADPHONE_IN 99 | ||
49 | #define GPIO100_MAGICIAN_KEY_VOL_UP 100 | ||
50 | #define GPIO101_MAGICIAN_KEY_VOL_DOWN 101 | ||
51 | #define GPIO102_MAGICIAN_KEY_PHONE 102 | ||
52 | #define GPIO103_MAGICIAN_LED_KP 103 | ||
53 | #define GPIO104_MAGICIAN_LCD_POWER_1 104 | ||
54 | #define GPIO105_MAGICIAN_LCD_POWER_2 105 | ||
55 | #define GPIO106_MAGICIAN_LCD_POWER_3 106 | ||
56 | #define GPIO107_MAGICIAN_DS1WM_IRQ 107 | ||
57 | #define GPIO108_MAGICIAN_GSM_READY 108 | ||
58 | #define GPIO114_MAGICIAN_UNKNOWN 114 | ||
59 | #define GPIO115_MAGICIAN_nPEN_IRQ 115 | ||
60 | #define GPIO116_MAGICIAN_nCAM_EN 116 | ||
61 | #define GPIO119_MAGICIAN_UNKNOWN 119 | ||
62 | #define GPIO120_MAGICIAN_UNKNOWN 120 | ||
63 | |||
64 | /* | ||
65 | * PXA GPIO alternate function mode & direction | ||
66 | */ | ||
67 | |||
68 | #define GPIO0_MAGICIAN_KEY_POWER_MD (0 | GPIO_IN) | ||
69 | #define GPIO9_MAGICIAN_UNKNOWN_MD (9 | GPIO_IN) | ||
70 | #define GPIO10_MAGICIAN_GSM_IRQ_MD (10 | GPIO_IN) | ||
71 | #define GPIO11_MAGICIAN_GSM_OUT1_MD (11 | GPIO_OUT) | ||
72 | #define GPIO13_MAGICIAN_CPLD_IRQ_MD (13 | GPIO_IN) | ||
73 | #define GPIO18_MAGICIAN_UNKNOWN_MD (18 | GPIO_OUT) | ||
74 | #define GPIO22_MAGICIAN_VIBRA_EN_MD (22 | GPIO_OUT) | ||
75 | #define GPIO26_MAGICIAN_GSM_POWER_MD (26 | GPIO_OUT) | ||
76 | #define GPIO27_MAGICIAN_USBC_PUEN_MD (27 | GPIO_OUT) | ||
77 | #define GPIO30_MAGICIAN_nCHARGE_EN_MD (30 | GPIO_OUT) | ||
78 | #define GPIO37_MAGICIAN_KEY_HANGUP_MD (37 | GPIO_OUT) | ||
79 | #define GPIO38_MAGICIAN_KEY_CONTACTS_MD (38 | GPIO_OUT) | ||
80 | #define GPIO40_MAGICIAN_GSM_OUT2_MD (40 | GPIO_OUT) | ||
81 | #define GPIO48_MAGICIAN_UNKNOWN_MD (48 | GPIO_OUT) | ||
82 | #define GPIO56_MAGICIAN_UNKNOWN_MD (56 | GPIO_OUT) | ||
83 | #define GPIO57_MAGICIAN_CAM_RESET_MD (57 | GPIO_OUT) | ||
84 | #define GPIO83_MAGICIAN_nIR_EN_MD (83 | GPIO_OUT) | ||
85 | #define GPIO86_MAGICIAN_GSM_RESET_MD (86 | GPIO_OUT) | ||
86 | #define GPIO87_MAGICIAN_GSM_SELECT_MD (87 | GPIO_OUT) | ||
87 | #define GPIO90_MAGICIAN_KEY_CALENDAR_MD (90 | GPIO_OUT) | ||
88 | #define GPIO91_MAGICIAN_KEY_CAMERA_MD (91 | GPIO_OUT) | ||
89 | #define GPIO93_MAGICIAN_KEY_UP_MD (93 | GPIO_IN) | ||
90 | #define GPIO94_MAGICIAN_KEY_DOWN_MD (94 | GPIO_IN) | ||
91 | #define GPIO95_MAGICIAN_KEY_LEFT_MD (95 | GPIO_IN) | ||
92 | #define GPIO96_MAGICIAN_KEY_RIGHT_MD (96 | GPIO_IN) | ||
93 | #define GPIO97_MAGICIAN_KEY_ENTER_MD (97 | GPIO_IN) | ||
94 | #define GPIO98_MAGICIAN_KEY_RECORD_MD (98 | GPIO_IN) | ||
95 | #define GPIO99_MAGICIAN_HEADPHONE_IN_MD (99 | GPIO_IN) | ||
96 | #define GPIO100_MAGICIAN_KEY_VOL_UP_MD (100 | GPIO_IN) | ||
97 | #define GPIO101_MAGICIAN_KEY_VOL_DOWN_MD (101 | GPIO_IN) | ||
98 | #define GPIO102_MAGICIAN_KEY_PHONE_MD (102 | GPIO_IN) | ||
99 | #define GPIO103_MAGICIAN_LED_KP_MD (103 | GPIO_OUT) | ||
100 | #define GPIO104_MAGICIAN_LCD_POWER_1_MD (104 | GPIO_OUT) | ||
101 | #define GPIO105_MAGICIAN_LCD_POWER_2_MD (105 | GPIO_OUT) | ||
102 | #define GPIO106_MAGICIAN_LCD_POWER_3_MD (106 | GPIO_OUT) | ||
103 | #define GPIO107_MAGICIAN_DS1WM_IRQ_MD (107 | GPIO_IN) | ||
104 | #define GPIO108_MAGICIAN_GSM_READY_MD (108 | GPIO_IN) | ||
105 | #define GPIO114_MAGICIAN_UNKNOWN_MD (114 | GPIO_OUT) | ||
106 | #define GPIO115_MAGICIAN_nPEN_IRQ_MD (115 | GPIO_IN) | ||
107 | #define GPIO116_MAGICIAN_nCAM_EN_MD (116 | GPIO_OUT) | ||
108 | #define GPIO119_MAGICIAN_UNKNOWN_MD (119 | GPIO_OUT) | ||
109 | #define GPIO120_MAGICIAN_UNKNOWN_MD (120 | GPIO_OUT) | ||
110 | |||
111 | #endif /* _MAGICIAN_H_ */ | ||
diff --git a/include/asm-arm/arch-pxa/mfp-pxa300.h b/include/asm-arm/arch-pxa/mfp-pxa300.h index a20996649889..bb410313556f 100644 --- a/include/asm-arm/arch-pxa/mfp-pxa300.h +++ b/include/asm-arm/arch-pxa/mfp-pxa300.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define __ASM_ARCH_MFP_PXA300_H | 16 | #define __ASM_ARCH_MFP_PXA300_H |
17 | 17 | ||
18 | #include <asm/arch/mfp.h> | 18 | #include <asm/arch/mfp.h> |
19 | #include <asm/arch/mfp-pxa3xx.h> | ||
19 | 20 | ||
20 | /* GPIO */ | 21 | /* GPIO */ |
21 | #define GPIO46_GPIO MFP_CFG(GPIO46, AF1) | 22 | #define GPIO46_GPIO MFP_CFG(GPIO46, AF1) |
diff --git a/include/asm-arm/arch-pxa/mfp-pxa320.h b/include/asm-arm/arch-pxa/mfp-pxa320.h index 52deedcaf3bd..576aa46d90fc 100644 --- a/include/asm-arm/arch-pxa/mfp-pxa320.h +++ b/include/asm-arm/arch-pxa/mfp-pxa320.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define __ASM_ARCH_MFP_PXA320_H | 16 | #define __ASM_ARCH_MFP_PXA320_H |
17 | 17 | ||
18 | #include <asm/arch/mfp.h> | 18 | #include <asm/arch/mfp.h> |
19 | #include <asm/arch/mfp-pxa3xx.h> | ||
19 | 20 | ||
20 | /* GPIO */ | 21 | /* GPIO */ |
21 | #define GPIO46_GPIO MFP_CFG(GPIO46, AF0) | 22 | #define GPIO46_GPIO MFP_CFG(GPIO46, AF0) |
diff --git a/include/asm-arm/arch-pxa/mfp-pxa3xx.h b/include/asm-arm/arch-pxa/mfp-pxa3xx.h new file mode 100644 index 000000000000..1f6b35c015d0 --- /dev/null +++ b/include/asm-arm/arch-pxa/mfp-pxa3xx.h | |||
@@ -0,0 +1,252 @@ | |||
1 | #ifndef __ASM_ARCH_MFP_PXA3XX_H | ||
2 | #define __ASM_ARCH_MFP_PXA3XX_H | ||
3 | |||
4 | #define MFPR_BASE (0x40e10000) | ||
5 | #define MFPR_SIZE (PAGE_SIZE) | ||
6 | |||
7 | /* MFPR register bit definitions */ | ||
8 | #define MFPR_PULL_SEL (0x1 << 15) | ||
9 | #define MFPR_PULLUP_EN (0x1 << 14) | ||
10 | #define MFPR_PULLDOWN_EN (0x1 << 13) | ||
11 | #define MFPR_SLEEP_SEL (0x1 << 9) | ||
12 | #define MFPR_SLEEP_OE_N (0x1 << 7) | ||
13 | #define MFPR_EDGE_CLEAR (0x1 << 6) | ||
14 | #define MFPR_EDGE_FALL_EN (0x1 << 5) | ||
15 | #define MFPR_EDGE_RISE_EN (0x1 << 4) | ||
16 | |||
17 | #define MFPR_SLEEP_DATA(x) ((x) << 8) | ||
18 | #define MFPR_DRIVE(x) (((x) & 0x7) << 10) | ||
19 | #define MFPR_AF_SEL(x) (((x) & 0x7) << 0) | ||
20 | |||
21 | #define MFPR_EDGE_NONE (0) | ||
22 | #define MFPR_EDGE_RISE (MFPR_EDGE_RISE_EN) | ||
23 | #define MFPR_EDGE_FALL (MFPR_EDGE_FALL_EN) | ||
24 | #define MFPR_EDGE_BOTH (MFPR_EDGE_RISE | MFPR_EDGE_FALL) | ||
25 | |||
26 | /* | ||
27 | * Table that determines the low power modes outputs, with actual settings | ||
28 | * used in parentheses for don't-care values. Except for the float output, | ||
29 | * the configured driven and pulled levels match, so if there is a need for | ||
30 | * non-LPM pulled output, the same configuration could probably be used. | ||
31 | * | ||
32 | * Output value sleep_oe_n sleep_data pullup_en pulldown_en pull_sel | ||
33 | * (bit 7) (bit 8) (bit 14) (bit 13) (bit 15) | ||
34 | * | ||
35 | * Input 0 X(0) X(0) X(0) 0 | ||
36 | * Drive 0 0 0 0 X(1) 0 | ||
37 | * Drive 1 0 1 X(1) 0 0 | ||
38 | * Pull hi (1) 1 X(1) 1 0 0 | ||
39 | * Pull lo (0) 1 X(0) 0 1 0 | ||
40 | * Z (float) 1 X(0) 0 0 0 | ||
41 | */ | ||
42 | #define MFPR_LPM_INPUT (0) | ||
43 | #define MFPR_LPM_DRIVE_LOW (MFPR_SLEEP_DATA(0) | MFPR_PULLDOWN_EN) | ||
44 | #define MFPR_LPM_DRIVE_HIGH (MFPR_SLEEP_DATA(1) | MFPR_PULLUP_EN) | ||
45 | #define MFPR_LPM_PULL_LOW (MFPR_LPM_DRIVE_LOW | MFPR_SLEEP_OE_N) | ||
46 | #define MFPR_LPM_PULL_HIGH (MFPR_LPM_DRIVE_HIGH | MFPR_SLEEP_OE_N) | ||
47 | #define MFPR_LPM_FLOAT (MFPR_SLEEP_OE_N) | ||
48 | #define MFPR_LPM_MASK (0xe080) | ||
49 | |||
50 | /* | ||
51 | * The pullup and pulldown state of the MFP pin at run mode is by default | ||
52 | * determined by the selected alternate function. In case that some buggy | ||
53 | * devices need to override this default behavior, the definitions below | ||
54 | * indicates the setting of corresponding MFPR bits | ||
55 | * | ||
56 | * Definition pull_sel pullup_en pulldown_en | ||
57 | * MFPR_PULL_NONE 0 0 0 | ||
58 | * MFPR_PULL_LOW 1 0 1 | ||
59 | * MFPR_PULL_HIGH 1 1 0 | ||
60 | * MFPR_PULL_BOTH 1 1 1 | ||
61 | */ | ||
62 | #define MFPR_PULL_NONE (0) | ||
63 | #define MFPR_PULL_LOW (MFPR_PULL_SEL | MFPR_PULLDOWN_EN) | ||
64 | #define MFPR_PULL_BOTH (MFPR_PULL_LOW | MFPR_PULLUP_EN) | ||
65 | #define MFPR_PULL_HIGH (MFPR_PULL_SEL | MFPR_PULLUP_EN) | ||
66 | |||
67 | /* PXA3xx common MFP configurations - processor specific ones defined | ||
68 | * in mfp-pxa300.h and mfp-pxa320.h | ||
69 | */ | ||
70 | #define GPIO0_GPIO MFP_CFG(GPIO0, AF0) | ||
71 | #define GPIO1_GPIO MFP_CFG(GPIO1, AF0) | ||
72 | #define GPIO2_GPIO MFP_CFG(GPIO2, AF0) | ||
73 | #define GPIO3_GPIO MFP_CFG(GPIO3, AF0) | ||
74 | #define GPIO4_GPIO MFP_CFG(GPIO4, AF0) | ||
75 | #define GPIO5_GPIO MFP_CFG(GPIO5, AF0) | ||
76 | #define GPIO6_GPIO MFP_CFG(GPIO6, AF0) | ||
77 | #define GPIO7_GPIO MFP_CFG(GPIO7, AF0) | ||
78 | #define GPIO8_GPIO MFP_CFG(GPIO8, AF0) | ||
79 | #define GPIO9_GPIO MFP_CFG(GPIO9, AF0) | ||
80 | #define GPIO10_GPIO MFP_CFG(GPIO10, AF0) | ||
81 | #define GPIO11_GPIO MFP_CFG(GPIO11, AF0) | ||
82 | #define GPIO12_GPIO MFP_CFG(GPIO12, AF0) | ||
83 | #define GPIO13_GPIO MFP_CFG(GPIO13, AF0) | ||
84 | #define GPIO14_GPIO MFP_CFG(GPIO14, AF0) | ||
85 | #define GPIO15_GPIO MFP_CFG(GPIO15, AF0) | ||
86 | #define GPIO16_GPIO MFP_CFG(GPIO16, AF0) | ||
87 | #define GPIO17_GPIO MFP_CFG(GPIO17, AF0) | ||
88 | #define GPIO18_GPIO MFP_CFG(GPIO18, AF0) | ||
89 | #define GPIO19_GPIO MFP_CFG(GPIO19, AF0) | ||
90 | #define GPIO20_GPIO MFP_CFG(GPIO20, AF0) | ||
91 | #define GPIO21_GPIO MFP_CFG(GPIO21, AF0) | ||
92 | #define GPIO22_GPIO MFP_CFG(GPIO22, AF0) | ||
93 | #define GPIO23_GPIO MFP_CFG(GPIO23, AF0) | ||
94 | #define GPIO24_GPIO MFP_CFG(GPIO24, AF0) | ||
95 | #define GPIO25_GPIO MFP_CFG(GPIO25, AF0) | ||
96 | #define GPIO26_GPIO MFP_CFG(GPIO26, AF0) | ||
97 | #define GPIO27_GPIO MFP_CFG(GPIO27, AF0) | ||
98 | #define GPIO28_GPIO MFP_CFG(GPIO28, AF0) | ||
99 | #define GPIO29_GPIO MFP_CFG(GPIO29, AF0) | ||
100 | #define GPIO30_GPIO MFP_CFG(GPIO30, AF0) | ||
101 | #define GPIO31_GPIO MFP_CFG(GPIO31, AF0) | ||
102 | #define GPIO32_GPIO MFP_CFG(GPIO32, AF0) | ||
103 | #define GPIO33_GPIO MFP_CFG(GPIO33, AF0) | ||
104 | #define GPIO34_GPIO MFP_CFG(GPIO34, AF0) | ||
105 | #define GPIO35_GPIO MFP_CFG(GPIO35, AF0) | ||
106 | #define GPIO36_GPIO MFP_CFG(GPIO36, AF0) | ||
107 | #define GPIO37_GPIO MFP_CFG(GPIO37, AF0) | ||
108 | #define GPIO38_GPIO MFP_CFG(GPIO38, AF0) | ||
109 | #define GPIO39_GPIO MFP_CFG(GPIO39, AF0) | ||
110 | #define GPIO40_GPIO MFP_CFG(GPIO40, AF0) | ||
111 | #define GPIO41_GPIO MFP_CFG(GPIO41, AF0) | ||
112 | #define GPIO42_GPIO MFP_CFG(GPIO42, AF0) | ||
113 | #define GPIO43_GPIO MFP_CFG(GPIO43, AF0) | ||
114 | #define GPIO44_GPIO MFP_CFG(GPIO44, AF0) | ||
115 | #define GPIO45_GPIO MFP_CFG(GPIO45, AF0) | ||
116 | |||
117 | #define GPIO47_GPIO MFP_CFG(GPIO47, AF0) | ||
118 | #define GPIO48_GPIO MFP_CFG(GPIO48, AF0) | ||
119 | |||
120 | #define GPIO53_GPIO MFP_CFG(GPIO53, AF0) | ||
121 | #define GPIO54_GPIO MFP_CFG(GPIO54, AF0) | ||
122 | #define GPIO55_GPIO MFP_CFG(GPIO55, AF0) | ||
123 | |||
124 | #define GPIO57_GPIO MFP_CFG(GPIO57, AF0) | ||
125 | |||
126 | #define GPIO63_GPIO MFP_CFG(GPIO63, AF0) | ||
127 | #define GPIO64_GPIO MFP_CFG(GPIO64, AF0) | ||
128 | #define GPIO65_GPIO MFP_CFG(GPIO65, AF0) | ||
129 | #define GPIO66_GPIO MFP_CFG(GPIO66, AF0) | ||
130 | #define GPIO67_GPIO MFP_CFG(GPIO67, AF0) | ||
131 | #define GPIO68_GPIO MFP_CFG(GPIO68, AF0) | ||
132 | #define GPIO69_GPIO MFP_CFG(GPIO69, AF0) | ||
133 | #define GPIO70_GPIO MFP_CFG(GPIO70, AF0) | ||
134 | #define GPIO71_GPIO MFP_CFG(GPIO71, AF0) | ||
135 | #define GPIO72_GPIO MFP_CFG(GPIO72, AF0) | ||
136 | #define GPIO73_GPIO MFP_CFG(GPIO73, AF0) | ||
137 | #define GPIO74_GPIO MFP_CFG(GPIO74, AF0) | ||
138 | #define GPIO75_GPIO MFP_CFG(GPIO75, AF0) | ||
139 | #define GPIO76_GPIO MFP_CFG(GPIO76, AF0) | ||
140 | #define GPIO77_GPIO MFP_CFG(GPIO77, AF0) | ||
141 | #define GPIO78_GPIO MFP_CFG(GPIO78, AF0) | ||
142 | #define GPIO79_GPIO MFP_CFG(GPIO79, AF0) | ||
143 | #define GPIO80_GPIO MFP_CFG(GPIO80, AF0) | ||
144 | #define GPIO81_GPIO MFP_CFG(GPIO81, AF0) | ||
145 | #define GPIO82_GPIO MFP_CFG(GPIO82, AF0) | ||
146 | #define GPIO83_GPIO MFP_CFG(GPIO83, AF0) | ||
147 | #define GPIO84_GPIO MFP_CFG(GPIO84, AF0) | ||
148 | #define GPIO85_GPIO MFP_CFG(GPIO85, AF0) | ||
149 | #define GPIO86_GPIO MFP_CFG(GPIO86, AF0) | ||
150 | #define GPIO87_GPIO MFP_CFG(GPIO87, AF0) | ||
151 | #define GPIO88_GPIO MFP_CFG(GPIO88, AF0) | ||
152 | #define GPIO89_GPIO MFP_CFG(GPIO89, AF0) | ||
153 | #define GPIO90_GPIO MFP_CFG(GPIO90, AF0) | ||
154 | #define GPIO91_GPIO MFP_CFG(GPIO91, AF0) | ||
155 | #define GPIO92_GPIO MFP_CFG(GPIO92, AF0) | ||
156 | #define GPIO93_GPIO MFP_CFG(GPIO93, AF0) | ||
157 | #define GPIO94_GPIO MFP_CFG(GPIO94, AF0) | ||
158 | #define GPIO95_GPIO MFP_CFG(GPIO95, AF0) | ||
159 | #define GPIO96_GPIO MFP_CFG(GPIO96, AF0) | ||
160 | #define GPIO97_GPIO MFP_CFG(GPIO97, AF0) | ||
161 | #define GPIO98_GPIO MFP_CFG(GPIO98, AF0) | ||
162 | #define GPIO99_GPIO MFP_CFG(GPIO99, AF0) | ||
163 | #define GPIO100_GPIO MFP_CFG(GPIO100, AF0) | ||
164 | #define GPIO101_GPIO MFP_CFG(GPIO101, AF0) | ||
165 | #define GPIO102_GPIO MFP_CFG(GPIO102, AF0) | ||
166 | #define GPIO103_GPIO MFP_CFG(GPIO103, AF0) | ||
167 | #define GPIO104_GPIO MFP_CFG(GPIO104, AF0) | ||
168 | #define GPIO105_GPIO MFP_CFG(GPIO105, AF0) | ||
169 | #define GPIO106_GPIO MFP_CFG(GPIO106, AF0) | ||
170 | #define GPIO107_GPIO MFP_CFG(GPIO107, AF0) | ||
171 | #define GPIO108_GPIO MFP_CFG(GPIO108, AF0) | ||
172 | #define GPIO109_GPIO MFP_CFG(GPIO109, AF0) | ||
173 | #define GPIO110_GPIO MFP_CFG(GPIO110, AF0) | ||
174 | #define GPIO111_GPIO MFP_CFG(GPIO111, AF0) | ||
175 | #define GPIO112_GPIO MFP_CFG(GPIO112, AF0) | ||
176 | #define GPIO113_GPIO MFP_CFG(GPIO113, AF0) | ||
177 | #define GPIO114_GPIO MFP_CFG(GPIO114, AF0) | ||
178 | #define GPIO115_GPIO MFP_CFG(GPIO115, AF0) | ||
179 | #define GPIO116_GPIO MFP_CFG(GPIO116, AF0) | ||
180 | #define GPIO117_GPIO MFP_CFG(GPIO117, AF0) | ||
181 | #define GPIO118_GPIO MFP_CFG(GPIO118, AF0) | ||
182 | #define GPIO119_GPIO MFP_CFG(GPIO119, AF0) | ||
183 | #define GPIO120_GPIO MFP_CFG(GPIO120, AF0) | ||
184 | #define GPIO121_GPIO MFP_CFG(GPIO121, AF0) | ||
185 | #define GPIO122_GPIO MFP_CFG(GPIO122, AF0) | ||
186 | #define GPIO123_GPIO MFP_CFG(GPIO123, AF0) | ||
187 | #define GPIO124_GPIO MFP_CFG(GPIO124, AF0) | ||
188 | #define GPIO125_GPIO MFP_CFG(GPIO125, AF0) | ||
189 | #define GPIO126_GPIO MFP_CFG(GPIO126, AF0) | ||
190 | #define GPIO127_GPIO MFP_CFG(GPIO127, AF0) | ||
191 | |||
192 | #define GPIO0_2_GPIO MFP_CFG(GPIO0_2, AF0) | ||
193 | #define GPIO1_2_GPIO MFP_CFG(GPIO1_2, AF0) | ||
194 | #define GPIO2_2_GPIO MFP_CFG(GPIO2_2, AF0) | ||
195 | #define GPIO3_2_GPIO MFP_CFG(GPIO3_2, AF0) | ||
196 | #define GPIO4_2_GPIO MFP_CFG(GPIO4_2, AF0) | ||
197 | #define GPIO5_2_GPIO MFP_CFG(GPIO5_2, AF0) | ||
198 | #define GPIO6_2_GPIO MFP_CFG(GPIO6_2, AF0) | ||
199 | |||
200 | /* | ||
201 | * each MFP pin will have a MFPR register, since the offset of the | ||
202 | * register varies between processors, the processor specific code | ||
203 | * should initialize the pin offsets by pxa3xx_mfp_init_addr() | ||
204 | * | ||
205 | * pxa3xx_mfp_init_addr - accepts a table of "pxa3xx_mfp_addr_map" | ||
206 | * structure, which represents a range of MFP pins from "start" to | ||
207 | * "end", with the offset begining at "offset", to define a single | ||
208 | * pin, let "end" = -1 | ||
209 | * | ||
210 | * use | ||
211 | * | ||
212 | * MFP_ADDR_X() to define a range of pins | ||
213 | * MFP_ADDR() to define a single pin | ||
214 | * MFP_ADDR_END to signal the end of pin offset definitions | ||
215 | */ | ||
216 | struct pxa3xx_mfp_addr_map { | ||
217 | unsigned int start; | ||
218 | unsigned int end; | ||
219 | unsigned long offset; | ||
220 | }; | ||
221 | |||
222 | #define MFP_ADDR_X(start, end, offset) \ | ||
223 | { MFP_PIN_##start, MFP_PIN_##end, offset } | ||
224 | |||
225 | #define MFP_ADDR(pin, offset) \ | ||
226 | { MFP_PIN_##pin, -1, offset } | ||
227 | |||
228 | #define MFP_ADDR_END { MFP_PIN_INVALID, 0 } | ||
229 | |||
230 | /* | ||
231 | * pxa3xx_mfp_read()/pxa3xx_mfp_write() - for direct read/write access | ||
232 | * to the MFPR register | ||
233 | */ | ||
234 | unsigned long pxa3xx_mfp_read(int mfp); | ||
235 | void pxa3xx_mfp_write(int mfp, unsigned long mfpr_val); | ||
236 | |||
237 | /* | ||
238 | * pxa3xx_mfp_config - configure the MFPR registers | ||
239 | * | ||
240 | * used by board specific initialization code | ||
241 | */ | ||
242 | void pxa3xx_mfp_config(unsigned long *mfp_cfgs, int num); | ||
243 | |||
244 | /* | ||
245 | * pxa3xx_mfp_init_addr() - initialize the mapping between mfp pin | ||
246 | * index and MFPR register offset | ||
247 | * | ||
248 | * used by processor specific code | ||
249 | */ | ||
250 | void __init pxa3xx_mfp_init_addr(struct pxa3xx_mfp_addr_map *); | ||
251 | void __init pxa3xx_init_mfp(void); | ||
252 | #endif /* __ASM_ARCH_MFP_PXA3XX_H */ | ||
diff --git a/include/asm-arm/arch-pxa/mfp.h b/include/asm-arm/arch-pxa/mfp.h index 03c508d94f0e..02f6157396d3 100644 --- a/include/asm-arm/arch-pxa/mfp.h +++ b/include/asm-arm/arch-pxa/mfp.h | |||
@@ -16,9 +16,6 @@ | |||
16 | #ifndef __ASM_ARCH_MFP_H | 16 | #ifndef __ASM_ARCH_MFP_H |
17 | #define __ASM_ARCH_MFP_H | 17 | #define __ASM_ARCH_MFP_H |
18 | 18 | ||
19 | #define MFPR_BASE (0x40e10000) | ||
20 | #define MFPR_SIZE (PAGE_SIZE) | ||
21 | |||
22 | #define mfp_to_gpio(m) ((m) % 128) | 19 | #define mfp_to_gpio(m) ((m) % 128) |
23 | 20 | ||
24 | /* list of all the configurable MFP pins */ | 21 | /* list of all the configurable MFP pins */ |
@@ -217,114 +214,21 @@ enum { | |||
217 | }; | 214 | }; |
218 | 215 | ||
219 | /* | 216 | /* |
220 | * Table that determines the low power modes outputs, with actual settings | ||
221 | * used in parentheses for don't-care values. Except for the float output, | ||
222 | * the configured driven and pulled levels match, so if there is a need for | ||
223 | * non-LPM pulled output, the same configuration could probably be used. | ||
224 | * | ||
225 | * Output value sleep_oe_n sleep_data pullup_en pulldown_en pull_sel | ||
226 | * (bit 7) (bit 8) (bit 14d) (bit 13d) | ||
227 | * | ||
228 | * Drive 0 0 0 0 X (1) 0 | ||
229 | * Drive 1 0 1 X (1) 0 0 | ||
230 | * Pull hi (1) 1 X(1) 1 0 0 | ||
231 | * Pull lo (0) 1 X(0) 0 1 0 | ||
232 | * Z (float) 1 X(0) 0 0 0 | ||
233 | */ | ||
234 | #define MFP_LPM_DRIVE_LOW 0x8 | ||
235 | #define MFP_LPM_DRIVE_HIGH 0x6 | ||
236 | #define MFP_LPM_PULL_HIGH 0x7 | ||
237 | #define MFP_LPM_PULL_LOW 0x9 | ||
238 | #define MFP_LPM_FLOAT 0x1 | ||
239 | #define MFP_LPM_PULL_NEITHER 0x0 | ||
240 | |||
241 | /* | ||
242 | * The pullup and pulldown state of the MFP pin is by default determined by | ||
243 | * selected alternate function. In case some buggy devices need to override | ||
244 | * this default behavior, pxa3xx_mfp_set_pull() can be invoked with one of | ||
245 | * the following definition as the parameter. | ||
246 | * | ||
247 | * Definition pull_sel pullup_en pulldown_en | ||
248 | * MFP_PULL_HIGH 1 1 0 | ||
249 | * MFP_PULL_LOW 1 0 1 | ||
250 | * MFP_PULL_BOTH 1 1 1 | ||
251 | * MFP_PULL_NONE 1 0 0 | ||
252 | * MFP_PULL_DEFAULT 0 X X | ||
253 | * | ||
254 | * NOTE: pxa3xx_mfp_set_pull() will modify the PULLUP_EN and PULLDOWN_EN | ||
255 | * bits, which will cause potential conflicts with the low power mode | ||
256 | * setting, device drivers should take care of this | ||
257 | */ | ||
258 | #define MFP_PULL_BOTH (0x7u) | ||
259 | #define MFP_PULL_HIGH (0x6u) | ||
260 | #define MFP_PULL_LOW (0x5u) | ||
261 | #define MFP_PULL_NONE (0x4u) | ||
262 | #define MFP_PULL_DEFAULT (0x0u) | ||
263 | |||
264 | #define MFP_AF0 (0) | ||
265 | #define MFP_AF1 (1) | ||
266 | #define MFP_AF2 (2) | ||
267 | #define MFP_AF3 (3) | ||
268 | #define MFP_AF4 (4) | ||
269 | #define MFP_AF5 (5) | ||
270 | #define MFP_AF6 (6) | ||
271 | #define MFP_AF7 (7) | ||
272 | |||
273 | #define MFP_DS01X (0) | ||
274 | #define MFP_DS02X (1) | ||
275 | #define MFP_DS03X (2) | ||
276 | #define MFP_DS04X (3) | ||
277 | #define MFP_DS06X (4) | ||
278 | #define MFP_DS08X (5) | ||
279 | #define MFP_DS10X (6) | ||
280 | #define MFP_DS12X (7) | ||
281 | |||
282 | #define MFP_EDGE_BOTH 0x3 | ||
283 | #define MFP_EDGE_RISE 0x2 | ||
284 | #define MFP_EDGE_FALL 0x1 | ||
285 | #define MFP_EDGE_NONE 0x0 | ||
286 | |||
287 | #define MFPR_AF_MASK 0x0007 | ||
288 | #define MFPR_DRV_MASK 0x1c00 | ||
289 | #define MFPR_RDH_MASK 0x0200 | ||
290 | #define MFPR_LPM_MASK 0xe180 | ||
291 | #define MFPR_PULL_MASK 0xe000 | ||
292 | #define MFPR_EDGE_MASK 0x0070 | ||
293 | |||
294 | #define MFPR_ALT_OFFSET 0 | ||
295 | #define MFPR_ERE_OFFSET 4 | ||
296 | #define MFPR_EFE_OFFSET 5 | ||
297 | #define MFPR_EC_OFFSET 6 | ||
298 | #define MFPR_SON_OFFSET 7 | ||
299 | #define MFPR_SD_OFFSET 8 | ||
300 | #define MFPR_SS_OFFSET 9 | ||
301 | #define MFPR_DRV_OFFSET 10 | ||
302 | #define MFPR_PD_OFFSET 13 | ||
303 | #define MFPR_PU_OFFSET 14 | ||
304 | #define MFPR_PS_OFFSET 15 | ||
305 | |||
306 | #define MFPR(af, drv, rdh, lpm, edge) \ | ||
307 | (((af) & 0x7) | (((drv) & 0x7) << 10) |\ | ||
308 | (((rdh) & 0x1) << 9) |\ | ||
309 | (((lpm) & 0x3) << 7) |\ | ||
310 | (((lpm) & 0x4) << 12)|\ | ||
311 | (((lpm) & 0x8) << 10)|\ | ||
312 | ((!(edge)) << 6) |\ | ||
313 | (((edge) & 0x1) << 5) |\ | ||
314 | (((edge) & 0x2) << 3)) | ||
315 | |||
316 | /* | ||
317 | * a possible MFP configuration is represented by a 32-bit integer | 217 | * a possible MFP configuration is represented by a 32-bit integer |
318 | * bit 0..15 - MFPR value (16-bit) | 218 | * |
319 | * bit 16..31 - mfp pin index (used to obtain the MFPR offset) | 219 | * bit 0.. 9 - MFP Pin Number (1024 Pins Maximum) |
220 | * bit 10..12 - Alternate Function Selection | ||
221 | * bit 13..15 - Drive Strength | ||
222 | * bit 16..18 - Low Power Mode State | ||
223 | * bit 19..20 - Low Power Mode Edge Detection | ||
224 | * bit 21..22 - Run Mode Pull State | ||
320 | * | 225 | * |
321 | * to facilitate the definition, the following macros are provided | 226 | * to facilitate the definition, the following macros are provided |
322 | * | 227 | * |
323 | * MFPR_DEFAULT - default MFPR value, with | 228 | * MFP_CFG_DEFAULT - default MFP configuration value, with |
324 | * alternate function = 0, | 229 | * alternate function = 0, |
325 | * drive strength = fast 1mA (MFP_DS01X) | 230 | * drive strength = fast 3mA (MFP_DS03X) |
326 | * low power mode = default | 231 | * low power mode = default |
327 | * release dalay hold = false (RDH bit) | ||
328 | * edge detection = none | 232 | * edge detection = none |
329 | * | 233 | * |
330 | * MFP_CFG - default MFPR value with alternate function | 234 | * MFP_CFG - default MFPR value with alternate function |
@@ -334,251 +238,74 @@ enum { | |||
334 | * low power mode | 238 | * low power mode |
335 | * MFP_CFG_X - default MFPR value with alternate function, | 239 | * MFP_CFG_X - default MFPR value with alternate function, |
336 | * pin drive strength and low power mode | 240 | * pin drive strength and low power mode |
337 | * | ||
338 | * use | ||
339 | * | ||
340 | * MFP_CFG_PIN - to get the MFP pin index | ||
341 | * MFP_CFG_VAL - to get the corresponding MFPR value | ||
342 | */ | 241 | */ |
343 | 242 | ||
344 | typedef uint32_t mfp_cfg_t; | 243 | typedef unsigned long mfp_cfg_t; |
345 | 244 | ||
346 | #define MFP_CFG_PIN(mfp_cfg) (((mfp_cfg) >> 16) & 0xffff) | 245 | #define MFP_PIN(x) ((x) & 0x3ff) |
347 | #define MFP_CFG_VAL(mfp_cfg) ((mfp_cfg) & 0xffff) | 246 | |
348 | 247 | #define MFP_AF0 (0x0 << 10) | |
349 | /* | 248 | #define MFP_AF1 (0x1 << 10) |
350 | * MFP register defaults to | 249 | #define MFP_AF2 (0x2 << 10) |
351 | * drive strength fast 3mA (010'b) | 250 | #define MFP_AF3 (0x3 << 10) |
352 | * edge detection logic disabled | 251 | #define MFP_AF4 (0x4 << 10) |
353 | * alternate function 0 | 252 | #define MFP_AF5 (0x5 << 10) |
354 | */ | 253 | #define MFP_AF6 (0x6 << 10) |
355 | #define MFPR_DEFAULT (0x0840) | 254 | #define MFP_AF7 (0x7 << 10) |
255 | #define MFP_AF_MASK (0x7 << 10) | ||
256 | #define MFP_AF(x) (((x) >> 10) & 0x7) | ||
257 | |||
258 | #define MFP_DS01X (0x0 << 13) | ||
259 | #define MFP_DS02X (0x1 << 13) | ||
260 | #define MFP_DS03X (0x2 << 13) | ||
261 | #define MFP_DS04X (0x3 << 13) | ||
262 | #define MFP_DS06X (0x4 << 13) | ||
263 | #define MFP_DS08X (0x5 << 13) | ||
264 | #define MFP_DS10X (0x6 << 13) | ||
265 | #define MFP_DS13X (0x7 << 13) | ||
266 | #define MFP_DS_MASK (0x7 << 13) | ||
267 | #define MFP_DS(x) (((x) >> 13) & 0x7) | ||
268 | |||
269 | #define MFP_LPM_INPUT (0x0 << 16) | ||
270 | #define MFP_LPM_DRIVE_LOW (0x1 << 16) | ||
271 | #define MFP_LPM_DRIVE_HIGH (0x2 << 16) | ||
272 | #define MFP_LPM_PULL_LOW (0x3 << 16) | ||
273 | #define MFP_LPM_PULL_HIGH (0x4 << 16) | ||
274 | #define MFP_LPM_FLOAT (0x5 << 16) | ||
275 | #define MFP_LPM_STATE_MASK (0x7 << 16) | ||
276 | #define MFP_LPM_STATE(x) (((x) >> 16) & 0x7) | ||
277 | |||
278 | #define MFP_LPM_EDGE_NONE (0x0 << 19) | ||
279 | #define MFP_LPM_EDGE_RISE (0x1 << 19) | ||
280 | #define MFP_LPM_EDGE_FALL (0x2 << 19) | ||
281 | #define MFP_LPM_EDGE_BOTH (0x3 << 19) | ||
282 | #define MFP_LPM_EDGE_MASK (0x3 << 19) | ||
283 | #define MFP_LPM_EDGE(x) (((x) >> 19) & 0x3) | ||
284 | |||
285 | #define MFP_PULL_NONE (0x0 << 21) | ||
286 | #define MFP_PULL_LOW (0x1 << 21) | ||
287 | #define MFP_PULL_HIGH (0x2 << 21) | ||
288 | #define MFP_PULL_BOTH (0x3 << 21) | ||
289 | #define MFP_PULL_MASK (0x3 << 21) | ||
290 | #define MFP_PULL(x) (((x) >> 21) & 0x3) | ||
291 | |||
292 | #define MFP_CFG_DEFAULT (MFP_AF0 | MFP_DS03X | MFP_LPM_INPUT |\ | ||
293 | MFP_LPM_EDGE_NONE | MFP_PULL_NONE) | ||
356 | 294 | ||
357 | #define MFP_CFG(pin, af) \ | 295 | #define MFP_CFG(pin, af) \ |
358 | ((MFP_PIN_##pin << 16) | MFPR_DEFAULT | (MFP_##af)) | 296 | ((MFP_CFG_DEFAULT & ~MFP_AF_MASK) |\ |
297 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af)) | ||
359 | 298 | ||
360 | #define MFP_CFG_DRV(pin, af, drv) \ | 299 | #define MFP_CFG_DRV(pin, af, drv) \ |
361 | ((MFP_PIN_##pin << 16) | (MFPR_DEFAULT & ~MFPR_DRV_MASK) |\ | 300 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK)) |\ |
362 | ((MFP_##drv) << 10) | (MFP_##af)) | 301 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv)) |
363 | 302 | ||
364 | #define MFP_CFG_LPM(pin, af, lpm) \ | 303 | #define MFP_CFG_LPM(pin, af, lpm) \ |
365 | ((MFP_PIN_##pin << 16) | (MFPR_DEFAULT & ~MFPR_LPM_MASK) |\ | 304 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_LPM_STATE_MASK)) |\ |
366 | (((MFP_LPM_##lpm) & 0x3) << 7) |\ | 305 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_LPM_##lpm)) |
367 | (((MFP_LPM_##lpm) & 0x4) << 12) |\ | ||
368 | (((MFP_LPM_##lpm) & 0x8) << 10) |\ | ||
369 | (MFP_##af)) | ||
370 | 306 | ||
371 | #define MFP_CFG_X(pin, af, drv, lpm) \ | 307 | #define MFP_CFG_X(pin, af, drv, lpm) \ |
372 | ((MFP_PIN_##pin << 16) |\ | 308 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\ |
373 | (MFPR_DEFAULT & ~(MFPR_DRV_MASK | MFPR_LPM_MASK)) |\ | 309 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm)) |
374 | ((MFP_##drv) << 10) | (MFP_##af) |\ | ||
375 | (((MFP_LPM_##lpm) & 0x3) << 7) |\ | ||
376 | (((MFP_LPM_##lpm) & 0x4) << 12) |\ | ||
377 | (((MFP_LPM_##lpm) & 0x8) << 10)) | ||
378 | |||
379 | /* common MFP configurations - processor specific ones defined | ||
380 | * in mfp-pxa3xx.h | ||
381 | */ | ||
382 | #define GPIO0_GPIO MFP_CFG(GPIO0, AF0) | ||
383 | #define GPIO1_GPIO MFP_CFG(GPIO1, AF0) | ||
384 | #define GPIO2_GPIO MFP_CFG(GPIO2, AF0) | ||
385 | #define GPIO3_GPIO MFP_CFG(GPIO3, AF0) | ||
386 | #define GPIO4_GPIO MFP_CFG(GPIO4, AF0) | ||
387 | #define GPIO5_GPIO MFP_CFG(GPIO5, AF0) | ||
388 | #define GPIO6_GPIO MFP_CFG(GPIO6, AF0) | ||
389 | #define GPIO7_GPIO MFP_CFG(GPIO7, AF0) | ||
390 | #define GPIO8_GPIO MFP_CFG(GPIO8, AF0) | ||
391 | #define GPIO9_GPIO MFP_CFG(GPIO9, AF0) | ||
392 | #define GPIO10_GPIO MFP_CFG(GPIO10, AF0) | ||
393 | #define GPIO11_GPIO MFP_CFG(GPIO11, AF0) | ||
394 | #define GPIO12_GPIO MFP_CFG(GPIO12, AF0) | ||
395 | #define GPIO13_GPIO MFP_CFG(GPIO13, AF0) | ||
396 | #define GPIO14_GPIO MFP_CFG(GPIO14, AF0) | ||
397 | #define GPIO15_GPIO MFP_CFG(GPIO15, AF0) | ||
398 | #define GPIO16_GPIO MFP_CFG(GPIO16, AF0) | ||
399 | #define GPIO17_GPIO MFP_CFG(GPIO17, AF0) | ||
400 | #define GPIO18_GPIO MFP_CFG(GPIO18, AF0) | ||
401 | #define GPIO19_GPIO MFP_CFG(GPIO19, AF0) | ||
402 | #define GPIO20_GPIO MFP_CFG(GPIO20, AF0) | ||
403 | #define GPIO21_GPIO MFP_CFG(GPIO21, AF0) | ||
404 | #define GPIO22_GPIO MFP_CFG(GPIO22, AF0) | ||
405 | #define GPIO23_GPIO MFP_CFG(GPIO23, AF0) | ||
406 | #define GPIO24_GPIO MFP_CFG(GPIO24, AF0) | ||
407 | #define GPIO25_GPIO MFP_CFG(GPIO25, AF0) | ||
408 | #define GPIO26_GPIO MFP_CFG(GPIO26, AF0) | ||
409 | #define GPIO27_GPIO MFP_CFG(GPIO27, AF0) | ||
410 | #define GPIO28_GPIO MFP_CFG(GPIO28, AF0) | ||
411 | #define GPIO29_GPIO MFP_CFG(GPIO29, AF0) | ||
412 | #define GPIO30_GPIO MFP_CFG(GPIO30, AF0) | ||
413 | #define GPIO31_GPIO MFP_CFG(GPIO31, AF0) | ||
414 | #define GPIO32_GPIO MFP_CFG(GPIO32, AF0) | ||
415 | #define GPIO33_GPIO MFP_CFG(GPIO33, AF0) | ||
416 | #define GPIO34_GPIO MFP_CFG(GPIO34, AF0) | ||
417 | #define GPIO35_GPIO MFP_CFG(GPIO35, AF0) | ||
418 | #define GPIO36_GPIO MFP_CFG(GPIO36, AF0) | ||
419 | #define GPIO37_GPIO MFP_CFG(GPIO37, AF0) | ||
420 | #define GPIO38_GPIO MFP_CFG(GPIO38, AF0) | ||
421 | #define GPIO39_GPIO MFP_CFG(GPIO39, AF0) | ||
422 | #define GPIO40_GPIO MFP_CFG(GPIO40, AF0) | ||
423 | #define GPIO41_GPIO MFP_CFG(GPIO41, AF0) | ||
424 | #define GPIO42_GPIO MFP_CFG(GPIO42, AF0) | ||
425 | #define GPIO43_GPIO MFP_CFG(GPIO43, AF0) | ||
426 | #define GPIO44_GPIO MFP_CFG(GPIO44, AF0) | ||
427 | #define GPIO45_GPIO MFP_CFG(GPIO45, AF0) | ||
428 | |||
429 | #define GPIO47_GPIO MFP_CFG(GPIO47, AF0) | ||
430 | #define GPIO48_GPIO MFP_CFG(GPIO48, AF0) | ||
431 | |||
432 | #define GPIO53_GPIO MFP_CFG(GPIO53, AF0) | ||
433 | #define GPIO54_GPIO MFP_CFG(GPIO54, AF0) | ||
434 | #define GPIO55_GPIO MFP_CFG(GPIO55, AF0) | ||
435 | |||
436 | #define GPIO57_GPIO MFP_CFG(GPIO57, AF0) | ||
437 | |||
438 | #define GPIO63_GPIO MFP_CFG(GPIO63, AF0) | ||
439 | #define GPIO64_GPIO MFP_CFG(GPIO64, AF0) | ||
440 | #define GPIO65_GPIO MFP_CFG(GPIO65, AF0) | ||
441 | #define GPIO66_GPIO MFP_CFG(GPIO66, AF0) | ||
442 | #define GPIO67_GPIO MFP_CFG(GPIO67, AF0) | ||
443 | #define GPIO68_GPIO MFP_CFG(GPIO68, AF0) | ||
444 | #define GPIO69_GPIO MFP_CFG(GPIO69, AF0) | ||
445 | #define GPIO70_GPIO MFP_CFG(GPIO70, AF0) | ||
446 | #define GPIO71_GPIO MFP_CFG(GPIO71, AF0) | ||
447 | #define GPIO72_GPIO MFP_CFG(GPIO72, AF0) | ||
448 | #define GPIO73_GPIO MFP_CFG(GPIO73, AF0) | ||
449 | #define GPIO74_GPIO MFP_CFG(GPIO74, AF0) | ||
450 | #define GPIO75_GPIO MFP_CFG(GPIO75, AF0) | ||
451 | #define GPIO76_GPIO MFP_CFG(GPIO76, AF0) | ||
452 | #define GPIO77_GPIO MFP_CFG(GPIO77, AF0) | ||
453 | #define GPIO78_GPIO MFP_CFG(GPIO78, AF0) | ||
454 | #define GPIO79_GPIO MFP_CFG(GPIO79, AF0) | ||
455 | #define GPIO80_GPIO MFP_CFG(GPIO80, AF0) | ||
456 | #define GPIO81_GPIO MFP_CFG(GPIO81, AF0) | ||
457 | #define GPIO82_GPIO MFP_CFG(GPIO82, AF0) | ||
458 | #define GPIO83_GPIO MFP_CFG(GPIO83, AF0) | ||
459 | #define GPIO84_GPIO MFP_CFG(GPIO84, AF0) | ||
460 | #define GPIO85_GPIO MFP_CFG(GPIO85, AF0) | ||
461 | #define GPIO86_GPIO MFP_CFG(GPIO86, AF0) | ||
462 | #define GPIO87_GPIO MFP_CFG(GPIO87, AF0) | ||
463 | #define GPIO88_GPIO MFP_CFG(GPIO88, AF0) | ||
464 | #define GPIO89_GPIO MFP_CFG(GPIO89, AF0) | ||
465 | #define GPIO90_GPIO MFP_CFG(GPIO90, AF0) | ||
466 | #define GPIO91_GPIO MFP_CFG(GPIO91, AF0) | ||
467 | #define GPIO92_GPIO MFP_CFG(GPIO92, AF0) | ||
468 | #define GPIO93_GPIO MFP_CFG(GPIO93, AF0) | ||
469 | #define GPIO94_GPIO MFP_CFG(GPIO94, AF0) | ||
470 | #define GPIO95_GPIO MFP_CFG(GPIO95, AF0) | ||
471 | #define GPIO96_GPIO MFP_CFG(GPIO96, AF0) | ||
472 | #define GPIO97_GPIO MFP_CFG(GPIO97, AF0) | ||
473 | #define GPIO98_GPIO MFP_CFG(GPIO98, AF0) | ||
474 | #define GPIO99_GPIO MFP_CFG(GPIO99, AF0) | ||
475 | #define GPIO100_GPIO MFP_CFG(GPIO100, AF0) | ||
476 | #define GPIO101_GPIO MFP_CFG(GPIO101, AF0) | ||
477 | #define GPIO102_GPIO MFP_CFG(GPIO102, AF0) | ||
478 | #define GPIO103_GPIO MFP_CFG(GPIO103, AF0) | ||
479 | #define GPIO104_GPIO MFP_CFG(GPIO104, AF0) | ||
480 | #define GPIO105_GPIO MFP_CFG(GPIO105, AF0) | ||
481 | #define GPIO106_GPIO MFP_CFG(GPIO106, AF0) | ||
482 | #define GPIO107_GPIO MFP_CFG(GPIO107, AF0) | ||
483 | #define GPIO108_GPIO MFP_CFG(GPIO108, AF0) | ||
484 | #define GPIO109_GPIO MFP_CFG(GPIO109, AF0) | ||
485 | #define GPIO110_GPIO MFP_CFG(GPIO110, AF0) | ||
486 | #define GPIO111_GPIO MFP_CFG(GPIO111, AF0) | ||
487 | #define GPIO112_GPIO MFP_CFG(GPIO112, AF0) | ||
488 | #define GPIO113_GPIO MFP_CFG(GPIO113, AF0) | ||
489 | #define GPIO114_GPIO MFP_CFG(GPIO114, AF0) | ||
490 | #define GPIO115_GPIO MFP_CFG(GPIO115, AF0) | ||
491 | #define GPIO116_GPIO MFP_CFG(GPIO116, AF0) | ||
492 | #define GPIO117_GPIO MFP_CFG(GPIO117, AF0) | ||
493 | #define GPIO118_GPIO MFP_CFG(GPIO118, AF0) | ||
494 | #define GPIO119_GPIO MFP_CFG(GPIO119, AF0) | ||
495 | #define GPIO120_GPIO MFP_CFG(GPIO120, AF0) | ||
496 | #define GPIO121_GPIO MFP_CFG(GPIO121, AF0) | ||
497 | #define GPIO122_GPIO MFP_CFG(GPIO122, AF0) | ||
498 | #define GPIO123_GPIO MFP_CFG(GPIO123, AF0) | ||
499 | #define GPIO124_GPIO MFP_CFG(GPIO124, AF0) | ||
500 | #define GPIO125_GPIO MFP_CFG(GPIO125, AF0) | ||
501 | #define GPIO126_GPIO MFP_CFG(GPIO126, AF0) | ||
502 | #define GPIO127_GPIO MFP_CFG(GPIO127, AF0) | ||
503 | |||
504 | #define GPIO0_2_GPIO MFP_CFG(GPIO0_2, AF0) | ||
505 | #define GPIO1_2_GPIO MFP_CFG(GPIO1_2, AF0) | ||
506 | #define GPIO2_2_GPIO MFP_CFG(GPIO2_2, AF0) | ||
507 | #define GPIO3_2_GPIO MFP_CFG(GPIO3_2, AF0) | ||
508 | #define GPIO4_2_GPIO MFP_CFG(GPIO4_2, AF0) | ||
509 | #define GPIO5_2_GPIO MFP_CFG(GPIO5_2, AF0) | ||
510 | #define GPIO6_2_GPIO MFP_CFG(GPIO6_2, AF0) | ||
511 | |||
512 | /* | ||
513 | * each MFP pin will have a MFPR register, since the offset of the | ||
514 | * register varies between processors, the processor specific code | ||
515 | * should initialize the pin offsets by pxa3xx_mfp_init_addr() | ||
516 | * | ||
517 | * pxa3xx_mfp_init_addr - accepts a table of "pxa3xx_mfp_addr_map" | ||
518 | * structure, which represents a range of MFP pins from "start" to | ||
519 | * "end", with the offset begining at "offset", to define a single | ||
520 | * pin, let "end" = -1 | ||
521 | * | ||
522 | * use | ||
523 | * | ||
524 | * MFP_ADDR_X() to define a range of pins | ||
525 | * MFP_ADDR() to define a single pin | ||
526 | * MFP_ADDR_END to signal the end of pin offset definitions | ||
527 | */ | ||
528 | struct pxa3xx_mfp_addr_map { | ||
529 | unsigned int start; | ||
530 | unsigned int end; | ||
531 | unsigned long offset; | ||
532 | }; | ||
533 | |||
534 | #define MFP_ADDR_X(start, end, offset) \ | ||
535 | { MFP_PIN_##start, MFP_PIN_##end, offset } | ||
536 | |||
537 | #define MFP_ADDR(pin, offset) \ | ||
538 | { MFP_PIN_##pin, -1, offset } | ||
539 | |||
540 | #define MFP_ADDR_END { MFP_PIN_INVALID, 0 } | ||
541 | |||
542 | struct pxa3xx_mfp_pin { | ||
543 | unsigned long mfpr_off; /* MFPRxx register offset */ | ||
544 | unsigned long mfpr_val; /* MFPRxx register value */ | ||
545 | }; | ||
546 | |||
547 | /* | ||
548 | * pxa3xx_mfp_read()/pxa3xx_mfp_write() - for direct read/write access | ||
549 | * to the MFPR register | ||
550 | */ | ||
551 | unsigned long pxa3xx_mfp_read(int mfp); | ||
552 | void pxa3xx_mfp_write(int mfp, unsigned long mfpr_val); | ||
553 | |||
554 | /* | ||
555 | * pxa3xx_mfp_set_afds - set MFP alternate function and drive strength | ||
556 | * pxa3xx_mfp_set_rdh - set MFP release delay hold on/off | ||
557 | * pxa3xx_mfp_set_lpm - set MFP low power mode state | ||
558 | * pxa3xx_mfp_set_edge - set MFP edge detection in low power mode | ||
559 | * | ||
560 | * use these functions to override/change the default configuration | ||
561 | * done by pxa3xx_mfp_set_config(s) | ||
562 | */ | ||
563 | void pxa3xx_mfp_set_afds(int mfp, int af, int ds); | ||
564 | void pxa3xx_mfp_set_rdh(int mfp, int rdh); | ||
565 | void pxa3xx_mfp_set_lpm(int mfp, int lpm); | ||
566 | void pxa3xx_mfp_set_edge(int mfp, int edge); | ||
567 | |||
568 | /* | ||
569 | * pxa3xx_mfp_config - configure the MFPR registers | ||
570 | * | ||
571 | * used by board specific initialization code | ||
572 | */ | ||
573 | void pxa3xx_mfp_config(mfp_cfg_t *mfp_cfgs, int num); | ||
574 | |||
575 | /* | ||
576 | * pxa3xx_mfp_init_addr() - initialize the mapping between mfp pin | ||
577 | * index and MFPR register offset | ||
578 | * | ||
579 | * used by processor specific code | ||
580 | */ | ||
581 | void __init pxa3xx_mfp_init_addr(struct pxa3xx_mfp_addr_map *); | ||
582 | void __init pxa3xx_init_mfp(void); | ||
583 | 310 | ||
584 | #endif /* __ASM_ARCH_MFP_H */ | 311 | #endif /* __ASM_ARCH_MFP_H */ |
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index ef4f570381d1..6d1304c9270f 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h | |||
@@ -17,5 +17,7 @@ struct pxamci_platform_data { | |||
17 | }; | 17 | }; |
18 | 18 | ||
19 | extern void pxa_set_mci_info(struct pxamci_platform_data *info); | 19 | extern void pxa_set_mci_info(struct pxamci_platform_data *info); |
20 | extern void pxa3xx_set_mci2_info(struct pxamci_platform_data *info); | ||
21 | extern void pxa3xx_set_mci3_info(struct pxamci_platform_data *info); | ||
20 | 22 | ||
21 | #endif | 23 | #endif |
diff --git a/include/asm-arm/arch-pxa/pcm027.h b/include/asm-arm/arch-pxa/pcm027.h new file mode 100644 index 000000000000..7beae1472c3e --- /dev/null +++ b/include/asm-arm/arch-pxa/pcm027.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-pxa/pcm027.h | ||
3 | * | ||
4 | * (c) 2003 Phytec Messtechnik GmbH <armlinux@phytec.de> | ||
5 | * (c) 2007 Juergen Beisert <j.beisert@pengutronix.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | * Definitions of CPU card resources only | ||
24 | */ | ||
25 | |||
26 | /* I2C RTC */ | ||
27 | #define PCM027_RTC_IRQ_GPIO 0 | ||
28 | #define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) | ||
29 | #define PCM027_RTC_IRQ_EDGE IRQ_TYPE_EDGE_FALLING | ||
30 | #define ADR_PCM027_RTC 0x51 /* I2C address */ | ||
31 | |||
32 | /* I2C EEPROM */ | ||
33 | #define ADR_PCM027_EEPROM 0x54 /* I2C address */ | ||
34 | |||
35 | /* Ethernet chip (SMSC91C111) */ | ||
36 | #define PCM027_ETH_IRQ_GPIO 52 | ||
37 | #define PCM027_ETH_IRQ IRQ_GPIO(PCM027_ETH_IRQ_GPIO) | ||
38 | #define PCM027_ETH_IRQ_EDGE IRQ_TYPE_EDGE_RISING | ||
39 | #define PCM027_ETH_PHYS PXA_CS5_PHYS | ||
40 | #define PCM027_ETH_SIZE (1*1024*1024) | ||
41 | |||
42 | /* CAN controller SJA1000 (unsupported yet) */ | ||
43 | #define PCM027_CAN_IRQ_GPIO 114 | ||
44 | #define PCM027_CAN_IRQ IRQ_GPIO(PCM027_CAN_IRQ_GPIO) | ||
45 | #define PCM027_CAN_IRQ_EDGE IRQ_TYPE_EDGE_FALLING | ||
46 | #define PCM027_CAN_PHYS 0x22000000 | ||
47 | #define PCM027_CAN_SIZE 0x100 | ||
48 | |||
49 | /* SPI GPIO expander (unsupported yet) */ | ||
50 | #define PCM027_EGPIO_IRQ_GPIO 27 | ||
51 | #define PCM027_EGPIO_IRQ IRQ_GPIO(PCM027_EGPIO_IRQ_GPIO) | ||
52 | #define PCM027_EGPIO_IRQ_EDGE IRQ_TYPE_EDGE_FALLING | ||
53 | #define PCM027_EGPIO_CS 24 | ||
54 | /* | ||
55 | * TODO: Switch this pin from dedicated usage to GPIO if | ||
56 | * more than the MAX7301 device is connected to this SPI bus | ||
57 | */ | ||
58 | #define PCM027_EGPIO_CS_MODE GPIO24_SFRM_MD | ||
59 | |||
60 | /* Flash memory */ | ||
61 | #define PCM027_FLASH_PHYS 0x00000000 | ||
62 | #define PCM027_FLASH_SIZE 0x02000000 | ||
63 | |||
64 | /* onboard LEDs connected to GPIO */ | ||
65 | #define PCM027_LED_CPU 90 | ||
66 | #define PCM027_LED_HEARD_BEAT 91 | ||
67 | |||
68 | /* | ||
69 | * This CPU module needs a baseboard to work. After basic initializing | ||
70 | * its own devices, it calls baseboard's init function. | ||
71 | * TODO: Add your own basebaord init function and call it from | ||
72 | * inside pcm027_init(). This example here is for the developmen board. | ||
73 | * Refer pcm990-baseboard.c | ||
74 | */ | ||
75 | extern void pcm990_baseboard_init(void); | ||
diff --git a/include/asm-arm/arch-pxa/pcm990_baseboard.h b/include/asm-arm/arch-pxa/pcm990_baseboard.h new file mode 100644 index 000000000000..b699d0d7bdb2 --- /dev/null +++ b/include/asm-arm/arch-pxa/pcm990_baseboard.h | |||
@@ -0,0 +1,275 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-pxa/pcm990_baseboard.h | ||
3 | * | ||
4 | * (c) 2003 Phytec Messtechnik GmbH <armlinux@phytec.de> | ||
5 | * (c) 2007 Juergen Beisert <j.beisert@pengutronix.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <asm/arch/pcm027.h> | ||
23 | |||
24 | /* | ||
25 | * definitions relevant only when the PCM-990 | ||
26 | * development base board is in use | ||
27 | */ | ||
28 | |||
29 | /* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */ | ||
30 | #define PCM990_CTRL_INT_IRQ_GPIO 9 | ||
31 | #define PCM990_CTRL_INT_IRQ IRQ_GPIO(PCM990_CTRL_INT_IRQ_GPIO) | ||
32 | #define PCM990_CTRL_INT_IRQ_EDGE IRQT_RISING | ||
33 | #define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */ | ||
34 | #define PCM990_CTRL_BASE 0xea000000 | ||
35 | #define PCM990_CTRL_SIZE (1*1024*1024) | ||
36 | |||
37 | #define PCM990_CTRL_PWR_IRQ_GPIO 14 | ||
38 | #define PCM990_CTRL_PWR_IRQ IRQ_GPIO(PCM990_CTRL_PWR_IRQ_GPIO) | ||
39 | #define PCM990_CTRL_PWR_IRQ_EDGE IRQT_RISING | ||
40 | |||
41 | /* visible CPLD (U7) registers */ | ||
42 | #define PCM990_CTRL_REG0 0x0000 /* RESET REGISTER */ | ||
43 | #define PCM990_CTRL_SYSRES 0x0001 /* System RESET REGISTER */ | ||
44 | #define PCM990_CTRL_RESOUT 0x0002 /* RESETOUT Enable REGISTER */ | ||
45 | #define PCM990_CTRL_RESGPIO 0x0004 /* RESETGPIO Enable REGISTER */ | ||
46 | |||
47 | #define PCM990_CTRL_REG1 0x0002 /* Power REGISTER */ | ||
48 | #define PCM990_CTRL_5VOFF 0x0001 /* Disable 5V Regulators */ | ||
49 | #define PCM990_CTRL_CANPWR 0x0004 /* Enable CANPWR ADUM */ | ||
50 | #define PCM990_CTRL_PM_5V 0x0008 /* Read 5V OK */ | ||
51 | |||
52 | #define PCM990_CTRL_REG2 0x0004 /* LED REGISTER */ | ||
53 | #define PCM990_CTRL_LEDPWR 0x0001 /* POWER LED enable */ | ||
54 | #define PCM990_CTRL_LEDBAS 0x0002 /* BASIS LED enable */ | ||
55 | #define PCM990_CTRL_LEDUSR 0x0004 /* USER LED enable */ | ||
56 | |||
57 | #define PCM990_CTRL_REG3 0x0006 /* LCD CTRL REGISTER 3 */ | ||
58 | #define PCM990_CTRL_LCDPWR 0x0001 /* RW LCD Power on */ | ||
59 | #define PCM990_CTRL_LCDON 0x0002 /* RW LCD Latch on */ | ||
60 | #define PCM990_CTRL_LCDPOS1 0x0004 /* RW POS 1 */ | ||
61 | #define PCM990_CTRL_LCDPOS2 0x0008 /* RW POS 2 */ | ||
62 | |||
63 | #define PCM990_CTRL_REG4 0x0008 /* MMC1 CTRL REGISTER 4 */ | ||
64 | #define PCM990_CTRL_MMC1PWR 0x0001 /* RW MMC1 Power on */ | ||
65 | |||
66 | #define PCM990_CTRL_REG5 0x000A /* MMC2 CTRL REGISTER 5 */ | ||
67 | #define PCM990_CTRL_MMC2PWR 0x0001 /* RW MMC2 Power on */ | ||
68 | #define PCM990_CTRL_MMC2LED 0x0002 /* RW MMC2 LED */ | ||
69 | #define PCM990_CTRL_MMC2DE 0x0004 /* R MMC2 Card detect */ | ||
70 | #define PCM990_CTRL_MMC2WP 0x0008 /* R MMC2 Card write protect */ | ||
71 | |||
72 | #define PCM990_CTRL_REG6 0x000C /* Interrupt Clear REGISTER */ | ||
73 | #define PCM990_CTRL_INTC0 0x0001 /* Clear Reg BT Detect */ | ||
74 | #define PCM990_CTRL_INTC1 0x0002 /* Clear Reg FR RI */ | ||
75 | #define PCM990_CTRL_INTC2 0x0004 /* Clear Reg MMC1 Detect */ | ||
76 | #define PCM990_CTRL_INTC3 0x0008 /* Clear Reg PM_5V off */ | ||
77 | |||
78 | #define PCM990_CTRL_REG7 0x000E /* Interrupt Enable REGISTER */ | ||
79 | #define PCM990_CTRL_ENAINT0 0x0001 /* Enable Int BT Detect */ | ||
80 | #define PCM990_CTRL_ENAINT1 0x0002 /* Enable Int FR RI */ | ||
81 | #define PCM990_CTRL_ENAINT2 0x0004 /* Enable Int MMC1 Detect */ | ||
82 | #define PCM990_CTRL_ENAINT3 0x0008 /* Enable Int PM_5V off */ | ||
83 | |||
84 | #define PCM990_CTRL_REG8 0x0014 /* Uart REGISTER */ | ||
85 | #define PCM990_CTRL_FFSD 0x0001 /* BT Uart Enable */ | ||
86 | #define PCM990_CTRL_BTSD 0x0002 /* FF Uart Enable */ | ||
87 | #define PCM990_CTRL_FFRI 0x0004 /* FF Uart RI detect */ | ||
88 | #define PCM990_CTRL_BTRX 0x0008 /* BT Uart Rx detect */ | ||
89 | |||
90 | #define PCM990_CTRL_REG9 0x0010 /* AC97 Flash REGISTER */ | ||
91 | #define PCM990_CTRL_FLWP 0x0001 /* pC Flash Write Protect */ | ||
92 | #define PCM990_CTRL_FLDIS 0x0002 /* pC Flash Disable */ | ||
93 | #define PCM990_CTRL_AC97ENA 0x0004 /* Enable AC97 Expansion */ | ||
94 | |||
95 | #define PCM990_CTRL_REG10 0x0012 /* GPS-REGISTER */ | ||
96 | #define PCM990_CTRL_GPSPWR 0x0004 /* GPS-Modul Power on */ | ||
97 | #define PCM990_CTRL_GPSENA 0x0008 /* GPS-Modul Enable */ | ||
98 | |||
99 | #define PCM990_CTRL_REG11 0x0014 /* Accu REGISTER */ | ||
100 | #define PCM990_CTRL_ACENA 0x0001 /* Charge Enable */ | ||
101 | #define PCM990_CTRL_ACSEL 0x0002 /* Charge Akku -> DC Enable */ | ||
102 | #define PCM990_CTRL_ACPRES 0x0004 /* DC Present */ | ||
103 | #define PCM990_CTRL_ACALARM 0x0008 /* Error Akku */ | ||
104 | |||
105 | #define PCM990_CTRL_P2V(x) ((x) - PCM990_CTRL_PHYS + PCM990_CTRL_BASE) | ||
106 | #define PCM990_CTRL_V2P(x) ((x) - PCM990_CTRL_BASE + PCM990_CTRL_PHYS) | ||
107 | |||
108 | #ifndef __ASSEMBLY__ | ||
109 | # define __PCM990_CTRL_REG(x) \ | ||
110 | (*((volatile unsigned char *)PCM990_CTRL_P2V(x))) | ||
111 | #else | ||
112 | # define __PCM990_CTRL_REG(x) PCM990_CTRL_P2V(x) | ||
113 | #endif | ||
114 | |||
115 | #define PCM990_INTMSKENA __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7) | ||
116 | #define PCM990_INTSETCLR __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6) | ||
117 | #define PCM990_CTRL0 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG0) | ||
118 | #define PCM990_CTRL1 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG1) | ||
119 | #define PCM990_CTRL2 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG2) | ||
120 | #define PCM990_CTRL3 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) | ||
121 | #define PCM990_CTRL4 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG4) | ||
122 | #define PCM990_CTRL5 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) | ||
123 | #define PCM990_CTRL6 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6) | ||
124 | #define PCM990_CTRL7 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7) | ||
125 | #define PCM990_CTRL8 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG8) | ||
126 | #define PCM990_CTRL9 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG9) | ||
127 | #define PCM990_CTRL10 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG10) | ||
128 | #define PCM990_CTRL11 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG11) | ||
129 | |||
130 | |||
131 | /* | ||
132 | * IDE | ||
133 | */ | ||
134 | #define PCM990_IDE_IRQ_GPIO 13 | ||
135 | #define PCM990_IDE_IRQ IRQ_GPIO(PCM990_IDE_IRQ_GPIO) | ||
136 | #define PCM990_IDE_IRQ_EDGE IRQT_RISING | ||
137 | #define PCM990_IDE_PLD_PHYS 0x20000000 /* 16 bit wide */ | ||
138 | #define PCM990_IDE_PLD_BASE 0xee000000 | ||
139 | #define PCM990_IDE_PLD_SIZE (1*1024*1024) | ||
140 | |||
141 | /* visible CPLD (U6) registers */ | ||
142 | #define PCM990_IDE_PLD_REG0 0x1000 /* OFFSET IDE REGISTER 0 */ | ||
143 | #define PCM990_IDE_PM5V 0x0004 /* R System VCC_5V */ | ||
144 | #define PCM990_IDE_STBY 0x0008 /* R System StandBy */ | ||
145 | |||
146 | #define PCM990_IDE_PLD_REG1 0x1002 /* OFFSET IDE REGISTER 1 */ | ||
147 | #define PCM990_IDE_IDEMODE 0x0001 /* R TrueIDE Mode */ | ||
148 | #define PCM990_IDE_DMAENA 0x0004 /* RW DMA Enable */ | ||
149 | #define PCM990_IDE_DMA1_0 0x0008 /* RW 1=DREQ1 0=DREQ0 */ | ||
150 | |||
151 | #define PCM990_IDE_PLD_REG2 0x1004 /* OFFSET IDE REGISTER 2 */ | ||
152 | #define PCM990_IDE_RESENA 0x0001 /* RW IDE Reset Bit enable */ | ||
153 | #define PCM990_IDE_RES 0x0002 /* RW IDE Reset Bit */ | ||
154 | #define PCM990_IDE_RDY 0x0008 /* RDY */ | ||
155 | |||
156 | #define PCM990_IDE_PLD_REG3 0x1006 /* OFFSET IDE REGISTER 3 */ | ||
157 | #define PCM990_IDE_IDEOE 0x0001 /* RW Latch on Databus */ | ||
158 | #define PCM990_IDE_IDEON 0x0002 /* RW Latch on Control Address */ | ||
159 | #define PCM990_IDE_IDEIN 0x0004 /* RW Latch on Interrupt usw. */ | ||
160 | |||
161 | #define PCM990_IDE_PLD_REG4 0x1008 /* OFFSET IDE REGISTER 4 */ | ||
162 | #define PCM990_IDE_PWRENA 0x0001 /* RW IDE Power enable */ | ||
163 | #define PCM990_IDE_5V 0x0002 /* R IDE Power 5V */ | ||
164 | #define PCM990_IDE_PWG 0x0008 /* R IDE Power is on */ | ||
165 | |||
166 | #define PCM990_IDE_PLD_P2V(x) ((x) - PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_BASE) | ||
167 | #define PCM990_IDE_PLD_V2P(x) ((x) - PCM990_IDE_PLD_BASE + PCM990_IDE_PLD_PHYS) | ||
168 | |||
169 | #ifndef __ASSEMBLY__ | ||
170 | # define __PCM990_IDE_PLD_REG(x) \ | ||
171 | (*((volatile unsigned char *)PCM990_IDE_PLD_P2V(x))) | ||
172 | #else | ||
173 | # define __PCM990_IDE_PLD_REG(x) PCM990_IDE_PLD_P2V(x) | ||
174 | #endif | ||
175 | |||
176 | #define PCM990_IDE0 \ | ||
177 | __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG0) | ||
178 | #define PCM990_IDE1 \ | ||
179 | __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG1) | ||
180 | #define PCM990_IDE2 \ | ||
181 | __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG2) | ||
182 | #define PCM990_IDE3 \ | ||
183 | __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG3) | ||
184 | #define PCM990_IDE4 \ | ||
185 | __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG4) | ||
186 | |||
187 | /* | ||
188 | * Compact Flash | ||
189 | */ | ||
190 | #define PCM990_CF_IRQ_GPIO 11 | ||
191 | #define PCM990_CF_IRQ IRQ_GPIO(PCM990_CF_IRQ_GPIO) | ||
192 | #define PCM990_CF_IRQ_EDGE IRQT_RISING | ||
193 | |||
194 | #define PCM990_CF_CD_GPIO 12 | ||
195 | #define PCM990_CF_CD IRQ_GPIO(PCM990_CF_CD_GPIO) | ||
196 | #define PCM990_CF_CD_EDGE IRQT_RISING | ||
197 | |||
198 | #define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */ | ||
199 | #define PCM990_CF_PLD_BASE 0xef000000 | ||
200 | #define PCM990_CF_PLD_SIZE (1*1024*1024) | ||
201 | #define PCM990_CF_PLD_P2V(x) ((x) - PCM990_CF_PLD_PHYS + PCM990_CF_PLD_BASE) | ||
202 | #define PCM990_CF_PLD_V2P(x) ((x) - PCM990_CF_PLD_BASE + PCM990_CF_PLD_PHYS) | ||
203 | |||
204 | /* visible CPLD (U6) registers */ | ||
205 | #define PCM990_CF_PLD_REG0 0x1000 /* OFFSET CF REGISTER 0 */ | ||
206 | #define PCM990_CF_REG0_LED 0x0001 /* RW LED on */ | ||
207 | #define PCM990_CF_REG0_BLK 0x0002 /* RW LED flash when access */ | ||
208 | #define PCM990_CF_REG0_PM5V 0x0004 /* R System VCC_5V enable */ | ||
209 | #define PCM990_CF_REG0_STBY 0x0008 /* R System StandBy */ | ||
210 | |||
211 | #define PCM990_CF_PLD_REG1 0x1002 /* OFFSET CF REGISTER 1 */ | ||
212 | #define PCM990_CF_REG1_IDEMODE 0x0001 /* RW CF card run as TrueIDE */ | ||
213 | #define PCM990_CF_REG1_CF0 0x0002 /* RW CF card at ADDR 0x28000000 */ | ||
214 | |||
215 | #define PCM990_CF_PLD_REG2 0x1004 /* OFFSET CF REGISTER 2 */ | ||
216 | #define PCM990_CF_REG2_RES 0x0002 /* RW CF RESET BIT */ | ||
217 | #define PCM990_CF_REG2_RDYENA 0x0004 /* RW Enable CF_RDY */ | ||
218 | #define PCM990_CF_REG2_RDY 0x0008 /* R CF_RDY auf PWAIT */ | ||
219 | |||
220 | #define PCM990_CF_PLD_REG3 0x1006 /* OFFSET CF REGISTER 3 */ | ||
221 | #define PCM990_CF_REG3_CFOE 0x0001 /* RW Latch on Databus */ | ||
222 | #define PCM990_CF_REG3_CFON 0x0002 /* RW Latch on Control Address */ | ||
223 | #define PCM990_CF_REG3_CFIN 0x0004 /* RW Latch on Interrupt usw. */ | ||
224 | #define PCM990_CF_REG3_CFCD 0x0008 /* RW Latch on CD1/2 VS1/2 usw */ | ||
225 | |||
226 | #define PCM990_CF_PLD_REG4 0x1008 /* OFFSET CF REGISTER 4 */ | ||
227 | #define PCM990_CF_REG4_PWRENA 0x0001 /* RW CF Power on (CD1/2 = "00") */ | ||
228 | #define PCM990_CF_REG4_5_3V 0x0002 /* RW 1 = 5V CF_VCC 0 = 3 V CF_VCC */ | ||
229 | #define PCM990_CF_REG4_3B 0x0004 /* RW 3.0V Backup from VCC (5_3V=0) */ | ||
230 | #define PCM990_CF_REG4_PWG 0x0008 /* R CF-Power is on */ | ||
231 | |||
232 | #define PCM990_CF_PLD_REG5 0x100A /* OFFSET CF REGISTER 5 */ | ||
233 | #define PCM990_CF_REG5_BVD1 0x0001 /* R CF /BVD1 */ | ||
234 | #define PCM990_CF_REG5_BVD2 0x0002 /* R CF /BVD2 */ | ||
235 | #define PCM990_CF_REG5_VS1 0x0004 /* R CF /VS1 */ | ||
236 | #define PCM990_CF_REG5_VS2 0x0008 /* R CF /VS2 */ | ||
237 | |||
238 | #define PCM990_CF_PLD_REG6 0x100C /* OFFSET CF REGISTER 6 */ | ||
239 | #define PCM990_CF_REG6_CD1 0x0001 /* R CF Card_Detect1 */ | ||
240 | #define PCM990_CF_REG6_CD2 0x0002 /* R CF Card_Detect2 */ | ||
241 | |||
242 | #ifndef __ASSEMBLY__ | ||
243 | # define __PCM990_CF_PLD_REG(x) \ | ||
244 | (*((volatile unsigned char *)PCM990_CF_PLD_P2V(x))) | ||
245 | #else | ||
246 | # define __PCM990_CF_PLD_REG(x) PCM990_CF_PLD_P2V(x) | ||
247 | #endif | ||
248 | |||
249 | #define PCM990_CF0 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG0) | ||
250 | #define PCM990_CF1 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG1) | ||
251 | #define PCM990_CF2 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG2) | ||
252 | #define PCM990_CF3 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG3) | ||
253 | #define PCM990_CF4 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG4) | ||
254 | #define PCM990_CF5 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG5) | ||
255 | #define PCM990_CF6 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG6) | ||
256 | |||
257 | /* | ||
258 | * Wolfson AC97 Touch | ||
259 | */ | ||
260 | #define PCM990_AC97_IRQ_GPIO 10 | ||
261 | #define PCM990_AC97_IRQ IRQ_GPIO(PCM990_AC97_IRQ_GPIO) | ||
262 | #define PCM990_AC97_IRQ_EDGE IRQT_RISING | ||
263 | |||
264 | /* | ||
265 | * MMC phyCORE | ||
266 | */ | ||
267 | #define PCM990_MMC0_IRQ_GPIO 9 | ||
268 | #define PCM990_MMC0_IRQ IRQ_GPIO(PCM990_MMC0_IRQ_GPIO) | ||
269 | #define PCM990_MMC0_IRQ_EDGE IRQT_FALLING | ||
270 | |||
271 | /* | ||
272 | * USB phyCore | ||
273 | */ | ||
274 | #define PCM990_USB_OVERCURRENT (88 | GPIO_ALT_FN_1_IN) | ||
275 | #define PCM990_USB_PWR_EN (89 | GPIO_ALT_FN_2_OUT) | ||
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 1bd398da07da..442494d71f12 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1597,176 +1597,10 @@ | |||
1597 | #define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */ | 1597 | #define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */ |
1598 | #define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */ | 1598 | #define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */ |
1599 | 1599 | ||
1600 | |||
1601 | /* | 1600 | /* |
1602 | * SSP Serial Port Registers | 1601 | * SSP Serial Port Registers - see include/asm-arm/arch-pxa/regs-ssp.h |
1603 | * PXA250, PXA255, PXA26x and PXA27x SSP controllers are all slightly different. | ||
1604 | * PXA255, PXA26x and PXA27x have extra ports, registers and bits. | ||
1605 | */ | 1602 | */ |
1606 | 1603 | ||
1607 | /* Common PXA2xx bits first */ | ||
1608 | #define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */ | ||
1609 | #define SSCR0_DataSize(x) ((x) - 1) /* Data Size Select [4..16] */ | ||
1610 | #define SSCR0_FRF (0x00000030) /* FRame Format (mask) */ | ||
1611 | #define SSCR0_Motorola (0x0 << 4) /* Motorola's Serial Peripheral Interface (SPI) */ | ||
1612 | #define SSCR0_TI (0x1 << 4) /* Texas Instruments' Synchronous Serial Protocol (SSP) */ | ||
1613 | #define SSCR0_National (0x2 << 4) /* National Microwire */ | ||
1614 | #define SSCR0_ECS (1 << 6) /* External clock select */ | ||
1615 | #define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */ | ||
1616 | #if defined(CONFIG_PXA25x) | ||
1617 | #define SSCR0_SCR (0x0000ff00) /* Serial Clock Rate (mask) */ | ||
1618 | #define SSCR0_SerClkDiv(x) ((((x) - 2)/2) << 8) /* Divisor [2..512] */ | ||
1619 | #elif defined(CONFIG_PXA27x) | ||
1620 | #define SSCR0_SCR (0x000fff00) /* Serial Clock Rate (mask) */ | ||
1621 | #define SSCR0_SerClkDiv(x) (((x) - 1) << 8) /* Divisor [1..4096] */ | ||
1622 | #define SSCR0_EDSS (1 << 20) /* Extended data size select */ | ||
1623 | #define SSCR0_NCS (1 << 21) /* Network clock select */ | ||
1624 | #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ | ||
1625 | #define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ | ||
1626 | #define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ | ||
1627 | #define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ | ||
1628 | #define SSCR0_ADC (1 << 30) /* Audio clock select */ | ||
1629 | #define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ | ||
1630 | #endif | ||
1631 | |||
1632 | #define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */ | ||
1633 | #define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */ | ||
1634 | #define SSCR1_LBM (1 << 2) /* Loop-Back Mode */ | ||
1635 | #define SSCR1_SPO (1 << 3) /* Motorola SPI SSPSCLK polarity setting */ | ||
1636 | #define SSCR1_SPH (1 << 4) /* Motorola SPI SSPSCLK phase setting */ | ||
1637 | #define SSCR1_MWDS (1 << 5) /* Microwire Transmit Data Size */ | ||
1638 | #define SSCR1_TFT (0x000003c0) /* Transmit FIFO Threshold (mask) */ | ||
1639 | #define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..16] */ | ||
1640 | #define SSCR1_RFT (0x00003c00) /* Receive FIFO Threshold (mask) */ | ||
1641 | #define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..16] */ | ||
1642 | |||
1643 | #define SSSR_TNF (1 << 2) /* Transmit FIFO Not Full */ | ||
1644 | #define SSSR_RNE (1 << 3) /* Receive FIFO Not Empty */ | ||
1645 | #define SSSR_BSY (1 << 4) /* SSP Busy */ | ||
1646 | #define SSSR_TFS (1 << 5) /* Transmit FIFO Service Request */ | ||
1647 | #define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */ | ||
1648 | #define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */ | ||
1649 | |||
1650 | #define SSCR0_TIM (1 << 23) /* Transmit FIFO Under Run Interrupt Mask */ | ||
1651 | #define SSCR0_RIM (1 << 22) /* Receive FIFO Over Run interrupt Mask */ | ||
1652 | #define SSCR0_NCS (1 << 21) /* Network Clock Select */ | ||
1653 | #define SSCR0_EDSS (1 << 20) /* Extended Data Size Select */ | ||
1654 | |||
1655 | /* extra bits in PXA255, PXA26x and PXA27x SSP ports */ | ||
1656 | #define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */ | ||
1657 | #define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */ | ||
1658 | #define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */ | ||
1659 | #define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */ | ||
1660 | #define SSCR1_EBCEI (1 << 29) /* Enable Bit Count Error interrupt */ | ||
1661 | #define SSCR1_SCFR (1 << 28) /* Slave Clock free Running */ | ||
1662 | #define SSCR1_ECRA (1 << 27) /* Enable Clock Request A */ | ||
1663 | #define SSCR1_ECRB (1 << 26) /* Enable Clock request B */ | ||
1664 | #define SSCR1_SCLKDIR (1 << 25) /* Serial Bit Rate Clock Direction */ | ||
1665 | #define SSCR1_SFRMDIR (1 << 24) /* Frame Direction */ | ||
1666 | #define SSCR1_RWOT (1 << 23) /* Receive Without Transmit */ | ||
1667 | #define SSCR1_TRAIL (1 << 22) /* Trailing Byte */ | ||
1668 | #define SSCR1_TSRE (1 << 21) /* Transmit Service Request Enable */ | ||
1669 | #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */ | ||
1670 | #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */ | ||
1671 | #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */ | ||
1672 | #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */ | ||
1673 | #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */ | ||
1674 | |||
1675 | #define SSSR_BCE (1 << 23) /* Bit Count Error */ | ||
1676 | #define SSSR_CSS (1 << 22) /* Clock Synchronisation Status */ | ||
1677 | #define SSSR_TUR (1 << 21) /* Transmit FIFO Under Run */ | ||
1678 | #define SSSR_EOC (1 << 20) /* End Of Chain */ | ||
1679 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ | ||
1680 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | ||
1681 | |||
1682 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
1683 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ | ||
1684 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ | ||
1685 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ | ||
1686 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ | ||
1687 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ | ||
1688 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | ||
1689 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | ||
1690 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ | ||
1691 | |||
1692 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ | ||
1693 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ | ||
1694 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | ||
1695 | |||
1696 | #define SSCR0_P1 __REG(0x41000000) /* SSP Port 1 Control Register 0 */ | ||
1697 | #define SSCR1_P1 __REG(0x41000004) /* SSP Port 1 Control Register 1 */ | ||
1698 | #define SSSR_P1 __REG(0x41000008) /* SSP Port 1 Status Register */ | ||
1699 | #define SSITR_P1 __REG(0x4100000C) /* SSP Port 1 Interrupt Test Register */ | ||
1700 | #define SSDR_P1 __REG(0x41000010) /* (Write / Read) SSP Port 1 Data Write Register/SSP Data Read Register */ | ||
1701 | |||
1702 | /* Support existing PXA25x drivers */ | ||
1703 | #define SSCR0 SSCR0_P1 /* SSP Control Register 0 */ | ||
1704 | #define SSCR1 SSCR1_P1 /* SSP Control Register 1 */ | ||
1705 | #define SSSR SSSR_P1 /* SSP Status Register */ | ||
1706 | #define SSITR SSITR_P1 /* SSP Interrupt Test Register */ | ||
1707 | #define SSDR SSDR_P1 /* (Write / Read) SSP Data Write Register/SSP Data Read Register */ | ||
1708 | |||
1709 | /* PXA27x ports */ | ||
1710 | #if defined (CONFIG_PXA27x) | ||
1711 | #define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */ | ||
1712 | #define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */ | ||
1713 | #define SSTSA_P1 __REG(0x41000030) /* SSP Port 1 Tx Timeslot Active */ | ||
1714 | #define SSRSA_P1 __REG(0x41000034) /* SSP Port 1 Rx Timeslot Active */ | ||
1715 | #define SSTSS_P1 __REG(0x41000038) /* SSP Port 1 Timeslot Status */ | ||
1716 | #define SSACD_P1 __REG(0x4100003C) /* SSP Port 1 Audio Clock Divider */ | ||
1717 | #define SSCR0_P2 __REG(0x41700000) /* SSP Port 2 Control Register 0 */ | ||
1718 | #define SSCR1_P2 __REG(0x41700004) /* SSP Port 2 Control Register 1 */ | ||
1719 | #define SSSR_P2 __REG(0x41700008) /* SSP Port 2 Status Register */ | ||
1720 | #define SSITR_P2 __REG(0x4170000C) /* SSP Port 2 Interrupt Test Register */ | ||
1721 | #define SSDR_P2 __REG(0x41700010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */ | ||
1722 | #define SSTO_P2 __REG(0x41700028) /* SSP Port 2 Time Out Register */ | ||
1723 | #define SSPSP_P2 __REG(0x4170002C) /* SSP Port 2 Programmable Serial Protocol */ | ||
1724 | #define SSTSA_P2 __REG(0x41700030) /* SSP Port 2 Tx Timeslot Active */ | ||
1725 | #define SSRSA_P2 __REG(0x41700034) /* SSP Port 2 Rx Timeslot Active */ | ||
1726 | #define SSTSS_P2 __REG(0x41700038) /* SSP Port 2 Timeslot Status */ | ||
1727 | #define SSACD_P2 __REG(0x4170003C) /* SSP Port 2 Audio Clock Divider */ | ||
1728 | #define SSCR0_P3 __REG(0x41900000) /* SSP Port 3 Control Register 0 */ | ||
1729 | #define SSCR1_P3 __REG(0x41900004) /* SSP Port 3 Control Register 1 */ | ||
1730 | #define SSSR_P3 __REG(0x41900008) /* SSP Port 3 Status Register */ | ||
1731 | #define SSITR_P3 __REG(0x4190000C) /* SSP Port 3 Interrupt Test Register */ | ||
1732 | #define SSDR_P3 __REG(0x41900010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */ | ||
1733 | #define SSTO_P3 __REG(0x41900028) /* SSP Port 3 Time Out Register */ | ||
1734 | #define SSPSP_P3 __REG(0x4190002C) /* SSP Port 3 Programmable Serial Protocol */ | ||
1735 | #define SSTSA_P3 __REG(0x41900030) /* SSP Port 3 Tx Timeslot Active */ | ||
1736 | #define SSRSA_P3 __REG(0x41900034) /* SSP Port 3 Rx Timeslot Active */ | ||
1737 | #define SSTSS_P3 __REG(0x41900038) /* SSP Port 3 Timeslot Status */ | ||
1738 | #define SSACD_P3 __REG(0x4190003C) /* SSP Port 3 Audio Clock Divider */ | ||
1739 | #else /* PXA255 (only port 2) and PXA26x ports*/ | ||
1740 | #define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */ | ||
1741 | #define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */ | ||
1742 | #define SSCR0_P2 __REG(0x41400000) /* SSP Port 2 Control Register 0 */ | ||
1743 | #define SSCR1_P2 __REG(0x41400004) /* SSP Port 2 Control Register 1 */ | ||
1744 | #define SSSR_P2 __REG(0x41400008) /* SSP Port 2 Status Register */ | ||
1745 | #define SSITR_P2 __REG(0x4140000C) /* SSP Port 2 Interrupt Test Register */ | ||
1746 | #define SSDR_P2 __REG(0x41400010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */ | ||
1747 | #define SSTO_P2 __REG(0x41400028) /* SSP Port 2 Time Out Register */ | ||
1748 | #define SSPSP_P2 __REG(0x4140002C) /* SSP Port 2 Programmable Serial Protocol */ | ||
1749 | #define SSCR0_P3 __REG(0x41500000) /* SSP Port 3 Control Register 0 */ | ||
1750 | #define SSCR1_P3 __REG(0x41500004) /* SSP Port 3 Control Register 1 */ | ||
1751 | #define SSSR_P3 __REG(0x41500008) /* SSP Port 3 Status Register */ | ||
1752 | #define SSITR_P3 __REG(0x4150000C) /* SSP Port 3 Interrupt Test Register */ | ||
1753 | #define SSDR_P3 __REG(0x41500010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */ | ||
1754 | #define SSTO_P3 __REG(0x41500028) /* SSP Port 3 Time Out Register */ | ||
1755 | #define SSPSP_P3 __REG(0x4150002C) /* SSP Port 3 Programmable Serial Protocol */ | ||
1756 | #endif | ||
1757 | |||
1758 | #define SSCR0_P(x) (*(((x) == 1) ? &SSCR0_P1 : ((x) == 2) ? &SSCR0_P2 : ((x) == 3) ? &SSCR0_P3 : NULL)) | ||
1759 | #define SSCR1_P(x) (*(((x) == 1) ? &SSCR1_P1 : ((x) == 2) ? &SSCR1_P2 : ((x) == 3) ? &SSCR1_P3 : NULL)) | ||
1760 | #define SSSR_P(x) (*(((x) == 1) ? &SSSR_P1 : ((x) == 2) ? &SSSR_P2 : ((x) == 3) ? &SSSR_P3 : NULL)) | ||
1761 | #define SSITR_P(x) (*(((x) == 1) ? &SSITR_P1 : ((x) == 2) ? &SSITR_P2 : ((x) == 3) ? &SSITR_P3 : NULL)) | ||
1762 | #define SSDR_P(x) (*(((x) == 1) ? &SSDR_P1 : ((x) == 2) ? &SSDR_P2 : ((x) == 3) ? &SSDR_P3 : NULL)) | ||
1763 | #define SSTO_P(x) (*(((x) == 1) ? &SSTO_P1 : ((x) == 2) ? &SSTO_P2 : ((x) == 3) ? &SSTO_P3 : NULL)) | ||
1764 | #define SSPSP_P(x) (*(((x) == 1) ? &SSPSP_P1 : ((x) == 2) ? &SSPSP_P2 : ((x) == 3) ? &SSPSP_P3 : NULL)) | ||
1765 | #define SSTSA_P(x) (*(((x) == 1) ? &SSTSA_P1 : ((x) == 2) ? &SSTSA_P2 : ((x) == 3) ? &SSTSA_P3 : NULL)) | ||
1766 | #define SSRSA_P(x) (*(((x) == 1) ? &SSRSA_P1 : ((x) == 2) ? &SSRSA_P2 : ((x) == 3) ? &SSRSA_P3 : NULL)) | ||
1767 | #define SSTSS_P(x) (*(((x) == 1) ? &SSTSS_P1 : ((x) == 2) ? &SSTSS_P2 : ((x) == 3) ? &SSTSS_P3 : NULL)) | ||
1768 | #define SSACD_P(x) (*(((x) == 1) ? &SSACD_P1 : ((x) == 2) ? &SSACD_P2 : ((x) == 3) ? &SSACD_P3 : NULL)) | ||
1769 | |||
1770 | /* | 1604 | /* |
1771 | * MultiMediaCard (MMC) controller - see drivers/mmc/host/pxamci.h | 1605 | * MultiMediaCard (MMC) controller - see drivers/mmc/host/pxamci.h |
1772 | */ | 1606 | */ |
@@ -2014,71 +1848,8 @@ | |||
2014 | 1848 | ||
2015 | #define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ | 1849 | #define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ |
2016 | 1850 | ||
2017 | /* | ||
2018 | * Memory controller | ||
2019 | */ | ||
2020 | |||
2021 | #define MDCNFG __REG(0x48000000) /* SDRAM Configuration Register 0 */ | ||
2022 | #define MDREFR __REG(0x48000004) /* SDRAM Refresh Control Register */ | ||
2023 | #define MSC0 __REG(0x48000008) /* Static Memory Control Register 0 */ | ||
2024 | #define MSC1 __REG(0x4800000C) /* Static Memory Control Register 1 */ | ||
2025 | #define MSC2 __REG(0x48000010) /* Static Memory Control Register 2 */ | ||
2026 | #define MECR __REG(0x48000014) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */ | ||
2027 | #define SXLCR __REG(0x48000018) /* LCR value to be written to SDRAM-Timing Synchronous Flash */ | ||
2028 | #define SXCNFG __REG(0x4800001C) /* Synchronous Static Memory Control Register */ | ||
2029 | #define SXMRS __REG(0x48000024) /* MRS value to be written to Synchronous Flash or SMROM */ | ||
2030 | #define MCMEM0 __REG(0x48000028) /* Card interface Common Memory Space Socket 0 Timing */ | ||
2031 | #define MCMEM1 __REG(0x4800002C) /* Card interface Common Memory Space Socket 1 Timing */ | ||
2032 | #define MCATT0 __REG(0x48000030) /* Card interface Attribute Space Socket 0 Timing Configuration */ | ||
2033 | #define MCATT1 __REG(0x48000034) /* Card interface Attribute Space Socket 1 Timing Configuration */ | ||
2034 | #define MCIO0 __REG(0x48000038) /* Card interface I/O Space Socket 0 Timing Configuration */ | ||
2035 | #define MCIO1 __REG(0x4800003C) /* Card interface I/O Space Socket 1 Timing Configuration */ | ||
2036 | #define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */ | ||
2037 | #define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ | ||
2038 | |||
2039 | /* | ||
2040 | * More handy macros for PCMCIA | ||
2041 | * | ||
2042 | * Arg is socket number | ||
2043 | */ | ||
2044 | #define MCMEM(s) __REG2(0x48000028, (s)<<2 ) /* Card interface Common Memory Space Socket s Timing */ | ||
2045 | #define MCATT(s) __REG2(0x48000030, (s)<<2 ) /* Card interface Attribute Space Socket s Timing Configuration */ | ||
2046 | #define MCIO(s) __REG2(0x48000038, (s)<<2 ) /* Card interface I/O Space Socket s Timing Configuration */ | ||
2047 | |||
2048 | /* MECR register defines */ | ||
2049 | #define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ | ||
2050 | #define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ | ||
2051 | |||
2052 | #define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ | ||
2053 | #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ | ||
2054 | #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ | ||
2055 | #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ | ||
2056 | #define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */ | ||
2057 | #define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */ | ||
2058 | #define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */ | ||
2059 | #define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */ | ||
2060 | #define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */ | ||
2061 | #define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */ | ||
2062 | #define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */ | ||
2063 | #define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */ | ||
2064 | #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ | ||
2065 | #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ | ||
2066 | |||
2067 | |||
2068 | #ifdef CONFIG_PXA27x | 1851 | #ifdef CONFIG_PXA27x |
2069 | 1852 | ||
2070 | #define ARB_CNTRL __REG(0x48000048) /* Arbiter Control Register */ | ||
2071 | |||
2072 | #define ARB_DMA_SLV_PARK (1<<31) /* Be parked with DMA slave when idle */ | ||
2073 | #define ARB_CI_PARK (1<<30) /* Be parked with Camera Interface when idle */ | ||
2074 | #define ARB_EX_MEM_PARK (1<<29) /* Be parked with external MEMC when idle */ | ||
2075 | #define ARB_INT_MEM_PARK (1<<28) /* Be parked with internal MEMC when idle */ | ||
2076 | #define ARB_USB_PARK (1<<27) /* Be parked with USB when idle */ | ||
2077 | #define ARB_LCD_PARK (1<<26) /* Be parked with LCD when idle */ | ||
2078 | #define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */ | ||
2079 | #define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ | ||
2080 | #define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ | ||
2081 | |||
2082 | /* | 1853 | /* |
2083 | * Keypad | 1854 | * Keypad |
2084 | */ | 1855 | */ |
@@ -2135,74 +1906,6 @@ | |||
2135 | #define KPAS_SO (0x1 << 31) | 1906 | #define KPAS_SO (0x1 << 31) |
2136 | #define KPASMKPx_SO (0x1 << 31) | 1907 | #define KPASMKPx_SO (0x1 << 31) |
2137 | 1908 | ||
2138 | /* | ||
2139 | * UHC: USB Host Controller (OHCI-like) register definitions | ||
2140 | */ | ||
2141 | #define UHC_BASE_PHYS (0x4C000000) | ||
2142 | #define UHCREV __REG(0x4C000000) /* UHC HCI Spec Revision */ | ||
2143 | #define UHCHCON __REG(0x4C000004) /* UHC Host Control Register */ | ||
2144 | #define UHCCOMS __REG(0x4C000008) /* UHC Command Status Register */ | ||
2145 | #define UHCINTS __REG(0x4C00000C) /* UHC Interrupt Status Register */ | ||
2146 | #define UHCINTE __REG(0x4C000010) /* UHC Interrupt Enable */ | ||
2147 | #define UHCINTD __REG(0x4C000014) /* UHC Interrupt Disable */ | ||
2148 | #define UHCHCCA __REG(0x4C000018) /* UHC Host Controller Comm. Area */ | ||
2149 | #define UHCPCED __REG(0x4C00001C) /* UHC Period Current Endpt Descr */ | ||
2150 | #define UHCCHED __REG(0x4C000020) /* UHC Control Head Endpt Descr */ | ||
2151 | #define UHCCCED __REG(0x4C000024) /* UHC Control Current Endpt Descr */ | ||
2152 | #define UHCBHED __REG(0x4C000028) /* UHC Bulk Head Endpt Descr */ | ||
2153 | #define UHCBCED __REG(0x4C00002C) /* UHC Bulk Current Endpt Descr */ | ||
2154 | #define UHCDHEAD __REG(0x4C000030) /* UHC Done Head */ | ||
2155 | #define UHCFMI __REG(0x4C000034) /* UHC Frame Interval */ | ||
2156 | #define UHCFMR __REG(0x4C000038) /* UHC Frame Remaining */ | ||
2157 | #define UHCFMN __REG(0x4C00003C) /* UHC Frame Number */ | ||
2158 | #define UHCPERS __REG(0x4C000040) /* UHC Periodic Start */ | ||
2159 | #define UHCLS __REG(0x4C000044) /* UHC Low Speed Threshold */ | ||
2160 | |||
2161 | #define UHCRHDA __REG(0x4C000048) /* UHC Root Hub Descriptor A */ | ||
2162 | #define UHCRHDA_NOCP (1 << 12) /* No over current protection */ | ||
2163 | |||
2164 | #define UHCRHDB __REG(0x4C00004C) /* UHC Root Hub Descriptor B */ | ||
2165 | #define UHCRHS __REG(0x4C000050) /* UHC Root Hub Status */ | ||
2166 | #define UHCRHPS1 __REG(0x4C000054) /* UHC Root Hub Port 1 Status */ | ||
2167 | #define UHCRHPS2 __REG(0x4C000058) /* UHC Root Hub Port 2 Status */ | ||
2168 | #define UHCRHPS3 __REG(0x4C00005C) /* UHC Root Hub Port 3 Status */ | ||
2169 | |||
2170 | #define UHCSTAT __REG(0x4C000060) /* UHC Status Register */ | ||
2171 | #define UHCSTAT_UPS3 (1 << 16) /* USB Power Sense Port3 */ | ||
2172 | #define UHCSTAT_SBMAI (1 << 15) /* System Bus Master Abort Interrupt*/ | ||
2173 | #define UHCSTAT_SBTAI (1 << 14) /* System Bus Target Abort Interrupt*/ | ||
2174 | #define UHCSTAT_UPRI (1 << 13) /* USB Port Resume Interrupt */ | ||
2175 | #define UHCSTAT_UPS2 (1 << 12) /* USB Power Sense Port 2 */ | ||
2176 | #define UHCSTAT_UPS1 (1 << 11) /* USB Power Sense Port 1 */ | ||
2177 | #define UHCSTAT_HTA (1 << 10) /* HCI Target Abort */ | ||
2178 | #define UHCSTAT_HBA (1 << 8) /* HCI Buffer Active */ | ||
2179 | #define UHCSTAT_RWUE (1 << 7) /* HCI Remote Wake Up Event */ | ||
2180 | |||
2181 | #define UHCHR __REG(0x4C000064) /* UHC Reset Register */ | ||
2182 | #define UHCHR_SSEP3 (1 << 11) /* Sleep Standby Enable for Port3 */ | ||
2183 | #define UHCHR_SSEP2 (1 << 10) /* Sleep Standby Enable for Port2 */ | ||
2184 | #define UHCHR_SSEP1 (1 << 9) /* Sleep Standby Enable for Port1 */ | ||
2185 | #define UHCHR_PCPL (1 << 7) /* Power control polarity low */ | ||
2186 | #define UHCHR_PSPL (1 << 6) /* Power sense polarity low */ | ||
2187 | #define UHCHR_SSE (1 << 5) /* Sleep Standby Enable */ | ||
2188 | #define UHCHR_UIT (1 << 4) /* USB Interrupt Test */ | ||
2189 | #define UHCHR_SSDC (1 << 3) /* Simulation Scale Down Clock */ | ||
2190 | #define UHCHR_CGR (1 << 2) /* Clock Generation Reset */ | ||
2191 | #define UHCHR_FHR (1 << 1) /* Force Host Controller Reset */ | ||
2192 | #define UHCHR_FSBIR (1 << 0) /* Force System Bus Iface Reset */ | ||
2193 | |||
2194 | #define UHCHIE __REG(0x4C000068) /* UHC Interrupt Enable Register*/ | ||
2195 | #define UHCHIE_UPS3IE (1 << 14) /* Power Sense Port3 IntEn */ | ||
2196 | #define UHCHIE_UPRIE (1 << 13) /* Port Resume IntEn */ | ||
2197 | #define UHCHIE_UPS2IE (1 << 12) /* Power Sense Port2 IntEn */ | ||
2198 | #define UHCHIE_UPS1IE (1 << 11) /* Power Sense Port1 IntEn */ | ||
2199 | #define UHCHIE_TAIE (1 << 10) /* HCI Interface Transfer Abort | ||
2200 | Interrupt Enable*/ | ||
2201 | #define UHCHIE_HBAIE (1 << 8) /* HCI Buffer Active IntEn */ | ||
2202 | #define UHCHIE_RWIE (1 << 7) /* Remote Wake-up IntEn */ | ||
2203 | |||
2204 | #define UHCHIT __REG(0x4C00006C) /* UHC Interrupt Test register */ | ||
2205 | |||
2206 | /* Camera Interface */ | 1909 | /* Camera Interface */ |
2207 | #define CICR0 __REG(0x50000000) | 1910 | #define CICR0 __REG(0x50000000) |
2208 | #define CICR1 __REG(0x50000004) | 1911 | #define CICR1 __REG(0x50000004) |
@@ -2350,6 +2053,77 @@ | |||
2350 | 2053 | ||
2351 | #endif | 2054 | #endif |
2352 | 2055 | ||
2056 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
2057 | /* | ||
2058 | * UHC: USB Host Controller (OHCI-like) register definitions | ||
2059 | */ | ||
2060 | #define UHC_BASE_PHYS (0x4C000000) | ||
2061 | #define UHCREV __REG(0x4C000000) /* UHC HCI Spec Revision */ | ||
2062 | #define UHCHCON __REG(0x4C000004) /* UHC Host Control Register */ | ||
2063 | #define UHCCOMS __REG(0x4C000008) /* UHC Command Status Register */ | ||
2064 | #define UHCINTS __REG(0x4C00000C) /* UHC Interrupt Status Register */ | ||
2065 | #define UHCINTE __REG(0x4C000010) /* UHC Interrupt Enable */ | ||
2066 | #define UHCINTD __REG(0x4C000014) /* UHC Interrupt Disable */ | ||
2067 | #define UHCHCCA __REG(0x4C000018) /* UHC Host Controller Comm. Area */ | ||
2068 | #define UHCPCED __REG(0x4C00001C) /* UHC Period Current Endpt Descr */ | ||
2069 | #define UHCCHED __REG(0x4C000020) /* UHC Control Head Endpt Descr */ | ||
2070 | #define UHCCCED __REG(0x4C000024) /* UHC Control Current Endpt Descr */ | ||
2071 | #define UHCBHED __REG(0x4C000028) /* UHC Bulk Head Endpt Descr */ | ||
2072 | #define UHCBCED __REG(0x4C00002C) /* UHC Bulk Current Endpt Descr */ | ||
2073 | #define UHCDHEAD __REG(0x4C000030) /* UHC Done Head */ | ||
2074 | #define UHCFMI __REG(0x4C000034) /* UHC Frame Interval */ | ||
2075 | #define UHCFMR __REG(0x4C000038) /* UHC Frame Remaining */ | ||
2076 | #define UHCFMN __REG(0x4C00003C) /* UHC Frame Number */ | ||
2077 | #define UHCPERS __REG(0x4C000040) /* UHC Periodic Start */ | ||
2078 | #define UHCLS __REG(0x4C000044) /* UHC Low Speed Threshold */ | ||
2079 | |||
2080 | #define UHCRHDA __REG(0x4C000048) /* UHC Root Hub Descriptor A */ | ||
2081 | #define UHCRHDA_NOCP (1 << 12) /* No over current protection */ | ||
2082 | |||
2083 | #define UHCRHDB __REG(0x4C00004C) /* UHC Root Hub Descriptor B */ | ||
2084 | #define UHCRHS __REG(0x4C000050) /* UHC Root Hub Status */ | ||
2085 | #define UHCRHPS1 __REG(0x4C000054) /* UHC Root Hub Port 1 Status */ | ||
2086 | #define UHCRHPS2 __REG(0x4C000058) /* UHC Root Hub Port 2 Status */ | ||
2087 | #define UHCRHPS3 __REG(0x4C00005C) /* UHC Root Hub Port 3 Status */ | ||
2088 | |||
2089 | #define UHCSTAT __REG(0x4C000060) /* UHC Status Register */ | ||
2090 | #define UHCSTAT_UPS3 (1 << 16) /* USB Power Sense Port3 */ | ||
2091 | #define UHCSTAT_SBMAI (1 << 15) /* System Bus Master Abort Interrupt*/ | ||
2092 | #define UHCSTAT_SBTAI (1 << 14) /* System Bus Target Abort Interrupt*/ | ||
2093 | #define UHCSTAT_UPRI (1 << 13) /* USB Port Resume Interrupt */ | ||
2094 | #define UHCSTAT_UPS2 (1 << 12) /* USB Power Sense Port 2 */ | ||
2095 | #define UHCSTAT_UPS1 (1 << 11) /* USB Power Sense Port 1 */ | ||
2096 | #define UHCSTAT_HTA (1 << 10) /* HCI Target Abort */ | ||
2097 | #define UHCSTAT_HBA (1 << 8) /* HCI Buffer Active */ | ||
2098 | #define UHCSTAT_RWUE (1 << 7) /* HCI Remote Wake Up Event */ | ||
2099 | |||
2100 | #define UHCHR __REG(0x4C000064) /* UHC Reset Register */ | ||
2101 | #define UHCHR_SSEP3 (1 << 11) /* Sleep Standby Enable for Port3 */ | ||
2102 | #define UHCHR_SSEP2 (1 << 10) /* Sleep Standby Enable for Port2 */ | ||
2103 | #define UHCHR_SSEP1 (1 << 9) /* Sleep Standby Enable for Port1 */ | ||
2104 | #define UHCHR_PCPL (1 << 7) /* Power control polarity low */ | ||
2105 | #define UHCHR_PSPL (1 << 6) /* Power sense polarity low */ | ||
2106 | #define UHCHR_SSE (1 << 5) /* Sleep Standby Enable */ | ||
2107 | #define UHCHR_UIT (1 << 4) /* USB Interrupt Test */ | ||
2108 | #define UHCHR_SSDC (1 << 3) /* Simulation Scale Down Clock */ | ||
2109 | #define UHCHR_CGR (1 << 2) /* Clock Generation Reset */ | ||
2110 | #define UHCHR_FHR (1 << 1) /* Force Host Controller Reset */ | ||
2111 | #define UHCHR_FSBIR (1 << 0) /* Force System Bus Iface Reset */ | ||
2112 | |||
2113 | #define UHCHIE __REG(0x4C000068) /* UHC Interrupt Enable Register*/ | ||
2114 | #define UHCHIE_UPS3IE (1 << 14) /* Power Sense Port3 IntEn */ | ||
2115 | #define UHCHIE_UPRIE (1 << 13) /* Port Resume IntEn */ | ||
2116 | #define UHCHIE_UPS2IE (1 << 12) /* Power Sense Port2 IntEn */ | ||
2117 | #define UHCHIE_UPS1IE (1 << 11) /* Power Sense Port1 IntEn */ | ||
2118 | #define UHCHIE_TAIE (1 << 10) /* HCI Interface Transfer Abort | ||
2119 | Interrupt Enable*/ | ||
2120 | #define UHCHIE_HBAIE (1 << 8) /* HCI Buffer Active IntEn */ | ||
2121 | #define UHCHIE_RWIE (1 << 7) /* Remote Wake-up IntEn */ | ||
2122 | |||
2123 | #define UHCHIT __REG(0x4C00006C) /* UHC Interrupt Test register */ | ||
2124 | |||
2125 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ | ||
2126 | |||
2353 | /* PWRMODE register M field values */ | 2127 | /* PWRMODE register M field values */ |
2354 | 2128 | ||
2355 | #define PWRMODE_IDLE 0x1 | 2129 | #define PWRMODE_IDLE 0x1 |
diff --git a/include/asm-arm/arch-pxa/pxa2xx-regs.h b/include/asm-arm/arch-pxa/pxa2xx-regs.h new file mode 100644 index 000000000000..9553b54fa5bc --- /dev/null +++ b/include/asm-arm/arch-pxa/pxa2xx-regs.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-pxa/pxa2xx-regs.h | ||
3 | * | ||
4 | * Taken from pxa-regs.h by Russell King | ||
5 | * | ||
6 | * Author: Nicolas Pitre | ||
7 | * Copyright: MontaVista Software Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PXA2XX_REGS_H | ||
15 | #define __PXA2XX_REGS_H | ||
16 | |||
17 | /* | ||
18 | * Memory controller | ||
19 | */ | ||
20 | |||
21 | #define MDCNFG __REG(0x48000000) /* SDRAM Configuration Register 0 */ | ||
22 | #define MDREFR __REG(0x48000004) /* SDRAM Refresh Control Register */ | ||
23 | #define MSC0 __REG(0x48000008) /* Static Memory Control Register 0 */ | ||
24 | #define MSC1 __REG(0x4800000C) /* Static Memory Control Register 1 */ | ||
25 | #define MSC2 __REG(0x48000010) /* Static Memory Control Register 2 */ | ||
26 | #define MECR __REG(0x48000014) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */ | ||
27 | #define SXLCR __REG(0x48000018) /* LCR value to be written to SDRAM-Timing Synchronous Flash */ | ||
28 | #define SXCNFG __REG(0x4800001C) /* Synchronous Static Memory Control Register */ | ||
29 | #define SXMRS __REG(0x48000024) /* MRS value to be written to Synchronous Flash or SMROM */ | ||
30 | #define MCMEM0 __REG(0x48000028) /* Card interface Common Memory Space Socket 0 Timing */ | ||
31 | #define MCMEM1 __REG(0x4800002C) /* Card interface Common Memory Space Socket 1 Timing */ | ||
32 | #define MCATT0 __REG(0x48000030) /* Card interface Attribute Space Socket 0 Timing Configuration */ | ||
33 | #define MCATT1 __REG(0x48000034) /* Card interface Attribute Space Socket 1 Timing Configuration */ | ||
34 | #define MCIO0 __REG(0x48000038) /* Card interface I/O Space Socket 0 Timing Configuration */ | ||
35 | #define MCIO1 __REG(0x4800003C) /* Card interface I/O Space Socket 1 Timing Configuration */ | ||
36 | #define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */ | ||
37 | #define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ | ||
38 | |||
39 | /* | ||
40 | * More handy macros for PCMCIA | ||
41 | * | ||
42 | * Arg is socket number | ||
43 | */ | ||
44 | #define MCMEM(s) __REG2(0x48000028, (s)<<2 ) /* Card interface Common Memory Space Socket s Timing */ | ||
45 | #define MCATT(s) __REG2(0x48000030, (s)<<2 ) /* Card interface Attribute Space Socket s Timing Configuration */ | ||
46 | #define MCIO(s) __REG2(0x48000038, (s)<<2 ) /* Card interface I/O Space Socket s Timing Configuration */ | ||
47 | |||
48 | /* MECR register defines */ | ||
49 | #define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ | ||
50 | #define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ | ||
51 | |||
52 | #define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ | ||
53 | #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ | ||
54 | #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ | ||
55 | #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ | ||
56 | #define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */ | ||
57 | #define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */ | ||
58 | #define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */ | ||
59 | #define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */ | ||
60 | #define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */ | ||
61 | #define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */ | ||
62 | #define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */ | ||
63 | #define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */ | ||
64 | #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ | ||
65 | #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ | ||
66 | |||
67 | |||
68 | #ifdef CONFIG_PXA27x | ||
69 | |||
70 | #define ARB_CNTRL __REG(0x48000048) /* Arbiter Control Register */ | ||
71 | |||
72 | #define ARB_DMA_SLV_PARK (1<<31) /* Be parked with DMA slave when idle */ | ||
73 | #define ARB_CI_PARK (1<<30) /* Be parked with Camera Interface when idle */ | ||
74 | #define ARB_EX_MEM_PARK (1<<29) /* Be parked with external MEMC when idle */ | ||
75 | #define ARB_INT_MEM_PARK (1<<28) /* Be parked with internal MEMC when idle */ | ||
76 | #define ARB_USB_PARK (1<<27) /* Be parked with USB when idle */ | ||
77 | #define ARB_LCD_PARK (1<<26) /* Be parked with LCD when idle */ | ||
78 | #define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */ | ||
79 | #define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ | ||
80 | #define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ | ||
81 | |||
82 | #endif | ||
83 | |||
84 | #endif | ||
diff --git a/include/asm-arm/arch-pxa/pxa2xx_spi.h b/include/asm-arm/arch-pxa/pxa2xx_spi.h index acc7ec7a84a1..3459fb26ce97 100644 --- a/include/asm-arm/arch-pxa/pxa2xx_spi.h +++ b/include/asm-arm/arch-pxa/pxa2xx_spi.h | |||
@@ -22,32 +22,8 @@ | |||
22 | #define PXA2XX_CS_ASSERT (0x01) | 22 | #define PXA2XX_CS_ASSERT (0x01) |
23 | #define PXA2XX_CS_DEASSERT (0x02) | 23 | #define PXA2XX_CS_DEASSERT (0x02) |
24 | 24 | ||
25 | #if defined(CONFIG_PXA25x) | ||
26 | #define CLOCK_SPEED_HZ 3686400 | ||
27 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00) | ||
28 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
29 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
30 | #elif defined(CONFIG_PXA27x) | ||
31 | #define CLOCK_SPEED_HZ 13000000 | ||
32 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
33 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
34 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
35 | #endif | ||
36 | |||
37 | #define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1))))) | ||
38 | #define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2))))) | ||
39 | #define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3))))) | ||
40 | |||
41 | enum pxa_ssp_type { | ||
42 | SSP_UNDEFINED = 0, | ||
43 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
44 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
45 | PXA27x_SSP, | ||
46 | }; | ||
47 | |||
48 | /* device.platform_data for SSP controller devices */ | 25 | /* device.platform_data for SSP controller devices */ |
49 | struct pxa2xx_spi_master { | 26 | struct pxa2xx_spi_master { |
50 | enum pxa_ssp_type ssp_type; | ||
51 | u32 clock_enable; | 27 | u32 clock_enable; |
52 | u16 num_chipselect; | 28 | u16 num_chipselect; |
53 | u8 enable_dma; | 29 | u8 enable_dma; |
diff --git a/include/asm-arm/arch-pxa/pxa3xx-regs.h b/include/asm-arm/arch-pxa/pxa3xx-regs.h index 3900a0ca0bc0..66d54119757c 100644 --- a/include/asm-arm/arch-pxa/pxa3xx-regs.h +++ b/include/asm-arm/arch-pxa/pxa3xx-regs.h | |||
@@ -14,6 +14,92 @@ | |||
14 | #define __ASM_ARCH_PXA3XX_REGS_H | 14 | #define __ASM_ARCH_PXA3XX_REGS_H |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Slave Power Managment Unit | ||
18 | */ | ||
19 | #define ASCR __REG(0x40f40000) /* Application Subsystem Power Status/Configuration */ | ||
20 | #define ARSR __REG(0x40f40004) /* Application Subsystem Reset Status */ | ||
21 | #define AD3ER __REG(0x40f40008) /* Application Subsystem Wake-Up from D3 Enable */ | ||
22 | #define AD3SR __REG(0x40f4000c) /* Application Subsystem Wake-Up from D3 Status */ | ||
23 | #define AD2D0ER __REG(0x40f40010) /* Application Subsystem Wake-Up from D2 to D0 Enable */ | ||
24 | #define AD2D0SR __REG(0x40f40014) /* Application Subsystem Wake-Up from D2 to D0 Status */ | ||
25 | #define AD2D1ER __REG(0x40f40018) /* Application Subsystem Wake-Up from D2 to D1 Enable */ | ||
26 | #define AD2D1SR __REG(0x40f4001c) /* Application Subsystem Wake-Up from D2 to D1 Status */ | ||
27 | #define AD1D0ER __REG(0x40f40020) /* Application Subsystem Wake-Up from D1 to D0 Enable */ | ||
28 | #define AD1D0SR __REG(0x40f40024) /* Application Subsystem Wake-Up from D1 to D0 Status */ | ||
29 | #define AGENP __REG(0x40f4002c) /* Application Subsystem General Purpose */ | ||
30 | #define AD3R __REG(0x40f40030) /* Application Subsystem D3 Configuration */ | ||
31 | #define AD2R __REG(0x40f40034) /* Application Subsystem D2 Configuration */ | ||
32 | #define AD1R __REG(0x40f40038) /* Application Subsystem D1 Configuration */ | ||
33 | |||
34 | /* | ||
35 | * Application Subsystem Configuration bits. | ||
36 | */ | ||
37 | #define ASCR_RDH (1 << 31) | ||
38 | #define ASCR_D1S (1 << 2) | ||
39 | #define ASCR_D2S (1 << 1) | ||
40 | #define ASCR_D3S (1 << 0) | ||
41 | |||
42 | /* | ||
43 | * Application Reset Status bits. | ||
44 | */ | ||
45 | #define ARSR_GPR (1 << 3) | ||
46 | #define ARSR_LPMR (1 << 2) | ||
47 | #define ARSR_WDT (1 << 1) | ||
48 | #define ARSR_HWR (1 << 0) | ||
49 | |||
50 | /* | ||
51 | * Application Subsystem Wake-Up bits. | ||
52 | */ | ||
53 | #define ADXER_WRTC (1 << 31) /* RTC */ | ||
54 | #define ADXER_WOST (1 << 30) /* OS Timer */ | ||
55 | #define ADXER_WTSI (1 << 29) /* Touchscreen */ | ||
56 | #define ADXER_WUSBH (1 << 28) /* USB host */ | ||
57 | #define ADXER_WUSB2 (1 << 26) /* USB client 2.0 */ | ||
58 | #define ADXER_WMSL0 (1 << 24) /* MSL port 0*/ | ||
59 | #define ADXER_WDMUX3 (1 << 23) /* USB EDMUX3 */ | ||
60 | #define ADXER_WDMUX2 (1 << 22) /* USB EDMUX2 */ | ||
61 | #define ADXER_WKP (1 << 21) /* Keypad */ | ||
62 | #define ADXER_WUSIM1 (1 << 20) /* USIM Port 1 */ | ||
63 | #define ADXER_WUSIM0 (1 << 19) /* USIM Port 0 */ | ||
64 | #define ADXER_WOTG (1 << 16) /* USBOTG input */ | ||
65 | #define ADXER_MFP_WFLASH (1 << 15) /* MFP: Data flash busy */ | ||
66 | #define ADXER_MFP_GEN12 (1 << 14) /* MFP: MMC3/GPIO/OST inputs */ | ||
67 | #define ADXER_MFP_WMMC2 (1 << 13) /* MFP: MMC2 */ | ||
68 | #define ADXER_MFP_WMMC1 (1 << 12) /* MFP: MMC1 */ | ||
69 | #define ADXER_MFP_WI2C (1 << 11) /* MFP: I2C */ | ||
70 | #define ADXER_MFP_WSSP4 (1 << 10) /* MFP: SSP4 */ | ||
71 | #define ADXER_MFP_WSSP3 (1 << 9) /* MFP: SSP3 */ | ||
72 | #define ADXER_MFP_WMAXTRIX (1 << 8) /* MFP: matrix keypad */ | ||
73 | #define ADXER_MFP_WUART3 (1 << 7) /* MFP: UART3 */ | ||
74 | #define ADXER_MFP_WUART2 (1 << 6) /* MFP: UART2 */ | ||
75 | #define ADXER_MFP_WUART1 (1 << 5) /* MFP: UART1 */ | ||
76 | #define ADXER_MFP_WSSP2 (1 << 4) /* MFP: SSP2 */ | ||
77 | #define ADXER_MFP_WSSP1 (1 << 3) /* MFP: SSP1 */ | ||
78 | #define ADXER_MFP_WAC97 (1 << 2) /* MFP: AC97 */ | ||
79 | #define ADXER_WEXTWAKE1 (1 << 1) /* External Wake 1 */ | ||
80 | #define ADXER_WEXTWAKE0 (1 << 0) /* External Wake 0 */ | ||
81 | |||
82 | /* | ||
83 | * AD3R/AD2R/AD1R bits. R2-R5 are only defined for PXA320. | ||
84 | */ | ||
85 | #define ADXR_L2 (1 << 8) | ||
86 | #define ADXR_R5 (1 << 5) | ||
87 | #define ADXR_R4 (1 << 4) | ||
88 | #define ADXR_R3 (1 << 3) | ||
89 | #define ADXR_R2 (1 << 2) | ||
90 | #define ADXR_R1 (1 << 1) | ||
91 | #define ADXR_R0 (1 << 0) | ||
92 | |||
93 | /* | ||
94 | * Values for PWRMODE CP15 register | ||
95 | */ | ||
96 | #define PXA3xx_PM_S3D4C4 0x07 /* aka deep sleep */ | ||
97 | #define PXA3xx_PM_S2D3C4 0x06 /* aka sleep */ | ||
98 | #define PXA3xx_PM_S0D2C2 0x03 /* aka standby */ | ||
99 | #define PXA3xx_PM_S0D1C2 0x02 /* aka LCD refresh */ | ||
100 | #define PXA3xx_PM_S0D0C1 0x01 | ||
101 | |||
102 | /* | ||
17 | * Application Subsystem Clock | 103 | * Application Subsystem Clock |
18 | */ | 104 | */ |
19 | #define ACCR __REG(0x41340000) /* Application Subsystem Clock Configuration Register */ | 105 | #define ACCR __REG(0x41340000) /* Application Subsystem Clock Configuration Register */ |
diff --git a/include/asm-arm/arch-pxa/regs-ssp.h b/include/asm-arm/arch-pxa/regs-ssp.h new file mode 100644 index 000000000000..991cb688db75 --- /dev/null +++ b/include/asm-arm/arch-pxa/regs-ssp.h | |||
@@ -0,0 +1,112 @@ | |||
1 | #ifndef __ASM_ARCH_REGS_SSP_H | ||
2 | #define __ASM_ARCH_REGS_SSP_H | ||
3 | |||
4 | /* | ||
5 | * SSP Serial Port Registers | ||
6 | * PXA250, PXA255, PXA26x and PXA27x SSP controllers are all slightly different. | ||
7 | * PXA255, PXA26x and PXA27x have extra ports, registers and bits. | ||
8 | */ | ||
9 | |||
10 | #define SSCR0 (0x00) /* SSP Control Register 0 */ | ||
11 | #define SSCR1 (0x04) /* SSP Control Register 1 */ | ||
12 | #define SSSR (0x08) /* SSP Status Register */ | ||
13 | #define SSITR (0x0C) /* SSP Interrupt Test Register */ | ||
14 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ | ||
15 | |||
16 | #define SSTO (0x28) /* SSP Time Out Register */ | ||
17 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ | ||
18 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ | ||
19 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ | ||
20 | #define SSTSS (0x38) /* SSP Timeslot Status */ | ||
21 | #define SSACD (0x3C) /* SSP Audio Clock Divider */ | ||
22 | |||
23 | /* Common PXA2xx bits first */ | ||
24 | #define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */ | ||
25 | #define SSCR0_DataSize(x) ((x) - 1) /* Data Size Select [4..16] */ | ||
26 | #define SSCR0_FRF (0x00000030) /* FRame Format (mask) */ | ||
27 | #define SSCR0_Motorola (0x0 << 4) /* Motorola's Serial Peripheral Interface (SPI) */ | ||
28 | #define SSCR0_TI (0x1 << 4) /* Texas Instruments' Synchronous Serial Protocol (SSP) */ | ||
29 | #define SSCR0_National (0x2 << 4) /* National Microwire */ | ||
30 | #define SSCR0_ECS (1 << 6) /* External clock select */ | ||
31 | #define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */ | ||
32 | #if defined(CONFIG_PXA25x) | ||
33 | #define SSCR0_SCR (0x0000ff00) /* Serial Clock Rate (mask) */ | ||
34 | #define SSCR0_SerClkDiv(x) ((((x) - 2)/2) << 8) /* Divisor [2..512] */ | ||
35 | #elif defined(CONFIG_PXA27x) | ||
36 | #define SSCR0_SCR (0x000fff00) /* Serial Clock Rate (mask) */ | ||
37 | #define SSCR0_SerClkDiv(x) (((x) - 1) << 8) /* Divisor [1..4096] */ | ||
38 | #define SSCR0_EDSS (1 << 20) /* Extended data size select */ | ||
39 | #define SSCR0_NCS (1 << 21) /* Network clock select */ | ||
40 | #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ | ||
41 | #define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ | ||
42 | #define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ | ||
43 | #define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ | ||
44 | #define SSCR0_ADC (1 << 30) /* Audio clock select */ | ||
45 | #define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ | ||
46 | #endif | ||
47 | |||
48 | #define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */ | ||
49 | #define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */ | ||
50 | #define SSCR1_LBM (1 << 2) /* Loop-Back Mode */ | ||
51 | #define SSCR1_SPO (1 << 3) /* Motorola SPI SSPSCLK polarity setting */ | ||
52 | #define SSCR1_SPH (1 << 4) /* Motorola SPI SSPSCLK phase setting */ | ||
53 | #define SSCR1_MWDS (1 << 5) /* Microwire Transmit Data Size */ | ||
54 | #define SSCR1_TFT (0x000003c0) /* Transmit FIFO Threshold (mask) */ | ||
55 | #define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..16] */ | ||
56 | #define SSCR1_RFT (0x00003c00) /* Receive FIFO Threshold (mask) */ | ||
57 | #define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..16] */ | ||
58 | |||
59 | #define SSSR_TNF (1 << 2) /* Transmit FIFO Not Full */ | ||
60 | #define SSSR_RNE (1 << 3) /* Receive FIFO Not Empty */ | ||
61 | #define SSSR_BSY (1 << 4) /* SSP Busy */ | ||
62 | #define SSSR_TFS (1 << 5) /* Transmit FIFO Service Request */ | ||
63 | #define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */ | ||
64 | #define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */ | ||
65 | |||
66 | #define SSCR0_TIM (1 << 23) /* Transmit FIFO Under Run Interrupt Mask */ | ||
67 | #define SSCR0_RIM (1 << 22) /* Receive FIFO Over Run interrupt Mask */ | ||
68 | #define SSCR0_NCS (1 << 21) /* Network Clock Select */ | ||
69 | #define SSCR0_EDSS (1 << 20) /* Extended Data Size Select */ | ||
70 | |||
71 | /* extra bits in PXA255, PXA26x and PXA27x SSP ports */ | ||
72 | #define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */ | ||
73 | #define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */ | ||
74 | #define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */ | ||
75 | #define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */ | ||
76 | #define SSCR1_EBCEI (1 << 29) /* Enable Bit Count Error interrupt */ | ||
77 | #define SSCR1_SCFR (1 << 28) /* Slave Clock free Running */ | ||
78 | #define SSCR1_ECRA (1 << 27) /* Enable Clock Request A */ | ||
79 | #define SSCR1_ECRB (1 << 26) /* Enable Clock request B */ | ||
80 | #define SSCR1_SCLKDIR (1 << 25) /* Serial Bit Rate Clock Direction */ | ||
81 | #define SSCR1_SFRMDIR (1 << 24) /* Frame Direction */ | ||
82 | #define SSCR1_RWOT (1 << 23) /* Receive Without Transmit */ | ||
83 | #define SSCR1_TRAIL (1 << 22) /* Trailing Byte */ | ||
84 | #define SSCR1_TSRE (1 << 21) /* Transmit Service Request Enable */ | ||
85 | #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */ | ||
86 | #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */ | ||
87 | #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */ | ||
88 | #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */ | ||
89 | #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */ | ||
90 | |||
91 | #define SSSR_BCE (1 << 23) /* Bit Count Error */ | ||
92 | #define SSSR_CSS (1 << 22) /* Clock Synchronisation Status */ | ||
93 | #define SSSR_TUR (1 << 21) /* Transmit FIFO Under Run */ | ||
94 | #define SSSR_EOC (1 << 20) /* End Of Chain */ | ||
95 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ | ||
96 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | ||
97 | |||
98 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
99 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ | ||
100 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ | ||
101 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ | ||
102 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ | ||
103 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ | ||
104 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | ||
105 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | ||
106 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ | ||
107 | |||
108 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ | ||
109 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ | ||
110 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | ||
111 | |||
112 | #endif /* __ASM_ARCH_REGS_SSP_H */ | ||
diff --git a/include/asm-arm/arch-pxa/sharpsl.h b/include/asm-arm/arch-pxa/sharpsl.h index 2b0fe773213a..3b1d4a72d4d1 100644 --- a/include/asm-arm/arch-pxa/sharpsl.h +++ b/include/asm-arm/arch-pxa/sharpsl.h | |||
@@ -16,7 +16,7 @@ int corgi_ssp_max1111_get(unsigned long data); | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | struct corgits_machinfo { | 18 | struct corgits_machinfo { |
19 | unsigned long (*get_hsync_len)(void); | 19 | unsigned long (*get_hsync_invperiod)(void); |
20 | void (*put_hsync)(void); | 20 | void (*put_hsync)(void); |
21 | void (*wait_hsync)(void); | 21 | void (*wait_hsync)(void); |
22 | }; | 22 | }; |
diff --git a/include/asm-arm/arch-pxa/spitz.h b/include/asm-arm/arch-pxa/spitz.h index 4953dd324d4d..bd14365f7ed5 100644 --- a/include/asm-arm/arch-pxa/spitz.h +++ b/include/asm-arm/arch-pxa/spitz.h | |||
@@ -156,5 +156,3 @@ extern struct platform_device spitzscoop_device; | |||
156 | extern struct platform_device spitzscoop2_device; | 156 | extern struct platform_device spitzscoop2_device; |
157 | extern struct platform_device spitzssp_device; | 157 | extern struct platform_device spitzssp_device; |
158 | extern struct sharpsl_charger_machinfo spitz_pm_machinfo; | 158 | extern struct sharpsl_charger_machinfo spitz_pm_machinfo; |
159 | |||
160 | extern void spitz_lcd_power(int on, struct fb_var_screeninfo *var); | ||
diff --git a/include/asm-arm/arch-pxa/ssp.h b/include/asm-arm/arch-pxa/ssp.h index ea200551a75f..a012882c9ee6 100644 --- a/include/asm-arm/arch-pxa/ssp.h +++ b/include/asm-arm/arch-pxa/ssp.h | |||
@@ -13,10 +13,37 @@ | |||
13 | * PXA255 SSP, NSSP | 13 | * PXA255 SSP, NSSP |
14 | * PXA26x SSP, NSSP, ASSP | 14 | * PXA26x SSP, NSSP, ASSP |
15 | * PXA27x SSP1, SSP2, SSP3 | 15 | * PXA27x SSP1, SSP2, SSP3 |
16 | * PXA3xx SSP1, SSP2, SSP3, SSP4 | ||
16 | */ | 17 | */ |
17 | 18 | ||
18 | #ifndef SSP_H | 19 | #ifndef __ASM_ARCH_SSP_H |
19 | #define SSP_H | 20 | #define __ASM_ARCH_SSP_H |
21 | |||
22 | #include <linux/list.h> | ||
23 | |||
24 | enum pxa_ssp_type { | ||
25 | SSP_UNDEFINED = 0, | ||
26 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
27 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
28 | PXA27x_SSP, | ||
29 | }; | ||
30 | |||
31 | struct ssp_device { | ||
32 | struct platform_device *pdev; | ||
33 | struct list_head node; | ||
34 | |||
35 | struct clk *clk; | ||
36 | void __iomem *mmio_base; | ||
37 | unsigned long phys_base; | ||
38 | |||
39 | const char *label; | ||
40 | int port_id; | ||
41 | int type; | ||
42 | int use_count; | ||
43 | int irq; | ||
44 | int drcmr_rx; | ||
45 | int drcmr_tx; | ||
46 | }; | ||
20 | 47 | ||
21 | /* | 48 | /* |
22 | * SSP initialisation flags | 49 | * SSP initialisation flags |
@@ -31,6 +58,7 @@ struct ssp_state { | |||
31 | }; | 58 | }; |
32 | 59 | ||
33 | struct ssp_dev { | 60 | struct ssp_dev { |
61 | struct ssp_device *ssp; | ||
34 | u32 port; | 62 | u32 port; |
35 | u32 mode; | 63 | u32 mode; |
36 | u32 flags; | 64 | u32 flags; |
@@ -50,4 +78,6 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags); | |||
50 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); | 78 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); |
51 | void ssp_exit(struct ssp_dev *dev); | 79 | void ssp_exit(struct ssp_dev *dev); |
52 | 80 | ||
53 | #endif | 81 | struct ssp_device *ssp_request(int port, const char *label); |
82 | void ssp_free(struct ssp_device *); | ||
83 | #endif /* __ASM_ARCH_SSP_H */ | ||
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h index 178aa2e073ac..dadf4c20b622 100644 --- a/include/asm-arm/arch-pxa/uncompress.h +++ b/include/asm-arm/arch-pxa/uncompress.h | |||
@@ -9,19 +9,21 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define FFUART ((volatile unsigned long *)0x40100000) | 12 | #include <linux/serial_reg.h> |
13 | #define BTUART ((volatile unsigned long *)0x40200000) | 13 | #include <asm/arch/pxa-regs.h> |
14 | #define STUART ((volatile unsigned long *)0x40700000) | 14 | |
15 | #define HWUART ((volatile unsigned long *)0x41600000) | 15 | #define __REG(x) ((volatile unsigned long *)x) |
16 | 16 | ||
17 | #define UART FFUART | 17 | #define UART FFUART |
18 | 18 | ||
19 | 19 | ||
20 | static inline void putc(char c) | 20 | static inline void putc(char c) |
21 | { | 21 | { |
22 | while (!(UART[5] & 0x20)) | 22 | if (!(UART[UART_IER] & IER_UUE)) |
23 | return; | ||
24 | while (!(UART[UART_LSR] & LSR_TDRQ)) | ||
23 | barrier(); | 25 | barrier(); |
24 | UART[0] = c; | 26 | UART[UART_TX] = c; |
25 | } | 27 | } |
26 | 28 | ||
27 | /* | 29 | /* |
diff --git a/include/asm-arm/arch-pxa/zylonite.h b/include/asm-arm/arch-pxa/zylonite.h index f58b59162b82..5f717d64ea7d 100644 --- a/include/asm-arm/arch-pxa/zylonite.h +++ b/include/asm-arm/arch-pxa/zylonite.h | |||
@@ -3,9 +3,18 @@ | |||
3 | 3 | ||
4 | #define ZYLONITE_ETH_PHYS 0x14000000 | 4 | #define ZYLONITE_ETH_PHYS 0x14000000 |
5 | 5 | ||
6 | #define EXT_GPIO(x) (128 + (x)) | ||
7 | |||
6 | /* the following variables are processor specific and initialized | 8 | /* the following variables are processor specific and initialized |
7 | * by the corresponding zylonite_pxa3xx_init() | 9 | * by the corresponding zylonite_pxa3xx_init() |
8 | */ | 10 | */ |
11 | struct platform_mmc_slot { | ||
12 | int gpio_cd; | ||
13 | int gpio_wp; | ||
14 | }; | ||
15 | |||
16 | extern struct platform_mmc_slot zylonite_mmc_slot[]; | ||
17 | |||
9 | extern int gpio_backlight; | 18 | extern int gpio_backlight; |
10 | extern int gpio_eth_irq; | 19 | extern int gpio_eth_irq; |
11 | 20 | ||
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S index 9c8cd9abb82b..89076c322726 100644 --- a/include/asm-arm/arch-s3c2410/debug-macro.S +++ b/include/asm-arm/arch-s3c2410/debug-macro.S | |||
@@ -92,11 +92,9 @@ | |||
92 | #if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY) | 92 | #if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY) |
93 | #define fifo_full fifo_full_s3c2410 | 93 | #define fifo_full fifo_full_s3c2410 |
94 | #define fifo_level fifo_level_s3c2410 | 94 | #define fifo_level fifo_level_s3c2410 |
95 | #warning 2410only | ||
96 | #elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY) | 95 | #elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY) |
97 | #define fifo_full fifo_full_s3c24xx | 96 | #define fifo_full fifo_full_s3c24xx |
98 | #define fifo_level fifo_level_s3c24xx | 97 | #define fifo_level fifo_level_s3c24xx |
99 | #warning generic | ||
100 | #endif | 98 | #endif |
101 | 99 | ||
102 | /* include the reset of the code which will do the work */ | 100 | /* include the reset of the code which will do the work */ |
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h index c6e8d8f64938..4f291d9b7d93 100644 --- a/include/asm-arm/arch-s3c2410/dma.h +++ b/include/asm-arm/arch-s3c2410/dma.h | |||
@@ -214,6 +214,7 @@ struct s3c2410_dma_chan { | |||
214 | unsigned long dev_addr; | 214 | unsigned long dev_addr; |
215 | unsigned long load_timeout; | 215 | unsigned long load_timeout; |
216 | unsigned int flags; /* channel flags */ | 216 | unsigned int flags; /* channel flags */ |
217 | unsigned int hw_cfg; /* last hw config */ | ||
217 | 218 | ||
218 | struct s3c24xx_dma_map *map; /* channel hw maps */ | 219 | struct s3c24xx_dma_map *map; /* channel hw maps */ |
219 | 220 | ||
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h index 6dadf58ff984..29592c3ebf22 100644 --- a/include/asm-arm/arch-s3c2410/hardware.h +++ b/include/asm-arm/arch-s3c2410/hardware.h | |||
@@ -50,6 +50,17 @@ extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); | |||
50 | 50 | ||
51 | extern int s3c2410_gpio_getirq(unsigned int pin); | 51 | extern int s3c2410_gpio_getirq(unsigned int pin); |
52 | 52 | ||
53 | /* s3c2410_gpio_irq2pin | ||
54 | * | ||
55 | * turn the given irq number into the corresponding GPIO number | ||
56 | * | ||
57 | * returns: | ||
58 | * < 0 = no pin | ||
59 | * >=0 = gpio pin number | ||
60 | */ | ||
61 | |||
62 | extern int s3c2410_gpio_irq2pin(unsigned int irq); | ||
63 | |||
53 | #ifdef CONFIG_CPU_S3C2400 | 64 | #ifdef CONFIG_CPU_S3C2400 |
54 | 65 | ||
55 | extern int s3c2400_gpio_getirq(unsigned int pin); | 66 | extern int s3c2400_gpio_getirq(unsigned int pin); |
@@ -87,6 +98,18 @@ extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, | |||
87 | 98 | ||
88 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); | 99 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); |
89 | 100 | ||
101 | /* s3c2410_gpio_getpull | ||
102 | * | ||
103 | * Read the state of the pull-up on a given pin | ||
104 | * | ||
105 | * return: | ||
106 | * < 0 => error code | ||
107 | * 0 => enabled | ||
108 | * 1 => disabled | ||
109 | */ | ||
110 | |||
111 | extern int s3c2410_gpio_getpull(unsigned int pin); | ||
112 | |||
90 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); | 113 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); |
91 | 114 | ||
92 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); | 115 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); |
@@ -99,6 +122,11 @@ extern int s3c2440_set_dsc(unsigned int pin, unsigned int value); | |||
99 | 122 | ||
100 | #endif /* CONFIG_CPU_S3C2440 */ | 123 | #endif /* CONFIG_CPU_S3C2440 */ |
101 | 124 | ||
125 | #ifdef CONFIG_CPU_S3C2412 | ||
126 | |||
127 | extern int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state); | ||
128 | |||
129 | #endif /* CONFIG_CPU_S3C2412 */ | ||
102 | 130 | ||
103 | #endif /* __ASSEMBLY__ */ | 131 | #endif /* __ASSEMBLY__ */ |
104 | 132 | ||
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h index 996f65488d2d..d858b3eb5547 100644 --- a/include/asm-arm/arch-s3c2410/irqs.h +++ b/include/asm-arm/arch-s3c2410/irqs.h | |||
@@ -160,4 +160,7 @@ | |||
160 | #define NR_IRQS (IRQ_S3C2440_AC97+1) | 160 | #define NR_IRQS (IRQ_S3C2440_AC97+1) |
161 | #endif | 161 | #endif |
162 | 162 | ||
163 | /* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */ | ||
164 | #define FIQ_START IRQ_EINT0 | ||
165 | |||
163 | #endif /* __ASM_ARCH_IRQ_H */ | 166 | #endif /* __ASM_ARCH_IRQ_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h index e39656b7a086..dba9df9d8713 100644 --- a/include/asm-arm/arch-s3c2410/regs-clock.h +++ b/include/asm-arm/arch-s3c2410/regs-clock.h | |||
@@ -138,6 +138,8 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk) | |||
138 | #define S3C2412_CLKDIVN_PDIVN (1<<2) | 138 | #define S3C2412_CLKDIVN_PDIVN (1<<2) |
139 | #define S3C2412_CLKDIVN_HDIVN_MASK (3<<0) | 139 | #define S3C2412_CLKDIVN_HDIVN_MASK (3<<0) |
140 | #define S3C2421_CLKDIVN_ARMDIVN (1<<3) | 140 | #define S3C2421_CLKDIVN_ARMDIVN (1<<3) |
141 | #define S3C2412_CLKDIVN_DVSEN (1<<4) | ||
142 | #define S3C2412_CLKDIVN_HALFHCLK (1<<5) | ||
141 | #define S3C2412_CLKDIVN_USB48DIV (1<<6) | 143 | #define S3C2412_CLKDIVN_USB48DIV (1<<6) |
142 | #define S3C2412_CLKDIVN_UARTDIV_MASK (15<<8) | 144 | #define S3C2412_CLKDIVN_UARTDIV_MASK (15<<8) |
143 | #define S3C2412_CLKDIVN_UARTDIV_SHIFT (8) | 145 | #define S3C2412_CLKDIVN_UARTDIV_SHIFT (8) |
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h index c0748511edbc..1235df70f34e 100644 --- a/include/asm-arm/arch-s3c2410/regs-dsc.h +++ b/include/asm-arm/arch-s3c2410/regs-dsc.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) | 19 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #if defined(CONFIG_CPU_S3C2440) | 22 | #if defined(CONFIG_CPU_S3C244X) |
23 | 23 | ||
24 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) | 24 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) |
25 | #define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) | 25 | #define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) |
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index b693158b2d3c..0ad75d716ded 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h | |||
@@ -1133,12 +1133,16 @@ | |||
1133 | #define S3C2412_GPBSLPCON S3C2410_GPIOREG(0x1C) | 1133 | #define S3C2412_GPBSLPCON S3C2410_GPIOREG(0x1C) |
1134 | #define S3C2412_GPCSLPCON S3C2410_GPIOREG(0x2C) | 1134 | #define S3C2412_GPCSLPCON S3C2410_GPIOREG(0x2C) |
1135 | #define S3C2412_GPDSLPCON S3C2410_GPIOREG(0x3C) | 1135 | #define S3C2412_GPDSLPCON S3C2410_GPIOREG(0x3C) |
1136 | #define S3C2412_GPESLPCON S3C2410_GPIOREG(0x4C) | ||
1137 | #define S3C2412_GPFSLPCON S3C2410_GPIOREG(0x5C) | 1136 | #define S3C2412_GPFSLPCON S3C2410_GPIOREG(0x5C) |
1138 | #define S3C2412_GPGSLPCON S3C2410_GPIOREG(0x6C) | 1137 | #define S3C2412_GPGSLPCON S3C2410_GPIOREG(0x6C) |
1139 | #define S3C2412_GPHSLPCON S3C2410_GPIOREG(0x7C) | 1138 | #define S3C2412_GPHSLPCON S3C2410_GPIOREG(0x7C) |
1140 | 1139 | ||
1141 | /* definitions for each pin bit */ | 1140 | /* definitions for each pin bit */ |
1141 | #define S3C2412_GPIO_SLPCON_LOW ( 0x00 ) | ||
1142 | #define S3C2412_GPIO_SLPCON_HIGH ( 0x01 ) | ||
1143 | #define S3C2412_GPIO_SLPCON_IN ( 0x02 ) | ||
1144 | #define S3C2412_GPIO_SLPCON_PULL ( 0x03 ) | ||
1145 | |||
1142 | #define S3C2412_SLPCON_LOW(x) ( 0x00 << ((x) * 2)) | 1146 | #define S3C2412_SLPCON_LOW(x) ( 0x00 << ((x) * 2)) |
1143 | #define S3C2412_SLPCON_HIGH(x) ( 0x01 << ((x) * 2)) | 1147 | #define S3C2412_SLPCON_HIGH(x) ( 0x01 << ((x) * 2)) |
1144 | #define S3C2412_SLPCON_IN(x) ( 0x02 << ((x) * 2)) | 1148 | #define S3C2412_SLPCON_IN(x) ( 0x02 << ((x) * 2)) |
diff --git a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h index e4d82341f7ba..312ff93b63c6 100644 --- a/include/asm-arm/arch-s3c2410/regs-mem.h +++ b/include/asm-arm/arch-s3c2410/regs-mem.h | |||
@@ -98,16 +98,19 @@ | |||
98 | #define S3C2410_BANKCON_Tacp3 (0x1 << 2) | 98 | #define S3C2410_BANKCON_Tacp3 (0x1 << 2) |
99 | #define S3C2410_BANKCON_Tacp4 (0x2 << 2) | 99 | #define S3C2410_BANKCON_Tacp4 (0x2 << 2) |
100 | #define S3C2410_BANKCON_Tacp6 (0x3 << 2) | 100 | #define S3C2410_BANKCON_Tacp6 (0x3 << 2) |
101 | #define S3C2410_BANKCON_Tacp_SHIFT (2) | ||
101 | 102 | ||
102 | #define S3C2410_BANKCON_Tcah0 (0x0 << 4) | 103 | #define S3C2410_BANKCON_Tcah0 (0x0 << 4) |
103 | #define S3C2410_BANKCON_Tcah1 (0x1 << 4) | 104 | #define S3C2410_BANKCON_Tcah1 (0x1 << 4) |
104 | #define S3C2410_BANKCON_Tcah2 (0x2 << 4) | 105 | #define S3C2410_BANKCON_Tcah2 (0x2 << 4) |
105 | #define S3C2410_BANKCON_Tcah4 (0x3 << 4) | 106 | #define S3C2410_BANKCON_Tcah4 (0x3 << 4) |
107 | #define S3C2410_BANKCON_Tcah_SHIFT (4) | ||
106 | 108 | ||
107 | #define S3C2410_BANKCON_Tcoh0 (0x0 << 6) | 109 | #define S3C2410_BANKCON_Tcoh0 (0x0 << 6) |
108 | #define S3C2410_BANKCON_Tcoh1 (0x1 << 6) | 110 | #define S3C2410_BANKCON_Tcoh1 (0x1 << 6) |
109 | #define S3C2410_BANKCON_Tcoh2 (0x2 << 6) | 111 | #define S3C2410_BANKCON_Tcoh2 (0x2 << 6) |
110 | #define S3C2410_BANKCON_Tcoh4 (0x3 << 6) | 112 | #define S3C2410_BANKCON_Tcoh4 (0x3 << 6) |
113 | #define S3C2410_BANKCON_Tcoh_SHIFT (6) | ||
111 | 114 | ||
112 | #define S3C2410_BANKCON_Tacc1 (0x0 << 8) | 115 | #define S3C2410_BANKCON_Tacc1 (0x0 << 8) |
113 | #define S3C2410_BANKCON_Tacc2 (0x1 << 8) | 116 | #define S3C2410_BANKCON_Tacc2 (0x1 << 8) |
@@ -117,16 +120,19 @@ | |||
117 | #define S3C2410_BANKCON_Tacc8 (0x5 << 8) | 120 | #define S3C2410_BANKCON_Tacc8 (0x5 << 8) |
118 | #define S3C2410_BANKCON_Tacc10 (0x6 << 8) | 121 | #define S3C2410_BANKCON_Tacc10 (0x6 << 8) |
119 | #define S3C2410_BANKCON_Tacc14 (0x7 << 8) | 122 | #define S3C2410_BANKCON_Tacc14 (0x7 << 8) |
123 | #define S3C2410_BANKCON_Tacc_SHIFT (8) | ||
120 | 124 | ||
121 | #define S3C2410_BANKCON_Tcos0 (0x0 << 11) | 125 | #define S3C2410_BANKCON_Tcos0 (0x0 << 11) |
122 | #define S3C2410_BANKCON_Tcos1 (0x1 << 11) | 126 | #define S3C2410_BANKCON_Tcos1 (0x1 << 11) |
123 | #define S3C2410_BANKCON_Tcos2 (0x2 << 11) | 127 | #define S3C2410_BANKCON_Tcos2 (0x2 << 11) |
124 | #define S3C2410_BANKCON_Tcos4 (0x3 << 11) | 128 | #define S3C2410_BANKCON_Tcos4 (0x3 << 11) |
129 | #define S3C2410_BANKCON_Tcos_SHIFT (11) | ||
125 | 130 | ||
126 | #define S3C2410_BANKCON_Tacs0 (0x0 << 13) | 131 | #define S3C2410_BANKCON_Tacs0 (0x0 << 13) |
127 | #define S3C2410_BANKCON_Tacs1 (0x1 << 13) | 132 | #define S3C2410_BANKCON_Tacs1 (0x1 << 13) |
128 | #define S3C2410_BANKCON_Tacs2 (0x2 << 13) | 133 | #define S3C2410_BANKCON_Tacs2 (0x2 << 13) |
129 | #define S3C2410_BANKCON_Tacs4 (0x3 << 13) | 134 | #define S3C2410_BANKCON_Tacs4 (0x3 << 13) |
135 | #define S3C2410_BANKCON_Tacs_SHIFT (13) | ||
130 | 136 | ||
131 | #define S3C2410_BANKCON_SRAM (0x0 << 15) | 137 | #define S3C2410_BANKCON_SRAM (0x0 << 15) |
132 | #define S3C2400_BANKCON_EDODRAM (0x2 << 15) | 138 | #define S3C2400_BANKCON_EDODRAM (0x2 << 15) |
diff --git a/include/asm-arm/arch-s3c2410/regs-power.h b/include/asm-arm/arch-s3c2410/regs-power.h index f79987be55e8..13d13b7cfe98 100644 --- a/include/asm-arm/arch-s3c2410/regs-power.h +++ b/include/asm-arm/arch-s3c2410/regs-power.h | |||
@@ -23,7 +23,8 @@ | |||
23 | #define S3C2412_INFORM2 S3C24XX_PWRREG(0x78) | 23 | #define S3C2412_INFORM2 S3C24XX_PWRREG(0x78) |
24 | #define S3C2412_INFORM3 S3C24XX_PWRREG(0x7C) | 24 | #define S3C2412_INFORM3 S3C24XX_PWRREG(0x7C) |
25 | 25 | ||
26 | #define S3C2412_PWRCFG_BATF_IGNORE (0<<0) | 26 | #define S3C2412_PWRCFG_BATF_IRQ (1<<0) |
27 | #define S3C2412_PWRCFG_BATF_IGNORE (2<<0) | ||
27 | #define S3C2412_PWRCFG_BATF_SLEEP (3<<0) | 28 | #define S3C2412_PWRCFG_BATF_SLEEP (3<<0) |
28 | #define S3C2412_PWRCFG_BATF_MASK (3<<0) | 29 | #define S3C2412_PWRCFG_BATF_MASK (3<<0) |
29 | 30 | ||
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h index 63891786dfa0..14de4e596f87 100644 --- a/include/asm-arm/arch-s3c2410/system.h +++ b/include/asm-arm/arch-s3c2410/system.h | |||
@@ -20,6 +20,9 @@ | |||
20 | #include <asm/plat-s3c/regs-watchdog.h> | 20 | #include <asm/plat-s3c/regs-watchdog.h> |
21 | #include <asm/arch/regs-clock.h> | 21 | #include <asm/arch/regs-clock.h> |
22 | 22 | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/err.h> | ||
25 | |||
23 | void (*s3c24xx_idle)(void); | 26 | void (*s3c24xx_idle)(void); |
24 | void (*s3c24xx_reset_hook)(void); | 27 | void (*s3c24xx_reset_hook)(void); |
25 | 28 | ||
@@ -59,6 +62,8 @@ static void arch_idle(void) | |||
59 | static void | 62 | static void |
60 | arch_reset(char mode) | 63 | arch_reset(char mode) |
61 | { | 64 | { |
65 | struct clk *wdtclk; | ||
66 | |||
62 | if (mode == 's') { | 67 | if (mode == 's') { |
63 | cpu_reset(0); | 68 | cpu_reset(0); |
64 | } | 69 | } |
@@ -70,19 +75,28 @@ arch_reset(char mode) | |||
70 | 75 | ||
71 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ | 76 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ |
72 | 77 | ||
78 | wdtclk = clk_get(NULL, "watchdog"); | ||
79 | if (!IS_ERR(wdtclk)) { | ||
80 | clk_enable(wdtclk); | ||
81 | } else | ||
82 | printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); | ||
83 | |||
73 | /* put initial values into count and data */ | 84 | /* put initial values into count and data */ |
74 | __raw_writel(0x100, S3C2410_WTCNT); | 85 | __raw_writel(0x80, S3C2410_WTCNT); |
75 | __raw_writel(0x100, S3C2410_WTDAT); | 86 | __raw_writel(0x80, S3C2410_WTDAT); |
76 | 87 | ||
77 | /* set the watchdog to go and reset... */ | 88 | /* set the watchdog to go and reset... */ |
78 | __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | | 89 | __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | |
79 | S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); | 90 | S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); |
80 | 91 | ||
81 | /* wait for reset to assert... */ | 92 | /* wait for reset to assert... */ |
82 | mdelay(5000); | 93 | mdelay(500); |
83 | 94 | ||
84 | printk(KERN_ERR "Watchdog reset failed to assert reset\n"); | 95 | printk(KERN_ERR "Watchdog reset failed to assert reset\n"); |
85 | 96 | ||
97 | /* delay to allow the serial port to show the message */ | ||
98 | mdelay(50); | ||
99 | |||
86 | /* we'll take a jump through zero as a poor second */ | 100 | /* we'll take a jump through zero as a poor second */ |
87 | cpu_reset(0); | 101 | cpu_reset(0); |
88 | } | 102 | } |
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 6c1c968b2987..759a97b56eed 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
@@ -94,6 +94,14 @@ | |||
94 | # endif | 94 | # endif |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | #if defined(CONFIG_CPU_FEROCEON) | ||
98 | # ifdef _CACHE | ||
99 | # define MULTI_CACHE 1 | ||
100 | # else | ||
101 | # define _CACHE feroceon | ||
102 | # endif | ||
103 | #endif | ||
104 | |||
97 | #if defined(CONFIG_CPU_V6) | 105 | #if defined(CONFIG_CPU_V6) |
98 | //# ifdef _CACHE | 106 | //# ifdef _CACHE |
99 | # define MULTI_CACHE 1 | 107 | # define MULTI_CACHE 1 |
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h index f31cda5a55ee..392eb5332323 100644 --- a/include/asm-arm/fpstate.h +++ b/include/asm-arm/fpstate.h | |||
@@ -17,14 +17,18 @@ | |||
17 | /* | 17 | /* |
18 | * VFP storage area has: | 18 | * VFP storage area has: |
19 | * - FPEXC, FPSCR, FPINST and FPINST2. | 19 | * - FPEXC, FPSCR, FPINST and FPINST2. |
20 | * - 16 double precision data registers | 20 | * - 16 or 32 double precision data registers |
21 | * - an implementation-dependant word of state for FLDMX/FSTMX | 21 | * - an implementation-dependant word of state for FLDMX/FSTMX (pre-ARMv6) |
22 | * | 22 | * |
23 | * FPEXC will always be non-zero once the VFP has been used in this process. | 23 | * FPEXC will always be non-zero once the VFP has been used in this process. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | struct vfp_hard_struct { | 26 | struct vfp_hard_struct { |
27 | #ifdef CONFIG_VFPv3 | ||
28 | __u64 fpregs[32]; | ||
29 | #else | ||
27 | __u64 fpregs[16]; | 30 | __u64 fpregs[16]; |
31 | #endif | ||
28 | #if __LINUX_ARM_ARCH__ < 6 | 32 | #if __LINUX_ARM_ARCH__ < 6 |
29 | __u32 fpmx_state; | 33 | __u32 fpmx_state; |
30 | #endif | 34 | #endif |
@@ -35,6 +39,7 @@ struct vfp_hard_struct { | |||
35 | */ | 39 | */ |
36 | __u32 fpinst; | 40 | __u32 fpinst; |
37 | __u32 fpinst2; | 41 | __u32 fpinst2; |
42 | |||
38 | #ifdef CONFIG_SMP | 43 | #ifdef CONFIG_SMP |
39 | __u32 cpu; | 44 | __u32 cpu; |
40 | #endif | 45 | #endif |
diff --git a/include/asm-arm/kprobes.h b/include/asm-arm/kprobes.h new file mode 100644 index 000000000000..4e7bd32288ae --- /dev/null +++ b/include/asm-arm/kprobes.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * include/asm-arm/kprobes.h | ||
3 | * | ||
4 | * Copyright (C) 2006, 2007 Motorola Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _ARM_KPROBES_H | ||
17 | #define _ARM_KPROBES_H | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/ptrace.h> | ||
21 | #include <linux/percpu.h> | ||
22 | |||
23 | #define ARCH_SUPPORTS_KRETPROBES | ||
24 | #define __ARCH_WANT_KPROBES_INSN_SLOT | ||
25 | #define MAX_INSN_SIZE 2 | ||
26 | #define MAX_STACK_SIZE 64 /* 32 would probably be OK */ | ||
27 | |||
28 | /* | ||
29 | * This undefined instruction must be unique and | ||
30 | * reserved solely for kprobes' use. | ||
31 | */ | ||
32 | #define KPROBE_BREAKPOINT_INSTRUCTION 0xe7f001f8 | ||
33 | |||
34 | #define regs_return_value(regs) ((regs)->ARM_r0) | ||
35 | #define flush_insn_slot(p) do { } while (0) | ||
36 | #define kretprobe_blacklist_size 0 | ||
37 | |||
38 | typedef u32 kprobe_opcode_t; | ||
39 | |||
40 | struct kprobe; | ||
41 | typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *); | ||
42 | |||
43 | /* Architecture specific copy of original instruction. */ | ||
44 | struct arch_specific_insn { | ||
45 | kprobe_opcode_t *insn; | ||
46 | kprobe_insn_handler_t *insn_handler; | ||
47 | }; | ||
48 | |||
49 | struct prev_kprobe { | ||
50 | struct kprobe *kp; | ||
51 | unsigned int status; | ||
52 | }; | ||
53 | |||
54 | /* per-cpu kprobe control block */ | ||
55 | struct kprobe_ctlblk { | ||
56 | unsigned int kprobe_status; | ||
57 | struct prev_kprobe prev_kprobe; | ||
58 | struct pt_regs jprobe_saved_regs; | ||
59 | char jprobes_stack[MAX_STACK_SIZE]; | ||
60 | }; | ||
61 | |||
62 | void arch_remove_kprobe(struct kprobe *); | ||
63 | |||
64 | int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr); | ||
65 | int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); | ||
66 | int kprobe_exceptions_notify(struct notifier_block *self, | ||
67 | unsigned long val, void *data); | ||
68 | |||
69 | enum kprobe_insn { | ||
70 | INSN_REJECTED, | ||
71 | INSN_GOOD, | ||
72 | INSN_GOOD_NO_SLOT | ||
73 | }; | ||
74 | |||
75 | enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t, | ||
76 | struct arch_specific_insn *); | ||
77 | void __init arm_kprobe_decode_init(void); | ||
78 | |||
79 | #endif /* _ARM_KPROBES_H */ | ||
diff --git a/include/asm-arm/plat-s3c24xx/dma.h b/include/asm-arm/plat-s3c24xx/dma.h index 2c59406435e5..c78efe316fc8 100644 --- a/include/asm-arm/plat-s3c24xx/dma.h +++ b/include/asm-arm/plat-s3c24xx/dma.h | |||
@@ -32,6 +32,7 @@ struct s3c24xx_dma_map { | |||
32 | struct s3c24xx_dma_addr hw_addr; | 32 | struct s3c24xx_dma_addr hw_addr; |
33 | 33 | ||
34 | unsigned long channels[S3C2410_DMA_CHANNELS]; | 34 | unsigned long channels[S3C2410_DMA_CHANNELS]; |
35 | unsigned long channels_rx[S3C2410_DMA_CHANNELS]; | ||
35 | }; | 36 | }; |
36 | 37 | ||
37 | struct s3c24xx_dma_selection { | 38 | struct s3c24xx_dma_selection { |
@@ -41,6 +42,10 @@ struct s3c24xx_dma_selection { | |||
41 | 42 | ||
42 | void (*select)(struct s3c2410_dma_chan *chan, | 43 | void (*select)(struct s3c2410_dma_chan *chan, |
43 | struct s3c24xx_dma_map *map); | 44 | struct s3c24xx_dma_map *map); |
45 | |||
46 | void (*direction)(struct s3c2410_dma_chan *chan, | ||
47 | struct s3c24xx_dma_map *map, | ||
48 | enum s3c2410_dmasrc dir); | ||
44 | }; | 49 | }; |
45 | 50 | ||
46 | extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel); | 51 | extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel); |
diff --git a/include/asm-arm/plat-s3c24xx/irq.h b/include/asm-arm/plat-s3c24xx/irq.h index 8af6d9579b31..45746a995343 100644 --- a/include/asm-arm/plat-s3c24xx/irq.h +++ b/include/asm-arm/plat-s3c24xx/irq.h | |||
@@ -15,7 +15,9 @@ | |||
15 | 15 | ||
16 | #define EXTINT_OFF (IRQ_EINT4 - 4) | 16 | #define EXTINT_OFF (IRQ_EINT4 - 4) |
17 | 17 | ||
18 | /* these are exported for arch/arm/mach-* usage */ | ||
18 | extern struct irq_chip s3c_irq_level_chip; | 19 | extern struct irq_chip s3c_irq_level_chip; |
20 | extern struct irq_chip s3c_irq_chip; | ||
19 | 21 | ||
20 | static inline void | 22 | static inline void |
21 | s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit, | 23 | s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit, |
diff --git a/include/asm-arm/plat-s3c24xx/regs-s3c2412-iis.h b/include/asm-arm/plat-s3c24xx/regs-s3c2412-iis.h new file mode 100644 index 000000000000..25d4058bcfed --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/regs-s3c2412-iis.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/regs-s3c2412-iis.h | ||
2 | * | ||
3 | * Copyright 2007 Simtec Electronics <linux@simtec.co.uk> | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * S3C2412 IIS register definition | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_REGS_S3C2412_IIS_H | ||
14 | #define __ASM_ARCH_REGS_S3C2412_IIS_H | ||
15 | |||
16 | #define S3C2412_IISCON (0x00) | ||
17 | #define S3C2412_IISMOD (0x04) | ||
18 | #define S3C2412_IISFIC (0x08) | ||
19 | #define S3C2412_IISPSR (0x0C) | ||
20 | #define S3C2412_IISTXD (0x10) | ||
21 | #define S3C2412_IISRXD (0x14) | ||
22 | |||
23 | #define S3C2412_IISCON_LRINDEX (1 << 11) | ||
24 | #define S3C2412_IISCON_TXFIFO_EMPTY (1 << 10) | ||
25 | #define S3C2412_IISCON_RXFIFO_EMPTY (1 << 9) | ||
26 | #define S3C2412_IISCON_TXFIFO_FULL (1 << 8) | ||
27 | #define S3C2412_IISCON_RXFIFO_FULL (1 << 7) | ||
28 | #define S3C2412_IISCON_TXDMA_PAUSE (1 << 6) | ||
29 | #define S3C2412_IISCON_RXDMA_PAUSE (1 << 5) | ||
30 | #define S3C2412_IISCON_TXCH_PAUSE (1 << 4) | ||
31 | #define S3C2412_IISCON_RXCH_PAUSE (1 << 3) | ||
32 | #define S3C2412_IISCON_TXDMA_ACTIVE (1 << 2) | ||
33 | #define S3C2412_IISCON_RXDMA_ACTIVE (1 << 1) | ||
34 | #define S3C2412_IISCON_IIS_ACTIVE (1 << 0) | ||
35 | |||
36 | #define S3C2412_IISMOD_MASTER_INTERNAL (0 << 10) | ||
37 | #define S3C2412_IISMOD_MASTER_EXTERNAL (1 << 10) | ||
38 | #define S3C2412_IISMOD_SLAVE (2 << 10) | ||
39 | #define S3C2412_IISMOD_MASTER_MASK (3 << 10) | ||
40 | #define S3C2412_IISMOD_MODE_TXONLY (0 << 8) | ||
41 | #define S3C2412_IISMOD_MODE_RXONLY (1 << 8) | ||
42 | #define S3C2412_IISMOD_MODE_TXRX (2 << 8) | ||
43 | #define S3C2412_IISMOD_MODE_MASK (3 << 8) | ||
44 | #define S3C2412_IISMOD_LR_LLOW (0 << 7) | ||
45 | #define S3C2412_IISMOD_LR_RLOW (1 << 7) | ||
46 | #define S3C2412_IISMOD_SDF_IIS (0 << 5) | ||
47 | #define S3C2412_IISMOD_SDF_MSB (0 << 5) | ||
48 | #define S3C2412_IISMOD_SDF_LSB (0 << 5) | ||
49 | #define S3C2412_IISMOD_SDF_MASK (3 << 5) | ||
50 | #define S3C2412_IISMOD_RCLK_256FS (0 << 3) | ||
51 | #define S3C2412_IISMOD_RCLK_512FS (1 << 3) | ||
52 | #define S3C2412_IISMOD_RCLK_384FS (2 << 3) | ||
53 | #define S3C2412_IISMOD_RCLK_768FS (3 << 3) | ||
54 | #define S3C2412_IISMOD_RCLK_MASK (3 << 3) | ||
55 | #define S3C2412_IISMOD_BCLK_32FS (0 << 1) | ||
56 | #define S3C2412_IISMOD_BCLK_48FS (1 << 1) | ||
57 | #define S3C2412_IISMOD_BCLK_16FS (2 << 1) | ||
58 | #define S3C2412_IISMOD_BCLK_24FS (3 << 1) | ||
59 | #define S3C2412_IISMOD_BCLK_MASK (3 << 1) | ||
60 | #define S3C2412_IISMOD_8BIT (1 << 0) | ||
61 | |||
62 | #define S3C2412_IISPSR_PSREN (1 << 15) | ||
63 | |||
64 | #define S3C2412_IISFIC_TXFLUSH (1 << 15) | ||
65 | #define S3C2412_IISFIC_RXFLUSH (1 << 7) | ||
66 | #define S3C2412_IISFIC_TXCOUNT(x) (((x) >> 8) & 0xf) | ||
67 | #define S3C2412_IISFIC_RXCOUNT(x) (((x) >> 0) & 0xf) | ||
68 | |||
69 | |||
70 | |||
71 | #endif /* __ASM_ARCH_REGS_S3C2412_IIS_H */ | ||
72 | |||
diff --git a/include/asm-arm/plat-s3c24xx/regs-spi.h b/include/asm-arm/plat-s3c24xx/regs-spi.h index 4a499a138256..ea565b007d04 100644 --- a/include/asm-arm/plat-s3c24xx/regs-spi.h +++ b/include/asm-arm/plat-s3c24xx/regs-spi.h | |||
@@ -17,6 +17,21 @@ | |||
17 | 17 | ||
18 | #define S3C2410_SPCON (0x00) | 18 | #define S3C2410_SPCON (0x00) |
19 | 19 | ||
20 | #define S3C2412_SPCON_RXFIFO_RB2 (0<<14) | ||
21 | #define S3C2412_SPCON_RXFIFO_RB4 (1<<14) | ||
22 | #define S3C2412_SPCON_RXFIFO_RB12 (2<<14) | ||
23 | #define S3C2412_SPCON_RXFIFO_RB14 (3<<14) | ||
24 | #define S3C2412_SPCON_TXFIFO_RB2 (0<<12) | ||
25 | #define S3C2412_SPCON_TXFIFO_RB4 (1<<12) | ||
26 | #define S3C2412_SPCON_TXFIFO_RB12 (2<<12) | ||
27 | #define S3C2412_SPCON_TXFIFO_RB14 (3<<12) | ||
28 | #define S3C2412_SPCON_RXFIFO_RESET (1<<11) /* RxFIFO reset */ | ||
29 | #define S3C2412_SPCON_TXFIFO_RESET (1<<10) /* TxFIFO reset */ | ||
30 | #define S3C2412_SPCON_RXFIFO_EN (1<<9) /* RxFIFO Enable */ | ||
31 | #define S3C2412_SPCON_TXFIFO_EN (1<<8) /* TxFIFO Enable */ | ||
32 | |||
33 | #define S3C2412_SPCON_DIRC_RX (1<<7) | ||
34 | |||
20 | #define S3C2410_SPCON_SMOD_DMA (2<<5) /* DMA mode */ | 35 | #define S3C2410_SPCON_SMOD_DMA (2<<5) /* DMA mode */ |
21 | #define S3C2410_SPCON_SMOD_INT (1<<5) /* interrupt mode */ | 36 | #define S3C2410_SPCON_SMOD_INT (1<<5) /* interrupt mode */ |
22 | #define S3C2410_SPCON_SMOD_POLL (0<<5) /* polling mode */ | 37 | #define S3C2410_SPCON_SMOD_POLL (0<<5) /* polling mode */ |
@@ -34,10 +49,19 @@ | |||
34 | 49 | ||
35 | #define S3C2410_SPSTA (0x04) | 50 | #define S3C2410_SPSTA (0x04) |
36 | 51 | ||
52 | #define S3C2412_SPSTA_RXFIFO_AE (1<<11) | ||
53 | #define S3C2412_SPSTA_TXFIFO_AE (1<<10) | ||
54 | #define S3C2412_SPSTA_RXFIFO_ERROR (1<<9) | ||
55 | #define S3C2412_SPSTA_TXFIFO_ERROR (1<<8) | ||
56 | #define S3C2412_SPSTA_RXFIFO_FIFO (1<<7) | ||
57 | #define S3C2412_SPSTA_RXFIFO_EMPTY (1<<6) | ||
58 | #define S3C2412_SPSTA_TXFIFO_NFULL (1<<5) | ||
59 | #define S3C2412_SPSTA_TXFIFO_EMPTY (1<<4) | ||
60 | |||
37 | #define S3C2410_SPSTA_DCOL (1<<2) /* Data Collision Error */ | 61 | #define S3C2410_SPSTA_DCOL (1<<2) /* Data Collision Error */ |
38 | #define S3C2410_SPSTA_MULD (1<<1) /* Multi Master Error */ | 62 | #define S3C2410_SPSTA_MULD (1<<1) /* Multi Master Error */ |
39 | #define S3C2410_SPSTA_READY (1<<0) /* Data Tx/Rx ready */ | 63 | #define S3C2410_SPSTA_READY (1<<0) /* Data Tx/Rx ready */ |
40 | 64 | #define S3C2412_SPSTA_READY_ORG (1<<3) | |
41 | 65 | ||
42 | #define S3C2410_SPPIN (0x08) | 66 | #define S3C2410_SPPIN (0x08) |
43 | 67 | ||
@@ -46,9 +70,13 @@ | |||
46 | #define S3C2400_SPPIN_nCS (1<<1) /* SPI Card Select */ | 70 | #define S3C2400_SPPIN_nCS (1<<1) /* SPI Card Select */ |
47 | #define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ | 71 | #define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ |
48 | 72 | ||
49 | |||
50 | #define S3C2410_SPPRE (0x0C) | 73 | #define S3C2410_SPPRE (0x0C) |
51 | #define S3C2410_SPTDAT (0x10) | 74 | #define S3C2410_SPTDAT (0x10) |
52 | #define S3C2410_SPRDAT (0x14) | 75 | #define S3C2410_SPRDAT (0x14) |
53 | 76 | ||
77 | #define S3C2412_TXFIFO (0x18) | ||
78 | #define S3C2412_RXFIFO (0x18) | ||
79 | #define S3C2412_SPFIC (0x24) | ||
80 | |||
81 | |||
54 | #endif /* __ASM_ARCH_REGS_SPI_H */ | 82 | #endif /* __ASM_ARCH_REGS_SPI_H */ |
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h index 5599d4e5e708..a4ce457199d3 100644 --- a/include/asm-arm/proc-fns.h +++ b/include/asm-arm/proc-fns.h | |||
@@ -185,6 +185,14 @@ | |||
185 | # define CPU_NAME cpu_xsc3 | 185 | # define CPU_NAME cpu_xsc3 |
186 | # endif | 186 | # endif |
187 | # endif | 187 | # endif |
188 | # ifdef CONFIG_CPU_FEROCEON | ||
189 | # ifdef CPU_NAME | ||
190 | # undef MULTI_CPU | ||
191 | # define MULTI_CPU | ||
192 | # else | ||
193 | # define CPU_NAME cpu_feroceon | ||
194 | # endif | ||
195 | # endif | ||
188 | # ifdef CONFIG_CPU_V6 | 196 | # ifdef CONFIG_CPU_V6 |
189 | # ifdef CPU_NAME | 197 | # ifdef CPU_NAME |
190 | # undef MULTI_CPU | 198 | # undef MULTI_CPU |
diff --git a/include/asm-arm/traps.h b/include/asm-arm/traps.h index d4f34dc83eb0..f1541afcf85c 100644 --- a/include/asm-arm/traps.h +++ b/include/asm-arm/traps.h | |||
@@ -15,4 +15,13 @@ struct undef_hook { | |||
15 | void register_undef_hook(struct undef_hook *hook); | 15 | void register_undef_hook(struct undef_hook *hook); |
16 | void unregister_undef_hook(struct undef_hook *hook); | 16 | void unregister_undef_hook(struct undef_hook *hook); |
17 | 17 | ||
18 | static inline int in_exception_text(unsigned long ptr) | ||
19 | { | ||
20 | extern char __exception_text_start[]; | ||
21 | extern char __exception_text_end[]; | ||
22 | |||
23 | return ptr >= (unsigned long)&__exception_text_start && | ||
24 | ptr < (unsigned long)&__exception_text_end; | ||
25 | } | ||
26 | |||
18 | #endif | 27 | #endif |
diff --git a/include/asm-arm/vfp.h b/include/asm-arm/vfp.h index bd6be9d7f772..5f9a2cb3d452 100644 --- a/include/asm-arm/vfp.h +++ b/include/asm-arm/vfp.h | |||
@@ -7,7 +7,11 @@ | |||
7 | 7 | ||
8 | #define FPSID cr0 | 8 | #define FPSID cr0 |
9 | #define FPSCR cr1 | 9 | #define FPSCR cr1 |
10 | #define MVFR1 cr6 | ||
11 | #define MVFR0 cr7 | ||
10 | #define FPEXC cr8 | 12 | #define FPEXC cr8 |
13 | #define FPINST cr9 | ||
14 | #define FPINST2 cr10 | ||
11 | 15 | ||
12 | /* FPSID bits */ | 16 | /* FPSID bits */ |
13 | #define FPSID_IMPLEMENTER_BIT (24) | 17 | #define FPSID_IMPLEMENTER_BIT (24) |
@@ -28,6 +32,19 @@ | |||
28 | /* FPEXC bits */ | 32 | /* FPEXC bits */ |
29 | #define FPEXC_EX (1 << 31) | 33 | #define FPEXC_EX (1 << 31) |
30 | #define FPEXC_EN (1 << 30) | 34 | #define FPEXC_EN (1 << 30) |
35 | #define FPEXC_DEX (1 << 29) | ||
36 | #define FPEXC_FP2V (1 << 28) | ||
37 | #define FPEXC_VV (1 << 27) | ||
38 | #define FPEXC_TFV (1 << 26) | ||
39 | #define FPEXC_LENGTH_BIT (8) | ||
40 | #define FPEXC_LENGTH_MASK (7 << FPEXC_LENGTH_BIT) | ||
41 | #define FPEXC_IDF (1 << 7) | ||
42 | #define FPEXC_IXF (1 << 4) | ||
43 | #define FPEXC_UFF (1 << 3) | ||
44 | #define FPEXC_OFF (1 << 2) | ||
45 | #define FPEXC_DZF (1 << 1) | ||
46 | #define FPEXC_IOF (1 << 0) | ||
47 | #define FPEXC_TRAP_MASK (FPEXC_IDF|FPEXC_IXF|FPEXC_UFF|FPEXC_OFF|FPEXC_DZF|FPEXC_IOF) | ||
31 | 48 | ||
32 | /* FPSCR bits */ | 49 | /* FPSCR bits */ |
33 | #define FPSCR_DEFAULT_NAN (1<<25) | 50 | #define FPSCR_DEFAULT_NAN (1<<25) |
@@ -55,20 +72,9 @@ | |||
55 | #define FPSCR_IXC (1<<4) | 72 | #define FPSCR_IXC (1<<4) |
56 | #define FPSCR_IDC (1<<7) | 73 | #define FPSCR_IDC (1<<7) |
57 | 74 | ||
58 | /* | 75 | /* MVFR0 bits */ |
59 | * VFP9-S specific. | 76 | #define MVFR0_A_SIMD_BIT (0) |
60 | */ | 77 | #define MVFR0_A_SIMD_MASK (0xf << MVFR0_A_SIMD_BIT) |
61 | #define FPINST cr9 | ||
62 | #define FPINST2 cr10 | ||
63 | |||
64 | /* FPEXC bits */ | ||
65 | #define FPEXC_FPV2 (1<<28) | ||
66 | #define FPEXC_LENGTH_BIT (8) | ||
67 | #define FPEXC_LENGTH_MASK (7 << FPEXC_LENGTH_BIT) | ||
68 | #define FPEXC_INV (1 << 7) | ||
69 | #define FPEXC_UFC (1 << 3) | ||
70 | #define FPEXC_OFC (1 << 2) | ||
71 | #define FPEXC_IOC (1 << 0) | ||
72 | 78 | ||
73 | /* Bit patterns for decoding the packaged operation descriptors */ | 79 | /* Bit patterns for decoding the packaged operation descriptors */ |
74 | #define VFPOPDESC_LENGTH_BIT (9) | 80 | #define VFPOPDESC_LENGTH_BIT (9) |
diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h index 27fe028b4e72..cccb3892e73c 100644 --- a/include/asm-arm/vfpmacros.h +++ b/include/asm-arm/vfpmacros.h | |||
@@ -15,19 +15,33 @@ | |||
15 | .endm | 15 | .endm |
16 | 16 | ||
17 | @ read all the working registers back into the VFP | 17 | @ read all the working registers back into the VFP |
18 | .macro VFPFLDMIA, base | 18 | .macro VFPFLDMIA, base, tmp |
19 | #if __LINUX_ARM_ARCH__ < 6 | 19 | #if __LINUX_ARM_ARCH__ < 6 |
20 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} | 20 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} |
21 | #else | 21 | #else |
22 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} | 22 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} |
23 | #endif | 23 | #endif |
24 | #ifdef CONFIG_VFPv3 | ||
25 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | ||
26 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | ||
27 | cmp \tmp, #2 @ 32 x 64bit registers? | ||
28 | ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | ||
29 | addne \base, \base, #32*4 @ step over unused register space | ||
30 | #endif | ||
24 | .endm | 31 | .endm |
25 | 32 | ||
26 | @ write all the working registers out of the VFP | 33 | @ write all the working registers out of the VFP |
27 | .macro VFPFSTMIA, base | 34 | .macro VFPFSTMIA, base, tmp |
28 | #if __LINUX_ARM_ARCH__ < 6 | 35 | #if __LINUX_ARM_ARCH__ < 6 |
29 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} | 36 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} |
30 | #else | 37 | #else |
31 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} | 38 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} |
32 | #endif | 39 | #endif |
40 | #ifdef CONFIG_VFPv3 | ||
41 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | ||
42 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | ||
43 | cmp \tmp, #2 @ 32 x 64bit registers? | ||
44 | stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | ||
45 | addne \base, \base, #32*4 @ step over unused register space | ||
46 | #endif | ||
33 | .endm | 47 | .endm |
diff --git a/include/asm-avr32/arch-at32ap/cpu.h b/include/asm-avr32/arch-at32ap/cpu.h index 0dc20261c1ea..44d0bfa1f409 100644 --- a/include/asm-avr32/arch-at32ap/cpu.h +++ b/include/asm-avr32/arch-at32ap/cpu.h | |||
@@ -30,5 +30,6 @@ | |||
30 | #define cpu_is_at91sam9261() (0) | 30 | #define cpu_is_at91sam9261() (0) |
31 | #define cpu_is_at91sam9263() (0) | 31 | #define cpu_is_at91sam9263() (0) |
32 | #define cpu_is_at91sam9rl() (0) | 32 | #define cpu_is_at91sam9rl() (0) |
33 | #define cpu_is_at91cap9() (0) | ||
33 | 34 | ||
34 | #endif /* __ASM_ARCH_CPU_H */ | 35 | #endif /* __ASM_ARCH_CPU_H */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 49b7a4c31a6d..71e7a847dffc 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -34,83 +34,10 @@ struct sg_io_hdr; | |||
34 | #define BLKDEV_MIN_RQ 4 | 34 | #define BLKDEV_MIN_RQ 4 |
35 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 35 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
36 | 36 | ||
37 | /* | 37 | int put_io_context(struct io_context *ioc); |
38 | * This is the per-process anticipatory I/O scheduler state. | ||
39 | */ | ||
40 | struct as_io_context { | ||
41 | spinlock_t lock; | ||
42 | |||
43 | void (*dtor)(struct as_io_context *aic); /* destructor */ | ||
44 | void (*exit)(struct as_io_context *aic); /* called on task exit */ | ||
45 | |||
46 | unsigned long state; | ||
47 | atomic_t nr_queued; /* queued reads & sync writes */ | ||
48 | atomic_t nr_dispatched; /* number of requests gone to the drivers */ | ||
49 | |||
50 | /* IO History tracking */ | ||
51 | /* Thinktime */ | ||
52 | unsigned long last_end_request; | ||
53 | unsigned long ttime_total; | ||
54 | unsigned long ttime_samples; | ||
55 | unsigned long ttime_mean; | ||
56 | /* Layout pattern */ | ||
57 | unsigned int seek_samples; | ||
58 | sector_t last_request_pos; | ||
59 | u64 seek_total; | ||
60 | sector_t seek_mean; | ||
61 | }; | ||
62 | |||
63 | struct cfq_queue; | ||
64 | struct cfq_io_context { | ||
65 | struct rb_node rb_node; | ||
66 | void *key; | ||
67 | |||
68 | struct cfq_queue *cfqq[2]; | ||
69 | |||
70 | struct io_context *ioc; | ||
71 | |||
72 | unsigned long last_end_request; | ||
73 | sector_t last_request_pos; | ||
74 | |||
75 | unsigned long ttime_total; | ||
76 | unsigned long ttime_samples; | ||
77 | unsigned long ttime_mean; | ||
78 | |||
79 | unsigned int seek_samples; | ||
80 | u64 seek_total; | ||
81 | sector_t seek_mean; | ||
82 | |||
83 | struct list_head queue_list; | ||
84 | |||
85 | void (*dtor)(struct io_context *); /* destructor */ | ||
86 | void (*exit)(struct io_context *); /* called on task exit */ | ||
87 | }; | ||
88 | |||
89 | /* | ||
90 | * This is the per-process I/O subsystem state. It is refcounted and | ||
91 | * kmalloc'ed. Currently all fields are modified in process io context | ||
92 | * (apart from the atomic refcount), so require no locking. | ||
93 | */ | ||
94 | struct io_context { | ||
95 | atomic_t refcount; | ||
96 | struct task_struct *task; | ||
97 | |||
98 | unsigned int ioprio_changed; | ||
99 | |||
100 | /* | ||
101 | * For request batching | ||
102 | */ | ||
103 | unsigned long last_waited; /* Time last woken after wait for request */ | ||
104 | int nr_batch_requests; /* Number of requests left in the batch */ | ||
105 | |||
106 | struct as_io_context *aic; | ||
107 | struct rb_root cic_root; | ||
108 | void *ioc_data; | ||
109 | }; | ||
110 | |||
111 | void put_io_context(struct io_context *ioc); | ||
112 | void exit_io_context(void); | 38 | void exit_io_context(void); |
113 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 39 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
40 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | ||
114 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 41 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
115 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | 42 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); |
116 | 43 | ||
@@ -429,6 +356,8 @@ struct request_queue | |||
429 | unsigned int max_segment_size; | 356 | unsigned int max_segment_size; |
430 | 357 | ||
431 | unsigned long seg_boundary_mask; | 358 | unsigned long seg_boundary_mask; |
359 | void *dma_drain_buffer; | ||
360 | unsigned int dma_drain_size; | ||
432 | unsigned int dma_alignment; | 361 | unsigned int dma_alignment; |
433 | 362 | ||
434 | struct blk_queue_tag *queue_tags; | 363 | struct blk_queue_tag *queue_tags; |
@@ -537,6 +466,8 @@ enum { | |||
537 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 466 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
538 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 467 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
539 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | 468 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) |
469 | /* rq->queuelist of dequeued request must be list_empty() */ | ||
470 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) | ||
540 | 471 | ||
541 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 472 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
542 | 473 | ||
@@ -716,29 +647,32 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
716 | } | 647 | } |
717 | 648 | ||
718 | /* | 649 | /* |
719 | * end_request() and friends. Must be called with the request queue spinlock | 650 | * blk_end_request() and friends. |
720 | * acquired. All functions called within end_request() _must_be_ atomic. | 651 | * __blk_end_request() and end_request() must be called with |
652 | * the request queue spinlock acquired. | ||
721 | * | 653 | * |
722 | * Several drivers define their own end_request and call | 654 | * Several drivers define their own end_request and call |
723 | * end_that_request_first() and end_that_request_last() | 655 | * blk_end_request() for parts of the original function. |
724 | * for parts of the original function. This prevents | 656 | * This prevents code duplication in drivers. |
725 | * code duplication in drivers. | ||
726 | */ | 657 | */ |
727 | extern int end_that_request_first(struct request *, int, int); | 658 | extern int blk_end_request(struct request *rq, int error, int nr_bytes); |
728 | extern int end_that_request_chunk(struct request *, int, int); | 659 | extern int __blk_end_request(struct request *rq, int error, int nr_bytes); |
729 | extern void end_that_request_last(struct request *, int); | 660 | extern int blk_end_bidi_request(struct request *rq, int error, int nr_bytes, |
661 | int bidi_bytes); | ||
730 | extern void end_request(struct request *, int); | 662 | extern void end_request(struct request *, int); |
731 | extern void end_queued_request(struct request *, int); | 663 | extern void end_queued_request(struct request *, int); |
732 | extern void end_dequeued_request(struct request *, int); | 664 | extern void end_dequeued_request(struct request *, int); |
665 | extern int blk_end_request_callback(struct request *rq, int error, int nr_bytes, | ||
666 | int (drv_callback)(struct request *)); | ||
733 | extern void blk_complete_request(struct request *); | 667 | extern void blk_complete_request(struct request *); |
734 | 668 | ||
735 | /* | 669 | /* |
736 | * end_that_request_first/chunk() takes an uptodate argument. we account | 670 | * blk_end_request() takes bytes instead of sectors as a complete size. |
737 | * any value <= as an io error. 0 means -EIO for compatability reasons, | 671 | * blk_rq_bytes() returns bytes left to complete in the entire request. |
738 | * any other < 0 value is the direct error type. An uptodate value of | 672 | * blk_rq_cur_bytes() returns bytes left to complete in the current segment. |
739 | * 1 indicates successful io completion | ||
740 | */ | 673 | */ |
741 | #define end_io_error(uptodate) (unlikely((uptodate) <= 0)) | 674 | extern unsigned int blk_rq_bytes(struct request *rq); |
675 | extern unsigned int blk_rq_cur_bytes(struct request *rq); | ||
742 | 676 | ||
743 | static inline void blkdev_dequeue_request(struct request *req) | 677 | static inline void blkdev_dequeue_request(struct request *req) |
744 | { | 678 | { |
@@ -760,6 +694,8 @@ extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); | |||
760 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 694 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
761 | extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); | 695 | extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); |
762 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); | 696 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); |
697 | extern int blk_queue_dma_drain(struct request_queue *q, void *buf, | ||
698 | unsigned int size); | ||
763 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); | 699 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); |
764 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); | 700 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); |
765 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); | 701 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); |
@@ -836,12 +772,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev) | |||
836 | 772 | ||
837 | static inline int queue_dma_alignment(struct request_queue *q) | 773 | static inline int queue_dma_alignment(struct request_queue *q) |
838 | { | 774 | { |
839 | int retval = 511; | 775 | return q ? q->dma_alignment : 511; |
840 | |||
841 | if (q && q->dma_alignment) | ||
842 | retval = q->dma_alignment; | ||
843 | |||
844 | return retval; | ||
845 | } | 776 | } |
846 | 777 | ||
847 | /* assumes size > 256 */ | 778 | /* assumes size > 256 */ |
@@ -894,6 +825,12 @@ static inline void exit_io_context(void) | |||
894 | { | 825 | { |
895 | } | 826 | } |
896 | 827 | ||
828 | static inline int put_io_context(struct io_context *ioc) | ||
829 | { | ||
830 | return 1; | ||
831 | } | ||
832 | |||
833 | |||
897 | #endif /* CONFIG_BLOCK */ | 834 | #endif /* CONFIG_BLOCK */ |
898 | 835 | ||
899 | #endif | 836 | #endif |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7e11d23ac36a..06dadba349ac 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -148,7 +148,7 @@ extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | |||
148 | extern void blk_trace_shutdown(struct request_queue *); | 148 | extern void blk_trace_shutdown(struct request_queue *); |
149 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | 149 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); |
150 | extern int do_blk_trace_setup(struct request_queue *q, | 150 | extern int do_blk_trace_setup(struct request_queue *q, |
151 | struct block_device *bdev, struct blk_user_trace_setup *buts); | 151 | char *name, dev_t dev, struct blk_user_trace_setup *buts); |
152 | 152 | ||
153 | 153 | ||
154 | /** | 154 | /** |
@@ -282,6 +282,11 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
282 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | 282 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); |
283 | } | 283 | } |
284 | 284 | ||
285 | extern int blk_trace_setup(request_queue_t *q, char *name, dev_t dev, | ||
286 | char __user *arg); | ||
287 | extern int blk_trace_startstop(request_queue_t *q, int start); | ||
288 | extern int blk_trace_remove(request_queue_t *q); | ||
289 | |||
285 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | 290 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ |
286 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | 291 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) |
287 | #define blk_trace_shutdown(q) do { } while (0) | 292 | #define blk_trace_shutdown(q) do { } while (0) |
@@ -290,7 +295,10 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
290 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | 295 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) |
291 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | 296 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) |
292 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | 297 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) |
293 | #define do_blk_trace_setup(q, bdev, buts) (-ENOTTY) | 298 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) |
299 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | ||
300 | #define blk_trace_startstop(q, start) (-ENOTTY) | ||
301 | #define blk_trace_remove(q) (-ENOTTY) | ||
294 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | 302 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ |
295 | #endif /* __KERNEL__ */ | 303 | #endif /* __KERNEL__ */ |
296 | #endif | 304 | #endif |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 6e35b92b1d2c..3902690647b0 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -267,10 +267,10 @@ struct hid_item { | |||
267 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 | 267 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 |
268 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 | 268 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 |
269 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 | 269 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 |
270 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800 | 270 | #define HID_QUIRK_APPLE_HAS_FN 0x00000800 |
271 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00001000 | 271 | #define HID_QUIRK_APPLE_FN_ON 0x00001000 |
272 | #define HID_QUIRK_INVERT_HWHEEL 0x00002000 | 272 | #define HID_QUIRK_INVERT_HWHEEL 0x00002000 |
273 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000 | 273 | #define HID_QUIRK_APPLE_ISO_KEYBOARD 0x00004000 |
274 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 | 274 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 |
275 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 275 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
276 | #define HID_QUIRK_IGNORE_MOUSE 0x00020000 | 276 | #define HID_QUIRK_IGNORE_MOUSE 0x00020000 |
@@ -281,6 +281,9 @@ struct hid_item { | |||
281 | #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 | 281 | #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 |
282 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 | 282 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 |
283 | #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 | 283 | #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 |
284 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000 | ||
285 | #define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000 | ||
286 | #define HID_QUIRK_MICROSOFT_KEYS 0x08000000 | ||
284 | 287 | ||
285 | /* | 288 | /* |
286 | * Separate quirks for runtime report descriptor fixup | 289 | * Separate quirks for runtime report descriptor fixup |
@@ -291,6 +294,8 @@ struct hid_item { | |||
291 | #define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 | 294 | #define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 |
292 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 | 295 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 |
293 | #define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010 | 296 | #define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010 |
297 | #define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020 | ||
298 | #define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040 | ||
294 | 299 | ||
295 | /* | 300 | /* |
296 | * This is the global environment of the parser. This information is | 301 | * This is the global environment of the parser. This information is |
@@ -456,6 +461,8 @@ struct hid_device { /* device report descriptor */ | |||
456 | 461 | ||
457 | void *driver_data; | 462 | void *driver_data; |
458 | 463 | ||
464 | __s32 delayed_value; /* For A4 Tech mice hwheel quirk */ | ||
465 | |||
459 | /* device-specific function pointers */ | 466 | /* device-specific function pointers */ |
460 | int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); | 467 | int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); |
461 | int (*hid_open) (struct hid_device *); | 468 | int (*hid_open) (struct hid_device *); |
@@ -469,7 +476,7 @@ struct hid_device { /* device report descriptor */ | |||
469 | /* handler for raw output data, used by hidraw */ | 476 | /* handler for raw output data, used by hidraw */ |
470 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 477 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); |
471 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | 478 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK |
472 | unsigned long pb_pressed_fn[BITS_TO_LONGS(KEY_CNT)]; | 479 | unsigned long apple_pressed_fn[BITS_TO_LONGS(KEY_CNT)]; |
473 | unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)]; | 480 | unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)]; |
474 | #endif | 481 | #endif |
475 | }; | 482 | }; |
@@ -520,6 +527,9 @@ extern void hidinput_disconnect(struct hid_device *); | |||
520 | int hid_set_field(struct hid_field *, unsigned, __s32); | 527 | int hid_set_field(struct hid_field *, unsigned, __s32); |
521 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); | 528 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); |
522 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | 529 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); |
530 | int hidinput_mapping_quirks(struct hid_usage *, struct input_dev *, unsigned long **, int *); | ||
531 | void hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | ||
532 | int hidinput_apple_event(struct hid_device *, struct input_dev *, struct hid_usage *, __s32); | ||
523 | void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt); | 533 | void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt); |
524 | void hid_output_report(struct hid_report *report, __u8 *data); | 534 | void hid_output_report(struct hid_report *report, __u8 *data); |
525 | void hid_free_device(struct hid_device *device); | 535 | void hid_free_device(struct hid_device *device); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 796019b22b6f..e6b3f7080679 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -137,7 +137,6 @@ extern struct group_info init_groups; | |||
137 | .time_slice = HZ, \ | 137 | .time_slice = HZ, \ |
138 | .nr_cpus_allowed = NR_CPUS, \ | 138 | .nr_cpus_allowed = NR_CPUS, \ |
139 | }, \ | 139 | }, \ |
140 | .ioprio = 0, \ | ||
141 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ | 140 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ |
142 | .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \ | 141 | .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \ |
143 | .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \ | 142 | .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \ |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h new file mode 100644 index 000000000000..593b222d9dcc --- /dev/null +++ b/include/linux/iocontext.h | |||
@@ -0,0 +1,95 @@ | |||
1 | #ifndef IOCONTEXT_H | ||
2 | #define IOCONTEXT_H | ||
3 | |||
4 | #include <linux/radix-tree.h> | ||
5 | |||
6 | /* | ||
7 | * This is the per-process anticipatory I/O scheduler state. | ||
8 | */ | ||
9 | struct as_io_context { | ||
10 | spinlock_t lock; | ||
11 | |||
12 | void (*dtor)(struct as_io_context *aic); /* destructor */ | ||
13 | void (*exit)(struct as_io_context *aic); /* called on task exit */ | ||
14 | |||
15 | unsigned long state; | ||
16 | atomic_t nr_queued; /* queued reads & sync writes */ | ||
17 | atomic_t nr_dispatched; /* number of requests gone to the drivers */ | ||
18 | |||
19 | /* IO History tracking */ | ||
20 | /* Thinktime */ | ||
21 | unsigned long last_end_request; | ||
22 | unsigned long ttime_total; | ||
23 | unsigned long ttime_samples; | ||
24 | unsigned long ttime_mean; | ||
25 | /* Layout pattern */ | ||
26 | unsigned int seek_samples; | ||
27 | sector_t last_request_pos; | ||
28 | u64 seek_total; | ||
29 | sector_t seek_mean; | ||
30 | }; | ||
31 | |||
32 | struct cfq_queue; | ||
33 | struct cfq_io_context { | ||
34 | void *key; | ||
35 | unsigned long dead_key; | ||
36 | |||
37 | struct cfq_queue *cfqq[2]; | ||
38 | |||
39 | struct io_context *ioc; | ||
40 | |||
41 | unsigned long last_end_request; | ||
42 | sector_t last_request_pos; | ||
43 | |||
44 | unsigned long ttime_total; | ||
45 | unsigned long ttime_samples; | ||
46 | unsigned long ttime_mean; | ||
47 | |||
48 | unsigned int seek_samples; | ||
49 | u64 seek_total; | ||
50 | sector_t seek_mean; | ||
51 | |||
52 | struct list_head queue_list; | ||
53 | |||
54 | void (*dtor)(struct io_context *); /* destructor */ | ||
55 | void (*exit)(struct io_context *); /* called on task exit */ | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | * I/O subsystem state of the associated processes. It is refcounted | ||
60 | * and kmalloc'ed. These could be shared between processes. | ||
61 | */ | ||
62 | struct io_context { | ||
63 | atomic_t refcount; | ||
64 | atomic_t nr_tasks; | ||
65 | |||
66 | /* all the fields below are protected by this lock */ | ||
67 | spinlock_t lock; | ||
68 | |||
69 | unsigned short ioprio; | ||
70 | unsigned short ioprio_changed; | ||
71 | |||
72 | /* | ||
73 | * For request batching | ||
74 | */ | ||
75 | unsigned long last_waited; /* Time last woken after wait for request */ | ||
76 | int nr_batch_requests; /* Number of requests left in the batch */ | ||
77 | |||
78 | struct as_io_context *aic; | ||
79 | struct radix_tree_root radix_root; | ||
80 | void *ioc_data; | ||
81 | }; | ||
82 | |||
83 | static inline struct io_context *ioc_task_link(struct io_context *ioc) | ||
84 | { | ||
85 | /* | ||
86 | * if ref count is zero, don't allow sharing (ioc is going away, it's | ||
87 | * a race). | ||
88 | */ | ||
89 | if (ioc && atomic_inc_not_zero(&ioc->refcount)) | ||
90 | return ioc; | ||
91 | |||
92 | return NULL; | ||
93 | } | ||
94 | |||
95 | #endif | ||
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index baf29387cab4..2a3bb1bb7433 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define IOPRIO_H | 2 | #define IOPRIO_H |
3 | 3 | ||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <linux/iocontext.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Gives us 8 prio classes with 13-bits of data for each class | 8 | * Gives us 8 prio classes with 13-bits of data for each class |
@@ -45,18 +46,18 @@ enum { | |||
45 | * the cpu scheduler nice value to an io priority | 46 | * the cpu scheduler nice value to an io priority |
46 | */ | 47 | */ |
47 | #define IOPRIO_NORM (4) | 48 | #define IOPRIO_NORM (4) |
48 | static inline int task_ioprio(struct task_struct *task) | 49 | static inline int task_ioprio(struct io_context *ioc) |
49 | { | 50 | { |
50 | if (ioprio_valid(task->ioprio)) | 51 | if (ioprio_valid(ioc->ioprio)) |
51 | return IOPRIO_PRIO_DATA(task->ioprio); | 52 | return IOPRIO_PRIO_DATA(ioc->ioprio); |
52 | 53 | ||
53 | return IOPRIO_NORM; | 54 | return IOPRIO_NORM; |
54 | } | 55 | } |
55 | 56 | ||
56 | static inline int task_ioprio_class(struct task_struct *task) | 57 | static inline int task_ioprio_class(struct io_context *ioc) |
57 | { | 58 | { |
58 | if (ioprio_valid(task->ioprio)) | 59 | if (ioprio_valid(ioc->ioprio)) |
59 | return IOPRIO_PRIO_CLASS(task->ioprio); | 60 | return IOPRIO_PRIO_CLASS(ioc->ioprio); |
60 | 61 | ||
61 | return IOPRIO_CLASS_BE; | 62 | return IOPRIO_CLASS_BE; |
62 | } | 63 | } |
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index d2ae6185f03b..69327b7b4ce4 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <asm/types.h> | 16 | #include <asm/types.h> |
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/mv643xx_i2c.h> | ||
18 | 19 | ||
19 | /****************************************/ | 20 | /****************************************/ |
20 | /* Processor Address Space */ | 21 | /* Processor Address Space */ |
@@ -863,7 +864,6 @@ | |||
863 | /* I2C Registers */ | 864 | /* I2C Registers */ |
864 | /****************************************/ | 865 | /****************************************/ |
865 | 866 | ||
866 | #define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c" | ||
867 | #define MV64XXX_I2C_OFFSET 0xc000 | 867 | #define MV64XXX_I2C_OFFSET 0xc000 |
868 | #define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 | 868 | #define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 |
869 | 869 | ||
@@ -968,14 +968,6 @@ struct mpsc_pdata { | |||
968 | u32 brg_clk_freq; | 968 | u32 brg_clk_freq; |
969 | }; | 969 | }; |
970 | 970 | ||
971 | /* i2c Platform Device, Driver Data */ | ||
972 | struct mv64xxx_i2c_pdata { | ||
973 | u32 freq_m; | ||
974 | u32 freq_n; | ||
975 | u32 timeout; /* In milliseconds */ | ||
976 | u32 retries; | ||
977 | }; | ||
978 | |||
979 | /* Watchdog Platform Device, Driver Data */ | 971 | /* Watchdog Platform Device, Driver Data */ |
980 | #define MV64x60_WDT_NAME "mv64x60_wdt" | 972 | #define MV64x60_WDT_NAME "mv64x60_wdt" |
981 | 973 | ||
diff --git a/include/linux/mv643xx_i2c.h b/include/linux/mv643xx_i2c.h new file mode 100644 index 000000000000..5db5152e9de5 --- /dev/null +++ b/include/linux/mv643xx_i2c.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License as published by the | ||
4 | * Free Software Foundation; either version 2 of the License, or (at your | ||
5 | * option) any later version. | ||
6 | */ | ||
7 | |||
8 | #ifndef _MV64XXX_I2C_H_ | ||
9 | #define _MV64XXX_I2C_H_ | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | |||
13 | #define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c" | ||
14 | |||
15 | /* i2c Platform Device, Driver Data */ | ||
16 | struct mv64xxx_i2c_pdata { | ||
17 | u32 freq_m; | ||
18 | u32 freq_n; | ||
19 | u32 timeout; /* In milliseconds */ | ||
20 | }; | ||
21 | |||
22 | #endif /*_MV64XXX_I2C_H_*/ | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index e3ff21dbac53..a3d567a974e8 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -7,6 +7,12 @@ | |||
7 | #include <linux/string.h> | 7 | #include <linux/string.h> |
8 | #include <asm/io.h> | 8 | #include <asm/io.h> |
9 | 9 | ||
10 | struct sg_table { | ||
11 | struct scatterlist *sgl; /* the list */ | ||
12 | unsigned int nents; /* number of mapped entries */ | ||
13 | unsigned int orig_nents; /* original size of list */ | ||
14 | }; | ||
15 | |||
10 | /* | 16 | /* |
11 | * Notes on SG table design. | 17 | * Notes on SG table design. |
12 | * | 18 | * |
@@ -106,31 +112,6 @@ static inline void sg_set_buf(struct scatterlist *sg, const void *buf, | |||
106 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | 112 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); |
107 | } | 113 | } |
108 | 114 | ||
109 | /** | ||
110 | * sg_next - return the next scatterlist entry in a list | ||
111 | * @sg: The current sg entry | ||
112 | * | ||
113 | * Description: | ||
114 | * Usually the next entry will be @sg@ + 1, but if this sg element is part | ||
115 | * of a chained scatterlist, it could jump to the start of a new | ||
116 | * scatterlist array. | ||
117 | * | ||
118 | **/ | ||
119 | static inline struct scatterlist *sg_next(struct scatterlist *sg) | ||
120 | { | ||
121 | #ifdef CONFIG_DEBUG_SG | ||
122 | BUG_ON(sg->sg_magic != SG_MAGIC); | ||
123 | #endif | ||
124 | if (sg_is_last(sg)) | ||
125 | return NULL; | ||
126 | |||
127 | sg++; | ||
128 | if (unlikely(sg_is_chain(sg))) | ||
129 | sg = sg_chain_ptr(sg); | ||
130 | |||
131 | return sg; | ||
132 | } | ||
133 | |||
134 | /* | 115 | /* |
135 | * Loop over each sg element, following the pointer to a new list if necessary | 116 | * Loop over each sg element, following the pointer to a new list if necessary |
136 | */ | 117 | */ |
@@ -138,40 +119,6 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg) | |||
138 | for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg)) | 119 | for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg)) |
139 | 120 | ||
140 | /** | 121 | /** |
141 | * sg_last - return the last scatterlist entry in a list | ||
142 | * @sgl: First entry in the scatterlist | ||
143 | * @nents: Number of entries in the scatterlist | ||
144 | * | ||
145 | * Description: | ||
146 | * Should only be used casually, it (currently) scan the entire list | ||
147 | * to get the last entry. | ||
148 | * | ||
149 | * Note that the @sgl@ pointer passed in need not be the first one, | ||
150 | * the important bit is that @nents@ denotes the number of entries that | ||
151 | * exist from @sgl@. | ||
152 | * | ||
153 | **/ | ||
154 | static inline struct scatterlist *sg_last(struct scatterlist *sgl, | ||
155 | unsigned int nents) | ||
156 | { | ||
157 | #ifndef ARCH_HAS_SG_CHAIN | ||
158 | struct scatterlist *ret = &sgl[nents - 1]; | ||
159 | #else | ||
160 | struct scatterlist *sg, *ret = NULL; | ||
161 | unsigned int i; | ||
162 | |||
163 | for_each_sg(sgl, sg, nents, i) | ||
164 | ret = sg; | ||
165 | |||
166 | #endif | ||
167 | #ifdef CONFIG_DEBUG_SG | ||
168 | BUG_ON(sgl[0].sg_magic != SG_MAGIC); | ||
169 | BUG_ON(!sg_is_last(ret)); | ||
170 | #endif | ||
171 | return ret; | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * sg_chain - Chain two sglists together | 122 | * sg_chain - Chain two sglists together |
176 | * @prv: First scatterlist | 123 | * @prv: First scatterlist |
177 | * @prv_nents: Number of entries in prv | 124 | * @prv_nents: Number of entries in prv |
@@ -223,47 +170,6 @@ static inline void sg_mark_end(struct scatterlist *sg) | |||
223 | } | 170 | } |
224 | 171 | ||
225 | /** | 172 | /** |
226 | * sg_init_table - Initialize SG table | ||
227 | * @sgl: The SG table | ||
228 | * @nents: Number of entries in table | ||
229 | * | ||
230 | * Notes: | ||
231 | * If this is part of a chained sg table, sg_mark_end() should be | ||
232 | * used only on the last table part. | ||
233 | * | ||
234 | **/ | ||
235 | static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) | ||
236 | { | ||
237 | memset(sgl, 0, sizeof(*sgl) * nents); | ||
238 | #ifdef CONFIG_DEBUG_SG | ||
239 | { | ||
240 | unsigned int i; | ||
241 | for (i = 0; i < nents; i++) | ||
242 | sgl[i].sg_magic = SG_MAGIC; | ||
243 | } | ||
244 | #endif | ||
245 | sg_mark_end(&sgl[nents - 1]); | ||
246 | } | ||
247 | |||
248 | /** | ||
249 | * sg_init_one - Initialize a single entry sg list | ||
250 | * @sg: SG entry | ||
251 | * @buf: Virtual address for IO | ||
252 | * @buflen: IO length | ||
253 | * | ||
254 | * Notes: | ||
255 | * This should not be used on a single entry that is part of a larger | ||
256 | * table. Use sg_init_table() for that. | ||
257 | * | ||
258 | **/ | ||
259 | static inline void sg_init_one(struct scatterlist *sg, const void *buf, | ||
260 | unsigned int buflen) | ||
261 | { | ||
262 | sg_init_table(sg, 1); | ||
263 | sg_set_buf(sg, buf, buflen); | ||
264 | } | ||
265 | |||
266 | /** | ||
267 | * sg_phys - Return physical address of an sg entry | 173 | * sg_phys - Return physical address of an sg entry |
268 | * @sg: SG entry | 174 | * @sg: SG entry |
269 | * | 175 | * |
@@ -293,4 +199,24 @@ static inline void *sg_virt(struct scatterlist *sg) | |||
293 | return page_address(sg_page(sg)) + sg->offset; | 199 | return page_address(sg_page(sg)) + sg->offset; |
294 | } | 200 | } |
295 | 201 | ||
202 | struct scatterlist *sg_next(struct scatterlist *); | ||
203 | struct scatterlist *sg_last(struct scatterlist *s, unsigned int); | ||
204 | void sg_init_table(struct scatterlist *, unsigned int); | ||
205 | void sg_init_one(struct scatterlist *, const void *, unsigned int); | ||
206 | |||
207 | typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t); | ||
208 | typedef void (sg_free_fn)(struct scatterlist *, unsigned int); | ||
209 | |||
210 | void __sg_free_table(struct sg_table *, unsigned int, sg_free_fn *); | ||
211 | void sg_free_table(struct sg_table *); | ||
212 | int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t, | ||
213 | sg_alloc_fn *); | ||
214 | int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); | ||
215 | |||
216 | /* | ||
217 | * Maximum number of entries that will be allocated in one piece, if | ||
218 | * a list larger than this is required then chaining will be utilized. | ||
219 | */ | ||
220 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) | ||
221 | |||
296 | #endif /* _LINUX_SCATTERLIST_H */ | 222 | #endif /* _LINUX_SCATTERLIST_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index df5b24ee80b3..2d0546e884ea 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ | 27 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ |
28 | #define CLONE_NEWPID 0x20000000 /* New pid namespace */ | 28 | #define CLONE_NEWPID 0x20000000 /* New pid namespace */ |
29 | #define CLONE_NEWNET 0x40000000 /* New network namespace */ | 29 | #define CLONE_NEWNET 0x40000000 /* New network namespace */ |
30 | #define CLONE_IO 0x80000000 /* Clone io context */ | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * Scheduling policies | 33 | * Scheduling policies |
@@ -975,7 +976,6 @@ struct task_struct { | |||
975 | struct hlist_head preempt_notifiers; | 976 | struct hlist_head preempt_notifiers; |
976 | #endif | 977 | #endif |
977 | 978 | ||
978 | unsigned short ioprio; | ||
979 | /* | 979 | /* |
980 | * fpu_counter contains the number of consecutive context switches | 980 | * fpu_counter contains the number of consecutive context switches |
981 | * that the FPU is used. If this is over a threshold, the lazy fpu | 981 | * that the FPU is used. If this is over a threshold, the lazy fpu |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index abd7479ff452..a457fca66f61 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -8,7 +8,6 @@ | |||
8 | #include <linux/scatterlist.h> | 8 | #include <linux/scatterlist.h> |
9 | 9 | ||
10 | struct request; | 10 | struct request; |
11 | struct scatterlist; | ||
12 | struct Scsi_Host; | 11 | struct Scsi_Host; |
13 | struct scsi_device; | 12 | struct scsi_device; |
14 | 13 | ||
@@ -68,8 +67,8 @@ struct scsi_cmnd { | |||
68 | void *request_buffer; /* Actual requested buffer */ | 67 | void *request_buffer; /* Actual requested buffer */ |
69 | 68 | ||
70 | /* These elements define the operation we ultimately want to perform */ | 69 | /* These elements define the operation we ultimately want to perform */ |
70 | struct sg_table sg_table; | ||
71 | unsigned short use_sg; /* Number of pieces of scatter-gather */ | 71 | unsigned short use_sg; /* Number of pieces of scatter-gather */ |
72 | unsigned short __use_sg; | ||
73 | 72 | ||
74 | unsigned underflow; /* Return error if less than | 73 | unsigned underflow; /* Return error if less than |
75 | this amount is transferred */ | 74 | this amount is transferred */ |
@@ -128,14 +127,14 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, | |||
128 | size_t *offset, size_t *len); | 127 | size_t *offset, size_t *len); |
129 | extern void scsi_kunmap_atomic_sg(void *virt); | 128 | extern void scsi_kunmap_atomic_sg(void *virt); |
130 | 129 | ||
131 | extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t); | 130 | extern int scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t); |
132 | extern void scsi_free_sgtable(struct scsi_cmnd *); | 131 | extern void scsi_free_sgtable(struct scsi_cmnd *); |
133 | 132 | ||
134 | extern int scsi_dma_map(struct scsi_cmnd *cmd); | 133 | extern int scsi_dma_map(struct scsi_cmnd *cmd); |
135 | extern void scsi_dma_unmap(struct scsi_cmnd *cmd); | 134 | extern void scsi_dma_unmap(struct scsi_cmnd *cmd); |
136 | 135 | ||
137 | #define scsi_sg_count(cmd) ((cmd)->use_sg) | 136 | #define scsi_sg_count(cmd) ((cmd)->use_sg) |
138 | #define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer) | 137 | #define scsi_sglist(cmd) ((cmd)->sg_table.sgl) |
139 | #define scsi_bufflen(cmd) ((cmd)->request_bufflen) | 138 | #define scsi_bufflen(cmd) ((cmd)->request_bufflen) |
140 | 139 | ||
141 | static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) | 140 | static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) |