diff options
author | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2006-09-29 02:45:43 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2006-09-29 02:45:43 -0400 |
commit | 1b06e7926694178e146ff708b2c15a6da64c9765 (patch) | |
tree | 30602fa4a854d6956f478212937726ca75ea13ce /include | |
parent | 65e8697a12e356cd7a6ecafa1149f5c5c6a71593 (diff) | |
parent | c972398b7871d9fb58c6a317786065a7cc6ca4be (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
112 files changed, 2844 insertions, 3040 deletions
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200.h b/include/asm-arm/arch-at91rm9200/at91rm9200.h index 58f40931a5c1..a5a86b1ff886 100644 --- a/include/asm-arm/arch-at91rm9200/at91rm9200.h +++ b/include/asm-arm/arch-at91rm9200/at91rm9200.h | |||
@@ -19,67 +19,80 @@ | |||
19 | /* | 19 | /* |
20 | * Peripheral identifiers/interrupts. | 20 | * Peripheral identifiers/interrupts. |
21 | */ | 21 | */ |
22 | #define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ | 22 | #define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ |
23 | #define AT91_ID_SYS 1 /* System Peripheral */ | 23 | #define AT91_ID_SYS 1 /* System Peripheral */ |
24 | #define AT91_ID_PIOA 2 /* Parallel IO Controller A */ | 24 | #define AT91RM9200_ID_PIOA 2 /* Parallel IO Controller A */ |
25 | #define AT91_ID_PIOB 3 /* Parallel IO Controller B */ | 25 | #define AT91RM9200_ID_PIOB 3 /* Parallel IO Controller B */ |
26 | #define AT91_ID_PIOC 4 /* Parallel IO Controller C */ | 26 | #define AT91RM9200_ID_PIOC 4 /* Parallel IO Controller C */ |
27 | #define AT91_ID_PIOD 5 /* Parallel IO Controller D */ | 27 | #define AT91RM9200_ID_PIOD 5 /* Parallel IO Controller D */ |
28 | #define AT91_ID_US0 6 /* USART 0 */ | 28 | #define AT91RM9200_ID_US0 6 /* USART 0 */ |
29 | #define AT91_ID_US1 7 /* USART 1 */ | 29 | #define AT91RM9200_ID_US1 7 /* USART 1 */ |
30 | #define AT91_ID_US2 8 /* USART 2 */ | 30 | #define AT91RM9200_ID_US2 8 /* USART 2 */ |
31 | #define AT91_ID_US3 9 /* USART 3 */ | 31 | #define AT91RM9200_ID_US3 9 /* USART 3 */ |
32 | #define AT91_ID_MCI 10 /* Multimedia Card Interface */ | 32 | #define AT91RM9200_ID_MCI 10 /* Multimedia Card Interface */ |
33 | #define AT91_ID_UDP 11 /* USB Device Port */ | 33 | #define AT91RM9200_ID_UDP 11 /* USB Device Port */ |
34 | #define AT91_ID_TWI 12 /* Two-Wire Interface */ | 34 | #define AT91RM9200_ID_TWI 12 /* Two-Wire Interface */ |
35 | #define AT91_ID_SPI 13 /* Serial Peripheral Interface */ | 35 | #define AT91RM9200_ID_SPI 13 /* Serial Peripheral Interface */ |
36 | #define AT91_ID_SSC0 14 /* Serial Synchronous Controller 0 */ | 36 | #define AT91RM9200_ID_SSC0 14 /* Serial Synchronous Controller 0 */ |
37 | #define AT91_ID_SSC1 15 /* Serial Synchronous Controller 1 */ | 37 | #define AT91RM9200_ID_SSC1 15 /* Serial Synchronous Controller 1 */ |
38 | #define AT91_ID_SSC2 16 /* Serial Synchronous Controller 2 */ | 38 | #define AT91RM9200_ID_SSC2 16 /* Serial Synchronous Controller 2 */ |
39 | #define AT91_ID_TC0 17 /* Timer Counter 0 */ | 39 | #define AT91RM9200_ID_TC0 17 /* Timer Counter 0 */ |
40 | #define AT91_ID_TC1 18 /* Timer Counter 1 */ | 40 | #define AT91RM9200_ID_TC1 18 /* Timer Counter 1 */ |
41 | #define AT91_ID_TC2 19 /* Timer Counter 2 */ | 41 | #define AT91RM9200_ID_TC2 19 /* Timer Counter 2 */ |
42 | #define AT91_ID_TC3 20 /* Timer Counter 3 */ | 42 | #define AT91RM9200_ID_TC3 20 /* Timer Counter 3 */ |
43 | #define AT91_ID_TC4 21 /* Timer Counter 4 */ | 43 | #define AT91RM9200_ID_TC4 21 /* Timer Counter 4 */ |
44 | #define AT91_ID_TC5 22 /* Timer Counter 5 */ | 44 | #define AT91RM9200_ID_TC5 22 /* Timer Counter 5 */ |
45 | #define AT91_ID_UHP 23 /* USB Host port */ | 45 | #define AT91RM9200_ID_UHP 23 /* USB Host port */ |
46 | #define AT91_ID_EMAC 24 /* Ethernet MAC */ | 46 | #define AT91RM9200_ID_EMAC 24 /* Ethernet MAC */ |
47 | #define AT91_ID_IRQ0 25 /* Advanced Interrupt Controller (IRQ0) */ | 47 | #define AT91RM9200_ID_IRQ0 25 /* Advanced Interrupt Controller (IRQ0) */ |
48 | #define AT91_ID_IRQ1 26 /* Advanced Interrupt Controller (IRQ1) */ | 48 | #define AT91RM9200_ID_IRQ1 26 /* Advanced Interrupt Controller (IRQ1) */ |
49 | #define AT91_ID_IRQ2 27 /* Advanced Interrupt Controller (IRQ2) */ | 49 | #define AT91RM9200_ID_IRQ2 27 /* Advanced Interrupt Controller (IRQ2) */ |
50 | #define AT91_ID_IRQ3 28 /* Advanced Interrupt Controller (IRQ3) */ | 50 | #define AT91RM9200_ID_IRQ3 28 /* Advanced Interrupt Controller (IRQ3) */ |
51 | #define AT91_ID_IRQ4 29 /* Advanced Interrupt Controller (IRQ4) */ | 51 | #define AT91RM9200_ID_IRQ4 29 /* Advanced Interrupt Controller (IRQ4) */ |
52 | #define AT91_ID_IRQ5 30 /* Advanced Interrupt Controller (IRQ5) */ | 52 | #define AT91RM9200_ID_IRQ5 30 /* Advanced Interrupt Controller (IRQ5) */ |
53 | #define AT91_ID_IRQ6 31 /* Advanced Interrupt Controller (IRQ6) */ | 53 | #define AT91RM9200_ID_IRQ6 31 /* Advanced Interrupt Controller (IRQ6) */ |
54 | 54 | ||
55 | 55 | ||
56 | /* | 56 | /* |
57 | * Peripheral physical base addresses. | 57 | * Peripheral physical base addresses. |
58 | */ | 58 | */ |
59 | #define AT91_BASE_TCB0 0xfffa0000 | 59 | #define AT91RM9200_BASE_TCB0 0xfffa0000 |
60 | #define AT91_BASE_TC0 0xfffa0000 | 60 | #define AT91RM9200_BASE_TC0 0xfffa0000 |
61 | #define AT91_BASE_TC1 0xfffa0040 | 61 | #define AT91RM9200_BASE_TC1 0xfffa0040 |
62 | #define AT91_BASE_TC2 0xfffa0080 | 62 | #define AT91RM9200_BASE_TC2 0xfffa0080 |
63 | #define AT91_BASE_TCB1 0xfffa4000 | 63 | #define AT91RM9200_BASE_TCB1 0xfffa4000 |
64 | #define AT91_BASE_TC3 0xfffa4000 | 64 | #define AT91RM9200_BASE_TC3 0xfffa4000 |
65 | #define AT91_BASE_TC4 0xfffa4040 | 65 | #define AT91RM9200_BASE_TC4 0xfffa4040 |
66 | #define AT91_BASE_TC5 0xfffa4080 | 66 | #define AT91RM9200_BASE_TC5 0xfffa4080 |
67 | #define AT91_BASE_UDP 0xfffb0000 | 67 | #define AT91RM9200_BASE_UDP 0xfffb0000 |
68 | #define AT91_BASE_MCI 0xfffb4000 | 68 | #define AT91RM9200_BASE_MCI 0xfffb4000 |
69 | #define AT91_BASE_TWI 0xfffb8000 | 69 | #define AT91RM9200_BASE_TWI 0xfffb8000 |
70 | #define AT91_BASE_EMAC 0xfffbc000 | 70 | #define AT91RM9200_BASE_EMAC 0xfffbc000 |
71 | #define AT91_BASE_US0 0xfffc0000 | 71 | #define AT91RM9200_BASE_US0 0xfffc0000 |
72 | #define AT91_BASE_US1 0xfffc4000 | 72 | #define AT91RM9200_BASE_US1 0xfffc4000 |
73 | #define AT91_BASE_US2 0xfffc8000 | 73 | #define AT91RM9200_BASE_US2 0xfffc8000 |
74 | #define AT91_BASE_US3 0xfffcc000 | 74 | #define AT91RM9200_BASE_US3 0xfffcc000 |
75 | #define AT91_BASE_SSC0 0xfffd0000 | 75 | #define AT91RM9200_BASE_SSC0 0xfffd0000 |
76 | #define AT91_BASE_SSC1 0xfffd4000 | 76 | #define AT91RM9200_BASE_SSC1 0xfffd4000 |
77 | #define AT91_BASE_SSC2 0xfffd8000 | 77 | #define AT91RM9200_BASE_SSC2 0xfffd8000 |
78 | #define AT91_BASE_SPI 0xfffe0000 | 78 | #define AT91RM9200_BASE_SPI 0xfffe0000 |
79 | #define AT91_BASE_SYS 0xfffff000 | 79 | #define AT91_BASE_SYS 0xfffff000 |
80 | 80 | ||
81 | 81 | ||
82 | /* | 82 | /* |
83 | * Internal Memory. | ||
84 | */ | ||
85 | #define AT91RM9200_ROM_BASE 0x00100000 /* Internal ROM base address */ | ||
86 | #define AT91RM9200_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */ | ||
87 | |||
88 | #define AT91RM9200_SRAM_BASE 0x00200000 /* Internal SRAM base address */ | ||
89 | #define AT91RM9200_SRAM_SIZE SZ_16K /* Internal SRAM size (16Kb) */ | ||
90 | |||
91 | #define AT91RM9200_UHP_BASE 0x00300000 /* USB Host controller */ | ||
92 | |||
93 | |||
94 | #if 0 | ||
95 | /* | ||
83 | * PIO pin definitions (peripheral A/B multiplexing). | 96 | * PIO pin definitions (peripheral A/B multiplexing). |
84 | */ | 97 | */ |
85 | #define AT91_PA0_MISO (1 << 0) /* A: SPI Master-In Slave-Out */ | 98 | #define AT91_PA0_MISO (1 << 0) /* A: SPI Master-In Slave-Out */ |
@@ -257,5 +270,6 @@ | |||
257 | #define AT91_PD25_TPK13 (1 << 25) /* B: ETM Trace Packet Port 13 */ | 270 | #define AT91_PD25_TPK13 (1 << 25) /* B: ETM Trace Packet Port 13 */ |
258 | #define AT91_PD26_TPK14 (1 << 26) /* B: ETM Trace Packet Port 14 */ | 271 | #define AT91_PD26_TPK14 (1 << 26) /* B: ETM Trace Packet Port 14 */ |
259 | #define AT91_PD27_TPK15 (1 << 27) /* B: ETM Trace Packet Port 15 */ | 272 | #define AT91_PD27_TPK15 (1 << 27) /* B: ETM Trace Packet Port 15 */ |
273 | #endif | ||
260 | 274 | ||
261 | #endif | 275 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h index 0f4c12d5f0cd..73693fea76a2 100644 --- a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h +++ b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h | |||
@@ -80,6 +80,9 @@ | |||
80 | #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ | 80 | #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ |
81 | #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ | 81 | #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ |
82 | 82 | ||
83 | #define AT91_AIC_FFER (AT91_AIC + 0x140) /* Fast Forcing Enable Register [SAM9 only] */ | ||
84 | #define AT91_AIC_FFDR (AT91_AIC + 0x144) /* Fast Forcing Disable Register [SAM9 only] */ | ||
85 | #define AT91_AIC_FFSR (AT91_AIC + 0x148) /* Fast Forcing Status Register [SAM9 only] */ | ||
83 | 86 | ||
84 | /* | 87 | /* |
85 | * PIO Controllers. | 88 | * PIO Controllers. |
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_twi.h b/include/asm-arm/arch-at91rm9200/at91rm9200_twi.h new file mode 100644 index 000000000000..93547d7482bd --- /dev/null +++ b/include/asm-arm/arch-at91rm9200/at91rm9200_twi.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91rm9200/at91rm9200_twi.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Two-wire Interface (TWI) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91RM9200_TWI_H | ||
17 | #define AT91RM9200_TWI_H | ||
18 | |||
19 | #define AT91_TWI_CR 0x00 /* Control Register */ | ||
20 | #define AT91_TWI_START (1 << 0) /* Send a Start Condition */ | ||
21 | #define AT91_TWI_STOP (1 << 1) /* Send a Stop Condition */ | ||
22 | #define AT91_TWI_MSEN (1 << 2) /* Master Transfer Enable */ | ||
23 | #define AT91_TWI_MSDIS (1 << 3) /* Master Transfer Disable */ | ||
24 | #define AT91_TWI_SWRST (1 << 7) /* Software Reset */ | ||
25 | |||
26 | #define AT91_TWI_MMR 0x04 /* Master Mode Register */ | ||
27 | #define AT91_TWI_IADRSZ (3 << 8) /* Internal Device Address Size */ | ||
28 | #define AT91_TWI_IADRSZ_NO (0 << 8) | ||
29 | #define AT91_TWI_IADRSZ_1 (1 << 8) | ||
30 | #define AT91_TWI_IADRSZ_2 (2 << 8) | ||
31 | #define AT91_TWI_IADRSZ_3 (3 << 8) | ||
32 | #define AT91_TWI_MREAD (1 << 12) /* Master Read Direction */ | ||
33 | #define AT91_TWI_DADR (0x7f << 16) /* Device Address */ | ||
34 | |||
35 | #define AT91_TWI_IADR 0x0c /* Internal Address Register */ | ||
36 | |||
37 | #define AT91_TWI_CWGR 0x10 /* Clock Waveform Generator Register */ | ||
38 | #define AT91_TWI_CLDIV (0xff << 0) /* Clock Low Divisor */ | ||
39 | #define AT91_TWI_CHDIV (0xff << 8) /* Clock High Divisor */ | ||
40 | #define AT91_TWI_CKDIV (7 << 16) /* Clock Divider */ | ||
41 | |||
42 | #define AT91_TWI_SR 0x20 /* Status Register */ | ||
43 | #define AT91_TWI_TXCOMP (1 << 0) /* Transmission Complete */ | ||
44 | #define AT91_TWI_RXRDY (1 << 1) /* Receive Holding Register Ready */ | ||
45 | #define AT91_TWI_TXRDY (1 << 2) /* Transmit Holding Register Ready */ | ||
46 | #define AT91_TWI_OVRE (1 << 6) /* Overrun Error */ | ||
47 | #define AT91_TWI_UNRE (1 << 7) /* Underrun Error */ | ||
48 | #define AT91_TWI_NACK (1 << 8) /* Not Acknowledged */ | ||
49 | |||
50 | #define AT91_TWI_IER 0x24 /* Interrupt Enable Register */ | ||
51 | #define AT91_TWI_IDR 0x28 /* Interrupt Disable Register */ | ||
52 | #define AT91_TWI_IMR 0x2c /* Interrupt Mask Register */ | ||
53 | #define AT91_TWI_RHR 0x30 /* Receive Holding Register */ | ||
54 | #define AT91_TWI_THR 0x34 /* Transmit Holding Register */ | ||
55 | |||
56 | #endif | ||
57 | |||
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h index dbde1baaf251..a011d27876a2 100644 --- a/include/asm-arm/arch-at91rm9200/gpio.h +++ b/include/asm-arm/arch-at91rm9200/gpio.h | |||
@@ -17,10 +17,9 @@ | |||
17 | 17 | ||
18 | #define PIN_BASE NR_AIC_IRQS | 18 | #define PIN_BASE NR_AIC_IRQS |
19 | 19 | ||
20 | #define PQFP_GPIO_BANKS 3 /* PQFP package has 3 banks */ | 20 | #define MAX_GPIO_BANKS 4 |
21 | #define BGA_GPIO_BANKS 4 /* BGA package has 4 banks */ | ||
22 | 21 | ||
23 | /* these pin numbers double as IRQ numbers, like AT91_ID_* values */ | 22 | /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ |
24 | 23 | ||
25 | #define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0) | 24 | #define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0) |
26 | #define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1) | 25 | #define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1) |
@@ -180,17 +179,18 @@ | |||
180 | 179 | ||
181 | #ifndef __ASSEMBLY__ | 180 | #ifndef __ASSEMBLY__ |
182 | /* setup setup routines, called from board init or driver probe() */ | 181 | /* setup setup routines, called from board init or driver probe() */ |
183 | extern int at91_set_A_periph(unsigned pin, int use_pullup); | 182 | extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); |
184 | extern int at91_set_B_periph(unsigned pin, int use_pullup); | 183 | extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); |
185 | extern int at91_set_gpio_input(unsigned pin, int use_pullup); | 184 | extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); |
186 | extern int at91_set_gpio_output(unsigned pin, int value); | 185 | extern int __init_or_module at91_set_gpio_output(unsigned pin, int value); |
187 | extern int at91_set_deglitch(unsigned pin, int is_on); | 186 | extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on); |
188 | extern int at91_set_multi_drive(unsigned pin, int is_on); | 187 | extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on); |
189 | 188 | ||
190 | /* callable at any time */ | 189 | /* callable at any time */ |
191 | extern int at91_set_gpio_value(unsigned pin, int value); | 190 | extern int at91_set_gpio_value(unsigned pin, int value); |
192 | extern int at91_get_gpio_value(unsigned pin); | 191 | extern int at91_get_gpio_value(unsigned pin); |
193 | 192 | ||
193 | /* callable only from core power-management code */ | ||
194 | extern void at91_gpio_suspend(void); | 194 | extern void at91_gpio_suspend(void); |
195 | extern void at91_gpio_resume(void); | 195 | extern void at91_gpio_resume(void); |
196 | #endif | 196 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h index 235d39d91107..6551b4d1ff7b 100644 --- a/include/asm-arm/arch-at91rm9200/hardware.h +++ b/include/asm-arm/arch-at91rm9200/hardware.h | |||
@@ -34,27 +34,14 @@ | |||
34 | * Virtual to Physical Address mapping for IO devices. | 34 | * Virtual to Physical Address mapping for IO devices. |
35 | */ | 35 | */ |
36 | #define AT91_VA_BASE_SYS AT91_IO_P2V(AT91_BASE_SYS) | 36 | #define AT91_VA_BASE_SYS AT91_IO_P2V(AT91_BASE_SYS) |
37 | #define AT91_VA_BASE_SPI AT91_IO_P2V(AT91_BASE_SPI) | 37 | #define AT91_VA_BASE_SPI AT91_IO_P2V(AT91RM9200_BASE_SPI) |
38 | #define AT91_VA_BASE_SSC2 AT91_IO_P2V(AT91_BASE_SSC2) | 38 | #define AT91_VA_BASE_EMAC AT91_IO_P2V(AT91RM9200_BASE_EMAC) |
39 | #define AT91_VA_BASE_SSC1 AT91_IO_P2V(AT91_BASE_SSC1) | 39 | #define AT91_VA_BASE_TWI AT91_IO_P2V(AT91RM9200_BASE_TWI) |
40 | #define AT91_VA_BASE_SSC0 AT91_IO_P2V(AT91_BASE_SSC0) | 40 | #define AT91_VA_BASE_MCI AT91_IO_P2V(AT91RM9200_BASE_MCI) |
41 | #define AT91_VA_BASE_US3 AT91_IO_P2V(AT91_BASE_US3) | 41 | #define AT91_VA_BASE_UDP AT91_IO_P2V(AT91RM9200_BASE_UDP) |
42 | #define AT91_VA_BASE_US2 AT91_IO_P2V(AT91_BASE_US2) | ||
43 | #define AT91_VA_BASE_US1 AT91_IO_P2V(AT91_BASE_US1) | ||
44 | #define AT91_VA_BASE_US0 AT91_IO_P2V(AT91_BASE_US0) | ||
45 | #define AT91_VA_BASE_EMAC AT91_IO_P2V(AT91_BASE_EMAC) | ||
46 | #define AT91_VA_BASE_TWI AT91_IO_P2V(AT91_BASE_TWI) | ||
47 | #define AT91_VA_BASE_MCI AT91_IO_P2V(AT91_BASE_MCI) | ||
48 | #define AT91_VA_BASE_UDP AT91_IO_P2V(AT91_BASE_UDP) | ||
49 | #define AT91_VA_BASE_TCB1 AT91_IO_P2V(AT91_BASE_TCB1) | ||
50 | #define AT91_VA_BASE_TCB0 AT91_IO_P2V(AT91_BASE_TCB0) | ||
51 | |||
52 | /* Internal SRAM */ | ||
53 | #define AT91_SRAM_BASE 0x00200000 /* Internal SRAM base address */ | ||
54 | #define AT91_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */ | ||
55 | 42 | ||
56 | /* Internal SRAM is mapped below the IO devices */ | 43 | /* Internal SRAM is mapped below the IO devices */ |
57 | #define AT91_SRAM_VIRT_BASE (AT91_IO_VIRT_BASE - AT91_SRAM_SIZE) | 44 | #define AT91_SRAM_VIRT_BASE (AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE) |
58 | 45 | ||
59 | /* Serial ports */ | 46 | /* Serial ports */ |
60 | #define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */ | 47 | #define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */ |
@@ -71,9 +58,6 @@ | |||
71 | /* Compact Flash */ | 58 | /* Compact Flash */ |
72 | #define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */ | 59 | #define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */ |
73 | 60 | ||
74 | /* Multi-Master Memory controller */ | ||
75 | #define AT91_UHP_BASE 0x00300000 /* USB Host controller */ | ||
76 | |||
77 | /* Clocks */ | 61 | /* Clocks */ |
78 | #define AT91_SLOW_CLOCK 32768 /* slow clock */ | 62 | #define AT91_SLOW_CLOCK 32768 /* slow clock */ |
79 | 63 | ||
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h index f63842c2c093..763cb96c418b 100644 --- a/include/asm-arm/arch-at91rm9200/irqs.h +++ b/include/asm-arm/arch-at91rm9200/irqs.h | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | 33 | ||
34 | /* | 34 | /* |
35 | * IRQ interrupt symbols are the AT91_ID_* symbols in at91rm9200.h | 35 | * IRQ interrupt symbols are the AT91xxx_ID_* symbols |
36 | * for IRQs handled directly through the AIC, or else the AT91_PIN_* | 36 | * for IRQs handled directly through the AIC, or else the AT91_PIN_* |
37 | * symbols in gpio.h for ones handled indirectly as GPIOs. | 37 | * symbols in gpio.h for ones handled indirectly as GPIOs. |
38 | * We make provision for 4 banks of GPIO. | 38 | * We make provision for 4 banks of GPIO. |
diff --git a/include/asm-arm/arch-iop32x/debug-macro.S b/include/asm-arm/arch-iop32x/debug-macro.S new file mode 100644 index 000000000000..9022b6849e23 --- /dev/null +++ b/include/asm-arm/arch-iop32x/debug-macro.S | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header | ||
5 | * | ||
6 | * Copyright (C) 1994-1999 Russell King | ||
7 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
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 | .macro addruart, rx | ||
15 | mov \rx, #0xfe000000 @ physical as well as virtual | ||
16 | orr \rx, \rx, #0x00800000 @ location of the UART | ||
17 | .endm | ||
18 | |||
19 | #define UART_SHIFT 0 | ||
20 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/include/asm-arm/arch-iop3xx/dma.h b/include/asm-arm/arch-iop32x/dma.h index 1e808db8af2a..e977a9ef3160 100644 --- a/include/asm-arm/arch-iop3xx/dma.h +++ b/include/asm-arm/arch-iop32x/dma.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/arch-iop3xx/dma.h | 2 | * include/asm-arm/arch-iop32x/dma.h |
3 | * | 3 | * |
4 | * Copyright (C) 2004 Intel Corp. | 4 | * Copyright (C) 2004 Intel Corp. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 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 | 7 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/asm-arm/arch-iop32x/entry-macro.S b/include/asm-arm/arch-iop32x/entry-macro.S new file mode 100644 index 000000000000..1500cbbd2295 --- /dev/null +++ b/include/asm-arm/arch-iop32x/entry-macro.S | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for IOP32x-based 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 | #include <asm/arch/iop32x.h> | ||
11 | |||
12 | .macro disable_fiq | ||
13 | .endm | ||
14 | |||
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
16 | ldr \base, =IOP3XX_REG_ADDR(0x07D8) | ||
17 | ldr \irqstat, [\base] @ Read IINTSRC | ||
18 | cmp \irqstat, #0 | ||
19 | clzne \irqnr, \irqstat | ||
20 | rsbne \irqnr, \irqnr, #31 | ||
21 | .endm | ||
diff --git a/include/asm-arm/arch-iop32x/glantank.h b/include/asm-arm/arch-iop32x/glantank.h new file mode 100644 index 000000000000..3b065618dd00 --- /dev/null +++ b/include/asm-arm/arch-iop32x/glantank.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * include/asm/arch-iop32x/glantank.h | ||
3 | * | ||
4 | * IO-Data GLAN Tank board registers | ||
5 | */ | ||
6 | |||
7 | #ifndef __GLANTANK_H | ||
8 | #define __GLANTANK_H | ||
9 | |||
10 | #define GLANTANK_UART 0xfe800000 /* UART */ | ||
11 | |||
12 | |||
13 | #endif | ||
diff --git a/include/asm-arm/arch-iop32x/hardware.h b/include/asm-arm/arch-iop32x/hardware.h new file mode 100644 index 000000000000..6556ed5eee31 --- /dev/null +++ b/include/asm-arm/arch-iop32x/hardware.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/hardware.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __HARDWARE_H | ||
6 | #define __HARDWARE_H | ||
7 | |||
8 | #include <asm/types.h> | ||
9 | |||
10 | /* | ||
11 | * Note about PCI IO space mappings | ||
12 | * | ||
13 | * To make IO space accesses efficient, we store virtual addresses in | ||
14 | * the IO resources. | ||
15 | * | ||
16 | * The PCI IO space is located at virtual 0xfe000000 from physical | ||
17 | * 0x90000000. The PCI BARs must be programmed with physical addresses, | ||
18 | * but when we read them, we convert them to virtual addresses. See | ||
19 | * arch/arm/plat-iop/pci.c. | ||
20 | */ | ||
21 | #define pcibios_assign_all_busses() 1 | ||
22 | #define PCIBIOS_MIN_IO 0x00000000 | ||
23 | #define PCIBIOS_MIN_MEM 0x00000000 | ||
24 | |||
25 | #ifndef __ASSEMBLY__ | ||
26 | void iop32x_init_irq(void); | ||
27 | #endif | ||
28 | |||
29 | |||
30 | /* | ||
31 | * Generic chipset bits | ||
32 | */ | ||
33 | #include "iop32x.h" | ||
34 | |||
35 | /* | ||
36 | * Board specific bits | ||
37 | */ | ||
38 | #include "glantank.h" | ||
39 | #include "iq80321.h" | ||
40 | #include "iq31244.h" | ||
41 | #include "n2100.h" | ||
42 | |||
43 | |||
44 | #endif | ||
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop32x/io.h index 36adbdf5055a..12d9ee02cde3 100644 --- a/include/asm-arm/arch-iop3xx/io.h +++ b/include/asm-arm/arch-iop32x/io.h | |||
@@ -1,21 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/arch-iop3xx/io.h | 2 | * include/asm-arm/arch-iop32x/io.h |
3 | * | 3 | * |
4 | * Copyright (C) 2001 MontaVista Software, Inc. | 4 | * Copyright (C) 2001 MontaVista Software, Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 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 | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | 14 | #include <asm/hardware.h> |
15 | 15 | ||
16 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
17 | 17 | ||
18 | #define __io(p) ((void __iomem *)(p)) | 18 | #define __io(p) ((void __iomem *)(p)) |
19 | #define __mem_pci(a) (a) | 19 | #define __mem_pci(a) (a) |
20 | 20 | ||
21 | |||
21 | #endif | 22 | #endif |
diff --git a/include/asm-arm/arch-iop32x/iop32x.h b/include/asm-arm/arch-iop32x/iop32x.h new file mode 100644 index 000000000000..4bbd85f3ed2a --- /dev/null +++ b/include/asm-arm/arch-iop32x/iop32x.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/iop32x.h | ||
3 | * | ||
4 | * Intel IOP32X Chip definitions | ||
5 | * | ||
6 | * Author: Rory Bolt <rorybolt@pacbell.net> | ||
7 | * Copyright (C) 2002 Rory Bolt | ||
8 | * Copyright (C) 2004 Intel Corp. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef __IOP32X_H | ||
16 | #define __IOP32X_H | ||
17 | |||
18 | /* | ||
19 | * Peripherals that are shared between the iop32x and iop33x but | ||
20 | * located at different addresses. | ||
21 | */ | ||
22 | #define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c0 + (reg)) | ||
23 | #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg)) | ||
24 | |||
25 | #include <asm/hardware/iop3xx.h> | ||
26 | |||
27 | |||
28 | #endif | ||
diff --git a/include/asm-arm/arch-iop3xx/iq31244.h b/include/asm-arm/arch-iop32x/iq31244.h index 4177cfa8100f..fff4eafa1f6b 100644 --- a/include/asm-arm/arch-iop3xx/iq31244.h +++ b/include/asm-arm/arch-iop32x/iq31244.h | |||
@@ -1,15 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm/arch-iop3xx/iq31244.h | 2 | * include/asm-arm/arch-iop32x/iq31244.h |
3 | * | 3 | * |
4 | * Intel IQ31244 evaluation board registers | 4 | * Intel IQ31244 evaluation board registers |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef _IQ31244_H_ | 7 | #ifndef __IQ31244_H |
8 | #define _IQ31244_H_ | 8 | #define __IQ31244_H |
9 | |||
10 | #define IQ31244_FLASHBASE 0xf0000000 /* Flash */ | ||
11 | #define IQ31244_FLASHSIZE 0x00800000 | ||
12 | #define IQ31244_FLASHWIDTH 2 | ||
13 | 9 | ||
14 | #define IQ31244_UART 0xfe800000 /* UART #1 */ | 10 | #define IQ31244_UART 0xfe800000 /* UART #1 */ |
15 | #define IQ31244_7SEG_1 0xfe840000 /* 7-Segment MSB */ | 11 | #define IQ31244_7SEG_1 0xfe840000 /* 7-Segment MSB */ |
@@ -17,8 +13,5 @@ | |||
17 | #define IQ31244_ROTARY_SW 0xfe8d0000 /* Rotary Switch */ | 13 | #define IQ31244_ROTARY_SW 0xfe8d0000 /* Rotary Switch */ |
18 | #define IQ31244_BATT_STAT 0xfe8f0000 /* Battery Status */ | 14 | #define IQ31244_BATT_STAT 0xfe8f0000 /* Battery Status */ |
19 | 15 | ||
20 | #ifndef __ASSEMBLY__ | ||
21 | extern void iq31244_map_io(void); | ||
22 | #endif | ||
23 | 16 | ||
24 | #endif // _IQ31244_H_ | 17 | #endif |
diff --git a/include/asm-arm/arch-iop3xx/iq80321.h b/include/asm-arm/arch-iop32x/iq80321.h index cb8725979ffa..eb69db9b9a06 100644 --- a/include/asm-arm/arch-iop3xx/iq80321.h +++ b/include/asm-arm/arch-iop32x/iq80321.h | |||
@@ -1,15 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm/arch-iop3xx/iq80321.h | 2 | * include/asm-arm/arch-iop32x/iq80321.h |
3 | * | 3 | * |
4 | * Intel IQ80321 evaluation board registers | 4 | * Intel IQ80321 evaluation board registers |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef _IQ80321_H_ | 7 | #ifndef __IQ80321_H |
8 | #define _IQ80321_H_ | 8 | #define __IQ80321_H |
9 | |||
10 | #define IQ80321_FLASHBASE 0xf0000000 /* Flash */ | ||
11 | #define IQ80321_FLASHSIZE 0x00800000 | ||
12 | #define IQ80321_FLASHWIDTH 1 | ||
13 | 9 | ||
14 | #define IQ80321_UART 0xfe800000 /* UART #1 */ | 10 | #define IQ80321_UART 0xfe800000 /* UART #1 */ |
15 | #define IQ80321_7SEG_1 0xfe840000 /* 7-Segment MSB */ | 11 | #define IQ80321_7SEG_1 0xfe840000 /* 7-Segment MSB */ |
@@ -17,8 +13,5 @@ | |||
17 | #define IQ80321_ROTARY_SW 0xfe8d0000 /* Rotary Switch */ | 13 | #define IQ80321_ROTARY_SW 0xfe8d0000 /* Rotary Switch */ |
18 | #define IQ80321_BATT_STAT 0xfe8f0000 /* Battery Status */ | 14 | #define IQ80321_BATT_STAT 0xfe8f0000 /* Battery Status */ |
19 | 15 | ||
20 | #ifndef __ASSEMBLY__ | ||
21 | extern void iq80321_map_io(void); | ||
22 | #endif | ||
23 | 16 | ||
24 | #endif // _IQ80321_H_ | 17 | #endif |
diff --git a/include/asm-arm/arch-iop32x/irqs.h b/include/asm-arm/arch-iop32x/irqs.h new file mode 100644 index 000000000000..bbaef873afce --- /dev/null +++ b/include/asm-arm/arch-iop32x/irqs.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/irqs.h | ||
3 | * | ||
4 | * Author: Rory Bolt <rorybolt@pacbell.net> | ||
5 | * Copyright: (C) 2002 Rory Bolt | ||
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 version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __IRQS_H | ||
13 | #define __IRQS_H | ||
14 | |||
15 | /* | ||
16 | * IOP80321 chipset interrupts | ||
17 | */ | ||
18 | #define IRQ_IOP32X_DMA0_EOT 0 | ||
19 | #define IRQ_IOP32X_DMA0_EOC 1 | ||
20 | #define IRQ_IOP32X_DMA1_EOT 2 | ||
21 | #define IRQ_IOP32X_DMA1_EOC 3 | ||
22 | #define IRQ_IOP32X_AA_EOT 6 | ||
23 | #define IRQ_IOP32X_AA_EOC 7 | ||
24 | #define IRQ_IOP32X_CORE_PMON 8 | ||
25 | #define IRQ_IOP32X_TIMER0 9 | ||
26 | #define IRQ_IOP32X_TIMER1 10 | ||
27 | #define IRQ_IOP32X_I2C_0 11 | ||
28 | #define IRQ_IOP32X_I2C_1 12 | ||
29 | #define IRQ_IOP32X_MESSAGING 13 | ||
30 | #define IRQ_IOP32X_ATU_BIST 14 | ||
31 | #define IRQ_IOP32X_PERFMON 15 | ||
32 | #define IRQ_IOP32X_CORE_PMU 16 | ||
33 | #define IRQ_IOP32X_BIU_ERR 17 | ||
34 | #define IRQ_IOP32X_ATU_ERR 18 | ||
35 | #define IRQ_IOP32X_MCU_ERR 19 | ||
36 | #define IRQ_IOP32X_DMA0_ERR 20 | ||
37 | #define IRQ_IOP32X_DMA1_ERR 21 | ||
38 | #define IRQ_IOP32X_AA_ERR 23 | ||
39 | #define IRQ_IOP32X_MSG_ERR 24 | ||
40 | #define IRQ_IOP32X_SSP 25 | ||
41 | #define IRQ_IOP32X_XINT0 27 | ||
42 | #define IRQ_IOP32X_XINT1 28 | ||
43 | #define IRQ_IOP32X_XINT2 29 | ||
44 | #define IRQ_IOP32X_XINT3 30 | ||
45 | #define IRQ_IOP32X_HPI 31 | ||
46 | |||
47 | #define NR_IRQS 32 | ||
48 | |||
49 | |||
50 | #endif | ||
diff --git a/include/asm-arm/arch-iop32x/memory.h b/include/asm-arm/arch-iop32x/memory.h new file mode 100644 index 000000000000..764cd3f0d416 --- /dev/null +++ b/include/asm-arm/arch-iop32x/memory.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/memory.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __MEMORY_H | ||
6 | #define __MEMORY_H | ||
7 | |||
8 | #include <asm/hardware.h> | ||
9 | |||
10 | /* | ||
11 | * Physical DRAM offset. | ||
12 | */ | ||
13 | #define PHYS_OFFSET UL(0xa0000000) | ||
14 | |||
15 | /* | ||
16 | * Virtual view <-> PCI DMA view memory address translations | ||
17 | * virt_to_bus: Used to translate the virtual address to an | ||
18 | * address suitable to be passed to set_dma_addr | ||
19 | * bus_to_virt: Used to convert an address for DMA operations | ||
20 | * to an address that the kernel can use. | ||
21 | */ | ||
22 | #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP3XX_IATVR2)) | ((*IOP3XX_IABAR2) & 0xfffffff0)) | ||
23 | #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP3XX_IALR2)) | ( *IOP3XX_IATVR2))) | ||
24 | |||
25 | |||
26 | #endif | ||
diff --git a/include/asm-arm/arch-iop32x/n2100.h b/include/asm-arm/arch-iop32x/n2100.h new file mode 100644 index 000000000000..fed31a648425 --- /dev/null +++ b/include/asm-arm/arch-iop32x/n2100.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * include/asm/arch-iop32x/n2100.h | ||
3 | * | ||
4 | * Thecus N2100 board registers | ||
5 | */ | ||
6 | |||
7 | #ifndef __N2100_H | ||
8 | #define __N2100_H | ||
9 | |||
10 | #define N2100_UART 0xfe800000 /* UART */ | ||
11 | |||
12 | #define N2100_COPY_BUTTON IOP3XX_GPIO_LINE(0) | ||
13 | #define N2100_PCA9532_RESET IOP3XX_GPIO_LINE(2) | ||
14 | #define N2100_RESET_BUTTON IOP3XX_GPIO_LINE(3) | ||
15 | #define N2100_HARDWARE_RESET IOP3XX_GPIO_LINE(4) | ||
16 | #define N2100_POWER_BUTTON IOP3XX_GPIO_LINE(5) | ||
17 | |||
18 | |||
19 | #endif | ||
diff --git a/include/asm-arm/arch-iop32x/system.h b/include/asm-arm/arch-iop32x/system.h new file mode 100644 index 000000000000..17b7eb7e9c0d --- /dev/null +++ b/include/asm-arm/arch-iop32x/system.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/system.h | ||
3 | * | ||
4 | * Copyright (C) 2001 MontaVista Software, 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 | |||
11 | #include <asm/mach-types.h> | ||
12 | |||
13 | static inline void arch_idle(void) | ||
14 | { | ||
15 | cpu_do_idle(); | ||
16 | } | ||
17 | |||
18 | static inline void arch_reset(char mode) | ||
19 | { | ||
20 | local_irq_disable(); | ||
21 | |||
22 | if (machine_is_n2100()) { | ||
23 | gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW); | ||
24 | gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT); | ||
25 | while (1) | ||
26 | ; | ||
27 | } | ||
28 | |||
29 | *IOP3XX_PCSR = 0x30; | ||
30 | |||
31 | /* Jump into ROM at address 0 */ | ||
32 | cpu_reset(0); | ||
33 | } | ||
diff --git a/include/asm-arm/arch-iop32x/timex.h b/include/asm-arm/arch-iop32x/timex.h new file mode 100644 index 000000000000..9934b087311b --- /dev/null +++ b/include/asm-arm/arch-iop32x/timex.h | |||
@@ -0,0 +1,9 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/timex.h | ||
3 | * | ||
4 | * IOP32x architecture timex specifications | ||
5 | */ | ||
6 | |||
7 | #include <asm/hardware.h> | ||
8 | |||
9 | #define CLOCK_TICK_RATE (100 * HZ) | ||
diff --git a/include/asm-arm/arch-iop32x/uncompress.h b/include/asm-arm/arch-iop32x/uncompress.h new file mode 100644 index 000000000000..e64f52bf2bce --- /dev/null +++ b/include/asm-arm/arch-iop32x/uncompress.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/uncompress.h | ||
3 | */ | ||
4 | |||
5 | #include <asm/types.h> | ||
6 | #include <asm/mach-types.h> | ||
7 | #include <linux/serial_reg.h> | ||
8 | #include <asm/hardware.h> | ||
9 | |||
10 | static volatile u8 *uart_base; | ||
11 | |||
12 | #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) | ||
13 | |||
14 | static inline void putc(char c) | ||
15 | { | ||
16 | while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE) | ||
17 | barrier(); | ||
18 | uart_base[UART_TX] = c; | ||
19 | } | ||
20 | |||
21 | static inline void flush(void) | ||
22 | { | ||
23 | } | ||
24 | |||
25 | static __inline__ void __arch_decomp_setup(unsigned long arch_id) | ||
26 | { | ||
27 | if (machine_is_iq80321()) | ||
28 | uart_base = (volatile u8 *)IQ80321_UART; | ||
29 | else if (machine_is_iq31244()) | ||
30 | uart_base = (volatile u8 *)IQ31244_UART; | ||
31 | else | ||
32 | uart_base = (volatile u8 *)0xfe800000; | ||
33 | } | ||
34 | |||
35 | /* | ||
36 | * nothing to do | ||
37 | */ | ||
38 | #define arch_decomp_setup() __arch_decomp_setup(arch_id) | ||
39 | #define arch_decomp_wdog() | ||
diff --git a/include/asm-arm/arch-iop32x/vmalloc.h b/include/asm-arm/arch-iop32x/vmalloc.h new file mode 100644 index 000000000000..0a70baa19517 --- /dev/null +++ b/include/asm-arm/arch-iop32x/vmalloc.h | |||
@@ -0,0 +1,5 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop32x/vmalloc.h | ||
3 | */ | ||
4 | |||
5 | #define VMALLOC_END 0xfe000000 | ||
diff --git a/include/asm-arm/arch-iop33x/debug-macro.S b/include/asm-arm/arch-iop33x/debug-macro.S new file mode 100644 index 000000000000..9e7132ebe6a7 --- /dev/null +++ b/include/asm-arm/arch-iop33x/debug-macro.S | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header | ||
5 | * | ||
6 | * Copyright (C) 1994-1999 Russell King | ||
7 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
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 | .macro addruart, rx | ||
15 | mrc p15, 0, \rx, c1, c0 | ||
16 | tst \rx, #1 @ mmu enabled? | ||
17 | moveq \rx, #0xff000000 @ physical | ||
18 | movne \rx, #0xfe000000 @ virtual | ||
19 | orr \rx, \rx, #0x00ff0000 | ||
20 | orr \rx, \rx, #0x0000f700 | ||
21 | .endm | ||
22 | |||
23 | #define UART_SHIFT 2 | ||
24 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/include/asm-arm/arch-iop33x/dma.h b/include/asm-arm/arch-iop33x/dma.h new file mode 100644 index 000000000000..b7775fdc5ad3 --- /dev/null +++ b/include/asm-arm/arch-iop33x/dma.h | |||
@@ -0,0 +1,9 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/dma.h | ||
3 | * | ||
4 | * Copyright (C) 2004 Intel Corp. | ||
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 | */ | ||
diff --git a/include/asm-arm/arch-iop33x/entry-macro.S b/include/asm-arm/arch-iop33x/entry-macro.S new file mode 100644 index 000000000000..92b791702e34 --- /dev/null +++ b/include/asm-arm/arch-iop33x/entry-macro.S | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for IOP33x-based 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 | #include <asm/arch/iop33x.h> | ||
11 | |||
12 | .macro disable_fiq | ||
13 | .endm | ||
14 | |||
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
16 | ldr \base, =IOP3XX_REG_ADDR(0x07C8) | ||
17 | ldr \irqstat, [\base] @ Read IINTVEC | ||
18 | cmp \irqstat, #0 | ||
19 | ldreq \irqstat, [\base] @ erratum 63 workaround | ||
20 | adds \irqnr, \irqstat, #1 | ||
21 | movne \irqnr, \irqstat, lsr #2 | ||
22 | .endm | ||
diff --git a/include/asm-arm/arch-iop33x/hardware.h b/include/asm-arm/arch-iop33x/hardware.h new file mode 100644 index 000000000000..0659cf94d040 --- /dev/null +++ b/include/asm-arm/arch-iop33x/hardware.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/hardware.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __HARDWARE_H | ||
6 | #define __HARDWARE_H | ||
7 | |||
8 | #include <asm/types.h> | ||
9 | |||
10 | /* | ||
11 | * Note about PCI IO space mappings | ||
12 | * | ||
13 | * To make IO space accesses efficient, we store virtual addresses in | ||
14 | * the IO resources. | ||
15 | * | ||
16 | * The PCI IO space is located at virtual 0xfe000000 from physical | ||
17 | * 0x90000000. The PCI BARs must be programmed with physical addresses, | ||
18 | * but when we read them, we convert them to virtual addresses. See | ||
19 | * arch/arm/mach-iop3xx/iop3xx-pci.c | ||
20 | */ | ||
21 | #define pcibios_assign_all_busses() 1 | ||
22 | #define PCIBIOS_MIN_IO 0x00000000 | ||
23 | #define PCIBIOS_MIN_MEM 0x00000000 | ||
24 | |||
25 | #ifndef __ASSEMBLY__ | ||
26 | void iop33x_init_irq(void); | ||
27 | |||
28 | extern struct platform_device iop33x_uart0_device; | ||
29 | extern struct platform_device iop33x_uart1_device; | ||
30 | #endif | ||
31 | |||
32 | |||
33 | /* | ||
34 | * Generic chipset bits | ||
35 | * | ||
36 | */ | ||
37 | #include "iop33x.h" | ||
38 | |||
39 | /* | ||
40 | * Board specific bits | ||
41 | */ | ||
42 | #include "iq80331.h" | ||
43 | #include "iq80332.h" | ||
44 | |||
45 | |||
46 | #endif | ||
diff --git a/include/asm-arm/arch-iop33x/io.h b/include/asm-arm/arch-iop33x/io.h new file mode 100644 index 000000000000..c017402bab96 --- /dev/null +++ b/include/asm-arm/arch-iop33x/io.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/io.h | ||
3 | * | ||
4 | * Copyright (C) 2001 MontaVista Software, 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 | |||
11 | #ifndef __IO_H | ||
12 | #define __IO_H | ||
13 | |||
14 | #include <asm/hardware.h> | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | #define __io(p) ((void __iomem *)(p)) | ||
18 | #define __mem_pci(a) (a) | ||
19 | |||
20 | |||
21 | #endif | ||
diff --git a/include/asm-arm/arch-iop33x/iop33x.h b/include/asm-arm/arch-iop33x/iop33x.h new file mode 100644 index 000000000000..7ac6e93db5ff --- /dev/null +++ b/include/asm-arm/arch-iop33x/iop33x.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/iop33x.h | ||
3 | * | ||
4 | * Intel IOP33X Chip definitions | ||
5 | * | ||
6 | * Author: Dave Jiang (dave.jiang@intel.com) | ||
7 | * Copyright (C) 2003, 2004 Intel Corp. | ||
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 __IOP33X_H | ||
15 | #define __IOP33X_H | ||
16 | |||
17 | /* | ||
18 | * Peripherals that are shared between the iop32x and iop33x but | ||
19 | * located at different addresses. | ||
20 | */ | ||
21 | #define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780 + (reg)) | ||
22 | #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07d0 + (reg)) | ||
23 | |||
24 | #include <asm/hardware/iop3xx.h> | ||
25 | |||
26 | /* UARTs */ | ||
27 | #define IOP33X_UART0_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1700) | ||
28 | #define IOP33X_UART0_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1700) | ||
29 | #define IOP33X_UART1_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1740) | ||
30 | #define IOP33X_UART1_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1740) | ||
31 | |||
32 | |||
33 | #endif | ||
diff --git a/include/asm-arm/arch-iop3xx/iq80331.h b/include/asm-arm/arch-iop33x/iq80331.h index 0668e78d483e..79b9302017ea 100644 --- a/include/asm-arm/arch-iop3xx/iq80331.h +++ b/include/asm-arm/arch-iop33x/iq80331.h | |||
@@ -1,23 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm/arch-iop3xx/iq80331.h | 2 | * include/asm-arm/arch-iop33x/iq80331.h |
3 | * | 3 | * |
4 | * Intel IQ80331 evaluation board registers | 4 | * Intel IQ80331 evaluation board registers |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef _IQ80331_H_ | 7 | #ifndef __IQ80331_H |
8 | #define _IQ80331_H_ | 8 | #define __IQ80331_H |
9 | |||
10 | #define IQ80331_FLASHBASE 0xc0000000 /* Flash */ | ||
11 | #define IQ80331_FLASHSIZE 0x00800000 | ||
12 | #define IQ80331_FLASHWIDTH 1 | ||
13 | 9 | ||
14 | #define IQ80331_7SEG_1 0xce840000 /* 7-Segment MSB */ | 10 | #define IQ80331_7SEG_1 0xce840000 /* 7-Segment MSB */ |
15 | #define IQ80331_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */ | 11 | #define IQ80331_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */ |
16 | #define IQ80331_ROTARY_SW 0xce8d0000 /* Rotary Switch */ | 12 | #define IQ80331_ROTARY_SW 0xce8d0000 /* Rotary Switch */ |
17 | #define IQ80331_BATT_STAT 0xce8f0000 /* Battery Status */ | 13 | #define IQ80331_BATT_STAT 0xce8f0000 /* Battery Status */ |
18 | 14 | ||
19 | #ifndef __ASSEMBLY__ | ||
20 | extern void iq80331_map_io(void); | ||
21 | #endif | ||
22 | 15 | ||
23 | #endif // _IQ80331_H_ | 16 | #endif |
diff --git a/include/asm-arm/arch-iop3xx/iq80332.h b/include/asm-arm/arch-iop33x/iq80332.h index e5fff1775d1a..053165629492 100644 --- a/include/asm-arm/arch-iop3xx/iq80332.h +++ b/include/asm-arm/arch-iop33x/iq80332.h | |||
@@ -1,23 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm/arch-iop3xx/iq80332.h | 2 | * include/asm-arm/arch-iop33x/iq80332.h |
3 | * | 3 | * |
4 | * Intel IQ80332 evaluation board registers | 4 | * Intel IQ80332 evaluation board registers |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef _IQ80332_H_ | 7 | #ifndef __IQ80332_H |
8 | #define _IQ80332_H_ | 8 | #define __IQ80332_H |
9 | |||
10 | #define IQ80332_FLASHBASE 0xc0000000 /* Flash */ | ||
11 | #define IQ80332_FLASHSIZE 0x00800000 | ||
12 | #define IQ80332_FLASHWIDTH 1 | ||
13 | 9 | ||
14 | #define IQ80332_7SEG_1 0xce840000 /* 7-Segment MSB */ | 10 | #define IQ80332_7SEG_1 0xce840000 /* 7-Segment MSB */ |
15 | #define IQ80332_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */ | 11 | #define IQ80332_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */ |
16 | #define IQ80332_ROTARY_SW 0xce8d0000 /* Rotary Switch */ | 12 | #define IQ80332_ROTARY_SW 0xce8d0000 /* Rotary Switch */ |
17 | #define IQ80332_BATT_STAT 0xce8f0000 /* Battery Status */ | 13 | #define IQ80332_BATT_STAT 0xce8f0000 /* Battery Status */ |
18 | 14 | ||
19 | #ifndef __ASSEMBLY__ | ||
20 | extern void iq80332_map_io(void); | ||
21 | #endif | ||
22 | 15 | ||
23 | #endif // _IQ80332_H_ | 16 | #endif |
diff --git a/include/asm-arm/arch-iop33x/irqs.h b/include/asm-arm/arch-iop33x/irqs.h new file mode 100644 index 000000000000..d045f8403396 --- /dev/null +++ b/include/asm-arm/arch-iop33x/irqs.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/irqs.h | ||
3 | * | ||
4 | * Author: Dave Jiang (dave.jiang@intel.com) | ||
5 | * Copyright: (C) 2003 Intel Corp. | ||
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 version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __IRQS_H | ||
13 | #define __IRQS_H | ||
14 | |||
15 | /* | ||
16 | * IOP80331 chipset interrupts | ||
17 | */ | ||
18 | #define IRQ_IOP33X_DMA0_EOT 0 | ||
19 | #define IRQ_IOP33X_DMA0_EOC 1 | ||
20 | #define IRQ_IOP33X_DMA1_EOT 2 | ||
21 | #define IRQ_IOP33X_DMA1_EOC 3 | ||
22 | #define IRQ_IOP33X_AA_EOT 6 | ||
23 | #define IRQ_IOP33X_AA_EOC 7 | ||
24 | #define IRQ_IOP33X_TIMER0 8 | ||
25 | #define IRQ_IOP33X_TIMER1 9 | ||
26 | #define IRQ_IOP33X_I2C_0 10 | ||
27 | #define IRQ_IOP33X_I2C_1 11 | ||
28 | #define IRQ_IOP33X_MSG 12 | ||
29 | #define IRQ_IOP33X_MSGIBQ 13 | ||
30 | #define IRQ_IOP33X_ATU_BIST 14 | ||
31 | #define IRQ_IOP33X_PERFMON 15 | ||
32 | #define IRQ_IOP33X_CORE_PMU 16 | ||
33 | #define IRQ_IOP33X_XINT0 24 | ||
34 | #define IRQ_IOP33X_XINT1 25 | ||
35 | #define IRQ_IOP33X_XINT2 26 | ||
36 | #define IRQ_IOP33X_XINT3 27 | ||
37 | #define IRQ_IOP33X_XINT8 32 | ||
38 | #define IRQ_IOP33X_XINT9 33 | ||
39 | #define IRQ_IOP33X_XINT10 34 | ||
40 | #define IRQ_IOP33X_XINT11 35 | ||
41 | #define IRQ_IOP33X_XINT12 36 | ||
42 | #define IRQ_IOP33X_XINT13 37 | ||
43 | #define IRQ_IOP33X_XINT14 38 | ||
44 | #define IRQ_IOP33X_XINT15 39 | ||
45 | #define IRQ_IOP33X_UART0 51 | ||
46 | #define IRQ_IOP33X_UART1 52 | ||
47 | #define IRQ_IOP33X_PBIE 53 | ||
48 | #define IRQ_IOP33X_ATU_CRW 54 | ||
49 | #define IRQ_IOP33X_ATU_ERR 55 | ||
50 | #define IRQ_IOP33X_MCU_ERR 56 | ||
51 | #define IRQ_IOP33X_DMA0_ERR 57 | ||
52 | #define IRQ_IOP33X_DMA1_ERR 58 | ||
53 | #define IRQ_IOP33X_AA_ERR 60 | ||
54 | #define IRQ_IOP33X_MSG_ERR 62 | ||
55 | #define IRQ_IOP33X_HPI 63 | ||
56 | |||
57 | #define NR_IRQS 64 | ||
58 | |||
59 | |||
60 | #endif | ||
diff --git a/include/asm-arm/arch-iop33x/memory.h b/include/asm-arm/arch-iop33x/memory.h new file mode 100644 index 000000000000..0d39139b241e --- /dev/null +++ b/include/asm-arm/arch-iop33x/memory.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/memory.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __MEMORY_H | ||
6 | #define __MEMORY_H | ||
7 | |||
8 | #include <asm/hardware.h> | ||
9 | |||
10 | /* | ||
11 | * Physical DRAM offset. | ||
12 | */ | ||
13 | #define PHYS_OFFSET UL(0x00000000) | ||
14 | |||
15 | /* | ||
16 | * Virtual view <-> PCI DMA view memory address translations | ||
17 | * virt_to_bus: Used to translate the virtual address to an | ||
18 | * address suitable to be passed to set_dma_addr | ||
19 | * bus_to_virt: Used to convert an address for DMA operations | ||
20 | * to an address that the kernel can use. | ||
21 | */ | ||
22 | #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP3XX_IATVR2)) | ((*IOP3XX_IABAR2) & 0xfffffff0)) | ||
23 | #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP3XX_IALR2)) | ( *IOP3XX_IATVR2))) | ||
24 | |||
25 | |||
26 | #endif | ||
diff --git a/include/asm-arm/arch-iop33x/system.h b/include/asm-arm/arch-iop33x/system.h new file mode 100644 index 000000000000..00dd07ece262 --- /dev/null +++ b/include/asm-arm/arch-iop33x/system.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/system.h | ||
3 | * | ||
4 | * Copyright (C) 2001 MontaVista Software, 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 | |||
11 | static inline void arch_idle(void) | ||
12 | { | ||
13 | cpu_do_idle(); | ||
14 | } | ||
15 | |||
16 | static inline void arch_reset(char mode) | ||
17 | { | ||
18 | *IOP3XX_PCSR = 0x30; | ||
19 | |||
20 | /* Jump into ROM at address 0 */ | ||
21 | cpu_reset(0); | ||
22 | } | ||
diff --git a/include/asm-arm/arch-iop33x/timex.h b/include/asm-arm/arch-iop33x/timex.h new file mode 100644 index 000000000000..fe3e1e369ff9 --- /dev/null +++ b/include/asm-arm/arch-iop33x/timex.h | |||
@@ -0,0 +1,9 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/timex.h | ||
3 | * | ||
4 | * IOP3xx architecture timex specifications | ||
5 | */ | ||
6 | |||
7 | #include <asm/hardware.h> | ||
8 | |||
9 | #define CLOCK_TICK_RATE (100 * HZ) | ||
diff --git a/include/asm-arm/arch-iop33x/uncompress.h b/include/asm-arm/arch-iop33x/uncompress.h new file mode 100644 index 000000000000..e17fbc05877b --- /dev/null +++ b/include/asm-arm/arch-iop33x/uncompress.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/uncompress.h | ||
3 | */ | ||
4 | |||
5 | #include <asm/types.h> | ||
6 | #include <asm/mach-types.h> | ||
7 | #include <linux/serial_reg.h> | ||
8 | #include <asm/hardware.h> | ||
9 | |||
10 | static volatile u32 *uart_base; | ||
11 | |||
12 | #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) | ||
13 | |||
14 | static inline void putc(char c) | ||
15 | { | ||
16 | while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE) | ||
17 | barrier(); | ||
18 | uart_base[UART_TX] = c; | ||
19 | } | ||
20 | |||
21 | static inline void flush(void) | ||
22 | { | ||
23 | } | ||
24 | |||
25 | static __inline__ void __arch_decomp_setup(unsigned long arch_id) | ||
26 | { | ||
27 | if (machine_is_iq80331() || machine_is_iq80332()) | ||
28 | uart_base = (volatile u32 *)IOP33X_UART0_PHYS; | ||
29 | else | ||
30 | uart_base = (volatile u32 *)0xfe800000; | ||
31 | } | ||
32 | |||
33 | /* | ||
34 | * nothing to do | ||
35 | */ | ||
36 | #define arch_decomp_setup() __arch_decomp_setup(arch_id) | ||
37 | #define arch_decomp_wdog() | ||
diff --git a/include/asm-arm/arch-iop33x/vmalloc.h b/include/asm-arm/arch-iop33x/vmalloc.h new file mode 100644 index 000000000000..66f545a7f4fc --- /dev/null +++ b/include/asm-arm/arch-iop33x/vmalloc.h | |||
@@ -0,0 +1,5 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop33x/vmalloc.h | ||
3 | */ | ||
4 | |||
5 | #define VMALLOC_END 0xfe000000 | ||
diff --git a/include/asm-arm/arch-iop3xx/debug-macro.S b/include/asm-arm/arch-iop3xx/debug-macro.S deleted file mode 100644 index ce007e531994..000000000000 --- a/include/asm-arm/arch-iop3xx/debug-macro.S +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* linux/include/asm-arm/arch-iop3xx/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | .macro addruart,rx | ||
15 | mov \rx, #0xfe000000 @ physical | ||
16 | #if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) | ||
17 | orr \rx, \rx, #0x00800000 @ location of the UART | ||
18 | #elif defined(CONFIG_ARCH_IOP331) | ||
19 | mrc p15, 0, \rx, c1, c0 | ||
20 | tst \rx, #1 @ MMU enabled? | ||
21 | moveq \rx, #0x000fe000 @ Physical Base | ||
22 | movne \rx, #0 | ||
23 | orr \rx, \rx, #0xfe000000 | ||
24 | orr \rx, \rx, #0x00f00000 @ Virtual Base | ||
25 | orr \rx, \rx, #0x00001700 @ location of the UART | ||
26 | #else | ||
27 | #error Unknown IOP3XX implementation | ||
28 | #endif | ||
29 | .endm | ||
30 | |||
31 | #if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331) | ||
32 | #define FLOW_CONTROL | ||
33 | #endif | ||
34 | #define UART_SHIFT 0 | ||
35 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/include/asm-arm/arch-iop3xx/entry-macro.S b/include/asm-arm/arch-iop3xx/entry-macro.S deleted file mode 100644 index 926668c098a5..000000000000 --- a/include/asm-arm/arch-iop3xx/entry-macro.S +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-iop3xx/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for IOP3xx-based 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 | #include <asm/arch/irqs.h> | ||
11 | |||
12 | #if defined(CONFIG_ARCH_IOP321) | ||
13 | .macro disable_fiq | ||
14 | .endm | ||
15 | |||
16 | /* | ||
17 | * Note: only deal with normal interrupts, not FIQ | ||
18 | */ | ||
19 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
20 | mov \irqnr, #0 | ||
21 | mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC | ||
22 | cmp \irqstat, #0 | ||
23 | beq 1001f | ||
24 | clz \irqnr, \irqstat | ||
25 | mov \base, #31 | ||
26 | subs \irqnr,\base,\irqnr | ||
27 | add \irqnr,\irqnr,#IRQ_IOP321_DMA0_EOT | ||
28 | 1001: | ||
29 | .endm | ||
30 | |||
31 | #elif defined(CONFIG_ARCH_IOP331) | ||
32 | .macro disable_fiq | ||
33 | .endm | ||
34 | |||
35 | /* | ||
36 | * Note: only deal with normal interrupts, not FIQ | ||
37 | */ | ||
38 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
39 | mov \irqnr, #0 | ||
40 | mrc p6, 0, \irqstat, c4, c0, 0 @ Read IINTSRC0 | ||
41 | cmp \irqstat, #0 | ||
42 | bne 1002f | ||
43 | mrc p6, 0, \irqstat, c5, c0, 0 @ Read IINTSRC1 | ||
44 | cmp \irqstat, #0 | ||
45 | beq 1001f | ||
46 | clz \irqnr, \irqstat | ||
47 | rsbs \irqnr,\irqnr,#31 @ recommend by RMK | ||
48 | add \irqnr,\irqnr,#IRQ_IOP331_XINT8 | ||
49 | b 1001f | ||
50 | 1002: clz \irqnr, \irqstat | ||
51 | rsbs \irqnr,\irqnr,#31 @ recommend by RMK | ||
52 | add \irqnr,\irqnr,#IRQ_IOP331_DMA0_EOT | ||
53 | 1001: | ||
54 | .endm | ||
55 | |||
56 | #endif | ||
57 | |||
diff --git a/include/asm-arm/arch-iop3xx/hardware.h b/include/asm-arm/arch-iop3xx/hardware.h deleted file mode 100644 index 3b138171d086..000000000000 --- a/include/asm-arm/arch-iop3xx/hardware.h +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/hardware.h | ||
3 | */ | ||
4 | #ifndef __ASM_ARCH_HARDWARE_H | ||
5 | #define __ASM_ARCH_HARDWARE_H | ||
6 | |||
7 | #include <asm/types.h> | ||
8 | |||
9 | /* | ||
10 | * Note about PCI IO space mappings | ||
11 | * | ||
12 | * To make IO space accesses efficient, we store virtual addresses in | ||
13 | * the IO resources. | ||
14 | * | ||
15 | * The PCI IO space is located at virtual 0xfe000000 from physical | ||
16 | * 0x90000000. The PCI BARs must be programmed with physical addresses, | ||
17 | * but when we read them, we convert them to virtual addresses. See | ||
18 | * arch/arm/mach-iop3xx/iop3xx-pci.c | ||
19 | */ | ||
20 | |||
21 | #define pcibios_assign_all_busses() 1 | ||
22 | |||
23 | |||
24 | /* | ||
25 | * The min PCI I/O and MEM space are dependent on what specific | ||
26 | * chipset/platform we are running on, so instead of hardcoding with | ||
27 | * #ifdefs, we just fill these in the platform level PCI init code. | ||
28 | */ | ||
29 | #ifndef __ASSEMBLY__ | ||
30 | extern unsigned long iop3xx_pcibios_min_io; | ||
31 | extern unsigned long iop3xx_pcibios_min_mem; | ||
32 | |||
33 | extern unsigned int processor_id; | ||
34 | #endif | ||
35 | |||
36 | /* | ||
37 | * We just set these to zero since they are really bogus anyways | ||
38 | */ | ||
39 | #define PCIBIOS_MIN_IO (iop3xx_pcibios_min_io) | ||
40 | #define PCIBIOS_MIN_MEM (iop3xx_pcibios_min_mem) | ||
41 | |||
42 | /* | ||
43 | * Generic chipset bits | ||
44 | * | ||
45 | */ | ||
46 | #include "iop321.h" | ||
47 | #include "iop331.h" | ||
48 | |||
49 | /* | ||
50 | * Board specific bits | ||
51 | */ | ||
52 | #include "iq80321.h" | ||
53 | #include "iq31244.h" | ||
54 | #include "iq80331.h" | ||
55 | #include "iq80332.h" | ||
56 | |||
57 | #endif /* _ASM_ARCH_HARDWARE_H */ | ||
diff --git a/include/asm-arm/arch-iop3xx/iop321-irqs.h b/include/asm-arm/arch-iop3xx/iop321-irqs.h deleted file mode 100644 index 2fcc1654cb9d..000000000000 --- a/include/asm-arm/arch-iop3xx/iop321-irqs.h +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/irqs.h | ||
3 | * | ||
4 | * Author: Rory Bolt <rorybolt@pacbell.net> | ||
5 | * Copyright: (C) 2002 Rory Bolt | ||
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 version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | #ifndef _IOP321_IRQS_H_ | ||
13 | #define _IOP321_IRQS_H_ | ||
14 | |||
15 | /* | ||
16 | * IOP80321 chipset interrupts | ||
17 | */ | ||
18 | #define IOP321_IRQ_OFS 0 | ||
19 | #define IOP321_IRQ(x) (IOP321_IRQ_OFS + (x)) | ||
20 | |||
21 | /* | ||
22 | * On IRQ or FIQ register | ||
23 | */ | ||
24 | #define IRQ_IOP321_DMA0_EOT IOP321_IRQ(0) | ||
25 | #define IRQ_IOP321_DMA0_EOC IOP321_IRQ(1) | ||
26 | #define IRQ_IOP321_DMA1_EOT IOP321_IRQ(2) | ||
27 | #define IRQ_IOP321_DMA1_EOC IOP321_IRQ(3) | ||
28 | #define IRQ_IOP321_RSVD_4 IOP321_IRQ(4) | ||
29 | #define IRQ_IOP321_RSVD_5 IOP321_IRQ(5) | ||
30 | #define IRQ_IOP321_AA_EOT IOP321_IRQ(6) | ||
31 | #define IRQ_IOP321_AA_EOC IOP321_IRQ(7) | ||
32 | #define IRQ_IOP321_CORE_PMON IOP321_IRQ(8) | ||
33 | #define IRQ_IOP321_TIMER0 IOP321_IRQ(9) | ||
34 | #define IRQ_IOP321_TIMER1 IOP321_IRQ(10) | ||
35 | #define IRQ_IOP321_I2C_0 IOP321_IRQ(11) | ||
36 | #define IRQ_IOP321_I2C_1 IOP321_IRQ(12) | ||
37 | #define IRQ_IOP321_MESSAGING IOP321_IRQ(13) | ||
38 | #define IRQ_IOP321_ATU_BIST IOP321_IRQ(14) | ||
39 | #define IRQ_IOP321_PERFMON IOP321_IRQ(15) | ||
40 | #define IRQ_IOP321_CORE_PMU IOP321_IRQ(16) | ||
41 | #define IRQ_IOP321_BIU_ERR IOP321_IRQ(17) | ||
42 | #define IRQ_IOP321_ATU_ERR IOP321_IRQ(18) | ||
43 | #define IRQ_IOP321_MCU_ERR IOP321_IRQ(19) | ||
44 | #define IRQ_IOP321_DMA0_ERR IOP321_IRQ(20) | ||
45 | #define IRQ_IOP321_DMA1_ERR IOP321_IRQ(21) | ||
46 | #define IRQ_IOP321_RSVD_22 IOP321_IRQ(22) | ||
47 | #define IRQ_IOP321_AA_ERR IOP321_IRQ(23) | ||
48 | #define IRQ_IOP321_MSG_ERR IOP321_IRQ(24) | ||
49 | #define IRQ_IOP321_SSP IOP321_IRQ(25) | ||
50 | #define IRQ_IOP321_RSVD_26 IOP321_IRQ(26) | ||
51 | #define IRQ_IOP321_XINT0 IOP321_IRQ(27) | ||
52 | #define IRQ_IOP321_XINT1 IOP321_IRQ(28) | ||
53 | #define IRQ_IOP321_XINT2 IOP321_IRQ(29) | ||
54 | #define IRQ_IOP321_XINT3 IOP321_IRQ(30) | ||
55 | #define IRQ_IOP321_HPI IOP321_IRQ(31) | ||
56 | |||
57 | #define NR_IOP321_IRQS (IOP321_IRQ(31) + 1) | ||
58 | |||
59 | #define NR_IRQS NR_IOP321_IRQS | ||
60 | |||
61 | |||
62 | /* | ||
63 | * Interrupts available on the IQ80321 board | ||
64 | */ | ||
65 | |||
66 | /* | ||
67 | * On board devices | ||
68 | */ | ||
69 | #define IRQ_IQ80321_I82544 IRQ_IOP321_XINT0 | ||
70 | #define IRQ_IQ80321_UART IRQ_IOP321_XINT1 | ||
71 | |||
72 | /* | ||
73 | * PCI interrupts | ||
74 | */ | ||
75 | #define IRQ_IQ80321_INTA IRQ_IOP321_XINT0 | ||
76 | #define IRQ_IQ80321_INTB IRQ_IOP321_XINT1 | ||
77 | #define IRQ_IQ80321_INTC IRQ_IOP321_XINT2 | ||
78 | #define IRQ_IQ80321_INTD IRQ_IOP321_XINT3 | ||
79 | |||
80 | /* | ||
81 | * Interrupts on the IQ31244 board | ||
82 | */ | ||
83 | |||
84 | /* | ||
85 | * On board devices | ||
86 | */ | ||
87 | #define IRQ_IQ31244_UART IRQ_IOP321_XINT1 | ||
88 | #define IRQ_IQ31244_I82546 IRQ_IOP321_XINT0 | ||
89 | #define IRQ_IQ31244_SATA IRQ_IOP321_XINT2 | ||
90 | #define IRQ_IQ31244_PCIX_SLOT IRQ_IOP321_XINT3 | ||
91 | |||
92 | /* | ||
93 | * PCI interrupts | ||
94 | */ | ||
95 | #define IRQ_IQ31244_INTA IRQ_IOP321_XINT0 | ||
96 | #define IRQ_IQ31244_INTB IRQ_IOP321_XINT1 | ||
97 | #define IRQ_IQ31244_INTC IRQ_IOP321_XINT2 | ||
98 | #define IRQ_IQ31244_INTD IRQ_IOP321_XINT3 | ||
99 | |||
100 | #endif // _IOP321_IRQ_H_ | ||
diff --git a/include/asm-arm/arch-iop3xx/iop321.h b/include/asm-arm/arch-iop3xx/iop321.h deleted file mode 100644 index f8df778a356f..000000000000 --- a/include/asm-arm/arch-iop3xx/iop321.h +++ /dev/null | |||
@@ -1,345 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm/arch-iop3xx/iop321.h | ||
3 | * | ||
4 | * Intel IOP321 Chip definitions | ||
5 | * | ||
6 | * Author: Rory Bolt <rorybolt@pacbell.net> | ||
7 | * Copyright (C) 2002 Rory Bolt | ||
8 | * Copyright (C) 2004 Intel Corp. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef _IOP321_HW_H_ | ||
16 | #define _IOP321_HW_H_ | ||
17 | |||
18 | |||
19 | /* | ||
20 | * This is needed for mixed drivers that need to work on all | ||
21 | * IOP3xx variants but behave slightly differently on each. | ||
22 | */ | ||
23 | #ifndef __ASSEMBLY__ | ||
24 | #ifdef CONFIG_ARCH_IOP321 | ||
25 | #define iop_is_321() (((processor_id & 0xfffff5e0) == 0x69052420)) | ||
26 | #else | ||
27 | #define iop_is_321() 0 | ||
28 | #endif | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * IOP321 I/O and Mem space regions for PCI autoconfiguration | ||
33 | */ | ||
34 | #define IOP321_PCI_IO_WINDOW_SIZE 0x00010000 | ||
35 | #define IOP321_PCI_LOWER_IO_PA 0x90000000 | ||
36 | #define IOP321_PCI_LOWER_IO_VA 0xfe000000 | ||
37 | #define IOP321_PCI_LOWER_IO_BA (*IOP321_OIOWTVR) | ||
38 | #define IOP321_PCI_UPPER_IO_PA (IOP321_PCI_LOWER_IO_PA + IOP321_PCI_IO_WINDOW_SIZE - 1) | ||
39 | #define IOP321_PCI_UPPER_IO_VA (IOP321_PCI_LOWER_IO_VA + IOP321_PCI_IO_WINDOW_SIZE - 1) | ||
40 | #define IOP321_PCI_UPPER_IO_BA (IOP321_PCI_LOWER_IO_BA + IOP321_PCI_IO_WINDOW_SIZE - 1) | ||
41 | #define IOP321_PCI_IO_OFFSET (IOP321_PCI_LOWER_IO_VA - IOP321_PCI_LOWER_IO_BA) | ||
42 | |||
43 | /* #define IOP321_PCI_MEM_WINDOW_SIZE (~*IOP321_IALR1 + 1) */ | ||
44 | #define IOP321_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */ | ||
45 | #define IOP321_PCI_LOWER_MEM_PA 0x80000000 | ||
46 | #define IOP321_PCI_LOWER_MEM_BA (*IOP321_OMWTVR0) | ||
47 | #define IOP321_PCI_UPPER_MEM_PA (IOP321_PCI_LOWER_MEM_PA + IOP321_PCI_MEM_WINDOW_SIZE - 1) | ||
48 | #define IOP321_PCI_UPPER_MEM_BA (IOP321_PCI_LOWER_MEM_BA + IOP321_PCI_MEM_WINDOW_SIZE - 1) | ||
49 | #define IOP321_PCI_MEM_OFFSET (IOP321_PCI_LOWER_MEM_PA - IOP321_PCI_LOWER_MEM_BA) | ||
50 | |||
51 | |||
52 | /* | ||
53 | * IOP321 chipset registers | ||
54 | */ | ||
55 | #define IOP321_VIRT_MEM_BASE 0xfeffe000 /* chip virtual mem address*/ | ||
56 | #define IOP321_PHYS_MEM_BASE 0xffffe000 /* chip physical memory address */ | ||
57 | #define IOP321_REG_ADDR(reg) (IOP321_VIRT_MEM_BASE | (reg)) | ||
58 | |||
59 | /* Reserved 0x00000000 through 0x000000FF */ | ||
60 | |||
61 | /* Address Translation Unit 0x00000100 through 0x000001FF */ | ||
62 | #define IOP321_ATUVID (volatile u16 *)IOP321_REG_ADDR(0x00000100) | ||
63 | #define IOP321_ATUDID (volatile u16 *)IOP321_REG_ADDR(0x00000102) | ||
64 | #define IOP321_ATUCMD (volatile u16 *)IOP321_REG_ADDR(0x00000104) | ||
65 | #define IOP321_ATUSR (volatile u16 *)IOP321_REG_ADDR(0x00000106) | ||
66 | #define IOP321_ATURID (volatile u8 *)IOP321_REG_ADDR(0x00000108) | ||
67 | #define IOP321_ATUCCR (volatile u32 *)IOP321_REG_ADDR(0x00000109) | ||
68 | #define IOP321_ATUCLSR (volatile u8 *)IOP321_REG_ADDR(0x0000010C) | ||
69 | #define IOP321_ATULT (volatile u8 *)IOP321_REG_ADDR(0x0000010D) | ||
70 | #define IOP321_ATUHTR (volatile u8 *)IOP321_REG_ADDR(0x0000010E) | ||
71 | #define IOP321_ATUBIST (volatile u8 *)IOP321_REG_ADDR(0x0000010F) | ||
72 | #define IOP321_IABAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000110) | ||
73 | #define IOP321_IAUBAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000114) | ||
74 | #define IOP321_IABAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000118) | ||
75 | #define IOP321_IAUBAR1 (volatile u32 *)IOP321_REG_ADDR(0x0000011C) | ||
76 | #define IOP321_IABAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000120) | ||
77 | #define IOP321_IAUBAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000124) | ||
78 | #define IOP321_ASVIR (volatile u16 *)IOP321_REG_ADDR(0x0000012C) | ||
79 | #define IOP321_ASIR (volatile u16 *)IOP321_REG_ADDR(0x0000012E) | ||
80 | #define IOP321_ERBAR (volatile u32 *)IOP321_REG_ADDR(0x00000130) | ||
81 | /* Reserved 0x00000134 through 0x0000013B */ | ||
82 | #define IOP321_ATUILR (volatile u8 *)IOP321_REG_ADDR(0x0000013C) | ||
83 | #define IOP321_ATUIPR (volatile u8 *)IOP321_REG_ADDR(0x0000013D) | ||
84 | #define IOP321_ATUMGNT (volatile u8 *)IOP321_REG_ADDR(0x0000013E) | ||
85 | #define IOP321_ATUMLAT (volatile u8 *)IOP321_REG_ADDR(0x0000013F) | ||
86 | #define IOP321_IALR0 (volatile u32 *)IOP321_REG_ADDR(0x00000140) | ||
87 | #define IOP321_IATVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000144) | ||
88 | #define IOP321_ERLR (volatile u32 *)IOP321_REG_ADDR(0x00000148) | ||
89 | #define IOP321_ERTVR (volatile u32 *)IOP321_REG_ADDR(0x0000014C) | ||
90 | #define IOP321_IALR1 (volatile u32 *)IOP321_REG_ADDR(0x00000150) | ||
91 | #define IOP321_IALR2 (volatile u32 *)IOP321_REG_ADDR(0x00000154) | ||
92 | #define IOP321_IATVR2 (volatile u32 *)IOP321_REG_ADDR(0x00000158) | ||
93 | #define IOP321_OIOWTVR (volatile u32 *)IOP321_REG_ADDR(0x0000015C) | ||
94 | #define IOP321_OMWTVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000160) | ||
95 | #define IOP321_OUMWTVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000164) | ||
96 | #define IOP321_OMWTVR1 (volatile u32 *)IOP321_REG_ADDR(0x00000168) | ||
97 | #define IOP321_OUMWTVR1 (volatile u32 *)IOP321_REG_ADDR(0x0000016C) | ||
98 | /* Reserved 0x00000170 through 0x00000177*/ | ||
99 | #define IOP321_OUDWTVR (volatile u32 *)IOP321_REG_ADDR(0x00000178) | ||
100 | /* Reserved 0x0000017C through 0x0000017F*/ | ||
101 | #define IOP321_ATUCR (volatile u32 *)IOP321_REG_ADDR(0x00000180) | ||
102 | #define IOP321_PCSR (volatile u32 *)IOP321_REG_ADDR(0x00000184) | ||
103 | #define IOP321_ATUISR (volatile u32 *)IOP321_REG_ADDR(0x00000188) | ||
104 | #define IOP321_ATUIMR (volatile u32 *)IOP321_REG_ADDR(0x0000018C) | ||
105 | #define IOP321_IABAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000190) | ||
106 | #define IOP321_IAUBAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000194) | ||
107 | #define IOP321_IALR3 (volatile u32 *)IOP321_REG_ADDR(0x00000198) | ||
108 | #define IOP321_IATVR3 (volatile u32 *)IOP321_REG_ADDR(0x0000019C) | ||
109 | /* Reserved 0x000001A0 through 0x000001A3*/ | ||
110 | #define IOP321_OCCAR (volatile u32 *)IOP321_REG_ADDR(0x000001A4) | ||
111 | /* Reserved 0x000001A8 through 0x000001AB*/ | ||
112 | #define IOP321_OCCDR (volatile u32 *)IOP321_REG_ADDR(0x000001AC) | ||
113 | /* Reserved 0x000001B0 through 0x000001BB*/ | ||
114 | #define IOP321_PDSCR (volatile u32 *)IOP321_REG_ADDR(0x000001BC) | ||
115 | #define IOP321_PMCAPID (volatile u8 *)IOP321_REG_ADDR(0x000001C0) | ||
116 | #define IOP321_PMNEXT (volatile u8 *)IOP321_REG_ADDR(0x000001C1) | ||
117 | #define IOP321_APMCR (volatile u16 *)IOP321_REG_ADDR(0x000001C2) | ||
118 | #define IOP321_APMCSR (volatile u16 *)IOP321_REG_ADDR(0x000001C4) | ||
119 | /* Reserved 0x000001C6 through 0x000001DF */ | ||
120 | #define IOP321_PCIXCAPID (volatile u8 *)IOP321_REG_ADDR(0x000001E0) | ||
121 | #define IOP321_PCIXNEXT (volatile u8 *)IOP321_REG_ADDR(0x000001E1) | ||
122 | #define IOP321_PCIXCMD (volatile u16 *)IOP321_REG_ADDR(0x000001E2) | ||
123 | #define IOP321_PCIXSR (volatile u32 *)IOP321_REG_ADDR(0x000001E4) | ||
124 | #define IOP321_PCIIRSR (volatile u32 *)IOP321_REG_ADDR(0x000001EC) | ||
125 | |||
126 | /* Messaging Unit 0x00000300 through 0x000003FF */ | ||
127 | |||
128 | /* Reserved 0x00000300 through 0x0000030c */ | ||
129 | #define IOP321_IMR0 (volatile u32 *)IOP321_REG_ADDR(0x00000310) | ||
130 | #define IOP321_IMR1 (volatile u32 *)IOP321_REG_ADDR(0x00000314) | ||
131 | #define IOP321_OMR0 (volatile u32 *)IOP321_REG_ADDR(0x00000318) | ||
132 | #define IOP321_OMR1 (volatile u32 *)IOP321_REG_ADDR(0x0000031C) | ||
133 | #define IOP321_IDR (volatile u32 *)IOP321_REG_ADDR(0x00000320) | ||
134 | #define IOP321_IISR (volatile u32 *)IOP321_REG_ADDR(0x00000324) | ||
135 | #define IOP321_IIMR (volatile u32 *)IOP321_REG_ADDR(0x00000328) | ||
136 | #define IOP321_ODR (volatile u32 *)IOP321_REG_ADDR(0x0000032C) | ||
137 | #define IOP321_OISR (volatile u32 *)IOP321_REG_ADDR(0x00000330) | ||
138 | #define IOP321_OIMR (volatile u32 *)IOP321_REG_ADDR(0x00000334) | ||
139 | /* Reserved 0x00000338 through 0x0000034F */ | ||
140 | #define IOP321_MUCR (volatile u32 *)IOP321_REG_ADDR(0x00000350) | ||
141 | #define IOP321_QBAR (volatile u32 *)IOP321_REG_ADDR(0x00000354) | ||
142 | /* Reserved 0x00000358 through 0x0000035C */ | ||
143 | #define IOP321_IFHPR (volatile u32 *)IOP321_REG_ADDR(0x00000360) | ||
144 | #define IOP321_IFTPR (volatile u32 *)IOP321_REG_ADDR(0x00000364) | ||
145 | #define IOP321_IPHPR (volatile u32 *)IOP321_REG_ADDR(0x00000368) | ||
146 | #define IOP321_IPTPR (volatile u32 *)IOP321_REG_ADDR(0x0000036C) | ||
147 | #define IOP321_OFHPR (volatile u32 *)IOP321_REG_ADDR(0x00000370) | ||
148 | #define IOP321_OFTPR (volatile u32 *)IOP321_REG_ADDR(0x00000374) | ||
149 | #define IOP321_OPHPR (volatile u32 *)IOP321_REG_ADDR(0x00000378) | ||
150 | #define IOP321_OPTPR (volatile u32 *)IOP321_REG_ADDR(0x0000037C) | ||
151 | #define IOP321_IAR (volatile u32 *)IOP321_REG_ADDR(0x00000380) | ||
152 | |||
153 | #define IOP321_IIxR_MASK 0x7f /* masks all */ | ||
154 | #define IOP321_IIxR_IRI 0x40 /* RC Index Register Interrupt */ | ||
155 | #define IOP321_IIxR_OFQF 0x20 /* RC Output Free Q Full (ERROR) */ | ||
156 | #define IOP321_IIxR_ipq 0x10 /* RC Inbound Post Q (post) */ | ||
157 | #define IOP321_IIxR_ERRDI 0x08 /* RO Error Doorbell Interrupt */ | ||
158 | #define IOP321_IIxR_IDI 0x04 /* RO Inbound Doorbell Interrupt */ | ||
159 | #define IOP321_IIxR_IM1 0x02 /* RC Inbound Message 1 Interrupt */ | ||
160 | #define IOP321_IIxR_IM0 0x01 /* RC Inbound Message 0 Interrupt */ | ||
161 | |||
162 | /* Reserved 0x00000384 through 0x000003FF */ | ||
163 | |||
164 | /* DMA Controller 0x00000400 through 0x000004FF */ | ||
165 | #define IOP321_DMA0_CCR (volatile u32 *)IOP321_REG_ADDR(0x00000400) | ||
166 | #define IOP321_DMA0_CSR (volatile u32 *)IOP321_REG_ADDR(0x00000404) | ||
167 | #define IOP321_DMA0_DAR (volatile u32 *)IOP321_REG_ADDR(0x0000040C) | ||
168 | #define IOP321_DMA0_NDAR (volatile u32 *)IOP321_REG_ADDR(0x00000410) | ||
169 | #define IOP321_DMA0_PADR (volatile u32 *)IOP321_REG_ADDR(0x00000414) | ||
170 | #define IOP321_DMA0_PUADR (volatile u32 *)IOP321_REG_ADDR(0x00000418) | ||
171 | #define IOP321_DMA0_LADR (volatile u32 *)IOP321_REG_ADDR(0X0000041C) | ||
172 | #define IOP321_DMA0_BCR (volatile u32 *)IOP321_REG_ADDR(0x00000420) | ||
173 | #define IOP321_DMA0_DCR (volatile u32 *)IOP321_REG_ADDR(0x00000424) | ||
174 | /* Reserved 0x00000428 through 0x0000043C */ | ||
175 | #define IOP321_DMA1_CCR (volatile u32 *)IOP321_REG_ADDR(0x00000440) | ||
176 | #define IOP321_DMA1_CSR (volatile u32 *)IOP321_REG_ADDR(0x00000444) | ||
177 | #define IOP321_DMA1_DAR (volatile u32 *)IOP321_REG_ADDR(0x0000044C) | ||
178 | #define IOP321_DMA1_NDAR (volatile u32 *)IOP321_REG_ADDR(0x00000450) | ||
179 | #define IOP321_DMA1_PADR (volatile u32 *)IOP321_REG_ADDR(0x00000454) | ||
180 | #define IOP321_DMA1_PUADR (volatile u32 *)IOP321_REG_ADDR(0x00000458) | ||
181 | #define IOP321_DMA1_LADR (volatile u32 *)IOP321_REG_ADDR(0x0000045C) | ||
182 | #define IOP321_DMA1_BCR (volatile u32 *)IOP321_REG_ADDR(0x00000460) | ||
183 | #define IOP321_DMA1_DCR (volatile u32 *)IOP321_REG_ADDR(0x00000464) | ||
184 | /* Reserved 0x00000468 through 0x000004FF */ | ||
185 | |||
186 | /* Memory controller 0x00000500 through 0x0005FF */ | ||
187 | |||
188 | /* Peripheral bus interface unit 0x00000680 through 0x0006FF */ | ||
189 | #define IOP321_PBCR (volatile u32 *)IOP321_REG_ADDR(0x00000680) | ||
190 | #define IOP321_PBISR (volatile u32 *)IOP321_REG_ADDR(0x00000684) | ||
191 | #define IOP321_PBBAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000688) | ||
192 | #define IOP321_PBLR0 (volatile u32 *)IOP321_REG_ADDR(0x0000068C) | ||
193 | #define IOP321_PBBAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000690) | ||
194 | #define IOP321_PBLR1 (volatile u32 *)IOP321_REG_ADDR(0x00000694) | ||
195 | #define IOP321_PBBAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000698) | ||
196 | #define IOP321_PBLR2 (volatile u32 *)IOP321_REG_ADDR(0x0000069C) | ||
197 | #define IOP321_PBBAR3 (volatile u32 *)IOP321_REG_ADDR(0x000006A0) | ||
198 | #define IOP321_PBLR3 (volatile u32 *)IOP321_REG_ADDR(0x000006A4) | ||
199 | #define IOP321_PBBAR4 (volatile u32 *)IOP321_REG_ADDR(0x000006A8) | ||
200 | #define IOP321_PBLR4 (volatile u32 *)IOP321_REG_ADDR(0x000006AC) | ||
201 | #define IOP321_PBBAR5 (volatile u32 *)IOP321_REG_ADDR(0x000006B0) | ||
202 | #define IOP321_PBLR5 (volatile u32 *)IOP321_REG_ADDR(0x000006B4) | ||
203 | #define IOP321_PBDSCR (volatile u32 *)IOP321_REG_ADDR(0x000006B8) | ||
204 | /* Reserved 0x000006BC */ | ||
205 | #define IOP321_PMBR0 (volatile u32 *)IOP321_REG_ADDR(0x000006C0) | ||
206 | /* Reserved 0x000006C4 through 0x000006DC */ | ||
207 | #define IOP321_PMBR1 (volatile u32 *)IOP321_REG_ADDR(0x000006E0) | ||
208 | #define IOP321_PMBR2 (volatile u32 *)IOP321_REG_ADDR(0x000006E4) | ||
209 | |||
210 | #define IOP321_PBCR_EN 0x1 | ||
211 | |||
212 | #define IOP321_PBISR_BOOR_ERR 0x1 | ||
213 | |||
214 | /* Peripheral performance monitoring unit 0x00000700 through 0x00077F */ | ||
215 | #define IOP321_GTMR (volatile u32 *)IOP321_REG_ADDR(0x00000700) | ||
216 | #define IOP321_ESR (volatile u32 *)IOP321_REG_ADDR(0x00000704) | ||
217 | #define IOP321_EMISR (volatile u32 *)IOP321_REG_ADDR(0x00000708) | ||
218 | /* reserved 0x00000070c */ | ||
219 | #define IOP321_GTSR (volatile u32 *)IOP321_REG_ADDR(0x00000710) | ||
220 | /* PERC0 DOESN'T EXIST - index from 1! */ | ||
221 | #define IOP321_PERCR0 (volatile u32 *)IOP321_REG_ADDR(0x00000710) | ||
222 | |||
223 | #define IOP321_GTMR_NGCE 0x04 /* (Not) Global Counter Enable */ | ||
224 | |||
225 | /* Internal arbitration unit 0x00000780 through 0x0007BF */ | ||
226 | #define IOP321_IACR (volatile u32 *)IOP321_REG_ADDR(0x00000780) | ||
227 | #define IOP321_MTTR1 (volatile u32 *)IOP321_REG_ADDR(0x00000784) | ||
228 | #define IOP321_MTTR2 (volatile u32 *)IOP321_REG_ADDR(0x00000788) | ||
229 | |||
230 | /* General Purpose I/O Registers */ | ||
231 | #define IOP321_GPOE (volatile u32 *)IOP321_REG_ADDR(0x000007C4) | ||
232 | #define IOP321_GPID (volatile u32 *)IOP321_REG_ADDR(0x000007C8) | ||
233 | #define IOP321_GPOD (volatile u32 *)IOP321_REG_ADDR(0x000007CC) | ||
234 | |||
235 | /* Interrupt Controller */ | ||
236 | #define IOP321_INTCTL (volatile u32 *)IOP321_REG_ADDR(0x000007D0) | ||
237 | #define IOP321_INTSTR (volatile u32 *)IOP321_REG_ADDR(0x000007D4) | ||
238 | #define IOP321_IINTSRC (volatile u32 *)IOP321_REG_ADDR(0x000007D8) | ||
239 | #define IOP321_FINTSRC (volatile u32 *)IOP321_REG_ADDR(0x000007DC) | ||
240 | |||
241 | /* Timers */ | ||
242 | |||
243 | #define IOP321_TU_TMR0 (volatile u32 *)IOP321_REG_ADDR(0x000007E0) | ||
244 | #define IOP321_TU_TMR1 (volatile u32 *)IOP321_REG_ADDR(0x000007E4) | ||
245 | |||
246 | #ifdef CONFIG_ARCH_IQ80321 | ||
247 | #define IOP321_TICK_RATE 200000000 /* 200 MHz clock */ | ||
248 | #elif defined(CONFIG_ARCH_IQ31244) | ||
249 | #define IOP321_TICK_RATE 198000000 /* 33.000 MHz crystal */ | ||
250 | #endif | ||
251 | |||
252 | #ifdef CONFIG_ARCH_EP80219 | ||
253 | #undef IOP321_TICK_RATE | ||
254 | #define IOP321_TICK_RATE 200000000 /* 33.333333 Mhz crystal */ | ||
255 | #endif | ||
256 | |||
257 | #define IOP321_TMR_TC 0x01 | ||
258 | #define IOP321_TMR_EN 0x02 | ||
259 | #define IOP321_TMR_RELOAD 0x04 | ||
260 | #define IOP321_TMR_PRIVILEGED 0x09 | ||
261 | |||
262 | #define IOP321_TMR_RATIO_1_1 0x00 | ||
263 | #define IOP321_TMR_RATIO_4_1 0x10 | ||
264 | #define IOP321_TMR_RATIO_8_1 0x20 | ||
265 | #define IOP321_TMR_RATIO_16_1 0x30 | ||
266 | |||
267 | #define IOP321_TU_TCR0 (volatile u32 *)IOP321_REG_ADDR(0x000007E8) | ||
268 | #define IOP321_TU_TCR1 (volatile u32 *)IOP321_REG_ADDR(0x000007EC) | ||
269 | #define IOP321_TU_TRR0 (volatile u32 *)IOP321_REG_ADDR(0x000007F0) | ||
270 | #define IOP321_TU_TRR1 (volatile u32 *)IOP321_REG_ADDR(0x000007F4) | ||
271 | #define IOP321_TU_TISR (volatile u32 *)IOP321_REG_ADDR(0x000007F8) | ||
272 | #define IOP321_TU_WDTCR (volatile u32 *)IOP321_REG_ADDR(0x000007FC) | ||
273 | |||
274 | /* Application accelerator unit 0x00000800 - 0x000008FF */ | ||
275 | #define IOP321_AAU_ACR (volatile u32 *)IOP321_REG_ADDR(0x00000800) | ||
276 | #define IOP321_AAU_ASR (volatile u32 *)IOP321_REG_ADDR(0x00000804) | ||
277 | #define IOP321_AAU_ADAR (volatile u32 *)IOP321_REG_ADDR(0x00000808) | ||
278 | #define IOP321_AAU_ANDAR (volatile u32 *)IOP321_REG_ADDR(0x0000080C) | ||
279 | #define IOP321_AAU_SAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000810) | ||
280 | #define IOP321_AAU_SAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000814) | ||
281 | #define IOP321_AAU_SAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000818) | ||
282 | #define IOP321_AAU_SAR4 (volatile u32 *)IOP321_REG_ADDR(0x0000081C) | ||
283 | #define IOP321_AAU_SAR5 (volatile u32 *)IOP321_REG_ADDR(0x0000082C) | ||
284 | #define IOP321_AAU_SAR6 (volatile u32 *)IOP321_REG_ADDR(0x00000830) | ||
285 | #define IOP321_AAU_SAR7 (volatile u32 *)IOP321_REG_ADDR(0x00000834) | ||
286 | #define IOP321_AAU_SAR8 (volatile u32 *)IOP321_REG_ADDR(0x00000838) | ||
287 | #define IOP321_AAU_SAR9 (volatile u32 *)IOP321_REG_ADDR(0x00000840) | ||
288 | #define IOP321_AAU_SAR10 (volatile u32 *)IOP321_REG_ADDR(0x00000844) | ||
289 | #define IOP321_AAU_SAR11 (volatile u32 *)IOP321_REG_ADDR(0x00000848) | ||
290 | #define IOP321_AAU_SAR12 (volatile u32 *)IOP321_REG_ADDR(0x0000084C) | ||
291 | #define IOP321_AAU_SAR13 (volatile u32 *)IOP321_REG_ADDR(0x00000850) | ||
292 | #define IOP321_AAU_SAR14 (volatile u32 *)IOP321_REG_ADDR(0x00000854) | ||
293 | #define IOP321_AAU_SAR15 (volatile u32 *)IOP321_REG_ADDR(0x00000858) | ||
294 | #define IOP321_AAU_SAR16 (volatile u32 *)IOP321_REG_ADDR(0x0000085C) | ||
295 | #define IOP321_AAU_SAR17 (volatile u32 *)IOP321_REG_ADDR(0x00000864) | ||
296 | #define IOP321_AAU_SAR18 (volatile u32 *)IOP321_REG_ADDR(0x00000868) | ||
297 | #define IOP321_AAU_SAR19 (volatile u32 *)IOP321_REG_ADDR(0x0000086C) | ||
298 | #define IOP321_AAU_SAR20 (volatile u32 *)IOP321_REG_ADDR(0x00000870) | ||
299 | #define IOP321_AAU_SAR21 (volatile u32 *)IOP321_REG_ADDR(0x00000874) | ||
300 | #define IOP321_AAU_SAR22 (volatile u32 *)IOP321_REG_ADDR(0x00000878) | ||
301 | #define IOP321_AAU_SAR23 (volatile u32 *)IOP321_REG_ADDR(0x0000087C) | ||
302 | #define IOP321_AAU_SAR24 (volatile u32 *)IOP321_REG_ADDR(0x00000880) | ||
303 | #define IOP321_AAU_SAR25 (volatile u32 *)IOP321_REG_ADDR(0x00000888) | ||
304 | #define IOP321_AAU_SAR26 (volatile u32 *)IOP321_REG_ADDR(0x0000088C) | ||
305 | #define IOP321_AAU_SAR27 (volatile u32 *)IOP321_REG_ADDR(0x00000890) | ||
306 | #define IOP321_AAU_SAR28 (volatile u32 *)IOP321_REG_ADDR(0x00000894) | ||
307 | #define IOP321_AAU_SAR29 (volatile u32 *)IOP321_REG_ADDR(0x00000898) | ||
308 | #define IOP321_AAU_SAR30 (volatile u32 *)IOP321_REG_ADDR(0x0000089C) | ||
309 | #define IOP321_AAU_SAR31 (volatile u32 *)IOP321_REG_ADDR(0x000008A0) | ||
310 | #define IOP321_AAU_SAR32 (volatile u32 *)IOP321_REG_ADDR(0x000008A4) | ||
311 | #define IOP321_AAU_DAR (volatile u32 *)IOP321_REG_ADDR(0x00000820) | ||
312 | #define IOP321_AAU_ABCR (volatile u32 *)IOP321_REG_ADDR(0x00000824) | ||
313 | #define IOP321_AAU_ADCR (volatile u32 *)IOP321_REG_ADDR(0x00000828) | ||
314 | #define IOP321_AAU_EDCR0 (volatile u32 *)IOP321_REG_ADDR(0x0000083c) | ||
315 | #define IOP321_AAU_EDCR1 (volatile u32 *)IOP321_REG_ADDR(0x00000860) | ||
316 | #define IOP321_AAU_EDCR2 (volatile u32 *)IOP321_REG_ADDR(0x00000884) | ||
317 | |||
318 | |||
319 | /* SSP serial port unit 0x00001600 - 0x0000167F */ | ||
320 | /* I2C bus interface unit 0x00001680 - 0x000016FF */ | ||
321 | #define IOP321_ICR0 (volatile u32 *)IOP321_REG_ADDR(0x00001680) | ||
322 | #define IOP321_ISR0 (volatile u32 *)IOP321_REG_ADDR(0x00001684) | ||
323 | #define IOP321_ISAR0 (volatile u32 *)IOP321_REG_ADDR(0x00001688) | ||
324 | #define IOP321_IDBR0 (volatile u32 *)IOP321_REG_ADDR(0x0000168C) | ||
325 | /* Reserved 0x00001690 */ | ||
326 | #define IOP321_IBMR0 (volatile u32 *)IOP321_REG_ADDR(0x00001694) | ||
327 | /* Reserved 0x00001698 */ | ||
328 | /* Reserved 0x0000169C */ | ||
329 | #define IOP321_ICR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A0) | ||
330 | #define IOP321_ISR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A4) | ||
331 | #define IOP321_ISAR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A8) | ||
332 | #define IOP321_IDBR1 (volatile u32 *)IOP321_REG_ADDR(0x000016AC) | ||
333 | #define IOP321_IBMR1 (volatile u32 *)IOP321_REG_ADDR(0x000016B4) | ||
334 | /* Reserved 0x000016B8 through 0x000016FC */ | ||
335 | |||
336 | /* for I2C bit defs see drivers/i2c/i2c-iop3xx.h */ | ||
337 | |||
338 | |||
339 | #ifndef __ASSEMBLY__ | ||
340 | extern void iop321_map_io(void); | ||
341 | extern void iop321_init_irq(void); | ||
342 | extern void iop321_time_init(void); | ||
343 | #endif | ||
344 | |||
345 | #endif // _IOP321_HW_H_ | ||
diff --git a/include/asm-arm/arch-iop3xx/iop331-irqs.h b/include/asm-arm/arch-iop3xx/iop331-irqs.h deleted file mode 100644 index 7135ad7e335e..000000000000 --- a/include/asm-arm/arch-iop3xx/iop331-irqs.h +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/irqs.h | ||
3 | * | ||
4 | * Author: Dave Jiang (dave.jiang@intel.com) | ||
5 | * Copyright: (C) 2003 Intel Corp. | ||
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 version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | #ifndef _IOP331_IRQS_H_ | ||
13 | #define _IOP331_IRQS_H_ | ||
14 | |||
15 | /* | ||
16 | * IOP80331 chipset interrupts | ||
17 | */ | ||
18 | #define IOP331_IRQ_OFS 0 | ||
19 | #define IOP331_IRQ(x) (IOP331_IRQ_OFS + (x)) | ||
20 | |||
21 | /* | ||
22 | * On IRQ or FIQ register | ||
23 | */ | ||
24 | #define IRQ_IOP331_DMA0_EOT IOP331_IRQ(0) | ||
25 | #define IRQ_IOP331_DMA0_EOC IOP331_IRQ(1) | ||
26 | #define IRQ_IOP331_DMA1_EOT IOP331_IRQ(2) | ||
27 | #define IRQ_IOP331_DMA1_EOC IOP331_IRQ(3) | ||
28 | #define IRQ_IOP331_RSVD_4 IOP331_IRQ(4) | ||
29 | #define IRQ_IOP331_RSVD_5 IOP331_IRQ(5) | ||
30 | #define IRQ_IOP331_AA_EOT IOP331_IRQ(6) | ||
31 | #define IRQ_IOP331_AA_EOC IOP331_IRQ(7) | ||
32 | #define IRQ_IOP331_TIMER0 IOP331_IRQ(8) | ||
33 | #define IRQ_IOP331_TIMER1 IOP331_IRQ(9) | ||
34 | #define IRQ_IOP331_I2C_0 IOP331_IRQ(10) | ||
35 | #define IRQ_IOP331_I2C_1 IOP331_IRQ(11) | ||
36 | #define IRQ_IOP331_MSG IOP331_IRQ(12) | ||
37 | #define IRQ_IOP331_MSGIBQ IOP331_IRQ(13) | ||
38 | #define IRQ_IOP331_ATU_BIST IOP331_IRQ(14) | ||
39 | #define IRQ_IOP331_PERFMON IOP331_IRQ(15) | ||
40 | #define IRQ_IOP331_CORE_PMU IOP331_IRQ(16) | ||
41 | #define IRQ_IOP331_RSVD_17 IOP331_IRQ(17) | ||
42 | #define IRQ_IOP331_RSVD_18 IOP331_IRQ(18) | ||
43 | #define IRQ_IOP331_RSVD_19 IOP331_IRQ(19) | ||
44 | #define IRQ_IOP331_RSVD_20 IOP331_IRQ(20) | ||
45 | #define IRQ_IOP331_RSVD_21 IOP331_IRQ(21) | ||
46 | #define IRQ_IOP331_RSVD_22 IOP331_IRQ(22) | ||
47 | #define IRQ_IOP331_RSVD_23 IOP331_IRQ(23) | ||
48 | #define IRQ_IOP331_XINT0 IOP331_IRQ(24) | ||
49 | #define IRQ_IOP331_XINT1 IOP331_IRQ(25) | ||
50 | #define IRQ_IOP331_XINT2 IOP331_IRQ(26) | ||
51 | #define IRQ_IOP331_XINT3 IOP331_IRQ(27) | ||
52 | #define IRQ_IOP331_RSVD_28 IOP331_IRQ(28) | ||
53 | #define IRQ_IOP331_RSVD_29 IOP331_IRQ(29) | ||
54 | #define IRQ_IOP331_RSVD_30 IOP331_IRQ(30) | ||
55 | #define IRQ_IOP331_RSVD_31 IOP331_IRQ(31) | ||
56 | #define IRQ_IOP331_XINT8 IOP331_IRQ(32) // 0 | ||
57 | #define IRQ_IOP331_XINT9 IOP331_IRQ(33) // 1 | ||
58 | #define IRQ_IOP331_XINT10 IOP331_IRQ(34) // 2 | ||
59 | #define IRQ_IOP331_XINT11 IOP331_IRQ(35) // 3 | ||
60 | #define IRQ_IOP331_XINT12 IOP331_IRQ(36) // 4 | ||
61 | #define IRQ_IOP331_XINT13 IOP331_IRQ(37) // 5 | ||
62 | #define IRQ_IOP331_XINT14 IOP331_IRQ(38) // 6 | ||
63 | #define IRQ_IOP331_XINT15 IOP331_IRQ(39) // 7 | ||
64 | #define IRQ_IOP331_RSVD_40 IOP331_IRQ(40) // 8 | ||
65 | #define IRQ_IOP331_RSVD_41 IOP331_IRQ(41) // 9 | ||
66 | #define IRQ_IOP331_RSVD_42 IOP331_IRQ(42) // 10 | ||
67 | #define IRQ_IOP331_RSVD_43 IOP331_IRQ(43) // 11 | ||
68 | #define IRQ_IOP331_RSVD_44 IOP331_IRQ(44) // 12 | ||
69 | #define IRQ_IOP331_RSVD_45 IOP331_IRQ(45) // 13 | ||
70 | #define IRQ_IOP331_RSVD_46 IOP331_IRQ(46) // 14 | ||
71 | #define IRQ_IOP331_RSVD_47 IOP331_IRQ(47) // 15 | ||
72 | #define IRQ_IOP331_RSVD_48 IOP331_IRQ(48) // 16 | ||
73 | #define IRQ_IOP331_RSVD_49 IOP331_IRQ(49) // 17 | ||
74 | #define IRQ_IOP331_RSVD_50 IOP331_IRQ(50) // 18 | ||
75 | #define IRQ_IOP331_UART0 IOP331_IRQ(51) // 19 | ||
76 | #define IRQ_IOP331_UART1 IOP331_IRQ(52) // 20 | ||
77 | #define IRQ_IOP331_PBIE IOP331_IRQ(53) // 21 | ||
78 | #define IRQ_IOP331_ATU_CRW IOP331_IRQ(54) // 22 | ||
79 | #define IRQ_IOP331_ATU_ERR IOP331_IRQ(55) // 23 | ||
80 | #define IRQ_IOP331_MCU_ERR IOP331_IRQ(56) // 24 | ||
81 | #define IRQ_IOP331_DMA0_ERR IOP331_IRQ(57) // 25 | ||
82 | #define IRQ_IOP331_DMA1_ERR IOP331_IRQ(58) // 26 | ||
83 | #define IRQ_IOP331_RSVD_59 IOP331_IRQ(59) // 27 | ||
84 | #define IRQ_IOP331_AA_ERR IOP331_IRQ(60) // 28 | ||
85 | #define IRQ_IOP331_RSVD_61 IOP331_IRQ(61) // 29 | ||
86 | #define IRQ_IOP331_MSG_ERR IOP331_IRQ(62) // 30 | ||
87 | #define IRQ_IOP331_HPI IOP331_IRQ(63) // 31 | ||
88 | |||
89 | #define NR_IOP331_IRQS (IOP331_IRQ(63) + 1) | ||
90 | |||
91 | #define NR_IRQS NR_IOP331_IRQS | ||
92 | |||
93 | |||
94 | /* | ||
95 | * Interrupts available on the IQ80331 board | ||
96 | */ | ||
97 | |||
98 | /* | ||
99 | * On board devices | ||
100 | */ | ||
101 | #define IRQ_IQ80331_I82544 IRQ_IOP331_XINT0 | ||
102 | #define IRQ_IQ80331_UART0 IRQ_IOP331_UART0 | ||
103 | #define IRQ_IQ80331_UART1 IRQ_IOP331_UART1 | ||
104 | |||
105 | /* | ||
106 | * PCI interrupts | ||
107 | */ | ||
108 | #define IRQ_IQ80331_INTA IRQ_IOP331_XINT0 | ||
109 | #define IRQ_IQ80331_INTB IRQ_IOP331_XINT1 | ||
110 | #define IRQ_IQ80331_INTC IRQ_IOP331_XINT2 | ||
111 | #define IRQ_IQ80331_INTD IRQ_IOP331_XINT3 | ||
112 | |||
113 | /* | ||
114 | * Interrupts available on the IQ80332 board | ||
115 | */ | ||
116 | |||
117 | /* | ||
118 | * On board devices | ||
119 | */ | ||
120 | #define IRQ_IQ80332_I82544 IRQ_IOP331_XINT0 | ||
121 | #define IRQ_IQ80332_UART0 IRQ_IOP331_UART0 | ||
122 | #define IRQ_IQ80332_UART1 IRQ_IOP331_UART1 | ||
123 | |||
124 | /* | ||
125 | * PCI interrupts | ||
126 | */ | ||
127 | #define IRQ_IQ80332_INTA IRQ_IOP331_XINT0 | ||
128 | #define IRQ_IQ80332_INTB IRQ_IOP331_XINT1 | ||
129 | #define IRQ_IQ80332_INTC IRQ_IOP331_XINT2 | ||
130 | #define IRQ_IQ80332_INTD IRQ_IOP331_XINT3 | ||
131 | |||
132 | #endif // _IOP331_IRQ_H_ | ||
diff --git a/include/asm-arm/arch-iop3xx/iop331.h b/include/asm-arm/arch-iop3xx/iop331.h deleted file mode 100644 index fbf0cc11bdd9..000000000000 --- a/include/asm-arm/arch-iop3xx/iop331.h +++ /dev/null | |||
@@ -1,363 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm/arch-iop3xx/iop331.h | ||
3 | * | ||
4 | * Intel IOP331 Chip definitions | ||
5 | * | ||
6 | * Author: Dave Jiang (dave.jiang@intel.com) | ||
7 | * Copyright (C) 2003, 2004 Intel Corp. | ||
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 _IOP331_HW_H_ | ||
15 | #define _IOP331_HW_H_ | ||
16 | |||
17 | |||
18 | /* | ||
19 | * This is needed for mixed drivers that need to work on all | ||
20 | * IOP3xx variants but behave slightly differently on each. | ||
21 | */ | ||
22 | #ifndef __ASSEMBLY__ | ||
23 | #ifdef CONFIG_ARCH_IOP331 | ||
24 | /*#define iop_is_331() ((processor_id & 0xffffffb0) == 0x69054090) */ | ||
25 | #define iop_is_331() ((processor_id & 0xffffff30) == 0x69054010) | ||
26 | #else | ||
27 | #define iop_is_331() 0 | ||
28 | #endif | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * IOP331 I/O and Mem space regions for PCI autoconfiguration | ||
33 | */ | ||
34 | #define IOP331_PCI_IO_WINDOW_SIZE 0x00010000 | ||
35 | #define IOP331_PCI_LOWER_IO_PA 0x90000000 | ||
36 | #define IOP331_PCI_LOWER_IO_VA 0xfe000000 | ||
37 | #define IOP331_PCI_LOWER_IO_BA (*IOP331_OIOWTVR) | ||
38 | #define IOP331_PCI_UPPER_IO_PA (IOP331_PCI_LOWER_IO_PA + IOP331_PCI_IO_WINDOW_SIZE - 1) | ||
39 | #define IOP331_PCI_UPPER_IO_VA (IOP331_PCI_LOWER_IO_VA + IOP331_PCI_IO_WINDOW_SIZE - 1) | ||
40 | #define IOP331_PCI_UPPER_IO_BA (IOP331_PCI_LOWER_IO_BA + IOP331_PCI_IO_WINDOW_SIZE - 1) | ||
41 | #define IOP331_PCI_IO_OFFSET (IOP331_PCI_LOWER_IO_VA - IOP331_PCI_LOWER_IO_BA) | ||
42 | |||
43 | /* this can be 128M if OMWTVR1 is set */ | ||
44 | #define IOP331_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */ | ||
45 | /* #define IOP331_PCI_MEM_WINDOW_SIZE (~*IOP331_IALR1 + 1) */ | ||
46 | #define IOP331_PCI_LOWER_MEM_PA 0x80000000 | ||
47 | #define IOP331_PCI_LOWER_MEM_BA (*IOP331_OMWTVR0) | ||
48 | #define IOP331_PCI_UPPER_MEM_PA (IOP331_PCI_LOWER_MEM_PA + IOP331_PCI_MEM_WINDOW_SIZE - 1) | ||
49 | #define IOP331_PCI_UPPER_MEM_BA (IOP331_PCI_LOWER_MEM_BA + IOP331_PCI_MEM_WINDOW_SIZE - 1) | ||
50 | #define IOP331_PCI_MEM_OFFSET (IOP331_PCI_LOWER_MEM_PA - IOP331_PCI_LOWER_MEM_BA) | ||
51 | |||
52 | /* | ||
53 | * IOP331 chipset registers | ||
54 | */ | ||
55 | #define IOP331_VIRT_MEM_BASE 0xfeffe000 /* chip virtual mem address*/ | ||
56 | #define IOP331_PHYS_MEM_BASE 0xffffe000 /* chip physical memory address */ | ||
57 | #define IOP331_REG_ADDR(reg) (IOP331_VIRT_MEM_BASE | (reg)) | ||
58 | |||
59 | /* Reserved 0x00000000 through 0x000000FF */ | ||
60 | |||
61 | /* Address Translation Unit 0x00000100 through 0x000001FF */ | ||
62 | #define IOP331_ATUVID (volatile u16 *)IOP331_REG_ADDR(0x00000100) | ||
63 | #define IOP331_ATUDID (volatile u16 *)IOP331_REG_ADDR(0x00000102) | ||
64 | #define IOP331_ATUCMD (volatile u16 *)IOP331_REG_ADDR(0x00000104) | ||
65 | #define IOP331_ATUSR (volatile u16 *)IOP331_REG_ADDR(0x00000106) | ||
66 | #define IOP331_ATURID (volatile u8 *)IOP331_REG_ADDR(0x00000108) | ||
67 | #define IOP331_ATUCCR (volatile u32 *)IOP331_REG_ADDR(0x00000109) | ||
68 | #define IOP331_ATUCLSR (volatile u8 *)IOP331_REG_ADDR(0x0000010C) | ||
69 | #define IOP331_ATULT (volatile u8 *)IOP331_REG_ADDR(0x0000010D) | ||
70 | #define IOP331_ATUHTR (volatile u8 *)IOP331_REG_ADDR(0x0000010E) | ||
71 | #define IOP331_ATUBIST (volatile u8 *)IOP331_REG_ADDR(0x0000010F) | ||
72 | #define IOP331_IABAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000110) | ||
73 | #define IOP331_IAUBAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000114) | ||
74 | #define IOP331_IABAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000118) | ||
75 | #define IOP331_IAUBAR1 (volatile u32 *)IOP331_REG_ADDR(0x0000011C) | ||
76 | #define IOP331_IABAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000120) | ||
77 | #define IOP331_IAUBAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000124) | ||
78 | #define IOP331_ASVIR (volatile u16 *)IOP331_REG_ADDR(0x0000012C) | ||
79 | #define IOP331_ASIR (volatile u16 *)IOP331_REG_ADDR(0x0000012E) | ||
80 | #define IOP331_ERBAR (volatile u32 *)IOP331_REG_ADDR(0x00000130) | ||
81 | #define IOP331_ATU_CAPPTR (volatile u32 *)IOP331_REG_ADDR(0x00000134) | ||
82 | /* Reserved 0x00000138 through 0x0000013B */ | ||
83 | #define IOP331_ATUILR (volatile u8 *)IOP331_REG_ADDR(0x0000013C) | ||
84 | #define IOP331_ATUIPR (volatile u8 *)IOP331_REG_ADDR(0x0000013D) | ||
85 | #define IOP331_ATUMGNT (volatile u8 *)IOP331_REG_ADDR(0x0000013E) | ||
86 | #define IOP331_ATUMLAT (volatile u8 *)IOP331_REG_ADDR(0x0000013F) | ||
87 | #define IOP331_IALR0 (volatile u32 *)IOP331_REG_ADDR(0x00000140) | ||
88 | #define IOP331_IATVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000144) | ||
89 | #define IOP331_ERLR (volatile u32 *)IOP331_REG_ADDR(0x00000148) | ||
90 | #define IOP331_ERTVR (volatile u32 *)IOP331_REG_ADDR(0x0000014C) | ||
91 | #define IOP331_IALR1 (volatile u32 *)IOP331_REG_ADDR(0x00000150) | ||
92 | #define IOP331_IALR2 (volatile u32 *)IOP331_REG_ADDR(0x00000154) | ||
93 | #define IOP331_IATVR2 (volatile u32 *)IOP331_REG_ADDR(0x00000158) | ||
94 | #define IOP331_OIOWTVR (volatile u32 *)IOP331_REG_ADDR(0x0000015C) | ||
95 | #define IOP331_OMWTVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000160) | ||
96 | #define IOP331_OUMWTVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000164) | ||
97 | #define IOP331_OMWTVR1 (volatile u32 *)IOP331_REG_ADDR(0x00000168) | ||
98 | #define IOP331_OUMWTVR1 (volatile u32 *)IOP331_REG_ADDR(0x0000016C) | ||
99 | /* Reserved 0x00000170 through 0x00000177*/ | ||
100 | #define IOP331_OUDWTVR (volatile u32 *)IOP331_REG_ADDR(0x00000178) | ||
101 | /* Reserved 0x0000017C through 0x0000017F*/ | ||
102 | #define IOP331_ATUCR (volatile u32 *)IOP331_REG_ADDR(0x00000180) | ||
103 | #define IOP331_PCSR (volatile u32 *)IOP331_REG_ADDR(0x00000184) | ||
104 | #define IOP331_ATUISR (volatile u32 *)IOP331_REG_ADDR(0x00000188) | ||
105 | #define IOP331_ATUIMR (volatile u32 *)IOP331_REG_ADDR(0x0000018C) | ||
106 | #define IOP331_IABAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000190) | ||
107 | #define IOP331_IAUBAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000194) | ||
108 | #define IOP331_IALR3 (volatile u32 *)IOP331_REG_ADDR(0x00000198) | ||
109 | #define IOP331_IATVR3 (volatile u32 *)IOP331_REG_ADDR(0x0000019C) | ||
110 | /* Reserved 0x000001A0 through 0x000001A3*/ | ||
111 | #define IOP331_OCCAR (volatile u32 *)IOP331_REG_ADDR(0x000001A4) | ||
112 | /* Reserved 0x000001A8 through 0x000001AB*/ | ||
113 | #define IOP331_OCCDR (volatile u32 *)IOP331_REG_ADDR(0x000001AC) | ||
114 | /* Reserved 0x000001B0 through 0x000001BB*/ | ||
115 | #define IOP331_VPDCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001B8) | ||
116 | #define IOP331_VPDNXTP (volatile u8 *)IOP331_REG_ADDR(0x000001B9) | ||
117 | #define IOP331_VPDAR (volatile u16 *)IOP331_REG_ADDR(0x000001BA) | ||
118 | #define IOP331_VPDDR (volatile u32 *)IOP331_REG_ADDR(0x000001BC) | ||
119 | #define IOP331_PMCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001C0) | ||
120 | #define IOP331_PMNEXT (volatile u8 *)IOP331_REG_ADDR(0x000001C1) | ||
121 | #define IOP331_APMCR (volatile u16 *)IOP331_REG_ADDR(0x000001C2) | ||
122 | #define IOP331_APMCSR (volatile u16 *)IOP331_REG_ADDR(0x000001C4) | ||
123 | /* Reserved 0x000001C6 through 0x000001CF */ | ||
124 | #define IOP331_MSICAPID (volatile u8 *)IOP331_REG_ADDR(0x000001D0) | ||
125 | #define IOP331_MSINXTP (volatile u8 *)IOP331_REG_ADDR(0x000001D1) | ||
126 | #define IOP331_MSIMCR (volatile u16 *)IOP331_REG_ADDR(0x000001D2) | ||
127 | #define IOP331_MSIMAR (volatile u32 *)IOP331_REG_ADDR(0x000001D4) | ||
128 | #define IOP331_MSIMUAR (volatile u32 *)IOP331_REG_ADDR(0x000001D8) | ||
129 | #define IOP331_MSIMDR (volatile u32 *)IOP331_REG_ADDR(0x000001DC) | ||
130 | #define IOP331_PCIXCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001E0) | ||
131 | #define IOP331_PCIXNEXT (volatile u8 *)IOP331_REG_ADDR(0x000001E1) | ||
132 | #define IOP331_PCIXCMD (volatile u16 *)IOP331_REG_ADDR(0x000001E2) | ||
133 | #define IOP331_PCIXSR (volatile u32 *)IOP331_REG_ADDR(0x000001E4) | ||
134 | #define IOP331_PCIIRSR (volatile u32 *)IOP331_REG_ADDR(0x000001EC) | ||
135 | |||
136 | /* Messaging Unit 0x00000300 through 0x000003FF */ | ||
137 | |||
138 | /* Reserved 0x00000300 through 0x0000030c */ | ||
139 | #define IOP331_IMR0 (volatile u32 *)IOP331_REG_ADDR(0x00000310) | ||
140 | #define IOP331_IMR1 (volatile u32 *)IOP331_REG_ADDR(0x00000314) | ||
141 | #define IOP331_OMR0 (volatile u32 *)IOP331_REG_ADDR(0x00000318) | ||
142 | #define IOP331_OMR1 (volatile u32 *)IOP331_REG_ADDR(0x0000031C) | ||
143 | #define IOP331_IDR (volatile u32 *)IOP331_REG_ADDR(0x00000320) | ||
144 | #define IOP331_IISR (volatile u32 *)IOP331_REG_ADDR(0x00000324) | ||
145 | #define IOP331_IIMR (volatile u32 *)IOP331_REG_ADDR(0x00000328) | ||
146 | #define IOP331_ODR (volatile u32 *)IOP331_REG_ADDR(0x0000032C) | ||
147 | #define IOP331_OISR (volatile u32 *)IOP331_REG_ADDR(0x00000330) | ||
148 | #define IOP331_OIMR (volatile u32 *)IOP331_REG_ADDR(0x00000334) | ||
149 | /* Reserved 0x00000338 through 0x0000034F */ | ||
150 | #define IOP331_MUCR (volatile u32 *)IOP331_REG_ADDR(0x00000350) | ||
151 | #define IOP331_QBAR (volatile u32 *)IOP331_REG_ADDR(0x00000354) | ||
152 | /* Reserved 0x00000358 through 0x0000035C */ | ||
153 | #define IOP331_IFHPR (volatile u32 *)IOP331_REG_ADDR(0x00000360) | ||
154 | #define IOP331_IFTPR (volatile u32 *)IOP331_REG_ADDR(0x00000364) | ||
155 | #define IOP331_IPHPR (volatile u32 *)IOP331_REG_ADDR(0x00000368) | ||
156 | #define IOP331_IPTPR (volatile u32 *)IOP331_REG_ADDR(0x0000036C) | ||
157 | #define IOP331_OFHPR (volatile u32 *)IOP331_REG_ADDR(0x00000370) | ||
158 | #define IOP331_OFTPR (volatile u32 *)IOP331_REG_ADDR(0x00000374) | ||
159 | #define IOP331_OPHPR (volatile u32 *)IOP331_REG_ADDR(0x00000378) | ||
160 | #define IOP331_OPTPR (volatile u32 *)IOP331_REG_ADDR(0x0000037C) | ||
161 | #define IOP331_IAR (volatile u32 *)IOP331_REG_ADDR(0x00000380) | ||
162 | /* Reserved 0x00000384 through 0x000003FF */ | ||
163 | |||
164 | /* DMA Controller 0x00000400 through 0x000004FF */ | ||
165 | #define IOP331_DMA0_CCR (volatile u32 *)IOP331_REG_ADDR(0x00000400) | ||
166 | #define IOP331_DMA0_CSR (volatile u32 *)IOP331_REG_ADDR(0x00000404) | ||
167 | #define IOP331_DMA0_DAR (volatile u32 *)IOP331_REG_ADDR(0x0000040C) | ||
168 | #define IOP331_DMA0_NDAR (volatile u32 *)IOP331_REG_ADDR(0x00000410) | ||
169 | #define IOP331_DMA0_PADR (volatile u32 *)IOP331_REG_ADDR(0x00000414) | ||
170 | #define IOP331_DMA0_PUADR (volatile u32 *)IOP331_REG_ADDR(0x00000418) | ||
171 | #define IOP331_DMA0_LADR (volatile u32 *)IOP331_REG_ADDR(0X0000041C) | ||
172 | #define IOP331_DMA0_BCR (volatile u32 *)IOP331_REG_ADDR(0x00000420) | ||
173 | #define IOP331_DMA0_DCR (volatile u32 *)IOP331_REG_ADDR(0x00000424) | ||
174 | /* Reserved 0x00000428 through 0x0000043C */ | ||
175 | #define IOP331_DMA1_CCR (volatile u32 *)IOP331_REG_ADDR(0x00000440) | ||
176 | #define IOP331_DMA1_CSR (volatile u32 *)IOP331_REG_ADDR(0x00000444) | ||
177 | #define IOP331_DMA1_DAR (volatile u32 *)IOP331_REG_ADDR(0x0000044C) | ||
178 | #define IOP331_DMA1_NDAR (volatile u32 *)IOP331_REG_ADDR(0x00000450) | ||
179 | #define IOP331_DMA1_PADR (volatile u32 *)IOP331_REG_ADDR(0x00000454) | ||
180 | #define IOP331_DMA1_PUADR (volatile u32 *)IOP331_REG_ADDR(0x00000458) | ||
181 | #define IOP331_DMA1_LADR (volatile u32 *)IOP331_REG_ADDR(0x0000045C) | ||
182 | #define IOP331_DMA1_BCR (volatile u32 *)IOP331_REG_ADDR(0x00000460) | ||
183 | #define IOP331_DMA1_DCR (volatile u32 *)IOP331_REG_ADDR(0x00000464) | ||
184 | /* Reserved 0x00000468 through 0x000004FF */ | ||
185 | |||
186 | /* Memory controller 0x00000500 through 0x0005FF */ | ||
187 | |||
188 | /* Peripheral bus interface unit 0x00000680 through 0x0006FF */ | ||
189 | #define IOP331_PBCR (volatile u32 *)IOP331_REG_ADDR(0x00000680) | ||
190 | #define IOP331_PBISR (volatile u32 *)IOP331_REG_ADDR(0x00000684) | ||
191 | #define IOP331_PBBAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000688) | ||
192 | #define IOP331_PBLR0 (volatile u32 *)IOP331_REG_ADDR(0x0000068C) | ||
193 | #define IOP331_PBBAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000690) | ||
194 | #define IOP331_PBLR1 (volatile u32 *)IOP331_REG_ADDR(0x00000694) | ||
195 | #define IOP331_PBBAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000698) | ||
196 | #define IOP331_PBLR2 (volatile u32 *)IOP331_REG_ADDR(0x0000069C) | ||
197 | #define IOP331_PBBAR3 (volatile u32 *)IOP331_REG_ADDR(0x000006A0) | ||
198 | #define IOP331_PBLR3 (volatile u32 *)IOP331_REG_ADDR(0x000006A4) | ||
199 | #define IOP331_PBBAR4 (volatile u32 *)IOP331_REG_ADDR(0x000006A8) | ||
200 | #define IOP331_PBLR4 (volatile u32 *)IOP331_REG_ADDR(0x000006AC) | ||
201 | #define IOP331_PBBAR5 (volatile u32 *)IOP331_REG_ADDR(0x000006B0) | ||
202 | #define IOP331_PBLR5 (volatile u32 *)IOP331_REG_ADDR(0x000006B4) | ||
203 | #define IOP331_PBDSCR (volatile u32 *)IOP331_REG_ADDR(0x000006B8) | ||
204 | /* Reserved 0x000006BC */ | ||
205 | #define IOP331_PMBR0 (volatile u32 *)IOP331_REG_ADDR(0x000006C0) | ||
206 | /* Reserved 0x000006C4 through 0x000006DC */ | ||
207 | #define IOP331_PMBR1 (volatile u32 *)IOP331_REG_ADDR(0x000006E0) | ||
208 | #define IOP331_PMBR2 (volatile u32 *)IOP331_REG_ADDR(0x000006E4) | ||
209 | |||
210 | #define IOP331_PBCR_EN 0x1 | ||
211 | |||
212 | #define IOP331_PBISR_BOOR_ERR 0x1 | ||
213 | |||
214 | |||
215 | |||
216 | /* Peripheral performance monitoring unit 0x00000700 through 0x00077F */ | ||
217 | /* Internal arbitration unit 0x00000780 through 0x0007BF */ | ||
218 | |||
219 | /* Interrupt Controller */ | ||
220 | #define IOP331_INTCTL0 (volatile u32 *)IOP331_REG_ADDR(0x00000790) | ||
221 | #define IOP331_INTCTL1 (volatile u32 *)IOP331_REG_ADDR(0x00000794) | ||
222 | #define IOP331_INTSTR0 (volatile u32 *)IOP331_REG_ADDR(0x00000798) | ||
223 | #define IOP331_INTSTR1 (volatile u32 *)IOP331_REG_ADDR(0x0000079C) | ||
224 | #define IOP331_IINTSRC0 (volatile u32 *)IOP331_REG_ADDR(0x000007A0) | ||
225 | #define IOP331_IINTSRC1 (volatile u32 *)IOP331_REG_ADDR(0x000007A4) | ||
226 | #define IOP331_FINTSRC0 (volatile u32 *)IOP331_REG_ADDR(0x000007A8) | ||
227 | #define IOP331_FINTSRC1 (volatile u32 *)IOP331_REG_ADDR(0x000007AC) | ||
228 | #define IOP331_IPR0 (volatile u32 *)IOP331_REG_ADDR(0x000007B0) | ||
229 | #define IOP331_IPR1 (volatile u32 *)IOP331_REG_ADDR(0x000007B4) | ||
230 | #define IOP331_IPR2 (volatile u32 *)IOP331_REG_ADDR(0x000007B8) | ||
231 | #define IOP331_IPR3 (volatile u32 *)IOP331_REG_ADDR(0x000007BC) | ||
232 | #define IOP331_INTBASE (volatile u32 *)IOP331_REG_ADDR(0x000007C0) | ||
233 | #define IOP331_INTSIZE (volatile u32 *)IOP331_REG_ADDR(0x000007C4) | ||
234 | #define IOP331_IINTVEC (volatile u32 *)IOP331_REG_ADDR(0x000007C8) | ||
235 | #define IOP331_FINTVEC (volatile u32 *)IOP331_REG_ADDR(0x000007CC) | ||
236 | |||
237 | |||
238 | /* Timers */ | ||
239 | |||
240 | #define IOP331_TU_TMR0 (volatile u32 *)IOP331_REG_ADDR(0x000007D0) | ||
241 | #define IOP331_TU_TMR1 (volatile u32 *)IOP331_REG_ADDR(0x000007D4) | ||
242 | |||
243 | #define IOP331_TMR_TC 0x01 | ||
244 | #define IOP331_TMR_EN 0x02 | ||
245 | #define IOP331_TMR_RELOAD 0x04 | ||
246 | #define IOP331_TMR_PRIVILEGED 0x09 | ||
247 | |||
248 | #define IOP331_TMR_RATIO_1_1 0x00 | ||
249 | #define IOP331_TMR_RATIO_4_1 0x10 | ||
250 | #define IOP331_TMR_RATIO_8_1 0x20 | ||
251 | #define IOP331_TMR_RATIO_16_1 0x30 | ||
252 | |||
253 | #define IOP331_TU_TCR0 (volatile u32 *)IOP331_REG_ADDR(0x000007D8) | ||
254 | #define IOP331_TU_TCR1 (volatile u32 *)IOP331_REG_ADDR(0x000007DC) | ||
255 | #define IOP331_TU_TRR0 (volatile u32 *)IOP331_REG_ADDR(0x000007E0) | ||
256 | #define IOP331_TU_TRR1 (volatile u32 *)IOP331_REG_ADDR(0x000007E4) | ||
257 | #define IOP331_TU_TISR (volatile u32 *)IOP331_REG_ADDR(0x000007E8) | ||
258 | #define IOP331_TU_WDTCR (volatile u32 *)IOP331_REG_ADDR(0x000007EC) | ||
259 | |||
260 | #if defined(CONFIG_ARCH_IOP331) | ||
261 | #define IOP331_TICK_RATE 266000000 /* 266 MHz IB clock */ | ||
262 | #endif | ||
263 | |||
264 | #if defined(CONFIG_IOP331_STEPD) || defined(CONFIG_ARCH_IQ80333) | ||
265 | #undef IOP331_TICK_RATE | ||
266 | #define IOP331_TICK_RATE 333000000 /* 333 Mhz IB clock */ | ||
267 | #endif | ||
268 | |||
269 | /* Application accelerator unit 0x00000800 - 0x000008FF */ | ||
270 | #define IOP331_AAU_ACR (volatile u32 *)IOP331_REG_ADDR(0x00000800) | ||
271 | #define IOP331_AAU_ASR (volatile u32 *)IOP331_REG_ADDR(0x00000804) | ||
272 | #define IOP331_AAU_ADAR (volatile u32 *)IOP331_REG_ADDR(0x00000808) | ||
273 | #define IOP331_AAU_ANDAR (volatile u32 *)IOP331_REG_ADDR(0x0000080C) | ||
274 | #define IOP331_AAU_SAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000810) | ||
275 | #define IOP331_AAU_SAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000814) | ||
276 | #define IOP331_AAU_SAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000818) | ||
277 | #define IOP331_AAU_SAR4 (volatile u32 *)IOP331_REG_ADDR(0x0000081C) | ||
278 | #define IOP331_AAU_SAR5 (volatile u32 *)IOP331_REG_ADDR(0x0000082C) | ||
279 | #define IOP331_AAU_SAR6 (volatile u32 *)IOP331_REG_ADDR(0x00000830) | ||
280 | #define IOP331_AAU_SAR7 (volatile u32 *)IOP331_REG_ADDR(0x00000834) | ||
281 | #define IOP331_AAU_SAR8 (volatile u32 *)IOP331_REG_ADDR(0x00000838) | ||
282 | #define IOP331_AAU_SAR9 (volatile u32 *)IOP331_REG_ADDR(0x00000840) | ||
283 | #define IOP331_AAU_SAR10 (volatile u32 *)IOP331_REG_ADDR(0x00000844) | ||
284 | #define IOP331_AAU_SAR11 (volatile u32 *)IOP331_REG_ADDR(0x00000848) | ||
285 | #define IOP331_AAU_SAR12 (volatile u32 *)IOP331_REG_ADDR(0x0000084C) | ||
286 | #define IOP331_AAU_SAR13 (volatile u32 *)IOP331_REG_ADDR(0x00000850) | ||
287 | #define IOP331_AAU_SAR14 (volatile u32 *)IOP331_REG_ADDR(0x00000854) | ||
288 | #define IOP331_AAU_SAR15 (volatile u32 *)IOP331_REG_ADDR(0x00000858) | ||
289 | #define IOP331_AAU_SAR16 (volatile u32 *)IOP331_REG_ADDR(0x0000085C) | ||
290 | #define IOP331_AAU_SAR17 (volatile u32 *)IOP331_REG_ADDR(0x00000864) | ||
291 | #define IOP331_AAU_SAR18 (volatile u32 *)IOP331_REG_ADDR(0x00000868) | ||
292 | #define IOP331_AAU_SAR19 (volatile u32 *)IOP331_REG_ADDR(0x0000086C) | ||
293 | #define IOP331_AAU_SAR20 (volatile u32 *)IOP331_REG_ADDR(0x00000870) | ||
294 | #define IOP331_AAU_SAR21 (volatile u32 *)IOP331_REG_ADDR(0x00000874) | ||
295 | #define IOP331_AAU_SAR22 (volatile u32 *)IOP331_REG_ADDR(0x00000878) | ||
296 | #define IOP331_AAU_SAR23 (volatile u32 *)IOP331_REG_ADDR(0x0000087C) | ||
297 | #define IOP331_AAU_SAR24 (volatile u32 *)IOP331_REG_ADDR(0x00000880) | ||
298 | #define IOP331_AAU_SAR25 (volatile u32 *)IOP331_REG_ADDR(0x00000888) | ||
299 | #define IOP331_AAU_SAR26 (volatile u32 *)IOP331_REG_ADDR(0x0000088C) | ||
300 | #define IOP331_AAU_SAR27 (volatile u32 *)IOP331_REG_ADDR(0x00000890) | ||
301 | #define IOP331_AAU_SAR28 (volatile u32 *)IOP331_REG_ADDR(0x00000894) | ||
302 | #define IOP331_AAU_SAR29 (volatile u32 *)IOP331_REG_ADDR(0x00000898) | ||
303 | #define IOP331_AAU_SAR30 (volatile u32 *)IOP331_REG_ADDR(0x0000089C) | ||
304 | #define IOP331_AAU_SAR31 (volatile u32 *)IOP331_REG_ADDR(0x000008A0) | ||
305 | #define IOP331_AAU_SAR32 (volatile u32 *)IOP331_REG_ADDR(0x000008A4) | ||
306 | #define IOP331_AAU_DAR (volatile u32 *)IOP331_REG_ADDR(0x00000820) | ||
307 | #define IOP331_AAU_ABCR (volatile u32 *)IOP331_REG_ADDR(0x00000824) | ||
308 | #define IOP331_AAU_ADCR (volatile u32 *)IOP331_REG_ADDR(0x00000828) | ||
309 | #define IOP331_AAU_EDCR0 (volatile u32 *)IOP331_REG_ADDR(0x0000083c) | ||
310 | #define IOP331_AAU_EDCR1 (volatile u32 *)IOP331_REG_ADDR(0x00000860) | ||
311 | #define IOP331_AAU_EDCR2 (volatile u32 *)IOP331_REG_ADDR(0x00000884) | ||
312 | |||
313 | |||
314 | #define IOP331_SPDSCR (volatile u32 *)IOP331_REG_ADDR(0x000015C0) | ||
315 | #define IOP331_PPDSCR (volatile u32 *)IOP331_REG_ADDR(0x000015C8) | ||
316 | /* SSP serial port unit 0x00001600 - 0x0000167F */ | ||
317 | |||
318 | /* I2C bus interface unit 0x00001680 - 0x000016FF */ | ||
319 | /* for I2C bit defs see drivers/i2c/i2c-iop3xx.h */ | ||
320 | |||
321 | #define IOP331_ICR0 (volatile u32 *)IOP331_REG_ADDR(0x00001680) | ||
322 | #define IOP331_ISR0 (volatile u32 *)IOP331_REG_ADDR(0x00001684) | ||
323 | #define IOP331_ISAR0 (volatile u32 *)IOP331_REG_ADDR(0x00001688) | ||
324 | #define IOP331_IDBR0 (volatile u32 *)IOP331_REG_ADDR(0x0000168C) | ||
325 | /* Reserved 0x00001690 */ | ||
326 | #define IOP331_IBMR0 (volatile u32 *)IOP331_REG_ADDR(0x00001694) | ||
327 | /* Reserved 0x00001698 */ | ||
328 | /* Reserved 0x0000169C */ | ||
329 | #define IOP331_ICR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A0) | ||
330 | #define IOP331_ISR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A4) | ||
331 | #define IOP331_ISAR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A8) | ||
332 | #define IOP331_IDBR1 (volatile u32 *)IOP331_REG_ADDR(0x000016AC) | ||
333 | #define IOP331_IBMR1 (volatile u32 *)IOP331_REG_ADDR(0x000016B4) | ||
334 | /* Reserved 0x000016B8 through 0x000016FF */ | ||
335 | |||
336 | /* 0x00001700 through 0x0000172C UART 0 */ | ||
337 | |||
338 | /* Reserved 0x00001730 through 0x0000173F */ | ||
339 | |||
340 | /* 0x00001740 through 0x0000176C UART 1 */ | ||
341 | |||
342 | #define IOP331_UART0_PHYS (IOP331_PHYS_MEM_BASE | 0x00001700) /* UART #1 physical */ | ||
343 | #define IOP331_UART1_PHYS (IOP331_PHYS_MEM_BASE | 0x00001740) /* UART #2 physical */ | ||
344 | #define IOP331_UART0_VIRT (IOP331_VIRT_MEM_BASE | 0x00001700) /* UART #1 virtual addr */ | ||
345 | #define IOP331_UART1_VIRT (IOP331_VIRT_MEM_BASE | 0x00001740) /* UART #2 virtual addr */ | ||
346 | |||
347 | /* Reserved 0x00001770 through 0x0000177F */ | ||
348 | |||
349 | /* General Purpose I/O Registers */ | ||
350 | #define IOP331_GPOE (volatile u32 *)IOP331_REG_ADDR(0x00001780) | ||
351 | #define IOP331_GPID (volatile u32 *)IOP331_REG_ADDR(0x00001784) | ||
352 | #define IOP331_GPOD (volatile u32 *)IOP331_REG_ADDR(0x00001788) | ||
353 | |||
354 | /* Reserved 0x0000178c through 0x000019ff */ | ||
355 | |||
356 | |||
357 | #ifndef __ASSEMBLY__ | ||
358 | extern void iop331_map_io(void); | ||
359 | extern void iop331_init_irq(void); | ||
360 | extern void iop331_time_init(void); | ||
361 | #endif | ||
362 | |||
363 | #endif // _IOP331_HW_H_ | ||
diff --git a/include/asm-arm/arch-iop3xx/irqs.h b/include/asm-arm/arch-iop3xx/irqs.h deleted file mode 100644 index b2c03f4c269c..000000000000 --- a/include/asm-arm/arch-iop3xx/irqs.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/irqs.h | ||
3 | * | ||
4 | * Copyright: (C) 2001-2003 MontaVista Software 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 | */ | ||
11 | |||
12 | /* | ||
13 | * Chipset-specific bits | ||
14 | */ | ||
15 | #ifdef CONFIG_ARCH_IOP321 | ||
16 | #include "iop321-irqs.h" | ||
17 | #endif | ||
18 | |||
19 | #ifdef CONFIG_ARCH_IOP331 | ||
20 | #include "iop331-irqs.h" | ||
21 | #endif | ||
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h deleted file mode 100644 index e43ebd984745..000000000000 --- a/include/asm-arm/arch-iop3xx/memory.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/memory.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __ASM_ARCH_MEMORY_H | ||
6 | #define __ASM_ARCH_MEMORY_H | ||
7 | |||
8 | #include <asm/hardware.h> | ||
9 | |||
10 | /* | ||
11 | * Physical DRAM offset. | ||
12 | */ | ||
13 | #ifndef CONFIG_ARCH_IOP331 | ||
14 | #define PHYS_OFFSET UL(0xa0000000) | ||
15 | #else | ||
16 | #define PHYS_OFFSET UL(0x00000000) | ||
17 | #endif | ||
18 | |||
19 | /* | ||
20 | * Virtual view <-> PCI DMA view memory address translations | ||
21 | * virt_to_bus: Used to translate the virtual address to an | ||
22 | * address suitable to be passed to set_dma_addr | ||
23 | * bus_to_virt: Used to convert an address for DMA operations | ||
24 | * to an address that the kernel can use. | ||
25 | */ | ||
26 | #if defined(CONFIG_ARCH_IOP321) | ||
27 | |||
28 | #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP321_IATVR2)) | ((*IOP321_IABAR2) & 0xfffffff0)) | ||
29 | #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP321_IALR2)) | ( *IOP321_IATVR2))) | ||
30 | |||
31 | #elif defined(CONFIG_ARCH_IOP331) | ||
32 | |||
33 | #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP331_IATVR2)) | ((*IOP331_IABAR2) & 0xfffffff0)) | ||
34 | #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP331_IALR2)) | ( *IOP331_IATVR2))) | ||
35 | |||
36 | #endif | ||
37 | |||
38 | #endif | ||
diff --git a/include/asm-arm/arch-iop3xx/system.h b/include/asm-arm/arch-iop3xx/system.h deleted file mode 100644 index af6ae8cd36c9..000000000000 --- a/include/asm-arm/arch-iop3xx/system.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/system.h | ||
3 | * | ||
4 | * Copyright (C) 2001 MontaVista Software, 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 | |||
11 | static inline void arch_idle(void) | ||
12 | { | ||
13 | cpu_do_idle(); | ||
14 | } | ||
15 | |||
16 | |||
17 | static inline void arch_reset(char mode) | ||
18 | { | ||
19 | #ifdef CONFIG_ARCH_IOP321 | ||
20 | *IOP321_PCSR = 0x30; | ||
21 | #endif | ||
22 | |||
23 | #ifdef CONFIG_ARCH_IOP331 | ||
24 | *IOP331_PCSR = 0x30; | ||
25 | #endif | ||
26 | |||
27 | if ( 1 && mode == 's') { | ||
28 | /* Jump into ROM at address 0 */ | ||
29 | cpu_reset(0); | ||
30 | } else { | ||
31 | /* No on-chip reset capability */ | ||
32 | cpu_reset(0); | ||
33 | } | ||
34 | } | ||
35 | |||
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h deleted file mode 100644 index 14ca8d0f7b29..000000000000 --- a/include/asm-arm/arch-iop3xx/timex.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/timex.h | ||
3 | * | ||
4 | * IOP3xx architecture timex specifications | ||
5 | */ | ||
6 | #include <asm/hardware.h> | ||
7 | |||
8 | #if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) | ||
9 | |||
10 | #define CLOCK_TICK_RATE IOP321_TICK_RATE | ||
11 | |||
12 | #elif defined(CONFIG_ARCH_IQ80331) || defined(CONFIG_MACH_IQ80332) | ||
13 | |||
14 | #define CLOCK_TICK_RATE IOP331_TICK_RATE | ||
15 | |||
16 | #else | ||
17 | |||
18 | #error "No IOP3xx timex information for this architecture" | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-arm/arch-iop3xx/uncompress.h b/include/asm-arm/arch-iop3xx/uncompress.h deleted file mode 100644 index fbdd5af644fe..000000000000 --- a/include/asm-arm/arch-iop3xx/uncompress.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/uncompress.h | ||
3 | */ | ||
4 | #include <asm/types.h> | ||
5 | #include <asm/mach-types.h> | ||
6 | #include <linux/serial_reg.h> | ||
7 | #include <asm/hardware.h> | ||
8 | |||
9 | #ifdef CONFIG_ARCH_IOP321 | ||
10 | #define UTYPE unsigned char * | ||
11 | #elif defined(CONFIG_ARCH_IOP331) | ||
12 | #define UTYPE u32 * | ||
13 | #else | ||
14 | #error "Missing IOP3xx arch type def" | ||
15 | #endif | ||
16 | |||
17 | static volatile UTYPE uart_base; | ||
18 | |||
19 | #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE) | ||
20 | |||
21 | static inline void putc(char c) | ||
22 | { | ||
23 | while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE) | ||
24 | barrier(); | ||
25 | *uart_base = c; | ||
26 | } | ||
27 | |||
28 | static inline void flush(void) | ||
29 | { | ||
30 | } | ||
31 | |||
32 | static __inline__ void __arch_decomp_setup(unsigned long arch_id) | ||
33 | { | ||
34 | if(machine_is_iq80321()) | ||
35 | uart_base = (volatile UTYPE)IQ80321_UART; | ||
36 | else if(machine_is_iq31244()) | ||
37 | uart_base = (volatile UTYPE)IQ31244_UART; | ||
38 | else if(machine_is_iq80331() || machine_is_iq80332()) | ||
39 | uart_base = (volatile UTYPE)IOP331_UART0_PHYS; | ||
40 | else | ||
41 | uart_base = (volatile UTYPE)0xfe800000; | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * nothing to do | ||
46 | */ | ||
47 | #define arch_decomp_setup() __arch_decomp_setup(arch_id) | ||
48 | #define arch_decomp_wdog() | ||
diff --git a/include/asm-arm/arch-iop3xx/vmalloc.h b/include/asm-arm/arch-iop3xx/vmalloc.h deleted file mode 100644 index 0f2f6847f93c..000000000000 --- a/include/asm-arm/arch-iop3xx/vmalloc.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-iop3xx/vmalloc.h | ||
3 | */ | ||
4 | |||
5 | /* | ||
6 | * Just any arbitrary offset to the start of the vmalloc VM area: the | ||
7 | * current 8MB value just means that there will be a 8MB "hole" after the | ||
8 | * physical memory until the kernel virtual memory starts. That means that | ||
9 | * any out-of-bounds memory accesses will hopefully be caught. | ||
10 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced | ||
11 | * area for the same reason. ;) | ||
12 | */ | ||
13 | //#define VMALLOC_END (0xe8000000) | ||
14 | /* increase usable physical RAM to ~992M per RMK */ | ||
15 | #define VMALLOC_END (0xfe000000) | ||
16 | |||
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h index 13aee17b0475..8d10a9187693 100644 --- a/include/asm-arm/arch-ixp4xx/platform.h +++ b/include/asm-arm/arch-ixp4xx/platform.h | |||
@@ -90,6 +90,11 @@ struct ixp4xx_i2c_pins { | |||
90 | struct sys_timer; | 90 | struct sys_timer; |
91 | 91 | ||
92 | /* | 92 | /* |
93 | * Frequency of clock used for primary clocksource | ||
94 | */ | ||
95 | extern unsigned long ixp4xx_timer_freq; | ||
96 | |||
97 | /* | ||
93 | * Functions used by platform-level setup code | 98 | * Functions used by platform-level setup code |
94 | */ | 99 | */ |
95 | extern void ixp4xx_map_io(void); | 100 | extern void ixp4xx_map_io(void); |
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h index cd080d8384d9..d744d97c18a5 100644 --- a/include/asm-arm/arch-l7200/io.h +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -31,9 +31,9 @@ | |||
31 | static inline unsigned int __arch_getw(unsigned long a) | 31 | static inline unsigned int __arch_getw(unsigned long a) |
32 | { | 32 | { |
33 | unsigned int value; | 33 | unsigned int value; |
34 | __asm__ __volatile__("ldr%?h %0, [%1, #0] @ getw" | 34 | __asm__ __volatile__("ldrh %0, [%1, #0] @ getw" |
35 | : "=&r" (value) | 35 | : "=&r" (value) |
36 | : "r" (a)); | 36 | : "r" (a) : "cc"); |
37 | return value; | 37 | return value; |
38 | } | 38 | } |
39 | 39 | ||
@@ -42,8 +42,8 @@ static inline unsigned int __arch_getw(unsigned long a) | |||
42 | 42 | ||
43 | static inline void __arch_putw(unsigned int value, unsigned long a) | 43 | static inline void __arch_putw(unsigned int value, unsigned long a) |
44 | { | 44 | { |
45 | __asm__ __volatile__("str%?h %0, [%1, #0] @ putw" | 45 | __asm__ __volatile__("strh %0, [%1, #0] @ putw" |
46 | : : "r" (value), "r" (a)); | 46 | : : "r" (value), "r" (a) : "cc"); |
47 | } | 47 | } |
48 | 48 | ||
49 | /* | 49 | /* |
diff --git a/include/asm-arm/arch-omap/board-ams-delta.h b/include/asm-arm/arch-omap/board-ams-delta.h index 0070f6d3b75c..9aee15d97145 100644 --- a/include/asm-arm/arch-omap/board-ams-delta.h +++ b/include/asm-arm/arch-omap/board-ams-delta.h | |||
@@ -50,9 +50,20 @@ | |||
50 | #define AMS_DELTA_LATCH2_NAND_NWE 0x0020 | 50 | #define AMS_DELTA_LATCH2_NAND_NWE 0x0020 |
51 | #define AMS_DELTA_LATCH2_NAND_ALE 0x0040 | 51 | #define AMS_DELTA_LATCH2_NAND_ALE 0x0040 |
52 | #define AMS_DELTA_LATCH2_NAND_CLE 0x0080 | 52 | #define AMS_DELTA_LATCH2_NAND_CLE 0x0080 |
53 | #define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100 | ||
54 | #define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200 | ||
55 | #define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400 | ||
56 | #define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800 | ||
53 | #define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 | 57 | #define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 |
54 | #define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 | 58 | #define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 |
55 | 59 | ||
60 | #define AMS_DELTA_GPIO_PIN_KEYBRD_DATA 0 | ||
61 | #define AMS_DELTA_GPIO_PIN_KEYBRD_CLK 1 | ||
62 | #define AMS_DELTA_GPIO_PIN_MODEM_IRQ 2 | ||
63 | #define AMS_DELTA_GPIO_PIN_HOOK_SWITCH 4 | ||
64 | #define AMS_DELTA_GPIO_PIN_SCARD_NOFF 6 | ||
65 | #define AMS_DELTA_GPIO_PIN_SCARD_IO 7 | ||
66 | #define AMS_DELTA_GPIO_PIN_CONFIG 11 | ||
56 | #define AMS_DELTA_GPIO_PIN_NAND_RB 12 | 67 | #define AMS_DELTA_GPIO_PIN_NAND_RB 12 |
57 | 68 | ||
58 | #ifndef __ASSEMBLY__ | 69 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h index f83003f5287b..fa6881049903 100644 --- a/include/asm-arm/arch-omap/clock.h +++ b/include/asm-arm/arch-omap/clock.h | |||
@@ -45,6 +45,7 @@ struct clk_functions { | |||
45 | struct clk * (*clk_get_parent)(struct clk *clk); | 45 | struct clk * (*clk_get_parent)(struct clk *clk); |
46 | void (*clk_allow_idle)(struct clk *clk); | 46 | void (*clk_allow_idle)(struct clk *clk); |
47 | void (*clk_deny_idle)(struct clk *clk); | 47 | void (*clk_deny_idle)(struct clk *clk); |
48 | void (*clk_disable_unused)(struct clk *clk); | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | extern unsigned int mpurate; | 51 | extern unsigned int mpurate; |
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index 1b1b02307e77..d591d0585bba 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h | |||
@@ -331,6 +331,12 @@ enum omap_dma_color_mode { | |||
331 | OMAP_DMA_TRANSPARENT_COPY | 331 | OMAP_DMA_TRANSPARENT_COPY |
332 | }; | 332 | }; |
333 | 333 | ||
334 | enum omap_dma_write_mode { | ||
335 | OMAP_DMA_WRITE_NON_POSTED = 0, | ||
336 | OMAP_DMA_WRITE_POSTED, | ||
337 | OMAP_DMA_WRITE_LAST_NON_POSTED | ||
338 | }; | ||
339 | |||
334 | struct omap_dma_channel_params { | 340 | struct omap_dma_channel_params { |
335 | int data_type; /* data type 8,16,32 */ | 341 | int data_type; /* data type 8,16,32 */ |
336 | int elem_count; /* number of elements in a frame */ | 342 | int elem_count; /* number of elements in a frame */ |
@@ -338,13 +344,13 @@ struct omap_dma_channel_params { | |||
338 | 344 | ||
339 | int src_port; /* Only on OMAP1 REVISIT: Is this needed? */ | 345 | int src_port; /* Only on OMAP1 REVISIT: Is this needed? */ |
340 | int src_amode; /* constant , post increment, indexed , double indexed */ | 346 | int src_amode; /* constant , post increment, indexed , double indexed */ |
341 | int src_start; /* source address : physical */ | 347 | unsigned long src_start; /* source address : physical */ |
342 | int src_ei; /* source element index */ | 348 | int src_ei; /* source element index */ |
343 | int src_fi; /* source frame index */ | 349 | int src_fi; /* source frame index */ |
344 | 350 | ||
345 | int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */ | 351 | int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */ |
346 | int dst_amode; /* constant , post increment, indexed , double indexed */ | 352 | int dst_amode; /* constant , post increment, indexed , double indexed */ |
347 | int dst_start; /* source address : physical */ | 353 | unsigned long dst_start; /* source address : physical */ |
348 | int dst_ei; /* source element index */ | 354 | int dst_ei; /* source element index */ |
349 | int dst_fi; /* source frame index */ | 355 | int dst_fi; /* source frame index */ |
350 | 356 | ||
@@ -356,7 +362,7 @@ struct omap_dma_channel_params { | |||
356 | }; | 362 | }; |
357 | 363 | ||
358 | 364 | ||
359 | extern void omap_set_dma_priority(int dst_port, int priority); | 365 | extern void omap_set_dma_priority(int lch, int dst_port, int priority); |
360 | extern int omap_request_dma(int dev_id, const char *dev_name, | 366 | extern int omap_request_dma(int dev_id, const char *dev_name, |
361 | void (* callback)(int lch, u16 ch_status, void *data), | 367 | void (* callback)(int lch, u16 ch_status, void *data), |
362 | void *data, int *dma_ch); | 368 | void *data, int *dma_ch); |
@@ -371,6 +377,7 @@ extern void omap_set_dma_transfer_params(int lch, int data_type, | |||
371 | int dma_trigger, int src_or_dst_synch); | 377 | int dma_trigger, int src_or_dst_synch); |
372 | extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, | 378 | extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, |
373 | u32 color); | 379 | u32 color); |
380 | extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode); | ||
374 | 381 | ||
375 | extern void omap_set_dma_src_params(int lch, int src_port, int src_amode, | 382 | extern void omap_set_dma_src_params(int lch, int src_port, int src_amode, |
376 | unsigned long src_start, | 383 | unsigned long src_start, |
@@ -394,6 +401,9 @@ extern void omap_set_dma_params(int lch, | |||
394 | extern void omap_dma_link_lch (int lch_head, int lch_queue); | 401 | extern void omap_dma_link_lch (int lch_head, int lch_queue); |
395 | extern void omap_dma_unlink_lch (int lch_head, int lch_queue); | 402 | extern void omap_dma_unlink_lch (int lch_head, int lch_queue); |
396 | 403 | ||
404 | extern int omap_set_dma_callback(int lch, | ||
405 | void (* callback)(int lch, u16 ch_status, void *data), | ||
406 | void *data); | ||
397 | extern dma_addr_t omap_get_dma_src_pos(int lch); | 407 | extern dma_addr_t omap_get_dma_src_pos(int lch); |
398 | extern dma_addr_t omap_get_dma_dst_pos(int lch); | 408 | extern dma_addr_t omap_get_dma_dst_pos(int lch); |
399 | extern int omap_get_dma_src_addr_counter(int lch); | 409 | extern int omap_get_dma_src_addr_counter(int lch); |
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h index 7a289ff07404..b5f3a71b899d 100644 --- a/include/asm-arm/arch-omap/dmtimer.h +++ b/include/asm-arm/arch-omap/dmtimer.h | |||
@@ -52,6 +52,8 @@ int omap_dm_timer_init(void); | |||
52 | struct omap_dm_timer *omap_dm_timer_request(void); | 52 | struct omap_dm_timer *omap_dm_timer_request(void); |
53 | struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); | 53 | struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); |
54 | void omap_dm_timer_free(struct omap_dm_timer *timer); | 54 | void omap_dm_timer_free(struct omap_dm_timer *timer); |
55 | void omap_dm_timer_enable(struct omap_dm_timer *timer); | ||
56 | void omap_dm_timer_disable(struct omap_dm_timer *timer); | ||
55 | 57 | ||
56 | int omap_dm_timer_get_irq(struct omap_dm_timer *timer); | 58 | int omap_dm_timer_get_irq(struct omap_dm_timer *timer); |
57 | 59 | ||
diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h index 1a0a5207822d..7c03ef6c14c4 100644 --- a/include/asm-arm/arch-omap/gpmc.h +++ b/include/asm-arm/arch-omap/gpmc.h | |||
@@ -85,7 +85,7 @@ extern void gpmc_cs_write_reg(int cs, int idx, u32 val); | |||
85 | extern u32 gpmc_cs_read_reg(int cs, int idx); | 85 | extern u32 gpmc_cs_read_reg(int cs, int idx); |
86 | extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); | 86 | extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); |
87 | extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); | 87 | extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); |
88 | extern unsigned long gpmc_cs_get_base_addr(int cs); | 88 | extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); |
89 | 89 | extern void gpmc_cs_free(int cs); | |
90 | 90 | ||
91 | #endif | 91 | #endif |
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h index 2542495d8a43..c5bb05a69b81 100644 --- a/include/asm-arm/arch-omap/irqs.h +++ b/include/asm-arm/arch-omap/irqs.h | |||
@@ -237,6 +237,7 @@ | |||
237 | #define INT_24XX_SDMA_IRQ1 13 | 237 | #define INT_24XX_SDMA_IRQ1 13 |
238 | #define INT_24XX_SDMA_IRQ2 14 | 238 | #define INT_24XX_SDMA_IRQ2 14 |
239 | #define INT_24XX_SDMA_IRQ3 15 | 239 | #define INT_24XX_SDMA_IRQ3 15 |
240 | #define INT_24XX_CAM_IRQ 24 | ||
240 | #define INT_24XX_DSS_IRQ 25 | 241 | #define INT_24XX_DSS_IRQ 25 |
241 | #define INT_24XX_GPIO_BANK1 29 | 242 | #define INT_24XX_GPIO_BANK1 29 |
242 | #define INT_24XX_GPIO_BANK2 30 | 243 | #define INT_24XX_GPIO_BANK2 30 |
@@ -261,6 +262,7 @@ | |||
261 | #define INT_24XX_UART1_IRQ 72 | 262 | #define INT_24XX_UART1_IRQ 72 |
262 | #define INT_24XX_UART2_IRQ 73 | 263 | #define INT_24XX_UART2_IRQ 73 |
263 | #define INT_24XX_UART3_IRQ 74 | 264 | #define INT_24XX_UART3_IRQ 74 |
265 | #define INT_24XX_MMC_IRQ 83 | ||
264 | 266 | ||
265 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and | 267 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and |
266 | * 16 MPUIO lines */ | 268 | * 16 MPUIO lines */ |
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index 679869c5e68f..828cc5c114e1 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h | |||
@@ -320,6 +320,17 @@ enum omap1xxx_index { | |||
320 | P15_1610_UWIRE_CS3, | 320 | P15_1610_UWIRE_CS3, |
321 | N15_1610_UWIRE_CS1, | 321 | N15_1610_UWIRE_CS1, |
322 | 322 | ||
323 | /* OMAP-1610 SPI */ | ||
324 | U19_1610_SPIF_SCK, | ||
325 | U18_1610_SPIF_DIN, | ||
326 | P20_1610_SPIF_DIN, | ||
327 | W21_1610_SPIF_DOUT, | ||
328 | R18_1610_SPIF_DOUT, | ||
329 | N14_1610_SPIF_CS0, | ||
330 | N15_1610_SPIF_CS1, | ||
331 | T19_1610_SPIF_CS2, | ||
332 | P15_1610_SPIF_CS3, | ||
333 | |||
323 | /* OMAP-1610 Flash */ | 334 | /* OMAP-1610 Flash */ |
324 | L3_1610_FLASH_CS2B_OE, | 335 | L3_1610_FLASH_CS2B_OE, |
325 | M8_1610_FLASH_CS2B_WE, | 336 | M8_1610_FLASH_CS2B_WE, |
@@ -461,6 +472,20 @@ enum omap24xx_index { | |||
461 | K15_24XX_UART3_TX, | 472 | K15_24XX_UART3_TX, |
462 | K14_24XX_UART3_RX, | 473 | K14_24XX_UART3_RX, |
463 | 474 | ||
475 | /* MMC/SDIO */ | ||
476 | G19_24XX_MMC_CLKO, | ||
477 | H18_24XX_MMC_CMD, | ||
478 | F20_24XX_MMC_DAT0, | ||
479 | H14_24XX_MMC_DAT1, | ||
480 | E19_24XX_MMC_DAT2, | ||
481 | D19_24XX_MMC_DAT3, | ||
482 | F19_24XX_MMC_DAT_DIR0, | ||
483 | E20_24XX_MMC_DAT_DIR1, | ||
484 | F18_24XX_MMC_DAT_DIR2, | ||
485 | E18_24XX_MMC_DAT_DIR3, | ||
486 | G18_24XX_MMC_CMD_DIR, | ||
487 | H15_24XX_MMC_CLKI, | ||
488 | |||
464 | /* Keypad GPIO*/ | 489 | /* Keypad GPIO*/ |
465 | T19_24XX_KBR0, | 490 | T19_24XX_KBR0, |
466 | R19_24XX_KBR1, | 491 | R19_24XX_KBR1, |
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h index 3661e465b0a5..7ac224836971 100644 --- a/include/asm-arm/arch-s3c2410/dma.h +++ b/include/asm-arm/arch-s3c2410/dma.h | |||
@@ -23,6 +23,39 @@ | |||
23 | #define MAX_DMA_ADDRESS 0x40000000 | 23 | #define MAX_DMA_ADDRESS 0x40000000 |
24 | #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ | 24 | #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ |
25 | 25 | ||
26 | /* We use `virtual` dma channels to hide the fact we have only a limited | ||
27 | * number of DMA channels, and not of all of them (dependant on the device) | ||
28 | * can be attached to any DMA source. We therefore let the DMA core handle | ||
29 | * the allocation of hardware channels to clients. | ||
30 | */ | ||
31 | |||
32 | enum dma_ch { | ||
33 | DMACH_XD0, | ||
34 | DMACH_XD1, | ||
35 | DMACH_SDI, | ||
36 | DMACH_SPI0, | ||
37 | DMACH_SPI1, | ||
38 | DMACH_UART0, | ||
39 | DMACH_UART1, | ||
40 | DMACH_UART2, | ||
41 | DMACH_TIMER, | ||
42 | DMACH_I2S_IN, | ||
43 | DMACH_I2S_OUT, | ||
44 | DMACH_PCM_IN, | ||
45 | DMACH_PCM_OUT, | ||
46 | DMACH_MIC_IN, | ||
47 | DMACH_USB_EP1, | ||
48 | DMACH_USB_EP2, | ||
49 | DMACH_USB_EP3, | ||
50 | DMACH_USB_EP4, | ||
51 | DMACH_UART0_SRC2, /* s3c2412 second uart sources */ | ||
52 | DMACH_UART1_SRC2, | ||
53 | DMACH_UART2_SRC2, | ||
54 | DMACH_MAX, /* the end entry */ | ||
55 | }; | ||
56 | |||
57 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ | ||
58 | |||
26 | /* we have 4 dma channels */ | 59 | /* we have 4 dma channels */ |
27 | #define S3C2410_DMA_CHANNELS (4) | 60 | #define S3C2410_DMA_CHANNELS (4) |
28 | 61 | ||
@@ -149,6 +182,8 @@ struct s3c2410_dma_stats { | |||
149 | unsigned long timeout_failed; | 182 | unsigned long timeout_failed; |
150 | }; | 183 | }; |
151 | 184 | ||
185 | struct s3c2410_dma_map; | ||
186 | |||
152 | /* struct s3c2410_dma_chan | 187 | /* struct s3c2410_dma_chan |
153 | * | 188 | * |
154 | * full state information for each DMA channel | 189 | * full state information for each DMA channel |
@@ -174,6 +209,8 @@ struct s3c2410_dma_chan { | |||
174 | unsigned long load_timeout; | 209 | unsigned long load_timeout; |
175 | unsigned int flags; /* channel flags */ | 210 | unsigned int flags; /* channel flags */ |
176 | 211 | ||
212 | struct s3c24xx_dma_map *map; /* channel hw maps */ | ||
213 | |||
177 | /* channel's hardware position and configuration */ | 214 | /* channel's hardware position and configuration */ |
178 | void __iomem *regs; /* channels registers */ | 215 | void __iomem *regs; /* channels registers */ |
179 | void __iomem *addr_reg; /* data address register */ | 216 | void __iomem *addr_reg; /* data address register */ |
@@ -283,6 +320,7 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn); | |||
283 | #define S3C2410_DMA_DCSRC (0x18) | 320 | #define S3C2410_DMA_DCSRC (0x18) |
284 | #define S3C2410_DMA_DCDST (0x1C) | 321 | #define S3C2410_DMA_DCDST (0x1C) |
285 | #define S3C2410_DMA_DMASKTRIG (0x20) | 322 | #define S3C2410_DMA_DMASKTRIG (0x20) |
323 | #define S3C2412_DMA_DMAREQSEL (0x24) | ||
286 | 324 | ||
287 | #define S3C2410_DISRCC_INC (1<<0) | 325 | #define S3C2410_DISRCC_INC (1<<0) |
288 | #define S3C2410_DISRCC_APB (1<<1) | 326 | #define S3C2410_DISRCC_APB (1<<1) |
@@ -349,4 +387,32 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn); | |||
349 | #define S3C2440_DCON_CH3_PCMOUT (6<<24) | 387 | #define S3C2440_DCON_CH3_PCMOUT (6<<24) |
350 | #endif | 388 | #endif |
351 | 389 | ||
390 | #ifdef CONFIG_CPU_S3C2412 | ||
391 | |||
392 | #define S3C2412_DMAREQSEL_SRC(x) ((x)<<1) | ||
393 | |||
394 | #define S3C2412_DMAREQSEL_HW (1) | ||
395 | |||
396 | #define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0) | ||
397 | #define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1) | ||
398 | #define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2) | ||
399 | #define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3) | ||
400 | #define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4) | ||
401 | #define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5) | ||
402 | #define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9) | ||
403 | #define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10) | ||
404 | #define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13) | ||
405 | #define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14) | ||
406 | #define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15) | ||
407 | #define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16) | ||
408 | #define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17) | ||
409 | #define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18) | ||
410 | #define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19) | ||
411 | #define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20) | ||
412 | #define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21) | ||
413 | #define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22) | ||
414 | #define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23) | ||
415 | #define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) | ||
416 | |||
417 | #endif | ||
352 | #endif /* __ASM_ARCH_DMA_H */ | 418 | #endif /* __ASM_ARCH_DMA_H */ |
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h index 27ba0ac3fdd5..7895042d176b 100644 --- a/include/asm-arm/arch-s3c2410/map.h +++ b/include/asm-arm/arch-s3c2410/map.h | |||
@@ -160,6 +160,11 @@ | |||
160 | #define S3C2440_PA_CAMIF (0x4F000000) | 160 | #define S3C2440_PA_CAMIF (0x4F000000) |
161 | #define S3C2440_SZ_CAMIF SZ_1M | 161 | #define S3C2440_SZ_CAMIF SZ_1M |
162 | 162 | ||
163 | /* AC97 */ | ||
164 | |||
165 | #define S3C2440_PA_AC97 (0x5B000000) | ||
166 | #define S3C2440_SZ_AC97 SZ_1M | ||
167 | |||
163 | /* ISA style IO, for each machine to sort out mappings for, if it | 168 | /* ISA style IO, for each machine to sort out mappings for, if it |
164 | * implements it. We reserve two 16M regions for ISA. | 169 | * implements it. We reserve two 16M regions for ISA. |
165 | */ | 170 | */ |
diff --git a/include/asm-arm/arch-s3c2410/osiris-map.h b/include/asm-arm/arch-s3c2410/osiris-map.h index e2d406218ae5..a14164dfa525 100644 --- a/include/asm-arm/arch-s3c2410/osiris-map.h +++ b/include/asm-arm/arch-s3c2410/osiris-map.h | |||
@@ -18,22 +18,22 @@ | |||
18 | 18 | ||
19 | /* start peripherals off after the S3C2410 */ | 19 | /* start peripherals off after the S3C2410 */ |
20 | 20 | ||
21 | #define OSIRIS_IOADDR(x) (S3C2410_ADDR((x) + 0x05000000)) | 21 | #define OSIRIS_IOADDR(x) (S3C2410_ADDR((x) + 0x04000000)) |
22 | 22 | ||
23 | #define OSIRIS_PA_CPLD (S3C2410_CS1 | (3<<25)) | 23 | #define OSIRIS_PA_CPLD (S3C2410_CS1 | (1<<26)) |
24 | 24 | ||
25 | /* we put the CPLD registers next, to get them out of the way */ | 25 | /* we put the CPLD registers next, to get them out of the way */ |
26 | 26 | ||
27 | #define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00000000) /* 0x01300000 */ | 27 | #define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00000000) |
28 | #define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD) | 28 | #define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD) |
29 | 29 | ||
30 | #define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00100000) /* 0x01400000 */ | 30 | #define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00100000) |
31 | #define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (1<<24)) | 31 | #define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (1<<23)) |
32 | 32 | ||
33 | #define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00200000) /* 0x01500000 */ | 33 | #define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00200000) |
34 | #define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<24)) | 34 | #define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<23)) |
35 | 35 | ||
36 | #define OSIRIS_VA_CTRL4 OSIRIS_IOADDR(0x00300000) /* 0x01600000 */ | 36 | #define OSIRIS_VA_CTRL4 OSIRIS_IOADDR(0x00300000) |
37 | #define OSIRIS_PA_CTRL4 (OSIRIS_PA_CPLD + (3<<24)) | 37 | #define OSIRIS_PA_CTRL4 (OSIRIS_PA_CPLD + (3<<23)) |
38 | 38 | ||
39 | #endif /* __ASM_ARCH_OSIRISMAP_H */ | 39 | #endif /* __ASM_ARCH_OSIRISMAP_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-ac97.h b/include/asm-arm/arch-s3c2410/regs-ac97.h new file mode 100644 index 000000000000..bdd6a4f93d7f --- /dev/null +++ b/include/asm-arm/arch-s3c2410/regs-ac97.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/regs-ac97.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics <linux@simtec.co.uk> | ||
4 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
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 | * S3C2440 AC97 Controller | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_REGS_AC97_H | ||
14 | #define __ASM_ARCH_REGS_AC97_H __FILE__ | ||
15 | |||
16 | #define S3C_AC97_GLBCTRL (0x00) | ||
17 | #define S3C_AC97_GLBSTAT (0x04) | ||
18 | #define S3C_AC97_CODEC_CMD (0x08) | ||
19 | #define S3C_AC97_PCM_ADDR (0x10) | ||
20 | #define S3C_AC97_PCM_DATA (0x18) | ||
21 | #define S3C_AC97_MIC_DATA (0x1C) | ||
22 | |||
23 | #endif /* __ASM_ARCH_REGS_AC97_H */ | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h index b306d6e3135d..6d7881c8cfc8 100644 --- a/include/asm-arm/arch-s3c2410/regs-lcd.h +++ b/include/asm-arm/arch-s3c2410/regs-lcd.h | |||
@@ -63,6 +63,8 @@ | |||
63 | #define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F) | 63 | #define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F) |
64 | #define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF) | 64 | #define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF) |
65 | 65 | ||
66 | /* LDCCON4 changes for STN mode on the S3C2412 */ | ||
67 | |||
66 | #define S3C2410_LCDCON4_MVAL(x) ((x) << 8) | 68 | #define S3C2410_LCDCON4_MVAL(x) ((x) << 8) |
67 | #define S3C2410_LCDCON4_HSPW(x) ((x) << 0) | 69 | #define S3C2410_LCDCON4_HSPW(x) ((x) << 0) |
68 | #define S3C2410_LCDCON4_WLH(x) ((x) << 0) | 70 | #define S3C2410_LCDCON4_WLH(x) ((x) << 0) |
@@ -113,10 +115,38 @@ | |||
113 | #define S3C2410_LCDINT_FRSYNC (1<<1) | 115 | #define S3C2410_LCDINT_FRSYNC (1<<1) |
114 | #define S3C2410_LCDINT_FICNT (1<<0) | 116 | #define S3C2410_LCDINT_FICNT (1<<0) |
115 | 117 | ||
118 | /* s3c2442 extra stn registers */ | ||
119 | |||
120 | #define S3C2442_REDLUT S3C2410_LCDREG(0x20) | ||
121 | #define S3C2442_GREENLUT S3C2410_LCDREG(0x24) | ||
122 | #define S3C2442_BLUELUT S3C2410_LCDREG(0x28) | ||
123 | #define S3C2442_DITHMODE S3C2410_LCDREG(0x20) | ||
124 | |||
116 | #define S3C2410_LPCSEL S3C2410_LCDREG(0x60) | 125 | #define S3C2410_LPCSEL S3C2410_LCDREG(0x60) |
117 | 126 | ||
118 | #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) | 127 | #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) |
119 | 128 | ||
129 | /* S3C2412 registers */ | ||
130 | |||
131 | #define S3C2412_TPAL S3C2410_LCDREG(0x20) | ||
132 | |||
133 | #define S3C2412_LCDINTPND S3C2410_LCDREG(0x24) | ||
134 | #define S3C2412_LCDSRCPND S3C2410_LCDREG(0x28) | ||
135 | #define S3C2412_LCDINTMSK S3C2410_LCDREG(0x2C) | ||
136 | |||
137 | #define S3C2412_TCONSEL S3C2410_LCDREG(0x30) | ||
138 | |||
139 | #define S3C2412_LCDCON6 S3C2410_LCDREG(0x34) | ||
140 | #define S3C2412_LCDCON7 S3C2410_LCDREG(0x38) | ||
141 | #define S3C2412_LCDCON8 S3C2410_LCDREG(0x3C) | ||
142 | #define S3C2412_LCDCON9 S3C2410_LCDREG(0x40) | ||
143 | |||
144 | #define S3C2412_REDLUT(x) S3C2410_LCDREG(0x44 + ((x)*4)) | ||
145 | #define S3C2412_GREENLUT(x) S3C2410_LCDREG(0x60 + ((x)*4)) | ||
146 | #define S3C2412_BLUELUT(x) S3C2410_LCDREG(0x98 + ((x)*4)) | ||
147 | |||
148 | #define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4)) | ||
149 | |||
120 | #endif /* ___ASM_ARCH_REGS_LCD_H */ | 150 | #endif /* ___ASM_ARCH_REGS_LCD_H */ |
121 | 151 | ||
122 | 152 | ||
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h index 4b0ce3e7de9a..ea88aa6bfc78 100644 --- a/include/asm-arm/atomic.h +++ b/include/asm-arm/atomic.h | |||
@@ -128,10 +128,10 @@ static inline int atomic_add_return(int i, atomic_t *v) | |||
128 | unsigned long flags; | 128 | unsigned long flags; |
129 | int val; | 129 | int val; |
130 | 130 | ||
131 | local_irq_save(flags); | 131 | raw_local_irq_save(flags); |
132 | val = v->counter; | 132 | val = v->counter; |
133 | v->counter = val += i; | 133 | v->counter = val += i; |
134 | local_irq_restore(flags); | 134 | raw_local_irq_restore(flags); |
135 | 135 | ||
136 | return val; | 136 | return val; |
137 | } | 137 | } |
@@ -141,10 +141,10 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
141 | unsigned long flags; | 141 | unsigned long flags; |
142 | int val; | 142 | int val; |
143 | 143 | ||
144 | local_irq_save(flags); | 144 | raw_local_irq_save(flags); |
145 | val = v->counter; | 145 | val = v->counter; |
146 | v->counter = val -= i; | 146 | v->counter = val -= i; |
147 | local_irq_restore(flags); | 147 | raw_local_irq_restore(flags); |
148 | 148 | ||
149 | return val; | 149 | return val; |
150 | } | 150 | } |
@@ -154,11 +154,11 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | |||
154 | int ret; | 154 | int ret; |
155 | unsigned long flags; | 155 | unsigned long flags; |
156 | 156 | ||
157 | local_irq_save(flags); | 157 | raw_local_irq_save(flags); |
158 | ret = v->counter; | 158 | ret = v->counter; |
159 | if (likely(ret == old)) | 159 | if (likely(ret == old)) |
160 | v->counter = new; | 160 | v->counter = new; |
161 | local_irq_restore(flags); | 161 | raw_local_irq_restore(flags); |
162 | 162 | ||
163 | return ret; | 163 | return ret; |
164 | } | 164 | } |
@@ -167,9 +167,9 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | |||
167 | { | 167 | { |
168 | unsigned long flags; | 168 | unsigned long flags; |
169 | 169 | ||
170 | local_irq_save(flags); | 170 | raw_local_irq_save(flags); |
171 | *addr &= ~mask; | 171 | *addr &= ~mask; |
172 | local_irq_restore(flags); | 172 | raw_local_irq_restore(flags); |
173 | } | 173 | } |
174 | 174 | ||
175 | #endif /* __LINUX_ARM_ARCH__ */ | 175 | #endif /* __LINUX_ARM_ARCH__ */ |
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index 0ac54b1a8bad..b41831b6432f 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h | |||
@@ -37,9 +37,9 @@ static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long * | |||
37 | 37 | ||
38 | p += bit >> 5; | 38 | p += bit >> 5; |
39 | 39 | ||
40 | local_irq_save(flags); | 40 | raw_local_irq_save(flags); |
41 | *p |= mask; | 41 | *p |= mask; |
42 | local_irq_restore(flags); | 42 | raw_local_irq_restore(flags); |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p) | 45 | static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p) |
@@ -49,9 +49,9 @@ static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long | |||
49 | 49 | ||
50 | p += bit >> 5; | 50 | p += bit >> 5; |
51 | 51 | ||
52 | local_irq_save(flags); | 52 | raw_local_irq_save(flags); |
53 | *p &= ~mask; | 53 | *p &= ~mask; |
54 | local_irq_restore(flags); | 54 | raw_local_irq_restore(flags); |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p) | 57 | static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p) |
@@ -61,9 +61,9 @@ static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned lon | |||
61 | 61 | ||
62 | p += bit >> 5; | 62 | p += bit >> 5; |
63 | 63 | ||
64 | local_irq_save(flags); | 64 | raw_local_irq_save(flags); |
65 | *p ^= mask; | 65 | *p ^= mask; |
66 | local_irq_restore(flags); | 66 | raw_local_irq_restore(flags); |
67 | } | 67 | } |
68 | 68 | ||
69 | static inline int | 69 | static inline int |
@@ -75,10 +75,10 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p) | |||
75 | 75 | ||
76 | p += bit >> 5; | 76 | p += bit >> 5; |
77 | 77 | ||
78 | local_irq_save(flags); | 78 | raw_local_irq_save(flags); |
79 | res = *p; | 79 | res = *p; |
80 | *p = res | mask; | 80 | *p = res | mask; |
81 | local_irq_restore(flags); | 81 | raw_local_irq_restore(flags); |
82 | 82 | ||
83 | return res & mask; | 83 | return res & mask; |
84 | } | 84 | } |
@@ -92,10 +92,10 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p) | |||
92 | 92 | ||
93 | p += bit >> 5; | 93 | p += bit >> 5; |
94 | 94 | ||
95 | local_irq_save(flags); | 95 | raw_local_irq_save(flags); |
96 | res = *p; | 96 | res = *p; |
97 | *p = res & ~mask; | 97 | *p = res & ~mask; |
98 | local_irq_restore(flags); | 98 | raw_local_irq_restore(flags); |
99 | 99 | ||
100 | return res & mask; | 100 | return res & mask; |
101 | } | 101 | } |
@@ -109,10 +109,10 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p) | |||
109 | 109 | ||
110 | p += bit >> 5; | 110 | p += bit >> 5; |
111 | 111 | ||
112 | local_irq_save(flags); | 112 | raw_local_irq_save(flags); |
113 | res = *p; | 113 | res = *p; |
114 | *p = res ^ mask; | 114 | *p = res ^ mask; |
115 | local_irq_restore(flags); | 115 | raw_local_irq_restore(flags); |
116 | 116 | ||
117 | return res & mask; | 117 | return res & mask; |
118 | } | 118 | } |
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index e4a2569c636c..f0845646aacb 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #undef _CACHE | 25 | #undef _CACHE |
26 | #undef MULTI_CACHE | 26 | #undef MULTI_CACHE |
27 | 27 | ||
28 | #if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710) | 28 | #if defined(CONFIG_CPU_CACHE_V3) |
29 | # ifdef _CACHE | 29 | # ifdef _CACHE |
30 | # define MULTI_CACHE 1 | 30 | # define MULTI_CACHE 1 |
31 | # else | 31 | # else |
@@ -33,7 +33,7 @@ | |||
33 | # endif | 33 | # endif |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #if defined(CONFIG_CPU_ARM720T) | 36 | #if defined(CONFIG_CPU_CACHE_V4) |
37 | # ifdef _CACHE | 37 | # ifdef _CACHE |
38 | # define MULTI_CACHE 1 | 38 | # define MULTI_CACHE 1 |
39 | # else | 39 | # else |
@@ -54,7 +54,23 @@ | |||
54 | # endif | 54 | # endif |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #if defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_SA1100) | 57 | #if defined(CONFIG_CPU_ARM940T) |
58 | # ifdef _CACHE | ||
59 | # define MULTI_CACHE 1 | ||
60 | # else | ||
61 | # define _CACHE arm940 | ||
62 | # endif | ||
63 | #endif | ||
64 | |||
65 | #if defined(CONFIG_CPU_ARM946E) | ||
66 | # ifdef _CACHE | ||
67 | # define MULTI_CACHE 1 | ||
68 | # else | ||
69 | # define _CACHE arm946 | ||
70 | # endif | ||
71 | #endif | ||
72 | |||
73 | #if defined(CONFIG_CPU_CACHE_V4WB) | ||
58 | # ifdef _CACHE | 74 | # ifdef _CACHE |
59 | # define MULTI_CACHE 1 | 75 | # define MULTI_CACHE 1 |
60 | # else | 76 | # else |
diff --git a/include/asm-arm/flat.h b/include/asm-arm/flat.h new file mode 100644 index 000000000000..966946478589 --- /dev/null +++ b/include/asm-arm/flat.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-arm/flat.h -- uClinux flat-format executables | ||
3 | */ | ||
4 | |||
5 | #ifndef __ARM_FLAT_H__ | ||
6 | #define __ARM_FLAT_H__ | ||
7 | |||
8 | #define flat_stack_align(sp) /* nothing needed */ | ||
9 | #define flat_argvp_envp_on_stack() 1 | ||
10 | #define flat_old_ram_flag(flags) (flags) | ||
11 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) | ||
12 | #define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) | ||
13 | #define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) | ||
14 | #define flat_get_relocate_addr(rel) (rel) | ||
15 | |||
16 | #endif /* __ARM_FLAT_H__ */ | ||
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h new file mode 100644 index 000000000000..1018a7486ab7 --- /dev/null +++ b/include/asm-arm/hardware/iop3xx.h | |||
@@ -0,0 +1,301 @@ | |||
1 | /* | ||
2 | * include/asm-arm/hardware/iop3xx.h | ||
3 | * | ||
4 | * Intel IOP32X and IOP33X register definitions | ||
5 | * | ||
6 | * Author: Rory Bolt <rorybolt@pacbell.net> | ||
7 | * Copyright (C) 2002 Rory Bolt | ||
8 | * Copyright (C) 2004 Intel Corp. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef __IOP3XX_H | ||
16 | #define __IOP3XX_H | ||
17 | |||
18 | /* | ||
19 | * IOP3XX GPIO handling | ||
20 | */ | ||
21 | #define GPIO_IN 0 | ||
22 | #define GPIO_OUT 1 | ||
23 | #define GPIO_LOW 0 | ||
24 | #define GPIO_HIGH 1 | ||
25 | #define IOP3XX_GPIO_LINE(x) (x) | ||
26 | |||
27 | #ifndef __ASSEMBLY__ | ||
28 | extern void gpio_line_config(int line, int direction); | ||
29 | extern int gpio_line_get(int line); | ||
30 | extern void gpio_line_set(int line, int value); | ||
31 | #endif | ||
32 | |||
33 | |||
34 | /* | ||
35 | * IOP3XX processor registers | ||
36 | */ | ||
37 | #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000 | ||
38 | #define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000 | ||
39 | #define IOP3XX_PERIPHERAL_SIZE 0x00002000 | ||
40 | #define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg)) | ||
41 | |||
42 | /* Address Translation Unit */ | ||
43 | #define IOP3XX_ATUVID (volatile u16 *)IOP3XX_REG_ADDR(0x0100) | ||
44 | #define IOP3XX_ATUDID (volatile u16 *)IOP3XX_REG_ADDR(0x0102) | ||
45 | #define IOP3XX_ATUCMD (volatile u16 *)IOP3XX_REG_ADDR(0x0104) | ||
46 | #define IOP3XX_ATUSR (volatile u16 *)IOP3XX_REG_ADDR(0x0106) | ||
47 | #define IOP3XX_ATURID (volatile u8 *)IOP3XX_REG_ADDR(0x0108) | ||
48 | #define IOP3XX_ATUCCR (volatile u32 *)IOP3XX_REG_ADDR(0x0109) | ||
49 | #define IOP3XX_ATUCLSR (volatile u8 *)IOP3XX_REG_ADDR(0x010c) | ||
50 | #define IOP3XX_ATULT (volatile u8 *)IOP3XX_REG_ADDR(0x010d) | ||
51 | #define IOP3XX_ATUHTR (volatile u8 *)IOP3XX_REG_ADDR(0x010e) | ||
52 | #define IOP3XX_ATUBIST (volatile u8 *)IOP3XX_REG_ADDR(0x010f) | ||
53 | #define IOP3XX_IABAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0110) | ||
54 | #define IOP3XX_IAUBAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0114) | ||
55 | #define IOP3XX_IABAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0118) | ||
56 | #define IOP3XX_IAUBAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x011c) | ||
57 | #define IOP3XX_IABAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0120) | ||
58 | #define IOP3XX_IAUBAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0124) | ||
59 | #define IOP3XX_ASVIR (volatile u16 *)IOP3XX_REG_ADDR(0x012c) | ||
60 | #define IOP3XX_ASIR (volatile u16 *)IOP3XX_REG_ADDR(0x012e) | ||
61 | #define IOP3XX_ERBAR (volatile u32 *)IOP3XX_REG_ADDR(0x0130) | ||
62 | #define IOP3XX_ATUILR (volatile u8 *)IOP3XX_REG_ADDR(0x013c) | ||
63 | #define IOP3XX_ATUIPR (volatile u8 *)IOP3XX_REG_ADDR(0x013d) | ||
64 | #define IOP3XX_ATUMGNT (volatile u8 *)IOP3XX_REG_ADDR(0x013e) | ||
65 | #define IOP3XX_ATUMLAT (volatile u8 *)IOP3XX_REG_ADDR(0x013f) | ||
66 | #define IOP3XX_IALR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0140) | ||
67 | #define IOP3XX_IATVR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0144) | ||
68 | #define IOP3XX_ERLR (volatile u32 *)IOP3XX_REG_ADDR(0x0148) | ||
69 | #define IOP3XX_ERTVR (volatile u32 *)IOP3XX_REG_ADDR(0x014c) | ||
70 | #define IOP3XX_IALR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0150) | ||
71 | #define IOP3XX_IALR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0154) | ||
72 | #define IOP3XX_IATVR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0158) | ||
73 | #define IOP3XX_OIOWTVR (volatile u32 *)IOP3XX_REG_ADDR(0x015c) | ||
74 | #define IOP3XX_OMWTVR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0160) | ||
75 | #define IOP3XX_OUMWTVR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0164) | ||
76 | #define IOP3XX_OMWTVR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0168) | ||
77 | #define IOP3XX_OUMWTVR1 (volatile u32 *)IOP3XX_REG_ADDR(0x016c) | ||
78 | #define IOP3XX_OUDWTVR (volatile u32 *)IOP3XX_REG_ADDR(0x0178) | ||
79 | #define IOP3XX_ATUCR (volatile u32 *)IOP3XX_REG_ADDR(0x0180) | ||
80 | #define IOP3XX_PCSR (volatile u32 *)IOP3XX_REG_ADDR(0x0184) | ||
81 | #define IOP3XX_ATUISR (volatile u32 *)IOP3XX_REG_ADDR(0x0188) | ||
82 | #define IOP3XX_ATUIMR (volatile u32 *)IOP3XX_REG_ADDR(0x018c) | ||
83 | #define IOP3XX_IABAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0190) | ||
84 | #define IOP3XX_IAUBAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0194) | ||
85 | #define IOP3XX_IALR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0198) | ||
86 | #define IOP3XX_IATVR3 (volatile u32 *)IOP3XX_REG_ADDR(0x019c) | ||
87 | #define IOP3XX_OCCAR (volatile u32 *)IOP3XX_REG_ADDR(0x01a4) | ||
88 | #define IOP3XX_OCCDR (volatile u32 *)IOP3XX_REG_ADDR(0x01ac) | ||
89 | #define IOP3XX_PDSCR (volatile u32 *)IOP3XX_REG_ADDR(0x01bc) | ||
90 | #define IOP3XX_PMCAPID (volatile u8 *)IOP3XX_REG_ADDR(0x01c0) | ||
91 | #define IOP3XX_PMNEXT (volatile u8 *)IOP3XX_REG_ADDR(0x01c1) | ||
92 | #define IOP3XX_APMCR (volatile u16 *)IOP3XX_REG_ADDR(0x01c2) | ||
93 | #define IOP3XX_APMCSR (volatile u16 *)IOP3XX_REG_ADDR(0x01c4) | ||
94 | #define IOP3XX_PCIXCAPID (volatile u8 *)IOP3XX_REG_ADDR(0x01e0) | ||
95 | #define IOP3XX_PCIXNEXT (volatile u8 *)IOP3XX_REG_ADDR(0x01e1) | ||
96 | #define IOP3XX_PCIXCMD (volatile u16 *)IOP3XX_REG_ADDR(0x01e2) | ||
97 | #define IOP3XX_PCIXSR (volatile u32 *)IOP3XX_REG_ADDR(0x01e4) | ||
98 | #define IOP3XX_PCIIRSR (volatile u32 *)IOP3XX_REG_ADDR(0x01ec) | ||
99 | |||
100 | /* Messaging Unit */ | ||
101 | #define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) | ||
102 | #define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314) | ||
103 | #define IOP3XX_OMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0318) | ||
104 | #define IOP3XX_OMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x031c) | ||
105 | #define IOP3XX_IDR (volatile u32 *)IOP3XX_REG_ADDR(0x0320) | ||
106 | #define IOP3XX_IISR (volatile u32 *)IOP3XX_REG_ADDR(0x0324) | ||
107 | #define IOP3XX_IIMR (volatile u32 *)IOP3XX_REG_ADDR(0x0328) | ||
108 | #define IOP3XX_ODR (volatile u32 *)IOP3XX_REG_ADDR(0x032c) | ||
109 | #define IOP3XX_OISR (volatile u32 *)IOP3XX_REG_ADDR(0x0330) | ||
110 | #define IOP3XX_OIMR (volatile u32 *)IOP3XX_REG_ADDR(0x0334) | ||
111 | #define IOP3XX_MUCR (volatile u32 *)IOP3XX_REG_ADDR(0x0350) | ||
112 | #define IOP3XX_QBAR (volatile u32 *)IOP3XX_REG_ADDR(0x0354) | ||
113 | #define IOP3XX_IFHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0360) | ||
114 | #define IOP3XX_IFTPR (volatile u32 *)IOP3XX_REG_ADDR(0x0364) | ||
115 | #define IOP3XX_IPHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0368) | ||
116 | #define IOP3XX_IPTPR (volatile u32 *)IOP3XX_REG_ADDR(0x036c) | ||
117 | #define IOP3XX_OFHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0370) | ||
118 | #define IOP3XX_OFTPR (volatile u32 *)IOP3XX_REG_ADDR(0x0374) | ||
119 | #define IOP3XX_OPHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0378) | ||
120 | #define IOP3XX_OPTPR (volatile u32 *)IOP3XX_REG_ADDR(0x037c) | ||
121 | #define IOP3XX_IAR (volatile u32 *)IOP3XX_REG_ADDR(0x0380) | ||
122 | |||
123 | /* DMA Controller */ | ||
124 | #define IOP3XX_DMA0_CCR (volatile u32 *)IOP3XX_REG_ADDR(0x0400) | ||
125 | #define IOP3XX_DMA0_CSR (volatile u32 *)IOP3XX_REG_ADDR(0x0404) | ||
126 | #define IOP3XX_DMA0_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x040c) | ||
127 | #define IOP3XX_DMA0_NDAR (volatile u32 *)IOP3XX_REG_ADDR(0x0410) | ||
128 | #define IOP3XX_DMA0_PADR (volatile u32 *)IOP3XX_REG_ADDR(0x0414) | ||
129 | #define IOP3XX_DMA0_PUADR (volatile u32 *)IOP3XX_REG_ADDR(0x0418) | ||
130 | #define IOP3XX_DMA0_LADR (volatile u32 *)IOP3XX_REG_ADDR(0x041c) | ||
131 | #define IOP3XX_DMA0_BCR (volatile u32 *)IOP3XX_REG_ADDR(0x0420) | ||
132 | #define IOP3XX_DMA0_DCR (volatile u32 *)IOP3XX_REG_ADDR(0x0424) | ||
133 | #define IOP3XX_DMA1_CCR (volatile u32 *)IOP3XX_REG_ADDR(0x0440) | ||
134 | #define IOP3XX_DMA1_CSR (volatile u32 *)IOP3XX_REG_ADDR(0x0444) | ||
135 | #define IOP3XX_DMA1_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x044c) | ||
136 | #define IOP3XX_DMA1_NDAR (volatile u32 *)IOP3XX_REG_ADDR(0x0450) | ||
137 | #define IOP3XX_DMA1_PADR (volatile u32 *)IOP3XX_REG_ADDR(0x0454) | ||
138 | #define IOP3XX_DMA1_PUADR (volatile u32 *)IOP3XX_REG_ADDR(0x0458) | ||
139 | #define IOP3XX_DMA1_LADR (volatile u32 *)IOP3XX_REG_ADDR(0x045c) | ||
140 | #define IOP3XX_DMA1_BCR (volatile u32 *)IOP3XX_REG_ADDR(0x0460) | ||
141 | #define IOP3XX_DMA1_DCR (volatile u32 *)IOP3XX_REG_ADDR(0x0464) | ||
142 | |||
143 | /* Peripheral bus interface */ | ||
144 | #define IOP3XX_PBCR (volatile u32 *)IOP3XX_REG_ADDR(0x0680) | ||
145 | #define IOP3XX_PBISR (volatile u32 *)IOP3XX_REG_ADDR(0x0684) | ||
146 | #define IOP3XX_PBBAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0688) | ||
147 | #define IOP3XX_PBLR0 (volatile u32 *)IOP3XX_REG_ADDR(0x068c) | ||
148 | #define IOP3XX_PBBAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0690) | ||
149 | #define IOP3XX_PBLR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0694) | ||
150 | #define IOP3XX_PBBAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0698) | ||
151 | #define IOP3XX_PBLR2 (volatile u32 *)IOP3XX_REG_ADDR(0x069c) | ||
152 | #define IOP3XX_PBBAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x06a0) | ||
153 | #define IOP3XX_PBLR3 (volatile u32 *)IOP3XX_REG_ADDR(0x06a4) | ||
154 | #define IOP3XX_PBBAR4 (volatile u32 *)IOP3XX_REG_ADDR(0x06a8) | ||
155 | #define IOP3XX_PBLR4 (volatile u32 *)IOP3XX_REG_ADDR(0x06ac) | ||
156 | #define IOP3XX_PBBAR5 (volatile u32 *)IOP3XX_REG_ADDR(0x06b0) | ||
157 | #define IOP3XX_PBLR5 (volatile u32 *)IOP3XX_REG_ADDR(0x06b4) | ||
158 | #define IOP3XX_PMBR0 (volatile u32 *)IOP3XX_REG_ADDR(0x06c0) | ||
159 | #define IOP3XX_PMBR1 (volatile u32 *)IOP3XX_REG_ADDR(0x06e0) | ||
160 | #define IOP3XX_PMBR2 (volatile u32 *)IOP3XX_REG_ADDR(0x06e4) | ||
161 | |||
162 | /* Peripheral performance monitoring unit */ | ||
163 | #define IOP3XX_GTMR (volatile u32 *)IOP3XX_REG_ADDR(0x0700) | ||
164 | #define IOP3XX_ESR (volatile u32 *)IOP3XX_REG_ADDR(0x0704) | ||
165 | #define IOP3XX_EMISR (volatile u32 *)IOP3XX_REG_ADDR(0x0708) | ||
166 | #define IOP3XX_GTSR (volatile u32 *)IOP3XX_REG_ADDR(0x0710) | ||
167 | /* PERCR0 DOESN'T EXIST - index from 1! */ | ||
168 | #define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710) | ||
169 | |||
170 | /* General Purpose I/O */ | ||
171 | #define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0004) | ||
172 | #define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0008) | ||
173 | #define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x000c) | ||
174 | |||
175 | /* Timers */ | ||
176 | #define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000) | ||
177 | #define IOP3XX_TU_TMR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0004) | ||
178 | #define IOP3XX_TU_TCR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0008) | ||
179 | #define IOP3XX_TU_TCR1 (volatile u32 *)IOP3XX_TIMER_REG(0x000c) | ||
180 | #define IOP3XX_TU_TRR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0010) | ||
181 | #define IOP3XX_TU_TRR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0014) | ||
182 | #define IOP3XX_TU_TISR (volatile u32 *)IOP3XX_TIMER_REG(0x0018) | ||
183 | #define IOP3XX_TU_WDTCR (volatile u32 *)IOP3XX_TIMER_REG(0x001c) | ||
184 | #define IOP3XX_TMR_TC 0x01 | ||
185 | #define IOP3XX_TMR_EN 0x02 | ||
186 | #define IOP3XX_TMR_RELOAD 0x04 | ||
187 | #define IOP3XX_TMR_PRIVILEGED 0x09 | ||
188 | #define IOP3XX_TMR_RATIO_1_1 0x00 | ||
189 | #define IOP3XX_TMR_RATIO_4_1 0x10 | ||
190 | #define IOP3XX_TMR_RATIO_8_1 0x20 | ||
191 | #define IOP3XX_TMR_RATIO_16_1 0x30 | ||
192 | |||
193 | /* Application accelerator unit */ | ||
194 | #define IOP3XX_AAU_ACR (volatile u32 *)IOP3XX_REG_ADDR(0x0800) | ||
195 | #define IOP3XX_AAU_ASR (volatile u32 *)IOP3XX_REG_ADDR(0x0804) | ||
196 | #define IOP3XX_AAU_ADAR (volatile u32 *)IOP3XX_REG_ADDR(0x0808) | ||
197 | #define IOP3XX_AAU_ANDAR (volatile u32 *)IOP3XX_REG_ADDR(0x080c) | ||
198 | #define IOP3XX_AAU_SAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0810) | ||
199 | #define IOP3XX_AAU_SAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0814) | ||
200 | #define IOP3XX_AAU_SAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0818) | ||
201 | #define IOP3XX_AAU_SAR4 (volatile u32 *)IOP3XX_REG_ADDR(0x081c) | ||
202 | #define IOP3XX_AAU_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x0820) | ||
203 | #define IOP3XX_AAU_ABCR (volatile u32 *)IOP3XX_REG_ADDR(0x0824) | ||
204 | #define IOP3XX_AAU_ADCR (volatile u32 *)IOP3XX_REG_ADDR(0x0828) | ||
205 | #define IOP3XX_AAU_SAR5 (volatile u32 *)IOP3XX_REG_ADDR(0x082c) | ||
206 | #define IOP3XX_AAU_SAR6 (volatile u32 *)IOP3XX_REG_ADDR(0x0830) | ||
207 | #define IOP3XX_AAU_SAR7 (volatile u32 *)IOP3XX_REG_ADDR(0x0834) | ||
208 | #define IOP3XX_AAU_SAR8 (volatile u32 *)IOP3XX_REG_ADDR(0x0838) | ||
209 | #define IOP3XX_AAU_EDCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x083c) | ||
210 | #define IOP3XX_AAU_SAR9 (volatile u32 *)IOP3XX_REG_ADDR(0x0840) | ||
211 | #define IOP3XX_AAU_SAR10 (volatile u32 *)IOP3XX_REG_ADDR(0x0844) | ||
212 | #define IOP3XX_AAU_SAR11 (volatile u32 *)IOP3XX_REG_ADDR(0x0848) | ||
213 | #define IOP3XX_AAU_SAR12 (volatile u32 *)IOP3XX_REG_ADDR(0x084c) | ||
214 | #define IOP3XX_AAU_SAR13 (volatile u32 *)IOP3XX_REG_ADDR(0x0850) | ||
215 | #define IOP3XX_AAU_SAR14 (volatile u32 *)IOP3XX_REG_ADDR(0x0854) | ||
216 | #define IOP3XX_AAU_SAR15 (volatile u32 *)IOP3XX_REG_ADDR(0x0858) | ||
217 | #define IOP3XX_AAU_SAR16 (volatile u32 *)IOP3XX_REG_ADDR(0x085c) | ||
218 | #define IOP3XX_AAU_EDCR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0860) | ||
219 | #define IOP3XX_AAU_SAR17 (volatile u32 *)IOP3XX_REG_ADDR(0x0864) | ||
220 | #define IOP3XX_AAU_SAR18 (volatile u32 *)IOP3XX_REG_ADDR(0x0868) | ||
221 | #define IOP3XX_AAU_SAR19 (volatile u32 *)IOP3XX_REG_ADDR(0x086c) | ||
222 | #define IOP3XX_AAU_SAR20 (volatile u32 *)IOP3XX_REG_ADDR(0x0870) | ||
223 | #define IOP3XX_AAU_SAR21 (volatile u32 *)IOP3XX_REG_ADDR(0x0874) | ||
224 | #define IOP3XX_AAU_SAR22 (volatile u32 *)IOP3XX_REG_ADDR(0x0878) | ||
225 | #define IOP3XX_AAU_SAR23 (volatile u32 *)IOP3XX_REG_ADDR(0x087c) | ||
226 | #define IOP3XX_AAU_SAR24 (volatile u32 *)IOP3XX_REG_ADDR(0x0880) | ||
227 | #define IOP3XX_AAU_EDCR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0884) | ||
228 | #define IOP3XX_AAU_SAR25 (volatile u32 *)IOP3XX_REG_ADDR(0x0888) | ||
229 | #define IOP3XX_AAU_SAR26 (volatile u32 *)IOP3XX_REG_ADDR(0x088c) | ||
230 | #define IOP3XX_AAU_SAR27 (volatile u32 *)IOP3XX_REG_ADDR(0x0890) | ||
231 | #define IOP3XX_AAU_SAR28 (volatile u32 *)IOP3XX_REG_ADDR(0x0894) | ||
232 | #define IOP3XX_AAU_SAR29 (volatile u32 *)IOP3XX_REG_ADDR(0x0898) | ||
233 | #define IOP3XX_AAU_SAR30 (volatile u32 *)IOP3XX_REG_ADDR(0x089c) | ||
234 | #define IOP3XX_AAU_SAR31 (volatile u32 *)IOP3XX_REG_ADDR(0x08a0) | ||
235 | #define IOP3XX_AAU_SAR32 (volatile u32 *)IOP3XX_REG_ADDR(0x08a4) | ||
236 | |||
237 | /* I2C bus interface unit */ | ||
238 | #define IOP3XX_ICR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1680) | ||
239 | #define IOP3XX_ISR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1684) | ||
240 | #define IOP3XX_ISAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1688) | ||
241 | #define IOP3XX_IDBR0 (volatile u32 *)IOP3XX_REG_ADDR(0x168c) | ||
242 | #define IOP3XX_IBMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1694) | ||
243 | #define IOP3XX_ICR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16a0) | ||
244 | #define IOP3XX_ISR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16a4) | ||
245 | #define IOP3XX_ISAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16a8) | ||
246 | #define IOP3XX_IDBR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16ac) | ||
247 | #define IOP3XX_IBMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16b4) | ||
248 | |||
249 | |||
250 | /* | ||
251 | * IOP3XX I/O and Mem space regions for PCI autoconfiguration | ||
252 | */ | ||
253 | #define IOP3XX_PCI_MEM_WINDOW_SIZE 0x04000000 | ||
254 | #define IOP3XX_PCI_LOWER_MEM_PA 0x80000000 | ||
255 | #define IOP3XX_PCI_LOWER_MEM_BA (*IOP3XX_OMWTVR0) | ||
256 | |||
257 | #define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000 | ||
258 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 | ||
259 | #define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 | ||
260 | #define IOP3XX_PCI_LOWER_IO_BA (*IOP3XX_OIOWTVR) | ||
261 | |||
262 | |||
263 | #ifndef __ASSEMBLY__ | ||
264 | void iop3xx_map_io(void); | ||
265 | void iop3xx_init_time(unsigned long); | ||
266 | unsigned long iop3xx_gettimeoffset(void); | ||
267 | |||
268 | extern struct platform_device iop3xx_i2c0_device; | ||
269 | extern struct platform_device iop3xx_i2c1_device; | ||
270 | |||
271 | extern inline void iop3xx_cp6_enable(void) | ||
272 | { | ||
273 | u32 temp; | ||
274 | |||
275 | asm volatile ( | ||
276 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
277 | "orr %0, %0, #(1 << 6)\n\t" | ||
278 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
279 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
280 | "mov %0, %0\n\t" | ||
281 | "sub pc, pc, #4\n\t" | ||
282 | : "=r" (temp) ); | ||
283 | } | ||
284 | |||
285 | extern inline void iop3xx_cp6_disable(void) | ||
286 | { | ||
287 | u32 temp; | ||
288 | |||
289 | asm volatile ( | ||
290 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
291 | "bic %0, %0, #(1 << 6)\n\t" | ||
292 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
293 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
294 | "mov %0, %0\n\t" | ||
295 | "sub pc, pc, #4\n\t" | ||
296 | : "=r" (temp) ); | ||
297 | } | ||
298 | #endif | ||
299 | |||
300 | |||
301 | #endif | ||
diff --git a/include/asm-arm/hardware/locomo.h b/include/asm-arm/hardware/locomo.h index 22dfb1737768..adab77780ed3 100644 --- a/include/asm-arm/hardware/locomo.h +++ b/include/asm-arm/hardware/locomo.h | |||
@@ -54,17 +54,18 @@ | |||
54 | #define LOCOMO_DAC_SDAOEB 0x01 /* SDA pin output data */ | 54 | #define LOCOMO_DAC_SDAOEB 0x01 /* SDA pin output data */ |
55 | 55 | ||
56 | /* SPI interface */ | 56 | /* SPI interface */ |
57 | #define LOCOMO_SPIMD 0x60 /* SPI mode setting */ | 57 | #define LOCOMO_SPI 0x60 |
58 | #define LOCOMO_SPICT 0x64 /* SPI mode control */ | 58 | #define LOCOMO_SPIMD 0x00 /* SPI mode setting */ |
59 | #define LOCOMO_SPIST 0x68 /* SPI status */ | 59 | #define LOCOMO_SPICT 0x04 /* SPI mode control */ |
60 | #define LOCOMO_SPIIS 0x70 /* SPI interrupt status */ | 60 | #define LOCOMO_SPIST 0x08 /* SPI status */ |
61 | #define LOCOMO_SPIWE 0x74 /* SPI interrupt status write enable */ | 61 | #define LOCOMO_SPIIS 0x10 /* SPI interrupt status */ |
62 | #define LOCOMO_SPIIE 0x78 /* SPI interrupt enable */ | 62 | #define LOCOMO_SPIWE 0x14 /* SPI interrupt status write enable */ |
63 | #define LOCOMO_SPIIR 0x7c /* SPI interrupt request */ | 63 | #define LOCOMO_SPIIE 0x18 /* SPI interrupt enable */ |
64 | #define LOCOMO_SPITD 0x80 /* SPI transfer data write */ | 64 | #define LOCOMO_SPIIR 0x1c /* SPI interrupt request */ |
65 | #define LOCOMO_SPIRD 0x84 /* SPI receive data read */ | 65 | #define LOCOMO_SPITD 0x20 /* SPI transfer data write */ |
66 | #define LOCOMO_SPITS 0x88 /* SPI transfer data shift */ | 66 | #define LOCOMO_SPIRD 0x24 /* SPI receive data read */ |
67 | #define LOCOMO_SPIRS 0x8C /* SPI receive data shift */ | 67 | #define LOCOMO_SPITS 0x28 /* SPI transfer data shift */ |
68 | #define LOCOMO_SPIRS 0x2C /* SPI receive data shift */ | ||
68 | #define LOCOMO_SPI_TEND (1 << 3) /* Transfer end bit */ | 69 | #define LOCOMO_SPI_TEND (1 << 3) /* Transfer end bit */ |
69 | #define LOCOMO_SPI_OVRN (1 << 2) /* Over Run bit */ | 70 | #define LOCOMO_SPI_OVRN (1 << 2) /* Over Run bit */ |
70 | #define LOCOMO_SPI_RFW (1 << 1) /* write buffer bit */ | 71 | #define LOCOMO_SPI_RFW (1 << 1) /* write buffer bit */ |
@@ -161,6 +162,7 @@ extern struct bus_type locomo_bus_type; | |||
161 | #define LOCOMO_DEVID_AUDIO 3 | 162 | #define LOCOMO_DEVID_AUDIO 3 |
162 | #define LOCOMO_DEVID_LED 4 | 163 | #define LOCOMO_DEVID_LED 4 |
163 | #define LOCOMO_DEVID_UART 5 | 164 | #define LOCOMO_DEVID_UART 5 |
165 | #define LOCOMO_DEVID_SPI 6 | ||
164 | 166 | ||
165 | struct locomo_dev { | 167 | struct locomo_dev { |
166 | struct device dev; | 168 | struct device dev; |
@@ -197,10 +199,11 @@ int locomo_driver_register(struct locomo_driver *); | |||
197 | void locomo_driver_unregister(struct locomo_driver *); | 199 | void locomo_driver_unregister(struct locomo_driver *); |
198 | 200 | ||
199 | /* GPIO control functions */ | 201 | /* GPIO control functions */ |
200 | void locomo_gpio_set_dir(struct locomo_dev *ldev, unsigned int bits, unsigned int dir); | 202 | void locomo_gpio_set_dir(struct device *dev, unsigned int bits, unsigned int dir); |
201 | unsigned int locomo_gpio_read_level(struct locomo_dev *ldev, unsigned int bits); | 203 | int locomo_gpio_read_level(struct device *dev, unsigned int bits); |
202 | unsigned int locomo_gpio_read_output(struct locomo_dev *ldev, unsigned int bits); | 204 | int locomo_gpio_read_output(struct device *dev, unsigned int bits); |
203 | void locomo_gpio_write(struct locomo_dev *ldev, unsigned int bits, unsigned int set); | 205 | void locomo_gpio_write(struct device *dev, unsigned int bits, unsigned int set); |
206 | |||
204 | 207 | ||
205 | /* M62332 control function */ | 208 | /* M62332 control function */ |
206 | void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel); | 209 | void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel); |
diff --git a/include/asm-arm/hardware/sharpsl_pm.h b/include/asm-arm/hardware/sharpsl_pm.h index ecf15b83956f..a836e76a14f7 100644 --- a/include/asm-arm/hardware/sharpsl_pm.h +++ b/include/asm-arm/hardware/sharpsl_pm.h | |||
@@ -25,6 +25,7 @@ struct sharpsl_charger_machinfo { | |||
25 | void (*measure_temp)(int); | 25 | void (*measure_temp)(int); |
26 | void (*presuspend)(void); | 26 | void (*presuspend)(void); |
27 | void (*postsuspend)(void); | 27 | void (*postsuspend)(void); |
28 | void (*earlyresume)(void); | ||
28 | unsigned long (*read_devdata)(int); | 29 | unsigned long (*read_devdata)(int); |
29 | #define SHARPSL_BATT_VOLT 1 | 30 | #define SHARPSL_BATT_VOLT 1 |
30 | #define SHARPSL_BATT_TEMP 2 | 31 | #define SHARPSL_BATT_TEMP 2 |
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index bf7b9dea30f1..8076a85c3675 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -280,6 +280,10 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); | |||
280 | #define BIOVEC_MERGEABLE(vec1, vec2) \ | 280 | #define BIOVEC_MERGEABLE(vec1, vec2) \ |
281 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) | 281 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) |
282 | 282 | ||
283 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE | ||
284 | extern int valid_phys_addr_range(unsigned long addr, size_t size); | ||
285 | extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); | ||
286 | |||
283 | /* | 287 | /* |
284 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 288 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
285 | * access | 289 | * access |
diff --git a/include/asm-arm/irqflags.h b/include/asm-arm/irqflags.h new file mode 100644 index 000000000000..6d09974e6646 --- /dev/null +++ b/include/asm-arm/irqflags.h | |||
@@ -0,0 +1,132 @@ | |||
1 | #ifndef __ASM_ARM_IRQFLAGS_H | ||
2 | #define __ASM_ARM_IRQFLAGS_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <asm/ptrace.h> | ||
7 | |||
8 | /* | ||
9 | * CPU interrupt mask handling. | ||
10 | */ | ||
11 | #if __LINUX_ARM_ARCH__ >= 6 | ||
12 | |||
13 | #define raw_local_irq_save(x) \ | ||
14 | ({ \ | ||
15 | __asm__ __volatile__( \ | ||
16 | "mrs %0, cpsr @ local_irq_save\n" \ | ||
17 | "cpsid i" \ | ||
18 | : "=r" (x) : : "memory", "cc"); \ | ||
19 | }) | ||
20 | |||
21 | #define raw_local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc") | ||
22 | #define raw_local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc") | ||
23 | #define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc") | ||
24 | #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc") | ||
25 | |||
26 | #else | ||
27 | |||
28 | /* | ||
29 | * Save the current interrupt enable state & disable IRQs | ||
30 | */ | ||
31 | #define raw_local_irq_save(x) \ | ||
32 | ({ \ | ||
33 | unsigned long temp; \ | ||
34 | (void) (&temp == &x); \ | ||
35 | __asm__ __volatile__( \ | ||
36 | "mrs %0, cpsr @ local_irq_save\n" \ | ||
37 | " orr %1, %0, #128\n" \ | ||
38 | " msr cpsr_c, %1" \ | ||
39 | : "=r" (x), "=r" (temp) \ | ||
40 | : \ | ||
41 | : "memory", "cc"); \ | ||
42 | }) | ||
43 | |||
44 | /* | ||
45 | * Enable IRQs | ||
46 | */ | ||
47 | #define raw_local_irq_enable() \ | ||
48 | ({ \ | ||
49 | unsigned long temp; \ | ||
50 | __asm__ __volatile__( \ | ||
51 | "mrs %0, cpsr @ local_irq_enable\n" \ | ||
52 | " bic %0, %0, #128\n" \ | ||
53 | " msr cpsr_c, %0" \ | ||
54 | : "=r" (temp) \ | ||
55 | : \ | ||
56 | : "memory", "cc"); \ | ||
57 | }) | ||
58 | |||
59 | /* | ||
60 | * Disable IRQs | ||
61 | */ | ||
62 | #define raw_local_irq_disable() \ | ||
63 | ({ \ | ||
64 | unsigned long temp; \ | ||
65 | __asm__ __volatile__( \ | ||
66 | "mrs %0, cpsr @ local_irq_disable\n" \ | ||
67 | " orr %0, %0, #128\n" \ | ||
68 | " msr cpsr_c, %0" \ | ||
69 | : "=r" (temp) \ | ||
70 | : \ | ||
71 | : "memory", "cc"); \ | ||
72 | }) | ||
73 | |||
74 | /* | ||
75 | * Enable FIQs | ||
76 | */ | ||
77 | #define local_fiq_enable() \ | ||
78 | ({ \ | ||
79 | unsigned long temp; \ | ||
80 | __asm__ __volatile__( \ | ||
81 | "mrs %0, cpsr @ stf\n" \ | ||
82 | " bic %0, %0, #64\n" \ | ||
83 | " msr cpsr_c, %0" \ | ||
84 | : "=r" (temp) \ | ||
85 | : \ | ||
86 | : "memory", "cc"); \ | ||
87 | }) | ||
88 | |||
89 | /* | ||
90 | * Disable FIQs | ||
91 | */ | ||
92 | #define local_fiq_disable() \ | ||
93 | ({ \ | ||
94 | unsigned long temp; \ | ||
95 | __asm__ __volatile__( \ | ||
96 | "mrs %0, cpsr @ clf\n" \ | ||
97 | " orr %0, %0, #64\n" \ | ||
98 | " msr cpsr_c, %0" \ | ||
99 | : "=r" (temp) \ | ||
100 | : \ | ||
101 | : "memory", "cc"); \ | ||
102 | }) | ||
103 | |||
104 | #endif | ||
105 | |||
106 | /* | ||
107 | * Save the current interrupt enable state. | ||
108 | */ | ||
109 | #define raw_local_save_flags(x) \ | ||
110 | ({ \ | ||
111 | __asm__ __volatile__( \ | ||
112 | "mrs %0, cpsr @ local_save_flags" \ | ||
113 | : "=r" (x) : : "memory", "cc"); \ | ||
114 | }) | ||
115 | |||
116 | /* | ||
117 | * restore saved IRQ & FIQ state | ||
118 | */ | ||
119 | #define raw_local_irq_restore(x) \ | ||
120 | __asm__ __volatile__( \ | ||
121 | "msr cpsr_c, %0 @ local_irq_restore\n" \ | ||
122 | : \ | ||
123 | : "r" (x) \ | ||
124 | : "memory", "cc") | ||
125 | |||
126 | #define raw_irqs_disabled_flags(flags) \ | ||
127 | ({ \ | ||
128 | (int)((flags) & PSR_I_BIT); \ | ||
129 | }) | ||
130 | |||
131 | #endif | ||
132 | #endif | ||
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h index 923e0ca66200..24621c49a0c7 100644 --- a/include/asm-arm/mach/pci.h +++ b/include/asm-arm/mach/pci.h | |||
@@ -52,13 +52,9 @@ void pci_common_init(struct hw_pci *); | |||
52 | /* | 52 | /* |
53 | * PCI controllers | 53 | * PCI controllers |
54 | */ | 54 | */ |
55 | extern int iop321_setup(int nr, struct pci_sys_data *); | 55 | extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); |
56 | extern struct pci_bus *iop321_scan_bus(int nr, struct pci_sys_data *); | 56 | extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); |
57 | extern void iop321_init(void); | 57 | extern void iop3xx_pci_preinit(void); |
58 | |||
59 | extern int iop331_setup(int nr, struct pci_sys_data *); | ||
60 | extern struct pci_bus *iop331_scan_bus(int nr, struct pci_sys_data *); | ||
61 | extern void iop331_init(void); | ||
62 | 58 | ||
63 | extern int dc21285_setup(int nr, struct pci_sys_data *); | 59 | extern int dc21285_setup(int nr, struct pci_sys_data *); |
64 | extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); | 60 | extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); |
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h index dee0bc336fe8..1eb93f5c0d6c 100644 --- a/include/asm-arm/mach/time.h +++ b/include/asm-arm/mach/time.h | |||
@@ -38,7 +38,9 @@ struct sys_timer { | |||
38 | void (*init)(void); | 38 | void (*init)(void); |
39 | void (*suspend)(void); | 39 | void (*suspend)(void); |
40 | void (*resume)(void); | 40 | void (*resume)(void); |
41 | #ifndef CONFIG_GENERIC_TIME | ||
41 | unsigned long (*offset)(void); | 42 | unsigned long (*offset)(void); |
43 | #endif | ||
42 | 44 | ||
43 | #ifdef CONFIG_NO_IDLE_HZ | 45 | #ifdef CONFIG_NO_IDLE_HZ |
44 | struct dyn_tick_timer *dyn_tick; | 46 | struct dyn_tick_timer *dyn_tick; |
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 02bd3ee935b0..7e85db77d99b 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h | |||
@@ -174,9 +174,6 @@ typedef unsigned long pgprot_t; | |||
174 | 174 | ||
175 | #endif /* STRICT_MM_TYPECHECKS */ | 175 | #endif /* STRICT_MM_TYPECHECKS */ |
176 | 176 | ||
177 | /* the upper-most page table pointer */ | ||
178 | extern pmd_t *top_pmd; | ||
179 | |||
180 | #endif /* CONFIG_MMU */ | 177 | #endif /* CONFIG_MMU */ |
181 | 178 | ||
182 | #include <asm/memory.h> | 179 | #include <asm/memory.h> |
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 4d10d319fa34..ed8cb5963e99 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -136,6 +136,13 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
136 | #define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) | 136 | #define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * section address mask and size definitions. | ||
140 | */ | ||
141 | #define SECTION_SHIFT 20 | ||
142 | #define SECTION_SIZE (1UL << SECTION_SHIFT) | ||
143 | #define SECTION_MASK (~(SECTION_SIZE-1)) | ||
144 | |||
145 | /* | ||
139 | * ARMv6 supersection address mask and size definitions. | 146 | * ARMv6 supersection address mask and size definitions. |
140 | */ | 147 | */ |
141 | #define SUPERSECTION_SHIFT 24 | 148 | #define SUPERSECTION_SHIFT 24 |
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h index 1bde92cdaebd..ea7e54c319be 100644 --- a/include/asm-arm/proc-fns.h +++ b/include/asm-arm/proc-fns.h | |||
@@ -33,6 +33,14 @@ | |||
33 | # define CPU_NAME cpu_arm6 | 33 | # define CPU_NAME cpu_arm6 |
34 | # endif | 34 | # endif |
35 | # endif | 35 | # endif |
36 | # ifdef CONFIG_CPU_ARM7TDMI | ||
37 | # ifdef CPU_NAME | ||
38 | # undef MULTI_CPU | ||
39 | # define MULTI_CPU | ||
40 | # else | ||
41 | # define CPU_NAME cpu_arm7tdmi | ||
42 | # endif | ||
43 | # endif | ||
36 | # ifdef CONFIG_CPU_ARM710 | 44 | # ifdef CONFIG_CPU_ARM710 |
37 | # ifdef CPU_NAME | 45 | # ifdef CPU_NAME |
38 | # undef MULTI_CPU | 46 | # undef MULTI_CPU |
@@ -49,6 +57,22 @@ | |||
49 | # define CPU_NAME cpu_arm720 | 57 | # define CPU_NAME cpu_arm720 |
50 | # endif | 58 | # endif |
51 | # endif | 59 | # endif |
60 | # ifdef CONFIG_CPU_ARM740T | ||
61 | # ifdef CPU_NAME | ||
62 | # undef MULTI_CPU | ||
63 | # define MULTI_CPU | ||
64 | # else | ||
65 | # define CPU_NAME cpu_arm740 | ||
66 | # endif | ||
67 | # endif | ||
68 | # ifdef CONFIG_CPU_ARM9TDMI | ||
69 | # ifdef CPU_NAME | ||
70 | # undef MULTI_CPU | ||
71 | # define MULTI_CPU | ||
72 | # else | ||
73 | # define CPU_NAME cpu_arm9tdmi | ||
74 | # endif | ||
75 | # endif | ||
52 | # ifdef CONFIG_CPU_ARM920T | 76 | # ifdef CONFIG_CPU_ARM920T |
53 | # ifdef CPU_NAME | 77 | # ifdef CPU_NAME |
54 | # undef MULTI_CPU | 78 | # undef MULTI_CPU |
@@ -81,6 +105,22 @@ | |||
81 | # define CPU_NAME cpu_arm926 | 105 | # define CPU_NAME cpu_arm926 |
82 | # endif | 106 | # endif |
83 | # endif | 107 | # endif |
108 | # ifdef CONFIG_CPU_ARM940T | ||
109 | # ifdef CPU_NAME | ||
110 | # undef MULTI_CPU | ||
111 | # define MULTI_CPU | ||
112 | # else | ||
113 | # define CPU_NAME cpu_arm940 | ||
114 | # endif | ||
115 | # endif | ||
116 | # ifdef CONFIG_CPU_ARM946E | ||
117 | # ifdef CPU_NAME | ||
118 | # undef MULTI_CPU | ||
119 | # define MULTI_CPU | ||
120 | # else | ||
121 | # define CPU_NAME cpu_arm946 | ||
122 | # endif | ||
123 | # endif | ||
84 | # ifdef CONFIG_CPU_SA110 | 124 | # ifdef CONFIG_CPU_SA110 |
85 | # ifdef CPU_NAME | 125 | # ifdef CPU_NAME |
86 | # undef MULTI_CPU | 126 | # undef MULTI_CPU |
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h index ea3ed2465233..aa4b5782f0c9 100644 --- a/include/asm-arm/setup.h +++ b/include/asm-arm/setup.h | |||
@@ -194,13 +194,15 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn } | |||
194 | # define NR_BANKS 8 | 194 | # define NR_BANKS 8 |
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | struct membank { | ||
198 | unsigned long start; | ||
199 | unsigned long size; | ||
200 | int node; | ||
201 | }; | ||
202 | |||
197 | struct meminfo { | 203 | struct meminfo { |
198 | int nr_banks; | 204 | int nr_banks; |
199 | struct { | 205 | struct membank bank[NR_BANKS]; |
200 | unsigned long start; | ||
201 | unsigned long size; | ||
202 | int node; | ||
203 | } bank[NR_BANKS]; | ||
204 | }; | 206 | }; |
205 | 207 | ||
206 | /* | 208 | /* |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 0947cbf9b69a..f05fbe31576c 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -46,6 +46,7 @@ | |||
46 | #define CPUID_TCM 2 | 46 | #define CPUID_TCM 2 |
47 | #define CPUID_TLBTYPE 3 | 47 | #define CPUID_TLBTYPE 3 |
48 | 48 | ||
49 | #ifdef CONFIG_CPU_CP15 | ||
49 | #define read_cpuid(reg) \ | 50 | #define read_cpuid(reg) \ |
50 | ({ \ | 51 | ({ \ |
51 | unsigned int __val; \ | 52 | unsigned int __val; \ |
@@ -55,6 +56,9 @@ | |||
55 | : "cc"); \ | 56 | : "cc"); \ |
56 | __val; \ | 57 | __val; \ |
57 | }) | 58 | }) |
59 | #else | ||
60 | #define read_cpuid(reg) (processor_id) | ||
61 | #endif | ||
58 | 62 | ||
59 | /* | 63 | /* |
60 | * This is used to ensure the compiler did actually allocate the register we | 64 | * This is used to ensure the compiler did actually allocate the register we |
@@ -207,130 +211,7 @@ static inline void sched_cacheflush(void) | |||
207 | { | 211 | { |
208 | } | 212 | } |
209 | 213 | ||
210 | /* | 214 | #include <linux/irqflags.h> |
211 | * CPU interrupt mask handling. | ||
212 | */ | ||
213 | #if __LINUX_ARM_ARCH__ >= 6 | ||
214 | |||
215 | #define local_irq_save(x) \ | ||
216 | ({ \ | ||
217 | __asm__ __volatile__( \ | ||
218 | "mrs %0, cpsr @ local_irq_save\n" \ | ||
219 | "cpsid i" \ | ||
220 | : "=r" (x) : : "memory", "cc"); \ | ||
221 | }) | ||
222 | |||
223 | #define local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc") | ||
224 | #define local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc") | ||
225 | #define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc") | ||
226 | #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc") | ||
227 | |||
228 | #else | ||
229 | |||
230 | /* | ||
231 | * Save the current interrupt enable state & disable IRQs | ||
232 | */ | ||
233 | #define local_irq_save(x) \ | ||
234 | ({ \ | ||
235 | unsigned long temp; \ | ||
236 | (void) (&temp == &x); \ | ||
237 | __asm__ __volatile__( \ | ||
238 | "mrs %0, cpsr @ local_irq_save\n" \ | ||
239 | " orr %1, %0, #128\n" \ | ||
240 | " msr cpsr_c, %1" \ | ||
241 | : "=r" (x), "=r" (temp) \ | ||
242 | : \ | ||
243 | : "memory", "cc"); \ | ||
244 | }) | ||
245 | |||
246 | /* | ||
247 | * Enable IRQs | ||
248 | */ | ||
249 | #define local_irq_enable() \ | ||
250 | ({ \ | ||
251 | unsigned long temp; \ | ||
252 | __asm__ __volatile__( \ | ||
253 | "mrs %0, cpsr @ local_irq_enable\n" \ | ||
254 | " bic %0, %0, #128\n" \ | ||
255 | " msr cpsr_c, %0" \ | ||
256 | : "=r" (temp) \ | ||
257 | : \ | ||
258 | : "memory", "cc"); \ | ||
259 | }) | ||
260 | |||
261 | /* | ||
262 | * Disable IRQs | ||
263 | */ | ||
264 | #define local_irq_disable() \ | ||
265 | ({ \ | ||
266 | unsigned long temp; \ | ||
267 | __asm__ __volatile__( \ | ||
268 | "mrs %0, cpsr @ local_irq_disable\n" \ | ||
269 | " orr %0, %0, #128\n" \ | ||
270 | " msr cpsr_c, %0" \ | ||
271 | : "=r" (temp) \ | ||
272 | : \ | ||
273 | : "memory", "cc"); \ | ||
274 | }) | ||
275 | |||
276 | /* | ||
277 | * Enable FIQs | ||
278 | */ | ||
279 | #define local_fiq_enable() \ | ||
280 | ({ \ | ||
281 | unsigned long temp; \ | ||
282 | __asm__ __volatile__( \ | ||
283 | "mrs %0, cpsr @ stf\n" \ | ||
284 | " bic %0, %0, #64\n" \ | ||
285 | " msr cpsr_c, %0" \ | ||
286 | : "=r" (temp) \ | ||
287 | : \ | ||
288 | : "memory", "cc"); \ | ||
289 | }) | ||
290 | |||
291 | /* | ||
292 | * Disable FIQs | ||
293 | */ | ||
294 | #define local_fiq_disable() \ | ||
295 | ({ \ | ||
296 | unsigned long temp; \ | ||
297 | __asm__ __volatile__( \ | ||
298 | "mrs %0, cpsr @ clf\n" \ | ||
299 | " orr %0, %0, #64\n" \ | ||
300 | " msr cpsr_c, %0" \ | ||
301 | : "=r" (temp) \ | ||
302 | : \ | ||
303 | : "memory", "cc"); \ | ||
304 | }) | ||
305 | |||
306 | #endif | ||
307 | |||
308 | /* | ||
309 | * Save the current interrupt enable state. | ||
310 | */ | ||
311 | #define local_save_flags(x) \ | ||
312 | ({ \ | ||
313 | __asm__ __volatile__( \ | ||
314 | "mrs %0, cpsr @ local_save_flags" \ | ||
315 | : "=r" (x) : : "memory", "cc"); \ | ||
316 | }) | ||
317 | |||
318 | /* | ||
319 | * restore saved IRQ & FIQ state | ||
320 | */ | ||
321 | #define local_irq_restore(x) \ | ||
322 | __asm__ __volatile__( \ | ||
323 | "msr cpsr_c, %0 @ local_irq_restore\n" \ | ||
324 | : \ | ||
325 | : "r" (x) \ | ||
326 | : "memory", "cc") | ||
327 | |||
328 | #define irqs_disabled() \ | ||
329 | ({ \ | ||
330 | unsigned long flags; \ | ||
331 | local_save_flags(flags); \ | ||
332 | (int)(flags & PSR_I_BIT); \ | ||
333 | }) | ||
334 | 215 | ||
335 | #ifdef CONFIG_SMP | 216 | #ifdef CONFIG_SMP |
336 | 217 | ||
@@ -405,17 +286,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size | |||
405 | #error SMP is not supported on this platform | 286 | #error SMP is not supported on this platform |
406 | #endif | 287 | #endif |
407 | case 1: | 288 | case 1: |
408 | local_irq_save(flags); | 289 | raw_local_irq_save(flags); |
409 | ret = *(volatile unsigned char *)ptr; | 290 | ret = *(volatile unsigned char *)ptr; |
410 | *(volatile unsigned char *)ptr = x; | 291 | *(volatile unsigned char *)ptr = x; |
411 | local_irq_restore(flags); | 292 | raw_local_irq_restore(flags); |
412 | break; | 293 | break; |
413 | 294 | ||
414 | case 4: | 295 | case 4: |
415 | local_irq_save(flags); | 296 | raw_local_irq_save(flags); |
416 | ret = *(volatile unsigned long *)ptr; | 297 | ret = *(volatile unsigned long *)ptr; |
417 | *(volatile unsigned long *)ptr = x; | 298 | *(volatile unsigned long *)ptr = x; |
418 | local_irq_restore(flags); | 299 | raw_local_irq_restore(flags); |
419 | break; | 300 | break; |
420 | #else | 301 | #else |
421 | case 1: | 302 | case 1: |
diff --git a/include/asm-arm/timeofday.h b/include/asm-arm/timeofday.h new file mode 100644 index 000000000000..27254bd5b94f --- /dev/null +++ b/include/asm-arm/timeofday.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #ifndef _ASM_ARM_TIMEOFDAY_H | ||
2 | #define _ASM_ARM_TIMEOFDAY_H | ||
3 | #include <asm-generic/timeofday.h> | ||
4 | #endif | ||
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h index d97fc76189a5..cd10a0b5f8ae 100644 --- a/include/asm-arm/tlbflush.h +++ b/include/asm-arm/tlbflush.h | |||
@@ -247,16 +247,16 @@ static inline void local_flush_tlb_all(void) | |||
247 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 247 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
248 | 248 | ||
249 | if (tlb_flag(TLB_WB)) | 249 | if (tlb_flag(TLB_WB)) |
250 | asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); | 250 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); |
251 | 251 | ||
252 | if (tlb_flag(TLB_V3_FULL)) | 252 | if (tlb_flag(TLB_V3_FULL)) |
253 | asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (zero)); | 253 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc"); |
254 | if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL)) | 254 | if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL)) |
255 | asm("mcr%? p15, 0, %0, c8, c7, 0" : : "r" (zero)); | 255 | asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc"); |
256 | if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL)) | 256 | if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL)) |
257 | asm("mcr%? p15, 0, %0, c8, c6, 0" : : "r" (zero)); | 257 | asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc"); |
258 | if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) | 258 | if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) |
259 | asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); | 259 | asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); |
260 | } | 260 | } |
261 | 261 | ||
262 | static inline void local_flush_tlb_mm(struct mm_struct *mm) | 262 | static inline void local_flush_tlb_mm(struct mm_struct *mm) |
@@ -266,25 +266,25 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) | |||
266 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 266 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
267 | 267 | ||
268 | if (tlb_flag(TLB_WB)) | 268 | if (tlb_flag(TLB_WB)) |
269 | asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); | 269 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); |
270 | 270 | ||
271 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) { | 271 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) { |
272 | if (tlb_flag(TLB_V3_FULL)) | 272 | if (tlb_flag(TLB_V3_FULL)) |
273 | asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (zero)); | 273 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc"); |
274 | if (tlb_flag(TLB_V4_U_FULL)) | 274 | if (tlb_flag(TLB_V4_U_FULL)) |
275 | asm("mcr%? p15, 0, %0, c8, c7, 0" : : "r" (zero)); | 275 | asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc"); |
276 | if (tlb_flag(TLB_V4_D_FULL)) | 276 | if (tlb_flag(TLB_V4_D_FULL)) |
277 | asm("mcr%? p15, 0, %0, c8, c6, 0" : : "r" (zero)); | 277 | asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc"); |
278 | if (tlb_flag(TLB_V4_I_FULL)) | 278 | if (tlb_flag(TLB_V4_I_FULL)) |
279 | asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); | 279 | asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); |
280 | } | 280 | } |
281 | 281 | ||
282 | if (tlb_flag(TLB_V6_U_ASID)) | 282 | if (tlb_flag(TLB_V6_U_ASID)) |
283 | asm("mcr%? p15, 0, %0, c8, c7, 2" : : "r" (asid)); | 283 | asm("mcr p15, 0, %0, c8, c7, 2" : : "r" (asid) : "cc"); |
284 | if (tlb_flag(TLB_V6_D_ASID)) | 284 | if (tlb_flag(TLB_V6_D_ASID)) |
285 | asm("mcr%? p15, 0, %0, c8, c6, 2" : : "r" (asid)); | 285 | asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc"); |
286 | if (tlb_flag(TLB_V6_I_ASID)) | 286 | if (tlb_flag(TLB_V6_I_ASID)) |
287 | asm("mcr%? p15, 0, %0, c8, c5, 2" : : "r" (asid)); | 287 | asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc"); |
288 | } | 288 | } |
289 | 289 | ||
290 | static inline void | 290 | static inline void |
@@ -296,27 +296,27 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | |||
296 | uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); | 296 | uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); |
297 | 297 | ||
298 | if (tlb_flag(TLB_WB)) | 298 | if (tlb_flag(TLB_WB)) |
299 | asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); | 299 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero)); |
300 | 300 | ||
301 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { | 301 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { |
302 | if (tlb_flag(TLB_V3_PAGE)) | 302 | if (tlb_flag(TLB_V3_PAGE)) |
303 | asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (uaddr)); | 303 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc"); |
304 | if (tlb_flag(TLB_V4_U_PAGE)) | 304 | if (tlb_flag(TLB_V4_U_PAGE)) |
305 | asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (uaddr)); | 305 | asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc"); |
306 | if (tlb_flag(TLB_V4_D_PAGE)) | 306 | if (tlb_flag(TLB_V4_D_PAGE)) |
307 | asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (uaddr)); | 307 | asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc"); |
308 | if (tlb_flag(TLB_V4_I_PAGE)) | 308 | if (tlb_flag(TLB_V4_I_PAGE)) |
309 | asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr)); | 309 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc"); |
310 | if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL)) | 310 | if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL)) |
311 | asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); | 311 | asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); |
312 | } | 312 | } |
313 | 313 | ||
314 | if (tlb_flag(TLB_V6_U_PAGE)) | 314 | if (tlb_flag(TLB_V6_U_PAGE)) |
315 | asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (uaddr)); | 315 | asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc"); |
316 | if (tlb_flag(TLB_V6_D_PAGE)) | 316 | if (tlb_flag(TLB_V6_D_PAGE)) |
317 | asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (uaddr)); | 317 | asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc"); |
318 | if (tlb_flag(TLB_V6_I_PAGE)) | 318 | if (tlb_flag(TLB_V6_I_PAGE)) |
319 | asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr)); | 319 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc"); |
320 | } | 320 | } |
321 | 321 | ||
322 | static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | 322 | static inline void local_flush_tlb_kernel_page(unsigned long kaddr) |
@@ -327,31 +327,31 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | |||
327 | kaddr &= PAGE_MASK; | 327 | kaddr &= PAGE_MASK; |
328 | 328 | ||
329 | if (tlb_flag(TLB_WB)) | 329 | if (tlb_flag(TLB_WB)) |
330 | asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); | 330 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); |
331 | 331 | ||
332 | if (tlb_flag(TLB_V3_PAGE)) | 332 | if (tlb_flag(TLB_V3_PAGE)) |
333 | asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (kaddr)); | 333 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc"); |
334 | if (tlb_flag(TLB_V4_U_PAGE)) | 334 | if (tlb_flag(TLB_V4_U_PAGE)) |
335 | asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (kaddr)); | 335 | asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc"); |
336 | if (tlb_flag(TLB_V4_D_PAGE)) | 336 | if (tlb_flag(TLB_V4_D_PAGE)) |
337 | asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr)); | 337 | asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc"); |
338 | if (tlb_flag(TLB_V4_I_PAGE)) | 338 | if (tlb_flag(TLB_V4_I_PAGE)) |
339 | asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr)); | 339 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc"); |
340 | if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL)) | 340 | if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL)) |
341 | asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); | 341 | asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); |
342 | 342 | ||
343 | if (tlb_flag(TLB_V6_U_PAGE)) | 343 | if (tlb_flag(TLB_V6_U_PAGE)) |
344 | asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (kaddr)); | 344 | asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc"); |
345 | if (tlb_flag(TLB_V6_D_PAGE)) | 345 | if (tlb_flag(TLB_V6_D_PAGE)) |
346 | asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr)); | 346 | asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc"); |
347 | if (tlb_flag(TLB_V6_I_PAGE)) | 347 | if (tlb_flag(TLB_V6_I_PAGE)) |
348 | asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr)); | 348 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc"); |
349 | 349 | ||
350 | /* The ARM ARM states that the completion of a TLB maintenance | 350 | /* The ARM ARM states that the completion of a TLB maintenance |
351 | * operation is only guaranteed by a DSB instruction | 351 | * operation is only guaranteed by a DSB instruction |
352 | */ | 352 | */ |
353 | if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE)) | 353 | if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE)) |
354 | asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); | 354 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); |
355 | } | 355 | } |
356 | 356 | ||
357 | /* | 357 | /* |
@@ -373,11 +373,11 @@ static inline void flush_pmd_entry(pmd_t *pmd) | |||
373 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 373 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
374 | 374 | ||
375 | if (tlb_flag(TLB_DCLEAN)) | 375 | if (tlb_flag(TLB_DCLEAN)) |
376 | asm("mcr%? p15, 0, %0, c7, c10, 1 @ flush_pmd" | 376 | asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd" |
377 | : : "r" (pmd)); | 377 | : : "r" (pmd) : "cc"); |
378 | if (tlb_flag(TLB_WB)) | 378 | if (tlb_flag(TLB_WB)) |
379 | asm("mcr%? p15, 0, %0, c7, c10, 4 @ flush_pmd" | 379 | asm("mcr p15, 0, %0, c7, c10, 4 @ flush_pmd" |
380 | : : "r" (zero)); | 380 | : : "r" (zero) : "cc"); |
381 | } | 381 | } |
382 | 382 | ||
383 | static inline void clean_pmd_entry(pmd_t *pmd) | 383 | static inline void clean_pmd_entry(pmd_t *pmd) |
@@ -385,8 +385,8 @@ static inline void clean_pmd_entry(pmd_t *pmd) | |||
385 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 385 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
386 | 386 | ||
387 | if (tlb_flag(TLB_DCLEAN)) | 387 | if (tlb_flag(TLB_DCLEAN)) |
388 | asm("mcr%? p15, 0, %0, c7, c10, 1 @ flush_pmd" | 388 | asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd" |
389 | : : "r" (pmd)); | 389 | : : "r" (pmd) : "cc"); |
390 | } | 390 | } |
391 | 391 | ||
392 | #undef tlb_flag | 392 | #undef tlb_flag |
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h index 1b39c2f322c9..795b9e5b9e6a 100644 --- a/include/asm-arm/unaligned.h +++ b/include/asm-arm/unaligned.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | 5 | ||
6 | extern int __bug_unaligned_x(void *ptr); | 6 | extern int __bug_unaligned_x(const void *ptr); |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * What is the most efficient way of loading/storing an unaligned value? | 9 | * What is the most efficient way of loading/storing an unaligned value? |
@@ -51,44 +51,32 @@ extern int __bug_unaligned_x(void *ptr); | |||
51 | #define __get_unaligned_4_be(__p) \ | 51 | #define __get_unaligned_4_be(__p) \ |
52 | (__p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3]) | 52 | (__p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3]) |
53 | 53 | ||
54 | #define __get_unaligned_le(ptr) \ | 54 | #define __get_unaligned_8_le(__p) \ |
55 | ({ \ | 55 | ((unsigned long long)__get_unaligned_4_le((__p+4)) << 32 | \ |
56 | __typeof__(*(ptr)) __v; \ | 56 | __get_unaligned_4_le(__p)) |
57 | __u8 *__p = (__u8 *)(ptr); \ | 57 | |
58 | switch (sizeof(*(ptr))) { \ | 58 | #define __get_unaligned_8_be(__p) \ |
59 | case 1: __v = *(ptr); break; \ | 59 | ((unsigned long long)__get_unaligned_4_be(__p) << 32 | \ |
60 | case 2: __v = __get_unaligned_2_le(__p); break; \ | 60 | __get_unaligned_4_be((__p+4))) |
61 | case 4: __v = __get_unaligned_4_le(__p); break; \ | 61 | |
62 | case 8: { \ | 62 | #define __get_unaligned_le(ptr) \ |
63 | unsigned int __v1, __v2; \ | 63 | ({ \ |
64 | __v2 = __get_unaligned_4_le((__p+4)); \ | 64 | const __u8 *__p = (const __u8 *)(ptr); \ |
65 | __v1 = __get_unaligned_4_le(__p); \ | 65 | __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \ |
66 | __v = ((unsigned long long)__v2 << 32 | __v1); \ | 66 | __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \ |
67 | } \ | 67 | __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \ |
68 | break; \ | 68 | __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \ |
69 | default: __v = __bug_unaligned_x(__p); break; \ | 69 | (void)__bug_unaligned_x(__p))))); \ |
70 | } \ | ||
71 | __v; \ | ||
72 | }) | 70 | }) |
73 | 71 | ||
74 | #define __get_unaligned_be(ptr) \ | 72 | #define __get_unaligned_be(ptr) \ |
75 | ({ \ | 73 | ({ \ |
76 | __typeof__(*(ptr)) __v; \ | 74 | const __u8 *__p = (const __u8 *)(ptr); \ |
77 | __u8 *__p = (__u8 *)(ptr); \ | 75 | __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \ |
78 | switch (sizeof(*(ptr))) { \ | 76 | __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \ |
79 | case 1: __v = *(ptr); break; \ | 77 | __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \ |
80 | case 2: __v = __get_unaligned_2_be(__p); break; \ | 78 | __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \ |
81 | case 4: __v = __get_unaligned_4_be(__p); break; \ | 79 | (void)__bug_unaligned_x(__p))))); \ |
82 | case 8: { \ | ||
83 | unsigned int __v1, __v2; \ | ||
84 | __v2 = __get_unaligned_4_be(__p); \ | ||
85 | __v1 = __get_unaligned_4_be((__p+4)); \ | ||
86 | __v = ((unsigned long long)__v2 << 32 | __v1); \ | ||
87 | } \ | ||
88 | break; \ | ||
89 | default: __v = __bug_unaligned_x(__p); break; \ | ||
90 | } \ | ||
91 | __v; \ | ||
92 | }) | 80 | }) |
93 | 81 | ||
94 | 82 | ||
diff --git a/include/asm-s390/appldata.h b/include/asm-s390/appldata.h index b1770703b706..79283dac8281 100644 --- a/include/asm-s390/appldata.h +++ b/include/asm-s390/appldata.h | |||
@@ -80,7 +80,7 @@ static inline int appldata_asm(struct appldata_product_id *id, | |||
80 | parm_list.product_id_addr = (unsigned long) id; | 80 | parm_list.product_id_addr = (unsigned long) id; |
81 | parm_list.buffer_addr = virt_to_phys(buffer); | 81 | parm_list.buffer_addr = virt_to_phys(buffer); |
82 | asm volatile( | 82 | asm volatile( |
83 | "diag %1,%0,0xdc" | 83 | " diag %1,%0,0xdc" |
84 | : "=d" (ry) | 84 | : "=d" (ry) |
85 | : "d" (&parm_list), "m" (parm_list), "m" (*id) | 85 | : "d" (&parm_list), "m" (parm_list), "m" (*id) |
86 | : "cc"); | 86 | : "cc"); |
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index 399bf02894dd..af20c7462485 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h | |||
@@ -30,20 +30,43 @@ typedef struct { | |||
30 | 30 | ||
31 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
32 | 32 | ||
33 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) | ||
34 | |||
33 | #define __CS_LOOP(ptr, op_val, op_string) ({ \ | 35 | #define __CS_LOOP(ptr, op_val, op_string) ({ \ |
34 | typeof(ptr->counter) old_val, new_val; \ | 36 | typeof(ptr->counter) old_val, new_val; \ |
35 | __asm__ __volatile__(" l %0,0(%3)\n" \ | 37 | asm volatile( \ |
36 | "0: lr %1,%0\n" \ | 38 | " l %0,%2\n" \ |
37 | op_string " %1,%4\n" \ | 39 | "0: lr %1,%0\n" \ |
38 | " cs %0,%1,0(%3)\n" \ | 40 | op_string " %1,%3\n" \ |
39 | " jl 0b" \ | 41 | " cs %0,%1,%2\n" \ |
40 | : "=&d" (old_val), "=&d" (new_val), \ | 42 | " jl 0b" \ |
41 | "=m" (((atomic_t *)(ptr))->counter) \ | 43 | : "=&d" (old_val), "=&d" (new_val), \ |
42 | : "a" (ptr), "d" (op_val), \ | 44 | "=Q" (((atomic_t *)(ptr))->counter) \ |
43 | "m" (((atomic_t *)(ptr))->counter) \ | 45 | : "d" (op_val), "Q" (((atomic_t *)(ptr))->counter) \ |
44 | : "cc", "memory" ); \ | 46 | : "cc", "memory"); \ |
45 | new_val; \ | 47 | new_val; \ |
46 | }) | 48 | }) |
49 | |||
50 | #else /* __GNUC__ */ | ||
51 | |||
52 | #define __CS_LOOP(ptr, op_val, op_string) ({ \ | ||
53 | typeof(ptr->counter) old_val, new_val; \ | ||
54 | asm volatile( \ | ||
55 | " l %0,0(%3)\n" \ | ||
56 | "0: lr %1,%0\n" \ | ||
57 | op_string " %1,%4\n" \ | ||
58 | " cs %0,%1,0(%3)\n" \ | ||
59 | " jl 0b" \ | ||
60 | : "=&d" (old_val), "=&d" (new_val), \ | ||
61 | "=m" (((atomic_t *)(ptr))->counter) \ | ||
62 | : "a" (ptr), "d" (op_val), \ | ||
63 | "m" (((atomic_t *)(ptr))->counter) \ | ||
64 | : "cc", "memory"); \ | ||
65 | new_val; \ | ||
66 | }) | ||
67 | |||
68 | #endif /* __GNUC__ */ | ||
69 | |||
47 | #define atomic_read(v) ((v)->counter) | 70 | #define atomic_read(v) ((v)->counter) |
48 | #define atomic_set(v,i) (((v)->counter) = (i)) | 71 | #define atomic_set(v,i) (((v)->counter) = (i)) |
49 | 72 | ||
@@ -81,10 +104,19 @@ static __inline__ void atomic_set_mask(unsigned long mask, atomic_t * v) | |||
81 | 104 | ||
82 | static __inline__ int atomic_cmpxchg(atomic_t *v, int old, int new) | 105 | static __inline__ int atomic_cmpxchg(atomic_t *v, int old, int new) |
83 | { | 106 | { |
84 | __asm__ __volatile__(" cs %0,%3,0(%2)\n" | 107 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
85 | : "+d" (old), "=m" (v->counter) | 108 | asm volatile( |
86 | : "a" (v), "d" (new), "m" (v->counter) | 109 | " cs %0,%2,%1" |
87 | : "cc", "memory" ); | 110 | : "+d" (old), "=Q" (v->counter) |
111 | : "d" (new), "Q" (v->counter) | ||
112 | : "cc", "memory"); | ||
113 | #else /* __GNUC__ */ | ||
114 | asm volatile( | ||
115 | " cs %0,%3,0(%2)" | ||
116 | : "+d" (old), "=m" (v->counter) | ||
117 | : "a" (v), "d" (new), "m" (v->counter) | ||
118 | : "cc", "memory"); | ||
119 | #endif /* __GNUC__ */ | ||
88 | return old; | 120 | return old; |
89 | } | 121 | } |
90 | 122 | ||
@@ -113,20 +145,43 @@ typedef struct { | |||
113 | } __attribute__ ((aligned (8))) atomic64_t; | 145 | } __attribute__ ((aligned (8))) atomic64_t; |
114 | #define ATOMIC64_INIT(i) { (i) } | 146 | #define ATOMIC64_INIT(i) { (i) } |
115 | 147 | ||
148 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) | ||
149 | |||
116 | #define __CSG_LOOP(ptr, op_val, op_string) ({ \ | 150 | #define __CSG_LOOP(ptr, op_val, op_string) ({ \ |
117 | typeof(ptr->counter) old_val, new_val; \ | 151 | typeof(ptr->counter) old_val, new_val; \ |
118 | __asm__ __volatile__(" lg %0,0(%3)\n" \ | 152 | asm volatile( \ |
119 | "0: lgr %1,%0\n" \ | 153 | " lg %0,%2\n" \ |
120 | op_string " %1,%4\n" \ | 154 | "0: lgr %1,%0\n" \ |
121 | " csg %0,%1,0(%3)\n" \ | 155 | op_string " %1,%3\n" \ |
122 | " jl 0b" \ | 156 | " csg %0,%1,%2\n" \ |
123 | : "=&d" (old_val), "=&d" (new_val), \ | 157 | " jl 0b" \ |
124 | "=m" (((atomic_t *)(ptr))->counter) \ | 158 | : "=&d" (old_val), "=&d" (new_val), \ |
125 | : "a" (ptr), "d" (op_val), \ | 159 | "=Q" (((atomic_t *)(ptr))->counter) \ |
126 | "m" (((atomic_t *)(ptr))->counter) \ | 160 | : "d" (op_val), "Q" (((atomic_t *)(ptr))->counter) \ |
127 | : "cc", "memory" ); \ | 161 | : "cc", "memory" ); \ |
128 | new_val; \ | 162 | new_val; \ |
129 | }) | 163 | }) |
164 | |||
165 | #else /* __GNUC__ */ | ||
166 | |||
167 | #define __CSG_LOOP(ptr, op_val, op_string) ({ \ | ||
168 | typeof(ptr->counter) old_val, new_val; \ | ||
169 | asm volatile( \ | ||
170 | " lg %0,0(%3)\n" \ | ||
171 | "0: lgr %1,%0\n" \ | ||
172 | op_string " %1,%4\n" \ | ||
173 | " csg %0,%1,0(%3)\n" \ | ||
174 | " jl 0b" \ | ||
175 | : "=&d" (old_val), "=&d" (new_val), \ | ||
176 | "=m" (((atomic_t *)(ptr))->counter) \ | ||
177 | : "a" (ptr), "d" (op_val), \ | ||
178 | "m" (((atomic_t *)(ptr))->counter) \ | ||
179 | : "cc", "memory" ); \ | ||
180 | new_val; \ | ||
181 | }) | ||
182 | |||
183 | #endif /* __GNUC__ */ | ||
184 | |||
130 | #define atomic64_read(v) ((v)->counter) | 185 | #define atomic64_read(v) ((v)->counter) |
131 | #define atomic64_set(v,i) (((v)->counter) = (i)) | 186 | #define atomic64_set(v,i) (((v)->counter) = (i)) |
132 | 187 | ||
@@ -163,10 +218,19 @@ static __inline__ void atomic64_set_mask(unsigned long mask, atomic64_t * v) | |||
163 | static __inline__ long long atomic64_cmpxchg(atomic64_t *v, | 218 | static __inline__ long long atomic64_cmpxchg(atomic64_t *v, |
164 | long long old, long long new) | 219 | long long old, long long new) |
165 | { | 220 | { |
166 | __asm__ __volatile__(" csg %0,%3,0(%2)\n" | 221 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
167 | : "+d" (old), "=m" (v->counter) | 222 | asm volatile( |
168 | : "a" (v), "d" (new), "m" (v->counter) | 223 | " csg %0,%2,%1" |
169 | : "cc", "memory" ); | 224 | : "+d" (old), "=Q" (v->counter) |
225 | : "d" (new), "Q" (v->counter) | ||
226 | : "cc", "memory"); | ||
227 | #else /* __GNUC__ */ | ||
228 | asm volatile( | ||
229 | " csg %0,%3,0(%2)" | ||
230 | : "+d" (old), "=m" (v->counter) | ||
231 | : "a" (v), "d" (new), "m" (v->counter) | ||
232 | : "cc", "memory"); | ||
233 | #endif /* __GNUC__ */ | ||
170 | return old; | 234 | return old; |
171 | } | 235 | } |
172 | 236 | ||
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index 0ddcdba79e4a..f79c9b792af1 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h | |||
@@ -67,16 +67,35 @@ extern const char _sb_findmap[]; | |||
67 | #define __BITOPS_AND "nr" | 67 | #define __BITOPS_AND "nr" |
68 | #define __BITOPS_XOR "xr" | 68 | #define __BITOPS_XOR "xr" |
69 | 69 | ||
70 | #define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ | 70 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
71 | __asm__ __volatile__(" l %0,0(%4)\n" \ | 71 | |
72 | "0: lr %1,%0\n" \ | 72 | #define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ |
73 | __op_string " %1,%3\n" \ | 73 | asm volatile( \ |
74 | " cs %0,%1,0(%4)\n" \ | 74 | " l %0,%2\n" \ |
75 | " jl 0b" \ | 75 | "0: lr %1,%0\n" \ |
76 | : "=&d" (__old), "=&d" (__new), \ | 76 | __op_string " %1,%3\n" \ |
77 | "=m" (*(unsigned long *) __addr) \ | 77 | " cs %0,%1,%2\n" \ |
78 | : "d" (__val), "a" (__addr), \ | 78 | " jl 0b" \ |
79 | "m" (*(unsigned long *) __addr) : "cc" ); | 79 | : "=&d" (__old), "=&d" (__new), \ |
80 | "=Q" (*(unsigned long *) __addr) \ | ||
81 | : "d" (__val), "Q" (*(unsigned long *) __addr) \ | ||
82 | : "cc"); | ||
83 | |||
84 | #else /* __GNUC__ */ | ||
85 | |||
86 | #define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ | ||
87 | asm volatile( \ | ||
88 | " l %0,0(%4)\n" \ | ||
89 | "0: lr %1,%0\n" \ | ||
90 | __op_string " %1,%3\n" \ | ||
91 | " cs %0,%1,0(%4)\n" \ | ||
92 | " jl 0b" \ | ||
93 | : "=&d" (__old), "=&d" (__new), \ | ||
94 | "=m" (*(unsigned long *) __addr) \ | ||
95 | : "d" (__val), "a" (__addr), \ | ||
96 | "m" (*(unsigned long *) __addr) : "cc"); | ||
97 | |||
98 | #endif /* __GNUC__ */ | ||
80 | 99 | ||
81 | #else /* __s390x__ */ | 100 | #else /* __s390x__ */ |
82 | 101 | ||
@@ -86,21 +105,41 @@ extern const char _sb_findmap[]; | |||
86 | #define __BITOPS_AND "ngr" | 105 | #define __BITOPS_AND "ngr" |
87 | #define __BITOPS_XOR "xgr" | 106 | #define __BITOPS_XOR "xgr" |
88 | 107 | ||
89 | #define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ | 108 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
90 | __asm__ __volatile__(" lg %0,0(%4)\n" \ | 109 | |
91 | "0: lgr %1,%0\n" \ | 110 | #define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ |
92 | __op_string " %1,%3\n" \ | 111 | asm volatile( \ |
93 | " csg %0,%1,0(%4)\n" \ | 112 | " lg %0,%2\n" \ |
94 | " jl 0b" \ | 113 | "0: lgr %1,%0\n" \ |
95 | : "=&d" (__old), "=&d" (__new), \ | 114 | __op_string " %1,%3\n" \ |
96 | "=m" (*(unsigned long *) __addr) \ | 115 | " csg %0,%1,%2\n" \ |
97 | : "d" (__val), "a" (__addr), \ | 116 | " jl 0b" \ |
98 | "m" (*(unsigned long *) __addr) : "cc" ); | 117 | : "=&d" (__old), "=&d" (__new), \ |
118 | "=Q" (*(unsigned long *) __addr) \ | ||
119 | : "d" (__val), "Q" (*(unsigned long *) __addr) \ | ||
120 | : "cc"); | ||
121 | |||
122 | #else /* __GNUC__ */ | ||
123 | |||
124 | #define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ | ||
125 | asm volatile( \ | ||
126 | " lg %0,0(%4)\n" \ | ||
127 | "0: lgr %1,%0\n" \ | ||
128 | __op_string " %1,%3\n" \ | ||
129 | " csg %0,%1,0(%4)\n" \ | ||
130 | " jl 0b" \ | ||
131 | : "=&d" (__old), "=&d" (__new), \ | ||
132 | "=m" (*(unsigned long *) __addr) \ | ||
133 | : "d" (__val), "a" (__addr), \ | ||
134 | "m" (*(unsigned long *) __addr) : "cc"); | ||
135 | |||
136 | |||
137 | #endif /* __GNUC__ */ | ||
99 | 138 | ||
100 | #endif /* __s390x__ */ | 139 | #endif /* __s390x__ */ |
101 | 140 | ||
102 | #define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) | 141 | #define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) |
103 | #define __BITOPS_BARRIER() __asm__ __volatile__ ( "" : : : "memory" ) | 142 | #define __BITOPS_BARRIER() asm volatile("" : : : "memory") |
104 | 143 | ||
105 | #ifdef CONFIG_SMP | 144 | #ifdef CONFIG_SMP |
106 | /* | 145 | /* |
@@ -217,10 +256,10 @@ static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr) | |||
217 | unsigned long addr; | 256 | unsigned long addr; |
218 | 257 | ||
219 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 258 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
220 | asm volatile("oc 0(1,%1),0(%2)" | 259 | asm volatile( |
221 | : "=m" (*(char *) addr) | 260 | " oc 0(1,%1),0(%2)" |
222 | : "a" (addr), "a" (_oi_bitmap + (nr & 7)), | 261 | : "=m" (*(char *) addr) : "a" (addr), |
223 | "m" (*(char *) addr) : "cc" ); | 262 | "a" (_oi_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc" ); |
224 | } | 263 | } |
225 | 264 | ||
226 | static inline void | 265 | static inline void |
@@ -229,40 +268,7 @@ __constant_set_bit(const unsigned long nr, volatile unsigned long *ptr) | |||
229 | unsigned long addr; | 268 | unsigned long addr; |
230 | 269 | ||
231 | addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 270 | addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
232 | switch (nr&7) { | 271 | *(unsigned char *) addr |= 1 << (nr & 7); |
233 | case 0: | ||
234 | asm volatile ("oi 0(%1),0x01" : "=m" (*(char *) addr) | ||
235 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
236 | break; | ||
237 | case 1: | ||
238 | asm volatile ("oi 0(%1),0x02" : "=m" (*(char *) addr) | ||
239 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
240 | break; | ||
241 | case 2: | ||
242 | asm volatile ("oi 0(%1),0x04" : "=m" (*(char *) addr) | ||
243 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
244 | break; | ||
245 | case 3: | ||
246 | asm volatile ("oi 0(%1),0x08" : "=m" (*(char *) addr) | ||
247 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
248 | break; | ||
249 | case 4: | ||
250 | asm volatile ("oi 0(%1),0x10" : "=m" (*(char *) addr) | ||
251 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
252 | break; | ||
253 | case 5: | ||
254 | asm volatile ("oi 0(%1),0x20" : "=m" (*(char *) addr) | ||
255 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
256 | break; | ||
257 | case 6: | ||
258 | asm volatile ("oi 0(%1),0x40" : "=m" (*(char *) addr) | ||
259 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
260 | break; | ||
261 | case 7: | ||
262 | asm volatile ("oi 0(%1),0x80" : "=m" (*(char *) addr) | ||
263 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
264 | break; | ||
265 | } | ||
266 | } | 272 | } |
267 | 273 | ||
268 | #define set_bit_simple(nr,addr) \ | 274 | #define set_bit_simple(nr,addr) \ |
@@ -279,10 +285,10 @@ __clear_bit(unsigned long nr, volatile unsigned long *ptr) | |||
279 | unsigned long addr; | 285 | unsigned long addr; |
280 | 286 | ||
281 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 287 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
282 | asm volatile("nc 0(1,%1),0(%2)" | 288 | asm volatile( |
283 | : "=m" (*(char *) addr) | 289 | " nc 0(1,%1),0(%2)" |
284 | : "a" (addr), "a" (_ni_bitmap + (nr & 7)), | 290 | : "=m" (*(char *) addr) : "a" (addr), |
285 | "m" (*(char *) addr) : "cc" ); | 291 | "a" (_ni_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc"); |
286 | } | 292 | } |
287 | 293 | ||
288 | static inline void | 294 | static inline void |
@@ -291,40 +297,7 @@ __constant_clear_bit(const unsigned long nr, volatile unsigned long *ptr) | |||
291 | unsigned long addr; | 297 | unsigned long addr; |
292 | 298 | ||
293 | addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 299 | addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
294 | switch (nr&7) { | 300 | *(unsigned char *) addr &= ~(1 << (nr & 7)); |
295 | case 0: | ||
296 | asm volatile ("ni 0(%1),0xFE" : "=m" (*(char *) addr) | ||
297 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
298 | break; | ||
299 | case 1: | ||
300 | asm volatile ("ni 0(%1),0xFD": "=m" (*(char *) addr) | ||
301 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
302 | break; | ||
303 | case 2: | ||
304 | asm volatile ("ni 0(%1),0xFB" : "=m" (*(char *) addr) | ||
305 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
306 | break; | ||
307 | case 3: | ||
308 | asm volatile ("ni 0(%1),0xF7" : "=m" (*(char *) addr) | ||
309 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
310 | break; | ||
311 | case 4: | ||
312 | asm volatile ("ni 0(%1),0xEF" : "=m" (*(char *) addr) | ||
313 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
314 | break; | ||
315 | case 5: | ||
316 | asm volatile ("ni 0(%1),0xDF" : "=m" (*(char *) addr) | ||
317 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
318 | break; | ||
319 | case 6: | ||
320 | asm volatile ("ni 0(%1),0xBF" : "=m" (*(char *) addr) | ||
321 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
322 | break; | ||
323 | case 7: | ||
324 | asm volatile ("ni 0(%1),0x7F" : "=m" (*(char *) addr) | ||
325 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
326 | break; | ||
327 | } | ||
328 | } | 301 | } |
329 | 302 | ||
330 | #define clear_bit_simple(nr,addr) \ | 303 | #define clear_bit_simple(nr,addr) \ |
@@ -340,10 +313,10 @@ static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr) | |||
340 | unsigned long addr; | 313 | unsigned long addr; |
341 | 314 | ||
342 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 315 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
343 | asm volatile("xc 0(1,%1),0(%2)" | 316 | asm volatile( |
344 | : "=m" (*(char *) addr) | 317 | " xc 0(1,%1),0(%2)" |
345 | : "a" (addr), "a" (_oi_bitmap + (nr & 7)), | 318 | : "=m" (*(char *) addr) : "a" (addr), |
346 | "m" (*(char *) addr) : "cc" ); | 319 | "a" (_oi_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc" ); |
347 | } | 320 | } |
348 | 321 | ||
349 | static inline void | 322 | static inline void |
@@ -352,40 +325,7 @@ __constant_change_bit(const unsigned long nr, volatile unsigned long *ptr) | |||
352 | unsigned long addr; | 325 | unsigned long addr; |
353 | 326 | ||
354 | addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 327 | addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
355 | switch (nr&7) { | 328 | *(unsigned char *) addr ^= 1 << (nr & 7); |
356 | case 0: | ||
357 | asm volatile ("xi 0(%1),0x01" : "=m" (*(char *) addr) | ||
358 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
359 | break; | ||
360 | case 1: | ||
361 | asm volatile ("xi 0(%1),0x02" : "=m" (*(char *) addr) | ||
362 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
363 | break; | ||
364 | case 2: | ||
365 | asm volatile ("xi 0(%1),0x04" : "=m" (*(char *) addr) | ||
366 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
367 | break; | ||
368 | case 3: | ||
369 | asm volatile ("xi 0(%1),0x08" : "=m" (*(char *) addr) | ||
370 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
371 | break; | ||
372 | case 4: | ||
373 | asm volatile ("xi 0(%1),0x10" : "=m" (*(char *) addr) | ||
374 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
375 | break; | ||
376 | case 5: | ||
377 | asm volatile ("xi 0(%1),0x20" : "=m" (*(char *) addr) | ||
378 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
379 | break; | ||
380 | case 6: | ||
381 | asm volatile ("xi 0(%1),0x40" : "=m" (*(char *) addr) | ||
382 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
383 | break; | ||
384 | case 7: | ||
385 | asm volatile ("xi 0(%1),0x80" : "=m" (*(char *) addr) | ||
386 | : "a" (addr), "m" (*(char *) addr) : "cc" ); | ||
387 | break; | ||
388 | } | ||
389 | } | 329 | } |
390 | 330 | ||
391 | #define change_bit_simple(nr,addr) \ | 331 | #define change_bit_simple(nr,addr) \ |
@@ -404,10 +344,11 @@ test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr) | |||
404 | 344 | ||
405 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 345 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
406 | ch = *(unsigned char *) addr; | 346 | ch = *(unsigned char *) addr; |
407 | asm volatile("oc 0(1,%1),0(%2)" | 347 | asm volatile( |
408 | : "=m" (*(char *) addr) | 348 | " oc 0(1,%1),0(%2)" |
409 | : "a" (addr), "a" (_oi_bitmap + (nr & 7)), | 349 | : "=m" (*(char *) addr) |
410 | "m" (*(char *) addr) : "cc", "memory" ); | 350 | : "a" (addr), "a" (_oi_bitmap + (nr & 7)), |
351 | "m" (*(char *) addr) : "cc", "memory"); | ||
411 | return (ch >> (nr & 7)) & 1; | 352 | return (ch >> (nr & 7)) & 1; |
412 | } | 353 | } |
413 | #define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y) | 354 | #define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y) |
@@ -423,10 +364,11 @@ test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr) | |||
423 | 364 | ||
424 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 365 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
425 | ch = *(unsigned char *) addr; | 366 | ch = *(unsigned char *) addr; |
426 | asm volatile("nc 0(1,%1),0(%2)" | 367 | asm volatile( |
427 | : "=m" (*(char *) addr) | 368 | " nc 0(1,%1),0(%2)" |
428 | : "a" (addr), "a" (_ni_bitmap + (nr & 7)), | 369 | : "=m" (*(char *) addr) |
429 | "m" (*(char *) addr) : "cc", "memory" ); | 370 | : "a" (addr), "a" (_ni_bitmap + (nr & 7)), |
371 | "m" (*(char *) addr) : "cc", "memory"); | ||
430 | return (ch >> (nr & 7)) & 1; | 372 | return (ch >> (nr & 7)) & 1; |
431 | } | 373 | } |
432 | #define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y) | 374 | #define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y) |
@@ -442,10 +384,11 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr) | |||
442 | 384 | ||
443 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); | 385 | addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); |
444 | ch = *(unsigned char *) addr; | 386 | ch = *(unsigned char *) addr; |
445 | asm volatile("xc 0(1,%1),0(%2)" | 387 | asm volatile( |
446 | : "=m" (*(char *) addr) | 388 | " xc 0(1,%1),0(%2)" |
447 | : "a" (addr), "a" (_oi_bitmap + (nr & 7)), | 389 | : "=m" (*(char *) addr) |
448 | "m" (*(char *) addr) : "cc", "memory" ); | 390 | : "a" (addr), "a" (_oi_bitmap + (nr & 7)), |
391 | "m" (*(char *) addr) : "cc", "memory"); | ||
449 | return (ch >> (nr & 7)) & 1; | 392 | return (ch >> (nr & 7)) & 1; |
450 | } | 393 | } |
451 | #define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y) | 394 | #define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y) |
@@ -557,35 +500,36 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size) | |||
557 | 500 | ||
558 | if (!size) | 501 | if (!size) |
559 | return 0; | 502 | return 0; |
560 | __asm__(" lhi %1,-1\n" | 503 | asm volatile( |
561 | " lr %2,%3\n" | 504 | " lhi %1,-1\n" |
562 | " slr %0,%0\n" | 505 | " lr %2,%3\n" |
563 | " ahi %2,31\n" | 506 | " slr %0,%0\n" |
564 | " srl %2,5\n" | 507 | " ahi %2,31\n" |
565 | "0: c %1,0(%0,%4)\n" | 508 | " srl %2,5\n" |
566 | " jne 1f\n" | 509 | "0: c %1,0(%0,%4)\n" |
567 | " la %0,4(%0)\n" | 510 | " jne 1f\n" |
568 | " brct %2,0b\n" | 511 | " la %0,4(%0)\n" |
569 | " lr %0,%3\n" | 512 | " brct %2,0b\n" |
570 | " j 4f\n" | 513 | " lr %0,%3\n" |
571 | "1: l %2,0(%0,%4)\n" | 514 | " j 4f\n" |
572 | " sll %0,3\n" | 515 | "1: l %2,0(%0,%4)\n" |
573 | " lhi %1,0xff\n" | 516 | " sll %0,3\n" |
574 | " tml %2,0xffff\n" | 517 | " lhi %1,0xff\n" |
575 | " jno 2f\n" | 518 | " tml %2,0xffff\n" |
576 | " ahi %0,16\n" | 519 | " jno 2f\n" |
577 | " srl %2,16\n" | 520 | " ahi %0,16\n" |
578 | "2: tml %2,0x00ff\n" | 521 | " srl %2,16\n" |
579 | " jno 3f\n" | 522 | "2: tml %2,0x00ff\n" |
580 | " ahi %0,8\n" | 523 | " jno 3f\n" |
581 | " srl %2,8\n" | 524 | " ahi %0,8\n" |
582 | "3: nr %2,%1\n" | 525 | " srl %2,8\n" |
583 | " ic %2,0(%2,%5)\n" | 526 | "3: nr %2,%1\n" |
584 | " alr %0,%2\n" | 527 | " ic %2,0(%2,%5)\n" |
585 | "4:" | 528 | " alr %0,%2\n" |
586 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | 529 | "4:" |
587 | : "a" (size), "a" (addr), "a" (&_zb_findmap), | 530 | : "=&a" (res), "=&d" (cmp), "=&a" (count) |
588 | "m" (*(addrtype *) addr) : "cc" ); | 531 | : "a" (size), "a" (addr), "a" (&_zb_findmap), |
532 | "m" (*(addrtype *) addr) : "cc"); | ||
589 | return (res < size) ? res : size; | 533 | return (res < size) ? res : size; |
590 | } | 534 | } |
591 | 535 | ||
@@ -598,35 +542,36 @@ find_first_bit(const unsigned long * addr, unsigned long size) | |||
598 | 542 | ||
599 | if (!size) | 543 | if (!size) |
600 | return 0; | 544 | return 0; |
601 | __asm__(" slr %1,%1\n" | 545 | asm volatile( |
602 | " lr %2,%3\n" | 546 | " slr %1,%1\n" |
603 | " slr %0,%0\n" | 547 | " lr %2,%3\n" |
604 | " ahi %2,31\n" | 548 | " slr %0,%0\n" |
605 | " srl %2,5\n" | 549 | " ahi %2,31\n" |
606 | "0: c %1,0(%0,%4)\n" | 550 | " srl %2,5\n" |
607 | " jne 1f\n" | 551 | "0: c %1,0(%0,%4)\n" |
608 | " la %0,4(%0)\n" | 552 | " jne 1f\n" |
609 | " brct %2,0b\n" | 553 | " la %0,4(%0)\n" |
610 | " lr %0,%3\n" | 554 | " brct %2,0b\n" |
611 | " j 4f\n" | 555 | " lr %0,%3\n" |
612 | "1: l %2,0(%0,%4)\n" | 556 | " j 4f\n" |
613 | " sll %0,3\n" | 557 | "1: l %2,0(%0,%4)\n" |
614 | " lhi %1,0xff\n" | 558 | " sll %0,3\n" |
615 | " tml %2,0xffff\n" | 559 | " lhi %1,0xff\n" |
616 | " jnz 2f\n" | 560 | " tml %2,0xffff\n" |
617 | " ahi %0,16\n" | 561 | " jnz 2f\n" |
618 | " srl %2,16\n" | 562 | " ahi %0,16\n" |
619 | "2: tml %2,0x00ff\n" | 563 | " srl %2,16\n" |
620 | " jnz 3f\n" | 564 | "2: tml %2,0x00ff\n" |
621 | " ahi %0,8\n" | 565 | " jnz 3f\n" |
622 | " srl %2,8\n" | 566 | " ahi %0,8\n" |
623 | "3: nr %2,%1\n" | 567 | " srl %2,8\n" |
624 | " ic %2,0(%2,%5)\n" | 568 | "3: nr %2,%1\n" |
625 | " alr %0,%2\n" | 569 | " ic %2,0(%2,%5)\n" |
626 | "4:" | 570 | " alr %0,%2\n" |
627 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | 571 | "4:" |
628 | : "a" (size), "a" (addr), "a" (&_sb_findmap), | 572 | : "=&a" (res), "=&d" (cmp), "=&a" (count) |
629 | "m" (*(addrtype *) addr) : "cc" ); | 573 | : "a" (size), "a" (addr), "a" (&_sb_findmap), |
574 | "m" (*(addrtype *) addr) : "cc"); | ||
630 | return (res < size) ? res : size; | 575 | return (res < size) ? res : size; |
631 | } | 576 | } |
632 | 577 | ||
@@ -640,39 +585,40 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size) | |||
640 | 585 | ||
641 | if (!size) | 586 | if (!size) |
642 | return 0; | 587 | return 0; |
643 | __asm__(" lghi %1,-1\n" | 588 | asm volatile( |
644 | " lgr %2,%3\n" | 589 | " lghi %1,-1\n" |
645 | " slgr %0,%0\n" | 590 | " lgr %2,%3\n" |
646 | " aghi %2,63\n" | 591 | " slgr %0,%0\n" |
647 | " srlg %2,%2,6\n" | 592 | " aghi %2,63\n" |
648 | "0: cg %1,0(%0,%4)\n" | 593 | " srlg %2,%2,6\n" |
649 | " jne 1f\n" | 594 | "0: cg %1,0(%0,%4)\n" |
650 | " la %0,8(%0)\n" | 595 | " jne 1f\n" |
651 | " brct %2,0b\n" | 596 | " la %0,8(%0)\n" |
652 | " lgr %0,%3\n" | 597 | " brct %2,0b\n" |
653 | " j 5f\n" | 598 | " lgr %0,%3\n" |
654 | "1: lg %2,0(%0,%4)\n" | 599 | " j 5f\n" |
655 | " sllg %0,%0,3\n" | 600 | "1: lg %2,0(%0,%4)\n" |
656 | " clr %2,%1\n" | 601 | " sllg %0,%0,3\n" |
657 | " jne 2f\n" | 602 | " clr %2,%1\n" |
658 | " aghi %0,32\n" | 603 | " jne 2f\n" |
659 | " srlg %2,%2,32\n" | 604 | " aghi %0,32\n" |
660 | "2: lghi %1,0xff\n" | 605 | " srlg %2,%2,32\n" |
661 | " tmll %2,0xffff\n" | 606 | "2: lghi %1,0xff\n" |
662 | " jno 3f\n" | 607 | " tmll %2,0xffff\n" |
663 | " aghi %0,16\n" | 608 | " jno 3f\n" |
664 | " srl %2,16\n" | 609 | " aghi %0,16\n" |
665 | "3: tmll %2,0x00ff\n" | 610 | " srl %2,16\n" |
666 | " jno 4f\n" | 611 | "3: tmll %2,0x00ff\n" |
667 | " aghi %0,8\n" | 612 | " jno 4f\n" |
668 | " srl %2,8\n" | 613 | " aghi %0,8\n" |
669 | "4: ngr %2,%1\n" | 614 | " srl %2,8\n" |
670 | " ic %2,0(%2,%5)\n" | 615 | "4: ngr %2,%1\n" |
671 | " algr %0,%2\n" | 616 | " ic %2,0(%2,%5)\n" |
672 | "5:" | 617 | " algr %0,%2\n" |
673 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | 618 | "5:" |
619 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
674 | : "a" (size), "a" (addr), "a" (&_zb_findmap), | 620 | : "a" (size), "a" (addr), "a" (&_zb_findmap), |
675 | "m" (*(addrtype *) addr) : "cc" ); | 621 | "m" (*(addrtype *) addr) : "cc"); |
676 | return (res < size) ? res : size; | 622 | return (res < size) ? res : size; |
677 | } | 623 | } |
678 | 624 | ||
@@ -684,39 +630,40 @@ find_first_bit(const unsigned long * addr, unsigned long size) | |||
684 | 630 | ||
685 | if (!size) | 631 | if (!size) |
686 | return 0; | 632 | return 0; |
687 | __asm__(" slgr %1,%1\n" | 633 | asm volatile( |
688 | " lgr %2,%3\n" | 634 | " slgr %1,%1\n" |
689 | " slgr %0,%0\n" | 635 | " lgr %2,%3\n" |
690 | " aghi %2,63\n" | 636 | " slgr %0,%0\n" |
691 | " srlg %2,%2,6\n" | 637 | " aghi %2,63\n" |
692 | "0: cg %1,0(%0,%4)\n" | 638 | " srlg %2,%2,6\n" |
693 | " jne 1f\n" | 639 | "0: cg %1,0(%0,%4)\n" |
694 | " aghi %0,8\n" | 640 | " jne 1f\n" |
695 | " brct %2,0b\n" | 641 | " aghi %0,8\n" |
696 | " lgr %0,%3\n" | 642 | " brct %2,0b\n" |
697 | " j 5f\n" | 643 | " lgr %0,%3\n" |
698 | "1: lg %2,0(%0,%4)\n" | 644 | " j 5f\n" |
699 | " sllg %0,%0,3\n" | 645 | "1: lg %2,0(%0,%4)\n" |
700 | " clr %2,%1\n" | 646 | " sllg %0,%0,3\n" |
701 | " jne 2f\n" | 647 | " clr %2,%1\n" |
702 | " aghi %0,32\n" | 648 | " jne 2f\n" |
703 | " srlg %2,%2,32\n" | 649 | " aghi %0,32\n" |
704 | "2: lghi %1,0xff\n" | 650 | " srlg %2,%2,32\n" |
705 | " tmll %2,0xffff\n" | 651 | "2: lghi %1,0xff\n" |
706 | " jnz 3f\n" | 652 | " tmll %2,0xffff\n" |
707 | " aghi %0,16\n" | 653 | " jnz 3f\n" |
708 | " srl %2,16\n" | 654 | " aghi %0,16\n" |
709 | "3: tmll %2,0x00ff\n" | 655 | " srl %2,16\n" |
710 | " jnz 4f\n" | 656 | "3: tmll %2,0x00ff\n" |
711 | " aghi %0,8\n" | 657 | " jnz 4f\n" |
712 | " srl %2,8\n" | 658 | " aghi %0,8\n" |
713 | "4: ngr %2,%1\n" | 659 | " srl %2,8\n" |
714 | " ic %2,0(%2,%5)\n" | 660 | "4: ngr %2,%1\n" |
715 | " algr %0,%2\n" | 661 | " ic %2,0(%2,%5)\n" |
716 | "5:" | 662 | " algr %0,%2\n" |
717 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | 663 | "5:" |
664 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
718 | : "a" (size), "a" (addr), "a" (&_sb_findmap), | 665 | : "a" (size), "a" (addr), "a" (&_sb_findmap), |
719 | "m" (*(addrtype *) addr) : "cc" ); | 666 | "m" (*(addrtype *) addr) : "cc"); |
720 | return (res < size) ? res : size; | 667 | return (res < size) ? res : size; |
721 | } | 668 | } |
722 | 669 | ||
@@ -832,36 +779,37 @@ ext2_find_first_zero_bit(void *vaddr, unsigned int size) | |||
832 | 779 | ||
833 | if (!size) | 780 | if (!size) |
834 | return 0; | 781 | return 0; |
835 | __asm__(" lhi %1,-1\n" | 782 | asm volatile( |
836 | " lr %2,%3\n" | 783 | " lhi %1,-1\n" |
837 | " ahi %2,31\n" | 784 | " lr %2,%3\n" |
838 | " srl %2,5\n" | 785 | " ahi %2,31\n" |
839 | " slr %0,%0\n" | 786 | " srl %2,5\n" |
840 | "0: cl %1,0(%0,%4)\n" | 787 | " slr %0,%0\n" |
841 | " jne 1f\n" | 788 | "0: cl %1,0(%0,%4)\n" |
842 | " ahi %0,4\n" | 789 | " jne 1f\n" |
843 | " brct %2,0b\n" | 790 | " ahi %0,4\n" |
844 | " lr %0,%3\n" | 791 | " brct %2,0b\n" |
845 | " j 4f\n" | 792 | " lr %0,%3\n" |
846 | "1: l %2,0(%0,%4)\n" | 793 | " j 4f\n" |
847 | " sll %0,3\n" | 794 | "1: l %2,0(%0,%4)\n" |
848 | " ahi %0,24\n" | 795 | " sll %0,3\n" |
849 | " lhi %1,0xff\n" | 796 | " ahi %0,24\n" |
850 | " tmh %2,0xffff\n" | 797 | " lhi %1,0xff\n" |
851 | " jo 2f\n" | 798 | " tmh %2,0xffff\n" |
852 | " ahi %0,-16\n" | 799 | " jo 2f\n" |
853 | " srl %2,16\n" | 800 | " ahi %0,-16\n" |
854 | "2: tml %2,0xff00\n" | 801 | " srl %2,16\n" |
855 | " jo 3f\n" | 802 | "2: tml %2,0xff00\n" |
856 | " ahi %0,-8\n" | 803 | " jo 3f\n" |
857 | " srl %2,8\n" | 804 | " ahi %0,-8\n" |
858 | "3: nr %2,%1\n" | 805 | " srl %2,8\n" |
859 | " ic %2,0(%2,%5)\n" | 806 | "3: nr %2,%1\n" |
860 | " alr %0,%2\n" | 807 | " ic %2,0(%2,%5)\n" |
861 | "4:" | 808 | " alr %0,%2\n" |
862 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | 809 | "4:" |
863 | : "a" (size), "a" (vaddr), "a" (&_zb_findmap), | 810 | : "=&a" (res), "=&d" (cmp), "=&a" (count) |
864 | "m" (*(addrtype *) vaddr) : "cc" ); | 811 | : "a" (size), "a" (vaddr), "a" (&_zb_findmap), |
812 | "m" (*(addrtype *) vaddr) : "cc"); | ||
865 | return (res < size) ? res : size; | 813 | return (res < size) ? res : size; |
866 | } | 814 | } |
867 | 815 | ||
@@ -875,39 +823,40 @@ ext2_find_first_zero_bit(void *vaddr, unsigned long size) | |||
875 | 823 | ||
876 | if (!size) | 824 | if (!size) |
877 | return 0; | 825 | return 0; |
878 | __asm__(" lghi %1,-1\n" | 826 | asm volatile( |
879 | " lgr %2,%3\n" | 827 | " lghi %1,-1\n" |
880 | " aghi %2,63\n" | 828 | " lgr %2,%3\n" |
881 | " srlg %2,%2,6\n" | 829 | " aghi %2,63\n" |
882 | " slgr %0,%0\n" | 830 | " srlg %2,%2,6\n" |
883 | "0: clg %1,0(%0,%4)\n" | 831 | " slgr %0,%0\n" |
884 | " jne 1f\n" | 832 | "0: clg %1,0(%0,%4)\n" |
885 | " aghi %0,8\n" | 833 | " jne 1f\n" |
886 | " brct %2,0b\n" | 834 | " aghi %0,8\n" |
887 | " lgr %0,%3\n" | 835 | " brct %2,0b\n" |
888 | " j 5f\n" | 836 | " lgr %0,%3\n" |
889 | "1: cl %1,0(%0,%4)\n" | 837 | " j 5f\n" |
890 | " jne 2f\n" | 838 | "1: cl %1,0(%0,%4)\n" |
891 | " aghi %0,4\n" | 839 | " jne 2f\n" |
892 | "2: l %2,0(%0,%4)\n" | 840 | " aghi %0,4\n" |
893 | " sllg %0,%0,3\n" | 841 | "2: l %2,0(%0,%4)\n" |
894 | " aghi %0,24\n" | 842 | " sllg %0,%0,3\n" |
895 | " lghi %1,0xff\n" | 843 | " aghi %0,24\n" |
896 | " tmlh %2,0xffff\n" | 844 | " lghi %1,0xff\n" |
897 | " jo 3f\n" | 845 | " tmlh %2,0xffff\n" |
898 | " aghi %0,-16\n" | 846 | " jo 3f\n" |
899 | " srl %2,16\n" | 847 | " aghi %0,-16\n" |
900 | "3: tmll %2,0xff00\n" | 848 | " srl %2,16\n" |
901 | " jo 4f\n" | 849 | "3: tmll %2,0xff00\n" |
902 | " aghi %0,-8\n" | 850 | " jo 4f\n" |
903 | " srl %2,8\n" | 851 | " aghi %0,-8\n" |
904 | "4: ngr %2,%1\n" | 852 | " srl %2,8\n" |
905 | " ic %2,0(%2,%5)\n" | 853 | "4: ngr %2,%1\n" |
906 | " algr %0,%2\n" | 854 | " ic %2,0(%2,%5)\n" |
907 | "5:" | 855 | " algr %0,%2\n" |
908 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | 856 | "5:" |
857 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
909 | : "a" (size), "a" (vaddr), "a" (&_zb_findmap), | 858 | : "a" (size), "a" (vaddr), "a" (&_zb_findmap), |
910 | "m" (*(addrtype *) vaddr) : "cc" ); | 859 | "m" (*(addrtype *) vaddr) : "cc"); |
911 | return (res < size) ? res : size; | 860 | return (res < size) ? res : size; |
912 | } | 861 | } |
913 | 862 | ||
@@ -927,13 +876,16 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) | |||
927 | p = addr + offset / __BITOPS_WORDSIZE; | 876 | p = addr + offset / __BITOPS_WORDSIZE; |
928 | if (bit) { | 877 | if (bit) { |
929 | #ifndef __s390x__ | 878 | #ifndef __s390x__ |
930 | asm(" ic %0,0(%1)\n" | 879 | asm volatile( |
931 | " icm %0,2,1(%1)\n" | 880 | " ic %0,0(%1)\n" |
932 | " icm %0,4,2(%1)\n" | 881 | " icm %0,2,1(%1)\n" |
933 | " icm %0,8,3(%1)" | 882 | " icm %0,4,2(%1)\n" |
934 | : "=&a" (word) : "a" (p), "m" (*p) : "cc" ); | 883 | " icm %0,8,3(%1)" |
884 | : "=&a" (word) : "a" (p), "m" (*p) : "cc"); | ||
935 | #else | 885 | #else |
936 | asm(" lrvg %0,%1" : "=a" (word) : "m" (*p) ); | 886 | asm volatile( |
887 | " lrvg %0,%1" | ||
888 | : "=a" (word) : "m" (*p) ); | ||
937 | #endif | 889 | #endif |
938 | /* | 890 | /* |
939 | * s390 version of ffz returns __BITOPS_WORDSIZE | 891 | * s390 version of ffz returns __BITOPS_WORDSIZE |
diff --git a/include/asm-s390/byteorder.h b/include/asm-s390/byteorder.h index 2cc35a0e188e..1fe2492baa8d 100644 --- a/include/asm-s390/byteorder.h +++ b/include/asm-s390/byteorder.h | |||
@@ -14,60 +14,54 @@ | |||
14 | #ifdef __GNUC__ | 14 | #ifdef __GNUC__ |
15 | 15 | ||
16 | #ifdef __s390x__ | 16 | #ifdef __s390x__ |
17 | static __inline__ __u64 ___arch__swab64p(const __u64 *x) | 17 | static inline __u64 ___arch__swab64p(const __u64 *x) |
18 | { | 18 | { |
19 | __u64 result; | 19 | __u64 result; |
20 | 20 | ||
21 | __asm__ __volatile__ ( | 21 | asm volatile("lrvg %0,%1" : "=d" (result) : "m" (*x)); |
22 | " lrvg %0,%1" | ||
23 | : "=d" (result) : "m" (*x) ); | ||
24 | return result; | 22 | return result; |
25 | } | 23 | } |
26 | 24 | ||
27 | static __inline__ __u64 ___arch__swab64(__u64 x) | 25 | static inline __u64 ___arch__swab64(__u64 x) |
28 | { | 26 | { |
29 | __u64 result; | 27 | __u64 result; |
30 | 28 | ||
31 | __asm__ __volatile__ ( | 29 | asm volatile("lrvgr %0,%1" : "=d" (result) : "d" (x)); |
32 | " lrvgr %0,%1" | ||
33 | : "=d" (result) : "d" (x) ); | ||
34 | return result; | 30 | return result; |
35 | } | 31 | } |
36 | 32 | ||
37 | static __inline__ void ___arch__swab64s(__u64 *x) | 33 | static inline void ___arch__swab64s(__u64 *x) |
38 | { | 34 | { |
39 | *x = ___arch__swab64p(x); | 35 | *x = ___arch__swab64p(x); |
40 | } | 36 | } |
41 | #endif /* __s390x__ */ | 37 | #endif /* __s390x__ */ |
42 | 38 | ||
43 | static __inline__ __u32 ___arch__swab32p(const __u32 *x) | 39 | static inline __u32 ___arch__swab32p(const __u32 *x) |
44 | { | 40 | { |
45 | __u32 result; | 41 | __u32 result; |
46 | 42 | ||
47 | __asm__ __volatile__ ( | 43 | asm volatile( |
48 | #ifndef __s390x__ | 44 | #ifndef __s390x__ |
49 | " icm %0,8,3(%1)\n" | 45 | " icm %0,8,3(%1)\n" |
50 | " icm %0,4,2(%1)\n" | 46 | " icm %0,4,2(%1)\n" |
51 | " icm %0,2,1(%1)\n" | 47 | " icm %0,2,1(%1)\n" |
52 | " ic %0,0(%1)" | 48 | " ic %0,0(%1)" |
53 | : "=&d" (result) : "a" (x), "m" (*x) : "cc" ); | 49 | : "=&d" (result) : "a" (x), "m" (*x) : "cc"); |
54 | #else /* __s390x__ */ | 50 | #else /* __s390x__ */ |
55 | " lrv %0,%1" | 51 | " lrv %0,%1" |
56 | : "=d" (result) : "m" (*x) ); | 52 | : "=d" (result) : "m" (*x)); |
57 | #endif /* __s390x__ */ | 53 | #endif /* __s390x__ */ |
58 | return result; | 54 | return result; |
59 | } | 55 | } |
60 | 56 | ||
61 | static __inline__ __u32 ___arch__swab32(__u32 x) | 57 | static inline __u32 ___arch__swab32(__u32 x) |
62 | { | 58 | { |
63 | #ifndef __s390x__ | 59 | #ifndef __s390x__ |
64 | return ___arch__swab32p(&x); | 60 | return ___arch__swab32p(&x); |
65 | #else /* __s390x__ */ | 61 | #else /* __s390x__ */ |
66 | __u32 result; | 62 | __u32 result; |
67 | 63 | ||
68 | __asm__ __volatile__ ( | 64 | asm volatile("lrvr %0,%1" : "=d" (result) : "d" (x)); |
69 | " lrvr %0,%1" | ||
70 | : "=d" (result) : "d" (x) ); | ||
71 | return result; | 65 | return result; |
72 | #endif /* __s390x__ */ | 66 | #endif /* __s390x__ */ |
73 | } | 67 | } |
@@ -81,14 +75,14 @@ static __inline__ __u16 ___arch__swab16p(const __u16 *x) | |||
81 | { | 75 | { |
82 | __u16 result; | 76 | __u16 result; |
83 | 77 | ||
84 | __asm__ __volatile__ ( | 78 | asm volatile( |
85 | #ifndef __s390x__ | 79 | #ifndef __s390x__ |
86 | " icm %0,2,1(%1)\n" | 80 | " icm %0,2,1(%1)\n" |
87 | " ic %0,0(%1)\n" | 81 | " ic %0,0(%1)\n" |
88 | : "=&d" (result) : "a" (x), "m" (*x) : "cc" ); | 82 | : "=&d" (result) : "a" (x), "m" (*x) : "cc"); |
89 | #else /* __s390x__ */ | 83 | #else /* __s390x__ */ |
90 | " lrvh %0,%1" | 84 | " lrvh %0,%1" |
91 | : "=d" (result) : "m" (*x) ); | 85 | : "=d" (result) : "m" (*x)); |
92 | #endif /* __s390x__ */ | 86 | #endif /* __s390x__ */ |
93 | return result; | 87 | return result; |
94 | } | 88 | } |
diff --git a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h index 471f2af2b16a..37c362d89fad 100644 --- a/include/asm-s390/checksum.h +++ b/include/asm-s390/checksum.h | |||
@@ -30,57 +30,13 @@ | |||
30 | static inline unsigned int | 30 | static inline unsigned int |
31 | csum_partial(const unsigned char * buff, int len, unsigned int sum) | 31 | csum_partial(const unsigned char * buff, int len, unsigned int sum) |
32 | { | 32 | { |
33 | /* | 33 | register unsigned long reg2 asm("2") = (unsigned long) buff; |
34 | * Experiments with ethernet and slip connections show that buf | 34 | register unsigned long reg3 asm("3") = (unsigned long) len; |
35 | * is aligned on either a 2-byte or 4-byte boundary. | ||
36 | */ | ||
37 | #ifndef __s390x__ | ||
38 | register_pair rp; | ||
39 | |||
40 | rp.subreg.even = (unsigned long) buff; | ||
41 | rp.subreg.odd = (unsigned long) len; | ||
42 | __asm__ __volatile__ ( | ||
43 | "0: cksm %0,%1\n" /* do checksum on longs */ | ||
44 | " jo 0b\n" | ||
45 | : "+&d" (sum), "+&a" (rp) : : "cc", "memory" ); | ||
46 | #else /* __s390x__ */ | ||
47 | __asm__ __volatile__ ( | ||
48 | " lgr 2,%1\n" /* address in gpr 2 */ | ||
49 | " lgfr 3,%2\n" /* length in gpr 3 */ | ||
50 | "0: cksm %0,2\n" /* do checksum on longs */ | ||
51 | " jo 0b\n" | ||
52 | : "+&d" (sum) | ||
53 | : "d" (buff), "d" (len) | ||
54 | : "cc", "memory", "2", "3" ); | ||
55 | #endif /* __s390x__ */ | ||
56 | return sum; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * csum_partial as an inline function | ||
61 | */ | ||
62 | static inline unsigned int | ||
63 | csum_partial_inline(const unsigned char * buff, int len, unsigned int sum) | ||
64 | { | ||
65 | #ifndef __s390x__ | ||
66 | register_pair rp; | ||
67 | 35 | ||
68 | rp.subreg.even = (unsigned long) buff; | 36 | asm volatile( |
69 | rp.subreg.odd = (unsigned long) len; | 37 | "0: cksm %0,%1\n" /* do checksum on longs */ |
70 | __asm__ __volatile__ ( | 38 | " jo 0b\n" |
71 | "0: cksm %0,%1\n" /* do checksum on longs */ | 39 | : "+d" (sum), "+d" (reg2), "+d" (reg3) : : "cc", "memory"); |
72 | " jo 0b\n" | ||
73 | : "+&d" (sum), "+&a" (rp) : : "cc", "memory" ); | ||
74 | #else /* __s390x__ */ | ||
75 | __asm__ __volatile__ ( | ||
76 | " lgr 2,%1\n" /* address in gpr 2 */ | ||
77 | " lgfr 3,%2\n" /* length in gpr 3 */ | ||
78 | "0: cksm %0,2\n" /* do checksum on longs */ | ||
79 | " jo 0b\n" | ||
80 | : "+&d" (sum) | ||
81 | : "d" (buff), "d" (len) | ||
82 | : "cc", "memory", "2", "3" ); | ||
83 | #endif /* __s390x__ */ | ||
84 | return sum; | 40 | return sum; |
85 | } | 41 | } |
86 | 42 | ||
@@ -114,7 +70,7 @@ static inline unsigned int | |||
114 | csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum) | 70 | csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum) |
115 | { | 71 | { |
116 | memcpy(dst,src,len); | 72 | memcpy(dst,src,len); |
117 | return csum_partial_inline(dst, len, sum); | 73 | return csum_partial(dst, len, sum); |
118 | } | 74 | } |
119 | 75 | ||
120 | /* | 76 | /* |
@@ -126,22 +82,22 @@ csum_fold(unsigned int sum) | |||
126 | #ifndef __s390x__ | 82 | #ifndef __s390x__ |
127 | register_pair rp; | 83 | register_pair rp; |
128 | 84 | ||
129 | __asm__ __volatile__ ( | 85 | asm volatile( |
130 | " slr %N1,%N1\n" /* %0 = H L */ | 86 | " slr %N1,%N1\n" /* %0 = H L */ |
131 | " lr %1,%0\n" /* %0 = H L, %1 = H L 0 0 */ | 87 | " lr %1,%0\n" /* %0 = H L, %1 = H L 0 0 */ |
132 | " srdl %1,16\n" /* %0 = H L, %1 = 0 H L 0 */ | 88 | " srdl %1,16\n" /* %0 = H L, %1 = 0 H L 0 */ |
133 | " alr %1,%N1\n" /* %0 = H L, %1 = L H L 0 */ | 89 | " alr %1,%N1\n" /* %0 = H L, %1 = L H L 0 */ |
134 | " alr %0,%1\n" /* %0 = H+L+C L+H */ | 90 | " alr %0,%1\n" /* %0 = H+L+C L+H */ |
135 | " srl %0,16\n" /* %0 = H+L+C */ | 91 | " srl %0,16\n" /* %0 = H+L+C */ |
136 | : "+&d" (sum), "=d" (rp) : : "cc" ); | 92 | : "+&d" (sum), "=d" (rp) : : "cc"); |
137 | #else /* __s390x__ */ | 93 | #else /* __s390x__ */ |
138 | __asm__ __volatile__ ( | 94 | asm volatile( |
139 | " sr 3,3\n" /* %0 = H*65536 + L */ | 95 | " sr 3,3\n" /* %0 = H*65536 + L */ |
140 | " lr 2,%0\n" /* %0 = H L, R2/R3 = H L / 0 0 */ | 96 | " lr 2,%0\n" /* %0 = H L, 2/3 = H L / 0 0 */ |
141 | " srdl 2,16\n" /* %0 = H L, R2/R3 = 0 H / L 0 */ | 97 | " srdl 2,16\n" /* %0 = H L, 2/3 = 0 H / L 0 */ |
142 | " alr 2,3\n" /* %0 = H L, R2/R3 = L H / L 0 */ | 98 | " alr 2,3\n" /* %0 = H L, 2/3 = L H / L 0 */ |
143 | " alr %0,2\n" /* %0 = H+L+C L+H */ | 99 | " alr %0,2\n" /* %0 = H+L+C L+H */ |
144 | " srl %0,16\n" /* %0 = H+L+C */ | 100 | " srl %0,16\n" /* %0 = H+L+C */ |
145 | : "+&d" (sum) : : "cc", "2", "3"); | 101 | : "+&d" (sum) : : "cc", "2", "3"); |
146 | #endif /* __s390x__ */ | 102 | #endif /* __s390x__ */ |
147 | return ((unsigned short) ~sum); | 103 | return ((unsigned short) ~sum); |
@@ -155,29 +111,7 @@ csum_fold(unsigned int sum) | |||
155 | static inline unsigned short | 111 | static inline unsigned short |
156 | ip_fast_csum(unsigned char *iph, unsigned int ihl) | 112 | ip_fast_csum(unsigned char *iph, unsigned int ihl) |
157 | { | 113 | { |
158 | unsigned long sum; | 114 | return csum_fold(csum_partial(iph, ihl*4, 0)); |
159 | #ifndef __s390x__ | ||
160 | register_pair rp; | ||
161 | |||
162 | rp.subreg.even = (unsigned long) iph; | ||
163 | rp.subreg.odd = (unsigned long) ihl*4; | ||
164 | __asm__ __volatile__ ( | ||
165 | " sr %0,%0\n" /* set sum to zero */ | ||
166 | "0: cksm %0,%1\n" /* do checksum on longs */ | ||
167 | " jo 0b\n" | ||
168 | : "=&d" (sum), "+&a" (rp) : : "cc", "memory" ); | ||
169 | #else /* __s390x__ */ | ||
170 | __asm__ __volatile__ ( | ||
171 | " slgr %0,%0\n" /* set sum to zero */ | ||
172 | " lgr 2,%1\n" /* address in gpr 2 */ | ||
173 | " lgfr 3,%2\n" /* length in gpr 3 */ | ||
174 | "0: cksm %0,2\n" /* do checksum on ints */ | ||
175 | " jo 0b\n" | ||
176 | : "=&d" (sum) | ||
177 | : "d" (iph), "d" (ihl*4) | ||
178 | : "cc", "memory", "2", "3" ); | ||
179 | #endif /* __s390x__ */ | ||
180 | return csum_fold(sum); | ||
181 | } | 115 | } |
182 | 116 | ||
183 | /* | 117 | /* |
@@ -190,47 +124,47 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
190 | unsigned int sum) | 124 | unsigned int sum) |
191 | { | 125 | { |
192 | #ifndef __s390x__ | 126 | #ifndef __s390x__ |
193 | __asm__ __volatile__ ( | 127 | asm volatile( |
194 | " alr %0,%1\n" /* sum += saddr */ | 128 | " alr %0,%1\n" /* sum += saddr */ |
195 | " brc 12,0f\n" | 129 | " brc 12,0f\n" |
196 | " ahi %0,1\n" /* add carry */ | 130 | " ahi %0,1\n" /* add carry */ |
197 | "0:" | 131 | "0:" |
198 | : "+&d" (sum) : "d" (saddr) : "cc" ); | 132 | : "+&d" (sum) : "d" (saddr) : "cc"); |
199 | __asm__ __volatile__ ( | 133 | asm volatile( |
200 | " alr %0,%1\n" /* sum += daddr */ | 134 | " alr %0,%1\n" /* sum += daddr */ |
201 | " brc 12,1f\n" | 135 | " brc 12,1f\n" |
202 | " ahi %0,1\n" /* add carry */ | 136 | " ahi %0,1\n" /* add carry */ |
203 | "1:" | 137 | "1:" |
204 | : "+&d" (sum) : "d" (daddr) : "cc" ); | 138 | : "+&d" (sum) : "d" (daddr) : "cc"); |
205 | __asm__ __volatile__ ( | 139 | asm volatile( |
206 | " alr %0,%1\n" /* sum += (len<<16) + (proto<<8) */ | 140 | " alr %0,%1\n" /* sum += (len<<16) + (proto<<8) */ |
207 | " brc 12,2f\n" | 141 | " brc 12,2f\n" |
208 | " ahi %0,1\n" /* add carry */ | 142 | " ahi %0,1\n" /* add carry */ |
209 | "2:" | 143 | "2:" |
210 | : "+&d" (sum) | 144 | : "+&d" (sum) |
211 | : "d" (((unsigned int) len<<16) + (unsigned int) proto) | 145 | : "d" (((unsigned int) len<<16) + (unsigned int) proto) |
212 | : "cc" ); | 146 | : "cc"); |
213 | #else /* __s390x__ */ | 147 | #else /* __s390x__ */ |
214 | __asm__ __volatile__ ( | 148 | asm volatile( |
215 | " lgfr %0,%0\n" | 149 | " lgfr %0,%0\n" |
216 | " algr %0,%1\n" /* sum += saddr */ | 150 | " algr %0,%1\n" /* sum += saddr */ |
217 | " brc 12,0f\n" | 151 | " brc 12,0f\n" |
218 | " aghi %0,1\n" /* add carry */ | 152 | " aghi %0,1\n" /* add carry */ |
219 | "0: algr %0,%2\n" /* sum += daddr */ | 153 | "0: algr %0,%2\n" /* sum += daddr */ |
220 | " brc 12,1f\n" | 154 | " brc 12,1f\n" |
221 | " aghi %0,1\n" /* add carry */ | 155 | " aghi %0,1\n" /* add carry */ |
222 | "1: algfr %0,%3\n" /* sum += (len<<16) + proto */ | 156 | "1: algfr %0,%3\n" /* sum += (len<<16) + proto */ |
223 | " brc 12,2f\n" | 157 | " brc 12,2f\n" |
224 | " aghi %0,1\n" /* add carry */ | 158 | " aghi %0,1\n" /* add carry */ |
225 | "2: srlg 0,%0,32\n" | 159 | "2: srlg 0,%0,32\n" |
226 | " alr %0,0\n" /* fold to 32 bits */ | 160 | " alr %0,0\n" /* fold to 32 bits */ |
227 | " brc 12,3f\n" | 161 | " brc 12,3f\n" |
228 | " ahi %0,1\n" /* add carry */ | 162 | " ahi %0,1\n" /* add carry */ |
229 | "3: llgfr %0,%0" | 163 | "3: llgfr %0,%0" |
230 | : "+&d" (sum) | 164 | : "+&d" (sum) |
231 | : "d" (saddr), "d" (daddr), | 165 | : "d" (saddr), "d" (daddr), |
232 | "d" (((unsigned int) len<<16) + (unsigned int) proto) | 166 | "d" (((unsigned int) len<<16) + (unsigned int) proto) |
233 | : "cc", "0" ); | 167 | : "cc", "0"); |
234 | #endif /* __s390x__ */ | 168 | #endif /* __s390x__ */ |
235 | return sum; | 169 | return sum; |
236 | } | 170 | } |
diff --git a/include/asm-s390/div64.h b/include/asm-s390/div64.h index af098dc3cf59..6cd978cefb28 100644 --- a/include/asm-s390/div64.h +++ b/include/asm-s390/div64.h | |||
@@ -1,49 +1 @@ | |||
1 | #ifndef __S390_DIV64 | ||
2 | #define __S390_DIV64 | ||
3 | |||
4 | #ifndef __s390x__ | ||
5 | |||
6 | /* for do_div "base" needs to be smaller than 2^31-1 */ | ||
7 | #define do_div(n, base) ({ \ | ||
8 | unsigned long long __n = (n); \ | ||
9 | unsigned long __r; \ | ||
10 | \ | ||
11 | asm (" slr 0,0\n" \ | ||
12 | " l 1,%1\n" \ | ||
13 | " srdl 0,1\n" \ | ||
14 | " dr 0,%2\n" \ | ||
15 | " alr 1,1\n" \ | ||
16 | " alr 0,0\n" \ | ||
17 | " lhi 2,1\n" \ | ||
18 | " n 2,%1\n" \ | ||
19 | " alr 0,2\n" \ | ||
20 | " clr 0,%2\n" \ | ||
21 | " jl 0f\n" \ | ||
22 | " slr 0,%2\n" \ | ||
23 | " ahi 1,1\n" \ | ||
24 | "0: st 1,%1\n" \ | ||
25 | " l 1,4+%1\n" \ | ||
26 | " srdl 0,1\n" \ | ||
27 | " dr 0,%2\n" \ | ||
28 | " alr 1,1\n" \ | ||
29 | " alr 0,0\n" \ | ||
30 | " lhi 2,1\n" \ | ||
31 | " n 2,4+%1\n" \ | ||
32 | " alr 0,2\n" \ | ||
33 | " clr 0,%2\n" \ | ||
34 | " jl 1f\n" \ | ||
35 | " slr 0,%2\n" \ | ||
36 | " ahi 1,1\n" \ | ||
37 | "1: st 1,4+%1\n" \ | ||
38 | " lr %0,0" \ | ||
39 | : "=d" (__r), "=m" (__n) \ | ||
40 | : "d" (base), "m" (__n) : "0", "1", "2", "cc" ); \ | ||
41 | (n) = (__n); \ | ||
42 | __r; \ | ||
43 | }) | ||
44 | |||
45 | #else /* __s390x__ */ | ||
46 | #include <asm-generic/div64.h> | #include <asm-generic/div64.h> | |
47 | #endif /* __s390x__ */ | ||
48 | |||
49 | #endif | ||
diff --git a/include/asm-s390/ebcdic.h b/include/asm-s390/ebcdic.h index 15fd2eda6c90..7f6f641d32f4 100644 --- a/include/asm-s390/ebcdic.h +++ b/include/asm-s390/ebcdic.h | |||
@@ -26,16 +26,16 @@ codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned long nr) | |||
26 | { | 26 | { |
27 | if (nr-- <= 0) | 27 | if (nr-- <= 0) |
28 | return; | 28 | return; |
29 | __asm__ __volatile__( | 29 | asm volatile( |
30 | " bras 1,1f\n" | 30 | " bras 1,1f\n" |
31 | " tr 0(1,%0),0(%2)\n" | 31 | " tr 0(1,%0),0(%2)\n" |
32 | "0: tr 0(256,%0),0(%2)\n" | 32 | "0: tr 0(256,%0),0(%2)\n" |
33 | " la %0,256(%0)\n" | 33 | " la %0,256(%0)\n" |
34 | "1: ahi %1,-256\n" | 34 | "1: ahi %1,-256\n" |
35 | " jnm 0b\n" | 35 | " jnm 0b\n" |
36 | " ex %1,0(1)" | 36 | " ex %1,0(1)" |
37 | : "+&a" (addr), "+&a" (nr) | 37 | : "+&a" (addr), "+&a" (nr) |
38 | : "a" (codepage) : "cc", "memory", "1" ); | 38 | : "a" (codepage) : "cc", "memory", "1"); |
39 | } | 39 | } |
40 | 40 | ||
41 | #define ASCEBC(addr,nr) codepage_convert(_ascebc, addr, nr) | 41 | #define ASCEBC(addr,nr) codepage_convert(_ascebc, addr, nr) |
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h index a6cc27e77007..63c78b9399c4 100644 --- a/include/asm-s390/io.h +++ b/include/asm-s390/io.h | |||
@@ -27,18 +27,16 @@ | |||
27 | static inline unsigned long virt_to_phys(volatile void * address) | 27 | static inline unsigned long virt_to_phys(volatile void * address) |
28 | { | 28 | { |
29 | unsigned long real_address; | 29 | unsigned long real_address; |
30 | __asm__ ( | 30 | asm volatile( |
31 | #ifndef __s390x__ | 31 | #ifndef __s390x__ |
32 | " lra %0,0(%1)\n" | 32 | " lra %0,0(%1)\n" |
33 | " jz 0f\n" | ||
34 | " sr %0,%0\n" | ||
35 | #else /* __s390x__ */ | 33 | #else /* __s390x__ */ |
36 | " lrag %0,0(%1)\n" | 34 | " lrag %0,0(%1)\n" |
37 | " jz 0f\n" | ||
38 | " slgr %0,%0\n" | ||
39 | #endif /* __s390x__ */ | 35 | #endif /* __s390x__ */ |
36 | " jz 0f\n" | ||
37 | " la %0,0\n" | ||
40 | "0:" | 38 | "0:" |
41 | : "=a" (real_address) : "a" (address) : "cc" ); | 39 | : "=a" (real_address) : "a" (address) : "cc"); |
42 | return real_address; | 40 | return real_address; |
43 | } | 41 | } |
44 | 42 | ||
diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h index 3b566a5b3cc7..3f26131120b7 100644 --- a/include/asm-s390/irqflags.h +++ b/include/asm-s390/irqflags.h | |||
@@ -10,43 +10,93 @@ | |||
10 | 10 | ||
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | 12 | ||
13 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) | ||
14 | |||
15 | /* store then or system mask. */ | ||
16 | #define __raw_local_irq_stosm(__or) \ | ||
17 | ({ \ | ||
18 | unsigned long __mask; \ | ||
19 | asm volatile( \ | ||
20 | " stosm %0,%1" \ | ||
21 | : "=Q" (__mask) : "i" (__or) : "memory"); \ | ||
22 | __mask; \ | ||
23 | }) | ||
24 | |||
25 | /* store then and system mask. */ | ||
26 | #define __raw_local_irq_stnsm(__and) \ | ||
27 | ({ \ | ||
28 | unsigned long __mask; \ | ||
29 | asm volatile( \ | ||
30 | " stnsm %0,%1" \ | ||
31 | : "=Q" (__mask) : "i" (__and) : "memory"); \ | ||
32 | __mask; \ | ||
33 | }) | ||
34 | |||
35 | /* set system mask. */ | ||
36 | #define __raw_local_irq_ssm(__mask) \ | ||
37 | ({ \ | ||
38 | asm volatile("ssm %0" : : "Q" (__mask) : "memory"); \ | ||
39 | }) | ||
40 | |||
41 | #else /* __GNUC__ */ | ||
42 | |||
43 | /* store then or system mask. */ | ||
44 | #define __raw_local_irq_stosm(__or) \ | ||
45 | ({ \ | ||
46 | unsigned long __mask; \ | ||
47 | asm volatile( \ | ||
48 | " stosm 0(%1),%2" \ | ||
49 | : "=m" (__mask) \ | ||
50 | : "a" (&__mask), "i" (__or) : "memory"); \ | ||
51 | __mask; \ | ||
52 | }) | ||
53 | |||
54 | /* store then and system mask. */ | ||
55 | #define __raw_local_irq_stnsm(__and) \ | ||
56 | ({ \ | ||
57 | unsigned long __mask; \ | ||
58 | asm volatile( \ | ||
59 | " stnsm 0(%1),%2" \ | ||
60 | : "=m" (__mask) \ | ||
61 | : "a" (&__mask), "i" (__and) : "memory"); \ | ||
62 | __mask; \ | ||
63 | }) | ||
64 | |||
65 | /* set system mask. */ | ||
66 | #define __raw_local_irq_ssm(__mask) \ | ||
67 | ({ \ | ||
68 | asm volatile( \ | ||
69 | " ssm 0(%0)" \ | ||
70 | : : "a" (&__mask), "m" (__mask) : "memory"); \ | ||
71 | }) | ||
72 | |||
73 | #endif /* __GNUC__ */ | ||
74 | |||
13 | /* interrupt control.. */ | 75 | /* interrupt control.. */ |
14 | #define raw_local_irq_enable() ({ \ | 76 | static inline unsigned long raw_local_irq_enable(void) |
15 | unsigned long __dummy; \ | 77 | { |
16 | __asm__ __volatile__ ( \ | 78 | return __raw_local_irq_stosm(0x03); |
17 | "stosm 0(%1),0x03" \ | 79 | } |
18 | : "=m" (__dummy) : "a" (&__dummy) : "memory" ); \ | ||
19 | }) | ||
20 | |||
21 | #define raw_local_irq_disable() ({ \ | ||
22 | unsigned long __flags; \ | ||
23 | __asm__ __volatile__ ( \ | ||
24 | "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \ | ||
25 | __flags; \ | ||
26 | }) | ||
27 | |||
28 | #define raw_local_save_flags(x) \ | ||
29 | do { \ | ||
30 | typecheck(unsigned long, x); \ | ||
31 | __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \ | ||
32 | } while (0) | ||
33 | 80 | ||
34 | #define raw_local_irq_restore(x) \ | 81 | static inline unsigned long raw_local_irq_disable(void) |
35 | do { \ | 82 | { |
36 | typecheck(unsigned long, x); \ | 83 | return __raw_local_irq_stnsm(0xfc); |
37 | __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \ | 84 | } |
85 | |||
86 | #define raw_local_save_flags(x) \ | ||
87 | do { \ | ||
88 | typecheck(unsigned long, x); \ | ||
89 | (x) = __raw_local_irq_stosm(0x00); \ | ||
38 | } while (0) | 90 | } while (0) |
39 | 91 | ||
40 | #define raw_irqs_disabled() \ | 92 | static inline void raw_local_irq_restore(unsigned long flags) |
41 | ({ \ | 93 | { |
42 | unsigned long flags; \ | 94 | __raw_local_irq_ssm(flags); |
43 | raw_local_save_flags(flags); \ | 95 | } |
44 | !((flags >> __FLAG_SHIFT) & 3); \ | ||
45 | }) | ||
46 | 96 | ||
47 | static inline int raw_irqs_disabled_flags(unsigned long flags) | 97 | static inline int raw_irqs_disabled_flags(unsigned long flags) |
48 | { | 98 | { |
49 | return !((flags >> __FLAG_SHIFT) & 3); | 99 | return !(flags & (3UL << (BITS_PER_LONG - 8))); |
50 | } | 100 | } |
51 | 101 | ||
52 | /* For spinlocks etc */ | 102 | /* For spinlocks etc */ |
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index 18695d10dedf..06583ed0bde7 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h | |||
@@ -359,7 +359,7 @@ extern struct _lowcore *lowcore_ptr[]; | |||
359 | 359 | ||
360 | static inline void set_prefix(__u32 address) | 360 | static inline void set_prefix(__u32 address) |
361 | { | 361 | { |
362 | __asm__ __volatile__ ("spx %0" : : "m" (address) : "memory" ); | 362 | asm volatile("spx %0" : : "m" (address) : "memory"); |
363 | } | 363 | } |
364 | 364 | ||
365 | #define __PANIC_MAGIC 0xDEADC0DE | 365 | #define __PANIC_MAGIC 0xDEADC0DE |
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h index b2628dc5c490..796c400f2b79 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h | |||
@@ -22,89 +22,45 @@ | |||
22 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
23 | #ifndef __ASSEMBLY__ | 23 | #ifndef __ASSEMBLY__ |
24 | 24 | ||
25 | #ifndef __s390x__ | ||
26 | |||
27 | static inline void clear_page(void *page) | ||
28 | { | ||
29 | register_pair rp; | ||
30 | |||
31 | rp.subreg.even = (unsigned long) page; | ||
32 | rp.subreg.odd = (unsigned long) 4096; | ||
33 | asm volatile (" slr 1,1\n" | ||
34 | " mvcl %0,0" | ||
35 | : "+&a" (rp) : : "memory", "cc", "1" ); | ||
36 | } | ||
37 | |||
38 | static inline void copy_page(void *to, void *from) | ||
39 | { | ||
40 | if (MACHINE_HAS_MVPG) | ||
41 | asm volatile (" sr 0,0\n" | ||
42 | " mvpg %0,%1" | ||
43 | : : "a" ((void *)(to)), "a" ((void *)(from)) | ||
44 | : "memory", "cc", "0" ); | ||
45 | else | ||
46 | asm volatile (" mvc 0(256,%0),0(%1)\n" | ||
47 | " mvc 256(256,%0),256(%1)\n" | ||
48 | " mvc 512(256,%0),512(%1)\n" | ||
49 | " mvc 768(256,%0),768(%1)\n" | ||
50 | " mvc 1024(256,%0),1024(%1)\n" | ||
51 | " mvc 1280(256,%0),1280(%1)\n" | ||
52 | " mvc 1536(256,%0),1536(%1)\n" | ||
53 | " mvc 1792(256,%0),1792(%1)\n" | ||
54 | " mvc 2048(256,%0),2048(%1)\n" | ||
55 | " mvc 2304(256,%0),2304(%1)\n" | ||
56 | " mvc 2560(256,%0),2560(%1)\n" | ||
57 | " mvc 2816(256,%0),2816(%1)\n" | ||
58 | " mvc 3072(256,%0),3072(%1)\n" | ||
59 | " mvc 3328(256,%0),3328(%1)\n" | ||
60 | " mvc 3584(256,%0),3584(%1)\n" | ||
61 | " mvc 3840(256,%0),3840(%1)\n" | ||
62 | : : "a"((void *)(to)),"a"((void *)(from)) | ||
63 | : "memory" ); | ||
64 | } | ||
65 | |||
66 | #else /* __s390x__ */ | ||
67 | |||
68 | static inline void clear_page(void *page) | 25 | static inline void clear_page(void *page) |
69 | { | 26 | { |
70 | asm volatile (" lgr 2,%0\n" | 27 | register unsigned long reg1 asm ("1") = 0; |
71 | " lghi 3,4096\n" | 28 | register void *reg2 asm ("2") = page; |
72 | " slgr 1,1\n" | 29 | register unsigned long reg3 asm ("3") = 4096; |
73 | " mvcl 2,0" | 30 | asm volatile( |
74 | : : "a" ((void *) (page)) | 31 | " mvcl 2,0" |
75 | : "memory", "cc", "1", "2", "3" ); | 32 | : "+d" (reg2), "+d" (reg3) : "d" (reg1) : "memory", "cc"); |
76 | } | 33 | } |
77 | 34 | ||
78 | static inline void copy_page(void *to, void *from) | 35 | static inline void copy_page(void *to, void *from) |
79 | { | 36 | { |
80 | if (MACHINE_HAS_MVPG) | 37 | if (MACHINE_HAS_MVPG) { |
81 | asm volatile (" sgr 0,0\n" | 38 | register unsigned long reg0 asm ("0") = 0; |
82 | " mvpg %0,%1" | 39 | asm volatile( |
83 | : : "a" ((void *)(to)), "a" ((void *)(from)) | 40 | " mvpg %0,%1" |
84 | : "memory", "cc", "0" ); | 41 | : : "a" (to), "a" (from), "d" (reg0) |
85 | else | 42 | : "memory", "cc"); |
86 | asm volatile (" mvc 0(256,%0),0(%1)\n" | 43 | } else |
87 | " mvc 256(256,%0),256(%1)\n" | 44 | asm volatile( |
88 | " mvc 512(256,%0),512(%1)\n" | 45 | " mvc 0(256,%0),0(%1)\n" |
89 | " mvc 768(256,%0),768(%1)\n" | 46 | " mvc 256(256,%0),256(%1)\n" |
90 | " mvc 1024(256,%0),1024(%1)\n" | 47 | " mvc 512(256,%0),512(%1)\n" |
91 | " mvc 1280(256,%0),1280(%1)\n" | 48 | " mvc 768(256,%0),768(%1)\n" |
92 | " mvc 1536(256,%0),1536(%1)\n" | 49 | " mvc 1024(256,%0),1024(%1)\n" |
93 | " mvc 1792(256,%0),1792(%1)\n" | 50 | " mvc 1280(256,%0),1280(%1)\n" |
94 | " mvc 2048(256,%0),2048(%1)\n" | 51 | " mvc 1536(256,%0),1536(%1)\n" |
95 | " mvc 2304(256,%0),2304(%1)\n" | 52 | " mvc 1792(256,%0),1792(%1)\n" |
96 | " mvc 2560(256,%0),2560(%1)\n" | 53 | " mvc 2048(256,%0),2048(%1)\n" |
97 | " mvc 2816(256,%0),2816(%1)\n" | 54 | " mvc 2304(256,%0),2304(%1)\n" |
98 | " mvc 3072(256,%0),3072(%1)\n" | 55 | " mvc 2560(256,%0),2560(%1)\n" |
99 | " mvc 3328(256,%0),3328(%1)\n" | 56 | " mvc 2816(256,%0),2816(%1)\n" |
100 | " mvc 3584(256,%0),3584(%1)\n" | 57 | " mvc 3072(256,%0),3072(%1)\n" |
101 | " mvc 3840(256,%0),3840(%1)\n" | 58 | " mvc 3328(256,%0),3328(%1)\n" |
102 | : : "a"((void *)(to)),"a"((void *)(from)) | 59 | " mvc 3584(256,%0),3584(%1)\n" |
103 | : "memory" ); | 60 | " mvc 3840(256,%0),3840(%1)\n" |
61 | : : "a" (to), "a" (from) : "memory"); | ||
104 | } | 62 | } |
105 | 63 | ||
106 | #endif /* __s390x__ */ | ||
107 | |||
108 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 64 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
109 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 65 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
110 | 66 | ||
@@ -159,7 +115,7 @@ extern unsigned int default_storage_key; | |||
159 | static inline void | 115 | static inline void |
160 | page_set_storage_key(unsigned long addr, unsigned int skey) | 116 | page_set_storage_key(unsigned long addr, unsigned int skey) |
161 | { | 117 | { |
162 | asm volatile ( "sske %0,%1" : : "d" (skey), "a" (addr) ); | 118 | asm volatile("sske %0,%1" : : "d" (skey), "a" (addr)); |
163 | } | 119 | } |
164 | 120 | ||
165 | static inline unsigned int | 121 | static inline unsigned int |
@@ -167,8 +123,7 @@ page_get_storage_key(unsigned long addr) | |||
167 | { | 123 | { |
168 | unsigned int skey; | 124 | unsigned int skey; |
169 | 125 | ||
170 | asm volatile ( "iske %0,%1" : "=d" (skey) : "a" (addr), "0" (0) ); | 126 | asm volatile("iske %0,%1" : "=d" (skey) : "a" (addr), "0" (0)); |
171 | |||
172 | return skey; | 127 | return skey; |
173 | } | 128 | } |
174 | 129 | ||
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index e965309fedac..83425cdefc91 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -554,9 +554,10 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep) | |||
554 | /* ipte in zarch mode can do the math */ | 554 | /* ipte in zarch mode can do the math */ |
555 | pte_t *pto = ptep; | 555 | pte_t *pto = ptep; |
556 | #endif | 556 | #endif |
557 | asm volatile ("ipte %2,%3" | 557 | asm volatile( |
558 | : "=m" (*ptep) : "m" (*ptep), | 558 | " ipte %2,%3" |
559 | "a" (pto), "a" (address) ); | 559 | : "=m" (*ptep) : "m" (*ptep), |
560 | "a" (pto), "a" (address)); | ||
560 | } | 561 | } |
561 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; | 562 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; |
562 | } | 563 | } |
@@ -609,16 +610,17 @@ ptep_establish(struct vm_area_struct *vma, | |||
609 | /* | 610 | /* |
610 | * Test and clear referenced bit in storage key. | 611 | * Test and clear referenced bit in storage key. |
611 | */ | 612 | */ |
612 | #define page_test_and_clear_young(page) \ | 613 | #define page_test_and_clear_young(page) \ |
613 | ({ \ | 614 | ({ \ |
614 | struct page *__page = (page); \ | 615 | struct page *__page = (page); \ |
615 | unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \ | 616 | unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT);\ |
616 | int __ccode; \ | 617 | int __ccode; \ |
617 | asm volatile ("rrbe 0,%1\n\t" \ | 618 | asm volatile( \ |
618 | "ipm %0\n\t" \ | 619 | " rrbe 0,%1\n" \ |
619 | "srl %0,28\n\t" \ | 620 | " ipm %0\n" \ |
620 | : "=d" (__ccode) : "a" (__physpage) : "cc" ); \ | 621 | " srl %0,28\n" \ |
621 | (__ccode & 2); \ | 622 | : "=d" (__ccode) : "a" (__physpage) : "cc"); \ |
623 | (__ccode & 2); \ | ||
622 | }) | 624 | }) |
623 | 625 | ||
624 | /* | 626 | /* |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 578c2209fa76..cbbedc63ba25 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #ifndef __ASM_S390_PROCESSOR_H | 13 | #ifndef __ASM_S390_PROCESSOR_H |
14 | #define __ASM_S390_PROCESSOR_H | 14 | #define __ASM_S390_PROCESSOR_H |
15 | 15 | ||
16 | #include <asm/page.h> | ||
17 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
18 | 17 | ||
19 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
@@ -21,7 +20,7 @@ | |||
21 | * Default implementation of macro that returns current | 20 | * Default implementation of macro that returns current |
22 | * instruction pointer ("program counter"). | 21 | * instruction pointer ("program counter"). |
23 | */ | 22 | */ |
24 | #define current_text_addr() ({ void *pc; __asm__("basr %0,0":"=a"(pc)); pc; }) | 23 | #define current_text_addr() ({ void *pc; asm("basr %0,0" : "=a" (pc)); pc; }) |
25 | 24 | ||
26 | /* | 25 | /* |
27 | * CPU type and hardware bug flags. Kept separately for each CPU. | 26 | * CPU type and hardware bug flags. Kept separately for each CPU. |
@@ -202,7 +201,7 @@ unsigned long get_wchan(struct task_struct *p); | |||
202 | static inline void cpu_relax(void) | 201 | static inline void cpu_relax(void) |
203 | { | 202 | { |
204 | if (MACHINE_HAS_DIAG44) | 203 | if (MACHINE_HAS_DIAG44) |
205 | asm volatile ("diag 0,0,68" : : : "memory"); | 204 | asm volatile("diag 0,0,68" : : : "memory"); |
206 | else | 205 | else |
207 | barrier(); | 206 | barrier(); |
208 | } | 207 | } |
@@ -213,9 +212,9 @@ static inline void cpu_relax(void) | |||
213 | static inline void __load_psw(psw_t psw) | 212 | static inline void __load_psw(psw_t psw) |
214 | { | 213 | { |
215 | #ifndef __s390x__ | 214 | #ifndef __s390x__ |
216 | asm volatile ("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc" ); | 215 | asm volatile("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc"); |
217 | #else | 216 | #else |
218 | asm volatile ("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" ); | 217 | asm volatile("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc"); |
219 | #endif | 218 | #endif |
220 | } | 219 | } |
221 | 220 | ||
@@ -232,20 +231,20 @@ static inline void __load_psw_mask (unsigned long mask) | |||
232 | psw.mask = mask; | 231 | psw.mask = mask; |
233 | 232 | ||
234 | #ifndef __s390x__ | 233 | #ifndef __s390x__ |
235 | asm volatile ( | 234 | asm volatile( |
236 | " basr %0,0\n" | 235 | " basr %0,0\n" |
237 | "0: ahi %0,1f-0b\n" | 236 | "0: ahi %0,1f-0b\n" |
238 | " st %0,4(%1)\n" | 237 | " st %0,4(%1)\n" |
239 | " lpsw 0(%1)\n" | 238 | " lpsw 0(%1)\n" |
240 | "1:" | 239 | "1:" |
241 | : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" ); | 240 | : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc"); |
242 | #else /* __s390x__ */ | 241 | #else /* __s390x__ */ |
243 | asm volatile ( | 242 | asm volatile( |
244 | " larl %0,1f\n" | 243 | " larl %0,1f\n" |
245 | " stg %0,8(%1)\n" | 244 | " stg %0,8(%1)\n" |
246 | " lpswe 0(%1)\n" | 245 | " lpswe 0(%1)\n" |
247 | "1:" | 246 | "1:" |
248 | : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" ); | 247 | : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc"); |
249 | #endif /* __s390x__ */ | 248 | #endif /* __s390x__ */ |
250 | } | 249 | } |
251 | 250 | ||
@@ -274,56 +273,57 @@ static inline void disabled_wait(unsigned long code) | |||
274 | * the processor is dead afterwards | 273 | * the processor is dead afterwards |
275 | */ | 274 | */ |
276 | #ifndef __s390x__ | 275 | #ifndef __s390x__ |
277 | asm volatile (" stctl 0,0,0(%2)\n" | 276 | asm volatile( |
278 | " ni 0(%2),0xef\n" /* switch off protection */ | 277 | " stctl 0,0,0(%2)\n" |
279 | " lctl 0,0,0(%2)\n" | 278 | " ni 0(%2),0xef\n" /* switch off protection */ |
280 | " stpt 0xd8\n" /* store timer */ | 279 | " lctl 0,0,0(%2)\n" |
281 | " stckc 0xe0\n" /* store clock comparator */ | 280 | " stpt 0xd8\n" /* store timer */ |
282 | " stpx 0x108\n" /* store prefix register */ | 281 | " stckc 0xe0\n" /* store clock comparator */ |
283 | " stam 0,15,0x120\n" /* store access registers */ | 282 | " stpx 0x108\n" /* store prefix register */ |
284 | " std 0,0x160\n" /* store f0 */ | 283 | " stam 0,15,0x120\n" /* store access registers */ |
285 | " std 2,0x168\n" /* store f2 */ | 284 | " std 0,0x160\n" /* store f0 */ |
286 | " std 4,0x170\n" /* store f4 */ | 285 | " std 2,0x168\n" /* store f2 */ |
287 | " std 6,0x178\n" /* store f6 */ | 286 | " std 4,0x170\n" /* store f4 */ |
288 | " stm 0,15,0x180\n" /* store general registers */ | 287 | " std 6,0x178\n" /* store f6 */ |
289 | " stctl 0,15,0x1c0\n" /* store control registers */ | 288 | " stm 0,15,0x180\n" /* store general registers */ |
290 | " oi 0x1c0,0x10\n" /* fake protection bit */ | 289 | " stctl 0,15,0x1c0\n" /* store control registers */ |
291 | " lpsw 0(%1)" | 290 | " oi 0x1c0,0x10\n" /* fake protection bit */ |
292 | : "=m" (ctl_buf) | 291 | " lpsw 0(%1)" |
293 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" ); | 292 | : "=m" (ctl_buf) |
293 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc"); | ||
294 | #else /* __s390x__ */ | 294 | #else /* __s390x__ */ |
295 | asm volatile (" stctg 0,0,0(%2)\n" | 295 | asm volatile( |
296 | " ni 4(%2),0xef\n" /* switch off protection */ | 296 | " stctg 0,0,0(%2)\n" |
297 | " lctlg 0,0,0(%2)\n" | 297 | " ni 4(%2),0xef\n" /* switch off protection */ |
298 | " lghi 1,0x1000\n" | 298 | " lctlg 0,0,0(%2)\n" |
299 | " stpt 0x328(1)\n" /* store timer */ | 299 | " lghi 1,0x1000\n" |
300 | " stckc 0x330(1)\n" /* store clock comparator */ | 300 | " stpt 0x328(1)\n" /* store timer */ |
301 | " stpx 0x318(1)\n" /* store prefix register */ | 301 | " stckc 0x330(1)\n" /* store clock comparator */ |
302 | " stam 0,15,0x340(1)\n" /* store access registers */ | 302 | " stpx 0x318(1)\n" /* store prefix register */ |
303 | " stfpc 0x31c(1)\n" /* store fpu control */ | 303 | " stam 0,15,0x340(1)\n"/* store access registers */ |
304 | " std 0,0x200(1)\n" /* store f0 */ | 304 | " stfpc 0x31c(1)\n" /* store fpu control */ |
305 | " std 1,0x208(1)\n" /* store f1 */ | 305 | " std 0,0x200(1)\n" /* store f0 */ |
306 | " std 2,0x210(1)\n" /* store f2 */ | 306 | " std 1,0x208(1)\n" /* store f1 */ |
307 | " std 3,0x218(1)\n" /* store f3 */ | 307 | " std 2,0x210(1)\n" /* store f2 */ |
308 | " std 4,0x220(1)\n" /* store f4 */ | 308 | " std 3,0x218(1)\n" /* store f3 */ |
309 | " std 5,0x228(1)\n" /* store f5 */ | 309 | " std 4,0x220(1)\n" /* store f4 */ |
310 | " std 6,0x230(1)\n" /* store f6 */ | 310 | " std 5,0x228(1)\n" /* store f5 */ |
311 | " std 7,0x238(1)\n" /* store f7 */ | 311 | " std 6,0x230(1)\n" /* store f6 */ |
312 | " std 8,0x240(1)\n" /* store f8 */ | 312 | " std 7,0x238(1)\n" /* store f7 */ |
313 | " std 9,0x248(1)\n" /* store f9 */ | 313 | " std 8,0x240(1)\n" /* store f8 */ |
314 | " std 10,0x250(1)\n" /* store f10 */ | 314 | " std 9,0x248(1)\n" /* store f9 */ |
315 | " std 11,0x258(1)\n" /* store f11 */ | 315 | " std 10,0x250(1)\n" /* store f10 */ |
316 | " std 12,0x260(1)\n" /* store f12 */ | 316 | " std 11,0x258(1)\n" /* store f11 */ |
317 | " std 13,0x268(1)\n" /* store f13 */ | 317 | " std 12,0x260(1)\n" /* store f12 */ |
318 | " std 14,0x270(1)\n" /* store f14 */ | 318 | " std 13,0x268(1)\n" /* store f13 */ |
319 | " std 15,0x278(1)\n" /* store f15 */ | 319 | " std 14,0x270(1)\n" /* store f14 */ |
320 | " stmg 0,15,0x280(1)\n" /* store general registers */ | 320 | " std 15,0x278(1)\n" /* store f15 */ |
321 | " stctg 0,15,0x380(1)\n" /* store control registers */ | 321 | " stmg 0,15,0x280(1)\n"/* store general registers */ |
322 | " oi 0x384(1),0x10\n" /* fake protection bit */ | 322 | " stctg 0,15,0x380(1)\n"/* store control registers */ |
323 | " lpswe 0(%1)" | 323 | " oi 0x384(1),0x10\n"/* fake protection bit */ |
324 | : "=m" (ctl_buf) | 324 | " lpswe 0(%1)" |
325 | : "a" (&dw_psw), "a" (&ctl_buf), | 325 | : "=m" (ctl_buf) |
326 | "m" (dw_psw) : "cc", "0", "1"); | 326 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0"); |
327 | #endif /* __s390x__ */ | 327 | #endif /* __s390x__ */ |
328 | } | 328 | } |
329 | 329 | ||
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h index 4d75d77b0f99..8d2bf65b0b64 100644 --- a/include/asm-s390/ptrace.h +++ b/include/asm-s390/ptrace.h | |||
@@ -479,7 +479,7 @@ extern void show_regs(struct pt_regs * regs); | |||
479 | static inline void | 479 | static inline void |
480 | psw_set_key(unsigned int key) | 480 | psw_set_key(unsigned int key) |
481 | { | 481 | { |
482 | asm volatile ( "spka 0(%0)" : : "d" (key) ); | 482 | asm volatile("spka 0(%0)" : : "d" (key)); |
483 | } | 483 | } |
484 | 484 | ||
485 | #endif /* __ASSEMBLY__ */ | 485 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h index 13ec16965150..90f4eccaa290 100644 --- a/include/asm-s390/rwsem.h +++ b/include/asm-s390/rwsem.h | |||
@@ -122,23 +122,23 @@ static inline void __down_read(struct rw_semaphore *sem) | |||
122 | { | 122 | { |
123 | signed long old, new; | 123 | signed long old, new; |
124 | 124 | ||
125 | __asm__ __volatile__( | 125 | asm volatile( |
126 | #ifndef __s390x__ | 126 | #ifndef __s390x__ |
127 | " l %0,0(%3)\n" | 127 | " l %0,0(%3)\n" |
128 | "0: lr %1,%0\n" | 128 | "0: lr %1,%0\n" |
129 | " ahi %1,%5\n" | 129 | " ahi %1,%5\n" |
130 | " cs %0,%1,0(%3)\n" | 130 | " cs %0,%1,0(%3)\n" |
131 | " jl 0b" | 131 | " jl 0b" |
132 | #else /* __s390x__ */ | 132 | #else /* __s390x__ */ |
133 | " lg %0,0(%3)\n" | 133 | " lg %0,0(%3)\n" |
134 | "0: lgr %1,%0\n" | 134 | "0: lgr %1,%0\n" |
135 | " aghi %1,%5\n" | 135 | " aghi %1,%5\n" |
136 | " csg %0,%1,0(%3)\n" | 136 | " csg %0,%1,0(%3)\n" |
137 | " jl 0b" | 137 | " jl 0b" |
138 | #endif /* __s390x__ */ | 138 | #endif /* __s390x__ */ |
139 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 139 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
140 | : "a" (&sem->count), "m" (sem->count), | 140 | : "a" (&sem->count), "m" (sem->count), |
141 | "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" ); | 141 | "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory"); |
142 | if (old < 0) | 142 | if (old < 0) |
143 | rwsem_down_read_failed(sem); | 143 | rwsem_down_read_failed(sem); |
144 | } | 144 | } |
@@ -150,27 +150,27 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) | |||
150 | { | 150 | { |
151 | signed long old, new; | 151 | signed long old, new; |
152 | 152 | ||
153 | __asm__ __volatile__( | 153 | asm volatile( |
154 | #ifndef __s390x__ | 154 | #ifndef __s390x__ |
155 | " l %0,0(%3)\n" | 155 | " l %0,0(%3)\n" |
156 | "0: ltr %1,%0\n" | 156 | "0: ltr %1,%0\n" |
157 | " jm 1f\n" | 157 | " jm 1f\n" |
158 | " ahi %1,%5\n" | 158 | " ahi %1,%5\n" |
159 | " cs %0,%1,0(%3)\n" | 159 | " cs %0,%1,0(%3)\n" |
160 | " jl 0b\n" | 160 | " jl 0b\n" |
161 | "1:" | 161 | "1:" |
162 | #else /* __s390x__ */ | 162 | #else /* __s390x__ */ |
163 | " lg %0,0(%3)\n" | 163 | " lg %0,0(%3)\n" |
164 | "0: ltgr %1,%0\n" | 164 | "0: ltgr %1,%0\n" |
165 | " jm 1f\n" | 165 | " jm 1f\n" |
166 | " aghi %1,%5\n" | 166 | " aghi %1,%5\n" |
167 | " csg %0,%1,0(%3)\n" | 167 | " csg %0,%1,0(%3)\n" |
168 | " jl 0b\n" | 168 | " jl 0b\n" |
169 | "1:" | 169 | "1:" |
170 | #endif /* __s390x__ */ | 170 | #endif /* __s390x__ */ |
171 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 171 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
172 | : "a" (&sem->count), "m" (sem->count), | 172 | : "a" (&sem->count), "m" (sem->count), |
173 | "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" ); | 173 | "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory"); |
174 | return old >= 0 ? 1 : 0; | 174 | return old >= 0 ? 1 : 0; |
175 | } | 175 | } |
176 | 176 | ||
@@ -182,23 +182,23 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) | |||
182 | signed long old, new, tmp; | 182 | signed long old, new, tmp; |
183 | 183 | ||
184 | tmp = RWSEM_ACTIVE_WRITE_BIAS; | 184 | tmp = RWSEM_ACTIVE_WRITE_BIAS; |
185 | __asm__ __volatile__( | 185 | asm volatile( |
186 | #ifndef __s390x__ | 186 | #ifndef __s390x__ |
187 | " l %0,0(%3)\n" | 187 | " l %0,0(%3)\n" |
188 | "0: lr %1,%0\n" | 188 | "0: lr %1,%0\n" |
189 | " a %1,%5\n" | 189 | " a %1,%5\n" |
190 | " cs %0,%1,0(%3)\n" | 190 | " cs %0,%1,0(%3)\n" |
191 | " jl 0b" | 191 | " jl 0b" |
192 | #else /* __s390x__ */ | 192 | #else /* __s390x__ */ |
193 | " lg %0,0(%3)\n" | 193 | " lg %0,0(%3)\n" |
194 | "0: lgr %1,%0\n" | 194 | "0: lgr %1,%0\n" |
195 | " ag %1,%5\n" | 195 | " ag %1,%5\n" |
196 | " csg %0,%1,0(%3)\n" | 196 | " csg %0,%1,0(%3)\n" |
197 | " jl 0b" | 197 | " jl 0b" |
198 | #endif /* __s390x__ */ | 198 | #endif /* __s390x__ */ |
199 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 199 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
200 | : "a" (&sem->count), "m" (sem->count), "m" (tmp) | 200 | : "a" (&sem->count), "m" (sem->count), "m" (tmp) |
201 | : "cc", "memory" ); | 201 | : "cc", "memory"); |
202 | if (old != 0) | 202 | if (old != 0) |
203 | rwsem_down_write_failed(sem); | 203 | rwsem_down_write_failed(sem); |
204 | } | 204 | } |
@@ -215,24 +215,24 @@ static inline int __down_write_trylock(struct rw_semaphore *sem) | |||
215 | { | 215 | { |
216 | signed long old; | 216 | signed long old; |
217 | 217 | ||
218 | __asm__ __volatile__( | 218 | asm volatile( |
219 | #ifndef __s390x__ | 219 | #ifndef __s390x__ |
220 | " l %0,0(%2)\n" | 220 | " l %0,0(%2)\n" |
221 | "0: ltr %0,%0\n" | 221 | "0: ltr %0,%0\n" |
222 | " jnz 1f\n" | 222 | " jnz 1f\n" |
223 | " cs %0,%4,0(%2)\n" | 223 | " cs %0,%4,0(%2)\n" |
224 | " jl 0b\n" | 224 | " jl 0b\n" |
225 | #else /* __s390x__ */ | 225 | #else /* __s390x__ */ |
226 | " lg %0,0(%2)\n" | 226 | " lg %0,0(%2)\n" |
227 | "0: ltgr %0,%0\n" | 227 | "0: ltgr %0,%0\n" |
228 | " jnz 1f\n" | 228 | " jnz 1f\n" |
229 | " csg %0,%4,0(%2)\n" | 229 | " csg %0,%4,0(%2)\n" |
230 | " jl 0b\n" | 230 | " jl 0b\n" |
231 | #endif /* __s390x__ */ | 231 | #endif /* __s390x__ */ |
232 | "1:" | 232 | "1:" |
233 | : "=&d" (old), "=m" (sem->count) | 233 | : "=&d" (old), "=m" (sem->count) |
234 | : "a" (&sem->count), "m" (sem->count), | 234 | : "a" (&sem->count), "m" (sem->count), |
235 | "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory" ); | 235 | "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory"); |
236 | return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0; | 236 | return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0; |
237 | } | 237 | } |
238 | 238 | ||
@@ -243,24 +243,24 @@ static inline void __up_read(struct rw_semaphore *sem) | |||
243 | { | 243 | { |
244 | signed long old, new; | 244 | signed long old, new; |
245 | 245 | ||
246 | __asm__ __volatile__( | 246 | asm volatile( |
247 | #ifndef __s390x__ | 247 | #ifndef __s390x__ |
248 | " l %0,0(%3)\n" | 248 | " l %0,0(%3)\n" |
249 | "0: lr %1,%0\n" | 249 | "0: lr %1,%0\n" |
250 | " ahi %1,%5\n" | 250 | " ahi %1,%5\n" |
251 | " cs %0,%1,0(%3)\n" | 251 | " cs %0,%1,0(%3)\n" |
252 | " jl 0b" | 252 | " jl 0b" |
253 | #else /* __s390x__ */ | 253 | #else /* __s390x__ */ |
254 | " lg %0,0(%3)\n" | 254 | " lg %0,0(%3)\n" |
255 | "0: lgr %1,%0\n" | 255 | "0: lgr %1,%0\n" |
256 | " aghi %1,%5\n" | 256 | " aghi %1,%5\n" |
257 | " csg %0,%1,0(%3)\n" | 257 | " csg %0,%1,0(%3)\n" |
258 | " jl 0b" | 258 | " jl 0b" |
259 | #endif /* __s390x__ */ | 259 | #endif /* __s390x__ */ |
260 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 260 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
261 | : "a" (&sem->count), "m" (sem->count), | 261 | : "a" (&sem->count), "m" (sem->count), |
262 | "i" (-RWSEM_ACTIVE_READ_BIAS) | 262 | "i" (-RWSEM_ACTIVE_READ_BIAS) |
263 | : "cc", "memory" ); | 263 | : "cc", "memory"); |
264 | if (new < 0) | 264 | if (new < 0) |
265 | if ((new & RWSEM_ACTIVE_MASK) == 0) | 265 | if ((new & RWSEM_ACTIVE_MASK) == 0) |
266 | rwsem_wake(sem); | 266 | rwsem_wake(sem); |
@@ -274,23 +274,23 @@ static inline void __up_write(struct rw_semaphore *sem) | |||
274 | signed long old, new, tmp; | 274 | signed long old, new, tmp; |
275 | 275 | ||
276 | tmp = -RWSEM_ACTIVE_WRITE_BIAS; | 276 | tmp = -RWSEM_ACTIVE_WRITE_BIAS; |
277 | __asm__ __volatile__( | 277 | asm volatile( |
278 | #ifndef __s390x__ | 278 | #ifndef __s390x__ |
279 | " l %0,0(%3)\n" | 279 | " l %0,0(%3)\n" |
280 | "0: lr %1,%0\n" | 280 | "0: lr %1,%0\n" |
281 | " a %1,%5\n" | 281 | " a %1,%5\n" |
282 | " cs %0,%1,0(%3)\n" | 282 | " cs %0,%1,0(%3)\n" |
283 | " jl 0b" | 283 | " jl 0b" |
284 | #else /* __s390x__ */ | 284 | #else /* __s390x__ */ |
285 | " lg %0,0(%3)\n" | 285 | " lg %0,0(%3)\n" |
286 | "0: lgr %1,%0\n" | 286 | "0: lgr %1,%0\n" |
287 | " ag %1,%5\n" | 287 | " ag %1,%5\n" |
288 | " csg %0,%1,0(%3)\n" | 288 | " csg %0,%1,0(%3)\n" |
289 | " jl 0b" | 289 | " jl 0b" |
290 | #endif /* __s390x__ */ | 290 | #endif /* __s390x__ */ |
291 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 291 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
292 | : "a" (&sem->count), "m" (sem->count), "m" (tmp) | 292 | : "a" (&sem->count), "m" (sem->count), "m" (tmp) |
293 | : "cc", "memory" ); | 293 | : "cc", "memory"); |
294 | if (new < 0) | 294 | if (new < 0) |
295 | if ((new & RWSEM_ACTIVE_MASK) == 0) | 295 | if ((new & RWSEM_ACTIVE_MASK) == 0) |
296 | rwsem_wake(sem); | 296 | rwsem_wake(sem); |
@@ -304,23 +304,23 @@ static inline void __downgrade_write(struct rw_semaphore *sem) | |||
304 | signed long old, new, tmp; | 304 | signed long old, new, tmp; |
305 | 305 | ||
306 | tmp = -RWSEM_WAITING_BIAS; | 306 | tmp = -RWSEM_WAITING_BIAS; |
307 | __asm__ __volatile__( | 307 | asm volatile( |
308 | #ifndef __s390x__ | 308 | #ifndef __s390x__ |
309 | " l %0,0(%3)\n" | 309 | " l %0,0(%3)\n" |
310 | "0: lr %1,%0\n" | 310 | "0: lr %1,%0\n" |
311 | " a %1,%5\n" | 311 | " a %1,%5\n" |
312 | " cs %0,%1,0(%3)\n" | 312 | " cs %0,%1,0(%3)\n" |
313 | " jl 0b" | 313 | " jl 0b" |
314 | #else /* __s390x__ */ | 314 | #else /* __s390x__ */ |
315 | " lg %0,0(%3)\n" | 315 | " lg %0,0(%3)\n" |
316 | "0: lgr %1,%0\n" | 316 | "0: lgr %1,%0\n" |
317 | " ag %1,%5\n" | 317 | " ag %1,%5\n" |
318 | " csg %0,%1,0(%3)\n" | 318 | " csg %0,%1,0(%3)\n" |
319 | " jl 0b" | 319 | " jl 0b" |
320 | #endif /* __s390x__ */ | 320 | #endif /* __s390x__ */ |
321 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 321 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
322 | : "a" (&sem->count), "m" (sem->count), "m" (tmp) | 322 | : "a" (&sem->count), "m" (sem->count), "m" (tmp) |
323 | : "cc", "memory" ); | 323 | : "cc", "memory"); |
324 | if (new > 1) | 324 | if (new > 1) |
325 | rwsem_downgrade_wake(sem); | 325 | rwsem_downgrade_wake(sem); |
326 | } | 326 | } |
@@ -332,23 +332,23 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem) | |||
332 | { | 332 | { |
333 | signed long old, new; | 333 | signed long old, new; |
334 | 334 | ||
335 | __asm__ __volatile__( | 335 | asm volatile( |
336 | #ifndef __s390x__ | 336 | #ifndef __s390x__ |
337 | " l %0,0(%3)\n" | 337 | " l %0,0(%3)\n" |
338 | "0: lr %1,%0\n" | 338 | "0: lr %1,%0\n" |
339 | " ar %1,%5\n" | 339 | " ar %1,%5\n" |
340 | " cs %0,%1,0(%3)\n" | 340 | " cs %0,%1,0(%3)\n" |
341 | " jl 0b" | 341 | " jl 0b" |
342 | #else /* __s390x__ */ | 342 | #else /* __s390x__ */ |
343 | " lg %0,0(%3)\n" | 343 | " lg %0,0(%3)\n" |
344 | "0: lgr %1,%0\n" | 344 | "0: lgr %1,%0\n" |
345 | " agr %1,%5\n" | 345 | " agr %1,%5\n" |
346 | " csg %0,%1,0(%3)\n" | 346 | " csg %0,%1,0(%3)\n" |
347 | " jl 0b" | 347 | " jl 0b" |
348 | #endif /* __s390x__ */ | 348 | #endif /* __s390x__ */ |
349 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 349 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
350 | : "a" (&sem->count), "m" (sem->count), "d" (delta) | 350 | : "a" (&sem->count), "m" (sem->count), "d" (delta) |
351 | : "cc", "memory" ); | 351 | : "cc", "memory"); |
352 | } | 352 | } |
353 | 353 | ||
354 | /* | 354 | /* |
@@ -358,23 +358,23 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) | |||
358 | { | 358 | { |
359 | signed long old, new; | 359 | signed long old, new; |
360 | 360 | ||
361 | __asm__ __volatile__( | 361 | asm volatile( |
362 | #ifndef __s390x__ | 362 | #ifndef __s390x__ |
363 | " l %0,0(%3)\n" | 363 | " l %0,0(%3)\n" |
364 | "0: lr %1,%0\n" | 364 | "0: lr %1,%0\n" |
365 | " ar %1,%5\n" | 365 | " ar %1,%5\n" |
366 | " cs %0,%1,0(%3)\n" | 366 | " cs %0,%1,0(%3)\n" |
367 | " jl 0b" | 367 | " jl 0b" |
368 | #else /* __s390x__ */ | 368 | #else /* __s390x__ */ |
369 | " lg %0,0(%3)\n" | 369 | " lg %0,0(%3)\n" |
370 | "0: lgr %1,%0\n" | 370 | "0: lgr %1,%0\n" |
371 | " agr %1,%5\n" | 371 | " agr %1,%5\n" |
372 | " csg %0,%1,0(%3)\n" | 372 | " csg %0,%1,0(%3)\n" |
373 | " jl 0b" | 373 | " jl 0b" |
374 | #endif /* __s390x__ */ | 374 | #endif /* __s390x__ */ |
375 | : "=&d" (old), "=&d" (new), "=m" (sem->count) | 375 | : "=&d" (old), "=&d" (new), "=m" (sem->count) |
376 | : "a" (&sem->count), "m" (sem->count), "d" (delta) | 376 | : "a" (&sem->count), "m" (sem->count), "d" (delta) |
377 | : "cc", "memory" ); | 377 | : "cc", "memory"); |
378 | return new; | 378 | return new; |
379 | } | 379 | } |
380 | 380 | ||
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h index 32cdc69f39f4..dbce058aefa9 100644 --- a/include/asm-s390/semaphore.h +++ b/include/asm-s390/semaphore.h | |||
@@ -85,17 +85,17 @@ static inline int down_trylock(struct semaphore * sem) | |||
85 | * sem->count.counter = --new_val; | 85 | * sem->count.counter = --new_val; |
86 | * In the ppc code this is called atomic_dec_if_positive. | 86 | * In the ppc code this is called atomic_dec_if_positive. |
87 | */ | 87 | */ |
88 | __asm__ __volatile__ ( | 88 | asm volatile( |
89 | " l %0,0(%3)\n" | 89 | " l %0,0(%3)\n" |
90 | "0: ltr %1,%0\n" | 90 | "0: ltr %1,%0\n" |
91 | " jle 1f\n" | 91 | " jle 1f\n" |
92 | " ahi %1,-1\n" | 92 | " ahi %1,-1\n" |
93 | " cs %0,%1,0(%3)\n" | 93 | " cs %0,%1,0(%3)\n" |
94 | " jl 0b\n" | 94 | " jl 0b\n" |
95 | "1:" | 95 | "1:" |
96 | : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter) | 96 | : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter) |
97 | : "a" (&sem->count.counter), "m" (sem->count.counter) | 97 | : "a" (&sem->count.counter), "m" (sem->count.counter) |
98 | : "cc", "memory" ); | 98 | : "cc", "memory"); |
99 | return old_val <= 0; | 99 | return old_val <= 0; |
100 | } | 100 | } |
101 | 101 | ||
diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h index de69dfa46fbb..8ca8c77b2d04 100644 --- a/include/asm-s390/sfp-machine.h +++ b/include/asm-s390/sfp-machine.h | |||
@@ -76,21 +76,23 @@ | |||
76 | unsigned int __r2 = (x2) + (y2); \ | 76 | unsigned int __r2 = (x2) + (y2); \ |
77 | unsigned int __r1 = (x1); \ | 77 | unsigned int __r1 = (x1); \ |
78 | unsigned int __r0 = (x0); \ | 78 | unsigned int __r0 = (x0); \ |
79 | __asm__ (" alr %2,%3\n" \ | 79 | asm volatile( \ |
80 | " brc 12,0f\n" \ | 80 | " alr %2,%3\n" \ |
81 | " lhi 0,1\n" \ | 81 | " brc 12,0f\n" \ |
82 | " alr %1,0\n" \ | 82 | " lhi 0,1\n" \ |
83 | " brc 12,0f\n" \ | 83 | " alr %1,0\n" \ |
84 | " alr %0,0\n" \ | 84 | " brc 12,0f\n" \ |
85 | "0:" \ | 85 | " alr %0,0\n" \ |
86 | : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \ | 86 | "0:" \ |
87 | : "d" (y0), "i" (1) : "cc", "0" ); \ | 87 | : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \ |
88 | __asm__ (" alr %1,%2\n" \ | 88 | : "d" (y0), "i" (1) : "cc", "0" ); \ |
89 | " brc 12,0f\n" \ | 89 | asm volatile( \ |
90 | " ahi %0,1\n" \ | 90 | " alr %1,%2\n" \ |
91 | "0:" \ | 91 | " brc 12,0f\n" \ |
92 | : "+&d" (__r2), "+&d" (__r1) \ | 92 | " ahi %0,1\n" \ |
93 | : "d" (y1) : "cc" ); \ | 93 | "0:" \ |
94 | : "+&d" (__r2), "+&d" (__r1) \ | ||
95 | : "d" (y1) : "cc"); \ | ||
94 | (r2) = __r2; \ | 96 | (r2) = __r2; \ |
95 | (r1) = __r1; \ | 97 | (r1) = __r1; \ |
96 | (r0) = __r0; \ | 98 | (r0) = __r0; \ |
@@ -100,21 +102,23 @@ | |||
100 | unsigned int __r2 = (x2) - (y2); \ | 102 | unsigned int __r2 = (x2) - (y2); \ |
101 | unsigned int __r1 = (x1); \ | 103 | unsigned int __r1 = (x1); \ |
102 | unsigned int __r0 = (x0); \ | 104 | unsigned int __r0 = (x0); \ |
103 | __asm__ (" slr %2,%3\n" \ | 105 | asm volatile( \ |
104 | " brc 3,0f\n" \ | 106 | " slr %2,%3\n" \ |
105 | " lhi 0,1\n" \ | 107 | " brc 3,0f\n" \ |
106 | " slr %1,0\n" \ | 108 | " lhi 0,1\n" \ |
107 | " brc 3,0f\n" \ | 109 | " slr %1,0\n" \ |
108 | " slr %0,0\n" \ | 110 | " brc 3,0f\n" \ |
109 | "0:" \ | 111 | " slr %0,0\n" \ |
110 | : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \ | 112 | "0:" \ |
111 | : "d" (y0) : "cc", "0" ); \ | 113 | : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \ |
112 | __asm__ (" slr %1,%2\n" \ | 114 | : "d" (y0) : "cc", "0"); \ |
113 | " brc 3,0f\n" \ | 115 | asm volatile( \ |
114 | " ahi %0,-1\n" \ | 116 | " slr %1,%2\n" \ |
115 | "0:" \ | 117 | " brc 3,0f\n" \ |
116 | : "+&d" (__r2), "+&d" (__r1) \ | 118 | " ahi %0,-1\n" \ |
117 | : "d" (y1) : "cc" ); \ | 119 | "0:" \ |
120 | : "+&d" (__r2), "+&d" (__r1) \ | ||
121 | : "d" (y1) : "cc"); \ | ||
118 | (r2) = __r2; \ | 122 | (r2) = __r2; \ |
119 | (r1) = __r1; \ | 123 | (r1) = __r1; \ |
120 | (r0) = __r0; \ | 124 | (r0) = __r0; \ |
diff --git a/include/asm-s390/sigp.h b/include/asm-s390/sigp.h index fc56458aff66..e16d56f8dfe1 100644 --- a/include/asm-s390/sigp.h +++ b/include/asm-s390/sigp.h | |||
@@ -70,16 +70,16 @@ typedef enum | |||
70 | static inline sigp_ccode | 70 | static inline sigp_ccode |
71 | signal_processor(__u16 cpu_addr, sigp_order_code order_code) | 71 | signal_processor(__u16 cpu_addr, sigp_order_code order_code) |
72 | { | 72 | { |
73 | register unsigned long reg1 asm ("1") = 0; | ||
73 | sigp_ccode ccode; | 74 | sigp_ccode ccode; |
74 | 75 | ||
75 | __asm__ __volatile__( | 76 | asm volatile( |
76 | " sr 1,1\n" /* parameter=0 in gpr 1 */ | 77 | " sigp %1,%2,0(%3)\n" |
77 | " sigp 1,%1,0(%2)\n" | 78 | " ipm %0\n" |
78 | " ipm %0\n" | 79 | " srl %0,28\n" |
79 | " srl %0,28\n" | 80 | : "=d" (ccode) |
80 | : "=d" (ccode) | 81 | : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), |
81 | : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) | 82 | "a" (order_code) : "cc" , "memory"); |
82 | : "cc" , "memory", "1" ); | ||
83 | return ccode; | 83 | return ccode; |
84 | } | 84 | } |
85 | 85 | ||
@@ -87,20 +87,18 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code) | |||
87 | * Signal processor with parameter | 87 | * Signal processor with parameter |
88 | */ | 88 | */ |
89 | static inline sigp_ccode | 89 | static inline sigp_ccode |
90 | signal_processor_p(__u32 parameter, __u16 cpu_addr, | 90 | signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code) |
91 | sigp_order_code order_code) | ||
92 | { | 91 | { |
92 | register unsigned int reg1 asm ("1") = parameter; | ||
93 | sigp_ccode ccode; | 93 | sigp_ccode ccode; |
94 | 94 | ||
95 | __asm__ __volatile__( | 95 | asm volatile( |
96 | " lr 1,%1\n" /* parameter in gpr 1 */ | 96 | " sigp %1,%2,0(%3)\n" |
97 | " sigp 1,%2,0(%3)\n" | 97 | " ipm %0\n" |
98 | " ipm %0\n" | 98 | " srl %0,28\n" |
99 | " srl %0,28\n" | ||
100 | : "=d" (ccode) | 99 | : "=d" (ccode) |
101 | : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]), | 100 | : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), |
102 | "a" (order_code) | 101 | "a" (order_code) : "cc" , "memory"); |
103 | : "cc" , "memory", "1" ); | ||
104 | return ccode; | 102 | return ccode; |
105 | } | 103 | } |
106 | 104 | ||
@@ -108,24 +106,21 @@ signal_processor_p(__u32 parameter, __u16 cpu_addr, | |||
108 | * Signal processor with parameter and return status | 106 | * Signal processor with parameter and return status |
109 | */ | 107 | */ |
110 | static inline sigp_ccode | 108 | static inline sigp_ccode |
111 | signal_processor_ps(__u32 *statusptr, __u32 parameter, | 109 | signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr, |
112 | __u16 cpu_addr, sigp_order_code order_code) | 110 | sigp_order_code order_code) |
113 | { | 111 | { |
112 | register unsigned int reg1 asm ("1") = parameter; | ||
114 | sigp_ccode ccode; | 113 | sigp_ccode ccode; |
115 | 114 | ||
116 | __asm__ __volatile__( | 115 | asm volatile( |
117 | " sr 2,2\n" /* clear status */ | 116 | " sigp %1,%2,0(%3)\n" |
118 | " lr 3,%2\n" /* parameter in gpr 3 */ | 117 | " ipm %0\n" |
119 | " sigp 2,%3,0(%4)\n" | 118 | " srl %0,28\n" |
120 | " st 2,%1\n" | 119 | : "=d" (ccode), "+d" (reg1) |
121 | " ipm %0\n" | 120 | : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) |
122 | " srl %0,28\n" | 121 | : "cc" , "memory"); |
123 | : "=d" (ccode), "=m" (*statusptr) | 122 | *statusptr = reg1; |
124 | : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]), | 123 | return ccode; |
125 | "a" (order_code) | ||
126 | : "cc" , "memory", "2" , "3" | ||
127 | ); | ||
128 | return ccode; | ||
129 | } | 124 | } |
130 | 125 | ||
131 | #endif /* __SIGP__ */ | 126 | #endif /* __SIGP__ */ |
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index 9fb02e9779c9..c3cf030ada4d 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h | |||
@@ -56,7 +56,7 @@ static inline __u16 hard_smp_processor_id(void) | |||
56 | { | 56 | { |
57 | __u16 cpu_address; | 57 | __u16 cpu_address; |
58 | 58 | ||
59 | __asm__ ("stap %0\n" : "=m" (cpu_address)); | 59 | asm volatile("stap %0" : "=m" (cpu_address)); |
60 | return cpu_address; | 60 | return cpu_address; |
61 | } | 61 | } |
62 | 62 | ||
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h index 273dbecf8ace..ce3edf6d63b3 100644 --- a/include/asm-s390/spinlock.h +++ b/include/asm-s390/spinlock.h | |||
@@ -11,17 +11,36 @@ | |||
11 | #ifndef __ASM_SPINLOCK_H | 11 | #ifndef __ASM_SPINLOCK_H |
12 | #define __ASM_SPINLOCK_H | 12 | #define __ASM_SPINLOCK_H |
13 | 13 | ||
14 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) | ||
15 | |||
16 | static inline int | ||
17 | _raw_compare_and_swap(volatile unsigned int *lock, | ||
18 | unsigned int old, unsigned int new) | ||
19 | { | ||
20 | asm volatile( | ||
21 | " cs %0,%3,%1" | ||
22 | : "=d" (old), "=Q" (*lock) | ||
23 | : "0" (old), "d" (new), "Q" (*lock) | ||
24 | : "cc", "memory" ); | ||
25 | return old; | ||
26 | } | ||
27 | |||
28 | #else /* __GNUC__ */ | ||
29 | |||
14 | static inline int | 30 | static inline int |
15 | _raw_compare_and_swap(volatile unsigned int *lock, | 31 | _raw_compare_and_swap(volatile unsigned int *lock, |
16 | unsigned int old, unsigned int new) | 32 | unsigned int old, unsigned int new) |
17 | { | 33 | { |
18 | asm volatile ("cs %0,%3,0(%4)" | 34 | asm volatile( |
19 | : "=d" (old), "=m" (*lock) | 35 | " cs %0,%3,0(%4)" |
20 | : "0" (old), "d" (new), "a" (lock), "m" (*lock) | 36 | : "=d" (old), "=m" (*lock) |
21 | : "cc", "memory" ); | 37 | : "0" (old), "d" (new), "a" (lock), "m" (*lock) |
38 | : "cc", "memory" ); | ||
22 | return old; | 39 | return old; |
23 | } | 40 | } |
24 | 41 | ||
42 | #endif /* __GNUC__ */ | ||
43 | |||
25 | /* | 44 | /* |
26 | * Simple spin lock operations. There are two variants, one clears IRQ's | 45 | * Simple spin lock operations. There are two variants, one clears IRQ's |
27 | * on the local processor, one does not. | 46 | * on the local processor, one does not. |
diff --git a/include/asm-s390/string.h b/include/asm-s390/string.h index 23a4c390489f..d074673a6d9b 100644 --- a/include/asm-s390/string.h +++ b/include/asm-s390/string.h | |||
@@ -60,12 +60,13 @@ static inline void *memchr(const void * s, int c, size_t n) | |||
60 | register int r0 asm("0") = (char) c; | 60 | register int r0 asm("0") = (char) c; |
61 | const void *ret = s + n; | 61 | const void *ret = s + n; |
62 | 62 | ||
63 | asm volatile ("0: srst %0,%1\n" | 63 | asm volatile( |
64 | " jo 0b\n" | 64 | "0: srst %0,%1\n" |
65 | " jl 1f\n" | 65 | " jo 0b\n" |
66 | " la %0,0\n" | 66 | " jl 1f\n" |
67 | "1:" | 67 | " la %0,0\n" |
68 | : "+a" (ret), "+&a" (s) : "d" (r0) : "cc" ); | 68 | "1:" |
69 | : "+a" (ret), "+&a" (s) : "d" (r0) : "cc"); | ||
69 | return (void *) ret; | 70 | return (void *) ret; |
70 | } | 71 | } |
71 | 72 | ||
@@ -74,9 +75,10 @@ static inline void *memscan(void *s, int c, size_t n) | |||
74 | register int r0 asm("0") = (char) c; | 75 | register int r0 asm("0") = (char) c; |
75 | const void *ret = s + n; | 76 | const void *ret = s + n; |
76 | 77 | ||
77 | asm volatile ("0: srst %0,%1\n" | 78 | asm volatile( |
78 | " jo 0b\n" | 79 | "0: srst %0,%1\n" |
79 | : "+a" (ret), "+&a" (s) : "d" (r0) : "cc" ); | 80 | " jo 0b\n" |
81 | : "+a" (ret), "+&a" (s) : "d" (r0) : "cc"); | ||
80 | return (void *) ret; | 82 | return (void *) ret; |
81 | } | 83 | } |
82 | 84 | ||
@@ -86,12 +88,13 @@ static inline char *strcat(char *dst, const char *src) | |||
86 | unsigned long dummy; | 88 | unsigned long dummy; |
87 | char *ret = dst; | 89 | char *ret = dst; |
88 | 90 | ||
89 | asm volatile ("0: srst %0,%1\n" | 91 | asm volatile( |
90 | " jo 0b\n" | 92 | "0: srst %0,%1\n" |
91 | "1: mvst %0,%2\n" | 93 | " jo 0b\n" |
92 | " jo 1b" | 94 | "1: mvst %0,%2\n" |
93 | : "=&a" (dummy), "+a" (dst), "+a" (src) | 95 | " jo 1b" |
94 | : "d" (r0), "0" (0) : "cc", "memory" ); | 96 | : "=&a" (dummy), "+a" (dst), "+a" (src) |
97 | : "d" (r0), "0" (0) : "cc", "memory" ); | ||
95 | return ret; | 98 | return ret; |
96 | } | 99 | } |
97 | 100 | ||
@@ -100,10 +103,11 @@ static inline char *strcpy(char *dst, const char *src) | |||
100 | register int r0 asm("0") = 0; | 103 | register int r0 asm("0") = 0; |
101 | char *ret = dst; | 104 | char *ret = dst; |
102 | 105 | ||
103 | asm volatile ("0: mvst %0,%1\n" | 106 | asm volatile( |
104 | " jo 0b" | 107 | "0: mvst %0,%1\n" |
105 | : "+&a" (dst), "+&a" (src) : "d" (r0) | 108 | " jo 0b" |
106 | : "cc", "memory" ); | 109 | : "+&a" (dst), "+&a" (src) : "d" (r0) |
110 | : "cc", "memory"); | ||
107 | return ret; | 111 | return ret; |
108 | } | 112 | } |
109 | 113 | ||
@@ -112,9 +116,10 @@ static inline size_t strlen(const char *s) | |||
112 | register unsigned long r0 asm("0") = 0; | 116 | register unsigned long r0 asm("0") = 0; |
113 | const char *tmp = s; | 117 | const char *tmp = s; |
114 | 118 | ||
115 | asm volatile ("0: srst %0,%1\n" | 119 | asm volatile( |
116 | " jo 0b" | 120 | "0: srst %0,%1\n" |
117 | : "+d" (r0), "+a" (tmp) : : "cc" ); | 121 | " jo 0b" |
122 | : "+d" (r0), "+a" (tmp) : : "cc"); | ||
118 | return r0 - (unsigned long) s; | 123 | return r0 - (unsigned long) s; |
119 | } | 124 | } |
120 | 125 | ||
@@ -124,9 +129,10 @@ static inline size_t strnlen(const char * s, size_t n) | |||
124 | const char *tmp = s; | 129 | const char *tmp = s; |
125 | const char *end = s + n; | 130 | const char *end = s + n; |
126 | 131 | ||
127 | asm volatile ("0: srst %0,%1\n" | 132 | asm volatile( |
128 | " jo 0b" | 133 | "0: srst %0,%1\n" |
129 | : "+a" (end), "+a" (tmp) : "d" (r0) : "cc" ); | 134 | " jo 0b" |
135 | : "+a" (end), "+a" (tmp) : "d" (r0) : "cc"); | ||
130 | return end - s; | 136 | return end - s; |
131 | } | 137 | } |
132 | 138 | ||
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 16040048cd1b..ccbafe4bf2cb 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h | |||
@@ -23,74 +23,68 @@ struct task_struct; | |||
23 | 23 | ||
24 | extern struct task_struct *__switch_to(void *, void *); | 24 | extern struct task_struct *__switch_to(void *, void *); |
25 | 25 | ||
26 | #ifdef __s390x__ | ||
27 | #define __FLAG_SHIFT 56 | ||
28 | #else /* ! __s390x__ */ | ||
29 | #define __FLAG_SHIFT 24 | ||
30 | #endif /* ! __s390x__ */ | ||
31 | |||
32 | static inline void save_fp_regs(s390_fp_regs *fpregs) | 26 | static inline void save_fp_regs(s390_fp_regs *fpregs) |
33 | { | 27 | { |
34 | asm volatile ( | 28 | asm volatile( |
35 | " std 0,8(%1)\n" | 29 | " std 0,8(%1)\n" |
36 | " std 2,24(%1)\n" | 30 | " std 2,24(%1)\n" |
37 | " std 4,40(%1)\n" | 31 | " std 4,40(%1)\n" |
38 | " std 6,56(%1)" | 32 | " std 6,56(%1)" |
39 | : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" ); | 33 | : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory"); |
40 | if (!MACHINE_HAS_IEEE) | 34 | if (!MACHINE_HAS_IEEE) |
41 | return; | 35 | return; |
42 | asm volatile( | 36 | asm volatile( |
43 | " stfpc 0(%1)\n" | 37 | " stfpc 0(%1)\n" |
44 | " std 1,16(%1)\n" | 38 | " std 1,16(%1)\n" |
45 | " std 3,32(%1)\n" | 39 | " std 3,32(%1)\n" |
46 | " std 5,48(%1)\n" | 40 | " std 5,48(%1)\n" |
47 | " std 7,64(%1)\n" | 41 | " std 7,64(%1)\n" |
48 | " std 8,72(%1)\n" | 42 | " std 8,72(%1)\n" |
49 | " std 9,80(%1)\n" | 43 | " std 9,80(%1)\n" |
50 | " std 10,88(%1)\n" | 44 | " std 10,88(%1)\n" |
51 | " std 11,96(%1)\n" | 45 | " std 11,96(%1)\n" |
52 | " std 12,104(%1)\n" | 46 | " std 12,104(%1)\n" |
53 | " std 13,112(%1)\n" | 47 | " std 13,112(%1)\n" |
54 | " std 14,120(%1)\n" | 48 | " std 14,120(%1)\n" |
55 | " std 15,128(%1)\n" | 49 | " std 15,128(%1)\n" |
56 | : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" ); | 50 | : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory"); |
57 | } | 51 | } |
58 | 52 | ||
59 | static inline void restore_fp_regs(s390_fp_regs *fpregs) | 53 | static inline void restore_fp_regs(s390_fp_regs *fpregs) |
60 | { | 54 | { |
61 | asm volatile ( | 55 | asm volatile( |
62 | " ld 0,8(%0)\n" | 56 | " ld 0,8(%0)\n" |
63 | " ld 2,24(%0)\n" | 57 | " ld 2,24(%0)\n" |
64 | " ld 4,40(%0)\n" | 58 | " ld 4,40(%0)\n" |
65 | " ld 6,56(%0)" | 59 | " ld 6,56(%0)" |
66 | : : "a" (fpregs), "m" (*fpregs) ); | 60 | : : "a" (fpregs), "m" (*fpregs)); |
67 | if (!MACHINE_HAS_IEEE) | 61 | if (!MACHINE_HAS_IEEE) |
68 | return; | 62 | return; |
69 | asm volatile( | 63 | asm volatile( |
70 | " lfpc 0(%0)\n" | 64 | " lfpc 0(%0)\n" |
71 | " ld 1,16(%0)\n" | 65 | " ld 1,16(%0)\n" |
72 | " ld 3,32(%0)\n" | 66 | " ld 3,32(%0)\n" |
73 | " ld 5,48(%0)\n" | 67 | " ld 5,48(%0)\n" |
74 | " ld 7,64(%0)\n" | 68 | " ld 7,64(%0)\n" |
75 | " ld 8,72(%0)\n" | 69 | " ld 8,72(%0)\n" |
76 | " ld 9,80(%0)\n" | 70 | " ld 9,80(%0)\n" |
77 | " ld 10,88(%0)\n" | 71 | " ld 10,88(%0)\n" |
78 | " ld 11,96(%0)\n" | 72 | " ld 11,96(%0)\n" |
79 | " ld 12,104(%0)\n" | 73 | " ld 12,104(%0)\n" |
80 | " ld 13,112(%0)\n" | 74 | " ld 13,112(%0)\n" |
81 | " ld 14,120(%0)\n" | 75 | " ld 14,120(%0)\n" |
82 | " ld 15,128(%0)\n" | 76 | " ld 15,128(%0)\n" |
83 | : : "a" (fpregs), "m" (*fpregs) ); | 77 | : : "a" (fpregs), "m" (*fpregs)); |
84 | } | 78 | } |
85 | 79 | ||
86 | static inline void save_access_regs(unsigned int *acrs) | 80 | static inline void save_access_regs(unsigned int *acrs) |
87 | { | 81 | { |
88 | asm volatile ("stam 0,15,0(%0)" : : "a" (acrs) : "memory" ); | 82 | asm volatile("stam 0,15,0(%0)" : : "a" (acrs) : "memory"); |
89 | } | 83 | } |
90 | 84 | ||
91 | static inline void restore_access_regs(unsigned int *acrs) | 85 | static inline void restore_access_regs(unsigned int *acrs) |
92 | { | 86 | { |
93 | asm volatile ("lam 0,15,0(%0)" : : "a" (acrs) ); | 87 | asm volatile("lam 0,15,0(%0)" : : "a" (acrs)); |
94 | } | 88 | } |
95 | 89 | ||
96 | #define switch_to(prev,next,last) do { \ | 90 | #define switch_to(prev,next,last) do { \ |
@@ -126,7 +120,7 @@ extern void account_system_vtime(struct task_struct *); | |||
126 | account_vtime(prev); \ | 120 | account_vtime(prev); \ |
127 | } while (0) | 121 | } while (0) |
128 | 122 | ||
129 | #define nop() __asm__ __volatile__ ("nop") | 123 | #define nop() asm volatile("nop") |
130 | 124 | ||
131 | #define xchg(ptr,x) \ | 125 | #define xchg(ptr,x) \ |
132 | ({ \ | 126 | ({ \ |
@@ -147,15 +141,15 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size) | |||
147 | shift = (3 ^ (addr & 3)) << 3; | 141 | shift = (3 ^ (addr & 3)) << 3; |
148 | addr ^= addr & 3; | 142 | addr ^= addr & 3; |
149 | asm volatile( | 143 | asm volatile( |
150 | " l %0,0(%4)\n" | 144 | " l %0,0(%4)\n" |
151 | "0: lr 0,%0\n" | 145 | "0: lr 0,%0\n" |
152 | " nr 0,%3\n" | 146 | " nr 0,%3\n" |
153 | " or 0,%2\n" | 147 | " or 0,%2\n" |
154 | " cs %0,0,0(%4)\n" | 148 | " cs %0,0,0(%4)\n" |
155 | " jl 0b\n" | 149 | " jl 0b\n" |
156 | : "=&d" (old), "=m" (*(int *) addr) | 150 | : "=&d" (old), "=m" (*(int *) addr) |
157 | : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), | 151 | : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), |
158 | "m" (*(int *) addr) : "memory", "cc", "0" ); | 152 | "m" (*(int *) addr) : "memory", "cc", "0"); |
159 | x = old >> shift; | 153 | x = old >> shift; |
160 | break; | 154 | break; |
161 | case 2: | 155 | case 2: |
@@ -163,36 +157,36 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size) | |||
163 | shift = (2 ^ (addr & 2)) << 3; | 157 | shift = (2 ^ (addr & 2)) << 3; |
164 | addr ^= addr & 2; | 158 | addr ^= addr & 2; |
165 | asm volatile( | 159 | asm volatile( |
166 | " l %0,0(%4)\n" | 160 | " l %0,0(%4)\n" |
167 | "0: lr 0,%0\n" | 161 | "0: lr 0,%0\n" |
168 | " nr 0,%3\n" | 162 | " nr 0,%3\n" |
169 | " or 0,%2\n" | 163 | " or 0,%2\n" |
170 | " cs %0,0,0(%4)\n" | 164 | " cs %0,0,0(%4)\n" |
171 | " jl 0b\n" | 165 | " jl 0b\n" |
172 | : "=&d" (old), "=m" (*(int *) addr) | 166 | : "=&d" (old), "=m" (*(int *) addr) |
173 | : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), | 167 | : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), |
174 | "m" (*(int *) addr) : "memory", "cc", "0" ); | 168 | "m" (*(int *) addr) : "memory", "cc", "0"); |
175 | x = old >> shift; | 169 | x = old >> shift; |
176 | break; | 170 | break; |
177 | case 4: | 171 | case 4: |
178 | asm volatile ( | 172 | asm volatile( |
179 | " l %0,0(%3)\n" | 173 | " l %0,0(%3)\n" |
180 | "0: cs %0,%2,0(%3)\n" | 174 | "0: cs %0,%2,0(%3)\n" |
181 | " jl 0b\n" | 175 | " jl 0b\n" |
182 | : "=&d" (old), "=m" (*(int *) ptr) | 176 | : "=&d" (old), "=m" (*(int *) ptr) |
183 | : "d" (x), "a" (ptr), "m" (*(int *) ptr) | 177 | : "d" (x), "a" (ptr), "m" (*(int *) ptr) |
184 | : "memory", "cc" ); | 178 | : "memory", "cc"); |
185 | x = old; | 179 | x = old; |
186 | break; | 180 | break; |
187 | #ifdef __s390x__ | 181 | #ifdef __s390x__ |
188 | case 8: | 182 | case 8: |
189 | asm volatile ( | 183 | asm volatile( |
190 | " lg %0,0(%3)\n" | 184 | " lg %0,0(%3)\n" |
191 | "0: csg %0,%2,0(%3)\n" | 185 | "0: csg %0,%2,0(%3)\n" |
192 | " jl 0b\n" | 186 | " jl 0b\n" |
193 | : "=&d" (old), "=m" (*(long *) ptr) | 187 | : "=&d" (old), "=m" (*(long *) ptr) |
194 | : "d" (x), "a" (ptr), "m" (*(long *) ptr) | 188 | : "d" (x), "a" (ptr), "m" (*(long *) ptr) |
195 | : "memory", "cc" ); | 189 | : "memory", "cc"); |
196 | x = old; | 190 | x = old; |
197 | break; | 191 | break; |
198 | #endif /* __s390x__ */ | 192 | #endif /* __s390x__ */ |
@@ -224,55 +218,55 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
224 | shift = (3 ^ (addr & 3)) << 3; | 218 | shift = (3 ^ (addr & 3)) << 3; |
225 | addr ^= addr & 3; | 219 | addr ^= addr & 3; |
226 | asm volatile( | 220 | asm volatile( |
227 | " l %0,0(%4)\n" | 221 | " l %0,0(%4)\n" |
228 | "0: nr %0,%5\n" | 222 | "0: nr %0,%5\n" |
229 | " lr %1,%0\n" | 223 | " lr %1,%0\n" |
230 | " or %0,%2\n" | 224 | " or %0,%2\n" |
231 | " or %1,%3\n" | 225 | " or %1,%3\n" |
232 | " cs %0,%1,0(%4)\n" | 226 | " cs %0,%1,0(%4)\n" |
233 | " jnl 1f\n" | 227 | " jnl 1f\n" |
234 | " xr %1,%0\n" | 228 | " xr %1,%0\n" |
235 | " nr %1,%5\n" | 229 | " nr %1,%5\n" |
236 | " jnz 0b\n" | 230 | " jnz 0b\n" |
237 | "1:" | 231 | "1:" |
238 | : "=&d" (prev), "=&d" (tmp) | 232 | : "=&d" (prev), "=&d" (tmp) |
239 | : "d" (old << shift), "d" (new << shift), "a" (ptr), | 233 | : "d" (old << shift), "d" (new << shift), "a" (ptr), |
240 | "d" (~(255 << shift)) | 234 | "d" (~(255 << shift)) |
241 | : "memory", "cc" ); | 235 | : "memory", "cc"); |
242 | return prev >> shift; | 236 | return prev >> shift; |
243 | case 2: | 237 | case 2: |
244 | addr = (unsigned long) ptr; | 238 | addr = (unsigned long) ptr; |
245 | shift = (2 ^ (addr & 2)) << 3; | 239 | shift = (2 ^ (addr & 2)) << 3; |
246 | addr ^= addr & 2; | 240 | addr ^= addr & 2; |
247 | asm volatile( | 241 | asm volatile( |
248 | " l %0,0(%4)\n" | 242 | " l %0,0(%4)\n" |
249 | "0: nr %0,%5\n" | 243 | "0: nr %0,%5\n" |
250 | " lr %1,%0\n" | 244 | " lr %1,%0\n" |
251 | " or %0,%2\n" | 245 | " or %0,%2\n" |
252 | " or %1,%3\n" | 246 | " or %1,%3\n" |
253 | " cs %0,%1,0(%4)\n" | 247 | " cs %0,%1,0(%4)\n" |
254 | " jnl 1f\n" | 248 | " jnl 1f\n" |
255 | " xr %1,%0\n" | 249 | " xr %1,%0\n" |
256 | " nr %1,%5\n" | 250 | " nr %1,%5\n" |
257 | " jnz 0b\n" | 251 | " jnz 0b\n" |
258 | "1:" | 252 | "1:" |
259 | : "=&d" (prev), "=&d" (tmp) | 253 | : "=&d" (prev), "=&d" (tmp) |
260 | : "d" (old << shift), "d" (new << shift), "a" (ptr), | 254 | : "d" (old << shift), "d" (new << shift), "a" (ptr), |
261 | "d" (~(65535 << shift)) | 255 | "d" (~(65535 << shift)) |
262 | : "memory", "cc" ); | 256 | : "memory", "cc"); |
263 | return prev >> shift; | 257 | return prev >> shift; |
264 | case 4: | 258 | case 4: |
265 | asm volatile ( | 259 | asm volatile( |
266 | " cs %0,%2,0(%3)\n" | 260 | " cs %0,%2,0(%3)\n" |
267 | : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) | 261 | : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) |
268 | : "memory", "cc" ); | 262 | : "memory", "cc"); |
269 | return prev; | 263 | return prev; |
270 | #ifdef __s390x__ | 264 | #ifdef __s390x__ |
271 | case 8: | 265 | case 8: |
272 | asm volatile ( | 266 | asm volatile( |
273 | " csg %0,%2,0(%3)\n" | 267 | " csg %0,%2,0(%3)\n" |
274 | : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) | 268 | : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) |
275 | : "memory", "cc" ); | 269 | : "memory", "cc"); |
276 | return prev; | 270 | return prev; |
277 | #endif /* __s390x__ */ | 271 | #endif /* __s390x__ */ |
278 | } | 272 | } |
@@ -289,8 +283,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
289 | * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ). | 283 | * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ). |
290 | */ | 284 | */ |
291 | 285 | ||
292 | #define eieio() __asm__ __volatile__ ( "bcr 15,0" : : : "memory" ) | 286 | #define eieio() asm volatile("bcr 15,0" : : : "memory") |
293 | # define SYNC_OTHER_CORES(x) eieio() | 287 | #define SYNC_OTHER_CORES(x) eieio() |
294 | #define mb() eieio() | 288 | #define mb() eieio() |
295 | #define rmb() eieio() | 289 | #define rmb() eieio() |
296 | #define wmb() eieio() | 290 | #define wmb() eieio() |
@@ -307,117 +301,56 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
307 | 301 | ||
308 | #ifdef __s390x__ | 302 | #ifdef __s390x__ |
309 | 303 | ||
310 | #define __ctl_load(array, low, high) ({ \ | 304 | #define __ctl_load(array, low, high) ({ \ |
311 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 305 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
312 | __asm__ __volatile__ ( \ | 306 | asm volatile( \ |
313 | " bras 1,0f\n" \ | 307 | " lctlg %1,%2,0(%0)\n" \ |
314 | " lctlg 0,0,0(%0)\n" \ | 308 | : : "a" (&array), "i" (low), "i" (high), \ |
315 | "0: ex %1,0(1)" \ | 309 | "m" (*(addrtype *)(array))); \ |
316 | : : "a" (&array), "a" (((low)<<4)+(high)), \ | ||
317 | "m" (*(addrtype *)(array)) : "1" ); \ | ||
318 | }) | 310 | }) |
319 | 311 | ||
320 | #define __ctl_store(array, low, high) ({ \ | 312 | #define __ctl_store(array, low, high) ({ \ |
321 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 313 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
322 | __asm__ __volatile__ ( \ | 314 | asm volatile( \ |
323 | " bras 1,0f\n" \ | 315 | " stctg %2,%3,0(%1)\n" \ |
324 | " stctg 0,0,0(%1)\n" \ | 316 | : "=m" (*(addrtype *)(array)) \ |
325 | "0: ex %2,0(1)" \ | 317 | : "a" (&array), "i" (low), "i" (high)); \ |
326 | : "=m" (*(addrtype *)(array)) \ | ||
327 | : "a" (&array), "a" (((low)<<4)+(high)) : "1" ); \ | ||
328 | }) | 318 | }) |
329 | 319 | ||
330 | #define __ctl_set_bit(cr, bit) ({ \ | ||
331 | __u8 __dummy[24]; \ | ||
332 | __asm__ __volatile__ ( \ | ||
333 | " bras 1,0f\n" /* skip indirect insns */ \ | ||
334 | " stctg 0,0,0(%1)\n" \ | ||
335 | " lctlg 0,0,0(%1)\n" \ | ||
336 | "0: ex %2,0(1)\n" /* execute stctl */ \ | ||
337 | " lg 0,0(%1)\n" \ | ||
338 | " ogr 0,%3\n" /* set the bit */ \ | ||
339 | " stg 0,0(%1)\n" \ | ||
340 | "1: ex %2,6(1)" /* execute lctl */ \ | ||
341 | : "=m" (__dummy) \ | ||
342 | : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \ | ||
343 | "a" (cr*17), "a" (1L<<(bit)) \ | ||
344 | : "cc", "0", "1" ); \ | ||
345 | }) | ||
346 | |||
347 | #define __ctl_clear_bit(cr, bit) ({ \ | ||
348 | __u8 __dummy[16]; \ | ||
349 | __asm__ __volatile__ ( \ | ||
350 | " bras 1,0f\n" /* skip indirect insns */ \ | ||
351 | " stctg 0,0,0(%1)\n" \ | ||
352 | " lctlg 0,0,0(%1)\n" \ | ||
353 | "0: ex %2,0(1)\n" /* execute stctl */ \ | ||
354 | " lg 0,0(%1)\n" \ | ||
355 | " ngr 0,%3\n" /* set the bit */ \ | ||
356 | " stg 0,0(%1)\n" \ | ||
357 | "1: ex %2,6(1)" /* execute lctl */ \ | ||
358 | : "=m" (__dummy) \ | ||
359 | : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \ | ||
360 | "a" (cr*17), "a" (~(1L<<(bit))) \ | ||
361 | : "cc", "0", "1" ); \ | ||
362 | }) | ||
363 | |||
364 | #else /* __s390x__ */ | 320 | #else /* __s390x__ */ |
365 | 321 | ||
366 | #define __ctl_load(array, low, high) ({ \ | 322 | #define __ctl_load(array, low, high) ({ \ |
367 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 323 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
368 | __asm__ __volatile__ ( \ | 324 | asm volatile( \ |
369 | " bras 1,0f\n" \ | 325 | " lctl %1,%2,0(%0)\n" \ |
370 | " lctl 0,0,0(%0)\n" \ | 326 | : : "a" (&array), "i" (low), "i" (high), \ |
371 | "0: ex %1,0(1)" \ | 327 | "m" (*(addrtype *)(array))); \ |
372 | : : "a" (&array), "a" (((low)<<4)+(high)), \ | 328 | }) |
373 | "m" (*(addrtype *)(array)) : "1" ); \ | ||
374 | }) | ||
375 | 329 | ||
376 | #define __ctl_store(array, low, high) ({ \ | 330 | #define __ctl_store(array, low, high) ({ \ |
377 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 331 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
378 | __asm__ __volatile__ ( \ | 332 | asm volatile( \ |
379 | " bras 1,0f\n" \ | 333 | " stctl %2,%3,0(%1)\n" \ |
380 | " stctl 0,0,0(%1)\n" \ | 334 | : "=m" (*(addrtype *)(array)) \ |
381 | "0: ex %2,0(1)" \ | 335 | : "a" (&array), "i" (low), "i" (high)); \ |
382 | : "=m" (*(addrtype *)(array)) \ | ||
383 | : "a" (&array), "a" (((low)<<4)+(high)): "1" ); \ | ||
384 | }) | 336 | }) |
385 | 337 | ||
386 | #define __ctl_set_bit(cr, bit) ({ \ | ||
387 | __u8 __dummy[16]; \ | ||
388 | __asm__ __volatile__ ( \ | ||
389 | " bras 1,0f\n" /* skip indirect insns */ \ | ||
390 | " stctl 0,0,0(%1)\n" \ | ||
391 | " lctl 0,0,0(%1)\n" \ | ||
392 | "0: ex %2,0(1)\n" /* execute stctl */ \ | ||
393 | " l 0,0(%1)\n" \ | ||
394 | " or 0,%3\n" /* set the bit */ \ | ||
395 | " st 0,0(%1)\n" \ | ||
396 | "1: ex %2,4(1)" /* execute lctl */ \ | ||
397 | : "=m" (__dummy) \ | ||
398 | : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \ | ||
399 | "a" (cr*17), "a" (1<<(bit)) \ | ||
400 | : "cc", "0", "1" ); \ | ||
401 | }) | ||
402 | |||
403 | #define __ctl_clear_bit(cr, bit) ({ \ | ||
404 | __u8 __dummy[16]; \ | ||
405 | __asm__ __volatile__ ( \ | ||
406 | " bras 1,0f\n" /* skip indirect insns */ \ | ||
407 | " stctl 0,0,0(%1)\n" \ | ||
408 | " lctl 0,0,0(%1)\n" \ | ||
409 | "0: ex %2,0(1)\n" /* execute stctl */ \ | ||
410 | " l 0,0(%1)\n" \ | ||
411 | " nr 0,%3\n" /* set the bit */ \ | ||
412 | " st 0,0(%1)\n" \ | ||
413 | "1: ex %2,4(1)" /* execute lctl */ \ | ||
414 | : "=m" (__dummy) \ | ||
415 | : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \ | ||
416 | "a" (cr*17), "a" (~(1<<(bit))) \ | ||
417 | : "cc", "0", "1" ); \ | ||
418 | }) | ||
419 | #endif /* __s390x__ */ | 338 | #endif /* __s390x__ */ |
420 | 339 | ||
340 | #define __ctl_set_bit(cr, bit) ({ \ | ||
341 | unsigned long __dummy; \ | ||
342 | __ctl_store(__dummy, cr, cr); \ | ||
343 | __dummy |= 1UL << (bit); \ | ||
344 | __ctl_load(__dummy, cr, cr); \ | ||
345 | }) | ||
346 | |||
347 | #define __ctl_clear_bit(cr, bit) ({ \ | ||
348 | unsigned long __dummy; \ | ||
349 | __ctl_store(__dummy, cr, cr); \ | ||
350 | __dummy &= ~(1UL << (bit)); \ | ||
351 | __ctl_load(__dummy, cr, cr); \ | ||
352 | }) | ||
353 | |||
421 | #include <linux/irqflags.h> | 354 | #include <linux/irqflags.h> |
422 | 355 | ||
423 | /* | 356 | /* |
@@ -427,8 +360,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
427 | static inline void | 360 | static inline void |
428 | __set_psw_mask(unsigned long mask) | 361 | __set_psw_mask(unsigned long mask) |
429 | { | 362 | { |
430 | local_save_flags(mask); | 363 | __load_psw_mask(mask | (__raw_local_irq_stosm(0x00) & ~(-1UL >> 8))); |
431 | __load_psw_mask(mask); | ||
432 | } | 364 | } |
433 | 365 | ||
434 | #define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS) | 366 | #define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS) |
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h index 5d0332a4c2bd..4df4a41029a3 100644 --- a/include/asm-s390/timex.h +++ b/include/asm-s390/timex.h | |||
@@ -15,20 +15,21 @@ | |||
15 | 15 | ||
16 | typedef unsigned long long cycles_t; | 16 | typedef unsigned long long cycles_t; |
17 | 17 | ||
18 | static inline cycles_t get_cycles(void) | ||
19 | { | ||
20 | cycles_t cycles; | ||
21 | |||
22 | __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); | ||
23 | return cycles >> 2; | ||
24 | } | ||
25 | |||
26 | static inline unsigned long long get_clock (void) | 18 | static inline unsigned long long get_clock (void) |
27 | { | 19 | { |
28 | unsigned long long clk; | 20 | unsigned long long clk; |
29 | 21 | ||
30 | __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); | 22 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
23 | asm volatile("stck %0" : "=Q" (clk) : : "cc"); | ||
24 | #else /* __GNUC__ */ | ||
25 | asm volatile("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); | ||
26 | #endif /* __GNUC__ */ | ||
31 | return clk; | 27 | return clk; |
32 | } | 28 | } |
33 | 29 | ||
30 | static inline cycles_t get_cycles(void) | ||
31 | { | ||
32 | return (cycles_t) get_clock() >> 2; | ||
33 | } | ||
34 | |||
34 | #endif | 35 | #endif |
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h index 73cd85bebfb2..fa4dc916a9bf 100644 --- a/include/asm-s390/tlbflush.h +++ b/include/asm-s390/tlbflush.h | |||
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define local_flush_tlb() \ | 27 | #define local_flush_tlb() \ |
28 | do { __asm__ __volatile__("ptlb": : :"memory"); } while (0) | 28 | do { asm volatile("ptlb": : :"memory"); } while (0) |
29 | 29 | ||
30 | #ifndef CONFIG_SMP | 30 | #ifndef CONFIG_SMP |
31 | 31 | ||
@@ -68,24 +68,24 @@ extern void smp_ptlb_all(void); | |||
68 | 68 | ||
69 | static inline void global_flush_tlb(void) | 69 | static inline void global_flush_tlb(void) |
70 | { | 70 | { |
71 | register unsigned long reg2 asm("2"); | ||
72 | register unsigned long reg3 asm("3"); | ||
73 | register unsigned long reg4 asm("4"); | ||
74 | long dummy; | ||
75 | |||
71 | #ifndef __s390x__ | 76 | #ifndef __s390x__ |
72 | if (!MACHINE_HAS_CSP) { | 77 | if (!MACHINE_HAS_CSP) { |
73 | smp_ptlb_all(); | 78 | smp_ptlb_all(); |
74 | return; | 79 | return; |
75 | } | 80 | } |
76 | #endif /* __s390x__ */ | 81 | #endif /* __s390x__ */ |
77 | { | 82 | |
78 | register unsigned long addr asm("4"); | 83 | dummy = 0; |
79 | long dummy; | 84 | reg2 = reg3 = 0; |
80 | 85 | reg4 = ((unsigned long) &dummy) + 1; | |
81 | dummy = 0; | 86 | asm volatile( |
82 | addr = ((unsigned long) &dummy) + 1; | 87 | " csp %0,%2" |
83 | __asm__ __volatile__ ( | 88 | : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); |
84 | " slr 2,2\n" | ||
85 | " slr 3,3\n" | ||
86 | " csp 2,%0" | ||
87 | : : "a" (addr), "m" (dummy) : "cc", "2", "3" ); | ||
88 | } | ||
89 | } | 89 | } |
90 | 90 | ||
91 | /* | 91 | /* |
@@ -102,9 +102,9 @@ static inline void __flush_tlb_mm(struct mm_struct * mm) | |||
102 | if (unlikely(cpus_empty(mm->cpu_vm_mask))) | 102 | if (unlikely(cpus_empty(mm->cpu_vm_mask))) |
103 | return; | 103 | return; |
104 | if (MACHINE_HAS_IDTE) { | 104 | if (MACHINE_HAS_IDTE) { |
105 | asm volatile (".insn rrf,0xb98e0000,0,%0,%1,0" | 105 | asm volatile( |
106 | : : "a" (2048), | 106 | " .insn rrf,0xb98e0000,0,%0,%1,0" |
107 | "a" (__pa(mm->pgd)&PAGE_MASK) : "cc" ); | 107 | : : "a" (2048), "a" (__pa(mm->pgd)&PAGE_MASK) : "cc"); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | preempt_disable(); | 110 | preempt_disable(); |
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index e2047b0c9092..72ae4efddb49 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h | |||
@@ -38,25 +38,14 @@ | |||
38 | #define get_ds() (KERNEL_DS) | 38 | #define get_ds() (KERNEL_DS) |
39 | #define get_fs() (current->thread.mm_segment) | 39 | #define get_fs() (current->thread.mm_segment) |
40 | 40 | ||
41 | #ifdef __s390x__ | ||
42 | #define set_fs(x) \ | 41 | #define set_fs(x) \ |
43 | ({ \ | 42 | ({ \ |
44 | unsigned long __pto; \ | 43 | unsigned long __pto; \ |
45 | current->thread.mm_segment = (x); \ | 44 | current->thread.mm_segment = (x); \ |
46 | __pto = current->thread.mm_segment.ar4 ? \ | 45 | __pto = current->thread.mm_segment.ar4 ? \ |
47 | S390_lowcore.user_asce : S390_lowcore.kernel_asce; \ | 46 | S390_lowcore.user_asce : S390_lowcore.kernel_asce; \ |
48 | asm volatile ("lctlg 7,7,%0" : : "m" (__pto) ); \ | 47 | __ctl_load(__pto, 7, 7); \ |
49 | }) | 48 | }) |
50 | #else /* __s390x__ */ | ||
51 | #define set_fs(x) \ | ||
52 | ({ \ | ||
53 | unsigned long __pto; \ | ||
54 | current->thread.mm_segment = (x); \ | ||
55 | __pto = current->thread.mm_segment.ar4 ? \ | ||
56 | S390_lowcore.user_asce : S390_lowcore.kernel_asce; \ | ||
57 | asm volatile ("lctl 7,7,%0" : : "m" (__pto) ); \ | ||
58 | }) | ||
59 | #endif /* __s390x__ */ | ||
60 | 49 | ||
61 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) | 50 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) |
62 | 51 | ||
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index d49c54cb5505..0361ac5dcde3 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -355,145 +355,145 @@ do { \ | |||
355 | 355 | ||
356 | #define _svc_clobber "1", "cc", "memory" | 356 | #define _svc_clobber "1", "cc", "memory" |
357 | 357 | ||
358 | #define _syscall0(type,name) \ | 358 | #define _syscall0(type,name) \ |
359 | type name(void) { \ | 359 | type name(void) { \ |
360 | register long __svcres asm("2"); \ | 360 | register long __svcres asm("2"); \ |
361 | long __res; \ | 361 | long __res; \ |
362 | __asm__ __volatile__ ( \ | 362 | asm volatile( \ |
363 | " .if %1 < 256\n" \ | 363 | " .if %1 < 256\n" \ |
364 | " svc %b1\n" \ | 364 | " svc %b1\n" \ |
365 | " .else\n" \ | 365 | " .else\n" \ |
366 | " la %%r1,%1\n" \ | 366 | " la %%r1,%1\n" \ |
367 | " svc 0\n" \ | 367 | " svc 0\n" \ |
368 | " .endif" \ | 368 | " .endif" \ |
369 | : "=d" (__svcres) \ | 369 | : "=d" (__svcres) \ |
370 | : "i" (__NR_##name) \ | 370 | : "i" (__NR_##name) \ |
371 | : _svc_clobber ); \ | 371 | : _svc_clobber); \ |
372 | __res = __svcres; \ | 372 | __res = __svcres; \ |
373 | __syscall_return(type,__res); \ | 373 | __syscall_return(type,__res); \ |
374 | } | 374 | } |
375 | 375 | ||
376 | #define _syscall1(type,name,type1,arg1) \ | 376 | #define _syscall1(type,name,type1,arg1) \ |
377 | type name(type1 arg1) { \ | 377 | type name(type1 arg1) { \ |
378 | register type1 __arg1 asm("2") = arg1; \ | 378 | register type1 __arg1 asm("2") = arg1; \ |
379 | register long __svcres asm("2"); \ | 379 | register long __svcres asm("2"); \ |
380 | long __res; \ | 380 | long __res; \ |
381 | __asm__ __volatile__ ( \ | 381 | asm volatile( \ |
382 | " .if %1 < 256\n" \ | 382 | " .if %1 < 256\n" \ |
383 | " svc %b1\n" \ | 383 | " svc %b1\n" \ |
384 | " .else\n" \ | 384 | " .else\n" \ |
385 | " la %%r1,%1\n" \ | 385 | " la %%r1,%1\n" \ |
386 | " svc 0\n" \ | 386 | " svc 0\n" \ |
387 | " .endif" \ | 387 | " .endif" \ |
388 | : "=d" (__svcres) \ | 388 | : "=d" (__svcres) \ |
389 | : "i" (__NR_##name), \ | 389 | : "i" (__NR_##name), \ |
390 | "0" (__arg1) \ | 390 | "0" (__arg1) \ |
391 | : _svc_clobber ); \ | 391 | : _svc_clobber); \ |
392 | __res = __svcres; \ | 392 | __res = __svcres; \ |
393 | __syscall_return(type,__res); \ | 393 | __syscall_return(type,__res); \ |
394 | } | 394 | } |
395 | 395 | ||
396 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | 396 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ |
397 | type name(type1 arg1, type2 arg2) { \ | 397 | type name(type1 arg1, type2 arg2) { \ |
398 | register type1 __arg1 asm("2") = arg1; \ | 398 | register type1 __arg1 asm("2") = arg1; \ |
399 | register type2 __arg2 asm("3") = arg2; \ | 399 | register type2 __arg2 asm("3") = arg2; \ |
400 | register long __svcres asm("2"); \ | 400 | register long __svcres asm("2"); \ |
401 | long __res; \ | 401 | long __res; \ |
402 | __asm__ __volatile__ ( \ | 402 | asm volatile( \ |
403 | " .if %1 < 256\n" \ | 403 | " .if %1 < 256\n" \ |
404 | " svc %b1\n" \ | 404 | " svc %b1\n" \ |
405 | " .else\n" \ | 405 | " .else\n" \ |
406 | " la %%r1,%1\n" \ | 406 | " la %%r1,%1\n" \ |
407 | " svc 0\n" \ | 407 | " svc 0\n" \ |
408 | " .endif" \ | 408 | " .endif" \ |
409 | : "=d" (__svcres) \ | 409 | : "=d" (__svcres) \ |
410 | : "i" (__NR_##name), \ | 410 | : "i" (__NR_##name), \ |
411 | "0" (__arg1), \ | 411 | "0" (__arg1), \ |
412 | "d" (__arg2) \ | 412 | "d" (__arg2) \ |
413 | : _svc_clobber ); \ | 413 | : _svc_clobber ); \ |
414 | __res = __svcres; \ | 414 | __res = __svcres; \ |
415 | __syscall_return(type,__res); \ | 415 | __syscall_return(type,__res); \ |
416 | } | 416 | } |
417 | 417 | ||
418 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)\ | 418 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ |
419 | type name(type1 arg1, type2 arg2, type3 arg3) { \ | 419 | type name(type1 arg1, type2 arg2, type3 arg3) { \ |
420 | register type1 __arg1 asm("2") = arg1; \ | 420 | register type1 __arg1 asm("2") = arg1; \ |
421 | register type2 __arg2 asm("3") = arg2; \ | 421 | register type2 __arg2 asm("3") = arg2; \ |
422 | register type3 __arg3 asm("4") = arg3; \ | 422 | register type3 __arg3 asm("4") = arg3; \ |
423 | register long __svcres asm("2"); \ | 423 | register long __svcres asm("2"); \ |
424 | long __res; \ | 424 | long __res; \ |
425 | __asm__ __volatile__ ( \ | 425 | asm volatile( \ |
426 | " .if %1 < 256\n" \ | 426 | " .if %1 < 256\n" \ |
427 | " svc %b1\n" \ | 427 | " svc %b1\n" \ |
428 | " .else\n" \ | 428 | " .else\n" \ |
429 | " la %%r1,%1\n" \ | 429 | " la %%r1,%1\n" \ |
430 | " svc 0\n" \ | 430 | " svc 0\n" \ |
431 | " .endif" \ | 431 | " .endif" \ |
432 | : "=d" (__svcres) \ | 432 | : "=d" (__svcres) \ |
433 | : "i" (__NR_##name), \ | 433 | : "i" (__NR_##name), \ |
434 | "0" (__arg1), \ | 434 | "0" (__arg1), \ |
435 | "d" (__arg2), \ | 435 | "d" (__arg2), \ |
436 | "d" (__arg3) \ | 436 | "d" (__arg3) \ |
437 | : _svc_clobber ); \ | 437 | : _svc_clobber); \ |
438 | __res = __svcres; \ | 438 | __res = __svcres; \ |
439 | __syscall_return(type,__res); \ | 439 | __syscall_return(type,__res); \ |
440 | } | 440 | } |
441 | 441 | ||
442 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,\ | 442 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3, \ |
443 | type4,name4) \ | 443 | type4,name4) \ |
444 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ | 444 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ |
445 | register type1 __arg1 asm("2") = arg1; \ | 445 | register type1 __arg1 asm("2") = arg1; \ |
446 | register type2 __arg2 asm("3") = arg2; \ | 446 | register type2 __arg2 asm("3") = arg2; \ |
447 | register type3 __arg3 asm("4") = arg3; \ | 447 | register type3 __arg3 asm("4") = arg3; \ |
448 | register type4 __arg4 asm("5") = arg4; \ | 448 | register type4 __arg4 asm("5") = arg4; \ |
449 | register long __svcres asm("2"); \ | 449 | register long __svcres asm("2"); \ |
450 | long __res; \ | 450 | long __res; \ |
451 | __asm__ __volatile__ ( \ | 451 | asm volatile( \ |
452 | " .if %1 < 256\n" \ | 452 | " .if %1 < 256\n" \ |
453 | " svc %b1\n" \ | 453 | " svc %b1\n" \ |
454 | " .else\n" \ | 454 | " .else\n" \ |
455 | " la %%r1,%1\n" \ | 455 | " la %%r1,%1\n" \ |
456 | " svc 0\n" \ | 456 | " svc 0\n" \ |
457 | " .endif" \ | 457 | " .endif" \ |
458 | : "=d" (__svcres) \ | 458 | : "=d" (__svcres) \ |
459 | : "i" (__NR_##name), \ | 459 | : "i" (__NR_##name), \ |
460 | "0" (__arg1), \ | 460 | "0" (__arg1), \ |
461 | "d" (__arg2), \ | 461 | "d" (__arg2), \ |
462 | "d" (__arg3), \ | 462 | "d" (__arg3), \ |
463 | "d" (__arg4) \ | 463 | "d" (__arg4) \ |
464 | : _svc_clobber ); \ | 464 | : _svc_clobber); \ |
465 | __res = __svcres; \ | 465 | __res = __svcres; \ |
466 | __syscall_return(type,__res); \ | 466 | __syscall_return(type,__res); \ |
467 | } | 467 | } |
468 | 468 | ||
469 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,\ | 469 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3, \ |
470 | type4,name4,type5,name5) \ | 470 | type4,name4,type5,name5) \ |
471 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ | 471 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ |
472 | type5 arg5) { \ | 472 | type5 arg5) { \ |
473 | register type1 __arg1 asm("2") = arg1; \ | 473 | register type1 __arg1 asm("2") = arg1; \ |
474 | register type2 __arg2 asm("3") = arg2; \ | 474 | register type2 __arg2 asm("3") = arg2; \ |
475 | register type3 __arg3 asm("4") = arg3; \ | 475 | register type3 __arg3 asm("4") = arg3; \ |
476 | register type4 __arg4 asm("5") = arg4; \ | 476 | register type4 __arg4 asm("5") = arg4; \ |
477 | register type5 __arg5 asm("6") = arg5; \ | 477 | register type5 __arg5 asm("6") = arg5; \ |
478 | register long __svcres asm("2"); \ | 478 | register long __svcres asm("2"); \ |
479 | long __res; \ | 479 | long __res; \ |
480 | __asm__ __volatile__ ( \ | 480 | asm volatile( \ |
481 | " .if %1 < 256\n" \ | 481 | " .if %1 < 256\n" \ |
482 | " svc %b1\n" \ | 482 | " svc %b1\n" \ |
483 | " .else\n" \ | 483 | " .else\n" \ |
484 | " la %%r1,%1\n" \ | 484 | " la %%r1,%1\n" \ |
485 | " svc 0\n" \ | 485 | " svc 0\n" \ |
486 | " .endif" \ | 486 | " .endif" \ |
487 | : "=d" (__svcres) \ | 487 | : "=d" (__svcres) \ |
488 | : "i" (__NR_##name), \ | 488 | : "i" (__NR_##name), \ |
489 | "0" (__arg1), \ | 489 | "0" (__arg1), \ |
490 | "d" (__arg2), \ | 490 | "d" (__arg2), \ |
491 | "d" (__arg3), \ | 491 | "d" (__arg3), \ |
492 | "d" (__arg4), \ | 492 | "d" (__arg4), \ |
493 | "d" (__arg5) \ | 493 | "d" (__arg5) \ |
494 | : _svc_clobber ); \ | 494 | : _svc_clobber); \ |
495 | __res = __svcres; \ | 495 | __res = __svcres; \ |
496 | __syscall_return(type,__res); \ | 496 | __syscall_return(type,__res); \ |
497 | } | 497 | } |
498 | 498 | ||
499 | #define __ARCH_WANT_IPC_PARSE_VERSION | 499 | #define __ARCH_WANT_IPC_PARSE_VERSION |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ba095aebedff..587264a58d56 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -85,6 +85,8 @@ struct mmc_host { | |||
85 | unsigned long caps; /* Host capabilities */ | 85 | unsigned long caps; /* Host capabilities */ |
86 | 86 | ||
87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
88 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ | ||
89 | #define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ | ||
88 | 90 | ||
89 | /* host specific block data */ | 91 | /* host specific block data */ |
90 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 92 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 627e2c08ce41..a3594dfd6963 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -68,7 +68,6 @@ struct mmc_command { | |||
68 | struct mmc_data { | 68 | struct mmc_data { |
69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | 69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ |
70 | unsigned int timeout_clks; /* data timeout (in clocks) */ | 70 | unsigned int timeout_clks; /* data timeout (in clocks) */ |
71 | unsigned int blksz_bits; /* data block size */ | ||
72 | unsigned int blksz; /* data block size */ | 71 | unsigned int blksz; /* data block size */ |
73 | unsigned int blocks; /* number of blocks */ | 72 | unsigned int blocks; /* number of blocks */ |
74 | unsigned int error; /* data error */ | 73 | unsigned int error; /* data error */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ab032ceafa84..61db1907f06f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -479,6 +479,7 @@ | |||
479 | 479 | ||
480 | #define PCI_VENDOR_ID_AMD 0x1022 | 480 | #define PCI_VENDOR_ID_AMD 0x1022 |
481 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 | 481 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 |
482 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | ||
482 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 483 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
483 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 484 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
484 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 485 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 0da15b0b02be..190cc1b78fe2 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -380,10 +380,10 @@ struct usb_device { | |||
380 | int maxchild; /* Number of ports if hub */ | 380 | int maxchild; /* Number of ports if hub */ |
381 | struct usb_device *children[USB_MAXCHILDREN]; | 381 | struct usb_device *children[USB_MAXCHILDREN]; |
382 | 382 | ||
383 | int pm_usage_cnt; /* usage counter for autosuspend */ | ||
383 | #ifdef CONFIG_PM | 384 | #ifdef CONFIG_PM |
384 | struct work_struct autosuspend; /* for delayed autosuspends */ | 385 | struct work_struct autosuspend; /* for delayed autosuspends */ |
385 | struct mutex pm_mutex; /* protects PM operations */ | 386 | struct mutex pm_mutex; /* protects PM operations */ |
386 | int pm_usage_cnt; /* usage counter for autosuspend */ | ||
387 | 387 | ||
388 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | 388 | unsigned auto_pm:1; /* autosuspend/resume in progress */ |
389 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | 389 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ |